Linux spg1.cloudpowerdns.com 5.14.0-611.34.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 18 05:51:10 EST 2026 x86_64
LiteSpeed
Server IP : 176.9.63.151 & Your IP : 216.73.217.60
Domains :
Cant Read [ /etc/named.conf ]
User : fastear1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
fastear1 /
.trash /
Delete
Unzip
Name
Size
Permission
Date
Action
.well-known
[ DIR ]
drwxr-xr-x
2025-09-15 16:52
DB
[ DIR ]
drwxr-xr-x
2024-01-26 18:47
Documentation
[ DIR ]
drwxr-xr-x
2025-08-31 15:59
Documentation.1
[ DIR ]
drwxr-xr-x
2025-10-30 18:23
FASTEARNADS
[ DIR ]
drwxr-xr-x
2025-09-15 19:14
Files
[ DIR ]
drwxr-xr-x
2025-10-30 18:23
admin
[ DIR ]
drwxr-xr-x
2025-10-18 00:49
admin.1
[ DIR ]
drwxr-xr-x
2025-10-17 21:15
admin.2
[ DIR ]
drwxr-xr-x
2025-10-18 21:54
app
[ DIR ]
drwxr-xr-x
2025-09-15 01:54
asset
[ DIR ]
drwxr-xr-x
2024-01-15 11:35
assets
[ DIR ]
drwxr--r--
2025-10-18 01:49
assets.1
[ DIR ]
drwxr--r--
2025-10-18 02:06
assets.2
[ DIR ]
drwxr-xr-x
2025-10-17 23:09
assets.3
[ DIR ]
drwxr--r--
2025-10-18 02:13
assets.4
[ DIR ]
drwxr-xr-x
2025-10-18 21:42
bootstrap
[ DIR ]
drwxr-xr-x
2025-09-15 21:09
cgi-bin
[ DIR ]
drwxr-xr-x
2025-08-31 15:33
cgi-bin.1
[ DIR ]
drwxr-xr-x
2025-11-14 14:25
cgi-bin.2
[ DIR ]
drwxr-xr-x
2026-03-06 11:21
core
[ DIR ]
drwxr-xr-x
2025-11-21 11:34
core.1
[ DIR ]
drwxr-xr-x
2025-11-21 15:51
data sycho
[ DIR ]
drwxr-xr-x
2026-03-18 10:25
database
[ DIR ]
drwxr-xr-x
2025-09-15 01:47
db
[ DIR ]
drwxr-xr-x
2025-10-17 23:00
db.1
[ DIR ]
drwxr-xr-x
2025-10-17 21:15
debug.php
[ DIR ]
drwxr-xr-x
2026-03-13 16:15
deployment_package
[ DIR ]
drwxr-xr-x
2025-10-18 02:05
deployment_package.1
[ DIR ]
drwxr-xr-x
2025-10-17 21:15
earnonline
[ DIR ]
drwxr-xr-x
2025-10-18 17:55
includes
[ DIR ]
drwxr-xr-x
2025-10-17 21:12
includes.1
[ DIR ]
drwxr-xr-x
2025-10-17 21:15
includes.2
[ DIR ]
drwxr-xr-x
2025-10-18 21:40
loading
[ DIR ]
drwxr-xr-x
2025-01-23 07:37
public
[ DIR ]
drwxr-xr-x
2025-09-15 19:19
resources
[ DIR ]
drwxr-xr-x
2025-09-15 01:28
routes
[ DIR ]
drwxr-xr-x
2025-09-15 21:08
serive
[ DIR ]
drwxr-xr-x
2024-10-22 19:23
shearearn
[ DIR ]
drwxr-xr-x
2025-10-17 21:12
storage
[ DIR ]
drwxr-xr-x
2025-09-15 01:56
uploads
[ DIR ]
drwxr--r--
2025-10-18 01:49
uploads.1
[ DIR ]
drwxr--r--
2025-10-18 02:06
uploads.2
[ DIR ]
drwxr-xr-x
2025-10-17 23:08
uploads.3
[ DIR ]
drwxr--r--
2025-10-18 02:13
user
[ DIR ]
drwxr-xr-x
2025-10-17 23:42
user.1
[ DIR ]
drwxr-xr-x
2025-10-17 21:15
user.2
[ DIR ]
drwxr-xr-x
2025-10-18 22:14
vendor
[ DIR ]
drwxr-xr-x
2025-09-15 01:53
.env
1.2
KB
-rw-r--r--
2025-09-15 19:24
.env.example
1.19
KB
-rw-r--r--
2025-09-15 01:27
.htaccess
281
B
-rw-r--r--
2025-09-15 16:51
.htaccess.1
1.08
KB
-rw-r--r--
2025-10-18 21:45
.htaccess.2
913
B
-rw-r--r--
2023-12-27 04:45
.htaccess.3
281
B
-rw-r--r--
2025-12-23 09:40
.htaccess.4
1.38
KB
-rw-r--r--
2025-12-23 09:40
.htaccess.5
812
B
-rw-r--r--
2025-12-23 09:40
.htaccess.6
281
B
-rw-r--r--
2026-02-22 15:25
.htaccess.7
5.15
KB
-rw-r--r--
2025-12-23 09:40
.htaccess.8
1.02
KB
-rw-r--r--
2025-12-23 09:40
.htaccess.9
281
B
-rw-r--r--
2025-12-23 09:40
.trash_restore
11.24
KB
-rw-------
2026-03-30 15:07
.well-known_2.zip
66.1
MB
-rw-r--r--
2025-07-10 15:10
.well-known_3.zip
69.98
MB
-rw-r--r--
2025-07-18 07:02
6clube by Tha_perfect_provider (1).zip
67.84
MB
-rw-r--r--
2025-11-21 12:25
DEPLOYMENT_INSTRUCTIONS.md
3.05
KB
-rw-r--r--
2025-10-18 01:48
FASTEARNADS.zip
26.04
MB
-rw-r--r--
2025-09-15 19:10
FIX_DUPLICATE_COMMISSIONS.md
3.63
KB
-rw-r--r--
2025-10-18 00:32
FIX_DUPLICATE_COMMISSIONS.md.1
3.63
KB
-rw-r--r--
2025-10-18 00:32
FIX_USER_EDIT_ISSUE.md
6.15
KB
-rw-r--r--
2025-10-18 00:44
FIX_USER_EDIT_ISSUE.md.1
6.15
KB
-rw-r--r--
2025-10-18 00:44
Hyipe rio_2.zip
56.84
MB
-rw-r--r--
2025-08-31 15:56
IMPROVEMENTS_SUMMARY.md
4.11
KB
-rw-r--r--
2025-10-18 00:40
IMPROVEMENTS_SUMMARY.md.1
4.11
KB
-rw-r--r--
2025-10-18 00:40
MRby91club.sql
32.58
MB
-rw-r--r--
2025-11-09 05:09
MRby91club.zip
58.89
MB
-rw-r--r--
2025-11-09 05:09
PropLab v1.0 Nulled.zip
67.55
MB
-rw-r--r--
2025-11-21 11:36
README.md
6.77
KB
-rw-r--r--
2025-09-15 01:24
README.md.1
3.01
KB
-rw-r--r--
2025-10-18 21:46
README.txt
2.34
KB
-rw-r--r--
2025-10-17 23:08
README.txt.1
2.34
KB
-rw-r--r--
2025-10-17 23:08
README_DEPLOYMENT.txt
1.74
KB
-rw-r--r--
2025-10-18 01:49
README_REFERRAL_COMMISSIONS.md
4.02
KB
-rw-r--r--
2025-10-18 00:22
README_REFERRAL_COMMISSIONS.md.1
4.02
KB
-rw-r--r--
2025-10-18 00:22
SQL_CHANGES_SUMMARY.md
2.02
KB
-rw-r--r--
2025-10-18 00:25
SQL_CHANGES_SUMMARY.md.1
2.02
KB
-rw-r--r--
2025-10-18 00:25
Vinance-Digital-Trading-Platform-V2.7[www.shop.softbdteam.com].zip
39.3
MB
-rw-r--r--
2025-11-28 16:01
apply_database_fixes.php
5.17
KB
-rw-r--r--
2025-10-18 00:39
apply_database_fixes.php.1
5.17
KB
-rw-r--r--
2025-10-18 00:39
artisan
1.7
KB
-rw-r--r--
2025-09-15 01:54
check_commission_levels.php
3.16
KB
-rw-r--r--
2025-10-18 00:53
check_commission_levels.php.1
3.16
KB
-rw-r--r--
2025-10-18 00:53
check_database_structure.php
3.9
KB
-rw-r--r--
2025-10-18 00:55
check_database_structure.php.1
3.9
KB
-rw-r--r--
2025-10-18 00:55
check_duplicate_commissions.php
4.38
KB
-rw-r--r--
2025-10-18 00:32
check_duplicate_commissions.php.1
4.38
KB
-rw-r--r--
2025-10-18 00:32
check_referrals_table.php
2.28
KB
-rw-r--r--
2025-10-18 00:39
check_referrals_table.php.1
2.28
KB
-rw-r--r--
2025-10-18 00:39
complete_setup.sql
5.34
KB
-rw-r--r--
2025-10-18 00:25
complete_setup.sql.1
5.34
KB
-rw-r--r--
2025-10-18 00:25
complete_setup_for_import.sql
5.36
KB
-rw-r--r--
2025-10-18 01:59
complete_setup_for_import.sql.1
5.36
KB
-rw-r--r--
2025-10-18 01:59
composer.json
1.83
KB
-rw-r--r--
2025-09-15 01:27
composer.lock
294.45
KB
-rw-r--r--
2025-09-15 01:52
config.php
2.63
KB
-rw-r--r--
2025-10-18 17:56
crazydeveloperbd_auto-ptc.sql
320.06
KB
-rw-r--r--
2025-02-03 11:56
crazydeveloperbd_auto-ptc.sql.1
320.06
KB
-rw-r--r--
2025-02-03 11:56
create_table_direct.php
3.44
KB
-rw-r--r--
2025-10-18 00:09
create_table_direct.php.1
3.44
KB
-rw-r--r--
2025-10-18 00:09
css_test.php
999
B
-rw-r--r--
2025-10-18 02:06
data sycho.1
0
B
-rw-r--r--
2026-03-18 10:25
database.sql
13.77
KB
-rw-r--r--
2025-10-18 22:24
debug_referral_chain.php
6.88
KB
-rw-r--r--
2025-10-18 00:54
debug_referral_chain.php.1
6.88
KB
-rw-r--r--
2025-10-18 00:54
demo-enhanced.html
45.46
KB
-rw-r--r--
2025-09-15 01:43
earnonline.zip
88.67
KB
-rw-r--r--
2025-10-18 17:55
error.php
3.84
KB
-rw-r--r--
2025-10-18 21:45
error_log
488
B
-rw-r--r--
2025-07-04 21:02
error_log.1
37.29
KB
-rw-r--r--
2025-11-21 16:03
favicon.png
2.71
KB
-rw-r--r--
2025-06-07 20:15
favicon.png.1
6.62
KB
-rw-r--r--
2022-08-31 22:45
favicon.png.2
50.48
KB
-rw-r--r--
2025-07-18 10:14
favicon.png.3
2.21
KB
-rw-r--r--
2025-07-18 10:19
fix_css_paths.bat
1.85
KB
-rw-r--r--
2025-10-18 02:06
fix_duplicate_commissions.php
2.67
KB
-rw-r--r--
2025-10-18 00:31
fix_duplicate_commissions.php.1
2.67
KB
-rw-r--r--
2025-10-18 00:31
fix_referral_commissions.sql
677
B
-rw-r--r--
2025-10-18 00:25
fix_referral_commissions.sql.1
677
B
-rw-r--r--
2025-10-18 00:25
fix_referral_commissions_for_import.sql
705
B
-rw-r--r--
2025-10-18 01:59
fix_referral_commissions_for_import.sql.1
705
B
-rw-r--r--
2025-10-18 01:59
index-8df9a8d8.js
1.09
MB
-rw-r--r--
2026-03-18 15:16
index.php
25.73
KB
-rw-r--r--
2025-10-18 01:40
index.php.1
26.17
KB
-rw-r--r--
2025-10-18 02:11
index.php.2
23.31
KB
-rw-r--r--
2025-10-18 22:32
index.php.3
1.77
KB
-rw-r--r--
2023-12-27 04:45
index.php.backup
25.74
KB
-rw-r--r--
2025-10-18 02:05
index_professional.php
26.17
KB
-rw-r--r--
2025-10-18 02:12
index_with_css_fix.php
25.82
KB
-rw-r--r--
2025-10-18 02:06
login.php
4.14
KB
-rw-r--r--
2025-10-17 23:09
login.php.1
4.15
KB
-rw-r--r--
2025-10-18 02:12
logo.png
18.18
KB
-rw-r--r--
2025-06-07 20:15
logo.png.1
46.68
KB
-rw-r--r--
2025-07-18 10:12
logo.png.2
46.68
KB
-rw-r--r--
2025-07-18 10:11
logo.png.3
920.77
KB
-rw-r--r--
2023-07-01 15:03
logout.php
88
B
-rw-r--r--
2025-10-17 23:02
logout.php.1
88
B
-rw-r--r--
2025-10-17 23:02
mailer.php
10.16
KB
-rw-r--r--
2026-03-30 14:45
mobile-demo.html
23.36
KB
-rw-r--r--
2025-09-15 01:32
register.php
6.57
KB
-rw-r--r--
2025-10-17 23:09
register.php.1
6.58
KB
-rw-r--r--
2025-10-18 02:12
run_setup.bat
714
B
-rw-r--r--
2025-10-18 00:23
run_setup.bat.1
714
B
-rw-r--r--
2025-10-18 00:23
servertime.php
128
B
-rw-r--r--
2024-09-27 12:16
setup_referral_commissions.php
2.73
KB
-rw-r--r--
2025-10-18 00:21
setup_referral_commissions.php.1
2.73
KB
-rw-r--r--
2025-10-18 00:21
shearearn.zip
3.2
MB
-rw-r--r--
2025-10-17 21:11
test.html
203
B
-rw-r--r--
2025-10-17 23:16
test.php
59
B
-rw-r--r--
2025-10-17 23:16
test.php.1
59
B
-rw-r--r--
2025-10-17 23:16
test_commission_application.php
6.93
KB
-rw-r--r--
2025-10-18 00:55
test_commission_application.php.1
6.93
KB
-rw-r--r--
2025-10-18 00:55
test_commission_display.php
3.26
KB
-rw-r--r--
2025-10-18 00:19
test_commission_display.php.1
3.26
KB
-rw-r--r--
2025-10-18 00:19
test_commission_fix.php
3.16
KB
-rw-r--r--
2025-10-18 00:39
test_commission_fix.php.1
3.16
KB
-rw-r--r--
2025-10-18 00:39
test_mobile_menu.php
2.73
KB
-rw-r--r--
2025-10-18 01:24
test_mobile_menu.php.1
2.73
KB
-rw-r--r--
2025-10-18 01:24
test_referral.php
2.07
KB
-rw-r--r--
2025-10-17 23:55
test_referral.php.1
2.07
KB
-rw-r--r--
2025-10-17 23:55
tradex (1).sql
189.14
KB
-rw-r--r--
2025-11-21 15:51
update_referral_commissions.sql
682
B
-rw-r--r--
2025-10-18 00:25
update_referral_commissions.sql.1
682
B
-rw-r--r--
2025-10-18 00:25
update_referral_commissions_for_import.sql
710
B
-rw-r--r--
2025-10-18 01:59
update_referral_commissions_for_import.sql.1
710
B
-rw-r--r--
2025-10-18 01:59
update_referrals_table.sql
398
B
-rw-r--r--
2025-10-18 00:31
update_referrals_table.sql.1
398
B
-rw-r--r--
2025-10-18 00:31
update_referrals_table_for_import.sql
426
B
-rw-r--r--
2025-10-18 01:59
update_referrals_table_for_import.sql.1
426
B
-rw-r--r--
2025-10-18 01:59
verify-code.php
8.79
KB
-rw-r--r--
2026-03-30 14:55
verify_commissions.php
3.28
KB
-rw-r--r--
2025-10-18 00:20
verify_commissions.php.1
3.28
KB
-rw-r--r--
2025-10-18 00:20
verify_commissions_working.php
8.2
KB
-rw-r--r--
2025-10-18 00:56
verify_commissions_working.php.1
8.2
KB
-rw-r--r--
2025-10-18 00:56
website_deployment_package.zip
648.91
KB
-rw-r--r--
2025-10-18 01:49
website_deployment_package_final.zip
657.48
KB
-rw-r--r--
2025-10-18 02:06
website_deployment_package_professional.zip
667.46
KB
-rw-r--r--
2025-10-17 21:14
website_deployment_package_updated.zip
653.07
KB
-rw-r--r--
2025-10-18 01:59
Save
Rename
function hI(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in n)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function mT(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function dI(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){if(this instanceof i){var r=[null];r.push.apply(r,arguments);var s=Function.bind.apply(e,r);return new s}return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}var Mf={},pI={get exports(){return Mf},set exports(n){Mf=n}},ng={},U={},mI={get exports(){return U},set exports(n){U=n}},Mt={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var lh=Symbol.for("react.element"),gI=Symbol.for("react.portal"),yI=Symbol.for("react.fragment"),vI=Symbol.for("react.strict_mode"),xI=Symbol.for("react.profiler"),_I=Symbol.for("react.provider"),AI=Symbol.for("react.context"),MI=Symbol.for("react.forward_ref"),wI=Symbol.for("react.suspense"),SI=Symbol.for("react.memo"),CI=Symbol.for("react.lazy"),Yw=Symbol.iterator;function EI(n){return n===null||typeof n!="object"?null:(n=Yw&&n[Yw]||n["@@iterator"],typeof n=="function"?n:null)}var gT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yT=Object.assign,vT={};function Gu(n,e,t){this.props=n,this.context=e,this.refs=vT,this.updater=t||gT}Gu.prototype.isReactComponent={};Gu.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};Gu.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function xT(){}xT.prototype=Gu.prototype;function J1(n,e,t){this.props=n,this.context=e,this.refs=vT,this.updater=t||gT}var X1=J1.prototype=new xT;X1.constructor=J1;yT(X1,Gu.prototype);X1.isPureReactComponent=!0;var Qw=Array.isArray,_T=Object.prototype.hasOwnProperty,K1={current:null},AT={key:!0,ref:!0,__self:!0,__source:!0};function MT(n,e,t){var i,r={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)_T.call(e,i)&&!AT.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1<a){for(var l=Array(a),f=0;f<a;f++)l[f]=arguments[f+2];r.children=l}if(n&&n.defaultProps)for(i in a=n.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return{$$typeof:lh,type:n,key:s,ref:o,props:r,_owner:K1.current}}function bI(n,e){return{$$typeof:lh,type:n.type,key:e,ref:n.ref,props:n.props,_owner:n._owner}}function Y1(n){return typeof n=="object"&&n!==null&&n.$$typeof===lh}function TI(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var Zw=/\/+/g;function ny(n,e){return typeof n=="object"&&n!==null&&n.key!=null?TI(""+n.key):e.toString(36)}function Jp(n,e,t,i,r){var s=typeof n;(s==="undefined"||s==="boolean")&&(n=null);var o=!1;if(n===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(n.$$typeof){case lh:case gI:o=!0}}if(o)return o=n,r=r(o),n=i===""?"."+ny(o,0):i,Qw(r)?(t="",n!=null&&(t=n.replace(Zw,"$&/")+"/"),Jp(r,e,t,"",function(f){return f})):r!=null&&(Y1(r)&&(r=bI(r,t+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(Zw,"$&/")+"/")+n)),e.push(r)),1;if(o=0,i=i===""?".":i+":",Qw(n))for(var a=0;a<n.length;a++){s=n[a];var l=i+ny(s,a);o+=Jp(s,e,t,l,r)}else if(l=EI(n),typeof l=="function")for(n=l.call(n),a=0;!(s=n.next()).done;)s=s.value,l=i+ny(s,a++),o+=Jp(s,e,t,l,r);else if(s==="object")throw e=String(n),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Fd(n,e,t){if(n==null)return n;var i=[],r=0;return Jp(n,i,"","",function(s){return e.call(t,s,r++)}),i}function PI(n){if(n._status===-1){var e=n._result;e=e(),e.then(function(t){(n._status===0||n._status===-1)&&(n._status=1,n._result=t)},function(t){(n._status===0||n._status===-1)&&(n._status=2,n._result=t)}),n._status===-1&&(n._status=0,n._result=e)}if(n._status===1)return n._result.default;throw n._result}var hi={current:null},Xp={transition:null},BI={ReactCurrentDispatcher:hi,ReactCurrentBatchConfig:Xp,ReactCurrentOwner:K1};Mt.Children={map:Fd,forEach:function(n,e,t){Fd(n,function(){e.apply(this,arguments)},t)},count:function(n){var e=0;return Fd(n,function(){e++}),e},toArray:function(n){return Fd(n,function(e){return e})||[]},only:function(n){if(!Y1(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Mt.Component=Gu;Mt.Fragment=yI;Mt.Profiler=xI;Mt.PureComponent=J1;Mt.StrictMode=vI;Mt.Suspense=wI;Mt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=BI;Mt.cloneElement=function(n,e,t){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var i=yT({},n.props),r=n.key,s=n.ref,o=n._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=K1.current),e.key!==void 0&&(r=""+e.key),n.type&&n.type.defaultProps)var a=n.type.defaultProps;for(l in e)_T.call(e,l)&&!AT.hasOwnProperty(l)&&(i[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)i.children=t;else if(1<l){a=Array(l);for(var f=0;f<l;f++)a[f]=arguments[f+2];i.children=a}return{$$typeof:lh,type:n.type,key:r,ref:s,props:i,_owner:o}};Mt.createContext=function(n){return n={$$typeof:AI,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:_I,_context:n},n.Consumer=n};Mt.createElement=MT;Mt.createFactory=function(n){var e=MT.bind(null,n);return e.type=n,e};Mt.createRef=function(){return{current:null}};Mt.forwardRef=function(n){return{$$typeof:MI,render:n}};Mt.isValidElement=Y1;Mt.lazy=function(n){return{$$typeof:CI,_payload:{_status:-1,_result:n},_init:PI}};Mt.memo=function(n,e){return{$$typeof:SI,type:n,compare:e===void 0?null:e}};Mt.startTransition=function(n){var e=Xp.transition;Xp.transition={};try{n()}finally{Xp.transition=e}};Mt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Mt.useCallback=function(n,e){return hi.current.useCallback(n,e)};Mt.useContext=function(n){return hi.current.useContext(n)};Mt.useDebugValue=function(){};Mt.useDeferredValue=function(n){return hi.current.useDeferredValue(n)};Mt.useEffect=function(n,e){return hi.current.useEffect(n,e)};Mt.useId=function(){return hi.current.useId()};Mt.useImperativeHandle=function(n,e,t){return hi.current.useImperativeHandle(n,e,t)};Mt.useInsertionEffect=function(n,e){return hi.current.useInsertionEffect(n,e)};Mt.useLayoutEffect=function(n,e){return hi.current.useLayoutEffect(n,e)};Mt.useMemo=function(n,e){return hi.current.useMemo(n,e)};Mt.useReducer=function(n,e,t){return hi.current.useReducer(n,e,t)};Mt.useRef=function(n){return hi.current.useRef(n)};Mt.useState=function(n){return hi.current.useState(n)};Mt.useSyncExternalStore=function(n,e,t){return hi.current.useSyncExternalStore(n,e,t)};Mt.useTransition=function(){return hi.current.useTransition()};Mt.version="18.2.0";(function(n){n.exports=Mt})(mI);const ig=mT(U),Iv=hI({__proto__:null,default:ig},[U]);/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var RI=U,LI=Symbol.for("react.element"),II=Symbol.for("react.fragment"),DI=Object.prototype.hasOwnProperty,FI=RI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,NI={key:!0,ref:!0,__self:!0,__source:!0};function wT(n,e,t){var i,r={},s=null,o=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(i in e)DI.call(e,i)&&!NI.hasOwnProperty(i)&&(r[i]=e[i]);if(n&&n.defaultProps)for(i in e=n.defaultProps,e)r[i]===void 0&&(r[i]=e[i]);return{$$typeof:LI,type:n,key:s,ref:o,props:r,_owner:FI.current}}ng.Fragment=II;ng.jsx=wT;ng.jsxs=wT;(function(n){n.exports=ng})(pI);const Q1=Mf.Fragment,pe=Mf.jsx,tt=Mf.jsxs;var Dv={},mm={},kI={get exports(){return mm},set exports(n){mm=n}},Wi={},Fv={},OI={get exports(){return Fv},set exports(n){Fv=n}},ST={};/** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */(function(n){function e(N,V){var j=N.length;N.push(V);e:for(;0<j;){var ae=j-1>>>1,W=N[ae];if(0<r(W,V))N[ae]=V,N[j]=W,j=ae;else break e}}function t(N){return N.length===0?null:N[0]}function i(N){if(N.length===0)return null;var V=N[0],j=N.pop();if(j!==V){N[0]=j;e:for(var ae=0,W=N.length,ce=W>>>1;ae<ce;){var ve=2*(ae+1)-1,_e=N[ve],$=ve+1,ke=N[$];if(0>r(_e,j))$<W&&0>r(ke,_e)?(N[ae]=ke,N[$]=j,ae=$):(N[ae]=_e,N[ve]=j,ae=ve);else if($<W&&0>r(ke,j))N[ae]=ke,N[$]=j,ae=$;else break e}}return V}function r(N,V){var j=N.sortIndex-V.sortIndex;return j!==0?j:N.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],f=[],h=1,d=null,p=3,m=!1,v=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(N){for(var V=t(f);V!==null;){if(V.callback===null)i(f);else if(V.startTime<=N)i(f),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(f)}}function S(N){if(y=!1,w(N),!v)if(t(l)!==null)v=!0,te(b);else{var V=t(f);V!==null&&le(S,V.startTime-N)}}function b(N,V){v=!1,y&&(y=!1,_(E),E=-1),m=!0;var j=p;try{for(w(V),d=t(l);d!==null&&(!(d.expirationTime>V)||N&&!z());){var ae=d.callback;if(typeof ae=="function"){d.callback=null,p=d.priorityLevel;var W=ae(d.expirationTime<=V);V=n.unstable_now(),typeof W=="function"?d.callback=W:d===t(l)&&i(l),w(V)}else i(l);d=t(l)}if(d!==null)var ce=!0;else{var ve=t(f);ve!==null&&le(S,ve.startTime-V),ce=!1}return ce}finally{d=null,p=j,m=!1}}var P=!1,R=null,E=-1,B=5,L=-1;function z(){return!(n.unstable_now()-L<B)}function Z(){if(R!==null){var N=n.unstable_now();L=N;var V=!0;try{V=R(!0,N)}finally{V?J():(P=!1,R=null)}}else P=!1}var J;if(typeof A=="function")J=function(){A(Z)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,Y=H.port2;H.port1.onmessage=Z,J=function(){Y.postMessage(null)}}else J=function(){x(Z,0)};function te(N){R=N,P||(P=!0,J())}function le(N,V){E=x(function(){N(n.unstable_now())},V)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(N){N.callback=null},n.unstable_continueExecution=function(){v||m||(v=!0,te(b))},n.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<N?Math.floor(1e3/N):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(N){switch(p){case 1:case 2:case 3:var V=3;break;default:V=p}var j=p;p=V;try{return N()}finally{p=j}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(N,V){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var j=p;p=N;try{return V()}finally{p=j}},n.unstable_scheduleCallback=function(N,V,j){var ae=n.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?ae+j:ae):j=ae,N){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=j+W,N={id:h++,callback:V,priorityLevel:N,startTime:j,expirationTime:W,sortIndex:-1},j>ae?(N.sortIndex=j,e(f,N),t(l)===null&&N===t(f)&&(y?(_(E),E=-1):y=!0,le(S,j-ae))):(N.sortIndex=W,e(l,N),v||m||(v=!0,te(b))),N},n.unstable_shouldYield=z,n.unstable_wrapCallback=function(N){var V=p;return function(){var j=p;p=V;try{return N.apply(this,arguments)}finally{p=j}}}})(ST);(function(n){n.exports=ST})(OI);/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var CT=U,zi=Fv;function Se(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ET=new Set,wf={};function rl(n,e){Mu(n,e),Mu(n+"Capture",e)}function Mu(n,e){for(wf[n]=e,n=0;n<e.length;n++)ET.add(e[n])}var Os=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nv=Object.prototype.hasOwnProperty,UI=/^[: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]*$/,qw={},$w={};function zI(n){return Nv.call($w,n)?!0:Nv.call(qw,n)?!1:UI.test(n)?$w[n]=!0:(qw[n]=!0,!1)}function GI(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function HI(n,e,t,i){if(e===null||typeof e>"u"||GI(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function di(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Wn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Wn[n]=new di(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Wn[e]=new di(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Wn[n]=new di(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Wn[n]=new di(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Wn[n]=new di(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Wn[n]=new di(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Wn[n]=new di(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Wn[n]=new di(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Wn[n]=new di(n,5,!1,n.toLowerCase(),null,!1,!1)});var Z1=/[\-:]([a-z])/g;function q1(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(Z1,q1);Wn[e]=new di(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(Z1,q1);Wn[e]=new di(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(Z1,q1);Wn[e]=new di(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Wn[n]=new di(n,1,!1,n.toLowerCase(),null,!1,!1)});Wn.xlinkHref=new di("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Wn[n]=new di(n,1,!1,n.toLowerCase(),null,!0,!0)});function $1(n,e,t,i){var r=Wn.hasOwnProperty(e)?Wn[e]:null;(r!==null?r.type!==0:i||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(HI(e,t,r,i)&&(t=null),i||r===null?zI(e)&&(t===null?n.removeAttribute(e):n.setAttribute(e,""+t)):r.mustUseProperty?n[r.propertyName]=t===null?r.type===3?!1:"":t:(e=r.attributeName,i=r.attributeNamespace,t===null?n.removeAttribute(e):(r=r.type,t=r===3||r===4&&t===!0?"":""+t,i?n.setAttributeNS(i,e,t):n.setAttribute(e,t))))}var js=CT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Nd=Symbol.for("react.element"),Kl=Symbol.for("react.portal"),Yl=Symbol.for("react.fragment"),e_=Symbol.for("react.strict_mode"),kv=Symbol.for("react.profiler"),bT=Symbol.for("react.provider"),TT=Symbol.for("react.context"),t_=Symbol.for("react.forward_ref"),Ov=Symbol.for("react.suspense"),Uv=Symbol.for("react.suspense_list"),n_=Symbol.for("react.memo"),po=Symbol.for("react.lazy"),PT=Symbol.for("react.offscreen"),eS=Symbol.iterator;function _c(n){return n===null||typeof n!="object"?null:(n=eS&&n[eS]||n["@@iterator"],typeof n=="function"?n:null)}var sn=Object.assign,iy;function Qc(n){if(iy===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);iy=e&&e[1]||""}return` `+iy+n}var ry=!1;function sy(n,e){if(!n||ry)return"";ry=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(f){var i=f}Reflect.construct(n,[],e)}else{try{e.call()}catch(f){i=f}n.call(e.prototype)}else{try{throw Error()}catch(f){i=f}n()}}catch(f){if(f&&i&&typeof f.stack=="string"){for(var r=f.stack.split(` `),s=i.stack.split(` `),o=r.length-1,a=s.length-1;1<=o&&0<=a&&r[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(r[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||r[o]!==s[a]){var l=` `+r[o].replace(" at new "," at ");return n.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{ry=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Qc(n):""}function VI(n){switch(n.tag){case 5:return Qc(n.type);case 16:return Qc("Lazy");case 13:return Qc("Suspense");case 19:return Qc("SuspenseList");case 0:case 2:case 15:return n=sy(n.type,!1),n;case 11:return n=sy(n.type.render,!1),n;case 1:return n=sy(n.type,!0),n;default:return""}}function zv(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Yl:return"Fragment";case Kl:return"Portal";case kv:return"Profiler";case e_:return"StrictMode";case Ov:return"Suspense";case Uv:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case TT:return(n.displayName||"Context")+".Consumer";case bT:return(n._context.displayName||"Context")+".Provider";case t_:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case n_:return e=n.displayName||null,e!==null?e:zv(n.type)||"Memo";case po:e=n._payload,n=n._init;try{return zv(n(e))}catch{}}return null}function WI(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return zv(e);case 8:return e===e_?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function No(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function BT(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function jI(n){var e=BT(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function kd(n){n._valueTracker||(n._valueTracker=jI(n))}function RT(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=BT(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function gm(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function Gv(n,e){var t=e.checked;return sn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function tS(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=No(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function LT(n,e){e=e.checked,e!=null&&$1(n,"checked",e,!1)}function Hv(n,e){LT(n,e);var t=No(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?Vv(n,e.type,t):e.hasOwnProperty("defaultValue")&&Vv(n,e.type,No(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function nS(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function Vv(n,e,t){(e!=="number"||gm(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Zc=Array.isArray;function du(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r<t.length;r++)e["$"+t[r]]=!0;for(t=0;t<n.length;t++)r=e.hasOwnProperty("$"+n[t].value),n[t].selected!==r&&(n[t].selected=r),r&&i&&(n[t].defaultSelected=!0)}else{for(t=""+No(t),e=null,r=0;r<n.length;r++){if(n[r].value===t){n[r].selected=!0,i&&(n[r].defaultSelected=!0);return}e!==null||n[r].disabled||(e=n[r])}e!==null&&(e.selected=!0)}}function Wv(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Se(91));return sn({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function iS(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(Se(92));if(Zc(t)){if(1<t.length)throw Error(Se(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:No(t)}}function IT(n,e){var t=No(e.value),i=No(e.defaultValue);t!=null&&(t=""+t,t!==n.value&&(n.value=t),e.defaultValue==null&&n.defaultValue!==t&&(n.defaultValue=t)),i!=null&&(n.defaultValue=""+i)}function rS(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function DT(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jv(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?DT(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var Od,FT=function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,t,i,r){MSApp.execUnsafeLocalFunction(function(){return n(e,t,i,r)})}:n}(function(n,e){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=e;else{for(Od=Od||document.createElement("div"),Od.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Od.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Sf(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var nf={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},JI=["Webkit","ms","Moz","O"];Object.keys(nf).forEach(function(n){JI.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),nf[e]=nf[n]})});function NT(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||nf.hasOwnProperty(n)&&nf[n]?(""+e).trim():e+"px"}function kT(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=NT(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var XI=sn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Jv(n,e){if(e){if(XI[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Se(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Se(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Se(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Se(62))}}function Xv(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){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 Kv=null;function i_(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Yv=null,pu=null,mu=null;function sS(n){if(n=fh(n)){if(typeof Yv!="function")throw Error(Se(280));var e=n.stateNode;e&&(e=lg(e),Yv(n.stateNode,n.type,e))}}function OT(n){pu?mu?mu.push(n):mu=[n]:pu=n}function UT(){if(pu){var n=pu,e=mu;if(mu=pu=null,sS(n),e)for(n=0;n<e.length;n++)sS(e[n])}}function zT(n,e){return n(e)}function GT(){}var oy=!1;function HT(n,e,t){if(oy)return n(e,t);oy=!0;try{return zT(n,e,t)}finally{oy=!1,(pu!==null||mu!==null)&&(GT(),UT())}}function Cf(n,e){var t=n.stateNode;if(t===null)return null;var i=lg(t);if(i===null)return null;t=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(n=n.type,i=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!i;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(Se(231,e,typeof t));return t}var Qv=!1;if(Os)try{var Ac={};Object.defineProperty(Ac,"passive",{get:function(){Qv=!0}}),window.addEventListener("test",Ac,Ac),window.removeEventListener("test",Ac,Ac)}catch{Qv=!1}function KI(n,e,t,i,r,s,o,a,l){var f=Array.prototype.slice.call(arguments,3);try{e.apply(t,f)}catch(h){this.onError(h)}}var rf=!1,ym=null,vm=!1,Zv=null,YI={onError:function(n){rf=!0,ym=n}};function QI(n,e,t,i,r,s,o,a,l){rf=!1,ym=null,KI.apply(YI,arguments)}function ZI(n,e,t,i,r,s,o,a,l){if(QI.apply(this,arguments),rf){if(rf){var f=ym;rf=!1,ym=null}else throw Error(Se(198));vm||(vm=!0,Zv=f)}}function sl(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,e.flags&4098&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function VT(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function oS(n){if(sl(n)!==n)throw Error(Se(188))}function qI(n){var e=n.alternate;if(!e){if(e=sl(n),e===null)throw Error(Se(188));return e!==n?null:n}for(var t=n,i=e;;){var r=t.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){t=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===t)return oS(r),n;if(s===i)return oS(r),e;s=s.sibling}throw Error(Se(188))}if(t.return!==i.return)t=r,i=s;else{for(var o=!1,a=r.child;a;){if(a===t){o=!0,t=r,i=s;break}if(a===i){o=!0,i=r,t=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===t){o=!0,t=s,i=r;break}if(a===i){o=!0,i=s,t=r;break}a=a.sibling}if(!o)throw Error(Se(189))}}if(t.alternate!==i)throw Error(Se(190))}if(t.tag!==3)throw Error(Se(188));return t.stateNode.current===t?n:e}function WT(n){return n=qI(n),n!==null?jT(n):null}function jT(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=jT(n);if(e!==null)return e;n=n.sibling}return null}var JT=zi.unstable_scheduleCallback,aS=zi.unstable_cancelCallback,$I=zi.unstable_shouldYield,eD=zi.unstable_requestPaint,mn=zi.unstable_now,tD=zi.unstable_getCurrentPriorityLevel,r_=zi.unstable_ImmediatePriority,XT=zi.unstable_UserBlockingPriority,xm=zi.unstable_NormalPriority,nD=zi.unstable_LowPriority,KT=zi.unstable_IdlePriority,rg=null,qr=null;function iD(n){if(qr&&typeof qr.onCommitFiberRoot=="function")try{qr.onCommitFiberRoot(rg,n,void 0,(n.current.flags&128)===128)}catch{}}var Rr=Math.clz32?Math.clz32:oD,rD=Math.log,sD=Math.LN2;function oD(n){return n>>>=0,n===0?32:31-(rD(n)/sD|0)|0}var Ud=64,zd=4194304;function qc(n){switch(n&-n){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: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function _m(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=qc(a):(s&=o,s!==0&&(i=qc(s)))}else o=t&~r,o!==0?i=qc(o):s!==0&&(i=qc(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0<e;)t=31-Rr(e),r=1<<t,i|=n[t],e&=~r;return i}function aD(n,e){switch(n){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64: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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lD(n,e){for(var t=n.suspendedLanes,i=n.pingedLanes,r=n.expirationTimes,s=n.pendingLanes;0<s;){var o=31-Rr(s),a=1<<o,l=r[o];l===-1?(!(a&t)||a&i)&&(r[o]=aD(a,e)):l<=e&&(n.expiredLanes|=a),s&=~a}}function qv(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function YT(){var n=Ud;return Ud<<=1,!(Ud&4194240)&&(Ud=64),n}function ay(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function uh(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Rr(e),n[e]=t}function uD(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0<t;){var r=31-Rr(t),s=1<<r;e[r]=0,i[r]=-1,n[r]=-1,t&=~s}}function s_(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var i=31-Rr(t),r=1<<i;r&e|n[i]&e&&(n[i]|=e),t&=~r}}var kt=0;function QT(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var ZT,o_,qT,$T,e2,$v=!1,Gd=[],Co=null,Eo=null,bo=null,Ef=new Map,bf=new Map,vo=[],cD="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 submit".split(" ");function lS(n,e){switch(n){case"focusin":case"focusout":Co=null;break;case"dragenter":case"dragleave":Eo=null;break;case"mouseover":case"mouseout":bo=null;break;case"pointerover":case"pointerout":Ef.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":bf.delete(e.pointerId)}}function Mc(n,e,t,i,r,s){return n===null||n.nativeEvent!==s?(n={blockedOn:e,domEventName:t,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=fh(e),e!==null&&o_(e)),n):(n.eventSystemFlags|=i,e=n.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),n)}function fD(n,e,t,i,r){switch(e){case"focusin":return Co=Mc(Co,n,e,t,i,r),!0;case"dragenter":return Eo=Mc(Eo,n,e,t,i,r),!0;case"mouseover":return bo=Mc(bo,n,e,t,i,r),!0;case"pointerover":var s=r.pointerId;return Ef.set(s,Mc(Ef.get(s)||null,n,e,t,i,r)),!0;case"gotpointercapture":return s=r.pointerId,bf.set(s,Mc(bf.get(s)||null,n,e,t,i,r)),!0}return!1}function t2(n){var e=Ba(n.target);if(e!==null){var t=sl(e);if(t!==null){if(e=t.tag,e===13){if(e=VT(t),e!==null){n.blockedOn=e,e2(n.priority,function(){qT(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Kp(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=ex(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var i=new t.constructor(t.type,t);Kv=i,t.target.dispatchEvent(i),Kv=null}else return e=fh(t),e!==null&&o_(e),n.blockedOn=t,!1;e.shift()}return!0}function uS(n,e,t){Kp(n)&&t.delete(e)}function hD(){$v=!1,Co!==null&&Kp(Co)&&(Co=null),Eo!==null&&Kp(Eo)&&(Eo=null),bo!==null&&Kp(bo)&&(bo=null),Ef.forEach(uS),bf.forEach(uS)}function wc(n,e){n.blockedOn===e&&(n.blockedOn=null,$v||($v=!0,zi.unstable_scheduleCallback(zi.unstable_NormalPriority,hD)))}function Tf(n){function e(r){return wc(r,n)}if(0<Gd.length){wc(Gd[0],n);for(var t=1;t<Gd.length;t++){var i=Gd[t];i.blockedOn===n&&(i.blockedOn=null)}}for(Co!==null&&wc(Co,n),Eo!==null&&wc(Eo,n),bo!==null&&wc(bo,n),Ef.forEach(e),bf.forEach(e),t=0;t<vo.length;t++)i=vo[t],i.blockedOn===n&&(i.blockedOn=null);for(;0<vo.length&&(t=vo[0],t.blockedOn===null);)t2(t),t.blockedOn===null&&vo.shift()}var gu=js.ReactCurrentBatchConfig,Am=!0;function dD(n,e,t,i){var r=kt,s=gu.transition;gu.transition=null;try{kt=1,a_(n,e,t,i)}finally{kt=r,gu.transition=s}}function pD(n,e,t,i){var r=kt,s=gu.transition;gu.transition=null;try{kt=4,a_(n,e,t,i)}finally{kt=r,gu.transition=s}}function a_(n,e,t,i){if(Am){var r=ex(n,e,t,i);if(r===null)yy(n,e,i,Mm,t),lS(n,i);else if(fD(r,n,e,t,i))i.stopPropagation();else if(lS(n,i),e&4&&-1<cD.indexOf(n)){for(;r!==null;){var s=fh(r);if(s!==null&&ZT(s),s=ex(n,e,t,i),s===null&&yy(n,e,i,Mm,t),s===r)break;r=s}r!==null&&i.stopPropagation()}else yy(n,e,i,null,t)}}var Mm=null;function ex(n,e,t,i){if(Mm=null,n=i_(i),n=Ba(n),n!==null)if(e=sl(n),e===null)n=null;else if(t=e.tag,t===13){if(n=VT(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null);return Mm=n,null}function n2(n){switch(n){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(tD()){case r_:return 1;case XT:return 4;case xm:case nD:return 16;case KT:return 536870912;default:return 16}default:return 16}}var _o=null,l_=null,Yp=null;function i2(){if(Yp)return Yp;var n,e=l_,t=e.length,i,r="value"in _o?_o.value:_o.textContent,s=r.length;for(n=0;n<t&&e[n]===r[n];n++);var o=t-n;for(i=1;i<=o&&e[t-i]===r[s-i];i++);return Yp=r.slice(n,1<i?1-i:void 0)}function Qp(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function Hd(){return!0}function cS(){return!1}function ji(n){function e(t,i,r,s,o){this._reactName=t,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in n)n.hasOwnProperty(a)&&(t=n[a],this[a]=t?t(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Hd:cS,this.isPropagationStopped=cS,this}return sn(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=Hd)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=Hd)},persist:function(){},isPersistent:Hd}),e}var Hu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},u_=ji(Hu),ch=sn({},Hu,{view:0,detail:0}),mD=ji(ch),ly,uy,Sc,sg=sn({},ch,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:c_,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Sc&&(Sc&&n.type==="mousemove"?(ly=n.screenX-Sc.screenX,uy=n.screenY-Sc.screenY):uy=ly=0,Sc=n),ly)},movementY:function(n){return"movementY"in n?n.movementY:uy}}),fS=ji(sg),gD=sn({},sg,{dataTransfer:0}),yD=ji(gD),vD=sn({},ch,{relatedTarget:0}),cy=ji(vD),xD=sn({},Hu,{animationName:0,elapsedTime:0,pseudoElement:0}),_D=ji(xD),AD=sn({},Hu,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),MD=ji(AD),wD=sn({},Hu,{data:0}),hS=ji(wD),SD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},CD={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"},ED={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bD(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=ED[n])?!!e[n]:!1}function c_(){return bD}var TD=sn({},ch,{key:function(n){if(n.key){var e=SD[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=Qp(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?CD[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:c_,charCode:function(n){return n.type==="keypress"?Qp(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Qp(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),PD=ji(TD),BD=sn({},sg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dS=ji(BD),RD=sn({},ch,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:c_}),LD=ji(RD),ID=sn({},Hu,{propertyName:0,elapsedTime:0,pseudoElement:0}),DD=ji(ID),FD=sn({},sg,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),ND=ji(FD),kD=[9,13,27,32],f_=Os&&"CompositionEvent"in window,sf=null;Os&&"documentMode"in document&&(sf=document.documentMode);var OD=Os&&"TextEvent"in window&&!sf,r2=Os&&(!f_||sf&&8<sf&&11>=sf),pS=String.fromCharCode(32),mS=!1;function s2(n,e){switch(n){case"keyup":return kD.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function o2(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ql=!1;function UD(n,e){switch(n){case"compositionend":return o2(e);case"keypress":return e.which!==32?null:(mS=!0,pS);case"textInput":return n=e.data,n===pS&&mS?null:n;default:return null}}function zD(n,e){if(Ql)return n==="compositionend"||!f_&&s2(n,e)?(n=i2(),Yp=l_=_o=null,Ql=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return r2&&e.locale!=="ko"?null:e.data;default:return null}}var GD={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 gS(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!GD[n.type]:e==="textarea"}function a2(n,e,t,i){OT(i),e=wm(e,"onChange"),0<e.length&&(t=new u_("onChange","change",null,t,i),n.push({event:t,listeners:e}))}var of=null,Pf=null;function HD(n){v2(n,0)}function og(n){var e=$l(n);if(RT(e))return n}function VD(n,e){if(n==="change")return e}var l2=!1;if(Os){var fy;if(Os){var hy="oninput"in document;if(!hy){var yS=document.createElement("div");yS.setAttribute("oninput","return;"),hy=typeof yS.oninput=="function"}fy=hy}else fy=!1;l2=fy&&(!document.documentMode||9<document.documentMode)}function vS(){of&&(of.detachEvent("onpropertychange",u2),Pf=of=null)}function u2(n){if(n.propertyName==="value"&&og(Pf)){var e=[];a2(e,Pf,n,i_(n)),HT(HD,e)}}function WD(n,e,t){n==="focusin"?(vS(),of=e,Pf=t,of.attachEvent("onpropertychange",u2)):n==="focusout"&&vS()}function jD(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return og(Pf)}function JD(n,e){if(n==="click")return og(e)}function XD(n,e){if(n==="input"||n==="change")return og(e)}function KD(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Fr=typeof Object.is=="function"?Object.is:KD;function Bf(n,e){if(Fr(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(i=0;i<t.length;i++){var r=t[i];if(!Nv.call(e,r)||!Fr(n[r],e[r]))return!1}return!0}function xS(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function _S(n,e){var t=xS(n);n=0;for(var i;t;){if(t.nodeType===3){if(i=n+t.textContent.length,n<=e&&i>=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=xS(t)}}function c2(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?c2(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function f2(){for(var n=window,e=gm();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=gm(n.document)}return e}function h_(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function YD(n){var e=f2(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&c2(t.ownerDocument.documentElement,t)){if(i!==null&&h_(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=_S(t,s);var o=_S(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var QD=Os&&"documentMode"in document&&11>=document.documentMode,Zl=null,tx=null,af=null,nx=!1;function AS(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;nx||Zl==null||Zl!==gm(i)||(i=Zl,"selectionStart"in i&&h_(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),af&&Bf(af,i)||(af=i,i=wm(tx,"onSelect"),0<i.length&&(e=new u_("onSelect","select",null,e,t),n.push({event:e,listeners:i}),e.target=Zl)))}function Vd(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var ql={animationend:Vd("Animation","AnimationEnd"),animationiteration:Vd("Animation","AnimationIteration"),animationstart:Vd("Animation","AnimationStart"),transitionend:Vd("Transition","TransitionEnd")},dy={},h2={};Os&&(h2=document.createElement("div").style,"AnimationEvent"in window||(delete ql.animationend.animation,delete ql.animationiteration.animation,delete ql.animationstart.animation),"TransitionEvent"in window||delete ql.transitionend.transition);function ag(n){if(dy[n])return dy[n];if(!ql[n])return n;var e=ql[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in h2)return dy[n]=e[t];return n}var d2=ag("animationend"),p2=ag("animationiteration"),m2=ag("animationstart"),g2=ag("transitionend"),y2=new Map,MS="abort auxClick 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(" ");function jo(n,e){y2.set(n,e),rl(e,[n])}for(var py=0;py<MS.length;py++){var my=MS[py],ZD=my.toLowerCase(),qD=my[0].toUpperCase()+my.slice(1);jo(ZD,"on"+qD)}jo(d2,"onAnimationEnd");jo(p2,"onAnimationIteration");jo(m2,"onAnimationStart");jo("dblclick","onDoubleClick");jo("focusin","onFocus");jo("focusout","onBlur");jo(g2,"onTransitionEnd");Mu("onMouseEnter",["mouseout","mouseover"]);Mu("onMouseLeave",["mouseout","mouseover"]);Mu("onPointerEnter",["pointerout","pointerover"]);Mu("onPointerLeave",["pointerout","pointerover"]);rl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));rl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));rl("onBeforeInput",["compositionend","keypress","textInput","paste"]);rl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));rl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));rl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $c="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(" "),$D=new Set("cancel close invalid load scroll toggle".split(" ").concat($c));function wS(n,e,t){var i=n.type||"unknown-event";n.currentTarget=t,ZI(i,e,void 0,n),n.currentTarget=null}function v2(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var i=n[t],r=i.event;i=i.listeners;e:{var s=void 0;if(e)for(var o=i.length-1;0<=o;o--){var a=i[o],l=a.instance,f=a.currentTarget;if(a=a.listener,l!==s&&r.isPropagationStopped())break e;wS(r,a,f),s=l}else for(o=0;o<i.length;o++){if(a=i[o],l=a.instance,f=a.currentTarget,a=a.listener,l!==s&&r.isPropagationStopped())break e;wS(r,a,f),s=l}}}if(vm)throw n=Zv,vm=!1,Zv=null,n}function Wt(n,e){var t=e[ax];t===void 0&&(t=e[ax]=new Set);var i=n+"__bubble";t.has(i)||(x2(e,n,2,!1),t.add(i))}function gy(n,e,t){var i=0;e&&(i|=4),x2(t,n,i,e)}var Wd="_reactListening"+Math.random().toString(36).slice(2);function Rf(n){if(!n[Wd]){n[Wd]=!0,ET.forEach(function(t){t!=="selectionchange"&&($D.has(t)||gy(t,!1,n),gy(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[Wd]||(e[Wd]=!0,gy("selectionchange",!1,e))}}function x2(n,e,t,i){switch(n2(e)){case 1:var r=dD;break;case 4:r=pD;break;default:r=a_}t=r.bind(null,e,t,n),r=void 0,!Qv||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?n.addEventListener(e,t,{capture:!0,passive:r}):n.addEventListener(e,t,!0):r!==void 0?n.addEventListener(e,t,{passive:r}):n.addEventListener(e,t,!1)}function yy(n,e,t,i,r){var s=i;if(!(e&1)&&!(e&2)&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var a=i.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(o===4)for(o=i.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;o=o.return}for(;a!==null;){if(o=Ba(a),o===null)return;if(l=o.tag,l===5||l===6){i=s=o;continue e}a=a.parentNode}}i=i.return}HT(function(){var f=s,h=i_(t),d=[];e:{var p=y2.get(n);if(p!==void 0){var m=u_,v=n;switch(n){case"keypress":if(Qp(t)===0)break e;case"keydown":case"keyup":m=PD;break;case"focusin":v="focus",m=cy;break;case"focusout":v="blur",m=cy;break;case"beforeblur":case"afterblur":m=cy;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=fS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=yD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=LD;break;case d2:case p2:case m2:m=_D;break;case g2:m=DD;break;case"scroll":m=mD;break;case"wheel":m=ND;break;case"copy":case"cut":case"paste":m=MD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=dS}var y=(e&4)!==0,x=!y&&n==="scroll",_=y?p!==null?p+"Capture":null:p;y=[];for(var A=f,w;A!==null;){w=A;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,_!==null&&(S=Cf(A,_),S!=null&&y.push(Lf(A,S,w)))),x)break;A=A.return}0<y.length&&(p=new m(p,v,null,t,h),d.push({event:p,listeners:y}))}}if(!(e&7)){e:{if(p=n==="mouseover"||n==="pointerover",m=n==="mouseout"||n==="pointerout",p&&t!==Kv&&(v=t.relatedTarget||t.fromElement)&&(Ba(v)||v[Us]))break e;if((m||p)&&(p=h.window===h?h:(p=h.ownerDocument)?p.defaultView||p.parentWindow:window,m?(v=t.relatedTarget||t.toElement,m=f,v=v?Ba(v):null,v!==null&&(x=sl(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=f),m!==v)){if(y=fS,S="onMouseLeave",_="onMouseEnter",A="mouse",(n==="pointerout"||n==="pointerover")&&(y=dS,S="onPointerLeave",_="onPointerEnter",A="pointer"),x=m==null?p:$l(m),w=v==null?p:$l(v),p=new y(S,A+"leave",m,t,h),p.target=x,p.relatedTarget=w,S=null,Ba(h)===f&&(y=new y(_,A+"enter",v,t,h),y.target=w,y.relatedTarget=x,S=y),x=S,m&&v)t:{for(y=m,_=v,A=0,w=y;w;w=El(w))A++;for(w=0,S=_;S;S=El(S))w++;for(;0<A-w;)y=El(y),A--;for(;0<w-A;)_=El(_),w--;for(;A--;){if(y===_||_!==null&&y===_.alternate)break t;y=El(y),_=El(_)}y=null}else y=null;m!==null&&SS(d,p,m,y,!1),v!==null&&x!==null&&SS(d,x,v,y,!0)}}e:{if(p=f?$l(f):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var b=VD;else if(gS(p))if(l2)b=XD;else{b=jD;var P=WD}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(b=JD);if(b&&(b=b(n,f))){a2(d,b,t,h);break e}P&&P(n,p,f),n==="focusout"&&(P=p._wrapperState)&&P.controlled&&p.type==="number"&&Vv(p,"number",p.value)}switch(P=f?$l(f):window,n){case"focusin":(gS(P)||P.contentEditable==="true")&&(Zl=P,tx=f,af=null);break;case"focusout":af=tx=Zl=null;break;case"mousedown":nx=!0;break;case"contextmenu":case"mouseup":case"dragend":nx=!1,AS(d,t,h);break;case"selectionchange":if(QD)break;case"keydown":case"keyup":AS(d,t,h)}var R;if(f_)e:{switch(n){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Ql?s2(n,t)&&(E="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(E="onCompositionStart");E&&(r2&&t.locale!=="ko"&&(Ql||E!=="onCompositionStart"?E==="onCompositionEnd"&&Ql&&(R=i2()):(_o=h,l_="value"in _o?_o.value:_o.textContent,Ql=!0)),P=wm(f,E),0<P.length&&(E=new hS(E,n,null,t,h),d.push({event:E,listeners:P}),R?E.data=R:(R=o2(t),R!==null&&(E.data=R)))),(R=OD?UD(n,t):zD(n,t))&&(f=wm(f,"onBeforeInput"),0<f.length&&(h=new hS("onBeforeInput","beforeinput",null,t,h),d.push({event:h,listeners:f}),h.data=R))}v2(d,e)})}function Lf(n,e,t){return{instance:n,listener:e,currentTarget:t}}function wm(n,e){for(var t=e+"Capture",i=[];n!==null;){var r=n,s=r.stateNode;r.tag===5&&s!==null&&(r=s,s=Cf(n,t),s!=null&&i.unshift(Lf(n,s,r)),s=Cf(n,e),s!=null&&i.push(Lf(n,s,r))),n=n.return}return i}function El(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function SS(n,e,t,i,r){for(var s=e._reactName,o=[];t!==null&&t!==i;){var a=t,l=a.alternate,f=a.stateNode;if(l!==null&&l===i)break;a.tag===5&&f!==null&&(a=f,r?(l=Cf(t,s),l!=null&&o.unshift(Lf(t,l,a))):r||(l=Cf(t,s),l!=null&&o.push(Lf(t,l,a)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var eF=/\r\n?/g,tF=/\u0000|\uFFFD/g;function CS(n){return(typeof n=="string"?n:""+n).replace(eF,` `).replace(tF,"")}function jd(n,e,t){if(e=CS(e),CS(n)!==e&&t)throw Error(Se(425))}function Sm(){}var ix=null,rx=null;function sx(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var ox=typeof setTimeout=="function"?setTimeout:void 0,nF=typeof clearTimeout=="function"?clearTimeout:void 0,ES=typeof Promise=="function"?Promise:void 0,iF=typeof queueMicrotask=="function"?queueMicrotask:typeof ES<"u"?function(n){return ES.resolve(null).then(n).catch(rF)}:ox;function rF(n){setTimeout(function(){throw n})}function vy(n,e){var t=e,i=0;do{var r=t.nextSibling;if(n.removeChild(t),r&&r.nodeType===8)if(t=r.data,t==="/$"){if(i===0){n.removeChild(r),Tf(e);return}i--}else t!=="$"&&t!=="$?"&&t!=="$!"||i++;t=r}while(t);Tf(e)}function To(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return n}function bS(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return n;e--}else t==="/$"&&e++}n=n.previousSibling}return null}var Vu=Math.random().toString(36).slice(2),Zr="__reactFiber$"+Vu,If="__reactProps$"+Vu,Us="__reactContainer$"+Vu,ax="__reactEvents$"+Vu,sF="__reactListeners$"+Vu,oF="__reactHandles$"+Vu;function Ba(n){var e=n[Zr];if(e)return e;for(var t=n.parentNode;t;){if(e=t[Us]||t[Zr]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=bS(n);n!==null;){if(t=n[Zr])return t;n=bS(n)}return e}n=t,t=n.parentNode}return null}function fh(n){return n=n[Zr]||n[Us],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function $l(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(Se(33))}function lg(n){return n[If]||null}var lx=[],eu=-1;function Jo(n){return{current:n}}function jt(n){0>eu||(n.current=lx[eu],lx[eu]=null,eu--)}function Ht(n,e){eu++,lx[eu]=n.current,n.current=e}var ko={},ei=Jo(ko),wi=Jo(!1),Ya=ko;function wu(n,e){var t=n.type.contextTypes;if(!t)return ko;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function Si(n){return n=n.childContextTypes,n!=null}function Cm(){jt(wi),jt(ei)}function TS(n,e,t){if(ei.current!==ko)throw Error(Se(168));Ht(ei,e),Ht(wi,t)}function _2(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(Se(108,WI(n)||"Unknown",r));return sn({},t,i)}function Em(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||ko,Ya=ei.current,Ht(ei,n),Ht(wi,wi.current),!0}function PS(n,e,t){var i=n.stateNode;if(!i)throw Error(Se(169));t?(n=_2(n,e,Ya),i.__reactInternalMemoizedMergedChildContext=n,jt(wi),jt(ei),Ht(ei,n)):jt(wi),Ht(wi,t)}var Cs=null,ug=!1,xy=!1;function A2(n){Cs===null?Cs=[n]:Cs.push(n)}function aF(n){ug=!0,A2(n)}function Xo(){if(!xy&&Cs!==null){xy=!0;var n=0,e=kt;try{var t=Cs;for(kt=1;n<t.length;n++){var i=t[n];do i=i(!0);while(i!==null)}Cs=null,ug=!1}catch(r){throw Cs!==null&&(Cs=Cs.slice(n+1)),JT(r_,Xo),r}finally{kt=e,xy=!1}}return null}var tu=[],nu=0,bm=null,Tm=0,lr=[],ur=0,Qa=null,Ts=1,Ps="";function _a(n,e){tu[nu++]=Tm,tu[nu++]=bm,bm=n,Tm=e}function M2(n,e,t){lr[ur++]=Ts,lr[ur++]=Ps,lr[ur++]=Qa,Qa=n;var i=Ts;n=Ps;var r=32-Rr(i)-1;i&=~(1<<r),t+=1;var s=32-Rr(e)+r;if(30<s){var o=r-r%5;s=(i&(1<<o)-1).toString(32),i>>=o,r-=o,Ts=1<<32-Rr(e)+r|t<<r|i,Ps=s+n}else Ts=1<<s|t<<r|i,Ps=n}function d_(n){n.return!==null&&(_a(n,1),M2(n,1,0))}function p_(n){for(;n===bm;)bm=tu[--nu],tu[nu]=null,Tm=tu[--nu],tu[nu]=null;for(;n===Qa;)Qa=lr[--ur],lr[ur]=null,Ps=lr[--ur],lr[ur]=null,Ts=lr[--ur],lr[ur]=null}var Oi=null,Ni=null,Yt=!1,Tr=null;function w2(n,e){var t=fr(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=n,e=n.deletions,e===null?(n.deletions=[t],n.flags|=16):e.push(t)}function BS(n,e){switch(n.tag){case 5:var t=n.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(n.stateNode=e,Oi=n,Ni=To(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,Oi=n,Ni=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=Qa!==null?{id:Ts,overflow:Ps}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=fr(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,Oi=n,Ni=null,!0):!1;default:return!1}}function ux(n){return(n.mode&1)!==0&&(n.flags&128)===0}function cx(n){if(Yt){var e=Ni;if(e){var t=e;if(!BS(n,e)){if(ux(n))throw Error(Se(418));e=To(t.nextSibling);var i=Oi;e&&BS(n,e)?w2(i,t):(n.flags=n.flags&-4097|2,Yt=!1,Oi=n)}}else{if(ux(n))throw Error(Se(418));n.flags=n.flags&-4097|2,Yt=!1,Oi=n}}}function RS(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;Oi=n}function Jd(n){if(n!==Oi)return!1;if(!Yt)return RS(n),Yt=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!sx(n.type,n.memoizedProps)),e&&(e=Ni)){if(ux(n))throw S2(),Error(Se(418));for(;e;)w2(n,e),e=To(e.nextSibling)}if(RS(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Se(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Ni=To(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Ni=null}}else Ni=Oi?To(n.stateNode.nextSibling):null;return!0}function S2(){for(var n=Ni;n;)n=To(n.nextSibling)}function Su(){Ni=Oi=null,Yt=!1}function m_(n){Tr===null?Tr=[n]:Tr.push(n)}var lF=js.ReactCurrentBatchConfig;function Cr(n,e){if(n&&n.defaultProps){e=sn({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}var Pm=Jo(null),Bm=null,iu=null,g_=null;function y_(){g_=iu=Bm=null}function v_(n){var e=Pm.current;jt(Pm),n._currentValue=e}function fx(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function yu(n,e){Bm=n,g_=iu=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Mi=!0),n.firstContext=null)}function pr(n){var e=n._currentValue;if(g_!==n)if(n={context:n,memoizedValue:e,next:null},iu===null){if(Bm===null)throw Error(Se(308));iu=n,Bm.dependencies={lanes:0,firstContext:n}}else iu=iu.next=n;return e}var Ra=null;function x_(n){Ra===null?Ra=[n]:Ra.push(n)}function C2(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,x_(e)):(t.next=r.next,r.next=t),e.interleaved=t,zs(n,i)}function zs(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var mo=!1;function __(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function E2(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Ds(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Po(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,Bt&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,zs(n,t)}return r=i.interleaved,r===null?(e.next=e,x_(i)):(e.next=r.next,r.next=e),i.interleaved=e,zs(n,t)}function Zp(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,s_(n,t)}}function LS(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var r=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?r=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?r=s=e:s=s.next=e}else r=s=e;t={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function Rm(n,e,t,i){var r=n.updateQueue;mo=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,f=l.next;l.next=null,o===null?s=f:o.next=f,o=l;var h=n.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=f:a.next=f,h.lastBaseUpdate=l))}if(s!==null){var d=r.baseState;o=0,h=f=l=null,a=s;do{var p=a.lane,m=a.eventTime;if((i&p)===p){h!==null&&(h=h.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=n,y=a;switch(p=e,m=t,y.tag){case 1:if(v=y.payload,typeof v=="function"){d=v.call(m,d,p);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=y.payload,p=typeof v=="function"?v.call(m,d,p):v,p==null)break e;d=sn({},d,p);break e;case 2:mo=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,p=r.effects,p===null?r.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(f=h=m,l=d):h=h.next=m,o|=p;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;p=a,a=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(1);if(h===null&&(l=d),r.baseState=l,r.firstBaseUpdate=f,r.lastBaseUpdate=h,e=r.shared.interleaved,e!==null){r=e;do o|=r.lane,r=r.next;while(r!==e)}else s===null&&(r.shared.lanes=0);qa|=o,n.lanes=o,n.memoizedState=d}}function IS(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e<n.length;e++){var i=n[e],r=i.callback;if(r!==null){if(i.callback=null,i=t,typeof r!="function")throw Error(Se(191,r));r.call(i)}}}var b2=new CT.Component().refs;function hx(n,e,t,i){e=n.memoizedState,t=t(i,e),t=t==null?e:sn({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var cg={isMounted:function(n){return(n=n._reactInternals)?sl(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var i=ci(),r=Ro(n),s=Ds(i,r);s.payload=e,t!=null&&(s.callback=t),e=Po(n,s,r),e!==null&&(Lr(e,n,r,i),Zp(e,n,r))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var i=ci(),r=Ro(n),s=Ds(i,r);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=Po(n,s,r),e!==null&&(Lr(e,n,r,i),Zp(e,n,r))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=ci(),i=Ro(n),r=Ds(t,i);r.tag=2,e!=null&&(r.callback=e),e=Po(n,r,i),e!==null&&(Lr(e,n,i,t),Zp(e,n,i))}};function DS(n,e,t,i,r,s,o){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(i,s,o):e.prototype&&e.prototype.isPureReactComponent?!Bf(t,i)||!Bf(r,s):!0}function T2(n,e,t){var i=!1,r=ko,s=e.contextType;return typeof s=="object"&&s!==null?s=pr(s):(r=Si(e)?Ya:ei.current,i=e.contextTypes,s=(i=i!=null)?wu(n,r):ko),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=cg,n.stateNode=e,e._reactInternals=n,i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=r,n.__reactInternalMemoizedMaskedChildContext=s),e}function FS(n,e,t,i){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,i),e.state!==n&&cg.enqueueReplaceState(e,e.state,null)}function dx(n,e,t,i){var r=n.stateNode;r.props=t,r.state=n.memoizedState,r.refs=b2,__(n);var s=e.contextType;typeof s=="object"&&s!==null?r.context=pr(s):(s=Si(e)?Ya:ei.current,r.context=wu(n,s)),r.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(hx(n,e,s,t),r.state=n.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(e=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),e!==r.state&&cg.enqueueReplaceState(r,r.state,null),Rm(n,t,r,i),r.state=n.memoizedState),typeof r.componentDidMount=="function"&&(n.flags|=4194308)}function Cc(n,e,t){if(n=t.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(Se(309));var i=t.stateNode}if(!i)throw Error(Se(147,n));var r=i,s=""+n;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=r.refs;a===b2&&(a=r.refs={}),o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof n!="string")throw Error(Se(284));if(!t._owner)throw Error(Se(290,n))}return n}function Xd(n,e){throw n=Object.prototype.toString.call(e),Error(Se(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function NS(n){var e=n._init;return e(n._payload)}function P2(n){function e(_,A){if(n){var w=_.deletions;w===null?(_.deletions=[A],_.flags|=16):w.push(A)}}function t(_,A){if(!n)return null;for(;A!==null;)e(_,A),A=A.sibling;return null}function i(_,A){for(_=new Map;A!==null;)A.key!==null?_.set(A.key,A):_.set(A.index,A),A=A.sibling;return _}function r(_,A){return _=Lo(_,A),_.index=0,_.sibling=null,_}function s(_,A,w){return _.index=w,n?(w=_.alternate,w!==null?(w=w.index,w<A?(_.flags|=2,A):w):(_.flags|=2,A)):(_.flags|=1048576,A)}function o(_){return n&&_.alternate===null&&(_.flags|=2),_}function a(_,A,w,S){return A===null||A.tag!==6?(A=Ey(w,_.mode,S),A.return=_,A):(A=r(A,w),A.return=_,A)}function l(_,A,w,S){var b=w.type;return b===Yl?h(_,A,w.props.children,S,w.key):A!==null&&(A.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===po&&NS(b)===A.type)?(S=r(A,w.props),S.ref=Cc(_,A,w),S.return=_,S):(S=im(w.type,w.key,w.props,null,_.mode,S),S.ref=Cc(_,A,w),S.return=_,S)}function f(_,A,w,S){return A===null||A.tag!==4||A.stateNode.containerInfo!==w.containerInfo||A.stateNode.implementation!==w.implementation?(A=by(w,_.mode,S),A.return=_,A):(A=r(A,w.children||[]),A.return=_,A)}function h(_,A,w,S,b){return A===null||A.tag!==7?(A=Ga(w,_.mode,S,b),A.return=_,A):(A=r(A,w),A.return=_,A)}function d(_,A,w){if(typeof A=="string"&&A!==""||typeof A=="number")return A=Ey(""+A,_.mode,w),A.return=_,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case Nd:return w=im(A.type,A.key,A.props,null,_.mode,w),w.ref=Cc(_,null,A),w.return=_,w;case Kl:return A=by(A,_.mode,w),A.return=_,A;case po:var S=A._init;return d(_,S(A._payload),w)}if(Zc(A)||_c(A))return A=Ga(A,_.mode,w,null),A.return=_,A;Xd(_,A)}return null}function p(_,A,w,S){var b=A!==null?A.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return b!==null?null:a(_,A,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Nd:return w.key===b?l(_,A,w,S):null;case Kl:return w.key===b?f(_,A,w,S):null;case po:return b=w._init,p(_,A,b(w._payload),S)}if(Zc(w)||_c(w))return b!==null?null:h(_,A,w,S,null);Xd(_,w)}return null}function m(_,A,w,S,b){if(typeof S=="string"&&S!==""||typeof S=="number")return _=_.get(w)||null,a(A,_,""+S,b);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Nd:return _=_.get(S.key===null?w:S.key)||null,l(A,_,S,b);case Kl:return _=_.get(S.key===null?w:S.key)||null,f(A,_,S,b);case po:var P=S._init;return m(_,A,w,P(S._payload),b)}if(Zc(S)||_c(S))return _=_.get(w)||null,h(A,_,S,b,null);Xd(A,S)}return null}function v(_,A,w,S){for(var b=null,P=null,R=A,E=A=0,B=null;R!==null&&E<w.length;E++){R.index>E?(B=R,R=null):B=R.sibling;var L=p(_,R,w[E],S);if(L===null){R===null&&(R=B);break}n&&R&&L.alternate===null&&e(_,R),A=s(L,A,E),P===null?b=L:P.sibling=L,P=L,R=B}if(E===w.length)return t(_,R),Yt&&_a(_,E),b;if(R===null){for(;E<w.length;E++)R=d(_,w[E],S),R!==null&&(A=s(R,A,E),P===null?b=R:P.sibling=R,P=R);return Yt&&_a(_,E),b}for(R=i(_,R);E<w.length;E++)B=m(R,_,E,w[E],S),B!==null&&(n&&B.alternate!==null&&R.delete(B.key===null?E:B.key),A=s(B,A,E),P===null?b=B:P.sibling=B,P=B);return n&&R.forEach(function(z){return e(_,z)}),Yt&&_a(_,E),b}function y(_,A,w,S){var b=_c(w);if(typeof b!="function")throw Error(Se(150));if(w=b.call(w),w==null)throw Error(Se(151));for(var P=b=null,R=A,E=A=0,B=null,L=w.next();R!==null&&!L.done;E++,L=w.next()){R.index>E?(B=R,R=null):B=R.sibling;var z=p(_,R,L.value,S);if(z===null){R===null&&(R=B);break}n&&R&&z.alternate===null&&e(_,R),A=s(z,A,E),P===null?b=z:P.sibling=z,P=z,R=B}if(L.done)return t(_,R),Yt&&_a(_,E),b;if(R===null){for(;!L.done;E++,L=w.next())L=d(_,L.value,S),L!==null&&(A=s(L,A,E),P===null?b=L:P.sibling=L,P=L);return Yt&&_a(_,E),b}for(R=i(_,R);!L.done;E++,L=w.next())L=m(R,_,E,L.value,S),L!==null&&(n&&L.alternate!==null&&R.delete(L.key===null?E:L.key),A=s(L,A,E),P===null?b=L:P.sibling=L,P=L);return n&&R.forEach(function(Z){return e(_,Z)}),Yt&&_a(_,E),b}function x(_,A,w,S){if(typeof w=="object"&&w!==null&&w.type===Yl&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Nd:e:{for(var b=w.key,P=A;P!==null;){if(P.key===b){if(b=w.type,b===Yl){if(P.tag===7){t(_,P.sibling),A=r(P,w.props.children),A.return=_,_=A;break e}}else if(P.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===po&&NS(b)===P.type){t(_,P.sibling),A=r(P,w.props),A.ref=Cc(_,P,w),A.return=_,_=A;break e}t(_,P);break}else e(_,P);P=P.sibling}w.type===Yl?(A=Ga(w.props.children,_.mode,S,w.key),A.return=_,_=A):(S=im(w.type,w.key,w.props,null,_.mode,S),S.ref=Cc(_,A,w),S.return=_,_=S)}return o(_);case Kl:e:{for(P=w.key;A!==null;){if(A.key===P)if(A.tag===4&&A.stateNode.containerInfo===w.containerInfo&&A.stateNode.implementation===w.implementation){t(_,A.sibling),A=r(A,w.children||[]),A.return=_,_=A;break e}else{t(_,A);break}else e(_,A);A=A.sibling}A=by(w,_.mode,S),A.return=_,_=A}return o(_);case po:return P=w._init,x(_,A,P(w._payload),S)}if(Zc(w))return v(_,A,w,S);if(_c(w))return y(_,A,w,S);Xd(_,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,A!==null&&A.tag===6?(t(_,A.sibling),A=r(A,w),A.return=_,_=A):(t(_,A),A=Ey(w,_.mode,S),A.return=_,_=A),o(_)):t(_,A)}return x}var Cu=P2(!0),B2=P2(!1),hh={},$r=Jo(hh),Df=Jo(hh),Ff=Jo(hh);function La(n){if(n===hh)throw Error(Se(174));return n}function A_(n,e){switch(Ht(Ff,e),Ht(Df,n),Ht($r,hh),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:jv(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=jv(e,n)}jt($r),Ht($r,e)}function Eu(){jt($r),jt(Df),jt(Ff)}function R2(n){La(Ff.current);var e=La($r.current),t=jv(e,n.type);e!==t&&(Ht(Df,n),Ht($r,t))}function M_(n){Df.current===n&&(jt($r),jt(Df))}var $t=Jo(0);function Lm(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var _y=[];function w_(){for(var n=0;n<_y.length;n++)_y[n]._workInProgressVersionPrimary=null;_y.length=0}var qp=js.ReactCurrentDispatcher,Ay=js.ReactCurrentBatchConfig,Za=0,rn=null,Cn=null,Nn=null,Im=!1,lf=!1,Nf=0,uF=0;function Yn(){throw Error(Se(321))}function S_(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!Fr(n[t],e[t]))return!1;return!0}function C_(n,e,t,i,r,s){if(Za=s,rn=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,qp.current=n===null||n.memoizedState===null?dF:pF,n=t(i,r),lf){s=0;do{if(lf=!1,Nf=0,25<=s)throw Error(Se(301));s+=1,Nn=Cn=null,e.updateQueue=null,qp.current=mF,n=t(i,r)}while(lf)}if(qp.current=Dm,e=Cn!==null&&Cn.next!==null,Za=0,Nn=Cn=rn=null,Im=!1,e)throw Error(Se(300));return n}function E_(){var n=Nf!==0;return Nf=0,n}function Yr(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?rn.memoizedState=Nn=n:Nn=Nn.next=n,Nn}function mr(){if(Cn===null){var n=rn.alternate;n=n!==null?n.memoizedState:null}else n=Cn.next;var e=Nn===null?rn.memoizedState:Nn.next;if(e!==null)Nn=e,Cn=n;else{if(n===null)throw Error(Se(310));Cn=n,n={memoizedState:Cn.memoizedState,baseState:Cn.baseState,baseQueue:Cn.baseQueue,queue:Cn.queue,next:null},Nn===null?rn.memoizedState=Nn=n:Nn=Nn.next=n}return Nn}function kf(n,e){return typeof e=="function"?e(n):e}function My(n){var e=mr(),t=e.queue;if(t===null)throw Error(Se(311));t.lastRenderedReducer=n;var i=Cn,r=i.baseQueue,s=t.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}i.baseQueue=r=s,t.pending=null}if(r!==null){s=r.next,i=i.baseState;var a=o=null,l=null,f=s;do{var h=f.lane;if((Za&h)===h)l!==null&&(l=l.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),i=f.hasEagerState?f.eagerState:n(i,f.action);else{var d={lane:h,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};l===null?(a=l=d,o=i):l=l.next=d,rn.lanes|=h,qa|=h}f=f.next}while(f!==null&&f!==s);l===null?o=i:l.next=a,Fr(i,e.memoizedState)||(Mi=!0),e.memoizedState=i,e.baseState=o,e.baseQueue=l,t.lastRenderedState=i}if(n=t.interleaved,n!==null){r=n;do s=r.lane,rn.lanes|=s,qa|=s,r=r.next;while(r!==n)}else r===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function wy(n){var e=mr(),t=e.queue;if(t===null)throw Error(Se(311));t.lastRenderedReducer=n;var i=t.dispatch,r=t.pending,s=e.memoizedState;if(r!==null){t.pending=null;var o=r=r.next;do s=n(s,o.action),o=o.next;while(o!==r);Fr(s,e.memoizedState)||(Mi=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,i]}function L2(){}function I2(n,e){var t=rn,i=mr(),r=e(),s=!Fr(i.memoizedState,r);if(s&&(i.memoizedState=r,Mi=!0),i=i.queue,b_(N2.bind(null,t,i,n),[n]),i.getSnapshot!==e||s||Nn!==null&&Nn.memoizedState.tag&1){if(t.flags|=2048,Of(9,F2.bind(null,t,i,r,e),void 0,null),kn===null)throw Error(Se(349));Za&30||D2(t,e,r)}return r}function D2(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=rn.updateQueue,e===null?(e={lastEffect:null,stores:null},rn.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function F2(n,e,t,i){e.value=t,e.getSnapshot=i,k2(e)&&O2(n)}function N2(n,e,t){return t(function(){k2(e)&&O2(n)})}function k2(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Fr(n,t)}catch{return!0}}function O2(n){var e=zs(n,1);e!==null&&Lr(e,n,1,-1)}function kS(n){var e=Yr();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:kf,lastRenderedState:n},e.queue=n,n=n.dispatch=hF.bind(null,rn,n),[e.memoizedState,n]}function Of(n,e,t,i){return n={tag:n,create:e,destroy:t,deps:i,next:null},e=rn.updateQueue,e===null?(e={lastEffect:null,stores:null},rn.updateQueue=e,e.lastEffect=n.next=n):(t=e.lastEffect,t===null?e.lastEffect=n.next=n:(i=t.next,t.next=n,n.next=i,e.lastEffect=n)),n}function U2(){return mr().memoizedState}function $p(n,e,t,i){var r=Yr();rn.flags|=n,r.memoizedState=Of(1|e,t,void 0,i===void 0?null:i)}function fg(n,e,t,i){var r=mr();i=i===void 0?null:i;var s=void 0;if(Cn!==null){var o=Cn.memoizedState;if(s=o.destroy,i!==null&&S_(i,o.deps)){r.memoizedState=Of(e,t,s,i);return}}rn.flags|=n,r.memoizedState=Of(1|e,t,s,i)}function OS(n,e){return $p(8390656,8,n,e)}function b_(n,e){return fg(2048,8,n,e)}function z2(n,e){return fg(4,2,n,e)}function G2(n,e){return fg(4,4,n,e)}function H2(n,e){if(typeof e=="function")return n=n(),e(n),function(){e(null)};if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function V2(n,e,t){return t=t!=null?t.concat([n]):null,fg(4,4,H2.bind(null,e,n),t)}function T_(){}function W2(n,e){var t=mr();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&S_(e,i[1])?i[0]:(t.memoizedState=[n,e],n)}function j2(n,e){var t=mr();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&S_(e,i[1])?i[0]:(n=n(),t.memoizedState=[n,e],n)}function J2(n,e,t){return Za&21?(Fr(t,e)||(t=YT(),rn.lanes|=t,qa|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,Mi=!0),n.memoizedState=t)}function cF(n,e){var t=kt;kt=t!==0&&4>t?t:4,n(!0);var i=Ay.transition;Ay.transition={};try{n(!1),e()}finally{kt=t,Ay.transition=i}}function X2(){return mr().memoizedState}function fF(n,e,t){var i=Ro(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},K2(n))Y2(e,t);else if(t=C2(n,e,t,i),t!==null){var r=ci();Lr(t,n,i,r),Q2(t,e,i)}}function hF(n,e,t){var i=Ro(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(K2(n))Y2(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(r.hasEagerState=!0,r.eagerState=a,Fr(a,o)){var l=e.interleaved;l===null?(r.next=r,x_(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=C2(n,e,r,i),t!==null&&(r=ci(),Lr(t,n,i,r),Q2(t,e,i))}}function K2(n){var e=n.alternate;return n===rn||e!==null&&e===rn}function Y2(n,e){lf=Im=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function Q2(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,s_(n,t)}}var Dm={readContext:pr,useCallback:Yn,useContext:Yn,useEffect:Yn,useImperativeHandle:Yn,useInsertionEffect:Yn,useLayoutEffect:Yn,useMemo:Yn,useReducer:Yn,useRef:Yn,useState:Yn,useDebugValue:Yn,useDeferredValue:Yn,useTransition:Yn,useMutableSource:Yn,useSyncExternalStore:Yn,useId:Yn,unstable_isNewReconciler:!1},dF={readContext:pr,useCallback:function(n,e){return Yr().memoizedState=[n,e===void 0?null:e],n},useContext:pr,useEffect:OS,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,$p(4194308,4,H2.bind(null,e,n),t)},useLayoutEffect:function(n,e){return $p(4194308,4,n,e)},useInsertionEffect:function(n,e){return $p(4,2,n,e)},useMemo:function(n,e){var t=Yr();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Yr();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=fF.bind(null,rn,n),[i.memoizedState,n]},useRef:function(n){var e=Yr();return n={current:n},e.memoizedState=n},useState:kS,useDebugValue:T_,useDeferredValue:function(n){return Yr().memoizedState=n},useTransition:function(){var n=kS(!1),e=n[0];return n=cF.bind(null,n[1]),Yr().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=rn,r=Yr();if(Yt){if(t===void 0)throw Error(Se(407));t=t()}else{if(t=e(),kn===null)throw Error(Se(349));Za&30||D2(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,OS(N2.bind(null,i,s,n),[n]),i.flags|=2048,Of(9,F2.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=Yr(),e=kn.identifierPrefix;if(Yt){var t=Ps,i=Ts;t=(i&~(1<<32-Rr(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Nf++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=uF++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},pF={readContext:pr,useCallback:W2,useContext:pr,useEffect:b_,useImperativeHandle:V2,useInsertionEffect:z2,useLayoutEffect:G2,useMemo:j2,useReducer:My,useRef:U2,useState:function(){return My(kf)},useDebugValue:T_,useDeferredValue:function(n){var e=mr();return J2(e,Cn.memoizedState,n)},useTransition:function(){var n=My(kf)[0],e=mr().memoizedState;return[n,e]},useMutableSource:L2,useSyncExternalStore:I2,useId:X2,unstable_isNewReconciler:!1},mF={readContext:pr,useCallback:W2,useContext:pr,useEffect:b_,useImperativeHandle:V2,useInsertionEffect:z2,useLayoutEffect:G2,useMemo:j2,useReducer:wy,useRef:U2,useState:function(){return wy(kf)},useDebugValue:T_,useDeferredValue:function(n){var e=mr();return Cn===null?e.memoizedState=n:J2(e,Cn.memoizedState,n)},useTransition:function(){var n=wy(kf)[0],e=mr().memoizedState;return[n,e]},useMutableSource:L2,useSyncExternalStore:I2,useId:X2,unstable_isNewReconciler:!1};function bu(n,e){try{var t="",i=e;do t+=VI(i),i=i.return;while(i);var r=t}catch(s){r=` Error generating stack: `+s.message+` `+s.stack}return{value:n,source:e,stack:r,digest:null}}function Sy(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function px(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var gF=typeof WeakMap=="function"?WeakMap:Map;function Z2(n,e,t){t=Ds(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){Nm||(Nm=!0,Sx=i),px(n,e)},t}function q2(n,e,t){t=Ds(-1,t),t.tag=3;var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;t.payload=function(){return i(r)},t.callback=function(){px(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){px(n,e),typeof i!="function"&&(Bo===null?Bo=new Set([this]):Bo.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function US(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new gF;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(t)||(r.add(t),n=BF.bind(null,n,e,t),e.then(n,n))}function zS(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function GS(n,e,t,i,r){return n.mode&1?(n.flags|=65536,n.lanes=r,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=Ds(-1,1),e.tag=2,Po(t,e,1))),t.lanes|=1),n)}var yF=js.ReactCurrentOwner,Mi=!1;function li(n,e,t,i){e.child=n===null?B2(e,null,t,i):Cu(e,n.child,t,i)}function HS(n,e,t,i,r){t=t.render;var s=e.ref;return yu(e,r),i=C_(n,e,t,i,s,r),t=E_(),n!==null&&!Mi?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,Gs(n,e,r)):(Yt&&t&&d_(e),e.flags|=1,li(n,e,i,r),e.child)}function VS(n,e,t,i,r){if(n===null){var s=t.type;return typeof s=="function"&&!N_(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,$2(n,e,s,i,r)):(n=im(t.type,null,i,e,e.mode,r),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&r)){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:Bf,t(o,i)&&n.ref===e.ref)return Gs(n,e,r)}return e.flags|=1,n=Lo(s,i),n.ref=e.ref,n.return=e,e.child=n}function $2(n,e,t,i,r){if(n!==null){var s=n.memoizedProps;if(Bf(s,i)&&n.ref===e.ref)if(Mi=!1,e.pendingProps=i=s,(n.lanes&r)!==0)n.flags&131072&&(Mi=!0);else return e.lanes=n.lanes,Gs(n,e,r)}return mx(n,e,t,i,r)}function eP(n,e,t){var i=e.pendingProps,r=i.children,s=n!==null?n.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ht(su,Di),Di|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,Ht(su,Di),Di|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:t,Ht(su,Di),Di|=i}else s!==null?(i=s.baseLanes|t,e.memoizedState=null):i=t,Ht(su,Di),Di|=i;return li(n,e,r,t),e.child}function tP(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function mx(n,e,t,i,r){var s=Si(t)?Ya:ei.current;return s=wu(e,s),yu(e,r),t=C_(n,e,t,i,s,r),i=E_(),n!==null&&!Mi?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,Gs(n,e,r)):(Yt&&i&&d_(e),e.flags|=1,li(n,e,t,r),e.child)}function WS(n,e,t,i,r){if(Si(t)){var s=!0;Em(e)}else s=!1;if(yu(e,r),e.stateNode===null)em(n,e),T2(e,t,i),dx(e,t,i,r),i=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,f=t.contextType;typeof f=="object"&&f!==null?f=pr(f):(f=Si(t)?Ya:ei.current,f=wu(e,f));var h=t.getDerivedStateFromProps,d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==i||l!==f)&&FS(e,o,i,f),mo=!1;var p=e.memoizedState;o.state=p,Rm(e,i,o,r),l=e.memoizedState,a!==i||p!==l||wi.current||mo?(typeof h=="function"&&(hx(e,t,h,i),l=e.memoizedState),(a=mo||DS(e,t,a,i,p,l,f))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),o.props=i,o.state=l,o.context=f,i=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,E2(n,e),a=e.memoizedProps,f=e.type===e.elementType?a:Cr(e.type,a),o.props=f,d=e.pendingProps,p=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=pr(l):(l=Si(t)?Ya:ei.current,l=wu(e,l));var m=t.getDerivedStateFromProps;(h=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||p!==l)&&FS(e,o,i,l),mo=!1,p=e.memoizedState,o.state=p,Rm(e,i,o,r);var v=e.memoizedState;a!==d||p!==v||wi.current||mo?(typeof m=="function"&&(hx(e,t,m,i),v=e.memoizedState),(f=mo||DS(e,t,f,i,p,v,l)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,v,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=v),o.props=i,o.state=v,o.context=l,i=f):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),i=!1)}return gx(n,e,t,i,s,r)}function gx(n,e,t,i,r,s){tP(n,e);var o=(e.flags&128)!==0;if(!i&&!o)return r&&PS(e,t,!1),Gs(n,e,s);i=e.stateNode,yF.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&o?(e.child=Cu(e,n.child,null,s),e.child=Cu(e,null,a,s)):li(n,e,a,s),e.memoizedState=i.state,r&&PS(e,t,!0),e.child}function nP(n){var e=n.stateNode;e.pendingContext?TS(n,e.pendingContext,e.pendingContext!==e.context):e.context&&TS(n,e.context,!1),A_(n,e.containerInfo)}function jS(n,e,t,i,r){return Su(),m_(r),e.flags|=256,li(n,e,t,i),e.child}var yx={dehydrated:null,treeContext:null,retryLane:0};function vx(n){return{baseLanes:n,cachePool:null,transitions:null}}function iP(n,e,t){var i=e.pendingProps,r=$t.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(r&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(r|=1),Ht($t,r&1),n===null)return cx(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=i.children,n=i.fallback,s?(i=e.mode,s=e.child,o={mode:"hidden",children:o},!(i&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=pg(o,i,0,null),n=Ga(n,i,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=vx(t),e.memoizedState=yx,n):P_(e,o));if(r=n.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return vF(n,e,o,i,a,r,t);if(s){s=i.fallback,o=e.mode,r=n.child,a=r.sibling;var l={mode:"hidden",children:i.children};return!(o&1)&&e.child!==r?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=Lo(r,l),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?s=Lo(a,s):(s=Ga(s,o,t,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,i=s,s=e.child,o=n.child.memoizedState,o=o===null?vx(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=yx,i}return s=n.child,n=s.sibling,i=Lo(s,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=t),i.return=e,i.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=i,e.memoizedState=null,i}function P_(n,e){return e=pg({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function Kd(n,e,t,i){return i!==null&&m_(i),Cu(e,n.child,null,t),n=P_(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function vF(n,e,t,i,r,s,o){if(t)return e.flags&256?(e.flags&=-257,i=Sy(Error(Se(422))),Kd(n,e,o,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=pg({mode:"visible",children:i.children},r,0,null),s=Ga(s,r,o,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,e.mode&1&&Cu(e,n.child,null,o),e.child.memoizedState=vx(o),e.memoizedState=yx,s);if(!(e.mode&1))return Kd(n,e,o,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,s=Error(Se(419)),i=Sy(s,i,void 0),Kd(n,e,o,i)}if(a=(o&n.childLanes)!==0,Mi||a){if(i=kn,i!==null){switch(o&-o){case 4:r=2;break;case 16:r=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|o)?0:r,r!==0&&r!==s.retryLane&&(s.retryLane=r,zs(n,r),Lr(i,n,r,-1))}return F_(),i=Sy(Error(Se(421))),Kd(n,e,o,i)}return r.data==="$?"?(e.flags|=128,e.child=n.child,e=RF.bind(null,n),r._reactRetry=e,null):(n=s.treeContext,Ni=To(r.nextSibling),Oi=e,Yt=!0,Tr=null,n!==null&&(lr[ur++]=Ts,lr[ur++]=Ps,lr[ur++]=Qa,Ts=n.id,Ps=n.overflow,Qa=e),e=P_(e,i.children),e.flags|=4096,e)}function JS(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),fx(n.return,e,t)}function Cy(n,e,t,i,r){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=t,s.tailMode=r)}function rP(n,e,t){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(li(n,e,i.children,t),i=$t.current,i&2)i=i&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&JS(n,t,e);else if(n.tag===19)JS(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}i&=1}if(Ht($t,i),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(t=e.child,r=null;t!==null;)n=t.alternate,n!==null&&Lm(n)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),Cy(e,!1,r,t,s);break;case"backwards":for(t=null,r=e.child,e.child=null;r!==null;){if(n=r.alternate,n!==null&&Lm(n)===null){e.child=r;break}n=r.sibling,r.sibling=t,t=r,r=n}Cy(e,!0,t,null,s);break;case"together":Cy(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function em(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function Gs(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),qa|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(Se(153));if(e.child!==null){for(n=e.child,t=Lo(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=Lo(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function xF(n,e,t){switch(e.tag){case 3:nP(e),Su();break;case 5:R2(e);break;case 1:Si(e.type)&&Em(e);break;case 4:A_(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;Ht(Pm,i._currentValue),i._currentValue=r;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(Ht($t,$t.current&1),e.flags|=128,null):t&e.child.childLanes?iP(n,e,t):(Ht($t,$t.current&1),n=Gs(n,e,t),n!==null?n.sibling:null);Ht($t,$t.current&1);break;case 19:if(i=(t&e.childLanes)!==0,n.flags&128){if(i)return rP(n,e,t);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Ht($t,$t.current),i)break;return null;case 22:case 23:return e.lanes=0,eP(n,e,t)}return Gs(n,e,t)}var sP,xx,oP,aP;sP=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};xx=function(){};oP=function(n,e,t,i){var r=n.memoizedProps;if(r!==i){n=e.stateNode,La($r.current);var s=null;switch(t){case"input":r=Gv(n,r),i=Gv(n,i),s=[];break;case"select":r=sn({},r,{value:void 0}),i=sn({},i,{value:void 0}),s=[];break;case"textarea":r=Wv(n,r),i=Wv(n,i),s=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=Sm)}Jv(t,i);var o;t=null;for(f in r)if(!i.hasOwnProperty(f)&&r.hasOwnProperty(f)&&r[f]!=null)if(f==="style"){var a=r[f];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(wf.hasOwnProperty(f)?s||(s=[]):(s=s||[]).push(f,null));for(f in i){var l=i[f];if(a=r!=null?r[f]:void 0,i.hasOwnProperty(f)&&l!==a&&(l!=null||a!=null))if(f==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(t||(t={}),t[o]=l[o])}else t||(s||(s=[]),s.push(f,t)),t=l;else f==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(f,l)):f==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(f,""+l):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(wf.hasOwnProperty(f)?(l!=null&&f==="onScroll"&&Wt("scroll",n),s||a===l||(s=[])):(s=s||[]).push(f,l))}t&&(s=s||[]).push("style",t);var f=s;(e.updateQueue=f)&&(e.flags|=4)}};aP=function(n,e,t,i){t!==i&&(e.flags|=4)};function Ec(n,e){if(!Yt)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:i.sibling=null}}function Qn(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,i=0;if(e)for(var r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=n,r=r.sibling;else for(r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=n,r=r.sibling;return n.subtreeFlags|=i,n.childLanes=t,e}function _F(n,e,t){var i=e.pendingProps;switch(p_(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qn(e),null;case 1:return Si(e.type)&&Cm(),Qn(e),null;case 3:return i=e.stateNode,Eu(),jt(wi),jt(ei),w_(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(Jd(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Tr!==null&&(bx(Tr),Tr=null))),xx(n,e),Qn(e),null;case 5:M_(e);var r=La(Ff.current);if(t=e.type,n!==null&&e.stateNode!=null)oP(n,e,t,i,r),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(Se(166));return Qn(e),null}if(n=La($r.current),Jd(e)){i=e.stateNode,t=e.type;var s=e.memoizedProps;switch(i[Zr]=e,i[If]=s,n=(e.mode&1)!==0,t){case"dialog":Wt("cancel",i),Wt("close",i);break;case"iframe":case"object":case"embed":Wt("load",i);break;case"video":case"audio":for(r=0;r<$c.length;r++)Wt($c[r],i);break;case"source":Wt("error",i);break;case"img":case"image":case"link":Wt("error",i),Wt("load",i);break;case"details":Wt("toggle",i);break;case"input":tS(i,s),Wt("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},Wt("invalid",i);break;case"textarea":iS(i,s),Wt("invalid",i)}Jv(t,s),r=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?i.textContent!==a&&(s.suppressHydrationWarning!==!0&&jd(i.textContent,a,n),r=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&jd(i.textContent,a,n),r=["children",""+a]):wf.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Wt("scroll",i)}switch(t){case"input":kd(i),nS(i,s,!0);break;case"textarea":kd(i),rS(i);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(i.onclick=Sm)}i=r,e.updateQueue=i,i!==null&&(e.flags|=4)}else{o=r.nodeType===9?r:r.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=DT(t)),n==="http://www.w3.org/1999/xhtml"?t==="script"?(n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[Zr]=e,n[If]=i,sP(n,e,!1,!1),e.stateNode=n;e:{switch(o=Xv(t,i),t){case"dialog":Wt("cancel",n),Wt("close",n),r=i;break;case"iframe":case"object":case"embed":Wt("load",n),r=i;break;case"video":case"audio":for(r=0;r<$c.length;r++)Wt($c[r],n);r=i;break;case"source":Wt("error",n),r=i;break;case"img":case"image":case"link":Wt("error",n),Wt("load",n),r=i;break;case"details":Wt("toggle",n),r=i;break;case"input":tS(n,i),r=Gv(n,i),Wt("invalid",n);break;case"option":r=i;break;case"select":n._wrapperState={wasMultiple:!!i.multiple},r=sn({},i,{value:void 0}),Wt("invalid",n);break;case"textarea":iS(n,i),r=Wv(n,i),Wt("invalid",n);break;default:r=i}Jv(t,r),a=r;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?kT(n,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&FT(n,l)):s==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&Sf(n,l):typeof l=="number"&&Sf(n,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(wf.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Wt("scroll",n):l!=null&&$1(n,s,l,o))}switch(t){case"input":kd(n),nS(n,i,!1);break;case"textarea":kd(n),rS(n);break;case"option":i.value!=null&&n.setAttribute("value",""+No(i.value));break;case"select":n.multiple=!!i.multiple,s=i.value,s!=null?du(n,!!i.multiple,s,!1):i.defaultValue!=null&&du(n,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(n.onclick=Sm)}switch(t){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Qn(e),null;case 6:if(n&&e.stateNode!=null)aP(n,e,n.memoizedProps,i);else{if(typeof i!="string"&&e.stateNode===null)throw Error(Se(166));if(t=La(Ff.current),La($r.current),Jd(e)){if(i=e.stateNode,t=e.memoizedProps,i[Zr]=e,(s=i.nodeValue!==t)&&(n=Oi,n!==null))switch(n.tag){case 3:jd(i.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&jd(i.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else i=(t.nodeType===9?t:t.ownerDocument).createTextNode(i),i[Zr]=e,e.stateNode=i}return Qn(e),null;case 13:if(jt($t),i=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(Yt&&Ni!==null&&e.mode&1&&!(e.flags&128))S2(),Su(),e.flags|=98560,s=!1;else if(s=Jd(e),i!==null&&i.dehydrated!==null){if(n===null){if(!s)throw Error(Se(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Se(317));s[Zr]=e}else Su(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Qn(e),s=!1}else Tr!==null&&(bx(Tr),Tr=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(i=i!==null,i!==(n!==null&&n.memoizedState!==null)&&i&&(e.child.flags|=8192,e.mode&1&&(n===null||$t.current&1?En===0&&(En=3):F_())),e.updateQueue!==null&&(e.flags|=4),Qn(e),null);case 4:return Eu(),xx(n,e),n===null&&Rf(e.stateNode.containerInfo),Qn(e),null;case 10:return v_(e.type._context),Qn(e),null;case 17:return Si(e.type)&&Cm(),Qn(e),null;case 19:if(jt($t),s=e.memoizedState,s===null)return Qn(e),null;if(i=(e.flags&128)!==0,o=s.rendering,o===null)if(i)Ec(s,!1);else{if(En!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(o=Lm(n),o!==null){for(e.flags|=128,Ec(s,!1),i=o.updateQueue,i!==null&&(e.updateQueue=i,e.flags|=4),e.subtreeFlags=0,i=t,t=e.child;t!==null;)s=t,n=i,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=n,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,n=o.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return Ht($t,$t.current&1|2),e.child}n=n.sibling}s.tail!==null&&mn()>Tu&&(e.flags|=128,i=!0,Ec(s,!1),e.lanes=4194304)}else{if(!i)if(n=Lm(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Ec(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Yt)return Qn(e),null}else 2*mn()-s.renderingStartTime>Tu&&t!==1073741824&&(e.flags|=128,i=!0,Ec(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=mn(),e.sibling=null,t=$t.current,Ht($t,i?t&1|2:t&1),e):(Qn(e),null);case 22:case 23:return D_(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Di&1073741824&&(Qn(e),e.subtreeFlags&6&&(e.flags|=8192)):Qn(e),null;case 24:return null;case 25:return null}throw Error(Se(156,e.tag))}function AF(n,e){switch(p_(e),e.tag){case 1:return Si(e.type)&&Cm(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Eu(),jt(wi),jt(ei),w_(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return M_(e),null;case 13:if(jt($t),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Se(340));Su()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return jt($t),null;case 4:return Eu(),null;case 10:return v_(e.type._context),null;case 22:case 23:return D_(),null;case 24:return null;default:return null}}var Yd=!1,$n=!1,MF=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function ru(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){cn(n,e,i)}else t.current=null}function _x(n,e,t){try{t()}catch(i){cn(n,e,i)}}var XS=!1;function wF(n,e){if(ix=Am,n=f2(),h_(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,f=0,h=0,d=n,p=null;t:for(;;){for(var m;d!==t||r!==0&&d.nodeType!==3||(a=o+r),d!==s||i!==0&&d.nodeType!==3||(l=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===n)break t;if(p===t&&++f===r&&(a=o),p===s&&++h===i&&(l=o),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(rx={focusedElem:n,selectionRange:t},Am=!1,Ge=e;Ge!==null;)if(e=Ge,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Ge=n;else for(;Ge!==null;){e=Ge;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,x=v.memoizedState,_=e.stateNode,A=_.getSnapshotBeforeUpdate(e.elementType===e.type?y:Cr(e.type,y),x);_.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Se(163))}}catch(S){cn(e,e.return,S)}if(n=e.sibling,n!==null){n.return=e.return,Ge=n;break}Ge=e.return}return v=XS,XS=!1,v}function uf(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&_x(e,t,s)}r=r.next}while(r!==i)}}function hg(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function Ax(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function lP(n){var e=n.alternate;e!==null&&(n.alternate=null,lP(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Zr],delete e[If],delete e[ax],delete e[sF],delete e[oF])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function uP(n){return n.tag===5||n.tag===3||n.tag===4}function KS(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||uP(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Mx(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Sm));else if(i!==4&&(n=n.child,n!==null))for(Mx(n,e,t),n=n.sibling;n!==null;)Mx(n,e,t),n=n.sibling}function wx(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(wx(n,e,t),n=n.sibling;n!==null;)wx(n,e,t),n=n.sibling}var Un=null,Er=!1;function io(n,e,t){for(t=t.child;t!==null;)cP(n,e,t),t=t.sibling}function cP(n,e,t){if(qr&&typeof qr.onCommitFiberUnmount=="function")try{qr.onCommitFiberUnmount(rg,t)}catch{}switch(t.tag){case 5:$n||ru(t,e);case 6:var i=Un,r=Er;Un=null,io(n,e,t),Un=i,Er=r,Un!==null&&(Er?(n=Un,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Un.removeChild(t.stateNode));break;case 18:Un!==null&&(Er?(n=Un,t=t.stateNode,n.nodeType===8?vy(n.parentNode,t):n.nodeType===1&&vy(n,t),Tf(n)):vy(Un,t.stateNode));break;case 4:i=Un,r=Er,Un=t.stateNode.containerInfo,Er=!0,io(n,e,t),Un=i,Er=r;break;case 0:case 11:case 14:case 15:if(!$n&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&_x(t,e,o),r=r.next}while(r!==i)}io(n,e,t);break;case 1:if(!$n&&(ru(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){cn(t,e,a)}io(n,e,t);break;case 21:io(n,e,t);break;case 22:t.mode&1?($n=(i=$n)||t.memoizedState!==null,io(n,e,t),$n=i):io(n,e,t);break;default:io(n,e,t)}}function YS(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new MF),e.forEach(function(i){var r=LF.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function Ar(n,e){var t=e.deletions;if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];try{var s=n,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Un=a.stateNode,Er=!1;break e;case 3:Un=a.stateNode.containerInfo,Er=!0;break e;case 4:Un=a.stateNode.containerInfo,Er=!0;break e}a=a.return}if(Un===null)throw Error(Se(160));cP(s,o,r),Un=null,Er=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(f){cn(r,e,f)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)fP(e,n),e=e.sibling}function fP(n,e){var t=n.alternate,i=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Ar(e,n),Kr(n),i&4){try{uf(3,n,n.return),hg(3,n)}catch(y){cn(n,n.return,y)}try{uf(5,n,n.return)}catch(y){cn(n,n.return,y)}}break;case 1:Ar(e,n),Kr(n),i&512&&t!==null&&ru(t,t.return);break;case 5:if(Ar(e,n),Kr(n),i&512&&t!==null&&ru(t,t.return),n.flags&32){var r=n.stateNode;try{Sf(r,"")}catch(y){cn(n,n.return,y)}}if(i&4&&(r=n.stateNode,r!=null)){var s=n.memoizedProps,o=t!==null?t.memoizedProps:s,a=n.type,l=n.updateQueue;if(n.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&<(r,s),Xv(a,o);var f=Xv(a,s);for(o=0;o<l.length;o+=2){var h=l[o],d=l[o+1];h==="style"?kT(r,d):h==="dangerouslySetInnerHTML"?FT(r,d):h==="children"?Sf(r,d):$1(r,h,d,f)}switch(a){case"input":Hv(r,s);break;case"textarea":IT(r,s);break;case"select":var p=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?du(r,!!s.multiple,m,!1):p!==!!s.multiple&&(s.defaultValue!=null?du(r,!!s.multiple,s.defaultValue,!0):du(r,!!s.multiple,s.multiple?[]:"",!1))}r[If]=s}catch(y){cn(n,n.return,y)}}break;case 6:if(Ar(e,n),Kr(n),i&4){if(n.stateNode===null)throw Error(Se(162));r=n.stateNode,s=n.memoizedProps;try{r.nodeValue=s}catch(y){cn(n,n.return,y)}}break;case 3:if(Ar(e,n),Kr(n),i&4&&t!==null&&t.memoizedState.isDehydrated)try{Tf(e.containerInfo)}catch(y){cn(n,n.return,y)}break;case 4:Ar(e,n),Kr(n);break;case 13:Ar(e,n),Kr(n),r=n.child,r.flags&8192&&(s=r.memoizedState!==null,r.stateNode.isHidden=s,!s||r.alternate!==null&&r.alternate.memoizedState!==null||(L_=mn())),i&4&&YS(n);break;case 22:if(h=t!==null&&t.memoizedState!==null,n.mode&1?($n=(f=$n)||h,Ar(e,n),$n=f):Ar(e,n),Kr(n),i&8192){if(f=n.memoizedState!==null,(n.stateNode.isHidden=f)&&!h&&n.mode&1)for(Ge=n,h=n.child;h!==null;){for(d=Ge=h;Ge!==null;){switch(p=Ge,m=p.child,p.tag){case 0:case 11:case 14:case 15:uf(4,p,p.return);break;case 1:ru(p,p.return);var v=p.stateNode;if(typeof v.componentWillUnmount=="function"){i=p,t=p.return;try{e=i,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(y){cn(i,t,y)}}break;case 5:ru(p,p.return);break;case 22:if(p.memoizedState!==null){ZS(d);continue}}m!==null?(m.return=p,Ge=m):ZS(d)}h=h.sibling}e:for(h=null,d=n;;){if(d.tag===5){if(h===null){h=d;try{r=d.stateNode,f?(s=r.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=NT("display",o))}catch(y){cn(n,n.return,y)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=f?"":d.memoizedProps}catch(y){cn(n,n.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===n)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===n)break e;for(;d.sibling===null;){if(d.return===null||d.return===n)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Ar(e,n),Kr(n),i&4&&YS(n);break;case 21:break;default:Ar(e,n),Kr(n)}}function Kr(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(uP(t)){var i=t;break e}t=t.return}throw Error(Se(160))}switch(i.tag){case 5:var r=i.stateNode;i.flags&32&&(Sf(r,""),i.flags&=-33);var s=KS(n);wx(n,s,r);break;case 3:case 4:var o=i.stateNode.containerInfo,a=KS(n);Mx(n,a,o);break;default:throw Error(Se(161))}}catch(l){cn(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function SF(n,e,t){Ge=n,hP(n)}function hP(n,e,t){for(var i=(n.mode&1)!==0;Ge!==null;){var r=Ge,s=r.child;if(r.tag===22&&i){var o=r.memoizedState!==null||Yd;if(!o){var a=r.alternate,l=a!==null&&a.memoizedState!==null||$n;a=Yd;var f=$n;if(Yd=o,($n=l)&&!f)for(Ge=r;Ge!==null;)o=Ge,l=o.child,o.tag===22&&o.memoizedState!==null?qS(r):l!==null?(l.return=o,Ge=l):qS(r);for(;s!==null;)Ge=s,hP(s),s=s.sibling;Ge=r,Yd=a,$n=f}QS(n)}else r.subtreeFlags&8772&&s!==null?(s.return=r,Ge=s):QS(n)}}function QS(n){for(;Ge!==null;){var e=Ge;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:$n||hg(5,e);break;case 1:var i=e.stateNode;if(e.flags&4&&!$n)if(t===null)i.componentDidMount();else{var r=e.elementType===e.type?t.memoizedProps:Cr(e.type,t.memoizedProps);i.componentDidUpdate(r,t.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&IS(e,s,i);break;case 3:var o=e.updateQueue;if(o!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}IS(e,o,t)}break;case 5:var a=e.stateNode;if(t===null&&e.flags&4){t=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&t.focus();break;case"img":l.src&&(t.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var f=e.alternate;if(f!==null){var h=f.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&Tf(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Se(163))}$n||e.flags&512&&Ax(e)}catch(p){cn(e,e.return,p)}}if(e===n){Ge=null;break}if(t=e.sibling,t!==null){t.return=e.return,Ge=t;break}Ge=e.return}}function ZS(n){for(;Ge!==null;){var e=Ge;if(e===n){Ge=null;break}var t=e.sibling;if(t!==null){t.return=e.return,Ge=t;break}Ge=e.return}}function qS(n){for(;Ge!==null;){var e=Ge;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{hg(4,e)}catch(l){cn(e,t,l)}break;case 1:var i=e.stateNode;if(typeof i.componentDidMount=="function"){var r=e.return;try{i.componentDidMount()}catch(l){cn(e,r,l)}}var s=e.return;try{Ax(e)}catch(l){cn(e,s,l)}break;case 5:var o=e.return;try{Ax(e)}catch(l){cn(e,o,l)}}}catch(l){cn(e,e.return,l)}if(e===n){Ge=null;break}var a=e.sibling;if(a!==null){a.return=e.return,Ge=a;break}Ge=e.return}}var CF=Math.ceil,Fm=js.ReactCurrentDispatcher,B_=js.ReactCurrentOwner,hr=js.ReactCurrentBatchConfig,Bt=0,kn=null,An=null,Hn=0,Di=0,su=Jo(0),En=0,Uf=null,qa=0,dg=0,R_=0,cf=null,_i=null,L_=0,Tu=1/0,Ss=null,Nm=!1,Sx=null,Bo=null,Qd=!1,Ao=null,km=0,ff=0,Cx=null,tm=-1,nm=0;function ci(){return Bt&6?mn():tm!==-1?tm:tm=mn()}function Ro(n){return n.mode&1?Bt&2&&Hn!==0?Hn&-Hn:lF.transition!==null?(nm===0&&(nm=YT()),nm):(n=kt,n!==0||(n=window.event,n=n===void 0?16:n2(n.type)),n):1}function Lr(n,e,t,i){if(50<ff)throw ff=0,Cx=null,Error(Se(185));uh(n,t,i),(!(Bt&2)||n!==kn)&&(n===kn&&(!(Bt&2)&&(dg|=t),En===4&&xo(n,Hn)),Ci(n,i),t===1&&Bt===0&&!(e.mode&1)&&(Tu=mn()+500,ug&&Xo()))}function Ci(n,e){var t=n.callbackNode;lD(n,e);var i=_m(n,n===kn?Hn:0);if(i===0)t!==null&&aS(t),n.callbackNode=null,n.callbackPriority=0;else if(e=i&-i,n.callbackPriority!==e){if(t!=null&&aS(t),e===1)n.tag===0?aF($S.bind(null,n)):A2($S.bind(null,n)),iF(function(){!(Bt&6)&&Xo()}),t=null;else{switch(QT(i)){case 1:t=r_;break;case 4:t=XT;break;case 16:t=xm;break;case 536870912:t=KT;break;default:t=xm}t=_P(t,dP.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function dP(n,e){if(tm=-1,nm=0,Bt&6)throw Error(Se(327));var t=n.callbackNode;if(vu()&&n.callbackNode!==t)return null;var i=_m(n,n===kn?Hn:0);if(i===0)return null;if(i&30||i&n.expiredLanes||e)e=Om(n,i);else{e=i;var r=Bt;Bt|=2;var s=mP();(kn!==n||Hn!==e)&&(Ss=null,Tu=mn()+500,za(n,e));do try{TF();break}catch(a){pP(n,a)}while(1);y_(),Fm.current=s,Bt=r,An!==null?e=0:(kn=null,Hn=0,e=En)}if(e!==0){if(e===2&&(r=qv(n),r!==0&&(i=r,e=Ex(n,r))),e===1)throw t=Uf,za(n,0),xo(n,i),Ci(n,mn()),t;if(e===6)xo(n,i);else{if(r=n.current.alternate,!(i&30)&&!EF(r)&&(e=Om(n,i),e===2&&(s=qv(n),s!==0&&(i=s,e=Ex(n,s))),e===1))throw t=Uf,za(n,0),xo(n,i),Ci(n,mn()),t;switch(n.finishedWork=r,n.finishedLanes=i,e){case 0:case 1:throw Error(Se(345));case 2:Aa(n,_i,Ss);break;case 3:if(xo(n,i),(i&130023424)===i&&(e=L_+500-mn(),10<e)){if(_m(n,0)!==0)break;if(r=n.suspendedLanes,(r&i)!==i){ci(),n.pingedLanes|=n.suspendedLanes&r;break}n.timeoutHandle=ox(Aa.bind(null,n,_i,Ss),e);break}Aa(n,_i,Ss);break;case 4:if(xo(n,i),(i&4194240)===i)break;for(e=n.eventTimes,r=-1;0<i;){var o=31-Rr(i);s=1<<o,o=e[o],o>r&&(r=o),i&=~s}if(i=r,i=mn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*CF(i/1960))-i,10<i){n.timeoutHandle=ox(Aa.bind(null,n,_i,Ss),i);break}Aa(n,_i,Ss);break;case 5:Aa(n,_i,Ss);break;default:throw Error(Se(329))}}}return Ci(n,mn()),n.callbackNode===t?dP.bind(null,n):null}function Ex(n,e){var t=cf;return n.current.memoizedState.isDehydrated&&(za(n,e).flags|=256),n=Om(n,e),n!==2&&(e=_i,_i=t,e!==null&&bx(e)),n}function bx(n){_i===null?_i=n:_i.push.apply(_i,n)}function EF(n){for(var e=n;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var i=0;i<t.length;i++){var r=t[i],s=r.getSnapshot;r=r.value;try{if(!Fr(s(),r))return!1}catch{return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function xo(n,e){for(e&=~R_,e&=~dg,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-Rr(e),i=1<<t;n[t]=-1,e&=~i}}function $S(n){if(Bt&6)throw Error(Se(327));vu();var e=_m(n,0);if(!(e&1))return Ci(n,mn()),null;var t=Om(n,e);if(n.tag!==0&&t===2){var i=qv(n);i!==0&&(e=i,t=Ex(n,i))}if(t===1)throw t=Uf,za(n,0),xo(n,e),Ci(n,mn()),t;if(t===6)throw Error(Se(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,Aa(n,_i,Ss),Ci(n,mn()),null}function I_(n,e){var t=Bt;Bt|=1;try{return n(e)}finally{Bt=t,Bt===0&&(Tu=mn()+500,ug&&Xo())}}function $a(n){Ao!==null&&Ao.tag===0&&!(Bt&6)&&vu();var e=Bt;Bt|=1;var t=hr.transition,i=kt;try{if(hr.transition=null,kt=1,n)return n()}finally{kt=i,hr.transition=t,Bt=e,!(Bt&6)&&Xo()}}function D_(){Di=su.current,jt(su)}function za(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,nF(t)),An!==null)for(t=An.return;t!==null;){var i=t;switch(p_(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Cm();break;case 3:Eu(),jt(wi),jt(ei),w_();break;case 5:M_(i);break;case 4:Eu();break;case 13:jt($t);break;case 19:jt($t);break;case 10:v_(i.type._context);break;case 22:case 23:D_()}t=t.return}if(kn=n,An=n=Lo(n.current,null),Hn=Di=e,En=0,Uf=null,R_=dg=qa=0,_i=cf=null,Ra!==null){for(e=0;e<Ra.length;e++)if(t=Ra[e],i=t.interleaved,i!==null){t.interleaved=null;var r=i.next,s=t.pending;if(s!==null){var o=s.next;s.next=r,i.next=o}t.pending=i}Ra=null}return n}function pP(n,e){do{var t=An;try{if(y_(),qp.current=Dm,Im){for(var i=rn.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}Im=!1}if(Za=0,Nn=Cn=rn=null,lf=!1,Nf=0,B_.current=null,t===null||t.return===null){En=1,Uf=e,An=null;break}e:{var s=n,o=t.return,a=t,l=e;if(e=Hn,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var f=l,h=a,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var p=h.alternate;p?(h.updateQueue=p.updateQueue,h.memoizedState=p.memoizedState,h.lanes=p.lanes):(h.updateQueue=null,h.memoizedState=null)}var m=zS(o);if(m!==null){m.flags&=-257,GS(m,o,a,s,e),m.mode&1&&US(s,f,e),e=m,l=f;var v=e.updateQueue;if(v===null){var y=new Set;y.add(l),e.updateQueue=y}else v.add(l);break e}else{if(!(e&1)){US(s,f,e),F_();break e}l=Error(Se(426))}}else if(Yt&&a.mode&1){var x=zS(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),GS(x,o,a,s,e),m_(bu(l,a));break e}}s=l=bu(l,a),En!==4&&(En=2),cf===null?cf=[s]:cf.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var _=Z2(s,l,e);LS(s,_);break e;case 1:a=l;var A=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof A.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Bo===null||!Bo.has(w)))){s.flags|=65536,e&=-e,s.lanes|=e;var S=q2(s,a,e);LS(s,S);break e}}s=s.return}while(s!==null)}yP(t)}catch(b){e=b,An===t&&t!==null&&(An=t=t.return);continue}break}while(1)}function mP(){var n=Fm.current;return Fm.current=Dm,n===null?Dm:n}function F_(){(En===0||En===3||En===2)&&(En=4),kn===null||!(qa&268435455)&&!(dg&268435455)||xo(kn,Hn)}function Om(n,e){var t=Bt;Bt|=2;var i=mP();(kn!==n||Hn!==e)&&(Ss=null,za(n,e));do try{bF();break}catch(r){pP(n,r)}while(1);if(y_(),Bt=t,Fm.current=i,An!==null)throw Error(Se(261));return kn=null,Hn=0,En}function bF(){for(;An!==null;)gP(An)}function TF(){for(;An!==null&&!$I();)gP(An)}function gP(n){var e=xP(n.alternate,n,Di);n.memoizedProps=n.pendingProps,e===null?yP(n):An=e,B_.current=null}function yP(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=AF(t,e),t!==null){t.flags&=32767,An=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{En=6,An=null;return}}else if(t=_F(t,e,Di),t!==null){An=t;return}if(e=e.sibling,e!==null){An=e;return}An=e=n}while(e!==null);En===0&&(En=5)}function Aa(n,e,t){var i=kt,r=hr.transition;try{hr.transition=null,kt=1,PF(n,e,t,i)}finally{hr.transition=r,kt=i}return null}function PF(n,e,t,i){do vu();while(Ao!==null);if(Bt&6)throw Error(Se(327));t=n.finishedWork;var r=n.finishedLanes;if(t===null)return null;if(n.finishedWork=null,n.finishedLanes=0,t===n.current)throw Error(Se(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(uD(n,s),n===kn&&(An=kn=null,Hn=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||Qd||(Qd=!0,_P(xm,function(){return vu(),null})),s=(t.flags&15990)!==0,t.subtreeFlags&15990||s){s=hr.transition,hr.transition=null;var o=kt;kt=1;var a=Bt;Bt|=4,B_.current=null,wF(n,t),fP(t,n),YD(rx),Am=!!ix,rx=ix=null,n.current=t,SF(t),eD(),Bt=a,kt=o,hr.transition=s}else n.current=t;if(Qd&&(Qd=!1,Ao=n,km=r),s=n.pendingLanes,s===0&&(Bo=null),iD(t.stateNode),Ci(n,mn()),e!==null)for(i=n.onRecoverableError,t=0;t<e.length;t++)r=e[t],i(r.value,{componentStack:r.stack,digest:r.digest});if(Nm)throw Nm=!1,n=Sx,Sx=null,n;return km&1&&n.tag!==0&&vu(),s=n.pendingLanes,s&1?n===Cx?ff++:(ff=0,Cx=n):ff=0,Xo(),null}function vu(){if(Ao!==null){var n=QT(km),e=hr.transition,t=kt;try{if(hr.transition=null,kt=16>n?16:n,Ao===null)var i=!1;else{if(n=Ao,Ao=null,km=0,Bt&6)throw Error(Se(331));var r=Bt;for(Bt|=4,Ge=n.current;Ge!==null;){var s=Ge,o=s.child;if(Ge.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var f=a[l];for(Ge=f;Ge!==null;){var h=Ge;switch(h.tag){case 0:case 11:case 15:uf(8,h,s)}var d=h.child;if(d!==null)d.return=h,Ge=d;else for(;Ge!==null;){h=Ge;var p=h.sibling,m=h.return;if(lP(h),h===f){Ge=null;break}if(p!==null){p.return=m,Ge=p;break}Ge=m}}}var v=s.alternate;if(v!==null){var y=v.child;if(y!==null){v.child=null;do{var x=y.sibling;y.sibling=null,y=x}while(y!==null)}}Ge=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,Ge=o;else e:for(;Ge!==null;){if(s=Ge,s.flags&2048)switch(s.tag){case 0:case 11:case 15:uf(9,s,s.return)}var _=s.sibling;if(_!==null){_.return=s.return,Ge=_;break e}Ge=s.return}}var A=n.current;for(Ge=A;Ge!==null;){o=Ge;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,Ge=w;else e:for(o=A;Ge!==null;){if(a=Ge,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:hg(9,a)}}catch(b){cn(a,a.return,b)}if(a===o){Ge=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,Ge=S;break e}Ge=a.return}}if(Bt=r,Xo(),qr&&typeof qr.onPostCommitFiberRoot=="function")try{qr.onPostCommitFiberRoot(rg,n)}catch{}i=!0}return i}finally{kt=t,hr.transition=e}}return!1}function eC(n,e,t){e=bu(t,e),e=Z2(n,e,1),n=Po(n,e,1),e=ci(),n!==null&&(uh(n,1,e),Ci(n,e))}function cn(n,e,t){if(n.tag===3)eC(n,n,t);else for(;e!==null;){if(e.tag===3){eC(e,n,t);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Bo===null||!Bo.has(i))){n=bu(t,n),n=q2(e,n,1),e=Po(e,n,1),n=ci(),e!==null&&(uh(e,1,n),Ci(e,n));break}}e=e.return}}function BF(n,e,t){var i=n.pingCache;i!==null&&i.delete(e),e=ci(),n.pingedLanes|=n.suspendedLanes&t,kn===n&&(Hn&t)===t&&(En===4||En===3&&(Hn&130023424)===Hn&&500>mn()-L_?za(n,0):R_|=t),Ci(n,e)}function vP(n,e){e===0&&(n.mode&1?(e=zd,zd<<=1,!(zd&130023424)&&(zd=4194304)):e=1);var t=ci();n=zs(n,e),n!==null&&(uh(n,e,t),Ci(n,t))}function RF(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),vP(n,t)}function LF(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Se(314))}i!==null&&i.delete(e),vP(n,t)}var xP;xP=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||wi.current)Mi=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Mi=!1,xF(n,e,t);Mi=!!(n.flags&131072)}else Mi=!1,Yt&&e.flags&1048576&&M2(e,Tm,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;em(n,e),n=e.pendingProps;var r=wu(e,ei.current);yu(e,t),r=C_(null,e,i,n,r,t);var s=E_();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Si(i)?(s=!0,Em(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,__(e),r.updater=cg,e.stateNode=r,r._reactInternals=e,dx(e,i,n,t),e=gx(null,e,i,!0,s,t)):(e.tag=0,Yt&&s&&d_(e),li(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(em(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=DF(i),n=Cr(i,n),r){case 0:e=mx(null,e,i,n,t);break e;case 1:e=WS(null,e,i,n,t);break e;case 11:e=HS(null,e,i,n,t);break e;case 14:e=VS(null,e,i,Cr(i.type,n),t);break e}throw Error(Se(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Cr(i,r),mx(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Cr(i,r),WS(n,e,i,r,t);case 3:e:{if(nP(e),n===null)throw Error(Se(387));i=e.pendingProps,s=e.memoizedState,r=s.element,E2(n,e),Rm(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=bu(Error(Se(423)),e),e=jS(n,e,i,t,r);break e}else if(i!==r){r=bu(Error(Se(424)),e),e=jS(n,e,i,t,r);break e}else for(Ni=To(e.stateNode.containerInfo.firstChild),Oi=e,Yt=!0,Tr=null,t=B2(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Su(),i===r){e=Gs(n,e,t);break e}li(n,e,i,t)}e=e.child}return e;case 5:return R2(e),n===null&&cx(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,sx(i,r)?o=null:s!==null&&sx(i,s)&&(e.flags|=32),tP(n,e),li(n,e,o,t),e.child;case 6:return n===null&&cx(e),null;case 13:return iP(n,e,t);case 4:return A_(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Cu(e,null,i,t):li(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Cr(i,r),HS(n,e,i,r,t);case 7:return li(n,e,e.pendingProps,t),e.child;case 8:return li(n,e,e.pendingProps.children,t),e.child;case 12:return li(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,Ht(Pm,i._currentValue),i._currentValue=o,s!==null)if(Fr(s.value,o)){if(s.children===r.children&&!wi.current){e=Gs(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=Ds(-1,t&-t),l.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?l.next=l:(l.next=h.next,h.next=l),f.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),fx(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Se(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),fx(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}li(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,yu(e,t),r=pr(r),i=i(r),e.flags|=1,li(n,e,i,t),e.child;case 14:return i=e.type,r=Cr(i,e.pendingProps),r=Cr(i.type,r),VS(n,e,i,r,t);case 15:return $2(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Cr(i,r),em(n,e),e.tag=1,Si(i)?(n=!0,Em(e)):n=!1,yu(e,t),T2(e,i,r),dx(e,i,r,t),gx(null,e,i,!0,n,t);case 19:return rP(n,e,t);case 22:return eP(n,e,t)}throw Error(Se(156,e.tag))};function _P(n,e){return JT(n,e)}function IF(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fr(n,e,t,i){return new IF(n,e,t,i)}function N_(n){return n=n.prototype,!(!n||!n.isReactComponent)}function DF(n){if(typeof n=="function")return N_(n)?1:0;if(n!=null){if(n=n.$$typeof,n===t_)return 11;if(n===n_)return 14}return 2}function Lo(n,e){var t=n.alternate;return t===null?(t=fr(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function im(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")N_(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Yl:return Ga(t.children,r,s,e);case e_:o=8,r|=8;break;case kv:return n=fr(12,t,e,r|2),n.elementType=kv,n.lanes=s,n;case Ov:return n=fr(13,t,e,r),n.elementType=Ov,n.lanes=s,n;case Uv:return n=fr(19,t,e,r),n.elementType=Uv,n.lanes=s,n;case PT:return pg(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case bT:o=10;break e;case TT:o=9;break e;case t_:o=11;break e;case n_:o=14;break e;case po:o=16,i=null;break e}throw Error(Se(130,n==null?n:typeof n,""))}return e=fr(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function Ga(n,e,t,i){return n=fr(7,n,i,e),n.lanes=t,n}function pg(n,e,t,i){return n=fr(22,n,i,e),n.elementType=PT,n.lanes=t,n.stateNode={isHidden:!1},n}function Ey(n,e,t){return n=fr(6,n,null,e),n.lanes=t,n}function by(n,e,t){return e=fr(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function FF(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ay(0),this.expirationTimes=ay(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ay(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function k_(n,e,t,i,r,s,o,a,l){return n=new FF(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=fr(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},__(s),n}function NF(n,e,t){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Kl,key:i==null?null:""+i,children:n,containerInfo:e,implementation:t}}function AP(n){if(!n)return ko;n=n._reactInternals;e:{if(sl(n)!==n||n.tag!==1)throw Error(Se(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Si(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Se(171))}if(n.tag===1){var t=n.type;if(Si(t))return _2(n,t,e)}return e}function MP(n,e,t,i,r,s,o,a,l){return n=k_(t,i,!0,n,r,s,o,a,l),n.context=AP(null),t=n.current,i=ci(),r=Ro(t),s=Ds(i,r),s.callback=e??null,Po(t,s,r),n.current.lanes=r,uh(n,r,i),Ci(n,i),n}function mg(n,e,t,i){var r=e.current,s=ci(),o=Ro(r);return t=AP(t),e.context===null?e.context=t:e.pendingContext=t,e=Ds(s,o),e.payload={element:n},i=i===void 0?null:i,i!==null&&(e.callback=i),n=Po(r,e,o),n!==null&&(Lr(n,r,o,s),Zp(n,r,o)),o}function Um(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function tC(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function O_(n,e){tC(n,e),(n=n.alternate)&&tC(n,e)}function kF(){return null}var wP=typeof reportError=="function"?reportError:function(n){console.error(n)};function U_(n){this._internalRoot=n}gg.prototype.render=U_.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(Se(409));mg(n,e,null,null)};gg.prototype.unmount=U_.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;$a(function(){mg(null,n,null,null)}),e[Us]=null}};function gg(n){this._internalRoot=n}gg.prototype.unstable_scheduleHydration=function(n){if(n){var e=$T();n={blockedOn:null,target:n,priority:e};for(var t=0;t<vo.length&&e!==0&&e<vo[t].priority;t++);vo.splice(t,0,n),t===0&&t2(n)}};function z_(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function yg(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function nC(){}function OF(n,e,t,i,r){if(r){if(typeof i=="function"){var s=i;i=function(){var f=Um(o);s.call(f)}}var o=MP(e,i,n,0,null,!1,!1,"",nC);return n._reactRootContainer=o,n[Us]=o.current,Rf(n.nodeType===8?n.parentNode:n),$a(),o}for(;r=n.lastChild;)n.removeChild(r);if(typeof i=="function"){var a=i;i=function(){var f=Um(l);a.call(f)}}var l=k_(n,0,!1,null,null,!1,!1,"",nC);return n._reactRootContainer=l,n[Us]=l.current,Rf(n.nodeType===8?n.parentNode:n),$a(function(){mg(e,l,t,i)}),l}function vg(n,e,t,i,r){var s=t._reactRootContainer;if(s){var o=s;if(typeof r=="function"){var a=r;r=function(){var l=Um(o);a.call(l)}}mg(e,o,n,r)}else o=OF(t,e,n,r,i);return Um(o)}ZT=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=qc(e.pendingLanes);t!==0&&(s_(e,t|1),Ci(e,mn()),!(Bt&6)&&(Tu=mn()+500,Xo()))}break;case 13:$a(function(){var i=zs(n,1);if(i!==null){var r=ci();Lr(i,n,1,r)}}),O_(n,1)}};o_=function(n){if(n.tag===13){var e=zs(n,134217728);if(e!==null){var t=ci();Lr(e,n,134217728,t)}O_(n,134217728)}};qT=function(n){if(n.tag===13){var e=Ro(n),t=zs(n,e);if(t!==null){var i=ci();Lr(t,n,e,i)}O_(n,e)}};$T=function(){return kt};e2=function(n,e){var t=kt;try{return kt=n,e()}finally{kt=t}};Yv=function(n,e,t){switch(e){case"input":if(Hv(n,t),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var i=t[e];if(i!==n&&i.form===n.form){var r=lg(i);if(!r)throw Error(Se(90));RT(i),Hv(i,r)}}}break;case"textarea":IT(n,t);break;case"select":e=t.value,e!=null&&du(n,!!t.multiple,e,!1)}};zT=I_;GT=$a;var UF={usingClientEntryPoint:!1,Events:[fh,$l,lg,OT,UT,I_]},bc={findFiberByHostInstance:Ba,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},zF={bundleType:bc.bundleType,version:bc.version,rendererPackageName:bc.rendererPackageName,rendererConfig:bc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:js.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=WT(n),n===null?null:n.stateNode},findFiberByHostInstance:bc.findFiberByHostInstance||kF,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zd.isDisabled&&Zd.supportsFiber)try{rg=Zd.inject(zF),qr=Zd}catch{}}Wi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=UF;Wi.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!z_(e))throw Error(Se(200));return NF(n,e,null,t)};Wi.createRoot=function(n,e){if(!z_(n))throw Error(Se(299));var t=!1,i="",r=wP;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=k_(n,1,!1,null,null,t,!1,i,r),n[Us]=e.current,Rf(n.nodeType===8?n.parentNode:n),new U_(e)};Wi.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(Se(188)):(n=Object.keys(n).join(","),Error(Se(268,n)));return n=WT(e),n=n===null?null:n.stateNode,n};Wi.flushSync=function(n){return $a(n)};Wi.hydrate=function(n,e,t){if(!yg(e))throw Error(Se(200));return vg(null,n,e,!0,t)};Wi.hydrateRoot=function(n,e,t){if(!z_(n))throw Error(Se(405));var i=t!=null&&t.hydratedSources||null,r=!1,s="",o=wP;if(t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),e=MP(e,null,n,1,t??null,r,!1,s,o),n[Us]=e.current,Rf(n),i)for(n=0;n<i.length;n++)t=i[n],r=t._getVersion,r=r(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,r]:e.mutableSourceEagerHydrationData.push(t,r);return new gg(e)};Wi.render=function(n,e,t){if(!yg(e))throw Error(Se(200));return vg(null,n,e,!1,t)};Wi.unmountComponentAtNode=function(n){if(!yg(n))throw Error(Se(40));return n._reactRootContainer?($a(function(){vg(null,null,n,!1,function(){n._reactRootContainer=null,n[Us]=null})}),!0):!1};Wi.unstable_batchedUpdates=I_;Wi.unstable_renderSubtreeIntoContainer=function(n,e,t,i){if(!yg(t))throw Error(Se(200));if(n==null||n._reactInternals===void 0)throw Error(Se(38));return vg(n,e,t,!1,i)};Wi.version="18.2.0-next-9e3b772b8-20220608";(function(n){function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}e(),n.exports=Wi})(kI);var SP,iC=mm;SP=Dv.createRoot=iC.createRoot,Dv.hydrateRoot=iC.hydrateRoot;/** * @remix-run/router v1.3.2 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function zf(){return zf=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},zf.apply(this,arguments)}var Ia;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(Ia||(Ia={}));const rC="popstate";function GF(n){n===void 0&&(n={});function e(i,r){let{pathname:s,search:o,hash:a}=i.location;return Tx("",{pathname:s,search:o,hash:a},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function t(i,r){return typeof r=="string"?r:zm(r)}return VF(e,t,null,n)}function Io(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function HF(){return Math.random().toString(36).substr(2,8)}function sC(n,e){return{usr:n.state,key:n.key,idx:e}}function Tx(n,e,t,i){return t===void 0&&(t=null),zf({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?xg(e):e,{state:t,key:e&&e.key||i||HF()})}function zm(n){let{pathname:e="/",search:t="",hash:i=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function xg(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substr(i),n=n.substr(0,i)),n&&(e.pathname=n)}return e}function VF(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,a=Ia.Pop,l=null,f=h();f==null&&(f=0,o.replaceState(zf({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function d(){a=Ia.Pop;let x=h(),_=x==null?null:x-f;f=x,l&&l({action:a,location:y.location,delta:_})}function p(x,_){a=Ia.Push;let A=Tx(y.location,x,_);t&&t(A,x),f=h()+1;let w=sC(A,f),S=y.createHref(A);try{o.pushState(w,"",S)}catch{r.location.assign(S)}s&&l&&l({action:a,location:y.location,delta:1})}function m(x,_){a=Ia.Replace;let A=Tx(y.location,x,_);t&&t(A,x),f=h();let w=sC(A,f),S=y.createHref(A);o.replaceState(w,"",S),s&&l&&l({action:a,location:y.location,delta:0})}function v(x){let _=r.location.origin!=="null"?r.location.origin:r.location.href,A=typeof x=="string"?x:zm(x);return Io(_,"No window.location.(origin|href) available to create URL for href: "+A),new URL(A,_)}let y={get action(){return a},get location(){return n(r,o)},listen(x){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(rC,d),l=x,()=>{r.removeEventListener(rC,d),l=null}},createHref(x){return e(r,x)},createURL:v,encodeLocation(x){let _=v(x);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:p,replace:m,go(x){return o.go(x)}};return y}var oC;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(oC||(oC={}));function WF(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}function jF(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?xg(n):n;return{pathname:t?t.startsWith("/")?t:JF(t,e):e,search:XF(i),hash:KF(r)}}function JF(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function Ty(n,e,t,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function CP(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function EP(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=xg(n):(r=zf({},n),Io(!r.pathname||!r.pathname.includes("?"),Ty("?","pathname","search",r)),Io(!r.pathname||!r.pathname.includes("#"),Ty("#","pathname","hash",r)),Io(!r.search||!r.search.includes("#"),Ty("#","search","hash",r)));let s=n===""||r.pathname==="",o=s?"/":r.pathname,a;if(i||o==null)a=t;else{let d=e.length-1;if(o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;r.pathname=p.join("/")}a=d>=0?e[d]:"/"}let l=jF(r,a),f=o&&o!=="/"&&o.endsWith("/"),h=(s||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(f||h)&&(l.pathname+="/"),l}const bP=n=>n.join("/").replace(/\/\/+/g,"/"),XF=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,KF=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,YF=["post","put","patch","delete"];[...YF];/** * React Router v6.8.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function QF(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}const ZF=typeof Object.is=="function"?Object.is:QF,{useState:qF,useEffect:$F,useLayoutEffect:eN,useDebugValue:tN}=Iv;function nN(n,e,t){const i=e(),[{inst:r},s]=qF({inst:{value:i,getSnapshot:e}});return eN(()=>{r.value=i,r.getSnapshot=e,Py(r)&&s({inst:r})},[n,i,e]),$F(()=>(Py(r)&&s({inst:r}),n(()=>{Py(r)&&s({inst:r})})),[n]),tN(i),i}function Py(n){const e=n.getSnapshot,t=n.value;try{const i=e();return!ZF(t,i)}catch{return!0}}function iN(n,e,t){return e()}const rN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sN=!rN,oN=sN?iN:nN;"useSyncExternalStore"in Iv&&(n=>n.useSyncExternalStore)(Iv);const G_=U.createContext(null),H_=U.createContext(null),TP=U.createContext({outlet:null,matches:[]});function aN(n,e){let{relative:t}=e===void 0?{}:e;_g()||Io(!1);let{basename:i,navigator:r}=U.useContext(G_),{hash:s,pathname:o,search:a}=PP(n,{relative:t}),l=o;return i!=="/"&&(l=o==="/"?i:bP([i,o])),r.createHref({pathname:l,search:a,hash:s})}function _g(){return U.useContext(H_)!=null}function V_(){return _g()||Io(!1),U.useContext(H_).location}function lN(){_g()||Io(!1);let{basename:n,navigator:e}=U.useContext(G_),{matches:t}=U.useContext(TP),{pathname:i}=V_(),r=JSON.stringify(CP(t).map(a=>a.pathnameBase)),s=U.useRef(!1);return U.useEffect(()=>{s.current=!0}),U.useCallback(function(a,l){if(l===void 0&&(l={}),!s.current)return;if(typeof a=="number"){e.go(a);return}let f=EP(a,JSON.parse(r),i,l.relative==="path");n!=="/"&&(f.pathname=f.pathname==="/"?n:bP([n,f.pathname])),(l.replace?e.replace:e.push)(f,l.state,l)},[n,e,r,i])}function PP(n,e){let{relative:t}=e===void 0?{}:e,{matches:i}=U.useContext(TP),{pathname:r}=V_(),s=JSON.stringify(CP(i).map(o=>o.pathnameBase));return U.useMemo(()=>EP(n,JSON.parse(s),r,t==="path"),[n,s,r,t])}var aC;(function(n){n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator"})(aC||(aC={}));var lC;(function(n){n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator"})(lC||(lC={}));function uN(n){let{basename:e="/",children:t=null,location:i,navigationType:r=Ia.Pop,navigator:s,static:o=!1}=n;_g()&&Io(!1);let a=e.replace(/^\/*/,"/"),l=U.useMemo(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof i=="string"&&(i=xg(i));let{pathname:f="/",search:h="",hash:d="",state:p=null,key:m="default"}=i,v=U.useMemo(()=>{let y=WF(f,a);return y==null?null:{pathname:y,search:h,hash:d,state:p,key:m}},[a,f,h,d,p,m]);return v==null?null:U.createElement(G_.Provider,{value:l},U.createElement(H_.Provider,{children:t,value:{location:v,navigationType:r}}))}var uC;(function(n){n[n.pending=0]="pending",n[n.success=1]="success",n[n.error=2]="error"})(uC||(uC={}));new Promise(()=>{});/** * React Router DOM v6.8.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Px(){return Px=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Px.apply(this,arguments)}function cN(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function fN(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function hN(n,e){return n.button===0&&(!e||e==="_self")&&!fN(n)}const dN=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function pN(n){let{basename:e,children:t,window:i}=n,r=U.useRef();r.current==null&&(r.current=GF({window:i,v5Compat:!0}));let s=r.current,[o,a]=U.useState({action:s.action,location:s.location});return U.useLayoutEffect(()=>s.listen(a),[s]),U.createElement(uN,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}const mN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gN=U.forwardRef(function(e,t){let{onClick:i,relative:r,reloadDocument:s,replace:o,state:a,target:l,to:f,preventScrollReset:h}=e,d=cN(e,dN),p,m=!1;if(mN&&typeof f=="string"&&/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(f)){p=f;let _=new URL(window.location.href),A=f.startsWith("//")?new URL(_.protocol+f):new URL(f);A.origin===_.origin?f=A.pathname+A.search+A.hash:m=!0}let v=aN(f,{relative:r}),y=yN(f,{replace:o,state:a,target:l,preventScrollReset:h,relative:r});function x(_){i&&i(_),_.defaultPrevented||y(_)}return U.createElement("a",Px({},d,{href:p||v,onClick:m||s?i:x,ref:t,target:l}))});var cC;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmitImpl="useSubmitImpl",n.UseFetcher="useFetcher"})(cC||(cC={}));var fC;(function(n){n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(fC||(fC={}));function yN(n,e){let{target:t,replace:i,state:r,preventScrollReset:s,relative:o}=e===void 0?{}:e,a=lN(),l=V_(),f=PP(n,{relative:o});return U.useCallback(h=>{if(hN(h,t)){h.preventDefault();let d=i!==void 0?i:zm(l)===zm(f);a(n,{replace:d,state:r,preventScrollReset:s,relative:o})}},[l,a,f,i,r,t,n,s,o])}/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT */const Ag="149",Ma={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},wa={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},BP=0,Bx=1,RP=2,vN=3,LP=0,Mg=1,hf=2,Da=3,is=0,Ei=1,Br=2,xN=2,Fs=0,Ha=1,Rx=2,Lx=3,Ix=4,IP=5,Ta=100,DP=101,FP=102,Dx=103,Fx=104,NP=200,kP=201,OP=202,UP=203,W_=204,j_=205,zP=206,GP=207,HP=208,VP=209,WP=210,jP=0,JP=1,XP=2,Gm=3,KP=4,YP=5,QP=6,ZP=7,dh=0,qP=1,$P=2,Ir=0,eB=1,tB=2,nB=3,J_=4,iB=5,wg=300,Oo=301,Uo=302,Gf=303,Hf=304,Wu=306,zo=1e3,zn=1001,Pu=1002,fn=1003,Vf=1004,_N=1004,xu=1005,AN=1005,en=1006,Sg=1007,MN=1007,rs=1008,wN=1008,Hs=1009,rB=1010,sB=1011,X_=1012,oB=1013,Mo=1014,Bs=1015,Bu=1016,aB=1017,lB=1018,Va=1020,uB=1021,Ai=1023,cB=1024,fB=1025,Do=1026,el=1027,hB=1028,dB=1029,pB=1030,mB=1031,gB=1033,rm=33776,sm=33777,om=33778,am=33779,Nx=35840,kx=35841,Ox=35842,Ux=35843,yB=36196,zx=37492,Gx=37496,Hx=37808,Vx=37809,Wx=37810,jx=37811,Jx=37812,Xx=37813,Kx=37814,Yx=37815,Qx=37816,Zx=37817,qx=37818,$x=37819,e1=37820,t1=37821,lm=36492,vB=36283,n1=36284,i1=36285,r1=36286,xB=2200,_B=2201,AB=2202,Ru=2300,tl=2301,um=2302,Fa=2400,Na=2401,Wf=2402,Cg=2500,K_=2501,SN=0,MB=1,Y_=2,Vs=3e3,Ct=3001,wB=3200,SB=3201,Js=0,CB=1,CN="",br="srgb",Lu="srgb-linear",EN=0,cm=7680,bN=7681,TN=7682,PN=7683,BN=34055,RN=34056,LN=5386,IN=512,DN=513,FN=514,NN=515,kN=516,ON=517,UN=518,EB=519,jf=35044,Wa=35048,zN=35040,GN=35045,HN=35049,VN=35041,WN=35046,jN=35050,JN=35042,XN="100",s1="300 es",Hm=1035;class os{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}}const Zn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let hC=1234567;const ja=Math.PI/180,Jf=180/Math.PI;function Ui(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(Zn[n&255]+Zn[n>>8&255]+Zn[n>>16&255]+Zn[n>>24&255]+"-"+Zn[e&255]+Zn[e>>8&255]+"-"+Zn[e>>16&15|64]+Zn[e>>24&255]+"-"+Zn[t&63|128]+Zn[t>>8&255]+"-"+Zn[t>>16&255]+Zn[t>>24&255]+Zn[i&255]+Zn[i>>8&255]+Zn[i>>16&255]+Zn[i>>24&255]).toLowerCase()}function gn(n,e,t){return Math.max(e,Math.min(t,n))}function Q_(n,e){return(n%e+e)%e}function KN(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function YN(n,e,t){return n!==e?(t-n)/(e-n):0}function df(n,e,t){return(1-t)*n+t*e}function QN(n,e,t,i){return df(n,e,1-Math.exp(-t*i))}function ZN(n,e=1){return e-Math.abs(Q_(n,e*2)-e)}function qN(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function $N(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function ek(n,e){return n+Math.floor(Math.random()*(e-n+1))}function tk(n,e){return n+Math.random()*(e-n)}function nk(n){return n*(.5-Math.random())}function ik(n){n!==void 0&&(hC=n);let e=hC+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function rk(n){return n*ja}function sk(n){return n*Jf}function o1(n){return(n&n-1)===0&&n!==0}function bB(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Vm(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function ok(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),f=s((e+i)/2),h=o((e+i)/2),d=s((e-i)/2),p=o((e-i)/2),m=s((i-e)/2),v=o((i-e)/2);switch(r){case"XYX":n.set(a*h,l*d,l*p,a*f);break;case"YZY":n.set(l*p,a*h,l*d,a*f);break;case"ZXZ":n.set(l*d,l*p,a*h,a*f);break;case"XZX":n.set(a*h,l*v,l*m,a*f);break;case"YXY":n.set(l*m,a*h,l*v,a*f);break;case"ZYZ":n.set(l*v,l*m,a*h,a*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Rs(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function zt(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}var Z_=Object.freeze({__proto__:null,DEG2RAD:ja,RAD2DEG:Jf,ceilPowerOfTwo:bB,clamp:gn,damp:QN,degToRad:rk,denormalize:Rs,euclideanModulo:Q_,floorPowerOfTwo:Vm,generateUUID:Ui,inverseLerp:YN,isPowerOfTwo:o1,lerp:df,mapLinear:KN,normalize:zt,pingpong:ZN,radToDeg:sk,randFloat:tk,randFloatSpread:nk,randInt:ek,seededRandom:ik,setQuaternionFromProperEuler:ok,smootherstep:$N,smoothstep:qN});class me{constructor(e=0,t=0){me.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,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}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(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}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ui{constructor(){ui.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,i,r,s,o,a,l,f){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=s,h[5]=l,h[6]=i,h[7]=o,h[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],f=i[1],h=i[4],d=i[7],p=i[2],m=i[5],v=i[8],y=r[0],x=r[3],_=r[6],A=r[1],w=r[4],S=r[7],b=r[2],P=r[5],R=r[8];return s[0]=o*y+a*A+l*b,s[3]=o*x+a*w+l*P,s[6]=o*_+a*S+l*R,s[1]=f*y+h*A+d*b,s[4]=f*x+h*w+d*P,s[7]=f*_+h*S+d*R,s[2]=p*y+m*A+v*b,s[5]=p*x+m*w+v*P,s[8]=p*_+m*S+v*R,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],f=e[7],h=e[8];return t*o*h-t*a*f-i*s*h+i*a*l+r*s*f-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],f=e[7],h=e[8],d=h*o-a*f,p=a*l-h*s,m=f*s-o*l,v=t*d+i*p+r*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/v;return e[0]=d*y,e[1]=(r*f-h*i)*y,e[2]=(a*i-r*o)*y,e[3]=p*y,e[4]=(h*t-r*l)*y,e[5]=(r*s-a*t)*y,e[6]=m*y,e[7]=(i*l-f*t)*y,e[8]=(o*t-i*s)*y,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),f=Math.sin(s);return this.set(i*l,i*f,-i*(l*o+f*a)+o+e,-r*f,r*l,-r*(-f*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(By.makeScale(e,t)),this}rotate(e){return this.premultiply(By.makeRotation(-e)),this}translate(e,t){return this.premultiply(By.makeTranslation(e,t)),this}makeTranslation(e,t){return this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const By=new ui;function TB(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const ak={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ou(n,e){return new ak[n](e)}function Xf(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Ja(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function fm(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const Ry={[br]:{[Lu]:Ja},[Lu]:{[br]:fm}},qn={legacyMode:!0,get workingColorSpace(){return Lu},set workingColorSpace(n){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(n,e,t){if(this.legacyMode||e===t||!e||!t)return n;if(Ry[e]&&Ry[e][t]!==void 0){const i=Ry[e][t];return n.r=i(n.r),n.g=i(n.g),n.b=i(n.b),n}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(n,e){return this.convert(n,this.workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this.workingColorSpace)}},PB={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},Sn={r:0,g:0,b:0},Mr={h:0,s:0,l:0},qd={h:0,s:0,l:0};function Ly(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}function $d(n,e){return e.r=n.r,e.g=n.g,e.b=n.b,e}class Le{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,t===void 0&&i===void 0?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=br){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,qn.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=qn.workingColorSpace){return this.r=e,this.g=t,this.b=i,qn.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=qn.workingColorSpace){if(e=Q_(e,1),t=gn(t,0,1),i=gn(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=Ly(o,s,e+1/3),this.g=Ly(o,s,e),this.b=Ly(o,s,e-1/3)}return qn.toWorkingColorSpace(this,r),this}setStyle(e,t=br){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(s[1],10))/255,this.g=Math.min(255,parseInt(s[2],10))/255,this.b=Math.min(255,parseInt(s[3],10))/255,qn.toWorkingColorSpace(this,t),i(s[4]),this;if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(s[1],10))/100,this.g=Math.min(100,parseInt(s[2],10))/100,this.b=Math.min(100,parseInt(s[3],10))/100,qn.toWorkingColorSpace(this,t),i(s[4]),this;break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){const l=parseFloat(s[1])/360,f=parseFloat(s[2])/100,h=parseFloat(s[3])/100;return i(s[4]),this.setHSL(l,f,h,t)}break}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.r=parseInt(s.charAt(0)+s.charAt(0),16)/255,this.g=parseInt(s.charAt(1)+s.charAt(1),16)/255,this.b=parseInt(s.charAt(2)+s.charAt(2),16)/255,qn.toWorkingColorSpace(this,t),this;if(o===6)return this.r=parseInt(s.charAt(0)+s.charAt(1),16)/255,this.g=parseInt(s.charAt(2)+s.charAt(3),16)/255,this.b=parseInt(s.charAt(4)+s.charAt(5),16)/255,qn.toWorkingColorSpace(this,t),this}return e&&e.length>0?this.setColorName(e,t):this}setColorName(e,t=br){const i=PB[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Ja(e.r),this.g=Ja(e.g),this.b=Ja(e.b),this}copyLinearToSRGB(e){return this.r=fm(e.r),this.g=fm(e.g),this.b=fm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=br){return qn.fromWorkingColorSpace($d(this,Sn),e),gn(Sn.r*255,0,255)<<16^gn(Sn.g*255,0,255)<<8^gn(Sn.b*255,0,255)<<0}getHexString(e=br){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=qn.workingColorSpace){qn.fromWorkingColorSpace($d(this,Sn),t);const i=Sn.r,r=Sn.g,s=Sn.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,f;const h=(a+o)/2;if(a===o)l=0,f=0;else{const d=o-a;switch(f=h<=.5?d/(o+a):d/(2-o-a),o){case i:l=(r-s)/d+(r<s?6:0);break;case r:l=(s-i)/d+2;break;case s:l=(i-r)/d+4;break}l/=6}return e.h=l,e.s=f,e.l=h,e}getRGB(e,t=qn.workingColorSpace){return qn.fromWorkingColorSpace($d(this,Sn),t),e.r=Sn.r,e.g=Sn.g,e.b=Sn.b,e}getStyle(e=br){return qn.fromWorkingColorSpace($d(this,Sn),e),e!==br?`color(${e} ${Sn.r} ${Sn.g} ${Sn.b})`:`rgb(${Sn.r*255|0},${Sn.g*255|0},${Sn.b*255|0})`}offsetHSL(e,t,i){return this.getHSL(Mr),Mr.h+=e,Mr.s+=t,Mr.l+=i,this.setHSL(Mr.h,Mr.s,Mr.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Mr),e.getHSL(qd);const i=df(Mr.h,qd.h,t),r=df(Mr.s,qd.s,t),s=df(Mr.l,qd.l,t);return this.setHSL(i,r,s),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}Le.NAMES=PB;let bl;class q_{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{bl===void 0&&(bl=Xf("canvas")),bl.width=e.width,bl.height=e.height;const i=bl.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=bl}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Xf("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Ja(s[o]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(Ja(t[i]/255)*255):t[i]=Ja(t[i]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}class ka{constructor(e=null){this.isSource=!0,this.uuid=Ui(),this.data=e,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(Iy(r[o].image)):s.push(Iy(r[o]))}else s=Iy(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function Iy(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?q_.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let lk=0;class Qt extends os{constructor(e=Qt.DEFAULT_IMAGE,t=Qt.DEFAULT_MAPPING,i=zn,r=zn,s=en,o=rs,a=Ai,l=Hs,f=Qt.DEFAULT_ANISOTROPY,h=Vs){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:lk++}),this.uuid=Ui(),this.name="",this.source=new ka(e),this.mipmaps=[],this.mapping=t,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=f,this.format=a,this.internalFormat=null,this.type=l,this.offset=new me(0,0),this.repeat=new me(1,1),this.center=new me(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ui,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}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)}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.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,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,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==wg)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case zo:e.x=e.x-Math.floor(e.x);break;case zn:e.x=e.x<0?0:1;break;case Pu: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 zo:e.y=e.y-Math.floor(e.y);break;case zn:e.y=e.y<0?0:1;break;case Pu: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)}}Qt.DEFAULT_IMAGE=null;Qt.DEFAULT_MAPPING=wg;Qt.DEFAULT_ANISOTROPY=1;class Nt{constructor(e=0,t=0,i=0,r=1){Nt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,f=l[0],h=l[4],d=l[8],p=l[1],m=l[5],v=l[9],y=l[2],x=l[6],_=l[10];if(Math.abs(h-p)<.01&&Math.abs(d-y)<.01&&Math.abs(v-x)<.01){if(Math.abs(h+p)<.1&&Math.abs(d+y)<.1&&Math.abs(v+x)<.1&&Math.abs(f+m+_-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(f+1)/2,S=(m+1)/2,b=(_+1)/2,P=(h+p)/4,R=(d+y)/4,E=(v+x)/4;return w>S&&w>b?w<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(w),r=P/i,s=R/i):S>b?S<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(S),i=P/r,s=E/r):b<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(b),i=R/s,r=E/s),this.set(i,r,s,t),this}let A=Math.sqrt((x-v)*(x-v)+(d-y)*(d-y)+(p-h)*(p-h));return Math.abs(A)<.001&&(A=1),this.x=(x-v)/A,this.y=(d-y)/A,this.z=(p-h)/A,this.w=Math.acos((f+m+_-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Nr extends os{constructor(e=1,t=1,i={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Nt(0,0,e,t),this.scissorTest=!1,this.viewport=new Nt(0,0,e,t);const r={width:e,height:t,depth:1};this.texture=new Qt(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.internalFormat=i.internalFormat!==void 0?i.internalFormat:null,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:en,this.depthBuffer=i.depthBuffer!==void 0?i.depthBuffer:!0,this.stencilBuffer=i.stencilBuffer!==void 0?i.stencilBuffer:!1,this.depthTexture=i.depthTexture!==void 0?i.depthTexture:null,this.samples=i.samples!==void 0?i.samples:0}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new ka(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Eg extends Qt{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=fn,this.minFilter=fn,this.wrapR=zn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class uk extends Nr{constructor(e=1,t=1,i=1){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new Eg(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class $_ extends Qt{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=fn,this.minFilter=fn,this.wrapR=zn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ck extends Nr{constructor(e=1,t=1,i=1){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new $_(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class fk extends Nr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;o<i;o++)this.texture[o]=s.clone(),this.texture[o].isRenderTargetTexture=!0}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,s=this.texture.length;r<s;r++)this.texture[r].image.width=e,this.texture[r].image.height=t,this.texture[r].image.depth=i;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,i=e.texture.length;t<i;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}}class Vn{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,o,a){let l=i[r+0],f=i[r+1],h=i[r+2],d=i[r+3];const p=s[o+0],m=s[o+1],v=s[o+2],y=s[o+3];if(a===0){e[t+0]=l,e[t+1]=f,e[t+2]=h,e[t+3]=d;return}if(a===1){e[t+0]=p,e[t+1]=m,e[t+2]=v,e[t+3]=y;return}if(d!==y||l!==p||f!==m||h!==v){let x=1-a;const _=l*p+f*m+h*v+d*y,A=_>=0?1:-1,w=1-_*_;if(w>Number.EPSILON){const b=Math.sqrt(w),P=Math.atan2(b,_*A);x=Math.sin(x*P)/b,a=Math.sin(a*P)/b}const S=a*A;if(l=l*x+p*S,f=f*x+m*S,h=h*x+v*S,d=d*x+y*S,x===1-a){const b=1/Math.sqrt(l*l+f*f+h*h+d*d);l*=b,f*=b,h*=b,d*=b}}e[t]=l,e[t+1]=f,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],f=i[r+2],h=i[r+3],d=s[o],p=s[o+1],m=s[o+2],v=s[o+3];return e[t]=a*v+h*d+l*m-f*p,e[t+1]=l*v+h*p+f*d-a*m,e[t+2]=f*v+h*m+a*p-l*d,e[t+3]=h*v-a*d-l*p-f*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,f=a(i/2),h=a(r/2),d=a(s/2),p=l(i/2),m=l(r/2),v=l(s/2);switch(o){case"XYZ":this._x=p*h*d+f*m*v,this._y=f*m*d-p*h*v,this._z=f*h*v+p*m*d,this._w=f*h*d-p*m*v;break;case"YXZ":this._x=p*h*d+f*m*v,this._y=f*m*d-p*h*v,this._z=f*h*v-p*m*d,this._w=f*h*d+p*m*v;break;case"ZXY":this._x=p*h*d-f*m*v,this._y=f*m*d+p*h*v,this._z=f*h*v+p*m*d,this._w=f*h*d-p*m*v;break;case"ZYX":this._x=p*h*d-f*m*v,this._y=f*m*d+p*h*v,this._z=f*h*v-p*m*d,this._w=f*h*d+p*m*v;break;case"YZX":this._x=p*h*d+f*m*v,this._y=f*m*d+p*h*v,this._z=f*h*v-p*m*d,this._w=f*h*d-p*m*v;break;case"XZY":this._x=p*h*d-f*m*v,this._y=f*m*d-p*h*v,this._z=f*h*v+p*m*d,this._w=f*h*d+p*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],f=t[2],h=t[6],d=t[10],p=i+a+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(s-f)*m,this._z=(o-r)*m}else if(i>a&&i>d){const m=2*Math.sqrt(1+i-a-d);this._w=(h-l)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(s+f)/m}else if(a>d){const m=2*Math.sqrt(1+a-i-d);this._w=(s-f)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-i-a);this._w=(o-r)/m,this._x=(s+f)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(gn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,f=t._z,h=t._w;return this._x=i*h+o*a+r*f-s*l,this._y=r*h+o*l+s*a-i*f,this._z=s*h+o*f+i*l-r*a,this._w=o*h-i*a-r*l-s*f,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const f=Math.sqrt(l),h=Math.atan2(f,a),d=Math.sin((1-t)*h)/f,p=Math.sin(t*h)/f;return this._w=o*d+this._w*p,this._x=i*d+this._x*p,this._y=r*d+this._y*p,this._z=s*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),r=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(r),i*Math.sin(s),i*Math.cos(s),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class D{constructor(e=0,t=0,i=0){D.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(dC.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(dC.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,f=l*t+o*r-a*i,h=l*i+a*t-s*r,d=l*r+s*i-o*t,p=-s*t-o*i-a*r;return this.x=f*l+p*-s+h*-a-d*-o,this.y=h*l+p*-o+d*-s-f*-a,this.z=d*l+p*-a+f*-o-h*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Dy.copy(this).projectOnVector(e),this.sub(Dy)}reflect(e){return this.sub(Dy.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(gn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Dy=new D,dC=new Vn;class Ko{constructor(e=new D(1/0,1/0,1/0),t=new D(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,i=1/0,r=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,f=e.length;l<f;l+=3){const h=e[l],d=e[l+1],p=e[l+2];h<t&&(t=h),d<i&&(i=d),p<r&&(r=p),h>s&&(s=h),d>o&&(o=d),p>a&&(a=p)}return this.min.set(t,i,r),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,i=1/0,r=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,f=e.count;l<f;l++){const h=e.getX(l),d=e.getY(l),p=e.getZ(l);h<t&&(t=h),d<i&&(i=d),p<r&&(r=p),h>s&&(s=h),d>o&&(o=d),p>a&&(a=p)}return this.min.set(t,i,r),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=ca.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0)if(t&&i.attributes!=null&&i.attributes.position!==void 0){const s=i.attributes.position;for(let o=0,a=s.count;o<a;o++)ca.fromBufferAttribute(s,o).applyMatrix4(e.matrixWorld),this.expandByPoint(ca)}else i.boundingBox===null&&i.computeBoundingBox(),Fy.copy(i.boundingBox),Fy.applyMatrix4(e.matrixWorld),this.union(Fy);const r=e.children;for(let s=0,o=r.length;s<o;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,ca),ca.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Tc),ep.subVectors(this.max,Tc),Tl.subVectors(e.a,Tc),Pl.subVectors(e.b,Tc),Bl.subVectors(e.c,Tc),ro.subVectors(Pl,Tl),so.subVectors(Bl,Pl),fa.subVectors(Tl,Bl);let t=[0,-ro.z,ro.y,0,-so.z,so.y,0,-fa.z,fa.y,ro.z,0,-ro.x,so.z,0,-so.x,fa.z,0,-fa.x,-ro.y,ro.x,0,-so.y,so.x,0,-fa.y,fa.x,0];return!Ny(t,Tl,Pl,Bl,ep)||(t=[1,0,0,0,1,0,0,0,1],!Ny(t,Tl,Pl,Bl,ep))?!1:(tp.crossVectors(ro,so),t=[tp.x,tp.y,tp.z],Ny(t,Tl,Pl,Bl,ep))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ca.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(ca).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:(ys[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ys[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ys[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ys[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ys[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ys[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ys[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ys[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ys),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const ys=[new D,new D,new D,new D,new D,new D,new D,new D],ca=new D,Fy=new Ko,Tl=new D,Pl=new D,Bl=new D,ro=new D,so=new D,fa=new D,Tc=new D,ep=new D,tp=new D,ha=new D;function Ny(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){ha.fromArray(n,s);const a=r.x*Math.abs(ha.x)+r.y*Math.abs(ha.y)+r.z*Math.abs(ha.z),l=e.dot(ha),f=t.dot(ha),h=i.dot(ha);if(Math.max(-Math.max(l,f,h),Math.min(l,f,h))>a)return!1}return!0}const hk=new Ko,Pc=new D,ky=new D;class Yo{constructor(e=new D,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):hk.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Pc.subVectors(e,this.center);const t=Pc.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Pc,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(ky.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Pc.copy(e.center).add(ky)),this.expandByPoint(Pc.copy(e.center).sub(ky))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const vs=new D,Oy=new D,np=new D,oo=new D,Uy=new D,ip=new D,zy=new D;class ph{constructor(e=new D,t=new D(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,vs)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=vs.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(vs.copy(this.direction).multiplyScalar(t).add(this.origin),vs.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Oy.copy(e).add(t).multiplyScalar(.5),np.copy(t).sub(e).normalize(),oo.copy(this.origin).sub(Oy);const s=e.distanceTo(t)*.5,o=-this.direction.dot(np),a=oo.dot(this.direction),l=-oo.dot(np),f=oo.lengthSq(),h=Math.abs(1-o*o);let d,p,m,v;if(h>0)if(d=o*l-a,p=o*a-l,v=s*h,d>=0)if(p>=-v)if(p<=v){const y=1/h;d*=y,p*=y,m=d*(d+o*p+2*a)+p*(o*d+p+2*l)+f}else p=s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+f;else p=-s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+f;else p<=-v?(d=Math.max(0,-(-o*s+a)),p=d>0?-s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+f):p<=v?(d=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+f):(d=Math.max(0,-(o*s+a)),p=d>0?s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+f);else p=o>0?-s:s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+f;return i&&i.copy(this.direction).multiplyScalar(d).add(this.origin),r&&r.copy(np).multiplyScalar(p).add(Oy),m}intersectSphere(e,t){vs.subVectors(e.center,this.origin);const i=vs.dot(this.direction),r=vs.dot(vs)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const f=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return f>=0?(i=(e.min.x-p.x)*f,r=(e.max.x-p.x)*f):(i=(e.max.x-p.x)*f,r=(e.min.x-p.x)*f),h>=0?(s=(e.min.y-p.y)*h,o=(e.max.y-p.y)*h):(s=(e.max.y-p.y)*h,o=(e.min.y-p.y)*h),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o<r||isNaN(r))&&(r=o),d>=0?(a=(e.min.z-p.z)*d,l=(e.max.z-p.z)*d):(a=(e.max.z-p.z)*d,l=(e.min.z-p.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,vs)!==null}intersectTriangle(e,t,i,r,s){Uy.subVectors(t,e),ip.subVectors(i,e),zy.crossVectors(Uy,ip);let o=this.direction.dot(zy),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;oo.subVectors(this.origin,e);const l=a*this.direction.dot(ip.crossVectors(oo,ip));if(l<0)return null;const f=a*this.direction.dot(Uy.cross(oo));if(f<0||l+f>o)return null;const h=-a*oo.dot(zy);return h<0?null:this.at(h/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class rt{constructor(){rt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,i,r,s,o,a,l,f,h,d,p,m,v,y,x){const _=this.elements;return _[0]=e,_[4]=t,_[8]=i,_[12]=r,_[1]=s,_[5]=o,_[9]=a,_[13]=l,_[2]=f,_[6]=h,_[10]=d,_[14]=p,_[3]=m,_[7]=v,_[11]=y,_[15]=x,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 rt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/Rl.setFromMatrixColumn(e,0).length(),s=1/Rl.setFromMatrixColumn(e,1).length(),o=1/Rl.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),f=Math.sin(r),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const p=o*h,m=o*d,v=a*h,y=a*d;t[0]=l*h,t[4]=-l*d,t[8]=f,t[1]=m+v*f,t[5]=p-y*f,t[9]=-a*l,t[2]=y-p*f,t[6]=v+m*f,t[10]=o*l}else if(e.order==="YXZ"){const p=l*h,m=l*d,v=f*h,y=f*d;t[0]=p+y*a,t[4]=v*a-m,t[8]=o*f,t[1]=o*d,t[5]=o*h,t[9]=-a,t[2]=m*a-v,t[6]=y+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*h,m=l*d,v=f*h,y=f*d;t[0]=p-y*a,t[4]=-o*d,t[8]=v+m*a,t[1]=m+v*a,t[5]=o*h,t[9]=y-p*a,t[2]=-o*f,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*h,m=o*d,v=a*h,y=a*d;t[0]=l*h,t[4]=v*f-m,t[8]=p*f+y,t[1]=l*d,t[5]=y*f+p,t[9]=m*f-v,t[2]=-f,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*f,v=a*l,y=a*f;t[0]=l*h,t[4]=y-p*d,t[8]=v*d+m,t[1]=d,t[5]=o*h,t[9]=-a*h,t[2]=-f*h,t[6]=m*d+v,t[10]=p-y*d}else if(e.order==="XZY"){const p=o*l,m=o*f,v=a*l,y=a*f;t[0]=l*h,t[4]=-d,t[8]=f*h,t[1]=p*d+y,t[5]=o*h,t[9]=m*d-v,t[2]=v*d-m,t[6]=a*h,t[10]=y*d+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(dk,e,pk)}lookAt(e,t,i){const r=this.elements;return Li.subVectors(e,t),Li.lengthSq()===0&&(Li.z=1),Li.normalize(),ao.crossVectors(i,Li),ao.lengthSq()===0&&(Math.abs(i.z)===1?Li.x+=1e-4:Li.z+=1e-4,Li.normalize(),ao.crossVectors(i,Li)),ao.normalize(),rp.crossVectors(Li,ao),r[0]=ao.x,r[4]=rp.x,r[8]=Li.x,r[1]=ao.y,r[5]=rp.y,r[9]=Li.y,r[2]=ao.z,r[6]=rp.z,r[10]=Li.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],f=i[12],h=i[1],d=i[5],p=i[9],m=i[13],v=i[2],y=i[6],x=i[10],_=i[14],A=i[3],w=i[7],S=i[11],b=i[15],P=r[0],R=r[4],E=r[8],B=r[12],L=r[1],z=r[5],Z=r[9],J=r[13],H=r[2],Y=r[6],te=r[10],le=r[14],N=r[3],V=r[7],j=r[11],ae=r[15];return s[0]=o*P+a*L+l*H+f*N,s[4]=o*R+a*z+l*Y+f*V,s[8]=o*E+a*Z+l*te+f*j,s[12]=o*B+a*J+l*le+f*ae,s[1]=h*P+d*L+p*H+m*N,s[5]=h*R+d*z+p*Y+m*V,s[9]=h*E+d*Z+p*te+m*j,s[13]=h*B+d*J+p*le+m*ae,s[2]=v*P+y*L+x*H+_*N,s[6]=v*R+y*z+x*Y+_*V,s[10]=v*E+y*Z+x*te+_*j,s[14]=v*B+y*J+x*le+_*ae,s[3]=A*P+w*L+S*H+b*N,s[7]=A*R+w*z+S*Y+b*V,s[11]=A*E+w*Z+S*te+b*j,s[15]=A*B+w*J+S*le+b*ae,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],f=e[13],h=e[2],d=e[6],p=e[10],m=e[14],v=e[3],y=e[7],x=e[11],_=e[15];return v*(+s*l*d-r*f*d-s*a*p+i*f*p+r*a*m-i*l*m)+y*(+t*l*m-t*f*p+s*o*p-r*o*m+r*f*h-s*l*h)+x*(+t*f*d-t*a*m-s*o*d+i*o*m+s*a*h-i*f*h)+_*(-r*a*h-t*l*d+t*a*p+r*o*d-i*o*p+i*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],f=e[7],h=e[8],d=e[9],p=e[10],m=e[11],v=e[12],y=e[13],x=e[14],_=e[15],A=d*x*f-y*p*f+y*l*m-a*x*m-d*l*_+a*p*_,w=v*p*f-h*x*f-v*l*m+o*x*m+h*l*_-o*p*_,S=h*y*f-v*d*f+v*a*m-o*y*m-h*a*_+o*d*_,b=v*d*l-h*y*l-v*a*p+o*y*p+h*a*x-o*d*x,P=t*A+i*w+r*S+s*b;if(P===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/P;return e[0]=A*R,e[1]=(y*p*s-d*x*s-y*r*m+i*x*m+d*r*_-i*p*_)*R,e[2]=(a*x*s-y*l*s+y*r*f-i*x*f-a*r*_+i*l*_)*R,e[3]=(d*l*s-a*p*s-d*r*f+i*p*f+a*r*m-i*l*m)*R,e[4]=w*R,e[5]=(h*x*s-v*p*s+v*r*m-t*x*m-h*r*_+t*p*_)*R,e[6]=(v*l*s-o*x*s-v*r*f+t*x*f+o*r*_-t*l*_)*R,e[7]=(o*p*s-h*l*s+h*r*f-t*p*f-o*r*m+t*l*m)*R,e[8]=S*R,e[9]=(v*d*s-h*y*s-v*i*m+t*y*m+h*i*_-t*d*_)*R,e[10]=(o*y*s-v*a*s+v*i*f-t*y*f-o*i*_+t*a*_)*R,e[11]=(h*a*s-o*d*s-h*i*f+t*d*f+o*i*m-t*a*m)*R,e[12]=b*R,e[13]=(h*y*r-v*d*r+v*i*p-t*y*p-h*i*x+t*d*x)*R,e[14]=(v*a*r-o*y*r-v*i*l+t*y*l+o*i*x-t*a*x)*R,e[15]=(o*d*r-h*a*r+h*i*l-t*d*l-o*i*p+t*a*p)*R,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,f=s*o,h=s*a;return this.set(f*o+i,f*a-r*l,f*l+r*a,0,f*a+r*l,h*a+i,h*l-r*o,0,f*l-r*a,h*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,f=s+s,h=o+o,d=a+a,p=s*f,m=s*h,v=s*d,y=o*h,x=o*d,_=a*d,A=l*f,w=l*h,S=l*d,b=i.x,P=i.y,R=i.z;return r[0]=(1-(y+_))*b,r[1]=(m+S)*b,r[2]=(v-w)*b,r[3]=0,r[4]=(m-S)*P,r[5]=(1-(p+_))*P,r[6]=(x+A)*P,r[7]=0,r[8]=(v+w)*R,r[9]=(x-A)*R,r[10]=(1-(p+y))*R,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=Rl.set(r[0],r[1],r[2]).length();const o=Rl.set(r[4],r[5],r[6]).length(),a=Rl.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],wr.copy(this);const f=1/s,h=1/o,d=1/a;return wr.elements[0]*=f,wr.elements[1]*=f,wr.elements[2]*=f,wr.elements[4]*=h,wr.elements[5]*=h,wr.elements[6]*=h,wr.elements[8]*=d,wr.elements[9]*=d,wr.elements[10]*=d,t.setFromRotationMatrix(wr),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o){const a=this.elements,l=2*s/(t-e),f=2*s/(i-r),h=(t+e)/(t-e),d=(i+r)/(i-r),p=-(o+s)/(o-s),m=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=f,a[9]=d,a[13]=0,a[2]=0,a[6]=0,a[10]=p,a[14]=m,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,i,r,s,o){const a=this.elements,l=1/(t-e),f=1/(i-r),h=1/(o-s),d=(t+e)*l,p=(i+r)*f,m=(o+s)*h;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-d,a[1]=0,a[5]=2*f,a[9]=0,a[13]=-p,a[2]=0,a[6]=0,a[10]=-2*h,a[14]=-m,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Rl=new D,wr=new rt,dk=new D(0,0,0),pk=new D(1,1,1),ao=new D,rp=new D,Li=new D,pC=new rt,mC=new Vn;class ol{constructor(e=0,t=0,i=0,r=ol.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],f=r[5],h=r[9],d=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin(gn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,f),this._z=0);break;case"YXZ":this._x=Math.asin(-gn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,f)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(gn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-o,f)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-gn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(gn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,f),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-gn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,f),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return pC.makeRotationFromQuaternion(e),this.setFromRotationMatrix(pC,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return mC.setFromEuler(this),this.setFromQuaternion(mC,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ol.DEFAULT_ORDER="XYZ";class Xa{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 mk=0;const gC=new D,Ll=new Vn,xs=new rt,sp=new D,Bc=new D,gk=new D,yk=new Vn,yC=new D(1,0,0),vC=new D(0,1,0),xC=new D(0,0,1),vk={type:"added"},_C={type:"removed"};class Tt extends os{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:mk++}),this.uuid=Ui(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Tt.DEFAULT_UP.clone();const e=new D,t=new ol,i=new Vn,r=new D(1,1,1);function s(){i.setFromEuler(t,!1)}function o(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new rt},normalMatrix:{value:new ui}}),this.matrix=new rt,this.matrixWorld=new rt,this.matrixAutoUpdate=Tt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=Tt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new Xa,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Ll.setFromAxisAngle(e,t),this.quaternion.multiply(Ll),this}rotateOnWorldAxis(e,t){return Ll.setFromAxisAngle(e,t),this.quaternion.premultiply(Ll),this}rotateX(e){return this.rotateOnAxis(yC,e)}rotateY(e){return this.rotateOnAxis(vC,e)}rotateZ(e){return this.rotateOnAxis(xC,e)}translateOnAxis(e,t){return gC.copy(e).applyQuaternion(this.quaternion),this.position.add(gC.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(yC,e)}translateY(e){return this.translateOnAxis(vC,e)}translateZ(e){return this.translateOnAxis(xC,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(xs.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?sp.copy(e):sp.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Bc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?xs.lookAt(Bc,sp,this.up):xs.lookAt(sp,Bc,this.up),this.quaternion.setFromRotationMatrix(xs),r&&(xs.extractRotation(r.matrixWorld),Ll.setFromRotationMatrix(xs),this.quaternion.premultiply(Ll.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(vk)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(_C)),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(_C)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),xs.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),xs.multiply(e.parent.matrixWorld)),e.applyMatrix4(xs),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){const o=this.children[i].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t){let i=[];this[e]===t&&i.push(this);for(let r=0,s=this.children.length;r<s;r++){const o=this.children[r].getObjectsByProperty(e,t);o.length>0&&(i=i.concat(o))}return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Bc,e,gk),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Bc,yk,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,r=t.length;i<r;i++){const s=t[i];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.matrixWorldAutoUpdate===!0&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++){const a=r[s];a.matrixWorldAutoUpdate===!0&&a.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let f=0,h=l.length;f<h;f++){const d=l[f];s(e.shapes,d)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,f=this.material.length;l<f;l++)a.push(s(e.materials,this.material[l]));r.material=a}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(s(e.animations,l))}}if(t){const a=o(e.geometries),l=o(e.materials),f=o(e.textures),h=o(e.images),d=o(e.shapes),p=o(e.skeletons),m=o(e.animations),v=o(e.nodes);a.length>0&&(i.geometries=a),l.length>0&&(i.materials=l),f.length>0&&(i.textures=f),h.length>0&&(i.images=h),d.length>0&&(i.shapes=d),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),v.length>0&&(i.nodes=v)}return i.object=r,i;function o(a){const l=[];for(const f in a){const h=a[f];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,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.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}Tt.DEFAULT_UP=new D(0,1,0);Tt.DEFAULT_MATRIX_AUTO_UPDATE=!0;Tt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Sr=new D,_s=new D,Gy=new D,As=new D,Il=new D,Dl=new D,AC=new D,Hy=new D,Vy=new D,Wy=new D;class cr{constructor(e=new D,t=new D,i=new D){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),Sr.subVectors(e,t),r.cross(Sr);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Sr.subVectors(r,t),_s.subVectors(i,t),Gy.subVectors(e,t);const o=Sr.dot(Sr),a=Sr.dot(_s),l=Sr.dot(Gy),f=_s.dot(_s),h=_s.dot(Gy),d=o*f-a*a;if(d===0)return s.set(-2,-1,-1);const p=1/d,m=(f*l-a*h)*p,v=(o*h-a*l)*p;return s.set(1-m-v,v,m)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,As),As.x>=0&&As.y>=0&&As.x+As.y<=1}static getUV(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,As),l.set(0,0),l.addScaledVector(s,As.x),l.addScaledVector(o,As.y),l.addScaledVector(a,As.z),l}static isFrontFacing(e,t,i,r){return Sr.subVectors(i,t),_s.subVectors(e,t),Sr.cross(_s).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Sr.subVectors(this.c,this.b),_s.subVectors(this.a,this.b),Sr.cross(_s).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return cr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return cr.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,r,s){return cr.getUV(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return cr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return cr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;Il.subVectors(r,i),Dl.subVectors(s,i),Hy.subVectors(e,i);const l=Il.dot(Hy),f=Dl.dot(Hy);if(l<=0&&f<=0)return t.copy(i);Vy.subVectors(e,r);const h=Il.dot(Vy),d=Dl.dot(Vy);if(h>=0&&d<=h)return t.copy(r);const p=l*d-h*f;if(p<=0&&l>=0&&h<=0)return o=l/(l-h),t.copy(i).addScaledVector(Il,o);Wy.subVectors(e,s);const m=Il.dot(Wy),v=Dl.dot(Wy);if(v>=0&&m<=v)return t.copy(s);const y=m*f-l*v;if(y<=0&&f>=0&&v<=0)return a=f/(f-v),t.copy(i).addScaledVector(Dl,a);const x=h*v-m*d;if(x<=0&&d-h>=0&&m-v>=0)return AC.subVectors(s,r),a=(d-h)/(d-h+(m-v)),t.copy(r).addScaledVector(AC,a);const _=1/(x+y+p);return o=y*_,a=p*_,t.copy(i).addScaledVector(Il,o).addScaledVector(Dl,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let xk=0;class Mn extends os{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:xk++}),this.uuid=Ui(),this.name="",this.type="Material",this.blending=Ha,this.side=is,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=W_,this.blendDst=j_,this.blendEquation=Ta,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Gm,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=EB,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=cm,this.stencilZFail=cm,this.stencilZPass=cm,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}const r=this[t];if(r===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Ha&&(i.blending=this.blending),this.side!==is&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.forceSinglePass===!0&&(i.forceSinglePass=this.forceSinglePass),this.wireframe===!0&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class ki extends Mn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Le(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.combine=dh,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.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 xn=new D,op=new me;class Dt{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=jf,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}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}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)op.fromBufferAttribute(this,t),op.applyMatrix3(e),this.setXY(t,op.x,op.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)xn.fromBufferAttribute(this,t),xn.applyMatrix3(e),this.setXYZ(t,xn.x,xn.y,xn.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)xn.fromBufferAttribute(this,t),xn.applyMatrix4(e),this.setXYZ(t,xn.x,xn.y,xn.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)xn.fromBufferAttribute(this,t),xn.applyNormalMatrix(e),this.setXYZ(t,xn.x,xn.y,xn.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)xn.fromBufferAttribute(this,t),xn.transformDirection(e),this.setXYZ(t,xn.x,xn.y,xn.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Rs(t,this.array)),t}setX(e,t){return this.normalized&&(t=zt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Rs(t,this.array)),t}setY(e,t){return this.normalized&&(t=zt(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Rs(t,this.array)),t}setZ(e,t){return this.normalized&&(t=zt(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Rs(t,this.array)),t}setW(e,t){return this.normalized&&(t=zt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=zt(t,this.array),i=zt(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=zt(t,this.array),i=zt(i,this.array),r=zt(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=zt(t,this.array),i=zt(i,this.array),r=zt(r,this.array),s=zt(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==jf&&(e.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(e.updateRange=this.updateRange),e}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class _k extends Dt{constructor(e,t,i){super(new Int8Array(e),t,i)}}class Ak extends Dt{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class Mk extends Dt{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class wk extends Dt{constructor(e,t,i){super(new Int16Array(e),t,i)}}class eA extends Dt{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class Sk extends Dt{constructor(e,t,i){super(new Int32Array(e),t,i)}}class tA extends Dt{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class Ck extends Dt{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}}class We extends Dt{constructor(e,t,i){super(new Float32Array(e),t,i)}}class Ek extends Dt{constructor(e,t,i){super(new Float64Array(e),t,i)}}let bk=0;const rr=new rt,jy=new Tt,Fl=new D,Ii=new Ko,Rc=new Ko,Fn=new D;class ut extends os{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:bk++}),this.uuid=Ui(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(TB(e)?tA:eA)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new ui().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return rr.makeRotationFromQuaternion(e),this.applyMatrix4(rr),this}rotateX(e){return rr.makeRotationX(e),this.applyMatrix4(rr),this}rotateY(e){return rr.makeRotationY(e),this.applyMatrix4(rr),this}rotateZ(e){return rr.makeRotationZ(e),this.applyMatrix4(rr),this}translate(e,t,i){return rr.makeTranslation(e,t,i),this.applyMatrix4(rr),this}scale(e,t,i){return rr.makeScale(e,t,i),this.applyMatrix4(rr),this}lookAt(e){return jy.lookAt(e),jy.updateMatrix(),this.applyMatrix4(jy.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Fl).negate(),this.translate(Fl.x,Fl.y,Fl.z),this}setFromPoints(e){const t=[];for(let i=0,r=e.length;i<r;i++){const s=e[i];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new We(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ko);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingBox.set(new D(-1/0,-1/0,-1/0),new D(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const s=t[i];Ii.setFromBufferAttribute(s),this.morphTargetsRelative?(Fn.addVectors(this.boundingBox.min,Ii.min),this.boundingBox.expandByPoint(Fn),Fn.addVectors(this.boundingBox.max,Ii.max),this.boundingBox.expandByPoint(Fn)):(this.boundingBox.expandByPoint(Ii.min),this.boundingBox.expandByPoint(Ii.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Yo);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingSphere.set(new D,1/0);return}if(e){const i=this.boundingSphere.center;if(Ii.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];Rc.setFromBufferAttribute(a),this.morphTargetsRelative?(Fn.addVectors(Ii.min,Rc.min),Ii.expandByPoint(Fn),Fn.addVectors(Ii.max,Rc.max),Ii.expandByPoint(Fn)):(Ii.expandByPoint(Rc.min),Ii.expandByPoint(Rc.max))}Ii.getCenter(i);let r=0;for(let s=0,o=e.count;s<o;s++)Fn.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(Fn));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],l=this.morphTargetsRelative;for(let f=0,h=a.count;f<h;f++)Fn.fromBufferAttribute(a,f),l&&(Fl.fromBufferAttribute(e,f),Fn.add(Fl)),r=Math.max(r,i.distanceToSquared(Fn))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=e.array,r=t.position.array,s=t.normal.array,o=t.uv.array,a=r.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Dt(new Float32Array(4*a),4));const l=this.getAttribute("tangent").array,f=[],h=[];for(let L=0;L<a;L++)f[L]=new D,h[L]=new D;const d=new D,p=new D,m=new D,v=new me,y=new me,x=new me,_=new D,A=new D;function w(L,z,Z){d.fromArray(r,L*3),p.fromArray(r,z*3),m.fromArray(r,Z*3),v.fromArray(o,L*2),y.fromArray(o,z*2),x.fromArray(o,Z*2),p.sub(d),m.sub(d),y.sub(v),x.sub(v);const J=1/(y.x*x.y-x.x*y.y);isFinite(J)&&(_.copy(p).multiplyScalar(x.y).addScaledVector(m,-y.y).multiplyScalar(J),A.copy(m).multiplyScalar(y.x).addScaledVector(p,-x.x).multiplyScalar(J),f[L].add(_),f[z].add(_),f[Z].add(_),h[L].add(A),h[z].add(A),h[Z].add(A))}let S=this.groups;S.length===0&&(S=[{start:0,count:i.length}]);for(let L=0,z=S.length;L<z;++L){const Z=S[L],J=Z.start,H=Z.count;for(let Y=J,te=J+H;Y<te;Y+=3)w(i[Y+0],i[Y+1],i[Y+2])}const b=new D,P=new D,R=new D,E=new D;function B(L){R.fromArray(s,L*3),E.copy(R);const z=f[L];b.copy(z),b.sub(R.multiplyScalar(R.dot(z))).normalize(),P.crossVectors(E,z);const J=P.dot(h[L])<0?-1:1;l[L*4]=b.x,l[L*4+1]=b.y,l[L*4+2]=b.z,l[L*4+3]=J}for(let L=0,z=S.length;L<z;++L){const Z=S[L],J=Z.start,H=Z.count;for(let Y=J,te=J+H;Y<te;Y+=3)B(i[Y+0]),B(i[Y+1]),B(i[Y+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Dt(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let p=0,m=i.count;p<m;p++)i.setXYZ(p,0,0,0);const r=new D,s=new D,o=new D,a=new D,l=new D,f=new D,h=new D,d=new D;if(e)for(let p=0,m=e.count;p<m;p+=3){const v=e.getX(p+0),y=e.getX(p+1),x=e.getX(p+2);r.fromBufferAttribute(t,v),s.fromBufferAttribute(t,y),o.fromBufferAttribute(t,x),h.subVectors(o,s),d.subVectors(r,s),h.cross(d),a.fromBufferAttribute(i,v),l.fromBufferAttribute(i,y),f.fromBufferAttribute(i,x),a.add(h),l.add(h),f.add(h),i.setXYZ(v,a.x,a.y,a.z),i.setXYZ(y,l.x,l.y,l.z),i.setXYZ(x,f.x,f.y,f.z)}else for(let p=0,m=t.count;p<m;p+=3)r.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),o.fromBufferAttribute(t,p+2),h.subVectors(o,s),d.subVectors(r,s),h.cross(d),i.setXYZ(p+0,h.x,h.y,h.z),i.setXYZ(p+1,h.x,h.y,h.z),i.setXYZ(p+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead."),this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)Fn.fromBufferAttribute(e,t),Fn.normalize(),e.setXYZ(t,Fn.x,Fn.y,Fn.z)}toNonIndexed(){function e(a,l){const f=a.array,h=a.itemSize,d=a.normalized,p=new f.constructor(l.length*h);let m=0,v=0;for(let y=0,x=l.length;y<x;y++){a.isInterleavedBufferAttribute?m=l[y]*a.data.stride+a.offset:m=l[y]*h;for(let _=0;_<h;_++)p[v++]=f[m++]}return new Dt(p,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new ut,i=this.index.array,r=this.attributes;for(const a in r){const l=r[a],f=e(l,i);t.setAttribute(a,f)}const s=this.morphAttributes;for(const a in s){const l=[],f=s[a];for(let h=0,d=f.length;h<d;h++){const p=f[h],m=e(p,i);l.push(m)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const f=o[a];t.addGroup(f.start,f.count,f.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const f in l)l[f]!==void 0&&(e[f]=l[f]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const f=i[l];e.data.attributes[l]=f.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const f=this.morphAttributes[l],h=[];for(let d=0,p=f.length;d<p;d++){const m=f[d];h.push(m.toJSON(e.data))}h.length>0&&(r[l]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const f in r){const h=r[f];this.setAttribute(f,h.clone(t))}const s=e.morphAttributes;for(const f in s){const h=[],d=s[f];for(let p=0,m=d.length;p<m;p++)h.push(d[p].clone(t));this.morphAttributes[f]=h}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let f=0,h=o.length;f<h;f++){const d=o[f];this.addGroup(d.start,d.count,d.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,e.parameters!==void 0&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}const MC=new rt,Nl=new ph,Jy=new Yo,Lc=new D,Ic=new D,Dc=new D,Xy=new D,ap=new D,lp=new me,up=new me,cp=new me,Ky=new D,fp=new D;class bn extends Tt{constructor(e=new ut,t=new ki){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,o=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const a=this.morphTargetInfluences;if(s&&a){ap.set(0,0,0);for(let l=0,f=s.length;l<f;l++){const h=a[l],d=s[l];h!==0&&(Xy.fromBufferAttribute(d,e),o?ap.addScaledVector(Xy,h):ap.addScaledVector(Xy.sub(t),h))}t.add(ap)}return this.isSkinnedMesh&&this.boneTransform(e,t),t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;if(r===void 0||(i.boundingSphere===null&&i.computeBoundingSphere(),Jy.copy(i.boundingSphere),Jy.applyMatrix4(s),e.ray.intersectsSphere(Jy)===!1)||(MC.copy(s).invert(),Nl.copy(e.ray).applyMatrix4(MC),i.boundingBox!==null&&Nl.intersectsBox(i.boundingBox)===!1))return;let o;const a=i.index,l=i.attributes.position,f=i.attributes.uv,h=i.attributes.uv2,d=i.groups,p=i.drawRange;if(a!==null)if(Array.isArray(r))for(let m=0,v=d.length;m<v;m++){const y=d[m],x=r[y.materialIndex],_=Math.max(y.start,p.start),A=Math.min(a.count,Math.min(y.start+y.count,p.start+p.count));for(let w=_,S=A;w<S;w+=3){const b=a.getX(w),P=a.getX(w+1),R=a.getX(w+2);o=hp(this,x,e,Nl,f,h,b,P,R),o&&(o.faceIndex=Math.floor(w/3),o.face.materialIndex=y.materialIndex,t.push(o))}}else{const m=Math.max(0,p.start),v=Math.min(a.count,p.start+p.count);for(let y=m,x=v;y<x;y+=3){const _=a.getX(y),A=a.getX(y+1),w=a.getX(y+2);o=hp(this,r,e,Nl,f,h,_,A,w),o&&(o.faceIndex=Math.floor(y/3),t.push(o))}}else if(l!==void 0)if(Array.isArray(r))for(let m=0,v=d.length;m<v;m++){const y=d[m],x=r[y.materialIndex],_=Math.max(y.start,p.start),A=Math.min(l.count,Math.min(y.start+y.count,p.start+p.count));for(let w=_,S=A;w<S;w+=3){const b=w,P=w+1,R=w+2;o=hp(this,x,e,Nl,f,h,b,P,R),o&&(o.faceIndex=Math.floor(w/3),o.face.materialIndex=y.materialIndex,t.push(o))}}else{const m=Math.max(0,p.start),v=Math.min(l.count,p.start+p.count);for(let y=m,x=v;y<x;y+=3){const _=y,A=y+1,w=y+2;o=hp(this,r,e,Nl,f,h,_,A,w),o&&(o.faceIndex=Math.floor(y/3),t.push(o))}}}}function Tk(n,e,t,i,r,s,o,a){let l;if(e.side===Ei?l=i.intersectTriangle(o,s,r,!0,a):l=i.intersectTriangle(r,s,o,e.side===is,a),l===null)return null;fp.copy(a),fp.applyMatrix4(n.matrixWorld);const f=t.ray.origin.distanceTo(fp);return f<t.near||f>t.far?null:{distance:f,point:fp.clone(),object:n}}function hp(n,e,t,i,r,s,o,a,l){n.getVertexPosition(o,Lc),n.getVertexPosition(a,Ic),n.getVertexPosition(l,Dc);const f=Tk(n,e,t,i,Lc,Ic,Dc,Ky);if(f){r&&(lp.fromBufferAttribute(r,o),up.fromBufferAttribute(r,a),cp.fromBufferAttribute(r,l),f.uv=cr.getUV(Ky,Lc,Ic,Dc,lp,up,cp,new me)),s&&(lp.fromBufferAttribute(s,o),up.fromBufferAttribute(s,a),cp.fromBufferAttribute(s,l),f.uv2=cr.getUV(Ky,Lc,Ic,Dc,lp,up,cp,new me));const h={a:o,b:a,c:l,normal:new D,materialIndex:0};cr.getNormal(Lc,Ic,Dc,h.normal),f.face=h}return f}class Qo extends ut{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],f=[],h=[],d=[];let p=0,m=0;v("z","y","x",-1,-1,i,t,e,o,s,0),v("z","y","x",1,-1,i,t,-e,o,s,1),v("x","z","y",1,1,e,i,t,r,o,2),v("x","z","y",1,-1,e,i,-t,r,o,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new We(f,3)),this.setAttribute("normal",new We(h,3)),this.setAttribute("uv",new We(d,2));function v(y,x,_,A,w,S,b,P,R,E,B){const L=S/R,z=b/E,Z=S/2,J=b/2,H=P/2,Y=R+1,te=E+1;let le=0,N=0;const V=new D;for(let j=0;j<te;j++){const ae=j*z-J;for(let W=0;W<Y;W++){const ce=W*L-Z;V[y]=ce*A,V[x]=ae*w,V[_]=H,f.push(V.x,V.y,V.z),V[y]=0,V[x]=0,V[_]=P>0?1:-1,h.push(V.x,V.y,V.z),d.push(W/R),d.push(1-j/E),le+=1}}for(let j=0;j<E;j++)for(let ae=0;ae<R;ae++){const W=p+ae+Y*j,ce=p+ae+Y*(j+1),ve=p+(ae+1)+Y*(j+1),_e=p+(ae+1)+Y*j;l.push(W,ce,_e),l.push(ce,ve,_e),N+=6}a.addGroup(m,N,B),m+=N,p+=le}}static fromJSON(e){return new Qo(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Iu(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?e[t][i]=r.clone():Array.isArray(r)?e[t][i]=r.slice():e[t][i]=r}}return e}function oi(n){const e={};for(let t=0;t<n.length;t++){const i=Iu(n[t]);for(const r in i)e[r]=i[r]}return e}function Pk(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function BB(n){return n.getRenderTarget()===null&&n.outputEncoding===Ct?br:Lu}const RB={clone:Iu,merge:oi};var Bk=`void main() { gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }`,Rk=`void main() { gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); }`;class ss extends Mn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Bk,this.fragmentShader=Rk,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[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=Iu(e.uniforms),this.uniformsGroups=Pk(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?t.uniforms[r]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[r]={type:"m4",value:o.toArray()}:t.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class mh extends Tt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new rt,this.projectionMatrix=new rt,this.projectionMatrixInverse=new rt}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Gt extends mh{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Jf*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ja*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Jf*2*Math.atan(Math.tan(ja*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(ja*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,f=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/f,r*=o.width/l,i*=o.height/f}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const kl=-90,Ol=1;class nA extends Tt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i;const r=new Gt(kl,Ol,e,t);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(1,0,0),this.add(r);const s=new Gt(kl,Ol,e,t);s.layers=this.layers,s.up.set(0,1,0),s.lookAt(-1,0,0),this.add(s);const o=new Gt(kl,Ol,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(0,1,0),this.add(o);const a=new Gt(kl,Ol,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);const l=new Gt(kl,Ol,e,t);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,1),this.add(l);const f=new Gt(kl,Ol,e,t);f.layers=this.layers,f.up.set(0,1,0),f.lookAt(0,0,-1),this.add(f)}update(e,t){this.parent===null&&this.updateMatrixWorld();const i=this.renderTarget,[r,s,o,a,l,f]=this.children,h=e.getRenderTarget(),d=e.toneMapping,p=e.xr.enabled;e.toneMapping=Ir,e.xr.enabled=!1;const m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,r),e.setRenderTarget(i,1),e.render(t,s),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,a),e.setRenderTarget(i,4),e.render(t,l),i.texture.generateMipmaps=m,e.setRenderTarget(i,5),e.render(t,f),e.setRenderTarget(h),e.toneMapping=d,e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class gh extends Qt{constructor(e,t,i,r,s,o,a,l,f,h){e=e!==void 0?e:[],t=t!==void 0?t:Oo,super(e,t,i,r,s,o,a,l,f,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class iA extends Nr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new gh(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:en}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include <begin_vertex> #include <project_vertex> } `,fragmentShader:` uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include <common> void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); } `},r=new Qo(5,5,5),s=new ss({name:"CubemapFromEquirect",uniforms:Iu(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Ei,blending:Fs});s.uniforms.tEquirect.value=t;const o=new bn(r,s),a=t.minFilter;return t.minFilter===rs&&(t.minFilter=en),new nA(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}const Yy=new D,Lk=new D,Ik=new ui;class go{constructor(e=new D(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=Yy.subVectors(i,t).cross(Lk.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const i=e.delta(Yy),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(i).multiplyScalar(s).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||Ik.getNormalMatrix(e),r=this.coplanarPoint(Yy).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ul=new Yo,dp=new D;class bg{constructor(e=new go,t=new go,i=new go,r=new go,s=new go,o=new go){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){const t=this.planes,i=e.elements,r=i[0],s=i[1],o=i[2],a=i[3],l=i[4],f=i[5],h=i[6],d=i[7],p=i[8],m=i[9],v=i[10],y=i[11],x=i[12],_=i[13],A=i[14],w=i[15];return t[0].setComponents(a-r,d-l,y-p,w-x).normalize(),t[1].setComponents(a+r,d+l,y+p,w+x).normalize(),t[2].setComponents(a+s,d+f,y+m,w+_).normalize(),t[3].setComponents(a-s,d-f,y-m,w-_).normalize(),t[4].setComponents(a-o,d-h,y-v,w-A).normalize(),t[5].setComponents(a+o,d+h,y+v,w+A).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),Ul.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Ul)}intersectsSprite(e){return Ul.center.set(0,0,0),Ul.radius=.7071067811865476,Ul.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ul)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(dp.x=r.normal.x>0?e.max.x:e.min.x,dp.y=r.normal.y>0?e.max.y:e.min.y,dp.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(dp)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function LB(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function Dk(n,e){const t=e.isWebGL2,i=new WeakMap;function r(f,h){const d=f.array,p=f.usage,m=n.createBuffer();n.bindBuffer(h,m),n.bufferData(h,d,p),f.onUploadCallback();let v;if(d instanceof Float32Array)v=5126;else if(d instanceof Uint16Array)if(f.isFloat16BufferAttribute)if(t)v=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else v=5123;else if(d instanceof Int16Array)v=5122;else if(d instanceof Uint32Array)v=5125;else if(d instanceof Int32Array)v=5124;else if(d instanceof Int8Array)v=5120;else if(d instanceof Uint8Array)v=5121;else if(d instanceof Uint8ClampedArray)v=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:m,type:v,bytesPerElement:d.BYTES_PER_ELEMENT,version:f.version}}function s(f,h,d){const p=h.array,m=h.updateRange;n.bindBuffer(d,f),m.count===-1?n.bufferSubData(d,0,p):(t?n.bufferSubData(d,m.offset*p.BYTES_PER_ELEMENT,p,m.offset,m.count):n.bufferSubData(d,m.offset*p.BYTES_PER_ELEMENT,p.subarray(m.offset,m.offset+m.count)),m.count=-1),h.onUploadCallback()}function o(f){return f.isInterleavedBufferAttribute&&(f=f.data),i.get(f)}function a(f){f.isInterleavedBufferAttribute&&(f=f.data);const h=i.get(f);h&&(n.deleteBuffer(h.buffer),i.delete(f))}function l(f,h){if(f.isGLBufferAttribute){const p=i.get(f);(!p||p.version<f.version)&&i.set(f,{buffer:f.buffer,type:f.type,bytesPerElement:f.elementSize,version:f.version});return}f.isInterleavedBufferAttribute&&(f=f.data);const d=i.get(f);d===void 0?i.set(f,r(f,h)):d.version<f.version&&(s(d.buffer,f,h),d.version=f.version)}return{get:o,remove:a,update:l}}class ju extends ut{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const s=e/2,o=t/2,a=Math.floor(i),l=Math.floor(r),f=a+1,h=l+1,d=e/a,p=t/l,m=[],v=[],y=[],x=[];for(let _=0;_<h;_++){const A=_*p-o;for(let w=0;w<f;w++){const S=w*d-s;v.push(S,-A,0),y.push(0,0,1),x.push(w/a),x.push(1-_/l)}}for(let _=0;_<l;_++)for(let A=0;A<a;A++){const w=A+f*_,S=A+f*(_+1),b=A+1+f*(_+1),P=A+1+f*_;m.push(w,S,P),m.push(S,b,P)}this.setIndex(m),this.setAttribute("position",new We(v,3)),this.setAttribute("normal",new We(y,3)),this.setAttribute("uv",new We(x,2))}static fromJSON(e){return new ju(e.width,e.height,e.widthSegments,e.heightSegments)}}var Fk=`#ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, vUv ).g; #endif`,Nk=`#ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`,kk=`#ifdef USE_ALPHATEST if ( diffuseColor.a < alphaTest ) discard; #endif`,Ok=`#ifdef USE_ALPHATEST uniform float alphaTest; #endif`,Uk=`#ifdef USE_AOMAP float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0; reflectedLight.indirectDiffuse *= ambientOcclusion; #if defined( USE_ENVMAP ) && defined( STANDARD ) float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); #endif #endif`,zk=`#ifdef USE_AOMAP uniform sampler2D aoMap; uniform float aoMapIntensity; #endif`,Gk="vec3 transformed = vec3( position );",Hk=`vec3 objectNormal = vec3( normal ); #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); #endif`,Vk=`vec3 BRDF_Lambert( const in vec3 diffuseColor ) { return RECIPROCAL_PI * diffuseColor; } vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); float x2 = x * x; float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); } float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); return 0.5 / max( gv + gl, EPSILON ); } float D_GGX( const in float alpha, const in float dotNH ) { float a2 = pow2( alpha ); float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; return RECIPROCAL_PI * a2 / pow2( denom ); } vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) { float alpha = pow2( roughness ); vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = F_Schlick( f0, f90, dotVH ); float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); return F * ( V * D ); } #ifdef USE_IRIDESCENCE vec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) { float alpha = pow2( roughness ); vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence ); float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); return F * ( V * D ); } #endif vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { const float LUT_SIZE = 64.0; const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; const float LUT_BIAS = 0.5 / LUT_SIZE; float dotNV = saturate( dot( N, V ) ); vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); uv = uv * LUT_SCALE + LUT_BIAS; return uv; } float LTC_ClippedSphereFormFactor( const in vec3 f ) { float l = length( f ); return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); } vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { float x = dot( v1, v2 ); float y = abs( x ); float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; float b = 3.4175940 + ( 4.1616724 + y ) * y; float v = a / b; float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; return cross( v1, v2 ) * theta_sintheta; } vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; vec3 lightNormal = cross( v1, v2 ); if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); vec3 T1, T2; T1 = normalize( V - N * dot( V, N ) ); T2 = - cross( N, T1 ); mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); vec3 coords[ 4 ]; coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); coords[ 0 ] = normalize( coords[ 0 ] ); coords[ 1 ] = normalize( coords[ 1 ] ); coords[ 2 ] = normalize( coords[ 2 ] ); coords[ 3 ] = normalize( coords[ 3 ] ); vec3 vectorFormFactor = vec3( 0.0 ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); return vec3( result ); } float G_BlinnPhong_Implicit( ) { return 0.25; } float D_BlinnPhong( const in float shininess, const in float dotNH ) { return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); } vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { vec3 halfDir = normalize( lightDir + viewDir ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = F_Schlick( specularColor, 1.0, dotVH ); float G = G_BlinnPhong_Implicit( ); float D = D_BlinnPhong( shininess, dotNH ); return F * ( G * D ); } #if defined( USE_SHEEN ) float D_Charlie( float roughness, float dotNH ) { float alpha = pow2( roughness ); float invAlpha = 1.0 / alpha; float cos2h = dotNH * dotNH; float sin2h = max( 1.0 - cos2h, 0.0078125 ); return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); } float V_Neubelt( float dotNV, float dotNL ) { return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); } vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float D = D_Charlie( sheenRoughness, dotNH ); float V = V_Neubelt( dotNV, dotNL ); return sheenColor * ( D * V ); } #endif`,Wk=`#ifdef USE_IRIDESCENCE const mat3 XYZ_TO_REC709 = mat3( 3.2404542, -0.9692660, 0.0556434, -1.5371385, 1.8760108, -0.2040259, -0.4985314, 0.0415560, 1.0572252 ); vec3 Fresnel0ToIor( vec3 fresnel0 ) { vec3 sqrtF0 = sqrt( fresnel0 ); return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); } vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); } float IorToFresnel0( float transmittedIor, float incidentIor ) { return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); } vec3 evalSensitivity( float OPD, vec3 shift ) { float phase = 2.0 * PI * OPD * 1.0e-9; vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 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 ) ); xyz /= 1.0685e-7; vec3 rgb = XYZ_TO_REC709 * xyz; return rgb; } vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { vec3 I; float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); float cosTheta2Sq = 1.0 - sinTheta2Sq; if ( cosTheta2Sq < 0.0 ) { return vec3( 1.0 ); } float cosTheta2 = sqrt( cosTheta2Sq ); float R0 = IorToFresnel0( iridescenceIOR, outsideIOR ); float R12 = F_Schlick( R0, 1.0, cosTheta1 ); float R21 = R12; float T121 = 1.0 - R12; float phi12 = 0.0; if ( iridescenceIOR < outsideIOR ) phi12 = PI; float phi21 = PI - phi12; vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); vec3 phi23 = vec3( 0.0 ); if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; vec3 phi = vec3( phi21 ) + phi23; vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); vec3 r123 = sqrt( R123 ); vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); vec3 C0 = R12 + Rs; I = C0; vec3 Cm = Rs - T121; for ( int m = 1; m <= 2; ++ m ) { Cm *= r123; vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); I += Cm * Sm; } return max( I, vec3( 0.0 ) ); } #endif`,jk=`#ifdef USE_BUMPMAP uniform sampler2D bumpMap; uniform float bumpScale; vec2 dHdxy_fwd() { vec2 dSTdx = dFdx( vUv ); vec2 dSTdy = dFdy( vUv ); float Hll = bumpScale * texture2D( bumpMap, vUv ).x; float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; return vec2( dBx, dBy ); } vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { vec3 vSigmaX = dFdx( surf_pos.xyz ); vec3 vSigmaY = dFdy( surf_pos.xyz ); vec3 vN = surf_norm; vec3 R1 = cross( vSigmaY, vN ); vec3 R2 = cross( vN, vSigmaX ); float fDet = dot( vSigmaX, R1 ) * faceDirection; vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); return normalize( abs( fDet ) * surf_norm - vGrad ); } #endif`,Jk=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES bool clipped = true; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; } #pragma unroll_loop_end if ( clipped ) discard; #endif #endif`,Xk=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,Kk=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`,Yk=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`,Qk=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`,Zk=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`,qk=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; #endif`,$k=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); #endif #ifdef USE_COLOR vColor *= color; #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; #endif`,eO=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 #define RECIPROCAL_PI2 0.15915494309189535 #define EPSILON 1e-6 #ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif #define whiteComplement( a ) ( 1.0 - saturate( a ) ) float pow2( const in float x ) { return x*x; } vec3 pow2( const in vec3 x ) { return x*x; } float pow3( const in float x ) { return x*x*x; } float pow4( const in float x ) { float x2 = x*x; return x2*x2; } float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } highp float rand( const in vec2 uv ) { const highp float a = 12.9898, b = 78.233, c = 43758.5453; highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); return fract( sin( sn ) * c ); } #ifdef HIGH_PRECISION float precisionSafeLength( vec3 v ) { return length( v ); } #else float precisionSafeLength( vec3 v ) { float maxComponent = max3( abs( v ) ); return length( v / maxComponent ) * maxComponent; } #endif struct IncidentLight { vec3 color; vec3 direction; bool visible; }; struct ReflectedLight { vec3 directDiffuse; vec3 directSpecular; vec3 indirectDiffuse; vec3 indirectSpecular; }; struct GeometricContext { vec3 position; vec3 normal; vec3 viewDir; #ifdef USE_CLEARCOAT vec3 clearcoatNormal; #endif }; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); } mat3 transposeMat3( const in mat3 m ) { mat3 tmp; tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); return tmp; } float luminance( const in vec3 rgb ) { const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); return dot( weights, rgb ); } bool isPerspectiveMatrix( mat4 m ) { return m[ 2 ][ 3 ] == - 1.0; } vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); }`,tO=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { vec3 absDirection = abs( direction ); float face = - 1.0; if ( absDirection.x > absDirection.z ) { if ( absDirection.x > absDirection.y ) face = direction.x > 0.0 ? 0.0 : 3.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } else { if ( absDirection.z > absDirection.y ) face = direction.z > 0.0 ? 2.0 : 5.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } return face; } vec2 getUV( vec3 direction, float face ) { vec2 uv; if ( face == 0.0 ) { uv = vec2( direction.z, direction.y ) / abs( direction.x ); } else if ( face == 1.0 ) { uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); } else if ( face == 2.0 ) { uv = vec2( - direction.x, direction.y ) / abs( direction.z ); } else if ( face == 3.0 ) { uv = vec2( - direction.z, direction.y ) / abs( direction.x ); } else if ( face == 4.0 ) { uv = vec2( - direction.x, direction.z ) / abs( direction.y ); } else { uv = vec2( direction.x, direction.y ) / abs( direction.z ); } return 0.5 * ( uv + 1.0 ); } vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { float face = getFace( direction ); float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); mipInt = max( mipInt, cubeUV_minMipLevel ); float faceSize = exp2( mipInt ); highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; if ( face > 2.0 ) { uv.y += faceSize; face -= 3.0; } uv.x += face * faceSize; uv.x += filterInt * 3.0 * cubeUV_minTileSize; uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); uv.x *= CUBEUV_TEXEL_WIDTH; uv.y *= CUBEUV_TEXEL_HEIGHT; #ifdef texture2DGradEXT return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; #else return texture2D( envMap, uv ).rgb; #endif } #define cubeUV_r0 1.0 #define cubeUV_v0 0.339 #define cubeUV_m0 - 2.0 #define cubeUV_r1 0.8 #define cubeUV_v1 0.276 #define cubeUV_m1 - 1.0 #define cubeUV_r4 0.4 #define cubeUV_v4 0.046 #define cubeUV_m4 2.0 #define cubeUV_r5 0.305 #define cubeUV_v5 0.016 #define cubeUV_m5 3.0 #define cubeUV_r6 0.21 #define cubeUV_v6 0.0038 #define cubeUV_m6 4.0 float roughnessToMip( float roughness ) { float mip = 0.0; if ( roughness >= cubeUV_r1 ) { mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; } else if ( roughness >= cubeUV_r4 ) { mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; } else if ( roughness >= cubeUV_r5 ) { mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; } else if ( roughness >= cubeUV_r6 ) { mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; } else { mip = - 2.0 * log2( 1.16 * roughness ); } return mip; } vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); float mipF = fract( mip ); float mipInt = floor( mip ); vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); if ( mipF == 0.0 ) { return vec4( color0, 1.0 ); } else { vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); return vec4( mix( color0, color1, mipF ), 1.0 ); } } #endif`,nO=`vec3 transformedNormal = objectNormal; #ifdef USE_INSTANCING mat3 m = mat3( instanceMatrix ); transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); transformedNormal = m * transformedNormal; #endif transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedNormal = - transformedNormal; #endif #ifdef USE_TANGENT vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif #endif`,iO=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`,rO=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); #endif`,sO=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); totalEmissiveRadiance *= emissiveColor.rgb; #endif`,oO=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`,aO="gl_FragColor = linearToOutputTexel( gl_FragColor );",lO=`vec4 LinearToLinear( in vec4 value ) { return value; } vec4 LinearTosRGB( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); }`,uO=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToFrag = normalize( vWorldPosition - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( cameraToFrag, worldNormal ); #else vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); #endif #else vec3 reflectVec = vReflect; #endif #ifdef ENVMAP_TYPE_CUBE vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); #else vec4 envColor = vec4( 0.0 ); #endif #ifdef ENVMAP_BLENDING_MULTIPLY outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_MIX ) outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif #endif`,cO=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #else uniform sampler2D envMap; #endif #endif`,fO=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; uniform float refractionRatio; #else varying vec3 vReflect; #endif #endif`,hO=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; #else varying vec3 vReflect; uniform float refractionRatio; #endif #endif`,dO=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else vec3 cameraToVertex; if ( isOrthographic ) { cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vReflect = reflect( cameraToVertex, worldNormal ); #else vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif #endif`,pO=`#ifdef USE_FOG vFogDepth = - mvPosition.z; #endif`,mO=`#ifdef USE_FOG varying float vFogDepth; #endif`,gO=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif`,yO=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`,vO=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { float dotNL = dot( normal, lightDirection ); vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); #ifdef USE_GRADIENTMAP return vec3( texture2D( gradientMap, coord ).r ); #else vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif }`,xO=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; #endif`,_O=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`,AO=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularStrength = specularStrength;`,MO=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; }; void RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,wO=`uniform bool receiveShadow; uniform vec3 ambientLightColor; uniform vec3 lightProbe[ 9 ]; vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { float x = normal.x, y = normal.y, z = normal.z; vec3 result = shCoefficients[ 0 ] * 0.886227; result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); return result; } vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); return irradiance; } vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { vec3 irradiance = ambientLightColor; return irradiance; } float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { #if defined ( PHYSICALLY_CORRECT_LIGHTS ) float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); if ( cutoffDistance > 0.0 ) { distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); } return distanceFalloff; #else if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); } return 1.0; #endif } float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { return smoothstep( coneCosine, penumbraCosine, angleCosine ); } #if NUM_DIR_LIGHTS > 0 struct DirectionalLight { vec3 direction; vec3 color; }; uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) { light.color = directionalLight.color; light.direction = directionalLight.direction; light.visible = true; } #endif #if NUM_POINT_LIGHTS > 0 struct PointLight { vec3 position; vec3 color; float distance; float decay; }; uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) { vec3 lVector = pointLight.position - geometry.position; light.direction = normalize( lVector ); float lightDistance = length( lVector ); light.color = pointLight.color; light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); light.visible = ( light.color != vec3( 0.0 ) ); } #endif #if NUM_SPOT_LIGHTS > 0 struct SpotLight { vec3 position; vec3 direction; vec3 color; float distance; float decay; float coneCos; float penumbraCos; }; uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) { vec3 lVector = spotLight.position - geometry.position; light.direction = normalize( lVector ); float angleCos = dot( light.direction, spotLight.direction ); float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); if ( spotAttenuation > 0.0 ) { float lightDistance = length( lVector ); light.color = spotLight.color * spotAttenuation; light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); light.visible = ( light.color != vec3( 0.0 ) ); } else { light.color = vec3( 0.0 ); light.visible = false; } } #endif #if NUM_RECT_AREA_LIGHTS > 0 struct RectAreaLight { vec3 color; vec3 position; vec3 halfWidth; vec3 halfHeight; }; uniform sampler2D ltc_1; uniform sampler2D ltc_2; uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; #endif #if NUM_HEMI_LIGHTS > 0 struct HemisphereLight { vec3 direction; vec3 skyColor; vec3 groundColor; }; uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { float dotNL = dot( normal, hemiLight.direction ); float hemiDiffuseWeight = 0.5 * dotNL + 0.5; vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } #endif`,SO=`#if defined( USE_ENVMAP ) vec3 getIBLIrradiance( const in vec3 normal ) { #if defined( ENVMAP_TYPE_CUBE_UV ) vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); return PI * envMapColor.rgb * envMapIntensity; #else return vec3( 0.0 ); #endif } vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { #if defined( ENVMAP_TYPE_CUBE_UV ) vec3 reflectVec = reflect( - viewDir, normal ); reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); return envMapColor.rgb * envMapIntensity; #else return vec3( 0.0 ); #endif } #endif`,CO=`ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`,EO=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,bO=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`,TO=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; float specularShininess; float specularStrength; }; void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength; } void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,PO=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; material.roughness = min( material.roughness, 1.0 ); #ifdef IOR material.ior = ior; #ifdef SPECULAR float specularIntensityFactor = specularIntensity; vec3 specularColorFactor = specularColor; #ifdef USE_SPECULARINTENSITYMAP specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; #endif #ifdef USE_SPECULARCOLORMAP specularColorFactor *= texture2D( specularColorMap, vUv ).rgb; #endif material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); #else float specularIntensityFactor = 1.0; vec3 specularColorFactor = vec3( 1.0 ); material.specularF90 = 1.0; #endif material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); #else material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); material.specularF90 = 1.0; #endif #ifdef USE_CLEARCOAT material.clearcoat = clearcoat; material.clearcoatRoughness = clearcoatRoughness; material.clearcoatF0 = vec3( 0.04 ); material.clearcoatF90 = 1.0; #ifdef USE_CLEARCOATMAP material.clearcoat *= texture2D( clearcoatMap, vUv ).x; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; #endif material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); material.clearcoatRoughness += geometryRoughness; material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); #endif #ifdef USE_IRIDESCENCE material.iridescence = iridescence; material.iridescenceIOR = iridescenceIOR; #ifdef USE_IRIDESCENCEMAP material.iridescence *= texture2D( iridescenceMap, vUv ).r; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum; #else material.iridescenceThickness = iridescenceThicknessMaximum; #endif #endif #ifdef USE_SHEEN material.sheenColor = sheenColor; #ifdef USE_SHEENCOLORMAP material.sheenColor *= texture2D( sheenColorMap, vUv ).rgb; #endif material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); #ifdef USE_SHEENROUGHNESSMAP material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a; #endif #endif`,BO=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; float specularF90; #ifdef USE_CLEARCOAT float clearcoat; float clearcoatRoughness; vec3 clearcoatF0; float clearcoatF90; #endif #ifdef USE_IRIDESCENCE float iridescence; float iridescenceIOR; float iridescenceThickness; vec3 iridescenceFresnel; vec3 iridescenceF0; #endif #ifdef USE_SHEEN vec3 sheenColor; float sheenRoughness; #endif #ifdef IOR float ior; #endif #ifdef USE_TRANSMISSION float transmission; float transmissionAlpha; float thickness; float attenuationDistance; vec3 attenuationColor; #endif }; vec3 clearcoatSpecular = vec3( 0.0 ); vec3 sheenSpecular = vec3( 0.0 ); float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); float r2 = roughness * roughness; float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); return saturate( DG * RECIPROCAL_PI ); } vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); vec4 r = roughness * c0 + c1; float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; return fab; } vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { vec2 fab = DFGApprox( normal, viewDir, roughness ); return specularColor * fab.x + specularF90 * fab.y; } #ifdef USE_IRIDESCENCE void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { #else void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { #endif vec2 fab = DFGApprox( normal, viewDir, roughness ); #ifdef USE_IRIDESCENCE vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); #else vec3 Fr = specularColor; #endif vec3 FssEss = Fr * fab.x + specularF90 * fab.y; float Ess = fab.x + fab.y; float Ems = 1.0 - Ess; vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); singleScatter += FssEss; multiScatter += Fms * Ems; } #if NUM_RECT_AREA_LIGHTS > 0 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { vec3 normal = geometry.normal; vec3 viewDir = geometry.viewDir; vec3 position = geometry.position; vec3 lightPos = rectAreaLight.position; vec3 halfWidth = rectAreaLight.halfWidth; vec3 halfHeight = rectAreaLight.halfHeight; vec3 lightColor = rectAreaLight.color; float roughness = material.roughness; vec3 rectCoords[ 4 ]; rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; vec2 uv = LTC_Uv( normal, viewDir, roughness ); vec4 t1 = texture2D( ltc_1, uv ); vec4 t2 = texture2D( ltc_2, uv ); mat3 mInv = mat3( vec3( t1.x, 0, t1.y ), vec3( 0, 1, 0 ), vec3( t1.z, 0, t1.w ) ); vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); } #endif void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifdef USE_CLEARCOAT float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); vec3 ccIrradiance = dotNLcc * directLight.color; clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); #endif #ifdef USE_SHEEN sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness ); #endif #ifdef USE_IRIDESCENCE reflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness ); #else reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness ); #endif reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { #ifdef USE_CLEARCOAT clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); #endif #ifdef USE_SHEEN sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness ); #endif vec3 singleScattering = vec3( 0.0 ); vec3 multiScattering = vec3( 0.0 ); vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; #ifdef USE_IRIDESCENCE computeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); #else computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); #endif vec3 totalScattering = singleScattering + multiScattering; vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); reflectedLight.indirectSpecular += radiance * singleScattering; reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; } #define RE_Direct RE_Direct_Physical #define RE_Direct_RectArea RE_Direct_RectArea_Physical #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); }`,RO=` GeometricContext geometry; geometry.position = - vViewPosition; geometry.normal = normal; geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); #ifdef USE_CLEARCOAT geometry.clearcoatNormal = clearcoatNormal; #endif #ifdef USE_IRIDESCENCE float dotNVi = saturate( dot( normal, geometry.viewDir ) ); if ( material.iridescenceThickness == 0.0 ) { material.iridescence = 0.0; } else { material.iridescence = saturate( material.iridescence ); } if ( material.iridescence > 0.0 ) { material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); } #endif IncidentLight directLight; #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) PointLight pointLight; #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { pointLight = pointLights[ i ]; getPointLightInfo( pointLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) pointLightShadow = pointLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) SpotLight spotLight; vec4 spotColor; vec3 spotLightCoord; bool inSpotLightMap; #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { spotLight = spotLights[ i ]; getSpotLightInfo( spotLight, geometry, directLight ); #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS #else #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) #endif #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; #endif #undef SPOT_LIGHT_MAP_INDEX #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) spotLightShadow = spotLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) DirectionalLight directionalLight; #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { directionalLight = directionalLights[ i ]; getDirectionalLightInfo( directionalLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) directionalLightShadow = directionalLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) RectAreaLight rectAreaLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { rectAreaLight = rectAreaLights[ i ]; RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if defined( RE_IndirectDiffuse ) vec3 iblIrradiance = vec3( 0.0 ); vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); irradiance += getLightProbeIrradiance( lightProbe, geometry.normal ); #if ( NUM_HEMI_LIGHTS > 0 ) #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); } #pragma unroll_loop_end #endif #endif #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); #endif`,LO=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; irradiance += lightMapIrradiance; #endif #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) iblIrradiance += getIBLIrradiance( geometry.normal ); #endif #endif #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness ); #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness ); #endif #endif`,IO=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); #endif`,DO=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,FO=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`,NO=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif #endif`,kO=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #else if ( isPerspectiveMatrix( projectionMatrix ) ) { gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; gl_Position.z *= gl_Position.w; } #endif #endif`,OO=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; #endif`,UO=`#ifdef USE_MAP uniform sampler2D map; #endif`,zO=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #ifdef USE_MAP diffuseColor *= texture2D( map, uv ); #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; #endif`,GO=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #ifdef USE_MAP uniform sampler2D map; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`,HO=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.b; #endif`,VO=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`,WO=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; #elif defined( USE_COLOR ) if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } #endif`,jO=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } #else objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif #endif`,JO=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; uniform sampler2DArray morphTargetsTexture; uniform ivec2 morphTargetsTextureSize; vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; int y = texelIndex / morphTargetsTextureSize.x; int x = texelIndex - y * morphTargetsTextureSize.x; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } #else #ifndef USE_MORPHNORMALS uniform float morphTargetInfluences[ 8 ]; #else uniform float morphTargetInfluences[ 4 ]; #endif #endif #endif`,XO=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } #else transformed += morphTarget0 * morphTargetInfluences[ 0 ]; transformed += morphTarget1 * morphTargetInfluences[ 1 ]; transformed += morphTarget2 * morphTargetInfluences[ 2 ]; transformed += morphTarget3 * morphTargetInfluences[ 3 ]; #ifndef USE_MORPHNORMALS transformed += morphTarget4 * morphTargetInfluences[ 4 ]; transformed += morphTarget5 * morphTargetInfluences[ 5 ]; transformed += morphTarget6 * morphTargetInfluences[ 6 ]; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif #endif`,KO=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); vec3 normal = normalize( cross( fdx, fdy ) ); #else vec3 normal = normalize( vNormal ); #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif #ifdef USE_TANGENT vec3 tangent = normalize( vTangent ); vec3 bitangent = normalize( vBitangent ); #ifdef DOUBLE_SIDED tangent = tangent * faceDirection; bitangent = bitangent * faceDirection; #endif #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) mat3 vTBN = mat3( tangent, bitangent, normal ); #endif #endif #endif vec3 geometryNormal = normal;`,YO=`#ifdef OBJECTSPACE_NORMALMAP normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; #endif #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif normal = normalize( normalMatrix * normal ); #elif defined( TANGENTSPACE_NORMALMAP ) vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; mapN.xy *= normalScale; #ifdef USE_TANGENT normal = normalize( vTBN * mapN ); #else normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection ); #endif #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif`,QO=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,ZO=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,qO=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif`,$O=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif #ifdef OBJECTSPACE_NORMALMAP uniform mat3 normalMatrix; #endif #if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { vec3 q0 = dFdx( eye_pos.xyz ); vec3 q1 = dFdy( eye_pos.xyz ); vec2 st0 = dFdx( vUv.st ); vec2 st1 = dFdy( vUv.st ); vec3 N = surf_norm; vec3 q1perp = cross( q1, N ); vec3 q0perp = cross( N, q0 ); vec3 T = q1perp * st0.x + q0perp * st1.x; vec3 B = q1perp * st0.y + q0perp * st1.y; float det = max( dot( T, T ), dot( B, B ) ); float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); } #endif`,eU=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = geometryNormal; #endif`,tU=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; #ifdef USE_TANGENT clearcoatNormal = normalize( vTBN * clearcoatMapN ); #else clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); #endif #endif`,nU=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; #endif`,iU=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; #endif`,rU=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha + 0.1; #endif gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,sU=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); const float ShiftRight8 = 1. / 256.; vec4 packDepthToRGBA( const in float v ) { vec4 r = vec4( fract( v * PackFactors ), v ); r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors ); } vec2 packDepthToRG( in highp float v ) { return packDepthToRGBA( v ).yx; } float unpackRGToDepth( const in highp vec2 v ) { return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); } vec4 pack2HalfToRGBA( vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); } vec2 unpackRGBATo2Half( vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { return linearClipZ * ( near - far ) - near; } float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); }`,oU=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`,aU=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`,lU=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`,uU=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } #endif`,cU=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.g; #endif`,fU=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`,hU=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; #endif #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); } vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { return unpackRGBATo2Half( texture2D( shadow, uv ) ); } float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ float occlusion = 1.0; vec2 distribution = texture2DDistribution( shadow, uv ); float hard_shadow = step( compare , distribution.x ); if (hard_shadow != 1.0 ) { float distance = compare - distribution.x ; float variance = max( 0.00000, distribution.y * distribution.y ); float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); } return occlusion; } float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { float shadow = 1.0; shadowCoord.xyz /= shadowCoord.w; shadowCoord.z += shadowBias; bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; bool frustumTest = inFrustum && shadowCoord.z <= 1.0; if ( frustumTest ) { #if defined( SHADOWMAP_TYPE_PCF ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx0 = - texelSize.x * shadowRadius; float dy0 = - texelSize.y * shadowRadius; float dx1 = + texelSize.x * shadowRadius; float dy1 = + texelSize.y * shadowRadius; float dx2 = dx0 / 2.0; float dy2 = dy0 / 2.0; float dx3 = dx1 / 2.0; float dy3 = dy1 / 2.0; shadow = ( texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) ) * ( 1.0 / 17.0 ); #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx = texelSize.x; float dy = texelSize.y; vec2 uv = shadowCoord.xy; vec2 f = fract( uv * shadowMapSize + 0.5 ); uv -= f * texelSize; shadow = ( texture2DCompare( shadowMap, uv, shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), f.x ), mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), f.x ), f.y ) ) * ( 1.0 / 9.0 ); #elif defined( SHADOWMAP_TYPE_VSM ) shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); #else shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); #endif } return shadow; } vec2 cubeToUV( vec3 v, float texelSizeY ) { vec3 absV = abs( v ); float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); absV *= scaleToCube; v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); vec2 planar = v.xy; float almostATexel = 1.5 * texelSizeY; float almostOne = 1.0 - almostATexel; if ( absV.z >= almostOne ) { if ( v.z > 0.0 ) planar.x = 4.0 - v.x; } else if ( absV.x >= almostOne ) { float signX = sign( v.x ); planar.x = v.z * signX + 2.0 * signX; } else if ( absV.y >= almostOne ) { float signY = sign( v.y ); planar.x = v.x + 2.0 * signY + 2.0; planar.y = v.z * signY - 2.0; } return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); } float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); vec3 lightToPosition = shadowCoord.xyz; float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; vec3 bd3D = normalize( lightToPosition ); #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; return ( texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) ) * ( 1.0 / 9.0 ); #else return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } #endif`,dU=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif #endif`,pU=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif #if defined( USE_SHADOWMAP ) #if NUM_DIR_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #endif #if NUM_SPOT_LIGHT_COORDS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { shadowWorldPosition = worldPosition; #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; #endif vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif`,mU=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { directionalLight = directionalLightShadows[ i ]; shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { spotLight = spotLightShadows[ i ]; shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { pointLight = pointLightShadows[ i ]; shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; } #pragma unroll_loop_end #endif #endif return shadow; }`,gU=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`,yU=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; uniform int boneTextureSize; mat4 getBoneMatrix( const in float i ) { float j = i * 4.0; float x = mod( j, float( boneTextureSize ) ); float y = floor( j / float( boneTextureSize ) ); float dx = 1.0 / float( boneTextureSize ); float dy = 1.0 / float( boneTextureSize ); y = dy * ( y + 0.5 ); vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); mat4 bone = mat4( v1, v2, v3, v4 ); return bone; } #endif`,vU=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; skinned += boneMatY * skinVertex * skinWeight.y; skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; #endif`,xU=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; skinMatrix += skinWeight.z * boneMatZ; skinMatrix += skinWeight.w * boneMatW; skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif #endif`,_U=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`,AU=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`,MU=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`,wU=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; vec3 LinearToneMapping( vec3 color ) { return toneMappingExposure * color; } vec3 ReinhardToneMapping( vec3 color ) { color *= toneMappingExposure; return saturate( color / ( vec3( 1.0 ) + color ) ); } vec3 OptimizedCineonToneMapping( vec3 color ) { color *= toneMappingExposure; color = max( vec3( 0.0 ), color - 0.004 ); return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); } vec3 RRTAndODTFit( vec3 v ) { vec3 a = v * ( v + 0.0245786 ) - 0.000090537; vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; return a / b; } vec3 ACESFilmicToneMapping( vec3 color ) { const mat3 ACESInputMat = mat3( vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), vec3( 0.04823, 0.01566, 0.83777 ) ); const mat3 ACESOutputMat = mat3( vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), vec3( -0.07367, -0.00605, 1.07602 ) ); color *= toneMappingExposure / 0.6; color = ACESInputMat * color; color = RRTAndODTFit( color ); color = ACESOutputMat * color; return saturate( color ); } vec3 CustomToneMapping( vec3 color ) { return color; }`,SU=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; material.attenuationDistance = attenuationDistance; material.attenuationColor = attenuationColor; #ifdef USE_TRANSMISSIONMAP material.transmission *= texture2D( transmissionMap, vUv ).r; #endif #ifdef USE_THICKNESSMAP material.thickness *= texture2D( thicknessMap, vUv ).g; #endif vec3 pos = vWorldPosition; vec3 v = normalize( cameraPosition - pos ); vec3 n = inverseTransformDirection( normal, viewMatrix ); vec4 transmission = getIBLVolumeRefraction( n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission ); #endif`,CU=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; uniform vec3 attenuationColor; #ifdef USE_TRANSMISSIONMAP uniform sampler2D transmissionMap; #endif #ifdef USE_THICKNESSMAP uniform sampler2D thicknessMap; #endif uniform vec2 transmissionSamplerSize; uniform sampler2D transmissionSamplerMap; uniform mat4 modelMatrix; uniform mat4 projectionMatrix; varying vec3 vWorldPosition; vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); vec3 modelScale; modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); return normalize( refractionVector ) * thickness * modelScale; } float applyIorToRoughness( const in float roughness, const in float ior ) { return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); } vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); #ifdef texture2DLodEXT return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod ); #else return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod ); #endif } vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { if ( isinf( attenuationDistance ) ) { return radiance; } else { vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance * radiance; } } vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, const in vec3 attenuationColor, const in float attenuationDistance ) { vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance ); vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a ); } #endif`,EU=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; #endif`,bU=`#ifdef USE_UV #ifdef UVS_VERTEX_ONLY vec2 vUv; #else varying vec2 vUv; #endif uniform mat3 uvTransform; #endif`,TU=`#ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif`,PU=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; #endif`,BU=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; uniform mat3 uv2Transform; #endif`,RU=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; #endif`,LU=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; #endif`;const IU=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`,DU=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { vec4 texColor = texture2D( t2D, vUv ); #ifdef DECODE_VIDEO_TEXTURE texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); #endif texColor.rgb *= backgroundIntensity; gl_FragColor = texColor; #include <tonemapping_fragment> #include <encodings_fragment> }`,FU=`varying vec3 vWorldDirection; #include <common> void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include <begin_vertex> #include <project_vertex> gl_Position.z = gl_Position.w; }`,NU=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; #endif uniform float flipEnvMap; uniform float backgroundBlurriness; uniform float backgroundIntensity; varying vec3 vWorldDirection; #include <cube_uv_reflection_fragment> void main() { #ifdef ENVMAP_TYPE_CUBE vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); #else vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); #endif texColor.rgb *= backgroundIntensity; gl_FragColor = texColor; #include <tonemapping_fragment> #include <encodings_fragment> }`,kU=`varying vec3 vWorldDirection; #include <common> void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include <begin_vertex> #include <project_vertex> gl_Position.z = gl_Position.w; }`,OU=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; void main() { vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); gl_FragColor = texColor; gl_FragColor.a *= opacity; #include <tonemapping_fragment> #include <encodings_fragment> }`,UU=`#include <common> #include <uv_pars_vertex> #include <displacementmap_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <logdepthbuf_pars_vertex> #include <clipping_planes_pars_vertex> varying vec2 vHighPrecisionZW; void main() { #include <uv_vertex> #include <skinbase_vertex> #ifdef USE_DISPLACEMENTMAP #include <beginnormal_vertex> #include <morphnormal_vertex> #include <skinnormal_vertex> #endif #include <begin_vertex> #include <morphtarget_vertex> #include <skinning_vertex> #include <displacementmap_vertex> #include <project_vertex> #include <logdepthbuf_vertex> #include <clipping_planes_vertex> vHighPrecisionZW = gl_Position.zw; }`,zU=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include <common> #include <packing> #include <uv_pars_fragment> #include <map_pars_fragment> #include <alphamap_pars_fragment> #include <alphatest_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> varying vec2 vHighPrecisionZW; void main() { #include <clipping_planes_fragment> vec4 diffuseColor = vec4( 1.0 ); #if DEPTH_PACKING == 3200 diffuseColor.a = opacity; #endif #include <map_fragment> #include <alphamap_fragment> #include <alphatest_fragment> #include <logdepthbuf_fragment> float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; #if DEPTH_PACKING == 3200 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif }`,GU=`#define DISTANCE varying vec3 vWorldPosition; #include <common> #include <uv_pars_vertex> #include <displacementmap_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <clipping_planes_pars_vertex> void main() { #include <uv_vertex> #include <skinbase_vertex> #ifdef USE_DISPLACEMENTMAP #include <beginnormal_vertex> #include <morphnormal_vertex> #include <skinnormal_vertex> #endif #include <begin_vertex> #include <morphtarget_vertex> #include <skinning_vertex> #include <displacementmap_vertex> #include <project_vertex> #include <worldpos_vertex> #include <clipping_planes_vertex> vWorldPosition = worldPosition.xyz; }`,HU=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; varying vec3 vWorldPosition; #include <common> #include <packing> #include <uv_pars_fragment> #include <map_pars_fragment> #include <alphamap_pars_fragment> #include <alphatest_pars_fragment> #include <clipping_planes_pars_fragment> void main () { #include <clipping_planes_fragment> vec4 diffuseColor = vec4( 1.0 ); #include <map_fragment> #include <alphamap_fragment> #include <alphatest_fragment> float dist = length( vWorldPosition - referencePosition ); dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); }`,VU=`varying vec3 vWorldDirection; #include <common> void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include <begin_vertex> #include <project_vertex> }`,WU=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include <common> void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); #include <tonemapping_fragment> #include <encodings_fragment> }`,jU=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include <common> #include <color_pars_vertex> #include <fog_pars_vertex> #include <morphtarget_pars_vertex> #include <logdepthbuf_pars_vertex> #include <clipping_planes_pars_vertex> void main() { vLineDistance = scale * lineDistance; #include <color_vertex> #include <morphcolor_vertex> #include <begin_vertex> #include <morphtarget_vertex> #include <project_vertex> #include <logdepthbuf_vertex> #include <clipping_planes_vertex> #include <fog_vertex> }`,JU=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; varying float vLineDistance; #include <common> #include <color_pars_fragment> #include <fog_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { #include <clipping_planes_fragment> if ( mod( vLineDistance, totalSize ) > dashSize ) { discard; } vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include <logdepthbuf_fragment> #include <color_fragment> outgoingLight = diffuseColor.rgb; #include <output_fragment> #include <tonemapping_fragment> #include <encodings_fragment> #include <fog_fragment> #include <premultiplied_alpha_fragment> }`,XU=`#include <common> #include <uv_pars_vertex> #include <uv2_pars_vertex> #include <envmap_pars_vertex> #include <color_pars_vertex> #include <fog_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <logdepthbuf_pars_vertex> #include <clipping_planes_pars_vertex> void main() { #include <uv_vertex> #include <uv2_vertex> #include <color_vertex> #include <morphcolor_vertex> #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) #include <beginnormal_vertex> #include <morphnormal_vertex> #include <skinbase_vertex> #include <skinnormal_vertex> #include <defaultnormal_vertex> #endif #include <begin_vertex> #include <morphtarget_vertex> #include <skinning_vertex> #include <project_vertex> #include <logdepthbuf_vertex> #include <clipping_planes_vertex> #include <worldpos_vertex> #include <envmap_vertex> #include <fog_vertex> }`,KU=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include <common> #include <dithering_pars_fragment> #include <color_pars_fragment> #include <uv_pars_fragment> #include <uv2_pars_fragment> #include <map_pars_fragment> #include <alphamap_pars_fragment> #include <alphatest_pars_fragment> #include <aomap_pars_fragment> #include <lightmap_pars_fragment> #include <envmap_common_pars_fragment> #include <envmap_pars_fragment> #include <fog_pars_fragment> #include <specularmap_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { #include <clipping_planes_fragment> vec4 diffuseColor = vec4( diffuse, opacity ); #include <logdepthbuf_fragment> #include <map_fragment> #include <color_fragment> #include <alphamap_fragment> #include <alphatest_fragment> #include <specularmap_fragment> ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; #else reflectedLight.indirectDiffuse += vec3( 1.0 ); #endif #include <aomap_fragment> reflectedLight.indirectDiffuse *= diffuseColor.rgb; vec3 outgoingLight = reflectedLight.indirectDiffuse; #include <envmap_fragment> #include <output_fragment> #include <tonemapping_fragment> #include <encodings_fragment> #include <fog_fragment> #include <premultiplied_alpha_fragment> #include <dithering_fragment> }`,YU=`#define LAMBERT varying vec3 vViewPosition; #include <common> #include <uv_pars_vertex> #include <uv2_pars_vertex> #include <displacementmap_pars_vertex> #include <envmap_pars_vertex> #include <color_pars_vertex> #include <fog_pars_vertex> #include <normal_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <shadowmap_pars_vertex> #include <logdepthbuf_pars_vertex> #include <clipping_planes_pars_vertex> void main() { #include <uv_vertex> #include <uv2_vertex> #include <color_vertex> #include <morphcolor_vertex> #include <beginnormal_vertex> #include <morphnormal_vertex> #include <skinbase_vertex> #include <skinnormal_vertex> #include <defaultnormal_vertex> #include <normal_vertex> #include <begin_vertex> #include <morphtarget_vertex> #include <skinning_vertex> #include <displacementmap_vertex> #include <project_vertex> #include <logdepthbuf_vertex> #include <clipping_planes_vertex> vViewPosition = - mvPosition.xyz; #include <worldpos_vertex> #include <envmap_vertex> #include <shadowmap_vertex> #include <fog_vertex> }`,QU=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include <common> #include <packing> #include <dithering_pars_fragment> #include <color_pars_fragment> #include <uv_pars_fragment> #include <uv2_pars_fragment> #include <map_pars_fragment> #include <alphamap_pars_fragment> #include <alphatest_pars_fragment> #include <aomap_pars_fragment> #include <lightmap_pars_fragment> #include <emissivemap_pars_fragment> #include <envmap_common_pars_fragment> #include <envmap_pars_fragment> #include <fog_pars_fragment> #include <bsdfs> #include <lights_pars_begin> #include <normal_pars_fragment> #include <lights_lambert_pars_fragment> #include <shadowmap_pars_fragment> #include <bumpmap_pars_fragment> #include <normalmap_pars_fragment> #include <specularmap_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { #include <clipping_planes_fragment> vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include <logdepthbuf_fragment> #include <map_fragment> #include <color_fragment> #include <alphamap_fragment> #include <alphatest_fragment> #include <specularmap_fragment> #include <normal_fragment_begin> #include <normal_fragment_maps> #include <emissivemap_fragment> #include <lights_lambert_fragment> #include <lights_fragment_begin> #include <lights_fragment_maps> #include <lights_fragment_end> #include <aomap_fragment> vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include <envmap_fragment> #include <output_fragment> #include <tonemapping_fragment> #include <encodings_fragment> #include <fog_fragment> #include <premultiplied_alpha_fragment> #include <dithering_fragment> }`,ZU=`#define MATCAP varying vec3 vViewPosition; #include <common> #include <uv_pars_vertex> #include <color_pars_vertex> #include <displacementmap_pars_vertex> #include <fog_pars_vertex> #include <normal_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <logdepthbuf_pars_vertex> #include <clipping_planes_pars_vertex> void main() { #include <uv_vertex> #include <color_vertex> #include <morphcolor_vertex> #include <beginnormal_vertex> #include <morphnormal_vertex> #include <skinbase_vertex> #include <skinnormal_vertex> #include <defaultnormal_vertex> #include <normal_vertex> #include <begin_vertex> #include <morphtarget_vertex> #include <skinning_vertex> #include <displacementmap_vertex> #include <project_vertex> #include <logdepthbuf_vertex> #include <clipping_planes_vertex> #include <fog_vertex> vViewPosition = - mvPosition.xyz; }`,qU=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; varying vec3 vViewPosition; #include <common> #include <dithering_pars_fragment> #include <color_pars_fragment> #include <uv_pars_fragment> #include <map_pars_fragment> #include <alphamap_pars_fragment> #include <alphatest_pars_fragment> #include <fog_pars_fragment> #include <normal_pars_fragment> #include <bumpmap_pars_fragment> #include <normalmap_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { #include <clipping_planes_fragment> vec4 diffuseColor = vec4( diffuse, opacity ); #include <logdepthbuf_fragment> #include <map_fragment> #include <color_fragment> #include <alphamap_fragment> #include <alphatest_fragment> #include <normal_fragment_begin> #include <normal_fragment_maps> vec3 viewDir = normalize( vViewPosition ); vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); vec3 y = cross( viewDir, x ); vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; #ifdef USE_MATCAP vec4 matcapColor = texture2D( matcap, uv ); #else vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); #endif vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; #include <output_fragment> #include <tonemapping_fragment> #include <encodings_fragment> #include <fog_fragment> #include <premultiplied_alpha_fragment> #include <dithering_fragment> }`,$U=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif #include <common> #include <uv_pars_vertex> #include <displacementmap_pars_vertex> #include <normal_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <logdepthbuf_pars_vertex> #include <clipping_planes_pars_vertex> void main() { #include <uv_vertex> #include <beginnormal_vertex> #include <morphnormal_vertex> #include <skinbase_vertex> #include <skinnormal_vertex> #include <defaultnormal_vertex> #include <normal_vertex> #include <begin_vertex> #include <morphtarget_vertex> #include <skinning_vertex> #include <displacementmap_vertex> #include <project_vertex> #include <logdepthbuf_vertex> #include <clipping_planes_vertex> #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) vViewPosition = - mvPosition.xyz; #endif }`,ez=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif #include <packing> #include <uv_pars_fragment> #include <normal_pars_fragment> #include <bumpmap_pars_fragment> #include <normalmap_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { #include <clipping_planes_fragment> #include <logdepthbuf_fragment> #include <normal_fragment_begin> #include <normal_fragment_maps> gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); #ifdef OPAQUE gl_FragColor.a = 1.0; #endif }`,tz=`#define PHONG varying vec3 vViewPosition; #include <common> #include <uv_pars_vertex> #include <uv2_pars_vertex> #include <displacementmap_pars_vertex> #include <envmap_pars_vertex> #include <color_pars_vertex> #include <fog_pars_vertex> #include <normal_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <shadowmap_pars_vertex> #include <logdepthbuf_pars_vertex> #include <clipping_planes_pars_vertex> void main() { #include <uv_vertex> #include <uv2_vertex> #include <color_vertex> #include <morphcolor_vertex> #include <beginnormal_vertex> #include <morphnormal_vertex> #include <skinbase_vertex> #include <skinnormal_vertex> #include <defaultnormal_vertex> #include <normal_vertex> #include <begin_vertex> #include <morphtarget_vertex> #include <skinning_vertex> #include <displacementmap_vertex> #include <project_vertex> #include <logdepthbuf_vertex> #include <clipping_planes_vertex> vViewPosition = - mvPosition.xyz; #include <worldpos_vertex> #include <envmap_vertex> #include <shadowmap_vertex> #include <fog_vertex> }`,nz=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; uniform float shininess; uniform float opacity; #include <common> #include <packing> #include <dithering_pars_fragment> #include <color_pars_fragment> #include <uv_pars_fragment> #include <uv2_pars_fragment> #include <map_pars_fragment> #include <alphamap_pars_fragment> #include <alphatest_pars_fragment> #include <aomap_pars_fragment> #include <lightmap_pars_fragment> #include <emissivemap_pars_fragment> #include <envmap_common_pars_fragment> #include <envmap_pars_fragment> #include <fog_pars_fragment> #include <bsdfs> #include <lights_pars_begin> #include <normal_pars_fragment> #include <lights_phong_pars_fragment> #include <shadowmap_pars_fragment> #include <bumpmap_pars_fragment> #include <normalmap_pars_fragment> #include <specularmap_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { #include <clipping_planes_fragment> vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include <logdepthbuf_fragment> #include <map_fragment> #include <color_fragment> #include <alphamap_fragment> #include <alphatest_fragment> #include <specularmap_fragment> #include <normal_fragment_begin> #include <normal_fragment_maps> #include <emissivemap_fragment> #include <lights_phong_fragment> #include <lights_fragment_begin> #include <lights_fragment_maps> #include <lights_fragment_end> #include <aomap_fragment> vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; #include <envmap_fragment> #include <output_fragment> #include <tonemapping_fragment> #include <encodings_fragment> #include <fog_fragment> #include <premultiplied_alpha_fragment> #include <dithering_fragment> }`,iz=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; #endif #include <common> #include <uv_pars_vertex> #include <uv2_pars_vertex> #include <displacementmap_pars_vertex> #include <color_pars_vertex> #include <fog_pars_vertex> #include <normal_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <shadowmap_pars_vertex> #include <logdepthbuf_pars_vertex> #include <clipping_planes_pars_vertex> void main() { #include <uv_vertex> #include <uv2_vertex> #include <color_vertex> #include <morphcolor_vertex> #include <beginnormal_vertex> #include <morphnormal_vertex> #include <skinbase_vertex> #include <skinnormal_vertex> #include <defaultnormal_vertex> #include <normal_vertex> #include <begin_vertex> #include <morphtarget_vertex> #include <skinning_vertex> #include <displacementmap_vertex> #include <project_vertex> #include <logdepthbuf_vertex> #include <clipping_planes_vertex> vViewPosition = - mvPosition.xyz; #include <worldpos_vertex> #include <shadowmap_vertex> #include <fog_vertex> #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif }`,rz=`#define STANDARD #ifdef PHYSICAL #define IOR #define SPECULAR #endif uniform vec3 diffuse; uniform vec3 emissive; uniform float roughness; uniform float metalness; uniform float opacity; #ifdef IOR uniform float ior; #endif #ifdef SPECULAR uniform float specularIntensity; uniform vec3 specularColor; #ifdef USE_SPECULARINTENSITYMAP uniform sampler2D specularIntensityMap; #endif #ifdef USE_SPECULARCOLORMAP uniform sampler2D specularColorMap; #endif #endif #ifdef USE_CLEARCOAT uniform float clearcoat; uniform float clearcoatRoughness; #endif #ifdef USE_IRIDESCENCE uniform float iridescence; uniform float iridescenceIOR; uniform float iridescenceThicknessMinimum; uniform float iridescenceThicknessMaximum; #endif #ifdef USE_SHEEN uniform vec3 sheenColor; uniform float sheenRoughness; #ifdef USE_SHEENCOLORMAP uniform sampler2D sheenColorMap; #endif #ifdef USE_SHEENROUGHNESSMAP uniform sampler2D sheenRoughnessMap; #endif #endif varying vec3 vViewPosition; #include <common> #include <packing> #include <dithering_pars_fragment> #include <color_pars_fragment> #include <uv_pars_fragment> #include <uv2_pars_fragment> #include <map_pars_fragment> #include <alphamap_pars_fragment> #include <alphatest_pars_fragment> #include <aomap_pars_fragment> #include <lightmap_pars_fragment> #include <emissivemap_pars_fragment> #include <bsdfs> #include <iridescence_fragment> #include <cube_uv_reflection_fragment> #include <envmap_common_pars_fragment> #include <envmap_physical_pars_fragment> #include <fog_pars_fragment> #include <lights_pars_begin> #include <normal_pars_fragment> #include <lights_physical_pars_fragment> #include <transmission_pars_fragment> #include <shadowmap_pars_fragment> #include <bumpmap_pars_fragment> #include <normalmap_pars_fragment> #include <clearcoat_pars_fragment> #include <iridescence_pars_fragment> #include <roughnessmap_pars_fragment> #include <metalnessmap_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { #include <clipping_planes_fragment> vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include <logdepthbuf_fragment> #include <map_fragment> #include <color_fragment> #include <alphamap_fragment> #include <alphatest_fragment> #include <roughnessmap_fragment> #include <metalnessmap_fragment> #include <normal_fragment_begin> #include <normal_fragment_maps> #include <clearcoat_normal_fragment_begin> #include <clearcoat_normal_fragment_maps> #include <emissivemap_fragment> #include <lights_physical_fragment> #include <lights_fragment_begin> #include <lights_fragment_maps> #include <lights_fragment_end> #include <aomap_fragment> vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; #include <transmission_fragment> vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; #ifdef USE_SHEEN float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular; #endif #ifdef USE_CLEARCOAT float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat; #endif #include <output_fragment> #include <tonemapping_fragment> #include <encodings_fragment> #include <fog_fragment> #include <premultiplied_alpha_fragment> #include <dithering_fragment> }`,sz=`#define TOON varying vec3 vViewPosition; #include <common> #include <uv_pars_vertex> #include <uv2_pars_vertex> #include <displacementmap_pars_vertex> #include <color_pars_vertex> #include <fog_pars_vertex> #include <normal_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <shadowmap_pars_vertex> #include <logdepthbuf_pars_vertex> #include <clipping_planes_pars_vertex> void main() { #include <uv_vertex> #include <uv2_vertex> #include <color_vertex> #include <morphcolor_vertex> #include <beginnormal_vertex> #include <morphnormal_vertex> #include <skinbase_vertex> #include <skinnormal_vertex> #include <defaultnormal_vertex> #include <normal_vertex> #include <begin_vertex> #include <morphtarget_vertex> #include <skinning_vertex> #include <displacementmap_vertex> #include <project_vertex> #include <logdepthbuf_vertex> #include <clipping_planes_vertex> vViewPosition = - mvPosition.xyz; #include <worldpos_vertex> #include <shadowmap_vertex> #include <fog_vertex> }`,oz=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include <common> #include <packing> #include <dithering_pars_fragment> #include <color_pars_fragment> #include <uv_pars_fragment> #include <uv2_pars_fragment> #include <map_pars_fragment> #include <alphamap_pars_fragment> #include <alphatest_pars_fragment> #include <aomap_pars_fragment> #include <lightmap_pars_fragment> #include <emissivemap_pars_fragment> #include <gradientmap_pars_fragment> #include <fog_pars_fragment> #include <bsdfs> #include <lights_pars_begin> #include <normal_pars_fragment> #include <lights_toon_pars_fragment> #include <shadowmap_pars_fragment> #include <bumpmap_pars_fragment> #include <normalmap_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { #include <clipping_planes_fragment> vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include <logdepthbuf_fragment> #include <map_fragment> #include <color_fragment> #include <alphamap_fragment> #include <alphatest_fragment> #include <normal_fragment_begin> #include <normal_fragment_maps> #include <emissivemap_fragment> #include <lights_toon_fragment> #include <lights_fragment_begin> #include <lights_fragment_maps> #include <lights_fragment_end> #include <aomap_fragment> vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include <output_fragment> #include <tonemapping_fragment> #include <encodings_fragment> #include <fog_fragment> #include <premultiplied_alpha_fragment> #include <dithering_fragment> }`,az=`uniform float size; uniform float scale; #include <common> #include <color_pars_vertex> #include <fog_pars_vertex> #include <morphtarget_pars_vertex> #include <logdepthbuf_pars_vertex> #include <clipping_planes_pars_vertex> void main() { #include <color_vertex> #include <morphcolor_vertex> #include <begin_vertex> #include <morphtarget_vertex> #include <project_vertex> gl_PointSize = size; #ifdef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); #endif #include <logdepthbuf_vertex> #include <clipping_planes_vertex> #include <worldpos_vertex> #include <fog_vertex> }`,lz=`uniform vec3 diffuse; uniform float opacity; #include <common> #include <color_pars_fragment> #include <map_particle_pars_fragment> #include <alphatest_pars_fragment> #include <fog_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { #include <clipping_planes_fragment> vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include <logdepthbuf_fragment> #include <map_particle_fragment> #include <color_fragment> #include <alphatest_fragment> outgoingLight = diffuseColor.rgb; #include <output_fragment> #include <tonemapping_fragment> #include <encodings_fragment> #include <fog_fragment> #include <premultiplied_alpha_fragment> }`,uz=`#include <common> #include <fog_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <shadowmap_pars_vertex> void main() { #include <beginnormal_vertex> #include <morphnormal_vertex> #include <skinbase_vertex> #include <skinnormal_vertex> #include <defaultnormal_vertex> #include <begin_vertex> #include <morphtarget_vertex> #include <skinning_vertex> #include <project_vertex> #include <worldpos_vertex> #include <shadowmap_vertex> #include <fog_vertex> }`,cz=`uniform vec3 color; uniform float opacity; #include <common> #include <packing> #include <fog_pars_fragment> #include <bsdfs> #include <lights_pars_begin> #include <shadowmap_pars_fragment> #include <shadowmask_pars_fragment> void main() { gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); #include <tonemapping_fragment> #include <encodings_fragment> #include <fog_fragment> }`,fz=`uniform float rotation; uniform vec2 center; #include <common> #include <uv_pars_vertex> #include <fog_pars_vertex> #include <logdepthbuf_pars_vertex> #include <clipping_planes_pars_vertex> void main() { #include <uv_vertex> vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); vec2 scale; scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); #ifndef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) scale *= - mvPosition.z; #endif vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; vec2 rotatedPosition; rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; #include <logdepthbuf_vertex> #include <clipping_planes_vertex> #include <fog_vertex> }`,hz=`uniform vec3 diffuse; uniform float opacity; #include <common> #include <uv_pars_fragment> #include <map_pars_fragment> #include <alphamap_pars_fragment> #include <alphatest_pars_fragment> #include <fog_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { #include <clipping_planes_fragment> vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include <logdepthbuf_fragment> #include <map_fragment> #include <alphamap_fragment> #include <alphatest_fragment> outgoingLight = diffuseColor.rgb; #include <output_fragment> #include <tonemapping_fragment> #include <encodings_fragment> #include <fog_fragment> }`,pt={alphamap_fragment:Fk,alphamap_pars_fragment:Nk,alphatest_fragment:kk,alphatest_pars_fragment:Ok,aomap_fragment:Uk,aomap_pars_fragment:zk,begin_vertex:Gk,beginnormal_vertex:Hk,bsdfs:Vk,iridescence_fragment:Wk,bumpmap_pars_fragment:jk,clipping_planes_fragment:Jk,clipping_planes_pars_fragment:Xk,clipping_planes_pars_vertex:Kk,clipping_planes_vertex:Yk,color_fragment:Qk,color_pars_fragment:Zk,color_pars_vertex:qk,color_vertex:$k,common:eO,cube_uv_reflection_fragment:tO,defaultnormal_vertex:nO,displacementmap_pars_vertex:iO,displacementmap_vertex:rO,emissivemap_fragment:sO,emissivemap_pars_fragment:oO,encodings_fragment:aO,encodings_pars_fragment:lO,envmap_fragment:uO,envmap_common_pars_fragment:cO,envmap_pars_fragment:fO,envmap_pars_vertex:hO,envmap_physical_pars_fragment:SO,envmap_vertex:dO,fog_vertex:pO,fog_pars_vertex:mO,fog_fragment:gO,fog_pars_fragment:yO,gradientmap_pars_fragment:vO,lightmap_fragment:xO,lightmap_pars_fragment:_O,lights_lambert_fragment:AO,lights_lambert_pars_fragment:MO,lights_pars_begin:wO,lights_toon_fragment:CO,lights_toon_pars_fragment:EO,lights_phong_fragment:bO,lights_phong_pars_fragment:TO,lights_physical_fragment:PO,lights_physical_pars_fragment:BO,lights_fragment_begin:RO,lights_fragment_maps:LO,lights_fragment_end:IO,logdepthbuf_fragment:DO,logdepthbuf_pars_fragment:FO,logdepthbuf_pars_vertex:NO,logdepthbuf_vertex:kO,map_fragment:OO,map_pars_fragment:UO,map_particle_fragment:zO,map_particle_pars_fragment:GO,metalnessmap_fragment:HO,metalnessmap_pars_fragment:VO,morphcolor_vertex:WO,morphnormal_vertex:jO,morphtarget_pars_vertex:JO,morphtarget_vertex:XO,normal_fragment_begin:KO,normal_fragment_maps:YO,normal_pars_fragment:QO,normal_pars_vertex:ZO,normal_vertex:qO,normalmap_pars_fragment:$O,clearcoat_normal_fragment_begin:eU,clearcoat_normal_fragment_maps:tU,clearcoat_pars_fragment:nU,iridescence_pars_fragment:iU,output_fragment:rU,packing:sU,premultiplied_alpha_fragment:oU,project_vertex:aU,dithering_fragment:lU,dithering_pars_fragment:uU,roughnessmap_fragment:cU,roughnessmap_pars_fragment:fU,shadowmap_pars_fragment:hU,shadowmap_pars_vertex:dU,shadowmap_vertex:pU,shadowmask_pars_fragment:mU,skinbase_vertex:gU,skinning_pars_vertex:yU,skinning_vertex:vU,skinnormal_vertex:xU,specularmap_fragment:_U,specularmap_pars_fragment:AU,tonemapping_fragment:MU,tonemapping_pars_fragment:wU,transmission_fragment:SU,transmission_pars_fragment:CU,uv_pars_fragment:EU,uv_pars_vertex:bU,uv_vertex:TU,uv2_pars_fragment:PU,uv2_pars_vertex:BU,uv2_vertex:RU,worldpos_vertex:LU,background_vert:IU,background_frag:DU,backgroundCube_vert:FU,backgroundCube_frag:NU,cube_vert:kU,cube_frag:OU,depth_vert:UU,depth_frag:zU,distanceRGBA_vert:GU,distanceRGBA_frag:HU,equirect_vert:VU,equirect_frag:WU,linedashed_vert:jU,linedashed_frag:JU,meshbasic_vert:XU,meshbasic_frag:KU,meshlambert_vert:YU,meshlambert_frag:QU,meshmatcap_vert:ZU,meshmatcap_frag:qU,meshnormal_vert:$U,meshnormal_frag:ez,meshphong_vert:tz,meshphong_frag:nz,meshphysical_vert:iz,meshphysical_frag:rz,meshtoon_vert:sz,meshtoon_frag:oz,points_vert:az,points_frag:lz,shadow_vert:uz,shadow_frag:cz,sprite_vert:fz,sprite_frag:hz},Re={common:{diffuse:{value:new Le(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new ui},uv2Transform:{value:new ui},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new me(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Le(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Le(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new ui}},sprite:{diffuse:{value:new Le(16777215)},opacity:{value:1},center:{value:new me(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new ui}}},Pr={basic:{uniforms:oi([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.fog]),vertexShader:pt.meshbasic_vert,fragmentShader:pt.meshbasic_frag},lambert:{uniforms:oi([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.fog,Re.lights,{emissive:{value:new Le(0)}}]),vertexShader:pt.meshlambert_vert,fragmentShader:pt.meshlambert_frag},phong:{uniforms:oi([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.fog,Re.lights,{emissive:{value:new Le(0)},specular:{value:new Le(1118481)},shininess:{value:30}}]),vertexShader:pt.meshphong_vert,fragmentShader:pt.meshphong_frag},standard:{uniforms:oi([Re.common,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.roughnessmap,Re.metalnessmap,Re.fog,Re.lights,{emissive:{value:new Le(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:pt.meshphysical_vert,fragmentShader:pt.meshphysical_frag},toon:{uniforms:oi([Re.common,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.gradientmap,Re.fog,Re.lights,{emissive:{value:new Le(0)}}]),vertexShader:pt.meshtoon_vert,fragmentShader:pt.meshtoon_frag},matcap:{uniforms:oi([Re.common,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.fog,{matcap:{value:null}}]),vertexShader:pt.meshmatcap_vert,fragmentShader:pt.meshmatcap_frag},points:{uniforms:oi([Re.points,Re.fog]),vertexShader:pt.points_vert,fragmentShader:pt.points_frag},dashed:{uniforms:oi([Re.common,Re.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:pt.linedashed_vert,fragmentShader:pt.linedashed_frag},depth:{uniforms:oi([Re.common,Re.displacementmap]),vertexShader:pt.depth_vert,fragmentShader:pt.depth_frag},normal:{uniforms:oi([Re.common,Re.bumpmap,Re.normalmap,Re.displacementmap,{opacity:{value:1}}]),vertexShader:pt.meshnormal_vert,fragmentShader:pt.meshnormal_frag},sprite:{uniforms:oi([Re.sprite,Re.fog]),vertexShader:pt.sprite_vert,fragmentShader:pt.sprite_frag},background:{uniforms:{uvTransform:{value:new ui},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:pt.background_vert,fragmentShader:pt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:pt.backgroundCube_vert,fragmentShader:pt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:pt.cube_vert,fragmentShader:pt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:pt.equirect_vert,fragmentShader:pt.equirect_frag},distanceRGBA:{uniforms:oi([Re.common,Re.displacementmap,{referencePosition:{value:new D},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:pt.distanceRGBA_vert,fragmentShader:pt.distanceRGBA_frag},shadow:{uniforms:oi([Re.lights,Re.fog,{color:{value:new Le(0)},opacity:{value:1}}]),vertexShader:pt.shadow_vert,fragmentShader:pt.shadow_frag}};Pr.physical={uniforms:oi([Pr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new me(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Le(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new me},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Le(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Le(1,1,1)},specularColorMap:{value:null}}]),vertexShader:pt.meshphysical_vert,fragmentShader:pt.meshphysical_frag};const pp={r:0,b:0,g:0};function dz(n,e,t,i,r,s,o){const a=new Le(0);let l=s===!0?0:1,f,h,d=null,p=0,m=null;function v(x,_){let A=!1,w=_.isScene===!0?_.background:null;w&&w.isTexture&&(w=(_.backgroundBlurriness>0?t:e).get(w));const S=n.xr,b=S.getSession&&S.getSession();b&&b.environmentBlendMode==="additive"&&(w=null),w===null?y(a,l):w&&w.isColor&&(y(w,1),A=!0),(n.autoClear||A)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),w&&(w.isCubeTexture||w.mapping===Wu)?(h===void 0&&(h=new bn(new Qo(1,1,1),new ss({name:"BackgroundCubeMaterial",uniforms:Iu(Pr.backgroundCube.uniforms),vertexShader:Pr.backgroundCube.vertexShader,fragmentShader:Pr.backgroundCube.fragmentShader,side:Ei,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(P,R,E){this.matrixWorld.copyPosition(E.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),h.material.uniforms.envMap.value=w,h.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,h.material.toneMapped=w.encoding!==Ct,(d!==w||p!==w.version||m!==n.toneMapping)&&(h.material.needsUpdate=!0,d=w,p=w.version,m=n.toneMapping),h.layers.enableAll(),x.unshift(h,h.geometry,h.material,0,0,null)):w&&w.isTexture&&(f===void 0&&(f=new bn(new ju(2,2),new ss({name:"BackgroundMaterial",uniforms:Iu(Pr.background.uniforms),vertexShader:Pr.background.vertexShader,fragmentShader:Pr.background.fragmentShader,side:is,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),Object.defineProperty(f.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(f)),f.material.uniforms.t2D.value=w,f.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,f.material.toneMapped=w.encoding!==Ct,w.matrixAutoUpdate===!0&&w.updateMatrix(),f.material.uniforms.uvTransform.value.copy(w.matrix),(d!==w||p!==w.version||m!==n.toneMapping)&&(f.material.needsUpdate=!0,d=w,p=w.version,m=n.toneMapping),f.layers.enableAll(),x.unshift(f,f.geometry,f.material,0,0,null))}function y(x,_){x.getRGB(pp,BB(n)),i.buffers.color.setClear(pp.r,pp.g,pp.b,_,o)}return{getClearColor:function(){return a},setClearColor:function(x,_=1){a.set(x),l=_,y(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,y(a,l)},render:v}}function pz(n,e,t,i){const r=n.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,a={},l=x(null);let f=l,h=!1;function d(H,Y,te,le,N){let V=!1;if(o){const j=y(le,te,Y);f!==j&&(f=j,m(f.object)),V=_(H,le,te,N),V&&A(H,le,te,N)}else{const j=Y.wireframe===!0;(f.geometry!==le.id||f.program!==te.id||f.wireframe!==j)&&(f.geometry=le.id,f.program=te.id,f.wireframe=j,V=!0)}N!==null&&t.update(N,34963),(V||h)&&(h=!1,E(H,Y,te,le),N!==null&&n.bindBuffer(34963,t.get(N).buffer))}function p(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function m(H){return i.isWebGL2?n.bindVertexArray(H):s.bindVertexArrayOES(H)}function v(H){return i.isWebGL2?n.deleteVertexArray(H):s.deleteVertexArrayOES(H)}function y(H,Y,te){const le=te.wireframe===!0;let N=a[H.id];N===void 0&&(N={},a[H.id]=N);let V=N[Y.id];V===void 0&&(V={},N[Y.id]=V);let j=V[le];return j===void 0&&(j=x(p()),V[le]=j),j}function x(H){const Y=[],te=[],le=[];for(let N=0;N<r;N++)Y[N]=0,te[N]=0,le[N]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:Y,enabledAttributes:te,attributeDivisors:le,object:H,attributes:{},index:null}}function _(H,Y,te,le){const N=f.attributes,V=Y.attributes;let j=0;const ae=te.getAttributes();for(const W in ae)if(ae[W].location>=0){const ve=N[W];let _e=V[W];if(_e===void 0&&(W==="instanceMatrix"&&H.instanceMatrix&&(_e=H.instanceMatrix),W==="instanceColor"&&H.instanceColor&&(_e=H.instanceColor)),ve===void 0||ve.attribute!==_e||_e&&ve.data!==_e.data)return!0;j++}return f.attributesNum!==j||f.index!==le}function A(H,Y,te,le){const N={},V=Y.attributes;let j=0;const ae=te.getAttributes();for(const W in ae)if(ae[W].location>=0){let ve=V[W];ve===void 0&&(W==="instanceMatrix"&&H.instanceMatrix&&(ve=H.instanceMatrix),W==="instanceColor"&&H.instanceColor&&(ve=H.instanceColor));const _e={};_e.attribute=ve,ve&&ve.data&&(_e.data=ve.data),N[W]=_e,j++}f.attributes=N,f.attributesNum=j,f.index=le}function w(){const H=f.newAttributes;for(let Y=0,te=H.length;Y<te;Y++)H[Y]=0}function S(H){b(H,0)}function b(H,Y){const te=f.newAttributes,le=f.enabledAttributes,N=f.attributeDivisors;te[H]=1,le[H]===0&&(n.enableVertexAttribArray(H),le[H]=1),N[H]!==Y&&((i.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](H,Y),N[H]=Y)}function P(){const H=f.newAttributes,Y=f.enabledAttributes;for(let te=0,le=Y.length;te<le;te++)Y[te]!==H[te]&&(n.disableVertexAttribArray(te),Y[te]=0)}function R(H,Y,te,le,N,V){i.isWebGL2===!0&&(te===5124||te===5125)?n.vertexAttribIPointer(H,Y,te,N,V):n.vertexAttribPointer(H,Y,te,le,N,V)}function E(H,Y,te,le){if(i.isWebGL2===!1&&(H.isInstancedMesh||le.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;w();const N=le.attributes,V=te.getAttributes(),j=Y.defaultAttributeValues;for(const ae in V){const W=V[ae];if(W.location>=0){let ce=N[ae];if(ce===void 0&&(ae==="instanceMatrix"&&H.instanceMatrix&&(ce=H.instanceMatrix),ae==="instanceColor"&&H.instanceColor&&(ce=H.instanceColor)),ce!==void 0){const ve=ce.normalized,_e=ce.itemSize,$=t.get(ce);if($===void 0)continue;const ke=$.buffer,Oe=$.type,He=$.bytesPerElement;if(ce.isInterleavedBufferAttribute){const Me=ce.data,Ie=Me.stride,he=ce.offset;if(Me.isInstancedInterleavedBuffer){for(let re=0;re<W.locationSize;re++)b(W.location+re,Me.meshPerAttribute);H.isInstancedMesh!==!0&&le._maxInstanceCount===void 0&&(le._maxInstanceCount=Me.meshPerAttribute*Me.count)}else for(let re=0;re<W.locationSize;re++)S(W.location+re);n.bindBuffer(34962,ke);for(let re=0;re<W.locationSize;re++)R(W.location+re,_e/W.locationSize,Oe,ve,Ie*He,(he+_e/W.locationSize*re)*He)}else{if(ce.isInstancedBufferAttribute){for(let Me=0;Me<W.locationSize;Me++)b(W.location+Me,ce.meshPerAttribute);H.isInstancedMesh!==!0&&le._maxInstanceCount===void 0&&(le._maxInstanceCount=ce.meshPerAttribute*ce.count)}else for(let Me=0;Me<W.locationSize;Me++)S(W.location+Me);n.bindBuffer(34962,ke);for(let Me=0;Me<W.locationSize;Me++)R(W.location+Me,_e/W.locationSize,Oe,ve,_e*He,_e/W.locationSize*Me*He)}}else if(j!==void 0){const ve=j[ae];if(ve!==void 0)switch(ve.length){case 2:n.vertexAttrib2fv(W.location,ve);break;case 3:n.vertexAttrib3fv(W.location,ve);break;case 4:n.vertexAttrib4fv(W.location,ve);break;default:n.vertexAttrib1fv(W.location,ve)}}}}P()}function B(){Z();for(const H in a){const Y=a[H];for(const te in Y){const le=Y[te];for(const N in le)v(le[N].object),delete le[N];delete Y[te]}delete a[H]}}function L(H){if(a[H.id]===void 0)return;const Y=a[H.id];for(const te in Y){const le=Y[te];for(const N in le)v(le[N].object),delete le[N];delete Y[te]}delete a[H.id]}function z(H){for(const Y in a){const te=a[Y];if(te[H.id]===void 0)continue;const le=te[H.id];for(const N in le)v(le[N].object),delete le[N];delete te[H.id]}}function Z(){J(),h=!0,f!==l&&(f=l,m(f.object))}function J(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:d,reset:Z,resetDefaultState:J,dispose:B,releaseStatesOfGeometry:L,releaseStatesOfProgram:z,initAttributes:w,enableAttribute:S,disableUnusedAttributes:P}}function mz(n,e,t,i){const r=i.isWebGL2;let s;function o(f){s=f}function a(f,h){n.drawArrays(s,f,h),t.update(h,s,1)}function l(f,h,d){if(d===0)return;let p,m;if(r)p=n,m="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),m="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[m](s,f,h,d),t.update(h,s,d)}this.setMode=o,this.render=a,this.renderInstances=l}function gz(n,e,t){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const R=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(R.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(R){if(R==="highp"){if(n.getShaderPrecisionFormat(35633,36338).precision>0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";R="mediump"}return R==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext;let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const f=o||e.has("WEBGL_draw_buffers"),h=t.logarithmicDepthBuffer===!0,d=n.getParameter(34930),p=n.getParameter(35660),m=n.getParameter(3379),v=n.getParameter(34076),y=n.getParameter(34921),x=n.getParameter(36347),_=n.getParameter(36348),A=n.getParameter(36349),w=p>0,S=o||e.has("OES_texture_float"),b=w&&S,P=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:f,getMaxAnisotropy:r,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:h,maxTextures:d,maxVertexTextures:p,maxTextureSize:m,maxCubemapSize:v,maxAttributes:y,maxVertexUniforms:x,maxVaryings:_,maxFragmentUniforms:A,vertexTextures:w,floatFragmentTextures:S,floatVertexTextures:b,maxSamples:P}}function yz(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new go,a=new ui,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,p){const m=d.length!==0||p||i!==0||r;return r=p,i=d.length,m},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,p){t=h(d,p,0)},this.setState=function(d,p,m){const v=d.clippingPlanes,y=d.clipIntersection,x=d.clipShadows,_=n.get(d);if(!r||v===null||v.length===0||s&&!x)s?h(null):f();else{const A=s?0:i,w=A*4;let S=_.clippingState||null;l.value=S,S=h(v,p,w,m);for(let b=0;b!==w;++b)S[b]=t[b];_.clippingState=S,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=A}};function f(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(d,p,m,v){const y=d!==null?d.length:0;let x=null;if(y!==0){if(x=l.value,v!==!0||x===null){const _=m+y*4,A=p.matrixWorldInverse;a.getNormalMatrix(A),(x===null||x.length<_)&&(x=new Float32Array(_));for(let w=0,S=m;w!==y;++w,S+=4)o.copy(d[w]).applyMatrix4(A,a),o.normal.toArray(x,S),x[S+3]=o.constant}l.value=x,l.needsUpdate=!0}return e.numPlanes=y,e.numIntersection=0,x}}function vz(n){let e=new WeakMap;function t(o,a){return a===Gf?o.mapping=Oo:a===Hf&&(o.mapping=Uo),o}function i(o){if(o&&o.isTexture&&o.isRenderTargetTexture===!1){const a=o.mapping;if(a===Gf||a===Hf)if(e.has(o)){const l=e.get(o).texture;return t(l,o.mapping)}else{const l=o.image;if(l&&l.height>0){const f=new iA(l.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),o.addEventListener("dispose",r),t(f.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class Dr extends mh{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=f*this.view.offsetX,o=s+f*this.view.width,a-=h*this.view.offsetY,l=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const au=4,wC=[.125,.215,.35,.446,.526,.582],Pa=20,Qy=new Dr,SC=new Le;let Zy=null;const Sa=(1+Math.sqrt(5))/2,zl=1/Sa,CC=[new D(1,1,1),new D(-1,1,1),new D(1,1,-1),new D(-1,1,-1),new D(0,Sa,zl),new D(0,Sa,-zl),new D(zl,0,Sa),new D(-zl,0,Sa),new D(Sa,zl,0),new D(-Sa,zl,0)];class a1{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){Zy=this._renderer.getRenderTarget(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=TC(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=bC(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Zy),e.scissorTest=!1,mp(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Oo||e.mapping===Uo?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Zy=this._renderer.getRenderTarget();const i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:en,minFilter:en,generateMipmaps:!1,type:Bu,format:Ai,encoding:Vs,depthBuffer:!1},r=EC(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=EC(e,t,i);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=xz(s)),this._blurMaterial=_z(s,e,t)}return r}_compileMaterial(e){const t=new bn(this._lodPlanes[0],e);this._renderer.compile(t,Qy)}_sceneToCubeUV(e,t,i,r){const a=new Gt(90,1,t,i),l=[1,-1,1,1,1,1],f=[1,1,1,-1,-1,-1],h=this._renderer,d=h.autoClear,p=h.toneMapping;h.getClearColor(SC),h.toneMapping=Ir,h.autoClear=!1;const m=new ki({name:"PMREM.Background",side:Ei,depthWrite:!1,depthTest:!1}),v=new bn(new Qo,m);let y=!1;const x=e.background;x?x.isColor&&(m.color.copy(x),e.background=null,y=!0):(m.color.copy(SC),y=!0);for(let _=0;_<6;_++){const A=_%3;A===0?(a.up.set(0,l[_],0),a.lookAt(f[_],0,0)):A===1?(a.up.set(0,0,l[_]),a.lookAt(0,f[_],0)):(a.up.set(0,l[_],0),a.lookAt(0,0,f[_]));const w=this._cubeSize;mp(r,A*w,_>2?w:0,w,w),h.setRenderTarget(r),y&&h.render(v,a),h.render(e,a)}v.geometry.dispose(),v.material.dispose(),h.toneMapping=p,h.autoClear=d,e.background=x}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===Oo||e.mapping===Uo;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=TC()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=bC());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new bn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;mp(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Qy)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;r<this._lodPlanes.length;r++){const s=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),o=CC[(r-1)%CC.length];this._blur(e,r-1,r,s,o)}t.autoClear=i}_blur(e,t,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,t,i,r,s,o,a){const l=this._renderer,f=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,d=new bn(this._lodPlanes[r],f),p=f.uniforms,m=this._sizeLods[i]-1,v=isFinite(s)?Math.PI/(2*m):2*Math.PI/(2*Pa-1),y=s/v,x=isFinite(s)?1+Math.floor(h*y):Pa;x>Pa&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Pa}`);const _=[];let A=0;for(let R=0;R<Pa;++R){const E=R/y,B=Math.exp(-E*E/2);_.push(B),R===0?A+=B:R<x&&(A+=2*B)}for(let R=0;R<_.length;R++)_[R]=_[R]/A;p.envMap.value=e.texture,p.samples.value=x,p.weights.value=_,p.latitudinal.value=o==="latitudinal",a&&(p.poleAxis.value=a);const{_lodMax:w}=this;p.dTheta.value=v,p.mipInt.value=w-i;const S=this._sizeLods[r],b=3*S*(r>w-au?r-w+au:0),P=4*(this._cubeSize-S);mp(t,b,P,3*S,2*S),l.setRenderTarget(t),l.render(d,Qy)}}function xz(n){const e=[],t=[],i=[];let r=n;const s=n-au+1+wC.length;for(let o=0;o<s;o++){const a=Math.pow(2,r);t.push(a);let l=1/a;o>n-au?l=wC[o-n+au-1]:o===0&&(l=0),i.push(l);const f=1/(a-2),h=-f,d=1+f,p=[h,h,d,h,d,d,h,h,d,d,h,d],m=6,v=6,y=3,x=2,_=1,A=new Float32Array(y*v*m),w=new Float32Array(x*v*m),S=new Float32Array(_*v*m);for(let P=0;P<m;P++){const R=P%3*2/3-1,E=P>2?0:-1,B=[R,E,0,R+2/3,E,0,R+2/3,E+1,0,R,E,0,R+2/3,E+1,0,R,E+1,0];A.set(B,y*v*P),w.set(p,x*v*P);const L=[P,P,P,P,P,P];S.set(L,_*v*P)}const b=new ut;b.setAttribute("position",new Dt(A,y)),b.setAttribute("uv",new Dt(w,x)),b.setAttribute("faceIndex",new Dt(S,_)),e.push(b),r>au&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function EC(n,e,t){const i=new Nr(n,e,t);return i.texture.mapping=Wu,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function mp(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function _z(n,e,t){const i=new Float32Array(Pa),r=new D(0,1,0);return new ss({name:"SphericalGaussianBlur",defines:{n:Pa,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:rA(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform int samples; uniform float weights[ n ]; uniform bool latitudinal; uniform float dTheta; uniform float mipInt; uniform vec3 poleAxis; #define ENVMAP_TYPE_CUBE_UV #include <cube_uv_reflection_fragment> vec3 getSample( float theta, vec3 axis ) { float cosTheta = cos( theta ); // Rodrigues' axis-angle rotation vec3 sampleDirection = vOutputDirection * cosTheta + cross( axis, vOutputDirection ) * sin( theta ) + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); return bilinearCubeUV( envMap, sampleDirection, mipInt ); } void main() { vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); if ( all( equal( axis, vec3( 0.0 ) ) ) ) { axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); } axis = normalize( axis ); gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); for ( int i = 1; i < n; i++ ) { if ( i >= samples ) { break; } float theta = dTheta * float( i ); gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); } } `,blending:Fs,depthTest:!1,depthWrite:!1})}function bC(){return new ss({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:rA(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; #include <common> void main() { vec3 outputDirection = normalize( vOutputDirection ); vec2 uv = equirectUv( outputDirection ); gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } `,blending:Fs,depthTest:!1,depthWrite:!1})}function TC(){return new ss({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:rA(),fragmentShader:` precision mediump float; precision mediump int; uniform float flipEnvMap; varying vec3 vOutputDirection; uniform samplerCube envMap; void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } `,blending:Fs,depthTest:!1,depthWrite:!1})}function rA(){return` precision mediump float; precision mediump int; attribute float faceIndex; varying vec3 vOutputDirection; // RH coordinate system; PMREM face-indexing convention vec3 getDirection( vec2 uv, float face ) { uv = 2.0 * uv - 1.0; vec3 direction = vec3( uv, 1.0 ); if ( face == 0.0 ) { direction = direction.zyx; // ( 1, v, u ) pos x } else if ( face == 1.0 ) { direction = direction.xzy; direction.xz *= -1.0; // ( -u, 1, -v ) pos y } else if ( face == 2.0 ) { direction.x *= -1.0; // ( -u, v, 1 ) pos z } else if ( face == 3.0 ) { direction = direction.zyx; direction.xz *= -1.0; // ( -1, v, -u ) neg x } else if ( face == 4.0 ) { direction = direction.xzy; direction.xy *= -1.0; // ( -u, -1, v ) neg y } else if ( face == 5.0 ) { direction.z *= -1.0; // ( u, v, -1 ) neg z } return direction; } void main() { vOutputDirection = getDirection( uv, faceIndex ); gl_Position = vec4( position, 1.0 ); } `}function Az(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,f=l===Gf||l===Hf,h=l===Oo||l===Uo;if(f||h)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let d=e.get(a);return t===null&&(t=new a1(n)),d=f?t.fromEquirectangular(a,d):t.fromCubemap(a,d),e.set(a,d),d.texture}else{if(e.has(a))return e.get(a).texture;{const d=a.image;if(f&&d&&d.height>0||h&&d&&r(d)){t===null&&(t=new a1(n));const p=f?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),a.addEventListener("dispose",s),p.texture}else return null}}}return a}function r(a){let l=0;const f=6;for(let h=0;h<f;h++)a[h]!==void 0&&l++;return l===f}function s(a){const l=a.target;l.removeEventListener("dispose",s);const f=e.get(l);f!==void 0&&(e.delete(l),f.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:i,dispose:o}}function Mz(n){const e={};function t(i){if(e[i]!==void 0)return e[i];let r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(i)}return e[i]=r,r}return{has:function(i){return t(i)!==null},init:function(i){i.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(i){const r=t(i);return r===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function wz(n,e,t,i){const r={},s=new WeakMap;function o(d){const p=d.target;p.index!==null&&e.remove(p.index);for(const v in p.attributes)e.remove(p.attributes[v]);p.removeEventListener("dispose",o),delete r[p.id];const m=s.get(p);m&&(e.remove(m),s.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function a(d,p){return r[p.id]===!0||(p.addEventListener("dispose",o),r[p.id]=!0,t.memory.geometries++),p}function l(d){const p=d.attributes;for(const v in p)e.update(p[v],34962);const m=d.morphAttributes;for(const v in m){const y=m[v];for(let x=0,_=y.length;x<_;x++)e.update(y[x],34962)}}function f(d){const p=[],m=d.index,v=d.attributes.position;let y=0;if(m!==null){const A=m.array;y=m.version;for(let w=0,S=A.length;w<S;w+=3){const b=A[w+0],P=A[w+1],R=A[w+2];p.push(b,P,P,R,R,b)}}else{const A=v.array;y=v.version;for(let w=0,S=A.length/3-1;w<S;w+=3){const b=w+0,P=w+1,R=w+2;p.push(b,P,P,R,R,b)}}const x=new(TB(p)?tA:eA)(p,1);x.version=y;const _=s.get(d);_&&e.remove(_),s.set(d,x)}function h(d){const p=s.get(d);if(p){const m=d.index;m!==null&&p.version<m.version&&f(d)}else f(d);return s.get(d)}return{get:a,update:l,getWireframeAttribute:h}}function Sz(n,e,t,i){const r=i.isWebGL2;let s;function o(p){s=p}let a,l;function f(p){a=p.type,l=p.bytesPerElement}function h(p,m){n.drawElements(s,m,a,p*l),t.update(m,s,1)}function d(p,m,v){if(v===0)return;let y,x;if(r)y=n,x="drawElementsInstanced";else if(y=e.get("ANGLE_instanced_arrays"),x="drawElementsInstancedANGLE",y===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}y[x](s,m,a,p*l,v),t.update(m,s,v)}this.setMode=o,this.setIndex=f,this.render=h,this.renderInstances=d}function Cz(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,o,a){switch(t.calls++,o){case 4:t.triangles+=a*(s/3);break;case 1:t.lines+=a*(s/2);break;case 3:t.lines+=a*(s-1);break;case 2:t.lines+=a*s;break;case 0:t.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function r(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:i}}function Ez(n,e){return n[0]-e[0]}function bz(n,e){return Math.abs(e[1])-Math.abs(n[1])}function Tz(n,e,t){const i={},r=new Float32Array(8),s=new WeakMap,o=new Nt,a=[];for(let f=0;f<8;f++)a[f]=[f,0];function l(f,h,d,p){const m=f.morphTargetInfluences;if(e.isWebGL2===!0){const v=h.morphAttributes.position||h.morphAttributes.normal||h.morphAttributes.color,y=v!==void 0?v.length:0;let x=s.get(h);if(x===void 0||x.count!==y){let Y=function(){J.dispose(),s.delete(h),h.removeEventListener("dispose",Y)};x!==void 0&&x.texture.dispose();const w=h.morphAttributes.position!==void 0,S=h.morphAttributes.normal!==void 0,b=h.morphAttributes.color!==void 0,P=h.morphAttributes.position||[],R=h.morphAttributes.normal||[],E=h.morphAttributes.color||[];let B=0;w===!0&&(B=1),S===!0&&(B=2),b===!0&&(B=3);let L=h.attributes.position.count*B,z=1;L>e.maxTextureSize&&(z=Math.ceil(L/e.maxTextureSize),L=e.maxTextureSize);const Z=new Float32Array(L*z*4*y),J=new Eg(Z,L,z,y);J.type=Bs,J.needsUpdate=!0;const H=B*4;for(let te=0;te<y;te++){const le=P[te],N=R[te],V=E[te],j=L*z*4*te;for(let ae=0;ae<le.count;ae++){const W=ae*H;w===!0&&(o.fromBufferAttribute(le,ae),Z[j+W+0]=o.x,Z[j+W+1]=o.y,Z[j+W+2]=o.z,Z[j+W+3]=0),S===!0&&(o.fromBufferAttribute(N,ae),Z[j+W+4]=o.x,Z[j+W+5]=o.y,Z[j+W+6]=o.z,Z[j+W+7]=0),b===!0&&(o.fromBufferAttribute(V,ae),Z[j+W+8]=o.x,Z[j+W+9]=o.y,Z[j+W+10]=o.z,Z[j+W+11]=V.itemSize===4?o.w:1)}}x={count:y,texture:J,size:new me(L,z)},s.set(h,x),h.addEventListener("dispose",Y)}let _=0;for(let w=0;w<m.length;w++)_+=m[w];const A=h.morphTargetsRelative?1:1-_;p.getUniforms().setValue(n,"morphTargetBaseInfluence",A),p.getUniforms().setValue(n,"morphTargetInfluences",m),p.getUniforms().setValue(n,"morphTargetsTexture",x.texture,t),p.getUniforms().setValue(n,"morphTargetsTextureSize",x.size)}else{const v=m===void 0?0:m.length;let y=i[h.id];if(y===void 0||y.length!==v){y=[];for(let S=0;S<v;S++)y[S]=[S,0];i[h.id]=y}for(let S=0;S<v;S++){const b=y[S];b[0]=S,b[1]=m[S]}y.sort(bz);for(let S=0;S<8;S++)S<v&&y[S][1]?(a[S][0]=y[S][0],a[S][1]=y[S][1]):(a[S][0]=Number.MAX_SAFE_INTEGER,a[S][1]=0);a.sort(Ez);const x=h.morphAttributes.position,_=h.morphAttributes.normal;let A=0;for(let S=0;S<8;S++){const b=a[S],P=b[0],R=b[1];P!==Number.MAX_SAFE_INTEGER&&R?(x&&h.getAttribute("morphTarget"+S)!==x[P]&&h.setAttribute("morphTarget"+S,x[P]),_&&h.getAttribute("morphNormal"+S)!==_[P]&&h.setAttribute("morphNormal"+S,_[P]),r[S]=R,A+=R):(x&&h.hasAttribute("morphTarget"+S)===!0&&h.deleteAttribute("morphTarget"+S),_&&h.hasAttribute("morphNormal"+S)===!0&&h.deleteAttribute("morphNormal"+S),r[S]=0)}const w=h.morphTargetsRelative?1:1-A;p.getUniforms().setValue(n,"morphTargetBaseInfluence",w),p.getUniforms().setValue(n,"morphTargetInfluences",r)}}return{update:l}}function Pz(n,e,t,i){let r=new WeakMap;function s(l){const f=i.render.frame,h=l.geometry,d=e.get(l,h);return r.get(d)!==f&&(e.update(d),r.set(d,f)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),t.update(l.instanceMatrix,34962),l.instanceColor!==null&&t.update(l.instanceColor,34962)),d}function o(){r=new WeakMap}function a(l){const f=l.target;f.removeEventListener("dispose",a),t.remove(f.instanceMatrix),f.instanceColor!==null&&t.remove(f.instanceColor)}return{update:s,dispose:o}}const IB=new Qt,DB=new Eg,FB=new $_,NB=new gh,PC=[],BC=[],RC=new Float32Array(16),LC=new Float32Array(9),IC=new Float32Array(4);function Ju(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let s=PC[r];if(s===void 0&&(s=new Float32Array(r),PC[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function Tn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t<i;t++)if(n[t]!==e[t])return!1;return!0}function Pn(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function Tg(n,e){let t=BC[e];t===void 0&&(t=new Int32Array(e),BC[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function Bz(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function Rz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Tn(t,e))return;n.uniform2fv(this.addr,e),Pn(t,e)}}function Lz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Tn(t,e))return;n.uniform3fv(this.addr,e),Pn(t,e)}}function Iz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Tn(t,e))return;n.uniform4fv(this.addr,e),Pn(t,e)}}function Dz(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(Tn(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),Pn(t,e)}else{if(Tn(t,i))return;IC.set(i),n.uniformMatrix2fv(this.addr,!1,IC),Pn(t,i)}}function Fz(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(Tn(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),Pn(t,e)}else{if(Tn(t,i))return;LC.set(i),n.uniformMatrix3fv(this.addr,!1,LC),Pn(t,i)}}function Nz(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(Tn(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),Pn(t,e)}else{if(Tn(t,i))return;RC.set(i),n.uniformMatrix4fv(this.addr,!1,RC),Pn(t,i)}}function kz(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function Oz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Tn(t,e))return;n.uniform2iv(this.addr,e),Pn(t,e)}}function Uz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Tn(t,e))return;n.uniform3iv(this.addr,e),Pn(t,e)}}function zz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Tn(t,e))return;n.uniform4iv(this.addr,e),Pn(t,e)}}function Gz(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function Hz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Tn(t,e))return;n.uniform2uiv(this.addr,e),Pn(t,e)}}function Vz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Tn(t,e))return;n.uniform3uiv(this.addr,e),Pn(t,e)}}function Wz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Tn(t,e))return;n.uniform4uiv(this.addr,e),Pn(t,e)}}function jz(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2D(e||IB,r)}function Jz(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||FB,r)}function Xz(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTextureCube(e||NB,r)}function Kz(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||DB,r)}function Yz(n){switch(n){case 5126:return Bz;case 35664:return Rz;case 35665:return Lz;case 35666:return Iz;case 35674:return Dz;case 35675:return Fz;case 35676:return Nz;case 5124:case 35670:return kz;case 35667:case 35671:return Oz;case 35668:case 35672:return Uz;case 35669:case 35673:return zz;case 5125:return Gz;case 36294:return Hz;case 36295:return Vz;case 36296:return Wz;case 35678:case 36198:case 36298:case 36306:case 35682:return jz;case 35679:case 36299:case 36307:return Jz;case 35680:case 36300:case 36308:case 36293:return Xz;case 36289:case 36303:case 36311:case 36292:return Kz}}function Qz(n,e){n.uniform1fv(this.addr,e)}function Zz(n,e){const t=Ju(e,this.size,2);n.uniform2fv(this.addr,t)}function qz(n,e){const t=Ju(e,this.size,3);n.uniform3fv(this.addr,t)}function $z(n,e){const t=Ju(e,this.size,4);n.uniform4fv(this.addr,t)}function e4(n,e){const t=Ju(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function t4(n,e){const t=Ju(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function n4(n,e){const t=Ju(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function i4(n,e){n.uniform1iv(this.addr,e)}function r4(n,e){n.uniform2iv(this.addr,e)}function s4(n,e){n.uniform3iv(this.addr,e)}function o4(n,e){n.uniform4iv(this.addr,e)}function a4(n,e){n.uniform1uiv(this.addr,e)}function l4(n,e){n.uniform2uiv(this.addr,e)}function u4(n,e){n.uniform3uiv(this.addr,e)}function c4(n,e){n.uniform4uiv(this.addr,e)}function f4(n,e,t){const i=this.cache,r=e.length,s=Tg(t,r);Tn(i,s)||(n.uniform1iv(this.addr,s),Pn(i,s));for(let o=0;o!==r;++o)t.setTexture2D(e[o]||IB,s[o])}function h4(n,e,t){const i=this.cache,r=e.length,s=Tg(t,r);Tn(i,s)||(n.uniform1iv(this.addr,s),Pn(i,s));for(let o=0;o!==r;++o)t.setTexture3D(e[o]||FB,s[o])}function d4(n,e,t){const i=this.cache,r=e.length,s=Tg(t,r);Tn(i,s)||(n.uniform1iv(this.addr,s),Pn(i,s));for(let o=0;o!==r;++o)t.setTextureCube(e[o]||NB,s[o])}function p4(n,e,t){const i=this.cache,r=e.length,s=Tg(t,r);Tn(i,s)||(n.uniform1iv(this.addr,s),Pn(i,s));for(let o=0;o!==r;++o)t.setTexture2DArray(e[o]||DB,s[o])}function m4(n){switch(n){case 5126:return Qz;case 35664:return Zz;case 35665:return qz;case 35666:return $z;case 35674:return e4;case 35675:return t4;case 35676:return n4;case 5124:case 35670:return i4;case 35667:case 35671:return r4;case 35668:case 35672:return s4;case 35669:case 35673:return o4;case 5125:return a4;case 36294:return l4;case 36295:return u4;case 36296:return c4;case 35678:case 36198:case 36298:case 36306:case 35682:return f4;case 35679:case 36299:case 36307:return h4;case 35680:case 36300:case 36308:case 36293:return d4;case 36289:case 36303:case 36311:case 36292:return p4}}class g4{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.setValue=Yz(t.type)}}class y4{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.size=t.size,this.setValue=m4(t.type)}}class v4{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){const r=this.seq;for(let s=0,o=r.length;s!==o;++s){const a=r[s];a.setValue(e,t[a.id],i)}}}const qy=/(\w+)(\])?(\[|\.)?/g;function DC(n,e){n.seq.push(e),n.map[e.id]=e}function x4(n,e,t){const i=n.name,r=i.length;for(qy.lastIndex=0;;){const s=qy.exec(i),o=qy.lastIndex;let a=s[1];const l=s[2]==="]",f=s[3];if(l&&(a=a|0),f===void 0||f==="["&&o+2===r){DC(t,f===void 0?new g4(a,n,e):new y4(a,n,e));break}else{let d=t.map[a];d===void 0&&(d=new v4(a),DC(t,d)),t=d}}}class hm{constructor(e,t){this.seq=[],this.map={};const i=e.getProgramParameter(t,35718);for(let r=0;r<i;++r){const s=e.getActiveUniform(t,r),o=e.getUniformLocation(t,s.name);x4(s,o,this)}}setValue(e,t,i,r){const s=this.map[t];s!==void 0&&s.setValue(e,i,r)}setOptional(e,t,i){const r=t[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,t,i,r){for(let s=0,o=t.length;s!==o;++s){const a=t[s],l=i[a.id];l.needsUpdate!==!1&&a.setValue(e,l.value,r)}}static seqWithValue(e,t){const i=[];for(let r=0,s=e.length;r!==s;++r){const o=e[r];o.id in t&&i.push(o)}return i}}function FC(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}let _4=0;function A4(n,e){const t=n.split(` `),i=[],r=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=r;o<s;o++){const a=o+1;i.push(`${a===e?">":" "} ${a}: ${t[o]}`)}return i.join(` `)}function M4(n){switch(n){case Vs:return["Linear","( value )"];case Ct:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",n),["Linear","( value )"]}}function NC(n,e,t){const i=n.getShaderParameter(e,35713),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` `+r+` `+A4(n.getShaderSource(e),o)}else return r}function w4(n,e){const t=M4(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function S4(n,e){let t;switch(e){case eB:t="Linear";break;case tB:t="Reinhard";break;case nB:t="OptimizedCineon";break;case J_:t="ACESFilmic";break;case iB:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function C4(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.tangentSpaceNormalMap||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ef).join(` `)}function E4(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` `)}function b4(n,e){const t={},i=n.getProgramParameter(e,35721);for(let r=0;r<i;r++){const s=n.getActiveAttrib(e,r),o=s.name;let a=1;s.type===35674&&(a=2),s.type===35675&&(a=3),s.type===35676&&(a=4),t[o]={type:s.type,location:n.getAttribLocation(e,o),locationSize:a}}return t}function ef(n){return n!==""}function kC(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function OC(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const T4=/^[ \t]*#include +<([\w\d./]+)>/gm;function l1(n){return n.replace(T4,P4)}function P4(n,e){const t=pt[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return l1(t)}const B4=/#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 UC(n){return n.replace(B4,R4)}function R4(n,e,t,i){let r="";for(let s=parseInt(e);s<parseInt(t);s++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return r}function zC(n){let e="precision "+n.precision+` float; precision `+n.precision+" int;";return n.precision==="highp"?e+=` #define HIGH_PRECISION`:n.precision==="mediump"?e+=` #define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=` #define LOW_PRECISION`),e}function L4(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===Mg?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===hf?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===Da&&(e="SHADOWMAP_TYPE_VSM"),e}function I4(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Oo:case Uo:e="ENVMAP_TYPE_CUBE";break;case Wu:e="ENVMAP_TYPE_CUBE_UV";break}return e}function D4(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case Uo:e="ENVMAP_MODE_REFRACTION";break}return e}function F4(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case dh:e="ENVMAP_BLENDING_MULTIPLY";break;case qP:e="ENVMAP_BLENDING_MIX";break;case $P:e="ENVMAP_BLENDING_ADD";break}return e}function N4(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:i,maxMip:t}}function k4(n,e,t,i){const r=n.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const l=L4(t),f=I4(t),h=D4(t),d=F4(t),p=N4(t),m=t.isWebGL2?"":C4(t),v=E4(s),y=r.createProgram();let x,_,A=t.glslVersion?"#version "+t.glslVersion+` `:"";t.isRawShaderMaterial?(x=[v].filter(ef).join(` `),x.length>0&&(x+=` `),_=[m,v].filter(ef).join(` `),_.length>0&&(_+=` `)):(x=[zC(t),"#define SHADER_NAME "+t.shaderName,v,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","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","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(ef).join(` `),_=[m,zC(t),"#define SHADER_NAME "+t.shaderName,v,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.envMap?"#define "+h:"",t.envMap?"#define "+d:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Ir?"#define TONE_MAPPING":"",t.toneMapping!==Ir?pt.tonemapping_pars_fragment:"",t.toneMapping!==Ir?S4("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",pt.encodings_pars_fragment,w4("linearToOutputTexel",t.outputEncoding),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(ef).join(` `)),o=l1(o),o=kC(o,t),o=OC(o,t),a=l1(a),a=kC(a,t),a=OC(a,t),o=UC(o),a=UC(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(A=`#version 300 es `,x=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+x,_=["#define varying in",t.glslVersion===s1?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===s1?"":"#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(` `)+` `+_);const w=A+x+o,S=A+_+a,b=FC(r,35633,w),P=FC(r,35632,S);if(r.attachShader(y,b),r.attachShader(y,P),t.index0AttributeName!==void 0?r.bindAttribLocation(y,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(y,0,"position"),r.linkProgram(y),n.debug.checkShaderErrors){const B=r.getProgramInfoLog(y).trim(),L=r.getShaderInfoLog(b).trim(),z=r.getShaderInfoLog(P).trim();let Z=!0,J=!0;if(r.getProgramParameter(y,35714)===!1){Z=!1;const H=NC(r,b,"vertex"),Y=NC(r,P,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(y,35715)+` Program Info Log: `+B+` `+H+` `+Y)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(L===""||z==="")&&(J=!1);J&&(this.diagnostics={runnable:Z,programLog:B,vertexShader:{log:L,prefix:x},fragmentShader:{log:z,prefix:_}})}r.deleteShader(b),r.deleteShader(P);let R;this.getUniforms=function(){return R===void 0&&(R=new hm(r,y)),R};let E;return this.getAttributes=function(){return E===void 0&&(E=b4(r,y)),E},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(y),this.program=void 0},this.name=t.shaderName,this.id=_4++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=b,this.fragmentShader=P,this}let O4=0;class U4{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new z4(e),t.set(e,i)),i}}class z4{constructor(e){this.id=O4++,this.code=e,this.usedTimes=0}}function G4(n,e,t,i,r,s,o){const a=new Xa,l=new U4,f=[],h=r.isWebGL2,d=r.logarithmicDepthBuffer,p=r.vertexTextures;let m=r.precision;const v={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function y(E,B,L,z,Z){const J=z.fog,H=Z.geometry,Y=E.isMeshStandardMaterial?z.environment:null,te=(E.isMeshStandardMaterial?t:e).get(E.envMap||Y),le=te&&te.mapping===Wu?te.image.height:null,N=v[E.type];E.precision!==null&&(m=r.getMaxPrecision(E.precision),m!==E.precision&&console.warn("THREE.WebGLProgram.getParameters:",E.precision,"not supported, using",m,"instead."));const V=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,j=V!==void 0?V.length:0;let ae=0;H.morphAttributes.position!==void 0&&(ae=1),H.morphAttributes.normal!==void 0&&(ae=2),H.morphAttributes.color!==void 0&&(ae=3);let W,ce,ve,_e;if(N){const Ie=Pr[N];W=Ie.vertexShader,ce=Ie.fragmentShader}else W=E.vertexShader,ce=E.fragmentShader,l.update(E),ve=l.getVertexShaderID(E),_e=l.getFragmentShaderID(E);const $=n.getRenderTarget(),ke=E.alphaTest>0,Oe=E.clearcoat>0,He=E.iridescence>0;return{isWebGL2:h,shaderID:N,shaderName:E.type,vertexShader:W,fragmentShader:ce,defines:E.defines,customVertexShaderID:ve,customFragmentShaderID:_e,isRawShaderMaterial:E.isRawShaderMaterial===!0,glslVersion:E.glslVersion,precision:m,instancing:Z.isInstancedMesh===!0,instancingColor:Z.isInstancedMesh===!0&&Z.instanceColor!==null,supportsVertexTextures:p,outputEncoding:$===null?n.outputEncoding:$.isXRRenderTarget===!0?$.texture.encoding:Vs,map:!!E.map,matcap:!!E.matcap,envMap:!!te,envMapMode:te&&te.mapping,envMapCubeUVHeight:le,lightMap:!!E.lightMap,aoMap:!!E.aoMap,emissiveMap:!!E.emissiveMap,bumpMap:!!E.bumpMap,normalMap:!!E.normalMap,objectSpaceNormalMap:E.normalMapType===CB,tangentSpaceNormalMap:E.normalMapType===Js,decodeVideoTexture:!!E.map&&E.map.isVideoTexture===!0&&E.map.encoding===Ct,clearcoat:Oe,clearcoatMap:Oe&&!!E.clearcoatMap,clearcoatRoughnessMap:Oe&&!!E.clearcoatRoughnessMap,clearcoatNormalMap:Oe&&!!E.clearcoatNormalMap,iridescence:He,iridescenceMap:He&&!!E.iridescenceMap,iridescenceThicknessMap:He&&!!E.iridescenceThicknessMap,displacementMap:!!E.displacementMap,roughnessMap:!!E.roughnessMap,metalnessMap:!!E.metalnessMap,specularMap:!!E.specularMap,specularIntensityMap:!!E.specularIntensityMap,specularColorMap:!!E.specularColorMap,opaque:E.transparent===!1&&E.blending===Ha,alphaMap:!!E.alphaMap,alphaTest:ke,gradientMap:!!E.gradientMap,sheen:E.sheen>0,sheenColorMap:!!E.sheenColorMap,sheenRoughnessMap:!!E.sheenRoughnessMap,transmission:E.transmission>0,transmissionMap:!!E.transmissionMap,thicknessMap:!!E.thicknessMap,combine:E.combine,vertexTangents:!!E.normalMap&&!!H.attributes.tangent,vertexColors:E.vertexColors,vertexAlphas:E.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,vertexUvs:!!E.map||!!E.bumpMap||!!E.normalMap||!!E.specularMap||!!E.alphaMap||!!E.emissiveMap||!!E.roughnessMap||!!E.metalnessMap||!!E.clearcoatMap||!!E.clearcoatRoughnessMap||!!E.clearcoatNormalMap||!!E.iridescenceMap||!!E.iridescenceThicknessMap||!!E.displacementMap||!!E.transmissionMap||!!E.thicknessMap||!!E.specularIntensityMap||!!E.specularColorMap||!!E.sheenColorMap||!!E.sheenRoughnessMap,uvsVertexOnly:!(E.map||E.bumpMap||E.normalMap||E.specularMap||E.alphaMap||E.emissiveMap||E.roughnessMap||E.metalnessMap||E.clearcoatNormalMap||E.iridescenceMap||E.iridescenceThicknessMap||E.transmission>0||E.transmissionMap||E.thicknessMap||E.specularIntensityMap||E.specularColorMap||E.sheen>0||E.sheenColorMap||E.sheenRoughnessMap)&&!!E.displacementMap,fog:!!J,useFog:E.fog===!0,fogExp2:J&&J.isFogExp2,flatShading:!!E.flatShading,sizeAttenuation:E.sizeAttenuation,logarithmicDepthBuffer:d,skinning:Z.isSkinnedMesh===!0,morphTargets:H.morphAttributes.position!==void 0,morphNormals:H.morphAttributes.normal!==void 0,morphColors:H.morphAttributes.color!==void 0,morphTargetsCount:j,morphTextureStride:ae,numDirLights:B.directional.length,numPointLights:B.point.length,numSpotLights:B.spot.length,numSpotLightMaps:B.spotLightMap.length,numRectAreaLights:B.rectArea.length,numHemiLights:B.hemi.length,numDirLightShadows:B.directionalShadowMap.length,numPointLightShadows:B.pointShadowMap.length,numSpotLightShadows:B.spotShadowMap.length,numSpotLightShadowsWithMaps:B.numSpotLightShadowsWithMaps,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:E.dithering,shadowMapEnabled:n.shadowMap.enabled&&L.length>0,shadowMapType:n.shadowMap.type,toneMapping:E.toneMapped?n.toneMapping:Ir,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:E.premultipliedAlpha,doubleSided:E.side===Br,flipSided:E.side===Ei,useDepthPacking:!!E.depthPacking,depthPacking:E.depthPacking||0,index0AttributeName:E.index0AttributeName,extensionDerivatives:E.extensions&&E.extensions.derivatives,extensionFragDepth:E.extensions&&E.extensions.fragDepth,extensionDrawBuffers:E.extensions&&E.extensions.drawBuffers,extensionShaderTextureLOD:E.extensions&&E.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),customProgramCacheKey:E.customProgramCacheKey()}}function x(E){const B=[];if(E.shaderID?B.push(E.shaderID):(B.push(E.customVertexShaderID),B.push(E.customFragmentShaderID)),E.defines!==void 0)for(const L in E.defines)B.push(L),B.push(E.defines[L]);return E.isRawShaderMaterial===!1&&(_(B,E),A(B,E),B.push(n.outputEncoding)),B.push(E.customProgramCacheKey),B.join()}function _(E,B){E.push(B.precision),E.push(B.outputEncoding),E.push(B.envMapMode),E.push(B.envMapCubeUVHeight),E.push(B.combine),E.push(B.vertexUvs),E.push(B.fogExp2),E.push(B.sizeAttenuation),E.push(B.morphTargetsCount),E.push(B.morphAttributeCount),E.push(B.numDirLights),E.push(B.numPointLights),E.push(B.numSpotLights),E.push(B.numSpotLightMaps),E.push(B.numHemiLights),E.push(B.numRectAreaLights),E.push(B.numDirLightShadows),E.push(B.numPointLightShadows),E.push(B.numSpotLightShadows),E.push(B.numSpotLightShadowsWithMaps),E.push(B.shadowMapType),E.push(B.toneMapping),E.push(B.numClippingPlanes),E.push(B.numClipIntersection),E.push(B.depthPacking)}function A(E,B){a.disableAll(),B.isWebGL2&&a.enable(0),B.supportsVertexTextures&&a.enable(1),B.instancing&&a.enable(2),B.instancingColor&&a.enable(3),B.map&&a.enable(4),B.matcap&&a.enable(5),B.envMap&&a.enable(6),B.lightMap&&a.enable(7),B.aoMap&&a.enable(8),B.emissiveMap&&a.enable(9),B.bumpMap&&a.enable(10),B.normalMap&&a.enable(11),B.objectSpaceNormalMap&&a.enable(12),B.tangentSpaceNormalMap&&a.enable(13),B.clearcoat&&a.enable(14),B.clearcoatMap&&a.enable(15),B.clearcoatRoughnessMap&&a.enable(16),B.clearcoatNormalMap&&a.enable(17),B.iridescence&&a.enable(18),B.iridescenceMap&&a.enable(19),B.iridescenceThicknessMap&&a.enable(20),B.displacementMap&&a.enable(21),B.specularMap&&a.enable(22),B.roughnessMap&&a.enable(23),B.metalnessMap&&a.enable(24),B.gradientMap&&a.enable(25),B.alphaMap&&a.enable(26),B.alphaTest&&a.enable(27),B.vertexColors&&a.enable(28),B.vertexAlphas&&a.enable(29),B.vertexUvs&&a.enable(30),B.vertexTangents&&a.enable(31),B.uvsVertexOnly&&a.enable(32),E.push(a.mask),a.disableAll(),B.fog&&a.enable(0),B.useFog&&a.enable(1),B.flatShading&&a.enable(2),B.logarithmicDepthBuffer&&a.enable(3),B.skinning&&a.enable(4),B.morphTargets&&a.enable(5),B.morphNormals&&a.enable(6),B.morphColors&&a.enable(7),B.premultipliedAlpha&&a.enable(8),B.shadowMapEnabled&&a.enable(9),B.physicallyCorrectLights&&a.enable(10),B.doubleSided&&a.enable(11),B.flipSided&&a.enable(12),B.useDepthPacking&&a.enable(13),B.dithering&&a.enable(14),B.specularIntensityMap&&a.enable(15),B.specularColorMap&&a.enable(16),B.transmission&&a.enable(17),B.transmissionMap&&a.enable(18),B.thicknessMap&&a.enable(19),B.sheen&&a.enable(20),B.sheenColorMap&&a.enable(21),B.sheenRoughnessMap&&a.enable(22),B.decodeVideoTexture&&a.enable(23),B.opaque&&a.enable(24),E.push(a.mask)}function w(E){const B=v[E.type];let L;if(B){const z=Pr[B];L=RB.clone(z.uniforms)}else L=E.uniforms;return L}function S(E,B){let L;for(let z=0,Z=f.length;z<Z;z++){const J=f[z];if(J.cacheKey===B){L=J,++L.usedTimes;break}}return L===void 0&&(L=new k4(n,B,E,s),f.push(L)),L}function b(E){if(--E.usedTimes===0){const B=f.indexOf(E);f[B]=f[f.length-1],f.pop(),E.destroy()}}function P(E){l.remove(E)}function R(){l.dispose()}return{getParameters:y,getProgramCacheKey:x,getUniforms:w,acquireProgram:S,releaseProgram:b,releaseShaderCache:P,programs:f,dispose:R}}function H4(){let n=new WeakMap;function e(s){let o=n.get(s);return o===void 0&&(o={},n.set(s,o)),o}function t(s){n.delete(s)}function i(s,o,a){n.get(s)[o]=a}function r(){n=new WeakMap}return{get:e,remove:t,update:i,dispose:r}}function V4(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.z!==e.z?n.z-e.z:n.id-e.id}function GC(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function HC(){const n=[];let e=0;const t=[],i=[],r=[];function s(){e=0,t.length=0,i.length=0,r.length=0}function o(d,p,m,v,y,x){let _=n[e];return _===void 0?(_={id:d.id,object:d,geometry:p,material:m,groupOrder:v,renderOrder:d.renderOrder,z:y,group:x},n[e]=_):(_.id=d.id,_.object=d,_.geometry=p,_.material=m,_.groupOrder=v,_.renderOrder=d.renderOrder,_.z=y,_.group=x),e++,_}function a(d,p,m,v,y,x){const _=o(d,p,m,v,y,x);m.transmission>0?i.push(_):m.transparent===!0?r.push(_):t.push(_)}function l(d,p,m,v,y,x){const _=o(d,p,m,v,y,x);m.transmission>0?i.unshift(_):m.transparent===!0?r.unshift(_):t.unshift(_)}function f(d,p){t.length>1&&t.sort(d||V4),i.length>1&&i.sort(p||GC),r.length>1&&r.sort(p||GC)}function h(){for(let d=e,p=n.length;d<p;d++){const m=n[d];if(m.id===null)break;m.id=null,m.object=null,m.geometry=null,m.material=null,m.group=null}}return{opaque:t,transmissive:i,transparent:r,init:s,push:a,unshift:l,finish:h,sort:f}}function W4(){let n=new WeakMap;function e(i,r){const s=n.get(i);let o;return s===void 0?(o=new HC,n.set(i,[o])):r>=s.length?(o=new HC,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function j4(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new D,color:new Le};break;case"SpotLight":t={position:new D,direction:new D,color:new Le,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new D,color:new Le,distance:0,decay:0};break;case"HemisphereLight":t={direction:new D,skyColor:new Le,groundColor:new Le};break;case"RectAreaLight":t={color:new Le,position:new D,halfWidth:new D,halfHeight:new D};break}return n[e.id]=t,t}}}function J4(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new me};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new me};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new me,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let X4=0;function K4(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function Y4(n,e){const t=new j4,i=J4(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-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};for(let h=0;h<9;h++)r.probe.push(new D);const s=new D,o=new rt,a=new rt;function l(h,d){let p=0,m=0,v=0;for(let z=0;z<9;z++)r.probe[z].set(0,0,0);let y=0,x=0,_=0,A=0,w=0,S=0,b=0,P=0,R=0,E=0;h.sort(K4);const B=d!==!0?Math.PI:1;for(let z=0,Z=h.length;z<Z;z++){const J=h[z],H=J.color,Y=J.intensity,te=J.distance,le=J.shadow&&J.shadow.map?J.shadow.map.texture:null;if(J.isAmbientLight)p+=H.r*Y*B,m+=H.g*Y*B,v+=H.b*Y*B;else if(J.isLightProbe)for(let N=0;N<9;N++)r.probe[N].addScaledVector(J.sh.coefficients[N],Y);else if(J.isDirectionalLight){const N=t.get(J);if(N.color.copy(J.color).multiplyScalar(J.intensity*B),J.castShadow){const V=J.shadow,j=i.get(J);j.shadowBias=V.bias,j.shadowNormalBias=V.normalBias,j.shadowRadius=V.radius,j.shadowMapSize=V.mapSize,r.directionalShadow[y]=j,r.directionalShadowMap[y]=le,r.directionalShadowMatrix[y]=J.shadow.matrix,S++}r.directional[y]=N,y++}else if(J.isSpotLight){const N=t.get(J);N.position.setFromMatrixPosition(J.matrixWorld),N.color.copy(H).multiplyScalar(Y*B),N.distance=te,N.coneCos=Math.cos(J.angle),N.penumbraCos=Math.cos(J.angle*(1-J.penumbra)),N.decay=J.decay,r.spot[_]=N;const V=J.shadow;if(J.map&&(r.spotLightMap[R]=J.map,R++,V.updateMatrices(J),J.castShadow&&E++),r.spotLightMatrix[_]=V.matrix,J.castShadow){const j=i.get(J);j.shadowBias=V.bias,j.shadowNormalBias=V.normalBias,j.shadowRadius=V.radius,j.shadowMapSize=V.mapSize,r.spotShadow[_]=j,r.spotShadowMap[_]=le,P++}_++}else if(J.isRectAreaLight){const N=t.get(J);N.color.copy(H).multiplyScalar(Y),N.halfWidth.set(J.width*.5,0,0),N.halfHeight.set(0,J.height*.5,0),r.rectArea[A]=N,A++}else if(J.isPointLight){const N=t.get(J);if(N.color.copy(J.color).multiplyScalar(J.intensity*B),N.distance=J.distance,N.decay=J.decay,J.castShadow){const V=J.shadow,j=i.get(J);j.shadowBias=V.bias,j.shadowNormalBias=V.normalBias,j.shadowRadius=V.radius,j.shadowMapSize=V.mapSize,j.shadowCameraNear=V.camera.near,j.shadowCameraFar=V.camera.far,r.pointShadow[x]=j,r.pointShadowMap[x]=le,r.pointShadowMatrix[x]=J.shadow.matrix,b++}r.point[x]=N,x++}else if(J.isHemisphereLight){const N=t.get(J);N.skyColor.copy(J.color).multiplyScalar(Y*B),N.groundColor.copy(J.groundColor).multiplyScalar(Y*B),r.hemi[w]=N,w++}}A>0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Re.LTC_FLOAT_1,r.rectAreaLTC2=Re.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=Re.LTC_HALF_1,r.rectAreaLTC2=Re.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=p,r.ambient[1]=m,r.ambient[2]=v;const L=r.hash;(L.directionalLength!==y||L.pointLength!==x||L.spotLength!==_||L.rectAreaLength!==A||L.hemiLength!==w||L.numDirectionalShadows!==S||L.numPointShadows!==b||L.numSpotShadows!==P||L.numSpotMaps!==R)&&(r.directional.length=y,r.spot.length=_,r.rectArea.length=A,r.point.length=x,r.hemi.length=w,r.directionalShadow.length=S,r.directionalShadowMap.length=S,r.pointShadow.length=b,r.pointShadowMap.length=b,r.spotShadow.length=P,r.spotShadowMap.length=P,r.directionalShadowMatrix.length=S,r.pointShadowMatrix.length=b,r.spotLightMatrix.length=P+R-E,r.spotLightMap.length=R,r.numSpotLightShadowsWithMaps=E,L.directionalLength=y,L.pointLength=x,L.spotLength=_,L.rectAreaLength=A,L.hemiLength=w,L.numDirectionalShadows=S,L.numPointShadows=b,L.numSpotShadows=P,L.numSpotMaps=R,r.version=X4++)}function f(h,d){let p=0,m=0,v=0,y=0,x=0;const _=d.matrixWorldInverse;for(let A=0,w=h.length;A<w;A++){const S=h[A];if(S.isDirectionalLight){const b=r.directional[p];b.direction.setFromMatrixPosition(S.matrixWorld),s.setFromMatrixPosition(S.target.matrixWorld),b.direction.sub(s),b.direction.transformDirection(_),p++}else if(S.isSpotLight){const b=r.spot[v];b.position.setFromMatrixPosition(S.matrixWorld),b.position.applyMatrix4(_),b.direction.setFromMatrixPosition(S.matrixWorld),s.setFromMatrixPosition(S.target.matrixWorld),b.direction.sub(s),b.direction.transformDirection(_),v++}else if(S.isRectAreaLight){const b=r.rectArea[y];b.position.setFromMatrixPosition(S.matrixWorld),b.position.applyMatrix4(_),a.identity(),o.copy(S.matrixWorld),o.premultiply(_),a.extractRotation(o),b.halfWidth.set(S.width*.5,0,0),b.halfHeight.set(0,S.height*.5,0),b.halfWidth.applyMatrix4(a),b.halfHeight.applyMatrix4(a),y++}else if(S.isPointLight){const b=r.point[m];b.position.setFromMatrixPosition(S.matrixWorld),b.position.applyMatrix4(_),m++}else if(S.isHemisphereLight){const b=r.hemi[x];b.direction.setFromMatrixPosition(S.matrixWorld),b.direction.transformDirection(_),x++}}}return{setup:l,setupView:f,state:r}}function VC(n,e){const t=new Y4(n,e),i=[],r=[];function s(){i.length=0,r.length=0}function o(d){i.push(d)}function a(d){r.push(d)}function l(d){t.setup(i,d)}function f(d){t.setupView(i,d)}return{init:s,state:{lightsArray:i,shadowsArray:r,lights:t},setupLights:l,setupLightsView:f,pushLight:o,pushShadow:a}}function Q4(n,e){let t=new WeakMap;function i(s,o=0){const a=t.get(s);let l;return a===void 0?(l=new VC(n,e),t.set(s,[l])):o>=a.length?(l=new VC(n,e),a.push(l)):l=a[o],l}function r(){t=new WeakMap}return{get:i,dispose:r}}class sA extends Mn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=wB,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 oA extends Mn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new D,this.nearDistance=1,this.farDistance=1e3,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.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const Z4=`void main() { gl_Position = vec4( position, 1.0 ); }`,q4=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include <packing> void main() { const float samples = float( VSM_SAMPLES ); float mean = 0.0; float squared_mean = 0.0; float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); float uvStart = samples <= 1.0 ? 0.0 : - 1.0; for ( float i = 0.0; i < samples; i ++ ) { float uvOffset = uvStart + i * uvStride; #ifdef HORIZONTAL_PASS vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); mean += distribution.x; squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; #else float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); mean += depth; squared_mean += depth * depth; #endif } mean = mean / samples; squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); }`;function $4(n,e,t){let i=new bg;const r=new me,s=new me,o=new Nt,a=new sA({depthPacking:SB}),l=new oA,f={},h=t.maxTextureSize,d={[is]:Ei,[Ei]:is,[Br]:Br},p=new ss({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new me},radius:{value:4}},vertexShader:Z4,fragmentShader:q4}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const v=new ut;v.setAttribute("position",new Dt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new bn(v,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Mg,this.render=function(S,b,P){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||S.length===0)return;const R=n.getRenderTarget(),E=n.getActiveCubeFace(),B=n.getActiveMipmapLevel(),L=n.state;L.setBlending(Fs),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let z=0,Z=S.length;z<Z;z++){const J=S[z],H=J.shadow;if(H===void 0){console.warn("THREE.WebGLShadowMap:",J,"has no shadow.");continue}if(H.autoUpdate===!1&&H.needsUpdate===!1)continue;r.copy(H.mapSize);const Y=H.getFrameExtents();if(r.multiply(Y),s.copy(H.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/Y.x),r.x=s.x*Y.x,H.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/Y.y),r.y=s.y*Y.y,H.mapSize.y=s.y)),H.map===null){const le=this.type!==Da?{minFilter:fn,magFilter:fn}:{};H.map=new Nr(r.x,r.y,le),H.map.texture.name=J.name+".shadowMap",H.camera.updateProjectionMatrix()}n.setRenderTarget(H.map),n.clear();const te=H.getViewportCount();for(let le=0;le<te;le++){const N=H.getViewport(le);o.set(s.x*N.x,s.y*N.y,s.x*N.z,s.y*N.w),L.viewport(o),H.updateMatrices(J,le),i=H.getFrustum(),w(b,P,H.camera,J,this.type)}H.isPointLightShadow!==!0&&this.type===Da&&_(H,P),H.needsUpdate=!1}x.needsUpdate=!1,n.setRenderTarget(R,E,B)};function _(S,b){const P=e.update(y);p.defines.VSM_SAMPLES!==S.blurSamples&&(p.defines.VSM_SAMPLES=S.blurSamples,m.defines.VSM_SAMPLES=S.blurSamples,p.needsUpdate=!0,m.needsUpdate=!0),S.mapPass===null&&(S.mapPass=new Nr(r.x,r.y)),p.uniforms.shadow_pass.value=S.map.texture,p.uniforms.resolution.value=S.mapSize,p.uniforms.radius.value=S.radius,n.setRenderTarget(S.mapPass),n.clear(),n.renderBufferDirect(b,null,P,p,y,null),m.uniforms.shadow_pass.value=S.mapPass.texture,m.uniforms.resolution.value=S.mapSize,m.uniforms.radius.value=S.radius,n.setRenderTarget(S.map),n.clear(),n.renderBufferDirect(b,null,P,m,y,null)}function A(S,b,P,R,E,B){let L=null;const z=P.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(z!==void 0)L=z;else if(L=P.isPointLight===!0?l:a,n.localClippingEnabled&&b.clipShadows===!0&&Array.isArray(b.clippingPlanes)&&b.clippingPlanes.length!==0||b.displacementMap&&b.displacementScale!==0||b.alphaMap&&b.alphaTest>0||b.map&&b.alphaTest>0){const Z=L.uuid,J=b.uuid;let H=f[Z];H===void 0&&(H={},f[Z]=H);let Y=H[J];Y===void 0&&(Y=L.clone(),H[J]=Y),L=Y}return L.visible=b.visible,L.wireframe=b.wireframe,B===Da?L.side=b.shadowSide!==null?b.shadowSide:b.side:L.side=b.shadowSide!==null?b.shadowSide:d[b.side],L.alphaMap=b.alphaMap,L.alphaTest=b.alphaTest,L.map=b.map,L.clipShadows=b.clipShadows,L.clippingPlanes=b.clippingPlanes,L.clipIntersection=b.clipIntersection,L.displacementMap=b.displacementMap,L.displacementScale=b.displacementScale,L.displacementBias=b.displacementBias,L.wireframeLinewidth=b.wireframeLinewidth,L.linewidth=b.linewidth,P.isPointLight===!0&&L.isMeshDistanceMaterial===!0&&(L.referencePosition.setFromMatrixPosition(P.matrixWorld),L.nearDistance=R,L.farDistance=E),L}function w(S,b,P,R,E){if(S.visible===!1)return;if(S.layers.test(b.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&E===Da)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,S.matrixWorld);const z=e.update(S),Z=S.material;if(Array.isArray(Z)){const J=z.groups;for(let H=0,Y=J.length;H<Y;H++){const te=J[H],le=Z[te.materialIndex];if(le&&le.visible){const N=A(S,le,R,P.near,P.far,E);n.renderBufferDirect(P,null,z,N,S,te)}}}else if(Z.visible){const J=A(S,Z,R,P.near,P.far,E);n.renderBufferDirect(P,null,z,J,S,null)}}const L=S.children;for(let z=0,Z=L.length;z<Z;z++)w(L[z],b,P,R,E)}}function eG(n,e,t){const i=t.isWebGL2;function r(){let K=!1;const ue=new Nt;let xe=null;const Ue=new Nt(0,0,0,0);return{setMask:function(Ye){xe!==Ye&&!K&&(n.colorMask(Ye,Ye,Ye,Ye),xe=Ye)},setLocked:function(Ye){K=Ye},setClear:function(Ye,Pt,hn,Bn,zr){zr===!0&&(Ye*=Bn,Pt*=Bn,hn*=Bn),ue.set(Ye,Pt,hn,Bn),Ue.equals(ue)===!1&&(n.clearColor(Ye,Pt,hn,Bn),Ue.copy(ue))},reset:function(){K=!1,xe=null,Ue.set(-1,0,0,0)}}}function s(){let K=!1,ue=null,xe=null,Ue=null;return{setTest:function(Ye){Ye?ke(2929):Oe(2929)},setMask:function(Ye){ue!==Ye&&!K&&(n.depthMask(Ye),ue=Ye)},setFunc:function(Ye){if(xe!==Ye){switch(Ye){case jP:n.depthFunc(512);break;case JP:n.depthFunc(519);break;case XP:n.depthFunc(513);break;case Gm:n.depthFunc(515);break;case KP:n.depthFunc(514);break;case YP:n.depthFunc(518);break;case QP:n.depthFunc(516);break;case ZP:n.depthFunc(517);break;default:n.depthFunc(515)}xe=Ye}},setLocked:function(Ye){K=Ye},setClear:function(Ye){Ue!==Ye&&(n.clearDepth(Ye),Ue=Ye)},reset:function(){K=!1,ue=null,xe=null,Ue=null}}}function o(){let K=!1,ue=null,xe=null,Ue=null,Ye=null,Pt=null,hn=null,Bn=null,zr=null;return{setTest:function(Ot){K||(Ot?ke(2960):Oe(2960))},setMask:function(Ot){ue!==Ot&&!K&&(n.stencilMask(Ot),ue=Ot)},setFunc:function(Ot,Ji,mi){(xe!==Ot||Ue!==Ji||Ye!==mi)&&(n.stencilFunc(Ot,Ji,mi),xe=Ot,Ue=Ji,Ye=mi)},setOp:function(Ot,Ji,mi){(Pt!==Ot||hn!==Ji||Bn!==mi)&&(n.stencilOp(Ot,Ji,mi),Pt=Ot,hn=Ji,Bn=mi)},setLocked:function(Ot){K=Ot},setClear:function(Ot){zr!==Ot&&(n.clearStencil(Ot),zr=Ot)},reset:function(){K=!1,ue=null,xe=null,Ue=null,Ye=null,Pt=null,hn=null,Bn=null,zr=null}}}const a=new r,l=new s,f=new o,h=new WeakMap,d=new WeakMap;let p={},m={},v=new WeakMap,y=[],x=null,_=!1,A=null,w=null,S=null,b=null,P=null,R=null,E=null,B=!1,L=null,z=null,Z=null,J=null,H=null;const Y=n.getParameter(35661);let te=!1,le=0;const N=n.getParameter(7938);N.indexOf("WebGL")!==-1?(le=parseFloat(/^WebGL (\d)/.exec(N)[1]),te=le>=1):N.indexOf("OpenGL ES")!==-1&&(le=parseFloat(/^OpenGL ES (\d)/.exec(N)[1]),te=le>=2);let V=null,j={};const ae=n.getParameter(3088),W=n.getParameter(2978),ce=new Nt().fromArray(ae),ve=new Nt().fromArray(W);function _e(K,ue,xe){const Ue=new Uint8Array(4),Ye=n.createTexture();n.bindTexture(K,Ye),n.texParameteri(K,10241,9728),n.texParameteri(K,10240,9728);for(let Pt=0;Pt<xe;Pt++)n.texImage2D(ue+Pt,0,6408,1,1,0,6408,5121,Ue);return Ye}const $={};$[3553]=_e(3553,3553,1),$[34067]=_e(34067,34069,6),a.setClear(0,0,0,1),l.setClear(1),f.setClear(0),ke(2929),l.setFunc(Gm),Be(!1),Ze(Bx),ke(2884),Ce(Fs);function ke(K){p[K]!==!0&&(n.enable(K),p[K]=!0)}function Oe(K){p[K]!==!1&&(n.disable(K),p[K]=!1)}function He(K,ue){return m[K]!==ue?(n.bindFramebuffer(K,ue),m[K]=ue,i&&(K===36009&&(m[36160]=ue),K===36160&&(m[36009]=ue)),!0):!1}function Me(K,ue){let xe=y,Ue=!1;if(K)if(xe=v.get(ue),xe===void 0&&(xe=[],v.set(ue,xe)),K.isWebGLMultipleRenderTargets){const Ye=K.texture;if(xe.length!==Ye.length||xe[0]!==36064){for(let Pt=0,hn=Ye.length;Pt<hn;Pt++)xe[Pt]=36064+Pt;xe.length=Ye.length,Ue=!0}}else xe[0]!==36064&&(xe[0]=36064,Ue=!0);else xe[0]!==1029&&(xe[0]=1029,Ue=!0);Ue&&(t.isWebGL2?n.drawBuffers(xe):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(xe))}function Ie(K){return x!==K?(n.useProgram(K),x=K,!0):!1}const he={[Ta]:32774,[DP]:32778,[FP]:32779};if(i)he[Dx]=32775,he[Fx]=32776;else{const K=e.get("EXT_blend_minmax");K!==null&&(he[Dx]=K.MIN_EXT,he[Fx]=K.MAX_EXT)}const re={[NP]:0,[kP]:1,[OP]:768,[W_]:770,[WP]:776,[HP]:774,[zP]:772,[UP]:769,[j_]:771,[VP]:775,[GP]:773};function Ce(K,ue,xe,Ue,Ye,Pt,hn,Bn){if(K===Fs){_===!0&&(Oe(3042),_=!1);return}if(_===!1&&(ke(3042),_=!0),K!==IP){if(K!==A||Bn!==B){if((w!==Ta||P!==Ta)&&(n.blendEquation(32774),w=Ta,P=Ta),Bn)switch(K){case Ha:n.blendFuncSeparate(1,771,1,771);break;case Rx:n.blendFunc(1,1);break;case Lx:n.blendFuncSeparate(0,769,0,1);break;case Ix:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",K);break}else switch(K){case Ha:n.blendFuncSeparate(770,771,1,771);break;case Rx:n.blendFunc(770,1);break;case Lx:n.blendFuncSeparate(0,769,0,1);break;case Ix:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",K);break}S=null,b=null,R=null,E=null,A=K,B=Bn}return}Ye=Ye||ue,Pt=Pt||xe,hn=hn||Ue,(ue!==w||Ye!==P)&&(n.blendEquationSeparate(he[ue],he[Ye]),w=ue,P=Ye),(xe!==S||Ue!==b||Pt!==R||hn!==E)&&(n.blendFuncSeparate(re[xe],re[Ue],re[Pt],re[hn]),S=xe,b=Ue,R=Pt,E=hn),A=K,B=!1}function ze(K,ue){K.side===Br?Oe(2884):ke(2884);let xe=K.side===Ei;ue&&(xe=!xe),Be(xe),K.blending===Ha&&K.transparent===!1?Ce(Fs):Ce(K.blending,K.blendEquation,K.blendSrc,K.blendDst,K.blendEquationAlpha,K.blendSrcAlpha,K.blendDstAlpha,K.premultipliedAlpha),l.setFunc(K.depthFunc),l.setTest(K.depthTest),l.setMask(K.depthWrite),a.setMask(K.colorWrite);const Ue=K.stencilWrite;f.setTest(Ue),Ue&&(f.setMask(K.stencilWriteMask),f.setFunc(K.stencilFunc,K.stencilRef,K.stencilFuncMask),f.setOp(K.stencilFail,K.stencilZFail,K.stencilZPass)),je(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),K.alphaToCoverage===!0?ke(32926):Oe(32926)}function Be(K){L!==K&&(K?n.frontFace(2304):n.frontFace(2305),L=K)}function Ze(K){K!==BP?(ke(2884),K!==z&&(K===Bx?n.cullFace(1029):K===RP?n.cullFace(1028):n.cullFace(1032))):Oe(2884),z=K}function Je(K){K!==Z&&(te&&n.lineWidth(K),Z=K)}function je(K,ue,xe){K?(ke(32823),(J!==ue||H!==xe)&&(n.polygonOffset(ue,xe),J=ue,H=xe)):Oe(32823)}function vt(K){K?ke(3089):Oe(3089)}function wt(K){K===void 0&&(K=33984+Y-1),V!==K&&(n.activeTexture(K),V=K)}function O(K,ue,xe){xe===void 0&&(V===null?xe=33984+Y-1:xe=V);let Ue=j[xe];Ue===void 0&&(Ue={type:void 0,texture:void 0},j[xe]=Ue),(Ue.type!==K||Ue.texture!==ue)&&(V!==xe&&(n.activeTexture(xe),V=xe),n.bindTexture(K,ue||$[K]),Ue.type=K,Ue.texture=ue)}function I(){const K=j[V];K!==void 0&&K.type!==void 0&&(n.bindTexture(K.type,null),K.type=void 0,K.texture=void 0)}function ie(){try{n.compressedTexImage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function we(){try{n.compressedTexImage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function Ee(){try{n.texSubImage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function Pe(){try{n.texSubImage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function nt(){try{n.compressedTexSubImage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function De(){try{n.compressedTexSubImage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function ge(){try{n.texStorage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function Xe(){try{n.texStorage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function G(){try{n.texImage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function se(){try{n.texImage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function Ae(K){ce.equals(K)===!1&&(n.scissor(K.x,K.y,K.z,K.w),ce.copy(K))}function Te(K){ve.equals(K)===!1&&(n.viewport(K.x,K.y,K.z,K.w),ve.copy(K))}function $e(K,ue){let xe=d.get(ue);xe===void 0&&(xe=new WeakMap,d.set(ue,xe));let Ue=xe.get(K);Ue===void 0&&(Ue=n.getUniformBlockIndex(ue,K.name),xe.set(K,Ue))}function yt(K,ue){const Ue=d.get(ue).get(K);h.get(ue)!==Ue&&(n.uniformBlockBinding(ue,Ue,K.__bindingPointIndex),h.set(ue,Ue))}function Vt(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),i===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),p={},V=null,j={},m={},v=new WeakMap,y=[],x=null,_=!1,A=null,w=null,S=null,b=null,P=null,R=null,E=null,B=!1,L=null,z=null,Z=null,J=null,H=null,ce.set(0,0,n.canvas.width,n.canvas.height),ve.set(0,0,n.canvas.width,n.canvas.height),a.reset(),l.reset(),f.reset()}return{buffers:{color:a,depth:l,stencil:f},enable:ke,disable:Oe,bindFramebuffer:He,drawBuffers:Me,useProgram:Ie,setBlending:Ce,setMaterial:ze,setFlipSided:Be,setCullFace:Ze,setLineWidth:Je,setPolygonOffset:je,setScissorTest:vt,activeTexture:wt,bindTexture:O,unbindTexture:I,compressedTexImage2D:ie,compressedTexImage3D:we,texImage2D:G,texImage3D:se,updateUBOMapping:$e,uniformBlockBinding:yt,texStorage2D:ge,texStorage3D:Xe,texSubImage2D:Ee,texSubImage3D:Pe,compressedTexSubImage2D:nt,compressedTexSubImage3D:De,scissor:Ae,viewport:Te,reset:Vt}}function tG(n,e,t,i,r,s,o){const a=r.isWebGL2,l=r.maxTextures,f=r.maxCubemapSize,h=r.maxTextureSize,d=r.maxSamples,p=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,m=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),v=new WeakMap;let y;const x=new WeakMap;let _=!1;try{_=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function A(O,I){return _?new OffscreenCanvas(O,I):Xf("canvas")}function w(O,I,ie,we){let Ee=1;if((O.width>we||O.height>we)&&(Ee=we/Math.max(O.width,O.height)),Ee<1||I===!0)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap){const Pe=I?Vm:Math.floor,nt=Pe(Ee*O.width),De=Pe(Ee*O.height);y===void 0&&(y=A(nt,De));const ge=ie?A(nt,De):y;return ge.width=nt,ge.height=De,ge.getContext("2d").drawImage(O,0,0,nt,De),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+O.width+"x"+O.height+") to ("+nt+"x"+De+")."),ge}else return"data"in O&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+O.width+"x"+O.height+")."),O;return O}function S(O){return o1(O.width)&&o1(O.height)}function b(O){return a?!1:O.wrapS!==zn||O.wrapT!==zn||O.minFilter!==fn&&O.minFilter!==en}function P(O,I){return O.generateMipmaps&&I&&O.minFilter!==fn&&O.minFilter!==en}function R(O){n.generateMipmap(O)}function E(O,I,ie,we,Ee=!1){if(a===!1)return I;if(O!==null){if(n[O]!==void 0)return n[O];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let Pe=I;return I===6403&&(ie===5126&&(Pe=33326),ie===5131&&(Pe=33325),ie===5121&&(Pe=33321)),I===33319&&(ie===5126&&(Pe=33328),ie===5131&&(Pe=33327),ie===5121&&(Pe=33323)),I===6408&&(ie===5126&&(Pe=34836),ie===5131&&(Pe=34842),ie===5121&&(Pe=we===Ct&&Ee===!1?35907:32856),ie===32819&&(Pe=32854),ie===32820&&(Pe=32855)),(Pe===33325||Pe===33326||Pe===33327||Pe===33328||Pe===34842||Pe===34836)&&e.get("EXT_color_buffer_float"),Pe}function B(O,I,ie){return P(O,ie)===!0||O.isFramebufferTexture&&O.minFilter!==fn&&O.minFilter!==en?Math.log2(Math.max(I.width,I.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?I.mipmaps.length:1}function L(O){return O===fn||O===Vf||O===xu?9728:9729}function z(O){const I=O.target;I.removeEventListener("dispose",z),J(I),I.isVideoTexture&&v.delete(I)}function Z(O){const I=O.target;I.removeEventListener("dispose",Z),Y(I)}function J(O){const I=i.get(O);if(I.__webglInit===void 0)return;const ie=O.source,we=x.get(ie);if(we){const Ee=we[I.__cacheKey];Ee.usedTimes--,Ee.usedTimes===0&&H(O),Object.keys(we).length===0&&x.delete(ie)}i.remove(O)}function H(O){const I=i.get(O);n.deleteTexture(I.__webglTexture);const ie=O.source,we=x.get(ie);delete we[I.__cacheKey],o.memory.textures--}function Y(O){const I=O.texture,ie=i.get(O),we=i.get(I);if(we.__webglTexture!==void 0&&(n.deleteTexture(we.__webglTexture),o.memory.textures--),O.depthTexture&&O.depthTexture.dispose(),O.isWebGLCubeRenderTarget)for(let Ee=0;Ee<6;Ee++)n.deleteFramebuffer(ie.__webglFramebuffer[Ee]),ie.__webglDepthbuffer&&n.deleteRenderbuffer(ie.__webglDepthbuffer[Ee]);else{if(n.deleteFramebuffer(ie.__webglFramebuffer),ie.__webglDepthbuffer&&n.deleteRenderbuffer(ie.__webglDepthbuffer),ie.__webglMultisampledFramebuffer&&n.deleteFramebuffer(ie.__webglMultisampledFramebuffer),ie.__webglColorRenderbuffer)for(let Ee=0;Ee<ie.__webglColorRenderbuffer.length;Ee++)ie.__webglColorRenderbuffer[Ee]&&n.deleteRenderbuffer(ie.__webglColorRenderbuffer[Ee]);ie.__webglDepthRenderbuffer&&n.deleteRenderbuffer(ie.__webglDepthRenderbuffer)}if(O.isWebGLMultipleRenderTargets)for(let Ee=0,Pe=I.length;Ee<Pe;Ee++){const nt=i.get(I[Ee]);nt.__webglTexture&&(n.deleteTexture(nt.__webglTexture),o.memory.textures--),i.remove(I[Ee])}i.remove(I),i.remove(O)}let te=0;function le(){te=0}function N(){const O=te;return O>=l&&console.warn("THREE.WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+l),te+=1,O}function V(O){const I=[];return I.push(O.wrapS),I.push(O.wrapT),I.push(O.wrapR||0),I.push(O.magFilter),I.push(O.minFilter),I.push(O.anisotropy),I.push(O.internalFormat),I.push(O.format),I.push(O.type),I.push(O.generateMipmaps),I.push(O.premultiplyAlpha),I.push(O.flipY),I.push(O.unpackAlignment),I.push(O.encoding),I.join()}function j(O,I){const ie=i.get(O);if(O.isVideoTexture&&vt(O),O.isRenderTargetTexture===!1&&O.version>0&&ie.__version!==O.version){const we=O.image;if(we===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(we.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Oe(ie,O,I);return}}t.bindTexture(3553,ie.__webglTexture,33984+I)}function ae(O,I){const ie=i.get(O);if(O.version>0&&ie.__version!==O.version){Oe(ie,O,I);return}t.bindTexture(35866,ie.__webglTexture,33984+I)}function W(O,I){const ie=i.get(O);if(O.version>0&&ie.__version!==O.version){Oe(ie,O,I);return}t.bindTexture(32879,ie.__webglTexture,33984+I)}function ce(O,I){const ie=i.get(O);if(O.version>0&&ie.__version!==O.version){He(ie,O,I);return}t.bindTexture(34067,ie.__webglTexture,33984+I)}const ve={[zo]:10497,[zn]:33071,[Pu]:33648},_e={[fn]:9728,[Vf]:9984,[xu]:9986,[en]:9729,[Sg]:9985,[rs]:9987};function $(O,I,ie){if(ie?(n.texParameteri(O,10242,ve[I.wrapS]),n.texParameteri(O,10243,ve[I.wrapT]),(O===32879||O===35866)&&n.texParameteri(O,32882,ve[I.wrapR]),n.texParameteri(O,10240,_e[I.magFilter]),n.texParameteri(O,10241,_e[I.minFilter])):(n.texParameteri(O,10242,33071),n.texParameteri(O,10243,33071),(O===32879||O===35866)&&n.texParameteri(O,32882,33071),(I.wrapS!==zn||I.wrapT!==zn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(O,10240,L(I.magFilter)),n.texParameteri(O,10241,L(I.minFilter)),I.minFilter!==fn&&I.minFilter!==en&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const we=e.get("EXT_texture_filter_anisotropic");if(I.magFilter===fn||I.minFilter!==xu&&I.minFilter!==rs||I.type===Bs&&e.has("OES_texture_float_linear")===!1||a===!1&&I.type===Bu&&e.has("OES_texture_half_float_linear")===!1)return;(I.anisotropy>1||i.get(I).__currentAnisotropy)&&(n.texParameterf(O,we.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,r.getMaxAnisotropy())),i.get(I).__currentAnisotropy=I.anisotropy)}}function ke(O,I){let ie=!1;O.__webglInit===void 0&&(O.__webglInit=!0,I.addEventListener("dispose",z));const we=I.source;let Ee=x.get(we);Ee===void 0&&(Ee={},x.set(we,Ee));const Pe=V(I);if(Pe!==O.__cacheKey){Ee[Pe]===void 0&&(Ee[Pe]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ie=!0),Ee[Pe].usedTimes++;const nt=Ee[O.__cacheKey];nt!==void 0&&(Ee[O.__cacheKey].usedTimes--,nt.usedTimes===0&&H(I)),O.__cacheKey=Pe,O.__webglTexture=Ee[Pe].texture}return ie}function Oe(O,I,ie){let we=3553;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(we=35866),I.isData3DTexture&&(we=32879);const Ee=ke(O,I),Pe=I.source;t.bindTexture(we,O.__webglTexture,33984+ie);const nt=i.get(Pe);if(Pe.version!==nt.__version||Ee===!0){t.activeTexture(33984+ie),n.pixelStorei(37440,I.flipY),n.pixelStorei(37441,I.premultiplyAlpha),n.pixelStorei(3317,I.unpackAlignment),n.pixelStorei(37443,0);const De=b(I)&&S(I.image)===!1;let ge=w(I.image,De,!1,h);ge=wt(I,ge);const Xe=S(ge)||a,G=s.convert(I.format,I.encoding);let se=s.convert(I.type),Ae=E(I.internalFormat,G,se,I.encoding,I.isVideoTexture);$(we,I,Xe);let Te;const $e=I.mipmaps,yt=a&&I.isVideoTexture!==!0,Vt=nt.__version===void 0||Ee===!0,K=B(I,ge,Xe);if(I.isDepthTexture)Ae=6402,a?I.type===Bs?Ae=36012:I.type===Mo?Ae=33190:I.type===Va?Ae=35056:Ae=33189:I.type===Bs&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),I.format===Do&&Ae===6402&&I.type!==X_&&I.type!==Mo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),I.type=Mo,se=s.convert(I.type)),I.format===el&&Ae===6402&&(Ae=34041,I.type!==Va&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),I.type=Va,se=s.convert(I.type))),Vt&&(yt?t.texStorage2D(3553,1,Ae,ge.width,ge.height):t.texImage2D(3553,0,Ae,ge.width,ge.height,0,G,se,null));else if(I.isDataTexture)if($e.length>0&&Xe){yt&&Vt&&t.texStorage2D(3553,K,Ae,$e[0].width,$e[0].height);for(let ue=0,xe=$e.length;ue<xe;ue++)Te=$e[ue],yt?t.texSubImage2D(3553,ue,0,0,Te.width,Te.height,G,se,Te.data):t.texImage2D(3553,ue,Ae,Te.width,Te.height,0,G,se,Te.data);I.generateMipmaps=!1}else yt?(Vt&&t.texStorage2D(3553,K,Ae,ge.width,ge.height),t.texSubImage2D(3553,0,0,0,ge.width,ge.height,G,se,ge.data)):t.texImage2D(3553,0,Ae,ge.width,ge.height,0,G,se,ge.data);else if(I.isCompressedTexture)if(I.isCompressedArrayTexture){yt&&Vt&&t.texStorage3D(35866,K,Ae,$e[0].width,$e[0].height,ge.depth);for(let ue=0,xe=$e.length;ue<xe;ue++)Te=$e[ue],I.format!==Ai?G!==null?yt?t.compressedTexSubImage3D(35866,ue,0,0,0,Te.width,Te.height,ge.depth,G,Te.data,0,0):t.compressedTexImage3D(35866,ue,Ae,Te.width,Te.height,ge.depth,0,Te.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):yt?t.texSubImage3D(35866,ue,0,0,0,Te.width,Te.height,ge.depth,G,se,Te.data):t.texImage3D(35866,ue,Ae,Te.width,Te.height,ge.depth,0,G,se,Te.data)}else{yt&&Vt&&t.texStorage2D(3553,K,Ae,$e[0].width,$e[0].height);for(let ue=0,xe=$e.length;ue<xe;ue++)Te=$e[ue],I.format!==Ai?G!==null?yt?t.compressedTexSubImage2D(3553,ue,0,0,Te.width,Te.height,G,Te.data):t.compressedTexImage2D(3553,ue,Ae,Te.width,Te.height,0,Te.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):yt?t.texSubImage2D(3553,ue,0,0,Te.width,Te.height,G,se,Te.data):t.texImage2D(3553,ue,Ae,Te.width,Te.height,0,G,se,Te.data)}else if(I.isDataArrayTexture)yt?(Vt&&t.texStorage3D(35866,K,Ae,ge.width,ge.height,ge.depth),t.texSubImage3D(35866,0,0,0,0,ge.width,ge.height,ge.depth,G,se,ge.data)):t.texImage3D(35866,0,Ae,ge.width,ge.height,ge.depth,0,G,se,ge.data);else if(I.isData3DTexture)yt?(Vt&&t.texStorage3D(32879,K,Ae,ge.width,ge.height,ge.depth),t.texSubImage3D(32879,0,0,0,0,ge.width,ge.height,ge.depth,G,se,ge.data)):t.texImage3D(32879,0,Ae,ge.width,ge.height,ge.depth,0,G,se,ge.data);else if(I.isFramebufferTexture){if(Vt)if(yt)t.texStorage2D(3553,K,Ae,ge.width,ge.height);else{let ue=ge.width,xe=ge.height;for(let Ue=0;Ue<K;Ue++)t.texImage2D(3553,Ue,Ae,ue,xe,0,G,se,null),ue>>=1,xe>>=1}}else if($e.length>0&&Xe){yt&&Vt&&t.texStorage2D(3553,K,Ae,$e[0].width,$e[0].height);for(let ue=0,xe=$e.length;ue<xe;ue++)Te=$e[ue],yt?t.texSubImage2D(3553,ue,0,0,G,se,Te):t.texImage2D(3553,ue,Ae,G,se,Te);I.generateMipmaps=!1}else yt?(Vt&&t.texStorage2D(3553,K,Ae,ge.width,ge.height),t.texSubImage2D(3553,0,0,0,G,se,ge)):t.texImage2D(3553,0,Ae,G,se,ge);P(I,Xe)&&R(we),nt.__version=Pe.version,I.onUpdate&&I.onUpdate(I)}O.__version=I.version}function He(O,I,ie){if(I.image.length!==6)return;const we=ke(O,I),Ee=I.source;t.bindTexture(34067,O.__webglTexture,33984+ie);const Pe=i.get(Ee);if(Ee.version!==Pe.__version||we===!0){t.activeTexture(33984+ie),n.pixelStorei(37440,I.flipY),n.pixelStorei(37441,I.premultiplyAlpha),n.pixelStorei(3317,I.unpackAlignment),n.pixelStorei(37443,0);const nt=I.isCompressedTexture||I.image[0].isCompressedTexture,De=I.image[0]&&I.image[0].isDataTexture,ge=[];for(let ue=0;ue<6;ue++)!nt&&!De?ge[ue]=w(I.image[ue],!1,!0,f):ge[ue]=De?I.image[ue].image:I.image[ue],ge[ue]=wt(I,ge[ue]);const Xe=ge[0],G=S(Xe)||a,se=s.convert(I.format,I.encoding),Ae=s.convert(I.type),Te=E(I.internalFormat,se,Ae,I.encoding),$e=a&&I.isVideoTexture!==!0,yt=Pe.__version===void 0||we===!0;let Vt=B(I,Xe,G);$(34067,I,G);let K;if(nt){$e&&yt&&t.texStorage2D(34067,Vt,Te,Xe.width,Xe.height);for(let ue=0;ue<6;ue++){K=ge[ue].mipmaps;for(let xe=0;xe<K.length;xe++){const Ue=K[xe];I.format!==Ai?se!==null?$e?t.compressedTexSubImage2D(34069+ue,xe,0,0,Ue.width,Ue.height,se,Ue.data):t.compressedTexImage2D(34069+ue,xe,Te,Ue.width,Ue.height,0,Ue.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):$e?t.texSubImage2D(34069+ue,xe,0,0,Ue.width,Ue.height,se,Ae,Ue.data):t.texImage2D(34069+ue,xe,Te,Ue.width,Ue.height,0,se,Ae,Ue.data)}}}else{K=I.mipmaps,$e&&yt&&(K.length>0&&Vt++,t.texStorage2D(34067,Vt,Te,ge[0].width,ge[0].height));for(let ue=0;ue<6;ue++)if(De){$e?t.texSubImage2D(34069+ue,0,0,0,ge[ue].width,ge[ue].height,se,Ae,ge[ue].data):t.texImage2D(34069+ue,0,Te,ge[ue].width,ge[ue].height,0,se,Ae,ge[ue].data);for(let xe=0;xe<K.length;xe++){const Ye=K[xe].image[ue].image;$e?t.texSubImage2D(34069+ue,xe+1,0,0,Ye.width,Ye.height,se,Ae,Ye.data):t.texImage2D(34069+ue,xe+1,Te,Ye.width,Ye.height,0,se,Ae,Ye.data)}}else{$e?t.texSubImage2D(34069+ue,0,0,0,se,Ae,ge[ue]):t.texImage2D(34069+ue,0,Te,se,Ae,ge[ue]);for(let xe=0;xe<K.length;xe++){const Ue=K[xe];$e?t.texSubImage2D(34069+ue,xe+1,0,0,se,Ae,Ue.image[ue]):t.texImage2D(34069+ue,xe+1,Te,se,Ae,Ue.image[ue])}}}P(I,G)&&R(34067),Pe.__version=Ee.version,I.onUpdate&&I.onUpdate(I)}O.__version=I.version}function Me(O,I,ie,we,Ee){const Pe=s.convert(ie.format,ie.encoding),nt=s.convert(ie.type),De=E(ie.internalFormat,Pe,nt,ie.encoding);i.get(I).__hasExternalTextures||(Ee===32879||Ee===35866?t.texImage3D(Ee,0,De,I.width,I.height,I.depth,0,Pe,nt,null):t.texImage2D(Ee,0,De,I.width,I.height,0,Pe,nt,null)),t.bindFramebuffer(36160,O),je(I)?p.framebufferTexture2DMultisampleEXT(36160,we,Ee,i.get(ie).__webglTexture,0,Je(I)):(Ee===3553||Ee>=34069&&Ee<=34074)&&n.framebufferTexture2D(36160,we,Ee,i.get(ie).__webglTexture,0),t.bindFramebuffer(36160,null)}function Ie(O,I,ie){if(n.bindRenderbuffer(36161,O),I.depthBuffer&&!I.stencilBuffer){let we=33189;if(ie||je(I)){const Ee=I.depthTexture;Ee&&Ee.isDepthTexture&&(Ee.type===Bs?we=36012:Ee.type===Mo&&(we=33190));const Pe=Je(I);je(I)?p.renderbufferStorageMultisampleEXT(36161,Pe,we,I.width,I.height):n.renderbufferStorageMultisample(36161,Pe,we,I.width,I.height)}else n.renderbufferStorage(36161,we,I.width,I.height);n.framebufferRenderbuffer(36160,36096,36161,O)}else if(I.depthBuffer&&I.stencilBuffer){const we=Je(I);ie&&je(I)===!1?n.renderbufferStorageMultisample(36161,we,35056,I.width,I.height):je(I)?p.renderbufferStorageMultisampleEXT(36161,we,35056,I.width,I.height):n.renderbufferStorage(36161,34041,I.width,I.height),n.framebufferRenderbuffer(36160,33306,36161,O)}else{const we=I.isWebGLMultipleRenderTargets===!0?I.texture:[I.texture];for(let Ee=0;Ee<we.length;Ee++){const Pe=we[Ee],nt=s.convert(Pe.format,Pe.encoding),De=s.convert(Pe.type),ge=E(Pe.internalFormat,nt,De,Pe.encoding),Xe=Je(I);ie&&je(I)===!1?n.renderbufferStorageMultisample(36161,Xe,ge,I.width,I.height):je(I)?p.renderbufferStorageMultisampleEXT(36161,Xe,ge,I.width,I.height):n.renderbufferStorage(36161,ge,I.width,I.height)}}n.bindRenderbuffer(36161,null)}function he(O,I){if(I&&I.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,O),!(I.depthTexture&&I.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(I.depthTexture).__webglTexture||I.depthTexture.image.width!==I.width||I.depthTexture.image.height!==I.height)&&(I.depthTexture.image.width=I.width,I.depthTexture.image.height=I.height,I.depthTexture.needsUpdate=!0),j(I.depthTexture,0);const we=i.get(I.depthTexture).__webglTexture,Ee=Je(I);if(I.depthTexture.format===Do)je(I)?p.framebufferTexture2DMultisampleEXT(36160,36096,3553,we,0,Ee):n.framebufferTexture2D(36160,36096,3553,we,0);else if(I.depthTexture.format===el)je(I)?p.framebufferTexture2DMultisampleEXT(36160,33306,3553,we,0,Ee):n.framebufferTexture2D(36160,33306,3553,we,0);else throw new Error("Unknown depthTexture format")}function re(O){const I=i.get(O),ie=O.isWebGLCubeRenderTarget===!0;if(O.depthTexture&&!I.__autoAllocateDepthBuffer){if(ie)throw new Error("target.depthTexture not supported in Cube render targets");he(I.__webglFramebuffer,O)}else if(ie){I.__webglDepthbuffer=[];for(let we=0;we<6;we++)t.bindFramebuffer(36160,I.__webglFramebuffer[we]),I.__webglDepthbuffer[we]=n.createRenderbuffer(),Ie(I.__webglDepthbuffer[we],O,!1)}else t.bindFramebuffer(36160,I.__webglFramebuffer),I.__webglDepthbuffer=n.createRenderbuffer(),Ie(I.__webglDepthbuffer,O,!1);t.bindFramebuffer(36160,null)}function Ce(O,I,ie){const we=i.get(O);I!==void 0&&Me(we.__webglFramebuffer,O,O.texture,36064,3553),ie!==void 0&&re(O)}function ze(O){const I=O.texture,ie=i.get(O),we=i.get(I);O.addEventListener("dispose",Z),O.isWebGLMultipleRenderTargets!==!0&&(we.__webglTexture===void 0&&(we.__webglTexture=n.createTexture()),we.__version=I.version,o.memory.textures++);const Ee=O.isWebGLCubeRenderTarget===!0,Pe=O.isWebGLMultipleRenderTargets===!0,nt=S(O)||a;if(Ee){ie.__webglFramebuffer=[];for(let De=0;De<6;De++)ie.__webglFramebuffer[De]=n.createFramebuffer()}else{if(ie.__webglFramebuffer=n.createFramebuffer(),Pe)if(r.drawBuffers){const De=O.texture;for(let ge=0,Xe=De.length;ge<Xe;ge++){const G=i.get(De[ge]);G.__webglTexture===void 0&&(G.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(a&&O.samples>0&&je(O)===!1){const De=Pe?I:[I];ie.__webglMultisampledFramebuffer=n.createFramebuffer(),ie.__webglColorRenderbuffer=[],t.bindFramebuffer(36160,ie.__webglMultisampledFramebuffer);for(let ge=0;ge<De.length;ge++){const Xe=De[ge];ie.__webglColorRenderbuffer[ge]=n.createRenderbuffer(),n.bindRenderbuffer(36161,ie.__webglColorRenderbuffer[ge]);const G=s.convert(Xe.format,Xe.encoding),se=s.convert(Xe.type),Ae=E(Xe.internalFormat,G,se,Xe.encoding,O.isXRRenderTarget===!0),Te=Je(O);n.renderbufferStorageMultisample(36161,Te,Ae,O.width,O.height),n.framebufferRenderbuffer(36160,36064+ge,36161,ie.__webglColorRenderbuffer[ge])}n.bindRenderbuffer(36161,null),O.depthBuffer&&(ie.__webglDepthRenderbuffer=n.createRenderbuffer(),Ie(ie.__webglDepthRenderbuffer,O,!0)),t.bindFramebuffer(36160,null)}}if(Ee){t.bindTexture(34067,we.__webglTexture),$(34067,I,nt);for(let De=0;De<6;De++)Me(ie.__webglFramebuffer[De],O,I,36064,34069+De);P(I,nt)&&R(34067),t.unbindTexture()}else if(Pe){const De=O.texture;for(let ge=0,Xe=De.length;ge<Xe;ge++){const G=De[ge],se=i.get(G);t.bindTexture(3553,se.__webglTexture),$(3553,G,nt),Me(ie.__webglFramebuffer,O,G,36064+ge,3553),P(G,nt)&&R(3553)}t.unbindTexture()}else{let De=3553;(O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(a?De=O.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(De,we.__webglTexture),$(De,I,nt),Me(ie.__webglFramebuffer,O,I,36064,De),P(I,nt)&&R(De),t.unbindTexture()}O.depthBuffer&&re(O)}function Be(O){const I=S(O)||a,ie=O.isWebGLMultipleRenderTargets===!0?O.texture:[O.texture];for(let we=0,Ee=ie.length;we<Ee;we++){const Pe=ie[we];if(P(Pe,I)){const nt=O.isWebGLCubeRenderTarget?34067:3553,De=i.get(Pe).__webglTexture;t.bindTexture(nt,De),R(nt),t.unbindTexture()}}}function Ze(O){if(a&&O.samples>0&&je(O)===!1){const I=O.isWebGLMultipleRenderTargets?O.texture:[O.texture],ie=O.width,we=O.height;let Ee=16384;const Pe=[],nt=O.stencilBuffer?33306:36096,De=i.get(O),ge=O.isWebGLMultipleRenderTargets===!0;if(ge)for(let Xe=0;Xe<I.length;Xe++)t.bindFramebuffer(36160,De.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064+Xe,36161,null),t.bindFramebuffer(36160,De.__webglFramebuffer),n.framebufferTexture2D(36009,36064+Xe,3553,null,0);t.bindFramebuffer(36008,De.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,De.__webglFramebuffer);for(let Xe=0;Xe<I.length;Xe++){Pe.push(36064+Xe),O.depthBuffer&&Pe.push(nt);const G=De.__ignoreDepthValues!==void 0?De.__ignoreDepthValues:!1;if(G===!1&&(O.depthBuffer&&(Ee|=256),O.stencilBuffer&&(Ee|=1024)),ge&&n.framebufferRenderbuffer(36008,36064,36161,De.__webglColorRenderbuffer[Xe]),G===!0&&(n.invalidateFramebuffer(36008,[nt]),n.invalidateFramebuffer(36009,[nt])),ge){const se=i.get(I[Xe]).__webglTexture;n.framebufferTexture2D(36009,36064,3553,se,0)}n.blitFramebuffer(0,0,ie,we,0,0,ie,we,Ee,9728),m&&n.invalidateFramebuffer(36008,Pe)}if(t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,null),ge)for(let Xe=0;Xe<I.length;Xe++){t.bindFramebuffer(36160,De.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064+Xe,36161,De.__webglColorRenderbuffer[Xe]);const G=i.get(I[Xe]).__webglTexture;t.bindFramebuffer(36160,De.__webglFramebuffer),n.framebufferTexture2D(36009,36064+Xe,3553,G,0)}t.bindFramebuffer(36009,De.__webglMultisampledFramebuffer)}}function Je(O){return Math.min(d,O.samples)}function je(O){const I=i.get(O);return a&&O.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function vt(O){const I=o.render.frame;v.get(O)!==I&&(v.set(O,I),O.update())}function wt(O,I){const ie=O.encoding,we=O.format,Ee=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||O.format===Hm||ie!==Vs&&(ie===Ct?a===!1?e.has("EXT_sRGB")===!0&&we===Ai?(O.format=Hm,O.minFilter=en,O.generateMipmaps=!1):I=q_.sRGBToLinear(I):(we!==Ai||Ee!==Hs)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",ie)),I}this.allocateTextureUnit=N,this.resetTextureUnits=le,this.setTexture2D=j,this.setTexture2DArray=ae,this.setTexture3D=W,this.setTextureCube=ce,this.rebindTextures=Ce,this.setupRenderTarget=ze,this.updateRenderTargetMipmap=Be,this.updateMultisampleRenderTarget=Ze,this.setupDepthRenderbuffer=re,this.setupFrameBufferTexture=Me,this.useMultisampledRTT=je}function kB(n,e,t){const i=t.isWebGL2;function r(s,o=null){let a;if(s===Hs)return 5121;if(s===aB)return 32819;if(s===lB)return 32820;if(s===rB)return 5120;if(s===sB)return 5122;if(s===X_)return 5123;if(s===oB)return 5124;if(s===Mo)return 5125;if(s===Bs)return 5126;if(s===Bu)return i?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===uB)return 6406;if(s===Ai)return 6408;if(s===cB)return 6409;if(s===fB)return 6410;if(s===Do)return 6402;if(s===el)return 34041;if(s===Hm)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===hB)return 6403;if(s===dB)return 36244;if(s===pB)return 33319;if(s===mB)return 33320;if(s===gB)return 36249;if(s===rm||s===sm||s===om||s===am)if(o===Ct)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===rm)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===sm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===om)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===am)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===rm)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===sm)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===om)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===am)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Nx||s===kx||s===Ox||s===Ux)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===Nx)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===kx)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Ox)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Ux)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===yB)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===zx||s===Gx)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===zx)return o===Ct?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===Gx)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===Hx||s===Vx||s===Wx||s===jx||s===Jx||s===Xx||s===Kx||s===Yx||s===Qx||s===Zx||s===qx||s===$x||s===e1||s===t1)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===Hx)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Vx)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Wx)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===jx)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Jx)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Xx)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Kx)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Yx)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Qx)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Zx)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===qx)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===$x)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===e1)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===t1)return o===Ct?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===lm)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===lm)return o===Ct?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(s===vB||s===n1||s===i1||s===r1)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===lm)return a.COMPRESSED_RED_RGTC1_EXT;if(s===n1)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===i1)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===r1)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===Va?i?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:r}}class OB extends Gt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Ls extends Tt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const nG={type:"move"};class $y{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ls,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 Ls,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new D,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new D),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ls,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new D,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new D),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(f&&e.hand){o=!0;for(const y of e.hand.values()){const x=t.getJointPose(y,i),_=this._getHandJoint(f,y);x!==null&&(_.matrix.fromArray(x.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.jointRadius=x.radius),_.visible=x!==null}const h=f.joints["index-finger-tip"],d=f.joints["thumb-tip"],p=h.position.distanceTo(d.position),m=.02,v=.005;f.inputState.pinching&&p>m+v?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&p<=m-v&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(nG)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),f!==null&&(f.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Ls;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class UB extends Qt{constructor(e,t,i,r,s,o,a,l,f,h){if(h=h!==void 0?h:Do,h!==Do&&h!==el)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===Do&&(i=Mo),i===void 0&&h===el&&(i=Va),super(null,r,s,o,a,l,h,i,f),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:fn,this.minFilter=l!==void 0?l:fn,this.flipY=!1,this.generateMipmaps=!1}}class iG extends os{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,f=null,h=null,d=null,p=null,m=null,v=null;const y=t.getContextAttributes();let x=null,_=null;const A=[],w=[],S=new Set,b=new Map,P=new Gt;P.layers.enable(1),P.viewport=new Nt;const R=new Gt;R.layers.enable(2),R.viewport=new Nt;const E=[P,R],B=new OB;B.layers.enable(1),B.layers.enable(2);let L=null,z=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(W){let ce=A[W];return ce===void 0&&(ce=new $y,A[W]=ce),ce.getTargetRaySpace()},this.getControllerGrip=function(W){let ce=A[W];return ce===void 0&&(ce=new $y,A[W]=ce),ce.getGripSpace()},this.getHand=function(W){let ce=A[W];return ce===void 0&&(ce=new $y,A[W]=ce),ce.getHandSpace()};function Z(W){const ce=w.indexOf(W.inputSource);if(ce===-1)return;const ve=A[ce];ve!==void 0&&ve.dispatchEvent({type:W.type,data:W.inputSource})}function J(){r.removeEventListener("select",Z),r.removeEventListener("selectstart",Z),r.removeEventListener("selectend",Z),r.removeEventListener("squeeze",Z),r.removeEventListener("squeezestart",Z),r.removeEventListener("squeezeend",Z),r.removeEventListener("end",J),r.removeEventListener("inputsourceschange",H);for(let W=0;W<A.length;W++){const ce=w[W];ce!==null&&(w[W]=null,A[W].disconnect(ce))}L=null,z=null,e.setRenderTarget(x),m=null,p=null,d=null,r=null,_=null,ae.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(W){s=W,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(W){a=W,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return f||o},this.setReferenceSpace=function(W){f=W},this.getBaseLayer=function(){return p!==null?p:m},this.getBinding=function(){return d},this.getFrame=function(){return v},this.getSession=function(){return r},this.setSession=async function(W){if(r=W,r!==null){if(x=e.getRenderTarget(),r.addEventListener("select",Z),r.addEventListener("selectstart",Z),r.addEventListener("selectend",Z),r.addEventListener("squeeze",Z),r.addEventListener("squeezestart",Z),r.addEventListener("squeezeend",Z),r.addEventListener("end",J),r.addEventListener("inputsourceschange",H),y.xrCompatible!==!0&&await t.makeXRCompatible(),r.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const ce={antialias:r.renderState.layers===void 0?y.antialias:!0,alpha:y.alpha,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(r,t,ce),r.updateRenderState({baseLayer:m}),_=new Nr(m.framebufferWidth,m.framebufferHeight,{format:Ai,type:Hs,encoding:e.outputEncoding,stencilBuffer:y.stencil})}else{let ce=null,ve=null,_e=null;y.depth&&(_e=y.stencil?35056:33190,ce=y.stencil?el:Do,ve=y.stencil?Va:Mo);const $={colorFormat:32856,depthFormat:_e,scaleFactor:s};d=new XRWebGLBinding(r,t),p=d.createProjectionLayer($),r.updateRenderState({layers:[p]}),_=new Nr(p.textureWidth,p.textureHeight,{format:Ai,type:Hs,depthTexture:new UB(p.textureWidth,p.textureHeight,ve,void 0,void 0,void 0,void 0,void 0,void 0,ce),stencilBuffer:y.stencil,encoding:e.outputEncoding,samples:y.antialias?4:0});const ke=e.properties.get(_);ke.__ignoreDepthValues=p.ignoreDepthValues}_.isXRRenderTarget=!0,this.setFoveation(l),f=null,o=await r.requestReferenceSpace(a),ae.setContext(r),ae.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function H(W){for(let ce=0;ce<W.removed.length;ce++){const ve=W.removed[ce],_e=w.indexOf(ve);_e>=0&&(w[_e]=null,A[_e].disconnect(ve))}for(let ce=0;ce<W.added.length;ce++){const ve=W.added[ce];let _e=w.indexOf(ve);if(_e===-1){for(let ke=0;ke<A.length;ke++)if(ke>=w.length){w.push(ve),_e=ke;break}else if(w[ke]===null){w[ke]=ve,_e=ke;break}if(_e===-1)break}const $=A[_e];$&&$.connect(ve)}}const Y=new D,te=new D;function le(W,ce,ve){Y.setFromMatrixPosition(ce.matrixWorld),te.setFromMatrixPosition(ve.matrixWorld);const _e=Y.distanceTo(te),$=ce.projectionMatrix.elements,ke=ve.projectionMatrix.elements,Oe=$[14]/($[10]-1),He=$[14]/($[10]+1),Me=($[9]+1)/$[5],Ie=($[9]-1)/$[5],he=($[8]-1)/$[0],re=(ke[8]+1)/ke[0],Ce=Oe*he,ze=Oe*re,Be=_e/(-he+re),Ze=Be*-he;ce.matrixWorld.decompose(W.position,W.quaternion,W.scale),W.translateX(Ze),W.translateZ(Be),W.matrixWorld.compose(W.position,W.quaternion,W.scale),W.matrixWorldInverse.copy(W.matrixWorld).invert();const Je=Oe+Be,je=He+Be,vt=Ce-Ze,wt=ze+(_e-Ze),O=Me*He/je*Je,I=Ie*He/je*Je;W.projectionMatrix.makePerspective(vt,wt,O,I,Je,je)}function N(W,ce){ce===null?W.matrixWorld.copy(W.matrix):W.matrixWorld.multiplyMatrices(ce.matrixWorld,W.matrix),W.matrixWorldInverse.copy(W.matrixWorld).invert()}this.updateCamera=function(W){if(r===null)return;B.near=R.near=P.near=W.near,B.far=R.far=P.far=W.far,(L!==B.near||z!==B.far)&&(r.updateRenderState({depthNear:B.near,depthFar:B.far}),L=B.near,z=B.far);const ce=W.parent,ve=B.cameras;N(B,ce);for(let $=0;$<ve.length;$++)N(ve[$],ce);B.matrixWorld.decompose(B.position,B.quaternion,B.scale),W.matrix.copy(B.matrix),W.matrix.decompose(W.position,W.quaternion,W.scale);const _e=W.children;for(let $=0,ke=_e.length;$<ke;$++)_e[$].updateMatrixWorld(!0);ve.length===2?le(B,P,R):B.projectionMatrix.copy(P.projectionMatrix)},this.getCamera=function(){return B},this.getFoveation=function(){if(!(p===null&&m===null))return l},this.setFoveation=function(W){l=W,p!==null&&(p.fixedFoveation=W),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=W)},this.getPlanes=function(){return S};let V=null;function j(W,ce){if(h=ce.getViewerPose(f||o),v=ce,h!==null){const ve=h.views;m!==null&&(e.setRenderTargetFramebuffer(_,m.framebuffer),e.setRenderTarget(_));let _e=!1;ve.length!==B.cameras.length&&(B.cameras.length=0,_e=!0);for(let $=0;$<ve.length;$++){const ke=ve[$];let Oe=null;if(m!==null)Oe=m.getViewport(ke);else{const Me=d.getViewSubImage(p,ke);Oe=Me.viewport,$===0&&(e.setRenderTargetTextures(_,Me.colorTexture,p.ignoreDepthValues?void 0:Me.depthStencilTexture),e.setRenderTarget(_))}let He=E[$];He===void 0&&(He=new Gt,He.layers.enable($),He.viewport=new Nt,E[$]=He),He.matrix.fromArray(ke.transform.matrix),He.projectionMatrix.fromArray(ke.projectionMatrix),He.viewport.set(Oe.x,Oe.y,Oe.width,Oe.height),$===0&&B.matrix.copy(He.matrix),_e===!0&&B.cameras.push(He)}}for(let ve=0;ve<A.length;ve++){const _e=w[ve],$=A[ve];_e!==null&&$!==void 0&&$.update(_e,ce,f||o)}if(V&&V(W,ce),ce.detectedPlanes){i.dispatchEvent({type:"planesdetected",data:ce.detectedPlanes});let ve=null;for(const _e of S)ce.detectedPlanes.has(_e)||(ve===null&&(ve=[]),ve.push(_e));if(ve!==null)for(const _e of ve)S.delete(_e),b.delete(_e),i.dispatchEvent({type:"planeremoved",data:_e});for(const _e of ce.detectedPlanes)if(!S.has(_e))S.add(_e),b.set(_e,ce.lastChangedTime),i.dispatchEvent({type:"planeadded",data:_e});else{const $=b.get(_e);_e.lastChangedTime>$&&(b.set(_e,_e.lastChangedTime),i.dispatchEvent({type:"planechanged",data:_e}))}}v=null}const ae=new LB;ae.setAnimationLoop(j),this.setAnimationLoop=function(W){V=W},this.dispose=function(){}}}function rG(n,e){function t(y,x){x.color.getRGB(y.fogColor.value,BB(n)),x.isFog?(y.fogNear.value=x.near,y.fogFar.value=x.far):x.isFogExp2&&(y.fogDensity.value=x.density)}function i(y,x,_,A,w){x.isMeshBasicMaterial||x.isMeshLambertMaterial?r(y,x):x.isMeshToonMaterial?(r(y,x),h(y,x)):x.isMeshPhongMaterial?(r(y,x),f(y,x)):x.isMeshStandardMaterial?(r(y,x),d(y,x),x.isMeshPhysicalMaterial&&p(y,x,w)):x.isMeshMatcapMaterial?(r(y,x),m(y,x)):x.isMeshDepthMaterial?r(y,x):x.isMeshDistanceMaterial?(r(y,x),v(y,x)):x.isMeshNormalMaterial?r(y,x):x.isLineBasicMaterial?(s(y,x),x.isLineDashedMaterial&&o(y,x)):x.isPointsMaterial?a(y,x,_,A):x.isSpriteMaterial?l(y,x):x.isShadowMaterial?(y.color.value.copy(x.color),y.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function r(y,x){y.opacity.value=x.opacity,x.color&&y.diffuse.value.copy(x.color),x.emissive&&y.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(y.map.value=x.map),x.alphaMap&&(y.alphaMap.value=x.alphaMap),x.bumpMap&&(y.bumpMap.value=x.bumpMap,y.bumpScale.value=x.bumpScale,x.side===Ei&&(y.bumpScale.value*=-1)),x.displacementMap&&(y.displacementMap.value=x.displacementMap,y.displacementScale.value=x.displacementScale,y.displacementBias.value=x.displacementBias),x.emissiveMap&&(y.emissiveMap.value=x.emissiveMap),x.normalMap&&(y.normalMap.value=x.normalMap,y.normalScale.value.copy(x.normalScale),x.side===Ei&&y.normalScale.value.negate()),x.specularMap&&(y.specularMap.value=x.specularMap),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest);const _=e.get(x).envMap;if(_&&(y.envMap.value=_,y.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=x.reflectivity,y.ior.value=x.ior,y.refractionRatio.value=x.refractionRatio),x.lightMap){y.lightMap.value=x.lightMap;const S=n.physicallyCorrectLights!==!0?Math.PI:1;y.lightMapIntensity.value=x.lightMapIntensity*S}x.aoMap&&(y.aoMap.value=x.aoMap,y.aoMapIntensity.value=x.aoMapIntensity);let A;x.map?A=x.map:x.specularMap?A=x.specularMap:x.displacementMap?A=x.displacementMap:x.normalMap?A=x.normalMap:x.bumpMap?A=x.bumpMap:x.roughnessMap?A=x.roughnessMap:x.metalnessMap?A=x.metalnessMap:x.alphaMap?A=x.alphaMap:x.emissiveMap?A=x.emissiveMap:x.clearcoatMap?A=x.clearcoatMap:x.clearcoatNormalMap?A=x.clearcoatNormalMap:x.clearcoatRoughnessMap?A=x.clearcoatRoughnessMap:x.iridescenceMap?A=x.iridescenceMap:x.iridescenceThicknessMap?A=x.iridescenceThicknessMap:x.specularIntensityMap?A=x.specularIntensityMap:x.specularColorMap?A=x.specularColorMap:x.transmissionMap?A=x.transmissionMap:x.thicknessMap?A=x.thicknessMap:x.sheenColorMap?A=x.sheenColorMap:x.sheenRoughnessMap&&(A=x.sheenRoughnessMap),A!==void 0&&(A.isWebGLRenderTarget&&(A=A.texture),A.matrixAutoUpdate===!0&&A.updateMatrix(),y.uvTransform.value.copy(A.matrix));let w;x.aoMap?w=x.aoMap:x.lightMap&&(w=x.lightMap),w!==void 0&&(w.isWebGLRenderTarget&&(w=w.texture),w.matrixAutoUpdate===!0&&w.updateMatrix(),y.uv2Transform.value.copy(w.matrix))}function s(y,x){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity}function o(y,x){y.dashSize.value=x.dashSize,y.totalSize.value=x.dashSize+x.gapSize,y.scale.value=x.scale}function a(y,x,_,A){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.size.value=x.size*_,y.scale.value=A*.5,x.map&&(y.map.value=x.map),x.alphaMap&&(y.alphaMap.value=x.alphaMap),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest);let w;x.map?w=x.map:x.alphaMap&&(w=x.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),y.uvTransform.value.copy(w.matrix))}function l(y,x){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.rotation.value=x.rotation,x.map&&(y.map.value=x.map),x.alphaMap&&(y.alphaMap.value=x.alphaMap),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest);let _;x.map?_=x.map:x.alphaMap&&(_=x.alphaMap),_!==void 0&&(_.matrixAutoUpdate===!0&&_.updateMatrix(),y.uvTransform.value.copy(_.matrix))}function f(y,x){y.specular.value.copy(x.specular),y.shininess.value=Math.max(x.shininess,1e-4)}function h(y,x){x.gradientMap&&(y.gradientMap.value=x.gradientMap)}function d(y,x){y.roughness.value=x.roughness,y.metalness.value=x.metalness,x.roughnessMap&&(y.roughnessMap.value=x.roughnessMap),x.metalnessMap&&(y.metalnessMap.value=x.metalnessMap),e.get(x).envMap&&(y.envMapIntensity.value=x.envMapIntensity)}function p(y,x,_){y.ior.value=x.ior,x.sheen>0&&(y.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),y.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(y.sheenColorMap.value=x.sheenColorMap),x.sheenRoughnessMap&&(y.sheenRoughnessMap.value=x.sheenRoughnessMap)),x.clearcoat>0&&(y.clearcoat.value=x.clearcoat,y.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(y.clearcoatMap.value=x.clearcoatMap),x.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap),x.clearcoatNormalMap&&(y.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),y.clearcoatNormalMap.value=x.clearcoatNormalMap,x.side===Ei&&y.clearcoatNormalScale.value.negate())),x.iridescence>0&&(y.iridescence.value=x.iridescence,y.iridescenceIOR.value=x.iridescenceIOR,y.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(y.iridescenceMap.value=x.iridescenceMap),x.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=x.iridescenceThicknessMap)),x.transmission>0&&(y.transmission.value=x.transmission,y.transmissionSamplerMap.value=_.texture,y.transmissionSamplerSize.value.set(_.width,_.height),x.transmissionMap&&(y.transmissionMap.value=x.transmissionMap),y.thickness.value=x.thickness,x.thicknessMap&&(y.thicknessMap.value=x.thicknessMap),y.attenuationDistance.value=x.attenuationDistance,y.attenuationColor.value.copy(x.attenuationColor)),y.specularIntensity.value=x.specularIntensity,y.specularColor.value.copy(x.specularColor),x.specularIntensityMap&&(y.specularIntensityMap.value=x.specularIntensityMap),x.specularColorMap&&(y.specularColorMap.value=x.specularColorMap)}function m(y,x){x.matcap&&(y.matcap.value=x.matcap)}function v(y,x){y.referencePosition.value.copy(x.referencePosition),y.nearDistance.value=x.nearDistance,y.farDistance.value=x.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:i}}function sG(n,e,t,i){let r={},s={},o=[];const a=t.isWebGL2?n.getParameter(35375):0;function l(A,w){const S=w.program;i.uniformBlockBinding(A,S)}function f(A,w){let S=r[A.id];S===void 0&&(v(A),S=h(A),r[A.id]=S,A.addEventListener("dispose",x));const b=w.program;i.updateUBOMapping(A,b);const P=e.render.frame;s[A.id]!==P&&(p(A),s[A.id]=P)}function h(A){const w=d();A.__bindingPointIndex=w;const S=n.createBuffer(),b=A.__size,P=A.usage;return n.bindBuffer(35345,S),n.bufferData(35345,b,P),n.bindBuffer(35345,null),n.bindBufferBase(35345,w,S),S}function d(){for(let A=0;A<a;A++)if(o.indexOf(A)===-1)return o.push(A),A;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(A){const w=r[A.id],S=A.uniforms,b=A.__cache;n.bindBuffer(35345,w);for(let P=0,R=S.length;P<R;P++){const E=S[P];if(m(E,P,b)===!0){const B=E.__offset,L=Array.isArray(E.value)?E.value:[E.value];let z=0;for(let Z=0;Z<L.length;Z++){const J=L[Z],H=y(J);typeof J=="number"?(E.__data[0]=J,n.bufferSubData(35345,B+z,E.__data)):J.isMatrix3?(E.__data[0]=J.elements[0],E.__data[1]=J.elements[1],E.__data[2]=J.elements[2],E.__data[3]=J.elements[0],E.__data[4]=J.elements[3],E.__data[5]=J.elements[4],E.__data[6]=J.elements[5],E.__data[7]=J.elements[0],E.__data[8]=J.elements[6],E.__data[9]=J.elements[7],E.__data[10]=J.elements[8],E.__data[11]=J.elements[0]):(J.toArray(E.__data,z),z+=H.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(35345,B,E.__data)}}n.bindBuffer(35345,null)}function m(A,w,S){const b=A.value;if(S[w]===void 0){if(typeof b=="number")S[w]=b;else{const P=Array.isArray(b)?b:[b],R=[];for(let E=0;E<P.length;E++)R.push(P[E].clone());S[w]=R}return!0}else if(typeof b=="number"){if(S[w]!==b)return S[w]=b,!0}else{const P=Array.isArray(S[w])?S[w]:[S[w]],R=Array.isArray(b)?b:[b];for(let E=0;E<P.length;E++){const B=P[E];if(B.equals(R[E])===!1)return B.copy(R[E]),!0}}return!1}function v(A){const w=A.uniforms;let S=0;const b=16;let P=0;for(let R=0,E=w.length;R<E;R++){const B=w[R],L={boundary:0,storage:0},z=Array.isArray(B.value)?B.value:[B.value];for(let Z=0,J=z.length;Z<J;Z++){const H=z[Z],Y=y(H);L.boundary+=Y.boundary,L.storage+=Y.storage}if(B.__data=new Float32Array(L.storage/Float32Array.BYTES_PER_ELEMENT),B.__offset=S,R>0){P=S%b;const Z=b-P;P!==0&&Z-L.boundary<0&&(S+=b-P,B.__offset=S)}S+=L.storage}return P=S%b,P>0&&(S+=b-P),A.__size=S,A.__cache={},this}function y(A){const w={boundary:0,storage:0};return typeof A=="number"?(w.boundary=4,w.storage=4):A.isVector2?(w.boundary=8,w.storage=8):A.isVector3||A.isColor?(w.boundary=16,w.storage=12):A.isVector4?(w.boundary=16,w.storage=16):A.isMatrix3?(w.boundary=48,w.storage=48):A.isMatrix4?(w.boundary=64,w.storage=64):A.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",A),w}function x(A){const w=A.target;w.removeEventListener("dispose",x);const S=o.indexOf(w.__bindingPointIndex);o.splice(S,1),n.deleteBuffer(r[w.id]),delete r[w.id],delete s[w.id]}function _(){for(const A in r)n.deleteBuffer(r[A]);o=[],r={},s={}}return{bind:l,update:f,dispose:_}}function oG(){const n=Xf("canvas");return n.style.display="block",n}function aA(n={}){this.isWebGLRenderer=!0;const e=n.canvas!==void 0?n.canvas:oG(),t=n.context!==void 0?n.context:null,i=n.depth!==void 0?n.depth:!0,r=n.stencil!==void 0?n.stencil:!0,s=n.antialias!==void 0?n.antialias:!1,o=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,a=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,l=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let h;t!==null?h=t.getContextAttributes().alpha:h=n.alpha!==void 0?n.alpha:!1;let d=null,p=null;const m=[],v=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Vs,this.physicallyCorrectLights=!1,this.toneMapping=Ir,this.toneMappingExposure=1;const y=this;let x=!1,_=0,A=0,w=null,S=-1,b=null;const P=new Nt,R=new Nt;let E=null,B=e.width,L=e.height,z=1,Z=null,J=null;const H=new Nt(0,0,B,L),Y=new Nt(0,0,B,L);let te=!1;const le=new bg;let N=!1,V=!1,j=null;const ae=new rt,W=new me,ce=new D,ve={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function _e(){return w===null?z:1}let $=t;function ke(F,ee){for(let de=0;de<F.length;de++){const q=F[de],ye=e.getContext(q,ee);if(ye!==null)return ye}return null}try{const F={alpha:!0,depth:i,stencil:r,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:a,powerPreference:l,failIfMajorPerformanceCaveat:f};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Ag}`),e.addEventListener("webglcontextlost",Ae,!1),e.addEventListener("webglcontextrestored",Te,!1),e.addEventListener("webglcontextcreationerror",$e,!1),$===null){const ee=["webgl2","webgl","experimental-webgl"];if(y.isWebGL1Renderer===!0&&ee.shift(),$=ke(ee,F),$===null)throw ke(ee)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}$.getShaderPrecisionFormat===void 0&&($.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(F){throw console.error("THREE.WebGLRenderer: "+F.message),F}let Oe,He,Me,Ie,he,re,Ce,ze,Be,Ze,Je,je,vt,wt,O,I,ie,we,Ee,Pe,nt,De,ge,Xe;function G(){Oe=new Mz($),He=new gz($,Oe,n),Oe.init(He),De=new kB($,Oe,He),Me=new eG($,Oe,He),Ie=new Cz,he=new H4,re=new tG($,Oe,Me,he,He,De,Ie),Ce=new vz(y),ze=new Az(y),Be=new Dk($,He),ge=new pz($,Oe,Be,He),Ze=new wz($,Be,Ie,ge),Je=new Pz($,Ze,Be,Ie),Ee=new Tz($,He,re),I=new yz(he),je=new G4(y,Ce,ze,Oe,He,ge,I),vt=new rG(y,he),wt=new W4,O=new Q4(Oe,He),we=new dz(y,Ce,ze,Me,Je,h,o),ie=new $4(y,Je,He),Xe=new sG($,Ie,He,Me),Pe=new mz($,Oe,Ie,He),nt=new Sz($,Oe,Ie,He),Ie.programs=je.programs,y.capabilities=He,y.extensions=Oe,y.properties=he,y.renderLists=wt,y.shadowMap=ie,y.state=Me,y.info=Ie}G();const se=new iG(y,$);this.xr=se,this.getContext=function(){return $},this.getContextAttributes=function(){return $.getContextAttributes()},this.forceContextLoss=function(){const F=Oe.get("WEBGL_lose_context");F&&F.loseContext()},this.forceContextRestore=function(){const F=Oe.get("WEBGL_lose_context");F&&F.restoreContext()},this.getPixelRatio=function(){return z},this.setPixelRatio=function(F){F!==void 0&&(z=F,this.setSize(B,L,!1))},this.getSize=function(F){return F.set(B,L)},this.setSize=function(F,ee,de){if(se.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}B=F,L=ee,e.width=Math.floor(F*z),e.height=Math.floor(ee*z),de!==!1&&(e.style.width=F+"px",e.style.height=ee+"px"),this.setViewport(0,0,F,ee)},this.getDrawingBufferSize=function(F){return F.set(B*z,L*z).floor()},this.setDrawingBufferSize=function(F,ee,de){B=F,L=ee,z=de,e.width=Math.floor(F*de),e.height=Math.floor(ee*de),this.setViewport(0,0,F,ee)},this.getCurrentViewport=function(F){return F.copy(P)},this.getViewport=function(F){return F.copy(H)},this.setViewport=function(F,ee,de,q){F.isVector4?H.set(F.x,F.y,F.z,F.w):H.set(F,ee,de,q),Me.viewport(P.copy(H).multiplyScalar(z).floor())},this.getScissor=function(F){return F.copy(Y)},this.setScissor=function(F,ee,de,q){F.isVector4?Y.set(F.x,F.y,F.z,F.w):Y.set(F,ee,de,q),Me.scissor(R.copy(Y).multiplyScalar(z).floor())},this.getScissorTest=function(){return te},this.setScissorTest=function(F){Me.setScissorTest(te=F)},this.setOpaqueSort=function(F){Z=F},this.setTransparentSort=function(F){J=F},this.getClearColor=function(F){return F.copy(we.getClearColor())},this.setClearColor=function(){we.setClearColor.apply(we,arguments)},this.getClearAlpha=function(){return we.getClearAlpha()},this.setClearAlpha=function(){we.setClearAlpha.apply(we,arguments)},this.clear=function(F=!0,ee=!0,de=!0){let q=0;F&&(q|=16384),ee&&(q|=256),de&&(q|=1024),$.clear(q)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Ae,!1),e.removeEventListener("webglcontextrestored",Te,!1),e.removeEventListener("webglcontextcreationerror",$e,!1),wt.dispose(),O.dispose(),he.dispose(),Ce.dispose(),ze.dispose(),Je.dispose(),ge.dispose(),Xe.dispose(),je.dispose(),se.dispose(),se.removeEventListener("sessionstart",Ue),se.removeEventListener("sessionend",Ye),j&&(j.dispose(),j=null),Pt.stop()};function Ae(F){F.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function Te(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;const F=Ie.autoReset,ee=ie.enabled,de=ie.autoUpdate,q=ie.needsUpdate,ye=ie.type;G(),Ie.autoReset=F,ie.enabled=ee,ie.autoUpdate=de,ie.needsUpdate=q,ie.type=ye}function $e(F){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",F.statusMessage)}function yt(F){const ee=F.target;ee.removeEventListener("dispose",yt),Vt(ee)}function Vt(F){K(F),he.remove(F)}function K(F){const ee=he.get(F).programs;ee!==void 0&&(ee.forEach(function(de){je.releaseProgram(de)}),F.isShaderMaterial&&je.releaseShaderCache(F))}this.renderBufferDirect=function(F,ee,de,q,ye,qe){ee===null&&(ee=ve);const st=ye.isMesh&&ye.matrixWorld.determinant()<0,ft=Zg(F,ee,de,q,ye);Me.setMaterial(q,st);let mt=de.index,St=1;q.wireframe===!0&&(mt=Ze.getWireframeAttribute(de),St=2);const _t=de.drawRange,At=de.attributes.position;let on=_t.start*St,ni=(_t.start+_t.count)*St;qe!==null&&(on=Math.max(on,qe.start*St),ni=Math.min(ni,(qe.start+qe.count)*St)),mt!==null?(on=Math.max(on,0),ni=Math.min(ni,mt.count)):At!=null&&(on=Math.max(on,0),ni=Math.min(ni,At.count));const yr=ni-on;if(yr<0||yr===1/0)return;ge.setup(ye,q,ft,de,mt);let as,Jt=Pe;if(mt!==null&&(as=Be.get(mt),Jt=nt,Jt.setIndex(as)),ye.isMesh)q.wireframe===!0?(Me.setLineWidth(q.wireframeLinewidth*_e()),Jt.setMode(1)):Jt.setMode(4);else if(ye.isLine){let ht=q.linewidth;ht===void 0&&(ht=1),Me.setLineWidth(ht*_e()),ye.isLineSegments?Jt.setMode(1):ye.isLineLoop?Jt.setMode(2):Jt.setMode(3)}else ye.isPoints?Jt.setMode(0):ye.isSprite&&Jt.setMode(4);if(ye.isInstancedMesh)Jt.renderInstances(on,yr,ye.count);else if(de.isInstancedBufferGeometry){const ht=de._maxInstanceCount!==void 0?de._maxInstanceCount:1/0,ea=Math.min(de.instanceCount,ht);Jt.renderInstances(on,yr,ea)}else Jt.render(on,yr)},this.compile=function(F,ee){function de(q,ye,qe){q.transparent===!0&&q.side===Br&&q.forceSinglePass===!1?(q.side=Ei,q.needsUpdate=!0,mi(q,ye,qe),q.side=is,q.needsUpdate=!0,mi(q,ye,qe),q.side=Br):mi(q,ye,qe)}p=O.get(F),p.init(),v.push(p),F.traverseVisible(function(q){q.isLight&&q.layers.test(ee.layers)&&(p.pushLight(q),q.castShadow&&p.pushShadow(q))}),p.setupLights(y.physicallyCorrectLights),F.traverse(function(q){const ye=q.material;if(ye)if(Array.isArray(ye))for(let qe=0;qe<ye.length;qe++){const st=ye[qe];de(st,F,q)}else de(ye,F,q)}),v.pop(),p=null};let ue=null;function xe(F){ue&&ue(F)}function Ue(){Pt.stop()}function Ye(){Pt.start()}const Pt=new LB;Pt.setAnimationLoop(xe),typeof self<"u"&&Pt.setContext(self),this.setAnimationLoop=function(F){ue=F,se.setAnimationLoop(F),F===null?Pt.stop():Pt.start()},se.addEventListener("sessionstart",Ue),se.addEventListener("sessionend",Ye),this.render=function(F,ee){if(ee!==void 0&&ee.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),ee.parent===null&&ee.matrixWorldAutoUpdate===!0&&ee.updateMatrixWorld(),se.enabled===!0&&se.isPresenting===!0&&(se.cameraAutoUpdate===!0&&se.updateCamera(ee),ee=se.getCamera()),F.isScene===!0&&F.onBeforeRender(y,F,ee,w),p=O.get(F,v.length),p.init(),v.push(p),ae.multiplyMatrices(ee.projectionMatrix,ee.matrixWorldInverse),le.setFromProjectionMatrix(ae),V=this.localClippingEnabled,N=I.init(this.clippingPlanes,V),d=wt.get(F,m.length),d.init(),m.push(d),hn(F,ee,0,y.sortObjects),d.finish(),y.sortObjects===!0&&d.sort(Z,J),N===!0&&I.beginShadows();const de=p.state.shadowsArray;if(ie.render(de,F,ee),N===!0&&I.endShadows(),this.info.autoReset===!0&&this.info.reset(),we.render(d,F),p.setupLights(y.physicallyCorrectLights),ee.isArrayCamera){const q=ee.cameras;for(let ye=0,qe=q.length;ye<qe;ye++){const st=q[ye];Bn(d,F,st,st.viewport)}}else Bn(d,F,ee);w!==null&&(re.updateMultisampleRenderTarget(w),re.updateRenderTargetMipmap(w)),F.isScene===!0&&F.onAfterRender(y,F,ee),ge.resetDefaultState(),S=-1,b=null,v.pop(),v.length>0?p=v[v.length-1]:p=null,m.pop(),m.length>0?d=m[m.length-1]:d=null};function hn(F,ee,de,q){if(F.visible===!1)return;if(F.layers.test(ee.layers)){if(F.isGroup)de=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(ee);else if(F.isLight)p.pushLight(F),F.castShadow&&p.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||le.intersectsSprite(F)){q&&ce.setFromMatrixPosition(F.matrixWorld).applyMatrix4(ae);const st=Je.update(F),ft=F.material;ft.visible&&d.push(F,st,ft,de,ce.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(F.isSkinnedMesh&&F.skeleton.frame!==Ie.render.frame&&(F.skeleton.update(),F.skeleton.frame=Ie.render.frame),!F.frustumCulled||le.intersectsObject(F))){q&&ce.setFromMatrixPosition(F.matrixWorld).applyMatrix4(ae);const st=Je.update(F),ft=F.material;if(Array.isArray(ft)){const mt=st.groups;for(let St=0,_t=mt.length;St<_t;St++){const At=mt[St],on=ft[At.materialIndex];on&&on.visible&&d.push(F,st,on,de,ce.z,At)}}else ft.visible&&d.push(F,st,ft,de,ce.z,null)}}const qe=F.children;for(let st=0,ft=qe.length;st<ft;st++)hn(qe[st],ee,de,q)}function Bn(F,ee,de,q){const ye=F.opaque,qe=F.transmissive,st=F.transparent;p.setupLightsView(de),N===!0&&I.setGlobalState(y.clippingPlanes,de),qe.length>0&&zr(ye,ee,de),q&&Me.viewport(P.copy(q)),ye.length>0&&Ot(ye,ee,de),qe.length>0&&Ot(qe,ee,de),st.length>0&&Ot(st,ee,de),Me.buffers.depth.setTest(!0),Me.buffers.depth.setMask(!0),Me.buffers.color.setMask(!0),Me.setPolygonOffset(!1)}function zr(F,ee,de){const q=He.isWebGL2;j===null&&(j=new Nr(1,1,{generateMipmaps:!0,type:Oe.has("EXT_color_buffer_half_float")?Bu:Hs,minFilter:rs,samples:q&&s===!0?4:0})),y.getDrawingBufferSize(W),q?j.setSize(W.x,W.y):j.setSize(Vm(W.x),Vm(W.y));const ye=y.getRenderTarget();y.setRenderTarget(j),y.clear();const qe=y.toneMapping;y.toneMapping=Ir,Ot(F,ee,de),y.toneMapping=qe,re.updateMultisampleRenderTarget(j),re.updateRenderTargetMipmap(j),y.setRenderTarget(ye)}function Ot(F,ee,de){const q=ee.isScene===!0?ee.overrideMaterial:null;for(let ye=0,qe=F.length;ye<qe;ye++){const st=F[ye],ft=st.object,mt=st.geometry,St=q===null?st.material:q,_t=st.group;ft.layers.test(de.layers)&&Ji(ft,ee,de,mt,St,_t)}}function Ji(F,ee,de,q,ye,qe){F.onBeforeRender(y,ee,de,q,ye,qe),F.modelViewMatrix.multiplyMatrices(de.matrixWorldInverse,F.matrixWorld),F.normalMatrix.getNormalMatrix(F.modelViewMatrix),ye.onBeforeRender(y,ee,de,q,F,qe),ye.transparent===!0&&ye.side===Br&&ye.forceSinglePass===!1?(ye.side=Ei,ye.needsUpdate=!0,y.renderBufferDirect(de,ee,q,ye,F,qe),ye.side=is,ye.needsUpdate=!0,y.renderBufferDirect(de,ee,q,ye,F,qe),ye.side=Br):y.renderBufferDirect(de,ee,q,ye,F,qe),F.onAfterRender(y,ee,de,q,ye,qe)}function mi(F,ee,de){ee.isScene!==!0&&(ee=ve);const q=he.get(F),ye=p.state.lights,qe=p.state.shadowsArray,st=ye.state.version,ft=je.getParameters(F,ye.state,qe,ee,de),mt=je.getProgramCacheKey(ft);let St=q.programs;q.environment=F.isMeshStandardMaterial?ee.environment:null,q.fog=ee.fog,q.envMap=(F.isMeshStandardMaterial?ze:Ce).get(F.envMap||q.environment),St===void 0&&(F.addEventListener("dispose",yt),St=new Map,q.programs=St);let _t=St.get(mt);if(_t!==void 0){if(q.currentProgram===_t&&q.lightsStateVersion===st)return Uh(F,ft),_t}else ft.uniforms=je.getUniforms(F),F.onBuild(de,ft,y),F.onBeforeCompile(ft,y),_t=je.acquireProgram(ft,mt),St.set(mt,_t),q.uniforms=ft.uniforms;const At=q.uniforms;(!F.isShaderMaterial&&!F.isRawShaderMaterial||F.clipping===!0)&&(At.clippingPlanes=I.uniform),Uh(F,ft),q.needsLights=ec(F),q.lightsStateVersion=st,q.needsLights&&(At.ambientLightColor.value=ye.state.ambient,At.lightProbe.value=ye.state.probe,At.directionalLights.value=ye.state.directional,At.directionalLightShadows.value=ye.state.directionalShadow,At.spotLights.value=ye.state.spot,At.spotLightShadows.value=ye.state.spotShadow,At.rectAreaLights.value=ye.state.rectArea,At.ltc_1.value=ye.state.rectAreaLTC1,At.ltc_2.value=ye.state.rectAreaLTC2,At.pointLights.value=ye.state.point,At.pointLightShadows.value=ye.state.pointShadow,At.hemisphereLights.value=ye.state.hemi,At.directionalShadowMap.value=ye.state.directionalShadowMap,At.directionalShadowMatrix.value=ye.state.directionalShadowMatrix,At.spotShadowMap.value=ye.state.spotShadowMap,At.spotLightMatrix.value=ye.state.spotLightMatrix,At.spotLightMap.value=ye.state.spotLightMap,At.pointShadowMap.value=ye.state.pointShadowMap,At.pointShadowMatrix.value=ye.state.pointShadowMatrix);const on=_t.getUniforms(),ni=hm.seqWithValue(on.seq,At);return q.currentProgram=_t,q.uniformsList=ni,_t}function Uh(F,ee){const de=he.get(F);de.outputEncoding=ee.outputEncoding,de.instancing=ee.instancing,de.skinning=ee.skinning,de.morphTargets=ee.morphTargets,de.morphNormals=ee.morphNormals,de.morphColors=ee.morphColors,de.morphTargetsCount=ee.morphTargetsCount,de.numClippingPlanes=ee.numClippingPlanes,de.numIntersection=ee.numClipIntersection,de.vertexAlphas=ee.vertexAlphas,de.vertexTangents=ee.vertexTangents,de.toneMapping=ee.toneMapping}function Zg(F,ee,de,q,ye){ee.isScene!==!0&&(ee=ve),re.resetTextureUnits();const qe=ee.fog,st=q.isMeshStandardMaterial?ee.environment:null,ft=w===null?y.outputEncoding:w.isXRRenderTarget===!0?w.texture.encoding:Vs,mt=(q.isMeshStandardMaterial?ze:Ce).get(q.envMap||st),St=q.vertexColors===!0&&!!de.attributes.color&&de.attributes.color.itemSize===4,_t=!!q.normalMap&&!!de.attributes.tangent,At=!!de.morphAttributes.position,on=!!de.morphAttributes.normal,ni=!!de.morphAttributes.color,yr=q.toneMapped?y.toneMapping:Ir,as=de.morphAttributes.position||de.morphAttributes.normal||de.morphAttributes.color,Jt=as!==void 0?as.length:0,ht=he.get(q),ea=p.state.lights;if(N===!0&&(V===!0||F!==b)){const Ft=F===b&&q.id===S;I.setState(q,F,Ft)}let an=!1;q.version===ht.__version?(ht.needsLights&&ht.lightsStateVersion!==ea.state.version||ht.outputEncoding!==ft||ye.isInstancedMesh&&ht.instancing===!1||!ye.isInstancedMesh&&ht.instancing===!0||ye.isSkinnedMesh&&ht.skinning===!1||!ye.isSkinnedMesh&&ht.skinning===!0||ht.envMap!==mt||q.fog===!0&&ht.fog!==qe||ht.numClippingPlanes!==void 0&&(ht.numClippingPlanes!==I.numPlanes||ht.numIntersection!==I.numIntersection)||ht.vertexAlphas!==St||ht.vertexTangents!==_t||ht.morphTargets!==At||ht.morphNormals!==on||ht.morphColors!==ni||ht.toneMapping!==yr||He.isWebGL2===!0&&ht.morphTargetsCount!==Jt)&&(an=!0):(an=!0,ht.__version=q.version);let ls=ht.currentProgram;an===!0&&(ls=mi(q,ee,ye));let dl=!1,Xi=!1,Ki=!1;const ct=ls.getUniforms(),Et=ht.uniforms;if(Me.useProgram(ls.program)&&(dl=!0,Xi=!0,Ki=!0),q.id!==S&&(S=q.id,Xi=!0),dl||b!==F){if(ct.setValue($,"projectionMatrix",F.projectionMatrix),He.logarithmicDepthBuffer&&ct.setValue($,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),b!==F&&(b=F,Xi=!0,Ki=!0),q.isShaderMaterial||q.isMeshPhongMaterial||q.isMeshToonMaterial||q.isMeshStandardMaterial||q.envMap){const Ft=ct.map.cameraPosition;Ft!==void 0&&Ft.setValue($,ce.setFromMatrixPosition(F.matrixWorld))}(q.isMeshPhongMaterial||q.isMeshToonMaterial||q.isMeshLambertMaterial||q.isMeshBasicMaterial||q.isMeshStandardMaterial||q.isShaderMaterial)&&ct.setValue($,"isOrthographic",F.isOrthographicCamera===!0),(q.isMeshPhongMaterial||q.isMeshToonMaterial||q.isMeshLambertMaterial||q.isMeshBasicMaterial||q.isMeshStandardMaterial||q.isShaderMaterial||q.isShadowMaterial||ye.isSkinnedMesh)&&ct.setValue($,"viewMatrix",F.matrixWorldInverse)}if(ye.isSkinnedMesh){ct.setOptional($,ye,"bindMatrix"),ct.setOptional($,ye,"bindMatrixInverse");const Ft=ye.skeleton;Ft&&(He.floatVertexTextures?(Ft.boneTexture===null&&Ft.computeBoneTexture(),ct.setValue($,"boneTexture",Ft.boneTexture,re),ct.setValue($,"boneTextureSize",Ft.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const Yi=de.morphAttributes;if((Yi.position!==void 0||Yi.normal!==void 0||Yi.color!==void 0&&He.isWebGL2===!0)&&Ee.update(ye,de,q,ls),(Xi||ht.receiveShadow!==ye.receiveShadow)&&(ht.receiveShadow=ye.receiveShadow,ct.setValue($,"receiveShadow",ye.receiveShadow)),q.isMeshGouraudMaterial&&q.envMap!==null&&(Et.envMap.value=mt,Et.flipEnvMap.value=mt.isCubeTexture&&mt.isRenderTargetTexture===!1?-1:1),Xi&&(ct.setValue($,"toneMappingExposure",y.toneMappingExposure),ht.needsLights&&zh(Et,Ki),qe&&q.fog===!0&&vt.refreshFogUniforms(Et,qe),vt.refreshMaterialUniforms(Et,q,z,L,j),hm.upload($,ht.uniformsList,Et,re)),q.isShaderMaterial&&q.uniformsNeedUpdate===!0&&(hm.upload($,ht.uniformsList,Et,re),q.uniformsNeedUpdate=!1),q.isSpriteMaterial&&ct.setValue($,"center",ye.center),ct.setValue($,"modelViewMatrix",ye.modelViewMatrix),ct.setValue($,"normalMatrix",ye.normalMatrix),ct.setValue($,"modelMatrix",ye.matrixWorld),q.isShaderMaterial||q.isRawShaderMaterial){const Ft=q.uniformsGroups;for(let Rn=0,us=Ft.length;Rn<us;Rn++)if(He.isWebGL2){const cs=Ft[Rn];Xe.update(cs,ls),Xe.bind(cs,ls)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return ls}function zh(F,ee){F.ambientLightColor.needsUpdate=ee,F.lightProbe.needsUpdate=ee,F.directionalLights.needsUpdate=ee,F.directionalLightShadows.needsUpdate=ee,F.pointLights.needsUpdate=ee,F.pointLightShadows.needsUpdate=ee,F.spotLights.needsUpdate=ee,F.spotLightShadows.needsUpdate=ee,F.rectAreaLights.needsUpdate=ee,F.hemisphereLights.needsUpdate=ee}function ec(F){return F.isMeshLambertMaterial||F.isMeshToonMaterial||F.isMeshPhongMaterial||F.isMeshStandardMaterial||F.isShadowMaterial||F.isShaderMaterial&&F.lights===!0}this.getActiveCubeFace=function(){return _},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(F,ee,de){he.get(F.texture).__webglTexture=ee,he.get(F.depthTexture).__webglTexture=de;const q=he.get(F);q.__hasExternalTextures=!0,q.__hasExternalTextures&&(q.__autoAllocateDepthBuffer=de===void 0,q.__autoAllocateDepthBuffer||Oe.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),q.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(F,ee){const de=he.get(F);de.__webglFramebuffer=ee,de.__useDefaultFramebuffer=ee===void 0},this.setRenderTarget=function(F,ee=0,de=0){w=F,_=ee,A=de;let q=!0,ye=null,qe=!1,st=!1;if(F){const mt=he.get(F);mt.__useDefaultFramebuffer!==void 0?(Me.bindFramebuffer(36160,null),q=!1):mt.__webglFramebuffer===void 0?re.setupRenderTarget(F):mt.__hasExternalTextures&&re.rebindTextures(F,he.get(F.texture).__webglTexture,he.get(F.depthTexture).__webglTexture);const St=F.texture;(St.isData3DTexture||St.isDataArrayTexture||St.isCompressedArrayTexture)&&(st=!0);const _t=he.get(F).__webglFramebuffer;F.isWebGLCubeRenderTarget?(ye=_t[ee],qe=!0):He.isWebGL2&&F.samples>0&&re.useMultisampledRTT(F)===!1?ye=he.get(F).__webglMultisampledFramebuffer:ye=_t,P.copy(F.viewport),R.copy(F.scissor),E=F.scissorTest}else P.copy(H).multiplyScalar(z).floor(),R.copy(Y).multiplyScalar(z).floor(),E=te;if(Me.bindFramebuffer(36160,ye)&&He.drawBuffers&&q&&Me.drawBuffers(F,ye),Me.viewport(P),Me.scissor(R),Me.setScissorTest(E),qe){const mt=he.get(F.texture);$.framebufferTexture2D(36160,36064,34069+ee,mt.__webglTexture,de)}else if(st){const mt=he.get(F.texture),St=ee||0;$.framebufferTextureLayer(36160,36064,mt.__webglTexture,de||0,St)}S=-1},this.readRenderTargetPixels=function(F,ee,de,q,ye,qe,st){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ft=he.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&st!==void 0&&(ft=ft[st]),ft){Me.bindFramebuffer(36160,ft);try{const mt=F.texture,St=mt.format,_t=mt.type;if(St!==Ai&&De.convert(St)!==$.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const At=_t===Bu&&(Oe.has("EXT_color_buffer_half_float")||He.isWebGL2&&Oe.has("EXT_color_buffer_float"));if(_t!==Hs&&De.convert(_t)!==$.getParameter(35738)&&!(_t===Bs&&(He.isWebGL2||Oe.has("OES_texture_float")||Oe.has("WEBGL_color_buffer_float")))&&!At){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ee>=0&&ee<=F.width-q&&de>=0&&de<=F.height-ye&&$.readPixels(ee,de,q,ye,De.convert(St),De.convert(_t),qe)}finally{const mt=w!==null?he.get(w).__webglFramebuffer:null;Me.bindFramebuffer(36160,mt)}}},this.copyFramebufferToTexture=function(F,ee,de=0){const q=Math.pow(2,-de),ye=Math.floor(ee.image.width*q),qe=Math.floor(ee.image.height*q);re.setTexture2D(ee,0),$.copyTexSubImage2D(3553,de,0,0,F.x,F.y,ye,qe),Me.unbindTexture()},this.copyTextureToTexture=function(F,ee,de,q=0){const ye=ee.image.width,qe=ee.image.height,st=De.convert(de.format),ft=De.convert(de.type);re.setTexture2D(de,0),$.pixelStorei(37440,de.flipY),$.pixelStorei(37441,de.premultiplyAlpha),$.pixelStorei(3317,de.unpackAlignment),ee.isDataTexture?$.texSubImage2D(3553,q,F.x,F.y,ye,qe,st,ft,ee.image.data):ee.isCompressedTexture?$.compressedTexSubImage2D(3553,q,F.x,F.y,ee.mipmaps[0].width,ee.mipmaps[0].height,st,ee.mipmaps[0].data):$.texSubImage2D(3553,q,F.x,F.y,st,ft,ee.image),q===0&&de.generateMipmaps&&$.generateMipmap(3553),Me.unbindTexture()},this.copyTextureToTexture3D=function(F,ee,de,q,ye=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const qe=F.max.x-F.min.x+1,st=F.max.y-F.min.y+1,ft=F.max.z-F.min.z+1,mt=De.convert(q.format),St=De.convert(q.type);let _t;if(q.isData3DTexture)re.setTexture3D(q,0),_t=32879;else if(q.isDataArrayTexture)re.setTexture2DArray(q,0),_t=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}$.pixelStorei(37440,q.flipY),$.pixelStorei(37441,q.premultiplyAlpha),$.pixelStorei(3317,q.unpackAlignment);const At=$.getParameter(3314),on=$.getParameter(32878),ni=$.getParameter(3316),yr=$.getParameter(3315),as=$.getParameter(32877),Jt=de.isCompressedTexture?de.mipmaps[0]:de.image;$.pixelStorei(3314,Jt.width),$.pixelStorei(32878,Jt.height),$.pixelStorei(3316,F.min.x),$.pixelStorei(3315,F.min.y),$.pixelStorei(32877,F.min.z),de.isDataTexture||de.isData3DTexture?$.texSubImage3D(_t,ye,ee.x,ee.y,ee.z,qe,st,ft,mt,St,Jt.data):de.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),$.compressedTexSubImage3D(_t,ye,ee.x,ee.y,ee.z,qe,st,ft,mt,Jt.data)):$.texSubImage3D(_t,ye,ee.x,ee.y,ee.z,qe,st,ft,mt,St,Jt),$.pixelStorei(3314,At),$.pixelStorei(32878,on),$.pixelStorei(3316,ni),$.pixelStorei(3315,yr),$.pixelStorei(32877,as),ye===0&&q.generateMipmaps&&$.generateMipmap(_t),Me.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?re.setTextureCube(F,0):F.isData3DTexture?re.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?re.setTexture2DArray(F,0):re.setTexture2D(F,0),Me.unbindTexture()},this.resetState=function(){_=0,A=0,w=null,Me.reset(),ge.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class zB extends aA{}zB.prototype.isWebGL1Renderer=!0;class Pg{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Le(e),this.density=t}clone(){return new Pg(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Bg{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Le(e),this.near=t,this.far=i}clone(){return new Bg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class lA extends Tt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class yh{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=jf,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ui()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ui()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ui()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const si=new D;class Go{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)si.fromBufferAttribute(this,t),si.applyMatrix4(e),this.setXYZ(t,si.x,si.y,si.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)si.fromBufferAttribute(this,t),si.applyNormalMatrix(e),this.setXYZ(t,si.x,si.y,si.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)si.fromBufferAttribute(this,t),si.transformDirection(e),this.setXYZ(t,si.x,si.y,si.z);return this}setX(e,t){return this.normalized&&(t=zt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=zt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=zt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=zt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Rs(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Rs(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Rs(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Rs(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=zt(t,this.array),i=zt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=zt(t,this.array),i=zt(i,this.array),r=zt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=zt(t,this.array),i=zt(i,this.array),r=zt(r,this.array),s=zt(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new Dt(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Go(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class uA extends Mn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Le(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Gl;const Fc=new D,Hl=new D,Vl=new D,Wl=new me,Nc=new me,GB=new rt,gp=new D,kc=new D,yp=new D,WC=new me,ev=new me,jC=new me;class HB extends Tt{constructor(e){if(super(),this.isSprite=!0,this.type="Sprite",Gl===void 0){Gl=new ut;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new yh(t,5);Gl.setIndex([0,1,2,0,2,3]),Gl.setAttribute("position",new Go(i,3,0,!1)),Gl.setAttribute("uv",new Go(i,2,3,!1))}this.geometry=Gl,this.material=e!==void 0?e:new uA,this.center=new me(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Hl.setFromMatrixScale(this.matrixWorld),GB.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Vl.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Hl.multiplyScalar(-Vl.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;vp(gp.set(-.5,-.5,0),Vl,o,Hl,r,s),vp(kc.set(.5,-.5,0),Vl,o,Hl,r,s),vp(yp.set(.5,.5,0),Vl,o,Hl,r,s),WC.set(0,0),ev.set(1,0),jC.set(1,1);let a=e.ray.intersectTriangle(gp,kc,yp,!1,Fc);if(a===null&&(vp(kc.set(-.5,.5,0),Vl,o,Hl,r,s),ev.set(0,1),a=e.ray.intersectTriangle(gp,yp,kc,!1,Fc),a===null))return;const l=e.ray.origin.distanceTo(Fc);l<e.near||l>e.far||t.push({distance:l,point:Fc.clone(),uv:cr.getUV(Fc,gp,kc,yp,WC,ev,jC,new me),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function vp(n,e,t,i,r,s){Wl.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Nc.x=s*Wl.x-r*Wl.y,Nc.y=r*Wl.x+s*Wl.y):Nc.copy(Wl),n.copy(e),n.x+=Nc.x,n.y+=Nc.y,n.applyMatrix4(GB)}const xp=new D,JC=new D;class VB extends Tt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i<r;i++){const s=t[i];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,i=0){t=Math.abs(t);const r=this.levels;let s;for(s=0;s<r.length&&!(t<r[s].distance);s++);return r.splice(s,0,{distance:t,hysteresis:i,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r;i++){let s=t[i].distance;if(t[i].object.visible&&(s-=s*t[i].hysteresis),e<s)break}return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){xp.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(xp);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){xp.setFromMatrixPosition(e.matrixWorld),JC.setFromMatrixPosition(this.matrixWorld);const i=xp.distanceTo(JC)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s;r++){let o=t[r].distance;if(t[r].object.visible&&(o-=o*t[r].hysteresis),i>=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let r=0,s=i.length;r<s;r++){const o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance,hysteresis:o.hysteresis})}return t}}const XC=new D,KC=new Nt,YC=new Nt,aG=new D,QC=new rt;class cA extends bn{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new rt,this.bindMatrixInverse=new rt}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Nt,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.fromBufferAttribute(t,i);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,r=this.geometry;KC.fromBufferAttribute(r.attributes.skinIndex,e),YC.fromBufferAttribute(r.attributes.skinWeight,e),XC.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=YC.getComponent(s);if(o!==0){const a=KC.getComponent(s);QC.multiplyMatrices(i.bones[a].matrixWorld,i.boneInverses[a]),t.addScaledVector(aG.copy(XC).applyMatrix4(QC),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class Rg extends Tt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class _u extends Qt{constructor(e=null,t=1,i=1,r,s,o,a,l,f=fn,h=fn,d,p){super(null,o,a,l,f,h,r,s,d,p),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const ZC=new rt,lG=new rt;class vh{constructor(e=[],t=[]){this.uuid=Ui(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new rt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new rt;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const a=e[s]?e[s].matrixWorld:lG;ZC.multiplyMatrices(a,t[s]),ZC.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new vh(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=bB(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new _u(t,e,e,Ai,Bs);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const s=e.bones[i];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new Rg),this.bones.push(o),this.boneInverses.push(new rt().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const o=t[r];e.bones.push(o.uuid);const a=i[r];e.boneInverses.push(a.toArray())}return e}}class Du extends Dt{constructor(e,t,i,r=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const qC=new rt,$C=new rt,_p=[],uG=new rt,Oc=new bn;class WB extends bn{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Du(new Float32Array(i*16),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1;for(let r=0;r<i;r++)this.setMatrixAt(r,uG)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const i=this.matrixWorld,r=this.count;if(Oc.geometry=this.geometry,Oc.material=this.material,Oc.material!==void 0)for(let s=0;s<r;s++){this.getMatrixAt(s,qC),$C.multiplyMatrices(i,qC),Oc.matrixWorld=$C,Oc.raycast(e,_p);for(let o=0,a=_p.length;o<a;o++){const l=_p[o];l.instanceId=s,l.object=this,t.push(l)}_p.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Du(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}class ti extends Mn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Le(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const eE=new D,tE=new D,nE=new rt,tv=new ph,Ap=new Yo;class Ws extends Tt{constructor(e=new ut,t=new ti){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)eE.fromBufferAttribute(t,r-1),tE.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=eE.distanceTo(tE);e.setAttribute("lineDistance",new We(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ap.copy(i.boundingSphere),Ap.applyMatrix4(r),Ap.radius+=s,e.ray.intersectsSphere(Ap)===!1)return;nE.copy(r).invert(),tv.copy(e.ray).applyMatrix4(nE);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,f=new D,h=new D,d=new D,p=new D,m=this.isLineSegments?2:1,v=i.index,x=i.attributes.position;if(v!==null){const _=Math.max(0,o.start),A=Math.min(v.count,o.start+o.count);for(let w=_,S=A-1;w<S;w+=m){const b=v.getX(w),P=v.getX(w+1);if(f.fromBufferAttribute(x,b),h.fromBufferAttribute(x,P),tv.distanceSqToSegment(f,h,p,d)>l)continue;p.applyMatrix4(this.matrixWorld);const E=e.ray.origin.distanceTo(p);E<e.near||E>e.far||t.push({distance:E,point:d.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const _=Math.max(0,o.start),A=Math.min(x.count,o.start+o.count);for(let w=_,S=A-1;w<S;w+=m){if(f.fromBufferAttribute(x,w),h.fromBufferAttribute(x,w+1),tv.distanceSqToSegment(f,h,p,d)>l)continue;p.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(p);P<e.near||P>e.far||t.push({distance:P,point:d.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}const iE=new D,rE=new D;class kr extends Ws{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r<s;r+=2)iE.fromBufferAttribute(t,r),rE.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+iE.distanceTo(rE);e.setAttribute("lineDistance",new We(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class fA extends Ws{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class xh extends Mn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Le(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const sE=new rt,u1=new ph,Mp=new Yo,wp=new D;let hA=class extends Tt{constructor(e=new ut,t=new xh){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Mp.copy(i.boundingSphere),Mp.applyMatrix4(r),Mp.radius+=s,e.ray.intersectsSphere(Mp)===!1)return;sE.copy(r).invert(),u1.copy(e.ray).applyMatrix4(sE);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,f=i.index,d=i.attributes.position;if(f!==null){const p=Math.max(0,o.start),m=Math.min(f.count,o.start+o.count);for(let v=p,y=m;v<y;v++){const x=f.getX(v);wp.fromBufferAttribute(d,x),oE(wp,x,l,r,e,t,this)}}else{const p=Math.max(0,o.start),m=Math.min(d.count,o.start+o.count);for(let v=p,y=m;v<y;v++)wp.fromBufferAttribute(d,v),oE(wp,v,l,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}};function oE(n,e,t,i,r,s,o){const a=u1.distanceSqToPoint(n);if(a<t){const l=new D;u1.closestPointToPoint(n,l),l.applyMatrix4(i);const f=r.ray.origin.distanceTo(l);if(f<r.near||f>r.far)return;s.push({distance:f,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class cG extends Qt{constructor(e,t,i,r,s,o,a,l,f){super(e,t,i,r,s,o,a,l,f),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:en,this.magFilter=s!==void 0?s:en,this.generateMipmaps=!1;const h=this;function d(){h.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class fG extends Qt{constructor(e,t,i){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=i,this.magFilter=fn,this.minFilter=fn,this.generateMipmaps=!1,this.needsUpdate=!0}}class dA extends Qt{constructor(e,t,i,r,s,o,a,l,f,h,d,p){super(null,o,a,l,f,h,r,s,d,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class hG extends dA{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=zn}}class dG extends Qt{constructor(e,t,i,r,s,o,a,l,f){super(e,t,i,r,s,o,a,l,f),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Or{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,f;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),f=i[r]-o,f<0)a=r+1;else if(f>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const h=i[r],p=i[r+1]-h,m=(o-h)/p;return(r+m)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new me:new D);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new D,r=[],s=[],o=[],a=new D,l=new rt;for(let m=0;m<=e;m++){const v=m/e;r[m]=this.getTangentAt(v,new D)}s[0]=new D,o[0]=new D;let f=Number.MAX_VALUE;const h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=f&&(f=h,i.set(1,0,0)),d<=f&&(f=d,i.set(0,1,0)),p<=f&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(gn(r[m-1].dot(r[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,v))}o[m].crossVectors(r[m],s[m])}if(t===!0){let m=Math.acos(gn(s[0].dot(s[e]),-1,1));m/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(r[v],m*v)),o[v].crossVectors(r[v],s[v])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Lg extends Or{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const i=t||new me,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const a=this.aStartAngle+e*s;let l=this.aX+this.xRadius*Math.cos(a),f=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const h=Math.cos(this.aRotation),d=Math.sin(this.aRotation),p=l-this.aX,m=f-this.aY;l=p*h-m*d+this.aX,f=p*d+m*h+this.aY}return i.set(l,f)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class jB extends Lg{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.isArcCurve=!0,this.type="ArcCurve"}}function pA(){let n=0,e=0,t=0,i=0;function r(s,o,a,l){n=s,e=a,t=-3*s+3*o-2*a-l,i=2*s-2*o+a+l}return{initCatmullRom:function(s,o,a,l,f){r(o,a,f*(a-s),f*(l-o))},initNonuniformCatmullRom:function(s,o,a,l,f,h,d){let p=(o-s)/f-(a-s)/(f+h)+(a-o)/h,m=(a-o)/h-(l-o)/(h+d)+(l-a)/d;p*=h,m*=h,r(o,a,p,m)},calc:function(s){const o=s*s,a=o*s;return n+e*s+t*o+i*a}}}const Sp=new D,nv=new pA,iv=new pA,rv=new pA;class JB extends Or{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new D){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let a=Math.floor(o),l=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let f,h;this.closed||a>0?f=r[(a-1)%s]:(Sp.subVectors(r[0],r[1]).add(r[0]),f=Sp);const d=r[a%s],p=r[(a+1)%s];if(this.closed||a+2<s?h=r[(a+2)%s]:(Sp.subVectors(r[s-1],r[s-2]).add(r[s-1]),h=Sp),this.curveType==="centripetal"||this.curveType==="chordal"){const m=this.curveType==="chordal"?.5:.25;let v=Math.pow(f.distanceToSquared(d),m),y=Math.pow(d.distanceToSquared(p),m),x=Math.pow(p.distanceToSquared(h),m);y<1e-4&&(y=1),v<1e-4&&(v=y),x<1e-4&&(x=y),nv.initNonuniformCatmullRom(f.x,d.x,p.x,h.x,v,y,x),iv.initNonuniformCatmullRom(f.y,d.y,p.y,h.y,v,y,x),rv.initNonuniformCatmullRom(f.z,d.z,p.z,h.z,v,y,x)}else this.curveType==="catmullrom"&&(nv.initCatmullRom(f.x,d.x,p.x,h.x,this.tension),iv.initCatmullRom(f.y,d.y,p.y,h.y,this.tension),rv.initCatmullRom(f.z,d.z,p.z,h.z,this.tension));return i.set(nv.calc(l),iv.calc(l),rv.calc(l)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new D().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function aE(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,a=n*n,l=n*a;return(2*t-2*i+s+o)*l+(-3*t+3*i-2*s-o)*a+s*n+t}function pG(n,e){const t=1-n;return t*t*e}function mG(n,e){return 2*(1-n)*n*e}function gG(n,e){return n*n*e}function pf(n,e,t,i){return pG(n,e)+mG(n,t)+gG(n,i)}function yG(n,e){const t=1-n;return t*t*t*e}function vG(n,e){const t=1-n;return 3*t*t*n*e}function xG(n,e){return 3*(1-n)*n*n*e}function _G(n,e){return n*n*n*e}function mf(n,e,t,i,r){return yG(n,e)+vG(n,t)+xG(n,i)+_G(n,r)}class mA extends Or{constructor(e=new me,t=new me,i=new me,r=new me){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new me){const i=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return i.set(mf(e,r.x,s.x,o.x,a.x),mf(e,r.y,s.y,o.y,a.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class XB extends Or{constructor(e=new D,t=new D,i=new D,r=new D){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new D){const i=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return i.set(mf(e,r.x,s.x,o.x,a.x),mf(e,r.y,s.y,o.y,a.y),mf(e,r.z,s.z,o.z,a.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Ig extends Or{constructor(e=new me,t=new me){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new me){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const i=t||new me;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class KB extends Or{constructor(e=new D,t=new D){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new D){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class gA extends Or{constructor(e=new me,t=new me,i=new me){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new me){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(pf(e,r.x,s.x,o.x),pf(e,r.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class yA extends Or{constructor(e=new D,t=new D,i=new D){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new D){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(pf(e,r.x,s.x,o.x),pf(e,r.y,s.y,o.y),pf(e,r.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class vA extends Or{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new me){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),a=s-o,l=r[o===0?o:o-1],f=r[o],h=r[o>r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(aE(a,l.x,f.x,h.x,d.x),aE(a,l.y,f.y,h.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new me().fromArray(r))}return this}}var xA=Object.freeze({__proto__:null,ArcCurve:jB,CatmullRomCurve3:JB,CubicBezierCurve:mA,CubicBezierCurve3:XB,EllipseCurve:Lg,LineCurve:Ig,LineCurve3:KB,QuadraticBezierCurve:gA,QuadraticBezierCurve3:yA,SplineCurve:vA});class YB extends Or{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Ig(t,e))}getPoint(e,t){const i=e*this.getLength(),r=this.getCurveLengths();let s=0;for(;s<r.length;){if(r[s]>=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),f=l===0?0:1-o/l;return a.getPointAt(f,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,l=o.getPoints(a);for(let f=0;f<l.length;f++){const h=l[f];i&&i.equals(h)||(t.push(h),i=h)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new xA[r.type]().fromJSON(r))}return this}}class Kf extends YB{constructor(e){super(),this.type="Path",this.currentPoint=new me,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new Ig(this.currentPoint.clone(),new me(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new gA(this.currentPoint.clone(),new me(e,t),new me(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const a=new mA(this.currentPoint.clone(),new me(e,t),new me(i,r),new me(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new vA(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,a,l){const f=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+f,t+h,i,r,s,o,a,l),this}absellipse(e,t,i,r,s,o,a,l){const f=new Lg(e,t,i,r,s,o,a,l);if(this.curves.length>0){const d=f.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(f);const h=f.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Xu extends ut{constructor(e=[new me(0,-.5),new me(.5,0),new me(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=gn(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],f=[],h=1/t,d=new D,p=new me,m=new D,v=new D,y=new D;let x=0,_=0;for(let A=0;A<=e.length-1;A++)switch(A){case 0:x=e[A+1].x-e[A].x,_=e[A+1].y-e[A].y,m.x=_*1,m.y=-x,m.z=_*0,y.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(y.x,y.y,y.z);break;default:x=e[A+1].x-e[A].x,_=e[A+1].y-e[A].y,m.x=_*1,m.y=-x,m.z=_*0,v.copy(m),m.x+=y.x,m.y+=y.y,m.z+=y.z,m.normalize(),l.push(m.x,m.y,m.z),y.copy(v)}for(let A=0;A<=t;A++){const w=i+A*h*r,S=Math.sin(w),b=Math.cos(w);for(let P=0;P<=e.length-1;P++){d.x=e[P].x*S,d.y=e[P].y,d.z=e[P].x*b,o.push(d.x,d.y,d.z),p.x=A/t,p.y=P/(e.length-1),a.push(p.x,p.y);const R=l[3*P+0]*S,E=l[3*P+1],B=l[3*P+0]*b;f.push(R,E,B)}}for(let A=0;A<t;A++)for(let w=0;w<e.length-1;w++){const S=w+A*e.length,b=S,P=S+e.length,R=S+e.length+1,E=S+1;s.push(b,P,E),s.push(R,E,P)}this.setIndex(s),this.setAttribute("position",new We(o,3)),this.setAttribute("uv",new We(a,2)),this.setAttribute("normal",new We(f,3))}static fromJSON(e){return new Xu(e.points,e.segments,e.phiStart,e.phiLength)}}class _h extends Xu{constructor(e=1,t=1,i=4,r=8){const s=new Kf;s.absarc(0,-t/2,e,Math.PI*1.5,0),s.absarc(0,t/2,e,0,Math.PI*.5),super(s.getPoints(i),r),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:r}}static fromJSON(e){return new _h(e.radius,e.length,e.capSegments,e.radialSegments)}}class Ah extends ut{constructor(e=1,t=32,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],a=[],l=[],f=new D,h=new me;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let d=0,p=3;d<=t;d++,p+=3){const m=i+d/t*r;f.x=e*Math.cos(m),f.y=e*Math.sin(m),o.push(f.x,f.y,f.z),a.push(0,0,1),h.x=(o[p]/e+1)/2,h.y=(o[p+1]/e+1)/2,l.push(h.x,h.y)}for(let d=1;d<=t;d++)s.push(d,d+1,0);this.setIndex(s),this.setAttribute("position",new We(o,3)),this.setAttribute("normal",new We(a,3)),this.setAttribute("uv",new We(l,2))}static fromJSON(e){return new Ah(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class al extends ut{constructor(e=1,t=1,i=1,r=32,s=1,o=!1,a=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};const f=this;r=Math.floor(r),s=Math.floor(s);const h=[],d=[],p=[],m=[];let v=0;const y=[],x=i/2;let _=0;A(),o===!1&&(e>0&&w(!0),t>0&&w(!1)),this.setIndex(h),this.setAttribute("position",new We(d,3)),this.setAttribute("normal",new We(p,3)),this.setAttribute("uv",new We(m,2));function A(){const S=new D,b=new D;let P=0;const R=(t-e)/i;for(let E=0;E<=s;E++){const B=[],L=E/s,z=L*(t-e)+e;for(let Z=0;Z<=r;Z++){const J=Z/r,H=J*l+a,Y=Math.sin(H),te=Math.cos(H);b.x=z*Y,b.y=-L*i+x,b.z=z*te,d.push(b.x,b.y,b.z),S.set(Y,R,te).normalize(),p.push(S.x,S.y,S.z),m.push(J,1-L),B.push(v++)}y.push(B)}for(let E=0;E<r;E++)for(let B=0;B<s;B++){const L=y[B][E],z=y[B+1][E],Z=y[B+1][E+1],J=y[B][E+1];h.push(L,z,J),h.push(z,Z,J),P+=6}f.addGroup(_,P,0),_+=P}function w(S){const b=v,P=new me,R=new D;let E=0;const B=S===!0?e:t,L=S===!0?1:-1;for(let Z=1;Z<=r;Z++)d.push(0,x*L,0),p.push(0,L,0),m.push(.5,.5),v++;const z=v;for(let Z=0;Z<=r;Z++){const H=Z/r*l+a,Y=Math.cos(H),te=Math.sin(H);R.x=B*te,R.y=x*L,R.z=B*Y,d.push(R.x,R.y,R.z),p.push(0,L,0),P.x=Y*.5+.5,P.y=te*.5*L+.5,m.push(P.x,P.y),v++}for(let Z=0;Z<r;Z++){const J=b+Z,H=z+Z;S===!0?h.push(H,H+1,J):h.push(H+1,H,J),E+=3}f.addGroup(_,E,S===!0?1:2),_+=E}}static fromJSON(e){return new al(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Mh extends al{constructor(e=1,t=1,i=32,r=1,s=!1,o=0,a=Math.PI*2){super(0,e,t,i,r,s,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new Mh(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Xs extends ut{constructor(e=[],t=[],i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const s=[],o=[];a(r),f(i),h(),this.setAttribute("position",new We(s,3)),this.setAttribute("normal",new We(s.slice(),3)),this.setAttribute("uv",new We(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function a(A){const w=new D,S=new D,b=new D;for(let P=0;P<t.length;P+=3)m(t[P+0],w),m(t[P+1],S),m(t[P+2],b),l(w,S,b,A)}function l(A,w,S,b){const P=b+1,R=[];for(let E=0;E<=P;E++){R[E]=[];const B=A.clone().lerp(S,E/P),L=w.clone().lerp(S,E/P),z=P-E;for(let Z=0;Z<=z;Z++)Z===0&&E===P?R[E][Z]=B:R[E][Z]=B.clone().lerp(L,Z/z)}for(let E=0;E<P;E++)for(let B=0;B<2*(P-E)-1;B++){const L=Math.floor(B/2);B%2===0?(p(R[E][L+1]),p(R[E+1][L]),p(R[E][L])):(p(R[E][L+1]),p(R[E+1][L+1]),p(R[E+1][L]))}}function f(A){const w=new D;for(let S=0;S<s.length;S+=3)w.x=s[S+0],w.y=s[S+1],w.z=s[S+2],w.normalize().multiplyScalar(A),s[S+0]=w.x,s[S+1]=w.y,s[S+2]=w.z}function h(){const A=new D;for(let w=0;w<s.length;w+=3){A.x=s[w+0],A.y=s[w+1],A.z=s[w+2];const S=x(A)/2/Math.PI+.5,b=_(A)/Math.PI+.5;o.push(S,1-b)}v(),d()}function d(){for(let A=0;A<o.length;A+=6){const w=o[A+0],S=o[A+2],b=o[A+4],P=Math.max(w,S,b),R=Math.min(w,S,b);P>.9&&R<.1&&(w<.2&&(o[A+0]+=1),S<.2&&(o[A+2]+=1),b<.2&&(o[A+4]+=1))}}function p(A){s.push(A.x,A.y,A.z)}function m(A,w){const S=A*3;w.x=e[S+0],w.y=e[S+1],w.z=e[S+2]}function v(){const A=new D,w=new D,S=new D,b=new D,P=new me,R=new me,E=new me;for(let B=0,L=0;B<s.length;B+=9,L+=6){A.set(s[B+0],s[B+1],s[B+2]),w.set(s[B+3],s[B+4],s[B+5]),S.set(s[B+6],s[B+7],s[B+8]),P.set(o[L+0],o[L+1]),R.set(o[L+2],o[L+3]),E.set(o[L+4],o[L+5]),b.copy(A).add(w).add(S).divideScalar(3);const z=x(b);y(P,L+0,A,z),y(R,L+2,w,z),y(E,L+4,S,z)}}function y(A,w,S,b){b<0&&A.x===1&&(o[w]=A.x-1),S.x===0&&S.z===0&&(o[w]=b/2/Math.PI+.5)}function x(A){return Math.atan2(A.z,-A.x)}function _(A){return Math.atan2(-A.y,Math.sqrt(A.x*A.x+A.z*A.z))}}static fromJSON(e){return new Xs(e.vertices,e.indices,e.radius,e.details)}}class wh extends Xs{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new wh(e.radius,e.detail)}}const Cp=new D,Ep=new D,sv=new D,bp=new cr;class QB extends ut{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const r=Math.pow(10,4),s=Math.cos(ja*t),o=e.getIndex(),a=e.getAttribute("position"),l=o?o.count:a.count,f=[0,0,0],h=["a","b","c"],d=new Array(3),p={},m=[];for(let v=0;v<l;v+=3){o?(f[0]=o.getX(v),f[1]=o.getX(v+1),f[2]=o.getX(v+2)):(f[0]=v,f[1]=v+1,f[2]=v+2);const{a:y,b:x,c:_}=bp;if(y.fromBufferAttribute(a,f[0]),x.fromBufferAttribute(a,f[1]),_.fromBufferAttribute(a,f[2]),bp.getNormal(sv),d[0]=`${Math.round(y.x*r)},${Math.round(y.y*r)},${Math.round(y.z*r)}`,d[1]=`${Math.round(x.x*r)},${Math.round(x.y*r)},${Math.round(x.z*r)}`,d[2]=`${Math.round(_.x*r)},${Math.round(_.y*r)},${Math.round(_.z*r)}`,!(d[0]===d[1]||d[1]===d[2]||d[2]===d[0]))for(let A=0;A<3;A++){const w=(A+1)%3,S=d[A],b=d[w],P=bp[h[A]],R=bp[h[w]],E=`${S}_${b}`,B=`${b}_${S}`;B in p&&p[B]?(sv.dot(p[B].normal)<=s&&(m.push(P.x,P.y,P.z),m.push(R.x,R.y,R.z)),p[B]=null):E in p||(p[E]={index0:f[A],index1:f[w],normal:sv.clone()})}}for(const v in p)if(p[v]){const{index0:y,index1:x}=p[v];Cp.fromBufferAttribute(a,y),Ep.fromBufferAttribute(a,x),m.push(Cp.x,Cp.y,Cp.z),m.push(Ep.x,Ep.y,Ep.z)}this.setAttribute("position",new We(m,3))}}}class Ka extends Kf{constructor(e){super(e),this.uuid=Ui(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new Kf().fromJSON(r))}return this}}const AG={triangulate:function(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=ZB(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,f,h,d,p,m;if(i&&(s=EG(n,e,s,t)),n.length>80*t){a=f=n[0],l=h=n[1];for(let v=t;v<r;v+=t)d=n[v],p=n[v+1],d<a&&(a=d),p<l&&(l=p),d>f&&(f=d),p>h&&(h=p);m=Math.max(f-a,h-l),m=m!==0?32767/m:0}return Yf(s,o,t,a,l,m,0),o}};function ZB(n,e,t,i,r){let s,o;if(r===kG(n,e,t,i)>0)for(s=e;s<t;s+=i)o=lE(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=lE(s,n[s],n[s+1],o);return o&&Dg(o,o.next)&&(Zf(o),o=o.next),o}function nl(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Dg(t,t.next)||tn(t.prev,t,t.next)===0)){if(Zf(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Yf(n,e,t,i,r,s,o){if(!n)return;!o&&s&&RG(n,i,r,s);let a=n,l,f;for(;n.prev!==n.next;){if(l=n.prev,f=n.next,s?wG(n,i,r,s):MG(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(f.i/t|0),Zf(n),n=f.next,a=f.next;continue}if(n=f,n===a){o?o===1?(n=SG(nl(n),e,t),Yf(n,e,t,i,r,s,2)):o===2&&CG(n,e,t,i,r,s):Yf(nl(n),e,t,i,r,s,1);break}}}function MG(n){const e=n.prev,t=n,i=n.next;if(tn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,f=i.y,h=r<s?r<o?r:o:s<o?s:o,d=a<l?a<f?a:f:l<f?l:f,p=r>s?r>o?r:o:s>o?s:o,m=a>l?a>f?a:f:l>f?l:f;let v=i.next;for(;v!==e;){if(v.x>=h&&v.x<=p&&v.y>=d&&v.y<=m&&lu(r,a,s,l,o,f,v.x,v.y)&&tn(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function wG(n,e,t,i){const r=n.prev,s=n,o=n.next;if(tn(r,s,o)>=0)return!1;const a=r.x,l=s.x,f=o.x,h=r.y,d=s.y,p=o.y,m=a<l?a<f?a:f:l<f?l:f,v=h<d?h<p?h:p:d<p?d:p,y=a>l?a>f?a:f:l>f?l:f,x=h>d?h>p?h:p:d>p?d:p,_=c1(m,v,e,t,i),A=c1(y,x,e,t,i);let w=n.prevZ,S=n.nextZ;for(;w&&w.z>=_&&S&&S.z<=A;){if(w.x>=m&&w.x<=y&&w.y>=v&&w.y<=x&&w!==r&&w!==o&&lu(a,h,l,d,f,p,w.x,w.y)&&tn(w.prev,w,w.next)>=0||(w=w.prevZ,S.x>=m&&S.x<=y&&S.y>=v&&S.y<=x&&S!==r&&S!==o&&lu(a,h,l,d,f,p,S.x,S.y)&&tn(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;w&&w.z>=_;){if(w.x>=m&&w.x<=y&&w.y>=v&&w.y<=x&&w!==r&&w!==o&&lu(a,h,l,d,f,p,w.x,w.y)&&tn(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;S&&S.z<=A;){if(S.x>=m&&S.x<=y&&S.y>=v&&S.y<=x&&S!==r&&S!==o&&lu(a,h,l,d,f,p,S.x,S.y)&&tn(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function SG(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Dg(r,s)&&qB(r,i,i.next,s)&&Qf(r,s)&&Qf(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Zf(i),Zf(i.next),i=n=s),i=i.next}while(i!==n);return nl(i)}function CG(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&DG(o,a)){let l=$B(o,a);o=nl(o,o.next),l=nl(l,l.next),Yf(o,e,t,i,r,s,0),Yf(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function EG(n,e,t,i){const r=[];let s,o,a,l,f;for(s=0,o=e.length;s<o;s++)a=e[s]*i,l=s<o-1?e[s+1]*i:n.length,f=ZB(n,a,l,i,!1),f===f.next&&(f.steiner=!0),r.push(IG(f));for(r.sort(bG),s=0;s<r.length;s++)t=TG(r[s],t);return t}function bG(n,e){return n.x-e.x}function TG(n,e){const t=PG(n,e);if(!t)return e;const i=$B(t,n);return nl(i,i.next),nl(t,t.next)}function PG(n,e){let t=e,i=-1/0,r;const s=n.x,o=n.y;do{if(o<=t.y&&o>=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>i&&(i=p,r=t.x<t.next.x?t:t.next,p===s))return r}t=t.next}while(t!==e);if(!r)return null;const a=r,l=r.x,f=r.y;let h=1/0,d;t=r;do s>=t.x&&t.x>=l&&s!==t.x&&lu(o<f?s:i,o,l,f,o<f?i:s,o,t.x,t.y)&&(d=Math.abs(o-t.y)/(s-t.x),Qf(t,n)&&(d<h||d===h&&(t.x>r.x||t.x===r.x&&BG(r,t)))&&(r=t,h=d)),t=t.next;while(t!==a);return r}function BG(n,e){return tn(n.prev,n,e.prev)<0&&tn(e.next,n,n.next)<0}function RG(n,e,t,i){let r=n;do r.z===0&&(r.z=c1(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,LG(r)}function LG(n){let e,t,i,r,s,o,a,l,f=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e<f&&(a++,i=i.nextZ,!!i);e++);for(l=f;a>0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,f*=2}while(o>1);return n}function c1(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function IG(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function lu(n,e,t,i,r,s,o,a){return(r-o)*(e-a)>=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function DG(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!FG(n,e)&&(Qf(n,e)&&Qf(e,n)&&NG(n,e)&&(tn(n.prev,n,e.prev)||tn(n,e.prev,e))||Dg(n,e)&&tn(n.prev,n,n.next)>0&&tn(e.prev,e,e.next)>0)}function tn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Dg(n,e){return n.x===e.x&&n.y===e.y}function qB(n,e,t,i){const r=Pp(tn(n,e,t)),s=Pp(tn(n,e,i)),o=Pp(tn(t,i,n)),a=Pp(tn(t,i,e));return!!(r!==s&&o!==a||r===0&&Tp(n,t,e)||s===0&&Tp(n,i,e)||o===0&&Tp(t,n,i)||a===0&&Tp(t,e,i))}function Tp(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Pp(n){return n>0?1:n<0?-1:0}function FG(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&qB(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Qf(n,e){return tn(n.prev,n,n.next)<0?tn(n,e,n.next)>=0&&tn(n,n.prev,e)>=0:tn(n,e,n.prev)<0||tn(n,n.next,e)<0}function NG(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function $B(n,e){const t=new f1(n.i,n.x,n.y),i=new f1(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function lE(n,e,t,i){const r=new f1(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Zf(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function f1(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function kG(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}class es{static area(e){const t=e.length;let i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return es.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];uE(e),cE(i,e);let o=e.length;t.forEach(uE);for(let l=0;l<t.length;l++)r.push(o),o+=t[l].length,cE(i,t[l]);const a=AG.triangulate(i,r);for(let l=0;l<a.length;l+=3)s.push(a.slice(l,l+3));return s}}function uE(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function cE(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class Sh extends ut{constructor(e=new Ka([new me(.5,.5),new me(-.5,.5),new me(-.5,-.5),new me(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],s=[];for(let a=0,l=e.length;a<l;a++){const f=e[a];o(f)}this.setAttribute("position",new We(r,3)),this.setAttribute("uv",new We(s,2)),this.computeVertexNormals();function o(a){const l=[],f=t.curveSegments!==void 0?t.curveSegments:12,h=t.steps!==void 0?t.steps:1,d=t.depth!==void 0?t.depth:1;let p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,m=t.bevelThickness!==void 0?t.bevelThickness:.2,v=t.bevelSize!==void 0?t.bevelSize:m-.1,y=t.bevelOffset!==void 0?t.bevelOffset:0,x=t.bevelSegments!==void 0?t.bevelSegments:3;const _=t.extrudePath,A=t.UVGenerator!==void 0?t.UVGenerator:OG;let w,S=!1,b,P,R,E;_&&(w=_.getSpacedPoints(h),S=!0,p=!1,b=_.computeFrenetFrames(h,!1),P=new D,R=new D,E=new D),p||(x=0,m=0,v=0,y=0);const B=a.extractPoints(f);let L=B.shape;const z=B.holes;if(!es.isClockWise(L)){L=L.reverse();for(let he=0,re=z.length;he<re;he++){const Ce=z[he];es.isClockWise(Ce)&&(z[he]=Ce.reverse())}}const J=es.triangulateShape(L,z),H=L;for(let he=0,re=z.length;he<re;he++){const Ce=z[he];L=L.concat(Ce)}function Y(he,re,Ce){return re||console.error("THREE.ExtrudeGeometry: vec does not exist"),re.clone().multiplyScalar(Ce).add(he)}const te=L.length,le=J.length;function N(he,re,Ce){let ze,Be,Ze;const Je=he.x-re.x,je=he.y-re.y,vt=Ce.x-he.x,wt=Ce.y-he.y,O=Je*Je+je*je,I=Je*wt-je*vt;if(Math.abs(I)>Number.EPSILON){const ie=Math.sqrt(O),we=Math.sqrt(vt*vt+wt*wt),Ee=re.x-je/ie,Pe=re.y+Je/ie,nt=Ce.x-wt/we,De=Ce.y+vt/we,ge=((nt-Ee)*wt-(De-Pe)*vt)/(Je*wt-je*vt);ze=Ee+Je*ge-he.x,Be=Pe+je*ge-he.y;const Xe=ze*ze+Be*Be;if(Xe<=2)return new me(ze,Be);Ze=Math.sqrt(Xe/2)}else{let ie=!1;Je>Number.EPSILON?vt>Number.EPSILON&&(ie=!0):Je<-Number.EPSILON?vt<-Number.EPSILON&&(ie=!0):Math.sign(je)===Math.sign(wt)&&(ie=!0),ie?(ze=-je,Be=Je,Ze=Math.sqrt(O)):(ze=Je,Be=je,Ze=Math.sqrt(O/2))}return new me(ze/Ze,Be/Ze)}const V=[];for(let he=0,re=H.length,Ce=re-1,ze=he+1;he<re;he++,Ce++,ze++)Ce===re&&(Ce=0),ze===re&&(ze=0),V[he]=N(H[he],H[Ce],H[ze]);const j=[];let ae,W=V.concat();for(let he=0,re=z.length;he<re;he++){const Ce=z[he];ae=[];for(let ze=0,Be=Ce.length,Ze=Be-1,Je=ze+1;ze<Be;ze++,Ze++,Je++)Ze===Be&&(Ze=0),Je===Be&&(Je=0),ae[ze]=N(Ce[ze],Ce[Ze],Ce[Je]);j.push(ae),W=W.concat(ae)}for(let he=0;he<x;he++){const re=he/x,Ce=m*Math.cos(re*Math.PI/2),ze=v*Math.sin(re*Math.PI/2)+y;for(let Be=0,Ze=H.length;Be<Ze;Be++){const Je=Y(H[Be],V[Be],ze);ke(Je.x,Je.y,-Ce)}for(let Be=0,Ze=z.length;Be<Ze;Be++){const Je=z[Be];ae=j[Be];for(let je=0,vt=Je.length;je<vt;je++){const wt=Y(Je[je],ae[je],ze);ke(wt.x,wt.y,-Ce)}}}const ce=v+y;for(let he=0;he<te;he++){const re=p?Y(L[he],W[he],ce):L[he];S?(R.copy(b.normals[0]).multiplyScalar(re.x),P.copy(b.binormals[0]).multiplyScalar(re.y),E.copy(w[0]).add(R).add(P),ke(E.x,E.y,E.z)):ke(re.x,re.y,0)}for(let he=1;he<=h;he++)for(let re=0;re<te;re++){const Ce=p?Y(L[re],W[re],ce):L[re];S?(R.copy(b.normals[he]).multiplyScalar(Ce.x),P.copy(b.binormals[he]).multiplyScalar(Ce.y),E.copy(w[he]).add(R).add(P),ke(E.x,E.y,E.z)):ke(Ce.x,Ce.y,d/h*he)}for(let he=x-1;he>=0;he--){const re=he/x,Ce=m*Math.cos(re*Math.PI/2),ze=v*Math.sin(re*Math.PI/2)+y;for(let Be=0,Ze=H.length;Be<Ze;Be++){const Je=Y(H[Be],V[Be],ze);ke(Je.x,Je.y,d+Ce)}for(let Be=0,Ze=z.length;Be<Ze;Be++){const Je=z[Be];ae=j[Be];for(let je=0,vt=Je.length;je<vt;je++){const wt=Y(Je[je],ae[je],ze);S?ke(wt.x,wt.y+w[h-1].y,w[h-1].x+Ce):ke(wt.x,wt.y,d+Ce)}}}ve(),_e();function ve(){const he=r.length/3;if(p){let re=0,Ce=te*re;for(let ze=0;ze<le;ze++){const Be=J[ze];Oe(Be[2]+Ce,Be[1]+Ce,Be[0]+Ce)}re=h+x*2,Ce=te*re;for(let ze=0;ze<le;ze++){const Be=J[ze];Oe(Be[0]+Ce,Be[1]+Ce,Be[2]+Ce)}}else{for(let re=0;re<le;re++){const Ce=J[re];Oe(Ce[2],Ce[1],Ce[0])}for(let re=0;re<le;re++){const Ce=J[re];Oe(Ce[0]+te*h,Ce[1]+te*h,Ce[2]+te*h)}}i.addGroup(he,r.length/3-he,0)}function _e(){const he=r.length/3;let re=0;$(H,re),re+=H.length;for(let Ce=0,ze=z.length;Ce<ze;Ce++){const Be=z[Ce];$(Be,re),re+=Be.length}i.addGroup(he,r.length/3-he,1)}function $(he,re){let Ce=he.length;for(;--Ce>=0;){const ze=Ce;let Be=Ce-1;Be<0&&(Be=he.length-1);for(let Ze=0,Je=h+x*2;Ze<Je;Ze++){const je=te*Ze,vt=te*(Ze+1),wt=re+ze+je,O=re+Be+je,I=re+Be+vt,ie=re+ze+vt;He(wt,O,I,ie)}}}function ke(he,re,Ce){l.push(he),l.push(re),l.push(Ce)}function Oe(he,re,Ce){Me(he),Me(re),Me(Ce);const ze=r.length/3,Be=A.generateTopUV(i,r,ze-3,ze-2,ze-1);Ie(Be[0]),Ie(Be[1]),Ie(Be[2])}function He(he,re,Ce,ze){Me(he),Me(re),Me(ze),Me(re),Me(Ce),Me(ze);const Be=r.length/3,Ze=A.generateSideWallUV(i,r,Be-6,Be-3,Be-2,Be-1);Ie(Ze[0]),Ie(Ze[1]),Ie(Ze[3]),Ie(Ze[1]),Ie(Ze[2]),Ie(Ze[3])}function Me(he){r.push(l[he*3+0]),r.push(l[he*3+1]),r.push(l[he*3+2])}function Ie(he){s.push(he.x),s.push(he.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return UG(t,i,e)}static fromJSON(e,t){const i=[];for(let s=0,o=e.shapes.length;s<o;s++){const a=t[e.shapes[s]];i.push(a)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new xA[r.type]().fromJSON(r)),new Sh(i,e.options)}}const OG={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],a=e[i*3],l=e[i*3+1],f=e[r*3],h=e[r*3+1];return[new me(s,o),new me(a,l),new me(f,h)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],a=e[t*3+1],l=e[t*3+2],f=e[i*3],h=e[i*3+1],d=e[i*3+2],p=e[r*3],m=e[r*3+1],v=e[r*3+2],y=e[s*3],x=e[s*3+1],_=e[s*3+2];return Math.abs(a-h)<Math.abs(o-f)?[new me(o,1-l),new me(f,1-d),new me(p,1-v),new me(y,1-_)]:[new me(a,1-l),new me(h,1-d),new me(m,1-v),new me(x,1-_)]}};function UG(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class Ch extends Xs{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Ch(e.radius,e.detail)}}class Ku extends Xs{constructor(e=1,t=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Ku(e.radius,e.detail)}}class Eh extends ut{constructor(e=.5,t=1,i=32,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);const a=[],l=[],f=[],h=[];let d=e;const p=(t-e)/r,m=new D,v=new me;for(let y=0;y<=r;y++){for(let x=0;x<=i;x++){const _=s+x/i*o;m.x=d*Math.cos(_),m.y=d*Math.sin(_),l.push(m.x,m.y,m.z),f.push(0,0,1),v.x=(m.x/t+1)/2,v.y=(m.y/t+1)/2,h.push(v.x,v.y)}d+=p}for(let y=0;y<r;y++){const x=y*(i+1);for(let _=0;_<i;_++){const A=_+x,w=A,S=A+i+1,b=A+i+2,P=A+1;a.push(w,S,P),a.push(S,b,P)}}this.setIndex(a),this.setAttribute("position",new We(l,3)),this.setAttribute("normal",new We(f,3)),this.setAttribute("uv",new We(h,2))}static fromJSON(e){return new Eh(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class bh extends ut{constructor(e=new Ka([new me(0,.5),new me(-.5,-.5),new me(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let a=0,l=0;if(Array.isArray(e)===!1)f(e);else for(let h=0;h<e.length;h++)f(e[h]),this.addGroup(a,l,h),a+=l,l=0;this.setIndex(i),this.setAttribute("position",new We(r,3)),this.setAttribute("normal",new We(s,3)),this.setAttribute("uv",new We(o,2));function f(h){const d=r.length/3,p=h.extractPoints(t);let m=p.shape;const v=p.holes;es.isClockWise(m)===!1&&(m=m.reverse());for(let x=0,_=v.length;x<_;x++){const A=v[x];es.isClockWise(A)===!0&&(v[x]=A.reverse())}const y=es.triangulateShape(m,v);for(let x=0,_=v.length;x<_;x++){const A=v[x];m=m.concat(A)}for(let x=0,_=m.length;x<_;x++){const A=m[x];r.push(A.x,A.y,0),s.push(0,0,1),o.push(A.x,A.y)}for(let x=0,_=y.length;x<_;x++){const A=y[x],w=A[0]+d,S=A[1]+d,b=A[2]+d;i.push(w,S,b),l+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return zG(t,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];i.push(o)}return new bh(i,e.curveSegments)}}function zG(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class Yu extends ut{constructor(e=1,t=32,i=16,r=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const l=Math.min(o+a,Math.PI);let f=0;const h=[],d=new D,p=new D,m=[],v=[],y=[],x=[];for(let _=0;_<=i;_++){const A=[],w=_/i;let S=0;_==0&&o==0?S=.5/t:_==i&&l==Math.PI&&(S=-.5/t);for(let b=0;b<=t;b++){const P=b/t;d.x=-e*Math.cos(r+P*s)*Math.sin(o+w*a),d.y=e*Math.cos(o+w*a),d.z=e*Math.sin(r+P*s)*Math.sin(o+w*a),v.push(d.x,d.y,d.z),p.copy(d).normalize(),y.push(p.x,p.y,p.z),x.push(P+S,1-w),A.push(f++)}h.push(A)}for(let _=0;_<i;_++)for(let A=0;A<t;A++){const w=h[_][A+1],S=h[_][A],b=h[_+1][A],P=h[_+1][A+1];(_!==0||o>0)&&m.push(w,S,P),(_!==i-1||l<Math.PI)&&m.push(S,b,P)}this.setIndex(m),this.setAttribute("position",new We(v,3)),this.setAttribute("normal",new We(y,3)),this.setAttribute("uv",new We(x,2))}static fromJSON(e){return new Yu(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Th extends Xs{constructor(e=1,t=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Th(e.radius,e.detail)}}class Ph extends ut{constructor(e=1,t=.4,i=12,r=48,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);const o=[],a=[],l=[],f=[],h=new D,d=new D,p=new D;for(let m=0;m<=i;m++)for(let v=0;v<=r;v++){const y=v/r*s,x=m/i*Math.PI*2;d.x=(e+t*Math.cos(x))*Math.cos(y),d.y=(e+t*Math.cos(x))*Math.sin(y),d.z=t*Math.sin(x),a.push(d.x,d.y,d.z),h.x=e*Math.cos(y),h.y=e*Math.sin(y),p.subVectors(d,h).normalize(),l.push(p.x,p.y,p.z),f.push(v/r),f.push(m/i)}for(let m=1;m<=i;m++)for(let v=1;v<=r;v++){const y=(r+1)*m+v-1,x=(r+1)*(m-1)+v-1,_=(r+1)*(m-1)+v,A=(r+1)*m+v;o.push(y,x,A),o.push(x,_,A)}this.setIndex(o),this.setAttribute("position",new We(a,3)),this.setAttribute("normal",new We(l,3)),this.setAttribute("uv",new We(f,2))}static fromJSON(e){return new Ph(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Bh extends ut{constructor(e=1,t=.4,i=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:s,q:o},i=Math.floor(i),r=Math.floor(r);const a=[],l=[],f=[],h=[],d=new D,p=new D,m=new D,v=new D,y=new D,x=new D,_=new D;for(let w=0;w<=i;++w){const S=w/i*s*Math.PI*2;A(S,s,o,e,m),A(S+.01,s,o,e,v),x.subVectors(v,m),_.addVectors(v,m),y.crossVectors(x,_),_.crossVectors(y,x),y.normalize(),_.normalize();for(let b=0;b<=r;++b){const P=b/r*Math.PI*2,R=-t*Math.cos(P),E=t*Math.sin(P);d.x=m.x+(R*_.x+E*y.x),d.y=m.y+(R*_.y+E*y.y),d.z=m.z+(R*_.z+E*y.z),l.push(d.x,d.y,d.z),p.subVectors(d,m).normalize(),f.push(p.x,p.y,p.z),h.push(w/i),h.push(b/r)}}for(let w=1;w<=i;w++)for(let S=1;S<=r;S++){const b=(r+1)*(w-1)+(S-1),P=(r+1)*w+(S-1),R=(r+1)*w+S,E=(r+1)*(w-1)+S;a.push(b,P,E),a.push(P,R,E)}this.setIndex(a),this.setAttribute("position",new We(l,3)),this.setAttribute("normal",new We(f,3)),this.setAttribute("uv",new We(h,2));function A(w,S,b,P,R){const E=Math.cos(w),B=Math.sin(w),L=b/S*w,z=Math.cos(L);R.x=P*(2+z)*.5*E,R.y=P*(2+z)*B*.5,R.z=P*Math.sin(L)*.5}}static fromJSON(e){return new Bh(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Rh extends ut{constructor(e=new yA(new D(-1,-1,0),new D(-1,1,0),new D(1,1,0)),t=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new D,l=new D,f=new me;let h=new D;const d=[],p=[],m=[],v=[];y(),this.setIndex(v),this.setAttribute("position",new We(d,3)),this.setAttribute("normal",new We(p,3)),this.setAttribute("uv",new We(m,2));function y(){for(let w=0;w<t;w++)x(w);x(s===!1?t:0),A(),_()}function x(w){h=e.getPointAt(w/t,h);const S=o.normals[w],b=o.binormals[w];for(let P=0;P<=r;P++){const R=P/r*Math.PI*2,E=Math.sin(R),B=-Math.cos(R);l.x=B*S.x+E*b.x,l.y=B*S.y+E*b.y,l.z=B*S.z+E*b.z,l.normalize(),p.push(l.x,l.y,l.z),a.x=h.x+i*l.x,a.y=h.y+i*l.y,a.z=h.z+i*l.z,d.push(a.x,a.y,a.z)}}function _(){for(let w=1;w<=t;w++)for(let S=1;S<=r;S++){const b=(r+1)*(w-1)+(S-1),P=(r+1)*w+(S-1),R=(r+1)*w+S,E=(r+1)*(w-1)+S;v.push(b,P,E),v.push(P,R,E)}}function A(){for(let w=0;w<=t;w++)for(let S=0;S<=r;S++)f.x=w/t,f.y=S/r,m.push(f.x,f.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Rh(new xA[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class e3 extends ut{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],i=new Set,r=new D,s=new D;if(e.index!==null){const o=e.attributes.position,a=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:a.count,materialIndex:0}]);for(let f=0,h=l.length;f<h;++f){const d=l[f],p=d.start,m=d.count;for(let v=p,y=p+m;v<y;v+=3)for(let x=0;x<3;x++){const _=a.getX(v+x),A=a.getX(v+(x+1)%3);r.fromBufferAttribute(o,_),s.fromBufferAttribute(o,A),fE(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}}else{const o=e.attributes.position;for(let a=0,l=o.count/3;a<l;a++)for(let f=0;f<3;f++){const h=3*a+f,d=3*a+(f+1)%3;r.fromBufferAttribute(o,h),s.fromBufferAttribute(o,d),fE(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new We(t,3))}}}function fE(n,e,t){const i=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(i)===!0||t.has(r)===!0?!1:(t.add(i),t.add(r),!0)}var hE=Object.freeze({__proto__:null,BoxGeometry:Qo,CapsuleGeometry:_h,CircleGeometry:Ah,ConeGeometry:Mh,CylinderGeometry:al,DodecahedronGeometry:wh,EdgesGeometry:QB,ExtrudeGeometry:Sh,IcosahedronGeometry:Ch,LatheGeometry:Xu,OctahedronGeometry:Ku,PlaneGeometry:ju,PolyhedronGeometry:Xs,RingGeometry:Eh,ShapeGeometry:bh,SphereGeometry:Yu,TetrahedronGeometry:Th,TorusGeometry:Ph,TorusKnotGeometry:Bh,TubeGeometry:Rh,WireframeGeometry:e3});class t3 extends Mn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Le(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class n3 extends ss{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class Qu extends Mn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Le(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Js,this.normalScale=new me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ks extends Qu{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new me(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return gn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Le(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Le(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Le(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._iridescence=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class i3 extends Mn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Le(16777215),this.specular=new Le(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Js,this.normalScale=new me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=dh,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class r3 extends Mn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Le(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Js,this.normalScale=new me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class s3 extends Mn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Js,this.normalScale=new me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class o3 extends Mn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Le(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Js,this.normalScale=new me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=dh,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class a3 extends Mn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Le(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Js,this.normalScale=new me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class l3 extends ti{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function ar(n,e,t){return _A(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)}function Oa(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function _A(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function u3(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function h1(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function AA(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function GG(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l<s.tracks.length;++l){const f=s.tracks[l],h=f.getValueSize(),d=[],p=[];for(let m=0;m<f.times.length;++m){const v=f.times[m]*r;if(!(v<t||v>=i)){d.push(f.times[m]);for(let y=0;y<h;++y)p.push(f.values[m*h+y])}}d.length!==0&&(f.times=Oa(d,f.times.constructor),f.values=Oa(p,f.values.constructor),o.push(f))}s.tracks=o;let a=1/0;for(let l=0;l<s.tracks.length;++l)a>s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*a);return s.resetDuration(),s}function HG(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,s=e/i;for(let o=0;o<r;++o){const a=t.tracks[o],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const f=n.tracks.find(function(_){return _.name===a.name&&_.ValueTypeName===l});if(f===void 0)continue;let h=0;const d=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=d/3);let p=0;const m=f.getValueSize();f.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=m/3);const v=a.times.length-1;let y;if(s<=a.times[0]){const _=h,A=d-h;y=ar(a.values,_,A)}else if(s>=a.times[v]){const _=v*d+h,A=_+d-h;y=ar(a.values,_,A)}else{const _=a.createInterpolant(),A=h,w=d-h;_.evaluate(s),y=ar(_.resultBuffer,A,w)}l==="quaternion"&&new Vn().fromArray(y).normalize().conjugate().toArray(y);const x=f.times.length;for(let _=0;_<x;++_){const A=_*m+p;if(l==="quaternion")Vn.multiplyQuaternionsFlat(f.values,A,y,0,f.values,A);else{const w=m-p*2;for(let S=0;S<w;++S)f.values[A+S]-=y[S]}}}return n.blendMode=K_,n}var VG=Object.freeze({__proto__:null,arraySlice:ar,convertArray:Oa,flattenJSON:AA,getKeyframeOrder:u3,isTypedArray:_A,makeClipAdditive:HG,sortedArray:h1,subclip:GG});class Zu{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],s=t[i-1];e:{t:{let o;n:{i:if(!(e<r)){for(let a=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const a=t[1];e<a&&(i=2,s=a);for(let l=i-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const a=i+o>>>1;e<t[a]?o=a:i=a+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=i[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class c3 extends Zu{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Fa,endingEnd:Fa}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,a=r[s],l=r[o];if(a===void 0)switch(this.getSettings_().endingStart){case Na:s=e,a=2*t-i;break;case Wf:s=r.length-2,a=t+r[s]-r[s+1];break;default:s=e,a=i}if(l===void 0)switch(this.getSettings_().endingEnd){case Na:o=e,l=2*i-t;break;case Wf:o=1,l=i+r[1]-r[0];break;default:o=e-1,l=t}const f=(i-t)*.5,h=this.valueSize;this._weightPrev=f/(t-a),this._weightNext=f/(l-i),this._offsetPrev=s*h,this._offsetNext=o*h}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,f=l-a,h=this._offsetPrev,d=this._offsetNext,p=this._weightPrev,m=this._weightNext,v=(i-t)/(r-t),y=v*v,x=y*v,_=-p*x+2*p*y-p*v,A=(1+p)*x+(-1.5-2*p)*y+(-.5+p)*v+1,w=(-1-m)*x+(1.5+m)*y+.5*v,S=m*x-m*y;for(let b=0;b!==a;++b)s[b]=_*o[h+b]+A*o[f+b]+w*o[l+b]+S*o[d+b];return s}}class MA extends Zu{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,f=l-a,h=(i-t)/(r-t),d=1-h;for(let p=0;p!==a;++p)s[p]=o[f+p]*d+o[l+p]*h;return s}}class f3 extends Zu{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Ur{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Oa(t,this.TimeBufferType),this.values=Oa(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:Oa(e.times,Array),values:Oa(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new f3(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new MA(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new c3(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Ru:t=this.InterpolantFactoryMethodDiscrete;break;case tl:t=this.InterpolantFactoryMethodLinear;break;case um:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Ru;case this.InterpolantFactoryMethodLinear:return tl;case this.InterpolantFactoryMethodSmooth:return um}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let s=0,o=r-1;for(;s!==r&&i[s]<e;)++s;for(;o!==-1&&i[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=ar(i,s,o),this.values=ar(this.values,s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&_A(r))for(let a=0,l=r.length;a!==l;++a){const f=r[a];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,f),e=!1;break}}return e}optimize(){const e=ar(this.times),t=ar(this.values),i=this.getValueSize(),r=this.getInterpolation()===um,s=e.length-1;let o=1;for(let a=1;a<s;++a){let l=!1;const f=e[a],h=e[a+1];if(f!==h&&(a!==1||f!==e[0]))if(r)l=!0;else{const d=a*i,p=d-i,m=d+i;for(let v=0;v!==i;++v){const y=t[d+v];if(y!==t[p+v]||y!==t[m+v]){l=!0;break}}}if(l){if(a!==o){e[o]=e[a];const d=a*i,p=o*i;for(let m=0;m!==i;++m)t[p+m]=t[d+m]}++o}}if(s>0){e[o]=e[s];for(let a=s*i,l=o*i,f=0;f!==i;++f)t[l+f]=t[a+f];++o}return o!==e.length?(this.times=ar(e,0,o),this.values=ar(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=ar(this.times,0),t=ar(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Ur.prototype.TimeBufferType=Float32Array;Ur.prototype.ValueBufferType=Float32Array;Ur.prototype.DefaultInterpolation=tl;class ll extends Ur{}ll.prototype.ValueTypeName="bool";ll.prototype.ValueBufferType=Array;ll.prototype.DefaultInterpolation=Ru;ll.prototype.InterpolantFactoryMethodLinear=void 0;ll.prototype.InterpolantFactoryMethodSmooth=void 0;class wA extends Ur{}wA.prototype.ValueTypeName="color";class Fu extends Ur{}Fu.prototype.ValueTypeName="number";class h3 extends Zu{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let f=e*a;for(let h=f+a;f!==h;f+=4)Vn.slerpFlat(s,0,o,f-a,o,f,l);return s}}class Ho extends Ur{InterpolantFactoryMethodLinear(e){return new h3(this.times,this.values,this.getValueSize(),e)}}Ho.prototype.ValueTypeName="quaternion";Ho.prototype.DefaultInterpolation=tl;Ho.prototype.InterpolantFactoryMethodSmooth=void 0;class ul extends Ur{}ul.prototype.ValueTypeName="string";ul.prototype.ValueBufferType=Array;ul.prototype.DefaultInterpolation=Ru;ul.prototype.InterpolantFactoryMethodLinear=void 0;ul.prototype.InterpolantFactoryMethodSmooth=void 0;class Nu extends Ur{}Nu.prototype.ValueTypeName="vector";class ku{constructor(e,t=-1,i,r=Cg){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Ui(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(jG(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Ur.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a<s;a++){let l=[],f=[];l.push((a+s-1)%s,a,(a+1)%s),f.push(0,1,0);const h=u3(l);l=h1(l,1,h),f=h1(f,1,h),!r&&l[0]===0&&(l.push(s),f.push(f[0])),o.push(new Fu(".morphTargetInfluences["+t[a].name+"]",l,f).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const f=e[a],h=f.name.match(s);if(h&&h.length>1){const d=h[1];let p=r[d];p||(r[d]=p=[]),p.push(f)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(d,p,m,v,y){if(m.length!==0){const x=[],_=[];AA(m,x,_,v),x.length!==0&&y.push(new d(p,x,_))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const f=e.hierarchy||[];for(let d=0;d<f.length;d++){const p=f[d].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const m={};let v;for(v=0;v<p.length;v++)if(p[v].morphTargets)for(let y=0;y<p[v].morphTargets.length;y++)m[p[v].morphTargets[y]]=-1;for(const y in m){const x=[],_=[];for(let A=0;A!==p[v].morphTargets.length;++A){const w=p[v];x.push(w.time),_.push(w.morphTarget===y?1:0)}r.push(new Fu(".morphTargetInfluence["+y+"]",x,_))}l=m.length*o}else{const m=".bones["+t[d].name+"]";i(Nu,m+".position",p,"pos",r),i(Ho,m+".quaternion",p,"rot",r),i(Nu,m+".scale",p,"scl",r)}}return r.length===0?null:new this(s,l,r,a)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const s=this.tracks[i];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function WG(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Fu;case"vector":case"vector2":case"vector3":case"vector4":return Nu;case"color":return wA;case"quaternion":return Ho;case"bool":case"boolean":return ll;case"string":return ul}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function jG(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=WG(n.type);if(n.times===void 0){const t=[],i=[];AA(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const il={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class SA{constructor(e,t,i){const r=this;let s=!1,o=0,a=0,l;const f=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(h){a++,s===!1&&r.onStart!==void 0&&r.onStart(h,o,a),s=!0},this.itemEnd=function(h){o++,r.onProgress!==void 0&&r.onProgress(h,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(h){r.onError!==void 0&&r.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,d){return f.push(h,d),this},this.removeHandler=function(h){const d=f.indexOf(h);return d!==-1&&f.splice(d,2),this},this.getHandler=function(h){for(let d=0,p=f.length;d<p;d+=2){const m=f[d],v=f[d+1];if(m.global&&(m.lastIndex=0),m.test(h))return v}return null}}}const uu=new SA;class pi{constructor(e){this.manager=e!==void 0?e:uu,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,s){i.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Ms={};class JG extends Error{constructor(e,t){super(e),this.response=t}}class Gi extends pi{constructor(e){super(e)}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=il.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(Ms[e]!==void 0){Ms[e].push({onLoad:t,onProgress:i,onError:r});return}Ms[e]=[],Ms[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;const h=Ms[e],d=f.body.getReader(),p=f.headers.get("Content-Length")||f.headers.get("X-File-Size"),m=p?parseInt(p):0,v=m!==0;let y=0;const x=new ReadableStream({start(_){A();function A(){d.read().then(({done:w,value:S})=>{if(w)_.close();else{y+=S.byteLength;const b=new ProgressEvent("progress",{lengthComputable:v,loaded:y,total:m});for(let P=0,R=h.length;P<R;P++){const E=h[P];E.onProgress&&E.onProgress(b)}_.enqueue(S),A()}})}}});return new Response(x)}else throw new JG(`fetch for "${f.url}" responded with ${f.status}: ${f.statusText}`,f)}).then(f=>{switch(l){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return f.json();default:if(a===void 0)return f.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),p=d&&d[1]?d[1].toLowerCase():void 0,m=new TextDecoder(p);return f.arrayBuffer().then(v=>m.decode(v))}}}).then(f=>{il.add(e,f);const h=Ms[e];delete Ms[e];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onLoad&&m.onLoad(f)}}).catch(f=>{const h=Ms[e];if(h===void 0)throw this.manager.itemError(e),f;delete Ms[e];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onError&&m.onError(f)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class XG extends pi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Gi(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=ku.parse(e[i]);t.push(r)}return t}}class KG extends pi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],a=new dA,l=new Gi(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(s.withCredentials);let f=0;function h(d){l.load(e[d],function(p){const m=s.parse(p,!0);o[d]={width:m.width,height:m.height,format:m.format,mipmaps:m.mipmaps},f+=1,f===6&&(m.mipmapCount===1&&(a.minFilter=en),a.image=o,a.format=m.format,a.needsUpdate=!0,t&&t(a))},i,r)}if(Array.isArray(e))for(let d=0,p=e.length;d<p;++d)h(d);else l.load(e,function(d){const p=s.parse(d,!0);if(p.isCubemap){const m=p.mipmaps.length/p.mipmapCount;for(let v=0;v<m;v++){o[v]={mipmaps:[]};for(let y=0;y<p.mipmapCount;y++)o[v].mipmaps.push(p.mipmaps[v*p.mipmapCount+y]),o[v].format=p.format,o[v].width=p.width,o[v].height=p.height}a.image=o}else a.image.width=p.width,a.image.height=p.height,a.mipmaps=p.mipmaps;p.mipmapCount===1&&(a.minFilter=en),a.format=p.format,a.needsUpdate=!0,t&&t(a)},i,r);return a}}class qf extends pi{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=il.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a=Xf("img");function l(){h(),il.add(e,this),t&&t(this),s.manager.itemEnd(e)}function f(d){h(),r&&r(d),s.manager.itemError(e),s.manager.itemEnd(e)}function h(){a.removeEventListener("load",l,!1),a.removeEventListener("error",f,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",f,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}}class YG extends pi{constructor(e){super(e)}load(e,t,i,r){const s=new gh,o=new qf(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(f){o.load(e[f],function(h){s.images[f]=h,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let f=0;f<e.length;++f)l(f);return s}}class QG extends pi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new _u,a=new Gi(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(s.withCredentials),a.load(e,function(l){const f=s.parse(l);f&&(f.image!==void 0?o.image=f.image:f.data!==void 0&&(o.image.width=f.width,o.image.height=f.height,o.image.data=f.data),o.wrapS=f.wrapS!==void 0?f.wrapS:zn,o.wrapT=f.wrapT!==void 0?f.wrapT:zn,o.magFilter=f.magFilter!==void 0?f.magFilter:en,o.minFilter=f.minFilter!==void 0?f.minFilter:en,o.anisotropy=f.anisotropy!==void 0?f.anisotropy:1,f.encoding!==void 0&&(o.encoding=f.encoding),f.flipY!==void 0&&(o.flipY=f.flipY),f.format!==void 0&&(o.format=f.format),f.type!==void 0&&(o.type=f.type),f.mipmaps!==void 0&&(o.mipmaps=f.mipmaps,o.minFilter=rs),f.mipmapCount===1&&(o.minFilter=en),f.generateMipmaps!==void 0&&(o.generateMipmaps=f.generateMipmaps),o.needsUpdate=!0,t&&t(o,f))},i,r),o}}class Lh extends pi{constructor(e){super(e)}load(e,t,i,r){const s=new Qt,o=new qf(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class Zo extends Tt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Le(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}class d3 extends Zo{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Tt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Le(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const ov=new rt,dE=new D,pE=new D;class CA{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new me(512,512),this.map=null,this.mapPass=null,this.matrix=new rt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new bg,this._frameExtents=new me(1,1),this._viewportCount=1,this._viewports=[new Nt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;dE.setFromMatrixPosition(e.matrixWorld),t.position.copy(dE),pE.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(pE),t.updateMatrixWorld(),ov.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ov),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(ov)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class ZG extends CA{constructor(){super(new Gt(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=Jf*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(i!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=i,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class EA extends Zo{constructor(e,t,i=0,r=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Tt.DEFAULT_UP),this.updateMatrix(),this.target=new Tt,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new ZG}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const mE=new rt,Uc=new D,av=new D;class qG extends CA{constructor(){super(new Gt(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new me(4,2),this._viewportCount=6,this._viewports=[new Nt(2,1,1,1),new Nt(0,1,1,1),new Nt(3,1,1,1),new Nt(1,1,1,1),new Nt(3,0,1,1),new Nt(1,0,1,1)],this._cubeDirections=[new D(1,0,0),new D(-1,0,0),new D(0,0,1),new D(0,0,-1),new D(0,1,0),new D(0,-1,0)],this._cubeUps=[new D(0,1,0),new D(0,1,0),new D(0,1,0),new D(0,1,0),new D(0,0,1),new D(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Uc.setFromMatrixPosition(e.matrixWorld),i.position.copy(Uc),av.copy(i.position),av.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(av),i.updateMatrixWorld(),r.makeTranslation(-Uc.x,-Uc.y,-Uc.z),mE.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(mE)}}class bA extends Zo{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new qG}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class $G extends CA{constructor(){super(new Dr(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class TA extends Zo{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Tt.DEFAULT_UP),this.updateMatrix(),this.target=new Tt,this.shadow=new $G}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class p3 extends Zo{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class m3 extends Zo{constructor(e,t,i=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class g3{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new D)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(i*s)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*i*s),t.addScaledVector(o[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*i*s,t[8]=.546274*(i*i-r*r)}}class Fg extends Zo{constructor(e=new g3,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class Ng extends pi{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new Gi(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const r=Ng.createMaterialFromType(e.type);if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=e.sheen),e.sheenColor!==void 0&&(r.sheenColor=new Le().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(r.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.specularIntensity!==void 0&&(r.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&r.specularColor!==void 0&&r.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.iridescence!==void 0&&(r.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(r.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(r.forceSinglePass=e.forceSinglePass),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Le().setHex(o.value);break;case"v2":r.uniforms[s].value=new me().fromArray(o.value);break;case"v3":r.uniforms[s].value=new D().fromArray(o.value);break;case"v4":r.uniforms[s].value=new Nt().fromArray(o.value);break;case"m3":r.uniforms[s].value=new ui().fromArray(o.value);break;case"m4":r.uniforms[s].value=new rt().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new me().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new me().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:t3,SpriteMaterial:uA,RawShaderMaterial:n3,ShaderMaterial:ss,PointsMaterial:xh,MeshPhysicalMaterial:Ks,MeshStandardMaterial:Qu,MeshPhongMaterial:i3,MeshToonMaterial:r3,MeshNormalMaterial:s3,MeshLambertMaterial:o3,MeshDepthMaterial:sA,MeshDistanceMaterial:oA,MeshBasicMaterial:ki,MeshMatcapMaterial:a3,LineDashedMaterial:l3,LineBasicMaterial:ti,Material:Mn};return new t[e]}}class ts{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class y3 extends ut{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class v3 extends pi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Gi(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(m,v){if(t[v]!==void 0)return t[v];const x=m.interleavedBuffers[v],_=s(m,x.buffer),A=ou(x.type,_),w=new yh(A,x.stride);return w.uuid=x.uuid,t[v]=w,w}function s(m,v){if(i[v]!==void 0)return i[v];const x=m.arrayBuffers[v],_=new Uint32Array(x).buffer;return i[v]=_,_}const o=e.isInstancedBufferGeometry?new y3:new ut,a=e.data.index;if(a!==void 0){const m=ou(a.type,a.array);o.setIndex(new Dt(m,1))}const l=e.data.attributes;for(const m in l){const v=l[m];let y;if(v.isInterleavedBufferAttribute){const x=r(e.data,v.data);y=new Go(x,v.itemSize,v.offset,v.normalized)}else{const x=ou(v.type,v.array),_=v.isInstancedBufferAttribute?Du:Dt;y=new _(x,v.itemSize,v.normalized)}v.name!==void 0&&(y.name=v.name),v.usage!==void 0&&y.setUsage(v.usage),v.updateRange!==void 0&&(y.updateRange.offset=v.updateRange.offset,y.updateRange.count=v.updateRange.count),o.setAttribute(m,y)}const f=e.data.morphAttributes;if(f)for(const m in f){const v=f[m],y=[];for(let x=0,_=v.length;x<_;x++){const A=v[x];let w;if(A.isInterleavedBufferAttribute){const S=r(e.data,A.data);w=new Go(S,A.itemSize,A.offset,A.normalized)}else{const S=ou(A.type,A.array);w=new Dt(S,A.itemSize,A.normalized)}A.name!==void 0&&(w.name=A.name),y.push(w)}o.morphAttributes[m]=y}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const d=e.data.groups||e.data.drawcalls||e.data.offsets;if(d!==void 0)for(let m=0,v=d.length;m!==v;++m){const y=d[m];o.addGroup(y.start,y.count,y.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const m=new D;p.center!==void 0&&m.fromArray(p.center),o.boundingSphere=new Yo(m,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class eH extends pi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?ts.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const a=new Gi(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){let f=null;try{f=JSON.parse(l)}catch(d){r!==void 0&&r(d),console.error("THREE:ObjectLoader: Can't parse "+e+".",d.message);return}const h=f.metadata;if(h===void 0||h.type===void 0||h.type.toLowerCase()==="geometry"){r!==void 0&&r(new Error("THREE.ObjectLoader: Can't load "+e)),console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(f,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?ts.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new Gi(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),a=JSON.parse(o),l=a.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(a)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(f)}),a=this.parseTextures(e.textures,o),l=this.parseMaterials(e.materials,a),f=this.parseObject(e.object,s,l,a,i),h=this.parseSkeletons(e.skeletons,f);if(this.bindSkeletons(f,h),t!==void 0){let d=!1;for(const p in o)if(o[p].data instanceof HTMLImageElement){d=!0;break}d===!1&&t(f)}return f}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,r,a,o,t),f=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,f),l}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new Ka().fromJSON(e[i]);t[s.uuid]=s}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=new vh().fromJSON(e[s],r);i[a.uuid]=a}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new v3;for(let s=0,o=e.length;s<o;s++){let a;const l=e[s];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(l);break;default:l.type in hE?a=hE[l.type].fromJSON(l,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}a.uuid=l.uuid,l.name!==void 0&&(a.name=l.name),a.isBufferGeometry===!0&&l.userData!==void 0&&(a.userData=l.userData),i[l.uuid]=a}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new Ng;s.setTextures(t);for(let o=0,a=e.length;o<a;o++){const l=e[o];i[l.uuid]===void 0&&(i[l.uuid]=s.parse(l)),r[l.uuid]=i[l.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=ku.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(l){return i.manager.itemStart(l),s.load(l,function(){i.manager.itemEnd(l)},void 0,function(){i.manager.itemError(l),i.manager.itemEnd(l)})}function a(l){if(typeof l=="string"){const f=l,h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(f)?f:i.resourcePath+f;return o(h)}else return l.data?{data:ou(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){const l=new SA(t);s=new qf(l),s.setCrossOrigin(this.crossOrigin);for(let f=0,h=e.length;f<h;f++){const d=e[f],p=d.url;if(Array.isArray(p)){const m=[];for(let v=0,y=p.length;v<y;v++){const x=p[v],_=a(x);_!==null&&(_ instanceof HTMLImageElement?m.push(_):m.push(new _u(_.data,_.width,_.height)))}r[d.uuid]=new ka(m)}else{const m=a(d.url);r[d.uuid]=new ka(m)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const a=o,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await r.loadAsync(l)}else return o.data?{data:ou(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new qf(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o<a;o++){const l=e[o],f=l.url;if(Array.isArray(f)){const h=[];for(let d=0,p=f.length;d<p;d++){const m=f[d],v=await s(m);v!==null&&(v instanceof HTMLImageElement?h.push(v):h.push(new _u(v.data,v.width,v.height)))}i[l.uuid]=new ka(h)}else{const h=await s(l.url);i[l.uuid]=new ka(h)}}}return i}parseTextures(e,t){function i(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const r={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=e[s];a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),t[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const l=t[a.image],f=l.data;let h;Array.isArray(f)?(h=new gh,f.length===6&&(h.needsUpdate=!0)):(f&&f.data?h=new _u:h=new Qt,f&&(h.needsUpdate=!0)),h.source=l,h.uuid=a.uuid,a.name!==void 0&&(h.name=a.name),a.mapping!==void 0&&(h.mapping=i(a.mapping,tH)),a.offset!==void 0&&h.offset.fromArray(a.offset),a.repeat!==void 0&&h.repeat.fromArray(a.repeat),a.center!==void 0&&h.center.fromArray(a.center),a.rotation!==void 0&&(h.rotation=a.rotation),a.wrap!==void 0&&(h.wrapS=i(a.wrap[0],gE),h.wrapT=i(a.wrap[1],gE)),a.format!==void 0&&(h.format=a.format),a.type!==void 0&&(h.type=a.type),a.encoding!==void 0&&(h.encoding=a.encoding),a.minFilter!==void 0&&(h.minFilter=i(a.minFilter,yE)),a.magFilter!==void 0&&(h.magFilter=i(a.magFilter,yE)),a.anisotropy!==void 0&&(h.anisotropy=a.anisotropy),a.flipY!==void 0&&(h.flipY=a.flipY),a.generateMipmaps!==void 0&&(h.generateMipmaps=a.generateMipmaps),a.premultiplyAlpha!==void 0&&(h.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(h.unpackAlignment=a.unpackAlignment),a.userData!==void 0&&(h.userData=a.userData),r[a.uuid]=h}return r}parseObject(e,t,i,r,s){let o;function a(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function l(p){if(p!==void 0){if(Array.isArray(p)){const m=[];for(let v=0,y=p.length;v<y;v++){const x=p[v];i[x]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",x),m.push(i[x])}return m}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function f(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}let h,d;switch(e.type){case"Scene":o=new lA,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Le(e.background):o.background=f(e.background)),e.environment!==void 0&&(o.environment=f(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new Bg(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new Pg(e.fog.color,e.fog.density))),e.backgroundBlurriness!==void 0&&(o.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(o.backgroundIntensity=e.backgroundIntensity);break;case"PerspectiveCamera":o=new Gt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new Dr(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new p3(e.color,e.intensity);break;case"DirectionalLight":o=new TA(e.color,e.intensity);break;case"PointLight":o=new bA(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new m3(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new EA(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new d3(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new Fg().fromJSON(e);break;case"SkinnedMesh":h=a(e.geometry),d=l(e.material),o=new cA(h,d),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":h=a(e.geometry),d=l(e.material),o=new bn(h,d);break;case"InstancedMesh":h=a(e.geometry),d=l(e.material);const p=e.count,m=e.instanceMatrix,v=e.instanceColor;o=new WB(h,d,p),o.instanceMatrix=new Du(new Float32Array(m.array),16),v!==void 0&&(o.instanceColor=new Du(new Float32Array(v.array),v.itemSize));break;case"LOD":o=new VB;break;case"Line":o=new Ws(a(e.geometry),l(e.material));break;case"LineLoop":o=new fA(a(e.geometry),l(e.material));break;case"LineSegments":o=new kr(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new hA(a(e.geometry),l(e.material));break;case"Sprite":o=new HB(l(e.material));break;case"Group":o=new Ls;break;case"Bone":o=new Rg;break;default:o=new Tt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let m=0;m<p.length;m++)o.add(this.parseObject(p[m],t,i,r,s))}if(e.animations!==void 0){const p=e.animations;for(let m=0;m<p.length;m++){const v=p[m];o.animations.push(s[v])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let m=0;m<p.length;m++){const v=p[m],y=o.getObjectByProperty("uuid",v.object);y!==void 0&&o.addLevel(y,v.distance,v.hysteresis)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}}const tH={UVMapping:wg,CubeReflectionMapping:Oo,CubeRefractionMapping:Uo,EquirectangularReflectionMapping:Gf,EquirectangularRefractionMapping:Hf,CubeUVReflectionMapping:Wu},gE={RepeatWrapping:zo,ClampToEdgeWrapping:zn,MirroredRepeatWrapping:Pu},yE={NearestFilter:fn,NearestMipmapNearestFilter:Vf,NearestMipmapLinearFilter:xu,LinearFilter:en,LinearMipmapNearestFilter:Sg,LinearMipmapLinearFilter:rs};class x3 extends pi{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=il.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){il.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){r&&r(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}let Bp;class PA{static getContext(){return Bp===void 0&&(Bp=new(window.AudioContext||window.webkitAudioContext)),Bp}static setContext(e){Bp=e}}class nH extends pi{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Gi(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{const l=a.slice(0);PA.getContext().decodeAudioData(l,function(h){t(h)})}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}}class iH extends Fg{constructor(e,t,i=1){super(void 0,i),this.isHemisphereLightProbe=!0;const r=new Le().set(e),s=new Le().set(t),o=new D(r.r,r.g,r.b),a=new D(s.r,s.g,s.b),l=Math.sqrt(Math.PI),f=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(f)}}class rH extends Fg{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const i=new Le().set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const vE=new rt,xE=new rt,da=new rt;class sH{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Gt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Gt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,da.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(ja*t.fov*.5)/t.zoom;let a,l;xE.elements[12]=-r,vE.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,da.elements[0]=2*t.near/(l-a),da.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(da),a=-o*t.aspect-s,l=o*t.aspect-s,da.elements[0]=2*t.near/(l-a),da.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(da)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(xE),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(vE)}}class BA{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=_E(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=_E();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function _E(){return(typeof performance>"u"?Date:performance).now()}const pa=new D,AE=new Vn,oH=new D,ma=new D;class aH extends Tt{constructor(){super(),this.type="AudioListener",this.context=PA.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new BA}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(pa,AE,oH),ma.set(0,0,-1).applyQuaternion(AE),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(pa.x,r),t.positionY.linearRampToValueAtTime(pa.y,r),t.positionZ.linearRampToValueAtTime(pa.z,r),t.forwardX.linearRampToValueAtTime(ma.x,r),t.forwardY.linearRampToValueAtTime(ma.y,r),t.forwardZ.linearRampToValueAtTime(ma.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(pa.x,pa.y,pa.z),t.setOrientation(ma.x,ma.y,ma.z,i.x,i.y,i.z)}}class _3 extends Tt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const ga=new D,ME=new Vn,lH=new D,ya=new D;class uH extends _3{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(ga,ME,lH),ya.set(0,0,1).applyQuaternion(ME);const t=this.panner;if(t.positionX){const i=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(ga.x,i),t.positionY.linearRampToValueAtTime(ga.y,i),t.positionZ.linearRampToValueAtTime(ga.z,i),t.orientationX.linearRampToValueAtTime(ya.x,i),t.orientationY.linearRampToValueAtTime(ya.y,i),t.orientationZ.linearRampToValueAtTime(ya.z,i)}else t.setPosition(ga.x,ga.y,ga.z),t.setOrientation(ya.x,ya.y,ya.z)}}class cH{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}}class A3{constructor(e,t,i){this.binding=e,this.valueSize=i;let r,s,o;switch(t){case"quaternion":r=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,r=this.valueSize,s=e*r+r;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==r;++a)i[s+a]=i[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(i,s,0,a,r)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,r=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const l=t*this._origIndex;this._mixBufferRegion(i,r,l,1-s,t)}o>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,f=t+t;l!==f;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,r,s){if(r>=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){Vn.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Vn.multiplyQuaternionsFlat(e,o,e,t,e,i),Vn.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const RA="\\[\\]\\.:\\/",fH=new RegExp("["+RA+"]","g"),LA="[^"+RA+"]",hH="[^"+RA.replace("\\.","")+"]",dH=/((?:WC+[\/:])*)/.source.replace("WC",LA),pH=/(WCOD+)?/.source.replace("WCOD",hH),mH=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",LA),gH=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",LA),yH=new RegExp("^"+dH+pH+mH+gH+"$"),vH=["material","materials","bones","map"];class xH{constructor(e,t,i){const r=i||bt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class bt{constructor(e,t,i){this.path=t,this.parsedPath=i||bt.parseTrackName(t),this.node=bt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new bt.Composite(e,t,i):new bt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(fH,"")}static parseTrackName(e){const t=yH.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);vH.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o<s.length;o++){const a=s[o];if(a.name===t||a.uuid===t)return a;const l=i(a.children);if(l)return l}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)e[t++]=i[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,i=t.objectName,r=t.propertyName;let s=t.propertyIndex;if(e||(e=bt.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(i){let f=t.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let h=0;h<e.length;h++)if(e[h].name===f){f=h;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(f!==void 0){if(e[f]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[f]}}const o=e[r];if(o===void 0){const f=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+f+"."+r+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}bt.Composite=xH;bt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};bt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};bt.prototype.GetterByBindingType=[bt.prototype._getValue_direct,bt.prototype._getValue_array,bt.prototype._getValue_arrayElement,bt.prototype._getValue_toArray];bt.prototype.SetterByBindingTypeAndVersioning=[[bt.prototype._setValue_direct,bt.prototype._setValue_direct_setNeedsUpdate,bt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[bt.prototype._setValue_array,bt.prototype._setValue_array_setNeedsUpdate,bt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[bt.prototype._setValue_arrayElement,bt.prototype._setValue_arrayElement_setNeedsUpdate,bt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[bt.prototype._setValue_fromArray,bt.prototype._setValue_fromArray_setNeedsUpdate,bt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class _H{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Ui(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,i=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length;let a,l=e.length,f=this.nCachedObjects_;for(let h=0,d=arguments.length;h!==d;++h){const p=arguments[h],m=p.uuid;let v=t[m];if(v===void 0){v=l++,t[m]=v,e.push(p);for(let y=0,x=o;y!==x;++y)s[y].push(new bt(p,i[y],r[y]))}else if(v<f){a=e[v];const y=--f,x=e[y];t[x.uuid]=v,e[v]=x,t[m]=y,e[y]=p;for(let _=0,A=o;_!==A;++_){const w=s[_],S=w[y];let b=w[v];w[v]=S,b===void 0&&(b=new bt(p,i[_],r[_])),w[y]=b}}else e[v]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=f}remove(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){const l=arguments[o],f=l.uuid,h=t[f];if(h!==void 0&&h>=s){const d=s++,p=e[d];t[p.uuid]=h,e[h]=p,t[f]=d,e[d]=l;for(let m=0,v=r;m!==v;++m){const y=i[m],x=y[d],_=y[h];y[h]=x,y[d]=_}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const f=arguments[a],h=f.uuid,d=t[h];if(d!==void 0)if(delete t[h],d<s){const p=--s,m=e[p],v=--o,y=e[v];t[m.uuid]=d,e[d]=m,t[y.uuid]=p,e[p]=y,e.pop();for(let x=0,_=r;x!==_;++x){const A=i[x],w=A[p],S=A[v];A[d]=w,A[p]=S,A.pop()}}else{const p=--o,m=e[p];p>0&&(t[m.uuid]=d),e[d]=m,e.pop();for(let v=0,y=r;v!==y;++v){const x=i[v];x[d]=x[p],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,f=l.length,h=this.nCachedObjects_,d=new Array(f);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(d);for(let p=h,m=l.length;p!==m;++p){const v=l[p];d[p]=new bt(v,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],f=e[a];t[f]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class AH{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Fa,endingEnd:Fa};for(let f=0;f!==o;++f){const h=s[f].createInterpolant(null);a[f]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=_B,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,f=a.sampleValues;return l[0]=s,l[1]=s+i,f[0]=e/o,f[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case K_:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(o),f[h].accumulateAdditive(a);break;case Cg:default:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(o),f[h].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===AB;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===xB){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const f=e<0;this._setEndings(f,!f,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Na,r.endingEnd=Na):(e?r.endingStart=this.zeroSlopeAtStart?Na:Fa:r.endingStart=Wf,t?r.endingEnd=this.zeroSlopeAtEnd?Na:Fa:r.endingEnd=Wf)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const MH=new Float32Array(1);class wH extends os{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,f=this._bindingsByRootAndName;let h=f[l];h===void 0&&(h={},f[l]=h);for(let d=0;d!==s;++d){const p=r[d],m=p.name;let v=h[m];if(v!==void 0)++v.referenceCount,o[d]=v;else{if(v=o[d],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,m));continue}const y=t&&t._propertyBindings[d].binding.parsedPath;v=new A3(bt.create(i,m,y),p.ValueTypeName,p.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,m),o[d]=v}a[d].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,i){const r=this._actions,s=this._actionsByClip;let o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,a=o[s],l=a.knownActions,f=l[l.length-1],h=e._byClipCacheIndex;f._byClipCacheIndex=h,l[h]=f,l.pop(),e._byClipCacheIndex=null;const d=a.actionByRoot,p=(e._localRoot||this._root).uuid;delete d[p],l.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_addInactiveBinding(e,t,i){const r=this._bindingsByRootAndName,s=this._bindings;let o=r[t];o===void 0&&(o={},r[t]=o),o[i]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,r=i.rootNode.uuid,s=i.path,o=this._bindingsByRootAndName,a=o[r],l=t[t.length-1],f=e._cacheIndex;l._cacheIndex=f,t[f]=l,t.pop(),delete a[s],Object.keys(a).length===0&&delete o[r]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new MA(new Float32Array(2),new Float32Array(2),1,MH),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,s=t[r];e.__cacheIndex=r,t[r]=e,s.__cacheIndex=i,t[i]=s}clipAction(e,t,i){const r=t||this._root,s=r.uuid;let o=typeof e=="string"?ku.findByName(r,e):e;const a=o!==null?o.uuid:e,l=this._actionsByClip[a];let f=null;if(i===void 0&&(o!==null?i=o.blendMode:i=Cg),l!==void 0){const d=l.actionByRoot[s];if(d!==void 0&&d.blendMode===i)return d;f=l.knownActions[0],o===null&&(o=f._clip)}if(o===null)return null;const h=new AH(this,o,t,i);return this._bindAction(h,f),this._addInactiveAction(h,a,s),h}existingAction(e,t){const i=t||this._root,r=i.uuid,s=typeof e=="string"?ku.findByName(i,e):e,o=s?s.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let f=0;f!==i;++f)t[f]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let f=0;f!==l;++f)a[f].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,r=this._actionsByClip,s=r[i];if(s!==void 0){const o=s.knownActions;for(let a=0,l=o.length;a!==l;++a){const f=o[a];this._deactivateAction(f);const h=f._cacheIndex,d=t[t.length-1];f._cacheIndex=null,f._byClipCacheIndex=null,d._cacheIndex=h,t[h]=d,t.pop(),this._removeInactiveBindingsForAction(f)}delete r[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const o in i){const a=i[o].actionByRoot,l=a[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const r=this._bindingsByRootAndName,s=r[t];if(s!==void 0)for(const o in s){const a=s[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class IA{constructor(e){this.value=e}clone(){return new IA(this.value.clone===void 0?this.value:this.value.clone())}}let SH=0;class CH extends os{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:SH++}),this.name="",this.usage=jf,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let i=0,r=t.length;i<r;i++)this.uniforms.push(t[i].clone());return this}clone(){return new this.constructor().copy(this)}}class EH extends yh{constructor(e,t,i=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class bH{constructor(e,t,i,r,s){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=r,this.count=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}class M3{constructor(e,t,i=0,r=1/0){this.ray=new ph(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new Xa,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,i=[]){return d1(e,this,i,t),i.sort(wE),i}intersectObjects(e,t=!0,i=[]){for(let r=0,s=e.length;r<s;r++)d1(e[r],this,i,t);return i.sort(wE),i}}function wE(n,e){return n.distance-e.distance}function d1(n,e,t,i){if(n.layers.test(e.layers)&&n.raycast(e,t),i===!0){const r=n.children;for(let s=0,o=r.length;s<o;s++)d1(r[s],e,t,!0)}}class p1{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(gn(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class TH{constructor(e=1,t=0,i=0){return this.radius=e,this.theta=t,this.y=i,this}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return new this.constructor().copy(this)}}const SE=new me;class PH{constructor(e=new me(1/0,1/0),t=new me(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=SE.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return SE.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const CE=new D,Rp=new D;class BH{constructor(e=new D,t=new D){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){CE.subVectors(e,this.start),Rp.subVectors(this.end,this.start);const i=Rp.dot(Rp);let s=Rp.dot(CE)/i;return t&&(s=gn(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const EE=new D;class RH extends Tt{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new ut,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o<l;o++,a++){const f=o/l*Math.PI*2,h=a/l*Math.PI*2;r.push(Math.cos(f),Math.sin(f),1,Math.cos(h),Math.sin(h),1)}i.setAttribute("position",new We(r,3));const s=new ti({fog:!1,toneMapped:!1});this.cone=new kr(i,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),EE.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(EE),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const lo=new D,Lp=new rt,lv=new rt;class LH extends kr{constructor(e){const t=w3(e),i=new ut,r=[],s=[],o=new Le(0,0,1),a=new Le(0,1,0);for(let f=0;f<t.length;f++){const h=t[f];h.parent&&h.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),s.push(o.r,o.g,o.b),s.push(a.r,a.g,a.b))}i.setAttribute("position",new We(r,3)),i.setAttribute("color",new We(s,3));const l=new ti({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,l),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,i=this.geometry,r=i.getAttribute("position");lv.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const a=t[s];a.parent&&a.parent.isBone&&(Lp.multiplyMatrices(lv,a.matrixWorld),lo.setFromMatrixPosition(Lp),r.setXYZ(o,lo.x,lo.y,lo.z),Lp.multiplyMatrices(lv,a.parent.matrixWorld),lo.setFromMatrixPosition(Lp),r.setXYZ(o+1,lo.x,lo.y,lo.z),o+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function w3(n){const e=[];n.isBone===!0&&e.push(n);for(let t=0;t<n.children.length;t++)e.push.apply(e,w3(n.children[t]));return e}class IH extends bn{constructor(e,t,i){const r=new Yu(t,4,2),s=new ki({wireframe:!0,fog:!1,toneMapped:!1});super(r,s),this.light=e,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const DH=new D,bE=new Le,TE=new Le;class FH extends Tt{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";const r=new Ku(t);r.rotateY(Math.PI*.5),this.material=new ki({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=r.getAttribute("position"),o=new Float32Array(s.count*3);r.setAttribute("color",new Dt(o,3)),this.add(new bn(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");bE.copy(this.light.color),TE.copy(this.light.groundColor);for(let i=0,r=t.count;i<r;i++){const s=i<r/2?bE:TE;t.setXYZ(i,s.r,s.g,s.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(DH.setFromMatrixPosition(this.light.matrixWorld).negate())}}class NH extends kr{constructor(e=10,t=10,i=4473924,r=8947848){i=new Le(i),r=new Le(r);const s=t/2,o=e/t,a=e/2,l=[],f=[];for(let p=0,m=0,v=-a;p<=t;p++,v+=o){l.push(-a,0,v,a,0,v),l.push(v,0,-a,v,0,a);const y=p===s?i:r;y.toArray(f,m),m+=3,y.toArray(f,m),m+=3,y.toArray(f,m),m+=3,y.toArray(f,m),m+=3}const h=new ut;h.setAttribute("position",new We(l,3)),h.setAttribute("color",new We(f,3));const d=new ti({vertexColors:!0,toneMapped:!1});super(h,d),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class kH extends kr{constructor(e=10,t=16,i=8,r=64,s=4473924,o=8947848){s=new Le(s),o=new Le(o);const a=[],l=[];if(t>1)for(let d=0;d<t;d++){const p=d/t*(Math.PI*2),m=Math.sin(p)*e,v=Math.cos(p)*e;a.push(0,0,0),a.push(m,0,v);const y=d&1?s:o;l.push(y.r,y.g,y.b),l.push(y.r,y.g,y.b)}for(let d=0;d<i;d++){const p=d&1?s:o,m=e-e/i*d;for(let v=0;v<r;v++){let y=v/r*(Math.PI*2),x=Math.sin(y)*m,_=Math.cos(y)*m;a.push(x,0,_),l.push(p.r,p.g,p.b),y=(v+1)/r*(Math.PI*2),x=Math.sin(y)*m,_=Math.cos(y)*m,a.push(x,0,_),l.push(p.r,p.g,p.b)}}const f=new ut;f.setAttribute("position",new We(a,3)),f.setAttribute("color",new We(l,3));const h=new ti({vertexColors:!0,toneMapped:!1});super(f,h),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const PE=new D,Ip=new D,BE=new D;class OH extends Tt{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",t===void 0&&(t=1);let r=new ut;r.setAttribute("position",new We([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new ti({fog:!1,toneMapped:!1});this.lightPlane=new Ws(r,s),this.add(this.lightPlane),r=new ut,r.setAttribute("position",new We([0,0,0,0,0,1],3)),this.targetLine=new Ws(r,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),PE.setFromMatrixPosition(this.light.matrixWorld),Ip.setFromMatrixPosition(this.light.target.matrixWorld),BE.subVectors(Ip,PE),this.lightPlane.lookAt(Ip),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Ip),this.targetLine.scale.z=BE.length()}}const Dp=new D,un=new mh;class UH extends kr{constructor(e){const t=new ut,i=new ti({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],s=[],o={};a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4");function a(v,y){l(v),l(y)}function l(v){r.push(0,0,0),s.push(0,0,0),o[v]===void 0&&(o[v]=[]),o[v].push(r.length/3-1)}t.setAttribute("position",new We(r,3)),t.setAttribute("color",new We(s,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update();const f=new Le(16755200),h=new Le(16711680),d=new Le(43775),p=new Le(16777215),m=new Le(3355443);this.setColors(f,h,d,p,m)}setColors(e,t,i,r,s){const a=this.geometry.getAttribute("color");a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,i.r,i.g,i.b),a.setXYZ(33,i.r,i.g,i.b),a.setXYZ(34,i.r,i.g,i.b),a.setXYZ(35,i.r,i.g,i.b),a.setXYZ(36,i.r,i.g,i.b),a.setXYZ(37,i.r,i.g,i.b),a.setXYZ(38,r.r,r.g,r.b),a.setXYZ(39,r.r,r.g,r.b),a.setXYZ(40,s.r,s.g,s.b),a.setXYZ(41,s.r,s.g,s.b),a.setXYZ(42,s.r,s.g,s.b),a.setXYZ(43,s.r,s.g,s.b),a.setXYZ(44,s.r,s.g,s.b),a.setXYZ(45,s.r,s.g,s.b),a.setXYZ(46,s.r,s.g,s.b),a.setXYZ(47,s.r,s.g,s.b),a.setXYZ(48,s.r,s.g,s.b),a.setXYZ(49,s.r,s.g,s.b),a.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap,i=1,r=1;un.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),pn("c",t,e,un,0,0,-1),pn("t",t,e,un,0,0,1),pn("n1",t,e,un,-i,-r,-1),pn("n2",t,e,un,i,-r,-1),pn("n3",t,e,un,-i,r,-1),pn("n4",t,e,un,i,r,-1),pn("f1",t,e,un,-i,-r,1),pn("f2",t,e,un,i,-r,1),pn("f3",t,e,un,-i,r,1),pn("f4",t,e,un,i,r,1),pn("u1",t,e,un,i*.7,r*1.1,-1),pn("u2",t,e,un,-i*.7,r*1.1,-1),pn("u3",t,e,un,0,r*2,-1),pn("cf1",t,e,un,-i,0,1),pn("cf2",t,e,un,i,0,1),pn("cf3",t,e,un,0,-r,1),pn("cf4",t,e,un,0,r,1),pn("cn1",t,e,un,-i,0,-1),pn("cn2",t,e,un,i,0,-1),pn("cn3",t,e,un,0,-r,-1),pn("cn4",t,e,un,0,r,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function pn(n,e,t,i,r,s,o){Dp.set(r,s,o).unproject(i);const a=e[n];if(a!==void 0){const l=t.getAttribute("position");for(let f=0,h=a.length;f<h;f++)l.setXYZ(a[f],Dp.x,Dp.y,Dp.z)}}const Fp=new Ko;class zH extends kr{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(8*3),s=new ut;s.setIndex(new Dt(i,1)),s.setAttribute("position",new Dt(r,3)),super(s,new ti({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&Fp.setFromObject(this.object),Fp.isEmpty())return;const t=Fp.min,i=Fp.max,r=this.geometry.attributes.position,s=r.array;s[0]=i.x,s[1]=i.y,s[2]=i.z,s[3]=t.x,s[4]=i.y,s[5]=i.z,s[6]=t.x,s[7]=t.y,s[8]=i.z,s[9]=i.x,s[10]=t.y,s[11]=i.z,s[12]=i.x,s[13]=i.y,s[14]=t.z,s[15]=t.x,s[16]=i.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=i.x,s[22]=t.y,s[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class GH extends kr{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new ut;s.setIndex(new Dt(i,1)),s.setAttribute("position",new We(r,3)),super(s,new ti({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class HH extends Ws{constructor(e,t=1,i=16776960){const r=i,s=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],o=new ut;o.setAttribute("position",new We(s,3)),o.computeBoundingSphere(),super(o,new ti({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const a=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],l=new ut;l.setAttribute("position",new We(a,3)),l.computeBoundingSphere(),this.add(new bn(l,new ki({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const RE=new D;let Np,uv;class VH extends Tt{constructor(e=new D(0,0,1),t=new D(0,0,0),i=1,r=16776960,s=i*.2,o=s*.2){super(),this.type="ArrowHelper",Np===void 0&&(Np=new ut,Np.setAttribute("position",new We([0,0,0,0,1,0],3)),uv=new al(0,.5,1,5,1),uv.translate(0,-.5,0)),this.position.copy(t),this.line=new Ws(Np,new ti({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new bn(uv,new ki({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,s,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{RE.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(RE,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class WH extends kr{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new ut;r.setAttribute("position",new We(t,3)),r.setAttribute("color",new We(i,3));const s=new ti({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Le,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class jH{constructor(){this.type="ShapePath",this.color=new Le,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Kf,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(_){const A=[];for(let w=0,S=_.length;w<S;w++){const b=_[w],P=new Ka;P.curves=b.curves,A.push(P)}return A}function i(_,A){const w=A.length;let S=!1;for(let b=w-1,P=0;P<w;b=P++){let R=A[b],E=A[P],B=E.x-R.x,L=E.y-R.y;if(Math.abs(L)>Number.EPSILON){if(L<0&&(R=A[P],B=-B,E=A[b],L=-L),_.y<R.y||_.y>E.y)continue;if(_.y===R.y){if(_.x===R.x)return!0}else{const z=L*(_.x-R.x)-B*(_.y-R.y);if(z===0)return!0;if(z<0)continue;S=!S}}else{if(_.y!==R.y)continue;if(E.x<=_.x&&_.x<=R.x||R.x<=_.x&&_.x<=E.x)return!0}}return S}const r=es.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const f=[];if(s.length===1)return a=s[0],l=new Ka,l.curves=a.curves,f.push(l),f;let h=!r(s[0].getPoints());h=e?!h:h;const d=[],p=[];let m=[],v=0,y;p[v]=void 0,m[v]=[];for(let _=0,A=s.length;_<A;_++)a=s[_],y=a.getPoints(),o=r(y),o=e?!o:o,o?(!h&&p[v]&&v++,p[v]={s:new Ka,p:y},p[v].s.curves=a.curves,h&&v++,m[v]=[]):m[v].push({h:a,p:y[0]});if(!p[0])return t(s);if(p.length>1){let _=!1,A=0;for(let w=0,S=p.length;w<S;w++)d[w]=[];for(let w=0,S=p.length;w<S;w++){const b=m[w];for(let P=0;P<b.length;P++){const R=b[P];let E=!0;for(let B=0;B<p.length;B++)i(R.p,p[B].p)&&(w!==B&&A++,E?(E=!1,d[B].push(R)):_=!0);E&&d[w].push(R)}}A>0&&_===!1&&(m=d)}let x;for(let _=0,A=p.length;_<A;_++){l=p[_].s,f.push(l),x=m[_];for(let w=0,S=x.length;w<S;w++)l.holes.push(x[w].h)}return f}}const Es=JH();function JH(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const f=l-127;f<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):f<-14?(i[l]=1024>>-f-14,i[l|256]=1024>>-f-14|32768,r[l]=-f-1,r[l|256]=-f-1):f<=15?(i[l]=f+15<<10,i[l|256]=f+15<<10|32768,r[l]=13,r[l|256]=13):f<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let f=l<<13,h=0;for(;!(f&8388608);)f<<=1,h-=8388608;f&=-8388609,h+=947912704,s[l]=f|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function XH(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=gn(n,-65504,65504),Es.floatView[0]=n;const e=Es.uint32View[0],t=e>>23&511;return Es.baseTable[t]+((e&8388607)>>Es.shiftTable[t])}function KH(n){const e=n>>10;return Es.uint32View[0]=Es.mantissaTable[Es.offsetTable[e]+(n&1023)]+Es.exponentTable[e],Es.floatView[0]}var YH=Object.freeze({__proto__:null,fromHalfFloat:KH,toHalfFloat:XH});class QH extends Qo{constructor(e,t,i,r,s,o){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(e,t,i,r,s,o)}}class ZH extends _h{constructor(e,t,i,r){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry."),super(e,t,i,r)}}class qH extends Ah{constructor(e,t,i,r){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(e,t,i,r)}}class $H extends Mh{constructor(e,t,i,r,s,o,a){console.warn("THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry."),super(e,t,i,r,s,o,a)}}class e5 extends al{constructor(e,t,i,r,s,o,a,l){console.warn("THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry."),super(e,t,i,r,s,o,a,l)}}class t5 extends wh{constructor(e,t){console.warn("THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry."),super(e,t)}}class n5 extends Sh{constructor(e,t){console.warn("THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry."),super(e,t)}}class i5 extends Ch{constructor(e,t){console.warn("THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry."),super(e,t)}}class r5 extends Xu{constructor(e,t,i,r){console.warn("THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry."),super(e,t,i,r)}}class s5 extends Ku{constructor(e,t){console.warn("THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry."),super(e,t)}}class o5 extends ju{constructor(e,t,i,r){console.warn("THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry."),super(e,t,i,r)}}class a5 extends Xs{constructor(e,t,i,r){console.warn("THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry."),super(e,t,i,r)}}class l5 extends Eh{constructor(e,t,i,r,s,o){console.warn("THREE.RingBufferGeometry has been renamed to THREE.RingGeometry."),super(e,t,i,r,s,o)}}class u5 extends bh{constructor(e,t){console.warn("THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry."),super(e,t)}}class c5 extends Yu{constructor(e,t,i,r,s,o,a){console.warn("THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry."),super(e,t,i,r,s,o,a)}}class f5 extends Th{constructor(e,t){console.warn("THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry."),super(e,t)}}class h5 extends Ph{constructor(e,t,i,r,s){console.warn("THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry."),super(e,t,i,r,s)}}class d5 extends Bh{constructor(e,t,i,r,s,o){console.warn("THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry."),super(e,t,i,r,s,o)}}class p5 extends Rh{constructor(e,t,i,r,s){console.warn("THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry."),super(e,t,i,r,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ag}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Ag);const m1=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:J_,AddEquation:Ta,AddOperation:$P,AdditiveAnimationBlendMode:K_,AdditiveBlending:Rx,AlphaFormat:uB,AlwaysDepth:JP,AlwaysStencilFunc:EB,AmbientLight:p3,AmbientLightProbe:rH,AnimationClip:ku,AnimationLoader:XG,AnimationMixer:wH,AnimationObjectGroup:_H,AnimationUtils:VG,ArcCurve:jB,ArrayCamera:OB,ArrowHelper:VH,Audio:_3,AudioAnalyser:cH,AudioContext:PA,AudioListener:aH,AudioLoader:nH,AxesHelper:WH,BackSide:Ei,BasicDepthPacking:wB,BasicShadowMap:LP,Bone:Rg,BooleanKeyframeTrack:ll,Box2:PH,Box3:Ko,Box3Helper:GH,BoxBufferGeometry:QH,BoxGeometry:Qo,BoxHelper:zH,BufferAttribute:Dt,BufferGeometry:ut,BufferGeometryLoader:v3,ByteType:rB,Cache:il,Camera:mh,CameraHelper:UH,CanvasTexture:dG,CapsuleBufferGeometry:ZH,CapsuleGeometry:_h,CatmullRomCurve3:JB,CineonToneMapping:nB,CircleBufferGeometry:qH,CircleGeometry:Ah,ClampToEdgeWrapping:zn,Clock:BA,Color:Le,ColorKeyframeTrack:wA,ColorManagement:qn,CompressedArrayTexture:hG,CompressedTexture:dA,CompressedTextureLoader:KG,ConeBufferGeometry:$H,ConeGeometry:Mh,CubeCamera:nA,CubeReflectionMapping:Oo,CubeRefractionMapping:Uo,CubeTexture:gh,CubeTextureLoader:YG,CubeUVReflectionMapping:Wu,CubicBezierCurve:mA,CubicBezierCurve3:XB,CubicInterpolant:c3,CullFaceBack:Bx,CullFaceFront:RP,CullFaceFrontBack:vN,CullFaceNone:BP,Curve:Or,CurvePath:YB,CustomBlending:IP,CustomToneMapping:iB,CylinderBufferGeometry:e5,CylinderGeometry:al,Cylindrical:TH,Data3DTexture:$_,DataArrayTexture:Eg,DataTexture:_u,DataTextureLoader:QG,DataUtils:YH,DecrementStencilOp:PN,DecrementWrapStencilOp:RN,DefaultLoadingManager:uu,DepthFormat:Do,DepthStencilFormat:el,DepthTexture:UB,DirectionalLight:TA,DirectionalLightHelper:OH,DiscreteInterpolant:f3,DodecahedronBufferGeometry:t5,DodecahedronGeometry:wh,DoubleSide:Br,DstAlphaFactor:zP,DstColorFactor:HP,DynamicCopyUsage:jN,DynamicDrawUsage:Wa,DynamicReadUsage:HN,EdgesGeometry:QB,EllipseCurve:Lg,EqualDepth:KP,EqualStencilFunc:FN,EquirectangularReflectionMapping:Gf,EquirectangularRefractionMapping:Hf,Euler:ol,EventDispatcher:os,ExtrudeBufferGeometry:n5,ExtrudeGeometry:Sh,FileLoader:Gi,Float16BufferAttribute:Ck,Float32BufferAttribute:We,Float64BufferAttribute:Ek,FloatType:Bs,Fog:Bg,FogExp2:Pg,FramebufferTexture:fG,FrontSide:is,Frustum:bg,GLBufferAttribute:bH,GLSL1:XN,GLSL3:s1,GreaterDepth:QP,GreaterEqualDepth:YP,GreaterEqualStencilFunc:UN,GreaterStencilFunc:kN,GridHelper:NH,Group:Ls,HalfFloatType:Bu,HemisphereLight:d3,HemisphereLightHelper:FH,HemisphereLightProbe:iH,IcosahedronBufferGeometry:i5,IcosahedronGeometry:Ch,ImageBitmapLoader:x3,ImageLoader:qf,ImageUtils:q_,IncrementStencilOp:TN,IncrementWrapStencilOp:BN,InstancedBufferAttribute:Du,InstancedBufferGeometry:y3,InstancedInterleavedBuffer:EH,InstancedMesh:WB,Int16BufferAttribute:wk,Int32BufferAttribute:Sk,Int8BufferAttribute:_k,IntType:oB,InterleavedBuffer:yh,InterleavedBufferAttribute:Go,Interpolant:Zu,InterpolateDiscrete:Ru,InterpolateLinear:tl,InterpolateSmooth:um,InvertStencilOp:LN,KeepStencilOp:cm,KeyframeTrack:Ur,LOD:VB,LatheBufferGeometry:r5,LatheGeometry:Xu,Layers:Xa,LessDepth:XP,LessEqualDepth:Gm,LessEqualStencilFunc:NN,LessStencilFunc:DN,Light:Zo,LightProbe:Fg,Line:Ws,Line3:BH,LineBasicMaterial:ti,LineCurve:Ig,LineCurve3:KB,LineDashedMaterial:l3,LineLoop:fA,LineSegments:kr,LinearEncoding:Vs,LinearFilter:en,LinearInterpolant:MA,LinearMipMapLinearFilter:wN,LinearMipMapNearestFilter:MN,LinearMipmapLinearFilter:rs,LinearMipmapNearestFilter:Sg,LinearSRGBColorSpace:Lu,LinearToneMapping:eB,Loader:pi,LoaderUtils:ts,LoadingManager:SA,LoopOnce:xB,LoopPingPong:AB,LoopRepeat:_B,LuminanceAlphaFormat:fB,LuminanceFormat:cB,MOUSE:Ma,Material:Mn,MaterialLoader:Ng,MathUtils:Z_,Matrix3:ui,Matrix4:rt,MaxEquation:Fx,Mesh:bn,MeshBasicMaterial:ki,MeshDepthMaterial:sA,MeshDistanceMaterial:oA,MeshLambertMaterial:o3,MeshMatcapMaterial:a3,MeshNormalMaterial:s3,MeshPhongMaterial:i3,MeshPhysicalMaterial:Ks,MeshStandardMaterial:Qu,MeshToonMaterial:r3,MinEquation:Dx,MirroredRepeatWrapping:Pu,MixOperation:qP,MultiplyBlending:Ix,MultiplyOperation:dh,NearestFilter:fn,NearestMipMapLinearFilter:AN,NearestMipMapNearestFilter:_N,NearestMipmapLinearFilter:xu,NearestMipmapNearestFilter:Vf,NeverDepth:jP,NeverStencilFunc:IN,NoBlending:Fs,NoColorSpace:CN,NoToneMapping:Ir,NormalAnimationBlendMode:Cg,NormalBlending:Ha,NotEqualDepth:ZP,NotEqualStencilFunc:ON,NumberKeyframeTrack:Fu,Object3D:Tt,ObjectLoader:eH,ObjectSpaceNormalMap:CB,OctahedronBufferGeometry:s5,OctahedronGeometry:Ku,OneFactor:kP,OneMinusDstAlphaFactor:GP,OneMinusDstColorFactor:VP,OneMinusSrcAlphaFactor:j_,OneMinusSrcColorFactor:UP,OrthographicCamera:Dr,PCFShadowMap:Mg,PCFSoftShadowMap:hf,PMREMGenerator:a1,Path:Kf,PerspectiveCamera:Gt,Plane:go,PlaneBufferGeometry:o5,PlaneGeometry:ju,PlaneHelper:HH,PointLight:bA,PointLightHelper:IH,Points:hA,PointsMaterial:xh,PolarGridHelper:kH,PolyhedronBufferGeometry:a5,PolyhedronGeometry:Xs,PositionalAudio:uH,PropertyBinding:bt,PropertyMixer:A3,QuadraticBezierCurve:gA,QuadraticBezierCurve3:yA,Quaternion:Vn,QuaternionKeyframeTrack:Ho,QuaternionLinearInterpolant:h3,RED_GREEN_RGTC2_Format:i1,RED_RGTC1_Format:vB,REVISION:Ag,RGBADepthPacking:SB,RGBAFormat:Ai,RGBAIntegerFormat:gB,RGBA_ASTC_10x10_Format:$x,RGBA_ASTC_10x5_Format:Qx,RGBA_ASTC_10x6_Format:Zx,RGBA_ASTC_10x8_Format:qx,RGBA_ASTC_12x10_Format:e1,RGBA_ASTC_12x12_Format:t1,RGBA_ASTC_4x4_Format:Hx,RGBA_ASTC_5x4_Format:Vx,RGBA_ASTC_5x5_Format:Wx,RGBA_ASTC_6x5_Format:jx,RGBA_ASTC_6x6_Format:Jx,RGBA_ASTC_8x5_Format:Xx,RGBA_ASTC_8x6_Format:Kx,RGBA_ASTC_8x8_Format:Yx,RGBA_BPTC_Format:lm,RGBA_ETC2_EAC_Format:Gx,RGBA_PVRTC_2BPPV1_Format:Ux,RGBA_PVRTC_4BPPV1_Format:Ox,RGBA_S3TC_DXT1_Format:sm,RGBA_S3TC_DXT3_Format:om,RGBA_S3TC_DXT5_Format:am,RGB_ETC1_Format:yB,RGB_ETC2_Format:zx,RGB_PVRTC_2BPPV1_Format:kx,RGB_PVRTC_4BPPV1_Format:Nx,RGB_S3TC_DXT1_Format:rm,RGFormat:pB,RGIntegerFormat:mB,RawShaderMaterial:n3,Ray:ph,Raycaster:M3,RectAreaLight:m3,RedFormat:hB,RedIntegerFormat:dB,ReinhardToneMapping:tB,RepeatWrapping:zo,ReplaceStencilOp:bN,ReverseSubtractEquation:FP,RingBufferGeometry:l5,RingGeometry:Eh,SIGNED_RED_GREEN_RGTC2_Format:r1,SIGNED_RED_RGTC1_Format:n1,SRGBColorSpace:br,Scene:lA,ShaderChunk:pt,ShaderLib:Pr,ShaderMaterial:ss,ShadowMaterial:t3,Shape:Ka,ShapeBufferGeometry:u5,ShapeGeometry:bh,ShapePath:jH,ShapeUtils:es,ShortType:sB,Skeleton:vh,SkeletonHelper:LH,SkinnedMesh:cA,Source:ka,Sphere:Yo,SphereBufferGeometry:c5,SphereGeometry:Yu,Spherical:p1,SphericalHarmonics3:g3,SplineCurve:vA,SpotLight:EA,SpotLightHelper:RH,Sprite:HB,SpriteMaterial:uA,SrcAlphaFactor:W_,SrcAlphaSaturateFactor:WP,SrcColorFactor:OP,StaticCopyUsage:WN,StaticDrawUsage:jf,StaticReadUsage:GN,StereoCamera:sH,StreamCopyUsage:JN,StreamDrawUsage:zN,StreamReadUsage:VN,StringKeyframeTrack:ul,SubtractEquation:DP,SubtractiveBlending:Lx,TOUCH:wa,TangentSpaceNormalMap:Js,TetrahedronBufferGeometry:f5,TetrahedronGeometry:Th,Texture:Qt,TextureLoader:Lh,TorusBufferGeometry:h5,TorusGeometry:Ph,TorusKnotBufferGeometry:d5,TorusKnotGeometry:Bh,Triangle:cr,TriangleFanDrawMode:Y_,TriangleStripDrawMode:MB,TrianglesDrawMode:SN,TubeBufferGeometry:p5,TubeGeometry:Rh,TwoPassDoubleSide:xN,UVMapping:wg,Uint16BufferAttribute:eA,Uint32BufferAttribute:tA,Uint8BufferAttribute:Ak,Uint8ClampedBufferAttribute:Mk,Uniform:IA,UniformsGroup:CH,UniformsLib:Re,UniformsUtils:RB,UnsignedByteType:Hs,UnsignedInt248Type:Va,UnsignedIntType:Mo,UnsignedShort4444Type:aB,UnsignedShort5551Type:lB,UnsignedShortType:X_,VSMShadowMap:Da,Vector2:me,Vector3:D,Vector4:Nt,VectorKeyframeTrack:Nu,VideoTexture:cG,WebGL1Renderer:zB,WebGL3DRenderTarget:ck,WebGLArrayRenderTarget:uk,WebGLCubeRenderTarget:iA,WebGLMultipleRenderTargets:fk,WebGLRenderTarget:Nr,WebGLRenderer:aA,WebGLUtils:kB,WireframeGeometry:e3,WrapAroundEnding:Wf,ZeroCurvatureEnding:Fa,ZeroFactor:NP,ZeroSlopeEnding:Na,ZeroStencilOp:EN,_SRGBAFormat:Hm,sRGBEncoding:Ct},Symbol.toStringTag,{value:"Module"}));var wo={},m5={get exports(){return wo},set exports(n){wo=n}},cl={};/** * @license React * react-reconciler-constants.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */cl.ConcurrentRoot=1;cl.ContinuousEventPriority=4;cl.DefaultEventPriority=16;cl.DiscreteEventPriority=1;cl.IdleEventPriority=536870912;cl.LegacyRoot=0;(function(n){n.exports=cl})(m5);function g5(n){let e;const t=new Set,i=(f,h)=>{const d=typeof f=="function"?f(e):f;if(d!==e){const p=e;e=h?d:Object.assign({},e,d),t.forEach(m=>m(e,p))}},r=()=>e,s=(f,h=r,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=h(e);function m(){const v=h(e);if(!d(p,v)){const y=p;f(p=v,y)}}return t.add(m),()=>t.delete(m)},l={setState:i,getState:r,subscribe:(f,h,d)=>h||d?s(f,h,d):(t.add(f),()=>t.delete(f)),destroy:()=>t.clear()};return e=n(i,r,l),l}const y5=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),LE=y5?U.useEffect:U.useLayoutEffect;function S3(n){const e=typeof n=="function"?g5(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=U.useReducer(x=>x+1,0),o=e.getState(),a=U.useRef(o),l=U.useRef(i),f=U.useRef(r),h=U.useRef(!1),d=U.useRef();d.current===void 0&&(d.current=i(o));let p,m=!1;(a.current!==o||l.current!==i||f.current!==r||h.current)&&(p=i(o),m=!r(d.current,p)),LE(()=>{m&&(d.current=p),a.current=o,l.current=i,f.current=r,h.current=!1});const v=U.useRef(o);LE(()=>{const x=()=>{try{const A=e.getState(),w=l.current(A);f.current(d.current,w)||(a.current=A,d.current=w,s())}catch{h.current=!0,s()}},_=e.subscribe(x);return e.getState()!==v.current&&x(),_},[]);const y=m?p:d.current;return U.useDebugValue(y),y};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}var g1={},v5={get exports(){return g1},set exports(n){g1=n}},$f={},x5={get exports(){return $f},set exports(n){$f=n}},C3={};/** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */(function(n){function e(N,V){var j=N.length;N.push(V);e:for(;0<j;){var ae=j-1>>>1,W=N[ae];if(0<r(W,V))N[ae]=V,N[j]=W,j=ae;else break e}}function t(N){return N.length===0?null:N[0]}function i(N){if(N.length===0)return null;var V=N[0],j=N.pop();if(j!==V){N[0]=j;e:for(var ae=0,W=N.length,ce=W>>>1;ae<ce;){var ve=2*(ae+1)-1,_e=N[ve],$=ve+1,ke=N[$];if(0>r(_e,j))$<W&&0>r(ke,_e)?(N[ae]=ke,N[$]=j,ae=$):(N[ae]=_e,N[ve]=j,ae=ve);else if($<W&&0>r(ke,j))N[ae]=ke,N[$]=j,ae=$;else break e}}return V}function r(N,V){var j=N.sortIndex-V.sortIndex;return j!==0?j:N.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],f=[],h=1,d=null,p=3,m=!1,v=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(N){for(var V=t(f);V!==null;){if(V.callback===null)i(f);else if(V.startTime<=N)i(f),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(f)}}function S(N){if(y=!1,w(N),!v)if(t(l)!==null)v=!0,te(b);else{var V=t(f);V!==null&&le(S,V.startTime-N)}}function b(N,V){v=!1,y&&(y=!1,_(E),E=-1),m=!0;var j=p;try{for(w(V),d=t(l);d!==null&&(!(d.expirationTime>V)||N&&!z());){var ae=d.callback;if(typeof ae=="function"){d.callback=null,p=d.priorityLevel;var W=ae(d.expirationTime<=V);V=n.unstable_now(),typeof W=="function"?d.callback=W:d===t(l)&&i(l),w(V)}else i(l);d=t(l)}if(d!==null)var ce=!0;else{var ve=t(f);ve!==null&&le(S,ve.startTime-V),ce=!1}return ce}finally{d=null,p=j,m=!1}}var P=!1,R=null,E=-1,B=5,L=-1;function z(){return!(n.unstable_now()-L<B)}function Z(){if(R!==null){var N=n.unstable_now();L=N;var V=!0;try{V=R(!0,N)}finally{V?J():(P=!1,R=null)}}else P=!1}var J;if(typeof A=="function")J=function(){A(Z)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,Y=H.port2;H.port1.onmessage=Z,J=function(){Y.postMessage(null)}}else J=function(){x(Z,0)};function te(N){R=N,P||(P=!0,J())}function le(N,V){E=x(function(){N(n.unstable_now())},V)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(N){N.callback=null},n.unstable_continueExecution=function(){v||m||(v=!0,te(b))},n.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<N?Math.floor(1e3/N):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(N){switch(p){case 1:case 2:case 3:var V=3;break;default:V=p}var j=p;p=V;try{return N()}finally{p=j}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(N,V){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var j=p;p=N;try{return V()}finally{p=j}},n.unstable_scheduleCallback=function(N,V,j){var ae=n.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?ae+j:ae):j=ae,N){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=j+W,N={id:h++,callback:V,priorityLevel:N,startTime:j,expirationTime:W,sortIndex:-1},j>ae?(N.sortIndex=j,e(f,N),t(l)===null&&N===t(f)&&(y?(_(E),E=-1):y=!0,le(S,j-ae))):(N.sortIndex=W,e(l,N),v||m||(v=!0,te(b))),N},n.unstable_shouldYield=z,n.unstable_wrapCallback=function(N){var V=p;return function(){var j=p;p=V;try{return N.apply(this,arguments)}finally{p=j}}}})(C3);(function(n){n.exports=C3})(x5);/** * @license React * react-reconciler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var _5=function(e){var t={},i=U,r=$f,s=Object.assign;function o(u){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+u,g=1;g<arguments.length;g++)c+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+u+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=Symbol.for("react.element"),f=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),v=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),b=Symbol.iterator;function P(u){return u===null||typeof u!="object"?null:(u=b&&u[b]||u["@@iterator"],typeof u=="function"?u:null)}function R(u){if(u==null)return null;if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case h:return"Fragment";case f:return"Portal";case p:return"Profiler";case d:return"StrictMode";case x:return"Suspense";case _:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case v:return(u.displayName||"Context")+".Consumer";case m:return(u._context.displayName||"Context")+".Provider";case y:var c=u.render;return u=u.displayName,u||(u=c.displayName||c.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case A:return c=u.displayName||null,c!==null?c:R(u.type)||"Memo";case w:c=u._payload,u=u._init;try{return R(u(c))}catch{}}return null}function E(u){var c=u.type;switch(u.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return u=c.render,u=u.displayName||u.name||"",c.displayName||(u!==""?"ForwardRef("+u+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return R(c);case 8:return c===d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function B(u){var c=u,g=u;if(u.alternate)for(;c.return;)c=c.return;else{u=c;do c=u,c.flags&4098&&(g=c.return),u=c.return;while(u)}return c.tag===3?g:null}function L(u){if(B(u)!==u)throw Error(o(188))}function z(u){var c=u.alternate;if(!c){if(c=B(u),c===null)throw Error(o(188));return c!==u?null:u}for(var g=u,M=c;;){var C=g.return;if(C===null)break;var T=C.alternate;if(T===null){if(M=C.return,M!==null){g=M;continue}break}if(C.child===T.child){for(T=C.child;T;){if(T===g)return L(C),u;if(T===M)return L(C),c;T=T.sibling}throw Error(o(188))}if(g.return!==M.return)g=C,M=T;else{for(var k=!1,X=C.child;X;){if(X===g){k=!0,g=C,M=T;break}if(X===M){k=!0,M=C,g=T;break}X=X.sibling}if(!k){for(X=T.child;X;){if(X===g){k=!0,g=T,M=C;break}if(X===M){k=!0,M=T,g=C;break}X=X.sibling}if(!k)throw Error(o(189))}}if(g.alternate!==M)throw Error(o(190))}if(g.tag!==3)throw Error(o(188));return g.stateNode.current===g?u:c}function Z(u){return u=z(u),u!==null?J(u):null}function J(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){var c=J(u);if(c!==null)return c;u=u.sibling}return null}function H(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){if(u.tag!==4){var c=H(u);if(c!==null)return c}u=u.sibling}return null}var Y=Array.isArray,te=e.getPublicInstance,le=e.getRootHostContext,N=e.getChildHostContext,V=e.prepareForCommit,j=e.resetAfterCommit,ae=e.createInstance,W=e.appendInitialChild,ce=e.finalizeInitialChildren,ve=e.prepareUpdate,_e=e.shouldSetTextContent,$=e.createTextInstance,ke=e.scheduleTimeout,Oe=e.cancelTimeout,He=e.noTimeout,Me=e.isPrimaryRenderer,Ie=e.supportsMutation,he=e.supportsPersistence,re=e.supportsHydration,Ce=e.getInstanceFromNode,ze=e.preparePortalMount,Be=e.getCurrentEventPriority,Ze=e.detachDeletedInstance,Je=e.supportsMicrotasks,je=e.scheduleMicrotask,vt=e.supportsTestSelectors,wt=e.findFiberRoot,O=e.getBoundingRect,I=e.getTextContent,ie=e.isHiddenSubtree,we=e.matchAccessibilityRole,Ee=e.setFocusIfFocusable,Pe=e.setupIntersectionObserver,nt=e.appendChild,De=e.appendChildToContainer,ge=e.commitTextUpdate,Xe=e.commitMount,G=e.commitUpdate,se=e.insertBefore,Ae=e.insertInContainerBefore,Te=e.removeChild,$e=e.removeChildFromContainer,yt=e.resetTextContent,Vt=e.hideInstance,K=e.hideTextInstance,ue=e.unhideInstance,xe=e.unhideTextInstance,Ue=e.clearContainer,Ye=e.cloneInstance,Pt=e.createContainerChildSet,hn=e.appendChildToContainerChildSet,Bn=e.finalizeContainerChildren,zr=e.replaceContainerChildren,Ot=e.cloneHiddenInstance,Ji=e.cloneHiddenTextInstance,mi=e.canHydrateInstance,Uh=e.canHydrateTextInstance,Zg=e.canHydrateSuspenseInstance,zh=e.isSuspenseInstancePending,ec=e.isSuspenseInstanceFallback,F=e.registerSuspenseInstanceRetry,ee=e.getNextHydratableSibling,de=e.getFirstHydratableChild,q=e.getFirstHydratableChildWithinContainer,ye=e.getFirstHydratableChildWithinSuspenseInstance,qe=e.hydrateInstance,st=e.hydrateTextInstance,ft=e.hydrateSuspenseInstance,mt=e.getNextHydratableInstanceAfterSuspenseInstance,St=e.commitHydratedContainer,_t=e.commitHydratedSuspenseInstance,At=e.clearSuspenseBoundary,on=e.clearSuspenseBoundaryFromContainer,ni=e.shouldDeleteUnhydratedTailInstances,yr=e.didNotMatchHydratedContainerTextInstance,as=e.didNotMatchHydratedTextInstance,Jt;function ht(u){if(Jt===void 0)try{throw Error()}catch(g){var c=g.stack.trim().match(/\n( *(at )?)/);Jt=c&&c[1]||""}return` `+Jt+u}var ea=!1;function an(u,c){if(!u||ea)return"";ea=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(be){var M=be}Reflect.construct(u,[],c)}else{try{c.call()}catch(be){M=be}u.call(c.prototype)}else{try{throw Error()}catch(be){M=be}u()}}catch(be){if(be&&M&&typeof be.stack=="string"){for(var C=be.stack.split(` `),T=M.stack.split(` `),k=C.length-1,X=T.length-1;1<=k&&0<=X&&C[k]!==T[X];)X--;for(;1<=k&&0<=X;k--,X--)if(C[k]!==T[X]){if(k!==1||X!==1)do if(k--,X--,0>X||C[k]!==T[X]){var fe=` `+C[k].replace(" at new "," at ");return u.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",u.displayName)),fe}while(1<=k&&0<=X);break}}}finally{ea=!1,Error.prepareStackTrace=g}return(u=u?u.displayName||u.name:"")?ht(u):""}var ls=Object.prototype.hasOwnProperty,dl=[],Xi=-1;function Ki(u){return{current:u}}function ct(u){0>Xi||(u.current=dl[Xi],dl[Xi]=null,Xi--)}function Et(u,c){Xi++,dl[Xi]=u.current,u.current=c}var Yi={},Ft=Ki(Yi),Rn=Ki(!1),us=Yi;function cs(u,c){var g=u.type.contextTypes;if(!g)return Yi;var M=u.stateNode;if(M&&M.__reactInternalMemoizedUnmaskedChildContext===c)return M.__reactInternalMemoizedMaskedChildContext;var C={},T;for(T in g)C[T]=c[T];return M&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=c,u.__reactInternalMemoizedMaskedChildContext=C),C}function gi(u){return u=u.childContextTypes,u!=null}function Gh(){ct(Rn),ct(Ft)}function mM(u,c,g){if(Ft.current!==Yi)throw Error(o(168));Et(Ft,c),Et(Rn,g)}function gM(u,c,g){var M=u.stateNode;if(c=c.childContextTypes,typeof M.getChildContext!="function")return g;M=M.getChildContext();for(var C in M)if(!(C in c))throw Error(o(108,E(u)||"Unknown",C));return s({},g,M)}function Hh(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||Yi,us=Ft.current,Et(Ft,u),Et(Rn,Rn.current),!0}function yM(u,c,g){var M=u.stateNode;if(!M)throw Error(o(169));g?(u=gM(u,c,us),M.__reactInternalMemoizedMergedChildContext=u,ct(Rn),ct(Ft),Et(Ft,u)):ct(Rn),Et(Rn,g)}var vr=Math.clz32?Math.clz32:wL,AL=Math.log,ML=Math.LN2;function wL(u){return u>>>=0,u===0?32:31-(AL(u)/ML|0)|0}var Vh=64,Wh=4194304;function tc(u){switch(u&-u){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: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 u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function jh(u,c){var g=u.pendingLanes;if(g===0)return 0;var M=0,C=u.suspendedLanes,T=u.pingedLanes,k=g&268435455;if(k!==0){var X=k&~C;X!==0?M=tc(X):(T&=k,T!==0&&(M=tc(T)))}else k=g&~C,k!==0?M=tc(k):T!==0&&(M=tc(T));if(M===0)return 0;if(c!==0&&c!==M&&!(c&C)&&(C=M&-M,T=c&-c,C>=T||C===16&&(T&4194240)!==0))return c;if(M&4&&(M|=g&16),c=u.entangledLanes,c!==0)for(u=u.entanglements,c&=M;0<c;)g=31-vr(c),C=1<<g,M|=u[g],c&=~C;return M}function SL(u,c){switch(u){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64: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 c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function CL(u,c){for(var g=u.suspendedLanes,M=u.pingedLanes,C=u.expirationTimes,T=u.pendingLanes;0<T;){var k=31-vr(T),X=1<<k,fe=C[k];fe===-1?(!(X&g)||X&M)&&(C[k]=SL(X,c)):fe<=c&&(u.expiredLanes|=X),T&=~X}}function qg(u){return u=u.pendingLanes&-1073741825,u!==0?u:u&1073741824?1073741824:0}function $g(u){for(var c=[],g=0;31>g;g++)c.push(u);return c}function nc(u,c,g){u.pendingLanes|=c,c!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,c=31-vr(c),u[c]=g}function EL(u,c){var g=u.pendingLanes&~c;u.pendingLanes=c,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=c,u.mutableReadLanes&=c,u.entangledLanes&=c,c=u.entanglements;var M=u.eventTimes;for(u=u.expirationTimes;0<g;){var C=31-vr(g),T=1<<C;c[C]=0,M[C]=-1,u[C]=-1,g&=~T}}function e0(u,c){var g=u.entangledLanes|=c;for(u=u.entanglements;g;){var M=31-vr(g),C=1<<M;C&c|u[M]&c&&(u[M]|=c),g&=~C}}var Rt=0;function vM(u){return u&=-u,1<u?4<u?u&268435455?16:536870912:4:1}var t0=r.unstable_scheduleCallback,xM=r.unstable_cancelCallback,bL=r.unstable_shouldYield,TL=r.unstable_requestPaint,Ln=r.unstable_now,n0=r.unstable_ImmediatePriority,PL=r.unstable_UserBlockingPriority,i0=r.unstable_NormalPriority,BL=r.unstable_IdlePriority,Jh=null,Gr=null;function RL(u){if(Gr&&typeof Gr.onCommitFiberRoot=="function")try{Gr.onCommitFiberRoot(Jh,u,void 0,(u.current.flags&128)===128)}catch{}}function LL(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var Hr=typeof Object.is=="function"?Object.is:LL,fs=null,Xh=!1,r0=!1;function _M(u){fs===null?fs=[u]:fs.push(u)}function IL(u){Xh=!0,_M(u)}function Vr(){if(!r0&&fs!==null){r0=!0;var u=0,c=Rt;try{var g=fs;for(Rt=1;u<g.length;u++){var M=g[u];do M=M(!0);while(M!==null)}fs=null,Xh=!1}catch(C){throw fs!==null&&(fs=fs.slice(u+1)),t0(n0,Vr),C}finally{Rt=c,r0=!1}}return null}var DL=a.ReactCurrentBatchConfig;function Kh(u,c){if(Hr(u,c))return!0;if(typeof u!="object"||u===null||typeof c!="object"||c===null)return!1;var g=Object.keys(u),M=Object.keys(c);if(g.length!==M.length)return!1;for(M=0;M<g.length;M++){var C=g[M];if(!ls.call(c,C)||!Hr(u[C],c[C]))return!1}return!0}function FL(u){switch(u.tag){case 5:return ht(u.type);case 16:return ht("Lazy");case 13:return ht("Suspense");case 19:return ht("SuspenseList");case 0:case 2:case 15:return u=an(u.type,!1),u;case 11:return u=an(u.type.render,!1),u;case 1:return u=an(u.type,!0),u;default:return""}}function xr(u,c){if(u&&u.defaultProps){c=s({},c),u=u.defaultProps;for(var g in u)c[g]===void 0&&(c[g]=u[g]);return c}return c}var Yh=Ki(null),Qh=null,pl=null,s0=null;function o0(){s0=pl=Qh=null}function AM(u,c,g){Me?(Et(Yh,c._currentValue),c._currentValue=g):(Et(Yh,c._currentValue2),c._currentValue2=g)}function a0(u){var c=Yh.current;ct(Yh),Me?u._currentValue=c:u._currentValue2=c}function l0(u,c,g){for(;u!==null;){var M=u.alternate;if((u.childLanes&c)!==c?(u.childLanes|=c,M!==null&&(M.childLanes|=c)):M!==null&&(M.childLanes&c)!==c&&(M.childLanes|=c),u===g)break;u=u.return}}function ml(u,c){Qh=u,s0=pl=null,u=u.dependencies,u!==null&&u.firstContext!==null&&(u.lanes&c&&(Bi=!0),u.firstContext=null)}function Qi(u){var c=Me?u._currentValue:u._currentValue2;if(s0!==u)if(u={context:u,memoizedValue:c,next:null},pl===null){if(Qh===null)throw Error(o(308));pl=u,Qh.dependencies={lanes:0,firstContext:u}}else pl=pl.next=u;return c}var Wr=null,Ys=!1;function u0(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function MM(u,c){u=u.updateQueue,c.updateQueue===u&&(c.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,effects:u.effects})}function hs(u,c){return{eventTime:u,lane:c,tag:0,payload:null,callback:null,next:null}}function Qs(u,c){var g=u.updateQueue;g!==null&&(g=g.shared,yn!==null&&u.mode&1&&!(gt&2)?(u=g.interleaved,u===null?(c.next=c,Wr===null?Wr=[g]:Wr.push(g)):(c.next=u.next,u.next=c),g.interleaved=c):(u=g.pending,u===null?c.next=c:(c.next=u.next,u.next=c),g.pending=c))}function Zh(u,c,g){if(c=c.updateQueue,c!==null&&(c=c.shared,(g&4194240)!==0)){var M=c.lanes;M&=u.pendingLanes,g|=M,c.lanes=g,e0(u,g)}}function wM(u,c){var g=u.updateQueue,M=u.alternate;if(M!==null&&(M=M.updateQueue,g===M)){var C=null,T=null;if(g=g.firstBaseUpdate,g!==null){do{var k={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};T===null?C=T=k:T=T.next=k,g=g.next}while(g!==null);T===null?C=T=c:T=T.next=c}else C=T=c;g={baseState:M.baseState,firstBaseUpdate:C,lastBaseUpdate:T,shared:M.shared,effects:M.effects},u.updateQueue=g;return}u=g.lastBaseUpdate,u===null?g.firstBaseUpdate=c:u.next=c,g.lastBaseUpdate=c}function qh(u,c,g,M){var C=u.updateQueue;Ys=!1;var T=C.firstBaseUpdate,k=C.lastBaseUpdate,X=C.shared.pending;if(X!==null){C.shared.pending=null;var fe=X,be=fe.next;fe.next=null,k===null?T=be:k.next=be,k=fe;var Ve=u.alternate;Ve!==null&&(Ve=Ve.updateQueue,X=Ve.lastBaseUpdate,X!==k&&(X===null?Ve.firstBaseUpdate=be:X.next=be,Ve.lastBaseUpdate=fe))}if(T!==null){var ot=C.baseState;k=0,Ve=be=fe=null,X=T;do{var et=X.lane,Ut=X.eventTime;if((M&et)===et){Ve!==null&&(Ve=Ve.next={eventTime:Ut,lane:0,tag:X.tag,payload:X.payload,callback:X.callback,next:null});e:{var Qe=u,Kn=X;switch(et=c,Ut=g,Kn.tag){case 1:if(Qe=Kn.payload,typeof Qe=="function"){ot=Qe.call(Ut,ot,et);break e}ot=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=Kn.payload,et=typeof Qe=="function"?Qe.call(Ut,ot,et):Qe,et==null)break e;ot=s({},ot,et);break e;case 2:Ys=!0}}X.callback!==null&&X.lane!==0&&(u.flags|=64,et=C.effects,et===null?C.effects=[X]:et.push(X))}else Ut={eventTime:Ut,lane:et,tag:X.tag,payload:X.payload,callback:X.callback,next:null},Ve===null?(be=Ve=Ut,fe=ot):Ve=Ve.next=Ut,k|=et;if(X=X.next,X===null){if(X=C.shared.pending,X===null)break;et=X,X=et.next,et.next=null,C.lastBaseUpdate=et,C.shared.pending=null}}while(1);if(Ve===null&&(fe=ot),C.baseState=fe,C.firstBaseUpdate=be,C.lastBaseUpdate=Ve,c=C.shared.interleaved,c!==null){C=c;do k|=C.lane,C=C.next;while(C!==c)}else T===null&&(C.shared.lanes=0);Sl|=k,u.lanes=k,u.memoizedState=ot}}function SM(u,c,g){if(u=c.effects,c.effects=null,u!==null)for(c=0;c<u.length;c++){var M=u[c],C=M.callback;if(C!==null){if(M.callback=null,M=g,typeof C!="function")throw Error(o(191,C));C.call(M)}}}var CM=new i.Component().refs;function c0(u,c,g,M){c=u.memoizedState,g=g(M,c),g=g==null?c:s({},c,g),u.memoizedState=g,u.lanes===0&&(u.updateQueue.baseState=g)}var $h={isMounted:function(u){return(u=u._reactInternals)?B(u)===u:!1},enqueueSetState:function(u,c,g){u=u._reactInternals;var M=ri(),C=$s(u),T=hs(M,C);T.payload=c,g!=null&&(T.callback=g),Qs(u,T),c=tr(u,C,M),c!==null&&Zh(c,u,C)},enqueueReplaceState:function(u,c,g){u=u._reactInternals;var M=ri(),C=$s(u),T=hs(M,C);T.tag=1,T.payload=c,g!=null&&(T.callback=g),Qs(u,T),c=tr(u,C,M),c!==null&&Zh(c,u,C)},enqueueForceUpdate:function(u,c){u=u._reactInternals;var g=ri(),M=$s(u),C=hs(g,M);C.tag=2,c!=null&&(C.callback=c),Qs(u,C),c=tr(u,M,g),c!==null&&Zh(c,u,M)}};function EM(u,c,g,M,C,T,k){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(M,T,k):c.prototype&&c.prototype.isPureReactComponent?!Kh(g,M)||!Kh(C,T):!0}function bM(u,c,g){var M=!1,C=Yi,T=c.contextType;return typeof T=="object"&&T!==null?T=Qi(T):(C=gi(c)?us:Ft.current,M=c.contextTypes,T=(M=M!=null)?cs(u,C):Yi),c=new c(g,T),u.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=$h,u.stateNode=c,c._reactInternals=u,M&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=C,u.__reactInternalMemoizedMaskedChildContext=T),c}function TM(u,c,g,M){u=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(g,M),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(g,M),c.state!==u&&$h.enqueueReplaceState(c,c.state,null)}function f0(u,c,g,M){var C=u.stateNode;C.props=g,C.state=u.memoizedState,C.refs=CM,u0(u);var T=c.contextType;typeof T=="object"&&T!==null?C.context=Qi(T):(T=gi(c)?us:Ft.current,C.context=cs(u,T)),C.state=u.memoizedState,T=c.getDerivedStateFromProps,typeof T=="function"&&(c0(u,c,T,g),C.state=u.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(c=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),c!==C.state&&$h.enqueueReplaceState(C,C.state,null),qh(u,g,C,M),C.state=u.memoizedState),typeof C.componentDidMount=="function"&&(u.flags|=4194308)}var gl=[],yl=0,ed=null,td=0,Zi=[],qi=0,ta=null,ds=1,ps="";function na(u,c){gl[yl++]=td,gl[yl++]=ed,ed=u,td=c}function PM(u,c,g){Zi[qi++]=ds,Zi[qi++]=ps,Zi[qi++]=ta,ta=u;var M=ds;u=ps;var C=32-vr(M)-1;M&=~(1<<C),g+=1;var T=32-vr(c)+C;if(30<T){var k=C-C%5;T=(M&(1<<k)-1).toString(32),M>>=k,C-=k,ds=1<<32-vr(c)+C|g<<C|M,ps=T+u}else ds=1<<T|g<<C|M,ps=u}function h0(u){u.return!==null&&(na(u,1),PM(u,1,0))}function d0(u){for(;u===ed;)ed=gl[--yl],gl[yl]=null,td=gl[--yl],gl[yl]=null;for(;u===ta;)ta=Zi[--qi],Zi[qi]=null,ps=Zi[--qi],Zi[qi]=null,ds=Zi[--qi],Zi[qi]=null}var Ti=null,Pi=null,Xt=!1,ic=!1,_r=null;function BM(u,c){var g=nr(5,null,null,0);g.elementType="DELETED",g.stateNode=c,g.return=u,c=u.deletions,c===null?(u.deletions=[g],u.flags|=16):c.push(g)}function RM(u,c){switch(u.tag){case 5:return c=mi(c,u.type,u.pendingProps),c!==null?(u.stateNode=c,Ti=u,Pi=de(c),!0):!1;case 6:return c=Uh(c,u.pendingProps),c!==null?(u.stateNode=c,Ti=u,Pi=null,!0):!1;case 13:if(c=Zg(c),c!==null){var g=ta!==null?{id:ds,overflow:ps}:null;return u.memoizedState={dehydrated:c,treeContext:g,retryLane:1073741824},g=nr(18,null,null,0),g.stateNode=c,g.return=u,u.child=g,Ti=u,Pi=null,!0}return!1;default:return!1}}function p0(u){return(u.mode&1)!==0&&(u.flags&128)===0}function m0(u){if(Xt){var c=Pi;if(c){var g=c;if(!RM(u,c)){if(p0(u))throw Error(o(418));c=ee(g);var M=Ti;c&&RM(u,c)?BM(M,g):(u.flags=u.flags&-4097|2,Xt=!1,Ti=u)}}else{if(p0(u))throw Error(o(418));u.flags=u.flags&-4097|2,Xt=!1,Ti=u}}}function LM(u){for(u=u.return;u!==null&&u.tag!==5&&u.tag!==3&&u.tag!==13;)u=u.return;Ti=u}function rc(u){if(!re||u!==Ti)return!1;if(!Xt)return LM(u),Xt=!0,!1;if(u.tag!==3&&(u.tag!==5||ni(u.type)&&!_e(u.type,u.memoizedProps))){var c=Pi;if(c){if(p0(u)){for(u=Pi;u;)u=ee(u);throw Error(o(418))}for(;c;)BM(u,c),c=ee(c)}}if(LM(u),u.tag===13){if(!re)throw Error(o(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));Pi=mt(u)}else Pi=Ti?ee(u.stateNode):null;return!0}function vl(){re&&(Pi=Ti=null,ic=Xt=!1)}function g0(u){_r===null?_r=[u]:_r.push(u)}function sc(u,c,g){if(u=g.ref,u!==null&&typeof u!="function"&&typeof u!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(o(309));var M=g.stateNode}if(!M)throw Error(o(147,u));var C=M,T=""+u;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===T?c.ref:(c=function(k){var X=C.refs;X===CM&&(X=C.refs={}),k===null?delete X[T]:X[T]=k},c._stringRef=T,c)}if(typeof u!="string")throw Error(o(284));if(!g._owner)throw Error(o(290,u))}return u}function nd(u,c){throw u=Object.prototype.toString.call(c),Error(o(31,u==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":u))}function IM(u){var c=u._init;return c(u._payload)}function DM(u){function c(ne,Q){if(u){var oe=ne.deletions;oe===null?(ne.deletions=[Q],ne.flags|=16):oe.push(Q)}}function g(ne,Q){if(!u)return null;for(;Q!==null;)c(ne,Q),Q=Q.sibling;return null}function M(ne,Q){for(ne=new Map;Q!==null;)Q.key!==null?ne.set(Q.key,Q):ne.set(Q.index,Q),Q=Q.sibling;return ne}function C(ne,Q){return ne=to(ne,Q),ne.index=0,ne.sibling=null,ne}function T(ne,Q,oe){return ne.index=oe,u?(oe=ne.alternate,oe!==null?(oe=oe.index,oe<Q?(ne.flags|=2,Q):oe):(ne.flags|=2,Q)):(ne.flags|=1048576,Q)}function k(ne){return u&&ne.alternate===null&&(ne.flags|=2),ne}function X(ne,Q,oe,Ne){return Q===null||Q.tag!==6?(Q=$0(oe,ne.mode,Ne),Q.return=ne,Q):(Q=C(Q,oe),Q.return=ne,Q)}function fe(ne,Q,oe,Ne){var Ke=oe.type;return Ke===h?Ve(ne,Q,oe.props.children,Ne,oe.key):Q!==null&&(Q.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===w&&IM(Ke)===Q.type)?(Ne=C(Q,oe.props),Ne.ref=sc(ne,Q,oe),Ne.return=ne,Ne):(Ne=Id(oe.type,oe.key,oe.props,null,ne.mode,Ne),Ne.ref=sc(ne,Q,oe),Ne.return=ne,Ne)}function be(ne,Q,oe,Ne){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==oe.containerInfo||Q.stateNode.implementation!==oe.implementation?(Q=ey(oe,ne.mode,Ne),Q.return=ne,Q):(Q=C(Q,oe.children||[]),Q.return=ne,Q)}function Ve(ne,Q,oe,Ne,Ke){return Q===null||Q.tag!==7?(Q=ua(oe,ne.mode,Ne,Ke),Q.return=ne,Q):(Q=C(Q,oe),Q.return=ne,Q)}function ot(ne,Q,oe){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Q=$0(""+Q,ne.mode,oe),Q.return=ne,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case l:return oe=Id(Q.type,Q.key,Q.props,null,ne.mode,oe),oe.ref=sc(ne,null,Q),oe.return=ne,oe;case f:return Q=ey(Q,ne.mode,oe),Q.return=ne,Q;case w:var Ne=Q._init;return ot(ne,Ne(Q._payload),oe)}if(Y(Q)||P(Q))return Q=ua(Q,ne.mode,oe,null),Q.return=ne,Q;nd(ne,Q)}return null}function et(ne,Q,oe,Ne){var Ke=Q!==null?Q.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number")return Ke!==null?null:X(ne,Q,""+oe,Ne);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case l:return oe.key===Ke?fe(ne,Q,oe,Ne):null;case f:return oe.key===Ke?be(ne,Q,oe,Ne):null;case w:return Ke=oe._init,et(ne,Q,Ke(oe._payload),Ne)}if(Y(oe)||P(oe))return Ke!==null?null:Ve(ne,Q,oe,Ne,null);nd(ne,oe)}return null}function Ut(ne,Q,oe,Ne,Ke){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number")return ne=ne.get(oe)||null,X(Q,ne,""+Ne,Ke);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case l:return ne=ne.get(Ne.key===null?oe:Ne.key)||null,fe(Q,ne,Ne,Ke);case f:return ne=ne.get(Ne.key===null?oe:Ne.key)||null,be(Q,ne,Ne,Ke);case w:var dt=Ne._init;return Ut(ne,Q,oe,dt(Ne._payload),Ke)}if(Y(Ne)||P(Ne))return ne=ne.get(oe)||null,Ve(Q,ne,Ne,Ke,null);nd(Q,Ne)}return null}function Qe(ne,Q,oe,Ne){for(var Ke=null,dt=null,at=Q,Lt=Q=0,Dn=null;at!==null&&Lt<oe.length;Lt++){at.index>Lt?(Dn=at,at=null):Dn=at.sibling;var It=et(ne,at,oe[Lt],Ne);if(It===null){at===null&&(at=Dn);break}u&&at&&It.alternate===null&&c(ne,at),Q=T(It,Q,Lt),dt===null?Ke=It:dt.sibling=It,dt=It,at=Dn}if(Lt===oe.length)return g(ne,at),Xt&&na(ne,Lt),Ke;if(at===null){for(;Lt<oe.length;Lt++)at=ot(ne,oe[Lt],Ne),at!==null&&(Q=T(at,Q,Lt),dt===null?Ke=at:dt.sibling=at,dt=at);return Xt&&na(ne,Lt),Ke}for(at=M(ne,at);Lt<oe.length;Lt++)Dn=Ut(at,ne,Lt,oe[Lt],Ne),Dn!==null&&(u&&Dn.alternate!==null&&at.delete(Dn.key===null?Lt:Dn.key),Q=T(Dn,Q,Lt),dt===null?Ke=Dn:dt.sibling=Dn,dt=Dn);return u&&at.forEach(function(no){return c(ne,no)}),Xt&&na(ne,Lt),Ke}function Kn(ne,Q,oe,Ne){var Ke=P(oe);if(typeof Ke!="function")throw Error(o(150));if(oe=Ke.call(oe),oe==null)throw Error(o(151));for(var dt=Ke=null,at=Q,Lt=Q=0,Dn=null,It=oe.next();at!==null&&!It.done;Lt++,It=oe.next()){at.index>Lt?(Dn=at,at=null):Dn=at.sibling;var no=et(ne,at,It.value,Ne);if(no===null){at===null&&(at=Dn);break}u&&at&&no.alternate===null&&c(ne,at),Q=T(no,Q,Lt),dt===null?Ke=no:dt.sibling=no,dt=no,at=Dn}if(It.done)return g(ne,at),Xt&&na(ne,Lt),Ke;if(at===null){for(;!It.done;Lt++,It=oe.next())It=ot(ne,It.value,Ne),It!==null&&(Q=T(It,Q,Lt),dt===null?Ke=It:dt.sibling=It,dt=It);return Xt&&na(ne,Lt),Ke}for(at=M(ne,at);!It.done;Lt++,It=oe.next())It=Ut(at,ne,Lt,It.value,Ne),It!==null&&(u&&It.alternate!==null&&at.delete(It.key===null?Lt:It.key),Q=T(It,Q,Lt),dt===null?Ke=It:dt.sibling=It,dt=It);return u&&at.forEach(function(fI){return c(ne,fI)}),Xt&&na(ne,Lt),Ke}function ir(ne,Q,oe,Ne){if(typeof oe=="object"&&oe!==null&&oe.type===h&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case l:e:{for(var Ke=oe.key,dt=Q;dt!==null;){if(dt.key===Ke){if(Ke=oe.type,Ke===h){if(dt.tag===7){g(ne,dt.sibling),Q=C(dt,oe.props.children),Q.return=ne,ne=Q;break e}}else if(dt.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===w&&IM(Ke)===dt.type){g(ne,dt.sibling),Q=C(dt,oe.props),Q.ref=sc(ne,dt,oe),Q.return=ne,ne=Q;break e}g(ne,dt);break}else c(ne,dt);dt=dt.sibling}oe.type===h?(Q=ua(oe.props.children,ne.mode,Ne,oe.key),Q.return=ne,ne=Q):(Ne=Id(oe.type,oe.key,oe.props,null,ne.mode,Ne),Ne.ref=sc(ne,Q,oe),Ne.return=ne,ne=Ne)}return k(ne);case f:e:{for(dt=oe.key;Q!==null;){if(Q.key===dt)if(Q.tag===4&&Q.stateNode.containerInfo===oe.containerInfo&&Q.stateNode.implementation===oe.implementation){g(ne,Q.sibling),Q=C(Q,oe.children||[]),Q.return=ne,ne=Q;break e}else{g(ne,Q);break}else c(ne,Q);Q=Q.sibling}Q=ey(oe,ne.mode,Ne),Q.return=ne,ne=Q}return k(ne);case w:return dt=oe._init,ir(ne,Q,dt(oe._payload),Ne)}if(Y(oe))return Qe(ne,Q,oe,Ne);if(P(oe))return Kn(ne,Q,oe,Ne);nd(ne,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"?(oe=""+oe,Q!==null&&Q.tag===6?(g(ne,Q.sibling),Q=C(Q,oe),Q.return=ne,ne=Q):(g(ne,Q),Q=$0(oe,ne.mode,Ne),Q.return=ne,ne=Q),k(ne)):g(ne,Q)}return ir}var xl=DM(!0),FM=DM(!1),oc={},$i=Ki(oc),ac=Ki(oc),_l=Ki(oc);function jr(u){if(u===oc)throw Error(o(174));return u}function y0(u,c){Et(_l,c),Et(ac,u),Et($i,oc),u=le(c),ct($i),Et($i,u)}function Al(){ct($i),ct(ac),ct(_l)}function NM(u){var c=jr(_l.current),g=jr($i.current);c=N(g,u.type,c),g!==c&&(Et(ac,u),Et($i,c))}function v0(u){ac.current===u&&(ct($i),ct(ac))}var Zt=Ki(0);function id(u){for(var c=u;c!==null;){if(c.tag===13){var g=c.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||zh(g)||ec(g)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break;for(;c.sibling===null;){if(c.return===null||c.return===u)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var x0=[];function _0(){for(var u=0;u<x0.length;u++){var c=x0[u];Me?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}x0.length=0}var rd=a.ReactCurrentDispatcher,er=a.ReactCurrentBatchConfig,Ml=0,ln=null,jn=null,In=null,sd=!1,lc=!1,uc=0,NL=0;function Jn(){throw Error(o(321))}function A0(u,c){if(c===null)return!1;for(var g=0;g<c.length&&g<u.length;g++)if(!Hr(u[g],c[g]))return!1;return!0}function M0(u,c,g,M,C,T){if(Ml=T,ln=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,rd.current=u===null||u.memoizedState===null?zL:GL,u=g(M,C),lc){T=0;do{if(lc=!1,uc=0,25<=T)throw Error(o(301));T+=1,In=jn=null,c.updateQueue=null,rd.current=HL,u=g(M,C)}while(lc)}if(rd.current=cd,c=jn!==null&&jn.next!==null,Ml=0,In=jn=ln=null,sd=!1,c)throw Error(o(300));return u}function w0(){var u=uc!==0;return uc=0,u}function ms(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return In===null?ln.memoizedState=In=u:In=In.next=u,In}function Jr(){if(jn===null){var u=ln.alternate;u=u!==null?u.memoizedState:null}else u=jn.next;var c=In===null?ln.memoizedState:In.next;if(c!==null)In=c,jn=u;else{if(u===null)throw Error(o(310));jn=u,u={memoizedState:jn.memoizedState,baseState:jn.baseState,baseQueue:jn.baseQueue,queue:jn.queue,next:null},In===null?ln.memoizedState=In=u:In=In.next=u}return In}function ia(u,c){return typeof c=="function"?c(u):c}function od(u){var c=Jr(),g=c.queue;if(g===null)throw Error(o(311));g.lastRenderedReducer=u;var M=jn,C=M.baseQueue,T=g.pending;if(T!==null){if(C!==null){var k=C.next;C.next=T.next,T.next=k}M.baseQueue=C=T,g.pending=null}if(C!==null){T=C.next,M=M.baseState;var X=k=null,fe=null,be=T;do{var Ve=be.lane;if((Ml&Ve)===Ve)fe!==null&&(fe=fe.next={lane:0,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),M=be.hasEagerState?be.eagerState:u(M,be.action);else{var ot={lane:Ve,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null};fe===null?(X=fe=ot,k=M):fe=fe.next=ot,ln.lanes|=Ve,Sl|=Ve}be=be.next}while(be!==null&&be!==T);fe===null?k=M:fe.next=X,Hr(M,c.memoizedState)||(Bi=!0),c.memoizedState=M,c.baseState=k,c.baseQueue=fe,g.lastRenderedState=M}if(u=g.interleaved,u!==null){C=u;do T=C.lane,ln.lanes|=T,Sl|=T,C=C.next;while(C!==u)}else C===null&&(g.lanes=0);return[c.memoizedState,g.dispatch]}function ad(u){var c=Jr(),g=c.queue;if(g===null)throw Error(o(311));g.lastRenderedReducer=u;var M=g.dispatch,C=g.pending,T=c.memoizedState;if(C!==null){g.pending=null;var k=C=C.next;do T=u(T,k.action),k=k.next;while(k!==C);Hr(T,c.memoizedState)||(Bi=!0),c.memoizedState=T,c.baseQueue===null&&(c.baseState=T),g.lastRenderedState=T}return[T,M]}function kM(){}function OM(u,c){var g=ln,M=Jr(),C=c(),T=!Hr(M.memoizedState,C);if(T&&(M.memoizedState=C,Bi=!0),M=M.queue,fc(GM.bind(null,g,M,u),[u]),M.getSnapshot!==c||T||In!==null&&In.memoizedState.tag&1){if(g.flags|=2048,cc(9,zM.bind(null,g,M,C,c),void 0,null),yn===null)throw Error(o(349));Ml&30||UM(g,c,C)}return C}function UM(u,c,g){u.flags|=16384,u={getSnapshot:c,value:g},c=ln.updateQueue,c===null?(c={lastEffect:null,stores:null},ln.updateQueue=c,c.stores=[u]):(g=c.stores,g===null?c.stores=[u]:g.push(u))}function zM(u,c,g,M){c.value=g,c.getSnapshot=M,HM(c)&&tr(u,1,-1)}function GM(u,c,g){return g(function(){HM(c)&&tr(u,1,-1)})}function HM(u){var c=u.getSnapshot;u=u.value;try{var g=c();return!Hr(u,g)}catch{return!0}}function S0(u){var c=ms();return typeof u=="function"&&(u=u()),c.memoizedState=c.baseState=u,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:u},c.queue=u,u=u.dispatch=UL.bind(null,ln,u),[c.memoizedState,u]}function cc(u,c,g,M){return u={tag:u,create:c,destroy:g,deps:M,next:null},c=ln.updateQueue,c===null?(c={lastEffect:null,stores:null},ln.updateQueue=c,c.lastEffect=u.next=u):(g=c.lastEffect,g===null?c.lastEffect=u.next=u:(M=g.next,g.next=u,u.next=M,c.lastEffect=u)),u}function VM(){return Jr().memoizedState}function ld(u,c,g,M){var C=ms();ln.flags|=u,C.memoizedState=cc(1|c,g,void 0,M===void 0?null:M)}function ud(u,c,g,M){var C=Jr();M=M===void 0?null:M;var T=void 0;if(jn!==null){var k=jn.memoizedState;if(T=k.destroy,M!==null&&A0(M,k.deps)){C.memoizedState=cc(c,g,T,M);return}}ln.flags|=u,C.memoizedState=cc(1|c,g,T,M)}function C0(u,c){return ld(8390656,8,u,c)}function fc(u,c){return ud(2048,8,u,c)}function WM(u,c){return ud(4,2,u,c)}function jM(u,c){return ud(4,4,u,c)}function JM(u,c){if(typeof c=="function")return u=u(),c(u),function(){c(null)};if(c!=null)return u=u(),c.current=u,function(){c.current=null}}function XM(u,c,g){return g=g!=null?g.concat([u]):null,ud(4,4,JM.bind(null,c,u),g)}function E0(){}function KM(u,c){var g=Jr();c=c===void 0?null:c;var M=g.memoizedState;return M!==null&&c!==null&&A0(c,M[1])?M[0]:(g.memoizedState=[u,c],u)}function YM(u,c){var g=Jr();c=c===void 0?null:c;var M=g.memoizedState;return M!==null&&c!==null&&A0(c,M[1])?M[0]:(u=u(),g.memoizedState=[u,c],u)}function kL(u,c){var g=Rt;Rt=g!==0&&4>g?g:4,u(!0);var M=er.transition;er.transition={};try{u(!1),c()}finally{Rt=g,er.transition=M}}function QM(){return Jr().memoizedState}function OL(u,c,g){var M=$s(u);g={lane:M,action:g,hasEagerState:!1,eagerState:null,next:null},ZM(u)?qM(c,g):($M(u,c,g),g=ri(),u=tr(u,M,g),u!==null&&ew(u,c,M))}function UL(u,c,g){var M=$s(u),C={lane:M,action:g,hasEagerState:!1,eagerState:null,next:null};if(ZM(u))qM(c,C);else{$M(u,c,C);var T=u.alternate;if(u.lanes===0&&(T===null||T.lanes===0)&&(T=c.lastRenderedReducer,T!==null))try{var k=c.lastRenderedState,X=T(k,g);if(C.hasEagerState=!0,C.eagerState=X,Hr(X,k))return}catch{}finally{}g=ri(),u=tr(u,M,g),u!==null&&ew(u,c,M)}}function ZM(u){var c=u.alternate;return u===ln||c!==null&&c===ln}function qM(u,c){lc=sd=!0;var g=u.pending;g===null?c.next=c:(c.next=g.next,g.next=c),u.pending=c}function $M(u,c,g){yn!==null&&u.mode&1&&!(gt&2)?(u=c.interleaved,u===null?(g.next=g,Wr===null?Wr=[c]:Wr.push(c)):(g.next=u.next,u.next=g),c.interleaved=g):(u=c.pending,u===null?g.next=g:(g.next=u.next,u.next=g),c.pending=g)}function ew(u,c,g){if(g&4194240){var M=c.lanes;M&=u.pendingLanes,g|=M,c.lanes=g,e0(u,g)}}var cd={readContext:Qi,useCallback:Jn,useContext:Jn,useEffect:Jn,useImperativeHandle:Jn,useInsertionEffect:Jn,useLayoutEffect:Jn,useMemo:Jn,useReducer:Jn,useRef:Jn,useState:Jn,useDebugValue:Jn,useDeferredValue:Jn,useTransition:Jn,useMutableSource:Jn,useSyncExternalStore:Jn,useId:Jn,unstable_isNewReconciler:!1},zL={readContext:Qi,useCallback:function(u,c){return ms().memoizedState=[u,c===void 0?null:c],u},useContext:Qi,useEffect:C0,useImperativeHandle:function(u,c,g){return g=g!=null?g.concat([u]):null,ld(4194308,4,JM.bind(null,c,u),g)},useLayoutEffect:function(u,c){return ld(4194308,4,u,c)},useInsertionEffect:function(u,c){return ld(4,2,u,c)},useMemo:function(u,c){var g=ms();return c=c===void 0?null:c,u=u(),g.memoizedState=[u,c],u},useReducer:function(u,c,g){var M=ms();return c=g!==void 0?g(c):c,M.memoizedState=M.baseState=c,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:c},M.queue=u,u=u.dispatch=OL.bind(null,ln,u),[M.memoizedState,u]},useRef:function(u){var c=ms();return u={current:u},c.memoizedState=u},useState:S0,useDebugValue:E0,useDeferredValue:function(u){var c=S0(u),g=c[0],M=c[1];return C0(function(){var C=er.transition;er.transition={};try{M(u)}finally{er.transition=C}},[u]),g},useTransition:function(){var u=S0(!1),c=u[0];return u=kL.bind(null,u[1]),ms().memoizedState=u,[c,u]},useMutableSource:function(){},useSyncExternalStore:function(u,c,g){var M=ln,C=ms();if(Xt){if(g===void 0)throw Error(o(407));g=g()}else{if(g=c(),yn===null)throw Error(o(349));Ml&30||UM(M,c,g)}C.memoizedState=g;var T={value:g,getSnapshot:c};return C.queue=T,C0(GM.bind(null,M,T,u),[u]),M.flags|=2048,cc(9,zM.bind(null,M,T,g,c),void 0,null),g},useId:function(){var u=ms(),c=yn.identifierPrefix;if(Xt){var g=ps,M=ds;g=(M&~(1<<32-vr(M)-1)).toString(32)+g,c=":"+c+"R"+g,g=uc++,0<g&&(c+="H"+g.toString(32)),c+=":"}else g=NL++,c=":"+c+"r"+g.toString(32)+":";return u.memoizedState=c},unstable_isNewReconciler:!1},GL={readContext:Qi,useCallback:KM,useContext:Qi,useEffect:fc,useImperativeHandle:XM,useInsertionEffect:WM,useLayoutEffect:jM,useMemo:YM,useReducer:od,useRef:VM,useState:function(){return od(ia)},useDebugValue:E0,useDeferredValue:function(u){var c=od(ia),g=c[0],M=c[1];return fc(function(){var C=er.transition;er.transition={};try{M(u)}finally{er.transition=C}},[u]),g},useTransition:function(){var u=od(ia)[0],c=Jr().memoizedState;return[u,c]},useMutableSource:kM,useSyncExternalStore:OM,useId:QM,unstable_isNewReconciler:!1},HL={readContext:Qi,useCallback:KM,useContext:Qi,useEffect:fc,useImperativeHandle:XM,useInsertionEffect:WM,useLayoutEffect:jM,useMemo:YM,useReducer:ad,useRef:VM,useState:function(){return ad(ia)},useDebugValue:E0,useDeferredValue:function(u){var c=ad(ia),g=c[0],M=c[1];return fc(function(){var C=er.transition;er.transition={};try{M(u)}finally{er.transition=C}},[u]),g},useTransition:function(){var u=ad(ia)[0],c=Jr().memoizedState;return[u,c]},useMutableSource:kM,useSyncExternalStore:OM,useId:QM,unstable_isNewReconciler:!1};function b0(u,c){try{var g="",M=c;do g+=FL(M),M=M.return;while(M);var C=g}catch(T){C=` Error generating stack: `+T.message+` `+T.stack}return{value:u,source:c,stack:C}}function T0(u,c){try{console.error(c.value)}catch(g){setTimeout(function(){throw g})}}var VL=typeof WeakMap=="function"?WeakMap:Map;function tw(u,c,g){g=hs(-1,g),g.tag=3,g.payload={element:null};var M=c.value;return g.callback=function(){Ed||(Ed=!0,J0=M),T0(u,c)},g}function nw(u,c,g){g=hs(-1,g),g.tag=3;var M=u.type.getDerivedStateFromError;if(typeof M=="function"){var C=c.value;g.payload=function(){return M(C)},g.callback=function(){T0(u,c)}}var T=u.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(g.callback=function(){T0(u,c),typeof M!="function"&&(Zs===null?Zs=new Set([this]):Zs.add(this));var k=c.stack;this.componentDidCatch(c.value,{componentStack:k!==null?k:""})}),g}function iw(u,c,g){var M=u.pingCache;if(M===null){M=u.pingCache=new VL;var C=new Set;M.set(c,C)}else C=M.get(c),C===void 0&&(C=new Set,M.set(c,C));C.has(g)||(C.add(g),u=iI.bind(null,u,c,g),c.then(u,u))}function rw(u){do{var c;if((c=u.tag===13)&&(c=u.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return u;u=u.return}while(u!==null);return null}function sw(u,c,g,M,C){return u.mode&1?(u.flags|=65536,u.lanes=C,u):(u===c?u.flags|=65536:(u.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(c=hs(-1,1),c.tag=2,Qs(g,c))),g.lanes|=1),u)}function Xr(u){u.flags|=4}function ow(u,c){if(u!==null&&u.child===c.child)return!0;if(c.flags&16)return!1;for(u=c.child;u!==null;){if(u.flags&12854||u.subtreeFlags&12854)return!1;u=u.sibling}return!0}var hc,dc,fd,hd;if(Ie)hc=function(u,c){for(var g=c.child;g!==null;){if(g.tag===5||g.tag===6)W(u,g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===c)break;for(;g.sibling===null;){if(g.return===null||g.return===c)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},dc=function(){},fd=function(u,c,g,M,C){if(u=u.memoizedProps,u!==M){var T=c.stateNode,k=jr($i.current);g=ve(T,g,u,M,C,k),(c.updateQueue=g)&&Xr(c)}},hd=function(u,c,g,M){g!==M&&Xr(c)};else if(he){hc=function(u,c,g,M){for(var C=c.child;C!==null;){if(C.tag===5){var T=C.stateNode;g&&M&&(T=Ot(T,C.type,C.memoizedProps,C)),W(u,T)}else if(C.tag===6)T=C.stateNode,g&&M&&(T=Ji(T,C.memoizedProps,C)),W(u,T);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)T=C.child,T!==null&&(T.return=C),hc(u,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===c)break;for(;C.sibling===null;){if(C.return===null||C.return===c)return;C=C.return}C.sibling.return=C.return,C=C.sibling}};var aw=function(u,c,g,M){for(var C=c.child;C!==null;){if(C.tag===5){var T=C.stateNode;g&&M&&(T=Ot(T,C.type,C.memoizedProps,C)),hn(u,T)}else if(C.tag===6)T=C.stateNode,g&&M&&(T=Ji(T,C.memoizedProps,C)),hn(u,T);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)T=C.child,T!==null&&(T.return=C),aw(u,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===c)break;for(;C.sibling===null;){if(C.return===null||C.return===c)return;C=C.return}C.sibling.return=C.return,C=C.sibling}};dc=function(u,c){var g=c.stateNode;if(!ow(u,c)){u=g.containerInfo;var M=Pt(u);aw(M,c,!1,!1),g.pendingChildren=M,Xr(c),Bn(u,M)}},fd=function(u,c,g,M,C){var T=u.stateNode,k=u.memoizedProps;if((u=ow(u,c))&&k===M)c.stateNode=T;else{var X=c.stateNode,fe=jr($i.current),be=null;k!==M&&(be=ve(X,g,k,M,C,fe)),u&&be===null?c.stateNode=T:(T=Ye(T,be,g,k,M,c,u,X),ce(T,g,M,C,fe)&&Xr(c),c.stateNode=T,u?Xr(c):hc(T,c,!1,!1))}},hd=function(u,c,g,M){g!==M?(u=jr(_l.current),g=jr($i.current),c.stateNode=$(M,u,g,c),Xr(c)):c.stateNode=u.stateNode}}else dc=function(){},fd=function(){},hd=function(){};function pc(u,c){if(!Xt)switch(u.tailMode){case"hidden":c=u.tail;for(var g=null;c!==null;)c.alternate!==null&&(g=c),c=c.sibling;g===null?u.tail=null:g.sibling=null;break;case"collapsed":g=u.tail;for(var M=null;g!==null;)g.alternate!==null&&(M=g),g=g.sibling;M===null?c||u.tail===null?u.tail=null:u.tail.sibling=null:M.sibling=null}}function Xn(u){var c=u.alternate!==null&&u.alternate.child===u.child,g=0,M=0;if(c)for(var C=u.child;C!==null;)g|=C.lanes|C.childLanes,M|=C.subtreeFlags&14680064,M|=C.flags&14680064,C.return=u,C=C.sibling;else for(C=u.child;C!==null;)g|=C.lanes|C.childLanes,M|=C.subtreeFlags,M|=C.flags,C.return=u,C=C.sibling;return u.subtreeFlags|=M,u.childLanes=g,c}function WL(u,c,g){var M=c.pendingProps;switch(d0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xn(c),null;case 1:return gi(c.type)&&Gh(),Xn(c),null;case 3:return M=c.stateNode,Al(),ct(Rn),ct(Ft),_0(),M.pendingContext&&(M.context=M.pendingContext,M.pendingContext=null),(u===null||u.child===null)&&(rc(c)?Xr(c):u===null||u.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,_r!==null&&(Y0(_r),_r=null))),dc(u,c),Xn(c),null;case 5:v0(c),g=jr(_l.current);var C=c.type;if(u!==null&&c.stateNode!=null)fd(u,c,C,M,g),u.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!M){if(c.stateNode===null)throw Error(o(166));return Xn(c),null}if(u=jr($i.current),rc(c)){if(!re)throw Error(o(175));u=qe(c.stateNode,c.type,c.memoizedProps,g,u,c,!ic),c.updateQueue=u,u!==null&&Xr(c)}else{var T=ae(C,M,g,u,c);hc(T,c,!1,!1),c.stateNode=T,ce(T,C,M,g,u)&&Xr(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Xn(c),null;case 6:if(u&&c.stateNode!=null)hd(u,c,u.memoizedProps,M);else{if(typeof M!="string"&&c.stateNode===null)throw Error(o(166));if(u=jr(_l.current),g=jr($i.current),rc(c)){if(!re)throw Error(o(176));if(u=c.stateNode,M=c.memoizedProps,(g=st(u,M,c,!ic))&&(C=Ti,C!==null))switch(T=(C.mode&1)!==0,C.tag){case 3:yr(C.stateNode.containerInfo,u,M,T);break;case 5:as(C.type,C.memoizedProps,C.stateNode,u,M,T)}g&&Xr(c)}else c.stateNode=$(M,u,g,c)}return Xn(c),null;case 13:if(ct(Zt),M=c.memoizedState,Xt&&Pi!==null&&c.mode&1&&!(c.flags&128)){for(u=Pi;u;)u=ee(u);return vl(),c.flags|=98560,c}if(M!==null&&M.dehydrated!==null){if(M=rc(c),u===null){if(!M)throw Error(o(318));if(!re)throw Error(o(344));if(u=c.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));ft(u,c)}else vl(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;return Xn(c),null}return _r!==null&&(Y0(_r),_r=null),c.flags&128?(c.lanes=g,c):(M=M!==null,g=!1,u===null?rc(c):g=u.memoizedState!==null,M&&!g&&(c.child.flags|=8192,c.mode&1&&(u===null||Zt.current&1?wn===0&&(wn=3):Z0())),c.updateQueue!==null&&(c.flags|=4),Xn(c),null);case 4:return Al(),dc(u,c),u===null&&ze(c.stateNode.containerInfo),Xn(c),null;case 10:return a0(c.type._context),Xn(c),null;case 17:return gi(c.type)&&Gh(),Xn(c),null;case 19:if(ct(Zt),C=c.memoizedState,C===null)return Xn(c),null;if(M=(c.flags&128)!==0,T=C.rendering,T===null)if(M)pc(C,!1);else{if(wn!==0||u!==null&&u.flags&128)for(u=c.child;u!==null;){if(T=id(u),T!==null){for(c.flags|=128,pc(C,!1),u=T.updateQueue,u!==null&&(c.updateQueue=u,c.flags|=4),c.subtreeFlags=0,u=g,M=c.child;M!==null;)g=M,C=u,g.flags&=14680066,T=g.alternate,T===null?(g.childLanes=0,g.lanes=C,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=T.childLanes,g.lanes=T.lanes,g.child=T.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=T.memoizedProps,g.memoizedState=T.memoizedState,g.updateQueue=T.updateQueue,g.type=T.type,C=T.dependencies,g.dependencies=C===null?null:{lanes:C.lanes,firstContext:C.firstContext}),M=M.sibling;return Et(Zt,Zt.current&1|2),c.child}u=u.sibling}C.tail!==null&&Ln()>j0&&(c.flags|=128,M=!0,pc(C,!1),c.lanes=4194304)}else{if(!M)if(u=id(T),u!==null){if(c.flags|=128,M=!0,u=u.updateQueue,u!==null&&(c.updateQueue=u,c.flags|=4),pc(C,!0),C.tail===null&&C.tailMode==="hidden"&&!T.alternate&&!Xt)return Xn(c),null}else 2*Ln()-C.renderingStartTime>j0&&g!==1073741824&&(c.flags|=128,M=!0,pc(C,!1),c.lanes=4194304);C.isBackwards?(T.sibling=c.child,c.child=T):(u=C.last,u!==null?u.sibling=T:c.child=T,C.last=T)}return C.tail!==null?(c=C.tail,C.rendering=c,C.tail=c.sibling,C.renderingStartTime=Ln(),c.sibling=null,u=Zt.current,Et(Zt,M?u&1|2:u&1),c):(Xn(c),null);case 22:case 23:return Q0(),M=c.memoizedState!==null,u!==null&&u.memoizedState!==null!==M&&(c.flags|=8192),M&&c.mode&1?Ri&1073741824&&(Xn(c),Ie&&c.subtreeFlags&6&&(c.flags|=8192)):Xn(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}var jL=a.ReactCurrentOwner,Bi=!1;function ii(u,c,g,M){c.child=u===null?FM(c,null,g,M):xl(c,u.child,g,M)}function lw(u,c,g,M,C){g=g.render;var T=c.ref;return ml(c,C),M=M0(u,c,g,M,T,C),g=w0(),u!==null&&!Bi?(c.updateQueue=u.updateQueue,c.flags&=-2053,u.lanes&=~C,gs(u,c,C)):(Xt&&g&&h0(c),c.flags|=1,ii(u,c,M,C),c.child)}function uw(u,c,g,M,C){if(u===null){var T=g.type;return typeof T=="function"&&!q0(T)&&T.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(c.tag=15,c.type=T,cw(u,c,T,M,C)):(u=Id(g.type,null,M,c,c.mode,C),u.ref=c.ref,u.return=c,c.child=u)}if(T=u.child,!(u.lanes&C)){var k=T.memoizedProps;if(g=g.compare,g=g!==null?g:Kh,g(k,M)&&u.ref===c.ref)return gs(u,c,C)}return c.flags|=1,u=to(T,M),u.ref=c.ref,u.return=c,c.child=u}function cw(u,c,g,M,C){if(u!==null&&Kh(u.memoizedProps,M)&&u.ref===c.ref)if(Bi=!1,(u.lanes&C)!==0)u.flags&131072&&(Bi=!0);else return c.lanes=u.lanes,gs(u,c,C);return P0(u,c,g,M,C)}function fw(u,c,g){var M=c.pendingProps,C=M.children,T=u!==null?u.memoizedState:null;if(M.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null},Et(wl,Ri),Ri|=g;else if(g&1073741824)c.memoizedState={baseLanes:0,cachePool:null},M=T!==null?T.baseLanes:g,Et(wl,Ri),Ri|=M;else return u=T!==null?T.baseLanes|g:g,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:u,cachePool:null},c.updateQueue=null,Et(wl,Ri),Ri|=u,null;else T!==null?(M=T.baseLanes|g,c.memoizedState=null):M=g,Et(wl,Ri),Ri|=M;return ii(u,c,C,g),c.child}function hw(u,c){var g=c.ref;(u===null&&g!==null||u!==null&&u.ref!==g)&&(c.flags|=512,c.flags|=2097152)}function P0(u,c,g,M,C){var T=gi(g)?us:Ft.current;return T=cs(c,T),ml(c,C),g=M0(u,c,g,M,T,C),M=w0(),u!==null&&!Bi?(c.updateQueue=u.updateQueue,c.flags&=-2053,u.lanes&=~C,gs(u,c,C)):(Xt&&M&&h0(c),c.flags|=1,ii(u,c,g,C),c.child)}function dw(u,c,g,M,C){if(gi(g)){var T=!0;Hh(c)}else T=!1;if(ml(c,C),c.stateNode===null)u!==null&&(u.alternate=null,c.alternate=null,c.flags|=2),bM(c,g,M),f0(c,g,M,C),M=!0;else if(u===null){var k=c.stateNode,X=c.memoizedProps;k.props=X;var fe=k.context,be=g.contextType;typeof be=="object"&&be!==null?be=Qi(be):(be=gi(g)?us:Ft.current,be=cs(c,be));var Ve=g.getDerivedStateFromProps,ot=typeof Ve=="function"||typeof k.getSnapshotBeforeUpdate=="function";ot||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(X!==M||fe!==be)&&TM(c,k,M,be),Ys=!1;var et=c.memoizedState;k.state=et,qh(c,M,k,C),fe=c.memoizedState,X!==M||et!==fe||Rn.current||Ys?(typeof Ve=="function"&&(c0(c,g,Ve,M),fe=c.memoizedState),(X=Ys||EM(c,g,X,M,et,fe,be))?(ot||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(c.flags|=4194308)):(typeof k.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=M,c.memoizedState=fe),k.props=M,k.state=fe,k.context=be,M=X):(typeof k.componentDidMount=="function"&&(c.flags|=4194308),M=!1)}else{k=c.stateNode,MM(u,c),X=c.memoizedProps,be=c.type===c.elementType?X:xr(c.type,X),k.props=be,ot=c.pendingProps,et=k.context,fe=g.contextType,typeof fe=="object"&&fe!==null?fe=Qi(fe):(fe=gi(g)?us:Ft.current,fe=cs(c,fe));var Ut=g.getDerivedStateFromProps;(Ve=typeof Ut=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(X!==ot||et!==fe)&&TM(c,k,M,fe),Ys=!1,et=c.memoizedState,k.state=et,qh(c,M,k,C);var Qe=c.memoizedState;X!==ot||et!==Qe||Rn.current||Ys?(typeof Ut=="function"&&(c0(c,g,Ut,M),Qe=c.memoizedState),(be=Ys||EM(c,g,be,M,et,Qe,fe)||!1)?(Ve||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(M,Qe,fe),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(M,Qe,fe)),typeof k.componentDidUpdate=="function"&&(c.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof k.componentDidUpdate!="function"||X===u.memoizedProps&&et===u.memoizedState||(c.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||X===u.memoizedProps&&et===u.memoizedState||(c.flags|=1024),c.memoizedProps=M,c.memoizedState=Qe),k.props=M,k.state=Qe,k.context=fe,M=be):(typeof k.componentDidUpdate!="function"||X===u.memoizedProps&&et===u.memoizedState||(c.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||X===u.memoizedProps&&et===u.memoizedState||(c.flags|=1024),M=!1)}return B0(u,c,g,M,T,C)}function B0(u,c,g,M,C,T){hw(u,c);var k=(c.flags&128)!==0;if(!M&&!k)return C&&yM(c,g,!1),gs(u,c,T);M=c.stateNode,jL.current=c;var X=k&&typeof g.getDerivedStateFromError!="function"?null:M.render();return c.flags|=1,u!==null&&k?(c.child=xl(c,u.child,null,T),c.child=xl(c,null,X,T)):ii(u,c,X,T),c.memoizedState=M.state,C&&yM(c,g,!0),c.child}function pw(u){var c=u.stateNode;c.pendingContext?mM(u,c.pendingContext,c.pendingContext!==c.context):c.context&&mM(u,c.context,!1),y0(u,c.containerInfo)}function mw(u,c,g,M,C){return vl(),g0(C),c.flags|=256,ii(u,c,g,M),c.child}var dd={dehydrated:null,treeContext:null,retryLane:0};function pd(u){return{baseLanes:u,cachePool:null}}function gw(u,c,g){var M=c.pendingProps,C=Zt.current,T=!1,k=(c.flags&128)!==0,X;if((X=k)||(X=u!==null&&u.memoizedState===null?!1:(C&2)!==0),X?(T=!0,c.flags&=-129):(u===null||u.memoizedState!==null)&&(C|=1),Et(Zt,C&1),u===null)return m0(c),u=c.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?(c.mode&1?ec(u)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(C=M.children,u=M.fallback,T?(M=c.mode,T=c.child,C={mode:"hidden",children:C},!(M&1)&&T!==null?(T.childLanes=0,T.pendingProps=C):T=Dd(C,M,0,null),u=ua(u,M,g,null),T.return=c,u.return=c,T.sibling=u,c.child=T,c.child.memoizedState=pd(g),c.memoizedState=dd,u):R0(c,C));if(C=u.memoizedState,C!==null){if(X=C.dehydrated,X!==null){if(k)return c.flags&256?(c.flags&=-257,md(u,c,g,Error(o(422)))):c.memoizedState!==null?(c.child=u.child,c.flags|=128,null):(T=M.fallback,C=c.mode,M=Dd({mode:"visible",children:M.children},C,0,null),T=ua(T,C,g,null),T.flags|=2,M.return=c,T.return=c,M.sibling=T,c.child=M,c.mode&1&&xl(c,u.child,null,g),c.child.memoizedState=pd(g),c.memoizedState=dd,T);if(!(c.mode&1))c=md(u,c,g,null);else if(ec(X))c=md(u,c,g,Error(o(419)));else if(M=(g&u.childLanes)!==0,Bi||M){if(M=yn,M!==null){switch(g&-g){case 4:T=2;break;case 16:T=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:T=32;break;case 536870912:T=268435456;break;default:T=0}M=T&(M.suspendedLanes|g)?0:T,M!==0&&M!==C.retryLane&&(C.retryLane=M,tr(u,M,-1))}Z0(),c=md(u,c,g,Error(o(421)))}else zh(X)?(c.flags|=128,c.child=u.child,c=rI.bind(null,u),F(X,c),c=null):(g=C.treeContext,re&&(Pi=ye(X),Ti=c,Xt=!0,_r=null,ic=!1,g!==null&&(Zi[qi++]=ds,Zi[qi++]=ps,Zi[qi++]=ta,ds=g.id,ps=g.overflow,ta=c)),c=R0(c,c.pendingProps.children),c.flags|=4096);return c}return T?(M=vw(u,c,M.children,M.fallback,g),T=c.child,C=u.child.memoizedState,T.memoizedState=C===null?pd(g):{baseLanes:C.baseLanes|g,cachePool:null},T.childLanes=u.childLanes&~g,c.memoizedState=dd,M):(g=yw(u,c,M.children,g),c.memoizedState=null,g)}return T?(M=vw(u,c,M.children,M.fallback,g),T=c.child,C=u.child.memoizedState,T.memoizedState=C===null?pd(g):{baseLanes:C.baseLanes|g,cachePool:null},T.childLanes=u.childLanes&~g,c.memoizedState=dd,M):(g=yw(u,c,M.children,g),c.memoizedState=null,g)}function R0(u,c){return c=Dd({mode:"visible",children:c},u.mode,0,null),c.return=u,u.child=c}function yw(u,c,g,M){var C=u.child;return u=C.sibling,g=to(C,{mode:"visible",children:g}),!(c.mode&1)&&(g.lanes=M),g.return=c,g.sibling=null,u!==null&&(M=c.deletions,M===null?(c.deletions=[u],c.flags|=16):M.push(u)),c.child=g}function vw(u,c,g,M,C){var T=c.mode;u=u.child;var k=u.sibling,X={mode:"hidden",children:g};return!(T&1)&&c.child!==u?(g=c.child,g.childLanes=0,g.pendingProps=X,c.deletions=null):(g=to(u,X),g.subtreeFlags=u.subtreeFlags&14680064),k!==null?M=to(k,M):(M=ua(M,T,C,null),M.flags|=2),M.return=c,g.return=c,g.sibling=M,c.child=g,M}function md(u,c,g,M){return M!==null&&g0(M),xl(c,u.child,null,g),u=R0(c,c.pendingProps.children),u.flags|=2,c.memoizedState=null,u}function xw(u,c,g){u.lanes|=c;var M=u.alternate;M!==null&&(M.lanes|=c),l0(u.return,c,g)}function L0(u,c,g,M,C){var T=u.memoizedState;T===null?u.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:M,tail:g,tailMode:C}:(T.isBackwards=c,T.rendering=null,T.renderingStartTime=0,T.last=M,T.tail=g,T.tailMode=C)}function _w(u,c,g){var M=c.pendingProps,C=M.revealOrder,T=M.tail;if(ii(u,c,M.children,g),M=Zt.current,M&2)M=M&1|2,c.flags|=128;else{if(u!==null&&u.flags&128)e:for(u=c.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&xw(u,g,c);else if(u.tag===19)xw(u,g,c);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break e;for(;u.sibling===null;){if(u.return===null||u.return===c)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}M&=1}if(Et(Zt,M),!(c.mode&1))c.memoizedState=null;else switch(C){case"forwards":for(g=c.child,C=null;g!==null;)u=g.alternate,u!==null&&id(u)===null&&(C=g),g=g.sibling;g=C,g===null?(C=c.child,c.child=null):(C=g.sibling,g.sibling=null),L0(c,!1,C,g,T);break;case"backwards":for(g=null,C=c.child,c.child=null;C!==null;){if(u=C.alternate,u!==null&&id(u)===null){c.child=C;break}u=C.sibling,C.sibling=g,g=C,C=u}L0(c,!0,g,null,T);break;case"together":L0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function gs(u,c,g){if(u!==null&&(c.dependencies=u.dependencies),Sl|=c.lanes,!(g&c.childLanes))return null;if(u!==null&&c.child!==u.child)throw Error(o(153));if(c.child!==null){for(u=c.child,g=to(u,u.pendingProps),c.child=g,g.return=c;u.sibling!==null;)u=u.sibling,g=g.sibling=to(u,u.pendingProps),g.return=c;g.sibling=null}return c.child}function JL(u,c,g){switch(c.tag){case 3:pw(c),vl();break;case 5:NM(c);break;case 1:gi(c.type)&&Hh(c);break;case 4:y0(c,c.stateNode.containerInfo);break;case 10:AM(c,c.type._context,c.memoizedProps.value);break;case 13:var M=c.memoizedState;if(M!==null)return M.dehydrated!==null?(Et(Zt,Zt.current&1),c.flags|=128,null):g&c.child.childLanes?gw(u,c,g):(Et(Zt,Zt.current&1),u=gs(u,c,g),u!==null?u.sibling:null);Et(Zt,Zt.current&1);break;case 19:if(M=(g&c.childLanes)!==0,u.flags&128){if(M)return _w(u,c,g);c.flags|=128}var C=c.memoizedState;if(C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Et(Zt,Zt.current),M)break;return null;case 22:case 23:return c.lanes=0,fw(u,c,g)}return gs(u,c,g)}function XL(u,c){switch(d0(c),c.tag){case 1:return gi(c.type)&&Gh(),u=c.flags,u&65536?(c.flags=u&-65537|128,c):null;case 3:return Al(),ct(Rn),ct(Ft),_0(),u=c.flags,u&65536&&!(u&128)?(c.flags=u&-65537|128,c):null;case 5:return v0(c),null;case 13:if(ct(Zt),u=c.memoizedState,u!==null&&u.dehydrated!==null){if(c.alternate===null)throw Error(o(340));vl()}return u=c.flags,u&65536?(c.flags=u&-65537|128,c):null;case 19:return ct(Zt),null;case 4:return Al(),null;case 10:return a0(c.type._context),null;case 22:case 23:return Q0(),null;case 24:return null;default:return null}}var gd=!1,ra=!1,KL=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function yd(u,c){var g=u.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(M){xi(u,c,M)}else g.current=null}function I0(u,c,g){try{g()}catch(M){xi(u,c,M)}}var Aw=!1;function YL(u,c){for(V(u.containerInfo),Fe=c;Fe!==null;)if(u=Fe,c=u.child,(u.subtreeFlags&1028)!==0&&c!==null)c.return=u,Fe=c;else for(;Fe!==null;){u=Fe;try{var g=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var M=g.memoizedProps,C=g.memoizedState,T=u.stateNode,k=T.getSnapshotBeforeUpdate(u.elementType===u.type?M:xr(u.type,M),C);T.__reactInternalSnapshotBeforeUpdate=k}break;case 3:Ie&&Ue(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(X){xi(u,u.return,X)}if(c=u.sibling,c!==null){c.return=u.return,Fe=c;break}Fe=u.return}return g=Aw,Aw=!1,g}function sa(u,c,g){var M=c.updateQueue;if(M=M!==null?M.lastEffect:null,M!==null){var C=M=M.next;do{if((C.tag&u)===u){var T=C.destroy;C.destroy=void 0,T!==void 0&&I0(c,g,T)}C=C.next}while(C!==M)}}function mc(u,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var g=c=c.next;do{if((g.tag&u)===u){var M=g.create;g.destroy=M()}g=g.next}while(g!==c)}}function D0(u){var c=u.ref;if(c!==null){var g=u.stateNode;switch(u.tag){case 5:u=te(g);break;default:u=g}typeof c=="function"?c(u):c.current=u}}function Mw(u,c,g){if(Gr&&typeof Gr.onCommitFiberUnmount=="function")try{Gr.onCommitFiberUnmount(Jh,c)}catch{}switch(c.tag){case 0:case 11:case 14:case 15:if(u=c.updateQueue,u!==null&&(u=u.lastEffect,u!==null)){var M=u=u.next;do{var C=M,T=C.destroy;C=C.tag,T!==void 0&&(C&2||C&4)&&I0(c,g,T),M=M.next}while(M!==u)}break;case 1:if(yd(c,g),u=c.stateNode,typeof u.componentWillUnmount=="function")try{u.props=c.memoizedProps,u.state=c.memoizedState,u.componentWillUnmount()}catch(k){xi(c,g,k)}break;case 5:yd(c,g);break;case 4:Ie?Tw(u,c,g):he&&he&&(c=c.stateNode.containerInfo,g=Pt(c),zr(c,g))}}function ww(u,c,g){for(var M=c;;)if(Mw(u,M,g),M.child===null||Ie&&M.tag===4){if(M===c)break;for(;M.sibling===null;){if(M.return===null||M.return===c)return;M=M.return}M.sibling.return=M.return,M=M.sibling}else M.child.return=M,M=M.child}function Sw(u){var c=u.alternate;c!==null&&(u.alternate=null,Sw(c)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(c=u.stateNode,c!==null&&Ze(c)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function Cw(u){return u.tag===5||u.tag===3||u.tag===4}function Ew(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Cw(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function bw(u){if(Ie){e:{for(var c=u.return;c!==null;){if(Cw(c))break e;c=c.return}throw Error(o(160))}var g=c;switch(g.tag){case 5:c=g.stateNode,g.flags&32&&(yt(c),g.flags&=-33),g=Ew(u),N0(u,g,c);break;case 3:case 4:c=g.stateNode.containerInfo,g=Ew(u),F0(u,g,c);break;default:throw Error(o(161))}}}function F0(u,c,g){var M=u.tag;if(M===5||M===6)u=u.stateNode,c?Ae(g,u,c):De(g,u);else if(M!==4&&(u=u.child,u!==null))for(F0(u,c,g),u=u.sibling;u!==null;)F0(u,c,g),u=u.sibling}function N0(u,c,g){var M=u.tag;if(M===5||M===6)u=u.stateNode,c?se(g,u,c):nt(g,u);else if(M!==4&&(u=u.child,u!==null))for(N0(u,c,g),u=u.sibling;u!==null;)N0(u,c,g),u=u.sibling}function Tw(u,c,g){for(var M=c,C=!1,T,k;;){if(!C){C=M.return;e:for(;;){if(C===null)throw Error(o(160));switch(T=C.stateNode,C.tag){case 5:k=!1;break e;case 3:T=T.containerInfo,k=!0;break e;case 4:T=T.containerInfo,k=!0;break e}C=C.return}C=!0}if(M.tag===5||M.tag===6)ww(u,M,g),k?$e(T,M.stateNode):Te(T,M.stateNode);else if(M.tag===18)k?on(T,M.stateNode):At(T,M.stateNode);else if(M.tag===4){if(M.child!==null){T=M.stateNode.containerInfo,k=!0,M.child.return=M,M=M.child;continue}}else if(Mw(u,M,g),M.child!==null){M.child.return=M,M=M.child;continue}if(M===c)break;for(;M.sibling===null;){if(M.return===null||M.return===c)return;M=M.return,M.tag===4&&(C=!1)}M.sibling.return=M.return,M=M.sibling}}function k0(u,c){if(Ie){switch(c.tag){case 0:case 11:case 14:case 15:sa(3,c,c.return),mc(3,c),sa(5,c,c.return);return;case 1:return;case 5:var g=c.stateNode;if(g!=null){var M=c.memoizedProps;u=u!==null?u.memoizedProps:M;var C=c.type,T=c.updateQueue;c.updateQueue=null,T!==null&&G(g,T,C,u,M,c)}return;case 6:if(c.stateNode===null)throw Error(o(162));g=c.memoizedProps,ge(c.stateNode,u!==null?u.memoizedProps:g,g);return;case 3:re&&u!==null&&u.memoizedState.isDehydrated&&St(c.stateNode.containerInfo);return;case 12:return;case 13:vd(c);return;case 19:vd(c);return;case 17:return}throw Error(o(163))}switch(c.tag){case 0:case 11:case 14:case 15:sa(3,c,c.return),mc(3,c),sa(5,c,c.return);return;case 12:return;case 13:vd(c);return;case 19:vd(c);return;case 3:re&&u!==null&&u.memoizedState.isDehydrated&&St(c.stateNode.containerInfo);break;case 22:case 23:return}e:if(he){switch(c.tag){case 1:case 5:case 6:break e;case 3:case 4:c=c.stateNode,zr(c.containerInfo,c.pendingChildren);break e}throw Error(o(163))}}function vd(u){var c=u.updateQueue;if(c!==null){u.updateQueue=null;var g=u.stateNode;g===null&&(g=u.stateNode=new KL),c.forEach(function(M){var C=sI.bind(null,u,M);g.has(M)||(g.add(M),M.then(C,C))})}}function QL(u,c){for(Fe=c;Fe!==null;){c=Fe;var g=c.deletions;if(g!==null)for(var M=0;M<g.length;M++){var C=g[M];try{var T=u;Ie?Tw(T,C,c):ww(T,C,c);var k=C.alternate;k!==null&&(k.return=null),C.return=null}catch(Ke){xi(C,c,Ke)}}if(g=c.child,c.subtreeFlags&12854&&g!==null)g.return=c,Fe=g;else for(;Fe!==null;){c=Fe;try{var X=c.flags;if(X&32&&Ie&&yt(c.stateNode),X&512){var fe=c.alternate;if(fe!==null){var be=fe.ref;be!==null&&(typeof be=="function"?be(null):be.current=null)}}if(X&8192)switch(c.tag){case 13:if(c.memoizedState!==null){var Ve=c.alternate;(Ve===null||Ve.memoizedState===null)&&(W0=Ln())}break;case 22:var ot=c.memoizedState!==null,et=c.alternate,Ut=et!==null&&et.memoizedState!==null;if(g=c,Ie){e:if(M=g,C=ot,T=null,Ie)for(var Qe=M;;){if(Qe.tag===5){if(T===null){T=Qe;var Kn=Qe.stateNode;C?Vt(Kn):ue(Qe.stateNode,Qe.memoizedProps)}}else if(Qe.tag===6){if(T===null){var ir=Qe.stateNode;C?K(ir):xe(ir,Qe.memoizedProps)}}else if((Qe.tag!==22&&Qe.tag!==23||Qe.memoizedState===null||Qe===M)&&Qe.child!==null){Qe.child.return=Qe,Qe=Qe.child;continue}if(Qe===M)break;for(;Qe.sibling===null;){if(Qe.return===null||Qe.return===M)break e;T===Qe&&(T=null),Qe=Qe.return}T===Qe&&(T=null),Qe.sibling.return=Qe.return,Qe=Qe.sibling}}if(ot&&!Ut&&g.mode&1){Fe=g;for(var ne=g.child;ne!==null;){for(g=Fe=ne;Fe!==null;){M=Fe;var Q=M.child;switch(M.tag){case 0:case 11:case 14:case 15:sa(4,M,M.return);break;case 1:yd(M,M.return);var oe=M.stateNode;if(typeof oe.componentWillUnmount=="function"){var Ne=M.return;try{oe.props=M.memoizedProps,oe.state=M.memoizedState,oe.componentWillUnmount()}catch(Ke){xi(M,Ne,Ke)}}break;case 5:yd(M,M.return);break;case 22:if(M.memoizedState!==null){Rw(g);continue}}Q!==null?(Q.return=M,Fe=Q):Rw(g)}ne=ne.sibling}}}switch(X&4102){case 2:bw(c),c.flags&=-3;break;case 6:bw(c),c.flags&=-3,k0(c.alternate,c);break;case 4096:c.flags&=-4097;break;case 4100:c.flags&=-4097,k0(c.alternate,c);break;case 4:k0(c.alternate,c)}}catch(Ke){xi(c,c.return,Ke)}if(g=c.sibling,g!==null){g.return=c.return,Fe=g;break}Fe=c.return}}}function ZL(u,c,g){Fe=u,Pw(u)}function Pw(u,c,g){for(var M=(u.mode&1)!==0;Fe!==null;){var C=Fe,T=C.child;if(C.tag===22&&M){var k=C.memoizedState!==null||gd;if(!k){var X=C.alternate,fe=X!==null&&X.memoizedState!==null||ra;X=gd;var be=ra;if(gd=k,(ra=fe)&&!be)for(Fe=C;Fe!==null;)k=Fe,fe=k.child,k.tag===22&&k.memoizedState!==null?Lw(C):fe!==null?(fe.return=k,Fe=fe):Lw(C);for(;T!==null;)Fe=T,Pw(T),T=T.sibling;Fe=C,gd=X,ra=be}Bw(u)}else C.subtreeFlags&8772&&T!==null?(T.return=C,Fe=T):Bw(u)}}function Bw(u){for(;Fe!==null;){var c=Fe;if(c.flags&8772){var g=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:ra||mc(5,c);break;case 1:var M=c.stateNode;if(c.flags&4&&!ra)if(g===null)M.componentDidMount();else{var C=c.elementType===c.type?g.memoizedProps:xr(c.type,g.memoizedProps);M.componentDidUpdate(C,g.memoizedState,M.__reactInternalSnapshotBeforeUpdate)}var T=c.updateQueue;T!==null&&SM(c,T,M);break;case 3:var k=c.updateQueue;if(k!==null){if(g=null,c.child!==null)switch(c.child.tag){case 5:g=te(c.child.stateNode);break;case 1:g=c.child.stateNode}SM(c,k,g)}break;case 5:var X=c.stateNode;g===null&&c.flags&4&&Xe(X,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(re&&c.memoizedState===null){var fe=c.alternate;if(fe!==null){var be=fe.memoizedState;if(be!==null){var Ve=be.dehydrated;Ve!==null&&_t(Ve)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(o(163))}ra||c.flags&512&&D0(c)}catch(ot){xi(c,c.return,ot)}}if(c===u){Fe=null;break}if(g=c.sibling,g!==null){g.return=c.return,Fe=g;break}Fe=c.return}}function Rw(u){for(;Fe!==null;){var c=Fe;if(c===u){Fe=null;break}var g=c.sibling;if(g!==null){g.return=c.return,Fe=g;break}Fe=c.return}}function Lw(u){for(;Fe!==null;){var c=Fe;try{switch(c.tag){case 0:case 11:case 15:var g=c.return;try{mc(4,c)}catch(fe){xi(c,g,fe)}break;case 1:var M=c.stateNode;if(typeof M.componentDidMount=="function"){var C=c.return;try{M.componentDidMount()}catch(fe){xi(c,C,fe)}}var T=c.return;try{D0(c)}catch(fe){xi(c,T,fe)}break;case 5:var k=c.return;try{D0(c)}catch(fe){xi(c,k,fe)}}}catch(fe){xi(c,c.return,fe)}if(c===u){Fe=null;break}var X=c.sibling;if(X!==null){X.return=c.return,Fe=X;break}Fe=c.return}}var xd=0,_d=1,Ad=2,Md=3,wd=4;if(typeof Symbol=="function"&&Symbol.for){var gc=Symbol.for;xd=gc("selector.component"),_d=gc("selector.has_pseudo_class"),Ad=gc("selector.role"),Md=gc("selector.test_id"),wd=gc("selector.text")}function O0(u){var c=Ce(u);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(o(364));return c}if(u=wt(u),u===null)throw Error(o(362));return u.stateNode.current}function U0(u,c){switch(c.$$typeof){case xd:if(u.type===c.value)return!0;break;case _d:e:{c=c.value,u=[u,0];for(var g=0;g<u.length;){var M=u[g++],C=u[g++],T=c[C];if(M.tag!==5||!ie(M)){for(;T!=null&&U0(M,T);)C++,T=c[C];if(C===c.length){c=!0;break e}else for(M=M.child;M!==null;)u.push(M,C),M=M.sibling}}c=!1}return c;case Ad:if(u.tag===5&&we(u.stateNode,c.value))return!0;break;case wd:if((u.tag===5||u.tag===6)&&(u=I(u),u!==null&&0<=u.indexOf(c.value)))return!0;break;case Md:if(u.tag===5&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function z0(u){switch(u.$$typeof){case xd:return"<"+(R(u.value)||"Unknown")+">";case _d:return":has("+(z0(u)||"")+")";case Ad:return'[role="'+u.value+'"]';case wd:return'"'+u.value+'"';case Md:return'[data-testname="'+u.value+'"]';default:throw Error(o(365))}}function Iw(u,c){var g=[];u=[u,0];for(var M=0;M<u.length;){var C=u[M++],T=u[M++],k=c[T];if(C.tag!==5||!ie(C)){for(;k!=null&&U0(C,k);)T++,k=c[T];if(T===c.length)g.push(C);else for(C=C.child;C!==null;)u.push(C,T),C=C.sibling}}return g}function G0(u,c){if(!vt)throw Error(o(363));u=O0(u),u=Iw(u,c),c=[],u=Array.from(u);for(var g=0;g<u.length;){var M=u[g++];if(M.tag===5)ie(M)||c.push(M.stateNode);else for(M=M.child;M!==null;)u.push(M),M=M.sibling}return c}var qL=Math.ceil,Sd=a.ReactCurrentDispatcher,H0=a.ReactCurrentOwner,dn=a.ReactCurrentBatchConfig,gt=0,yn=null,vn=null,On=0,Ri=0,wl=Ki(0),wn=0,yc=null,Sl=0,Cd=0,V0=0,vc=null,yi=null,W0=0,j0=1/0;function Cl(){j0=Ln()+500}var Ed=!1,J0=null,Zs=null,bd=!1,qs=null,Td=0,xc=0,X0=null,Pd=-1,Bd=0;function ri(){return gt&6?Ln():Pd!==-1?Pd:Pd=Ln()}function $s(u){return u.mode&1?gt&2&&On!==0?On&-On:DL.transition!==null?(Bd===0&&(u=Vh,Vh<<=1,!(Vh&4194240)&&(Vh=64),Bd=u),Bd):(u=Rt,u!==0?u:Be()):1}function tr(u,c,g){if(50<xc)throw xc=0,X0=null,Error(o(185));var M=Rd(u,c);return M===null?null:(nc(M,c,g),(!(gt&2)||M!==yn)&&(M===yn&&(!(gt&2)&&(Cd|=c),wn===4&&eo(M,On)),vi(M,g),c===1&>===0&&!(u.mode&1)&&(Cl(),Xh&&Vr())),M)}function Rd(u,c){u.lanes|=c;var g=u.alternate;for(g!==null&&(g.lanes|=c),g=u,u=u.return;u!==null;)u.childLanes|=c,g=u.alternate,g!==null&&(g.childLanes|=c),g=u,u=u.return;return g.tag===3?g.stateNode:null}function vi(u,c){var g=u.callbackNode;CL(u,c);var M=jh(u,u===yn?On:0);if(M===0)g!==null&&xM(g),u.callbackNode=null,u.callbackPriority=0;else if(c=M&-M,u.callbackPriority!==c){if(g!=null&&xM(g),c===1)u.tag===0?IL(Fw.bind(null,u)):_M(Fw.bind(null,u)),Je?je(function(){gt===0&&Vr()}):t0(n0,Vr),g=null;else{switch(vM(M)){case 1:g=n0;break;case 4:g=PL;break;case 16:g=i0;break;case 536870912:g=BL;break;default:g=i0}g=Ww(g,Dw.bind(null,u))}u.callbackPriority=c,u.callbackNode=g}}function Dw(u,c){if(Pd=-1,Bd=0,gt&6)throw Error(o(327));var g=u.callbackNode;if(la()&&u.callbackNode!==g)return null;var M=jh(u,u===yn?On:0);if(M===0)return null;if(M&30||M&u.expiredLanes||c)c=Ld(u,M);else{c=M;var C=gt;gt|=2;var T=Ow();(yn!==u||On!==c)&&(Cl(),oa(u,c));do try{tI();break}catch(X){kw(u,X)}while(1);o0(),Sd.current=T,gt=C,vn!==null?c=0:(yn=null,On=0,c=wn)}if(c!==0){if(c===2&&(C=qg(u),C!==0&&(M=C,c=K0(u,C))),c===1)throw g=yc,oa(u,0),eo(u,M),vi(u,Ln()),g;if(c===6)eo(u,M);else{if(C=u.current.alternate,!(M&30)&&!$L(C)&&(c=Ld(u,M),c===2&&(T=qg(u),T!==0&&(M=T,c=K0(u,T))),c===1))throw g=yc,oa(u,0),eo(u,M),vi(u,Ln()),g;switch(u.finishedWork=C,u.finishedLanes=M,c){case 0:case 1:throw Error(o(345));case 2:aa(u,yi);break;case 3:if(eo(u,M),(M&130023424)===M&&(c=W0+500-Ln(),10<c)){if(jh(u,0)!==0)break;if(C=u.suspendedLanes,(C&M)!==M){ri(),u.pingedLanes|=u.suspendedLanes&C;break}u.timeoutHandle=ke(aa.bind(null,u,yi),c);break}aa(u,yi);break;case 4:if(eo(u,M),(M&4194240)===M)break;for(c=u.eventTimes,C=-1;0<M;){var k=31-vr(M);T=1<<k,k=c[k],k>C&&(C=k),M&=~T}if(M=C,M=Ln()-M,M=(120>M?120:480>M?480:1080>M?1080:1920>M?1920:3e3>M?3e3:4320>M?4320:1960*qL(M/1960))-M,10<M){u.timeoutHandle=ke(aa.bind(null,u,yi),M);break}aa(u,yi);break;case 5:aa(u,yi);break;default:throw Error(o(329))}}}return vi(u,Ln()),u.callbackNode===g?Dw.bind(null,u):null}function K0(u,c){var g=vc;return u.current.memoizedState.isDehydrated&&(oa(u,c).flags|=256),u=Ld(u,c),u!==2&&(c=yi,yi=g,c!==null&&Y0(c)),u}function Y0(u){yi===null?yi=u:yi.push.apply(yi,u)}function $L(u){for(var c=u;;){if(c.flags&16384){var g=c.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var M=0;M<g.length;M++){var C=g[M],T=C.getSnapshot;C=C.value;try{if(!Hr(T(),C))return!1}catch{return!1}}}if(g=c.child,c.subtreeFlags&16384&&g!==null)g.return=c,c=g;else{if(c===u)break;for(;c.sibling===null;){if(c.return===null||c.return===u)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function eo(u,c){for(c&=~V0,c&=~Cd,u.suspendedLanes|=c,u.pingedLanes&=~c,u=u.expirationTimes;0<c;){var g=31-vr(c),M=1<<g;u[g]=-1,c&=~M}}function Fw(u){if(gt&6)throw Error(o(327));la();var c=jh(u,0);if(!(c&1))return vi(u,Ln()),null;var g=Ld(u,c);if(u.tag!==0&&g===2){var M=qg(u);M!==0&&(c=M,g=K0(u,M))}if(g===1)throw g=yc,oa(u,0),eo(u,c),vi(u,Ln()),g;if(g===6)throw Error(o(345));return u.finishedWork=u.current.alternate,u.finishedLanes=c,aa(u,yi),vi(u,Ln()),null}function Nw(u){qs!==null&&qs.tag===0&&!(gt&6)&&la();var c=gt;gt|=1;var g=dn.transition,M=Rt;try{if(dn.transition=null,Rt=1,u)return u()}finally{Rt=M,dn.transition=g,gt=c,!(gt&6)&&Vr()}}function Q0(){Ri=wl.current,ct(wl)}function oa(u,c){u.finishedWork=null,u.finishedLanes=0;var g=u.timeoutHandle;if(g!==He&&(u.timeoutHandle=He,Oe(g)),vn!==null)for(g=vn.return;g!==null;){var M=g;switch(d0(M),M.tag){case 1:M=M.type.childContextTypes,M!=null&&Gh();break;case 3:Al(),ct(Rn),ct(Ft),_0();break;case 5:v0(M);break;case 4:Al();break;case 13:ct(Zt);break;case 19:ct(Zt);break;case 10:a0(M.type._context);break;case 22:case 23:Q0()}g=g.return}if(yn=u,vn=u=to(u.current,null),On=Ri=c,wn=0,yc=null,V0=Cd=Sl=0,yi=vc=null,Wr!==null){for(c=0;c<Wr.length;c++)if(g=Wr[c],M=g.interleaved,M!==null){g.interleaved=null;var C=M.next,T=g.pending;if(T!==null){var k=T.next;T.next=C,M.next=k}g.pending=M}Wr=null}return u}function kw(u,c){do{var g=vn;try{if(o0(),rd.current=cd,sd){for(var M=ln.memoizedState;M!==null;){var C=M.queue;C!==null&&(C.pending=null),M=M.next}sd=!1}if(Ml=0,In=jn=ln=null,lc=!1,uc=0,H0.current=null,g===null||g.return===null){wn=1,yc=c,vn=null;break}e:{var T=u,k=g.return,X=g,fe=c;if(c=On,X.flags|=32768,fe!==null&&typeof fe=="object"&&typeof fe.then=="function"){var be=fe,Ve=X,ot=Ve.tag;if(!(Ve.mode&1)&&(ot===0||ot===11||ot===15)){var et=Ve.alternate;et?(Ve.updateQueue=et.updateQueue,Ve.memoizedState=et.memoizedState,Ve.lanes=et.lanes):(Ve.updateQueue=null,Ve.memoizedState=null)}var Ut=rw(k);if(Ut!==null){Ut.flags&=-257,sw(Ut,k,X,T,c),Ut.mode&1&&iw(T,be,c),c=Ut,fe=be;var Qe=c.updateQueue;if(Qe===null){var Kn=new Set;Kn.add(fe),c.updateQueue=Kn}else Qe.add(fe);break e}else{if(!(c&1)){iw(T,be,c),Z0();break e}fe=Error(o(426))}}else if(Xt&&X.mode&1){var ir=rw(k);if(ir!==null){!(ir.flags&65536)&&(ir.flags|=256),sw(ir,k,X,T,c),g0(fe);break e}}T=fe,wn!==4&&(wn=2),vc===null?vc=[T]:vc.push(T),fe=b0(fe,X),X=k;do{switch(X.tag){case 3:X.flags|=65536,c&=-c,X.lanes|=c;var ne=tw(X,fe,c);wM(X,ne);break e;case 1:T=fe;var Q=X.type,oe=X.stateNode;if(!(X.flags&128)&&(typeof Q.getDerivedStateFromError=="function"||oe!==null&&typeof oe.componentDidCatch=="function"&&(Zs===null||!Zs.has(oe)))){X.flags|=65536,c&=-c,X.lanes|=c;var Ne=nw(X,T,c);wM(X,Ne);break e}}X=X.return}while(X!==null)}zw(g)}catch(Ke){c=Ke,vn===g&&g!==null&&(vn=g=g.return);continue}break}while(1)}function Ow(){var u=Sd.current;return Sd.current=cd,u===null?cd:u}function Z0(){(wn===0||wn===3||wn===2)&&(wn=4),yn===null||!(Sl&268435455)&&!(Cd&268435455)||eo(yn,On)}function Ld(u,c){var g=gt;gt|=2;var M=Ow();yn===u&&On===c||oa(u,c);do try{eI();break}catch(C){kw(u,C)}while(1);if(o0(),gt=g,Sd.current=M,vn!==null)throw Error(o(261));return yn=null,On=0,wn}function eI(){for(;vn!==null;)Uw(vn)}function tI(){for(;vn!==null&&!bL();)Uw(vn)}function Uw(u){var c=Vw(u.alternate,u,Ri);u.memoizedProps=u.pendingProps,c===null?zw(u):vn=c,H0.current=null}function zw(u){var c=u;do{var g=c.alternate;if(u=c.return,c.flags&32768){if(g=XL(g,c),g!==null){g.flags&=32767,vn=g;return}if(u!==null)u.flags|=32768,u.subtreeFlags=0,u.deletions=null;else{wn=6,vn=null;return}}else if(g=WL(g,c,Ri),g!==null){vn=g;return}if(c=c.sibling,c!==null){vn=c;return}vn=c=u}while(c!==null);wn===0&&(wn=5)}function aa(u,c){var g=Rt,M=dn.transition;try{dn.transition=null,Rt=1,nI(u,c,g)}finally{dn.transition=M,Rt=g}return null}function nI(u,c,g){do la();while(qs!==null);if(gt&6)throw Error(o(327));var M=u.finishedWork,C=u.finishedLanes;if(M===null)return null;if(u.finishedWork=null,u.finishedLanes=0,M===u.current)throw Error(o(177));u.callbackNode=null,u.callbackPriority=0;var T=M.lanes|M.childLanes;if(EL(u,T),u===yn&&(vn=yn=null,On=0),!(M.subtreeFlags&2064)&&!(M.flags&2064)||bd||(bd=!0,Ww(i0,function(){return la(),null})),T=(M.flags&15990)!==0,M.subtreeFlags&15990||T){T=dn.transition,dn.transition=null;var k=Rt;Rt=1;var X=gt;gt|=4,H0.current=null,YL(u,M),QL(u,M),j(u.containerInfo),u.current=M,ZL(M),TL(),gt=X,Rt=k,dn.transition=T}else u.current=M;if(bd&&(bd=!1,qs=u,Td=C),T=u.pendingLanes,T===0&&(Zs=null),RL(M.stateNode),vi(u,Ln()),c!==null)for(g=u.onRecoverableError,M=0;M<c.length;M++)g(c[M]);if(Ed)throw Ed=!1,u=J0,J0=null,u;return Td&1&&u.tag!==0&&la(),T=u.pendingLanes,T&1?u===X0?xc++:(xc=0,X0=u):xc=0,Vr(),null}function la(){if(qs!==null){var u=vM(Td),c=dn.transition,g=Rt;try{if(dn.transition=null,Rt=16>u?16:u,qs===null)var M=!1;else{if(u=qs,qs=null,Td=0,gt&6)throw Error(o(331));var C=gt;for(gt|=4,Fe=u.current;Fe!==null;){var T=Fe,k=T.child;if(Fe.flags&16){var X=T.deletions;if(X!==null){for(var fe=0;fe<X.length;fe++){var be=X[fe];for(Fe=be;Fe!==null;){var Ve=Fe;switch(Ve.tag){case 0:case 11:case 15:sa(8,Ve,T)}var ot=Ve.child;if(ot!==null)ot.return=Ve,Fe=ot;else for(;Fe!==null;){Ve=Fe;var et=Ve.sibling,Ut=Ve.return;if(Sw(Ve),Ve===be){Fe=null;break}if(et!==null){et.return=Ut,Fe=et;break}Fe=Ut}}}var Qe=T.alternate;if(Qe!==null){var Kn=Qe.child;if(Kn!==null){Qe.child=null;do{var ir=Kn.sibling;Kn.sibling=null,Kn=ir}while(Kn!==null)}}Fe=T}}if(T.subtreeFlags&2064&&k!==null)k.return=T,Fe=k;else e:for(;Fe!==null;){if(T=Fe,T.flags&2048)switch(T.tag){case 0:case 11:case 15:sa(9,T,T.return)}var ne=T.sibling;if(ne!==null){ne.return=T.return,Fe=ne;break e}Fe=T.return}}var Q=u.current;for(Fe=Q;Fe!==null;){k=Fe;var oe=k.child;if(k.subtreeFlags&2064&&oe!==null)oe.return=k,Fe=oe;else e:for(k=Q;Fe!==null;){if(X=Fe,X.flags&2048)try{switch(X.tag){case 0:case 11:case 15:mc(9,X)}}catch(Ke){xi(X,X.return,Ke)}if(X===k){Fe=null;break e}var Ne=X.sibling;if(Ne!==null){Ne.return=X.return,Fe=Ne;break e}Fe=X.return}}if(gt=C,Vr(),Gr&&typeof Gr.onPostCommitFiberRoot=="function")try{Gr.onPostCommitFiberRoot(Jh,u)}catch{}M=!0}return M}finally{Rt=g,dn.transition=c}}return!1}function Gw(u,c,g){c=b0(g,c),c=tw(u,c,1),Qs(u,c),c=ri(),u=Rd(u,1),u!==null&&(nc(u,1,c),vi(u,c))}function xi(u,c,g){if(u.tag===3)Gw(u,u,g);else for(;c!==null;){if(c.tag===3){Gw(c,u,g);break}else if(c.tag===1){var M=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof M.componentDidCatch=="function"&&(Zs===null||!Zs.has(M))){u=b0(g,u),u=nw(c,u,1),Qs(c,u),u=ri(),c=Rd(c,1),c!==null&&(nc(c,1,u),vi(c,u));break}}c=c.return}}function iI(u,c,g){var M=u.pingCache;M!==null&&M.delete(c),c=ri(),u.pingedLanes|=u.suspendedLanes&g,yn===u&&(On&g)===g&&(wn===4||wn===3&&(On&130023424)===On&&500>Ln()-W0?oa(u,0):V0|=g),vi(u,c)}function Hw(u,c){c===0&&(u.mode&1?(c=Wh,Wh<<=1,!(Wh&130023424)&&(Wh=4194304)):c=1);var g=ri();u=Rd(u,c),u!==null&&(nc(u,c,g),vi(u,g))}function rI(u){var c=u.memoizedState,g=0;c!==null&&(g=c.retryLane),Hw(u,g)}function sI(u,c){var g=0;switch(u.tag){case 13:var M=u.stateNode,C=u.memoizedState;C!==null&&(g=C.retryLane);break;case 19:M=u.stateNode;break;default:throw Error(o(314))}M!==null&&M.delete(c),Hw(u,g)}var Vw;Vw=function(u,c,g){if(u!==null)if(u.memoizedProps!==c.pendingProps||Rn.current)Bi=!0;else{if(!(u.lanes&g)&&!(c.flags&128))return Bi=!1,JL(u,c,g);Bi=!!(u.flags&131072)}else Bi=!1,Xt&&c.flags&1048576&&PM(c,td,c.index);switch(c.lanes=0,c.tag){case 2:var M=c.type;u!==null&&(u.alternate=null,c.alternate=null,c.flags|=2),u=c.pendingProps;var C=cs(c,Ft.current);ml(c,g),C=M0(null,c,M,u,C,g);var T=w0();return c.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,gi(M)?(T=!0,Hh(c)):T=!1,c.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,u0(c),C.updater=$h,c.stateNode=C,C._reactInternals=c,f0(c,M,u,g),c=B0(null,c,M,!0,T,g)):(c.tag=0,Xt&&T&&h0(c),ii(null,c,C,g),c=c.child),c;case 16:M=c.elementType;e:{switch(u!==null&&(u.alternate=null,c.alternate=null,c.flags|=2),u=c.pendingProps,C=M._init,M=C(M._payload),c.type=M,C=c.tag=aI(M),u=xr(M,u),C){case 0:c=P0(null,c,M,u,g);break e;case 1:c=dw(null,c,M,u,g);break e;case 11:c=lw(null,c,M,u,g);break e;case 14:c=uw(null,c,M,xr(M.type,u),g);break e}throw Error(o(306,M,""))}return c;case 0:return M=c.type,C=c.pendingProps,C=c.elementType===M?C:xr(M,C),P0(u,c,M,C,g);case 1:return M=c.type,C=c.pendingProps,C=c.elementType===M?C:xr(M,C),dw(u,c,M,C,g);case 3:e:{if(pw(c),u===null)throw Error(o(387));M=c.pendingProps,T=c.memoizedState,C=T.element,MM(u,c),qh(c,M,null,g);var k=c.memoizedState;if(M=k.element,re&&T.isDehydrated)if(T={element:M,isDehydrated:!1,cache:k.cache,transitions:k.transitions},c.updateQueue.baseState=T,c.memoizedState=T,c.flags&256){C=Error(o(423)),c=mw(u,c,M,g,C);break e}else if(M!==C){C=Error(o(424)),c=mw(u,c,M,g,C);break e}else for(re&&(Pi=q(c.stateNode.containerInfo),Ti=c,Xt=!0,_r=null,ic=!1),g=FM(c,null,M,g),c.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(vl(),M===C){c=gs(u,c,g);break e}ii(u,c,M,g)}c=c.child}return c;case 5:return NM(c),u===null&&m0(c),M=c.type,C=c.pendingProps,T=u!==null?u.memoizedProps:null,k=C.children,_e(M,C)?k=null:T!==null&&_e(M,T)&&(c.flags|=32),hw(u,c),ii(u,c,k,g),c.child;case 6:return u===null&&m0(c),null;case 13:return gw(u,c,g);case 4:return y0(c,c.stateNode.containerInfo),M=c.pendingProps,u===null?c.child=xl(c,null,M,g):ii(u,c,M,g),c.child;case 11:return M=c.type,C=c.pendingProps,C=c.elementType===M?C:xr(M,C),lw(u,c,M,C,g);case 7:return ii(u,c,c.pendingProps,g),c.child;case 8:return ii(u,c,c.pendingProps.children,g),c.child;case 12:return ii(u,c,c.pendingProps.children,g),c.child;case 10:e:{if(M=c.type._context,C=c.pendingProps,T=c.memoizedProps,k=C.value,AM(c,M,k),T!==null)if(Hr(T.value,k)){if(T.children===C.children&&!Rn.current){c=gs(u,c,g);break e}}else for(T=c.child,T!==null&&(T.return=c);T!==null;){var X=T.dependencies;if(X!==null){k=T.child;for(var fe=X.firstContext;fe!==null;){if(fe.context===M){if(T.tag===1){fe=hs(-1,g&-g),fe.tag=2;var be=T.updateQueue;if(be!==null){be=be.shared;var Ve=be.pending;Ve===null?fe.next=fe:(fe.next=Ve.next,Ve.next=fe),be.pending=fe}}T.lanes|=g,fe=T.alternate,fe!==null&&(fe.lanes|=g),l0(T.return,g,c),X.lanes|=g;break}fe=fe.next}}else if(T.tag===10)k=T.type===c.type?null:T.child;else if(T.tag===18){if(k=T.return,k===null)throw Error(o(341));k.lanes|=g,X=k.alternate,X!==null&&(X.lanes|=g),l0(k,g,c),k=T.sibling}else k=T.child;if(k!==null)k.return=T;else for(k=T;k!==null;){if(k===c){k=null;break}if(T=k.sibling,T!==null){T.return=k.return,k=T;break}k=k.return}T=k}ii(u,c,C.children,g),c=c.child}return c;case 9:return C=c.type,M=c.pendingProps.children,ml(c,g),C=Qi(C),M=M(C),c.flags|=1,ii(u,c,M,g),c.child;case 14:return M=c.type,C=xr(M,c.pendingProps),C=xr(M.type,C),uw(u,c,M,C,g);case 15:return cw(u,c,c.type,c.pendingProps,g);case 17:return M=c.type,C=c.pendingProps,C=c.elementType===M?C:xr(M,C),u!==null&&(u.alternate=null,c.alternate=null,c.flags|=2),c.tag=1,gi(M)?(u=!0,Hh(c)):u=!1,ml(c,g),bM(c,M,C),f0(c,M,C,g),B0(null,c,M,!0,u,g);case 19:return _w(u,c,g);case 22:return fw(u,c,g)}throw Error(o(156,c.tag))};function Ww(u,c){return t0(u,c)}function oI(u,c,g,M){this.tag=u,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=M,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(u,c,g,M){return new oI(u,c,g,M)}function q0(u){return u=u.prototype,!(!u||!u.isReactComponent)}function aI(u){if(typeof u=="function")return q0(u)?1:0;if(u!=null){if(u=u.$$typeof,u===y)return 11;if(u===A)return 14}return 2}function to(u,c){var g=u.alternate;return g===null?(g=nr(u.tag,c,u.key,u.mode),g.elementType=u.elementType,g.type=u.type,g.stateNode=u.stateNode,g.alternate=u,u.alternate=g):(g.pendingProps=c,g.type=u.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=u.flags&14680064,g.childLanes=u.childLanes,g.lanes=u.lanes,g.child=u.child,g.memoizedProps=u.memoizedProps,g.memoizedState=u.memoizedState,g.updateQueue=u.updateQueue,c=u.dependencies,g.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},g.sibling=u.sibling,g.index=u.index,g.ref=u.ref,g}function Id(u,c,g,M,C,T){var k=2;if(M=u,typeof u=="function")q0(u)&&(k=1);else if(typeof u=="string")k=5;else e:switch(u){case h:return ua(g.children,C,T,c);case d:k=8,C|=8;break;case p:return u=nr(12,g,c,C|2),u.elementType=p,u.lanes=T,u;case x:return u=nr(13,g,c,C),u.elementType=x,u.lanes=T,u;case _:return u=nr(19,g,c,C),u.elementType=_,u.lanes=T,u;case S:return Dd(g,C,T,c);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case m:k=10;break e;case v:k=9;break e;case y:k=11;break e;case A:k=14;break e;case w:k=16,M=null;break e}throw Error(o(130,u==null?u:typeof u,""))}return c=nr(k,g,c,C),c.elementType=u,c.type=M,c.lanes=T,c}function ua(u,c,g,M){return u=nr(7,u,M,c),u.lanes=g,u}function Dd(u,c,g,M){return u=nr(22,u,M,c),u.elementType=S,u.lanes=g,u.stateNode={},u}function $0(u,c,g){return u=nr(6,u,null,c),u.lanes=g,u}function ey(u,c,g){return c=nr(4,u.children!==null?u.children:[],u.key,c),c.lanes=g,c.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},c}function lI(u,c,g,M,C){this.tag=c,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=He,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$g(0),this.expirationTimes=$g(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$g(0),this.identifierPrefix=M,this.onRecoverableError=C,re&&(this.mutableSourceEagerHydrationData=null)}function jw(u,c,g,M,C,T,k,X,fe){return u=new lI(u,c,g,X,fe),c===1?(c=1,T===!0&&(c|=8)):c=0,T=nr(3,null,null,c),u.current=T,T.stateNode=u,T.memoizedState={element:M,isDehydrated:g,cache:null,transitions:null},u0(T),u}function Jw(u){if(!u)return Yi;u=u._reactInternals;e:{if(B(u)!==u||u.tag!==1)throw Error(o(170));var c=u;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(gi(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(u.tag===1){var g=u.type;if(gi(g))return gM(u,g,c)}return c}function Xw(u){var c=u._reactInternals;if(c===void 0)throw typeof u.render=="function"?Error(o(188)):(u=Object.keys(u).join(","),Error(o(268,u)));return u=Z(c),u===null?null:u.stateNode}function Kw(u,c){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var g=u.retryLane;u.retryLane=g!==0&&g<c?g:c}}function ty(u,c){Kw(u,c),(u=u.alternate)&&Kw(u,c)}function uI(u){return u=Z(u),u===null?null:u.stateNode}function cI(){return null}return t.attemptContinuousHydration=function(u){if(u.tag===13){var c=ri();tr(u,134217728,c),ty(u,134217728)}},t.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var c=ri(),g=$s(u);tr(u,g,c),ty(u,g)}},t.attemptSynchronousHydration=function(u){switch(u.tag){case 3:var c=u.stateNode;if(c.current.memoizedState.isDehydrated){var g=tc(c.pendingLanes);g!==0&&(e0(c,g|1),vi(c,Ln()),!(gt&6)&&(Cl(),Vr()))}break;case 13:var M=ri();Nw(function(){return tr(u,1,M)}),ty(u,1)}},t.batchedUpdates=function(u,c){var g=gt;gt|=1;try{return u(c)}finally{gt=g,gt===0&&(Cl(),Xh&&Vr())}},t.createComponentSelector=function(u){return{$$typeof:xd,value:u}},t.createContainer=function(u,c,g,M,C,T,k){return jw(u,c,!1,null,g,M,C,T,k)},t.createHasPseudoClassSelector=function(u){return{$$typeof:_d,value:u}},t.createHydrationContainer=function(u,c,g,M,C,T,k,X,fe){return u=jw(g,M,!0,u,C,T,k,X,fe),u.context=Jw(null),g=u.current,M=ri(),C=$s(g),T=hs(M,C),T.callback=c??null,Qs(g,T),u.current.lanes=C,nc(u,C,M),vi(u,M),u},t.createPortal=function(u,c,g){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:M==null?null:""+M,children:u,containerInfo:c,implementation:g}},t.createRoleSelector=function(u){return{$$typeof:Ad,value:u}},t.createTestNameSelector=function(u){return{$$typeof:Md,value:u}},t.createTextSelector=function(u){return{$$typeof:wd,value:u}},t.deferredUpdates=function(u){var c=Rt,g=dn.transition;try{return dn.transition=null,Rt=16,u()}finally{Rt=c,dn.transition=g}},t.discreteUpdates=function(u,c,g,M,C){var T=Rt,k=dn.transition;try{return dn.transition=null,Rt=1,u(c,g,M,C)}finally{Rt=T,dn.transition=k,gt===0&&Cl()}},t.findAllNodes=G0,t.findBoundingRects=function(u,c){if(!vt)throw Error(o(363));c=G0(u,c),u=[];for(var g=0;g<c.length;g++)u.push(O(c[g]));for(c=u.length-1;0<c;c--){g=u[c];for(var M=g.x,C=M+g.width,T=g.y,k=T+g.height,X=c-1;0<=X;X--)if(c!==X){var fe=u[X],be=fe.x,Ve=be+fe.width,ot=fe.y,et=ot+fe.height;if(M>=be&&T>=ot&&C<=Ve&&k<=et){u.splice(c,1);break}else if(M!==be||g.width!==fe.width||et<T||ot>k){if(!(T!==ot||g.height!==fe.height||Ve<M||be>C)){be>M&&(fe.width+=be-M,fe.x=M),Ve<C&&(fe.width=C-be),u.splice(c,1);break}}else{ot>T&&(fe.height+=ot-T,fe.y=T),et<k&&(fe.height=k-ot),u.splice(c,1);break}}}return u},t.findHostInstance=Xw,t.findHostInstanceWithNoPortals=function(u){return u=z(u),u=u!==null?H(u):null,u===null?null:u.stateNode},t.findHostInstanceWithWarning=function(u){return Xw(u)},t.flushControlled=function(u){var c=gt;gt|=1;var g=dn.transition,M=Rt;try{dn.transition=null,Rt=1,u()}finally{Rt=M,dn.transition=g,gt=c,gt===0&&(Cl(),Vr())}},t.flushPassiveEffects=la,t.flushSync=Nw,t.focusWithin=function(u,c){if(!vt)throw Error(o(363));for(u=O0(u),c=Iw(u,c),c=Array.from(c),u=0;u<c.length;){var g=c[u++];if(!ie(g)){if(g.tag===5&&Ee(g.stateNode))return!0;for(g=g.child;g!==null;)c.push(g),g=g.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Rt},t.getFindAllNodesFailureDescription=function(u,c){if(!vt)throw Error(o(363));var g=0,M=[];u=[O0(u),0];for(var C=0;C<u.length;){var T=u[C++],k=u[C++],X=c[k];if((T.tag!==5||!ie(T))&&(U0(T,X)&&(M.push(z0(X)),k++,k>g&&(g=k)),k<c.length))for(T=T.child;T!==null;)u.push(T,k),T=T.sibling}if(g<c.length){for(u=[];g<c.length;g++)u.push(z0(c[g]));return`findAllNodes was able to match part of the selector: `+(M.join(" > ")+` No matching component was found for: `)+u.join(" > ")}return null},t.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 5:return te(u.child.stateNode);default:return u.child.stateNode}},t.injectIntoDevTools=function(u){if(u={bundleType:u.bundleType,version:u.version,rendererPackageName:u.rendererPackageName,rendererConfig:u.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:uI,findFiberByHostInstance:u.findFiberByHostInstance||cI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)u=!0;else{try{Jh=c.inject(u),Gr=c}catch{}u=!!c.checkDCE}}return u},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(u,c,g,M){if(!vt)throw Error(o(363));u=G0(u,c);var C=Pe(u,g,M).disconnect;return{disconnect:function(){C()}}},t.registerMutableSourceForHydration=function(u,c){var g=c._getVersion;g=g(c._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[c,g]:u.mutableSourceEagerHydrationData.push(c,g)},t.runWithPriority=function(u,c){var g=Rt;try{return Rt=u,c()}finally{Rt=g}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(u,c,g,M){var C=c.current,T=ri(),k=$s(C);return g=Jw(g),c.context===null?c.context=g:c.pendingContext=g,c=hs(T,k),c.payload={element:u},M=M===void 0?null:M,M!==null&&(c.callback=M),Qs(C,c),u=tr(C,k,T),u!==null&&Zh(u,C,k),k},t};(function(n){n.exports=_5})(v5);const A5=mT(g1);function E3(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r<i;r++)if(!t(n[r],e[r]))return!1;return!0}const bs=[];function b3(n,e,t=!1,i={}){for(const s of bs)if(E3(e,s.keys,s.equal)){if(t)return;if(Object.prototype.hasOwnProperty.call(s,"error"))throw s.error;if(Object.prototype.hasOwnProperty.call(s,"response"))return s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,promise:n(...e).then(s=>r.response=s).then(()=>{i.lifespan&&i.lifespan>0&&setTimeout(()=>{const s=bs.indexOf(r);s!==-1&&bs.splice(s,1)},i.lifespan)}).catch(s=>r.error=s)};if(bs.push(r),!t)throw r.promise}const M5=(n,e,t)=>b3(n,e,!1,t),w5=(n,e,t)=>void b3(n,e,!0,t),S5=n=>{if(n===void 0||n.length===0)bs.splice(0,bs.length);else{const e=bs.find(t=>E3(n,t.keys,t.equal));if(e){const t=bs.indexOf(e);t!==-1&&bs.splice(t,1)}}};var IE,DE;const C5=(n,...e)=>e.reduce((t,i)=>t==null?void 0:t[i],n),jl="ColorManagement"in m1&&C5(m1,"ColorManagement")||null,T3=n=>n&&n.isOrthographicCamera,E5=n=>n&&n.hasOwnProperty("current"),Ih=typeof window<"u"&&((IE=window.document)!=null&&IE.createElement||((DE=window.navigator)==null?void 0:DE.product)==="ReactNative")?U.useLayoutEffect:U.useEffect;function P3(n){const e=U.useRef(n);return Ih(()=>void(e.current=n),[n]),e}function b5({set:n}){return Ih(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class B3 extends U.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}B3.getDerivedStateFromError=()=>({error:!0});const R3="__default",FE=new Map,T5=n=>n&&!!n.memoized&&!!n.changes;function L3(n){const e=typeof window<"u"?window.devicePixelRatio:1;return Array.isArray(n)?Math.min(Math.max(n[0],e),n[1]):n}const zc=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},qt={obj:n=>n===Object(n)&&!qt.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(qt.str(n)||qt.num(n))return n===e;const s=qt.obj(n);if(s&&i==="reference")return n===e;const o=qt.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;for(a in r?e:n)if(n[a]!==e[a])return!1;if(qt.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function P5(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function B5(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Jl(n,e){const t=n;return(e!=null&&e.primitive||!t.__r3f)&&(t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e}),n}function y1(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const NE=/-\d+$/;function cv(n,e,t){if(qt.str(t)){if(NE.test(t)){const s=t.replace(NE,""),{target:o,key:a}=y1(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=y1(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function kE(n,e,t){var i,r;if(qt.str(t)){const{target:s,key:o}=y1(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function I3(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},f=!1){var h;const d=(h=n==null?void 0:n.__r3f)!=null?h:{},p=Object.entries(r),m=[];if(f){const y=Object.keys(l);for(let x=0;x<y.length;x++)r.hasOwnProperty(y[x])||p.unshift([y[x],R3+"remove"])}p.forEach(([y,x])=>{var _;if((_=n.__r3f)!=null&&_.primitive&&y==="object"||qt.equ(x,l[y]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(y))return m.push([y,x,!0,[]]);let A=[];y.includes("-")&&(A=y.split("-")),m.push([y,x,!1,A]);for(const w in r){const S=r[w];w.startsWith(`${y}-`)&&m.push([w,S,!1,w.split("-")])}});const v={...r};return d.memoizedProps&&d.memoizedProps.args&&(v.args=d.memoizedProps.args),d.memoizedProps&&d.memoizedProps.attach&&(v.attach=d.memoizedProps.attach),{memoized:v,changes:m}}function fv(n,e){var t,i,r;const s=(t=n.__r3f)!=null?t:{},o=s.root,a=(i=o==null||o.getState==null?void 0:o.getState())!=null?i:{},{memoized:l,changes:f}=T5(e)?e:I3(n,e),h=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let p=0;p<f.length;p++){let[m,v,y,x]=f[p],_=n,A=_[m];if(x.length&&(A=x.reduce((w,S)=>w[S],n),!(A&&A.set))){const[w,...S]=x.reverse();_=S.reverse().reduce((b,P)=>b[P],n),m=w}if(v===R3+"remove")if(_.constructor){let w=FE.get(_.constructor);w||(w=new _.constructor,FE.set(_.constructor,w)),v=w[m]}else v=0;if(y)v?s.handlers[m]=v:delete s.handlers[m],s.eventCount=Object.keys(s.handlers).length;else if(A&&A.set&&(A.copy||A instanceof Xa)){if(Array.isArray(v))A.fromArray?A.fromArray(v):A.set(...v);else if(A.copy&&v&&v.constructor&&A.constructor===v.constructor)A.copy(v);else if(v!==void 0){const w=A instanceof Le;!w&&A.setScalar?A.setScalar(v):A instanceof Xa&&v instanceof Xa?A.mask=v.mask:A.set(v),!jl&&!a.linear&&w&&A.convertSRGBToLinear()}}else _[m]=v,!a.linear&&_[m]instanceof Qt&&_[m].format===Ai&&_[m].type===Hs&&(_[m].encoding=Ct);Xl(n)}if(s.parent&&a.internal&&n.raycast&&h!==s.eventCount){const p=a.internal.interaction.indexOf(n);p>-1&&a.internal.interaction.splice(p,1),s.eventCount&&a.internal.interaction.push(n)}return!(f.length===1&&f[0][0]==="onUpdate")&&f.length&&(r=n.__r3f)!=null&&r.parent&&v1(n),n}function Xl(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function v1(n){n.onUpdate==null||n.onUpdate(n)}function R5(n,e){n.manual||(T3(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function kp(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function L5(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return wo.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return wo.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return wo.ContinuousEventPriority;default:return wo.DefaultEventPriority}}function D3(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function I5(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{D3(t.capturedMap,e,i,r)})}function D5(n){function e(l){const{internal:f}=n.getState(),h=l.offsetX-f.initialClick[0],d=l.offsetY-f.initialClick[1];return Math.round(Math.sqrt(h*h+d*d))}function t(l){return l.filter(f=>["Move","Over","Enter","Out","Leave"].some(h=>{var d;return(d=f.__r3f)==null?void 0:d.handlers["onPointer"+h]}))}function i(l,f){const h=n.getState(),d=new Set,p=[],m=f?f(h.internal.interaction):h.internal.interaction;for(let _=0;_<m.length;_++){const A=zc(m[_]);A&&(A.raycaster.camera=void 0)}h.previousRoot||h.events.compute==null||h.events.compute(l,h);function v(_){const A=zc(_);if(!A||!A.events.enabled||A.raycaster.camera===null)return[];if(A.raycaster.camera===void 0){var w;A.events.compute==null||A.events.compute(l,A,(w=A.previousRoot)==null?void 0:w.getState()),A.raycaster.camera===void 0&&(A.raycaster.camera=null)}return A.raycaster.camera?A.raycaster.intersectObject(_,!0):[]}let y=m.flatMap(v).sort((_,A)=>{const w=zc(_.object),S=zc(A.object);return!w||!S?_.distance-A.distance:S.events.priority-w.events.priority||_.distance-A.distance}).filter(_=>{const A=kp(_);return d.has(A)?!1:(d.add(A),!0)});h.events.filter&&(y=h.events.filter(y,h));for(const _ of y){let A=_.object;for(;A;){var x;(x=A.__r3f)!=null&&x.eventCount&&p.push({..._,eventObject:A}),A=A.parent}}if("pointerId"in l&&h.internal.capturedMap.has(l.pointerId))for(let _ of h.internal.capturedMap.get(l.pointerId).values())d.has(kp(_.intersection))||p.push(_.intersection);return p}function r(l,f,h,d){const p=n.getState();if(l.length){const m={stopped:!1};for(const v of l){const y=zc(v.object)||p,{raycaster:x,pointer:_,camera:A,internal:w}=y,S=new D(_.x,_.y,0).unproject(A),b=L=>{var z,Z;return(z=(Z=w.capturedMap.get(L))==null?void 0:Z.has(v.eventObject))!=null?z:!1},P=L=>{const z={intersection:v,target:f.target};w.capturedMap.has(L)?w.capturedMap.get(L).set(v.eventObject,z):w.capturedMap.set(L,new Map([[v.eventObject,z]])),f.target.setPointerCapture(L)},R=L=>{const z=w.capturedMap.get(L);z&&D3(w.capturedMap,v.eventObject,z,L)};let E={};for(let L in f){let z=f[L];typeof z!="function"&&(E[L]=z)}let B={...v,...E,pointer:_,intersections:l,stopped:m.stopped,delta:h,unprojectedPoint:S,ray:x.ray,camera:A,stopPropagation(){const L="pointerId"in f&&w.capturedMap.get(f.pointerId);if((!L||L.has(v.eventObject))&&(B.stopped=m.stopped=!0,w.hovered.size&&Array.from(w.hovered.values()).find(z=>z.eventObject===v.eventObject))){const z=l.slice(0,l.indexOf(v));s([...z,v])}},target:{hasPointerCapture:b,setPointerCapture:P,releasePointerCapture:R},currentTarget:{hasPointerCapture:b,setPointerCapture:P,releasePointerCapture:R},nativeEvent:f};if(d(B),m.stopped===!0)break}}return l}function s(l){const{internal:f}=n.getState();for(const h of f.hovered.values())if(!l.length||!l.find(d=>d.object===h.object&&d.index===h.index&&d.instanceId===h.instanceId)){const p=h.eventObject.__r3f,m=p==null?void 0:p.handlers;if(f.hovered.delete(kp(h)),p!=null&&p.eventCount){const v={...h,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function o(l,f){for(let h=0;h<f.length;h++){const d=f[h].__r3f;d==null||d.handlers.onPointerMissed==null||d.handlers.onPointerMissed(l)}}function a(l){switch(l){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return f=>{const{internal:h}=n.getState();"pointerId"in f&&h.capturedMap.has(f.pointerId)&&(h.capturedMap.delete(f.pointerId),s([]))}}return function(h){const{onPointerMissed:d,internal:p}=n.getState();p.lastEvent.current=h;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",x=i(h,m?t:void 0),_=v?e(h):0;l==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=x.map(w=>w.eventObject)),v&&!x.length&&_<=2&&(o(h,p.interaction),d&&d(h)),m&&s(x);function A(w){const S=w.eventObject,b=S.__r3f,P=b==null?void 0:b.handlers;if(b!=null&&b.eventCount)if(m){if(P.onPointerOver||P.onPointerEnter||P.onPointerOut||P.onPointerLeave){const R=kp(w),E=p.hovered.get(R);E?E.stopped&&w.stopPropagation():(p.hovered.set(R,w),P.onPointerOver==null||P.onPointerOver(w),P.onPointerEnter==null||P.onPointerEnter(w))}P.onPointerMove==null||P.onPointerMove(w)}else{const R=P[l];R?(!v||p.initialHits.includes(S))&&(o(h,p.interaction.filter(E=>!p.initialHits.includes(E))),R(w)):v&&p.initialHits.includes(S)&&o(h,p.interaction.filter(E=>!p.initialHits.includes(E)))}}r(x,h,_,A)}}return{handlePointer:a}}let x1={},F5=n=>void(x1={...x1,...n});function N5(n,e){function t(h,{args:d=[],attach:p,...m},v){let y=`${h[0].toUpperCase()}${h.slice(1)}`,x;if(h==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const _=m.object;x=Jl(_,{type:h,root:v,attach:p,primitive:!0})}else{const _=x1[y];if(!_)throw new Error(`R3F: ${y} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(d))throw new Error("R3F: The args prop must be an array!");x=Jl(new _(...d),{type:h,root:v,attach:p,memoizedProps:{args:d}})}return x.__r3f.attach===void 0&&(x instanceof ut?x.__r3f.attach="geometry":x instanceof Mn&&(x.__r3f.attach="material")),y!=="inject"&&fv(x,m),x}function i(h,d){let p=!1;if(d){var m,v;(m=d.__r3f)!=null&&m.attach?cv(h,d,d.__r3f.attach):d.isObject3D&&h.isObject3D&&(h.add(d),p=!0),p||(v=h.__r3f)==null||v.objects.push(d),d.__r3f||Jl(d,{}),d.__r3f.parent=h,v1(d),Xl(d)}}function r(h,d,p){let m=!1;if(d){var v,y;if((v=d.__r3f)!=null&&v.attach)cv(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){d.parent=h,d.dispatchEvent({type:"added"});const x=h.children.filter(A=>A!==d),_=x.indexOf(p);h.children=[...x.slice(0,_),d,...x.slice(_)],m=!0}m||(y=h.__r3f)==null||y.objects.push(d),d.__r3f||Jl(d,{}),d.__r3f.parent=h,v1(d),Xl(d)}}function s(h,d,p=!1){h&&[...h].forEach(m=>o(d,m,p))}function o(h,d,p){if(d){var m,v,y;if(d.__r3f&&(d.__r3f.parent=null),(m=h.__r3f)!=null&&m.objects&&(h.__r3f.objects=h.__r3f.objects.filter(S=>S!==d)),(v=d.__r3f)!=null&&v.attach)kE(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){var x;h.remove(d),(x=d.__r3f)!=null&&x.root&&I5(d.__r3f.root,d)}const A=(y=d.__r3f)==null?void 0:y.primitive,w=p===void 0?d.dispose!==null&&!A:p;if(!A){var _;s((_=d.__r3f)==null?void 0:_.objects,d,w),s(d.children,d,w)}d.__r3f&&(delete d.__r3f.root,delete d.__r3f.objects,delete d.__r3f.handlers,delete d.__r3f.memoizedProps,A||delete d.__r3f),w&&d.dispose&&d.type!=="Scene"&&$f.unstable_scheduleCallback($f.unstable_IdlePriority,()=>{try{d.dispose()}catch{}}),Xl(h)}}function a(h,d,p,m){var v;const y=(v=h.__r3f)==null?void 0:v.parent;if(!y)return;const x=t(d,p,h.__r3f.root);if(h.children){for(const _ of h.children)_.__r3f&&i(x,_);h.children=h.children.filter(_=>!_.__r3f)}h.__r3f.objects.forEach(_=>i(x,_)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||o(y,h),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),i(y,x),x.raycast&&x.__r3f.eventCount&&x.__r3f.root.getState().internal.interaction.push(x),[m,m.alternate].forEach(_=>{_!==null&&(_.stateNode=x,_.ref&&(typeof _.ref=="function"?_.ref(x):_.ref.current=x))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:A5({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(h,d)=>{if(!d)return;const p=h.getState().scene;p.__r3f&&(p.__r3f.root=h,i(p,d))},removeChildFromContainer:(h,d)=>{d&&o(h.getState().scene,d)},insertInContainerBefore:(h,d,p)=>{if(!d||!p)return;const m=h.getState().scene;m.__r3f&&r(m,d,p)},getRootHostContext:()=>null,getChildHostContext:h=>h,finalizeInitialChildren(h){var d;const p=(d=h==null?void 0:h.__r3f)!=null?d:{};return Boolean(p.handlers)},prepareUpdate(h,d,p,m){if(h.__r3f.primitive&&m.object&&m.object!==h)return[!0];{const{args:v=[],children:y,...x}=m,{args:_=[],children:A,...w}=p;if(!Array.isArray(v))throw new Error("R3F: the args prop must be an array!");if(v.some((b,P)=>b!==_[P]))return[!0];const S=I3(h,x,w,!0);return S.changes.length?[!1,S]:null}},commitUpdate(h,[d,p],m,v,y,x){d?a(h,m,y,x):fv(h,p)},commitMount(h,d,p,m){var v;const y=(v=h.__r3f)!=null?v:{};h.raycast&&y.handlers&&y.eventCount&&h.__r3f.root.getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>Jl(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var d;const{attach:p,parent:m}=(d=h.__r3f)!=null?d:{};p&&m&&kE(m,h,p),h.isObject3D&&(h.visible=!1),Xl(h)},unhideInstance(h,d){var p;const{attach:m,parent:v}=(p=h.__r3f)!=null?p:{};m&&v&&cv(v,h,m),(h.isObject3D&&d.visible==null||d.visible)&&(h.visible=!0),Xl(h)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():wo.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&qt.fun(performance.now)?performance.now:qt.fun(Date.now)?Date.now:()=>0,scheduleTimeout:qt.fun(setTimeout)?setTimeout:void 0,cancelTimeout:qt.fun(clearTimeout)?clearTimeout:void 0}),applyProps:fv}}const F3=n=>!!(n!=null&&n.render),N3=U.createContext(null),k5=(n,e)=>{const t=S3((a,l)=>{const f=new D,h=new D,d=new D;function p(_=l().camera,A=h,w=l().size){const{width:S,height:b,top:P,left:R}=w,E=S/b;A instanceof D?d.copy(A):d.set(...A);const B=_.getWorldPosition(f).distanceTo(d);if(T3(_))return{width:S/_.zoom,height:b/_.zoom,top:P,left:R,factor:1,distance:B,aspect:E};{const L=_.fov*Math.PI/180,z=2*Math.tan(L/2)*B,Z=z*(S/b);return{width:Z,height:z,top:P,left:R,factor:S/Z,distance:B,aspect:E}}}let m;const v=_=>a(A=>({performance:{...A.performance,current:_}})),y=new me;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,invalidate:(_=1)=>n(l(),_),advance:(_,A)=>e(_,A,l()),legacy:!1,linear:!1,flat:!1,scene:Jl(new lA),controls:null,clock:new BA,pointer:y,mouse:y,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const _=l();m&&clearTimeout(m),_.performance.current!==_.performance.min&&v(_.performance.min),m=setTimeout(()=>v(l().performance.max),_.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:_=>a(A=>({...A,events:{...A.events,..._}})),setSize:(_,A,w,S,b)=>{const P=l().camera,R={width:_,height:A,top:S||0,left:b||0,updateStyle:w};a(E=>({size:R,viewport:{...E.viewport,...p(P,h,R)}}))},setDpr:_=>a(A=>{const w=L3(_);return{viewport:{...A.viewport,dpr:w,initialDpr:A.viewport.initialDpr||w}}}),setFrameloop:(_="always")=>{const A=l().clock;A.stop(),A.elapsedTime=0,_!=="never"&&(A.start(),A.elapsedTime=0),a(()=>({frameloop:_}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:U.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(_,A,w)=>{const S=l().internal;return S.priority=S.priority+(A>0?1:0),S.subscribers.push({ref:_,priority:A,store:w}),S.subscribers=S.subscribers.sort((b,P)=>b.priority-P.priority),()=>{const b=l().internal;b!=null&&b.subscribers&&(b.priority=b.priority-(A>0?1:0),b.subscribers=b.subscribers.filter(P=>P.ref!==_))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:f,gl:h,set:d}=t.getState();if(l!==r||f.dpr!==s){var p;r=l,s=f.dpr,R5(a,l),h.setPixelRatio(f.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(l.width,l.height,m)}a!==o&&(o=a,d(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Op,O5=new Set,U5=new Set,z5=new Set;function hv(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Gc(n,e){switch(n){case"before":return hv(O5,e);case"after":return hv(U5,e);case"tail":return hv(z5,e)}}let dv,pv;function mv(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),dv=e.internal.subscribers,Op=0;Op<dv.length;Op++)pv=dv[Op],pv.ref.current(pv.store.getState(),i,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}function G5(n){let e=!1,t,i,r;function s(l){i=requestAnimationFrame(s),e=!0,t=0,Gc("before",l);for(const h of n.values()){var f;r=h.store.getState(),r.internal.active&&(r.frameloop==="always"||r.internal.frames>0)&&!((f=r.gl.xr)!=null&&f.isPresenting)&&(t+=mv(l,r))}if(Gc("after",l),t===0)return Gc("tail",l),e=!1,cancelAnimationFrame(i)}function o(l,f=1){var h;if(!l)return n.forEach(d=>o(d.store.getState()),f);(h=l.gl.xr)!=null&&h.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+f),e||(e=!0,requestAnimationFrame(s)))}function a(l,f=!0,h,d){if(f&&Gc("before",l),h)mv(l,h,d);else for(const p of n.values())mv(l,p.store.getState());f&&Gc("after",l)}return{loop:s,invalidate:o,advance:a}}function k3(){const n=U.useContext(N3);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Fi(n=t=>t,e){return k3()(n,e)}function qu(n,e=0){const t=k3(),i=t.getState().internal.subscribe,r=P3(n);return Ih(()=>i(r,e,t),[e,i,t]),null}function O3(n,e){return function(t,...i){const r=new t;return n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,P5(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l.message})`))))))}}function qo(n,e,t,i){const r=Array.isArray(e)?e:[e],s=M5(O3(t,i),[n,...r],{equal:qt.equ});return Array.isArray(e)?s:s[0]}qo.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return w5(O3(t),[n,...i])};qo.clear=function(n,e){const t=Array.isArray(e)?e:[e];return S5([n,...t])};const Ou=new Map,{invalidate:OE,advance:UE}=G5(Ou),{reconciler:Wm,applyProps:So}=N5(Ou,L5),Hc={objects:"shallow",strict:!1},H5=(n,e)=>{const t=typeof n=="function"?n(e):n;return F3(t)?t:new aA({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function V5(n,e){if(e)return e;if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:t,height:i,top:r,left:s}=n.parentElement.getBoundingClientRect();return{width:t,height:i,top:r,left:s}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0};return{width:0,height:0,top:0,left:0}}function W5(n){const e=Ou.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||k5(OE,UE),o=t||Wm.createContainer(s,wo.ConcurrentRoot,null,!1,null,"",r,null);e||Ou.set(n,{fiber:o,store:s});let a,l=!1;return{configure(f={}){let{gl:h,size:d,events:p,onCreated:m,shadows:v=!1,linear:y=!1,flat:x=!1,legacy:_=!1,orthographic:A=!1,frameloop:w="always",dpr:S=[1,2],performance:b,raycaster:P,camera:R,onPointerMissed:E}=f,B=s.getState(),L=B.gl;B.gl||B.set({gl:L=H5(h,n)});let z=B.raycaster;z||B.set({raycaster:z=new M3});const{params:Z,...J}=P||{};if(qt.equ(J,z,Hc)||So(z,{...J}),qt.equ(Z,z.params,Hc)||So(z,{params:{...z.params,...Z}}),!B.camera){const N=R instanceof mh,V=N?R:A?new Dr(0,0,0,0,.1,1e3):new Gt(75,0,.1,1e3);N||(V.position.z=5,R&&So(V,R),R!=null&&R.rotation||V.lookAt(0,0,0)),B.set({camera:V})}if(!B.xr){const N=(ae,W)=>{const ce=s.getState();ce.frameloop!=="never"&&UE(ae,!0,ce,W)},V=()=>{const ae=s.getState();ae.gl.xr.enabled=ae.gl.xr.isPresenting,ae.gl.xr.setAnimationLoop(ae.gl.xr.isPresenting?N:null),ae.gl.xr.isPresenting||OE(ae)},j={connect(){const ae=s.getState().gl;ae.xr.addEventListener("sessionstart",V),ae.xr.addEventListener("sessionend",V)},disconnect(){const ae=s.getState().gl;ae.xr.removeEventListener("sessionstart",V),ae.xr.removeEventListener("sessionend",V)}};L.xr&&j.connect(),B.set({xr:j})}if(L.shadowMap){const N=L.shadowMap.enabled,V=L.shadowMap.type;if(L.shadowMap.enabled=!!v,qt.boo(v))L.shadowMap.type=hf;else if(qt.str(v)){var H;const j={basic:LP,percentage:Mg,soft:hf,variance:Da};L.shadowMap.type=(H=j[v])!=null?H:hf}else qt.obj(v)&&Object.assign(L.shadowMap,v);(N!==L.shadowMap.enabled||V!==L.shadowMap.type)&&(L.shadowMap.needsUpdate=!0)}jl&&("enabled"in jl?jl.enabled=!_:"legacyMode"in jl&&(jl.legacyMode=_));const Y=y?Vs:Ct,te=x?Ir:J_;L.outputEncoding!==Y&&(L.outputEncoding=Y),L.toneMapping!==te&&(L.toneMapping=te),B.legacy!==_&&B.set(()=>({legacy:_})),B.linear!==y&&B.set(()=>({linear:y})),B.flat!==x&&B.set(()=>({flat:x})),h&&!qt.fun(h)&&!F3(h)&&!qt.equ(h,L,Hc)&&So(L,h),p&&!B.events.handlers&&B.set({events:p(s)});const le=V5(n,d);return qt.equ(le,B.size,Hc)||B.setSize(le.width,le.height,le.updateStyle,le.top,le.left),S&&B.viewport.dpr!==L3(S)&&B.setDpr(S),B.frameloop!==w&&B.setFrameloop(w),B.onPointerMissed||B.set({onPointerMissed:E}),b&&!qt.equ(b,B.performance,Hc)&&B.set(N=>({performance:{...N.performance,...b}})),a=m,l=!0,this},render(f){return l||this.configure(),Wm.updateContainer(U.createElement(j5,{store:s,children:f,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){U3(n)}}}function j5({store:n,children:e,onCreated:t,rootElement:i}){return Ih(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),U.createElement(N3.Provider,{value:n},e)}function U3(n,e){const t=Ou.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),Wm.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),B5(r),Ou.delete(n),e&&e(n)}catch{}},500)})}}Wm.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:U.version});function gr(){return gr=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},gr.apply(this,arguments)}function _1(n,e,t){var i,r,s,o,a;e==null&&(e=100);function l(){var h=Date.now()-o;h<e&&h>=0?i=setTimeout(l,e-h):(i=null,t||(a=n.apply(s,r),s=r=null))}var f=function(){s=this,r=arguments,o=Date.now();var h=t&&!i;return i||(i=setTimeout(l,e)),h&&(a=n.apply(s,r),s=r=null),a};return f.clear=function(){i&&(clearTimeout(i),i=null)},f.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},f}_1.debounce=_1;var zE=_1;function J5(n){let{debounce:e,scroll:t,polyfill:i,offsetSize:r}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=U.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=U.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),f=e?typeof e=="number"?e:e.scroll:null,h=e?typeof e=="number"?e:e.resize:null,d=U.useRef(!1);U.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[p,m,v]=U.useMemo(()=>{const A=()=>{if(!l.current.element)return;const{left:w,top:S,width:b,height:P,bottom:R,right:E,x:B,y:L}=l.current.element.getBoundingClientRect(),z={left:w,top:S,width:b,height:P,bottom:R,right:E,x:B,y:L};l.current.element instanceof HTMLElement&&r&&(z.height=l.current.element.offsetHeight,z.width=l.current.element.offsetWidth),Object.freeze(z),d.current&&!Q5(l.current.lastBounds,z)&&a(l.current.lastBounds=z)};return[A,h?zE(A,h):A,f?zE(A,f):A]},[a,r,f,h]);function y(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(A=>A.removeEventListener("scroll",v,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function x(){l.current.element&&(l.current.resizeObserver=new s(v),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(A=>A.addEventListener("scroll",v,{capture:!0,passive:!0})))}const _=A=>{!A||A===l.current.element||(y(),l.current.element=A,l.current.scrollContainers=z3(A),x())};return K5(v,Boolean(t)),X5(m),U.useEffect(()=>{y(),x()},[t,v,m]),U.useEffect(()=>y,[]),[_,o,p]}function X5(n){U.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function K5(n,e){U.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function z3(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...z3(n.parentElement)]}const Y5=["x","y","top","bottom","left","right","width","height"],Q5=(n,e)=>Y5.every(t=>n[t]===e[t]);var Z5=Object.defineProperty,q5=Object.defineProperties,$5=Object.getOwnPropertyDescriptors,GE=Object.getOwnPropertySymbols,e9=Object.prototype.hasOwnProperty,t9=Object.prototype.propertyIsEnumerable,HE=(n,e,t)=>e in n?Z5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,VE=(n,e)=>{for(var t in e||(e={}))e9.call(e,t)&&HE(n,t,e[t]);if(GE)for(var t of GE(e))t9.call(e,t)&&HE(n,t,e[t]);return n},n9=(n,e)=>q5(n,$5(e));function G3(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const r=G3(i,e,t);if(r)return r;i=e?null:i.sibling}}function H3(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const DA=H3(U.createContext(null));class V3 extends U.Component{render(){return U.createElement(DA.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:i9,ReactCurrentDispatcher:r9}=U.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function s9(){const n=U.useContext(DA);if(!n)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=U.useId();return U.useMemo(()=>{var i;return(i=i9.current)!=null?i:G3(n,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}})},[n,e])}function o9(){var n,e;const t=s9(),[i]=U.useState(()=>new Map);i.clear();let r=t;for(;r;){const s=(n=r.type)==null?void 0:n._context;s&&s!==DA&&!i.has(s)&&i.set(s,(e=r9.current)==null?void 0:e.readContext(H3(s))),r=r.return}return U.useMemo(()=>Array.from(i.keys()).reduce((s,o)=>a=>U.createElement(s,null,U.createElement(o.Provider,n9(VE({},a),{value:i.get(o)}))),s=>U.createElement(V3,VE({},s))),[i])}const gv={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function a9(n){const{handlePointer:e}=D5(n);return{priority:1,enabled:!0,compute(t,i,r){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(gv).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,f]=gv[o];t.addEventListener(l,a,{passive:f})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=gv[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const l9=U.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=a9,eventSource:a,eventPrefix:l,shadows:f,linear:h,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:y,performance:x,raycaster:_,camera:A,onPointerMissed:w,onCreated:S,...b},P){U.useMemo(()=>F5(m1),[]);const R=o9(),[E,B]=J5({scroll:!0,debounce:{scroll:50,resize:0},...i}),L=U.useRef(null),z=U.useRef(null),[Z,J]=U.useState(null);U.useImperativeHandle(P,()=>L.current);const H=P3(w),[Y,te]=U.useState(!1),[le,N]=U.useState(!1);if(Y)throw Y;if(le)throw le;const V=U.useRef(null);B.width>0&&B.height>0&&Z&&(V.current||(V.current=W5(Z)),V.current.configure({gl:s,events:o,shadows:f,linear:h,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:y,performance:x,raycaster:_,camera:A,size:B,onPointerMissed:(...ae)=>H.current==null?void 0:H.current(...ae),onCreated:ae=>{ae.events.connect==null||ae.events.connect(a?E5(a)?a.current:a:z.current),l&&ae.setEvents({compute:(W,ce)=>{const ve=W[l+"X"],_e=W[l+"Y"];ce.pointer.set(ve/ce.size.width*2-1,-(_e/ce.size.height)*2+1),ce.raycaster.setFromCamera(ce.pointer,ce.camera)}}),S==null||S(ae)}}),V.current.render(U.createElement(R,null,U.createElement(B3,{set:N},U.createElement(U.Suspense,{fallback:U.createElement(b5,{set:te})},e))))),Ih(()=>{J(L.current)},[]),U.useEffect(()=>{if(Z)return()=>U3(Z)},[Z]);const j=a?"none":"auto";return U.createElement("div",gr({ref:z,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:j,...r}},b),U.createElement("div",{ref:E,style:{width:"100%",height:"100%"}},U.createElement("canvas",{ref:L,style:{display:"block"}},t)))}),kg=U.forwardRef(function(e,t){return U.createElement(V3,null,U.createElement(l9,gr({},e,{ref:t})))}),Dh=new D,FA=new D,u9=new D;function c9(n,e,t){const i=Dh.setFromMatrixPosition(n.matrixWorld);i.project(e);const r=t.width/2,s=t.height/2;return[i.x*r+r,-(i.y*s)+s]}function f9(n,e){const t=Dh.setFromMatrixPosition(n.matrixWorld),i=FA.setFromMatrixPosition(e.matrixWorld),r=t.sub(i),s=e.getWorldDirection(u9);return r.angleTo(s)>Math.PI/2}function h9(n,e,t,i){const r=Dh.setFromMatrixPosition(n.matrixWorld),s=r.clone();s.project(e),t.setFromCamera(s,e);const o=t.intersectObjects(i,!0);if(o.length){const a=o[0].distance;return r.distanceTo(t.ray.origin)<a}return!0}function d9(n,e){if(e instanceof Dr)return e.zoom;if(e instanceof Gt){const t=Dh.setFromMatrixPosition(n.matrixWorld),i=FA.setFromMatrixPosition(e.matrixWorld),r=e.fov*Math.PI/180,s=t.distanceTo(i);return 1/(2*Math.tan(r/2)*s)}else return 1}function p9(n,e,t){if(e instanceof Gt||e instanceof Dr){const i=Dh.setFromMatrixPosition(n.matrixWorld),r=FA.setFromMatrixPosition(e.matrixWorld),s=i.distanceTo(r),o=(t[1]-t[0])/(e.far-e.near),a=t[1]-o*e.far;return Math.round(o*s+a)}}const A1=n=>Math.abs(n)<1e-10?0:n;function W3(n,e,t=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=A1(e[r]*n.elements[r])+(r!==15?",":")");return t+i}const m9=(n=>e=>W3(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),g9=(n=>(e,t)=>W3(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function y9(n){return n&&typeof n=="object"&&"current"in n}const v9=U.forwardRef(({children:n,eps:e=.001,style:t,className:i,prepend:r,center:s,fullscreen:o,portal:a,distanceFactor:l,sprite:f=!1,transform:h=!1,occlude:d,onOcclude:p,castShadow:m,receiveShadow:v,material:y,geometry:x,zIndexRange:_=[16777271,0],calculatePosition:A=c9,as:w="div",wrapperClass:S,pointerEvents:b="auto",...P},R)=>{const{gl:E,camera:B,scene:L,size:z,raycaster:Z,events:J,viewport:H}=Fi(),[Y]=U.useState(()=>document.createElement(w)),te=U.useRef(),le=U.useRef(null),N=U.useRef(0),V=U.useRef([0,0]),j=U.useRef(null),ae=U.useRef(null),W=(a==null?void 0:a.current)||J.connected||E.domElement.parentNode,ce=U.useRef(null),ve=U.useRef(!1),_e=U.useMemo(()=>d&&d!=="blending"||Array.isArray(d)&&d.length&&y9(d[0]),[d]);U.useLayoutEffect(()=>{const Me=E.domElement;d&&d==="blending"?(Me.style.zIndex=`${Math.floor(_[0]/2)}`,Me.style.position="absolute",Me.style.pointerEvents="none"):(Me.style.zIndex=null,Me.style.position=null,Me.style.pointerEvents=null)},[d]),U.useLayoutEffect(()=>{if(le.current){const Me=te.current=SP(Y);if(L.updateMatrixWorld(),h)Y.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Ie=A(le.current,B,z);Y.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Ie[0]}px,${Ie[1]}px,0);transform-origin:0 0;`}return W&&(r?W.prepend(Y):W.appendChild(Y)),()=>{W&&W.removeChild(Y),Me.unmount()}}},[W,h]),U.useLayoutEffect(()=>{S&&(Y.className=S)},[S]);const $=U.useMemo(()=>h?{position:"absolute",top:0,left:0,width:z.width,height:z.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-z.height/2,left:-z.width/2,width:z.width,height:z.height},...t},[t,s,o,z,h]),ke=U.useMemo(()=>({position:"absolute",pointerEvents:b}),[b]);U.useLayoutEffect(()=>{if(ve.current=!1,h){var Me;(Me=te.current)==null||Me.render(U.createElement("div",{ref:j,style:$},U.createElement("div",{ref:ae,style:ke},U.createElement("div",{ref:R,className:i,style:t,children:n}))))}else{var Ie;(Ie=te.current)==null||Ie.render(U.createElement("div",{ref:R,style:$,className:i,children:n}))}});const Oe=U.useRef(!0);qu(Me=>{if(le.current){B.updateMatrixWorld(),le.current.updateWorldMatrix(!0,!1);const Ie=h?V.current:A(le.current,B,z);if(h||Math.abs(N.current-B.zoom)>e||Math.abs(V.current[0]-Ie[0])>e||Math.abs(V.current[1]-Ie[1])>e){const he=f9(le.current,B);let re=!1;_e&&(d!=="blending"?re=[L]:Array.isArray(d)&&(re=d.map(Ze=>Ze.current)));const Ce=Oe.current;if(re){const Ze=h9(le.current,B,Z,re);Oe.current=Ze&&!he}else Oe.current=!he;Ce!==Oe.current&&(p?p(!Oe.current):Y.style.display=Oe.current?"block":"none");const ze=Math.floor(_[0]/2),Be=d?_e?[_[0],ze]:[ze-1,0]:_;if(Y.style.zIndex=`${p9(le.current,B,Be)}`,h){const[Ze,Je]=[z.width/2,z.height/2],je=B.projectionMatrix.elements[5]*Je,{isOrthographicCamera:vt,top:wt,left:O,bottom:I,right:ie}=B,we=m9(B.matrixWorldInverse),Ee=vt?`scale(${je})translate(${A1(-(ie+O)/2)}px,${A1((wt+I)/2)}px)`:`translateZ(${je}px)`;let Pe=le.current.matrixWorld;f&&(Pe=B.matrixWorldInverse.clone().transpose().copyPosition(Pe).scale(le.current.scale),Pe.elements[3]=Pe.elements[7]=Pe.elements[11]=0,Pe.elements[15]=1),Y.style.width=z.width+"px",Y.style.height=z.height+"px",Y.style.perspective=vt?"":`${je}px`,j.current&&ae.current&&(j.current.style.transform=`${Ee}${we}translate(${Ze}px,${Je}px)`,ae.current.style.transform=g9(Pe,1/((l||10)/400)))}else{const Ze=l===void 0?1:d9(le.current,B)*l;Y.style.transform=`translate3d(${Ie[0]}px,${Ie[1]}px,0) scale(${Ze})`}V.current=Ie,N.current=B.zoom}}if(!_e&&ce.current&&!ve.current)if(h){if(j.current){const Ie=j.current.children[0];if(Ie!=null&&Ie.clientWidth&&Ie!=null&&Ie.clientHeight){const{isOrthographicCamera:he}=B;if(he||x)P.scale&&(Array.isArray(P.scale)?P.scale instanceof D?ce.current.scale.copy(P.scale.clone().divideScalar(1)):ce.current.scale.set(1/P.scale[0],1/P.scale[1],1/P.scale[2]):ce.current.scale.setScalar(1/P.scale));else{const re=(l||10)/400,Ce=Ie.clientWidth*re,ze=Ie.clientHeight*re;ce.current.scale.set(Ce,ze,1)}ve.current=!0}}}else{const Ie=Y.children[0];if(Ie!=null&&Ie.clientWidth&&Ie!=null&&Ie.clientHeight){const he=1/H.factor,re=Ie.clientWidth*he,Ce=Ie.clientHeight*he;ce.current.scale.set(re,Ce,1),ve.current=!0}ce.current.lookAt(Me.camera.position)}});const He=U.useMemo(()=>({vertexShader:h?void 0:` /* This shader is from the THREE's SpriteMaterial. We need to turn the backing plane into a Sprite (make it always face the camera) if "transfrom" is false. */ #include <common> void main() { vec2 center = vec2(0., 1.); float rotation = 0.0; // This is somewhat arbitrary, but it seems to work well // Need to figure out how to derive this dynamically if it even matters float size = 0.03; vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); vec2 scale; scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) scale *= - mvPosition.z; vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; vec2 rotatedPosition; rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; } `,fragmentShader:` void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); } `}),[h]);return U.createElement("group",gr({},P,{ref:le}),d&&!_e&&U.createElement("mesh",{castShadow:m,receiveShadow:v,ref:ce},x||U.createElement("planeGeometry",null),y||U.createElement("shaderMaterial",{side:Br,vertexShader:He.vertexShader,fragmentShader:He.fragmentShader})))});let Vc=0;const x9=S3(n=>(uu.onStart=(e,t,i)=>{n({active:!0,item:e,loaded:t,total:i,progress:(t-Vc)/(i-Vc)*100})},uu.onLoad=()=>{n({active:!1})},uu.onError=e=>n(t=>({errors:[...t.errors,e]})),uu.onProgress=(e,t,i)=>{t===i&&(Vc=i),n({active:!0,item:e,loaded:t,total:i,progress:(t-Vc)/(i-Vc)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}));function NA(n){return function(e){n.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}function Au(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WE(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function jE(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?WE(Object(t),!0).forEach(function(i){Au(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):WE(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}new me;new me;function j3(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var sr=function n(e,t,i){var r=this;j3(this,n),Au(this,"dot2",function(s,o){return r.x*s+r.y*o}),Au(this,"dot3",function(s,o,a){return r.x*s+r.y*o+r.z*a}),this.x=e,this.y=t,this.z=i},_9=[new sr(1,1,0),new sr(-1,1,0),new sr(1,-1,0),new sr(-1,-1,0),new sr(1,0,1),new sr(-1,0,1),new sr(1,0,-1),new sr(-1,0,-1),new sr(0,1,1),new sr(0,-1,1),new sr(0,1,-1),new sr(0,-1,-1)],JE=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],XE=new Array(512),KE=new Array(512),A9=function(e){e>0&&e<1&&(e*=65536),e=Math.floor(e),e<256&&(e|=e<<8);for(var t=0;t<256;t++){var i;t&1?i=JE[t]^e&255:i=JE[t]^e>>8&255,XE[t]=XE[t+256]=i,KE[t]=KE[t+256]=_9[i%12]}};A9(0);function M9(n){if(typeof n=="number")n=Math.abs(n);else if(typeof n=="string"){var e=n;n=0;for(var t=0;t<e.length;t++)n=(n+(t+1)*(e.charCodeAt(t)%96))%2147483647}return n===0&&(n=311),n}function YE(n){var e=M9(n);return function(){var t=e*48271%2147483647;return e=t,t/2147483647}}var w9=function n(e){var t=this;j3(this,n),Au(this,"seed",0),Au(this,"init",function(i){t.seed=i,t.value=YE(i)}),Au(this,"value",YE(this.seed)),this.init(e)},S9=new w9(Math.random()),C9={radius:1,center:[0,0,0]};function E9(n,e){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S9,i=jE(jE({},C9),e),r=i.radius,s=i.center,o=0;o<n.length;o+=3){var a=Math.pow(t.value(),.3333333333333333),l=t.value()*2-1,f=t.value()*2-1,h=t.value()*2-1,d=Math.sqrt(l*l+f*f+h*h);l=a*l/d,f=a*f/d,h=a*h/d,n[o]=l*r+s[0],n[o+1]=f*r+s[1],n[o+2]=h*r+s[2]}return n}function eh(n){return eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eh(n)}function b9(n,e){if(eh(n)!=="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(eh(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function T9(n){var e=b9(n,"string");return eh(e)==="symbol"?e:String(e)}function lt(n,e,t){return e=T9(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}const QE=(n,e)=>(n%e+e)%e;let P9=class extends os{constructor(e,t){super(),lt(this,"object",void 0),lt(this,"domElement",void 0),lt(this,"enabled",!0),lt(this,"target",new D),lt(this,"minDistance",0),lt(this,"maxDistance",1/0),lt(this,"minZoom",0),lt(this,"maxZoom",1/0),lt(this,"minPolarAngle",0),lt(this,"maxPolarAngle",Math.PI),lt(this,"minAzimuthAngle",-1/0),lt(this,"maxAzimuthAngle",1/0),lt(this,"enableDamping",!1),lt(this,"dampingFactor",.05),lt(this,"enableZoom",!0),lt(this,"zoomSpeed",1),lt(this,"enableRotate",!0),lt(this,"rotateSpeed",1),lt(this,"enablePan",!0),lt(this,"panSpeed",1),lt(this,"screenSpacePanning",!0),lt(this,"keyPanSpeed",7),lt(this,"autoRotate",!1),lt(this,"autoRotateSpeed",2),lt(this,"reverseOrbit",!1),lt(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),lt(this,"mouseButtons",{LEFT:Ma.ROTATE,MIDDLE:Ma.DOLLY,RIGHT:Ma.PAN}),lt(this,"touches",{ONE:wa.ROTATE,TWO:wa.DOLLY_PAN}),lt(this,"target0",void 0),lt(this,"position0",void 0),lt(this,"zoom0",void 0),lt(this,"_domElementKeyEvents",null),lt(this,"getPolarAngle",void 0),lt(this,"getAzimuthalAngle",void 0),lt(this,"setPolarAngle",void 0),lt(this,"setAzimuthalAngle",void 0),lt(this,"getDistance",void 0),lt(this,"listenToKeyEvents",void 0),lt(this,"saveState",void 0),lt(this,"reset",void 0),lt(this,"update",void 0),lt(this,"connect",void 0),lt(this,"dispose",void 0),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object instanceof Gt?this.object.zoom:1,this.getPolarAngle=()=>h.phi,this.getAzimuthalAngle=()=>h.theta,this.setPolarAngle=G=>{let se=QE(G,2*Math.PI),Ae=h.phi;Ae<0&&(Ae+=2*Math.PI),se<0&&(se+=2*Math.PI);let Te=Math.abs(se-Ae);2*Math.PI-Te<Te&&(se<Ae?se+=2*Math.PI:Ae+=2*Math.PI),d.phi=se-Ae,i.update()},this.setAzimuthalAngle=G=>{let se=QE(G,2*Math.PI),Ae=h.theta;Ae<0&&(Ae+=2*Math.PI),se<0&&(se+=2*Math.PI);let Te=Math.abs(se-Ae);2*Math.PI-Te<Te&&(se<Ae?se+=2*Math.PI:Ae+=2*Math.PI),d.theta=se-Ae,i.update()},this.getDistance=()=>i.object.position.distanceTo(i.target),this.listenToKeyEvents=G=>{G.addEventListener("keydown",ie),this._domElementKeyEvents=G},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object instanceof Gt?i.object.zoom:1},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object instanceof Gt&&(i.object.zoom=i.zoom0,i.object.updateProjectionMatrix()),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=(()=>{const G=new D,se=new Vn().setFromUnitVectors(e.up,new D(0,1,0)),Ae=se.clone().invert(),Te=new D,$e=new Vn,yt=2*Math.PI;return function(){const K=i.object.position;G.copy(K).sub(i.target),G.applyQuaternion(se),h.setFromVector3(G),i.autoRotate&&l===a.NONE&&Z(L()),i.enableDamping?(h.theta+=d.theta*i.dampingFactor,h.phi+=d.phi*i.dampingFactor):(h.theta+=d.theta,h.phi+=d.phi);let ue=i.minAzimuthAngle,xe=i.maxAzimuthAngle;return isFinite(ue)&&isFinite(xe)&&(ue<-Math.PI?ue+=yt:ue>Math.PI&&(ue-=yt),xe<-Math.PI?xe+=yt:xe>Math.PI&&(xe-=yt),ue<=xe?h.theta=Math.max(ue,Math.min(xe,h.theta)):h.theta=h.theta>(ue+xe)/2?Math.max(ue,h.theta):Math.min(xe,h.theta)),h.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,h.phi)),h.makeSafe(),h.radius*=p,h.radius=Math.max(i.minDistance,Math.min(i.maxDistance,h.radius)),i.enableDamping===!0?i.target.addScaledVector(m,i.dampingFactor):i.target.add(m),G.setFromSpherical(h),G.applyQuaternion(Ae),K.copy(i.target).add(G),i.object.lookAt(i.target),i.enableDamping===!0?(d.theta*=1-i.dampingFactor,d.phi*=1-i.dampingFactor,m.multiplyScalar(1-i.dampingFactor)):(d.set(0,0,0),m.set(0,0,0)),p=1,v||Te.distanceToSquared(i.object.position)>f||8*(1-$e.dot(i.object.quaternion))>f?(i.dispatchEvent(r),Te.copy(i.object.position),$e.copy(i.object.quaternion),v=!1,!0):!1}})(),this.connect=G=>{G===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),i.domElement=G,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Pe),i.domElement.addEventListener("pointerdown",Ze),i.domElement.addEventListener("pointercancel",vt),i.domElement.addEventListener("wheel",I)},this.dispose=()=>{var G,se,Ae,Te,$e,yt;(G=i.domElement)===null||G===void 0||G.removeEventListener("contextmenu",Pe),(se=i.domElement)===null||se===void 0||se.removeEventListener("pointerdown",Ze),(Ae=i.domElement)===null||Ae===void 0||Ae.removeEventListener("pointercancel",vt),(Te=i.domElement)===null||Te===void 0||Te.removeEventListener("wheel",I),($e=i.domElement)===null||$e===void 0||$e.ownerDocument.removeEventListener("pointermove",Je),(yt=i.domElement)===null||yt===void 0||yt.ownerDocument.removeEventListener("pointerup",je),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",ie)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const f=1e-6,h=new p1,d=new p1;let p=1;const m=new D;let v=!1;const y=new me,x=new me,_=new me,A=new me,w=new me,S=new me,b=new me,P=new me,R=new me,E=[],B={};function L(){return 2*Math.PI/60/60*i.autoRotateSpeed}function z(){return Math.pow(.95,i.zoomSpeed)}function Z(G){i.reverseOrbit?d.theta+=G:d.theta-=G}function J(G){i.reverseOrbit?d.phi+=G:d.phi-=G}const H=(()=>{const G=new D;return function(Ae,Te){G.setFromMatrixColumn(Te,0),G.multiplyScalar(-Ae),m.add(G)}})(),Y=(()=>{const G=new D;return function(Ae,Te){i.screenSpacePanning===!0?G.setFromMatrixColumn(Te,1):(G.setFromMatrixColumn(Te,0),G.crossVectors(i.object.up,G)),G.multiplyScalar(Ae),m.add(G)}})(),te=(()=>{const G=new D;return function(Ae,Te){const $e=i.domElement;if($e&&i.object instanceof Gt&&i.object.isPerspectiveCamera){const yt=i.object.position;G.copy(yt).sub(i.target);let Vt=G.length();Vt*=Math.tan(i.object.fov/2*Math.PI/180),H(2*Ae*Vt/$e.clientHeight,i.object.matrix),Y(2*Te*Vt/$e.clientHeight,i.object.matrix)}else $e&&i.object instanceof Dr&&i.object.isOrthographicCamera?(H(Ae*(i.object.right-i.object.left)/i.object.zoom/$e.clientWidth,i.object.matrix),Y(Te*(i.object.top-i.object.bottom)/i.object.zoom/$e.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function le(G){i.object instanceof Gt&&i.object.isPerspectiveCamera?p/=G:i.object instanceof Dr&&i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom*G)),i.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function N(G){i.object instanceof Gt&&i.object.isPerspectiveCamera?p*=G:i.object instanceof Dr&&i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/G)),i.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function V(G){y.set(G.clientX,G.clientY)}function j(G){b.set(G.clientX,G.clientY)}function ae(G){A.set(G.clientX,G.clientY)}function W(G){x.set(G.clientX,G.clientY),_.subVectors(x,y).multiplyScalar(i.rotateSpeed);const se=i.domElement;se&&(Z(2*Math.PI*_.x/se.clientHeight),J(2*Math.PI*_.y/se.clientHeight)),y.copy(x),i.update()}function ce(G){P.set(G.clientX,G.clientY),R.subVectors(P,b),R.y>0?le(z()):R.y<0&&N(z()),b.copy(P),i.update()}function ve(G){w.set(G.clientX,G.clientY),S.subVectors(w,A).multiplyScalar(i.panSpeed),te(S.x,S.y),A.copy(w),i.update()}function _e(G){G.deltaY<0?N(z()):G.deltaY>0&&le(z()),i.update()}function $(G){let se=!1;switch(G.code){case i.keys.UP:te(0,i.keyPanSpeed),se=!0;break;case i.keys.BOTTOM:te(0,-i.keyPanSpeed),se=!0;break;case i.keys.LEFT:te(i.keyPanSpeed,0),se=!0;break;case i.keys.RIGHT:te(-i.keyPanSpeed,0),se=!0;break}se&&(G.preventDefault(),i.update())}function ke(){if(E.length==1)y.set(E[0].pageX,E[0].pageY);else{const G=.5*(E[0].pageX+E[1].pageX),se=.5*(E[0].pageY+E[1].pageY);y.set(G,se)}}function Oe(){if(E.length==1)A.set(E[0].pageX,E[0].pageY);else{const G=.5*(E[0].pageX+E[1].pageX),se=.5*(E[0].pageY+E[1].pageY);A.set(G,se)}}function He(){const G=E[0].pageX-E[1].pageX,se=E[0].pageY-E[1].pageY,Ae=Math.sqrt(G*G+se*se);b.set(0,Ae)}function Me(){i.enableZoom&&He(),i.enablePan&&Oe()}function Ie(){i.enableZoom&&He(),i.enableRotate&&ke()}function he(G){if(E.length==1)x.set(G.pageX,G.pageY);else{const Ae=Xe(G),Te=.5*(G.pageX+Ae.x),$e=.5*(G.pageY+Ae.y);x.set(Te,$e)}_.subVectors(x,y).multiplyScalar(i.rotateSpeed);const se=i.domElement;se&&(Z(2*Math.PI*_.x/se.clientHeight),J(2*Math.PI*_.y/se.clientHeight)),y.copy(x)}function re(G){if(E.length==1)w.set(G.pageX,G.pageY);else{const se=Xe(G),Ae=.5*(G.pageX+se.x),Te=.5*(G.pageY+se.y);w.set(Ae,Te)}S.subVectors(w,A).multiplyScalar(i.panSpeed),te(S.x,S.y),A.copy(w)}function Ce(G){const se=Xe(G),Ae=G.pageX-se.x,Te=G.pageY-se.y,$e=Math.sqrt(Ae*Ae+Te*Te);P.set(0,$e),R.set(0,Math.pow(P.y/b.y,i.zoomSpeed)),le(R.y),b.copy(P)}function ze(G){i.enableZoom&&Ce(G),i.enablePan&&re(G)}function Be(G){i.enableZoom&&Ce(G),i.enableRotate&&he(G)}function Ze(G){if(i.enabled!==!1){if(E.length===0){var se,Ae;(se=i.domElement)===null||se===void 0||se.ownerDocument.addEventListener("pointermove",Je),(Ae=i.domElement)===null||Ae===void 0||Ae.ownerDocument.addEventListener("pointerup",je)}nt(G),G.pointerType==="touch"?we(G):wt(G)}}function Je(G){i.enabled!==!1&&(G.pointerType==="touch"?Ee(G):O(G))}function je(G){if(De(G),E.length===0){var se,Ae,Te;(se=i.domElement)===null||se===void 0||se.releasePointerCapture(G.pointerId),(Ae=i.domElement)===null||Ae===void 0||Ae.ownerDocument.removeEventListener("pointermove",Je),(Te=i.domElement)===null||Te===void 0||Te.ownerDocument.removeEventListener("pointerup",je)}i.dispatchEvent(o),l=a.NONE}function vt(G){De(G)}function wt(G){let se;switch(G.button){case 0:se=i.mouseButtons.LEFT;break;case 1:se=i.mouseButtons.MIDDLE;break;case 2:se=i.mouseButtons.RIGHT;break;default:se=-1}switch(se){case Ma.DOLLY:if(i.enableZoom===!1)return;j(G),l=a.DOLLY;break;case Ma.ROTATE:if(G.ctrlKey||G.metaKey||G.shiftKey){if(i.enablePan===!1)return;ae(G),l=a.PAN}else{if(i.enableRotate===!1)return;V(G),l=a.ROTATE}break;case Ma.PAN:if(G.ctrlKey||G.metaKey||G.shiftKey){if(i.enableRotate===!1)return;V(G),l=a.ROTATE}else{if(i.enablePan===!1)return;ae(G),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function O(G){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;W(G);break;case a.DOLLY:if(i.enableZoom===!1)return;ce(G);break;case a.PAN:if(i.enablePan===!1)return;ve(G);break}}function I(G){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(G.preventDefault(),i.dispatchEvent(s),_e(G),i.dispatchEvent(o))}function ie(G){i.enabled===!1||i.enablePan===!1||$(G)}function we(G){switch(ge(G),E.length){case 1:switch(i.touches.ONE){case wa.ROTATE:if(i.enableRotate===!1)return;ke(),l=a.TOUCH_ROTATE;break;case wa.PAN:if(i.enablePan===!1)return;Oe(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case wa.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;Me(),l=a.TOUCH_DOLLY_PAN;break;case wa.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Ie(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Ee(G){switch(ge(G),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;he(G),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;re(G),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;ze(G),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Be(G),i.update();break;default:l=a.NONE}}function Pe(G){i.enabled!==!1&&G.preventDefault()}function nt(G){E.push(G)}function De(G){delete B[G.pointerId];for(let se=0;se<E.length;se++)if(E[se].pointerId==G.pointerId){E.splice(se,1);return}}function ge(G){let se=B[G.pointerId];se===void 0&&(se=new me,B[G.pointerId]=se),se.set(G.pageX,G.pageY)}function Xe(G){const se=G.pointerId===E[0].pointerId?E[1]:E[0];return B[se.pointerId]}t!==void 0&&this.connect(t),this.update()}};class kA extends pi{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new D9(t)}),this.register(function(t){return new G9(t)}),this.register(function(t){return new H9(t)}),this.register(function(t){return new N9(t)}),this.register(function(t){return new k9(t)}),this.register(function(t){return new O9(t)}),this.register(function(t){return new U9(t)}),this.register(function(t){return new I9(t)}),this.register(function(t){return new z9(t)}),this.register(function(t){return new F9(t)}),this.register(function(t){return new R9(t)}),this.register(function(t){return new V9(t)})}load(e,t,i,r){const s=this;let o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=ts.extractUrlBase(e),this.manager.itemStart(e);const a=function(f){r?r(f):console.error(f),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Gi(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(f){try{s.parse(f,o,function(h){t(h),s.manager.itemEnd(e)},a)}catch(h){a(h)}},i,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,r){let s;const o={},a={};if(typeof e=="string")s=e;else if(ts.decodeText(new Uint8Array(e,0,4))===J3){try{o[xt.KHR_BINARY_GLTF]=new W9(e)}catch(d){r&&r(d);return}s=o[xt.KHR_BINARY_GLTF].content}else s=ts.decodeText(new Uint8Array(e));const l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const f=new iV(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});f.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){const d=this.pluginCallbacks[h](f);a[d.name]=d,o[d.name]=!0}if(l.extensionsUsed)for(let h=0;h<l.extensionsUsed.length;++h){const d=l.extensionsUsed[h],p=l.extensionsRequired||[];switch(d){case xt.KHR_MATERIALS_UNLIT:o[d]=new L9;break;case xt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:o[d]=new X9;break;case xt.KHR_DRACO_MESH_COMPRESSION:o[d]=new j9(l,this.dracoLoader);break;case xt.KHR_TEXTURE_TRANSFORM:o[d]=new J9;break;case xt.KHR_MESH_QUANTIZATION:o[d]=new K9;break;default:p.indexOf(d)>=0&&a[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}f.setExtensions(o),f.setPlugins(a),f.parse(i,r)}parseAsync(e,t){const i=this;return new Promise(function(r,s){i.parse(e,t,r,s)})}}function B9(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const xt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"};class R9{constructor(e){this.parser=e,this.name=xt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i<r;i++){const s=t[i];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,i="light:"+e;let r=t.cache.get(i);if(r)return r;const s=t.json,l=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let f;const h=new Le(16777215);l.color!==void 0&&h.fromArray(l.color);const d=l.range!==void 0?l.range:0;switch(l.type){case"directional":f=new TA(h),f.target.position.set(0,0,-1),f.add(f.target);break;case"point":f=new bA(h),f.distance=d;break;case"spot":f=new EA(h),f.distance=d,l.spot=l.spot||{},l.spot.innerConeAngle=l.spot.innerConeAngle!==void 0?l.spot.innerConeAngle:0,l.spot.outerConeAngle=l.spot.outerConeAngle!==void 0?l.spot.outerConeAngle:Math.PI/4,f.angle=l.spot.outerConeAngle,f.penumbra=1-l.spot.innerConeAngle/l.spot.outerConeAngle,f.target.position.set(0,0,-1),f.add(f.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+l.type)}return f.position.set(0,0,0),f.decay=2,l.intensity!==void 0&&(f.intensity=l.intensity),f.name=t.createUniqueName(l.name||"light_"+e),r=Promise.resolve(f),t.cache.add(i,r),r}createNodeAttachment(e){const t=this,i=this.parser,s=i.json.nodes[e],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(l){return i._getNodeRef(t.cache,a,l)})}}class L9{constructor(){this.name=xt.KHR_MATERIALS_UNLIT}getMaterialType(){return ki}extendParams(e,t,i){const r=[];e.color=new Le(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}s.baseColorTexture!==void 0&&r.push(i.assignTexture(e,"map",s.baseColorTexture,Ct))}return Promise.all(r)}}class I9{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name].emissiveStrength;return s!==void 0&&(t.emissiveIntensity=s),Promise.resolve()}}class D9{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Ks}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(i.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(i.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(i.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new me(a,a)}return Promise.all(s)}}class F9{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Ks}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(i.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(i.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class N9{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SHEEN}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Ks}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new Le(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=r.extensions[this.name];return o.sheenColorFactor!==void 0&&t.sheenColor.fromArray(o.sheenColorFactor),o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(i.assignTexture(t,"sheenColorMap",o.sheenColorTexture,Ct)),o.sheenRoughnessTexture!==void 0&&s.push(i.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class k9{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Ks}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(i.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class O9{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_VOLUME}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Ks}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(i.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new Le(a[0],a[1],a[2]),Promise.all(s)}}class U9{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IOR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Ks}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name];return t.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class z9{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Ks}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(i.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new Le(a[0],a[1],a[2]),o.specularColorTexture!==void 0&&s.push(i.assignTexture(t,"specularColorMap",o.specularColorTexture,Ct)),Promise.all(s)}}class G9{constructor(e){this.parser=e,this.name=xt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,i=t.json,r=i.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const s=r.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class H9{constructor(e){this.parser=e,this.name=xt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const f=i.options.manager.getHandler(a.uri);f!==null&&(l=f)}return this.detectSupport().then(function(f){if(f)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class V9{constructor(e){this.name=xt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const l=r.byteOffset||0,f=r.byteLength||0,h=r.count,d=r.byteStride,p=new Uint8Array(a,l,f);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(h,d,p,r.mode,r.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(h*d);return o.decodeGltfBuffer(new Uint8Array(m),h,d,p,r.mode,r.filter),m})})}else return null}}const J3="glTF",Wc=12,ZE={JSON:1313821514,BIN:5130562};class W9{constructor(e){this.name=xt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Wc);if(this.header={magic:ts.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==J3)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Wc,r=new DataView(e,Wc);let s=0;for(;s<i;){const o=r.getUint32(s,!0);s+=4;const a=r.getUint32(s,!0);if(s+=4,a===ZE.JSON){const l=new Uint8Array(e,Wc+s,o);this.content=ts.decodeText(l)}else if(a===ZE.BIN){const l=Wc+s;this.body=e.slice(l,l+o)}s+=o}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class j9{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=xt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const i=this.json,r=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},l={},f={};for(const h in o){const d=w1[h]||h.toLowerCase();a[d]=o[h]}for(const h in e.attributes){const d=w1[h]||h.toLowerCase();if(o[h]!==void 0){const p=i.accessors[e.attributes[h]],m=th[p.componentType];f[d]=m.name,l[d]=p.normalized===!0}}return t.getDependency("bufferView",s).then(function(h){return new Promise(function(d){r.decodeDracoFile(h,function(p){for(const m in p.attributes){const v=p.attributes[m],y=l[m];y!==void 0&&(v.normalized=y)}d(p)},a,f)})})}}class J9{constructor(){this.name=xt.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return t.texCoord!==void 0&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class M1 extends Qu{constructor(e){super(),this.isGLTFSpecularGlossinessMaterial=!0;const t=["#ifdef USE_SPECULARMAP"," uniform sampler2D specularMap;","#endif"].join(` `),i=["#ifdef USE_GLOSSINESSMAP"," uniform sampler2D glossinessMap;","#endif"].join(` `),r=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP"," vec4 texelSpecular = texture2D( specularMap, vUv );"," // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture"," specularFactor *= texelSpecular.rgb;","#endif"].join(` `),s=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP"," vec4 texelGlossiness = texture2D( glossinessMap, vUv );"," // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture"," glossinessFactor *= texelGlossiness.a;","#endif"].join(` `),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.specularColor = specularFactor;"].join(` `),a={specular:{value:new Le().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=a,this.onBeforeCompile=function(l){for(const f in a)l.uniforms[f]=a[f];l.fragmentShader=l.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",i).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",s).replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class X9{constructor(){this.name=xt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return M1}extendParams(e,t,i){const r=t.extensions[this.name];e.color=new Le(1,1,1),e.opacity=1;const s=[];if(Array.isArray(r.diffuseFactor)){const o=r.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(r.diffuseTexture!==void 0&&s.push(i.assignTexture(e,"map",r.diffuseTexture,Ct)),e.emissive=new Le(0,0,0),e.glossiness=r.glossinessFactor!==void 0?r.glossinessFactor:1,e.specular=new Le(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),r.specularGlossinessTexture!==void 0){const o=r.specularGlossinessTexture;s.push(i.assignTexture(e,"glossinessMap",o)),s.push(i.assignTexture(e,"specularMap",o,Ct))}return Promise.all(s)}createMaterial(e){const t=new M1(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=e.emissiveIntensity===void 0?1:e.emissiveIntensity,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Js,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class K9{constructor(){this.name=xt.KHR_MESH_QUANTIZATION}}class X3 extends Zu{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[s+o];return t}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=a*2,f=a*3,h=r-t,d=(i-t)/h,p=d*d,m=p*d,v=e*f,y=v-f,x=-2*m+3*p,_=m-p,A=1-x,w=_-p+d;for(let S=0;S!==a;S++){const b=o[y+S+a],P=o[y+S+l]*h,R=o[v+S+a],E=o[v+S]*h;s[S]=A*b+w*P+x*R+_*E}return s}}const Y9=new Vn;class Q9 extends X3{interpolate_(e,t,i,r){const s=super.interpolate_(e,t,i,r);return Y9.fromArray(s).normalize().toArray(s),s}}const ws={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},th={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qE={9728:fn,9729:en,9984:Vf,9985:Sg,9986:xu,9987:rs},$E={33071:zn,33648:Pu,10497:zo},eb={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},w1={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},uo={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Z9={CUBICSPLINE:void 0,LINEAR:tl,STEP:Ru},yv={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function q9(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Qu({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:is})),n.DefaultMaterial}function jc(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function Ca(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function $9(n,e,t){let i=!1,r=!1,s=!1;for(let f=0,h=e.length;f<h;f++){const d=e[f];if(d.POSITION!==void 0&&(i=!0),d.NORMAL!==void 0&&(r=!0),d.COLOR_0!==void 0&&(s=!0),i&&r&&s)break}if(!i&&!r&&!s)return Promise.resolve(n);const o=[],a=[],l=[];for(let f=0,h=e.length;f<h;f++){const d=e[f];if(i){const p=d.POSITION!==void 0?t.getDependency("accessor",d.POSITION):n.attributes.position;o.push(p)}if(r){const p=d.NORMAL!==void 0?t.getDependency("accessor",d.NORMAL):n.attributes.normal;a.push(p)}if(s){const p=d.COLOR_0!==void 0?t.getDependency("accessor",d.COLOR_0):n.attributes.color;l.push(p)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l)]).then(function(f){const h=f[0],d=f[1],p=f[2];return i&&(n.morphAttributes.position=h),r&&(n.morphAttributes.normal=d),s&&(n.morphAttributes.color=p),n.morphTargetsRelative=!0,n})}function eV(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let i=0,r=t.length;i<r;i++)n.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function tV(n){const e=n.extensions&&n.extensions[xt.KHR_DRACO_MESH_COMPRESSION];let t;return e?t="draco:"+e.bufferView+":"+e.indices+":"+tb(e.attributes):t=n.indices+":"+tb(n.attributes)+":"+n.mode,t}function tb(n){let e="";const t=Object.keys(n).sort();for(let i=0,r=t.length;i<r;i++)e+=t[i]+":"+n[t[i]]+";";return e}function S1(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function nV(n){return n.search(/\.jpe?g($|\?)/i)>0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}class iV{constructor(e={},t={}){var i,r;this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new B9,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};const s=typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,o=typeof navigator<"u"&&((i=navigator.userAgent)===null||i===void 0?void 0:i.indexOf("Firefox"))>-1,a=typeof navigator<"u"&&o?(r=navigator.userAgent)===null||r===void 0?void 0:r.match(/Firefox\/([0-9]+)\./)[1]:-1;typeof createImageBitmap>"u"||s||o&&a<98?this.textureLoader=new Lh(this.options.manager):this.textureLoader=new x3(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Gi(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};jc(s,a,r),Ca(a,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){const o=t[r].joints;for(let a=0,l=o.length;a<l;a++)e[o[a]].isBone=!0}for(let r=0,s=e.length;r<s;r++){const o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const r=i.clone(),s=(o,a)=>{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[f,h]of o.children.entries())s(h,a.children[f])};return s(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const r=e(t[i]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let r=0;r<t.length;r++){const s=e(t[r]);s&&i.push(s)}return i}getDependency(e,t){const i=e+":"+t;let r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(s,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[xt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load(ts.resolveURL(t.uri,r.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const r=t.byteLength||0,s=t.byteOffset||0;return i.slice(s,s+r)})}loadAccessor(e){const t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0)return Promise.resolve(null);const s=[];return r.bufferView!==void 0?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),r.sparse!==void 0&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then(function(o){const a=o[0],l=eb[r.type],f=th[r.componentType],h=f.BYTES_PER_ELEMENT,d=h*l,p=r.byteOffset||0,m=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,v=r.normalized===!0;let y,x;if(m&&m!==d){const _=Math.floor(p/m),A="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+_+":"+r.count;let w=t.cache.get(A);w||(y=new f(a,_*m,r.count*m/h),w=new yh(y,m/h),t.cache.add(A,w)),x=new Go(w,l,p%m/h,v)}else a===null?y=new f(r.count*l):y=new f(a,p,r.count*l),x=new Dt(y,l,v);if(r.sparse!==void 0){const _=eb.SCALAR,A=th[r.sparse.indices.componentType],w=r.sparse.indices.byteOffset||0,S=r.sparse.values.byteOffset||0,b=new A(o[1],w,r.sparse.count*_),P=new f(o[2],S,r.sparse.count*l);a!==null&&(x=new Dt(x.array.slice(),x.itemSize,x.normalized));for(let R=0,E=b.length;R<E;R++){const B=b[R];if(x.setX(B,P[R*l]),l>=2&&x.setY(B,P[R*l+1]),l>=3&&x.setZ(B,P[R*l+2]),l>=4&&x.setW(B,P[R*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return x})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const r=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const f=this.loadImageSource(t,i).then(function(h){h.flipY=!1,o.name&&(h.name=o.name);const p=(s.samplers||{})[o.sampler]||{};return h.magFilter=qE[p.magFilter]||en,h.minFilter=qE[p.minFilter]||rs,h.wrapS=$E[p.wrapS]||zo,h.wrapT=$E[p.wrapT]||zo,r.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[l]=f,f}loadImageSource(e,t){const i=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const o=r.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",f=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(d){f=!0;const p=new Blob([d],{type:o.mimeType});return l=a.createObjectURL(p),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(l).then(function(d){return new Promise(function(p,m){let v=p;t.isImageBitmapLoader===!0&&(v=function(y){const x=new Qt(y);x.needsUpdate=!0,p(x)}),t.load(ts.resolveURL(d,s.path),v,void 0,m)})}).then(function(d){return f===!0&&a.revokeObjectURL(l),d.userData.mimeType=o.mimeType||nV(o.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=h,h}assignTexture(e,t,i,r){const s=this;return this.getDependency("texture",i.index).then(function(o){if(i.texCoord!==void 0&&i.texCoord!=0&&!(t==="aoMap"&&i.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),s.extensions[xt.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[xt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[xt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return r!==void 0&&(o.encoding=r),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new xh,Mn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new ti,Mn.prototype.copy.call(l,i),l.color.copy(i.color),this.cache.add(a,l)),i=l}if(r||s||o){let a="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),r&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}i.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=i}getMaterialType(){return Qu}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const a={},l=s.extensions||{},f=[];if(l[xt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const d=r[xt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=d.getMaterialType(),f.push(d.extendParams(a,s,t))}else if(l[xt.KHR_MATERIALS_UNLIT]){const d=r[xt.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),f.push(d.extendParams(a,s,t))}else{const d=s.pbrMetallicRoughness||{};if(a.color=new Le(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){const p=d.baseColorFactor;a.color.fromArray(p),a.opacity=p[3]}d.baseColorTexture!==void 0&&f.push(t.assignTexture(a,"map",d.baseColorTexture,Ct)),a.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,a.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(f.push(t.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),f.push(t.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),f.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Br);const h=s.alphaMode||yv.OPAQUE;if(h===yv.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,h===yv.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==ki&&(f.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new me(1,1),s.normalTexture.scale!==void 0)){const d=s.normalTexture.scale;a.normalScale.set(d,d)}return s.occlusionTexture!==void 0&&o!==ki&&(f.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==ki&&(a.emissive=new Le().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==ki&&f.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,Ct)),Promise.all(f).then(function(){let d;return o===M1?d=r[xt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):d=new o(a),s.name&&(d.name=s.name),Ca(d,s),t.associations.set(d,{materials:e}),s.extensions&&jc(r,d,s),d})}createUniqueName(e){const t=bt.sanitizeNodeName(e||"");let i=t;for(let r=1;this.nodeNamesUsed[i];++r)i=t+"_"+r;return this.nodeNamesUsed[i]=!0,i}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(a){return i[xt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return nb(l,a,t)})}const o=[];for(let a=0,l=e.length;a<l;a++){const f=e[a],h=tV(f),d=r[h];if(d)o.push(d.promise);else{let p;f.extensions&&f.extensions[xt.KHR_DRACO_MESH_COMPRESSION]?p=s(f):p=nb(new ut,f,t),r[h]={primitive:f,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,r=this.extensions,s=i.meshes[e],o=s.primitives,a=[];for(let l=0,f=o.length;l<f;l++){const h=o[l].material===void 0?q9(this.cache):this.getDependency("material",o[l].material);a.push(h)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(l){const f=l.slice(0,l.length-1),h=l[l.length-1],d=[];for(let m=0,v=h.length;m<v;m++){const y=h[m],x=o[m];let _;const A=f[m];if(x.mode===ws.TRIANGLES||x.mode===ws.TRIANGLE_STRIP||x.mode===ws.TRIANGLE_FAN||x.mode===void 0)_=s.isSkinnedMesh===!0?new cA(y,A):new bn(y,A),_.isSkinnedMesh===!0&&!_.geometry.attributes.skinWeight.normalized&&_.normalizeSkinWeights(),x.mode===ws.TRIANGLE_STRIP?_.geometry=ib(_.geometry,MB):x.mode===ws.TRIANGLE_FAN&&(_.geometry=ib(_.geometry,Y_));else if(x.mode===ws.LINES)_=new kr(y,A);else if(x.mode===ws.LINE_STRIP)_=new Ws(y,A);else if(x.mode===ws.LINE_LOOP)_=new fA(y,A);else if(x.mode===ws.POINTS)_=new hA(y,A);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+x.mode);Object.keys(_.geometry.morphAttributes).length>0&&eV(_,s),_.name=t.createUniqueName(s.name||"mesh_"+e),Ca(_,s),x.extensions&&jc(r,_,x),t.assignFinalMaterial(_),d.push(_)}for(let m=0,v=d.length;m<v;m++)t.associations.set(d[m],{meshes:e,primitives:m});if(d.length===1)return d[0];const p=new Ls;t.associations.set(p,{meshes:e});for(let m=0,v=d.length;m<v;m++)p.add(d[m]);return p})}loadCamera(e){let t;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Gt(Z_.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new Dr(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),Ca(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i={joints:t.joints};return t.inverseBindMatrices===void 0?Promise.resolve(i):this.getDependency("accessor",t.inverseBindMatrices).then(function(r){return i.inverseBindMatrices=r,i})}loadAnimation(e){const i=this.json.animations[e],r=[],s=[],o=[],a=[],l=[];for(let f=0,h=i.channels.length;f<h;f++){const d=i.channels[f],p=i.samplers[d.sampler],m=d.target,v=m.node,y=i.parameters!==void 0?i.parameters[p.input]:p.input,x=i.parameters!==void 0?i.parameters[p.output]:p.output;r.push(this.getDependency("node",v)),s.push(this.getDependency("accessor",y)),o.push(this.getDependency("accessor",x)),a.push(p),l.push(m)}return Promise.all([Promise.all(r),Promise.all(s),Promise.all(o),Promise.all(a),Promise.all(l)]).then(function(f){const h=f[0],d=f[1],p=f[2],m=f[3],v=f[4],y=[];for(let _=0,A=h.length;_<A;_++){const w=h[_],S=d[_],b=p[_],P=m[_],R=v[_];if(w===void 0)continue;w.updateMatrix();let E;switch(uo[R.path]){case uo.weights:E=Fu;break;case uo.rotation:E=Ho;break;case uo.position:case uo.scale:default:E=Nu;break}const B=w.name?w.name:w.uuid,L=P.interpolation!==void 0?Z9[P.interpolation]:tl,z=[];uo[R.path]===uo.weights?w.traverse(function(J){J.morphTargetInfluences&&z.push(J.name?J.name:J.uuid)}):z.push(B);let Z=b.array;if(b.normalized){const J=S1(Z.constructor),H=new Float32Array(Z.length);for(let Y=0,te=Z.length;Y<te;Y++)H[Y]=Z[Y]*J;Z=H}for(let J=0,H=z.length;J<H;J++){const Y=new E(z[J]+"."+uo[R.path],S.array,Z,L);P.interpolation==="CUBICSPLINE"&&(Y.createInterpolant=function(le){const N=this instanceof Ho?Q9:X3;return new N(this.times,this.values,this.getValueSize()/3,le)},Y.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),y.push(Y)}}const x=i.name?i.name:"animation_"+e;return new ku(x,void 0,y)})}createNodeMesh(e){const t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(s){const o=i._getNodeRef(i.meshCache,r.mesh,s);return r.weights!==void 0&&o.traverse(function(a){if(a.isMesh)for(let l=0,f=r.weights.length;l<f;l++)a.morphTargetInfluences[l]=r.weights[l]}),o})}loadNode(e){const t=this.json,i=this.extensions,r=this,s=t.nodes[e],o=s.name?r.createUniqueName(s.name):"";return function(){const a=[],l=r._invokeOne(function(f){return f.createNodeMesh&&f.createNodeMesh(e)});return l&&a.push(l),s.camera!==void 0&&a.push(r.getDependency("camera",s.camera).then(function(f){return r._getNodeRef(r.cameraCache,s.camera,f)})),r._invokeAll(function(f){return f.createNodeAttachment&&f.createNodeAttachment(e)}).forEach(function(f){a.push(f)}),Promise.all(a)}().then(function(a){let l;if(s.isBone===!0?l=new Rg:a.length>1?l=new Ls:a.length===1?l=a[0]:l=new Tt,l!==a[0])for(let f=0,h=a.length;f<h;f++)l.add(a[f]);if(s.name&&(l.userData.name=s.name,l.name=o),Ca(l,s),s.extensions&&jc(i,l,s),s.matrix!==void 0){const f=new rt;f.fromArray(s.matrix),l.applyMatrix4(f)}else s.translation!==void 0&&l.position.fromArray(s.translation),s.rotation!==void 0&&l.quaternion.fromArray(s.rotation),s.scale!==void 0&&l.scale.fromArray(s.scale);return r.associations.has(l)||r.associations.set(l,{}),r.associations.get(l).nodes=e,l})}loadScene(e){const t=this.json,i=this.extensions,r=this.json.scenes[e],s=this,o=new Ls;r.name&&(o.name=s.createUniqueName(r.name)),Ca(o,r),r.extensions&&jc(i,o,r);const a=r.nodes||[],l=[];for(let f=0,h=a.length;f<h;f++)l.push(K3(a[f],o,t,s));return Promise.all(l).then(function(){const f=h=>{const d=new Map;for(const[p,m]of s.associations)(p instanceof Mn||p instanceof Qt)&&d.set(p,m);return h.traverse(p=>{const m=s.associations.get(p);m!=null&&d.set(p,m)}),d};return s.associations=f(o),o})}}function K3(n,e,t,i){const r=t.nodes[n];return i.getDependency("node",n).then(function(s){if(r.skin===void 0)return s;let o;return i.getDependency("skin",r.skin).then(function(a){o=a;const l=[];for(let f=0,h=o.joints.length;f<h;f++)l.push(i.getDependency("node",o.joints[f]));return Promise.all(l)}).then(function(a){return s.traverse(function(l){if(!l.isMesh)return;const f=[],h=[];for(let d=0,p=a.length;d<p;d++){const m=a[d];if(m){f.push(m);const v=new rt;o.inverseBindMatrices!==void 0&&v.fromArray(o.inverseBindMatrices.array,d*16),h.push(v)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',o.joints[d])}l.bind(new vh(f,h),l.matrixWorld)}),s})}).then(function(s){e.add(s);const o=[];if(r.children){const a=r.children;for(let l=0,f=a.length;l<f;l++){const h=a[l];o.push(K3(h,s,t,i))}}return Promise.all(o)})}function rV(n,e,t){const i=e.attributes,r=new Ko;if(i.POSITION!==void 0){const a=t.json.accessors[i.POSITION],l=a.min,f=a.max;if(l!==void 0&&f!==void 0){if(r.set(new D(l[0],l[1],l[2]),new D(f[0],f[1],f[2])),a.normalized){const h=S1(th[a.componentType]);r.min.multiplyScalar(h),r.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new D,l=new D;for(let f=0,h=s.length;f<h;f++){const d=s[f];if(d.POSITION!==void 0){const p=t.json.accessors[d.POSITION],m=p.min,v=p.max;if(m!==void 0&&v!==void 0){if(l.setX(Math.max(Math.abs(m[0]),Math.abs(v[0]))),l.setY(Math.max(Math.abs(m[1]),Math.abs(v[1]))),l.setZ(Math.max(Math.abs(m[2]),Math.abs(v[2]))),p.normalized){const y=S1(th[p.componentType]);l.multiplyScalar(y)}a.max(l)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(a)}n.boundingBox=r;const o=new Yo;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function nb(n,e,t){const i=e.attributes,r=[];function s(o,a){return t.getDependency("accessor",o).then(function(l){n.setAttribute(a,l)})}for(const o in i){const a=w1[o]||o.toLowerCase();a in n.attributes||r.push(s(i[o],a))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(a){n.setIndex(a)});r.push(o)}return Ca(n,e),rV(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?$9(n,e.targets,t):n})}function ib(n,e){let t=n.getIndex();if(t===null){const o=[],a=n.getAttribute("position");if(a!==void 0){for(let l=0;l<a.count;l++)o.push(l);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const i=t.count-2,r=[];if(e===Y_)for(let o=1;o<=i;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<i;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(r),s}class sV extends ut{constructor(e,t,i,r){super();const s=[],o=[],a=[],l=new D,f=new rt;f.makeRotationFromEuler(i),f.setPosition(t);const h=new rt;h.copy(f).invert(),d(),this.setAttribute("position",new We(s,3)),this.setAttribute("normal",new We(o,3)),this.setAttribute("uv",new We(a,2));function d(){let y,x=[];const _=new D,A=new D;if(e.geometry.isGeometry===!0){console.error("THREE.DecalGeometry no longer supports THREE.Geometry. Use BufferGeometry instead.");return}const w=e.geometry,S=w.attributes.position,b=w.attributes.normal;if(w.index!==null){const P=w.index;for(y=0;y<P.count;y++)_.fromBufferAttribute(S,P.getX(y)),A.fromBufferAttribute(b,P.getX(y)),p(x,_,A)}else for(y=0;y<S.count;y++)_.fromBufferAttribute(S,y),A.fromBufferAttribute(b,y),p(x,_,A);for(x=m(x,l.set(1,0,0)),x=m(x,l.set(-1,0,0)),x=m(x,l.set(0,1,0)),x=m(x,l.set(0,-1,0)),x=m(x,l.set(0,0,1)),x=m(x,l.set(0,0,-1)),y=0;y<x.length;y++){const P=x[y];a.push(.5+P.position.x/r.x,.5+P.position.y/r.y),P.position.applyMatrix4(f),s.push(P.position.x,P.position.y,P.position.z),o.push(P.normal.x,P.normal.y,P.normal.z)}}function p(y,x,_){x.applyMatrix4(e.matrixWorld),x.applyMatrix4(h),_.transformDirection(e.matrixWorld),y.push(new rb(x.clone(),_.clone()))}function m(y,x){const _=[],A=.5*Math.abs(r.dot(x));for(let w=0;w<y.length;w+=3){let S,b,P,R=0,E,B,L,z;const Z=y[w+0].position.dot(x)-A,J=y[w+1].position.dot(x)-A,H=y[w+2].position.dot(x)-A;switch(S=Z>0,b=J>0,P=H>0,R=(S?1:0)+(b?1:0)+(P?1:0),R){case 0:{_.push(y[w]),_.push(y[w+1]),_.push(y[w+2]);break}case 1:{if(S&&(E=y[w+1],B=y[w+2],L=v(y[w],E,x,A),z=v(y[w],B,x,A)),b){E=y[w],B=y[w+2],L=v(y[w+1],E,x,A),z=v(y[w+1],B,x,A),_.push(L),_.push(B.clone()),_.push(E.clone()),_.push(B.clone()),_.push(L.clone()),_.push(z);break}P&&(E=y[w],B=y[w+1],L=v(y[w+2],E,x,A),z=v(y[w+2],B,x,A)),_.push(E.clone()),_.push(B.clone()),_.push(L),_.push(z),_.push(L.clone()),_.push(B.clone());break}case 2:{S||(E=y[w].clone(),B=v(E,y[w+1],x,A),L=v(E,y[w+2],x,A),_.push(E),_.push(B),_.push(L)),b||(E=y[w+1].clone(),B=v(E,y[w+2],x,A),L=v(E,y[w],x,A),_.push(E),_.push(B),_.push(L)),P||(E=y[w+2].clone(),B=v(E,y[w],x,A),L=v(E,y[w+1],x,A),_.push(E),_.push(B),_.push(L));break}}}return _}function v(y,x,_,A){const w=y.position.dot(_)-A,S=x.position.dot(_)-A,b=w/(w-S);return new rb(new D(y.position.x+b*(x.position.x-y.position.x),y.position.y+b*(x.position.y-y.position.y),y.position.z+b*(x.position.z-y.position.z)),new D(y.normal.x+b*(x.normal.x-y.normal.x),y.normal.y+b*(x.normal.y-y.normal.y),y.normal.z+b*(x.normal.z-y.normal.z)))}}}class rb{constructor(e,t){this.position=e,this.normal=t}clone(){return new this.constructor(this.position.clone(),this.normal.clone())}}const vv=new WeakMap;class oV extends pi{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,r){const s=new Gi(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(r)},i,r)}decodeDracoFile(e,t,i,r){const s={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const l in t.attributeTypes){const f=t.attributeTypes[l];f.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=f.name)}const i=JSON.stringify(t);if(vv.has(e)){const l=vv.get(e);if(l.key===i)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(r=l,new Promise((f,h)=>{r._callbacks[s]={resolve:f,reject:h},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),vv.set(e,{key:i,promise:a}),a}_createGeometry(e){const t=new ut;e.index&&t.setIndex(new Dt(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const r=e.attributes[i],s=r.name,o=r.array,a=r.itemSize;t.setAttribute(s,new Dt(o,a))}return t}_loadLibrary(e,t){const i=new Gi(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((r,s)=>{i.load(e,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const s=aV.toString(),o=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` `);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(s){const o=s.data;switch(o.type){case"decode":r._callbacks[o.id].resolve(o);break;case"error":r._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,s){return r._taskLoad>s._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function aV(){let n,e;onmessage=function(o){const a=o.data;switch(a.type){case"init":n=a.decoderConfig,e=new Promise(function(h){n.onModuleLoaded=function(d){h({draco:d})},DracoDecoderModule(n)});break;case"decode":const l=a.buffer,f=a.taskConfig;e.then(h=>{const d=h.draco,p=new d.Decoder,m=new d.DecoderBuffer;m.Init(new Int8Array(l),l.byteLength);try{const v=t(d,p,m,f),y=v.attributes.map(x=>x.array.buffer);v.index&&y.push(v.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:v},y)}catch(v){console.error(v),self.postMessage({type:"error",id:a.id,error:v.message})}finally{d.destroy(m),d.destroy(p)}});break}};function t(o,a,l,f){const h=f.attributeIDs,d=f.attributeTypes;let p,m;const v=a.GetEncodedGeometryType(l);if(v===o.TRIANGULAR_MESH)p=new o.Mesh,m=a.DecodeBufferToMesh(l,p);else if(v===o.POINT_CLOUD)p=new o.PointCloud,m=a.DecodeBufferToPointCloud(l,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!m.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+m.error_msg());const y={index:null,attributes:[]};for(const x in h){const _=self[d[x]];let A,w;if(f.useUniqueIDs)w=h[x],A=a.GetAttributeByUniqueId(p,w);else{if(w=a.GetAttributeId(p,o[h[x]]),w===-1)continue;A=a.GetAttribute(p,w)}y.attributes.push(r(o,a,p,x,_,A))}return v===o.TRIANGULAR_MESH&&(y.index=i(o,a,p)),o.destroy(p),y}function i(o,a,l){const h=l.num_faces()*3,d=h*4,p=o._malloc(d);a.GetTrianglesUInt32Array(l,d,p);const m=new Uint32Array(o.HEAPF32.buffer,p,h).slice();return o._free(p),{array:m,itemSize:1}}function r(o,a,l,f,h,d){const p=d.num_components(),v=l.num_points()*p,y=v*h.BYTES_PER_ELEMENT,x=s(o,h),_=o._malloc(y);a.GetAttributeDataArrayForAllPoints(l,d,x,y,_);const A=new h(o.HEAPF32.buffer,_,v).slice();return o._free(_),{name:f,array:A,itemSize:p}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}let Up;const xv=()=>{if(Up)return Up;const n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let r=n;WebAssembly.validate(t)&&(r=e);let s;const o=WebAssembly.instantiate(a(r),{}).then(d=>{s=d.instance,s.exports.__wasm_call_ctors()});function a(d){const p=new Uint8Array(d.length);for(let v=0;v<d.length;++v){const y=d.charCodeAt(v);p[v]=y>96?y-71:y>64?y-65:y>47?y+4:y>46?63:62}let m=0;for(let v=0;v<d.length;++v)p[m++]=p[v]<60?i[p[v]]:(p[v]-60)*64+p[++v];return p.buffer.slice(0,m)}function l(d,p,m,v,y,x){const _=s.exports.sbrk,A=m+3&-4,w=_(A*v),S=_(y.length),b=new Uint8Array(s.exports.memory.buffer);b.set(y,S);const P=d(w,m,v,S,y.length);if(P===0&&x&&x(w,A,v),p.set(b.subarray(w,w+m*v)),_(w-_(0)),P!==0)throw new Error(`Malformed buffer data: ${P}`)}const f={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return Up={ready:o,supported:!0,decodeVertexBuffer(d,p,m,v,y){l(s.exports.meshopt_decodeVertexBuffer,d,p,m,v,s.exports[f[y]])},decodeIndexBuffer(d,p,m,v){l(s.exports.meshopt_decodeIndexBuffer,d,p,m,v)},decodeIndexSequence(d,p,m,v){l(s.exports.meshopt_decodeIndexSequence,d,p,m,v)},decodeGltfBuffer(d,p,m,v,y,x){l(s.exports[h[y]],d,p,m,v,s.exports[f[x]])}},Up},sb=n=>n===Object(n)&&!Array.isArray(n)&&typeof n!="function";function OA(n,e){const t=Fi(r=>r.gl),i=qo(Lh,sb(n)?Object.values(n):n);if(U.useLayoutEffect(()=>{e==null||e(i)},[e]),U.useEffect(()=>{(Array.isArray(i)?i:[i]).forEach(t.initTexture)},[t,i]),sb(n)){const r=Object.keys(n),s={};return r.forEach(o=>Object.assign(s,{[o]:i[r.indexOf(o)]})),s}else return i}OA.preload=n=>qo.preload(Lh,n);OA.clear=n=>qo.clear(Lh,n);function lV(n){return Array.isArray(n)}function _v(n=[0,0,0]){return lV(n)?n:n instanceof D||n instanceof ol?[n.x,n.y,n.z]:[n,n,n]}function uV({debug:n,mesh:e,children:t,position:i,rotation:r,scale:s,...o}){const a=U.useRef(null),l=U.useRef(null);return U.useLayoutEffect(()=>{const f=(e==null?void 0:e.current)||a.current.parent,h=a.current;if(!(f instanceof bn))throw new Error('Decal must have a Mesh as parent or specify its "mesh" prop');const d={position:new D,rotation:new ol,scale:new D(1,1,1)};if(f){So(d,{position:i,scale:s});const p=f.matrixWorld.clone();if(f.matrixWorld.identity(),!r||typeof r=="number"){const m=new Tt;m.position.copy(d.position),m.lookAt(f.position),typeof r=="number"&&m.rotateZ(r),So(d,{rotation:m.rotation})}else So(d,{rotation:r});return h.geometry=new sV(f,d.position,d.rotation,d.scale),l.current&&So(l.current,d),f.matrixWorld=p,()=>{h.geometry.dispose()}}},[e,..._v(i),..._v(s),..._v(r)]),U.createElement("mesh",{ref:a},t||U.createElement("meshStandardMaterial",gr({transparent:!0,polygonOffset:!0,polygonOffsetFactor:-10},o)),n&&U.createElement("mesh",{ref:l},U.createElement("boxGeometry",null),U.createElement("meshNormalMaterial",{wireframe:!0}),U.createElement("axesHelper",null)))}let zp=null;function Y3(n,e,t){return i=>{t&&t(i),n&&(zp||(zp=new oV),zp.setDecoderPath(typeof n=="string"?n:"https://www.gstatic.com/draco/versioned/decoders/1.5.5/"),i.setDRACOLoader(zp)),e&&i.setMeshoptDecoder(typeof xv=="function"?xv():xv)}}function Og(n,e=!0,t=!0,i){return qo(kA,n,Y3(e,t,i))}Og.preload=(n,e=!0,t=!0,i)=>qo.preload(kA,n,Y3(e,t,i));Og.clear=n=>qo.clear(kA,n);const UA=U.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,onChange:s,onStart:o,onEnd:a,...l},f)=>{const h=Fi(b=>b.invalidate),d=Fi(b=>b.camera),p=Fi(b=>b.gl),m=Fi(b=>b.events),v=Fi(b=>b.setEvents),y=Fi(b=>b.set),x=Fi(b=>b.get),_=Fi(b=>b.performance),A=e||d,w=i||m.connected||p.domElement,S=U.useMemo(()=>new P9(A),[A]);return qu(()=>{S.enabled&&S.update()},-1),U.useEffect(()=>(S.connect(w),()=>void S.dispose()),[w,t,S,h]),U.useEffect(()=>{const b=E=>{h(),t&&_.regress(),s&&s(E)},P=E=>{o&&o(E)},R=E=>{a&&a(E)};return S.addEventListener("change",b),S.addEventListener("start",P),S.addEventListener("end",R),()=>{S.removeEventListener("start",P),S.removeEventListener("end",R),S.removeEventListener("change",b)}},[s,o,a,S,h,v]),U.useEffect(()=>{if(n){const b=x().controls;return y({controls:S}),()=>y({controls:b})}},[n,S]),U.createElement("primitive",gr({ref:f,object:S,enableDamping:r},l))});class cV extends xh{constructor(e){super(e),this.onBeforeCompile=(t,i)=>{const{isWebGL2:r}=i.capabilities;t.fragmentShader=t.fragmentShader.replace("#include <output_fragment>",` ${r?"#include <output_fragment>":`#extension GL_OES_standard_derivatives : enable #include <output_fragment>`} vec2 cxy = 2.0 * gl_PointCoord - 1.0; float r = dot(cxy, cxy); float delta = fwidth(r); float mask = 1.0 - smoothstep(1.0 - delta, 1.0 + delta, r); gl_FragColor = vec4(gl_FragColor.rgb, mask * gl_FragColor.a ); #include <tonemapping_fragment> #include <encodings_fragment> `)}}}const fV=U.forwardRef((n,e)=>{const[t]=U.useState(()=>new cV(null));return U.createElement("primitive",gr({},n,{object:t,ref:e,attach:"material"}))}),hV=U.forwardRef(({children:n,speed:e=1,rotationIntensity:t=1,floatIntensity:i=1,floatingRange:r=[-.1,.1],...s},o)=>{const a=U.useRef(null),l=U.useRef(Math.random()*1e4);return qu(f=>{var h,d;const p=l.current+f.clock.getElapsedTime();a.current.rotation.x=Math.cos(p/4*e)/8*t,a.current.rotation.y=Math.sin(p/4*e)/8*t,a.current.rotation.z=Math.sin(p/4*e)/20*t;let m=Math.sin(p/4*e)/10;m=Z_.mapLinear(m,-.1,.1,(h=r==null?void 0:r[0])!==null&&h!==void 0?h:-.1,(d=r==null?void 0:r[1])!==null&&d!==void 0?d:.1),a.current.position.y=m*i}),U.createElement("group",s,U.createElement("group",{ref:NA([a,o])},n))});let va,Jc;const dV=U.createContext(null),ob=new rt,ab=new D,pV=U.forwardRef(({children:n,range:e,limit:t=1e3,...i},r)=>{const s=U.useRef(null),[o,a]=U.useState([]),[[l,f,h]]=U.useState(()=>[new Float32Array(t*3),Float32Array.from({length:t*3},()=>1),Float32Array.from({length:t},()=>1)]);U.useEffect(()=>{s.current.geometry.attributes.position.needsUpdate=!0}),qu(()=>{for(s.current.updateMatrix(),s.current.updateMatrixWorld(),ob.copy(s.current.matrixWorld).invert(),s.current.geometry.drawRange.count=Math.min(t,e!==void 0?e:t,o.length),va=0;va<o.length;va++)Jc=o[va].current,Jc.getWorldPosition(ab).applyMatrix4(ob),ab.toArray(l,va*3),s.current.geometry.attributes.position.needsUpdate=!0,Jc.matrixWorldNeedsUpdate=!0,Jc.color.toArray(f,va*3),s.current.geometry.attributes.color.needsUpdate=!0,h.set([Jc.size],va),s.current.geometry.attributes.size.needsUpdate=!0});const d=U.useMemo(()=>({getParent:()=>s,subscribe:p=>(a(m=>[...m,p]),()=>a(m=>m.filter(v=>v.current!==p.current)))}),[]);return U.createElement("points",gr({userData:{instances:o},matrixAutoUpdate:!1,ref:NA([r,s]),raycast:()=>null},i),U.createElement("bufferGeometry",null,U.createElement("bufferAttribute",{attach:"attributes-position",count:l.length/3,array:l,itemSize:3,usage:Wa}),U.createElement("bufferAttribute",{attach:"attributes-color",count:f.length/3,array:f,itemSize:3,usage:Wa}),U.createElement("bufferAttribute",{attach:"attributes-size",count:h.length,array:h,itemSize:1,usage:Wa})),U.createElement(dV.Provider,{value:d},n))}),mV=U.forwardRef(({children:n,positions:e,colors:t,sizes:i,stride:r=3,...s},o)=>{const a=U.useRef(null);return qu(()=>{const l=a.current.geometry.attributes;l.position.needsUpdate=!0,t&&(l.color.needsUpdate=!0),i&&(l.size.needsUpdate=!0)}),U.createElement("points",gr({ref:NA([o,a])},s),U.createElement("bufferGeometry",null,U.createElement("bufferAttribute",{attach:"attributes-position",count:e.length/r,array:e,itemSize:r,usage:Wa}),t&&U.createElement("bufferAttribute",{attach:"attributes-color",count:t.length/r,array:t,itemSize:3,usage:Wa}),i&&U.createElement("bufferAttribute",{attach:"attributes-size",count:i.length/r,array:i,itemSize:1,usage:Wa})),n)}),gV=U.forwardRef((n,e)=>n.positions instanceof Float32Array?U.createElement(mV,gr({},n,{ref:e})):U.createElement(pV,gr({},n,{ref:e})));var jm={},yV={get exports(){return jm},set exports(n){jm=n}},vV="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",xV=vV,_V=xV;function Q3(){}function Z3(){}Z3.resetWarningCache=Q3;var AV=function(){function n(i,r,s,o,a,l){if(l!==_V){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Z3,resetWarningCache:Q3};return t.PropTypes=t,t};yV.exports=AV();function Ug({all:n,scene:e,camera:t}){const i=Fi(({gl:o})=>o),r=Fi(({camera:o})=>o),s=Fi(({scene:o})=>o);return U.useLayoutEffect(()=>{const o=[];n&&(e||s).traverse(f=>{f.visible===!1&&(o.push(f),f.visible=!0)}),i.compile(e||s,t||r);const a=new iA(128);new nA(.01,1e5,a).update(i,e||s),a.dispose(),o.forEach(f=>f.visible=!1)},[]),null}const zA=()=>{const{progress:n}=x9();return tt(v9,{as:"div",center:!0,style:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[pe("span",{className:"canvas-loader"}),tt("p",{style:{fontSize:14,color:"#F1F1F1",fontWeight:800,marginTop:40},children:[n.toFixed(2),"%"]})]})},MV=()=>{const n=Og("./planet/scene.gltf");return pe("primitive",{object:n.scene,scale:2.5,"position-y":0,"rotation-y":0})},wV=()=>pe(kg,{shadows:!0,frameloop:"demand",dpr:[1,2],gl:{preserveDrawingBuffer:!0},camera:{fov:45,near:.1,far:200,position:[-4,3,6]},children:tt(U.Suspense,{fallback:pe(zA,{}),children:[pe(UA,{autoRotate:!0,enableZoom:!1,maxPolarAngle:Math.PI/2,minPolarAngle:Math.PI/2}),pe(MV,{}),pe(Ug,{all:!0})]})}),SV=n=>{const[e]=OA([n.imgUrl]);return tt(hV,{speed:1.75,rotationIntensity:1,floatIntensity:2,children:[pe("ambientLight",{intensity:.25}),pe("directionalLight",{position:[0,0,.05]}),tt("mesh",{castShadow:!0,receiveShadow:!0,scale:2.75,children:[pe("icosahedronGeometry",{args:[1,1]}),pe("meshStandardMaterial",{color:"#fff8eb",polygonOffset:!0,polygonOffsetFactor:-5,flatShading:!0}),pe(uV,{position:[0,0,1],rotation:[2*Math.PI,0,6.25],scale:1,map:e,flatShading:!0})]})]})},CV=({icon:n})=>tt(kg,{frameloop:"demand",dpr:[1,2],gl:{preserveDrawingBuffer:!0},children:[tt(U.Suspense,{fallback:pe(zA,{}),children:[pe(UA,{enableZoom:!1}),pe(SV,{imgUrl:n})]}),pe(Ug,{all:!0})]}),EV=({isMobile:n})=>{const e=Og("./desktop_pc/scene.gltf");return tt("mesh",{children:[pe("hemisphereLight",{intensity:.15,groundColor:"black"}),pe("spotLight",{position:[-20,50,10],angle:.12,penumbra:1,intensity:1,castShadow:!0,"shadow-mapSize":1024}),pe("pointLight",{intensity:1}),pe("primitive",{object:e.scene,scale:n?.7:.75,position:n?[0,-3,-2.2]:[0,-3.25,-1.5],rotation:[-.01,-.2,-.1]})]})},bV=()=>{const[n,e]=U.useState(!1);return U.useEffect(()=>{const t=window.matchMedia("(max-width: 500px)");e(t.matches);const i=r=>{e(r.matches)};return t.addEventListener("change",i),()=>{t.removeEventListener("change",i)}},[]),tt(kg,{frameloop:"demand",shadows:!0,dpr:[1,2],camera:{position:[20,3,5],fov:25},gl:{preserveDrawingBuffer:!0},children:[tt(U.Suspense,{fallback:pe(zA,{}),children:[pe(UA,{enableZoom:!1,maxPolarAngle:Math.PI/2,minPolarAngle:Math.PI/2}),pe(EV,{isMobile:n})]}),pe(Ug,{all:!0})]})},TV=n=>{const e=U.useRef(),[t]=U.useState(()=>E9(new Float32Array(5e3),{radius:1.2}));return qu((i,r)=>{e.current.rotation.x-=r/10,e.current.rotation.y-=r/15}),pe("group",{rotation:[0,0,Math.PI/4],children:pe(gV,{ref:e,positions:t,stride:3,frustumCulled:!0,...n,children:pe(fV,{transparent:!0,color:"#f272c8",size:.002,sizeAttenuation:!0,depthWrite:!1})})})},PV=()=>pe("div",{className:"w-full h-auto absolute inset-0 z-[-1]",children:tt(kg,{camera:{position:[0,0,1]},children:[pe(U.Suspense,{fallback:null,children:pe(TV,{})}),pe(Ug,{all:!0})]})}),q3=U.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"}),zg=U.createContext({});function BV(){return U.useContext(zg).visualElement}const GA=U.createContext(null),Gg=typeof document<"u",lb=Gg?U.useLayoutEffect:U.useEffect,$3=U.createContext({strict:!1});function RV(n,e,t,i){const r=BV(),s=U.useContext($3),o=U.useContext(GA),a=U.useContext(q3).reducedMotion,l=U.useRef();i=i||s.renderer,!l.current&&i&&(l.current=i(n,{visualState:e,parent:r,props:t,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const f=l.current;return U.useInsertionEffect(()=>{f&&f.update(t,o)}),lb(()=>{f&&f.render()}),U.useEffect(()=>{f&&f.updateFeatures()}),(window.HandoffAppearAnimations?lb:U.useEffect)(()=>{f&&f.animationState&&f.animationState.animateChanges()}),f}function cu(n){return typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function LV(n,e,t){return U.useCallback(i=>{i&&n.mount&&n.mount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):cu(t)&&(t.current=i))},[e])}function nh(n){return typeof n=="string"||Array.isArray(n)}function Hg(n){return typeof n=="object"&&typeof n.start=="function"}const HA=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],VA=["initial",...HA];function Vg(n){return Hg(n.animate)||VA.some(e=>nh(n[e]))}function eR(n){return Boolean(Vg(n)||n.variants)}function IV(n,e){if(Vg(n)){const{initial:t,animate:i}=n;return{initial:t===!1||nh(t)?t:void 0,animate:nh(i)?i:void 0}}return n.inherit!==!1?e:{}}function DV(n){const{initial:e,animate:t}=IV(n,U.useContext(zg));return U.useMemo(()=>({initial:e,animate:t}),[ub(e),ub(t)])}function ub(n){return Array.isArray(n)?n.join(" "):n}const cb={animation:["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ih={};for(const n in cb)ih[n]={isEnabled:e=>cb[n].some(t=>!!e[t])};function FV(n){for(const e in n)ih[e]={...ih[e],...n[e]}}function tR(n){const e=U.useRef(null);return e.current===null&&(e.current=n()),e.current}const gf={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let NV=1;function kV(){return tR(()=>{if(gf.hasEverUpdated)return NV++})}const nR=U.createContext({}),iR=U.createContext({}),OV=Symbol.for("motionComponentSymbol");function UV({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){n&&FV(n);function s(a,l){let f;const h={...U.useContext(q3),...a,layoutId:zV(a)},{isStatic:d}=h,p=DV(a),m=d?void 0:kV(),v=i(a,d);if(!d&&Gg){p.visualElement=RV(r,v,h,e);const y=U.useContext(iR),x=U.useContext($3).strict;p.visualElement&&(f=p.visualElement.loadFeatures(h,x,n,m,y))}return U.createElement(zg.Provider,{value:p},f&&p.visualElement?U.createElement(f,{visualElement:p.visualElement,...h}):null,t(r,a,m,LV(v,p.visualElement,l),v,d,p.visualElement))}const o=U.forwardRef(s);return o[OV]=r,o}function zV({layoutId:n}){const e=U.useContext(nR).id;return e&&n!==void 0?e+"-"+n:n}function GV(n){function e(i,r={}){return UV(n(i,r))}if(typeof Proxy>"u")return e;const t=new Map;return new Proxy(e,{get:(i,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}const HV=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function WA(n){return typeof n!="string"||n.includes("-")?!1:!!(HV.indexOf(n)>-1||/[A-Z]/.test(n))}const Jm={};function VV(n){Object.assign(Jm,n)}const Wg=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],fl=new Set(Wg);function rR(n,{layout:e,layoutId:t}){return fl.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!Jm[n]||n==="opacity")}const bi=n=>Boolean(n&&n.getVelocity),WV={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jV=Wg.length;function JV(n,{enableHardwareAcceleration:e=!0,allowTransformNone:t=!0},i,r){let s="";for(let o=0;o<jV;o++){const a=Wg[o];if(n[a]!==void 0){const l=WV[a]||a;s+=`${l}(${n[a]}) `}}return e&&!n.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(n,i?"":s):t&&i&&(s="none"),s}const sR=n=>e=>typeof e=="string"&&e.startsWith(n),oR=sR("--"),C1=sR("var(--"),XV=(n,e)=>e&&typeof n=="number"?e.transform(n):n,Uu=(n,e,t)=>Math.min(Math.max(t,n),e),hl={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},yf={...hl,transform:n=>Uu(0,1,n)},Gp={...hl,default:1},vf=n=>Math.round(n*1e5)/1e5,rh=/(-)?([\d]*\.?[\d])+/g,E1=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,KV=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Fh(n){return typeof n=="string"}const Nh=n=>({test:e=>Fh(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),ho=Nh("deg"),ns=Nh("%"),it=Nh("px"),YV=Nh("vh"),QV=Nh("vw"),fb={...ns,parse:n=>ns.parse(n)/100,transform:n=>ns.transform(n*100)},hb={...hl,transform:Math.round},aR={borderWidth:it,borderTopWidth:it,borderRightWidth:it,borderBottomWidth:it,borderLeftWidth:it,borderRadius:it,radius:it,borderTopLeftRadius:it,borderTopRightRadius:it,borderBottomRightRadius:it,borderBottomLeftRadius:it,width:it,maxWidth:it,height:it,maxHeight:it,size:it,top:it,right:it,bottom:it,left:it,padding:it,paddingTop:it,paddingRight:it,paddingBottom:it,paddingLeft:it,margin:it,marginTop:it,marginRight:it,marginBottom:it,marginLeft:it,rotate:ho,rotateX:ho,rotateY:ho,rotateZ:ho,scale:Gp,scaleX:Gp,scaleY:Gp,scaleZ:Gp,skew:ho,skewX:ho,skewY:ho,distance:it,translateX:it,translateY:it,translateZ:it,x:it,y:it,z:it,perspective:it,transformPerspective:it,opacity:yf,originX:fb,originY:fb,originZ:it,zIndex:hb,fillOpacity:yf,strokeOpacity:yf,numOctaves:hb};function jA(n,e,t,i){const{style:r,vars:s,transform:o,transformOrigin:a}=n;let l=!1,f=!1,h=!0;for(const d in e){const p=e[d];if(oR(d)){s[d]=p;continue}const m=aR[d],v=XV(p,m);if(fl.has(d)){if(l=!0,o[d]=v,!h)continue;p!==(m.default||0)&&(h=!1)}else d.startsWith("origin")?(f=!0,a[d]=v):r[d]=v}if(e.transform||(l||i?r.transform=JV(n.transform,t,h,i):r.transform&&(r.transform="none")),f){const{originX:d="50%",originY:p="50%",originZ:m=0}=a;r.transformOrigin=`${d} ${p} ${m}`}}const JA=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function lR(n,e,t){for(const i in e)!bi(e[i])&&!rR(i,t)&&(n[i]=e[i])}function ZV({transformTemplate:n},e,t){return U.useMemo(()=>{const i=JA();return jA(i,e,{enableHardwareAcceleration:!t},n),Object.assign({},i.vars,i.style)},[e])}function qV(n,e,t){const i=n.style||{},r={};return lR(r,i,n),Object.assign(r,ZV(n,e,t)),n.transformValues?n.transformValues(r):r}function $V(n,e,t){const i={},r=qV(n,e,t);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=r,i}const e8=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function Xm(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||e8.has(n)}let uR=n=>!Xm(n);function t8(n){n&&(uR=e=>e.startsWith("on")?!Xm(e):n(e))}try{t8(require("@emotion/is-prop-valid").default)}catch{}function n8(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(uR(r)||t===!0&&Xm(r)||!e&&!Xm(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function db(n,e,t){return typeof n=="string"?n:it.transform(e+t*n)}function i8(n,e,t){const i=db(e,n.x,n.width),r=db(t,n.y,n.height);return`${i} ${r}`}const r8={offset:"stroke-dashoffset",array:"stroke-dasharray"},s8={offset:"strokeDashoffset",array:"strokeDasharray"};function o8(n,e,t=1,i=0,r=!0){n.pathLength=1;const s=r?r8:s8;n[s.offset]=it.transform(-i);const o=it.transform(e),a=it.transform(t);n[s.array]=`${o} ${a}`}function XA(n,{attrX:e,attrY:t,originX:i,originY:r,pathLength:s,pathSpacing:o=1,pathOffset:a=0,...l},f,h,d){if(jA(n,l,f,d),h){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:p,style:m,dimensions:v}=n;p.transform&&(v&&(m.transform=p.transform),delete p.transform),v&&(i!==void 0||r!==void 0||m.transform)&&(m.transformOrigin=i8(v,i!==void 0?i:.5,r!==void 0?r:.5)),e!==void 0&&(p.x=e),t!==void 0&&(p.y=t),s!==void 0&&o8(p,s,o,a,!1)}const cR=()=>({...JA(),attrs:{}}),KA=n=>typeof n=="string"&&n.toLowerCase()==="svg";function a8(n,e,t,i){const r=U.useMemo(()=>{const s=cR();return XA(s,e,{enableHardwareAcceleration:!1},KA(i),n.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(n.style){const s={};lR(s,n.style,n),r.style={...s,...r.style}}return r}function l8(n=!1){return(t,i,r,s,{latestValues:o},a)=>{const f=(WA(t)?a8:$V)(i,o,a,t),d={...n8(i,typeof t=="string",n),...f,ref:s},{children:p}=i,m=U.useMemo(()=>bi(p)?p.get():p,[p]);return r&&(d["data-projection-id"]=r),U.createElement(t,{...d,children:m})}}const YA=n=>n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function fR(n,{style:e,vars:t},i,r){Object.assign(n.style,e,r&&r.getProjectionStyles(i));for(const s in t)n.style.setProperty(s,t[s])}const hR=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function dR(n,e,t,i){fR(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(hR.has(r)?r:YA(r),e.attrs[r])}function QA(n,e){const{style:t}=n,i={};for(const r in t)(bi(t[r])||e.style&&bi(e.style[r])||rR(r,n))&&(i[r]=t[r]);return i}function pR(n,e){const t=QA(n,e);for(const i in n)if(bi(n[i])||bi(e[i])){const r=i==="x"||i==="y"?"attr"+i.toUpperCase():i;t[r]=n[i]}return t}function ZA(n,e,t,i={},r={}){return typeof e=="function"&&(e=e(t!==void 0?t:n.custom,i,r)),typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"&&(e=e(t!==void 0?t:n.custom,i,r)),e}const Km=n=>Array.isArray(n),u8=n=>Boolean(n&&typeof n=="object"&&n.mix&&n.toValue),c8=n=>Km(n)?n[n.length-1]||0:n;function dm(n){const e=bi(n)?n.get():n;return u8(e)?e.toValue():e}function f8({scrapeMotionValuesFromProps:n,createRenderState:e,onMount:t},i,r,s){const o={latestValues:h8(i,r,s,n),renderState:e()};return t&&(o.mount=a=>t(i,a,o)),o}const mR=n=>(e,t)=>{const i=U.useContext(zg),r=U.useContext(GA),s=()=>f8(n,e,i,r);return t?s():tR(s)};function h8(n,e,t,i){const r={},s=i(n,{});for(const p in s)r[p]=dm(s[p]);let{initial:o,animate:a}=n;const l=Vg(n),f=eR(n);e&&f&&!l&&n.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let h=t?t.initial===!1:!1;h=h||o===!1;const d=h?a:o;return d&&typeof d!="boolean"&&!Hg(d)&&(Array.isArray(d)?d:[d]).forEach(m=>{const v=ZA(n,m);if(!v)return;const{transitionEnd:y,transition:x,..._}=v;for(const A in _){let w=_[A];if(Array.isArray(w)){const S=h?w.length-1:0;w=w[S]}w!==null&&(r[A]=w)}for(const A in y)r[A]=y[A]}),r}const d8={useVisualState:mR({scrapeMotionValuesFromProps:pR,createRenderState:cR,onMount:(n,e,{renderState:t,latestValues:i})=>{try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}XA(t,i,{enableHardwareAcceleration:!1},KA(e.tagName),n.transformTemplate),dR(e,t)}})},p8={useVisualState:mR({scrapeMotionValuesFromProps:QA,createRenderState:JA})};function m8(n,{forwardMotionProps:e=!1},t,i){return{...WA(n)?d8:p8,preloadedFeatures:t,useRender:l8(e),createVisualElement:i,Component:n}}function Is(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}const gR=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function jg(n,e="page"){return{point:{x:n[e+"X"],y:n[e+"Y"]}}}const g8=n=>e=>gR(e)&&n(e,jg(e));function Ns(n,e,t,i){return Is(n,e,g8(t),i)}const y8=(n,e)=>t=>e(n(t)),Fo=(...n)=>n.reduce(y8);function yR(n){let e=null;return()=>{const t=()=>{e=null};return e===null?(e=n,t):!1}}const pb=yR("dragHorizontal"),mb=yR("dragVertical");function vR(n){let e=!1;if(n==="y")e=mb();else if(n==="x")e=pb();else{const t=pb(),i=mb();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function xR(){const n=vR(!0);return n?(n(),!1):!0}class $o{constructor(e){this.isMounted=!1,this.node=e}update(){}}function gb(n,e){const t="pointer"+(e?"enter":"leave"),i="onHover"+(e?"Start":"End"),r=(s,o)=>{if(s.type==="touch"||xR())return;const a=n.getProps();n.animationState&&a.whileHover&&n.animationState.setActive("whileHover",e),a[i]&&a[i](s,o)};return Ns(n.current,t,r,{passive:!n.getProps()[i]})}class v8 extends $o{mount(){this.unmount=Fo(gb(this.node,!0),gb(this.node,!1))}unmount(){}}class x8 extends $o{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Fo(Is(this.node.current,"focus",()=>this.onFocus()),Is(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const _R=(n,e)=>e?n===e?!0:_R(n,e.parentElement):!1,dr=n=>n;function Av(n,e){if(!e)return;const t=new PointerEvent("pointer"+n);e(t,jg(t))}class _8 extends $o{constructor(){super(...arguments),this.removeStartListeners=dr,this.removeEndListeners=dr,this.removeAccessibleListeners=dr,this.startPointerPress=(e,t)=>{if(this.removeEndListeners(),this.isPressing)return;const i=this.node.getProps(),s=Ns(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:f,onTapCancel:h}=this.node.getProps();_R(this.node.current,a.target)?f&&f(a,l):h&&h(a,l)},{passive:!(i.onTap||i.onPointerUp)}),o=Ns(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Fo(s,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Av("up",this.node.getProps().onTap)};this.removeEndListeners(),this.removeEndListeners=Is(this.node.current,"keyup",o),Av("down",(a,l)=>{this.startPress(a,l)})},t=Is(this.node.current,"keydown",e),i=()=>{this.isPressing&&Av("cancel",(s,o)=>this.cancelPress(s,o))},r=Is(this.node.current,"blur",i);this.removeAccessibleListeners=Fo(t,r)}}startPress(e,t){this.isPressing=!0;const{onTapStart:i,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&i(e,t)}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!xR()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&i(e,t)}mount(){const e=this.node.getProps(),t=Ns(this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),i=Is(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Fo(t,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const b1=new WeakMap,Mv=new WeakMap,A8=n=>{const e=b1.get(n.target);e&&e(n)},M8=n=>{n.forEach(A8)};function w8({root:n,...e}){const t=n||document;Mv.has(t)||Mv.set(t,{});const i=Mv.get(t),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(M8,{root:n,...e})),i[r]}function S8(n,e,t){const i=w8(e);return b1.set(n,t),i.observe(n),()=>{b1.delete(n),i.unobserve(n)}}const C8={some:0,all:1};class E8 extends $o{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}viewportFallback(){requestAnimationFrame(()=>{this.hasEnteredView=!0;const{onViewportEnter:e}=this.node.getProps();e&&e(null),this.node.animationState&&this.node.animationState.setActive("whileInView",!0)})}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:s,fallback:o=!0}=e;if(typeof IntersectionObserver>"u"){o&&this.viewportFallback();return}const a={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:C8[r]},l=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,s&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:d,onViewportLeave:p}=this.node.getProps(),m=h?d:p;m&&m(f)};return S8(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(b8(e,t))&&this.startObserver()}unmount(){}}function b8({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const T8={inView:{Feature:E8},tap:{Feature:_8},focus:{Feature:x8},hover:{Feature:v8}};function AR(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;i<t;i++)if(e[i]!==n[i])return!1;return!0}const P8=n=>/^\-?\d*\.?\d+$/.test(n),B8=n=>/^0[^.\s]+$/.test(n),ks={delta:0,timestamp:0},MR=1/60*1e3,R8=typeof performance<"u"?()=>performance.now():()=>Date.now(),wR=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(R8()),MR);function L8(n){let e=[],t=[],i=0,r=!1,s=!1;const o=new WeakSet,a={schedule:(l,f=!1,h=!1)=>{const d=h&&r,p=d?e:t;return f&&o.add(l),p.indexOf(l)===-1&&(p.push(l),d&&r&&(i=e.length)),l},cancel:l=>{const f=t.indexOf(l);f!==-1&&t.splice(f,1),o.delete(l)},process:l=>{if(r){s=!0;return}if(r=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let f=0;f<i;f++){const h=e[f];h(l),o.has(h)&&(a.schedule(h),n())}r=!1,s&&(s=!1,a.process(l))}};return a}const I8=40;let T1=!0,sh=!1,P1=!1;const kh=["read","update","preRender","render","postRender"],Jg=kh.reduce((n,e)=>(n[e]=L8(()=>sh=!0),n),{}),fi=kh.reduce((n,e)=>{const t=Jg[e];return n[e]=(i,r=!1,s=!1)=>(sh||F8(),t.schedule(i,r,s)),n},{}),Vo=kh.reduce((n,e)=>(n[e]=Jg[e].cancel,n),{}),wv=kh.reduce((n,e)=>(n[e]=()=>Jg[e].process(ks),n),{}),D8=n=>Jg[n].process(ks),SR=n=>{sh=!1,ks.delta=T1?MR:Math.max(Math.min(n-ks.timestamp,I8),1),ks.timestamp=n,P1=!0,kh.forEach(D8),P1=!1,sh&&(T1=!1,wR(SR))},F8=()=>{sh=!0,T1=!0,P1||wR(SR)};function qA(n,e){n.indexOf(e)===-1&&n.push(e)}function $A(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class eM{constructor(){this.subscriptions=[]}add(e){return qA(this.subscriptions,e),()=>$A(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let s=0;s<r;s++){const o=this.subscriptions[s];o&&o(e,t,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function tM(n,e){return e?n*(1e3/e):0}const N8=n=>!isNaN(parseFloat(n));class k8{constructor(e,t={}){this.version="9.1.7",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,r=!0)=>{this.prev=this.current,this.current=i;const{delta:s,timestamp:o}=ks;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,fi.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>fi.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=N8(this.current),this.owner=t.owner}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new eM);const i=this.events[e].add(t);return e==="change"?()=>{i(),fi.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,i){this.set(t),this.prev=e,this.timeDelta=i}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?tM(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t)||null,this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zu(n,e){return new k8(n,e)}const nM=(n,e)=>t=>Boolean(Fh(t)&&KV.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),CR=(n,e,t)=>i=>{if(!Fh(i))return i;const[r,s,o,a]=i.match(rh);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},O8=n=>Uu(0,255,n),Sv={...hl,transform:n=>Math.round(O8(n))},Ua={test:nM("rgb","red"),parse:CR("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+Sv.transform(n)+", "+Sv.transform(e)+", "+Sv.transform(t)+", "+vf(yf.transform(i))+")"};function U8(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const B1={test:nM("#"),parse:U8,transform:Ua.transform},fu={test:nM("hsl","hue"),parse:CR("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+ns.transform(vf(e))+", "+ns.transform(vf(t))+", "+vf(yf.transform(i))+")"},ai={test:n=>Ua.test(n)||B1.test(n)||fu.test(n),parse:n=>Ua.test(n)?Ua.parse(n):fu.test(n)?fu.parse(n):B1.parse(n),transform:n=>Fh(n)?n:n.hasOwnProperty("red")?Ua.transform(n):fu.transform(n)},ER="${c}",bR="${n}";function z8(n){var e,t;return isNaN(n)&&Fh(n)&&(((e=n.match(rh))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(E1))===null||t===void 0?void 0:t.length)||0)>0}function Ym(n){typeof n=="number"&&(n=`${n}`);const e=[];let t=0,i=0;const r=n.match(E1);r&&(t=r.length,n=n.replace(E1,ER),e.push(...r.map(ai.parse)));const s=n.match(rh);return s&&(i=s.length,n=n.replace(rh,bR),e.push(...s.map(hl.parse))),{values:e,numColors:t,numNumbers:i,tokenised:n}}function TR(n){return Ym(n).values}function PR(n){const{values:e,numColors:t,tokenised:i}=Ym(n),r=e.length;return s=>{let o=i;for(let a=0;a<r;a++)o=o.replace(a<t?ER:bR,a<t?ai.transform(s[a]):vf(s[a]));return o}}const G8=n=>typeof n=="number"?0:n;function H8(n){const e=TR(n);return PR(n)(e.map(G8))}const Wo={test:z8,parse:TR,createTransformer:PR,getAnimatableNone:H8},V8=new Set(["brightness","contrast","saturate","opacity"]);function W8(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(rh)||[];if(!i)return n;const r=t.replace(i,"");let s=V8.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const j8=/([a-z-]*)\(.*?\)/g,R1={...Wo,getAnimatableNone:n=>{const e=n.match(j8);return e?e.map(W8).join(" "):n}},J8={...aR,color:ai,backgroundColor:ai,outlineColor:ai,fill:ai,stroke:ai,borderColor:ai,borderTopColor:ai,borderRightColor:ai,borderBottomColor:ai,borderLeftColor:ai,filter:R1,WebkitFilter:R1},iM=n=>J8[n];function rM(n,e){let t=iM(n);return t!==R1&&(t=Wo),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const BR=n=>e=>e.test(n),X8={test:n=>n==="auto",parse:n=>n},RR=[hl,it,ns,ho,QV,YV,X8],Xc=n=>RR.find(BR(n)),K8=[...RR,ai,Wo],Y8=n=>K8.find(BR(n));function Q8(n){const e={};return n.values.forEach((t,i)=>e[i]=t.get()),e}function Z8(n){const e={};return n.values.forEach((t,i)=>e[i]=t.getVelocity()),e}function Xg(n,e,t){const i=n.getProps();return ZA(i,e,t!==void 0?t:i.custom,Q8(n),Z8(n))}function q8(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,zu(t))}function $8(n,e){const t=Xg(n,e);let{transitionEnd:i={},transition:r={},...s}=t?n.makeTargetAnimatable(t,!1):{};s={...s,...i};for(const o in s){const a=c8(s[o]);q8(n,o,a)}}function e6(n,e,t){var i,r;const s=Object.keys(e).filter(a=>!n.hasValue(a)),o=s.length;if(o)for(let a=0;a<o;a++){const l=s[a],f=e[l];let h=null;Array.isArray(f)&&(h=f[0]),h===null&&(h=(r=(i=t[l])!==null&&i!==void 0?i:n.readValue(l))!==null&&r!==void 0?r:e[l]),h!=null&&(typeof h=="string"&&(P8(h)||B8(h))?h=parseFloat(h):!Y8(h)&&Wo.test(f)&&(h=rM(l,f)),n.addValue(l,zu(h,{owner:n})),t[l]===void 0&&(t[l]=h),h!==null&&n.setBaseTarget(l,h))}}function t6(n,e){return e?(e[n]||e.default||e).from:void 0}function n6(n,e,t){const i={};for(const r in n){const s=t6(r,e);if(s!==void 0)i[r]=s;else{const o=t.getValue(r);o&&(i[r]=o.get())}}return i}function Qm(n){return Boolean(bi(n)&&n.add)}const i6="framerAppearId",r6="data-"+YA(i6);let s6=dr,Zm=dr;const pm=n=>n*1e3,o6={current:!1},sM=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,oM=n=>e=>1-n(1-e),aM=n=>n*n,a6=oM(aM),lM=sM(aM),nn=(n,e,t)=>-t*n+t*e+n;function Cv(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function l6({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,o=0;if(!e)r=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=Cv(l,a,n+1/3),s=Cv(l,a,n),o=Cv(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}const Ev=(n,e,t)=>{const i=n*n;return Math.sqrt(Math.max(0,t*(e*e-i)+i))},u6=[B1,Ua,fu],c6=n=>u6.find(e=>e.test(n));function yb(n){const e=c6(n);let t=e.parse(n);return e===fu&&(t=l6(t)),t}const LR=(n,e)=>{const t=yb(n),i=yb(e),r={...t};return s=>(r.red=Ev(t.red,i.red,s),r.green=Ev(t.green,i.green,s),r.blue=Ev(t.blue,i.blue,s),r.alpha=nn(t.alpha,i.alpha,s),Ua.transform(r))};function IR(n,e){return typeof n=="number"?t=>nn(n,e,t):ai.test(n)?LR(n,e):FR(n,e)}const DR=(n,e)=>{const t=[...n],i=t.length,r=n.map((s,o)=>IR(s,e[o]));return s=>{for(let o=0;o<i;o++)t[o]=r[o](s);return t}},f6=(n,e)=>{const t={...n,...e},i={};for(const r in t)n[r]!==void 0&&e[r]!==void 0&&(i[r]=IR(n[r],e[r]));return r=>{for(const s in i)t[s]=i[s](r);return t}},FR=(n,e)=>{const t=Wo.createTransformer(e),i=Ym(n),r=Ym(e);return i.numColors===r.numColors&&i.numNumbers>=r.numNumbers?Fo(DR(i.values,r.values),t):o=>`${o>0?e:n}`},oh=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},vb=(n,e)=>t=>nn(n,e,t);function h6(n){return typeof n=="number"?vb:typeof n=="string"?ai.test(n)?LR:FR:Array.isArray(n)?DR:typeof n=="object"?f6:vb}function d6(n,e,t){const i=[],r=t||h6(n[0]),s=n.length-1;for(let o=0;o<s;o++){let a=r(n[o],n[o+1]);if(e){const l=Array.isArray(e)?e[o]:e;a=Fo(l,a)}i.push(a)}return i}function NR(n,e,{clamp:t=!0,ease:i,mixer:r}={}){const s=n.length;Zm(s===e.length),Zm(!i||!Array.isArray(i)||i.length===s-1),n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const o=d6(e,i,r),a=o.length,l=f=>{let h=0;if(a>1)for(;h<n.length-2&&!(f<n[h+1]);h++);const d=oh(n[h],n[h+1],f);return o[h](d)};return t?f=>l(Uu(n[0],n[s-1],f)):l}function p6(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=oh(0,e,i);n.push(nn(t,1,r))}}function m6(n){const e=[0];return p6(e,n.length-1),e}function g6(n,e){return n.map(t=>t*e)}const kR=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,y6=1e-7,v6=12;function x6(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=kR(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>y6&&++a<v6);return o}function OR(n,e,t,i){if(n===e&&t===i)return dr;const r=s=>x6(s,0,1,n,t);return s=>s===0||s===1?s:kR(r(s),e,i)}const UR=n=>1-Math.sin(Math.acos(n)),uM=oM(UR),_6=sM(uM),zR=OR(.33,1.53,.69,.99),cM=oM(zR),A6=sM(cM),M6=n=>(n*=2)<1?.5*cM(n):.5*(2-Math.pow(2,-10*(n-1))),w6={linear:dr,easeIn:aM,easeInOut:lM,easeOut:a6,circIn:UR,circInOut:_6,circOut:uM,backIn:cM,backInOut:A6,backOut:zR,anticipate:M6},xb=n=>{if(Array.isArray(n)){Zm(n.length===4);const[e,t,i,r]=n;return OR(e,t,i,r)}else if(typeof n=="string")return w6[n];return n},S6=n=>Array.isArray(n)&&typeof n[0]!="number";function C6(n,e){return n.map(()=>e||lM).splice(0,n.length-1)}function L1({keyframes:n,ease:e=lM,times:t,duration:i=300}){n=[...n];const r=S6(e)?e.map(xb):xb(e),s={done:!1,value:n[0]},o=g6(t&&t.length===n.length?t:m6(n),i);function a(){return NR(o,n,{ease:Array.isArray(r)?r:C6(n,r)})}let l=a();return{next:f=>(s.value=l(f),s.done=f>=i,s),flipTarget:()=>{n.reverse(),l=a()}}}const bv=.001,E6=.01,_b=10,b6=.05,T6=1;function P6({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let r,s;s6(n<=_b*1e3);let o=1-e;o=Uu(b6,T6,o),n=Uu(E6,_b,n/1e3),o<1?(r=f=>{const h=f*o,d=h*n,p=h-t,m=I1(f,o),v=Math.exp(-d);return bv-p/m*v},s=f=>{const d=f*o*n,p=d*t+t,m=Math.pow(o,2)*Math.pow(f,2)*n,v=Math.exp(-d),y=I1(Math.pow(f,2),o);return(-r(f)+bv>0?-1:1)*((p-m)*v)/y}):(r=f=>{const h=Math.exp(-f*n),d=(f-t)*n+1;return-bv+h*d},s=f=>{const h=Math.exp(-f*n),d=(t-f)*(n*n);return h*d});const a=5/n,l=R6(r,s,a);if(n=n*1e3,isNaN(l))return{stiffness:100,damping:10,duration:n};{const f=Math.pow(l,2)*i;return{stiffness:f,damping:o*2*Math.sqrt(i*f),duration:n}}}const B6=12;function R6(n,e,t){let i=t;for(let r=1;r<B6;r++)i=i-n(i)/e(i);return i}function I1(n,e){return n*Math.sqrt(1-e*e)}const L6=["duration","bounce"],I6=["stiffness","damping","mass"];function Ab(n,e){return e.some(t=>n[t]!==void 0)}function D6(n){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...n};if(!Ab(n,I6)&&Ab(n,L6)){const t=P6(n);e={...e,...t,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}const F6=5;function GR({keyframes:n,restDelta:e,restSpeed:t,...i}){let r=n[0],s=n[n.length-1];const o={done:!1,value:r},{stiffness:a,damping:l,mass:f,velocity:h,duration:d,isResolvedFromDuration:p}=D6(i);let m=N6,v=h?-(h/1e3):0;const y=l/(2*Math.sqrt(a*f));function x(){const _=s-r,A=Math.sqrt(a/f)/1e3,w=Math.abs(_)<5;if(t||(t=w?.01:2),e||(e=w?.005:.5),y<1){const S=I1(A,y);m=b=>{const P=Math.exp(-y*A*b);return s-P*((v+y*A*_)/S*Math.sin(S*b)+_*Math.cos(S*b))}}else if(y===1)m=S=>s-Math.exp(-A*S)*(_+(v+A*_)*S);else{const S=A*Math.sqrt(y*y-1);m=b=>{const P=Math.exp(-y*A*b),R=Math.min(S*b,300);return s-P*((v+y*A*_)*Math.sinh(R)+S*_*Math.cosh(R))/S}}}return x(),{next:_=>{const A=m(_);if(p)o.done=_>=d;else{let w=v;if(_!==0)if(y<1){const P=Math.max(0,_-F6);w=tM(A-m(P),_-P)}else w=0;const S=Math.abs(w)<=t,b=Math.abs(s-A)<=e;o.done=S&&b}return o.value=o.done?s:A,o},flipTarget:()=>{v=-v,[r,s]=[s,r],x()}}}GR.needsInterpolation=(n,e)=>typeof n=="string"||typeof e=="string";const N6=n=>0;function k6({keyframes:n=[0],velocity:e=0,power:t=.8,timeConstant:i=350,restDelta:r=.5,modifyTarget:s}){const o=n[0],a={done:!1,value:o};let l=t*e;const f=o+l,h=s===void 0?f:s(f);return h!==f&&(l=h-o),{next:d=>{const p=-l*Math.exp(-d/i);return a.done=!(p>r||p<-r),a.value=a.done?h:h+p,a},flipTarget:()=>{}}}const O6={decay:k6,keyframes:L1,tween:L1,spring:GR};function HR(n,e,t=0){return n-e-t}function U6(n,e=0,t=0,i=!0){return i?HR(e+-n,e,t):e-(n-e)+t}function z6(n,e,t,i){return i?n>=e+t:n<=-t}const G6=n=>{const e=({delta:t})=>n(t);return{start:()=>fi.update(e,!0),stop:()=>Vo.update(e)}};function qm({duration:n,driver:e=G6,elapsed:t=0,repeat:i=0,repeatType:r="loop",repeatDelay:s=0,keyframes:o,autoplay:a=!0,onPlay:l,onStop:f,onComplete:h,onRepeat:d,onUpdate:p,type:m="keyframes",...v}){const y=t;let x,_=0,A=n,w=!1,S=!0,b;const P=O6[o.length>2?"keyframes":m]||L1,R=o[0],E=o[o.length-1];let B={done:!1,value:R};const{needsInterpolation:L}=P;L&&L(R,E)&&(b=NR([0,100],[R,E],{clamp:!1}),o=[0,100]);const z=P({...v,duration:n,keyframes:o});function Z(){_++,r==="reverse"?(S=_%2===0,t=U6(t,A,s,S)):(t=HR(t,A,s),r==="mirror"&&z.flipTarget()),w=!1,d&&d()}function J(){x&&x.stop(),h&&h()}function H(te){S||(te=-te),t+=te,w||(B=z.next(Math.max(0,t)),b&&(B.value=b(B.value)),w=S?B.done:t<=0),p&&p(B.value),w&&(_===0&&(A=A!==void 0?A:t),_<i?z6(t,A,s,S)&&Z():J())}function Y(){l&&l(),x=e(H),x.start()}return a&&Y(),{stop:()=>{f&&f(),x&&x.stop()},set currentTime(te){t=y,H(te)},sample:te=>{t=y;const le=n&&typeof n=="number"?Math.max(n*.5,50):50;let N=0;for(H(0);N<=te;){const V=te-N;H(Math.min(V,le)),N+=le}return B}}}function H6(n){return!n||Array.isArray(n)||typeof n=="string"&&VR[n]}const tf=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,VR={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tf([0,.65,.55,1]),circOut:tf([.55,0,1,.45]),backIn:tf([.31,.01,.66,-.59]),backOut:tf([.33,1.53,.69,.99])};function V6(n){if(n)return Array.isArray(n)?tf(n):VR[n]}function W6(n,e,t,{delay:i=0,duration:r,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){return n.animate({[e]:t,offset:l},{delay:i,duration:r,easing:V6(a),fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const Mb={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},Tv={},WR={};for(const n in Mb)WR[n]=()=>(Tv[n]===void 0&&(Tv[n]=Mb[n]()),Tv[n]);function j6(n,{repeat:e,repeatType:t="loop"}){const i=e&&t!=="loop"&&e%2===1?0:n.length-1;return n[i]}const J6=new Set(["opacity","clipPath","filter","transform"]),Hp=10;function X6(n,e,{onUpdate:t,onComplete:i,...r}){if(!(WR.waapi()&&J6.has(e)&&!r.repeatDelay&&r.repeatType!=="mirror"&&r.damping!==0))return!1;let{keyframes:o,duration:a=300,elapsed:l=0,ease:f}=r;if(r.type==="spring"||!H6(r.ease)){if(r.repeat===1/0)return;const d=qm({...r,elapsed:0});let p={done:!1,value:o[0]};const m=[];let v=0;for(;!p.done&&v<2e4;)p=d.sample(v),m.push(p.value),v+=Hp;o=m,a=v-Hp,f="linear"}const h=W6(n.owner.current,e,o,{...r,delay:-l,duration:a,ease:f});return h.onfinish=()=>{n.set(j6(o,r)),fi.update(()=>h.cancel()),i&&i()},{get currentTime(){return h.currentTime||0},set currentTime(d){h.currentTime=d},stop:()=>{const{currentTime:d}=h;if(d){const p=qm({...r,autoplay:!1});n.setWithVelocity(p.sample(d-Hp).value,p.sample(d).value,Hp)}fi.update(()=>h.cancel())}}}function jR(n,e){const t=performance.now(),i=({timestamp:r})=>{const s=r-t;s>=e&&(Vo.read(i),n(s-e))};return fi.read(i,!0),()=>Vo.read(i)}function K6({keyframes:n,elapsed:e,onUpdate:t,onComplete:i}){const r=()=>{t&&t(n[n.length-1]),i&&i()};return e?{stop:jR(r,-e)}:r()}function Y6({keyframes:n,velocity:e=0,min:t,max:i,power:r=.8,timeConstant:s=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:f,driver:h,onUpdate:d,onComplete:p,onStop:m}){const v=n[0];let y;function x(S){return t!==void 0&&S<t||i!==void 0&&S>i}function _(S){return t===void 0?i:i===void 0||Math.abs(t-S)<Math.abs(i-S)?t:i}function A(S){y&&y.stop(),y=qm({keyframes:[0,1],velocity:0,...S,driver:h,onUpdate:b=>{d&&d(b),S.onUpdate&&S.onUpdate(b)},onComplete:p,onStop:m})}function w(S){A({type:"spring",stiffness:o,damping:a,restDelta:l,...S})}if(x(v))w({velocity:e,keyframes:[v,_(v)]});else{let S=r*e+v;typeof f<"u"&&(S=f(S));const b=_(S),P=b===t?-1:1;let R,E;const B=L=>{R=E,E=L,e=tM(L-R,ks.delta),(P===1&&L>b||P===-1&&L<b)&&w({keyframes:[L,b],velocity:e})};A({type:"decay",keyframes:[v,0],velocity:e,timeConstant:s,power:r,restDelta:l,modifyTarget:f,onUpdate:x(S)?B:void 0})}return{stop:()=>y&&y.stop()}}const Q6={type:"spring",stiffness:500,damping:25,restSpeed:10},Z6=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),q6={type:"keyframes",duration:.8},$6={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},eW=(n,{keyframes:e})=>e.length>2?q6:fl.has(n)?n.startsWith("scale")?Z6(e[1]):Q6:$6,D1=(n,e)=>n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&Wo.test(e)&&!e.startsWith("url("));function tW({when:n,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:f,...h}){return!!Object.keys(h).length}function wb(n){return n===0||typeof n=="string"&&parseFloat(n)===0&&n.indexOf(" ")===-1}function Sb(n){return typeof n=="number"?0:rM("",n)}function JR(n,e){return n[e]||n.default||n}function nW(n,e,t,i){const r=D1(e,t);let s=i.from!==void 0?i.from:n.get();return s==="none"&&r&&typeof t=="string"?s=rM(e,t):wb(s)&&typeof t=="string"?s=Sb(t):!Array.isArray(t)&&wb(t)&&typeof s=="string"&&(t=Sb(s)),Array.isArray(t)?(t[0]===null&&(t[0]=s),t):[s,t]}const fM=(n,e,t,i={})=>r=>{const s=JR(i,n)||{},o=s.delay||i.delay||0;let{elapsed:a=0}=i;a=a-pm(o);const l=nW(e,n,t,s),f=l[0],h=l[l.length-1],d=D1(n,f),p=D1(n,h);let m={keyframes:l,velocity:e.getVelocity(),...s,elapsed:a,onUpdate:v=>{e.set(v),s.onUpdate&&s.onUpdate(v)},onComplete:()=>{r(),s.onComplete&&s.onComplete()}};if(!d||!p||o6.current||s.type===!1)return K6(m);if(s.type==="inertia")return Y6(m);if(tW(s)||(m={...m,...eW(n,m)}),m.duration&&(m.duration=pm(m.duration)),m.repeatDelay&&(m.repeatDelay=pm(m.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const v=X6(e,n,m);if(v)return v}return qm(m)};function iW(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>F1(n,s,t));i=Promise.all(r)}else if(typeof e=="string")i=F1(n,e,t);else{const r=typeof e=="function"?Xg(n,e,t.custom):e;i=XR(n,r,t)}return i.then(()=>n.notify("AnimationComplete",e))}function F1(n,e,t={}){const i=Xg(n,e,t.custom);let{transition:r=n.getDefaultTransition()||{}}=i||{};t.transitionOverride&&(r=t.transitionOverride);const s=i?()=>XR(n,i,t):()=>Promise.resolve(),o=n.variantChildren&&n.variantChildren.size?(l=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:d}=r;return rW(n,e,f+l,h,d,t)}:()=>Promise.resolve(),{when:a}=r;if(a){const[l,f]=a==="beforeChildren"?[s,o]:[o,s];return l().then(f)}else return Promise.all([s(),o(t.delay)])}function XR(n,e,{delay:t=0,transitionOverride:i,type:r}={}){let{transition:s=n.getDefaultTransition(),transitionEnd:o,...a}=n.makeTargetAnimatable(e);const l=n.getValue("willChange");i&&(s=i);const f=[],h=r&&n.animationState&&n.animationState.getState()[r];for(const d in a){const p=n.getValue(d),m=a[d];if(!p||m===void 0||h&&oW(h,d))continue;const v={delay:t,elapsed:0,...s};if(window.HandoffAppearAnimations&&!p.hasAnimated){const x=n.getProps()[r6];x&&(v.elapsed=window.HandoffAppearAnimations(x,d,p,fi))}let y=p.start(fM(d,p,m,n.shouldReduceMotion&&fl.has(d)?{type:!1}:v));Qm(l)&&(l.add(d),y=y.then(()=>l.remove(d))),f.push(y)}return Promise.all(f).then(()=>{o&&$8(n,o)})}function rW(n,e,t=0,i=0,r=1,s){const o=[],a=(n.variantChildren.size-1)*i,l=r===1?(f=0)=>f*i:(f=0)=>a-f*i;return Array.from(n.variantChildren).sort(sW).forEach((f,h)=>{f.notify("AnimationStart",e),o.push(F1(f,e,{...s,delay:t+l(h)}).then(()=>f.notify("AnimationComplete",e)))}),Promise.all(o)}function sW(n,e){return n.sortNodePosition(e)}function oW({protectedKeys:n,needsAnimating:e},t){const i=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,i}const aW=[...HA].reverse(),lW=HA.length;function uW(n){return e=>Promise.all(e.map(({animation:t,options:i})=>iW(n,t,i)))}function cW(n){let e=uW(n);const t=hW();let i=!0;const r=(l,f)=>{const h=Xg(n,f);if(h){const{transition:d,transitionEnd:p,...m}=h;l={...l,...m,...p}}return l};function s(l){e=l(n)}function o(l,f){const h=n.getProps(),d=n.getVariantContext(!0)||{},p=[],m=new Set;let v={},y=1/0;for(let _=0;_<lW;_++){const A=aW[_],w=t[A],S=h[A]!==void 0?h[A]:d[A],b=nh(S),P=A===f?w.isActive:null;P===!1&&(y=_);let R=S===d[A]&&S!==h[A]&&b;if(R&&i&&n.manuallyAnimateOnMount&&(R=!1),w.protectedKeys={...v},!w.isActive&&P===null||!S&&!w.prevProp||Hg(S)||typeof S=="boolean")continue;const E=fW(w.prevProp,S);let B=E||A===f&&w.isActive&&!R&&b||_>y&&b;const L=Array.isArray(S)?S:[S];let z=L.reduce(r,{});P===!1&&(z={});const{prevResolvedValues:Z={}}=w,J={...Z,...z},H=Y=>{B=!0,m.delete(Y),w.needsAnimating[Y]=!0};for(const Y in J){const te=z[Y],le=Z[Y];v.hasOwnProperty(Y)||(te!==le?Km(te)&&Km(le)?!AR(te,le)||E?H(Y):w.protectedKeys[Y]=!0:te!==void 0?H(Y):m.add(Y):te!==void 0&&m.has(Y)?H(Y):w.protectedKeys[Y]=!0)}w.prevProp=S,w.prevResolvedValues=z,w.isActive&&(v={...v,...z}),i&&n.blockInitialAnimation&&(B=!1),B&&!R&&p.push(...L.map(Y=>({animation:Y,options:{type:A,...l}})))}if(m.size){const _={};m.forEach(A=>{const w=n.getBaseTarget(A);w!==void 0&&(_[A]=w)}),p.push({animation:_})}let x=Boolean(p.length);return i&&h.initial===!1&&!n.manuallyAnimateOnMount&&(x=!1),i=!1,x?e(p):Promise.resolve()}function a(l,f,h){var d;if(t[l].isActive===f)return Promise.resolve();(d=n.variantChildren)===null||d===void 0||d.forEach(m=>{var v;return(v=m.animationState)===null||v===void 0?void 0:v.setActive(l,f)}),t[l].isActive=f;const p=o(h,l);for(const m in t)t[m].protectedKeys={};return p}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>t}}function fW(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!AR(e,n):!1}function xa(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hW(){return{animate:xa(!0),whileInView:xa(),whileHover:xa(),whileTap:xa(),whileDrag:xa(),whileFocus:xa(),exit:xa()}}class dW extends $o{constructor(e){super(e),e.animationState||(e.animationState=cW(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),Hg(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}let pW=0;class mW extends $o{constructor(){super(...arguments),this.id=pW++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t,custom:i}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e,{custom:i??this.node.getProps().custom});t&&!e&&s.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const gW={animation:{Feature:dW},exit:{Feature:mW}},Cb=(n,e)=>Math.abs(n-e);function yW(n,e){const t=Cb(n.x,e.x),i=Cb(n.y,e.y);return Math.sqrt(t**2+i**2)}class KR{constructor(e,t,{transformPagePoint:i}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Bv(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,d=yW(f.offset,{x:0,y:0})>=3;if(!h&&!d)return;const{point:p}=f,{timestamp:m}=ks;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Pv(h,this.transformPagePoint),fi.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:d,onSessionEnd:p}=this.handlers,m=Bv(f.type==="pointercancel"?this.lastMoveEventInfo:Pv(h,this.transformPagePoint),this.history);this.startEvent&&d&&d(f,m),p&&p(f,m)},!gR(e))return;this.handlers=t,this.transformPagePoint=i;const r=jg(e),s=Pv(r,this.transformPagePoint),{point:o}=s,{timestamp:a}=ks;this.history=[{...o,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,Bv(s,this.history)),this.removeListeners=Fo(Ns(window,"pointermove",this.handlePointerMove),Ns(window,"pointerup",this.handlePointerUp),Ns(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Vo.update(this.updatePoint)}}function Pv(n,e){return e?{point:e(n.point)}:n}function Eb(n,e){return{x:n.x-e.x,y:n.y-e.y}}function Bv({point:n},e){return{point:n,delta:Eb(n,YR(e)),offset:Eb(n,vW(e)),velocity:xW(e,.1)}}function vW(n){return n[0]}function YR(n){return n[n.length-1]}function xW(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=YR(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>pm(e)));)t--;if(!i)return{x:0,y:0};const s=(r.timestamp-i.timestamp)/1e3;if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Hi(n){return n.max-n.min}function N1(n,e=0,t=.01){return Math.abs(n-e)<=t}function bb(n,e,t,i=.5){n.origin=i,n.originPoint=nn(e.min,e.max,n.origin),n.scale=Hi(t)/Hi(e),(N1(n.scale,1,1e-4)||isNaN(n.scale))&&(n.scale=1),n.translate=nn(t.min,t.max,n.origin)-n.originPoint,(N1(n.translate)||isNaN(n.translate))&&(n.translate=0)}function xf(n,e,t,i){bb(n.x,e.x,t.x,i?i.originX:void 0),bb(n.y,e.y,t.y,i?i.originY:void 0)}function Tb(n,e,t){n.min=t.min+e.min,n.max=n.min+Hi(e)}function _W(n,e,t){Tb(n.x,e.x,t.x),Tb(n.y,e.y,t.y)}function Pb(n,e,t){n.min=e.min-t.min,n.max=n.min+Hi(e)}function _f(n,e,t){Pb(n.x,e.x,t.x),Pb(n.y,e.y,t.y)}function AW(n,{min:e,max:t},i){return e!==void 0&&n<e?n=i?nn(e,n,i.min):Math.max(n,e):t!==void 0&&n>t&&(n=i?nn(t,n,i.max):Math.min(n,t)),n}function Bb(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function MW(n,{top:e,left:t,bottom:i,right:r}){return{x:Bb(n.x,t,r),y:Bb(n.y,e,i)}}function Rb(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.min<n.max-n.min&&([t,i]=[i,t]),{min:t,max:i}}function wW(n,e){return{x:Rb(n.x,e.x),y:Rb(n.y,e.y)}}function SW(n,e){let t=.5;const i=Hi(n),r=Hi(e);return r>i?t=oh(e.min,e.max-i,n.min):i>r&&(t=oh(n.min,n.max-r,e.min)),Uu(0,1,t)}function CW(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const k1=.35;function EW(n=k1){return n===!1?n=0:n===!0&&(n=k1),{x:Lb(n,"left","right"),y:Lb(n,"top","bottom")}}function Lb(n,e,t){return{min:Ib(n,e),max:Ib(n,t)}}function Ib(n,e){return typeof n=="number"?n:n[e]||0}const Db=()=>({translate:0,scale:1,origin:0,originPoint:0}),Af=()=>({x:Db(),y:Db()}),Fb=()=>({min:0,max:0}),_n=()=>({x:Fb(),y:Fb()});function Qr(n){return[n("x"),n("y")]}function QR({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function bW({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function TW(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function Rv(n){return n===void 0||n===1}function O1({scale:n,scaleX:e,scaleY:t}){return!Rv(n)||!Rv(e)||!Rv(t)}function Ea(n){return O1(n)||ZR(n)||n.z||n.rotate||n.rotateX||n.rotateY}function ZR(n){return Nb(n.x)||Nb(n.y)}function Nb(n){return n&&n!=="0%"}function $m(n,e,t){const i=n-t,r=e*i;return t+r}function kb(n,e,t,i,r){return r!==void 0&&(n=$m(n,r,i)),$m(n,t,i)+e}function U1(n,e=0,t=1,i,r){n.min=kb(n.min,e,t,i,r),n.max=kb(n.max,e,t,i,r)}function qR(n,{x:e,y:t}){U1(n.x,e.translate,e.scale,e.originPoint),U1(n.y,t.translate,t.scale,t.originPoint)}function PW(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let s,o;for(let a=0;a<r;a++){s=t[a],o=s.projectionDelta;const l=s.instance;l&&l.style&&l.style.display==="contents"||(i&&s.options.layoutScroll&&s.scroll&&s!==s.root&&hu(n,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,qR(n,o)),i&&Ea(s.latestValues)&&hu(n,s.latestValues))}e.x=Ob(e.x),e.y=Ob(e.y)}function Ob(n){return Number.isInteger(n)||n>1.0000000000001||n<.999999999999?n:1}function yo(n,e){n.min=n.min+e,n.max=n.max+e}function Ub(n,e,[t,i,r]){const s=e[r]!==void 0?e[r]:.5,o=nn(n.min,n.max,s);U1(n,e[t],e[i],o,e.scale)}const BW=["x","scaleX","originX"],RW=["y","scaleY","originY"];function hu(n,e){Ub(n.x,e,BW),Ub(n.y,e,RW)}function $R(n,e){return QR(TW(n.getBoundingClientRect(),e))}function LW(n,e,t){const i=$R(n,t),{scroll:r}=e;return r&&(yo(i.x,r.offset.x),yo(i.y,r.offset.y)),i}const IW=new WeakMap;class DW{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_n(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=l=>{this.stopAnimation(),t&&this.snapToCursor(jg(l,"page").point)},s=(l,f)=>{const{drag:h,dragPropagation:d,onDragStart:p}=this.getProps();if(h&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=vR(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Qr(v=>{let y=this.getAxisMotionValue(v).get()||0;if(ns.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const _=x.layout.layoutBox[v];_&&(y=Hi(_)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&p(l,f);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(l,f)=>{const{dragPropagation:h,dragDirectionLock:d,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:v}=f;if(d&&this.currentDirection===null){this.currentDirection=FW(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),m&&m(l,f)},a=(l,f)=>this.stop(l,f);this.panSession=new KR(e,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,t){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&s(e,t)}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!Vp(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=AW(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:t}=this.getProps(),{layout:i}=this.visualElement.projection||{},r=this.constraints;e&&cu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=MW(i.layoutBox,e):this.constraints=!1,this.elastic=EW(t),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Qr(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=CW(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!cu(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=LW(i,r.root,this.visualElement.getTransformPagePoint());let o=wW(r.layout.layoutBox,s);if(t){const a=t(bW(o));this.hasMutatedConstraints=!!a,a&&(o=QR(a))}return o}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},f=Qr(h=>{if(!Vp(h,t,this.currentDirection))return;let d=l&&l[h]||{};o&&(d={min:0,max:0});const p=r?200:1e6,m=r?40:1e7,v={type:"inertia",velocity:i?e[h]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(h,v)});return Promise.all(f).then(a)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return i.start(fM(e,i,0,t))}stopAnimation(){Qr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t="_drag"+e.toUpperCase(),i=this.visualElement.getProps(),r=i[t];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){Qr(t=>{const{drag:i}=this.getProps();if(!Vp(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(t);if(r&&r.layout){const{min:o,max:a}=r.layout.layoutBox[t];s.set(e[t]-nn(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!cu(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Qr(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();r[o]=SW({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Qr(o=>{if(!Vp(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:f}=this.constraints[o];a.set(nn(l,f,r[o]))})}addListeners(){if(!this.visualElement.current)return;IW.set(this.visualElement,this);const e=this.visualElement.current,t=Ns(e,"pointerdown",l=>{const{drag:f,dragListener:h=!0}=this.getProps();f&&h&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();cu(l)&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),i();const o=Is(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:l,hasLayoutChanged:f})=>{this.isDragging&&f&&(Qr(h=>{const d=this.getAxisMotionValue(h);d&&(this.originPoint[h]+=l[h].translate,d.set(d.get()+l[h].translate))}),this.visualElement.render())});return()=>{o(),t(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=k1,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Vp(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function FW(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class NW extends $o{constructor(e){super(e),this.removeGroupControls=dr,this.removeListeners=dr,this.controls=new DW(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||dr}unmount(){this.removeGroupControls(),this.removeListeners()}}class kW extends $o{constructor(){super(...arguments),this.removePointerDownListener=dr}onPointerDown(e){this.session=new KR(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:e,onStart:t,onMove:i,onEnd:(s,o)=>{delete this.session,r&&r(s,o)}}}mount(){this.removePointerDownListener=Ns(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function OW(){const n=U.useContext(GA);if(n===null)return[!0,null];const{isPresent:e,onExitComplete:t,register:i}=n,r=U.useId();return U.useEffect(()=>i(r),[]),!e&&t?[!1,()=>t&&t(r)]:[!0]}function zb(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const Kc={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(it.test(n))n=parseFloat(n);else return n;const t=zb(n,e.target.x),i=zb(n,e.target.y);return`${t}% ${i}%`}},eL=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function UW(n){const e=eL.exec(n);if(!e)return[,];const[,t,i]=e;return[t,i]}function z1(n,e,t=1){const[i,r]=UW(n);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():C1(r)?z1(r,e,t+1):r}function zW(n,{...e},t){const i=n.current;if(!(i instanceof Element))return{target:e,transitionEnd:t};t&&(t={...t}),n.values.forEach(r=>{const s=r.get();if(!C1(s))return;const o=z1(s,i);o&&r.set(o)});for(const r in e){const s=e[r];if(!C1(s))continue;const o=z1(s,i);o&&(e[r]=o,t&&t[r]===void 0&&(t[r]=s))}return{target:e,transitionEnd:t}}const Gb="_$css",GW={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=n.includes("var("),s=[];r&&(n=n.replace(eL,m=>(s.push(m),Gb)));const o=Wo.parse(n);if(o.length>5)return i;const a=Wo.createTransformer(n),l=typeof o[0]!="number"?1:0,f=t.x.scale*e.x,h=t.y.scale*e.y;o[0+l]/=f,o[1+l]/=h;const d=nn(f,h,.5);typeof o[2+l]=="number"&&(o[2+l]/=d),typeof o[3+l]=="number"&&(o[3+l]/=d);let p=a(o);if(r){let m=0;p=p.replace(Gb,()=>{const v=s[m];return m++,v})}return p}};class HW extends ig.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;VV(VW),s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),gf.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||e.layoutDependency!==t||t===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||fi.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function tL(n){const[e,t]=OW(),i=U.useContext(nR);return ig.createElement(HW,{...n,layoutGroup:i,switchLayoutGroup:U.useContext(iR),isPresent:e,safeToRemove:t})}const VW={borderRadius:{...Kc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Kc,borderTopRightRadius:Kc,borderBottomLeftRadius:Kc,borderBottomRightRadius:Kc,boxShadow:GW};function WW(n,e,t={}){const i=bi(n)?n:zu(n);return i.start(fM("",i,e,t)),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}const nL=["TopLeft","TopRight","BottomLeft","BottomRight"],jW=nL.length,Hb=n=>typeof n=="string"?parseFloat(n):n,Vb=n=>typeof n=="number"||it.test(n);function JW(n,e,t,i,r,s){r?(n.opacity=nn(0,t.opacity!==void 0?t.opacity:1,XW(i)),n.opacityExit=nn(e.opacity!==void 0?e.opacity:1,0,KW(i))):s&&(n.opacity=nn(e.opacity!==void 0?e.opacity:1,t.opacity!==void 0?t.opacity:1,i));for(let o=0;o<jW;o++){const a=`border${nL[o]}Radius`;let l=Wb(e,a),f=Wb(t,a);if(l===void 0&&f===void 0)continue;l||(l=0),f||(f=0),l===0||f===0||Vb(l)===Vb(f)?(n[a]=Math.max(nn(Hb(l),Hb(f),i),0),(ns.test(f)||ns.test(l))&&(n[a]+="%")):n[a]=f}(e.rotate||t.rotate)&&(n.rotate=nn(e.rotate||0,t.rotate||0,i))}function Wb(n,e){return n[e]!==void 0?n[e]:n.borderRadius}const XW=iL(0,.5,uM),KW=iL(.5,.95,dr);function iL(n,e,t){return i=>i<n?0:i>e?1:t(oh(n,e,i))}function jb(n,e){n.min=e.min,n.max=e.max}function or(n,e){jb(n.x,e.x),jb(n.y,e.y)}function Jb(n,e,t,i,r){return n-=e,n=$m(n,1/t,i),r!==void 0&&(n=$m(n,1/r,i)),n}function YW(n,e=0,t=1,i=.5,r,s=n,o=n){if(ns.test(e)&&(e=parseFloat(e),e=nn(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=nn(s.min,s.max,i);n===s&&(a-=e),n.min=Jb(n.min,e,t,a,r),n.max=Jb(n.max,e,t,a,r)}function Xb(n,e,[t,i,r],s,o){YW(n,e[t],e[i],e[r],e.scale,s,o)}const QW=["x","scaleX","originX"],ZW=["y","scaleY","originY"];function Kb(n,e,t,i){Xb(n.x,e,QW,t?t.x:void 0,i?i.x:void 0),Xb(n.y,e,ZW,t?t.y:void 0,i?i.y:void 0)}function Yb(n){return n.translate===0&&n.scale===1}function rL(n){return Yb(n.x)&&Yb(n.y)}function G1(n,e){return n.x.min===e.x.min&&n.x.max===e.x.max&&n.y.min===e.y.min&&n.y.max===e.y.max}function Qb(n){return Hi(n.x)/Hi(n.y)}class qW{constructor(){this.members=[]}add(e){qA(this.members,e),e.scheduleRender()}remove(e){if($A(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){const t=this.members.findIndex(r=>e===r);if(t===0)return!1;let i;for(let r=t;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(e,t){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Zb(n,e,t){let i="";const r=n.x.translate/e.x,s=n.y.translate/e.y;if((r||s)&&(i=`translate3d(${r}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{rotate:l,rotateX:f,rotateY:h}=t;l&&(i+=`rotate(${l}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `)}const o=n.x.scale*e.x,a=n.y.scale*e.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const $W=(n,e)=>n.depth-e.depth;class e7{constructor(){this.children=[],this.isDirty=!1}add(e){qA(this.children,e),this.isDirty=!0}remove(e){$A(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort($W),this.isDirty=!1,this.children.forEach(e)}}function t7(n){window.MotionDebug&&window.MotionDebug.record(n)}const qb=["","X","Y","Z"],$b=1e3;let n7=0;const ba={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function sL({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o,a={},l=e==null?void 0:e()){this.id=n7++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{ba.totalNodes=ba.resolvedTargetDeltas=ba.recalculatedProjection=0,this.nodes.forEach(s7),this.nodes.forEach(u7),this.nodes.forEach(c7),this.nodes.forEach(o7),t7(ba)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=o,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,o&&this.root.registerPotentialNode(o,this);for(let f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new e7)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new eM),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}registerPotentialNode(o,a){this.potentialNodes.set(o,a)}mount(o,a=!1){if(this.instance)return;this.isSVG=o instanceof SVGElement&&o.tagName!=="svg",this.instance=o;const{layoutId:l,layout:f,visualElement:h}=this.options;if(h&&!h.current&&h.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),a&&(f||l)&&(this.isLayoutDirty=!0),n){let d;const p=()=>this.root.updateBlockedByResize=!1;n(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=jR(p,250),gf.hasAnimatedSinceResize&&(gf.hasAnimatedSinceResize=!1,this.nodes.forEach(tT))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&h&&(l||f)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p,hasRelativeTargetChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||h.getDefaultTransition()||m7,{onLayoutAnimationStart:x,onLayoutAnimationComplete:_}=h.getProps(),A=!this.targetLayout||!G1(this.targetLayout,v)||m,w=!p&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||p&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,w);const S={...JR(y,"layout"),onPlay:x,onComplete:_};(h.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else!p&&this.animationProgress===0&&tT(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Vo.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(f7),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const d=this.path[h];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(eT);return}this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(g7),this.potentialNodes.clear()),this.nodes.forEach(l7),this.nodes.forEach(i7),this.nodes.forEach(r7),this.clearAllSnapshots(),wv.update(),wv.preRender(),wv.render())}clearAllSnapshots(){this.nodes.forEach(a7),this.sharedNodes.forEach(h7)}scheduleUpdateProjection(){fi.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){fi.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=_n(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&(this.scroll={animationId:this.root.animationId,phase:o,isRoot:i(this.instance),offset:t(this.instance)})}resetTransform(){if(!r)return;const o=this.isLayoutDirty||this.shouldResetTransform,a=this.projectionDelta&&!rL(this.projectionDelta),l=this.getTransformTemplate(),f=l?l(this.latestValues,""):void 0,h=f!==this.prevTransformTemplateValue;o&&(a||Ea(this.latestValues)||h)&&(r(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),y7(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return _n();const a=o.measureViewportBox(),{scroll:l}=this.root;return l&&(yo(a.x,l.offset.x),yo(a.y,l.offset.y)),a}removeElementScroll(o){const a=_n();or(a,o);for(let l=0;l<this.path.length;l++){const f=this.path[l],{scroll:h,options:d}=f;if(f!==this.root&&h&&d.layoutScroll){if(h.isRoot){or(a,o);const{scroll:p}=this.root;p&&(yo(a.x,-p.offset.x),yo(a.y,-p.offset.y))}yo(a.x,h.offset.x),yo(a.y,h.offset.y)}}return a}applyTransform(o,a=!1){const l=_n();or(l,o);for(let f=0;f<this.path.length;f++){const h=this.path[f];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&hu(l,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),Ea(h.latestValues)&&hu(l,h.latestValues)}return Ea(this.latestValues)&&hu(l,this.latestValues),l}removeTransform(o){const a=_n();or(a,o);for(let l=0;l<this.path.length;l++){const f=this.path[l];if(!f.instance||!Ea(f.latestValues))continue;O1(f.latestValues)&&f.updateSnapshot();const h=_n(),d=f.measurePageBox();or(h,d),Kb(a,f.latestValues,f.snapshot?f.snapshot.layoutBox:void 0,h)}return Ea(this.latestValues)&&Kb(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var o;const a=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty),!((Boolean(this.resumingFrom)||this!==a)&&this.isSharedProjectionDirty||this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:h,layoutId:d}=this.options;if(!(!this.layout||!(h||d))){if(!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout?(this.relativeParent=p,this.relativeTarget=_n(),this.relativeTargetOrigin=_n(),_f(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),or(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=_n(),this.targetWithTransforms=_n()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?_W(this.target,this.relativeTarget,this.relativeParent.target):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):or(this.target,this.layout.layoutBox),qR(this.target,this.targetDelta)):or(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&Boolean(p.resumingFrom)===Boolean(this.resumingFrom)&&!p.options.layoutScroll&&p.target?(this.relativeParent=p,this.relativeTarget=_n(),this.relativeTargetOrigin=_n(),_f(this.relativeTargetOrigin,this.target,p.target),or(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ba.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||O1(this.parent.latestValues)||ZR(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=Boolean(this.resumingFrom)||this!==a;let f=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(f=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),f)return;const{layout:h,layoutId:d}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||d))return;or(this.layoutCorrected,this.layout.layoutBox),PW(this.layoutCorrected,this.treeScale,this.path,l);const{target:p}=a;if(!p)return;this.projectionDelta||(this.projectionDelta=Af(),this.projectionDeltaWithTransform=Af());const m=this.treeScale.x,v=this.treeScale.y,y=this.projectionTransform;xf(this.projectionDelta,this.layoutCorrected,p,this.latestValues),this.projectionTransform=Zb(this.projectionDelta,this.treeScale),(this.projectionTransform!==y||this.treeScale.x!==m||this.treeScale.y!==v)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),ba.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(o,a=!1){const l=this.snapshot,f=l?l.latestValues:{},h={...this.latestValues},d=Af();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=_n(),m=l?l.source:void 0,v=this.layout?this.layout.source:void 0,y=m!==v,x=this.getStack(),_=!x||x.members.length<=1,A=Boolean(y&&!_&&this.options.crossfade===!0&&!this.path.some(p7));this.animationProgress=0;let w;this.mixTargetDelta=S=>{const b=S/1e3;nT(d.x,o.x,b),nT(d.y,o.y,b),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(_f(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),d7(this.relativeTarget,this.relativeTargetOrigin,p,b),w&&G1(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=_n()),or(w,this.relativeTarget)),y&&(this.animationValues=h,JW(h,f,this.latestValues,b,A,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Vo.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=fi.update(()=>{gf.hasAnimatedSinceResize=!0,this.currentAnimation=WW(0,$b,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta($b),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:f,latestValues:h}=o;if(!(!a||!l||!f)){if(this!==o&&this.layout&&f&&oL(this.options.animationType,this.layout.layoutBox,f.layoutBox)){l=this.target||_n();const d=Hi(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const p=Hi(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}or(a,l),hu(a,h),xf(this.projectionDeltaWithTransform,this.layoutCorrected,a,h)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new qW),this.sharedNodes.get(o).add(a);const f=a.options.initialPromotionConfig;a.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const f=this.getStack();f&&f.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const f={};for(let h=0;h<qb.length;h++){const d="rotate"+qb[h];l[d]&&(f[d]=l[d],o.setStaticValue(d,0))}o.render();for(const h in f)o.setStaticValue(h,f[h]);o.scheduleRender()}getProjectionStyles(o={}){var a,l;const f={};if(!this.instance||this.isSVG)return f;if(this.isVisible)f.visibility="";else return{visibility:"hidden"};const h=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,f.opacity="",f.pointerEvents=dm(o.pointerEvents)||"",f.transform=h?h(this.latestValues,""):"none",f;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=dm(o.pointerEvents)||""),this.hasProjected&&!Ea(this.latestValues)&&(y.transform=h?h({},""):"none",this.hasProjected=!1),y}const p=d.animationValues||d.latestValues;this.applyTransformsToTarget(),f.transform=Zb(this.projectionDeltaWithTransform,this.treeScale,p),h&&(f.transform=h(p,f.transform));const{x:m,y:v}=this.projectionDelta;f.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,d.animationValues?f.opacity=d===this?(l=(a=p.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:f.opacity=d===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const y in Jm){if(p[y]===void 0)continue;const{correct:x,applyTo:_}=Jm[y],A=f.transform==="none"?p[y]:x(p[y],d);if(_){const w=_.length;for(let S=0;S<w;S++)f[_[S]]=A}else f[y]=A}return this.options.layoutId&&(f.pointerEvents=d===this?dm(o.pointerEvents)||"":"none"),f}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(eT),this.root.sharedNodes.clear()}}}function i7(n){n.updateLayout()}function r7(n){var e;const t=((e=n.resumeFrom)===null||e===void 0?void 0:e.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=n.layout,{animationType:s}=n.options,o=t.source!==n.layout.source;s==="size"?Qr(d=>{const p=o?t.measuredBox[d]:t.layoutBox[d],m=Hi(p);p.min=i[d].min,p.max=p.min+m}):oL(s,t.layoutBox,i)&&Qr(d=>{const p=o?t.measuredBox[d]:t.layoutBox[d],m=Hi(i[d]);p.max=p.min+m});const a=Af();xf(a,i,t.layoutBox);const l=Af();o?xf(l,n.applyTransform(r,!0),t.measuredBox):xf(l,i,t.layoutBox);const f=!rL(a);let h=!1;if(!n.resumeFrom){const d=n.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:p,layout:m}=d;if(p&&m){const v=_n();_f(v,t.layoutBox,p.layoutBox);const y=_n();_f(y,i,m.layoutBox),G1(v,y)||(h=!0),d.options.layoutRoot&&(n.relativeTarget=y,n.relativeTargetOrigin=v,n.relativeParent=d)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:f,hasRelativeTargetChanged:h})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function s7(n){ba.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=Boolean(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function o7(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function a7(n){n.clearSnapshot()}function eT(n){n.clearMeasurements()}function l7(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function tT(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0}function u7(n){n.resolveTargetDelta()}function c7(n){n.calcProjection()}function f7(n){n.resetRotation()}function h7(n){n.removeLeadSnapshot()}function nT(n,e,t){n.translate=nn(e.translate,0,t),n.scale=nn(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function iT(n,e,t,i){n.min=nn(e.min,t.min,i),n.max=nn(e.max,t.max,i)}function d7(n,e,t,i){iT(n.x,e.x,t.x,i),iT(n.y,e.y,t.y,i)}function p7(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const m7={duration:.45,ease:[.4,0,.1,1]};function g7(n,e){let t=n.root;for(let s=n.path.length-1;s>=0;s--)if(Boolean(n.path[s].instance)){t=n.path[s];break}const r=(t&&t!==n.root?t.instance:document).querySelector(`[data-projection-id="${e}"]`);r&&n.mount(r,!0)}function rT(n){n.min=Math.round(n.min),n.max=Math.round(n.max)}function y7(n){rT(n.x),rT(n.y)}function oL(n,e,t){return n==="position"||n==="preserve-aspect"&&!N1(Qb(e),Qb(t),.2)}const v7=sL({attachResizeListener:(n,e)=>Is(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Lv={current:void 0},aL=sL({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!Lv.current){const n=new v7(0,{});n.mount(window),n.setOptions({layoutScroll:!0}),Lv.current=n}return Lv.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>Boolean(window.getComputedStyle(n).position==="fixed")}),x7={pan:{Feature:kW},drag:{Feature:NW,ProjectionNode:aL,MeasureLayout:tL}},_7=new Set(["width","height","top","left","right","bottom","x","y"]),lL=n=>_7.has(n),A7=n=>Object.keys(n).some(lL),sT=n=>n===hl||n===it,oT=(n,e)=>parseFloat(n.split(", ")[e]),aT=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/);if(r)return oT(r[1],e);{const s=i.match(/^matrix\((.+)\)$/);return s?oT(s[1],n):0}},M7=new Set(["x","y","z"]),w7=Wg.filter(n=>!M7.has(n));function S7(n){const e=[];return w7.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e.length&&n.render(),e}const lT={width:({x:n},{paddingLeft:e="0",paddingRight:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),height:({y:n},{paddingTop:e="0",paddingBottom:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:aT(4,13),y:aT(5,14)},C7=(n,e,t)=>{const i=e.measureViewportBox(),r=e.current,s=getComputedStyle(r),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",n.display||"block"),t.forEach(f=>{a[f]=lT[f](i,s)}),e.render();const l=e.measureViewportBox();return t.forEach(f=>{const h=e.getValue(f);h&&h.jump(a[f]),n[f]=lT[f](l,s)}),n},E7=(n,e,t={},i={})=>{e={...e},i={...i};const r=Object.keys(e).filter(lL);let s=[],o=!1;const a=[];if(r.forEach(l=>{const f=n.getValue(l);if(!n.hasValue(l))return;let h=t[l],d=Xc(h);const p=e[l];let m;if(Km(p)){const v=p.length,y=p[0]===null?1:0;h=p[y],d=Xc(h);for(let x=y;x<v;x++)m?Zm(Xc(p[x])===m):m=Xc(p[x])}else m=Xc(p);if(d!==m)if(sT(d)&&sT(m)){const v=f.get();typeof v=="string"&&f.set(parseFloat(v)),typeof p=="string"?e[l]=parseFloat(p):Array.isArray(p)&&m===it&&(e[l]=p.map(parseFloat))}else d!=null&&d.transform&&(m!=null&&m.transform)&&(h===0||p===0)?h===0?f.set(m.transform(h)):e[l]=d.transform(p):(o||(s=S7(n),o=!0),a.push(l),i[l]=i[l]!==void 0?i[l]:e[l],f.jump(p))}),a.length){const l=a.indexOf("height")>=0?window.pageYOffset:null,f=C7(e,n,a);return s.length&&s.forEach(([h,d])=>{n.getValue(h).set(d)}),n.render(),Gg&&l!==null&&window.scrollTo({top:l}),{target:f,transitionEnd:i}}else return{target:e,transitionEnd:i}};function b7(n,e,t,i){return A7(e)?E7(n,e,t,i):{target:e,transitionEnd:i}}const T7=(n,e,t,i)=>{const r=zW(n,e,i);return e=r.target,i=r.transitionEnd,b7(n,e,t,i)},H1={current:null},uL={current:!1};function P7(){if(uL.current=!0,!!Gg)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>H1.current=n.matches;n.addListener(e),e()}else H1.current=!1}function B7(n,e,t){const{willChange:i}=e;for(const r in e){const s=e[r],o=t[r];if(bi(s))n.addValue(r,s),Qm(i)&&i.add(r);else if(bi(o))n.addValue(r,zu(s,{owner:n})),Qm(i)&&i.remove(r);else if(o!==s)if(n.hasValue(r)){const a=n.getValue(r);!a.hasAnimated&&a.set(s)}else{const a=n.getStaticValue(r);n.addValue(r,zu(a!==void 0?a:s,{owner:n}))}}for(const r in t)e[r]===void 0&&n.removeValue(r);return e}const cL=Object.keys(ih),R7=cL.length,uT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],L7=VA.length;class I7{constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>fi.render(this.render,!1,!0);const{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=Vg(t),this.isVariantNode=eR(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(t,{});for(const d in h){const p=h[d];a[d]!==void 0&&bi(p)&&(p.set(a[d],!1),Qm(f)&&f.add(d))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),uL.current||P7(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:H1.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Vo.update(this.notifyUpdate),Vo.render(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const i=fl.has(e),r=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&fi.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{r(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...t},i,r,s,o){let a,l;for(let f=0;f<R7;f++){const h=cL[f],{isEnabled:d,Feature:p,ProjectionNode:m,MeasureLayout:v}=ih[h];m&&(a=m),d(t)&&(!this.features[h]&&p&&(this.features[h]=new p(this)),v&&(l=v))}if(!this.projection&&a){this.projection=new a(s,this.latestValues,this.parent&&this.parent.projection);const{layoutId:f,layout:h,drag:d,dragConstraints:p,layoutScroll:m,layoutRoot:v}=t;this.projection.setOptions({layoutId:f,layout:h,alwaysMeasureLayout:Boolean(d)||p&&cu(p),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof h=="string"?h:"both",initialPromotionConfig:o,layoutScroll:m,layoutRoot:v})}return l}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update(this.props,this.prevProps):(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):_n()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;i<uT.length;i++){const r=uT[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const s=e["on"+r];s&&(this.propEventSubscriptions[r]=this.on(r,s))}this.prevMotionValues=B7(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const i=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(i.initial=this.props.initial),i}const t={};for(let i=0;i<L7;i++){const r=VA[i],s=this.props[r];(nh(s)||s===!1)&&(t[r]=s)}return t}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=zu(t,{owner:this}),this.addValue(e,i)),i}readValue(e){return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:i}=this.props,r=typeof i=="string"||typeof i=="object"?(t=ZA(this.props,i))===null||t===void 0?void 0:t[e]:void 0;if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!bi(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new eM),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class fL extends I7{sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...i},{transformValues:r},s){let o=n6(i,e||{},this);if(r&&(t&&(t=r(t)),i&&(i=r(i)),o&&(o=r(o))),s){e6(this,i,o);const a=T7(this,i,o,t);t=a.transitionEnd,i=a.target}return{transition:e,transitionEnd:t,...i}}}function D7(n){return window.getComputedStyle(n)}class F7 extends fL{readValueFromInstance(e,t){if(fl.has(t)){const i=iM(t);return i&&i.default||0}else{const i=D7(e),r=(oR(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return $R(e,t)}build(e,t,i,r){jA(e,t,i,r.transformTemplate)}scrapeMotionValuesFromProps(e,t){return QA(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;bi(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}renderInstance(e,t,i,r){fR(e,t,i,r)}}class N7 extends fL{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(fl.has(t)){const i=iM(t);return i&&i.default||0}return t=hR.has(t)?t:YA(t),e.getAttribute(t)}measureInstanceViewportBox(){return _n()}scrapeMotionValuesFromProps(e,t){return pR(e,t)}build(e,t,i,r){XA(e,t,i,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,i,r){dR(e,t,i,r)}mount(e){this.isSVGTag=KA(e.tagName),super.mount(e)}}const k7=(n,e)=>WA(n)?new N7(e,{enableHardwareAcceleration:!1}):new F7(e,{enableHardwareAcceleration:!0}),O7={layout:{ProjectionNode:aL,MeasureLayout:tL}},U7={...gW,...T8,...x7,...O7},Vi=GV((n,e)=>m8(n,e,U7,k7)),Gn={paddingX:"sm:px-16 px-6",paddingY:"sm:py-16 py-6",padding:"sm:px-16 px-6 sm:py-16 py-10",heroHeadText:"font-black text-white lg:text-[80px] sm:text-[60px] xs:text-[50px] text-[40px] lg:leading-[98px] mt-2",heroSubText:"text-[#dfd9ff] font-medium lg:text-[30px] sm:text-[26px] xs:text-[20px] text-[16px] lg:leading-[40px]",sectionHeadText:"text-white font-black md:text-[60px] sm:text-[50px] xs:text-[40px] text-[30px]",sectionSubText:"sm:text-[18px] text-[14px] text-secondary uppercase tracking-wider"},z7=()=>tt("section",{className:"relative w-full h-screen mx-auto",children:[tt("div",{className:`absolute inset-0 top-[120px] max-w-7xl mx-auto ${Gn.paddingX} flex flex-row items-start gap-5`,children:[tt("div",{className:"flex flex-col justify-center items-center mt-5",children:[pe("div",{className:"w-5 h-5 rounded-full bg-[#915EFF]"}),pe("div",{className:"w-1 sm:h-80 h-40 violet-gradient"})]}),tt("div",{children:[tt("h1",{className:`${Gn.heroHeadText} text-white`,children:["Hi, I'm ",pe("span",{className:"text-[#915EFF]",children:"CodeBySycho"})]}),tt("p",{className:`${Gn.heroSubText} mt-2 text-white-100`,children:["I develop 3D visuals, user ",pe("br",{className:"sm:block hidden"}),"interfaces and web applications"]})]})]}),pe(bV,{}),pe("div",{className:"absolute xs:bottom-10 bottom-32 w-full flex justify-center items-center",children:pe("a",{href:"#about",children:pe("div",{className:"w-[35px] h-[64px] rounded-3xl border-4 border-secondary flex justify-center items-start p-2",children:pe(Vi.div,{animate:{y:[0,24,0]},transition:{duration:1.5,repeat:1/0,repeatType:"loop"},className:"w-3 h-3 rounded-full bg-secondary mb-1"})})})})]}),G7=""+new URL("logo-5d95862e.svg",import.meta.url).href,H7=""+new URL("backend-565fc01f.png",import.meta.url).href,V7=""+new URL("creator-dbbffaec.png",import.meta.url).href,W7=""+new URL("mobile-896ef2f5.png",import.meta.url).href,j7=""+new URL("web-0d05165f.png",import.meta.url).href,J7=""+new URL("github-3b4e1609.png",import.meta.url).href,X7=""+new URL("menu-b5599218.svg",import.meta.url).href,K7=""+new URL("close-54702a70.svg",import.meta.url).href,Y7=""+new URL("css-79a7f026.png",import.meta.url).href,Q7=""+new URL("docker-602a695a.png",import.meta.url).href,Z7=""+new URL("figma-184a11e6.png",import.meta.url).href,q7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAYAAAA+VemSAAAACXBIWXMAAAsTAAALEwEAmpwYAAANG0lEQVR4nO2dX6xcRR2AD9QYgpYElEDv3fltqdUSHtSISNWIiIE09vbuzMKa+GBq4p/4hoIGEx/qSxOiL1T62Adj4kN90gegSXnQxAdCIiYkloQKSKKQpo3c7szeikrXzPZCW3r39uzdc2bOzPm+5Jc0t7t7dn4z386cc+bMFAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQFs415cdVqtHrJZjzqgTToudhFEn/N/8//nXxP6eAHAJIy13Oi3HnZFxqdBy3L+HJAJEZLy/e5016og1cr60vGvh3+Pf6z+DSgQIzGhZLVgjz80q7hUia/XC6mCHUIEAgfDCWS2vzCvvJRK/zrkxQILyIjFA4vIiMUDi8iIxQOLyIjFA4vIiMUDi8iIxQOLyIjFA4vIiMUDi8iIxQOLyIjFA4vIiMUDi8iIxQOLyIjFA4vIiMbSe1OVFYmgtuciLxNBKnJE/xJaucomNeu1cr7s9dm4Baie3HpieGFoHEgMkDhIDJA4SAyQOEgMkDhIDNASn5YDV8vis70NigMg4LT++eFsFibnFBMngjPzoynujSIzE0Hhsv/vo9AkOSIzE0Fj8vrtXn6WExEgMjcMa9cPyUw2RGImhMVijfjD7fGEkRmKIjtXq4c1P+kdiJIZojLR8z+9wP9+TO0iMxBAcp+W788qLxDyKCBFwRr5TlbxIjMQQENeTb1st71QpLxIjMSQ2bJ4qsVE/m/V7+SVs/FI2l/8YqDeslmecVof9ebYPp9Uhq9VTTqtTdZahwlywPA80v+etSmJn5EVn5Aln5DPjorhm2mvHB4prR8uLd1stB61Wb8YWFYmhVlxPfSuUvPNcnd4M46Vt1zsjjzmj3oot6/RcqNfP9WVHiHxAZjit9oeWN7TEntGgs2i1PB9bViSGynB9+WYseecZTs/ZGx+NLesGueCcGMphtfq6NfLfRjTcgD3xeFBssUY9HbvM03PBcBqugjUyaIq8MSRe2Ss3Oi0vxy4zEsPMDI081DR5Y0g87KkvxS4vEkOyw+ZpMdTdfqhqndxHbkCZp/6gcU4MKfS8lzTYf9t9t90SqtZGpnNX7DIjMVwV36tZrf7T/MYqvwtdnc7IycbnRXNhq7WMTNekIK+PkVbfD50fp9UvY5e73I+b4hZT2xhp1bNavR278ZUWeHnx7tA5clqWYpcbieEKRj21LyV5fQwHt94cuipX9nV2xi43EsNlONPZY7U6F7uxzRrjwR0fDF2Vp5d3bY1d7pkl1pwTZ4vrd7/mr+bGbmSbEnhp2/Wh8+VnZsUu96YkNpwTZ4fT6oEUe953Y7W3oELn7MyenTfELvemJdb0xNmQurwTgXX386Hz5h/ji13uuSQ29MTJY42632pZjd2Y5m6MWj0S42Jf7HIjcYuxPflqDvJeEFh+Hzx/Wv0idrmRuKXYfvcr1sgoduOpTmD1dsiplH5ZnhRmYrmy+WM4nQ621703J3nfC61+GvJ2W/TyInH7GPbli06Ljd1Y6gl11hnZFiKPq4MdYrW8Er/M1Ybl6nRzmTzHmq28a6HVb0Llc70la3MIy3C6eZztyRecUcPYjSNIA9Tq4VB5pSeG2mmTvBcElv9Z3flGqKZFTwy1MTLd3WvnhtHFCiqx3yVCq59stIh7lSAxVI7fhcAZ+VdsmaKGlj8Ol+WOEM2L4TRUvORLc3cUCH6PWKtfj3Tnc3U3MXpimJvRg+qzyLu+zGVz6Iz81hn1Vy/krPlHYtg0rtf9tDNyJnav19Qoncc59x5iOA0zg7zVC4zEst4pCRuqVY0z2z9Fz1uPwEgsSFwn9sHFTzojp2MPT3MWGIkFietg2O/e3vSNqHMRGIkFiZE3bYGRWJC4Cs4ub99ltXojdo/WRoGRWJAYedMWGIkFiTfV8+qFT1gj/4zdk6UaVQqMxILEM8nbX/w48jZLYCQWJEbedHvgeR+CX2/apb+2Mdl/WKvDfuNyH06rQ1arp5xWp2KPYlyN+cgSvweP1fKP2JWSQ5TNechG69/jjLzojDzhnyDb6BHI8YHiWr+Rm9VysOm3Dy0SF8Vqf3s3x2VbchQ49DRDv52MM/JYkx9csW2edom86Qkco9GOBp1Fq+X52LK6huSjEZzbJ7f5gsdOfm5RNv+pDR/XeuOjsfPrGpKPqIyW1QLD5rQFjiLxl4sPOC3HY8vqNsiHb9tFzoz3d6+zRp6Lnexco2w9pDp8XNkrNzotL8fOs5uejz/H2Ao2GNaoI7GTnHOUrYdKG23gntjvvBE7z27jfBwpcn0g32p5J3aCc47SdVF1ow3cE0/uIzcg3269XBg5P9JyZ5EbTT5/ySVK10Utx+/sKYIuahg/31NDy/EiJ1LfLDqVKFsfNRz7ZKg1qt/FGvVq7HxvFFndWrL97qOxE9qGKFsfVR/XGvXzelvQOmXQ6lDsfDdtU/basFqOxU5oG6JsfVR93FFP7au3Ba1TBi1LsfO9Ufg2X+SC0+ql2AltQ5SujwyGi34OvWtAzqeGVi8VudCmzcdiRvn6qPa4p5d3bS0C44/pGpDz6aGGRS4gcN4CjwfFliIw/pguuqRtEZghdN4C33/Lh4rAJNADnyhygYtYeQvMObDkfRHLX1KP/4uYf5StjxqOvbfeFpTiVWiVz22ktVUZoic19yhbH5UfW6tD9bag9cqgnoyd79ZM5PAwlTJfgf2sqCIwjZ6JpTObSunxE7z9RO/oyc04ytZFHcf285OLQDR5LrTN9WEGD48T5iuwf0KoCESzn0ZSeT5O6OGB/nwFXut97qt/w7vOPbEldW19oN/Dkjr5CuyfSloZdG6qq+34z3ZG/hZbVNfWJXXeZXWwQ6yWV2InPbcom/96v4d61q9fVcfMK2vU07Fz7NaJdq5Muc6q/UQOAk/iaJVDySavSmnbtCLl+6EnrrYxlc17oIb9F7/2d87rQts29rzvB4nzFHgSWqzf++jMnp03zNou/PzqJu/MYJH3IgynMxX4YmN/0+93NDLd3X7/ow33RjLd3U3fG8m2edg8DSTOV+DLQqtTk4tRl+9OeHjtb43fndAi73QYTrdA4ITDMmy+OkiMwLFFdcg7H0hMDxxbWEfPi8ShG1rZjMcWIqWwDJvpiRE4vogOeePAcJoeGHkTB4kZQtPzJg4Scw7MsDlxkJiLWJzzJg4ScxWaC1aJw7TL99/qkHesVk+VzZ9/LZuty8X8MT0yPEh8YQE1a+RXK1p9bNb8+ff497Z9oUGLvPFos8RWq7/bXvfeeXPoP8N/VuzyIG9LaeM58eQB90H31qpyOFza9lGn1Z/alUPFw/hNoU09sV/p4tTg5g9XnUP/mf6zW5LD13iet2G0QWL/kPtqb0HVlUP/2U1+kB55Myf34fTQyEN159AaGWQrr2bY3Hiy7YkD7reT4z5WlmFzOuTYE1uj7g+VP6fVA1nlTtPzJkdmPfHJcVFcEyp3/lj+mFnIa7hglSwZ9cRPhM6d3/M3eXk1PW/y5CDxsCcPhs6bv2AWu9zIC1kMp4f97u2hq9IfM3a5NxuWYXN+pNwTn9ULHwmdr8nsrBTl1QybsyXVnriO3f6uhj9mcvIaLlhlT4o9sd8nKHSeTi/v2pqUvJqetzWk1hPH2AFvZV9nZzLyGnre1pGYxHtD58dpWWpAuZEXMhhOa3UodD06o56MXu6rhGXYDClI7B+4D11T1qhXY5cbeSGb4fTIdO4KVZ3+WI2Wl3NeSK0ntlqeCVVrVsux5uaBq82QqsRG7qu78ob9zj2xy4m8kKXE/rzUz5Cqq3pXBp2bmvoUEj0vZCGxM+rZOmZmjQfFFmvU0/HLh7yQ/4Wto+OlbddXVdH+s/xnNqBcVwQXrCDLntivILna396dt3pHg87iZJnaJpaRC1aQs8ROi7VaHj+zZ+cNs5bLz692Rh5zRr0VvRzICy0eTk+Wm7VaDo5Md/f4QHHttHL4//Ov8a9t8vKxDJuhdRK/F1qdmlyM0uqw7519TP594W+non8/5IVYNHo4nUFwzgu1g8TIC4mDxPS8kDhIzLAZEgeJOeeFxEFiLlhB4iAxV5shcZCYW0WQOEjMfV5IHCRmkgYkDhIzwwoSB4mZHgmJ03aJmdsMydNWiZEXsqFtEiMvZEdbJEZeyJbcJUZeyJ5cJUZeaA25SYy80DpykRh5obWkLjHyQutJVWLkBUhUYuQFSFRi5AVIVGLkBUhUYuQFSFRi5AVIVGLkBUhUYuQFSFRi5AVIVGLkBUhUYuQFSFRi5AVIVGLkBUhUYuQFCMxoWS1YI89VIO8L/geBCgQIzHh/9zpr1BFr5PzM4ho579/rP4OKA4jISMudTsvx0gJrOe7fQ6UBNIhzfdlhtXrEajnmjDrhtNhJGHXC/83/n39N7O8JAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCE4v/t8177cNMPugAAAABJRU5ErkJggg==",$7=""+new URL("html-92b76a73.png",import.meta.url).href,ej="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAYAAAA+VemSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAOgElEQVR4nO2dCdCVZRXHz8Pnwi4groElmijuK6m4YCqJpZmJqJla40qGWjgYZZQL5p4GJZlboKKTGzoouWSAiQsuqONY42Q1LVrZYlpZnebcy51B6uO7977LeZ/7/H4z/wGGmfve5zznf577vu+ziAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtIW+JIqIQafkgKSGd8ARMVAMjIEpBBQCZQQmCSgEceeApIZ3wBExUAyMgSkEFAJlBCYJKARx54CkhnfAETFQDIyBKQQUAmUEJgkoBHHngKSGd8ARMVAMjIEpBBQCZQQmCSgEceeApIZ3wBExUAyMgSkEFAJlBCYJKARx54CkhnfAETFQDIyBKQQUAmUEJgkoBHHngKSGd8ARMVAMjIEpBBQCZQQmCSgEceeApIZ3wBExUAyMgSkEFAJlBCYJKARx54CkhnfAETFQDIyBKQQUAmUEJgkoBHHngKSGd8ARMVAMjIEpBBQCZQQmCSgEceeApIZ3wBExUAyMgSkEFAJlBCYJKARx54CkhnfAETFQDIyBKQQUAmUEJgkoBHHngKSGd8ARMVAMjIEpBBQCZQQmCSgEceeApIZ3wBExUAyMgSkEFAJlBCYJKARx54CkhnfAETFQDIyBKQQUAmUEJgkoBHHngKSGd8ARMVAMjIEpBBQCZQQmCSgEceeApIZ3wBExUAyMgSkEFAJlBCYJKARx54CkhnfAETFQDIyBKQQUAmUEJgkoBHHngKSGd8ARMVAMjIEpBBQCZQQmCSgEceeApIZ3wBExUAyMgSkEFAJlBCYJKARx54CkhnfAETFQDIyBKQQUAmUEJgkoBHHngKSGd8ARMVAMjIEpBBQCZQQmCSgEceeApIZ3wBExUAyMgSkEFAJlBCYJKARx54CkhnfAETFQDIyBKQQUAmUEJgkoBHHngKSGd8ARMVAMjIEpBBQCZQQmCSgEceeApIZ3wBExUAyMgSkEFAJlBCYJKARx54CkhnfAETFQDIyB/Sp+yKQJHwmlft+3l4kumiN62dmixx8WdJ9dg246LOjggUH79A4aQv3v79sg6Oab1P//pAlBL50iev9s0b8tq3bBkdTwDnjsisHA7zwj+v1viB62f9C+vbN9395rBx03JuhV00TfXFrF/kgM74DHriob+A8/EZ16YtChg7N9x+40oF/QyccGfXVhlfojMbwDHruqaOB3l4teMkV00IBijLuq1loz6PRJov94rgr9kRjeAY9dVTPwy/eJ7rZtOcZdVVtvHvSp2737IzG8DRC7qmTghdeWN+p2p769g94zEwNj4AqYMyYDz7tcdI0uX/PKCtn3mP01r/5IDG8DxK4qGPjumdUxr6yQvY6aezEGxsAVMGmVDWz3vAP7+xtWunnltGRu2f2RGN4GiF2eBranvttu4W9UWY3WHxL0tYcwMAaugFmrZuDzJ2e/fhkaN6a82WaSGt4GiF1eBv79Y6L9+/qbs1ndcCEGxsAVMGxVDDztZH9TtqIh64Ra0Sm+PxLD2wCxy8PANtNqw6H+pmxWgwcGvWZ6Wf2RGN4GiF0eBr732/nd+24/MugVU0WfuUP09cX11Ub259J5oldPE917l/oroXY//9hDgr6xpMz+SAxvA8QuDwNPOjq7cfv1qd+X/ufFnq9nr4J22LK1z990WKgtPyy/PxLD2wCxy8PANuc46/vZR29qfR3xxPE9f3ZXV9Azjwv61tNe/ZEY3gaIXWUb+O/PSs0kWa553ufba+u/losefuDqf44/eZt3fySGtwFiV9kGfnF+tmvarht/far99trIOmqz//3MGWeK/vP5KvRHYngHPHaVbeAHr8t2zQP2yD6pwh54NeZejx0d9JUFVeqPxPAOeOwq28C2cCHL9T57eD6zor46SfTa85p7CKal9kdieAc8dpVt4NuvzHZN28ius/sjMbwDHrvKNnDWd8AH7omBOwpvA8Susg38yA2S+f2v7VLZuf2RGN4Bj11lG9geGGW95qxzO7k/EsM74LGrbAPb6NmrV7Zrrjso6E/v79T+SAzvgMeusg1s2nJEtmuaRgwPtd08Oq8/EsM74LHLw8C2QCDrdU22Fc+NM6r3Kkgz9UdieAc8dnkY+KaL8t2Jw1YcPXZzp/RHYngHPHZ5GNiOTFlzjfwM3JAdZLZgduz9kRjeAY9dHgY2fXI1iwqyasetgt5yaTXmNmvL/ZEY3gGPXV4GtuWARRm4ITti1FYu/XZRTP2RGN4Bj11eBjbZrKqiTWxae62gnz406LN3xtAfieEd8NjlaeDn75LayYBlmHjl1UwPfLe6T64lNbwDHrs8DWz6+uk+e0NvNzLozZeI/vsF/z54b38khnfAY5e3gc1AB+9TvoEbsu19bruiSv2RGN4Bj13eBja9uVRqI6KXiUWCfvhD/mcDY+AKGCI2VcHApt8tzr7ZXVZ1dQX94gm+q50kNbwNELuqYmDTHx+X2mQMTxOLBN1qRNAnnDa3k9TwNkDsqpKBGycW2iiYdcVSVq3RFfSCM8p/Wi2p4W2A2FU1Azf0w+9JbSKG92h81MGhthUuBsbA7maNycAmO0zshMP8R+OD9irvvlhSw9sAsavKBl55G9j9Rvua+JCxobYxPAbGwO6mjc3ADc2fJbrLNn4mPuv44tsqqeFtgNgVk4EbWjRH9KP7Zjt1sB2FEGq7ahbbH4nhbYDYFaOBG3ruzvo9sh12VpaJN14/29EuPfdHYngbIHbFbOCVZ3JdeY7o+zcux8TnnlZcmyU1vJMndnWCgRt6d7norZeJ7jSqWAMP7B/0z08U1R+J4Z00sauTDLyyFl4rtfnNRZn4m18qqj8SwztRYlenGrghO+93/93zN/Do7Yppt6SGd4LErk43cEN3Xi26wbr5GbhXr6C/frSI/kgM78SIXakY2GR7Y+21c34mnnd5Ef2RGN5JEbtSMrDpradF99gxHwN/4YT82y6p4Z0QMcvm96ZmYNNrD0ntlMOsbT94HwyMgR0T+fXF1TSwLWIouu02LTJr27f5IAbGwE0m3M8flNrWqLboPa8kthP+sibxkQeFXN/jXnhGfXRcOq9YAy+Zm73t6w3BwBi4h0Sz0wVmnCnat3c9aU6ekF/S3Ped7El83Mfz+T7L737vQoVRmxW7DtemQ2Zte78+GBgD93CavW3vsuqE+rtn5pPENtplTeJTJ4bMo+75k6W2+fqqn33OScXeX2e9D+7qwsAYuJvXHXYEZ3erbQYPDPri/OwJvOdO2e8Dp3wm28buq5v2aNva2ESMIsxra3vt87O0vX9fDIyBV9kjeda5UjNoT8lj281kOaX+hXvy2VDdFhG0c1tgG7o3cyrDpsOCvrEkfwO/ujB7+zdaDwNj4BUJZXsS79riYvWhg4P+6Mb2Rp8xOYy+pjuuau3adj6RnR7YyjXGjs7/fvjqadkNvN1IDJy8gf+0VPRzx9Tvp9qd0jfp6FA7c7eZxH17mdQ2asvDvCZbk9vsqDt9UvvnAo/fO799qexzNt8ke9uPGIeBkzbw3ItFNxyaj5HsKfVJE0LtyfJfnnzvdWxr1JfvE71iqtR+kuZlXrumPYTqqZ3LfiC6fQ4nL9i+WLYBfNa4n35MddcFS2p4m7Bd/eyB7A9RVie7jx4xPOjwDetGK+Ia9hCsmbbuvkN+17T7zgWz24u5/QyffGx+3+XB6/LPC0kNbyNmkY2YRRm4DH3l1OYMvHiO5L5/1d671I8JbWanSNss/pZLpfZuOa/r9+1dzHtqSQ1vE2aRLUfLY06ul1o5DGzi+OJ+adi9qE12ue4CqW06d89M0RtnSO1khUP3C7ruoPyvO3E864GTN7Al9mVn+5yPm1X287yVY0dsAYFtReP9vfPSw9cXU9QlNbxH0awyE4wb45+QrcoKT6tttZ+x3t87D+00qrXihYE72MCm3/xYdP0h/onZrGwktddf7bT1xCP8v38VH17pCklqeJsvz3nPZe5vnEUXndV+O+09dB6vlLw0oeD1z5Ia3sbLU3d9q9hXS3nIJkBkffpqvzi2+IB/W1rVsA3yXc6JgTvMwCZ7elr2kSHNymZR5bVO95cP5zuppGj171vOod+SGt6GK0L2sKdPQZMvsuiqafkvKLCn2d7tkh5kSx3vb3PyCAZO0MAmq/Z2Do938jY07eRi7v1spZFNyvBun3SjQQPaWzCCgRMegRv61SP5rNnNIvs5bxMiimynzaf+8intL+goStuPDPrSveX2uaSGt8nKWCN8zfTm1gjnLZvBZBuil9XWx28t/lyjZrTWmkGnnljslj4YOBEDr7xLx6c+Vl8+WMaoa69L7Jplt9PmNl9/gc+9ca9eQT9xQNBXFvj1s6SGt7HKlu2kYdvt/L89pLLKfsIeMra1Oc5FydYP28O8Mu6P1xkQ9JQjQ23JpXe7JTW8A+4l2zvZTsjbd7f63lFZRh3bCcS2uPnFw/7t6u5p9SVT6mbOa7KLvdO1bXptR5F3ctooIA9JangHvAqyA65tIf9XJ4kefmDQnbcOtamZNrJYstpobffQm2xUX8NrezmbYefPqm/u7v39W5GZbdGc+t5hpx1VPx1hhy1DbWMEa2OjmA3oV//3ZsNDbfsgWz1kC/Bvv7K+Ftu7HdqNJDW8A46IgWJgDEwhoBAoIzBJQCGIOwckNbwDjoiBYmAMTCGgECgjMElAIYg7ByQ1vAOOiIFiYAxMIaAQKCMwSUAhiDsHJDW8A46IgWJgDEwhoBAoIzBJQCGIOwckNbwDjoiBYmAMTCGgECgjMElAIYg7ByQ1vAOOiIFiYAxMIaAQKCMwSUAhiDsHJDW8A46IgWJgDEwhoBBoiiMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEg+/BceiofdqS/+vQAAAABJRU5ErkJggg==",tj=""+new URL("mongodb-54000b2b.png",import.meta.url).href,nj=""+new URL("nodejs-d83eb6dd.png",import.meta.url).href,ij=""+new URL("reactjs-966214a8.png",import.meta.url).href,rj=""+new URL("redux-171787ca.png",import.meta.url).href,sj=""+new URL("tailwind-6ece120d.png",import.meta.url).href,oj="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAYAAAA+VemSAAAACXBIWXMAAAsTAAALEwEAmpwYAAANMUlEQVR4nO2d+48V9RXAv//Gtw/balttayOpjVZr06TPqLRJ09Q+09Yaa01sapNWKqiAqCiU+MJXfSGC+ADxQa1AK0WMogJW2L3syrIvdpcL+95ln7B7mu8Y7GaD9N7ZmXvuzPl8kvOLMXsvZ87nnLkz852vcwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsfDX7BaCHOSlBpw1tBNOkAOPwAhMI6AReCYwRUAjyHYNOGtoJ5wgBx6BEZhGQCPwTGCKgEaQ7Rpw1tBOOEEOPAIjMI2ARuCZwBQBjSDbNeCsoZ1wghx4BEZgGgGNwDOBKQIaQbZrwFlDO+EEOfAIjMA0AhqBZwJTBDSCbNeAs4Z2wgly4BEYgWkENALPBKYIaATZrgFnDe2EE+TAIzAC0whoBJ4JTBHQCLJdA84a2gknyIFHYASmEdAIPBOYIqARZLsGnDW0E06QA4/ACEwjoBF4JjBFQCPIdg04a2gnnCAHHoERmEZAI/BMYIqARpDtGnDW0E44QQ48AiMwjYBG4JnAFAGNINs14KyhnXCCHHgERmAaAY3AM4EpAhpBtmvAWUM74QQ58AiMwDQCGoFnAlMENIJs14CzhnbCCXLgERiBaQQ0As8EpghoBNmuAWcN7YQT5MAjMALTCGgEnglMEdAIsl0DzhraCSfIgUdgBKYR0Ag8E5gioBFkuwacNbQTTpADj8AITCOgEXgmMEVAI8h2DThraCecIAcegRGYRkAj8ExgioBGkO0acNbQTjhBDjwCIzCNgEbgmcAUAY0g2zXgrKGdcIIceARGYBoBjcAzgSkCGkG2a8BZQzvhBDnwCIzANAIagWcCUwQ0gmzXgLOGdsIJcuARGIFpBDQCzwSmCGgE2a4BZw3thBPkwCMwAtMIaASeCUwR0AiyXQPOGtoJJ8iBR2AEphHQCDwTmCKgEWS7Bpw1tBNOkAOPwAhMI6AReCYwRUAjyHYNOGtoJ5wgBx6BEZhGQCPwTGCKgEaQ7Rpw1tBOOEEOPALnW+Dm7jEBkYUbOiqW81mLCvKjBxrl6qcPyF83FeXJt3tk275BebdtWJq6xqJj0jt0TPqG34+uI0ej/7bv8Gj0/2ypH5BndvbKfVs7ZcGLHXLlE61y0d0N8vkFtUzgJNGWE4GrQ+ALltbL3Ofa5eXafin2j6faL/uGj8nOliFZub1b5jzbJrOXN8ip82oS+Xc4a2jLicB6Ap97a100XeuLo6LNsYnJaHqv3dUrf17XJucsrkNgBM4XSQl88fIG+fue/kiaamXVm90IjMD5YqYCn3dbnWzY3SeT1evtBzz0WhcCI3C+iCvwR+bsjk5Lh8YmJCvc9cphBEbgfBFH4NOuq4kuTGWNpZuKCIzAtgU+a1FB9rQPSxa5MebZhrOG9hXmUoL7wOULfPoNtZmVN3Dt+nYERmCbAn/8L3vk9f1HJMtc/fQBBEZgmwIv23xIss4Vq1sQGIHtCXzhXfuq+v5uqfxqRTMCI7A9gbc1DEoeuOTBRgRGYFsC/+zhJskL37unAYER2JbAm/cOVOy7tHSPyT9q+qNHHu/d2im3bSxGz1U/uK0zWoUUvktrT/xVZN++Yx8CI7Adgc++ZW+qv33D395U6JdLH2uWMxcWSpbrjPm10bLEIPiOliEp9SuG1VHcB87JfeCfPNQol61sTiX+8NSBxIo8rKZJ63uGCM8yf1iOwprbtAjPT4cGkcSxPHNhQf74zAF5s+nkt7m+HPPznDW05dSOLywsJFbobzUNqf070jh9Hj82Kb9/sjW173zB0nr527ZOOXKCZ7TDcYnzN501tAXSjjwIHB7cGBxNdqFCONX93er05PXTTrPDKXb/8LEPPj/uAn9nDW2BtCMPAn9tab0kzYo34i3n8zMUOVwQC5P/o3Pi/Q1nDW2BtCMPAoeHHpIknNKWc6HKJxxxL2CFcNbQFkg78iBwuDqdJC/u7lM/Lj5mOGtoJ1w78iDwPf8+LEnyp7Vt6sfFxwxnDe2Ea0ceBH709S5JknDbTvu4+JjhrKGdcO3Ig8BP7eiRJJkd8zFGXwXhrKGdcO3Ig8DPvtMrSfLrmCuBfBWEs4Z2wrUjDwKvfrNbkiQ8XKF9XHzMcNbQTrh25EHgIFzSOyeEV/JoHxsfI5w1tBOuHXkQOOnbSIGwF5L2sfExwllDO+HakQeBw0KHNAgbk2kfH19mOGtoJ1w78iBwWKWUFkHi8Ky19nHyJYazhnbCtSMPAoc4NHBU0mJX69BJlzL6KgpnDe2Ea0deBF6f8K2k6QyMTERrjk+5trqnsbOGdsK1Iy8Cp/U7eDphc+/wWWG/Je1j5xEYgfMi8Kfm1UjP0P/W06bN7rbhaBVUtYnsrKGdcO3Ii8Ah7t6S7KKGUgjbt1y2sjn2+l0ERmAEnrKZ2YleT1MJ6oujctWaVvUr1s4a2h1TO/I0gUOEV7tq0tw9Fu1FrHWxy1lDu+C0I28Cf3LunujtmNp09I3L9S90yCfmVlZkZw3tgtOOvAkc4uLlDdF7paqBtt7xaKfBj1Xo1NpZQ7vYtCOPAoeY+1y7VBP1xVH56UNNCIzACFyqxPe/muwqpSR4/t0+mXVTMi+JP1E4a2hPCu3I6wQ+HmGvompjYGRC5jybznu3nDW0C0w78i5weNDikYTfmZXk2y9PT3jdsbOGdoFpR94FnrpmuBo3/m7qGpPv3BlvJ0IERmAzAof4wX37pXMwvVVLcRken4i9off0cNbQLirtsCRwiHMW18n2xpPvDKjByPiE/PzhmV+ldtbQLijtsCZwiPDc8rzn22VI6bHLDyPcu/7lozOT2FlDu5i0w6LAx+PcW+vklbrktyWdCeFZ7m/e/h4CIzAClypy+P1ZODgi1UJz95h85nq2F2UCM4FLljisIpq7vj3VV/OUw+Pbu2NNYWcN7dM47bB8Cn2iCIsPwmqiorLIE5MiF91d/hYvzhraBaMdCHzivJx2XY3c/NLBir7lYzqvNRxBYARG4Jk0uPBbdMnGovQP64h84V3lPeThrKE9AbWDCVxank6fXyu3//OQDI5W9tbTk2XuEOGsoS2QdiBw+fkKq5wqtd64f/hYWS8FcNbQFkg7EDhe3r66pF42FSpzD/mSMh6zdNbQFkg7EHhm+fvNymbpPpLuFetlmw8hMAIjcFpNcNaigrz63mBqAoenxZjATGAmcIpnMqdcu0c27O5LReDGzlEERmAErsTTXBtr+xMXOFwwK3UHCGcN7d+g2sFv4GTz+bkFtan8Jj51XmnPRjtraAukHQicfE6XbT6UuMBfvLGAwAiMwJV6L3XShEbLBGYCM4ErIPCXbt6buMBh90UERmAEroDA5y+pT1Te8DK+Uj/bWaMSB7SaIw+/gc+7rS5662Slti/5fzH7nobEH6cs9bOdNbQPtnbkQeCvL3t/4r3dPDSj19EkFQs3dEiS1HaMlPzZzhraB1s78iTw8dPN8CL3M0u86JNGvHNgWJIkPCBS6mc7a2gLpB15E3jqy+Hu/Neh6L5sJb/LLx5pkqRZvuVwyZ/vrKEtkHbkVeCp+xA98GpndGEp7e9x1qKCtPeOS9L8dlULAiOwTYGnvmMqLAq49LHmkm/JlBPnL6lPZWPxycnSH+II4ayhUXDVFFYEnn56Hbb5vGJVi3z6uppE3p01mNKbOuqKpV/AQuAqEAqB0xd4KuGiV6FjRNa81RNt+fndO/eddMfAcKsqbM9y5ROt0etuwil6moTX+CAwE5gJXCZh25XwgvW9B0fk3bbhaBK29oxV7FU6x0+fwz1uBEZgBM4gbzTyWll+A/MbOLNcEmPLUWcN7d+g2mHxIlZep69HYH2hEBiBx45OyjdiPhLqrKEtkHYwgauPhRs6Yh9PZw1tgbQDgauLTYX+aANyBEZgBM4YO1uGogdDZtKQnTW0J6B2MIGrg+2NR+SM+TNfeOGsoS2QdiCwPuvf6S1r/yMERmAErgIGRiaizcSTbMjOGtoTUDvyMIG/cmtd9OhjVpiYFFm7q1fOvmVv4rlw1tAWSDvyIHCIcAr64wcb5d6tnbKjZaiizyyXSvhOz/+nT751R3qv/XHW0BZIO/Ii8PQIOxn88P79smRjUbbUD1R8Y+6p1LSPyOKXizLrpuQnLgJXQbEhcPo5CPdWw6L7yx9viXZOeGlPv9QXR2X06GTiK4hausdk3a5euWZdW9mriRCYCVxWEeR1Ape7Pej3722Qq9a0yvwXO6I1uCve6IpOd7e+NxhtHTo9Nu8diNYDh/duXf9CR7Q+ePbyBvnsDcm/7aOccNbQLh6CHHgERmAaAY3AM4EpAhpBtmvAWUM74QQ58AiMwDQCGoFnAlMENIJs14CzhnbCCXLgERiBaQQ0As8EpghoBNmuAWcN7YQT5MAjMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4bf4LtvMh68AvCz8AAAAASUVORK5CYII=",aj=""+new URL("threejs-fe160e71.svg",import.meta.url).href,lj=""+new URL("meta-e386841a.png",import.meta.url).href,uj=""+new URL("shopify-c0fdbc80.png",import.meta.url).href,cj=""+new URL("starbucks-af2a76fc.png",import.meta.url).href,fj=""+new URL("tesla-4c857950.png",import.meta.url).href,hj=""+new URL("carrent-aba013d1.png",import.meta.url).href,dj=""+new URL("jobit-ecb9d39c.png",import.meta.url).href,pj=""+new URL("tripguide-892dd3b1.png",import.meta.url).href,cT=[{id:"about",title:"About"},{id:"work",title:"Work"},{id:"contact",title:"Contact"}],mj=[{title:"Web Developer",icon:j7},{title:"React Native Developer",icon:W7},{title:"Backend Developer",icon:H7},{title:"Content Creator",icon:V7}],gj=[{name:"HTML 5",icon:$7},{name:"CSS 3",icon:Y7},{name:"JavaScript",icon:ej},{name:"TypeScript",icon:oj},{name:"React JS",icon:ij},{name:"Redux Toolkit",icon:rj},{name:"Tailwind CSS",icon:sj},{name:"Node JS",icon:nj},{name:"MongoDB",icon:tj},{name:"Three JS",icon:aj},{name:"git",icon:q7},{name:"figma",icon:Z7},{name:"docker",icon:Q7}],yj=[{title:"React.js Developer",company_name:"Starbucks",icon:cj,iconBg:"#383E56",date:"March 2020 - April 2021",points:["Developing and maintaining web applications using React.js and other related technologies.","Collaborating with cross-functional teams including designers, product managers, and other developers to create high-quality products.","Implementing responsive design and ensuring cross-browser compatibility.","Participating in code reviews and providing constructive feedback to other developers."]},{title:"React Native Developer",company_name:"Tesla",icon:fj,iconBg:"#E6DEDD",date:"Jan 2021 - Feb 2022",points:["Developing and maintaining web applications using React.js and other related technologies.","Collaborating with cross-functional teams including designers, product managers, and other developers to create high-quality products.","Implementing responsive design and ensuring cross-browser compatibility.","Participating in code reviews and providing constructive feedback to other developers."]},{title:"Web Developer",company_name:"Shopify",icon:uj,iconBg:"#383E56",date:"Jan 2022 - Jan 2023",points:["Developing and maintaining web applications using React.js and other related technologies.","Collaborating with cross-functional teams including designers, product managers, and other developers to create high-quality products.","Implementing responsive design and ensuring cross-browser compatibility.","Participating in code reviews and providing constructive feedback to other developers."]},{title:"Full stack Developer",company_name:"Meta",icon:lj,iconBg:"#E6DEDD",date:"Jan 2023 - Present",points:["Developing and maintaining web applications using React.js and other related technologies.","Collaborating with cross-functional teams including designers, product managers, and other developers to create high-quality products.","Implementing responsive design and ensuring cross-browser compatibility.","Participating in code reviews and providing constructive feedback to other developers."]}],vj=[{testimonial:"I thought it was impossible to make a website as beautiful as our product, but Rick proved me wrong.",name:"Sara Lee",designation:"CFO",company:"Acme Co",image:"https://randomuser.me/api/portraits/women/4.jpg"},{testimonial:"I've never met a web developer who truly cares about their clients' success like Rick does.",name:"Chris Brown",designation:"COO",company:"DEF Corp",image:"https://randomuser.me/api/portraits/men/5.jpg"},{testimonial:"After Rick optimized our website, our traffic increased by 50%. We can't thank them enough!",name:"Lisa Wang",designation:"CTO",company:"456 Enterprises",image:"https://randomuser.me/api/portraits/women/6.jpg"}],xj=[{name:"Car Rent",description:"Web-based platform that allows users to search, book, and manage car rentals from various providers, providing a convenient and efficient solution for transportation needs.",tags:[{name:"react",color:"blue-text-gradient"},{name:"mongodb",color:"green-text-gradient"},{name:"tailwind",color:"pink-text-gradient"}],image:hj,source_code_link:"https://github.com/"},{name:"Job IT",description:"Web application that enables users to search for job openings, view estimated salary ranges for positions, and locate available jobs based on their current location.",tags:[{name:"react",color:"blue-text-gradient"},{name:"restapi",color:"green-text-gradient"},{name:"scss",color:"pink-text-gradient"}],image:dj,source_code_link:"https://github.com/"},{name:"Trip Guide",description:"A comprehensive travel booking platform that allows users to book flights, hotels, and rental cars, and offers curated recommendations for popular destinations.",tags:[{name:"nextjs",color:"blue-text-gradient"},{name:"supabase",color:"green-text-gradient"},{name:"css",color:"pink-text-gradient"}],image:pj,source_code_link:"https://github.com/"}],_j=()=>{const[n,e]=U.useState(""),[t,i]=U.useState(!1),[r,s]=U.useState(!1);return U.useEffect(()=>{const o=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)},[]),pe("nav",{className:`${Gn.paddingX} w-full flex items-center py-5 fixed top-0 z-20 ${r?"bg-primary":"bg-transparent"}`,children:tt("div",{className:"w-full flex justify-between items-center max-w-7xl mx-auto",children:[tt(gN,{to:"/",className:"flex items-center gap-2",onClick:()=>{e(""),window.scrollTo(0,0)},children:[pe("img",{src:G7,alt:"logo",className:"w-9 h-9 object-contain"}),tt("p",{className:"text-white text-[18px] font-bold cursor-pointer flex ",children:["CodeBySycho ",pe("span",{className:"sm:block hidden",children:" | JavaScript Mastery"})]})]}),pe("ul",{className:"list-none hidden sm:flex flex-row gap-10",children:cT.map(o=>pe("li",{className:`${n===o.title?"text-white":"text-secondary"} hover:text-white text-[18px] font-medium cursor-pointer`,onClick:()=>e(o.title),children:pe("a",{href:`#${o.id}`,children:o.title})},o.id))}),tt("div",{className:"sm:hidden flex flex-1 justify-end items-center",children:[pe("img",{src:t?K7:X7,alt:"menu",className:"w-[28px] h-[28px] object-contain",onClick:()=>i(!t)}),pe("div",{className:`${t?"flex":"hidden"} p-6 black-gradient absolute top-20 right-0 mx-4 my-2 min-w-[140px] z-10 rounded-xl`,children:pe("ul",{className:"list-none flex justify-end items-start flex-1 flex-col gap-4",children:cT.map(o=>pe("li",{className:`font-poppins font-medium cursor-pointer text-[16px] ${n===o.title?"text-white":"text-secondary"}`,onClick:()=>{i(!t),e(o.title)},children:pe("a",{href:`#${o.id}`,children:o.title})},o.id))})})]})]})})};var hL={};Object.defineProperty(hL,"__esModule",{value:!0});var Yc=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Aj=function(){function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}}(),dL=U,Mj=Sj(dL),wj=mm;function Sj(n){return n&&n.__esModule?n:{default:n}}function Cj(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Ej(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function bj(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var Tj=function(n){bj(e,n);function e(t){Cj(this,e);var i=Ej(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));i.state={style:{}};var r={reverse:!1,max:35,perspective:1e3,easing:"cubic-bezier(.03,.98,.52,.99)",scale:"1.1",speed:"1000",transition:!0,axis:null,reset:!0};return i.width=null,i.height=null,i.left=null,i.top=null,i.transitionTimeout=null,i.updateCall=null,i.element=null,i.settings=Object.assign({},r,i.props.options),i.reverse=i.settings.reverse?-1:1,i.onMouseEnter=i.onMouseEnter.bind(i,i.props.onMouseEnter),i.onMouseMove=i.onMouseMove.bind(i,i.props.onMouseMove),i.onMouseLeave=i.onMouseLeave.bind(i,i.props.onMouseLeave),i}return Aj(e,[{key:"componentDidMount",value:function(){this.element=(0,wj.findDOMNode)(this)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.transitionTimeout),cancelAnimationFrame(this.updateCall)}},{key:"onMouseEnter",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},r=arguments[1];return this.updateElementPosition(),this.setState(Object.assign({},this.state,{style:Yc({},this.state.style,{willChange:"transform"})})),this.setTransition(),i(r)}},{key:"reset",value:function(){var i=this;window.requestAnimationFrame(function(){i.setState(Object.assign({},i.state,{style:Yc({},i.state.style,{transform:"perspective("+i.settings.perspective+"px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)"})}))})}},{key:"onMouseMove",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},r=arguments[1];return r.persist(),this.updateCall!==null&&window.cancelAnimationFrame(this.updateCall),this.event=r,this.updateCall=requestAnimationFrame(this.update.bind(this,r)),i(r)}},{key:"setTransition",value:function(){var i=this;clearTimeout(this.transitionTimeout),this.setState(Object.assign({},this.state,{style:Yc({},this.state.style,{transition:this.settings.speed+"ms "+this.settings.easing})})),this.transitionTimeout=setTimeout(function(){i.setState(Object.assign({},i.state,{style:Yc({},i.state.style,{transition:""})}))},this.settings.speed)}},{key:"onMouseLeave",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},r=arguments[1];return this.setTransition(),this.settings.reset&&this.reset(),i(r)}},{key:"getValues",value:function(i){var r=(i.nativeEvent.clientX-this.left)/this.width,s=(i.nativeEvent.clientY-this.top)/this.height,o=Math.min(Math.max(r,0),1),a=Math.min(Math.max(s,0),1),l=(this.reverse*(this.settings.max/2-o*this.settings.max)).toFixed(2),f=(this.reverse*(a*this.settings.max-this.settings.max/2)).toFixed(2),h=o*100,d=a*100;return{tiltX:l,tiltY:f,percentageX:h,percentageY:d}}},{key:"updateElementPosition",value:function(){var i=this.element.getBoundingClientRect();this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.left=i.left,this.top=i.top}},{key:"update",value:function(i){var r=this.getValues(i);this.setState(Object.assign({},this.state,{style:Yc({},this.state.style,{transform:"perspective("+this.settings.perspective+"px) rotateX("+(this.settings.axis==="x"?0:r.tiltY)+"deg) rotateY("+(this.settings.axis==="y"?0:r.tiltX)+"deg) scale3d("+this.settings.scale+", "+this.settings.scale+", "+this.settings.scale+")"})})),this.updateCall=null}},{key:"render",value:function(){var i=Object.assign({},this.props.style,this.state.style);return Mj.default.createElement("div",{style:i,className:this.props.className,onMouseEnter:this.onMouseEnter,onMouseMove:this.onMouseMove,onMouseLeave:this.onMouseLeave},this.props.children)}}]),e}(dL.Component),pL=hL.default=Tj;const Kg=n=>({hidden:{y:-50,opacity:0},show:{y:0,opacity:1,transition:{type:"spring",duration:1.25,delay:n}}}),Oh=(n,e,t,i)=>({hidden:{x:n==="left"?100:n==="right"?-100:0,y:n==="up"?100:n==="down"?-100:0,opacity:0},show:{x:0,y:0,opacity:1,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),fT=(n,e,t,i)=>({hidden:{x:n==="left"?"-100%":n==="right"?"100%":0,y:n==="up"||n==="down"?"100%":0},show:{x:0,y:0,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),Pj=(n,e)=>({hidden:{},show:{transition:{staggerChildren:n,delayChildren:e||0}}}),$u=(n,e)=>function(){return tt(Vi.section,{variants:Pj(),initial:"hidden",whileInView:"show",viewport:{once:!0,amount:.25},className:`${Gn.padding} max-w-7xl mx-auto relative z-0`,children:[pe("span",{className:"hash-span",id:e,children:" "}),pe(n,{})]})},Bj=({index:n,title:e,icon:t})=>pe(pL,{className:"xs:w-[250px] w-full",children:pe(Vi.div,{variants:Oh("right","spring",n*.5,.75),className:"w-full green-pink-gradient p-[1px] rounded-[20px] shadow-card",children:tt("div",{options:{max:45,scale:1,speed:450},className:"bg-tertiary rounded-[20px] py-5 px-12 min-h-[280px] flex justify-evenly items-center flex-col",children:[pe("img",{src:t,alt:"web-development",className:"w-16 h-16 object-contain"}),pe("h3",{className:"text-white text-[20px] font-bold text-center",children:e})]})})}),Rj=()=>tt(Q1,{children:[tt(Vi.div,{variants:Kg(),children:[pe("p",{className:Gn.sectionSubText,children:"Introduction"}),pe("h2",{className:Gn.sectionHeadText,children:"Overview."})]}),pe(Vi.p,{variants:Oh("","",.1,1),className:"mt-4 text-secondary text-[17px] max-w-3xl leading-[30px]",children:"I'm a skilled software developer with experience in TypeScript and JavaScript, and expertise in frameworks like React, Node.js, and Three.js. I'm a quick learner and collaborate closely with clients to create efficient, scalable, and user-friendly solutions that solve real-world problems. Let's work together to bring your ideas to life!"}),pe("div",{className:"mt-20 flex flex-wrap gap-10",children:mj.map((n,e)=>pe(Bj,{index:e,...n},n.title))})]}),Lj=$u(Rj,"about"),Ij=()=>pe("div",{className:"flex flex-row flex-wrap justify-center gap-10",children:gj.map(n=>pe("div",{className:"w-28 h-28",children:pe(CV,{icon:n.icon})},n.name))}),Dj=$u(Ij,"");var Yg={},eg={},Fj={get exports(){return eg},set exports(n){eg=n}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var i=[],r=0;r<arguments.length;r++){var s=arguments[r];if(s){var o=typeof s;if(o==="string"||o==="number")i.push(s);else if(Array.isArray(s)){if(s.length){var a=t.apply(null,s);a&&i.push(a)}}else if(o==="object"){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){i.push(s.toString());continue}for(var l in s)e.call(s,l)&&s[l]&&i.push(l)}}}return i.join(" ")}n.exports?(t.default=t,n.exports=t):window.classNames=t})()})(Fj);Yg.__esModule=!0;Yg.default=void 0;var Nj=hM(U),co=hM(jm),kj=hM(eg);function hM(n){return n&&n.__esModule?n:{default:n}}const mL=({animate:n=!0,className:e="",layout:t="2-columns",lineColor:i="#FFF",children:r})=>(typeof window=="object"&&document.documentElement.style.setProperty("--line-color",i),Nj.default.createElement("div",{className:(0,kj.default)(e,"vertical-timeline",{"vertical-timeline--animate":n,"vertical-timeline--two-columns":t==="2-columns","vertical-timeline--one-column-left":t==="1-column"||t==="1-column-left","vertical-timeline--one-column-right":t==="1-column-right"})},r));mL.propTypes={children:co.default.oneOfType([co.default.arrayOf(co.default.node),co.default.node]).isRequired,className:co.default.string,animate:co.default.bool,layout:co.default.oneOf(["1-column-left","1-column","2-columns","1-column-right"]),lineColor:co.default.string};var Oj=mL;Yg.default=Oj;var Qg={};function V1(){return V1=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},V1.apply(this,arguments)}function Uj(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,W1(n,e)}function W1(n,e){return W1=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},W1(n,e)}function zj(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var j1=new Map,Wp=new WeakMap,hT=0,gL=void 0;function Gj(n){gL=n}function Hj(n){return n?(Wp.has(n)||(hT+=1,Wp.set(n,hT.toString())),Wp.get(n)):"0"}function Vj(n){return Object.keys(n).sort().filter(function(e){return n[e]!==void 0}).map(function(e){return e+"_"+(e==="root"?Hj(n.root):n[e])}).toString()}function Wj(n){var e=Vj(n),t=j1.get(e);if(!t){var i=new Map,r,s=new IntersectionObserver(function(o){o.forEach(function(a){var l,f=a.isIntersecting&&r.some(function(h){return a.intersectionRatio>=h});n.trackVisibility&&typeof a.isVisible>"u"&&(a.isVisible=f),(l=i.get(a.target))==null||l.forEach(function(h){h(f,a)})})},n);r=s.thresholds||(Array.isArray(n.threshold)?n.threshold:[n.threshold||0]),t={id:e,observer:s,elements:i},j1.set(e,t)}return t}function dM(n,e,t,i){if(t===void 0&&(t={}),i===void 0&&(i=gL),typeof window.IntersectionObserver>"u"&&i!==void 0){var r=n.getBoundingClientRect();return e(i,{isIntersecting:i,target:n,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:r,intersectionRect:r,rootBounds:r}),function(){}}var s=Wj(t),o=s.id,a=s.observer,l=s.elements,f=l.get(n)||[];return l.has(n)||l.set(n,f),f.push(e),a.observe(n),function(){f.splice(f.indexOf(e),1),f.length===0&&(l.delete(n),a.unobserve(n)),l.size===0&&(a.disconnect(),j1.delete(o))}}var jj=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function dT(n){return typeof n.children!="function"}var tg=function(n){Uj(e,n);function e(i){var r;return r=n.call(this,i)||this,r.node=null,r._unobserveCb=null,r.handleNode=function(s){r.node&&(r.unobserve(),!s&&!r.props.triggerOnce&&!r.props.skip&&r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=s||null,r.observeNode()},r.handleChange=function(s,o){s&&r.props.triggerOnce&&r.unobserve(),dT(r.props)||r.setState({inView:s,entry:o}),r.props.onChange&&r.props.onChange(s,o)},r.state={inView:!!i.initialInView,entry:void 0},r}var t=e.prototype;return t.componentDidUpdate=function(r){(r.rootMargin!==this.props.rootMargin||r.root!==this.props.root||r.threshold!==this.props.threshold||r.skip!==this.props.skip||r.trackVisibility!==this.props.trackVisibility||r.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())},t.componentWillUnmount=function(){this.unobserve(),this.node=null},t.observeNode=function(){if(!(!this.node||this.props.skip)){var r=this.props,s=r.threshold,o=r.root,a=r.rootMargin,l=r.trackVisibility,f=r.delay,h=r.fallbackInView;this._unobserveCb=dM(this.node,this.handleChange,{threshold:s,root:o,rootMargin:a,trackVisibility:l,delay:f},h)}},t.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},t.render=function(){if(!dT(this.props)){var r=this.state,s=r.inView,o=r.entry;return this.props.children({inView:s,entry:o,ref:this.handleNode})}var a=this.props,l=a.children,f=a.as,h=zj(a,jj);return U.createElement(f||"div",V1({ref:this.handleNode},h),l)},e}(U.Component);tg.displayName="InView";tg.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function Jj(n){var e=n===void 0?{}:n,t=e.threshold,i=e.delay,r=e.trackVisibility,s=e.rootMargin,o=e.root,a=e.triggerOnce,l=e.skip,f=e.initialInView,h=e.fallbackInView,d=U.useRef(),p=U.useState({inView:!!f}),m=p[0],v=p[1],y=U.useCallback(function(_){d.current!==void 0&&(d.current(),d.current=void 0),!l&&_&&(d.current=dM(_,function(A,w){v({inView:A,entry:w}),w.isIntersecting&&a&&d.current&&(d.current(),d.current=void 0)},{root:o,rootMargin:s,threshold:t,trackVisibility:r,delay:i},h))},[Array.isArray(t)?t.toString():t,o,s,a,l,r,h,i]);U.useEffect(function(){!d.current&&m.entry&&!a&&!l&&v({inView:!!f})});var x=[y,m.inView,m.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}const Xj=Object.freeze(Object.defineProperty({__proto__:null,InView:tg,default:tg,defaultFallbackInView:Gj,observe:dM,useInView:Jj},Symbol.toStringTag,{value:"Module"})),Kj=dI(Xj);Qg.__esModule=!0;Qg.default=void 0;var fo=pM(U),Kt=pM(jm),jp=pM(eg),Yj=Kj;function pM(n){return n&&n.__esModule?n:{default:n}}const yL=({children:n="",className:e="",contentArrowStyle:t=null,contentStyle:i=null,date:r="",dateClassName:s="",icon:o=null,iconClassName:a="",iconOnClick:l=null,onTimelineElementClick:f=null,iconStyle:h=null,id:d="",position:p="",style:m=null,textClassName:v="",intersectionObserverProps:y={rootMargin:"0px 0px -40px 0px",triggerOnce:!0},visible:x=!1})=>fo.default.createElement(Yj.InView,y,({inView:_,ref:A})=>fo.default.createElement("div",{ref:A,id:d,className:(0,jp.default)(e,"vertical-timeline-element",{"vertical-timeline-element--left":p==="left","vertical-timeline-element--right":p==="right","vertical-timeline-element--no-children":n===""}),style:m},fo.default.createElement(fo.default.Fragment,null,fo.default.createElement("span",{style:h,onClick:l,className:(0,jp.default)(a,"vertical-timeline-element-icon",{"bounce-in":_||x,"is-hidden":!(_||x)})},o),fo.default.createElement("div",{style:i,onClick:f,className:(0,jp.default)(v,"vertical-timeline-element-content",{"bounce-in":_||x,"is-hidden":!(_||x)})},fo.default.createElement("div",{style:t,className:"vertical-timeline-element-content-arrow"}),n,fo.default.createElement("span",{className:(0,jp.default)(s,"vertical-timeline-element-date")},r)))));yL.propTypes={children:Kt.default.oneOfType([Kt.default.arrayOf(Kt.default.node),Kt.default.node]),className:Kt.default.string,contentArrowStyle:Kt.default.shape({}),contentStyle:Kt.default.shape({}),date:Kt.default.node,dateClassName:Kt.default.string,icon:Kt.default.element,iconClassName:Kt.default.string,iconStyle:Kt.default.shape({}),iconOnClick:Kt.default.func,onTimelineElementClick:Kt.default.func,id:Kt.default.string,position:Kt.default.string,style:Kt.default.shape({}),textClassName:Kt.default.string,visible:Kt.default.bool,intersectionObserverProps:Kt.default.shape({root:Kt.default.object,rootMargin:Kt.default.string,threshold:Kt.default.number,triggerOnce:Kt.default.bool})};var Qj=yL;Qg.default=Qj;var vL={VerticalTimeline:Yg.default,VerticalTimelineElement:Qg.default};const Zj=({experience:n})=>tt(vL.VerticalTimelineElement,{contentStyle:{background:"#1d1836",color:"#fff"},contentArrowStyle:{borderRight:"7px solid #232631"},date:n.date,iconStyle:{background:n.iconBg},icon:pe("div",{className:"flex justify-center items-center w-full h-full",children:pe("img",{src:n.icon,alt:n.company_name,className:"w-[60%] h-[60%] object-contain"})}),children:[tt("div",{children:[pe("h3",{className:"text-white text-[24px] font-bold",children:n.title}),pe("p",{className:"text-secondary text-[16px] font-semibold",style:{margin:0},children:n.company_name})]}),pe("ul",{className:"mt-5 list-disc ml-5 space-y-2",children:n.points.map((e,t)=>pe("li",{className:"text-white-100 text-[14px] pl-1 tracking-wider",children:e},`experience-point-${t}`))})]}),qj=()=>tt(Q1,{children:[tt(Vi.div,{variants:Kg(),children:[pe("p",{className:`${Gn.sectionSubText} text-center`,children:"What I have done so far"}),pe("h2",{className:`${Gn.sectionHeadText} text-center`,children:"Work Experience."})]}),pe("div",{className:"mt-20 flex flex-col",children:pe(vL.VerticalTimeline,{children:yj.map((n,e)=>pe(Zj,{experience:n},`experience-${e}`))})})]}),$j=$u(qj,"work"),eJ=({index:n,name:e,description:t,tags:i,image:r,source_code_link:s})=>pe(Vi.div,{variants:Oh("up","spring",n*.5,.75),children:tt(pL,{options:{max:45,scale:1,speed:450},className:"bg-tertiary p-5 rounded-2xl sm:w-[360px] w-full",children:[tt("div",{className:"relative w-full h-[230px]",children:[pe("img",{src:r,alt:"project_image",className:"w-full h-full object-cover rounded-2xl"}),pe("div",{className:"absolute inset-0 flex justify-end m-3 card-img_hover",children:pe("div",{onClick:()=>window.open(s,"_blank"),className:"black-gradient w-10 h-10 rounded-full flex justify-center items-center cursor-pointer",children:pe("img",{src:J7,alt:"source code",className:"w-1/2 h-1/2 object-contain"})})})]}),tt("div",{className:"mt-5",children:[pe("h3",{className:"text-white font-bold text-[24px]",children:e}),pe("p",{className:"mt-2 text-secondary text-[14px]",children:t})]}),pe("div",{className:"mt-4 flex flex-wrap gap-2",children:i.map(o=>tt("p",{className:`text-[14px] ${o.color}`,children:["#",o.name]},`${e}-${o.name}`))})]})}),tJ=()=>tt(Q1,{children:[tt(Vi.div,{variants:Kg(),children:[pe("p",{className:`${Gn.sectionSubText} `,children:"My work"}),pe("h2",{className:`${Gn.sectionHeadText}`,children:"Projects."})]}),pe("div",{className:"w-full flex",children:pe(Vi.p,{variants:Oh("","",.1,1),className:"mt-3 text-secondary text-[17px] max-w-3xl leading-[30px]",children:"Following projects showcases my skills and experience through real-world examples of my work. Each project is briefly described with links to code repositories and live demos in it. It reflects my ability to solve complex problems, work with different technologies, and manage projects effectively."})}),pe("div",{className:"mt-20 flex flex-wrap gap-7",children:xj.map((n,e)=>pe(eJ,{index:e,...n},`project-${e}`))})]}),nJ=$u(tJ,""),iJ=({index:n,testimonial:e,name:t,designation:i,company:r,image:s})=>tt(Vi.div,{variants:Oh("","spring",n*.5,.75),className:"bg-black-200 p-10 rounded-3xl xs:w-[320px] w-full",children:[pe("p",{className:"text-white font-black text-[48px]",children:'"'}),tt("div",{className:"mt-1",children:[pe("p",{className:"text-white tracking-wider text-[18px]",children:e}),tt("div",{className:"mt-7 flex justify-between items-center gap-1",children:[tt("div",{className:"flex-1 flex flex-col",children:[tt("p",{className:"text-white font-medium text-[16px]",children:[pe("span",{className:"blue-text-gradient",children:"@"})," ",t]}),tt("p",{className:"mt-1 text-secondary text-[12px]",children:[i," of ",r]})]}),pe("img",{src:s,alt:`feedback_by-${t}`,className:"w-10 h-10 rounded-full object-cover"})]})]})]}),rJ=()=>tt("div",{className:"mt-12 bg-black-100 rounded-[20px]",children:[pe("div",{className:`bg-tertiary rounded-2xl ${Gn.padding} min-h-[300px]`,children:tt(Vi.div,{variants:Kg(),children:[pe("p",{className:Gn.sectionSubText,children:"What others say"}),pe("h2",{className:Gn.sectionHeadText,children:"Testimonials."})]})}),pe("div",{className:`-mt-20 pb-14 ${Gn.paddingX} flex flex-wrap gap-7`,children:vj.map((n,e)=>pe(iJ,{index:e,...n},n.name))})]}),sJ=$u(rJ,""),ah={_origin:"https://api.emailjs.com"},oJ=(n,e="https://api.emailjs.com")=>{ah._userID=n,ah._origin=e},xL=(n,e,t)=>{if(!n)throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!e)throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!t)throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates";return!0};class pT{constructor(e){this.status=e?e.status:0,this.text=e?e.responseText:"Network Error"}}const _L=(n,e,t={})=>new Promise((i,r)=>{const s=new XMLHttpRequest;s.addEventListener("load",({target:o})=>{const a=new pT(o);a.status===200||a.text==="OK"?i(a):r(a)}),s.addEventListener("error",({target:o})=>{r(new pT(o))}),s.open("POST",ah._origin+n,!0),Object.keys(t).forEach(o=>{s.setRequestHeader(o,t[o])}),s.send(e)}),aJ=(n,e,t,i)=>{const r=i||ah._userID;return xL(r,n,e),_L("/api/v1.0/email/send",JSON.stringify({lib_version:"3.10.0",user_id:r,service_id:n,template_id:e,template_params:t}),{"Content-type":"application/json"})},lJ=n=>{let e;if(typeof n=="string"?e=document.querySelector(n):e=n,!e||e.nodeName!=="FORM")throw"The 3rd parameter is expected to be the HTML form element or the style selector of form";return e},uJ=(n,e,t,i)=>{const r=i||ah._userID,s=lJ(t);xL(r,n,e);const o=new FormData(s);return o.append("lib_version","3.10.0"),o.append("service_id",n),o.append("template_id",e),o.append("user_id",r),_L("/api/v1.0/email/send-form",o)},cJ={init:oJ,send:aJ,sendForm:uJ},fJ=()=>{const n=U.useRef(),[e,t]=U.useState({name:"",email:"",message:""}),[i,r]=U.useState(!1),s=a=>{const{target:l}=a,{name:f,value:h}=l;t({...e,[f]:h})},o=a=>{a.preventDefault(),r(!0),cJ.send({}.VITE_APP_EMAILJS_SERVICE_ID,{}.VITE_APP_EMAILJS_TEMPLATE_ID,{from_name:e.name,to_name:"JavaScript Mastery",from_email:e.email,to_email:"sujata@jsmastery.pro",message:e.message},{}.VITE_APP_EMAILJS_PUBLIC_KEY).then(()=>{r(!1),alert("Thank you. I will get back to you as soon as possible."),t({name:"",email:"",message:""})},l=>{r(!1),console.error(l),alert("Ahh, something went wrong. Please try again.")})};return tt("div",{className:"xl:mt-12 flex xl:flex-row flex-col-reverse gap-10 overflow-hidden",children:[tt(Vi.div,{variants:fT("left","tween",.2,1),className:"flex-[0.75] bg-black-100 p-8 rounded-2xl",children:[pe("p",{className:Gn.sectionSubText,children:"Get in touch"}),pe("h3",{className:Gn.sectionHeadText,children:"Contact."}),tt("form",{ref:n,onSubmit:o,className:"mt-12 flex flex-col gap-8",children:[tt("label",{className:"flex flex-col",children:[pe("span",{className:"text-white font-medium mb-4",children:"Your Name"}),pe("input",{type:"text",name:"name",value:e.name,onChange:s,placeholder:"What's your good name?",className:"bg-tertiary py-4 px-6 placeholder:text-secondary text-white rounded-lg outline-none border-none font-medium"})]}),tt("label",{className:"flex flex-col",children:[pe("span",{className:"text-white font-medium mb-4",children:"Your email"}),pe("input",{type:"email",name:"email",value:e.email,onChange:s,placeholder:"What's your web address?",className:"bg-tertiary py-4 px-6 placeholder:text-secondary text-white rounded-lg outline-none border-none font-medium"})]}),tt("label",{className:"flex flex-col",children:[pe("span",{className:"text-white font-medium mb-4",children:"Your Message"}),pe("textarea",{rows:7,name:"message",value:e.message,onChange:s,placeholder:"What you want to say?",className:"bg-tertiary py-4 px-6 placeholder:text-secondary text-white rounded-lg outline-none border-none font-medium"})]}),pe("button",{type:"submit",className:"bg-tertiary py-3 px-8 rounded-xl outline-none w-fit text-white font-bold shadow-md shadow-primary",children:i?"Sending...":"Send"})]})]}),pe(Vi.div,{variants:fT("right","tween",.2,1),className:"xl:flex-1 xl:h-auto md:h-[550px] h-[350px]",children:pe(wV,{})})]})},hJ=$u(fJ,"contact"),dJ=()=>pe(pN,{children:tt("div",{className:"relative z-0 bg-primary",children:[tt("div",{className:"bg-hero-pattern bg-cover bg-no-repeat bg-center",children:[pe(_j,{}),pe(z7,{})]}),pe(Lj,{}),pe($j,{}),pe(Dj,{}),pe(nJ,{}),pe(sJ,{}),tt("div",{className:"relative z-0",children:[pe(hJ,{}),pe(PV,{})]})]})});Dv.createRoot(document.getElementById("root")).render(pe(ig.StrictMode,{children:pe(dJ,{})}));