diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/.fxap b/resources/[jobs]/[mechanic]/rtx_carlift/.fxap new file mode 100644 index 000000000..263a921db Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift/.fxap differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/Readme.txt b/resources/[jobs]/[mechanic]/rtx_carlift/Readme.txt new file mode 100644 index 000000000..035e8204c --- /dev/null +++ b/resources/[jobs]/[mechanic]/rtx_carlift/Readme.txt @@ -0,0 +1,36 @@ +Thank you for purchasing rtx_carlift we're grateful for your support. If you'd ever have a question and / or need our help, please reach out to us by sending an email or go ahead and create a ticket on our discord: https://discord.gg/P6KdaDpgAk + +Install instructions (Standalone): +1. Put rtx_carlift folder to your resources +2. Open config.lua file +3. Configure your config.lua to your preferences +4. Put rtx_carlift to the server.cfg +5. Put rtx_carlift_objects folder to your resources +6. Put rtx_carlift_objects to the server.cfg + +Install instructions (QBCore): +1. Put rtx_carlift folder to your resources +2. Open config.lua file +3. Replace Config.Framework = "standalone" with Config.Framework = "qbcore" +4. Configure your config.lua to your preferences +5. Put rtx_carlift to the server.cfg +6. Put rtx_carlift_objects folder to your resources +7. Put rtx_carlift_objects to the server.cfg + +Install instructions (ESX): +1. Put rtx_carlift folder to your resources +2. Open config.lua file +3. Replace Config.Framework = "standalone" with Config.Framework = "esx" +4. Configure your config.lua to your preferences +5. Put rtx_carlift to the server.cfg +6. Put rtx_carlift_objects folder to your resources +7. Put rtx_carlift_objects to the server.cfg + +License agreement / Terms of Service + +1. Any purchase is non-refundable. +2. Each product is to be used on a singular server, with the exception of a test server. +3. Any form of redistribution of our content is considered copyright infringement. +4. If any of these rules are broken, legal actions can be taken. + +© 2025 RTX Development, all rights reserved. \ No newline at end of file diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/client/main.lua b/resources/[jobs]/[mechanic]/rtx_carlift/client/main.lua new file mode 100644 index 000000000..91e1cbcb7 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift/client/main.lua differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/config.lua b/resources/[jobs]/[mechanic]/rtx_carlift/config.lua new file mode 100644 index 000000000..40d0271a7 --- /dev/null +++ b/resources/[jobs]/[mechanic]/rtx_carlift/config.lua @@ -0,0 +1,95 @@ +Config = {} + +Config.Framework = "standalone" -- types (standalone, qbcore, esx) + +Config.ESXFramework = { + newversion = false, -- use this if you using new esx version (if you get error with old esxsharedobjectmethod in console) + getsharedobject = "esx:getSharedObject", + resourcename = "es_extended", +} + +Config.QBCoreFrameworkResourceName = "qb-core" -- qb-core resource name, change this if you have different name of main resource of qbcore + +Config.InterfaceColor = "#ff66ff" -- change interface color, color must be in hex + +Config.Language = "English" -- text language from code, if you want translate interface, you need do it manually in html folder. + +Config.LiftControlDistance = 4.0 -- lift control distance + +Config.LiftOpenKey = "E" -- lift open key + +Config.InteractionSystem = 1 -- 1 == Our custom interact system, 2 == 3D Text Interact, 3 == Gta V Online Interaction Style + +Config.Target = false -- enable this if you want use target + +Config.Targettype = "qtarget" -- types - qtarget, qbtarget, oxtarget + +Config.TargetSystemsNames = {qtarget = "qtarget", qbtarget = "qb-target", oxtarget = "ox_target"} + +Config.TargetIcon = "fas fa-box-circle-check" + +Config.CarLiftCreator = false -- enable this only on dev server, you can open car lift creator via /carliftcreator command (https://www.youtube.com/watch?v=0KHiz_MKl2g) + +Config.CustomJobEvent = false -- enable this if you want use custom job event for detect if player have a job (for lifts which have enabled onlyjoballowed function) + +Config.CustomJobEventName = "rtx_carlift:SetJob" -- you can execute this event for set player job in car lift script (its clientside event) for example TriggerEvent("rtx_carlift:SetJob", "mechanic") (after that, script will know that player have job mechanic) + +-- You can detect if vehicle is on lift via our function IsVehicleOnLift example: local vehicleonlift, liftheight = exports["rtx_carlift"]:IsVehicleOnLift(vehicle) (vehicleonlift return false or true, liftheight return height on which lift currently is) + +-- for add new lift you need just copy line from 29 to 42 and paste it at under line 42 + +Config.Lifts = { + { + coords = vector3(-220.45, -1329.88, 29.9), -- lift coords + rotation = vector3(0.0, 0.0, 90.0),-- lift rotation + currentheight = 0.0, -- dont edit this + objecthandler = {frame = nil, lift = nil}, -- dont edit this + manipulating = false, -- dont edit this + manipulatingplayerid = nil, -- dont edit this + lifttype = 2, -- lift type 1-4 + buttonuppress = false, -- dont edit this + buttondownpress = false, -- dont edit this + onlyjoballowed = false, -- enable this if you want lift restricted only for some jobs (works for only for qbcore and esx) + jobs = { + }, + }, + --[[ -- Other example for new lifts (this is example for lift with job allow only + { + coords = vector3(-60.84, -165.34, -99.63), -- lift coords + rotation = vector3(0.0, 0.0, 90.0),-- lift rotation + currentheight = 0.0, -- dont edit this + objecthandler = {frame = nil, lift = nil}, -- dont edit this + manipulating = false, -- dont edit this + manipulatingplayerid = nil, -- dont edit this + lifttype = 4, -- lift type 1-4 + buttonuppress = false, -- dont edit this + buttondownpress = false, -- dont edit this + onlyjoballowed = true, -- enable this if you want lift restricted only for some jobs (works for only for qbcore and esx) + jobs = { + ["mechanic"] = true, + ["police"] = true, + }, + },-]] +} + +function Notify(text) + exports["rtx_notify"]:Notify("Lift", text, 5000, "info") -- if you get error in this line its because you dont use our notify system buy it here https://rtx.tebex.io/package/5402098 or you can use some other notify system just replace this notify line with your notify system + --exports["mythic_notify"]:SendAlert("inform", text, 5000) +end + +function DrawText3D(x, y, z, text) + local onScreen,_x,_y=World3dToScreen2d(x,y,z) + local px,py,pz=table.unpack(GetGameplayCamCoords()) + if onScreen then + SetTextScale(0.35, 0.35) + SetTextFont(4) + SetTextProportional(1) + SetTextColour(255, 255, 255, 255) + SetTextEntry("STRING") + SetTextCentre(1) + AddTextComponentString(text) + DrawText(_x,_y) + local factor = (string.len(text)) / 240 + DrawRect(_x, _y + 0.0125, 0.015 + factor, 0.03, 255, 102, 255, 150) + end +end \ No newline at end of file diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/fxmanifest.lua b/resources/[jobs]/[mechanic]/rtx_carlift/fxmanifest.lua new file mode 100644 index 000000000..3fd551d19 --- /dev/null +++ b/resources/[jobs]/[mechanic]/rtx_carlift/fxmanifest.lua @@ -0,0 +1,48 @@ +fx_version 'adamant' + +game 'gta5' + +description 'RTX CAR LIFT' + +version '100.0' + +server_scripts { + 'config.lua', + 'language/main.lua', + 'server/main.lua' +} + +client_scripts { + 'config.lua', + 'language/main.lua', + 'client/main.lua' +} + +files { + 'html/ui.html', + 'html/styles.css', + 'html/scripts.js', + 'html/gizmoapi.js', + 'html/debounce.min.js', + 'html/BebasNeueBold.ttf', + 'html/img/*.png' +} + +ui_page 'html/ui.html' + +exports { + 'IsVehicleOnLift', +} + +lua54 'yes' + +escrow_ignore { + 'config.lua', + 'language/main.lua' +} + + + + + +dependency '/assetpacks' \ No newline at end of file diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/html/BebasNeueBold.ttf b/resources/[jobs]/[mechanic]/rtx_carlift/html/BebasNeueBold.ttf new file mode 100644 index 000000000..45268ef03 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift/html/BebasNeueBold.ttf differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/html/debounce.min.js b/resources/[jobs]/[mechanic]/rtx_carlift/html/debounce.min.js new file mode 100644 index 000000000..648fe5d3c --- /dev/null +++ b/resources/[jobs]/[mechanic]/rtx_carlift/html/debounce.min.js @@ -0,0 +1,9 @@ +/* + * jQuery throttle / debounce - v1.1 - 3/7/2010 + * http://benalman.com/projects/jquery-throttle-debounce-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this); diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/html/gizmoapi.js b/resources/[jobs]/[mechanic]/rtx_carlift/html/gizmoapi.js new file mode 100644 index 000000000..864e3cbe4 --- /dev/null +++ b/resources/[jobs]/[mechanic]/rtx_carlift/html/gizmoapi.js @@ -0,0 +1,3220 @@ +function JD(n,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if(r!=="default"&&!(r in n)){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}const eO=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}};eO();var Eo=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},te={exports:{}},Tt={};/** + * @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 rd=Symbol.for("react.element"),tO=Symbol.for("react.portal"),nO=Symbol.for("react.fragment"),rO=Symbol.for("react.strict_mode"),iO=Symbol.for("react.profiler"),sO=Symbol.for("react.provider"),oO=Symbol.for("react.context"),aO=Symbol.for("react.forward_ref"),lO=Symbol.for("react.suspense"),uO=Symbol.for("react.memo"),cO=Symbol.for("react.lazy"),JM=Symbol.iterator;function fO(n){return n===null||typeof n!="object"?null:(n=JM&&n[JM]||n["@@iterator"],typeof n=="function"?n:null)}var kC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zC=Object.assign,FC={};function Uu(n,e,t){this.props=n,this.context=e,this.refs=FC,this.updater=t||kC}Uu.prototype.isReactComponent={};Uu.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")};Uu.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function UC(){}UC.prototype=Uu.prototype;function r1(n,e,t){this.props=n,this.context=e,this.refs=FC,this.updater=t||kC}var i1=r1.prototype=new UC;i1.constructor=r1;zC(i1,Uu.prototype);i1.isPureReactComponent=!0;var eb=Array.isArray,BC=Object.prototype.hasOwnProperty,s1={current:null},VC={key:!0,ref:!0,__self:!0,__source:!0};function GC(n,e,t){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)BC.call(e,r)&&!VC.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=t;else if(1>>1,k=z[Z];if(0>>1;Zi(me,G))Xi(Te,me)?(z[Z]=Te,z[X]=G,Z=X):(z[Z]=me,z[N]=G,Z=N);else if(Xi(Te,G))z[Z]=Te,z[X]=G,Z=X;else break e}}return F}function i(z,F){var G=z.sortIndex-F.sortIndex;return G!==0?G:z.id-F.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 c=[],f=[],d=1,h=null,p=3,g=!1,v=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(z){for(var F=t(f);F!==null;){if(F.callback===null)r(f);else if(F.startTime<=z)r(f),F.sortIndex=F.expirationTime,e(c,F);else break;F=t(f)}}function E(z){if(y=!1,M(z),!v)if(t(c)!==null)v=!0,le(C);else{var F=t(f);F!==null&&pe(E,F.startTime-z)}}function C(z,F){v=!1,y&&(y=!1,w(T),T=-1),g=!0;var G=p;try{for(M(F),h=t(c);h!==null&&(!(h.expirationTime>F)||z&&!Y());){var Z=h.callback;if(typeof Z=="function"){h.callback=null,p=h.priorityLevel;var k=Z(h.expirationTime<=F);F=n.unstable_now(),typeof k=="function"?h.callback=k:h===t(c)&&r(c),M(F)}else r(c);h=t(c)}if(h!==null)var W=!0;else{var N=t(f);N!==null&&pe(E,N.startTime-F),W=!1}return W}finally{h=null,p=G,g=!1}}var P=!1,R=null,T=-1,L=5,D=-1;function Y(){return!(n.unstable_now()-Dz||125Z?(z.sortIndex=G,e(f,z),t(c)===null&&z===t(f)&&(y?(w(T),T=-1):y=!0,pe(E,G-Z))):(z.sortIndex=k,e(c,z),v||g||(v=!0,le(C))),z},n.unstable_shouldYield=Y,n.unstable_wrapCallback=function(z){var F=p;return function(){var G=p;p=F;try{return z.apply(this,arguments)}finally{p=G}}}})(WC);HC.exports=WC;/** + * @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 $C=te.exports,Yr=HC.exports;function Re(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;te}return!1}function vr(n,e,t,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Yn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Yn[n]=new vr(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Yn[e]=new vr(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Yn[n]=new vr(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Yn[n]=new vr(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){Yn[n]=new vr(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Yn[n]=new vr(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Yn[n]=new vr(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Yn[n]=new vr(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Yn[n]=new vr(n,5,!1,n.toLowerCase(),null,!1,!1)});var a1=/[\-:]([a-z])/g;function l1(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(a1,l1);Yn[e]=new vr(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(a1,l1);Yn[e]=new vr(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(a1,l1);Yn[e]=new vr(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Yn[n]=new vr(n,1,!1,n.toLowerCase(),null,!1,!1)});Yn.xlinkHref=new vr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Yn[n]=new vr(n,1,!1,n.toLowerCase(),null,!0,!0)});function u1(n,e,t,r){var i=Yn.hasOwnProperty(e)?Yn[e]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var c=` +`+i[o].replace(" at new "," at ");return n.displayName&&c.includes("")&&(c=c.replace("",n.displayName)),c}while(1<=o&&0<=a);break}}}finally{Rv=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Xc(n):""}function xO(n){switch(n.tag){case 5:return Xc(n.type);case 16:return Xc("Lazy");case 13:return Xc("Suspense");case 19:return Xc("SuspenseList");case 0:case 2:case 15:return n=Lv(n.type,!1),n;case 11:return n=Lv(n.type.render,!1),n;case 1:return n=Lv(n.type,!0),n;default:return""}}function d_(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 Jl:return"Fragment";case Kl:return"Portal";case u_:return"Profiler";case c1:return"StrictMode";case c_:return"Suspense";case f_:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case YC:return(n.displayName||"Context")+".Consumer";case XC:return(n._context.displayName||"Context")+".Provider";case f1:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case d1:return e=n.displayName||null,e!==null?e:d_(n.type)||"Memo";case _o:e=n._payload,n=n._init;try{return d_(n(e))}catch{}}return null}function SO(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 d_(e);case 8:return e===c1?"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 Uo(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function ZC(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function wO(n){var e=ZC(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t!="undefined"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Nh(n){n._valueTracker||(n._valueTracker=wO(n))}function QC(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=ZC(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function gm(n){if(n=n||(typeof document!="undefined"?document:void 0),typeof n=="undefined")return null;try{return n.activeElement||n.body}catch{return n.body}}function h_(n,e){var t=e.checked;return dn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t!=null?t:n._wrapperState.initialChecked})}function sb(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=Uo(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function KC(n,e){e=e.checked,e!=null&&u1(n,"checked",e,!1)}function p_(n,e){KC(n,e);var t=Uo(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?m_(n,e.type,t):e.hasOwnProperty("defaultValue")&&m_(n,e.type,Uo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function ob(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="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 m_(n,e,t){(e!=="number"||gm(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Yc=Array.isArray;function pu(n,e,t,r){if(n=n.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Dh.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function yf(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var ef={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},MO=["Webkit","ms","Moz","O"];Object.keys(ef).forEach(function(n){MO.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),ef[e]=ef[n]})});function nA(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||ef.hasOwnProperty(n)&&ef[n]?(""+e).trim():e+"px"}function rA(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=nA(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var bO=dn({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 y_(n,e){if(e){if(bO[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Re(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Re(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Re(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Re(62))}}function __(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 x_=null;function h1(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var S_=null,mu=null,gu=null;function ub(n){if(n=od(n)){if(typeof S_!="function")throw Error(Re(280));var e=n.stateNode;e&&(e=wg(e),S_(n.stateNode,n.type,e))}}function iA(n){mu?gu?gu.push(n):gu=[n]:mu=n}function sA(){if(mu){var n=mu,e=gu;if(gu=mu=null,ub(n),e)for(n=0;n>>=0,n===0?32:31-(OO(n)/kO|0)|0}var Oh=64,kh=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 xm(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,i=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~i;a!==0?r=qc(a):(s&=o,s!==0&&(r=qc(s)))}else o=t&~i,o!==0?r=qc(o):s!==0&&(r=qc(s));if(r===0)return 0;if(e!==0&&e!==r&&(e&i)===0&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if((r&4)!==0&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0t;t++)e.push(n);return e}function id(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-zi(e),n[e]=t}function BO(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 r=n.eventTimes;for(n=n.expirationTimes;0=nf),yb=String.fromCharCode(32),_b=!1;function EA(n,e){switch(n){case"keyup":return pk.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function TA(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var eu=!1;function gk(n,e){switch(n){case"compositionend":return TA(e);case"keypress":return e.which!==32?null:(_b=!0,yb);case"textInput":return n=e.data,n===yb&&_b?null:n;default:return null}}function vk(n,e){if(eu)return n==="compositionend"||!S1&&EA(n,e)?(n=MA(),Yp=y1=To=null,eu=!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)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Mb(t)}}function RA(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?RA(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function LA(){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 w1(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 Tk(n){var e=LA(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&RA(t.ownerDocument.documentElement,t)){if(r!==null&&w1(t)){if(e=r.start,n=r.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 i=t.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!n.extend&&s>r&&(i=r,r=s,s=i),i=bb(t,s);var o=bb(t,r);i&&o&&(n.rangeCount!==1||n.anchorNode!==i.node||n.anchorOffset!==i.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),n.removeAllRanges(),s>r?(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=document.documentMode,tu=null,C_=null,sf=null,A_=!1;function Eb(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;A_||tu==null||tu!==gm(r)||(r=tu,"selectionStart"in r&&w1(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),sf&&bf(sf,r)||(sf=r,r=Mm(C_,"onSelect"),0iu||(n.current=D_[iu],D_[iu]=null,iu--)}function Zt(n,e){iu++,D_[iu]=n.current,n.current=e}var Bo={},ar=jo(Bo),Cr=jo(!1),Ha=Bo;function bu(n,e){var t=n.type.contextTypes;if(!t)return Bo;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=i),i}function Ar(n){return n=n.childContextTypes,n!=null}function Em(){Jt(Cr),Jt(ar)}function Ib(n,e,t){if(ar.current!==Bo)throw Error(Re(168));Zt(ar,e),Zt(Cr,t)}function BA(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Re(108,SO(n)||"Unknown",i));return dn({},t,r)}function Tm(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Bo,Ha=ar.current,Zt(ar,n),Zt(Cr,Cr.current),!0}function Nb(n,e,t){var r=n.stateNode;if(!r)throw Error(Re(169));t?(n=BA(n,e,Ha),r.__reactInternalMemoizedMergedChildContext=n,Jt(Cr),Jt(ar),Zt(ar,n)):Jt(Cr),Zt(Cr,t)}var Os=null,Mg=!1,$v=!1;function VA(n){Os===null?Os=[n]:Os.push(n)}function Fk(n){Mg=!0,VA(n)}function Xo(){if(!$v&&Os!==null){$v=!0;var n=0,e=Wt;try{var t=Os;for(Wt=1;n>=o,i-=o,zs=1<<32-zi(e)+i|t<T?(L=R,R=null):L=R.sibling;var D=p(w,R,M[T],E);if(D===null){R===null&&(R=L);break}n&&R&&D.alternate===null&&e(w,R),_=s(D,_,T),P===null?C=D:P.sibling=D,P=D,R=L}if(T===M.length)return t(w,R),rn&&ga(w,T),C;if(R===null){for(;TT?(L=R,R=null):L=R.sibling;var Y=p(w,R,D.value,E);if(Y===null){R===null&&(R=L);break}n&&R&&Y.alternate===null&&e(w,R),_=s(Y,_,T),P===null?C=Y:P.sibling=Y,P=Y,R=L}if(D.done)return t(w,R),rn&&ga(w,T),C;if(R===null){for(;!D.done;T++,D=M.next())D=h(w,D.value,E),D!==null&&(_=s(D,_,T),P===null?C=D:P.sibling=D,P=D);return rn&&ga(w,T),C}for(R=r(w,R);!D.done;T++,D=M.next())D=g(R,w,T,D.value,E),D!==null&&(n&&D.alternate!==null&&R.delete(D.key===null?T:D.key),_=s(D,_,T),P===null?C=D:P.sibling=D,P=D);return n&&R.forEach(function(fe){return e(w,fe)}),rn&&ga(w,T),C}function x(w,_,M,E){if(typeof M=="object"&&M!==null&&M.type===Jl&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case Ih:e:{for(var C=M.key,P=_;P!==null;){if(P.key===C){if(C=M.type,C===Jl){if(P.tag===7){t(w,P.sibling),_=i(P,M.props.children),_.return=w,w=_;break e}}else if(P.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===_o&&Bb(C)===P.type){t(w,P.sibling),_=i(P,M.props),_.ref=wc(w,P,M),_.return=w,w=_;break e}t(w,P);break}else e(w,P);P=P.sibling}M.type===Jl?(_=Oa(M.props.children,w.mode,E,M.key),_.return=w,w=_):(E=nm(M.type,M.key,M.props,null,w.mode,E),E.ref=wc(w,_,M),E.return=w,w=E)}return o(w);case Kl:e:{for(P=M.key;_!==null;){if(_.key===P)if(_.tag===4&&_.stateNode.containerInfo===M.containerInfo&&_.stateNode.implementation===M.implementation){t(w,_.sibling),_=i(_,M.children||[]),_.return=w,w=_;break e}else{t(w,_);break}else e(w,_);_=_.sibling}_=Jv(M,w.mode,E),_.return=w,w=_}return o(w);case _o:return P=M._init,x(w,_,P(M._payload),E)}if(Yc(M))return v(w,_,M,E);if(vc(M))return y(w,_,M,E);Hh(w,M)}return typeof M=="string"&&M!==""||typeof M=="number"?(M=""+M,_!==null&&_.tag===6?(t(w,_.sibling),_=i(_,M),_.return=w,w=_):(t(w,_),_=Kv(M,w.mode,E),_.return=w,w=_),o(w)):t(w,_)}return x}var Tu=qA(!0),ZA=qA(!1),ad={},ls=jo(ad),Af=jo(ad),Pf=jo(ad);function Ta(n){if(n===ad)throw Error(Re(174));return n}function L1(n,e){switch(Zt(Pf,e),Zt(Af,n),Zt(ls,ad),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:v_(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=v_(e,n)}Jt(ls),Zt(ls,e)}function Cu(){Jt(ls),Jt(Af),Jt(Pf)}function QA(n){Ta(Pf.current);var e=Ta(ls.current),t=v_(e,n.type);e!==t&&(Zt(Af,n),Zt(ls,t))}function I1(n){Af.current===n&&(Jt(ls),Jt(Af))}var ln=jo(0);function Im(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)!==0)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 jv=[];function N1(){for(var n=0;nt?t:4,n(!0);var r=Xv.transition;Xv.transition={};try{n(!1),e()}finally{Wt=t,Xv.transition=r}}function h3(){return wi().memoizedState}function Gk(n,e,t){var r=ko(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},p3(n))m3(e,t);else if(t=$A(n,e,t,r),t!==null){var i=mr();Fi(t,n,r,i),g3(t,e,r)}}function Hk(n,e,t){var r=ko(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(p3(n))m3(e,i);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(i.hasEagerState=!0,i.eagerState=a,Bi(a,o)){var c=e.interleaved;c===null?(i.next=i,P1(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}t=$A(n,e,i,r),t!==null&&(i=mr(),Fi(t,n,r,i),g3(t,e,r))}}function p3(n){var e=n.alternate;return n===fn||e!==null&&e===fn}function m3(n,e){of=Nm=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function g3(n,e,t){if((t&4194240)!==0){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,m1(n,t)}}var Dm={readContext:Si,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useInsertionEffect:tr,useLayoutEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useMutableSource:tr,useSyncExternalStore:tr,useId:tr,unstable_isNewReconciler:!1},Wk={readContext:Si,useCallback:function(n,e){return es().memoizedState=[n,e===void 0?null:e],n},useContext:Si,useEffect:Gb,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Kp(4194308,4,l3.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Kp(4194308,4,n,e)},useInsertionEffect:function(n,e){return Kp(4,2,n,e)},useMemo:function(n,e){var t=es();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=es();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=Gk.bind(null,fn,n),[r.memoizedState,n]},useRef:function(n){var e=es();return n={current:n},e.memoizedState=n},useState:Vb,useDebugValue:F1,useDeferredValue:function(n){return es().memoizedState=n},useTransition:function(){var n=Vb(!1),e=n[0];return n=Vk.bind(null,n[1]),es().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=fn,i=es();if(rn){if(t===void 0)throw Error(Re(407));t=t()}else{if(t=e(),Hn===null)throw Error(Re(349));($a&30)!==0||e3(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,Gb(n3.bind(null,r,s,n),[n]),r.flags|=2048,If(9,t3.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=es(),e=Hn.identifierPrefix;if(rn){var t=Fs,r=zs;t=(r&~(1<<32-zi(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=Rf++,0<\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=o.createElement(t,{is:r.is}):(n=o.createElement(t),t==="select"&&(o=n,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):n=o.createElementNS(n,t),n[ss]=e,n[Cf]=r,E3(n,e,!1,!1),e.stateNode=n;e:{switch(o=__(t,r),t){case"dialog":Qt("cancel",n),Qt("close",n),i=r;break;case"iframe":case"object":case"embed":Qt("load",n),i=r;break;case"video":case"audio":for(i=0;iPu&&(e.flags|=128,r=!0,Mc(s,!1),e.lanes=4194304)}else{if(!r)if(n=Im(o),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Mc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!rn)return nr(e),null}else 2*_n()-s.renderingStartTime>Pu&&t!==1073741824&&(e.flags|=128,r=!0,Mc(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=_n(),e.sibling=null,t=ln.current,Zt(ln,r?t&1|2:t&1),e):(nr(e),null);case 22:case 23:return W1(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&(e.mode&1)!==0?(Br&1073741824)!==0&&(nr(e),e.subtreeFlags&6&&(e.flags|=8192)):nr(e),null;case 24:return null;case 25:return null}throw Error(Re(156,e.tag))}function Kk(n,e){switch(b1(e),e.tag){case 1:return Ar(e.type)&&Em(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Cu(),Jt(Cr),Jt(ar),N1(),n=e.flags,(n&65536)!==0&&(n&128)===0?(e.flags=n&-65537|128,e):null;case 5:return I1(e),null;case 13:if(Jt(ln),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Re(340));Eu()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Jt(ln),null;case 4:return Cu(),null;case 10:return A1(e.type._context),null;case 22:case 23:return W1(),null;case 24:return null;default:return null}}var $h=!1,or=!1,Jk=typeof WeakSet=="function"?WeakSet:Set,$e=null;function lu(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){mn(n,e,r)}else t.current=null}function j_(n,e,t){try{t()}catch(r){mn(n,e,r)}}var Qb=!1;function ez(n,e){if(P_=Sm,n=LA(),w1(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,c=-1,f=0,d=0,h=n,p=null;t:for(;;){for(var g;h!==t||i!==0&&h.nodeType!==3||(a=o+i),h!==s||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(g=h.firstChild)!==null;)p=h,h=g;for(;;){if(h===n)break t;if(p===t&&++f===i&&(a=o),p===s&&++d===r&&(c=o),(g=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=g}t=a===-1||c===-1?null:{start:a,end:c}}else t=null}t=t||{start:0,end:0}}else t=null;for(R_={focusedElem:n,selectionRange:t},Sm=!1,$e=e;$e!==null;)if(e=$e,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,$e=n;else for(;$e!==null;){e=$e;try{var v=e.alternate;if((e.flags&1024)!==0)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,x=v.memoizedState,w=e.stateNode,_=w.getSnapshotBeforeUpdate(e.elementType===e.type?y:Ii(e.type,y),x);w.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var M=e.stateNode.containerInfo;M.nodeType===1?M.textContent="":M.nodeType===9&&M.documentElement&&M.removeChild(M.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Re(163))}}catch(E){mn(e,e.return,E)}if(n=e.sibling,n!==null){n.return=e.return,$e=n;break}$e=e.return}return v=Qb,Qb=!1,v}function af(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&n)===n){var s=i.destroy;i.destroy=void 0,s!==void 0&&j_(e,t,s)}i=i.next}while(i!==r)}}function Tg(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 r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function X_(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 A3(n){var e=n.alternate;e!==null&&(n.alternate=null,A3(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[ss],delete e[Cf],delete e[N_],delete e[kk],delete e[zk])),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 P3(n){return n.tag===5||n.tag===3||n.tag===4}function Kb(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||P3(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 Y_(n,e,t){var r=n.tag;if(r===5||r===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=bm));else if(r!==4&&(n=n.child,n!==null))for(Y_(n,e,t),n=n.sibling;n!==null;)Y_(n,e,t),n=n.sibling}function q_(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(q_(n,e,t),n=n.sibling;n!==null;)q_(n,e,t),n=n.sibling}var $n=null,Ni=!1;function uo(n,e,t){for(t=t.child;t!==null;)R3(n,e,t),t=t.sibling}function R3(n,e,t){if(as&&typeof as.onCommitFiberUnmount=="function")try{as.onCommitFiberUnmount(yg,t)}catch{}switch(t.tag){case 5:or||lu(t,e);case 6:var r=$n,i=Ni;$n=null,uo(n,e,t),$n=r,Ni=i,$n!==null&&(Ni?(n=$n,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):$n.removeChild(t.stateNode));break;case 18:$n!==null&&(Ni?(n=$n,t=t.stateNode,n.nodeType===8?Wv(n.parentNode,t):n.nodeType===1&&Wv(n,t),wf(n)):Wv($n,t.stateNode));break;case 4:r=$n,i=Ni,$n=t.stateNode.containerInfo,Ni=!0,uo(n,e,t),$n=r,Ni=i;break;case 0:case 11:case 14:case 15:if(!or&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&((s&2)!==0||(s&4)!==0)&&j_(t,e,o),i=i.next}while(i!==r)}uo(n,e,t);break;case 1:if(!or&&(lu(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(a){mn(t,e,a)}uo(n,e,t);break;case 21:uo(n,e,t);break;case 22:t.mode&1?(or=(r=or)||t.memoizedState!==null,uo(n,e,t),or=r):uo(n,e,t);break;default:uo(n,e,t)}}function Jb(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new Jk),e.forEach(function(r){var i=uz.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function Ci(n,e){var t=e.deletions;if(t!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=_n()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*nz(r/1960))-r,10n?16:n,Co===null)var r=!1;else{if(n=Co,Co=null,zm=0,(It&6)!==0)throw Error(Re(331));var i=It;for(It|=4,$e=n.current;$e!==null;){var s=$e,o=s.child;if(($e.flags&16)!==0){var a=s.deletions;if(a!==null){for(var c=0;c_n()-G1?Da(n,0):V1|=t),Pr(n,e)}function F3(n,e){e===0&&((n.mode&1)===0?e=1:(e=kh,kh<<=1,(kh&130023424)===0&&(kh=4194304)));var t=mr();n=$s(n,e),n!==null&&(id(n,e,t),Pr(n,t))}function lz(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),F3(n,t)}function uz(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,i=n.memoizedState;i!==null&&(t=i.retryLane);break;case 19:r=n.stateNode;break;default:throw Error(Re(314))}r!==null&&r.delete(e),F3(n,t)}var U3;U3=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Cr.current)Er=!0;else{if((n.lanes&t)===0&&(e.flags&128)===0)return Er=!1,Zk(n,e,t);Er=(n.flags&131072)!==0}else Er=!1,rn&&(e.flags&1048576)!==0&&GA(e,Am,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Jp(n,e),n=e.pendingProps;var i=bu(e,ar.current);yu(e,t),i=O1(null,e,r,n,i,t);var s=k1();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ar(r)?(s=!0,Tm(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,R1(e),i.updater=bg,e.stateNode=i,i._reactInternals=e,U_(e,r,n,t),e=G_(null,e,r,!0,s,t)):(e.tag=0,rn&&s&&M1(e),dr(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(Jp(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=fz(r),n=Ii(r,n),i){case 0:e=V_(null,e,r,n,t);break e;case 1:e=Yb(null,e,r,n,t);break e;case 11:e=jb(null,e,r,n,t);break e;case 14:e=Xb(null,e,r,Ii(r.type,n),t);break e}throw Error(Re(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ii(r,i),V_(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ii(r,i),Yb(n,e,r,i,t);case 3:e:{if(w3(e),n===null)throw Error(Re(387));r=e.pendingProps,s=e.memoizedState,i=s.element,jA(n,e),Lm(e,r,null,t);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Au(Error(Re(423)),e),e=qb(n,e,r,t,i);break e}else if(r!==i){i=Au(Error(Re(424)),e),e=qb(n,e,r,t,i);break e}else for(Hr=No(e.stateNode.containerInfo.firstChild),Wr=e,rn=!0,Di=null,t=ZA(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Eu(),r===i){e=js(n,e,t);break e}dr(n,e,r,t)}e=e.child}return e;case 5:return QA(e),n===null&&k_(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,o=i.children,L_(r,i)?o=null:s!==null&&L_(r,s)&&(e.flags|=32),S3(n,e),dr(n,e,o,t),e.child;case 6:return n===null&&k_(e),null;case 13:return M3(n,e,t);case 4:return L1(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=Tu(e,null,r,t):dr(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ii(r,i),jb(n,e,r,i,t);case 7:return dr(n,e,e.pendingProps,t),e.child;case 8:return dr(n,e,e.pendingProps.children,t),e.child;case 12:return dr(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Zt(Pm,r._currentValue),r._currentValue=o,s!==null)if(Bi(s.value,o)){if(s.children===i.children&&!Cr.current){e=js(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 c=a.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=Vs(-1,t&-t),c.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var d=f.pending;d===null?c.next=c:(c.next=d.next,d.next=c),f.pending=c}}s.lanes|=t,c=s.alternate,c!==null&&(c.lanes|=t),z_(s.return,t,e),a.lanes|=t;break}c=c.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(Re(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),z_(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}dr(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,yu(e,t),i=Si(i),r=r(i),e.flags|=1,dr(n,e,r,t),e.child;case 14:return r=e.type,i=Ii(r,e.pendingProps),i=Ii(r.type,i),Xb(n,e,r,i,t);case 15:return _3(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ii(r,i),Jp(n,e),e.tag=1,Ar(r)?(n=!0,Tm(e)):n=!1,yu(e,t),YA(e,r,i),U_(e,r,i,t),G_(null,e,r,!0,n,t);case 19:return b3(n,e,t);case 22:return x3(n,e,t)}throw Error(Re(156,e.tag))};function B3(n,e){return dA(n,e)}function cz(n,e,t,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(n,e,t,r){return new cz(n,e,t,r)}function j1(n){return n=n.prototype,!(!n||!n.isReactComponent)}function fz(n){if(typeof n=="function")return j1(n)?1:0;if(n!=null){if(n=n.$$typeof,n===f1)return 11;if(n===d1)return 14}return 2}function zo(n,e){var t=n.alternate;return t===null?(t=yi(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 nm(n,e,t,r,i,s){var o=2;if(r=n,typeof n=="function")j1(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Jl:return Oa(t.children,i,s,e);case c1:o=8,i|=8;break;case u_:return n=yi(12,t,e,i|2),n.elementType=u_,n.lanes=s,n;case c_:return n=yi(13,t,e,i),n.elementType=c_,n.lanes=s,n;case f_:return n=yi(19,t,e,i),n.elementType=f_,n.lanes=s,n;case qC:return Ag(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case XC:o=10;break e;case YC:o=9;break e;case f1:o=11;break e;case d1:o=14;break e;case _o:o=16,r=null;break e}throw Error(Re(130,n==null?n:typeof n,""))}return e=yi(o,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function Oa(n,e,t,r){return n=yi(7,n,r,e),n.lanes=t,n}function Ag(n,e,t,r){return n=yi(22,n,r,e),n.elementType=qC,n.lanes=t,n.stateNode={isHidden:!1},n}function Kv(n,e,t){return n=yi(6,n,null,e),n.lanes=t,n}function Jv(n,e,t){return e=yi(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function dz(n,e,t,r,i){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=Nv(0),this.expirationTimes=Nv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nv(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function X1(n,e,t,r,i,s,o,a,c){return n=new dz(n,e,t,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=yi(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},R1(s),n}function hz(n,e,t){var r=3(s[`${n}:${o}`]=a=>r[o](a.detail),s),{});Tz(()=>(Object.keys(i).forEach(s=>{window.removeEventListener(s,i[s]),window.addEventListener(s,i[s])}),()=>Object.keys(i).forEach(s=>{window.removeEventListener(s,i[s])})),[i])}function t(r){return(...i)=>Ez(`${n}:${String(r)}`,i[0])}return[e,t]}function j3(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n))for(e=0;e({fontFamily:n.fontFamily||"sans-serif"})}var Rz=Object.defineProperty,uE=Object.getOwnPropertySymbols,Lz=Object.prototype.hasOwnProperty,Iz=Object.prototype.propertyIsEnumerable,cE=(n,e,t)=>e in n?Rz(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,fE=(n,e)=>{for(var t in e||(e={}))Lz.call(e,t)&&cE(n,t,e[t]);if(uE)for(var t of uE(e))Iz.call(e,t)&&cE(n,t,e[t]);return n};function Nz(n){return e=>({WebkitTapHighlightColor:"transparent",[e||"&:focus"]:fE({},n.focusRing==="always"||n.focusRing==="auto"?n.focusRingStyles.styles(n):n.focusRingStyles.resetStyles(n)),[e?e.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:fE({},n.focusRing==="auto"||n.focusRing==="never"?n.focusRingStyles.resetStyles(n):null)})}function ld(n){return e=>typeof n.primaryShade=="number"?n.primaryShade:n.primaryShade[e||n.colorScheme]}function Q1(n){const e=ld(n);return(t,r,i=!0,s=!0)=>{if(typeof t=="string"&&t.includes(".")){const[a,c]=t.split("."),f=parseInt(c,10);if(a in n.colors&&f>=0&&f<10)return n.colors[a][typeof r=="number"&&!s?r:f]}const o=typeof r=="number"?r:e();return t in n.colors?n.colors[t][o]:i?n.colors[n.primaryColor][o]:t}}function Y3(n){let e="";for(let t=1;t{const i={from:(r==null?void 0:r.from)||n.defaultGradient.from,to:(r==null?void 0:r.to)||n.defaultGradient.to,deg:(r==null?void 0:r.deg)||n.defaultGradient.deg};return`linear-gradient(${i.deg}deg, ${e(i.from,t(),!1)} 0%, ${e(i.to,t(),!1)} 100%)`}}function K1(n){if(typeof n.size=="number")return n.size;const e=n.sizes[n.size];return e!==void 0?e:n.size||n.sizes.md}function kz(n){return e=>`@media (min-width: ${K1({size:e,sizes:n.breakpoints})}px)`}function zz(n){return e=>`@media (max-width: ${K1({size:e,sizes:n.breakpoints})-1}px)`}function Fz(n){return/^#?([0-9A-F]{3}){1,2}$/i.test(n)}function Uz(n){let e=n.replace("#","");if(e.length===3){const o=e.split("");e=[o[0],o[0],o[1],o[1],o[2],o[2]].join("")}const t=parseInt(e,16),r=t>>16&255,i=t>>8&255,s=t&255;return{r,g:i,b:s,a:1}}function Bz(n){const[e,t,r,i]=n.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:e,g:t,b:r,a:i||1}}function J1(n){return Fz(n)?Uz(n):n.startsWith("rgb")?Bz(n):{r:0,g:0,b:0,a:1}}function Yl(n,e){if(typeof n!="string"||e>1||e<0)return"rgba(0, 0, 0, 1)";const{r:t,g:r,b:i}=J1(n);return`rgba(${t}, ${r}, ${i}, ${e})`}function Vz(n=0){return{position:"absolute",top:n,right:n,left:n,bottom:n}}function Gz(n,e){const{r:t,g:r,b:i,a:s}=J1(n),o=1-e,a=c=>Math.round(c*o);return`rgba(${a(t)}, ${a(r)}, ${a(i)}, ${s})`}function Hz(n,e){const{r:t,g:r,b:i,a:s}=J1(n),o=a=>Math.round(a+(255-a)*e);return`rgba(${o(t)}, ${o(r)}, ${o(i)}, ${s})`}function Wz(n){return e=>{if(typeof e=="number")return e;const t=typeof n.defaultRadius=="number"?n.defaultRadius:n.radius[n.defaultRadius]||n.defaultRadius;return n.radius[e]||e||t}}function $z(n,e){if(typeof n=="string"&&n.includes(".")){const[t,r]=n.split("."),i=parseInt(r,10);if(t in e.colors&&i>=0&&i<10)return{isSplittedColor:!0,key:t,shade:i}}return{isSplittedColor:!1}}function jz(n){const e=Q1(n),t=ld(n),r=q3(n);return({variant:i,color:s,gradient:o,primaryFallback:a})=>{const c=$z(s,n);switch(i){case"light":return{border:"transparent",background:Yl(e(s,n.colorScheme==="dark"?8:0,a,!1),n.colorScheme==="dark"?.2:1),color:s==="dark"?n.colorScheme==="dark"?n.colors.dark[0]:n.colors.dark[9]:e(s,n.colorScheme==="dark"?2:t("light")),hover:Yl(e(s,n.colorScheme==="dark"?7:1,a,!1),n.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:s==="dark"?n.colorScheme==="dark"?n.colors.dark[0]:n.colors.dark[9]:e(s,n.colorScheme==="dark"?2:t("light")),hover:Yl(e(s,n.colorScheme==="dark"?8:0,a,!1),n.colorScheme==="dark"?.2:1)};case"outline":return{border:e(s,n.colorScheme==="dark"?5:t("light")),background:"transparent",color:e(s,n.colorScheme==="dark"?5:t("light")),hover:n.colorScheme==="dark"?Yl(e(s,5,a,!1),.05):Yl(e(s,0,a,!1),.35)};case"default":return{border:n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[4],background:n.colorScheme==="dark"?n.colors.dark[6]:n.white,color:n.colorScheme==="dark"?n.white:n.black,hover:n.colorScheme==="dark"?n.colors.dark[5]:n.colors.gray[0]};case"white":return{border:"transparent",background:n.white,color:e(s,t()),hover:null};case"transparent":return{border:"transparent",color:s==="dark"?n.colorScheme==="dark"?n.colors.dark[0]:n.colors.dark[9]:e(s,n.colorScheme==="dark"?2:t("light")),background:"transparent",hover:null};case"gradient":return{background:r(o),color:n.white,border:"transparent",hover:null};default:{const f=t(),d=c.isSplittedColor?c.shade:f,h=c.isSplittedColor?c.key:s;return{border:"transparent",background:e(h,d,a),color:n.white,hover:e(h,d===9?8:d+1)}}}}}function Xz(n){return e=>{const t=ld(n)(e);return n.colors[n.primaryColor][t]}}function Yz(n){return{"@media (hover: hover)":{"&:hover":n},"@media (hover: none)":{"&:active":n}}}function qz(n){return()=>({userSelect:"none",color:n.colorScheme==="dark"?n.colors.dark[3]:n.colors.gray[5]})}const Pn={fontStyles:Pz,themeColor:Q1,focusStyles:Nz,linearGradient:Dz,radialGradient:Oz,smallerThan:zz,largerThan:kz,rgba:Yl,size:K1,cover:Vz,darken:Gz,lighten:Hz,radius:Wz,variant:jz,primaryShade:ld,hover:Yz,gradient:q3,primaryColor:Xz,placeholderStyles:qz};var Zz=Object.defineProperty,Qz=Object.defineProperties,Kz=Object.getOwnPropertyDescriptors,dE=Object.getOwnPropertySymbols,Jz=Object.prototype.hasOwnProperty,e4=Object.prototype.propertyIsEnumerable,hE=(n,e,t)=>e in n?Zz(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,t4=(n,e)=>{for(var t in e||(e={}))Jz.call(e,t)&&hE(n,t,e[t]);if(dE)for(var t of dE(e))e4.call(e,t)&&hE(n,t,e[t]);return n},n4=(n,e)=>Qz(n,Kz(e));function r4(n){return n4(t4({},n),{fn:{fontStyles:Pn.fontStyles(n),themeColor:Pn.themeColor(n),focusStyles:Pn.focusStyles(n),largerThan:Pn.largerThan(n),smallerThan:Pn.smallerThan(n),radialGradient:Pn.radialGradient,linearGradient:Pn.linearGradient,gradient:Pn.gradient(n),rgba:Pn.rgba,size:Pn.size,cover:Pn.cover,lighten:Pn.lighten,darken:Pn.darken,primaryShade:Pn.primaryShade(n),radius:Pn.radius(n),variant:Pn.variant(n),hover:Pn.hover,primaryColor:Pn.primaryColor(n),placeholderStyles:Pn.placeholderStyles(n)}})}Object.keys(X3);const i4={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",dateFormat:"MMMM D, YYYY",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:X3,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)",sm:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 10px 15px -5px, rgba(0, 0, 0, 0.04) 0px 7px 7px -5px",md:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 20px 25px -5px, rgba(0, 0, 0, 0.04) 0px 10px 10px -5px",lg:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 28px 23px -7px, rgba(0, 0, 0, 0.04) 0px 12px 12px -7px",xl:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 36px 28px -7px, rgba(0, 0, 0, 0.04) 0px 17px 17px -7px"},fontSizes:{xs:12,sm:14,md:16,lg:18,xl:20},radius:{xs:2,sm:4,md:8,lg:16,xl:32},spacing:{xs:10,sm:12,md:16,lg:20,xl:24},breakpoints:{xs:576,sm:768,md:992,lg:1200,xl:1400},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:34,lineHeight:1.3,fontWeight:void 0},h2:{fontSize:26,lineHeight:1.35,fontWeight:void 0},h3:{fontSize:22,lineHeight:1.4,fontWeight:void 0},h4:{fontSize:18,lineHeight:1.45,fontWeight:void 0},h5:{fontSize:16,lineHeight:1.5,fontWeight:void 0},h6:{fontSize:14,lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(1px)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:n=>({outlineOffset:2,outline:`2px solid ${n.colors[n.primaryColor][n.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:n=>({outline:"none",borderColor:n.colors[n.primaryColor][typeof n.primaryShade=="object"?n.primaryShade[n.colorScheme]:n.primaryShade]})}},Z3=r4(i4);function s4(n){if(n.sheet)return n.sheet;for(var e=0;e0?jn(Gu,--Lr):0,Ru--,bn===10&&(Ru=1,zg--),bn}function $r(){return bn=Lr2||Of(bn)>3?"":" "}function v4(n,e){for(;--e&&$r()&&!(bn<48||bn>102||bn>57&&bn<65||bn>70&&bn<97););return ud(n,rm()+(e<6&&us()==32&&$r()==32))}function tx(n){for(;$r();)switch(bn){case n:return Lr;case 34:case 39:n!==34&&n!==39&&tx(bn);break;case 40:n===41&&tx(n);break;case 92:$r();break}return Lr}function y4(n,e){for(;$r()&&n+bn!==47+10;)if(n+bn===42+42&&us()===47)break;return"/*"+ud(e,Lr-1)+"*"+kg(n===47?n:$r())}function _4(n){for(;!Of(us());)$r();return ud(n,Lr)}function x4(n){return nP(sm("",null,null,null,[""],n=tP(n),0,[0],n))}function sm(n,e,t,r,i,s,o,a,c){for(var f=0,d=0,h=o,p=0,g=0,v=0,y=1,x=1,w=1,_=0,M="",E=i,C=s,P=r,R=M;x;)switch(v=_,_=$r()){case 40:if(v!=108&&jn(R,h-1)==58){ex(R+=Vt(im(_),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:R+=im(_);break;case 9:case 10:case 13:case 32:R+=g4(v);break;case 92:R+=v4(rm()-1,7);continue;case 47:switch(us()){case 42:case 47:Yh(S4(y4($r(),rm()),e,t),c);break;default:R+="/"}break;case 123*y:a[f++]=ns(R)*w;case 125*y:case 59:case 0:switch(_){case 0:case 125:x=0;case 59+d:g>0&&ns(R)-h&&Yh(g>32?mE(R+";",r,t,h-1):mE(Vt(R," ","")+";",r,t,h-2),c);break;case 59:R+=";";default:if(Yh(P=pE(R,e,t,f,d,i,a,M,E=[],C=[],h),s),_===123)if(d===0)sm(R,e,P,P,E,s,h,a,C);else switch(p===99&&jn(R,3)===110?100:p){case 100:case 109:case 115:sm(n,P,P,r&&Yh(pE(n,P,P,0,0,i,a,M,i,E=[],h),C),i,C,h,a,r?E:C);break;default:sm(R,P,P,P,[""],C,0,a,C)}}f=d=g=0,y=w=1,M=R="",h=o;break;case 58:h=1+ns(R),g=v;default:if(y<1){if(_==123)--y;else if(_==125&&y++==0&&m4()==125)continue}switch(R+=kg(_),_*y){case 38:w=d>0?1:(R+="\f",-1);break;case 44:a[f++]=(ns(R)-1)*w,w=1;break;case 64:us()===45&&(R+=im($r())),p=us(),d=h=ns(M=R+=_4(rm())),_++;break;case 45:v===45&&ns(R)==2&&(y=0)}}return s}function pE(n,e,t,r,i,s,o,a,c,f,d){for(var h=i-1,p=i===0?s:[""],g=nS(p),v=0,y=0,x=0;v0?p[w]+" "+_:Vt(_,/&\f/g,p[w])))&&(c[x++]=M);return Fg(n,e,t,i===0?eS:a,c,f,d)}function S4(n,e,t){return Fg(n,e,t,Q3,kg(p4()),Df(n,2,-2),0)}function mE(n,e,t,r){return Fg(n,e,t,tS,Df(n,0,r),Df(n,r+1,-1),r)}function xu(n,e){for(var t="",r=nS(n),i=0;i6)switch(jn(n,e+1)){case 109:if(jn(n,e+4)!==45)break;case 102:return Vt(n,/(.+:)(.+)-([^]+)/,"$1"+Ut+"$2-$3$1"+Bm+(jn(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~ex(n,"stretch")?rP(Vt(n,"stretch","fill-available"),e)+n:n}break;case 4949:if(jn(n,e+1)!==115)break;case 6444:switch(jn(n,ns(n)-3-(~ex(n,"!important")&&10))){case 107:return Vt(n,":",":"+Ut)+n;case 101:return Vt(n,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ut+(jn(n,14)===45?"inline-":"")+"box$3$1"+Ut+"$2$3$1"+ir+"$2box$3")+n}break;case 5936:switch(jn(n,e+11)){case 114:return Ut+n+ir+Vt(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return Ut+n+ir+Vt(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return Ut+n+ir+Vt(n,/[svh]\w+-[tblr]{2}/,"lr")+n}return Ut+n+ir+n+n}return n}var L4=function(e,t,r,i){if(e.length>-1&&!e.return)switch(e.type){case tS:e.return=rP(e.value,e.length);break;case K3:return xu([Ec(e,{value:Vt(e.value,"@","@"+Ut)})],i);case eS:if(e.length)return h4(e.props,function(s){switch(d4(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return xu([Ec(e,{props:[Vt(s,/:(read-\w+)/,":"+Bm+"$1")]})],i);case"::placeholder":return xu([Ec(e,{props:[Vt(s,/:(plac\w+)/,":"+Ut+"input-$1")]}),Ec(e,{props:[Vt(s,/:(plac\w+)/,":"+Bm+"$1")]}),Ec(e,{props:[Vt(s,/:(plac\w+)/,ir+"input-$1")]})],i)}return""})}},I4=[L4],N4=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var x=y.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=e.stylisPlugins||I4,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(y){for(var x=y.getAttribute("data-emotion").split(" "),w=1;w=4;++r,i-=4)t=n.charCodeAt(r)&255|(n.charCodeAt(++r)&255)<<8|(n.charCodeAt(++r)&255)<<16|(n.charCodeAt(++r)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(n.charCodeAt(r+2)&255)<<16;case 2:e^=(n.charCodeAt(r+1)&255)<<8;case 1:e^=n.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var B4={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},V4=/[A-Z]|^ms/g,G4=/_EMO_([^_]+?)_([^]*?)_EMO_/g,iP=function(e){return e.charCodeAt(1)===45},vE=function(e){return e!=null&&typeof e!="boolean"},ey=E4(function(n){return iP(n)?n:n.replace(V4,"-$&").toLowerCase()}),yE=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(G4,function(r,i,s){return rs={name:i,styles:s,next:rs},i})}return B4[e]!==1&&!iP(e)&&typeof t=="number"&&t!==0?t+"px":t};function kf(n,e,t){if(t==null)return"";if(t.__emotion_styles!==void 0)return t;switch(typeof t){case"boolean":return"";case"object":{if(t.anim===1)return rs={name:t.name,styles:t.styles,next:rs},t.name;if(t.styles!==void 0){var r=t.next;if(r!==void 0)for(;r!==void 0;)rs={name:r.name,styles:r.styles,next:rs},r=r.next;var i=t.styles+";";return i}return H4(n,e,t)}case"function":{if(n!==void 0){var s=rs,o=t(n);return rs=s,kf(n,e,o)}break}}if(e==null)return t;var a=e[t];return a!==void 0?a:t}function H4(n,e,t){var r="";if(Array.isArray(t))for(var i=0;i(n[t]!==void 0&&(e[t]=n[t]),e),{})}var $4=Object.defineProperty,xE=Object.getOwnPropertySymbols,j4=Object.prototype.hasOwnProperty,X4=Object.prototype.propertyIsEnumerable,SE=(n,e,t)=>e in n?$4(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ty=(n,e)=>{for(var t in e||(e={}))j4.call(e,t)&&SE(n,t,e[t]);if(xE)for(var t of xE(e))X4.call(e,t)&&SE(n,t,e[t]);return n};const oP=te.exports.createContext({theme:Z3});function Yo(){var n;return((n=te.exports.useContext(oP))==null?void 0:n.theme)||Z3}function Y4(n){const e=Yo(),t=r=>{var i,s;return{styles:((i=e.components[r])==null?void 0:i.styles)||{},classNames:((s=e.components[r])==null?void 0:s.classNames)||{}}};return Array.isArray(n)?n.map(t):[t(n)]}function aP(){var n;return(n=te.exports.useContext(oP))==null?void 0:n.emotionCache}function Mi(n,e,t){var r;const i=Yo(),s=(r=i.components[n])==null?void 0:r.defaultProps,o=typeof s=="function"?s(i):s;return ty(ty(ty({},e),o),sP(t))}const q4={app:100,modal:200,popover:300,overlay:400,max:9999};function rS(n){return q4[n]}function Z4(n,e){const t=te.exports.useRef();return(!t.current||e.length!==t.current.prevDeps.length||t.current.prevDeps.map((r,i)=>r===e[i]).indexOf(!1)>=0)&&(t.current={v:n(),prevDeps:[...e]}),t.current.v}const Q4=D4({key:"mantine",prepend:!0});function K4(){return aP()||Q4}var J4=Object.defineProperty,wE=Object.getOwnPropertySymbols,eF=Object.prototype.hasOwnProperty,tF=Object.prototype.propertyIsEnumerable,ME=(n,e,t)=>e in n?J4(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,nF=(n,e)=>{for(var t in e||(e={}))eF.call(e,t)&&ME(n,t,e[t]);if(wE)for(var t of wE(e))tF.call(e,t)&&ME(n,t,e[t]);return n};const ny="ref";function rF(n){let e;if(n.length!==1)return{args:n,ref:e};const[t]=n;if(!(t instanceof Object))return{args:n,ref:e};if(!(ny in t))return{args:n,ref:e};e=t[ny];const r=nF({},t);return delete r[ny],{args:[r],ref:e}}const{cssFactory:iF}=(()=>{function n(t,r,i){const s=[],o=k4(t,s,i);return s.length<2?i:o+r(s)}function e(t){const{cache:r}=t,i=(...o)=>{const{ref:a,args:c}=rF(o),f=W4(c,r.registered);return F4(r,f,!1),`${r.key}-${f.name}${a===void 0?"":` ${a}`}`};return{css:i,cx:(...o)=>n(r.registered,i,Az(o))}}return{cssFactory:e}})();function lP(){const n=K4();return Z4(()=>iF({cache:n}),[n])}function sF({cx:n,classes:e,context:t,classNames:r,name:i,cache:s}){const o=t.reduce((a,c)=>(Object.keys(c.classNames).forEach(f=>{typeof a[f]!="string"?a[f]=`${c.classNames[f]}`:a[f]=`${a[f]} ${c.classNames[f]}`}),a),{});return Object.keys(e).reduce((a,c)=>(a[c]=n(e[c],o[c],r!=null&&r[c],Array.isArray(i)?i.filter(Boolean).map(f=>`${(s==null?void 0:s.key)||"mantine"}-${f}-${c}`).join(" "):i?`${(s==null?void 0:s.key)||"mantine"}-${i}-${c}`:null),a),{})}var oF=Object.defineProperty,bE=Object.getOwnPropertySymbols,aF=Object.prototype.hasOwnProperty,lF=Object.prototype.propertyIsEnumerable,EE=(n,e,t)=>e in n?oF(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ry=(n,e)=>{for(var t in e||(e={}))aF.call(e,t)&&EE(n,t,e[t]);if(bE)for(var t of bE(e))lF.call(e,t)&&EE(n,t,e[t]);return n};function uF(n){return`__mantine-ref-${n||""}`}function TE(n,e,t){const r=i=>typeof i=="function"?i(e,t||{}):i||{};return Array.isArray(n)?n.map(i=>r(i.styles)).reduce((i,s)=>(Object.keys(s).forEach(o=>{i[o]?i[o]=ry(ry({},i[o]),s[o]):i[o]=ry({},s[o])}),i),{}):r(n)}function ds(n){const e=typeof n=="function"?n:()=>n;function t(r,i){const s=Yo(),o=Y4(i==null?void 0:i.name),a=aP(),{css:c,cx:f}=lP(),d=e(s,r,uF),h=TE(i==null?void 0:i.styles,s,r),p=TE(o,s,r),g=Object.fromEntries(Object.keys(d).map(v=>{const y=f({[c(d[v])]:!(i!=null&&i.unstyled)},c(p[v]),c(h[v]));return[v,y]}));return{classes:sF({cx:f,classes:g,context:o,classNames:i==null?void 0:i.classNames,name:i==null?void 0:i.name,cache:a}),cx:f,theme:s}}return t}var cF=Object.defineProperty,fF=Object.defineProperties,dF=Object.getOwnPropertyDescriptors,CE=Object.getOwnPropertySymbols,hF=Object.prototype.hasOwnProperty,pF=Object.prototype.propertyIsEnumerable,AE=(n,e,t)=>e in n?cF(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Tc=(n,e)=>{for(var t in e||(e={}))hF.call(e,t)&&AE(n,t,e[t]);if(CE)for(var t of CE(e))pF.call(e,t)&&AE(n,t,e[t]);return n},Cc=(n,e)=>fF(n,dF(e));const Ac={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(.9) translateY(10px)"},transitionProperty:"transform, opacity"},qh={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:Cc(Tc({},Ac),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Cc(Tc({},Ac),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Cc(Tc({},Ac),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Cc(Tc({},Ac),{common:{transformOrigin:"top left"}}),"pop-top-right":Cc(Tc({},Ac),{common:{transformOrigin:"top right"}})};function mF(n,e){try{return n.addEventListener("change",e),()=>n.removeEventListener("change",e)}catch{return n.addListener(e),()=>n.removeListener(e)}}function gF(n,e){return typeof e=="boolean"?e:typeof window!="undefined"&&"matchMedia"in window?window.matchMedia(n).matches:!1}function vF(n,e,{getInitialValueInEffect:t}={getInitialValueInEffect:!0}){const[r,i]=te.exports.useState(t?e:gF(n,e)),s=te.exports.useRef();return te.exports.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(n),i(s.current.matches),mF(s.current,o=>i(o.matches))},[n]),r}const uP=typeof document!="undefined"?te.exports.useLayoutEffect:te.exports.useEffect;function cP(n,e){const t=te.exports.useRef(!1);te.exports.useEffect(()=>()=>{t.current=!1},[]),te.exports.useEffect(()=>{if(t.current)return n();t.current=!0},e)}function yF({opened:n,shouldReturnFocus:e=!0}){const t=te.exports.useRef(),r=()=>{var i;t.current&&"focus"in t.current&&typeof t.current.focus=="function"&&((i=t.current)==null||i.focus({preventScroll:!0}))};return cP(()=>{let i=-1;const s=o=>{o.key==="Tab"&&window.clearTimeout(i)};return document.addEventListener("keydown",s),n?t.current=document.activeElement:e&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener("keydown",s)}},[n,e]),r}const _F=/input|select|textarea|button|object/,fP="a, input, select, textarea, button, object, [tabindex]";function xF(n){return n.style.display==="none"}function SF(n){if(n.getAttribute("aria-hidden")||n.getAttribute("hidden")||n.getAttribute("type")==="hidden")return!1;let t=n;for(;t&&!(t===document.body||t.nodeType===11);){if(xF(t))return!1;t=t.parentNode}return!0}function dP(n){let e=n.getAttribute("tabindex");return e===null&&(e=void 0),parseInt(e,10)}function nx(n){const e=n.nodeName.toLowerCase(),t=!Number.isNaN(dP(n));return(_F.test(e)&&!n.disabled||n instanceof HTMLAnchorElement&&n.href||t)&&SF(n)}function hP(n){const e=dP(n);return(Number.isNaN(e)||e>=0)&&nx(n)}function wF(n){return Array.from(n.querySelectorAll(fP)).filter(hP)}function MF(n,e){const t=wF(n);if(!t.length){e.preventDefault();return}const r=t[e.shiftKey?0:t.length-1],i=n.getRootNode();if(!(r===i.activeElement||n===i.activeElement))return;e.preventDefault();const o=t[e.shiftKey?t.length-1:0];o&&o.focus()}function bF(n,e="body > :not(script)"){const t=Array.from(document.querySelectorAll(e)).map(r=>{var i;if(((i=r==null?void 0:r.shadowRoot)==null?void 0:i.contains(n))||r.contains(n))return;const s=r.getAttribute("aria-hidden");return(s===null||s==="false")&&r.setAttribute("aria-hidden","true"),{node:r,ariaHidden:s}});return()=>{t.forEach(r=>{!r||(r.ariaHidden===null?r.node.removeAttribute("aria-hidden"):r.node.setAttribute("aria-hidden",r.ariaHidden))})}}function EF(n=!0){const e=te.exports.useRef(),t=te.exports.useRef(null),r=te.exports.useCallback(i=>{if(!!n&&i!==null&&(t.current=bF(i),e.current!==i))if(i){const s=()=>{let o=i.querySelector("[data-autofocus]");if(!o){const a=Array.from(i.querySelectorAll(fP));o=a.find(hP)||a.find(nx)||null,!o&&nx(i)&&(o=i)}o&&o.focus({preventScroll:!0})};setTimeout(()=>{i.getRootNode()&&s()}),e.current=i}else e.current=null},[n]);return te.exports.useEffect(()=>{if(!n)return;const i=s=>{s.key==="Tab"&&e.current&&MF(e.current,s)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),t.current&&t.current()}},[n]),r}const TF=()=>`mantine-${Math.random().toString(36).slice(2,11)}`,CF=ke["useId".toString()]||(()=>{});function AF(){const[n,e]=te.exports.useState("");return uP(()=>{e(TF())},[]),n}function PF(){const n=CF();return n?`mantine-${n.replace(/:/g,"")}`:""}function RF(n){return typeof n=="string"?n:PF()||AF()}function LF(n,e,t){te.exports.useEffect(()=>(window.addEventListener(n,e,t),()=>window.removeEventListener(n,e,t)),[n,e])}function IF(n,e){typeof n=="function"?n(e):typeof n=="object"&&n!==null&&"current"in n&&(n.current=e)}function NF(...n){return e=>{n.forEach(t=>IF(t,e))}}function DF(...n){return te.exports.useCallback(NF(...n),n)}function OF(n,e){return vF("(prefers-reduced-motion: reduce)",n,e)}function kF(){if(typeof window=="undefined"||typeof document=="undefined")return 0;const n=parseInt(window.getComputedStyle(document.body).paddingRight,10),e=window.innerWidth-document.documentElement.clientWidth;return n+e}const zF=({disableBodyPadding:n})=>{const e=n?null:kF();return`body { + --removed-scroll-width: ${e}px; + touch-action: none; + overflow: hidden !important; + position: relative !important; + ${e?"padding-right: var(--removed-scroll-width) !important;":""} + `};function FF(n,e){n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}function UF(n){(document.head||document.getElementsByTagName("head")[0]).appendChild(n)}function BF(){const n=document.createElement("style");return n.type="text/css",n.setAttribute("mantine-scroll-lock",""),n}function VF(n,e={disableBodyPadding:!1}){const[t,r]=te.exports.useState(n||!1),i=te.exports.useRef(0),{disableBodyPadding:s}=e,o=te.exports.useRef(null),a=()=>{i.current=window.scrollY;const f=zF({disableBodyPadding:s}),d=BF();FF(d,f),UF(d),o.current=d},c=()=>{!(o!=null&&o.current)||(o.current.parentNode.removeChild(o.current),o.current=null)};return te.exports.useEffect(()=>(t?a():c(),c),[t]),te.exports.useEffect(()=>{n!==void 0&&r(n)},[n]),te.exports.useEffect(()=>{n===void 0&&typeof window!="undefined"&&window.document.body.style.overflow==="hidden"&&r(!0)},[r]),[t,r]}function iy(){return`mantine-${Math.random().toString(36).slice(2,11)}`}var PE=Object.getOwnPropertySymbols,GF=Object.prototype.hasOwnProperty,HF=Object.prototype.propertyIsEnumerable,WF=(n,e)=>{var t={};for(var r in n)GF.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&PE)for(var r of PE(n))e.indexOf(r)<0&&HF.call(n,r)&&(t[r]=n[r]);return t};function $F(n){const e=n,{m:t,mx:r,my:i,mt:s,mb:o,ml:a,mr:c,p:f,px:d,py:h,pt:p,pb:g,pl:v,pr:y,bg:x,c:w,opacity:_,ff:M,fz:E,fw:C,lts:P,ta:R,lh:T,fs:L,tt:D,td:Y,w:fe,miw:q,maw:$,h:se,mih:le,mah:pe,bgsz:z,bgp:F,bgr:G,bga:Z,pos:k,top:W,left:N,bottom:me,right:X,inset:Te,display:Ce}=e,we=WF(e,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:sP({m:t,mx:r,my:i,mt:s,mb:o,ml:a,mr:c,p:f,px:d,py:h,pt:p,pb:g,pl:v,pr:y,bg:x,c:w,opacity:_,ff:M,fz:E,fw:C,lts:P,ta:R,lh:T,fs:L,tt:D,td:Y,w:fe,miw:q,maw:$,h:se,mih:le,mah:pe,bgsz:z,bgp:F,bgr:G,bga:Z,pos:k,top:W,left:N,bottom:me,right:X,inset:Te,display:Ce}),rest:we}}function jF(n,e){const t=Object.keys(n).filter(r=>r!=="base").sort((r,i)=>e.fn.size({size:r,sizes:e.breakpoints})-e.fn.size({size:i,sizes:e.breakpoints}));return"base"in n?["base",...t]:t}function XF({value:n,theme:e,getValue:t,property:r}){if(n==null)return;if(typeof n=="object")return jF(n,e).reduce((o,a)=>{if(a==="base"&&n.base!==void 0){const f=t(n.base,e);return Array.isArray(r)?(r.forEach(d=>{o[d]=f}),o):(o[r]=f,o)}const c=t(n[a],e);return Array.isArray(r)?(o[e.fn.largerThan(a)]={},r.forEach(f=>{o[e.fn.largerThan(a)][f]=c}),o):(o[e.fn.largerThan(a)]={[r]:c},o)},{});const i=t(n,e);return Array.isArray(r)?r.reduce((s,o)=>(s[o]=i,s),{}):{[r]:i}}function YF(n,e){return n==="dimmed"?e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]:e.fn.variant({variant:"filled",color:n,primaryFallback:!1}).background}function qF(n){return n}function ZF(n,e){return e.fn.size({size:n,sizes:e.fontSizes})}const QF=["-xs","-sm","-md","-lg","-xl"];function KF(n,e){return QF.includes(n)?e.fn.size({size:n.replace("-",""),sizes:e.spacing})*-1:e.fn.size({size:n,sizes:e.spacing})}const JF={color:YF,default:qF,fontSize:ZF,spacing:KF},e5={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"default",property:"opacity"},ff:{type:"default",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"default",property:"fontWeight"},lts:{type:"default",property:"letterSpacing"},ta:{type:"default",property:"textAlign"},lh:{type:"default",property:"lineHeight"},fs:{type:"default",property:"fontStyle"},tt:{type:"default",property:"textTransform"},td:{type:"default",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"default",property:"background-size"},bgp:{type:"default",property:"background-position"},bgr:{type:"default",property:"background-repeat"},bga:{type:"default",property:"background-attachment"},pos:{type:"default",property:"position"},top:{type:"default",property:"top"},left:{type:"default",property:"left"},bottom:{type:"default",property:"bottom"},right:{type:"default",property:"right"},inset:{type:"default",property:"inset"},display:{type:"default",property:"display"}};var t5=Object.defineProperty,RE=Object.getOwnPropertySymbols,n5=Object.prototype.hasOwnProperty,r5=Object.prototype.propertyIsEnumerable,LE=(n,e,t)=>e in n?t5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,IE=(n,e)=>{for(var t in e||(e={}))n5.call(e,t)&&LE(n,t,e[t]);if(RE)for(var t of RE(e))r5.call(e,t)&&LE(n,t,e[t]);return n};function NE(n,e,t=e5){return Object.keys(t).reduce((i,s)=>(s in n&&n[s]!==void 0&&i.push(XF({value:n[s],getValue:JF[t[s].type],property:t[s].property,theme:e})),i),[]).reduce((i,s)=>(Object.keys(s).forEach(o=>{typeof s[o]=="object"&&s[o]!==null&&o in i?i[o]=IE(IE({},i[o]),s[o]):i[o]=s[o]}),i),{})}function DE(n,e){return typeof n=="function"?n(e):n}function i5(n,e,t){const r=Yo(),{css:i,cx:s}=lP();return Array.isArray(n)?s(t,i(NE(e,r)),n.map(o=>i(DE(o,r)))):s(t,i(DE(n,r)),i(NE(e,r)))}var s5=Object.defineProperty,Vm=Object.getOwnPropertySymbols,pP=Object.prototype.hasOwnProperty,mP=Object.prototype.propertyIsEnumerable,OE=(n,e,t)=>e in n?s5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,o5=(n,e)=>{for(var t in e||(e={}))pP.call(e,t)&&OE(n,t,e[t]);if(Vm)for(var t of Vm(e))mP.call(e,t)&&OE(n,t,e[t]);return n},a5=(n,e)=>{var t={};for(var r in n)pP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Vm)for(var r of Vm(n))e.indexOf(r)<0&&mP.call(n,r)&&(t[r]=n[r]);return t};const gP=te.exports.forwardRef((n,e)=>{var t=n,{className:r,component:i,style:s,sx:o}=t,a=a5(t,["className","component","style","sx"]);const{systemStyles:c,rest:f}=$F(a);return at(i||"div",{...o5({ref:e,className:i5(o,c,r),style:s},f)})});gP.displayName="@mantine/core/Box";const Vi=gP;var l5=Object.defineProperty,u5=Object.defineProperties,c5=Object.getOwnPropertyDescriptors,kE=Object.getOwnPropertySymbols,f5=Object.prototype.hasOwnProperty,d5=Object.prototype.propertyIsEnumerable,zE=(n,e,t)=>e in n?l5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,FE=(n,e)=>{for(var t in e||(e={}))f5.call(e,t)&&zE(n,t,e[t]);if(kE)for(var t of kE(e))d5.call(e,t)&&zE(n,t,e[t]);return n},h5=(n,e)=>u5(n,c5(e)),p5=ds(n=>({root:h5(FE(FE({},n.fn.focusStyles()),n.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:n.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:n.colorScheme==="dark"?n.colors.dark[0]:n.black,textDecoration:"none",boxSizing:"border-box"})})),m5=p5,g5=Object.defineProperty,Gm=Object.getOwnPropertySymbols,vP=Object.prototype.hasOwnProperty,yP=Object.prototype.propertyIsEnumerable,UE=(n,e,t)=>e in n?g5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,v5=(n,e)=>{for(var t in e||(e={}))vP.call(e,t)&&UE(n,t,e[t]);if(Gm)for(var t of Gm(e))yP.call(e,t)&&UE(n,t,e[t]);return n},y5=(n,e)=>{var t={};for(var r in n)vP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Gm)for(var r of Gm(n))e.indexOf(r)<0&&yP.call(n,r)&&(t[r]=n[r]);return t};const _P=te.exports.forwardRef((n,e)=>{const t=Mi("UnstyledButton",{},n),{className:r,component:i="button",unstyled:s}=t,o=y5(t,["className","component","unstyled"]),{classes:a,cx:c}=m5(null,{name:"UnstyledButton",unstyled:s});return at(Vi,{...v5({component:i,ref:e,className:c(a.root,r),type:i==="button"?"button":void 0},o)})});_P.displayName="@mantine/core/UnstyledButton";const xP=_P;var _5=Object.defineProperty,x5=Object.defineProperties,S5=Object.getOwnPropertyDescriptors,BE=Object.getOwnPropertySymbols,w5=Object.prototype.hasOwnProperty,M5=Object.prototype.propertyIsEnumerable,VE=(n,e,t)=>e in n?_5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,SP=(n,e)=>{for(var t in e||(e={}))w5.call(e,t)&&VE(n,t,e[t]);if(BE)for(var t of BE(e))M5.call(e,t)&&VE(n,t,e[t]);return n},b5=(n,e)=>x5(n,S5(e));const Qc={xs:18,sm:22,md:28,lg:34,xl:44};function E5({variant:n,theme:e,color:t,gradient:r}){const i=e.fn.variant({color:t,variant:n,gradient:r});return n==="gradient"?{border:0,backgroundImage:i.background,color:i.color,"&:hover":e.fn.hover({backgroundSize:"200%"})}:SP({border:`1px solid ${i.border}`,backgroundColor:i.background,color:i.color},e.fn.hover({backgroundColor:i.hover}))}var T5=ds((n,{color:e,size:t,radius:r,variant:i,gradient:s})=>({root:b5(SP({},E5({variant:i,theme:n,color:e,gradient:s})),{position:"relative",height:n.fn.size({size:t,sizes:Qc}),minHeight:n.fn.size({size:t,sizes:Qc}),width:n.fn.size({size:t,sizes:Qc}),minWidth:n.fn.size({size:t,sizes:Qc}),borderRadius:n.fn.radius(r),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center","&:active":n.activeStyles,"&:disabled, &[data-disabled]":{color:n.colors.gray[n.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:i==="transparent"?void 0:n.fn.themeColor("gray",n.colorScheme==="dark"?8:1),borderColor:i==="transparent"?void 0:n.fn.themeColor("gray",n.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":{content:'""',position:"absolute",top:-1,left:-1,right:-1,bottom:-1,backgroundColor:n.colorScheme==="dark"?n.fn.rgba(n.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:n.fn.radius(r),cursor:"not-allowed"}}})})),C5=T5,A5=Object.defineProperty,Hm=Object.getOwnPropertySymbols,wP=Object.prototype.hasOwnProperty,MP=Object.prototype.propertyIsEnumerable,GE=(n,e,t)=>e in n?A5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,P5=(n,e)=>{for(var t in e||(e={}))wP.call(e,t)&&GE(n,t,e[t]);if(Hm)for(var t of Hm(e))MP.call(e,t)&&GE(n,t,e[t]);return n},R5=(n,e)=>{var t={};for(var r in n)wP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Hm)for(var r of Hm(n))e.indexOf(r)<0&&MP.call(n,r)&&(t[r]=n[r]);return t};function L5(n){var e=n,{size:t,color:r}=e,i=R5(e,["size","color"]);return ke.createElement("svg",P5({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,width:`${t}px`},i),ke.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},ke.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),ke.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},ke.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),ke.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},ke.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),ke.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},ke.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),ke.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},ke.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var I5=Object.defineProperty,Wm=Object.getOwnPropertySymbols,bP=Object.prototype.hasOwnProperty,EP=Object.prototype.propertyIsEnumerable,HE=(n,e,t)=>e in n?I5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,N5=(n,e)=>{for(var t in e||(e={}))bP.call(e,t)&&HE(n,t,e[t]);if(Wm)for(var t of Wm(e))EP.call(e,t)&&HE(n,t,e[t]);return n},D5=(n,e)=>{var t={};for(var r in n)bP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Wm)for(var r of Wm(n))e.indexOf(r)<0&&EP.call(n,r)&&(t[r]=n[r]);return t};function O5(n){var e=n,{size:t,color:r}=e,i=D5(e,["size","color"]);return ke.createElement("svg",N5({width:`${t}px`,height:`${t}px`,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r},i),ke.createElement("g",{fill:"none",fillRule:"evenodd"},ke.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},ke.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),ke.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},ke.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var k5=Object.defineProperty,$m=Object.getOwnPropertySymbols,TP=Object.prototype.hasOwnProperty,CP=Object.prototype.propertyIsEnumerable,WE=(n,e,t)=>e in n?k5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,z5=(n,e)=>{for(var t in e||(e={}))TP.call(e,t)&&WE(n,t,e[t]);if($m)for(var t of $m(e))CP.call(e,t)&&WE(n,t,e[t]);return n},F5=(n,e)=>{var t={};for(var r in n)TP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&$m)for(var r of $m(n))e.indexOf(r)<0&&CP.call(n,r)&&(t[r]=n[r]);return t};function U5(n){var e=n,{size:t,color:r}=e,i=F5(e,["size","color"]);return ke.createElement("svg",z5({width:`${t}px`,height:`${t/4}px`,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r},i),ke.createElement("circle",{cx:"15",cy:"15",r:"15"},ke.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),ke.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},ke.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),ke.createElement("circle",{cx:"105",cy:"15",r:"15"},ke.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),ke.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var B5=Object.defineProperty,jm=Object.getOwnPropertySymbols,AP=Object.prototype.hasOwnProperty,PP=Object.prototype.propertyIsEnumerable,$E=(n,e,t)=>e in n?B5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,V5=(n,e)=>{for(var t in e||(e={}))AP.call(e,t)&&$E(n,t,e[t]);if(jm)for(var t of jm(e))PP.call(e,t)&&$E(n,t,e[t]);return n},G5=(n,e)=>{var t={};for(var r in n)AP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&jm)for(var r of jm(n))e.indexOf(r)<0&&PP.call(n,r)&&(t[r]=n[r]);return t};const sy={bars:L5,oval:O5,dots:U5},H5={xs:18,sm:22,md:36,lg:44,xl:58},W5={size:"md"};function iS(n){const e=Mi("Loader",W5,n),{size:t,color:r,variant:i}=e,s=G5(e,["size","color","variant"]),o=Yo(),a=i in sy?i:o.loader;return ke.createElement(Vi,V5({role:"presentation",component:sy[a]||sy.bars,size:o.fn.size({size:t,sizes:H5}),color:o.fn.variant({variant:"filled",primaryFallback:!1,color:r||o.primaryColor}).background},s))}iS.displayName="@mantine/core/Loader";var $5=Object.defineProperty,Xm=Object.getOwnPropertySymbols,RP=Object.prototype.hasOwnProperty,LP=Object.prototype.propertyIsEnumerable,jE=(n,e,t)=>e in n?$5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,XE=(n,e)=>{for(var t in e||(e={}))RP.call(e,t)&&jE(n,t,e[t]);if(Xm)for(var t of Xm(e))LP.call(e,t)&&jE(n,t,e[t]);return n},j5=(n,e)=>{var t={};for(var r in n)RP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Xm)for(var r of Xm(n))e.indexOf(r)<0&&LP.call(n,r)&&(t[r]=n[r]);return t};const X5={color:"gray",size:"md",variant:"subtle",loading:!1},IP=te.exports.forwardRef((n,e)=>{const t=Mi("ActionIcon",X5,n),{className:r,color:i,children:s,radius:o,size:a,variant:c,gradient:f,disabled:d,loaderProps:h,loading:p,unstyled:g}=t,v=j5(t,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled"]),{classes:y,cx:x,theme:w}=C5({size:a,radius:o,color:i,variant:c,gradient:f},{name:"ActionIcon",unstyled:g}),_=w.fn.variant({color:i,variant:c}),M=at(iS,{...XE({color:_.color,size:w.fn.size({size:a,sizes:Qc})-12},h)});return at(xP,{...XE({className:x(y.root,r),ref:e,disabled:d,"data-disabled":d||void 0,"data-loading":p||void 0,unstyled:g},v),children:p?M:s})});IP.displayName="@mantine/core/ActionIcon";const Y5=IP;function NP(n){const{children:e,target:t,className:r}=Mi("Portal",{},n),i=Yo(),[s,o]=te.exports.useState(!1),a=te.exports.useRef();return uP(()=>(o(!0),a.current=t?typeof t=="string"?document.querySelector(t):t:document.createElement("div"),t||document.body.appendChild(a.current),()=>{!t&&document.body.removeChild(a.current)}),[t]),s?vg.exports.createPortal(at("div",{className:r,dir:i.dir,children:e}),a.current):null}NP.displayName="@mantine/core/Portal";var q5=Object.defineProperty,Ym=Object.getOwnPropertySymbols,DP=Object.prototype.hasOwnProperty,OP=Object.prototype.propertyIsEnumerable,YE=(n,e,t)=>e in n?q5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Z5=(n,e)=>{for(var t in e||(e={}))DP.call(e,t)&&YE(n,t,e[t]);if(Ym)for(var t of Ym(e))OP.call(e,t)&&YE(n,t,e[t]);return n},Q5=(n,e)=>{var t={};for(var r in n)DP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Ym)for(var r of Ym(n))e.indexOf(r)<0&&OP.call(n,r)&&(t[r]=n[r]);return t};function kP(n){var e=n,{withinPortal:t=!0,children:r}=e,i=Q5(e,["withinPortal","children"]);return t?ke.createElement(NP,Z5({},i),r):ke.createElement(ke.Fragment,null,r)}kP.displayName="@mantine/core/OptionalPortal";var K5=Object.defineProperty,qE=Object.getOwnPropertySymbols,J5=Object.prototype.hasOwnProperty,eU=Object.prototype.propertyIsEnumerable,ZE=(n,e,t)=>e in n?K5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,tU=(n,e)=>{for(var t in e||(e={}))J5.call(e,t)&&ZE(n,t,e[t]);if(qE)for(var t of qE(e))eU.call(e,t)&&ZE(n,t,e[t]);return n};function zP(n){return ke.createElement("svg",tU({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),ke.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}zP.displayName="@mantine/core/CloseIcon";var nU=Object.defineProperty,qm=Object.getOwnPropertySymbols,FP=Object.prototype.hasOwnProperty,UP=Object.prototype.propertyIsEnumerable,QE=(n,e,t)=>e in n?nU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,rU=(n,e)=>{for(var t in e||(e={}))FP.call(e,t)&&QE(n,t,e[t]);if(qm)for(var t of qm(e))UP.call(e,t)&&QE(n,t,e[t]);return n},iU=(n,e)=>{var t={};for(var r in n)FP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&qm)for(var r of qm(n))e.indexOf(r)<0&&UP.call(n,r)&&(t[r]=n[r]);return t};const sU={xs:12,sm:14,md:16,lg:20,xl:24},oU={size:"md"},BP=te.exports.forwardRef((n,e)=>{const t=Mi("CloseButton",oU,n),{iconSize:r,size:i="md"}=t,s=iU(t,["iconSize","size"]),o=Yo(),a=r||o.fn.size({size:i,sizes:sU});return at(Y5,{...rU({size:i,ref:e},s),children:at(zP,{width:a,height:a})})});BP.displayName="@mantine/core/CloseButton";const aU=BP;var lU=Object.defineProperty,uU=Object.defineProperties,cU=Object.getOwnPropertyDescriptors,KE=Object.getOwnPropertySymbols,fU=Object.prototype.hasOwnProperty,dU=Object.prototype.propertyIsEnumerable,JE=(n,e,t)=>e in n?lU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Pc=(n,e)=>{for(var t in e||(e={}))fU.call(e,t)&&JE(n,t,e[t]);if(KE)for(var t of KE(e))dU.call(e,t)&&JE(n,t,e[t]);return n},hU=(n,e)=>uU(n,cU(e));function pU({underline:n,strikethrough:e}){const t=[];return n&&t.push("underline"),e&&t.push("line-through"),t.length>0?t.join(" "):"none"}function mU({theme:n,color:e,variant:t}){return e==="dimmed"?n.colorScheme==="dark"?n.colors.dark[2]:n.colors.gray[6]:typeof e=="string"&&(e in n.colors||e.split(".")[0]in n.colors)?n.fn.variant({variant:"filled",color:e}).background:t==="link"?n.colors[n.primaryColor][n.colorScheme==="dark"?4:7]:e||"inherit"}function gU(n){return typeof n=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:n,WebkitBoxOrient:"vertical"}:null}function vU(n){return n?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var yU=ds((n,{color:e,variant:t,size:r,lineClamp:i,truncate:s,inline:o,inherit:a,underline:c,gradient:f,weight:d,transform:h,align:p,strikethrough:g,italic:v})=>{const y=n.fn.variant({variant:"gradient",gradient:f});return{root:Pc(hU(Pc(Pc(Pc(Pc({},n.fn.fontStyles()),n.fn.focusStyles()),gU(i)),vU(s)),{color:mU({color:e,theme:n,variant:t}),fontFamily:a?"inherit":n.fontFamily,fontSize:a||r===void 0?"inherit":n.fn.size({size:r,sizes:n.fontSizes}),lineHeight:a?"inherit":o?1:n.lineHeight,textDecoration:pU({underline:c,strikethrough:g}),WebkitTapHighlightColor:"transparent",fontWeight:a?"inherit":d,textTransform:h,textAlign:p,fontStyle:v?"italic":void 0}),n.fn.hover(t==="link"&&c===void 0?{textDecoration:"underline"}:void 0)),gradient:{backgroundImage:y.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}}),_U=yU,xU=Object.defineProperty,Zm=Object.getOwnPropertySymbols,VP=Object.prototype.hasOwnProperty,GP=Object.prototype.propertyIsEnumerable,eT=(n,e,t)=>e in n?xU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,SU=(n,e)=>{for(var t in e||(e={}))VP.call(e,t)&&eT(n,t,e[t]);if(Zm)for(var t of Zm(e))GP.call(e,t)&&eT(n,t,e[t]);return n},wU=(n,e)=>{var t={};for(var r in n)VP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Zm)for(var r of Zm(n))e.indexOf(r)<0&&GP.call(n,r)&&(t[r]=n[r]);return t};const MU={variant:"text"},HP=te.exports.forwardRef((n,e)=>{const t=Mi("Text",MU,n),{className:r,size:i,weight:s,transform:o,color:a,align:c,variant:f,lineClamp:d,truncate:h,gradient:p,inline:g,inherit:v,underline:y,strikethrough:x,italic:w,classNames:_,styles:M,unstyled:E,span:C}=t,P=wU(t,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span"]),{classes:R,cx:T}=_U({variant:f,color:a,size:i,lineClamp:d,truncate:h,inline:g,inherit:v,underline:y,strikethrough:x,italic:w,weight:s,transform:o,align:c,gradient:p},{unstyled:E,name:"Text"});return at(Vi,{...SU({ref:e,className:T(R.root,{[R.gradient]:f==="gradient"},r),component:C?"span":"div"},P)})});HP.displayName="@mantine/core/Text";const bU=HP;var EU=Object.defineProperty,tT=Object.getOwnPropertySymbols,TU=Object.prototype.hasOwnProperty,CU=Object.prototype.propertyIsEnumerable,nT=(n,e,t)=>e in n?EU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Al=(n,e)=>{for(var t in e||(e={}))TU.call(e,t)&&nT(n,t,e[t]);if(tT)for(var t of tT(e))CU.call(e,t)&&nT(n,t,e[t]);return n};const rT={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function AU({transition:n,state:e,duration:t,timingFunction:r}){const i={transitionDuration:`${t}ms`,transitionTimingFunction:r};return typeof n=="string"?n in qh?Al(Al(Al({transitionProperty:qh[n].transitionProperty},i),qh[n].common),qh[n][rT[e]]):null:Al(Al(Al({transitionProperty:n.transitionProperty},i),n.common),n[rT[e]])}function PU({duration:n,exitDuration:e,timingFunction:t,mounted:r,onEnter:i,onExit:s,onEntered:o,onExited:a}){const c=Yo(),f=OF(),d=c.respectReducedMotion?f:!1,[h,p]=te.exports.useState(r?"entered":"exited");let g=d?0:n;const v=te.exports.useRef(-1),y=x=>{const w=x?i:s,_=x?o:a;if(p(x?"pre-entering":"pre-exiting"),window.clearTimeout(v.current),g=d?0:x?n:e,g===0)typeof w=="function"&&w(),typeof _=="function"&&_(),p(x?"entered":"exited");else{const M=window.setTimeout(()=>{typeof w=="function"&&w(),p(x?"entering":"exiting")},10);v.current=window.setTimeout(()=>{window.clearTimeout(M),typeof _=="function"&&_(),p(x?"entered":"exited")},g)}};return cP(()=>{y(r)},[r]),te.exports.useEffect(()=>()=>window.clearTimeout(v.current),[]),{transitionDuration:g,transitionStatus:h,transitionTimingFunction:t||c.transitionTimingFunction}}const Rc={xs:30,sm:36,md:42,lg:50,xl:60};var RU=ds((n,{orientation:e,buttonBorderWidth:t})=>({root:{display:"flex",flexDirection:e==="vertical"?"column":"row","& [data-button]":{"&:first-of-type":{borderBottomRightRadius:0,[e==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[e==="vertical"?"borderBottomWidth":"borderRightWidth"]:t/2},"&:last-of-type":{borderTopLeftRadius:0,[e==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[e==="vertical"?"borderTopWidth":"borderLeftWidth"]:t/2},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[e==="vertical"?"borderTopWidth":"borderLeftWidth"]:t/2,[e==="vertical"?"borderBottomWidth":"borderRightWidth"]:t/2},"& + [data-button]":{[e==="vertical"?"marginTop":"marginLeft"]:-t,"@media (min-resolution: 192dpi)":{[e==="vertical"?"marginTop":"marginLeft"]:0}}}}})),LU=RU,IU=Object.defineProperty,Qm=Object.getOwnPropertySymbols,WP=Object.prototype.hasOwnProperty,$P=Object.prototype.propertyIsEnumerable,iT=(n,e,t)=>e in n?IU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,NU=(n,e)=>{for(var t in e||(e={}))WP.call(e,t)&&iT(n,t,e[t]);if(Qm)for(var t of Qm(e))$P.call(e,t)&&iT(n,t,e[t]);return n},DU=(n,e)=>{var t={};for(var r in n)WP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Qm)for(var r of Qm(n))e.indexOf(r)<0&&$P.call(n,r)&&(t[r]=n[r]);return t};const OU={orientation:"horizontal",buttonBorderWidth:1},jP=te.exports.forwardRef((n,e)=>{const t=Mi("ButtonGroup",OU,n),{className:r,orientation:i,buttonBorderWidth:s,unstyled:o}=t,a=DU(t,["className","orientation","buttonBorderWidth","unstyled"]),{classes:c,cx:f}=LU({orientation:i,buttonBorderWidth:s},{name:"ButtonGroup",unstyled:o});return at(Vi,{...NU({className:f(c.root,r),ref:e},a)})});jP.displayName="@mantine/core/ButtonGroup";var kU=Object.defineProperty,zU=Object.defineProperties,FU=Object.getOwnPropertyDescriptors,sT=Object.getOwnPropertySymbols,UU=Object.prototype.hasOwnProperty,BU=Object.prototype.propertyIsEnumerable,oT=(n,e,t)=>e in n?kU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,xa=(n,e)=>{for(var t in e||(e={}))UU.call(e,t)&&oT(n,t,e[t]);if(sT)for(var t of sT(e))BU.call(e,t)&&oT(n,t,e[t]);return n},rx=(n,e)=>zU(n,FU(e));const ix={xs:{height:Rc.xs,paddingLeft:14,paddingRight:14},sm:{height:Rc.sm,paddingLeft:18,paddingRight:18},md:{height:Rc.md,paddingLeft:22,paddingRight:22},lg:{height:Rc.lg,paddingLeft:26,paddingRight:26},xl:{height:Rc.xl,paddingLeft:32,paddingRight:32},"compact-xs":{height:22,paddingLeft:7,paddingRight:7},"compact-sm":{height:26,paddingLeft:8,paddingRight:8},"compact-md":{height:30,paddingLeft:10,paddingRight:10},"compact-lg":{height:34,paddingLeft:12,paddingRight:12},"compact-xl":{height:40,paddingLeft:14,paddingRight:14}};function VU({compact:n,size:e,withLeftIcon:t,withRightIcon:r}){if(n)return ix[`compact-${e}`];const i=ix[e];return rx(xa({},i),{paddingLeft:t?i.paddingLeft/1.5:i.paddingLeft,paddingRight:r?i.paddingRight/1.5:i.paddingRight})}const GU=n=>({display:n?"block":"inline-block",width:n?"100%":"auto"});function HU({variant:n,theme:e,color:t,gradient:r}){const i=e.fn.variant({color:t,variant:n,gradient:r});return n==="gradient"?{border:0,backgroundImage:i.background,color:i.color,"&:hover":e.fn.hover({backgroundSize:"200%"})}:xa({border:`1px solid ${i.border}`,backgroundColor:i.background,color:i.color},e.fn.hover({backgroundColor:i.hover}))}var WU=ds((n,{color:e,size:t,radius:r,fullWidth:i,compact:s,gradient:o,variant:a,withLeftIcon:c,withRightIcon:f})=>({root:rx(xa(rx(xa(xa(xa(xa({},VU({compact:s,size:t,withLeftIcon:c,withRightIcon:f})),n.fn.fontStyles()),n.fn.focusStyles()),GU(i)),{borderRadius:n.fn.radius(r),fontWeight:600,position:"relative",lineHeight:1,fontSize:n.fn.size({size:t,sizes:n.fontSizes}),userSelect:"none",cursor:"pointer"}),HU({variant:a,theme:n,color:e,gradient:o})),{"&:active":n.activeStyles,"&:disabled, &[data-disabled]":{borderColor:"transparent",backgroundColor:n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[2],color:n.colorScheme==="dark"?n.colors.dark[6]:n.colors.gray[5],cursor:"not-allowed",backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":{content:'""',position:"absolute",top:-1,left:-1,right:-1,bottom:-1,backgroundColor:n.colorScheme==="dark"?n.fn.rgba(n.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:n.fn.radius(r),cursor:"not-allowed"}}}),icon:{display:"flex",alignItems:"center"},leftIcon:{marginRight:10},rightIcon:{marginLeft:10},centerLoader:{position:"absolute",left:"50%",transform:"translateX(-50%)",opacity:.5},inner:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",overflow:"visible"},label:{whiteSpace:"nowrap",height:"100%",overflow:"hidden",display:"flex",alignItems:"center"}})),$U=WU,jU=Object.defineProperty,Km=Object.getOwnPropertySymbols,XP=Object.prototype.hasOwnProperty,YP=Object.prototype.propertyIsEnumerable,aT=(n,e,t)=>e in n?jU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,lT=(n,e)=>{for(var t in e||(e={}))XP.call(e,t)&&aT(n,t,e[t]);if(Km)for(var t of Km(e))YP.call(e,t)&&aT(n,t,e[t]);return n},XU=(n,e)=>{var t={};for(var r in n)XP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Km)for(var r of Km(n))e.indexOf(r)<0&&YP.call(n,r)&&(t[r]=n[r]);return t};const YU={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},sS=te.exports.forwardRef((n,e)=>{const t=Mi("Button",YU,n),{className:r,size:i,color:s,type:o,disabled:a,children:c,leftIcon:f,rightIcon:d,fullWidth:h,variant:p,radius:g,uppercase:v,compact:y,loading:x,loaderPosition:w,loaderProps:_,gradient:M,classNames:E,styles:C,unstyled:P}=t,R=XU(t,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:T,cx:L,theme:D}=$U({radius:g,color:s,size:i,fullWidth:h,compact:y,gradient:M,variant:p,withLeftIcon:!!f,withRightIcon:!!d},{name:"Button",unstyled:P,classNames:E,styles:C}),Y=D.fn.variant({color:s,variant:p}),fe=at(iS,{...lT({color:Y.color,size:D.fn.size({size:i,sizes:ix}).height/2},_)});return at(xP,{...lT({className:L(T.root,r),type:o,disabled:a,"data-button":!0,"data-disabled":a||void 0,"data-loading":x||void 0,ref:e,unstyled:P},R),children:ka("div",{className:T.inner,children:[(f||x&&w==="left")&&at("span",{className:L(T.icon,T.leftIcon),children:x&&w==="left"?fe:f}),x&&w==="center"&&at("span",{className:T.centerLoader,children:fe}),at("span",{className:T.label,style:{textTransform:v?"uppercase":void 0},children:c}),(d||x&&w==="right")&&at("span",{className:L(T.icon,T.rightIcon),children:x&&w==="right"?fe:d})]})})});sS.displayName="@mantine/core/Button";sS.Group=jP;const uT=sS;var qU=ds((n,{radius:e,shadow:t,withBorder:r})=>({root:{outline:0,WebkitTapHighlightColor:"transparent",display:"block",textDecoration:"none",color:n.colorScheme==="dark"?n.colors.dark[0]:n.black,backgroundColor:n.colorScheme==="dark"?n.colors.dark[7]:n.white,boxSizing:"border-box",borderRadius:n.fn.radius(e),boxShadow:n.shadows[t]||t||"none",border:r?`1px solid ${n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[3]}`:void 0}})),ZU=qU,QU=Object.defineProperty,Jm=Object.getOwnPropertySymbols,qP=Object.prototype.hasOwnProperty,ZP=Object.prototype.propertyIsEnumerable,cT=(n,e,t)=>e in n?QU(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,KU=(n,e)=>{for(var t in e||(e={}))qP.call(e,t)&&cT(n,t,e[t]);if(Jm)for(var t of Jm(e))ZP.call(e,t)&&cT(n,t,e[t]);return n},JU=(n,e)=>{var t={};for(var r in n)qP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Jm)for(var r of Jm(n))e.indexOf(r)<0&&ZP.call(n,r)&&(t[r]=n[r]);return t};const eB={},QP=te.exports.forwardRef((n,e)=>{const t=Mi("Paper",eB,n),{className:r,children:i,radius:s,withBorder:o,shadow:a,unstyled:c}=t,f=JU(t,["className","children","radius","withBorder","shadow","unstyled"]),{classes:d,cx:h}=ZU({radius:s,shadow:a,withBorder:o},{name:"Paper",unstyled:c});return at(Vi,{...KU({className:h(d.root,r),ref:e},f),children:i})});QP.displayName="@mantine/core/Paper";const tB=QP;function nB(n){return te.exports.Children.toArray(n).filter(Boolean)}const rB={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var iB=ds((n,{spacing:e,position:t,noWrap:r,grow:i,align:s,count:o})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:s||"center",flexWrap:r?"nowrap":"wrap",justifyContent:rB[t],gap:n.fn.size({size:e,sizes:n.spacing}),"& > *":{boxSizing:"border-box",maxWidth:i?`calc(${100/o}% - ${n.fn.size({size:e,sizes:n.spacing})-n.fn.size({size:e,sizes:n.spacing})/o}px)`:void 0,flexGrow:i?1:0}}})),sB=iB,oB=Object.defineProperty,eg=Object.getOwnPropertySymbols,KP=Object.prototype.hasOwnProperty,JP=Object.prototype.propertyIsEnumerable,fT=(n,e,t)=>e in n?oB(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,aB=(n,e)=>{for(var t in e||(e={}))KP.call(e,t)&&fT(n,t,e[t]);if(eg)for(var t of eg(e))JP.call(e,t)&&fT(n,t,e[t]);return n},lB=(n,e)=>{var t={};for(var r in n)KP.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&eg)for(var r of eg(n))e.indexOf(r)<0&&JP.call(n,r)&&(t[r]=n[r]);return t};const uB={position:"left",spacing:"md"},eR=te.exports.forwardRef((n,e)=>{const t=Mi("Group",uB,n),{className:r,position:i,align:s,children:o,noWrap:a,grow:c,spacing:f,unstyled:d}=t,h=lB(t,["className","position","align","children","noWrap","grow","spacing","unstyled"]),p=nB(o),{classes:g,cx:v}=sB({align:s,grow:c,noWrap:a,spacing:f,position:i,count:p.length},{unstyled:d,name:"Group"});return at(Vi,{...aB({className:v(g.root,r),ref:e},h),children:p})});eR.displayName="@mantine/core/Group";function tR({transitions:n,duration:e=250,exitDuration:t=e,mounted:r,children:i,timingFunction:s,onExit:o,onEntered:a,onEnter:c,onExited:f}){const{transitionDuration:d,transitionStatus:h,transitionTimingFunction:p}=PU({mounted:r,duration:e,exitDuration:t,timingFunction:s,onExit:o,onEntered:a,onEnter:c,onExited:f});if(d===0)return r?ke.createElement(ke.Fragment,null,i({})):null;if(h==="exited")return null;const g=Object.keys(n).reduce((v,y)=>(v[y]=AU({duration:n[y].duration,transition:n[y].transition,timingFunction:n[y].timingFunction||p,state:h}),v),{});return ke.createElement(ke.Fragment,null,i(g))}tR.displayName="@mantine/core/GroupedTransition";var cB=ds((n,{zIndex:e})=>({root:{position:"absolute",top:0,bottom:0,left:0,right:0,zIndex:e}})),fB=cB,dB=Object.defineProperty,hB=Object.defineProperties,pB=Object.getOwnPropertyDescriptors,tg=Object.getOwnPropertySymbols,nR=Object.prototype.hasOwnProperty,rR=Object.prototype.propertyIsEnumerable,dT=(n,e,t)=>e in n?dB(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,oy=(n,e)=>{for(var t in e||(e={}))nR.call(e,t)&&dT(n,t,e[t]);if(tg)for(var t of tg(e))rR.call(e,t)&&dT(n,t,e[t]);return n},mB=(n,e)=>hB(n,pB(e)),gB=(n,e)=>{var t={};for(var r in n)nR.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&tg)for(var r of tg(n))e.indexOf(r)<0&&rR.call(n,r)&&(t[r]=n[r]);return t};const vB={opacity:.6,color:"#fff",zIndex:rS("modal"),radius:0,blur:0},iR=te.exports.forwardRef((n,e)=>{const t=Mi("Overlay",vB,n),{opacity:r,blur:i,color:s,gradient:o,zIndex:a,radius:c,sx:f,unstyled:d,className:h}=t,p=gB(t,["opacity","blur","color","gradient","zIndex","radius","sx","unstyled","className"]),{classes:g,cx:v}=fB({zIndex:a},{name:"Overlay",unstyled:d}),y=o?{backgroundImage:o}:{backgroundColor:s},x=w=>at(Vi,{...oy({ref:e,className:v(g.root,h),sx:[_=>mB(oy({},y),{opacity:r,borderRadius:_.fn.size({size:c,sizes:_.radius})}),...lE(f)]},w)});return i?at(Vi,{...oy({className:v(g.root,h),sx:[{backdropFilter:`blur(${i}px)`},...lE(f)]},p),children:x()}):x(p)});iR.displayName="@mantine/core/Overlay";const yB=iR;var _B=Object.defineProperty,hT=Object.getOwnPropertySymbols,xB=Object.prototype.hasOwnProperty,SB=Object.prototype.propertyIsEnumerable,pT=(n,e,t)=>e in n?_B(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,wB=(n,e)=>{for(var t in e||(e={}))xB.call(e,t)&&pT(n,t,e[t]);if(hT)for(var t of hT(e))SB.call(e,t)&&pT(n,t,e[t]);return n};const MB={xs:320,sm:380,md:440,lg:620,xl:780};function bB(n){return n?{position:"absolute",top:0,left:0,right:0,bottom:0,maxHeight:"100vh",overflowY:"auto"}:{}}var EB=ds((n,{overflow:e,size:t,centered:r,zIndex:i,fullScreen:s})=>({close:{},overlay:{display:s?"none":void 0},root:{position:"fixed",zIndex:i,top:0,left:0,right:0,bottom:0},inner:{position:"absolute",top:0,left:0,right:0,bottom:0,overflowY:"auto",padding:s?0:`${n.spacing.xl*2}px ${n.spacing.md}px`,display:"flex",justifyContent:"center",alignItems:r?"center":"flex-start"},title:{marginRight:n.spacing.md,textOverflow:"ellipsis",display:"block",wordBreak:"break-word"},modal:wB({position:"relative",width:s?"100vw":n.fn.size({sizes:MB,size:t}),borderRadius:s?0:void 0,outline:0,backgroundColor:n.colorScheme==="dark"?n.colors.dark[7]:n.white,marginTop:r?"auto":void 0,marginBottom:r?"auto":void 0,zIndex:1},bB(s)),header:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:n.spacing.md,marginRight:-9},body:{maxHeight:e==="inside"?"calc(100vh - 185px)":null,overflowY:e==="inside"?"auto":null,wordBreak:"break-word"}})),TB=EB,CB=Object.defineProperty,ng=Object.getOwnPropertySymbols,sR=Object.prototype.hasOwnProperty,oR=Object.prototype.propertyIsEnumerable,mT=(n,e,t)=>e in n?CB(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,AB=(n,e)=>{for(var t in e||(e={}))sR.call(e,t)&&mT(n,t,e[t]);if(ng)for(var t of ng(e))oR.call(e,t)&&mT(n,t,e[t]);return n},PB=(n,e)=>{var t={};for(var r in n)sR.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&ng)for(var r of ng(n))e.indexOf(r)<0&&oR.call(n,r)&&(t[r]=n[r]);return t};const RB={size:"md",transitionDuration:250,overflow:"outside",padding:"lg",shadow:"lg",closeOnClickOutside:!0,closeOnEscape:!0,trapFocus:!0,withCloseButton:!0,withinPortal:!0,lockScroll:!0,withFocusReturn:!0,overlayBlur:0,zIndex:rS("modal"),exitTransitionDuration:0};function aR(n){const e=Mi("Modal",RB,n),{className:t,opened:r,title:i,onClose:s,children:o,withCloseButton:a,overlayOpacity:c,size:f,transitionDuration:d,exitTransitionDuration:h,closeButtonLabel:p,overlayColor:g,overflow:v,transition:y,padding:x,shadow:w,radius:_,id:M,classNames:E,styles:C,closeOnClickOutside:P,trapFocus:R,closeOnEscape:T,centered:L,target:D,withinPortal:Y,zIndex:fe,overlayBlur:q,transitionTimingFunction:$,fullScreen:se,unstyled:le,lockScroll:pe,withFocusReturn:z}=e,F=PB(e,["className","opened","title","onClose","children","withCloseButton","overlayOpacity","size","transitionDuration","exitTransitionDuration","closeButtonLabel","overlayColor","overflow","transition","padding","shadow","radius","id","classNames","styles","closeOnClickOutside","trapFocus","closeOnEscape","centered","target","withinPortal","zIndex","overlayBlur","transitionTimingFunction","fullScreen","unstyled","lockScroll","withFocusReturn"]),G=RF(M),Z=`${G}-title`,k=`${G}-body`,{classes:W,cx:N,theme:me}=TB({size:f,overflow:v,centered:L,zIndex:fe,fullScreen:se},{unstyled:le,classNames:E,styles:C,name:"Modal"}),X=EF(R&&r),Te=te.exports.useRef(null),Ce=DF(X,Te),we=typeof c=="number"?c:me.colorScheme==="dark"?.85:.75;VF(pe&&r);const be=ne=>{!R&&ne.key==="Escape"&&T&&s()};te.exports.useEffect(()=>{if(!R)return window.addEventListener("keydown",be),()=>window.removeEventListener("keydown",be)},[R]),yF({opened:r,shouldReturnFocus:R&&z});const He=te.exports.useRef(null);LF("mousedown",ne=>{He.current=ne.target});const ue=()=>{He.current===Te.current&&P&&s()};return at(kP,{withinPortal:Y,target:D,children:at(tR,{mounted:r,duration:d,exitDuration:h,timingFunction:$,transitions:{modal:{duration:d,transition:y||(se?"fade":"pop")},overlay:{duration:d/2,transition:"fade",timingFunction:"ease"}},children:ne=>at(Og,{children:ka(Vi,{...AB({id:G,className:N(W.root,t)},F),children:[at("div",{style:ne.overlay,children:at(yB,{className:W.overlay,sx:{position:"fixed"},zIndex:0,blur:q,color:g||(me.colorScheme==="dark"?me.colors.dark[9]:me.black),opacity:we,unstyled:le})}),at("div",{role:"presentation",className:W.inner,onClick:ue,onKeyDown:Ee=>{var Ue;((Ue=Ee.target)==null?void 0:Ue.getAttribute("data-mantine-stop-propagation"))!=="true"&&Ee.key==="Escape"&&T&&s()},ref:Ce,children:ka(tB,{className:W.modal,shadow:w,p:x,radius:_,role:"dialog","aria-labelledby":Z,"aria-describedby":k,"aria-modal":!0,tabIndex:-1,style:ne.modal,unstyled:le,onClick:Ee=>Ee.stopPropagation(),children:[(i||a)&&ka("div",{className:W.header,children:[at(bU,{id:Z,className:W.title,children:i}),a&&at(aU,{iconSize:16,onClick:s,"aria-label":p,className:W.close})]}),at("div",{id:k,className:W.body,children:o})]})})]})})})})}aR.displayName="@mantine/core/Modal";/** + * @license + * Copyright 2010-2022 Three.js Authors + * SPDX-License-Identifier: MIT + */const Ug="145",LB={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},IB={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},lR=0,sx=1,uR=2,NB=3,cR=0,Bg=1,cf=2,Ca=3,qa=0,jr=1,ki=2,Gs=0,za=1,ox=2,ax=3,lx=4,fR=5,Sa=100,dR=101,hR=102,ux=103,cx=104,pR=200,mR=201,gR=202,vR=203,oS=204,aS=205,yR=206,_R=207,xR=208,SR=209,wR=210,MR=0,bR=1,ER=2,rg=3,TR=4,CR=5,AR=6,PR=7,cd=0,RR=1,LR=2,Ui=0,IR=1,NR=2,DR=3,lS=4,OR=5,Vg=300,Vo=301,Go=302,zf=303,Ff=304,Hu=306,Uf=1e3,pr=1001,Bf=1002,En=1003,ig=1004,DB=1004,sg=1005,OB=1005,un=1006,uS=1007,kB=1007,sl=1008,zB=1008,Ho=1009,kR=1010,zR=1011,cS=1012,FR=1013,Ao=1014,os=1015,Za=1016,UR=1017,BR=1018,Fa=1020,VR=1021,GR=1022,_i=1023,HR=1024,WR=1025,Fo=1026,Qa=1027,$R=1028,jR=1029,XR=1030,YR=1031,qR=1033,om=33776,am=33777,lm=33778,um=33779,fx=35840,dx=35841,hx=35842,px=35843,ZR=36196,mx=37492,gx=37496,vx=37808,yx=37809,_x=37810,xx=37811,Sx=37812,wx=37813,Mx=37814,bx=37815,Ex=37816,Tx=37817,Cx=37818,Ax=37819,Px=37820,Rx=37821,Lx=36492,QR=2200,KR=2201,JR=2202,Vf=2300,Gf=2301,cm=2302,Aa=2400,Pa=2401,Hf=2402,Gg=2500,fS=2501,FB=0,UB=1,BB=2,Xs=3e3,Kt=3001,eL=3200,tL=3201,qo=0,nL=1,VB="",ts="srgb",Po="srgb-linear",GB=0,fm=7680,HB=7681,WB=7682,$B=7683,jB=34055,XB=34056,YB=5386,qB=512,ZB=513,QB=514,KB=515,JB=516,eV=517,tV=518,rL=519,Wf=35044,nV=35048,rV=35040,iV=35045,sV=35049,oV=35041,aV=35046,lV=35050,uV=35042,cV="100",Ix="300 es",og=1035;class Zs{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let s=0,o=i.length;s>8&255]+rr[n>>16&255]+rr[n>>24&255]+"-"+rr[e&255]+rr[e>>8&255]+"-"+rr[e>>16&15|64]+rr[e>>24&255]+"-"+rr[t&63|128]+rr[t>>8&255]+"-"+rr[t>>16&255]+rr[t>>24&255]+rr[r&255]+rr[r>>8&255]+rr[r>>16&255]+rr[r>>24&255]).toLowerCase()}function xn(n,e,t){return Math.max(e,Math.min(t,n))}function dS(n,e){return(n%e+e)%e}function fV(n,e,t,r,i){return r+(n-e)*(i-r)/(t-e)}function dV(n,e,t){return n!==e?(t-n)/(e-n):0}function ff(n,e,t){return(1-t)*n+t*e}function hV(n,e,t,r){return ff(n,e,1-Math.exp(-t*r))}function pV(n,e=1){return e-Math.abs(dS(n,e*2)-e)}function mV(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function gV(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function vV(n,e){return n+Math.floor(Math.random()*(e-n+1))}function yV(n,e){return n+Math.random()*(e-n)}function _V(n){return n*(.5-Math.random())}function xV(n){n!==void 0&&(gT=n);let e=gT+=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 SV(n){return n*Ua}function wV(n){return n*$f}function Nx(n){return(n&n-1)===0&&n!==0}function iL(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function ag(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function MV(n,e,t,r,i){const s=Math.cos,o=Math.sin,a=s(t/2),c=o(t/2),f=s((e+r)/2),d=o((e+r)/2),h=s((e-r)/2),p=o((e-r)/2),g=s((r-e)/2),v=o((r-e)/2);switch(i){case"XYX":n.set(a*d,c*h,c*p,a*f);break;case"YZY":n.set(c*p,a*d,c*h,a*f);break;case"ZXZ":n.set(c*h,c*p,a*d,a*f);break;case"XZX":n.set(a*d,c*v,c*g,a*f);break;case"YXY":n.set(c*g,a*d,c*v,a*f);break;case"ZYZ":n.set(c*v,c*g,a*d,a*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Us(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 Xt(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 is=Object.freeze({__proto__:null,DEG2RAD:Ua,RAD2DEG:$f,generateUUID:Xr,clamp:xn,euclideanModulo:dS,mapLinear:fV,inverseLerp:dV,lerp:ff,damp:hV,pingpong:pV,smoothstep:mV,smootherstep:gV,randInt:vV,randFloat:yV,randFloatSpread:_V,seededRandom:xV,degToRad:SV,radToDeg:wV,isPowerOfTwo:Nx,ceilPowerOfTwo:iL,floorPowerOfTwo:ag,setQuaternionFromProperEuler:MV,normalize:Xt,denormalize:Us});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,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+i[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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r=this.y-e.y;return t*t+r*r}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,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 r=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*r-o*i+e.x,this.y=s*i+o*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Tr{constructor(){Tr.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,r,i,s,o,a,c,f){const d=this.elements;return d[0]=e,d[1]=i,d[2]=a,d[3]=t,d[4]=s,d[5]=c,d[6]=r,d[7]=o,d[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.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 r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[3],c=r[6],f=r[1],d=r[4],h=r[7],p=r[2],g=r[5],v=r[8],y=i[0],x=i[3],w=i[6],_=i[1],M=i[4],E=i[7],C=i[2],P=i[5],R=i[8];return s[0]=o*y+a*_+c*C,s[3]=o*x+a*M+c*P,s[6]=o*w+a*E+c*R,s[1]=f*y+d*_+h*C,s[4]=f*x+d*M+h*P,s[7]=f*w+d*E+h*R,s[2]=p*y+g*_+v*C,s[5]=p*x+g*M+v*P,s[8]=p*w+g*E+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],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],c=e[6],f=e[7],d=e[8];return t*o*d-t*a*f-r*s*d+r*a*c+i*s*f-i*o*c}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],c=e[6],f=e[7],d=e[8],h=d*o-a*f,p=a*c-d*s,g=f*s-o*c,v=t*h+r*p+i*g;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/v;return e[0]=h*y,e[1]=(i*f-d*r)*y,e[2]=(a*r-i*o)*y,e[3]=p*y,e[4]=(d*t-i*c)*y,e[5]=(i*s-a*t)*y,e[6]=g*y,e[7]=(r*c-f*t)*y,e[8]=(o*t-r*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,r,i,s,o,a){const c=Math.cos(s),f=Math.sin(s);return this.set(r*c,r*f,-r*(c*o+f*a)+o+e,-i*f,i*c,-i*(-f*o+c*a)+a+t,0,0,1),this}scale(e,t){const r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=t,r[4]*=t,r[7]*=t,this}rotate(e){const t=Math.cos(e),r=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],c=i[1],f=i[4],d=i[7];return i[0]=t*s+r*c,i[3]=t*o+r*f,i[6]=t*a+r*d,i[1]=-r*s+t*c,i[4]=-r*o+t*f,i[7]=-r*a+t*d,this}translate(e,t){const r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=t*r[2],r[4]+=t*r[5],r[7]+=t*r[8],this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<9;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}function sL(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const bV={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function cu(n,e){return new bV[n](e)}function jf(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Ba(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function dm(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const ay={[ts]:{[Po]:Ba},[Po]:{[ts]:dm}},di={legacyMode:!0,get workingColorSpace(){return Po},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(ay[e]&&ay[e][t]!==void 0){const r=ay[e][t];return n.r=r(n.r),n.g=r(n.g),n.b=r(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)}},oL={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},Rn={r:0,g:0,b:0},Ai={h:0,s:0,l:0},Zh={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 Qh(n,e){return e.r=n.r,e.g=n.g,e.b=n.b,e}class Ge{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,t===void 0&&r===void 0?this.set(e):this.setRGB(e,t,r)}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=ts){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,di.toWorkingColorSpace(this,t),this}setRGB(e,t,r,i=Po){return this.r=e,this.g=t,this.b=r,di.toWorkingColorSpace(this,i),this}setHSL(e,t,r,i=Po){if(e=dS(e,1),t=xn(t,0,1),r=xn(r,0,1),t===0)this.r=this.g=this.b=r;else{const s=r<=.5?r*(1+t):r+t-r*t,o=2*r-s;this.r=ly(o,s,e+1/3),this.g=ly(o,s,e),this.b=ly(o,s,e-1/3)}return di.toWorkingColorSpace(this,i),this}setStyle(e,t=ts){function r(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],a=i[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,di.toWorkingColorSpace(this,t),r(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,di.toWorkingColorSpace(this,t),r(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 c=parseFloat(s[1])/360,f=parseFloat(s[2])/100,d=parseFloat(s[3])/100;return r(s[4]),this.setHSL(c,f,d,t)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[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,di.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,di.toWorkingColorSpace(this,t),this}return e&&e.length>0?this.setColorName(e,t):this}setColorName(e,t=ts){const r=oL[e.toLowerCase()];return r!==void 0?this.setHex(r,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=Ba(e.r),this.g=Ba(e.g),this.b=Ba(e.b),this}copyLinearToSRGB(e){return this.r=dm(e.r),this.g=dm(e.g),this.b=dm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ts){return di.fromWorkingColorSpace(Qh(this,Rn),e),xn(Rn.r*255,0,255)<<16^xn(Rn.g*255,0,255)<<8^xn(Rn.b*255,0,255)<<0}getHexString(e=ts){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Po){di.fromWorkingColorSpace(Qh(this,Rn),t);const r=Rn.r,i=Rn.g,s=Rn.b,o=Math.max(r,i,s),a=Math.min(r,i,s);let c,f;const d=(a+o)/2;if(a===o)c=0,f=0;else{const h=o-a;switch(f=d<=.5?h/(o+a):h/(2-o-a),o){case r:c=(i-s)/h+(i2048||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!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){const t=jf("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o1)switch(this.wrapS){case Uf:e.x=e.x-Math.floor(e.x);break;case pr:e.x=e.x<0?0:1;break;case Bf: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 Uf:e.y=e.y-Math.floor(e.y);break;case pr:e.y=e.y<0?0:1;break;case Bf: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)}}Cn.DEFAULT_IMAGE=null;Cn.DEFAULT_MAPPING=Vg;class Ht{constructor(e=0,t=0,r=0,i=1){Ht.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=i}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,r,i){return this.x=e,this.y=t,this.z=r,this.w=i,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,r=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*r+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*r+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*r+o[11]*i+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,r,i,s;const c=e.elements,f=c[0],d=c[4],h=c[8],p=c[1],g=c[5],v=c[9],y=c[2],x=c[6],w=c[10];if(Math.abs(d-p)<.01&&Math.abs(h-y)<.01&&Math.abs(v-x)<.01){if(Math.abs(d+p)<.1&&Math.abs(h+y)<.1&&Math.abs(v+x)<.1&&Math.abs(f+g+w-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(f+1)/2,E=(g+1)/2,C=(w+1)/2,P=(d+p)/4,R=(h+y)/4,T=(v+x)/4;return M>E&&M>C?M<.01?(r=0,i=.707106781,s=.707106781):(r=Math.sqrt(M),i=P/r,s=R/r):E>C?E<.01?(r=.707106781,i=0,s=.707106781):(i=Math.sqrt(E),r=P/i,s=T/i):C<.01?(r=.707106781,i=.707106781,s=0):(s=Math.sqrt(C),r=R/s,i=T/s),this.set(r,i,s,t),this}let _=Math.sqrt((x-v)*(x-v)+(h-y)*(h-y)+(p-d)*(p-d));return Math.abs(_)<.001&&(_=1),this.x=(x-v)/_,this.y=(h-y)/_,this.z=(p-d)/_,this.w=Math.acos((f+g+w-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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,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 qr extends Zs{constructor(e,t,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ht(0,0,e,t),this.scissorTest=!1,this.viewport=new Ht(0,0,e,t);const i={width:e,height:t,depth:1};this.texture=new Cn(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:un,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(e,t,r=1){(this.width!==e||this.height!==t||this.depth!==r)&&(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,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 Ra(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 fd extends Cn{constructor(e=null,t=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=En,this.minFilter=En,this.wrapR=pr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class TV extends qr{constructor(e,t,r){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new fd(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class Hg extends Cn{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=En,this.minFilter=En,this.wrapR=pr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class CV extends qr{constructor(e,t,r){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new Hg(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class AV extends qr{constructor(e,t,r,i={}){super(e,t,i),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;o=0?1:-1,M=1-w*w;if(M>Number.EPSILON){const C=Math.sqrt(M),P=Math.atan2(C,w*_);x=Math.sin(x*P)/C,a=Math.sin(a*P)/C}const E=a*_;if(c=c*x+p*E,f=f*x+g*E,d=d*x+v*E,h=h*x+y*E,x===1-a){const C=1/Math.sqrt(c*c+f*f+d*d+h*h);c*=C,f*=C,d*=C,h*=C}}e[t]=c,e[t+1]=f,e[t+2]=d,e[t+3]=h}static multiplyQuaternionsFlat(e,t,r,i,s,o){const a=r[i],c=r[i+1],f=r[i+2],d=r[i+3],h=s[o],p=s[o+1],g=s[o+2],v=s[o+3];return e[t]=a*v+d*h+c*g-f*p,e[t+1]=c*v+d*p+f*h-a*g,e[t+2]=f*v+d*g+a*p-c*h,e[t+3]=d*v-a*h-c*p-f*g,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,r,i){return this._x=e,this._y=t,this._z=r,this._w=i,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 r=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,c=Math.sin,f=a(r/2),d=a(i/2),h=a(s/2),p=c(r/2),g=c(i/2),v=c(s/2);switch(o){case"XYZ":this._x=p*d*h+f*g*v,this._y=f*g*h-p*d*v,this._z=f*d*v+p*g*h,this._w=f*d*h-p*g*v;break;case"YXZ":this._x=p*d*h+f*g*v,this._y=f*g*h-p*d*v,this._z=f*d*v-p*g*h,this._w=f*d*h+p*g*v;break;case"ZXY":this._x=p*d*h-f*g*v,this._y=f*g*h+p*d*v,this._z=f*d*v+p*g*h,this._w=f*d*h-p*g*v;break;case"ZYX":this._x=p*d*h-f*g*v,this._y=f*g*h+p*d*v,this._z=f*d*v-p*g*h,this._w=f*d*h+p*g*v;break;case"YZX":this._x=p*d*h+f*g*v,this._y=f*g*h+p*d*v,this._z=f*d*v-p*g*h,this._w=f*d*h-p*g*v;break;case"XZY":this._x=p*d*h-f*g*v,this._y=f*g*h-p*d*v,this._z=f*d*v+p*g*h,this._w=f*d*h+p*g*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],i=t[4],s=t[8],o=t[1],a=t[5],c=t[9],f=t[2],d=t[6],h=t[10],p=r+a+h;if(p>0){const g=.5/Math.sqrt(p+1);this._w=.25/g,this._x=(d-c)*g,this._y=(s-f)*g,this._z=(o-i)*g}else if(r>a&&r>h){const g=2*Math.sqrt(1+r-a-h);this._w=(d-c)/g,this._x=.25*g,this._y=(i+o)/g,this._z=(s+f)/g}else if(a>h){const g=2*Math.sqrt(1+a-r-h);this._w=(s-f)/g,this._x=(i+o)/g,this._y=.25*g,this._z=(c+d)/g}else{const g=2*Math.sqrt(1+h-r-a);this._w=(o-i)/g,this._x=(s+f)/g,this._y=(c+d)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(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=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(xn(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,t/r);return this.slerp(e,i),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 r=e._x,i=e._y,s=e._z,o=e._w,a=t._x,c=t._y,f=t._z,d=t._w;return this._x=r*d+o*a+i*f-s*c,this._y=i*d+o*c+s*a-r*f,this._z=s*d+o*f+r*c-i*a,this._w=o*d-r*a-i*c-s*f,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,i=this._y,s=this._z,o=this._w;let a=o*e._w+r*e._x+i*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=r,this._y=i,this._z=s,this;const c=1-a*a;if(c<=Number.EPSILON){const g=1-t;return this._w=g*o+t*this._w,this._x=g*r+t*this._x,this._y=g*i+t*this._y,this._z=g*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const f=Math.sqrt(c),d=Math.atan2(f,a),h=Math.sin((1-t)*d)/f,p=Math.sin(t*d)/f;return this._w=o*h+this._w*p,this._x=r*h+this._x*p,this._y=i*h+this._y*p,this._z=s*h+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=Math.random(),t=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),r*Math.sin(s),r*Math.cos(s),t*Math.sin(i))}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 I{constructor(e=0,t=0,r=0){I.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,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(vT.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(vT.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6]*i,this.y=s[1]*t+s[4]*r+s[7]*i,this.z=s[2]*t+s[5]*r+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*r+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*r+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*r+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,r=this.y,i=this.z,s=e.x,o=e.y,a=e.z,c=e.w,f=c*t+o*i-a*r,d=c*r+a*t-s*i,h=c*i+s*r-o*t,p=-s*t-o*r-a*i;return this.x=f*c+p*-s+d*-a-h*-o,this.y=d*c+p*-o+h*-s-f*-a,this.z=h*c+p*-a+f*-o-d*-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,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*i,this.y=s[1]*t+s[5]*r+s[9]*i,this.z=s[2]*t+s[6]*r+s[10]*i,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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,i=e.y,s=e.z,o=t.x,a=t.y,c=t.z;return this.x=i*c-s*a,this.y=s*o-r*c,this.z=r*a-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return cy.copy(this).projectOnVector(e),this.sub(cy)}reflect(e){return this.sub(cy.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 r=this.dot(e)/t;return Math.acos(xn(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+r*r+i*i}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,r){const i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,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(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=i,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,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const cy=new I,vT=new Gt;class ol{constructor(e=new I(1/0,1/0,1/0),t=new I(-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,r=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let c=0,f=e.length;cs&&(s=d),h>o&&(o=h),p>a&&(a=p)}return this.min.set(t,r,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,r=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let c=0,f=e.count;cs&&(s=d),h>o&&(o=h),p>a&&(a=p)}return this.min.set(t,r,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,la),la.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Lc),Kh.subVectors(this.max,Lc),Rl.subVectors(e.a,Lc),Ll.subVectors(e.b,Lc),Il.subVectors(e.c,Lc),co.subVectors(Ll,Rl),fo.subVectors(Il,Ll),ua.subVectors(Rl,Il);let t=[0,-co.z,co.y,0,-fo.z,fo.y,0,-ua.z,ua.y,co.z,0,-co.x,fo.z,0,-fo.x,ua.z,0,-ua.x,-co.y,co.x,0,-fo.y,fo.x,0,-ua.y,ua.x,0];return!dy(t,Rl,Ll,Il,Kh)||(t=[1,0,0,0,1,0,0,0,1],!dy(t,Rl,Ll,Il,Kh))?!1:(Jh.crossVectors(co,fo),t=[Jh.x,Jh.y,Jh.z],dy(t,Rl,Ll,Il,Kh))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return la.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(la).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:(As[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),As[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),As[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),As[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),As[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),As[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),As[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),As[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(As),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 As=[new I,new I,new I,new I,new I,new I,new I,new I],la=new I,fy=new ol,Rl=new I,Ll=new I,Il=new I,co=new I,fo=new I,ua=new I,Lc=new I,Kh=new I,Jh=new I,ca=new I;function dy(n,e,t,r,i){for(let s=0,o=n.length-3;s<=o;s+=3){ca.fromArray(n,s);const a=i.x*Math.abs(ca.x)+i.y*Math.abs(ca.y)+i.z*Math.abs(ca.z),c=e.dot(ca),f=t.dot(ca),d=r.dot(ca);if(Math.max(-Math.max(c,f,d),Math.min(c,f,d))>a)return!1}return!0}const PV=new ol,yT=new I,ep=new I,hy=new I;class al{constructor(e=new I,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):PV.setFromPoints(e).getCenter(r);let i=0;for(let s=0,o=e.length;sthis.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;hy.subVectors(e,this.center);const t=hy.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),i=(r-this.radius)*.5;this.center.add(hy.multiplyScalar(i/r)),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?ep.set(0,0,1).multiplyScalar(e.radius):ep.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(yT.copy(e.center).add(ep)),this.expandByPoint(yT.copy(e.center).sub(ep)),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ps=new I,py=new I,tp=new I,ho=new I,my=new I,np=new I,gy=new I;class dd{constructor(e=new I,t=new I(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,Ps)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ps.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ps.copy(this.direction).multiplyScalar(t).add(this.origin),Ps.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){py.copy(e).add(t).multiplyScalar(.5),tp.copy(t).sub(e).normalize(),ho.copy(this.origin).sub(py);const s=e.distanceTo(t)*.5,o=-this.direction.dot(tp),a=ho.dot(this.direction),c=-ho.dot(tp),f=ho.lengthSq(),d=Math.abs(1-o*o);let h,p,g,v;if(d>0)if(h=o*c-a,p=o*a-c,v=s*d,h>=0)if(p>=-v)if(p<=v){const y=1/d;h*=y,p*=y,g=h*(h+o*p+2*a)+p*(o*h+p+2*c)+f}else p=s,h=Math.max(0,-(o*p+a)),g=-h*h+p*(p+2*c)+f;else p=-s,h=Math.max(0,-(o*p+a)),g=-h*h+p*(p+2*c)+f;else p<=-v?(h=Math.max(0,-(-o*s+a)),p=h>0?-s:Math.min(Math.max(-s,-c),s),g=-h*h+p*(p+2*c)+f):p<=v?(h=0,p=Math.min(Math.max(-s,-c),s),g=p*(p+2*c)+f):(h=Math.max(0,-(o*s+a)),p=h>0?s:Math.min(Math.max(-s,-c),s),g=-h*h+p*(p+2*c)+f);else p=o>0?-s:s,h=Math.max(0,-(o*p+a)),g=-h*h+p*(p+2*c)+f;return r&&r.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(tp).multiplyScalar(p).add(py),g}intersectSphere(e,t){Ps.subVectors(e.center,this.origin);const r=Ps.dot(this.direction),i=Ps.dot(Ps)-r*r,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),a=r-o,c=r+o;return a<0&&c<0?null:a<0?this.at(c,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 r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,i,s,o,a,c;const f=1/this.direction.x,d=1/this.direction.y,h=1/this.direction.z,p=this.origin;return f>=0?(r=(e.min.x-p.x)*f,i=(e.max.x-p.x)*f):(r=(e.max.x-p.x)*f,i=(e.min.x-p.x)*f),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),r>o||s>i||((s>r||r!==r)&&(r=s),(o=0?(a=(e.min.z-p.z)*h,c=(e.max.z-p.z)*h):(a=(e.max.z-p.z)*h,c=(e.min.z-p.z)*h),r>c||a>i)||((a>r||r!==r)&&(r=a),(c=0?r:i,t)}intersectsBox(e){return this.intersectBox(e,Ps)!==null}intersectTriangle(e,t,r,i,s){my.subVectors(t,e),np.subVectors(r,e),gy.crossVectors(my,np);let o=this.direction.dot(gy),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ho.subVectors(this.origin,e);const c=a*this.direction.dot(np.crossVectors(ho,np));if(c<0)return null;const f=a*this.direction.dot(my.cross(ho));if(f<0||c+f>o)return null;const d=-a*ho.dot(gy);return d<0?null:this.at(d/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 dt{constructor(){dt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,r,i,s,o,a,c,f,d,h,p,g,v,y,x){const w=this.elements;return w[0]=e,w[4]=t,w[8]=r,w[12]=i,w[1]=s,w[5]=o,w[9]=a,w[13]=c,w[2]=f,w[6]=d,w[10]=h,w[14]=p,w[3]=g,w[7]=v,w[11]=y,w[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 dt().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[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,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,i=1/Nl.setFromMatrixColumn(e,0).length(),s=1/Nl.setFromMatrixColumn(e,1).length(),o=1/Nl.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*s,t[5]=r[5]*s,t[6]=r[6]*s,t[7]=0,t[8]=r[8]*o,t[9]=r[9]*o,t[10]=r[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,i=e.y,s=e.z,o=Math.cos(r),a=Math.sin(r),c=Math.cos(i),f=Math.sin(i),d=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const p=o*d,g=o*h,v=a*d,y=a*h;t[0]=c*d,t[4]=-c*h,t[8]=f,t[1]=g+v*f,t[5]=p-y*f,t[9]=-a*c,t[2]=y-p*f,t[6]=v+g*f,t[10]=o*c}else if(e.order==="YXZ"){const p=c*d,g=c*h,v=f*d,y=f*h;t[0]=p+y*a,t[4]=v*a-g,t[8]=o*f,t[1]=o*h,t[5]=o*d,t[9]=-a,t[2]=g*a-v,t[6]=y+p*a,t[10]=o*c}else if(e.order==="ZXY"){const p=c*d,g=c*h,v=f*d,y=f*h;t[0]=p-y*a,t[4]=-o*h,t[8]=v+g*a,t[1]=g+v*a,t[5]=o*d,t[9]=y-p*a,t[2]=-o*f,t[6]=a,t[10]=o*c}else if(e.order==="ZYX"){const p=o*d,g=o*h,v=a*d,y=a*h;t[0]=c*d,t[4]=v*f-g,t[8]=p*f+y,t[1]=c*h,t[5]=y*f+p,t[9]=g*f-v,t[2]=-f,t[6]=a*c,t[10]=o*c}else if(e.order==="YZX"){const p=o*c,g=o*f,v=a*c,y=a*f;t[0]=c*d,t[4]=y-p*h,t[8]=v*h+g,t[1]=h,t[5]=o*d,t[9]=-a*d,t[2]=-f*d,t[6]=g*h+v,t[10]=p-y*h}else if(e.order==="XZY"){const p=o*c,g=o*f,v=a*c,y=a*f;t[0]=c*d,t[4]=-h,t[8]=f*d,t[1]=p*h+y,t[5]=o*d,t[9]=g*h-v,t[2]=v*h-g,t[6]=a*d,t[10]=y*h+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(RV,e,LV)}lookAt(e,t,r){const i=this.elements;return Fr.subVectors(e,t),Fr.lengthSq()===0&&(Fr.z=1),Fr.normalize(),po.crossVectors(r,Fr),po.lengthSq()===0&&(Math.abs(r.z)===1?Fr.x+=1e-4:Fr.z+=1e-4,Fr.normalize(),po.crossVectors(r,Fr)),po.normalize(),rp.crossVectors(Fr,po),i[0]=po.x,i[4]=rp.x,i[8]=Fr.x,i[1]=po.y,i[5]=rp.y,i[9]=Fr.y,i[2]=po.z,i[6]=rp.z,i[10]=Fr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[4],c=r[8],f=r[12],d=r[1],h=r[5],p=r[9],g=r[13],v=r[2],y=r[6],x=r[10],w=r[14],_=r[3],M=r[7],E=r[11],C=r[15],P=i[0],R=i[4],T=i[8],L=i[12],D=i[1],Y=i[5],fe=i[9],q=i[13],$=i[2],se=i[6],le=i[10],pe=i[14],z=i[3],F=i[7],G=i[11],Z=i[15];return s[0]=o*P+a*D+c*$+f*z,s[4]=o*R+a*Y+c*se+f*F,s[8]=o*T+a*fe+c*le+f*G,s[12]=o*L+a*q+c*pe+f*Z,s[1]=d*P+h*D+p*$+g*z,s[5]=d*R+h*Y+p*se+g*F,s[9]=d*T+h*fe+p*le+g*G,s[13]=d*L+h*q+p*pe+g*Z,s[2]=v*P+y*D+x*$+w*z,s[6]=v*R+y*Y+x*se+w*F,s[10]=v*T+y*fe+x*le+w*G,s[14]=v*L+y*q+x*pe+w*Z,s[3]=_*P+M*D+E*$+C*z,s[7]=_*R+M*Y+E*se+C*F,s[11]=_*T+M*fe+E*le+C*G,s[15]=_*L+M*q+E*pe+C*Z,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],r=e[4],i=e[8],s=e[12],o=e[1],a=e[5],c=e[9],f=e[13],d=e[2],h=e[6],p=e[10],g=e[14],v=e[3],y=e[7],x=e[11],w=e[15];return v*(+s*c*h-i*f*h-s*a*p+r*f*p+i*a*g-r*c*g)+y*(+t*c*g-t*f*p+s*o*p-i*o*g+i*f*d-s*c*d)+x*(+t*f*h-t*a*g-s*o*h+r*o*g+s*a*d-r*f*d)+w*(-i*a*d-t*c*h+t*a*p+i*o*h-r*o*p+r*c*d)}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,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],c=e[6],f=e[7],d=e[8],h=e[9],p=e[10],g=e[11],v=e[12],y=e[13],x=e[14],w=e[15],_=h*x*f-y*p*f+y*c*g-a*x*g-h*c*w+a*p*w,M=v*p*f-d*x*f-v*c*g+o*x*g+d*c*w-o*p*w,E=d*y*f-v*h*f+v*a*g-o*y*g-d*a*w+o*h*w,C=v*h*c-d*y*c-v*a*p+o*y*p+d*a*x-o*h*x,P=t*_+r*M+i*E+s*C;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]=_*R,e[1]=(y*p*s-h*x*s-y*i*g+r*x*g+h*i*w-r*p*w)*R,e[2]=(a*x*s-y*c*s+y*i*f-r*x*f-a*i*w+r*c*w)*R,e[3]=(h*c*s-a*p*s-h*i*f+r*p*f+a*i*g-r*c*g)*R,e[4]=M*R,e[5]=(d*x*s-v*p*s+v*i*g-t*x*g-d*i*w+t*p*w)*R,e[6]=(v*c*s-o*x*s-v*i*f+t*x*f+o*i*w-t*c*w)*R,e[7]=(o*p*s-d*c*s+d*i*f-t*p*f-o*i*g+t*c*g)*R,e[8]=E*R,e[9]=(v*h*s-d*y*s-v*r*g+t*y*g+d*r*w-t*h*w)*R,e[10]=(o*y*s-v*a*s+v*r*f-t*y*f-o*r*w+t*a*w)*R,e[11]=(d*a*s-o*h*s-d*r*f+t*h*f+o*r*g-t*a*g)*R,e[12]=C*R,e[13]=(d*y*i-v*h*i+v*r*p-t*y*p-d*r*x+t*h*x)*R,e[14]=(v*a*i-o*y*i-v*r*c+t*y*c+o*r*x-t*a*x)*R,e[15]=(o*h*i-d*a*i+d*r*c-t*h*c-o*r*p+t*a*p)*R,this}scale(e){const t=this.elements,r=e.x,i=e.y,s=e.z;return t[0]*=r,t[4]*=i,t[8]*=s,t[1]*=r,t[5]*=i,t[9]*=s,t[2]*=r,t[6]*=i,t[10]*=s,t[3]*=r,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,i))}makeTranslation(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),i=Math.sin(t),s=1-r,o=e.x,a=e.y,c=e.z,f=s*o,d=s*a;return this.set(f*o+r,f*a-i*c,f*c+i*a,0,f*a+i*c,d*a+r,d*c-i*o,0,f*c-i*a,d*c+i*o,s*c*c+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,s,o){return this.set(1,r,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){const i=this.elements,s=t._x,o=t._y,a=t._z,c=t._w,f=s+s,d=o+o,h=a+a,p=s*f,g=s*d,v=s*h,y=o*d,x=o*h,w=a*h,_=c*f,M=c*d,E=c*h,C=r.x,P=r.y,R=r.z;return i[0]=(1-(y+w))*C,i[1]=(g+E)*C,i[2]=(v-M)*C,i[3]=0,i[4]=(g-E)*P,i[5]=(1-(p+w))*P,i[6]=(x+_)*P,i[7]=0,i[8]=(v+M)*R,i[9]=(x-_)*R,i[10]=(1-(p+y))*R,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,r){const i=this.elements;let s=Nl.set(i[0],i[1],i[2]).length();const o=Nl.set(i[4],i[5],i[6]).length(),a=Nl.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],Pi.copy(this);const f=1/s,d=1/o,h=1/a;return Pi.elements[0]*=f,Pi.elements[1]*=f,Pi.elements[2]*=f,Pi.elements[4]*=d,Pi.elements[5]*=d,Pi.elements[6]*=d,Pi.elements[8]*=h,Pi.elements[9]*=h,Pi.elements[10]*=h,t.setFromRotationMatrix(Pi),r.x=s,r.y=o,r.z=a,this}makePerspective(e,t,r,i,s,o){const a=this.elements,c=2*s/(t-e),f=2*s/(r-i),d=(t+e)/(t-e),h=(r+i)/(r-i),p=-(o+s)/(o-s),g=-2*o*s/(o-s);return a[0]=c,a[4]=0,a[8]=d,a[12]=0,a[1]=0,a[5]=f,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=p,a[14]=g,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,r,i,s,o){const a=this.elements,c=1/(t-e),f=1/(r-i),d=1/(o-s),h=(t+e)*c,p=(r+i)*f,g=(o+s)*d;return a[0]=2*c,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*f,a[9]=0,a[13]=-p,a[2]=0,a[6]=0,a[10]=-2*d,a[14]=-g,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<16;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const Nl=new I,Pi=new dt,RV=new I(0,0,0),LV=new I(1,1,1),po=new I,rp=new I,Fr=new I,_T=new dt,xT=new Gt;class ll{constructor(e=0,t=0,r=0,i=ll.DefaultOrder){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=i}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,r,i=this._order){return this._x=e,this._y=t,this._z=r,this._order=i,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,r=!0){const i=e.elements,s=i[0],o=i[4],a=i[8],c=i[1],f=i[5],d=i[9],h=i[2],p=i[6],g=i[10];switch(t){case"XYZ":this._y=Math.asin(xn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,f),this._z=0);break;case"YXZ":this._x=Math.asin(-xn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,g),this._z=Math.atan2(c,f)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(xn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,g),this._z=Math.atan2(-o,f)):(this._y=0,this._z=Math.atan2(c,s));break;case"ZYX":this._y=Math.asin(-xn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,g),this._z=Math.atan2(c,s)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(xn(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-d,f),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,g));break;case"XZY":this._z=Math.asin(-xn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,f),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-d,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return _T.makeRotationFromQuaternion(e),this.setFromRotationMatrix(_T,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return xT.setFromEuler(this),this.setFromQuaternion(xT,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}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}ll.DefaultOrder="XYZ";ll.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Va{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let r=0;r0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),c.length>0&&(r.materials=c),f.length>0&&(r.textures=f),d.length>0&&(r.images=d),h.length>0&&(r.shapes=h),p.length>0&&(r.skeletons=p),g.length>0&&(r.animations=g),v.length>0&&(r.nodes=v)}return r.object=i,r;function o(a){const c=[];for(const f in a){const d=a[f];delete d.metadata,c.push(d)}return c}}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 r=0;r0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,r,i,s){Ri.subVectors(i,t),Ls.subVectors(r,t),vy.subVectors(e,t);const o=Ri.dot(Ri),a=Ri.dot(Ls),c=Ri.dot(vy),f=Ls.dot(Ls),d=Ls.dot(vy),h=o*f-a*a;if(h===0)return s.set(-2,-1,-1);const p=1/h,g=(f*c-a*d)*p,v=(o*d-a*c)*p;return s.set(1-g-v,v,g)}static containsPoint(e,t,r,i){return this.getBarycoord(e,t,r,i,Is),Is.x>=0&&Is.y>=0&&Is.x+Is.y<=1}static getUV(e,t,r,i,s,o,a,c){return this.getBarycoord(e,t,r,i,Is),c.set(0,0),c.addScaledVector(s,Is.x),c.addScaledVector(o,Is.y),c.addScaledVector(a,Is.z),c}static isFrontFacing(e,t,r,i){return Ri.subVectors(r,t),Ls.subVectors(e,t),Ri.cross(Ls).dot(i)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),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 Ri.subVectors(this.c,this.b),Ls.subVectors(this.a,this.b),Ri.cross(Ls).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return vi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return vi.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,r,i,s){return vi.getUV(e,this.a,this.b,this.c,t,r,i,s)}containsPoint(e){return vi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return vi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,i=this.b,s=this.c;let o,a;Ol.subVectors(i,r),kl.subVectors(s,r),yy.subVectors(e,r);const c=Ol.dot(yy),f=kl.dot(yy);if(c<=0&&f<=0)return t.copy(r);_y.subVectors(e,i);const d=Ol.dot(_y),h=kl.dot(_y);if(d>=0&&h<=d)return t.copy(i);const p=c*h-d*f;if(p<=0&&c>=0&&d<=0)return o=c/(c-d),t.copy(r).addScaledVector(Ol,o);xy.subVectors(e,s);const g=Ol.dot(xy),v=kl.dot(xy);if(v>=0&&g<=v)return t.copy(s);const y=g*f-c*v;if(y<=0&&f>=0&&v<=0)return a=f/(f-v),t.copy(r).addScaledVector(kl,a);const x=d*v-g*h;if(x<=0&&h-d>=0&&g-v>=0)return TT.subVectors(s,i),a=(h-d)/(h-d+(g-v)),t.copy(i).addScaledVector(TT,a);const w=1/(x+y+p);return o=y*w,a=p*w,t.copy(r).addScaledVector(Ol,o).addScaledVector(kl,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let kV=0;class qn extends Zs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:kV++}),this.uuid=Xr(),this.name="",this.type="Material",this.blending=za,this.side=qa,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=oS,this.blendDst=aS,this.blendEquation=Sa,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=rg,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=rL,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=fm,this.stencilZFail=fm,this.stencilZPass=fm,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.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 r=e[t];if(r===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}const i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==za&&(r.blending=this.blending),this.side!==qa&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData);function i(s){const o=[];for(const a in s){const c=s[a];delete c.metadata,o.push(c)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(r.textures=s),o.length>0&&(r.images=o)}return r}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 r=null;if(t!==null){const i=t.length;r=new Array(i);for(let s=0;s!==i;++s)r[s]=t[s].clone()}return this.clippingPlanes=r,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.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 hs extends qn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ge(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=cd,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 Mn=new I,sp=new Me;class qt{constructor(e,t,r){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=r===!0,this.usage=Wf,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,r){e*=this.itemSize,r*=t.itemSize;for(let i=0,s=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const f in c)c[f]!==void 0&&(e[f]=c[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 r=this.attributes;for(const c in r){const f=r[c];e.data.attributes[c]=f.toJSON(e.data)}const i={};let s=!1;for(const c in this.morphAttributes){const f=this.morphAttributes[c],d=[];for(let h=0,p=f.length;h0&&(i[c]=d,s=!0)}s&&(e.data.morphAttributes=i,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 r=e.index;r!==null&&this.setIndex(r.clone(t));const i=e.attributes;for(const f in i){const d=i[f];this.setAttribute(f,d.clone(t))}const s=e.morphAttributes;for(const f in s){const d=[],h=s[f];for(let p=0,g=h.length;p0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;st.far?null:{distance:f,point:dp.clone(),object:n}}function hp(n,e,t,r,i,s,o,a,c,f,d,h){mo.fromBufferAttribute(i,f),go.fromBufferAttribute(i,d),vo.fromBufferAttribute(i,h);const p=n.morphTargetInfluences;if(s&&p){op.set(0,0,0),ap.set(0,0,0),lp.set(0,0,0);for(let v=0,y=s.length;v0?1:-1,d.push(F.x,F.y,F.z),h.push(k/R),h.push(1-G/T),pe+=1}}for(let G=0;G0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class hd extends Mt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new dt,this.projectionMatrix=new dt,this.projectionMatrixInverse=new dt}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 Gn extends hd{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=$f*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Ua*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return $f*2*Math.atan(Math.tan(Ua*.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,r,i,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=r,this.view.offsetY=i,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(Ua*.5*this.fov)/this.zoom,r=2*t,i=this.aspect*r,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const c=o.fullWidth,f=o.fullHeight;s+=o.offsetX*i/c,t-=o.offsetY*r/f,i*=o.width/c,r*=o.height/f}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-r,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 Ul=90,Bl=1;class lL extends Mt{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new Gn(Ul,Bl,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new I(1,0,0)),this.add(i);const s=new Gn(Ul,Bl,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new I(-1,0,0)),this.add(s);const o=new Gn(Ul,Bl,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new I(0,1,0)),this.add(o);const a=new Gn(Ul,Bl,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new I(0,-1,0)),this.add(a);const c=new Gn(Ul,Bl,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new I(0,0,1)),this.add(c);const f=new Gn(Ul,Bl,e,t);f.layers=this.layers,f.up.set(0,-1,0),f.lookAt(new I(0,0,-1)),this.add(f)}update(e,t){this.parent===null&&this.updateMatrixWorld();const r=this.renderTarget,[i,s,o,a,c,f]=this.children,d=e.getRenderTarget(),h=e.toneMapping,p=e.xr.enabled;e.toneMapping=Ui,e.xr.enabled=!1;const g=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,i),e.setRenderTarget(r,1),e.render(t,s),e.setRenderTarget(r,2),e.render(t,o),e.setRenderTarget(r,3),e.render(t,a),e.setRenderTarget(r,4),e.render(t,c),r.texture.generateMipmaps=g,e.setRenderTarget(r,5),e.render(t,f),e.setRenderTarget(d),e.toneMapping=h,e.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class pd extends Cn{constructor(e,t,r,i,s,o,a,c,f,d){e=e!==void 0?e:[],t=t!==void 0?t:Vo,super(e,t,r,i,s,o,a,c,f,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class uL extends qr{constructor(e,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new pd(i,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:un}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 r={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 + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},i=new hr(5,5,5),s=new fs({name:"CubemapFromEquirect",uniforms:Lu(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:jr,blending:Gs});s.uniforms.tEquirect.value=t;const o=new We(i,s),a=t.minFilter;return t.minFilter===sl&&(t.minFilter=un),new lL(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,r,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,r,i);e.setRenderTarget(s)}}const Cy=new I,qV=new I,ZV=new Tr;class So{constructor(e=new I(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,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const i=Cy.subVectors(r,t).cross(qV.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const r=e.delta(Cy),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(r).multiplyScalar(s).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<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 r=t||ZV.getNormalMatrix(e),i=this.coplanarPoint(Cy).applyMatrix4(e),s=this.normal.applyMatrix3(r).normalize();return this.constant=-i.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 Vl=new al,pp=new I;class Wg{constructor(e=new So,t=new So,r=new So,i=new So,s=new So,o=new So){this.planes=[e,t,r,i,s,o]}set(e,t,r,i,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const t=this.planes,r=e.elements,i=r[0],s=r[1],o=r[2],a=r[3],c=r[4],f=r[5],d=r[6],h=r[7],p=r[8],g=r[9],v=r[10],y=r[11],x=r[12],w=r[13],_=r[14],M=r[15];return t[0].setComponents(a-i,h-c,y-p,M-x).normalize(),t[1].setComponents(a+i,h+c,y+p,M+x).normalize(),t[2].setComponents(a+s,h+f,y+g,M+w).normalize(),t[3].setComponents(a-s,h-f,y-g,M-w).normalize(),t[4].setComponents(a-o,h-d,y-v,M-_).normalize(),t[5].setComponents(a+o,h+d,y+v,M+_).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),Vl.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Vl)}intersectsSprite(e){return Vl.center.set(0,0,0),Vl.radius=.7071067811865476,Vl.applyMatrix4(e.matrixWorld),this.intersectsSphere(Vl)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(r)0?e.max.x:e.min.x,pp.y=i.normal.y>0?e.max.y:e.min.y,pp.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(pp)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function cL(){let n=null,e=!1,t=null,r=null;function i(s,o){t(s,o),r=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(r=n.requestAnimationFrame(i),e=!0)},stop:function(){n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function QV(n,e){const t=e.isWebGL2,r=new WeakMap;function i(f,d){const h=f.array,p=f.usage,g=n.createBuffer();n.bindBuffer(d,g),n.bufferData(d,h,p),f.onUploadCallback();let v;if(h instanceof Float32Array)v=5126;else if(h 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(h instanceof Int16Array)v=5122;else if(h instanceof Uint32Array)v=5125;else if(h instanceof Int32Array)v=5124;else if(h instanceof Int8Array)v=5120;else if(h instanceof Uint8Array)v=5121;else if(h instanceof Uint8ClampedArray)v=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:g,type:v,bytesPerElement:h.BYTES_PER_ELEMENT,version:f.version}}function s(f,d,h){const p=d.array,g=d.updateRange;n.bindBuffer(h,f),g.count===-1?n.bufferSubData(h,0,p):(t?n.bufferSubData(h,g.offset*p.BYTES_PER_ELEMENT,p,g.offset,g.count):n.bufferSubData(h,g.offset*p.BYTES_PER_ELEMENT,p.subarray(g.offset,g.offset+g.count)),g.count=-1)}function o(f){return f.isInterleavedBufferAttribute&&(f=f.data),r.get(f)}function a(f){f.isInterleavedBufferAttribute&&(f=f.data);const d=r.get(f);d&&(n.deleteBuffer(d.buffer),r.delete(f))}function c(f,d){if(f.isGLBufferAttribute){const p=r.get(f);(!p||p.version 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`,a6=`#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`,l6=`#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`,u6=`#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`,c6=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,f6=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,d6=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,h6=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,p6=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,m6=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,g6=`#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`,v6=`#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 ); +}`,y6=`#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 ); + 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`,_6=`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`,x6=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,S6=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); +#endif`,w6=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,M6=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,b6="gl_FragColor = linearToOutputTexel( gl_FragColor );",E6=`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 ); +}`,T6=`#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 ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); + #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`,C6=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,A6=`#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`,P6=`#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`,R6=`#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`,L6=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,I6=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,N6=`#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`,D6=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,O6=`#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 +}`,k6=`#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vUv2 ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + reflectedLight.indirectDiffuse += lightMapIrradiance; +#endif`,z6=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,F6=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,U6=`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 +#define Material_LightProbeLOD( material ) (0)`,B6=`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`,V6=`#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`,G6=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,H6=`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 +#define Material_LightProbeLOD( material ) (0)`,W6=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,$6=`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 +#define Material_LightProbeLOD( material ) (0)`,j6=`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`,X6=`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 ); +}`,Y6=` +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 *= all( bvec2( 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 *= all( bvec2( 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 *= all( bvec2( 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`,q6=`#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`,Z6=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); +#endif`,Q6=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,K6=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,J6=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + varying float vFragDepth; + varying float vIsPerspective; + #else + uniform float logDepthBufFC; + #endif +#endif`,e8=`#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`,t8=`#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`,n8=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,r8=`#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`,i8=`#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`,s8=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vUv ); + metalnessFactor *= texelMetalness.b; +#endif`,o8=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,a8=`#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`,l8=`#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`,u8=`#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`,c8=`#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`,f8=`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;`,d8=`#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`,h8=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,p8=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,m8=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,g8=`#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`,v8=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = geometryNormal; +#endif`,y8=`#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`,_8=`#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`,x8=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,S8=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha + 0.1; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,w8=`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 ); +} +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 ); +}`,M8=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,b8=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,E8=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,T8=`#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`,C8=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vUv ); + roughnessFactor *= texelRoughness.g; +#endif`,A8=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,P8=`#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; + bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); + bool inFrustum = all( inFrustumVec ); + bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); + bool frustumTest = all( frustumTestVec ); + 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`,R8=`#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`,L8=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; + #endif + #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_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 + #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`,I8=`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; +}`,N8=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,D8=`#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`,O8=`#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`,k8=`#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`,z8=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,F8=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,U8=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,B8=`#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; }`,V8=`#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`,G8=`#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`,H8=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) + varying vec2 vUv; +#endif`,W8=`#ifdef USE_UV + #ifdef UVS_VERTEX_ONLY + vec2 vUv; + #else + varying vec2 vUv; + #endif + uniform mat3 uvTransform; +#endif`,$8=`#ifdef USE_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; +#endif`,j8=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) + varying vec2 vUv2; +#endif`,X8=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) + attribute vec2 uv2; + varying vec2 vUv2; + uniform mat3 uv2Transform; +#endif`,Y8=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) + vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; +#endif`,q8=`#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 Z8=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,Q8=`uniform sampler2D t2D; +varying vec2 vUv; +void main() { + gl_FragColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + gl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w ); + #endif + #include + #include +}`,K8=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,J8=`#include +uniform float opacity; +varying vec3 vWorldDirection; +#include +void main() { + vec3 vReflect = vWorldDirection; + #include + gl_FragColor = envColor; + gl_FragColor.a *= opacity; + #include + #include +}`,eG=`#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,tG=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + vec4 diffuseColor = vec4( 1.0 ); + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + 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 +}`,nG=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,rG=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main () { + #include + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,iG=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,sG=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,oG=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include +}`,aG=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +void main() { + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,lG=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,uG=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + 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 + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,cG=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,fG=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,dG=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,hG=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + 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 + #include + #include + #include + #include + #include +}`,pG=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) + vViewPosition = - mvPosition.xyz; +#endif +}`,mG=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,gG=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,vG=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,yG=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,_G=`#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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + 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 + #include + #include + #include + #include + #include +}`,xG=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,SG=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,wG=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,MG=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,bG=`#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,EG=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +void main() { + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,TG=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + 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 + #include + #include +}`,CG=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,wt={alphamap_fragment:KV,alphamap_pars_fragment:JV,alphatest_fragment:e6,alphatest_pars_fragment:t6,aomap_fragment:n6,aomap_pars_fragment:r6,begin_vertex:i6,beginnormal_vertex:s6,bsdfs:o6,iridescence_fragment:a6,bumpmap_pars_fragment:l6,clipping_planes_fragment:u6,clipping_planes_pars_fragment:c6,clipping_planes_pars_vertex:f6,clipping_planes_vertex:d6,color_fragment:h6,color_pars_fragment:p6,color_pars_vertex:m6,color_vertex:g6,common:v6,cube_uv_reflection_fragment:y6,defaultnormal_vertex:_6,displacementmap_pars_vertex:x6,displacementmap_vertex:S6,emissivemap_fragment:w6,emissivemap_pars_fragment:M6,encodings_fragment:b6,encodings_pars_fragment:E6,envmap_fragment:T6,envmap_common_pars_fragment:C6,envmap_pars_fragment:A6,envmap_pars_vertex:P6,envmap_physical_pars_fragment:V6,envmap_vertex:R6,fog_vertex:L6,fog_pars_vertex:I6,fog_fragment:N6,fog_pars_fragment:D6,gradientmap_pars_fragment:O6,lightmap_fragment:k6,lightmap_pars_fragment:z6,lights_lambert_fragment:F6,lights_lambert_pars_fragment:U6,lights_pars_begin:B6,lights_toon_fragment:G6,lights_toon_pars_fragment:H6,lights_phong_fragment:W6,lights_phong_pars_fragment:$6,lights_physical_fragment:j6,lights_physical_pars_fragment:X6,lights_fragment_begin:Y6,lights_fragment_maps:q6,lights_fragment_end:Z6,logdepthbuf_fragment:Q6,logdepthbuf_pars_fragment:K6,logdepthbuf_pars_vertex:J6,logdepthbuf_vertex:e8,map_fragment:t8,map_pars_fragment:n8,map_particle_fragment:r8,map_particle_pars_fragment:i8,metalnessmap_fragment:s8,metalnessmap_pars_fragment:o8,morphcolor_vertex:a8,morphnormal_vertex:l8,morphtarget_pars_vertex:u8,morphtarget_vertex:c8,normal_fragment_begin:f8,normal_fragment_maps:d8,normal_pars_fragment:h8,normal_pars_vertex:p8,normal_vertex:m8,normalmap_pars_fragment:g8,clearcoat_normal_fragment_begin:v8,clearcoat_normal_fragment_maps:y8,clearcoat_pars_fragment:_8,iridescence_pars_fragment:x8,output_fragment:S8,packing:w8,premultiplied_alpha_fragment:M8,project_vertex:b8,dithering_fragment:E8,dithering_pars_fragment:T8,roughnessmap_fragment:C8,roughnessmap_pars_fragment:A8,shadowmap_pars_fragment:P8,shadowmap_pars_vertex:R8,shadowmap_vertex:L8,shadowmask_pars_fragment:I8,skinbase_vertex:N8,skinning_pars_vertex:D8,skinning_vertex:O8,skinnormal_vertex:k8,specularmap_fragment:z8,specularmap_pars_fragment:F8,tonemapping_fragment:U8,tonemapping_pars_fragment:B8,transmission_fragment:V8,transmission_pars_fragment:G8,uv_pars_fragment:H8,uv_pars_vertex:W8,uv_vertex:$8,uv2_pars_fragment:j8,uv2_pars_vertex:X8,uv2_vertex:Y8,worldpos_vertex:q8,background_vert:Z8,background_frag:Q8,cube_vert:K8,cube_frag:J8,depth_vert:eG,depth_frag:tG,distanceRGBA_vert:nG,distanceRGBA_frag:rG,equirect_vert:iG,equirect_frag:sG,linedashed_vert:oG,linedashed_frag:aG,meshbasic_vert:lG,meshbasic_frag:uG,meshlambert_vert:cG,meshlambert_frag:fG,meshmatcap_vert:dG,meshmatcap_frag:hG,meshnormal_vert:pG,meshnormal_frag:mG,meshphong_vert:gG,meshphong_frag:vG,meshphysical_vert:yG,meshphysical_frag:_G,meshtoon_vert:xG,meshtoon_frag:SG,points_vert:wG,points_frag:MG,shadow_vert:bG,shadow_frag:EG,sprite_vert:TG,sprite_frag:CG},De={common:{diffuse:{value:new Ge(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Tr},uv2Transform:{value:new Tr},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 Ge(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 Ge(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Tr}},sprite:{diffuse:{value:new Ge(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 Tr}}},Oi={basic:{uniforms:sr([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.fog]),vertexShader:wt.meshbasic_vert,fragmentShader:wt.meshbasic_frag},lambert:{uniforms:sr([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new Ge(0)}}]),vertexShader:wt.meshlambert_vert,fragmentShader:wt.meshlambert_frag},phong:{uniforms:sr([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new Ge(0)},specular:{value:new Ge(1118481)},shininess:{value:30}}]),vertexShader:wt.meshphong_vert,fragmentShader:wt.meshphong_frag},standard:{uniforms:sr([De.common,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.roughnessmap,De.metalnessmap,De.fog,De.lights,{emissive:{value:new Ge(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:wt.meshphysical_vert,fragmentShader:wt.meshphysical_frag},toon:{uniforms:sr([De.common,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.gradientmap,De.fog,De.lights,{emissive:{value:new Ge(0)}}]),vertexShader:wt.meshtoon_vert,fragmentShader:wt.meshtoon_frag},matcap:{uniforms:sr([De.common,De.bumpmap,De.normalmap,De.displacementmap,De.fog,{matcap:{value:null}}]),vertexShader:wt.meshmatcap_vert,fragmentShader:wt.meshmatcap_frag},points:{uniforms:sr([De.points,De.fog]),vertexShader:wt.points_vert,fragmentShader:wt.points_frag},dashed:{uniforms:sr([De.common,De.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:wt.linedashed_vert,fragmentShader:wt.linedashed_frag},depth:{uniforms:sr([De.common,De.displacementmap]),vertexShader:wt.depth_vert,fragmentShader:wt.depth_frag},normal:{uniforms:sr([De.common,De.bumpmap,De.normalmap,De.displacementmap,{opacity:{value:1}}]),vertexShader:wt.meshnormal_vert,fragmentShader:wt.meshnormal_frag},sprite:{uniforms:sr([De.sprite,De.fog]),vertexShader:wt.sprite_vert,fragmentShader:wt.sprite_frag},background:{uniforms:{uvTransform:{value:new Tr},t2D:{value:null}},vertexShader:wt.background_vert,fragmentShader:wt.background_frag},cube:{uniforms:sr([De.envmap,{opacity:{value:1}}]),vertexShader:wt.cube_vert,fragmentShader:wt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:wt.equirect_vert,fragmentShader:wt.equirect_frag},distanceRGBA:{uniforms:sr([De.common,De.displacementmap,{referencePosition:{value:new I},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:wt.distanceRGBA_vert,fragmentShader:wt.distanceRGBA_frag},shadow:{uniforms:sr([De.lights,De.fog,{color:{value:new Ge(0)},opacity:{value:1}}]),vertexShader:wt.shadow_vert,fragmentShader:wt.shadow_frag}};Oi.physical={uniforms:sr([Oi.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 Ge(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 Ge(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Ge(1,1,1)},specularColorMap:{value:null}}]),vertexShader:wt.meshphysical_vert,fragmentShader:wt.meshphysical_frag};function AG(n,e,t,r,i,s){const o=new Ge(0);let a=i===!0?0:1,c,f,d=null,h=0,p=null;function g(y,x){let w=!1,_=x.isScene===!0?x.background:null;_&&_.isTexture&&(_=e.get(_));const M=n.xr,E=M.getSession&&M.getSession();E&&E.environmentBlendMode==="additive"&&(_=null),_===null?v(o,a):_&&_.isColor&&(v(_,1),w=!0),(n.autoClear||w)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),_&&(_.isCubeTexture||_.mapping===Hu)?(f===void 0&&(f=new We(new hr(1,1,1),new fs({name:"BackgroundCubeMaterial",uniforms:Lu(Oi.cube.uniforms),vertexShader:Oi.cube.vertexShader,fragmentShader:Oi.cube.fragmentShader,side:jr,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(C,P,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(f)),f.material.uniforms.envMap.value=_,f.material.uniforms.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,(d!==_||h!==_.version||p!==n.toneMapping)&&(f.material.needsUpdate=!0,d=_,h=_.version,p=n.toneMapping),f.layers.enableAll(),y.unshift(f,f.geometry,f.material,0,0,null)):_&&_.isTexture&&(c===void 0&&(c=new We(new Gr(2,2),new fs({name:"BackgroundMaterial",uniforms:Lu(Oi.background.uniforms),vertexShader:Oi.background.vertexShader,fragmentShader:Oi.background.fragmentShader,side:qa,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=_,_.matrixAutoUpdate===!0&&_.updateMatrix(),c.material.uniforms.uvTransform.value.copy(_.matrix),(d!==_||h!==_.version||p!==n.toneMapping)&&(c.material.needsUpdate=!0,d=_,h=_.version,p=n.toneMapping),c.layers.enableAll(),y.unshift(c,c.geometry,c.material,0,0,null))}function v(y,x){t.buffers.color.setClear(y.r,y.g,y.b,x,s)}return{getClearColor:function(){return o},setClearColor:function(y,x=1){o.set(y),a=x,v(o,a)},getClearAlpha:function(){return a},setClearAlpha:function(y){a=y,v(o,a)},render:g}}function PG(n,e,t,r){const i=n.getParameter(34921),s=r.isWebGL2?null:e.get("OES_vertex_array_object"),o=r.isWebGL2||s!==null,a={},c=x(null);let f=c,d=!1;function h($,se,le,pe,z){let F=!1;if(o){const G=y(pe,le,se);f!==G&&(f=G,g(f.object)),F=w($,pe,le,z),F&&_($,pe,le,z)}else{const G=se.wireframe===!0;(f.geometry!==pe.id||f.program!==le.id||f.wireframe!==G)&&(f.geometry=pe.id,f.program=le.id,f.wireframe=G,F=!0)}z!==null&&t.update(z,34963),(F||d)&&(d=!1,T($,se,le,pe),z!==null&&n.bindBuffer(34963,t.get(z).buffer))}function p(){return r.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function g($){return r.isWebGL2?n.bindVertexArray($):s.bindVertexArrayOES($)}function v($){return r.isWebGL2?n.deleteVertexArray($):s.deleteVertexArrayOES($)}function y($,se,le){const pe=le.wireframe===!0;let z=a[$.id];z===void 0&&(z={},a[$.id]=z);let F=z[se.id];F===void 0&&(F={},z[se.id]=F);let G=F[pe];return G===void 0&&(G=x(p()),F[pe]=G),G}function x($){const se=[],le=[],pe=[];for(let z=0;z=0){const N=z[k];let me=F[k];if(me===void 0&&(k==="instanceMatrix"&&$.instanceMatrix&&(me=$.instanceMatrix),k==="instanceColor"&&$.instanceColor&&(me=$.instanceColor)),N===void 0||N.attribute!==me||me&&N.data!==me.data)return!0;G++}return f.attributesNum!==G||f.index!==pe}function _($,se,le,pe){const z={},F=se.attributes;let G=0;const Z=le.getAttributes();for(const k in Z)if(Z[k].location>=0){let N=F[k];N===void 0&&(k==="instanceMatrix"&&$.instanceMatrix&&(N=$.instanceMatrix),k==="instanceColor"&&$.instanceColor&&(N=$.instanceColor));const me={};me.attribute=N,N&&N.data&&(me.data=N.data),z[k]=me,G++}f.attributes=z,f.attributesNum=G,f.index=pe}function M(){const $=f.newAttributes;for(let se=0,le=$.length;se=0){let W=z[Z];if(W===void 0&&(Z==="instanceMatrix"&&$.instanceMatrix&&(W=$.instanceMatrix),Z==="instanceColor"&&$.instanceColor&&(W=$.instanceColor)),W!==void 0){const N=W.normalized,me=W.itemSize,X=t.get(W);if(X===void 0)continue;const Te=X.buffer,Ce=X.type,we=X.bytesPerElement;if(W.isInterleavedBufferAttribute){const be=W.data,He=be.stride,ue=W.offset;if(be.isInstancedInterleavedBuffer){for(let ne=0;ne0&&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!="undefined"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&n instanceof WebGL2ComputeRenderingContext;let a=t.precision!==void 0?t.precision:"highp";const c=s(a);c!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",c,"instead."),a=c);const f=o||e.has("WEBGL_draw_buffers"),d=t.logarithmicDepthBuffer===!0,h=n.getParameter(34930),p=n.getParameter(35660),g=n.getParameter(3379),v=n.getParameter(34076),y=n.getParameter(34921),x=n.getParameter(36347),w=n.getParameter(36348),_=n.getParameter(36349),M=p>0,E=o||e.has("OES_texture_float"),C=M&&E,P=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:f,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:d,maxTextures:h,maxVertexTextures:p,maxTextureSize:g,maxCubemapSize:v,maxAttributes:y,maxVertexUniforms:x,maxVaryings:w,maxFragmentUniforms:_,vertexTextures:M,floatFragmentTextures:E,floatVertexTextures:C,maxSamples:P}}function IG(n){const e=this;let t=null,r=0,i=!1,s=!1;const o=new So,a=new Tr,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p,g){const v=h.length!==0||p||r!==0||i;return i=p,t=d(h,g,0),r=h.length,v},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1,f()},this.setState=function(h,p,g){const v=h.clippingPlanes,y=h.clipIntersection,x=h.clipShadows,w=n.get(h);if(!i||v===null||v.length===0||s&&!x)s?d(null):f();else{const _=s?0:r,M=_*4;let E=w.clippingState||null;c.value=E,E=d(v,p,M,g);for(let C=0;C!==M;++C)E[C]=t[C];w.clippingState=E,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=_}};function f(){c.value!==t&&(c.value=t,c.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function d(h,p,g,v){const y=h!==null?h.length:0;let x=null;if(y!==0){if(x=c.value,v!==!0||x===null){const w=g+y*4,_=p.matrixWorldInverse;a.getNormalMatrix(_),(x===null||x.length0){const f=new uL(c.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),o.addEventListener("dispose",i),t(f.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const c=e.get(a);c!==void 0&&(e.delete(a),c.dispose())}function s(){e=new WeakMap}return{get:r,dispose:s}}class md extends hd{constructor(e=-1,t=1,r=1,i=-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=r,this.bottom=i,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,r,i,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=r,this.view.offsetY=i,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),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=r-e,o=r+e,a=i+t,c=i-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=f*this.view.offsetX,o=s+f*this.view.width,a-=d*this.view.offsetY,c=a-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,c,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 fu=4,AT=[.125,.215,.35,.446,.526,.582],wa=20,Ay=new md,PT=new Ge;let Py=null;const ya=(1+Math.sqrt(5))/2,Gl=1/ya,RT=[new I(1,1,1),new I(-1,1,1),new I(1,1,-1),new I(-1,1,-1),new I(0,ya,Gl),new I(0,ya,-Gl),new I(Gl,0,ya),new I(-Gl,0,ya),new I(ya,Gl,0),new I(-ya,Gl,0)];class Dx{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,r=.1,i=100){Py=this._renderer.getRenderTarget(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,r,i,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=NT(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=IT(),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;e2?M:0,M,M),d.setRenderTarget(i),y&&d.render(v,a),d.render(e,a)}v.geometry.dispose(),v.material.dispose(),d.toneMapping=p,d.autoClear=h,e.background=x}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===Vo||e.mapping===Go;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=NT()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=IT());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new We(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const c=this._cubeSize;mp(t,0,0,3*c,2*c),r.setRenderTarget(t),r.render(o,Ay)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let i=1;iwa&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${wa}`);const w=[];let _=0;for(let R=0;RM-fu?i-M+fu:0),P=4*(this._cubeSize-E);mp(t,C,P,3*E,2*E),c.setRenderTarget(t),c.render(h,Ay)}}function DG(n){const e=[],t=[],r=[];let i=n;const s=n-fu+1+AT.length;for(let o=0;on-fu?c=AT[o-n+fu-1]:o===0&&(c=0),r.push(c);const f=1/(a-2),d=-f,h=1+f,p=[d,d,h,d,h,h,d,d,h,h,d,h],g=6,v=6,y=3,x=2,w=1,_=new Float32Array(y*v*g),M=new Float32Array(x*v*g),E=new Float32Array(w*v*g);for(let P=0;P2?0:-1,L=[R,T,0,R+2/3,T,0,R+2/3,T+1,0,R,T,0,R+2/3,T+1,0,R,T+1,0];_.set(L,y*v*P),M.set(p,x*v*P);const D=[P,P,P,P,P,P];E.set(D,w*v*P)}const C=new ht;C.setAttribute("position",new qt(_,y)),C.setAttribute("uv",new qt(M,x)),C.setAttribute("faceIndex",new qt(E,w)),e.push(C),i>fu&&i--}return{lodPlanes:e,sizeLods:t,sigmas:r}}function LT(n,e,t){const r=new qr(n,e,t);return r.texture.mapping=Hu,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function mp(n,e,t,r,i){n.viewport.set(e,t,r,i),n.scissor.set(e,t,r,i)}function OG(n,e,t){const r=new Float32Array(wa),i=new I(0,1,0);return new fs({name:"SphericalGaussianBlur",defines:{n:wa,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:gS(),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 + + 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:Gs,depthTest:!1,depthWrite:!1})}function IT(){return new fs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:gS(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Gs,depthTest:!1,depthWrite:!1})}function NT(){return new fs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:gS(),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:Gs,depthTest:!1,depthWrite:!1})}function gS(){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 kG(n){let e=new WeakMap,t=null;function r(a){if(a&&a.isTexture){const c=a.mapping,f=c===zf||c===Ff,d=c===Vo||c===Go;if(f||d)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let h=e.get(a);return t===null&&(t=new Dx(n)),h=f?t.fromEquirectangular(a,h):t.fromCubemap(a,h),e.set(a,h),h.texture}else{if(e.has(a))return e.get(a).texture;{const h=a.image;if(f&&h&&h.height>0||d&&h&&i(h)){t===null&&(t=new Dx(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 i(a){let c=0;const f=6;for(let d=0;de.maxTextureSize&&(fe=Math.ceil(Y/e.maxTextureSize),Y=e.maxTextureSize);const q=new Float32Array(Y*fe*4*x),$=new fd(q,Y,fe,x);$.type=os,$.needsUpdate=!0;const se=D*4;for(let pe=0;pe0)return n;const i=e*t;let s=DT[i];if(s===void 0&&(s=new Float32Array(i),DT[i]=s),e!==0){r.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function Nn(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t":" "} ${a}: ${t[o]}`)}return r.join(` +`)}function zH(n){switch(n){case Xs:return["Linear","( value )"];case Kt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",n),["Linear","( value )"]}}function VT(n,e,t){const r=n.getShaderParameter(e,35713),i=n.getShaderInfoLog(e).trim();if(r&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` + +`+i+` + +`+kH(n.getShaderSource(e),o)}else return i}function FH(n,e){const t=zH(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function UH(n,e){let t;switch(e){case IR:t="Linear";break;case NR:t="Reinhard";break;case DR:t="OptimizedCineon";break;case lS:t="ACESFilmic";break;case OR:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function BH(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(Kc).join(` +`)}function VH(n){const e=[];for(const t in n){const r=n[t];r!==!1&&e.push("#define "+t+" "+r)}return e.join(` +`)}function GH(n,e){const t={},r=n.getProgramParameter(e,35721);for(let i=0;i/gm;function Ox(n){return n.replace(HH,WH)}function WH(n,e){const t=wt[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return Ox(t)}const $H=/#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 WT(n){return n.replace($H,jH)}function jH(n,e,t,r){let i="";for(let s=parseInt(e);s0&&(x+=` +`),w=[g,v].filter(Kc).join(` +`),w.length>0&&(w+=` +`)):(x=[$T(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 "+d:"",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 "+c:"",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(Kc).join(` +`),w=[g,$T(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 "+d:"",t.envMap?"#define "+h:"",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 "+c:"",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!==Ui?"#define TONE_MAPPING":"",t.toneMapping!==Ui?wt.tonemapping_pars_fragment:"",t.toneMapping!==Ui?UH("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",wt.encodings_pars_fragment,FH("linearToOutputTexel",t.outputEncoding),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(Kc).join(` +`)),o=Ox(o),o=GT(o,t),o=HT(o,t),a=Ox(a),a=GT(a,t),a=HT(a,t),o=WT(o),a=WT(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(_=`#version 300 es +`,x=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+x,w=["#define varying in",t.glslVersion===Ix?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Ix?"":"#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(` +`)+` +`+w);const M=_+x+o,E=_+w+a,C=BT(i,35633,M),P=BT(i,35632,E);if(i.attachShader(y,C),i.attachShader(y,P),t.index0AttributeName!==void 0?i.bindAttribLocation(y,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(y,0,"position"),i.linkProgram(y),n.debug.checkShaderErrors){const L=i.getProgramInfoLog(y).trim(),D=i.getShaderInfoLog(C).trim(),Y=i.getShaderInfoLog(P).trim();let fe=!0,q=!0;if(i.getProgramParameter(y,35714)===!1){fe=!1;const $=VT(i,C,"vertex"),se=VT(i,P,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(y,35715)+` + +Program Info Log: `+L+` +`+$+` +`+se)}else L!==""?console.warn("THREE.WebGLProgram: Program Info Log:",L):(D===""||Y==="")&&(q=!1);q&&(this.diagnostics={runnable:fe,programLog:L,vertexShader:{log:D,prefix:x},fragmentShader:{log:Y,prefix:w}})}i.deleteShader(C),i.deleteShader(P);let R;this.getUniforms=function(){return R===void 0&&(R=new hm(i,y)),R};let T;return this.getAttributes=function(){return T===void 0&&(T=GH(i,y)),T},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(y),this.program=void 0},this.name=t.shaderName,this.id=OH++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=C,this.fragmentShader=P,this}let JH=0;class eW{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(r),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.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 r=t.get(e);return r===void 0&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return r===void 0&&(r=new tW(e),t.set(e,r)),r}}class tW{constructor(e){this.id=JH++,this.code=e,this.usedTimes=0}}function nW(n,e,t,r,i,s,o){const a=new Va,c=new eW,f=[],d=i.isWebGL2,h=i.logarithmicDepthBuffer,p=i.vertexTextures;let g=i.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(T,L,D,Y,fe){const q=Y.fog,$=fe.geometry,se=T.isMeshStandardMaterial?Y.environment:null,le=(T.isMeshStandardMaterial?t:e).get(T.envMap||se),pe=!!le&&le.mapping===Hu?le.image.height:null,z=v[T.type];T.precision!==null&&(g=i.getMaxPrecision(T.precision),g!==T.precision&&console.warn("THREE.WebGLProgram.getParameters:",T.precision,"not supported, using",g,"instead."));const F=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,G=F!==void 0?F.length:0;let Z=0;$.morphAttributes.position!==void 0&&(Z=1),$.morphAttributes.normal!==void 0&&(Z=2),$.morphAttributes.color!==void 0&&(Z=3);let k,W,N,me;if(z){const He=Oi[z];k=He.vertexShader,W=He.fragmentShader}else k=T.vertexShader,W=T.fragmentShader,c.update(T),N=c.getVertexShaderID(T),me=c.getFragmentShaderID(T);const X=n.getRenderTarget(),Te=T.alphaTest>0,Ce=T.clearcoat>0,we=T.iridescence>0;return{isWebGL2:d,shaderID:z,shaderName:T.type,vertexShader:k,fragmentShader:W,defines:T.defines,customVertexShaderID:N,customFragmentShaderID:me,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:g,instancing:fe.isInstancedMesh===!0,instancingColor:fe.isInstancedMesh===!0&&fe.instanceColor!==null,supportsVertexTextures:p,outputEncoding:X===null?n.outputEncoding:X.isXRRenderTarget===!0?X.texture.encoding:Xs,map:!!T.map,matcap:!!T.matcap,envMap:!!le,envMapMode:le&&le.mapping,envMapCubeUVHeight:pe,lightMap:!!T.lightMap,aoMap:!!T.aoMap,emissiveMap:!!T.emissiveMap,bumpMap:!!T.bumpMap,normalMap:!!T.normalMap,objectSpaceNormalMap:T.normalMapType===nL,tangentSpaceNormalMap:T.normalMapType===qo,decodeVideoTexture:!!T.map&&T.map.isVideoTexture===!0&&T.map.encoding===Kt,clearcoat:Ce,clearcoatMap:Ce&&!!T.clearcoatMap,clearcoatRoughnessMap:Ce&&!!T.clearcoatRoughnessMap,clearcoatNormalMap:Ce&&!!T.clearcoatNormalMap,iridescence:we,iridescenceMap:we&&!!T.iridescenceMap,iridescenceThicknessMap:we&&!!T.iridescenceThicknessMap,displacementMap:!!T.displacementMap,roughnessMap:!!T.roughnessMap,metalnessMap:!!T.metalnessMap,specularMap:!!T.specularMap,specularIntensityMap:!!T.specularIntensityMap,specularColorMap:!!T.specularColorMap,opaque:T.transparent===!1&&T.blending===za,alphaMap:!!T.alphaMap,alphaTest:Te,gradientMap:!!T.gradientMap,sheen:T.sheen>0,sheenColorMap:!!T.sheenColorMap,sheenRoughnessMap:!!T.sheenRoughnessMap,transmission:T.transmission>0,transmissionMap:!!T.transmissionMap,thicknessMap:!!T.thicknessMap,combine:T.combine,vertexTangents:!!T.normalMap&&!!$.attributes.tangent,vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,vertexUvs:!!T.map||!!T.bumpMap||!!T.normalMap||!!T.specularMap||!!T.alphaMap||!!T.emissiveMap||!!T.roughnessMap||!!T.metalnessMap||!!T.clearcoatMap||!!T.clearcoatRoughnessMap||!!T.clearcoatNormalMap||!!T.iridescenceMap||!!T.iridescenceThicknessMap||!!T.displacementMap||!!T.transmissionMap||!!T.thicknessMap||!!T.specularIntensityMap||!!T.specularColorMap||!!T.sheenColorMap||!!T.sheenRoughnessMap,uvsVertexOnly:!(!!T.map||!!T.bumpMap||!!T.normalMap||!!T.specularMap||!!T.alphaMap||!!T.emissiveMap||!!T.roughnessMap||!!T.metalnessMap||!!T.clearcoatNormalMap||!!T.iridescenceMap||!!T.iridescenceThicknessMap||T.transmission>0||!!T.transmissionMap||!!T.thicknessMap||!!T.specularIntensityMap||!!T.specularColorMap||T.sheen>0||!!T.sheenColorMap||!!T.sheenRoughnessMap)&&!!T.displacementMap,fog:!!q,useFog:T.fog===!0,fogExp2:q&&q.isFogExp2,flatShading:!!T.flatShading,sizeAttenuation:T.sizeAttenuation,logarithmicDepthBuffer:h,skinning:fe.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:G,morphTextureStride:Z,numDirLights:L.directional.length,numPointLights:L.point.length,numSpotLights:L.spot.length,numSpotLightMaps:L.spotLightMap.length,numRectAreaLights:L.rectArea.length,numHemiLights:L.hemi.length,numDirLightShadows:L.directionalShadowMap.length,numPointLightShadows:L.pointShadowMap.length,numSpotLightShadows:L.spotShadowMap.length,numSpotLightShadowsWithMaps:L.numSpotLightShadowsWithMaps,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:T.dithering,shadowMapEnabled:n.shadowMap.enabled&&D.length>0,shadowMapType:n.shadowMap.type,toneMapping:T.toneMapped?n.toneMapping:Ui,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===ki,flipSided:T.side===jr,useDepthPacking:!!T.depthPacking,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionDerivatives:T.extensions&&T.extensions.derivatives,extensionFragDepth:T.extensions&&T.extensions.fragDepth,extensionDrawBuffers:T.extensions&&T.extensions.drawBuffers,extensionShaderTextureLOD:T.extensions&&T.extensions.shaderTextureLOD,rendererExtensionFragDepth:d||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||r.has("EXT_shader_texture_lod"),customProgramCacheKey:T.customProgramCacheKey()}}function x(T){const L=[];if(T.shaderID?L.push(T.shaderID):(L.push(T.customVertexShaderID),L.push(T.customFragmentShaderID)),T.defines!==void 0)for(const D in T.defines)L.push(D),L.push(T.defines[D]);return T.isRawShaderMaterial===!1&&(w(L,T),_(L,T),L.push(n.outputEncoding)),L.push(T.customProgramCacheKey),L.join()}function w(T,L){T.push(L.precision),T.push(L.outputEncoding),T.push(L.envMapMode),T.push(L.envMapCubeUVHeight),T.push(L.combine),T.push(L.vertexUvs),T.push(L.fogExp2),T.push(L.sizeAttenuation),T.push(L.morphTargetsCount),T.push(L.morphAttributeCount),T.push(L.numDirLights),T.push(L.numPointLights),T.push(L.numSpotLights),T.push(L.numSpotLightMaps),T.push(L.numHemiLights),T.push(L.numRectAreaLights),T.push(L.numDirLightShadows),T.push(L.numPointLightShadows),T.push(L.numSpotLightShadows),T.push(L.numSpotLightShadowsWithMaps),T.push(L.shadowMapType),T.push(L.toneMapping),T.push(L.numClippingPlanes),T.push(L.numClipIntersection),T.push(L.depthPacking)}function _(T,L){a.disableAll(),L.isWebGL2&&a.enable(0),L.supportsVertexTextures&&a.enable(1),L.instancing&&a.enable(2),L.instancingColor&&a.enable(3),L.map&&a.enable(4),L.matcap&&a.enable(5),L.envMap&&a.enable(6),L.lightMap&&a.enable(7),L.aoMap&&a.enable(8),L.emissiveMap&&a.enable(9),L.bumpMap&&a.enable(10),L.normalMap&&a.enable(11),L.objectSpaceNormalMap&&a.enable(12),L.tangentSpaceNormalMap&&a.enable(13),L.clearcoat&&a.enable(14),L.clearcoatMap&&a.enable(15),L.clearcoatRoughnessMap&&a.enable(16),L.clearcoatNormalMap&&a.enable(17),L.iridescence&&a.enable(18),L.iridescenceMap&&a.enable(19),L.iridescenceThicknessMap&&a.enable(20),L.displacementMap&&a.enable(21),L.specularMap&&a.enable(22),L.roughnessMap&&a.enable(23),L.metalnessMap&&a.enable(24),L.gradientMap&&a.enable(25),L.alphaMap&&a.enable(26),L.alphaTest&&a.enable(27),L.vertexColors&&a.enable(28),L.vertexAlphas&&a.enable(29),L.vertexUvs&&a.enable(30),L.vertexTangents&&a.enable(31),L.uvsVertexOnly&&a.enable(32),T.push(a.mask),a.disableAll(),L.fog&&a.enable(0),L.useFog&&a.enable(1),L.flatShading&&a.enable(2),L.logarithmicDepthBuffer&&a.enable(3),L.skinning&&a.enable(4),L.morphTargets&&a.enable(5),L.morphNormals&&a.enable(6),L.morphColors&&a.enable(7),L.premultipliedAlpha&&a.enable(8),L.shadowMapEnabled&&a.enable(9),L.physicallyCorrectLights&&a.enable(10),L.doubleSided&&a.enable(11),L.flipSided&&a.enable(12),L.useDepthPacking&&a.enable(13),L.dithering&&a.enable(14),L.specularIntensityMap&&a.enable(15),L.specularColorMap&&a.enable(16),L.transmission&&a.enable(17),L.transmissionMap&&a.enable(18),L.thicknessMap&&a.enable(19),L.sheen&&a.enable(20),L.sheenColorMap&&a.enable(21),L.sheenRoughnessMap&&a.enable(22),L.decodeVideoTexture&&a.enable(23),L.opaque&&a.enable(24),T.push(a.mask)}function M(T){const L=v[T.type];let D;if(L){const Y=Oi[L];D=aL.clone(Y.uniforms)}else D=T.uniforms;return D}function E(T,L){let D;for(let Y=0,fe=f.length;Y0?r.push(w):g.transparent===!0?i.push(w):t.push(w)}function c(h,p,g,v,y,x){const w=o(h,p,g,v,y,x);g.transmission>0?r.unshift(w):g.transparent===!0?i.unshift(w):t.unshift(w)}function f(h,p){t.length>1&&t.sort(h||iW),r.length>1&&r.sort(p||jT),i.length>1&&i.sort(p||jT)}function d(){for(let h=e,p=n.length;h=s.length?(o=new XT,s.push(o)):o=s[i],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function oW(){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 I,color:new Ge};break;case"SpotLight":t={position:new I,direction:new I,color:new Ge,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new I,color:new Ge,distance:0,decay:0};break;case"HemisphereLight":t={direction:new I,skyColor:new Ge,groundColor:new Ge};break;case"RectAreaLight":t={color:new Ge,position:new I,halfWidth:new I,halfHeight:new I};break}return n[e.id]=t,t}}}function aW(){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 lW=0;function uW(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function cW(n,e){const t=new oW,r=aW(),i={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 d=0;d<9;d++)i.probe.push(new I);const s=new I,o=new dt,a=new dt;function c(d,h){let p=0,g=0,v=0;for(let Y=0;Y<9;Y++)i.probe[Y].set(0,0,0);let y=0,x=0,w=0,_=0,M=0,E=0,C=0,P=0,R=0,T=0;d.sort(uW);const L=h!==!0?Math.PI:1;for(let Y=0,fe=d.length;Y0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=De.LTC_FLOAT_1,i.rectAreaLTC2=De.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=De.LTC_HALF_1,i.rectAreaLTC2=De.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=p,i.ambient[1]=g,i.ambient[2]=v;const D=i.hash;(D.directionalLength!==y||D.pointLength!==x||D.spotLength!==w||D.rectAreaLength!==_||D.hemiLength!==M||D.numDirectionalShadows!==E||D.numPointShadows!==C||D.numSpotShadows!==P||D.numSpotMaps!==R)&&(i.directional.length=y,i.spot.length=w,i.rectArea.length=_,i.point.length=x,i.hemi.length=M,i.directionalShadow.length=E,i.directionalShadowMap.length=E,i.pointShadow.length=C,i.pointShadowMap.length=C,i.spotShadow.length=P,i.spotShadowMap.length=P,i.directionalShadowMatrix.length=E,i.pointShadowMatrix.length=C,i.spotLightMatrix.length=P+R-T,i.spotLightMap.length=R,i.numSpotLightShadowsWithMaps=T,D.directionalLength=y,D.pointLength=x,D.spotLength=w,D.rectAreaLength=_,D.hemiLength=M,D.numDirectionalShadows=E,D.numPointShadows=C,D.numSpotShadows=P,D.numSpotMaps=R,i.version=lW++)}function f(d,h){let p=0,g=0,v=0,y=0,x=0;const w=h.matrixWorldInverse;for(let _=0,M=d.length;_=a.length?(c=new YT(n,e),a.push(c)):c=a[o],c}function i(){t=new WeakMap}return{get:r,dispose:i}}class vS extends qn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=eL,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 yS extends qn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new I,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 dW=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,hW=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +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 pW(n,e,t){let r=new Wg;const i=new Me,s=new Me,o=new Ht,a=new vS({depthPacking:tL}),c=new yS,f={},d=t.maxTextureSize,h={0:jr,1:qa,2:ki},p=new fs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Me},radius:{value:4}},vertexShader:dW,fragmentShader:hW}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const v=new ht;v.setAttribute("position",new qt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new We(v,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Bg,this.render=function(E,C,P){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||E.length===0)return;const R=n.getRenderTarget(),T=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),D=n.state;D.setBlending(Gs),D.buffers.color.setClear(1,1,1,1),D.buffers.depth.setTest(!0),D.setScissorTest(!1);for(let Y=0,fe=E.length;Yd||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/se.x),i.x=s.x*se.x,$.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/se.y),i.y=s.y*se.y,$.mapSize.y=s.y)),$.map===null){const pe=this.type!==Ca?{minFilter:En,magFilter:En}:{};$.map=new qr(i.x,i.y,pe),$.map.texture.name=q.name+".shadowMap",$.camera.updateProjectionMatrix()}n.setRenderTarget($.map),n.clear();const le=$.getViewportCount();for(let pe=0;pe0){const fe=D.uuid,q=C.uuid;let $=f[fe];$===void 0&&($={},f[fe]=$);let se=$[q];se===void 0&&(se=D.clone(),$[q]=se),D=se}return D.visible=C.visible,D.wireframe=C.wireframe,L===Ca?D.side=C.shadowSide!==null?C.shadowSide:C.side:D.side=C.shadowSide!==null?C.shadowSide:h[C.side],D.alphaMap=C.alphaMap,D.alphaTest=C.alphaTest,D.clipShadows=C.clipShadows,D.clippingPlanes=C.clippingPlanes,D.clipIntersection=C.clipIntersection,D.displacementMap=C.displacementMap,D.displacementScale=C.displacementScale,D.displacementBias=C.displacementBias,D.wireframeLinewidth=C.wireframeLinewidth,D.linewidth=C.linewidth,P.isPointLight===!0&&D.isMeshDistanceMaterial===!0&&(D.referencePosition.setFromMatrixPosition(P.matrixWorld),D.nearDistance=R,D.farDistance=T),D}function M(E,C,P,R,T){if(E.visible===!1)return;if(E.layers.test(C.layers)&&(E.isMesh||E.isLine||E.isPoints)&&(E.castShadow||E.receiveShadow&&T===Ca)&&(!E.frustumCulled||r.intersectsObject(E))){E.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,E.matrixWorld);const Y=e.update(E),fe=E.material;if(Array.isArray(fe)){const q=Y.groups;for(let $=0,se=q.length;$=1):z.indexOf("OpenGL ES")!==-1&&(pe=parseFloat(/^OpenGL ES (\d)/.exec(z)[1]),le=pe>=2);let F=null,G={};const Z=n.getParameter(3088),k=n.getParameter(2978),W=new Ht().fromArray(Z),N=new Ht().fromArray(k);function me(U,de,ie){const ee=new Uint8Array(4),ye=n.createTexture();n.bindTexture(U,ye),n.texParameteri(U,10241,9728),n.texParameteri(U,10240,9728);for(let Ae=0;AePe||H.height>Pe)&&(Ne=Pe/Math.max(H.width,H.height)),Ne<1||O===!0)if(typeof HTMLImageElement!="undefined"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&H instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&H instanceof ImageBitmap){const ze=O?ag:Math.floor,st=ze(Ne*H.width),Be=ze(Ne*H.height);y===void 0&&(y=_(st,Be));const Se=ce?_(st,Be):y;return Se.width=st,Se.height=Be,Se.getContext("2d").drawImage(H,0,0,st,Be),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+st+"x"+Be+")."),Se}else return"data"in H&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+H.width+"x"+H.height+")."),H;return H}function E(H){return Nx(H.width)&&Nx(H.height)}function C(H){return a?!1:H.wrapS!==pr||H.wrapT!==pr||H.minFilter!==En&&H.minFilter!==un}function P(H,O){return H.generateMipmaps&&O&&H.minFilter!==En&&H.minFilter!==un}function R(H){n.generateMipmap(H)}function T(H,O,ce,Pe,Ne=!1){if(a===!1)return O;if(H!==null){if(n[H]!==void 0)return n[H];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+H+"'")}let ze=O;return O===6403&&(ce===5126&&(ze=33326),ce===5131&&(ze=33325),ce===5121&&(ze=33321)),O===33319&&(ce===5126&&(ze=33328),ce===5131&&(ze=33327),ce===5121&&(ze=33323)),O===6408&&(ce===5126&&(ze=34836),ce===5131&&(ze=34842),ce===5121&&(ze=Pe===Kt&&Ne===!1?35907:32856),ce===32819&&(ze=32854),ce===32820&&(ze=32855)),(ze===33325||ze===33326||ze===33327||ze===33328||ze===34842||ze===34836)&&e.get("EXT_color_buffer_float"),ze}function L(H,O,ce){return P(H,ce)===!0||H.isFramebufferTexture&&H.minFilter!==En&&H.minFilter!==un?Math.log2(Math.max(O.width,O.height))+1:H.mipmaps!==void 0&&H.mipmaps.length>0?H.mipmaps.length:H.isCompressedTexture&&Array.isArray(H.image)?O.mipmaps.length:1}function D(H){return H===En||H===ig||H===sg?9728:9729}function Y(H){const O=H.target;O.removeEventListener("dispose",Y),q(O),O.isVideoTexture&&v.delete(O)}function fe(H){const O=H.target;O.removeEventListener("dispose",fe),se(O)}function q(H){const O=r.get(H);if(O.__webglInit===void 0)return;const ce=H.source,Pe=x.get(ce);if(Pe){const Ne=Pe[O.__cacheKey];Ne.usedTimes--,Ne.usedTimes===0&&$(H),Object.keys(Pe).length===0&&x.delete(ce)}r.remove(H)}function $(H){const O=r.get(H);n.deleteTexture(O.__webglTexture);const ce=H.source,Pe=x.get(ce);delete Pe[O.__cacheKey],o.memory.textures--}function se(H){const O=H.texture,ce=r.get(H),Pe=r.get(O);if(Pe.__webglTexture!==void 0&&(n.deleteTexture(Pe.__webglTexture),o.memory.textures--),H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let Ne=0;Ne<6;Ne++)n.deleteFramebuffer(ce.__webglFramebuffer[Ne]),ce.__webglDepthbuffer&&n.deleteRenderbuffer(ce.__webglDepthbuffer[Ne]);else{if(n.deleteFramebuffer(ce.__webglFramebuffer),ce.__webglDepthbuffer&&n.deleteRenderbuffer(ce.__webglDepthbuffer),ce.__webglMultisampledFramebuffer&&n.deleteFramebuffer(ce.__webglMultisampledFramebuffer),ce.__webglColorRenderbuffer)for(let Ne=0;Ne=c&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+c),le+=1,H}function F(H){const O=[];return O.push(H.wrapS),O.push(H.wrapT),O.push(H.magFilter),O.push(H.minFilter),O.push(H.anisotropy),O.push(H.internalFormat),O.push(H.format),O.push(H.type),O.push(H.generateMipmaps),O.push(H.premultiplyAlpha),O.push(H.flipY),O.push(H.unpackAlignment),O.push(H.encoding),O.join()}function G(H,O){const ce=r.get(H);if(H.isVideoTexture&&Ct(H),H.isRenderTargetTexture===!1&&H.version>0&&ce.__version!==H.version){const Pe=H.image;if(Pe===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Pe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ce(ce,H,O);return}}t.bindTexture(3553,ce.__webglTexture,33984+O)}function Z(H,O){const ce=r.get(H);if(H.version>0&&ce.__version!==H.version){Ce(ce,H,O);return}t.bindTexture(35866,ce.__webglTexture,33984+O)}function k(H,O){const ce=r.get(H);if(H.version>0&&ce.__version!==H.version){Ce(ce,H,O);return}t.bindTexture(32879,ce.__webglTexture,33984+O)}function W(H,O){const ce=r.get(H);if(H.version>0&&ce.__version!==H.version){we(ce,H,O);return}t.bindTexture(34067,ce.__webglTexture,33984+O)}const N={[Uf]:10497,[pr]:33071,[Bf]:33648},me={[En]:9728,[ig]:9984,[sg]:9986,[un]:9729,[uS]:9985,[sl]:9987};function X(H,O,ce){if(ce?(n.texParameteri(H,10242,N[O.wrapS]),n.texParameteri(H,10243,N[O.wrapT]),(H===32879||H===35866)&&n.texParameteri(H,32882,N[O.wrapR]),n.texParameteri(H,10240,me[O.magFilter]),n.texParameteri(H,10241,me[O.minFilter])):(n.texParameteri(H,10242,33071),n.texParameteri(H,10243,33071),(H===32879||H===35866)&&n.texParameteri(H,32882,33071),(O.wrapS!==pr||O.wrapT!==pr)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(H,10240,D(O.magFilter)),n.texParameteri(H,10241,D(O.minFilter)),O.minFilter!==En&&O.minFilter!==un&&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 Pe=e.get("EXT_texture_filter_anisotropic");if(O.type===os&&e.has("OES_texture_float_linear")===!1||a===!1&&O.type===Za&&e.has("OES_texture_half_float_linear")===!1)return;(O.anisotropy>1||r.get(O).__currentAnisotropy)&&(n.texParameterf(H,Pe.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(O.anisotropy,i.getMaxAnisotropy())),r.get(O).__currentAnisotropy=O.anisotropy)}}function Te(H,O){let ce=!1;H.__webglInit===void 0&&(H.__webglInit=!0,O.addEventListener("dispose",Y));const Pe=O.source;let Ne=x.get(Pe);Ne===void 0&&(Ne={},x.set(Pe,Ne));const ze=F(O);if(ze!==H.__cacheKey){Ne[ze]===void 0&&(Ne[ze]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ce=!0),Ne[ze].usedTimes++;const st=Ne[H.__cacheKey];st!==void 0&&(Ne[H.__cacheKey].usedTimes--,st.usedTimes===0&&$(O)),H.__cacheKey=ze,H.__webglTexture=Ne[ze].texture}return ce}function Ce(H,O,ce){let Pe=3553;O.isDataArrayTexture&&(Pe=35866),O.isData3DTexture&&(Pe=32879);const Ne=Te(H,O),ze=O.source;t.bindTexture(Pe,H.__webglTexture,33984+ce);const st=r.get(ze);if(ze.version!==st.__version||Ne===!0){t.activeTexture(33984+ce),n.pixelStorei(37440,O.flipY),n.pixelStorei(37441,O.premultiplyAlpha),n.pixelStorei(3317,O.unpackAlignment),n.pixelStorei(37443,0);const Be=C(O)&&E(O.image)===!1;let Se=M(O.image,Be,!1,d);Se=Nt(O,Se);const Je=E(Se)||a,ot=s.convert(O.format,O.encoding);let Ze=s.convert(O.type),it=T(O.internalFormat,ot,Ze,O.encoding,O.isVideoTexture);X(Pe,O,Je);let Q;const j=O.mipmaps,U=a&&O.isVideoTexture!==!0,de=st.__version===void 0||Ne===!0,ie=L(O,Se,Je);if(O.isDepthTexture)it=6402,a?O.type===os?it=36012:O.type===Ao?it=33190:O.type===Fa?it=35056:it=33189:O.type===os&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),O.format===Fo&&it===6402&&O.type!==cS&&O.type!==Ao&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),O.type=Ao,Ze=s.convert(O.type)),O.format===Qa&&it===6402&&(it=34041,O.type!==Fa&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),O.type=Fa,Ze=s.convert(O.type))),de&&(U?t.texStorage2D(3553,1,it,Se.width,Se.height):t.texImage2D(3553,0,it,Se.width,Se.height,0,ot,Ze,null));else if(O.isDataTexture)if(j.length>0&&Je){U&&de&&t.texStorage2D(3553,ie,it,j[0].width,j[0].height);for(let ee=0,ye=j.length;ee>=1,ye>>=1}}else if(j.length>0&&Je){U&&de&&t.texStorage2D(3553,ie,it,j[0].width,j[0].height);for(let ee=0,ye=j.length;ee0&&de++,t.texStorage2D(34067,de,Q,Se[0].width,Se[0].height));for(let ee=0;ee<6;ee++)if(Be){j?t.texSubImage2D(34069+ee,0,0,0,Se[ee].width,Se[ee].height,Ze,it,Se[ee].data):t.texImage2D(34069+ee,0,Q,Se[ee].width,Se[ee].height,0,Ze,it,Se[ee].data);for(let ye=0;ye0&&tt(H)===!1){const Be=ze?O:[O];ce.__webglMultisampledFramebuffer=n.createFramebuffer(),ce.__webglColorRenderbuffer=[],t.bindFramebuffer(36160,ce.__webglMultisampledFramebuffer);for(let Se=0;Se0&&tt(H)===!1){const O=H.isWebGLMultipleRenderTargets?H.texture:[H.texture],ce=H.width,Pe=H.height;let Ne=16384;const ze=[],st=H.stencilBuffer?33306:36096,Be=r.get(H),Se=H.isWebGLMultipleRenderTargets===!0;if(Se)for(let Je=0;Je0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&O.__useRenderToTexture!==!1}function Ct(H){const O=o.render.frame;v.get(H)!==O&&(v.set(H,O),H.update())}function Nt(H,O){const ce=H.encoding,Pe=H.format,Ne=H.type;return H.isCompressedTexture===!0||H.isVideoTexture===!0||H.format===og||ce!==Xs&&(ce===Kt?a===!1?e.has("EXT_sRGB")===!0&&Pe===_i?(H.format=og,H.minFilter=un,H.generateMipmaps=!1):O=hS.sRGBToLinear(O):(Pe!==_i||Ne!==Ho)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",ce)),O}this.allocateTextureUnit=z,this.resetTextureUnits=pe,this.setTexture2D=G,this.setTexture2DArray=Z,this.setTexture3D=k,this.setTextureCube=W,this.rebindTextures=Ee,this.setupRenderTarget=Ue,this.updateRenderTargetMipmap=Le,this.updateMultisampleRenderTarget=qe,this.setupDepthRenderbuffer=ne,this.setupFrameBufferTexture=be,this.useMultisampledRTT=tt}function mL(n,e,t){const r=t.isWebGL2;function i(s,o=null){let a;if(s===Ho)return 5121;if(s===UR)return 32819;if(s===BR)return 32820;if(s===kR)return 5120;if(s===zR)return 5122;if(s===cS)return 5123;if(s===FR)return 5124;if(s===Ao)return 5125;if(s===os)return 5126;if(s===Za)return r?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===VR)return 6406;if(s===_i)return 6408;if(s===HR)return 6409;if(s===WR)return 6410;if(s===Fo)return 6402;if(s===Qa)return 34041;if(s===$R)return 6403;if(s===GR)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(s===og)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===jR)return 36244;if(s===XR)return 33319;if(s===YR)return 33320;if(s===qR)return 36249;if(s===om||s===am||s===lm||s===um)if(o===Kt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===om)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===am)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===lm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===um)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===om)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===am)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===lm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===um)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===fx||s===dx||s===hx||s===px)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===fx)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===dx)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===hx)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===px)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===ZR)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===mx||s===gx)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===mx)return o===Kt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===gx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===vx||s===yx||s===_x||s===xx||s===Sx||s===wx||s===Mx||s===bx||s===Ex||s===Tx||s===Cx||s===Ax||s===Px||s===Rx)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===vx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===yx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===_x)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===xx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Sx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===wx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Mx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===bx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Ex)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Tx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Cx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Ax)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===Px)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Rx)return o===Kt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Lx)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===Lx)return o===Kt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return s===Fa?r?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:i}}class gL extends Gn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class du extends Mt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const vW={type:"move"};class Ly{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new du,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 du,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new I,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new I),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new du,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new I,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new I),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,r){let i=null,s=null,o=null;const a=this._targetRay,c=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,r);if(f.joints[y.jointName]===void 0){const _=new du;_.matrixAutoUpdate=!1,_.visible=!1,f.joints[y.jointName]=_,f.add(_)}const w=f.joints[y.jointName];x!==null&&(w.matrix.fromArray(x.transform.matrix),w.matrix.decompose(w.position,w.rotation,w.scale),w.jointRadius=x.radius),w.visible=x!==null}const d=f.joints["index-finger-tip"],h=f.joints["thumb-tip"],p=d.position.distanceTo(h.position),g=.02,v=.005;f.inputState.pinching&&p>g+v?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&p<=g-v&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));a!==null&&(i=t.getPose(e.targetRaySpace,r),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(vW)))}return a!==null&&(a.visible=i!==null),c!==null&&(c.visible=s!==null),f!==null&&(f.visible=o!==null),this}}class _S extends Cn{constructor(e,t,r,i,s,o,a,c,f,d){if(d=d!==void 0?d:Fo,d!==Fo&&d!==Qa)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&d===Fo&&(r=Ao),r===void 0&&d===Qa&&(r=Fa),super(null,i,s,o,a,c,d,r,f),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:En,this.minFilter=c!==void 0?c:En,this.flipY=!1,this.generateMipmaps=!1}}class yW extends Zs{constructor(e,t){super();const r=this;let i=null,s=1,o=null,a="local-floor",c=null,f=null,d=null,h=null,p=null,g=null;const v=t.getContextAttributes();let y=null,x=null;const w=[],_=[],M=new Gn;M.layers.enable(1),M.viewport=new Ht;const E=new Gn;E.layers.enable(2),E.viewport=new Ht;const C=[M,E],P=new gL;P.layers.enable(1),P.layers.enable(2);let R=null,T=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(F){let G=w[F];return G===void 0&&(G=new Ly,w[F]=G),G.getTargetRaySpace()},this.getControllerGrip=function(F){let G=w[F];return G===void 0&&(G=new Ly,w[F]=G),G.getGripSpace()},this.getHand=function(F){let G=w[F];return G===void 0&&(G=new Ly,w[F]=G),G.getHandSpace()};function L(F){const G=_.indexOf(F.inputSource);if(G===-1)return;const Z=w[G];Z!==void 0&&Z.dispatchEvent({type:F.type,data:F.inputSource})}function D(){i.removeEventListener("select",L),i.removeEventListener("selectstart",L),i.removeEventListener("selectend",L),i.removeEventListener("squeeze",L),i.removeEventListener("squeezestart",L),i.removeEventListener("squeezeend",L),i.removeEventListener("end",D),i.removeEventListener("inputsourceschange",Y);for(let F=0;F=0&&(_[k]=null,w[k].dispatchEvent({type:"disconnected",data:Z}))}for(let G=0;G=_.length){_.push(Z),k=N;break}else if(_[N]===null){_[N]=Z,k=N;break}if(k===-1)break}const W=w[k];W&&W.dispatchEvent({type:"connected",data:Z})}}const fe=new I,q=new I;function $(F,G,Z){fe.setFromMatrixPosition(G.matrixWorld),q.setFromMatrixPosition(Z.matrixWorld);const k=fe.distanceTo(q),W=G.projectionMatrix.elements,N=Z.projectionMatrix.elements,me=W[14]/(W[10]-1),X=W[14]/(W[10]+1),Te=(W[9]+1)/W[5],Ce=(W[9]-1)/W[5],we=(W[8]-1)/W[0],be=(N[8]+1)/N[0],He=me*we,ue=me*be,ne=k/(-we+be),Ee=ne*-we;G.matrixWorld.decompose(F.position,F.quaternion,F.scale),F.translateX(Ee),F.translateZ(ne),F.matrixWorld.compose(F.position,F.quaternion,F.scale),F.matrixWorldInverse.copy(F.matrixWorld).invert();const Ue=me+ne,Le=X+ne,qe=He-Ee,et=ue+(k-Ee),tt=Te*X/Le*Ue,Ct=Ce*X/Le*Ue;F.projectionMatrix.makePerspective(qe,et,tt,Ct,Ue,Le)}function se(F,G){G===null?F.matrixWorld.copy(F.matrix):F.matrixWorld.multiplyMatrices(G.matrixWorld,F.matrix),F.matrixWorldInverse.copy(F.matrixWorld).invert()}this.updateCamera=function(F){if(i===null)return;P.near=E.near=M.near=F.near,P.far=E.far=M.far=F.far,(R!==P.near||T!==P.far)&&(i.updateRenderState({depthNear:P.near,depthFar:P.far}),R=P.near,T=P.far);const G=F.parent,Z=P.cameras;se(P,G);for(let W=0;W0&&(y.alphaTest.value=x.alphaTest);const w=e.get(x).envMap;if(w&&(y.envMap.value=w,y.flipEnvMap.value=w.isCubeTexture&&w.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 E=n.physicallyCorrectLights!==!0?Math.PI:1;y.lightMapIntensity.value=x.lightMapIntensity*E}x.aoMap&&(y.aoMap.value=x.aoMap,y.aoMapIntensity.value=x.aoMapIntensity);let _;x.map?_=x.map:x.specularMap?_=x.specularMap:x.displacementMap?_=x.displacementMap:x.normalMap?_=x.normalMap:x.bumpMap?_=x.bumpMap:x.roughnessMap?_=x.roughnessMap:x.metalnessMap?_=x.metalnessMap:x.alphaMap?_=x.alphaMap:x.emissiveMap?_=x.emissiveMap:x.clearcoatMap?_=x.clearcoatMap:x.clearcoatNormalMap?_=x.clearcoatNormalMap:x.clearcoatRoughnessMap?_=x.clearcoatRoughnessMap:x.iridescenceMap?_=x.iridescenceMap:x.iridescenceThicknessMap?_=x.iridescenceThicknessMap:x.specularIntensityMap?_=x.specularIntensityMap:x.specularColorMap?_=x.specularColorMap:x.transmissionMap?_=x.transmissionMap:x.thicknessMap?_=x.thicknessMap:x.sheenColorMap?_=x.sheenColorMap:x.sheenRoughnessMap&&(_=x.sheenRoughnessMap),_!==void 0&&(_.isWebGLRenderTarget&&(_=_.texture),_.matrixAutoUpdate===!0&&_.updateMatrix(),y.uvTransform.value.copy(_.matrix));let M;x.aoMap?M=x.aoMap:x.lightMap&&(M=x.lightMap),M!==void 0&&(M.isWebGLRenderTarget&&(M=M.texture),M.matrixAutoUpdate===!0&&M.updateMatrix(),y.uv2Transform.value.copy(M.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,w,_){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.size.value=x.size*w,y.scale.value=_*.5,x.map&&(y.map.value=x.map),x.alphaMap&&(y.alphaMap.value=x.alphaMap),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest);let M;x.map?M=x.map:x.alphaMap&&(M=x.alphaMap),M!==void 0&&(M.matrixAutoUpdate===!0&&M.updateMatrix(),y.uvTransform.value.copy(M.matrix))}function c(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 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 f(y,x){y.specular.value.copy(x.specular),y.shininess.value=Math.max(x.shininess,1e-4)}function d(y,x){x.gradientMap&&(y.gradientMap.value=x.gradientMap)}function h(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,w){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===jr&&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=w.texture,y.transmissionSamplerSize.value.set(w.width,w.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 g(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:r}}function xW(n,e,t,r){let i={},s={},o=[];const a=t.isWebGL2?n.getParameter(35375):0;function c(_,M){const E=M.program;r.uniformBlockBinding(_,E)}function f(_,M){let E=i[_.id];E===void 0&&(v(_),E=d(_),i[_.id]=E,_.addEventListener("dispose",x));const C=M.program;r.updateUBOMapping(_,C);const P=e.render.frame;s[_.id]!==P&&(p(_),s[_.id]=P)}function d(_){const M=h();_.__bindingPointIndex=M;const E=n.createBuffer(),C=_.__size,P=_.usage;return n.bindBuffer(35345,E),n.bufferData(35345,C,P),n.bindBuffer(35345,null),n.bindBufferBase(35345,M,E),E}function h(){for(let _=0;_0){P=E%C;const Y=C-P;P!==0&&Y-D.boundary<0&&(E+=C-P,L.__offset=E)}E+=D.storage}return P=E%C,P>0&&(E+=C-P),_.__size=E,_.__cache={},this}function y(_){const M=_.value,E={boundary:0,storage:0};return typeof M=="number"?(E.boundary=4,E.storage=4):M.isVector2?(E.boundary=8,E.storage=8):M.isVector3||M.isColor?(E.boundary=16,E.storage=12):M.isVector4?(E.boundary=16,E.storage=16):M.isMatrix3?(E.boundary=48,E.storage=48):M.isMatrix4?(E.boundary=64,E.storage=64):M.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",M),E}function x(_){const M=_.target;M.removeEventListener("dispose",x);const E=o.indexOf(M.__bindingPointIndex);o.splice(E,1),n.deleteBuffer(i[M.id]),delete i[M.id],delete s[M.id]}function w(){for(const _ in i)n.deleteBuffer(i[_]);o=[],i={},s={}}return{bind:c,update:f,dispose:w}}function SW(){const n=jf("canvas");return n.style.display="block",n}function xS(n={}){this.isWebGLRenderer=!0;const e=n.canvas!==void 0?n.canvas:SW(),t=n.context!==void 0?n.context:null,r=n.depth!==void 0?n.depth:!0,i=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,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let d;t!==null?d=t.getContextAttributes().alpha:d=n.alpha!==void 0?n.alpha:!1;let h=null,p=null;const g=[],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=Xs,this.physicallyCorrectLights=!1,this.toneMapping=Ui,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const y=this;let x=!1,w=0,_=0,M=null,E=-1,C=null;const P=new Ht,R=new Ht;let T=null,L=e.width,D=e.height,Y=1,fe=null,q=null;const $=new Ht(0,0,L,D),se=new Ht(0,0,L,D);let le=!1;const pe=new Wg;let z=!1,F=!1,G=null;const Z=new dt,k=new Me,W=new I,N={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function me(){return M===null?Y:1}let X=t;function Te(B,oe){for(let _e=0;_e0?p=v[v.length-1]:p=null,g.pop(),g.length>0?h=g[g.length-1]:h=null};function bt(B,oe,_e,re){if(B.visible===!1)return;if(B.layers.test(oe.layers)){if(B.isGroup)_e=B.renderOrder;else if(B.isLOD)B.autoUpdate===!0&&B.update(oe);else if(B.isLight)p.pushLight(B),B.castShadow&&p.pushShadow(B);else if(B.isSprite){if(!B.frustumCulled||pe.intersectsSprite(B)){re&&W.setFromMatrixPosition(B.matrixWorld).applyMatrix4(Z);const lt=et.update(B),gt=B.material;gt.visible&&h.push(B,lt,gt,_e,W.z,null)}}else if((B.isMesh||B.isLine||B.isPoints)&&(B.isSkinnedMesh&&B.skeleton.frame!==He.render.frame&&(B.skeleton.update(),B.skeleton.frame=He.render.frame),!B.frustumCulled||pe.intersectsObject(B))){re&&W.setFromMatrixPosition(B.matrixWorld).applyMatrix4(Z);const lt=et.update(B),gt=B.material;if(Array.isArray(gt)){const ut=lt.groups;for(let Dt=0,At=ut.length;Dt0&&Ft(xe,oe,_e),re&&be.viewport(P.copy(re)),xe.length>0&&$t(xe,oe,_e),nt.length>0&&$t(nt,oe,_e),lt.length>0&&$t(lt,oe,_e),be.buffers.depth.setTest(!0),be.buffers.depth.setMask(!0),be.buffers.color.setMask(!0),be.setPolygonOffset(!1)}function Ft(B,oe,_e){const re=we.isWebGL2;G===null&&(G=new qr(1,1,{generateMipmaps:!0,type:Ce.has("EXT_color_buffer_half_float")?Za:Ho,minFilter:sl,samples:re&&s===!0?4:0})),y.getDrawingBufferSize(k),re?G.setSize(k.x,k.y):G.setSize(ag(k.x),ag(k.y));const xe=y.getRenderTarget();y.setRenderTarget(G),y.clear();const nt=y.toneMapping;y.toneMapping=Ui,$t(B,oe,_e),y.toneMapping=nt,ne.updateMultisampleRenderTarget(G),ne.updateRenderTargetMipmap(G),y.setRenderTarget(xe)}function $t(B,oe,_e){const re=oe.isScene===!0?oe.overrideMaterial:null;for(let xe=0,nt=B.length;xe0&&ne.useMultisampledRTT(B)===!1?xe=ue.get(B).__webglMultisampledFramebuffer:xe=Dt,P.copy(B.viewport),R.copy(B.scissor),T=B.scissorTest}else P.copy($).multiplyScalar(Y).floor(),R.copy(se).multiplyScalar(Y).floor(),T=le;if(be.bindFramebuffer(36160,xe)&&we.drawBuffers&&re&&be.drawBuffers(B,xe),be.viewport(P),be.scissor(R),be.setScissorTest(T),nt){const ut=ue.get(B.texture);X.framebufferTexture2D(36160,36064,34069+oe,ut.__webglTexture,_e)}else if(lt){const ut=ue.get(B.texture),Dt=oe||0;X.framebufferTextureLayer(36160,36064,ut.__webglTexture,_e||0,Dt)}E=-1},this.readRenderTargetPixels=function(B,oe,_e,re,xe,nt,lt){if(!(B&&B.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let gt=ue.get(B).__webglFramebuffer;if(B.isWebGLCubeRenderTarget&<!==void 0&&(gt=gt[lt]),gt){be.bindFramebuffer(36160,gt);try{const ut=B.texture,Dt=ut.format,At=ut.type;if(Dt!==_i&&Be.convert(Dt)!==X.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Pt=At===Za&&(Ce.has("EXT_color_buffer_half_float")||we.isWebGL2&&Ce.has("EXT_color_buffer_float"));if(At!==Ho&&Be.convert(At)!==X.getParameter(35738)&&!(At===os&&(we.isWebGL2||Ce.has("OES_texture_float")||Ce.has("WEBGL_color_buffer_float")))&&!Pt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}oe>=0&&oe<=B.width-re&&_e>=0&&_e<=B.height-xe&&X.readPixels(oe,_e,re,xe,Be.convert(Dt),Be.convert(At),nt)}finally{const ut=M!==null?ue.get(M).__webglFramebuffer:null;be.bindFramebuffer(36160,ut)}}},this.copyFramebufferToTexture=function(B,oe,_e=0){const re=Math.pow(2,-_e),xe=Math.floor(oe.image.width*re),nt=Math.floor(oe.image.height*re);ne.setTexture2D(oe,0),X.copyTexSubImage2D(3553,_e,0,0,B.x,B.y,xe,nt),be.unbindTexture()},this.copyTextureToTexture=function(B,oe,_e,re=0){const xe=oe.image.width,nt=oe.image.height,lt=Be.convert(_e.format),gt=Be.convert(_e.type);ne.setTexture2D(_e,0),X.pixelStorei(37440,_e.flipY),X.pixelStorei(37441,_e.premultiplyAlpha),X.pixelStorei(3317,_e.unpackAlignment),oe.isDataTexture?X.texSubImage2D(3553,re,B.x,B.y,xe,nt,lt,gt,oe.image.data):oe.isCompressedTexture?X.compressedTexSubImage2D(3553,re,B.x,B.y,oe.mipmaps[0].width,oe.mipmaps[0].height,lt,oe.mipmaps[0].data):X.texSubImage2D(3553,re,B.x,B.y,lt,gt,oe.image),re===0&&_e.generateMipmaps&&X.generateMipmap(3553),be.unbindTexture()},this.copyTextureToTexture3D=function(B,oe,_e,re,xe=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const nt=B.max.x-B.min.x+1,lt=B.max.y-B.min.y+1,gt=B.max.z-B.min.z+1,ut=Be.convert(re.format),Dt=Be.convert(re.type);let At;if(re.isData3DTexture)ne.setTexture3D(re,0),At=32879;else if(re.isDataArrayTexture)ne.setTexture2DArray(re,0),At=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}X.pixelStorei(37440,re.flipY),X.pixelStorei(37441,re.premultiplyAlpha),X.pixelStorei(3317,re.unpackAlignment);const Pt=X.getParameter(3314),en=X.getParameter(32878),_s=X.getParameter(3316),Js=X.getParameter(3315),eo=X.getParameter(32877),yr=_e.isCompressedTexture?_e.mipmaps[0]:_e.image;X.pixelStorei(3314,yr.width),X.pixelStorei(32878,yr.height),X.pixelStorei(3316,B.min.x),X.pixelStorei(3315,B.min.y),X.pixelStorei(32877,B.min.z),_e.isDataTexture||_e.isData3DTexture?X.texSubImage3D(At,xe,oe.x,oe.y,oe.z,nt,lt,gt,ut,Dt,yr.data):_e.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),X.compressedTexSubImage3D(At,xe,oe.x,oe.y,oe.z,nt,lt,gt,ut,yr.data)):X.texSubImage3D(At,xe,oe.x,oe.y,oe.z,nt,lt,gt,ut,Dt,yr),X.pixelStorei(3314,Pt),X.pixelStorei(32878,en),X.pixelStorei(3316,_s),X.pixelStorei(3315,Js),X.pixelStorei(32877,eo),xe===0&&re.generateMipmaps&&X.generateMipmap(At),be.unbindTexture()},this.initTexture=function(B){B.isCubeTexture?ne.setTextureCube(B,0):B.isData3DTexture?ne.setTexture3D(B,0):B.isDataArrayTexture?ne.setTexture2DArray(B,0):ne.setTexture2D(B,0),be.unbindTexture()},this.resetState=function(){w=0,_=0,M=null,be.reset(),Se.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class vL extends xS{}vL.prototype.isWebGL1Renderer=!0;class jg{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ge(e),this.density=t}clone(){return new jg(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Xg{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new Ge(e),this.near=t,this.far=r}clone(){return new Xg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class SS extends Mt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),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 Yg{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Wf,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Xr()}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,r){e*=this.stride,r*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:c,point:Dc.clone(),uv:vi.getUV(Dc,gp,kc,vp,qT,Iy,ZT,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 yp(n,e,t,r,i,s){jl.subVectors(n,t).addScalar(.5).multiply(r),i!==void 0?(Oc.x=s*jl.x-i*jl.y,Oc.y=i*jl.x+s*jl.y):Oc.copy(jl),n.copy(e),n.x+=Oc.x,n.y+=Oc.y,n.applyMatrix4(yL)}const _p=new I,QT=new I;class xL extends Mt{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 r=0,i=t.length;r0){let r,i;for(r=1,i=t.length;r0){_p.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(_p);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){_p.setFromMatrixPosition(e.matrixWorld),QT.setFromMatrixPosition(this.matrixWorld);const r=_p.distanceTo(QT)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;ic)continue;p.applyMatrix4(this.matrixWorld);const T=e.ray.origin.distanceTo(p);Te.far||t.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const w=Math.max(0,o.start),_=Math.min(x.count,o.start+o.count);for(let M=w,E=_-1;Mc)continue;p.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(p);Pe.far||t.push({distance:P,point:h.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;si.far)return;s.push({distance:f,distanceToRay:Math.sqrt(a),point:c,index:e,face:null,object:o})}}class bW extends Cn{constructor(e,t,r,i,s,o,a,c,f){super(e,t,r,i,s,o,a,c,f),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:un,this.magFilter=s!==void 0?s:un,this.generateMipmaps=!1;const d=this;function h(){d.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class EW extends Cn{constructor(e,t,r){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=r,this.magFilter=En,this.minFilter=En,this.generateMipmaps=!1,this.needsUpdate=!0}}class EL extends Cn{constructor(e,t,r,i,s,o,a,c,f,d,h,p){super(null,o,a,c,f,d,i,s,h,p),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class TW extends Cn{constructor(e,t,r,i,s,o,a,c,f){super(e,t,r,i,s,o,a,c,f),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Gi{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/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 r,i=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)r=this.getPoint(o/e),s+=r.distanceTo(i),t.push(s),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let i=0;const s=r.length;let o;t?o=t:o=e*r[s-1];let a=0,c=s-1,f;for(;a<=c;)if(i=Math.floor(a+(c-a)/2),f=r[i]-o,f<0)a=i+1;else if(f>0)c=i-1;else{c=i;break}if(i=c,r[i]===o)return i/(s-1);const d=r[i],p=r[i+1]-d,g=(o-d)/p;return(i+g)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const o=this.getPoint(i),a=this.getPoint(s),c=t||(o.isVector2?new Me:new I);return c.copy(a).sub(o).normalize(),c}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new I,i=[],s=[],o=[],a=new I,c=new dt;for(let g=0;g<=e;g++){const v=g/e;i[g]=this.getTangentAt(v,new I)}s[0]=new I,o[0]=new I;let f=Number.MAX_VALUE;const d=Math.abs(i[0].x),h=Math.abs(i[0].y),p=Math.abs(i[0].z);d<=f&&(f=d,r.set(1,0,0)),h<=f&&(f=h,r.set(0,1,0)),p<=f&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let g=1;g<=e;g++){if(s[g]=s[g-1].clone(),o[g]=o[g-1].clone(),a.crossVectors(i[g-1],i[g]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(xn(i[g-1].dot(i[g]),-1,1));s[g].applyMatrix4(c.makeRotationAxis(a,v))}o[g].crossVectors(i[g],s[g])}if(t===!0){let g=Math.acos(xn(s[0].dot(s[e]),-1,1));g/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(g=-g);for(let v=1;v<=e;v++)s[v].applyMatrix4(c.makeRotationAxis(i[v],g*v)),o[v].crossVectors(i[v],s[v])}return{tangents:i,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 Zg extends Gi{constructor(e=0,t=0,r=1,i=1,s=0,o=Math.PI*2,a=!1,c=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=c}getPoint(e,t){const r=t||new Me,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:c===0&&a===s-1&&(a=s-2,c=1);let f,d;this.closed||a>0?f=i[(a-1)%s]:(bp.subVectors(i[0],i[1]).add(i[0]),f=bp);const h=i[a%s],p=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return r.set(d2(a,c.x,f.x,d.x,h.x),d2(a,c.y,f.y,d.y,h.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t=r){const o=i[s]-r,a=this.curves[s],c=a.getLength(),f=c===0?0:1-o/c;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 r=0,i=this.curves.length;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t0){const h=f.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(f);const d=f.getPoint(1);return this.currentPoint.copy(d),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 $u extends ht{constructor(e=[new Me(0,-.5),new Me(.5,0),new Me(0,.5)],t=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:i},t=Math.floor(t),i=xn(i,0,Math.PI*2);const s=[],o=[],a=[],c=[],f=[],d=1/t,h=new I,p=new Me,g=new I,v=new I,y=new I;let x=0,w=0;for(let _=0;_<=e.length-1;_++)switch(_){case 0:x=e[_+1].x-e[_].x,w=e[_+1].y-e[_].y,g.x=w*1,g.y=-x,g.z=w*0,y.copy(g),g.normalize(),c.push(g.x,g.y,g.z);break;case e.length-1:c.push(y.x,y.y,y.z);break;default:x=e[_+1].x-e[_].x,w=e[_+1].y-e[_].y,g.x=w*1,g.y=-x,g.z=w*0,v.copy(g),g.x+=y.x,g.y+=y.y,g.z+=y.z,g.normalize(),c.push(g.x,g.y,g.z),y.copy(v)}for(let _=0;_<=t;_++){const M=r+_*d*i,E=Math.sin(M),C=Math.cos(M);for(let P=0;P<=e.length-1;P++){h.x=e[P].x*E,h.y=e[P].y,h.z=e[P].x*C,o.push(h.x,h.y,h.z),p.x=_/t,p.y=P/(e.length-1),a.push(p.x,p.y);const R=c[3*P+0]*E,T=c[3*P+1],L=c[3*P+0]*C;f.push(R,T,L)}}for(let _=0;_0&&M(!0),t>0&&M(!1)),this.setIndex(d),this.setAttribute("position",new Xe(h,3)),this.setAttribute("normal",new Xe(p,3)),this.setAttribute("uv",new Xe(g,2));function _(){const E=new I,C=new I;let P=0;const R=(t-e)/r;for(let T=0;T<=s;T++){const L=[],D=T/s,Y=D*(t-e)+e;for(let fe=0;fe<=i;fe++){const q=fe/i,$=q*c+a,se=Math.sin($),le=Math.cos($);C.x=Y*se,C.y=-D*r+x,C.z=Y*le,h.push(C.x,C.y,C.z),E.set(se,R,le).normalize(),p.push(E.x,E.y,E.z),g.push(q,1-D),L.push(v++)}y.push(L)}for(let T=0;T.9&&R<.1&&(M<.2&&(o[_+0]+=1),E<.2&&(o[_+2]+=1),C<.2&&(o[_+4]+=1))}}function p(_){s.push(_.x,_.y,_.z)}function g(_,M){const E=_*3;M.x=e[E+0],M.y=e[E+1],M.z=e[E+2]}function v(){const _=new I,M=new I,E=new I,C=new I,P=new Me,R=new Me,T=new Me;for(let L=0,D=0;L80*t){a=f=n[0],c=d=n[1];for(let v=t;vf&&(f=h),p>d&&(d=p);g=Math.max(f-a,d-c),g=g!==0?1/g:0}return Yf(s,o,t,a,c,g),o}};function IL(n,e,t,r,i){let s,o;if(i===ZW(n,e,t,r)>0)for(s=e;s=e;s-=r)o=h2(s,n[s],n[s+1],o);return o&&Kg(o,o.next)&&(Zf(o),o=o.next),o}function Wo(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(Kg(t,t.next)||cn(t.prev,t,t.next)===0)){if(Zf(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function Yf(n,e,t,r,i,s,o){if(!n)return;!o&&s&&WW(n,r,i,s);let a=n,c,f;for(;n.prev!==n.next;){if(c=n.prev,f=n.next,s?kW(n,r,i,s):OW(n)){e.push(c.i/t),e.push(n.i/t),e.push(f.i/t),Zf(n),n=f.next,a=f.next;continue}if(n=f,n===a){o?o===1?(n=zW(Wo(n),e,t),Yf(n,e,t,r,i,s,2)):o===2&&FW(n,e,t,r,i,s):Yf(Wo(n),e,t,r,i,s,1);break}}}function OW(n){const e=n.prev,t=n,r=n.next;if(cn(e,t,r)>=0)return!1;let i=n.next.next;for(;i!==n.prev;){if(hu(e.x,e.y,t.x,t.y,r.x,r.y,i.x,i.y)&&cn(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function kW(n,e,t,r){const i=n.prev,s=n,o=n.next;if(cn(i,s,o)>=0)return!1;const a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,d=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=zx(a,c,e,t,r),p=zx(f,d,e,t,r);let g=n.prevZ,v=n.nextZ;for(;g&&g.z>=h&&v&&v.z<=p;){if(g!==n.prev&&g!==n.next&&hu(i.x,i.y,s.x,s.y,o.x,o.y,g.x,g.y)&&cn(g.prev,g,g.next)>=0||(g=g.prevZ,v!==n.prev&&v!==n.next&&hu(i.x,i.y,s.x,s.y,o.x,o.y,v.x,v.y)&&cn(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;g&&g.z>=h;){if(g!==n.prev&&g!==n.next&&hu(i.x,i.y,s.x,s.y,o.x,o.y,g.x,g.y)&&cn(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;v&&v.z<=p;){if(v!==n.prev&&v!==n.next&&hu(i.x,i.y,s.x,s.y,o.x,o.y,v.x,v.y)&&cn(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function zW(n,e,t){let r=n;do{const i=r.prev,s=r.next.next;!Kg(i,s)&&NL(i,r,r.next,s)&&qf(i,s)&&qf(s,i)&&(e.push(i.i/t),e.push(r.i/t),e.push(s.i/t),Zf(r),Zf(r.next),r=n=s),r=r.next}while(r!==n);return Wo(r)}function FW(n,e,t,r,i,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&XW(o,a)){let c=DL(o,a);o=Wo(o,o.next),c=Wo(c,c.next),Yf(o,e,t,r,i,s),Yf(c,e,t,r,i,s);return}a=a.next}o=o.next}while(o!==n)}function UW(n,e,t,r){const i=[];let s,o,a,c,f;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=r&&p>s){if(s=p,p===r){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=c&&r!==t.x&&hu(io.x||t.x===o.x&&HW(o,t)))&&(o=t,d=h)),t=t.next;while(t!==a);return o}function HW(n,e){return cn(n.prev,n,e.prev)<0&&cn(e.next,n,n.next)<0}function WW(n,e,t,r){let i=n;do i.z===null&&(i.z=zx(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,$W(i)}function $W(n){let e,t,r,i,s,o,a,c,f=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,r=t,a=0,e=0;e0||c>0&&r;)a!==0&&(c===0||!r||t.z<=r.z)?(i=t,t=t.nextZ,a--):(i=r,r=r.nextZ,c--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;t=r}s.nextZ=null,f*=2}while(o>1);return n}function zx(n,e,t,r,i){return n=32767*(n-t)*i,e=32767*(e-r)*i,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 jW(n){let e=n,t=n;do(e.x=0&&(n-o)*(r-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(r-a)>=0}function XW(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!YW(n,e)&&(qf(n,e)&&qf(e,n)&&qW(n,e)&&(cn(n.prev,n,e.prev)||cn(n,e.prev,e))||Kg(n,e)&&cn(n.prev,n,n.next)>0&&cn(e.prev,e,e.next)>0)}function cn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Kg(n,e){return n.x===e.x&&n.y===e.y}function NL(n,e,t,r){const i=Pp(cn(n,e,t)),s=Pp(cn(n,e,r)),o=Pp(cn(t,r,n)),a=Pp(cn(t,r,e));return!!(i!==s&&o!==a||i===0&&Ap(n,t,e)||s===0&&Ap(n,r,e)||o===0&&Ap(t,n,r)||a===0&&Ap(t,e,r))}function Ap(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 YW(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&&NL(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function qf(n,e){return cn(n.prev,n,n.next)<0?cn(n,e,n.next)>=0&&cn(n,n.prev,e)>=0:cn(n,e,n.prev)<0||cn(n,n.next,e)<0}function qW(n,e){let t=n,r=!1;const i=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function DL(n,e){const t=new Fx(n.i,n.x,n.y),r=new Fx(e.i,e.x,e.y),i=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function h2(n,e,t,r){const i=new Fx(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}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 Fx(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ZW(n,e,t,r){let i=0;for(let s=e,o=t-r;s2&&n[e-1].equals(n[0])&&n.pop()}function m2(n,e){for(let t=0;tNumber.EPSILON){const ce=Math.sqrt(H),Pe=Math.sqrt(Ct*Ct+Nt*Nt),Ne=ne.x-tt/ce,ze=ne.y+et/ce,st=Ee.x-Nt/Pe,Be=Ee.y+Ct/Pe,Se=((st-Ne)*Nt-(Be-ze)*Ct)/(et*Nt-tt*Ct);Ue=Ne+et*Se-ue.x,Le=ze+tt*Se-ue.y;const Je=Ue*Ue+Le*Le;if(Je<=2)return new Me(Ue,Le);qe=Math.sqrt(Je/2)}else{let ce=!1;et>Number.EPSILON?Ct>Number.EPSILON&&(ce=!0):et<-Number.EPSILON?Ct<-Number.EPSILON&&(ce=!0):Math.sign(tt)===Math.sign(Nt)&&(ce=!0),ce?(Ue=-tt,Le=et,qe=Math.sqrt(H)):(Ue=et,Le=tt,qe=Math.sqrt(H/2))}return new Me(Ue/qe,Le/qe)}const F=[];for(let ue=0,ne=$.length,Ee=ne-1,Ue=ue+1;ue=0;ue--){const ne=ue/x,Ee=g*Math.cos(ne*Math.PI/2),Ue=v*Math.sin(ne*Math.PI/2)+y;for(let Le=0,qe=$.length;Le=0;){const Ue=Ee;let Le=Ee-1;Le<0&&(Le=ue.length-1);for(let qe=0,et=d+x*2;qe0)&&g.push(M,E,P),(w!==r-1||c0!=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 UL extends qn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ge(16777215),this.specular=new Ge(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ge(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,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=cd,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 BL extends qn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ge(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ge(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,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 VL extends qn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,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 GL extends qn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ge(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ge(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,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=cd,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 HL extends qn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ge(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qo,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 WL extends lr{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 hi(n,e,t){return IS(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)}function La(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 IS(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function $L(n){function e(i,s){return n[i]-n[s]}const t=n.length,r=new Array(t);for(let i=0;i!==t;++i)r[i]=i;return r.sort(e),r}function Ux(n,e,t){const r=n.length,i=new n.constructor(r);for(let s=0,o=0;o!==r;++s){const a=t[s]*e;for(let c=0;c!==e;++c)i[o++]=n[a+c]}return i}function NS(n,e,t,r){let i=1,s=n[0];for(;s!==void 0&&s[r]===void 0;)s=n[i++];if(s===void 0)return;let o=s[r];if(o!==void 0)if(Array.isArray(o))do o=s[r],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[r],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[i++];while(s!==void 0);else do o=s[r],o!==void 0&&(e.push(s.time),t.push(o)),s=n[i++];while(s!==void 0)}function e9(n,e,t,r,i=30){const s=n.clone();s.name=e;const o=[];for(let c=0;c=r)){h.push(f.times[g]);for(let y=0;ys.tracks[c].times[0]&&(a=s.tracks[c].times[0]);for(let c=0;c=a.times[v]){const w=v*h+d,_=w+h-d;y=hi(a.values,w,_)}else{const w=a.createInterpolant(),_=d,M=h-d;w.evaluate(s),y=hi(w.resultBuffer,_,M)}c==="quaternion"&&new Gt().fromArray(y).normalize().conjugate().toArray(y);const x=f.times.length;for(let w=0;w=s)){const a=t[1];e=s)break t}o=r,r=0;break n}break e}for(;r>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=hi(r,s,o),this.values=hi(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 r=this.times,i=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const c=r[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),e=!1;break}o=c}if(i!==void 0&&IS(i))for(let a=0,c=i.length;a!==c;++a){const f=i[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=hi(this.times),t=hi(this.values),r=this.getValueSize(),i=this.getInterpolation()===cm,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*r,c=o*r,f=0;f!==r;++f)t[c+f]=t[a+f];++o}return o!==e.length?(this.times=hi(e,0,o),this.values=hi(t,0,o*r)):(this.times=e,this.values=t),this}clone(){const e=hi(this.times,0),t=hi(this.values,0),r=this.constructor,i=new r(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Hi.prototype.TimeBufferType=Float32Array;Hi.prototype.ValueBufferType=Float32Array;Hi.prototype.DefaultInterpolation=Gf;class cl extends Hi{}cl.prototype.ValueTypeName="bool";cl.prototype.ValueBufferType=Array;cl.prototype.DefaultInterpolation=Vf;cl.prototype.InterpolantFactoryMethodLinear=void 0;cl.prototype.InterpolantFactoryMethodSmooth=void 0;class OS extends Hi{}OS.prototype.ValueTypeName="color";class Qf extends Hi{}Qf.prototype.ValueTypeName="number";class YL extends Cd{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(r-t)/(i-t);let f=e*a;for(let d=f+a;f!==d;f+=4)Gt.slerpFlat(s,0,o,f-a,o,f,c);return s}}class ju extends Hi{InterpolantFactoryMethodLinear(e){return new YL(this.times,this.values,this.getValueSize(),e)}}ju.prototype.ValueTypeName="quaternion";ju.prototype.DefaultInterpolation=Gf;ju.prototype.InterpolantFactoryMethodSmooth=void 0;class fl extends Hi{}fl.prototype.ValueTypeName="string";fl.prototype.ValueBufferType=Array;fl.prototype.DefaultInterpolation=Vf;fl.prototype.InterpolantFactoryMethodLinear=void 0;fl.prototype.InterpolantFactoryMethodSmooth=void 0;class Kf extends Hi{}Kf.prototype.ValueTypeName="vector";class Jf{constructor(e,t=-1,r,i=Gg){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=Xr(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,i=1/(e.fps||1);for(let o=0,a=r.length;o!==a;++o)t.push(i9(r[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=r.length;s!==o;++s)t.push(Hi.toJSON(r[s]));return i}static CreateFromMorphTargetSequence(e,t,r,i){const s=t.length,o=[];for(let a=0;a1){const h=d[1];let p=i[h];p||(i[h]=p=[]),p.push(f)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,r));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(h,p,g,v,y){if(g.length!==0){const x=[],w=[];NS(g,x,w,v),x.length!==0&&y.push(new h(p,x,w))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let c=e.length||-1;const f=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(Ns[e]!==void 0){Ns[e].push({onLoad:t,onProgress:r,onError:i});return}Ns[e]=[],Ns[e].push({onLoad:t,onProgress:r,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,c=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=="undefined"||f.body===void 0||f.body.getReader===void 0)return f;const d=Ns[e],h=f.body.getReader(),p=f.headers.get("Content-Length"),g=p?parseInt(p):0,v=g!==0;let y=0;const x=new ReadableStream({start(w){_();function _(){h.read().then(({done:M,value:E})=>{if(M)w.close();else{y+=E.byteLength;const C=new ProgressEvent("progress",{lengthComputable:v,loaded:y,total:g});for(let P=0,R=d.length;P{switch(c){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(d=>new DOMParser().parseFromString(d,a));case"json":return f.json();default:if(a===void 0)return f.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),p=h&&h[1]?h[1].toLowerCase():void 0,g=new TextDecoder(p);return f.arrayBuffer().then(v=>g.decode(v))}}}).then(f=>{Ja.add(e,f);const d=Ns[e];delete Ns[e];for(let h=0,p=d.length;h{const d=Ns[e];if(d===void 0)throw this.manager.itemError(e),f;delete Ns[e];for(let h=0,p=d.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class o9 extends Kr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new Ys(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(c){i?i(c):console.error(c),s.manager.itemError(e)}},r,i)}parse(e){const t=[];for(let r=0;r0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=r(o.value);break;case"c":i.uniforms[s].value=new Ge().setHex(o.value);break;case"v2":i.uniforms[s].value=new Me().fromArray(o.value);break;case"v3":i.uniforms[s].value=new I().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Ht().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Tr().fromArray(o.value);break;case"m4":i.uniforms[s].value=new dt().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new Me().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Me().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:kL,SpriteMaterial:wS,RawShaderMaterial:zL,ShaderMaterial:fs,PointsMaterial:bS,MeshPhysicalMaterial:FL,MeshStandardMaterial:LS,MeshPhongMaterial:UL,MeshToonMaterial:BL,MeshNormalMaterial:VL,MeshLambertMaterial:GL,MeshDepthMaterial:vS,MeshDistanceMaterial:yS,MeshBasicMaterial:hs,MeshMatcapMaterial:HL,LineDashedMaterial:WL,LineBasicMaterial:lr,Material:qn};return new t[e]}}class Bx{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let r=0,i=e.length;r0){const c=new kS(t);s=new ed(c),s.setCrossOrigin(this.crossOrigin);for(let f=0,d=e.length;f0){i=new ed(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,i,this._addIndex*t,1,t);for(let c=t,f=t+t;c!==f;++c)if(r[c]!==r[c+t]){a.setValue(r,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(t,i);for(let s=r,o=i;s!==o;++s)t[s]=t[i+s%r];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 r=e;r=.5)for(let o=0;o!==s;++o)e[t+o]=e[r+o]}_slerp(e,t,r,i){Gt.slerpFlat(e,t,e,t,e,r,i)}_slerpAdditive(e,t,r,i,s){const o=this._workIndex*s;Gt.multiplyQuaternionsFlat(e,o,e,t,e,r),Gt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,r,i,s){const o=1-i;for(let a=0;a!==s;++a){const c=t+a;e[c]=e[c]*o+e[r+a]*i}}_lerpAdditive(e,t,r,i,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[r+o]*i}}}const BS="\\[\\]\\.:\\/",T9=new RegExp("["+BS+"]","g"),VS="[^"+BS+"]",C9="[^"+BS.replace("\\.","")+"]",A9=/((?:WC+[\/:])*)/.source.replace("WC",VS),P9=/(WCOD+)?/.source.replace("WCOD",C9),R9=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",VS),L9=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",VS),I9=new RegExp("^"+A9+P9+R9+L9+"$"),N9=["material","materials","bones","map"];class D9{constructor(e,t,r){const i=r||Lt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=r.length;i!==s;++i)r[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class Lt{constructor(e,t,r){this.path=t,this.parsedPath=r||Lt.parseTrackName(t),this.node=Lt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new Lt.Composite(e,t,r):new Lt(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(T9,"")}static parseTrackName(e){const t=I9.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=r.nodeName.substring(i+1);N9.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(s){for(let o=0;o=s){const h=s++,p=e[h];t[p.uuid]=d,e[d]=p,t[f]=h,e[h]=c;for(let g=0,v=i;g!==v;++g){const y=r[g],x=y[h],w=y[d];y[d]=x,y[h]=w}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,c=arguments.length;a!==c;++a){const f=arguments[a],d=f.uuid,h=t[d];if(h!==void 0)if(delete t[d],h0&&(t[g.uuid]=h),e[h]=g,e.pop();for(let v=0,y=i;v!==y;++v){const x=r[v];x[h]=x[p],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const r=this._bindingsIndicesByPath;let i=r[e];const s=this._bindings;if(i!==void 0)return s[i];const o=this._paths,a=this._parsedPaths,c=this._objects,f=c.length,d=this.nCachedObjects_,h=new Array(f);i=s.length,r[e]=i,o.push(e),a.push(t),s.push(h);for(let p=d,g=c.length;p!==g;++p){const v=c[p];h[p]=new Lt(v,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){const i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,c=o[a],f=e[a];t[f]=r,o[r]=c,o.pop(),s[r]=s[a],s.pop(),i[r]=i[a],i.pop()}}}class k9{constructor(e,t,r=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=i;const s=t.tracks,o=s.length,a=new Array(o),c={endingStart:Aa,endingEnd:Aa};for(let f=0;f!==o;++f){const d=s[f].createInterpolant(null);a[f]=d,d.settings=c}this._interpolantSettings=c,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=KR,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,r){if(e.fadeOut(t),this.fadeIn(t),r){const i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}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,r){const i=this._mixer,s=i.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const c=a.parameterPositions,f=a.sampleValues;return c[0]=s,c[1]=s+r,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,r,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const c=(e-s)*r;c<0||r===0?t=0:(this._startTime=null,t=r*c)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const c=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case fS:for(let d=0,h=c.length;d!==h;++d)c[d].evaluate(o),f[d].accumulateAdditive(a);break;case Gg:default:for(let d=0,h=c.length;d!==h;++d)c[d].evaluate(o),f[d].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;r!==null&&(t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let i=this.time+e,s=this._loopCount;const o=r===JR;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(r===QR){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,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)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);const c=this.repetitions-s;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){const f=e<0;this._setEndings(f,!f,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,r){const i=this._interpolantSettings;r?(i.endingStart=Pa,i.endingEnd=Pa):(e?i.endingStart=this.zeroSlopeAtStart?Pa:Aa:i.endingStart=Hf,t?i.endingEnd=this.zeroSlopeAtEnd?Pa:Aa:i.endingEnd=Hf)}_scheduleFading(e,t,r){const i=this._mixer,s=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,c=o.sampleValues;return a[0]=s,c[0]=t,a[1]=s+e,c[1]=r,this}}const z9=new Float32Array(1);class F9 extends Zs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,c=r.uuid,f=this._bindingsByRootAndName;let d=f[c];d===void 0&&(d={},f[c]=d);for(let h=0;h!==s;++h){const p=i[h],g=p.name;let v=d[g];if(v!==void 0)++v.referenceCount,o[h]=v;else{if(v=o[h],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,c,g));continue}const y=t&&t._propertyBindings[h].binding.parsedPath;v=new oI(Lt.create(r,g,y),p.ValueTypeName,p.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,c,g),o[h]=v}a[h].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,r)}const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];--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=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let f=0;f!==r;++f)t[f]._update(i,e,s,o);const a=this._bindings,c=this._nActiveBindings;for(let f=0;f!==c;++f)a[f].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.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.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return P2.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 R2=new I,Lp=new I;class j9{constructor(e=new I,t=new I){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){R2.subVectors(e,this.start),Lp.subVectors(this.end,this.start);const r=Lp.dot(Lp);let s=Lp.dot(R2)/r;return t&&(s=xn(s,0,1)),s}closestPointToPoint(e,t,r){const i=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(i).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 L2=new I;class X9 extends Mt{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const r=new ht,i=[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,c=32;o1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{k2.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(k2,t)}}setLength(e,t=e*.2,r=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),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 o7 extends ps{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new ht;i.setAttribute("position",new Xe(t,3)),i.setAttribute("color",new Xe(r,3));const s=new lr({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,r){const i=new Ge,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(r),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class a7{constructor(){this.type="ShapePath",this.color=new Ge,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Xf,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,i){return this.currentPath.quadraticCurveTo(e,t,r,i),this}bezierCurveTo(e,t,r,i,s,o){return this.currentPath.bezierCurveTo(e,t,r,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(w){const _=[];for(let M=0,E=w.length;MNumber.EPSILON){if(D<0&&(R=_[P],L=-L,T=_[C],D=-D),w.yT.y)continue;if(w.y===R.y){if(w.x===R.x)return!0}else{const Y=D*(w.x-R.x)-L*(w.y-R.y);if(Y===0)return!0;if(Y<0)continue;E=!E}}else{if(w.y!==R.y)continue;if(T.x<=w.x&&w.x<=R.x||R.x<=w.x&&w.x<=T.x)return!0}}return E}const i=cs.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,c;const f=[];if(s.length===1)return a=s[0],c=new Ga,c.curves=a.curves,f.push(c),f;let d=!i(s[0].getPoints());d=e?!d:d;const h=[],p=[];let g=[],v=0,y;p[v]=void 0,g[v]=[];for(let w=0,_=s.length;w<_;w++)a=s[w],y=a.getPoints(),o=i(y),o=e?!o:o,o?(!d&&p[v]&&v++,p[v]={s:new Ga,p:y},p[v].s.curves=a.curves,d&&v++,g[v]=[]):g[v].push({h:a,p:y[0]});if(!p[0])return t(s);if(p.length>1){let w=!1,_=0;for(let M=0,E=p.length;M0&&w===!1&&(g=h)}let x;for(let w=0,_=p.length;w<_;w++){c=p[w].s,f.push(c),x=g[w];for(let M=0,E=x.length;M>-f-14,r[c|256]=1024>>-f-14|32768,i[c]=-f-1,i[c|256]=-f-1):f<=15?(r[c]=f+15<<10,r[c|256]=f+15<<10|32768,i[c]=13,i[c|256]=13):f<128?(r[c]=31744,r[c|256]=64512,i[c]=24,i[c|256]=24):(r[c]=31744,r[c|256]=64512,i[c]=13,i[c|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let c=1;c<1024;++c){let f=c<<13,d=0;for(;(f&8388608)===0;)f<<=1,d-=8388608;f&=-8388609,d+=947912704,s[c]=f|d}for(let c=1024;c<2048;++c)s[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)o[c]=c<<23;o[31]=1199570944,o[32]=2147483648;for(let c=33;c<63;++c)o[c]=2147483648+(c-32<<23);o[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(a[c]=1024);return{floatView:e,uint32View:t,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:a}}function u7(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=xn(n,-65504,65504),ks.floatView[0]=n;const e=ks.uint32View[0],t=e>>23&511;return ks.baseTable[t]+((e&8388607)>>ks.shiftTable[t])}function c7(n){const e=n>>10;return ks.uint32View[0]=ks.mantissaTable[ks.offsetTable[e]+(n&1023)]+ks.exponentTable[e],ks.floatView[0]}var f7=Object.freeze({__proto__:null,toHalfFloat:u7,fromHalfFloat:c7});function d7(){console.error("THREE.ImmediateRenderObject has been removed.")}class h7 extends qr{constructor(e,t,r){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,r),this.samples=4}}class p7 extends fd{constructor(e,t,r,i){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,r,i)}}class m7 extends Hg{constructor(e,t,r,i){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,r,i)}}class g7 extends hr{constructor(e,t,r,i,s,o){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(e,t,r,i,s,o)}}class v7 extends gd{constructor(e,t,r,i){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry."),super(e,t,r,i)}}class y7 extends vd{constructor(e,t,r,i){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(e,t,r,i)}}class _7 extends yd{constructor(e,t,r,i,s,o,a){console.warn("THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry."),super(e,t,r,i,s,o,a)}}class x7 extends Bn{constructor(e,t,r,i,s,o,a,c){console.warn("THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry."),super(e,t,r,i,s,o,a,c)}}class S7 extends _d{constructor(e,t){console.warn("THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry."),super(e,t)}}class w7 extends xd{constructor(e,t){console.warn("THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry."),super(e,t)}}class M7 extends Sd{constructor(e,t){console.warn("THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry."),super(e,t)}}class b7 extends $u{constructor(e,t,r,i){console.warn("THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry."),super(e,t,r,i)}}class E7 extends Vr{constructor(e,t){console.warn("THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry."),super(e,t)}}class T7 extends Gr{constructor(e,t,r,i){console.warn("THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry."),super(e,t,r,i)}}class C7 extends Qs{constructor(e,t,r,i){console.warn("THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry."),super(e,t,r,i)}}class A7 extends wd{constructor(e,t,r,i,s,o){console.warn("THREE.RingBufferGeometry has been renamed to THREE.RingGeometry."),super(e,t,r,i,s,o)}}class P7 extends Md{constructor(e,t){console.warn("THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry."),super(e,t)}}class R7 extends ul{constructor(e,t,r,i,s,o,a){console.warn("THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry."),super(e,t,r,i,s,o,a)}}class L7 extends bd{constructor(e,t){console.warn("THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry."),super(e,t)}}class I7 extends Bs{constructor(e,t,r,i,s){console.warn("THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry."),super(e,t,r,i,s)}}class N7 extends Ed{constructor(e,t,r,i,s,o){console.warn("THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry."),super(e,t,r,i,s,o)}}class D7 extends Td{constructor(e,t,r,i,s){console.warn("THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry."),super(e,t,r,i,s)}}typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ug}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Ug);var lg=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:lS,AddEquation:Sa,AddOperation:LR,AdditiveAnimationBlendMode:fS,AdditiveBlending:ox,AlphaFormat:VR,AlwaysDepth:bR,AlwaysStencilFunc:rL,AmbientLight:eI,AmbientLightProbe:_9,AnimationClip:Jf,AnimationLoader:o9,AnimationMixer:F9,AnimationObjectGroup:O9,AnimationUtils:n9,ArcCurve:TL,ArrayCamera:gL,ArrowHelper:s7,Audio:sI,AudioAnalyser:E9,AudioContext:FS,AudioListener:w9,AudioLoader:v9,AxesHelper:o7,BackSide:jr,BasicDepthPacking:eL,BasicShadowMap:cR,Bone:MS,BooleanKeyframeTrack:cl,Box2:$9,Box3:ol,Box3Helper:r7,BoxBufferGeometry:g7,BoxGeometry:hr,BoxHelper:n7,BufferAttribute:qt,BufferGeometry:ht,BufferGeometryLoader:iI,ByteType:kR,Cache:Ja,Camera:hd,CameraHelper:t7,CanvasTexture:TW,CapsuleBufferGeometry:v7,CapsuleGeometry:gd,CatmullRomCurve3:CL,CineonToneMapping:DR,CircleBufferGeometry:y7,CircleGeometry:vd,ClampToEdgeWrapping:pr,Clock:US,Color:Ge,ColorKeyframeTrack:OS,ColorManagement:di,CompressedTexture:EL,CompressedTextureLoader:a9,ConeBufferGeometry:_7,ConeGeometry:yd,CubeCamera:lL,CubeReflectionMapping:Vo,CubeRefractionMapping:Go,CubeTexture:pd,CubeTextureLoader:l9,CubeUVReflectionMapping:Hu,CubicBezierCurve:TS,CubicBezierCurve3:AL,CubicInterpolant:jL,CullFaceBack:sx,CullFaceFront:uR,CullFaceFrontBack:NB,CullFaceNone:lR,Curve:Gi,CurvePath:RL,CustomBlending:fR,CustomToneMapping:OR,CylinderBufferGeometry:x7,CylinderGeometry:Bn,Cylindrical:W9,Data3DTexture:Hg,DataArrayTexture:fd,DataTexture:Su,DataTexture2DArray:p7,DataTexture3D:m7,DataTextureLoader:u9,DataUtils:f7,DecrementStencilOp:$B,DecrementWrapStencilOp:XB,DefaultLoadingManager:qL,DepthFormat:Fo,DepthStencilFormat:Qa,DepthTexture:_S,DirectionalLight:JL,DirectionalLightHelper:e7,DiscreteInterpolant:XL,DodecahedronBufferGeometry:S7,DodecahedronGeometry:_d,DoubleSide:ki,DstAlphaFactor:yR,DstColorFactor:xR,DynamicCopyUsage:lV,DynamicDrawUsage:nV,DynamicReadUsage:sV,EdgesGeometry:LL,EllipseCurve:Zg,EqualDepth:TR,EqualStencilFunc:QB,EquirectangularReflectionMapping:zf,EquirectangularRefractionMapping:Ff,Euler:ll,EventDispatcher:Zs,ExtrudeBufferGeometry:w7,ExtrudeGeometry:xd,FileLoader:Ys,Float16BufferAttribute:GV,Float32BufferAttribute:Xe,Float64BufferAttribute:HV,FloatType:os,Fog:Xg,FogExp2:jg,FramebufferTexture:EW,FrontSide:qa,Frustum:Wg,GLBufferAttribute:G9,GLSL1:cV,GLSL3:Ix,GreaterDepth:AR,GreaterEqualDepth:CR,GreaterEqualStencilFunc:tV,GreaterStencilFunc:JB,GridHelper:K9,Group:du,HalfFloatType:Za,HemisphereLight:ZL,HemisphereLightHelper:Q9,HemisphereLightProbe:y9,IcosahedronBufferGeometry:M7,IcosahedronGeometry:Sd,ImageBitmapLoader:g9,ImageLoader:ed,ImageUtils:hS,ImmediateRenderObject:d7,IncrementStencilOp:WB,IncrementWrapStencilOp:jB,InstancedBufferAttribute:Iu,InstancedBufferGeometry:rI,InstancedInterleavedBuffer:V9,InstancedMesh:wL,Int16BufferAttribute:BV,Int32BufferAttribute:VV,Int8BufferAttribute:zV,IntType:FR,InterleavedBuffer:Yg,InterleavedBufferAttribute:Ka,Interpolant:Cd,InterpolateDiscrete:Vf,InterpolateLinear:Gf,InterpolateSmooth:cm,InvertStencilOp:YB,KeepStencilOp:fm,KeyframeTrack:Hi,LOD:xL,LatheBufferGeometry:b7,LatheGeometry:$u,Layers:Va,LessDepth:ER,LessEqualDepth:rg,LessEqualStencilFunc:KB,LessStencilFunc:ZB,Light:Zo,LightProbe:Jg,Line:St,Line3:j9,LineBasicMaterial:lr,LineCurve:Qg,LineCurve3:PL,LineDashedMaterial:WL,LineLoop:ML,LineSegments:ps,LinearEncoding:Xs,LinearFilter:un,LinearInterpolant:DS,LinearMipMapLinearFilter:zB,LinearMipMapNearestFilter:kB,LinearMipmapLinearFilter:sl,LinearMipmapNearestFilter:uS,LinearSRGBColorSpace:Po,LinearToneMapping:IR,Loader:Kr,LoaderUtils:Bx,LoadingManager:kS,LoopOnce:QR,LoopPingPong:JR,LoopRepeat:KR,LuminanceAlphaFormat:WR,LuminanceFormat:HR,MOUSE:LB,Material:qn,MaterialLoader:e0,MathUtils:is,Matrix3:Tr,Matrix4:dt,MaxEquation:cx,Mesh:We,MeshBasicMaterial:hs,MeshDepthMaterial:vS,MeshDistanceMaterial:yS,MeshLambertMaterial:GL,MeshMatcapMaterial:HL,MeshNormalMaterial:VL,MeshPhongMaterial:UL,MeshPhysicalMaterial:FL,MeshStandardMaterial:LS,MeshToonMaterial:BL,MinEquation:ux,MirroredRepeatWrapping:Bf,MixOperation:RR,MultiplyBlending:lx,MultiplyOperation:cd,NearestFilter:En,NearestMipMapLinearFilter:OB,NearestMipMapNearestFilter:DB,NearestMipmapLinearFilter:sg,NearestMipmapNearestFilter:ig,NeverDepth:MR,NeverStencilFunc:qB,NoBlending:Gs,NoColorSpace:VB,NoToneMapping:Ui,NormalAnimationBlendMode:Gg,NormalBlending:za,NotEqualDepth:PR,NotEqualStencilFunc:eV,NumberKeyframeTrack:Qf,Object3D:Mt,ObjectLoader:p9,ObjectSpaceNormalMap:nL,OctahedronBufferGeometry:E7,OctahedronGeometry:Vr,OneFactor:mR,OneMinusDstAlphaFactor:_R,OneMinusDstColorFactor:SR,OneMinusSrcAlphaFactor:aS,OneMinusSrcColorFactor:vR,OrthographicCamera:md,PCFShadowMap:Bg,PCFSoftShadowMap:cf,PMREMGenerator:Dx,Path:Xf,PerspectiveCamera:Gn,Plane:So,PlaneBufferGeometry:T7,PlaneGeometry:Gr,PlaneHelper:i7,PointLight:KL,PointLightHelper:q9,Points:bL,PointsMaterial:bS,PolarGridHelper:J9,PolyhedronBufferGeometry:C7,PolyhedronGeometry:Qs,PositionalAudio:b9,PropertyBinding:Lt,PropertyMixer:oI,QuadraticBezierCurve:CS,QuadraticBezierCurve3:AS,Quaternion:Gt,QuaternionKeyframeTrack:ju,QuaternionLinearInterpolant:YL,REVISION:Ug,RGBADepthPacking:tL,RGBAFormat:_i,RGBAIntegerFormat:qR,RGBA_ASTC_10x10_Format:Ax,RGBA_ASTC_10x5_Format:Ex,RGBA_ASTC_10x6_Format:Tx,RGBA_ASTC_10x8_Format:Cx,RGBA_ASTC_12x10_Format:Px,RGBA_ASTC_12x12_Format:Rx,RGBA_ASTC_4x4_Format:vx,RGBA_ASTC_5x4_Format:yx,RGBA_ASTC_5x5_Format:_x,RGBA_ASTC_6x5_Format:xx,RGBA_ASTC_6x6_Format:Sx,RGBA_ASTC_8x5_Format:wx,RGBA_ASTC_8x6_Format:Mx,RGBA_ASTC_8x8_Format:bx,RGBA_BPTC_Format:Lx,RGBA_ETC2_EAC_Format:gx,RGBA_PVRTC_2BPPV1_Format:px,RGBA_PVRTC_4BPPV1_Format:hx,RGBA_S3TC_DXT1_Format:am,RGBA_S3TC_DXT3_Format:lm,RGBA_S3TC_DXT5_Format:um,RGBFormat:GR,RGB_ETC1_Format:ZR,RGB_ETC2_Format:mx,RGB_PVRTC_2BPPV1_Format:dx,RGB_PVRTC_4BPPV1_Format:fx,RGB_S3TC_DXT1_Format:om,RGFormat:XR,RGIntegerFormat:YR,RawShaderMaterial:zL,Ray:dd,Raycaster:HS,RectAreaLight:tI,RedFormat:$R,RedIntegerFormat:jR,ReinhardToneMapping:NR,RepeatWrapping:Uf,ReplaceStencilOp:HB,ReverseSubtractEquation:hR,RingBufferGeometry:A7,RingGeometry:wd,SRGBColorSpace:ts,Scene:SS,ShaderChunk:wt,ShaderLib:Oi,ShaderMaterial:fs,ShadowMaterial:kL,Shape:Ga,ShapeBufferGeometry:P7,ShapeGeometry:Md,ShapePath:a7,ShapeUtils:cs,ShortType:zR,Skeleton:qg,SkeletonHelper:Y9,SkinnedMesh:SL,Source:Ra,Sphere:al,SphereBufferGeometry:R7,SphereGeometry:ul,Spherical:H9,SphericalHarmonics3:nI,SplineCurve:PS,SpotLight:QL,SpotLightHelper:X9,Sprite:_L,SpriteMaterial:wS,SrcAlphaFactor:oS,SrcAlphaSaturateFactor:wR,SrcColorFactor:gR,StaticCopyUsage:aV,StaticDrawUsage:Wf,StaticReadUsage:iV,StereoCamera:x9,StreamCopyUsage:uV,StreamDrawUsage:rV,StreamReadUsage:oV,StringKeyframeTrack:fl,SubtractEquation:dR,SubtractiveBlending:ax,TOUCH:IB,TangentSpaceNormalMap:qo,TetrahedronBufferGeometry:L7,TetrahedronGeometry:bd,Texture:Cn,TextureLoader:c9,TorusBufferGeometry:I7,TorusGeometry:Bs,TorusKnotBufferGeometry:N7,TorusKnotGeometry:Ed,Triangle:vi,TriangleFanDrawMode:BB,TriangleStripDrawMode:UB,TrianglesDrawMode:FB,TubeBufferGeometry:D7,TubeGeometry:Td,UVMapping:Vg,Uint16BufferAttribute:pS,Uint32BufferAttribute:mS,Uint8BufferAttribute:FV,Uint8ClampedBufferAttribute:UV,Uniform:GS,UniformsGroup:B9,UniformsLib:De,UniformsUtils:aL,UnsignedByteType:Ho,UnsignedInt248Type:Fa,UnsignedIntType:Ao,UnsignedShort4444Type:UR,UnsignedShort5551Type:BR,UnsignedShortType:cS,VSMShadowMap:Ca,Vector2:Me,Vector3:I,Vector4:Ht,VectorKeyframeTrack:Kf,VideoTexture:bW,WebGL1Renderer:vL,WebGL3DRenderTarget:CV,WebGLArrayRenderTarget:TV,WebGLCubeRenderTarget:uL,WebGLMultipleRenderTargets:AV,WebGLMultisampleRenderTarget:h7,WebGLRenderTarget:qr,WebGLRenderer:xS,WebGLUtils:mL,WireframeGeometry:OL,WrapAroundEnding:Hf,ZeroCurvatureEnding:Aa,ZeroFactor:pR,ZeroSlopeEnding:Pa,ZeroStencilOp:GB,_SRGBAFormat:og,sRGBEncoding:Kt},Symbol.toStringTag,{value:"Module"})),Ia={exports:{}},dl={};/** + * @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. + */dl.ConcurrentRoot=1;dl.ContinuousEventPriority=4;dl.DefaultEventPriority=16;dl.DiscreteEventPriority=1;dl.IdleEventPriority=536870912;dl.LegacyRoot=0;Ia.exports=dl;function O7(n){let e;const t=new Set,r=(f,d)=>{const h=typeof f=="function"?f(e):f;if(h!==e){const p=e;e=d?h:Object.assign({},e,h),t.forEach(g=>g(e,p))}},i=()=>e,s=(f,d=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=d(e);function g(){const v=d(e);if(!h(p,v)){const y=p;f(p=v,y)}}return t.add(g),()=>t.delete(g)},c={setState:r,getState:i,subscribe:(f,d,h)=>d||h?s(f,d,h):(t.add(f),()=>t.delete(f)),destroy:()=>t.clear()};return e=n(r,i,c),c}const k7=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),z2=k7?te.exports.useEffect:te.exports.useLayoutEffect;function z7(n){const e=typeof n=="function"?O7(n):n,t=(r=e.getState,i=Object.is)=>{const[,s]=te.exports.useReducer(x=>x+1,0),o=e.getState(),a=te.exports.useRef(o),c=te.exports.useRef(r),f=te.exports.useRef(i),d=te.exports.useRef(!1),h=te.exports.useRef();h.current===void 0&&(h.current=r(o));let p,g=!1;(a.current!==o||c.current!==r||f.current!==i||d.current)&&(p=r(o),g=!i(h.current,p)),z2(()=>{g&&(h.current=p),a.current=o,c.current=r,f.current=i,d.current=!1});const v=te.exports.useRef(o);z2(()=>{const x=()=>{try{const _=e.getState(),M=c.current(_);f.current(h.current,M)||(a.current=_,h.current=M,s())}catch{d.current=!0,s()}},w=e.subscribe(x);return e.getState()!==v.current&&x(),w},[]);const y=g?p:h.current;return te.exports.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 r=[t,e];return{next(){const i=r.length<=0;return{value:r.shift(),done:i}}}},t}var lI={exports:{}},ug={exports:{}},uI={};/** + * @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(z,F){var G=z.length;z.push(F);e:for(;0>>1,k=z[Z];if(0>>1;Zi(me,G))Xi(Te,me)?(z[Z]=Te,z[X]=G,Z=X):(z[Z]=me,z[N]=G,Z=N);else if(Xi(Te,G))z[Z]=Te,z[X]=G,Z=X;else break e}}return F}function i(z,F){var G=z.sortIndex-F.sortIndex;return G!==0?G:z.id-F.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 c=[],f=[],d=1,h=null,p=3,g=!1,v=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(z){for(var F=t(f);F!==null;){if(F.callback===null)r(f);else if(F.startTime<=z)r(f),F.sortIndex=F.expirationTime,e(c,F);else break;F=t(f)}}function E(z){if(y=!1,M(z),!v)if(t(c)!==null)v=!0,le(C);else{var F=t(f);F!==null&&pe(E,F.startTime-z)}}function C(z,F){v=!1,y&&(y=!1,w(T),T=-1),g=!0;var G=p;try{for(M(F),h=t(c);h!==null&&(!(h.expirationTime>F)||z&&!Y());){var Z=h.callback;if(typeof Z=="function"){h.callback=null,p=h.priorityLevel;var k=Z(h.expirationTime<=F);F=n.unstable_now(),typeof k=="function"?h.callback=k:h===t(c)&&r(c),M(F)}else r(c);h=t(c)}if(h!==null)var W=!0;else{var N=t(f);N!==null&&pe(E,N.startTime-F),W=!1}return W}finally{h=null,p=G,g=!1}}var P=!1,R=null,T=-1,L=5,D=-1;function Y(){return!(n.unstable_now()-Dz||125Z?(z.sortIndex=G,e(f,z),t(c)===null&&z===t(f)&&(y?(w(T),T=-1):y=!0,pe(E,G-Z))):(z.sortIndex=k,e(c,z),v||g||(v=!0,le(C))),z},n.unstable_shouldYield=Y,n.unstable_wrapCallback=function(z){var F=p;return function(){var G=p;p=F;try{return z.apply(this,arguments)}finally{p=G}}}})(uI);ug.exports=uI;/** + * @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 F7=function(e){var t={},r=te.exports,i=ug.exports,s=Object.assign;function o(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,m=1;mK||b[V]!==A[K]){var ge=` +`+b[V].replace(" at new "," at ");return l.displayName&&ge.includes("")&&(ge=ge.replace("",l.displayName)),ge}while(1<=V&&0<=K);break}}}finally{$i=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?Et(l):""}var _r=Object.prototype.hasOwnProperty,Jr=[],ei=-1;function ti(l){return{current:l}}function mt(l){0>ei||(l.current=Jr[ei],Jr[ei]=null,ei--)}function Rt(l,u){ei++,Jr[ei]=l.current,l.current=u}var ni={},Bt=ti(ni),On=ti(!1),xs=ni;function Ss(l,u){var m=l.type.contextTypes;if(!m)return ni;var S=l.stateNode;if(S&&S.__reactInternalMemoizedUnmaskedChildContext===u)return S.__reactInternalMemoizedMaskedChildContext;var b={},A;for(A in m)b[A]=u[A];return S&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=b),b}function xr(l){return l=l.childContextTypes,l!=null}function zd(){mt(On),mt(Bt)}function _w(l,u,m){if(Bt.current!==ni)throw Error(o(168));Rt(Bt,u),Rt(On,m)}function xw(l,u,m){var S=l.stateNode;if(u=u.childContextTypes,typeof S.getChildContext!="function")return m;S=S.getChildContext();for(var b in S)if(!(b in u))throw Error(o(108,T(l)||"Unknown",b));return s({},m,S)}function Fd(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||ni,xs=Bt.current,Rt(Bt,l),Rt(On,On.current),!0}function Sw(l,u,m){var S=l.stateNode;if(!S)throw Error(o(169));m?(l=xw(l,u,xs),S.__reactInternalMemoizedMergedChildContext=l,mt(On),mt(Bt),Rt(Bt,l)):mt(On),Rt(On,m)}var bi=Math.clz32?Math.clz32:cD,lD=Math.log,uD=Math.LN2;function cD(l){return l>>>=0,l===0?32:31-(lD(l)/uD|0)|0}var Ud=64,Bd=4194304;function Ku(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Vd(l,u){var m=l.pendingLanes;if(m===0)return 0;var S=0,b=l.suspendedLanes,A=l.pingedLanes,V=m&268435455;if(V!==0){var K=V&~b;K!==0?S=Ku(K):(A&=V,A!==0&&(S=Ku(A)))}else V=m&~b,V!==0?S=Ku(V):A!==0&&(S=Ku(A));if(S===0)return 0;if(u!==0&&u!==S&&(u&b)===0&&(b=S&-S,A=u&-u,b>=A||b===16&&(A&4194240)!==0))return u;if((S&4)!==0&&(S|=m&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=S;0m;m++)u.push(l);return u}function Ju(l,u,m){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-bi(u),l[u]=m}function hD(l,u){var m=l.pendingLanes&~u;l.pendingLanes=u,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=u,l.mutableReadLanes&=u,l.entangledLanes&=u,u=l.entanglements;var S=l.eventTimes;for(l=l.expirationTimes;0>=V,b-=V,bs=1<<32-bi(u)+b|m<kt?(Fn=ft,ft=null):Fn=ft.sibling;var zt=rt(ae,ft,he[kt],Ve);if(zt===null){ft===null&&(ft=Fn);break}l&&ft&&zt.alternate===null&&u(ae,ft),J=A(zt,J,kt),vt===null?Qe=zt:vt.sibling=zt,vt=zt,ft=Fn}if(kt===he.length)return m(ae,ft),nn&&ea(ae,kt),Qe;if(ft===null){for(;ktkt?(Fn=ft,ft=null):Fn=ft.sibling;var lo=rt(ae,ft,zt.value,Ve);if(lo===null){ft===null&&(ft=Fn);break}l&&ft&&lo.alternate===null&&u(ae,ft),J=A(lo,J,kt),vt===null?Qe=lo:vt.sibling=lo,vt=lo,ft=Fn}if(zt.done)return m(ae,ft),nn&&ea(ae,kt),Qe;if(ft===null){for(;!zt.done;kt++,zt=he.next())zt=ct(ae,zt.value,Ve),zt!==null&&(J=A(zt,J,kt),vt===null?Qe=zt:vt.sibling=zt,vt=zt);return nn&&ea(ae,kt),Qe}for(ft=S(ae,ft);!zt.done;kt++,zt=he.next())zt=jt(ft,ae,kt,zt.value,Ve),zt!==null&&(l&&zt.alternate!==null&&ft.delete(zt.key===null?kt:zt.key),J=A(zt,J,kt),vt===null?Qe=zt:vt.sibling=zt,vt=zt);return l&&ft.forEach(function(KD){return u(ae,KD)}),nn&&ea(ae,kt),Qe}function ci(ae,J,he,Ve){if(typeof he=="object"&&he!==null&&he.type===d&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case c:e:{for(var Qe=he.key,vt=J;vt!==null;){if(vt.key===Qe){if(Qe=he.type,Qe===d){if(vt.tag===7){m(ae,vt.sibling),J=b(vt,he.props.children),J.return=ae,ae=J;break e}}else if(vt.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===M&&zw(Qe)===vt.type){m(ae,vt.sibling),J=b(vt,he.props),J.ref=nc(ae,vt,he),J.return=ae,ae=J;break e}m(ae,vt);break}else u(ae,vt);vt=vt.sibling}he.type===d?(J=aa(he.props.children,ae.mode,Ve,he.key),J.return=ae,ae=J):(Ve=Ph(he.type,he.key,he.props,null,ae.mode,Ve),Ve.ref=nc(ae,J,he),Ve.return=ae,ae=Ve)}return V(ae);case f:e:{for(vt=he.key;J!==null;){if(J.key===vt)if(J.tag===4&&J.stateNode.containerInfo===he.containerInfo&&J.stateNode.implementation===he.implementation){m(ae,J.sibling),J=b(J,he.children||[]),J.return=ae,ae=J;break e}else{m(ae,J);break}else u(ae,J);J=J.sibling}J=Tv(he,ae.mode,Ve),J.return=ae,ae=J}return V(ae);case M:return vt=he._init,ci(ae,J,vt(he._payload),Ve)}if(se(he))return Ke(ae,J,he,Ve);if(P(he))return er(ae,J,he,Ve);Kd(ae,he)}return typeof he=="string"&&he!==""||typeof he=="number"?(he=""+he,J!==null&&J.tag===6?(m(ae,J.sibling),J=b(J,he),J.return=ae,ae=J):(m(ae,J),J=Ev(he,ae.mode,Ve),J.return=ae,ae=J),V(ae)):m(ae,J)}return ci}var xl=Fw(!0),Uw=Fw(!1),rc={},oi=ti(rc),ic=ti(rc),Sl=ti(rc);function Zi(l){if(l===rc)throw Error(o(174));return l}function H0(l,u){Rt(Sl,u),Rt(ic,l),Rt(oi,rc),l=pe(u),mt(oi),Rt(oi,l)}function wl(){mt(oi),mt(ic),mt(Sl)}function Bw(l){var u=Zi(Sl.current),m=Zi(oi.current);u=z(m,l.type,u),m!==u&&(Rt(ic,l),Rt(oi,u))}function W0(l){ic.current===l&&(mt(oi),mt(ic))}var an=ti(0);function Jd(l){for(var u=l;u!==null;){if(u.tag===13){var m=u.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||Wi(m)||Qu(m)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var $0=[];function j0(){for(var l=0;l<$0.length;l++){var u=$0[l];be?u._workInProgressVersionPrimary=null:u._workInProgressVersionSecondary=null}$0.length=0}var eh=a.ReactCurrentDispatcher,ai=a.ReactCurrentBatchConfig,Ml=0,hn=null,Qn=null,zn=null,th=!1,sc=!1,oc=0,MD=0;function Kn(){throw Error(o(321))}function X0(l,u){if(u===null)return!1;for(var m=0;mm?m:4,l(!0);var S=ai.transition;ai.transition={};try{l(!1),u()}finally{Ot=m,ai.transition=S}}function eM(){return Qi().memoizedState}function ED(l,u,m){var S=so(l);m={lane:S,action:m,hasEagerState:!1,eagerState:null,next:null},tM(l)?nM(u,m):(rM(l,u,m),m=cr(),l=li(l,S,m),l!==null&&iM(l,u,S))}function TD(l,u,m){var S=so(l),b={lane:S,action:m,hasEagerState:!1,eagerState:null,next:null};if(tM(l))nM(u,b);else{rM(l,u,b);var A=l.alternate;if(l.lanes===0&&(A===null||A.lanes===0)&&(A=u.lastRenderedReducer,A!==null))try{var V=u.lastRenderedState,K=A(V,m);if(b.hasEagerState=!0,b.eagerState=K,Xi(K,V))return}catch{}finally{}m=cr(),l=li(l,S,m),l!==null&&iM(l,u,S)}}function tM(l){var u=l.alternate;return l===hn||u!==null&&u===hn}function nM(l,u){sc=th=!0;var m=l.pending;m===null?u.next=u:(u.next=m.next,m.next=u),l.pending=u}function rM(l,u,m){Sn!==null&&(l.mode&1)!==0&&(xt&2)===0?(l=u.interleaved,l===null?(m.next=m,qi===null?qi=[u]:qi.push(u)):(m.next=l.next,l.next=m),u.interleaved=m):(l=u.pending,l===null?m.next=m:(m.next=l.next,l.next=m),u.pending=m)}function iM(l,u,m){if((m&4194240)!==0){var S=u.lanes;S&=l.pendingLanes,m|=S,u.lanes=m,T0(l,m)}}var oh={readContext:ri,useCallback:Kn,useContext:Kn,useEffect:Kn,useImperativeHandle:Kn,useInsertionEffect:Kn,useLayoutEffect:Kn,useMemo:Kn,useReducer:Kn,useRef:Kn,useState:Kn,useDebugValue:Kn,useDeferredValue:Kn,useTransition:Kn,useMutableSource:Kn,useSyncExternalStore:Kn,useId:Kn,unstable_isNewReconciler:!1},CD={readContext:ri,useCallback:function(l,u){return Ts().memoizedState=[l,u===void 0?null:u],l},useContext:ri,useEffect:Q0,useImperativeHandle:function(l,u,m){return m=m!=null?m.concat([l]):null,ih(4194308,4,Zw.bind(null,u,l),m)},useLayoutEffect:function(l,u){return ih(4194308,4,l,u)},useInsertionEffect:function(l,u){return ih(4,2,l,u)},useMemo:function(l,u){var m=Ts();return u=u===void 0?null:u,l=l(),m.memoizedState=[l,u],l},useReducer:function(l,u,m){var S=Ts();return u=m!==void 0?m(u):u,S.memoizedState=S.baseState=u,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},S.queue=l,l=l.dispatch=ED.bind(null,hn,l),[S.memoizedState,l]},useRef:function(l){var u=Ts();return l={current:l},u.memoizedState=l},useState:Z0,useDebugValue:K0,useDeferredValue:function(l){var u=Z0(l),m=u[0],S=u[1];return Q0(function(){var b=ai.transition;ai.transition={};try{S(l)}finally{ai.transition=b}},[l]),m},useTransition:function(){var l=Z0(!1),u=l[0];return l=bD.bind(null,l[1]),Ts().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,m){var S=hn,b=Ts();if(nn){if(m===void 0)throw Error(o(407));m=m()}else{if(m=u(),Sn===null)throw Error(o(349));(Ml&30)!==0||Hw(S,u,m)}b.memoizedState=m;var A={value:m,getSnapshot:u};return b.queue=A,Q0($w.bind(null,S,A,l),[l]),S.flags|=2048,ac(9,Ww.bind(null,S,A,m,u),void 0,null),m},useId:function(){var l=Ts(),u=Sn.identifierPrefix;if(nn){var m=Es,S=bs;m=(S&~(1<<32-bi(S)-1)).toString(32)+m,u=":"+u+"R"+m,m=oc++,0vv&&(u.flags|=128,S=!0,fc(b,!1),u.lanes=4194304)}else{if(!S)if(l=Jd(A),l!==null){if(u.flags|=128,S=!0,l=l.updateQueue,l!==null&&(u.updateQueue=l,u.flags|=4),fc(b,!0),b.tail===null&&b.tailMode==="hidden"&&!A.alternate&&!nn)return Jn(u),null}else 2*kn()-b.renderingStartTime>vv&&m!==1073741824&&(u.flags|=128,S=!0,fc(b,!1),u.lanes=4194304);b.isBackwards?(A.sibling=u.child,u.child=A):(l=b.last,l!==null?l.sibling=A:u.child=A,b.last=A)}return b.tail!==null?(u=b.tail,b.rendering=u,b.tail=u.sibling,b.renderingStartTime=kn(),u.sibling=null,l=an.current,Rt(an,S?l&1|2:l&1),u):(Jn(u),null);case 22:case 23:return wv(),S=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==S&&(u.flags|=8192),S&&(u.mode&1)!==0?(zr&1073741824)!==0&&(Jn(u),He&&u.subtreeFlags&6&&(u.flags|=8192)):Jn(u),null;case 24:return null;case 25:return null}throw Error(o(156,u.tag))}var ID=a.ReactCurrentOwner,kr=!1;function ur(l,u,m,S){u.child=l===null?Uw(u,null,m,S):xl(u,l.child,m,S)}function dM(l,u,m,S,b){m=m.render;var A=u.ref;return gl(u,b),S=Y0(l,u,m,S,A,b),m=q0(),l!==null&&!kr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~b,Cs(l,u,b)):(nn&&m&&F0(u),u.flags|=1,ur(l,u,S,b),u.child)}function hM(l,u,m,S,b){if(l===null){var A=m.type;return typeof A=="function"&&!bv(A)&&A.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=A,pM(l,u,A,S,b)):(l=Ph(m.type,null,S,u,u.mode,b),l.ref=u.ref,l.return=u,u.child=l)}if(A=l.child,(l.lanes&b)===0){var V=A.memoizedProps;if(m=m.compare,m=m!==null?m:Wd,m(V,S)&&l.ref===u.ref)return Cs(l,u,b)}return u.flags|=1,l=ao(A,S),l.ref=u.ref,l.return=u,u.child=l}function pM(l,u,m,S,b){if(l!==null&&Wd(l.memoizedProps,S)&&l.ref===u.ref)if(kr=!1,(l.lanes&b)!==0)(l.flags&131072)!==0&&(kr=!0);else return u.lanes=l.lanes,Cs(l,u,b);return tv(l,u,m,S,b)}function mM(l,u,m){var S=u.pendingProps,b=S.children,A=l!==null?l.memoizedState:null;if(S.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null},Rt(bl,zr),zr|=m;else if((m&1073741824)!==0)u.memoizedState={baseLanes:0,cachePool:null},S=A!==null?A.baseLanes:m,Rt(bl,zr),zr|=S;else return l=A!==null?A.baseLanes|m:m,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null},u.updateQueue=null,Rt(bl,zr),zr|=l,null;else A!==null?(S=A.baseLanes|m,u.memoizedState=null):S=m,Rt(bl,zr),zr|=S;return ur(l,u,b,m),u.child}function gM(l,u){var m=u.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function tv(l,u,m,S,b){var A=xr(m)?xs:Bt.current;return A=Ss(u,A),gl(u,b),m=Y0(l,u,m,S,A,b),S=q0(),l!==null&&!kr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~b,Cs(l,u,b)):(nn&&S&&F0(u),u.flags|=1,ur(l,u,m,b),u.child)}function vM(l,u,m,S,b){if(xr(m)){var A=!0;Fd(u)}else A=!1;if(gl(u,b),u.stateNode===null)l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2),Lw(u,m,S),z0(u,m,S,b),S=!0;else if(l===null){var V=u.stateNode,K=u.memoizedProps;V.props=K;var ge=V.context,Ie=m.contextType;typeof Ie=="object"&&Ie!==null?Ie=ri(Ie):(Ie=xr(m)?xs:Bt.current,Ie=Ss(u,Ie));var je=m.getDerivedStateFromProps,ct=typeof je=="function"||typeof V.getSnapshotBeforeUpdate=="function";ct||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(K!==S||ge!==Ie)&&Iw(u,V,S,Ie),to=!1;var rt=u.memoizedState;V.state=rt,Yd(u,S,V,b),ge=u.memoizedState,K!==S||rt!==ge||On.current||to?(typeof je=="function"&&(k0(u,m,je,S),ge=u.memoizedState),(K=to||Rw(u,m,K,S,rt,ge,Ie))?(ct||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount()),typeof V.componentDidMount=="function"&&(u.flags|=4194308)):(typeof V.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=S,u.memoizedState=ge),V.props=S,V.state=ge,V.context=Ie,S=K):(typeof V.componentDidMount=="function"&&(u.flags|=4194308),S=!1)}else{V=u.stateNode,Tw(l,u),K=u.memoizedProps,Ie=u.type===u.elementType?K:Ei(u.type,K),V.props=Ie,ct=u.pendingProps,rt=V.context,ge=m.contextType,typeof ge=="object"&&ge!==null?ge=ri(ge):(ge=xr(m)?xs:Bt.current,ge=Ss(u,ge));var jt=m.getDerivedStateFromProps;(je=typeof jt=="function"||typeof V.getSnapshotBeforeUpdate=="function")||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(K!==ct||rt!==ge)&&Iw(u,V,S,ge),to=!1,rt=u.memoizedState,V.state=rt,Yd(u,S,V,b);var Ke=u.memoizedState;K!==ct||rt!==Ke||On.current||to?(typeof jt=="function"&&(k0(u,m,jt,S),Ke=u.memoizedState),(Ie=to||Rw(u,m,Ie,S,rt,Ke,ge)||!1)?(je||typeof V.UNSAFE_componentWillUpdate!="function"&&typeof V.componentWillUpdate!="function"||(typeof V.componentWillUpdate=="function"&&V.componentWillUpdate(S,Ke,ge),typeof V.UNSAFE_componentWillUpdate=="function"&&V.UNSAFE_componentWillUpdate(S,Ke,ge)),typeof V.componentDidUpdate=="function"&&(u.flags|=4),typeof V.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof V.componentDidUpdate!="function"||K===l.memoizedProps&&rt===l.memoizedState||(u.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||K===l.memoizedProps&&rt===l.memoizedState||(u.flags|=1024),u.memoizedProps=S,u.memoizedState=Ke),V.props=S,V.state=Ke,V.context=ge,S=Ie):(typeof V.componentDidUpdate!="function"||K===l.memoizedProps&&rt===l.memoizedState||(u.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||K===l.memoizedProps&&rt===l.memoizedState||(u.flags|=1024),S=!1)}return nv(l,u,m,S,A,b)}function nv(l,u,m,S,b,A){gM(l,u);var V=(u.flags&128)!==0;if(!S&&!V)return b&&Sw(u,m,!1),Cs(l,u,A);S=u.stateNode,ID.current=u;var K=V&&typeof m.getDerivedStateFromError!="function"?null:S.render();return u.flags|=1,l!==null&&V?(u.child=xl(u,l.child,null,A),u.child=xl(u,null,K,A)):ur(l,u,K,A),u.memoizedState=S.state,b&&Sw(u,m,!0),u.child}function yM(l){var u=l.stateNode;u.pendingContext?_w(l,u.pendingContext,u.pendingContext!==u.context):u.context&&_w(l,u.context,!1),H0(l,u.containerInfo)}function _M(l,u,m,S,b){return _l(),G0(b),u.flags|=256,ur(l,u,m,S),u.child}var uh={dehydrated:null,treeContext:null,retryLane:0};function ch(l){return{baseLanes:l,cachePool:null}}function xM(l,u,m){var S=u.pendingProps,b=an.current,A=!1,V=(u.flags&128)!==0,K;if((K=V)||(K=l!==null&&l.memoizedState===null?!1:(b&2)!==0),K?(A=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(b|=1),Rt(an,b&1),l===null)return V0(u),l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((u.mode&1)===0?u.lanes=1:Qu(l)?u.lanes=8:u.lanes=1073741824,null):(b=S.children,l=S.fallback,A?(S=u.mode,A=u.child,b={mode:"hidden",children:b},(S&1)===0&&A!==null?(A.childLanes=0,A.pendingProps=b):A=Rh(b,S,0,null),l=aa(l,S,m,null),A.return=u,l.return=u,A.sibling=l,u.child=A,u.child.memoizedState=ch(m),u.memoizedState=uh,l):rv(u,b));if(b=l.memoizedState,b!==null){if(K=b.dehydrated,K!==null){if(V)return u.flags&256?(u.flags&=-257,fh(l,u,m,Error(o(422)))):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(A=S.fallback,b=u.mode,S=Rh({mode:"visible",children:S.children},b,0,null),A=aa(A,b,m,null),A.flags|=2,S.return=u,A.return=u,S.sibling=A,u.child=S,(u.mode&1)!==0&&xl(u,l.child,null,m),u.child.memoizedState=ch(m),u.memoizedState=uh,A);if((u.mode&1)===0)u=fh(l,u,m,null);else if(Qu(K))u=fh(l,u,m,Error(o(419)));else if(S=(m&l.childLanes)!==0,kr||S){if(S=Sn,S!==null){switch(m&-m){case 4:A=2;break;case 16:A=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:A=32;break;case 536870912:A=268435456;break;default:A=0}S=(A&(S.suspendedLanes|m))!==0?0:A,S!==0&&S!==b.retryLane&&(b.retryLane=S,li(l,S,-1))}Mv(),u=fh(l,u,m,Error(o(421)))}else Wi(K)?(u.flags|=128,u.child=l.child,u=$D.bind(null,l),B(K,u),u=null):(m=b.treeContext,ne&&(Or=xe(K),Dr=u,nn=!0,Ti=null,ec=!1,m!==null&&(ii[si++]=bs,ii[si++]=Es,ii[si++]=Jo,bs=m.id,Es=m.overflow,Jo=u)),u=rv(u,u.pendingProps.children),u.flags|=4096);return u}return A?(S=wM(l,u,S.children,S.fallback,m),A=u.child,b=l.child.memoizedState,A.memoizedState=b===null?ch(m):{baseLanes:b.baseLanes|m,cachePool:null},A.childLanes=l.childLanes&~m,u.memoizedState=uh,S):(m=SM(l,u,S.children,m),u.memoizedState=null,m)}return A?(S=wM(l,u,S.children,S.fallback,m),A=u.child,b=l.child.memoizedState,A.memoizedState=b===null?ch(m):{baseLanes:b.baseLanes|m,cachePool:null},A.childLanes=l.childLanes&~m,u.memoizedState=uh,S):(m=SM(l,u,S.children,m),u.memoizedState=null,m)}function rv(l,u){return u=Rh({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function SM(l,u,m,S){var b=l.child;return l=b.sibling,m=ao(b,{mode:"visible",children:m}),(u.mode&1)===0&&(m.lanes=S),m.return=u,m.sibling=null,l!==null&&(S=u.deletions,S===null?(u.deletions=[l],u.flags|=16):S.push(l)),u.child=m}function wM(l,u,m,S,b){var A=u.mode;l=l.child;var V=l.sibling,K={mode:"hidden",children:m};return(A&1)===0&&u.child!==l?(m=u.child,m.childLanes=0,m.pendingProps=K,u.deletions=null):(m=ao(l,K),m.subtreeFlags=l.subtreeFlags&14680064),V!==null?S=ao(V,S):(S=aa(S,A,b,null),S.flags|=2),S.return=u,m.return=u,m.sibling=S,u.child=m,S}function fh(l,u,m,S){return S!==null&&G0(S),xl(u,l.child,null,m),l=rv(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function MM(l,u,m){l.lanes|=u;var S=l.alternate;S!==null&&(S.lanes|=u),D0(l.return,u,m)}function iv(l,u,m,S,b){var A=l.memoizedState;A===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:S,tail:m,tailMode:b}:(A.isBackwards=u,A.rendering=null,A.renderingStartTime=0,A.last=S,A.tail=m,A.tailMode=b)}function bM(l,u,m){var S=u.pendingProps,b=S.revealOrder,A=S.tail;if(ur(l,u,S.children,m),S=an.current,(S&2)!==0)S=S&1|2,u.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&MM(l,m,u);else if(l.tag===19)MM(l,m,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}S&=1}if(Rt(an,S),(u.mode&1)===0)u.memoizedState=null;else switch(b){case"forwards":for(m=u.child,b=null;m!==null;)l=m.alternate,l!==null&&Jd(l)===null&&(b=m),m=m.sibling;m=b,m===null?(b=u.child,u.child=null):(b=m.sibling,m.sibling=null),iv(u,!1,b,m,A);break;case"backwards":for(m=null,b=u.child,u.child=null;b!==null;){if(l=b.alternate,l!==null&&Jd(l)===null){u.child=b;break}l=b.sibling,b.sibling=m,m=b,b=l}iv(u,!0,m,null,A);break;case"together":iv(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Cs(l,u,m){if(l!==null&&(u.dependencies=l.dependencies),El|=u.lanes,(m&u.childLanes)===0)return null;if(l!==null&&u.child!==l.child)throw Error(o(153));if(u.child!==null){for(l=u.child,m=ao(l,l.pendingProps),u.child=m,m.return=u;l.sibling!==null;)l=l.sibling,m=m.sibling=ao(l,l.pendingProps),m.return=u;m.sibling=null}return u.child}function ND(l,u,m){switch(u.tag){case 3:yM(u),_l();break;case 5:Bw(u);break;case 1:xr(u.type)&&Fd(u);break;case 4:H0(u,u.stateNode.containerInfo);break;case 10:Ew(u,u.type._context,u.memoizedProps.value);break;case 13:var S=u.memoizedState;if(S!==null)return S.dehydrated!==null?(Rt(an,an.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?xM(l,u,m):(Rt(an,an.current&1),l=Cs(l,u,m),l!==null?l.sibling:null);Rt(an,an.current&1);break;case 19:if(S=(m&u.childLanes)!==0,(l.flags&128)!==0){if(S)return bM(l,u,m);u.flags|=128}var b=u.memoizedState;if(b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),Rt(an,an.current),S)break;return null;case 22:case 23:return u.lanes=0,mM(l,u,m)}return Cs(l,u,m)}function DD(l,u){switch(U0(u),u.tag){case 1:return xr(u.type)&&zd(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return wl(),mt(On),mt(Bt),j0(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return W0(u),null;case 13:if(mt(an),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(o(340));_l()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return mt(an),null;case 4:return wl(),null;case 10:return N0(u.type._context),null;case 22:case 23:return wv(),null;case 24:return null;default:return null}}var dh=!1,na=!1,OD=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function hh(l,u){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(S){Mr(l,u,S)}else m.current=null}function sv(l,u,m){try{m()}catch(S){Mr(l,u,S)}}var EM=!1;function kD(l,u){for(F(l.containerInfo),Fe=u;Fe!==null;)if(l=Fe,u=l.child,(l.subtreeFlags&1028)!==0&&u!==null)u.return=l,Fe=u;else for(;Fe!==null;){l=Fe;try{var m=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var S=m.memoizedProps,b=m.memoizedState,A=l.stateNode,V=A.getSnapshotBeforeUpdate(l.elementType===l.type?S:Ei(l.type,S),b);A.__reactInternalSnapshotBeforeUpdate=V}break;case 3:He&&Ae(l.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(K){Mr(l,l.return,K)}if(u=l.sibling,u!==null){u.return=l.return,Fe=u;break}Fe=l.return}return m=EM,EM=!1,m}function ra(l,u,m){var S=u.updateQueue;if(S=S!==null?S.lastEffect:null,S!==null){var b=S=S.next;do{if((b.tag&l)===l){var A=b.destroy;b.destroy=void 0,A!==void 0&&sv(u,m,A)}b=b.next}while(b!==S)}}function dc(l,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var m=u=u.next;do{if((m.tag&l)===l){var S=m.create;m.destroy=S()}m=m.next}while(m!==u)}}function ov(l){var u=l.ref;if(u!==null){var m=l.stateNode;switch(l.tag){case 5:l=le(m);break;default:l=m}typeof u=="function"?u(l):u.current=l}}function TM(l,u,m){if(ji&&typeof ji.onCommitFiberUnmount=="function")try{ji.onCommitFiberUnmount(Gd,u)}catch{}switch(u.tag){case 0:case 11:case 14:case 15:if(l=u.updateQueue,l!==null&&(l=l.lastEffect,l!==null)){var S=l=l.next;do{var b=S,A=b.destroy;b=b.tag,A!==void 0&&((b&2)!==0||(b&4)!==0)&&sv(u,m,A),S=S.next}while(S!==l)}break;case 1:if(hh(u,m),l=u.stateNode,typeof l.componentWillUnmount=="function")try{l.props=u.memoizedProps,l.state=u.memoizedState,l.componentWillUnmount()}catch(V){Mr(u,m,V)}break;case 5:hh(u,m);break;case 4:He?IM(l,u,m):ue&&ue&&(u=u.stateNode.containerInfo,m=Ye(u),Ft(u,m))}}function CM(l,u,m){for(var S=u;;)if(TM(l,S,m),S.child===null||He&&S.tag===4){if(S===u)break;for(;S.sibling===null;){if(S.return===null||S.return===u)return;S=S.return}S.sibling.return=S.return,S=S.sibling}else S.child.return=S,S=S.child}function AM(l){var u=l.alternate;u!==null&&(l.alternate=null,AM(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&qe(u)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function PM(l){return l.tag===5||l.tag===3||l.tag===4}function RM(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||PM(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function LM(l){if(He){e:{for(var u=l.return;u!==null;){if(PM(u))break e;u=u.return}throw Error(o(160))}var m=u;switch(m.tag){case 5:u=m.stateNode,m.flags&32&&(U(u),m.flags&=-33),m=RM(l),lv(l,m,u);break;case 3:case 4:u=m.stateNode.containerInfo,m=RM(l),av(l,m,u);break;default:throw Error(o(161))}}}function av(l,u,m){var S=l.tag;if(S===5||S===6)l=l.stateNode,u?it(m,l,u):Be(m,l);else if(S!==4&&(l=l.child,l!==null))for(av(l,u,m),l=l.sibling;l!==null;)av(l,u,m),l=l.sibling}function lv(l,u,m){var S=l.tag;if(S===5||S===6)l=l.stateNode,u?Ze(m,l,u):st(m,l);else if(S!==4&&(l=l.child,l!==null))for(lv(l,u,m),l=l.sibling;l!==null;)lv(l,u,m),l=l.sibling}function IM(l,u,m){for(var S=u,b=!1,A,V;;){if(!b){b=S.return;e:for(;;){if(b===null)throw Error(o(160));switch(A=b.stateNode,b.tag){case 5:V=!1;break e;case 3:A=A.containerInfo,V=!0;break e;case 4:A=A.containerInfo,V=!0;break e}b=b.return}b=!0}if(S.tag===5||S.tag===6)CM(l,S,m),V?j(A,S.stateNode):Q(A,S.stateNode);else if(S.tag===18)V?en(A,S.stateNode):Pt(A,S.stateNode);else if(S.tag===4){if(S.child!==null){A=S.stateNode.containerInfo,V=!0,S.child.return=S,S=S.child;continue}}else if(TM(l,S,m),S.child!==null){S.child.return=S,S=S.child;continue}if(S===u)break;for(;S.sibling===null;){if(S.return===null||S.return===u)return;S=S.return,S.tag===4&&(b=!1)}S.sibling.return=S.return,S=S.sibling}}function uv(l,u){if(He){switch(u.tag){case 0:case 11:case 14:case 15:ra(3,u,u.return),dc(3,u),ra(5,u,u.return);return;case 1:return;case 5:var m=u.stateNode;if(m!=null){var S=u.memoizedProps;l=l!==null?l.memoizedProps:S;var b=u.type,A=u.updateQueue;u.updateQueue=null,A!==null&&ot(m,A,b,l,S,u)}return;case 6:if(u.stateNode===null)throw Error(o(162));m=u.memoizedProps,Se(u.stateNode,l!==null?l.memoizedProps:m,m);return;case 3:ne&&l!==null&&l.memoizedState.isDehydrated&&Dt(u.stateNode.containerInfo);return;case 12:return;case 13:ph(u);return;case 19:ph(u);return;case 17:return}throw Error(o(163))}switch(u.tag){case 0:case 11:case 14:case 15:ra(3,u,u.return),dc(3,u),ra(5,u,u.return);return;case 12:return;case 13:ph(u);return;case 19:ph(u);return;case 3:ne&&l!==null&&l.memoizedState.isDehydrated&&Dt(u.stateNode.containerInfo);break;case 22:case 23:return}e:if(ue){switch(u.tag){case 1:case 5:case 6:break e;case 3:case 4:u=u.stateNode,Ft(u.containerInfo,u.pendingChildren);break e}throw Error(o(163))}}function ph(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new OD),u.forEach(function(S){var b=jD.bind(null,l,S);m.has(S)||(m.add(S),S.then(b,b))})}}function zD(l,u){for(Fe=u;Fe!==null;){u=Fe;var m=u.deletions;if(m!==null)for(var S=0;S";case gh:return":has("+(dv(l)||"")+")";case vh:return'[role="'+l.value+'"]';case _h:return'"'+l.value+'"';case yh:return'[data-testname="'+l.value+'"]';default:throw Error(o(365))}}function zM(l,u){var m=[];l=[l,0];for(var S=0;Sb&&(b=V),S&=~A}if(S=b,S=kn()-S,S=(120>S?120:480>S?480:1080>S?1080:1920>S?1920:3e3>S?3e3:4320>S?4320:1960*UD(S/1960))-S,10l?16:l,io===null)var S=!1;else{if(l=io,io=null,bh=0,(xt&6)!==0)throw Error(o(331));var b=xt;for(xt|=4,Fe=l.current;Fe!==null;){var A=Fe,V=A.child;if((Fe.flags&16)!==0){var K=A.deletions;if(K!==null){for(var ge=0;gekn()-gv?ia(l,0):mv|=m),wr(l,u)}function jM(l,u){u===0&&((l.mode&1)===0?u=1:(u=Bd,Bd<<=1,(Bd&130023424)===0&&(Bd=4194304)));var m=cr();l=Ch(l,u),l!==null&&(Ju(l,u,m),wr(l,m))}function $D(l){var u=l.memoizedState,m=0;u!==null&&(m=u.retryLane),jM(l,m)}function jD(l,u){var m=0;switch(l.tag){case 13:var S=l.stateNode,b=l.memoizedState;b!==null&&(m=b.retryLane);break;case 19:S=l.stateNode;break;default:throw Error(o(314))}S!==null&&S.delete(u),jM(l,m)}var XM;XM=function(l,u,m){if(l!==null)if(l.memoizedProps!==u.pendingProps||On.current)kr=!0;else{if((l.lanes&m)===0&&(u.flags&128)===0)return kr=!1,ND(l,u,m);kr=(l.flags&131072)!==0}else kr=!1,nn&&(u.flags&1048576)!==0&&Nw(u,Qd,u.index);switch(u.lanes=0,u.tag){case 2:var S=u.type;l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2),l=u.pendingProps;var b=Ss(u,Bt.current);gl(u,m),b=Y0(null,u,S,l,b,m);var A=q0();return u.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,xr(S)?(A=!0,Fd(u)):A=!1,u.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,O0(u),b.updater=qd,u.stateNode=b,b._reactInternals=u,z0(u,S,l,m),u=nv(null,u,S,!0,A,m)):(u.tag=0,nn&&A&&F0(u),ur(null,u,b,m),u=u.child),u;case 16:S=u.elementType;e:{switch(l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2),l=u.pendingProps,b=S._init,S=b(S._payload),u.type=S,b=u.tag=YD(S),l=Ei(S,l),b){case 0:u=tv(null,u,S,l,m);break e;case 1:u=vM(null,u,S,l,m);break e;case 11:u=dM(null,u,S,l,m);break e;case 14:u=hM(null,u,S,Ei(S.type,l),m);break e}throw Error(o(306,S,""))}return u;case 0:return S=u.type,b=u.pendingProps,b=u.elementType===S?b:Ei(S,b),tv(l,u,S,b,m);case 1:return S=u.type,b=u.pendingProps,b=u.elementType===S?b:Ei(S,b),vM(l,u,S,b,m);case 3:e:{if(yM(u),l===null)throw Error(o(387));S=u.pendingProps,A=u.memoizedState,b=A.element,Tw(l,u),Yd(u,S,null,m);var V=u.memoizedState;if(S=V.element,ne&&A.isDehydrated)if(A={element:S,isDehydrated:!1,cache:V.cache,transitions:V.transitions},u.updateQueue.baseState=A,u.memoizedState=A,u.flags&256){b=Error(o(423)),u=_M(l,u,S,m,b);break e}else if(S!==b){b=Error(o(424)),u=_M(l,u,S,m,b);break e}else for(ne&&(Or=re(u.stateNode.containerInfo),Dr=u,nn=!0,Ti=null,ec=!1),m=Uw(u,null,S,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(_l(),S===b){u=Cs(l,u,m);break e}ur(l,u,S,m)}u=u.child}return u;case 5:return Bw(u),l===null&&V0(u),S=u.type,b=u.pendingProps,A=l!==null?l.memoizedProps:null,V=b.children,me(S,b)?V=null:A!==null&&me(S,A)&&(u.flags|=32),gM(l,u),ur(l,u,V,m),u.child;case 6:return l===null&&V0(u),null;case 13:return xM(l,u,m);case 4:return H0(u,u.stateNode.containerInfo),S=u.pendingProps,l===null?u.child=xl(u,null,S,m):ur(l,u,S,m),u.child;case 11:return S=u.type,b=u.pendingProps,b=u.elementType===S?b:Ei(S,b),dM(l,u,S,b,m);case 7:return ur(l,u,u.pendingProps,m),u.child;case 8:return ur(l,u,u.pendingProps.children,m),u.child;case 12:return ur(l,u,u.pendingProps.children,m),u.child;case 10:e:{if(S=u.type._context,b=u.pendingProps,A=u.memoizedProps,V=b.value,Ew(u,S,V),A!==null)if(Xi(A.value,V)){if(A.children===b.children&&!On.current){u=Cs(l,u,m);break e}}else for(A=u.child,A!==null&&(A.return=u);A!==null;){var K=A.dependencies;if(K!==null){V=A.child;for(var ge=K.firstContext;ge!==null;){if(ge.context===S){if(A.tag===1){ge=Ms(-1,m&-m),ge.tag=2;var Ie=A.updateQueue;if(Ie!==null){Ie=Ie.shared;var je=Ie.pending;je===null?ge.next=ge:(ge.next=je.next,je.next=ge),Ie.pending=ge}}A.lanes|=m,ge=A.alternate,ge!==null&&(ge.lanes|=m),D0(A.return,m,u),K.lanes|=m;break}ge=ge.next}}else if(A.tag===10)V=A.type===u.type?null:A.child;else if(A.tag===18){if(V=A.return,V===null)throw Error(o(341));V.lanes|=m,K=V.alternate,K!==null&&(K.lanes|=m),D0(V,m,u),V=A.sibling}else V=A.child;if(V!==null)V.return=A;else for(V=A;V!==null;){if(V===u){V=null;break}if(A=V.sibling,A!==null){A.return=V.return,V=A;break}V=V.return}A=V}ur(l,u,b.children,m),u=u.child}return u;case 9:return b=u.type,S=u.pendingProps.children,gl(u,m),b=ri(b),S=S(b),u.flags|=1,ur(l,u,S,m),u.child;case 14:return S=u.type,b=Ei(S,u.pendingProps),b=Ei(S.type,b),hM(l,u,S,b,m);case 15:return pM(l,u,u.type,u.pendingProps,m);case 17:return S=u.type,b=u.pendingProps,b=u.elementType===S?b:Ei(S,b),l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2),u.tag=1,xr(S)?(l=!0,Fd(u)):l=!1,gl(u,m),Lw(u,S,b),z0(u,S,b,m),nv(null,u,S,!0,l,m);case 19:return bM(l,u,m);case 22:return mM(l,u,m)}throw Error(o(156,u.tag))};function YM(l,u){return C0(l,u)}function XD(l,u,m,S){this.tag=l,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ui(l,u,m,S){return new XD(l,u,m,S)}function bv(l){return l=l.prototype,!(!l||!l.isReactComponent)}function YD(l){if(typeof l=="function")return bv(l)?1:0;if(l!=null){if(l=l.$$typeof,l===y)return 11;if(l===_)return 14}return 2}function ao(l,u){var m=l.alternate;return m===null?(m=ui(l.tag,u,l.key,l.mode),m.elementType=l.elementType,m.type=l.type,m.stateNode=l.stateNode,m.alternate=l,l.alternate=m):(m.pendingProps=u,m.type=l.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=l.flags&14680064,m.childLanes=l.childLanes,m.lanes=l.lanes,m.child=l.child,m.memoizedProps=l.memoizedProps,m.memoizedState=l.memoizedState,m.updateQueue=l.updateQueue,u=l.dependencies,m.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},m.sibling=l.sibling,m.index=l.index,m.ref=l.ref,m}function Ph(l,u,m,S,b,A){var V=2;if(S=l,typeof l=="function")bv(l)&&(V=1);else if(typeof l=="string")V=5;else e:switch(l){case d:return aa(m.children,b,A,u);case h:V=8,b|=8;break;case p:return l=ui(12,m,u,b|2),l.elementType=p,l.lanes=A,l;case x:return l=ui(13,m,u,b),l.elementType=x,l.lanes=A,l;case w:return l=ui(19,m,u,b),l.elementType=w,l.lanes=A,l;case E:return Rh(m,b,A,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case g:V=10;break e;case v:V=9;break e;case y:V=11;break e;case _:V=14;break e;case M:V=16,S=null;break e}throw Error(o(130,l==null?l:typeof l,""))}return u=ui(V,m,u,b),u.elementType=l,u.type=S,u.lanes=A,u}function aa(l,u,m,S){return l=ui(7,l,S,u),l.lanes=m,l}function Rh(l,u,m,S){return l=ui(22,l,S,u),l.elementType=E,l.lanes=m,l.stateNode={},l}function Ev(l,u,m){return l=ui(6,l,null,u),l.lanes=m,l}function Tv(l,u,m){return u=ui(4,l.children!==null?l.children:[],l.key,u),u.lanes=m,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function qD(l,u,m,S,b){this.tag=u,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=we,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=E0(0),this.expirationTimes=E0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=E0(0),this.identifierPrefix=S,this.onRecoverableError=b,ne&&(this.mutableSourceEagerHydrationData=null)}function qM(l,u,m,S,b,A,V,K,ge){return l=new qD(l,u,m,K,ge),u===1?(u=1,A===!0&&(u|=8)):u=0,A=ui(3,null,null,u),l.current=A,A.stateNode=l,A.memoizedState={element:S,isDehydrated:m,cache:null,transitions:null},O0(A),l}function ZM(l){if(!l)return ni;l=l._reactInternals;e:{if(L(l)!==l||l.tag!==1)throw Error(o(170));var u=l;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(xr(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(o(171))}if(l.tag===1){var m=l.type;if(xr(m))return xw(l,m,u)}return u}function QM(l){var u=l._reactInternals;if(u===void 0)throw typeof l.render=="function"?Error(o(188)):(l=Object.keys(l).join(","),Error(o(268,l)));return l=fe(u),l===null?null:l.stateNode}function KM(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m=Ie&&A>=ct&&b<=je&&V<=rt){l.splice(u,1);break}else if(S!==Ie||m.width!==ge.width||rtV){if(!(A!==ct||m.height!==ge.height||jeb)){Ie>S&&(ge.width+=Ie-S,ge.x=S),jeA&&(ge.height+=ct-A,ge.y=A),rtm&&(m=V)),V ")+` + +No matching component was found for: + `)+l.join(" > ")}return null},t.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return le(l.child.stateNode);default:return l.child.stateNode}},t.injectIntoDevTools=function(l){if(l={bundleType:l.bundleType,version:l.version,rendererPackageName:l.rendererPackageName,rendererConfig:l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:ZD,findFiberByHostInstance:l.findFiberByHostInstance||QD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined")l=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)l=!0;else{try{Gd=u.inject(l),ji=u}catch{}l=!!u.checkDCE}}return l},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(l,u,m,S){if(!Ct)throw Error(o(363));l=hv(l,u);var b=ze(l,m,S).disconnect;return{disconnect:function(){b()}}},t.registerMutableSourceForHydration=function(l,u){var m=u._getVersion;m=m(u._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[u,m]:l.mutableSourceEagerHydrationData.push(u,m)},t.runWithPriority=function(l,u){var m=Ot;try{return Ot=l,u()}finally{Ot=m}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(l,u,m,S){var b=u.current,A=cr(),V=so(b);return m=ZM(m),u.context===null?u.context=m:u.pendingContext=m,u=Ms(A,V),u.payload={element:l},S=S===void 0?null:S,S!==null&&(u.callback=S),no(b,u),l=li(b,V,A),l!==null&&Xd(l,b,V),V},t};lI.exports=F7;var U7=lI.exports,F2,U2;const cI=n=>n&&n.isOrthographicCamera,B7=n=>n&&n.hasOwnProperty("current"),Ad=typeof window!="undefined"&&((F2=window.document)!=null&&F2.createElement||((U2=window.navigator)==null?void 0:U2.product)==="ReactNative")?te.exports.useLayoutEffect:te.exports.useEffect;function fI(n){const e=te.exports.useRef(n);return Ad(()=>void(e.current=n),[n]),e}function V7({set:n}){return Ad(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class dI extends te.exports.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}dI.getDerivedStateFromError=()=>({error:!0});const hI="__default",G7=n=>n&&!!n.memoized&&!!n.changes;function pI(n){const e=typeof window!="undefined"?window.devicePixelRatio:1;return Array.isArray(n)?Math.min(Math.max(n[0],e),n[1]):n}const Uc=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},gn={obj:n=>n===Object(n)&&!gn.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:r="reference",strict:i=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(gn.str(n)||gn.num(n))return n===e;const s=gn.obj(n);if(s&&r==="reference")return n===e;const o=gn.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 i?e:n)if(n[a]!==e[a])return!1;if(gn.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 H7(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function ql(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 Gx(n,e){let t=n;if(e.includes("-")){const r=e.split("-"),i=r.pop();return t=r.reduce((s,o)=>s[o],n),{target:t,key:i}}else return{target:t,key:e}}const B2=/-\d+$/;function Gy(n,e,t){if(gn.str(t)){if(B2.test(t)){const s=t.replace(B2,""),{target:o,key:a}=Gx(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:r,key:i}=Gx(n,t);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=t(n,e)}function V2(n,e,t){var r,i;if(gn.str(t)){const{target:s,key:o}=Gx(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(i=e.__r3f)==null||delete i.previousAttach}function mI(n,{children:e,key:t,ref:r,...i},{children:s,key:o,ref:a,...c}={},f=!1){var d;const h=(d=n==null?void 0:n.__r3f)!=null?d:{},p=Object.entries(i),g=[];if(f){const y=Object.keys(c);for(let x=0;x{var w;if((w=n.__r3f)!=null&&w.primitive&&y==="object"||gn.equ(x,c[y]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(y))return g.push([y,x,!0,[]]);let _=[];y.includes("-")&&(_=y.split("-")),g.push([y,x,!1,_]);for(const M in i){const E=i[M];M.startsWith(`${y}-`)&&g.push([M,E,!1,M.split("-")])}});const v={...i};return h.memoizedProps&&h.memoizedProps.args&&(v.args=h.memoizedProps.args),h.memoizedProps&&h.memoizedProps.attach&&(v.attach=h.memoizedProps.attach),{memoized:v,changes:g}}function Hy(n,e){var t,r,i;const s=(t=n.__r3f)!=null?t:{},o=s.root,a=(r=o==null||o.getState==null?void 0:o.getState())!=null?r:{},{memoized:c,changes:f}=G7(e)?e:mI(n,e),d=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=c);for(let g=0;gE[C],n),!(M&&M.set))){const[E,...C]=w.reverse();_=C.reverse().reduce((P,R)=>P[R],n),v=E}if(y===hI+"remove")if(M&&M.constructor){var h;y=new M.constructor(...(h=c.args)!=null?h:[])}else if(_.constructor){var p;const E=new _.constructor(...(p=_.__r3f.memoizedProps.args)!=null?p:[]);y=E[M],E.dispose&&E.dispose()}else y=0;if(x)y?s.handlers[v]=y:delete s.handlers[v],s.eventCount=Object.keys(s.handlers).length;else if(M&&M.set&&(M.copy||M instanceof Va)){if(Array.isArray(y))M.fromArray?M.fromArray(y):M.set(...y);else if(M.copy&&y&&y.constructor&&M.constructor.name===y.constructor.name)M.copy(y);else if(y!==void 0){const E=M instanceof Ge;!E&&M.setScalar?M.setScalar(y):M instanceof Va&&y instanceof Va?M.mask=y.mask:M.set(y),!("ColorManagement"in lg)&&!a.linear&&E&&M.convertSRGBToLinear()}}else _[v]=y,!a.linear&&_[v]instanceof Cn&&(_[v].encoding=Kt);Zl(n)}if(s.parent&&a.internal&&n.raycast&&d!==s.eventCount){const g=a.internal.interaction.indexOf(n);g>-1&&a.internal.interaction.splice(g,1),s.eventCount&&a.internal.interaction.push(n)}return f.length&&(i=n.__r3f)!=null&&i.parent&&Hx(n),n}function Zl(n){var e,t;const r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function Hx(n){n.onUpdate==null||n.onUpdate(n)}function W7(n,e){n.manual||(cI(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 $7(n,e,t){const r=t.pop(),i=t.reduce((s,o)=>s[o],n);return i[r]=e}function zp(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function j7(){var n;const e=typeof self!="undefined"&&self||typeof window!="undefined"&&window;if(!e)return Ia.exports.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Ia.exports.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Ia.exports.ContinuousEventPriority;default:return Ia.exports.DefaultEventPriority}}function gI(n,e,t,r){const i=t.get(e);i&&(t.delete(e),t.size===0&&(n.delete(r),i.target.releasePointerCapture(r)))}function X7(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(r=>r!==e),t.initialHits=t.initialHits.filter(r=>r!==e),t.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&t.hovered.delete(i)}),t.capturedMap.forEach((r,i)=>{gI(t.capturedMap,e,r,i)})}function Y7(n){function e(c){const{internal:f}=n.getState(),d=c.offsetX-f.initialClick[0],h=c.offsetY-f.initialClick[1];return Math.round(Math.sqrt(d*d+h*h))}function t(c){return c.filter(f=>["Move","Over","Enter","Out","Leave"].some(d=>{var h;return(h=f.__r3f)==null?void 0:h.handlers["onPointer"+d]}))}function r(c,f){const d=n.getState(),h=new Set,p=[],g=f?f(d.internal.interaction):d.internal.interaction;for(let w=0;w{const M=Uc(w.object),E=Uc(_.object);return!M||!E?w.distance-_.distance:E.events.priority-M.events.priority||w.distance-_.distance}).filter(w=>{const _=zp(w);return h.has(_)?!1:(h.add(_),!0)});d.events.filter&&(y=d.events.filter(y,d));for(const w of y){let _=w.object;for(;_;){var x;(x=_.__r3f)!=null&&x.eventCount&&p.push({...w,eventObject:_}),_=_.parent}}if("pointerId"in c&&d.internal.capturedMap.has(c.pointerId))for(let w of d.internal.capturedMap.get(c.pointerId).values())h.has(zp(w.intersection))||p.push(w.intersection);return p}function i(c,f,d,h){const p=n.getState();if(c.length){const g={stopped:!1};for(const v of c){const y=Uc(v.object)||p,{raycaster:x,pointer:w,camera:_,internal:M}=y,E=new I(w.x,w.y,0).unproject(_),C=D=>{var Y,fe;return(Y=(fe=M.capturedMap.get(D))==null?void 0:fe.has(v.eventObject))!=null?Y:!1},P=D=>{const Y={intersection:v,target:f.target};M.capturedMap.has(D)?M.capturedMap.get(D).set(v.eventObject,Y):M.capturedMap.set(D,new Map([[v.eventObject,Y]])),f.target.setPointerCapture(D)},R=D=>{const Y=M.capturedMap.get(D);Y&&gI(M.capturedMap,v.eventObject,Y,D)};let T={};for(let D in f){let Y=f[D];typeof Y!="function"&&(T[D]=Y)}let L={...v,...T,pointer:w,intersections:c,stopped:g.stopped,delta:d,unprojectedPoint:E,ray:x.ray,camera:_,stopPropagation(){const D="pointerId"in f&&M.capturedMap.get(f.pointerId);if((!D||D.has(v.eventObject))&&(L.stopped=g.stopped=!0,M.hovered.size&&Array.from(M.hovered.values()).find(Y=>Y.eventObject===v.eventObject))){const Y=c.slice(0,c.indexOf(v));s([...Y,v])}},target:{hasPointerCapture:C,setPointerCapture:P,releasePointerCapture:R},currentTarget:{hasPointerCapture:C,setPointerCapture:P,releasePointerCapture:R},nativeEvent:f};if(h(L),g.stopped===!0)break}}return c}function s(c){const{internal:f}=n.getState();for(const d of f.hovered.values())if(!c.length||!c.find(h=>h.object===d.object&&h.index===d.index&&h.instanceId===d.instanceId)){const p=d.eventObject.__r3f,g=p==null?void 0:p.handlers;if(f.hovered.delete(zp(d)),p!=null&&p.eventCount){const v={...d,intersections:c};g.onPointerOut==null||g.onPointerOut(v),g.onPointerLeave==null||g.onPointerLeave(v)}}}function o(c,f){for(let d=0;ds([]);case"onLostPointerCapture":return f=>{const{internal:d}=n.getState();"pointerId"in f&&d.capturedMap.has(f.pointerId)&&(d.capturedMap.delete(f.pointerId),s([]))}}return function(d){const{onPointerMissed:h,internal:p}=n.getState();p.lastEvent.current=d;const g=c==="onPointerMove",v=c==="onClick"||c==="onContextMenu"||c==="onDoubleClick",x=r(d,g?t:void 0),w=v?e(d):0;c==="onPointerDown"&&(p.initialClick=[d.offsetX,d.offsetY],p.initialHits=x.map(M=>M.eventObject)),v&&!x.length&&w<=2&&(o(d,p.interaction),h&&h(d)),g&&s(x);function _(M){const E=M.eventObject,C=E.__r3f,P=C==null?void 0:C.handlers;if(!!(C!=null&&C.eventCount))if(g){if(P.onPointerOver||P.onPointerEnter||P.onPointerOut||P.onPointerLeave){const R=zp(M),T=p.hovered.get(R);T?T.stopped&&M.stopPropagation():(p.hovered.set(R,M),P.onPointerOver==null||P.onPointerOver(M),P.onPointerEnter==null||P.onPointerEnter(M))}P.onPointerMove==null||P.onPointerMove(M)}else{const R=P[c];R?(!v||p.initialHits.includes(E))&&(o(d,p.interaction.filter(T=>!p.initialHits.includes(T))),R(M)):v&&p.initialHits.includes(E)&&o(d,p.interaction.filter(T=>!p.initialHits.includes(T)))}}i(x,d,w,_)}}return{handlePointer:a}}let Wx={},q7=n=>void(Wx={...Wx,...n});function Z7(n,e){function t(d,{args:h=[],attach:p,...g},v){let y=`${d[0].toUpperCase()}${d.slice(1)}`,x;if(d==="primitive"){if(g.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const w=g.object;x=ql(w,{type:d,root:v,attach:p,primitive:!0})}else{const w=Wx[y];if(!w)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(h))throw new Error("R3F: The args prop must be an array!");x=ql(new w(...h),{type:d,root:v,attach:p,memoizedProps:{args:h}})}return x.__r3f.attach===void 0&&(x instanceof ht?x.__r3f.attach="geometry":x instanceof qn&&(x.__r3f.attach="material")),y!=="inject"&&Hy(x,g),x}function r(d,h){let p=!1;if(h){var g,v;(g=h.__r3f)!=null&&g.attach?Gy(d,h,h.__r3f.attach):h.isObject3D&&d.isObject3D&&(d.add(h),p=!0),p||(v=d.__r3f)==null||v.objects.push(h),h.__r3f||ql(h,{}),h.__r3f.parent=d,Hx(h),Zl(h)}}function i(d,h,p){let g=!1;if(h){var v,y;if((v=h.__r3f)!=null&&v.attach)Gy(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){h.parent=d,h.dispatchEvent({type:"added"});const x=d.children.filter(_=>_!==h),w=x.indexOf(p);d.children=[...x.slice(0,w),h,...x.slice(w)],g=!0}g||(y=d.__r3f)==null||y.objects.push(h),h.__r3f||ql(h,{}),h.__r3f.parent=d,Hx(h),Zl(h)}}function s(d,h,p=!1){d&&[...d].forEach(g=>o(h,g,p))}function o(d,h,p){if(h){var g,v,y;if(h.__r3f&&(h.__r3f.parent=null),(g=d.__r3f)!=null&&g.objects&&(d.__r3f.objects=d.__r3f.objects.filter(E=>E!==h)),(v=h.__r3f)!=null&&v.attach)V2(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){var x;d.remove(h),(x=h.__r3f)!=null&&x.root&&X7(h.__r3f.root,h)}const _=(y=h.__r3f)==null?void 0:y.primitive,M=p===void 0?h.dispose!==null&&!_:p;if(!_){var w;s((w=h.__r3f)==null?void 0:w.objects,h,M),s(h.children,h,M)}h.__r3f&&(delete h.__r3f.root,delete h.__r3f.objects,delete h.__r3f.handlers,delete h.__r3f.memoizedProps,_||delete h.__r3f),M&&h.dispose&&h.type!=="Scene"&&ug.exports.unstable_scheduleCallback(ug.exports.unstable_IdlePriority,()=>{try{h.dispose()}catch{}}),Zl(d)}}function a(d,h,p,g){var v;const y=(v=d.__r3f)==null?void 0:v.parent;if(!y)return;const x=t(h,p,d.__r3f.root);if(d.children){for(const w of d.children)w.__r3f&&r(x,w);d.children=d.children.filter(w=>!w.__r3f)}d.__r3f.objects.forEach(w=>r(x,w)),d.__r3f.objects=[],d.__r3f.autoRemovedBeforeAppend||o(y,d),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),r(y,x),x.raycast&&x.__r3f.eventCount&&x.__r3f.root.getState().internal.interaction.push(x),[g,g.alternate].forEach(w=>{w!==null&&(w.stateNode=x,w.ref&&(typeof w.ref=="function"?w.ref(x):w.ref.current=x))})}const c=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:U7({createInstance:t,removeChild:o,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(d,h)=>{if(!h)return;const p=d.getState().scene;!p.__r3f||(p.__r3f.root=d,r(p,h))},removeChildFromContainer:(d,h)=>{!h||o(d.getState().scene,h)},insertInContainerBefore:(d,h,p)=>{if(!h||!p)return;const g=d.getState().scene;!g.__r3f||i(g,h,p)},getRootHostContext:()=>null,getChildHostContext:d=>d,finalizeInitialChildren(d){var h;const p=(h=d==null?void 0:d.__r3f)!=null?h:{};return Boolean(p.handlers)},prepareUpdate(d,h,p,g){if(d.__r3f.primitive&&g.object&&g.object!==d)return[!0];{const{args:v=[],children:y,...x}=g,{args:w=[],children:_,...M}=p;if(!Array.isArray(v))throw new Error("R3F: the args prop must be an array!");if(v.some((C,P)=>C!==w[P]))return[!0];const E=mI(d,x,M,!0);return E.changes.length?[!1,E]:null}},commitUpdate(d,[h,p],g,v,y,x){h?a(d,g,y,x):Hy(d,p)},commitMount(d,h,p,g){var v;const y=(v=d.__r3f)!=null?v:{};d.raycast&&y.handlers&&y.eventCount&&d.__r3f.root.getState().internal.interaction.push(d)},getPublicInstance:d=>d,prepareForCommit:()=>null,preparePortalMount:d=>ql(d.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(d){var h;const{attach:p,parent:g}=(h=d.__r3f)!=null?h:{};p&&g&&V2(g,d,p),d.isObject3D&&(d.visible=!1),Zl(d)},unhideInstance(d,h){var p;const{attach:g,parent:v}=(p=d.__r3f)!=null?p:{};g&&v&&Gy(v,d,g),(d.isObject3D&&h.visible==null||h.visible)&&(d.visible=!0),Zl(d)},createTextInstance:c,hideTextInstance:c,unhideTextInstance:c,getCurrentEventPriority:()=>e?e():Ia.exports.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance!="undefined"&&gn.fun(performance.now)?performance.now:gn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:gn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:gn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Hy}}const vI=n=>!!(n!=null&&n.render),yI=te.exports.createContext(null),Q7=(n,e)=>{const t=z7((a,c)=>{const f=new I,d=new I,h=new I;function p(w=c().camera,_=d,M=c().size){const{width:E,height:C,top:P,left:R}=M,T=E/C;_ instanceof I?h.copy(_):h.set(..._);const L=w.getWorldPosition(f).distanceTo(h);if(cI(w))return{width:E/w.zoom,height:C/w.zoom,top:P,left:R,factor:1,distance:L,aspect:T};{const D=w.fov*Math.PI/180,Y=2*Math.tan(D/2)*L,fe=Y*(E/C);return{width:fe,height:Y,top:P,left:R,factor:E/fe,distance:L,aspect:T}}}let g;const v=w=>a(_=>({performance:{..._.performance,current:w}})),y=new Me;return{set:a,get:c,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,invalidate:(w=1)=>n(c(),w),advance:(w,_)=>e(w,_,c()),legacy:!1,linear:!1,flat:!1,scene:ql(new SS),controls:null,clock:new US,pointer:y,mouse:y,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const w=c();g&&clearTimeout(g),w.performance.current!==w.performance.min&&v(w.performance.min),g=setTimeout(()=>v(c().performance.max),w.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:w=>a(_=>({..._,events:{..._.events,...w}})),setSize:(w,_,M,E,C)=>{const P=c().camera,R={width:w,height:_,top:E||0,left:C||0,updateStyle:M};a(T=>({size:R,viewport:{...T.viewport,...p(P,d,R)}}))},setDpr:w=>a(_=>{const M=pI(w);return{viewport:{..._.viewport,dpr:M,initialDpr:_.viewport.initialDpr||M}}}),setFrameloop:(w="always")=>{const _=c().clock;_.stop(),_.elapsedTime=0,w!=="never"&&(_.start(),_.elapsedTime=0),a(()=>({frameloop:w}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:te.exports.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(w,_,M)=>{const E=c().internal;return E.priority=E.priority+(_>0?1:0),E.subscribers.push({ref:w,priority:_,store:M}),E.subscribers=E.subscribers.sort((C,P)=>C.priority-P.priority),()=>{const C=c().internal;C!=null&&C.subscribers&&(C.priority=C.priority-(_>0?1:0),C.subscribers=C.subscribers.filter(P=>P.ref!==w))}}}}}),r=t.getState();let i=r.size,s=r.viewport.dpr,o=r.camera;return t.subscribe(()=>{const{camera:a,size:c,viewport:f,gl:d,set:h}=t.getState();(c!==i||f.dpr!==s)&&(i=c,s=f.dpr,W7(a,c),d.setPixelRatio(f.dpr),d.setSize(c.width,c.height,c.updateStyle)),a!==o&&(o=a,h(p=>({viewport:{...p.viewport,...p.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Fp,K7=new Set,J7=new Set,e$=new Set;function Wy(n,e){if(!!n.size)for(const{callback:t}of n.values())t(e)}function Bc(n,e){switch(n){case"before":return Wy(K7,e);case"after":return Wy(J7,e);case"tail":return Wy(e$,e)}}let $y,jy;function Xy(n,e,t){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(r=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),$y=e.internal.subscribers,Fp=0;Fp<$y.length;Fp++)jy=$y[Fp],jy.ref.current(jy.store.getState(),r,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 t$(n){let e=!1,t,r,i;function s(c){r=requestAnimationFrame(s),e=!0,t=0,Bc("before",c);for(const d of n.values()){var f;i=d.store.getState(),i.internal.active&&(i.frameloop==="always"||i.internal.frames>0)&&!((f=i.gl.xr)!=null&&f.isPresenting)&&(t+=Xy(c,i))}if(Bc("after",c),t===0)return Bc("tail",c),e=!1,cancelAnimationFrame(r)}function o(c,f=1){var d;if(!c)return n.forEach(h=>o(h.store.getState()),f);(d=c.gl.xr)!=null&&d.isPresenting||!c.internal.active||c.frameloop==="never"||(c.internal.frames=Math.min(60,c.internal.frames+f),e||(e=!0,requestAnimationFrame(s)))}function a(c,f=!0,d,h){if(f&&Bc("before",c),d)Xy(c,d,h);else for(const p of n.values())Xy(c,p.store.getState());f&&Bc("after",c)}return{loop:s,invalidate:o,advance:a}}function _I(){const n=te.exports.useContext(yI);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function pi(n=t=>t,e){return _I()(n,e)}function n$(n,e=0){const t=_I(),r=t.getState().internal.subscribe,i=fI(n);return Ad(()=>r(i,e,t),[e,r,t]),null}const Nu=new Map,{invalidate:G2,advance:H2}=t$(Nu),{reconciler:cg,applyProps:Up}=Z7(Nu,j7),Vc={objects:"shallow",strict:!1},r$=(n,e)=>{const t=typeof n=="function"?n(e):n;return vI(t)?t:new xS({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function i$(n){return n instanceof HTMLCanvasElement}function s$(n,e){if(e)return e;if(i$(n)&&n.parentElement){const{width:t,height:r,top:i,left:s}=n.parentElement.getBoundingClientRect();return{width:t,height:r,top:i,left:s}}return{width:0,height:0,top:0,left:0}}function o$(n){const e=Nu.get(n),t=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,s=r||Q7(G2,H2),o=t||cg.createContainer(s,Ia.exports.ConcurrentRoot,null,!1,null,"",i,null);e||Nu.set(n,{fiber:o,store:s});let a,c=!1;return{configure(f={}){let{gl:d,size:h,events:p,onCreated:g,shadows:v=!1,linear:y=!1,flat:x=!1,legacy:w=!1,orthographic:_=!1,frameloop:M="always",dpr:E=[1,2],performance:C,raycaster:P,camera:R,onPointerMissed:T}=f,L=s.getState(),D=L.gl;L.gl||L.set({gl:D=r$(d,n)});let Y=L.raycaster;Y||L.set({raycaster:Y=new HS});const{params:fe,...q}=P||{};if(gn.equ(q,Y,Vc)||Up(Y,{...q}),gn.equ(fe,Y.params,Vc)||Up(Y,{params:{...Y.params,...fe}}),!L.camera){const z=R instanceof hd,F=z?R:_?new md(0,0,0,0,.1,1e3):new Gn(75,0,.1,1e3);z||(F.position.z=5,R&&Up(F,R),R!=null&&R.rotation||F.lookAt(0,0,0)),L.set({camera:F})}if(!L.xr){const z=(Z,k)=>{const W=s.getState();W.frameloop!=="never"&&H2(Z,!0,W,k)},F=()=>{const Z=s.getState();Z.gl.xr.enabled=Z.gl.xr.isPresenting,Z.gl.xr.setAnimationLoop(Z.gl.xr.isPresenting?z:null),Z.gl.xr.isPresenting||G2(Z)},G={connect(){const Z=s.getState().gl;Z.xr.addEventListener("sessionstart",F),Z.xr.addEventListener("sessionend",F)},disconnect(){const Z=s.getState().gl;Z.xr.removeEventListener("sessionstart",F),Z.xr.removeEventListener("sessionend",F)}};D.xr&&G.connect(),L.set({xr:G})}if(D.shadowMap){const z=D.shadowMap.enabled,F=D.shadowMap.type;if(D.shadowMap.enabled=!!v,gn.boo(v))D.shadowMap.type=cf;else if(gn.str(v)){var $;const G={basic:cR,percentage:Bg,soft:cf,variance:Ca};D.shadowMap.type=($=G[v])!=null?$:cf}else gn.obj(v)&&Object.assign(D.shadowMap,v);(z!==D.shadowMap.enabled||F!==D.shadowMap.type)&&(D.shadowMap.needsUpdate=!0)}"ColorManagement"in lg&&$7(lg,w,["ColorManagement","legacyMode"]);const se=y?Xs:Kt,le=x?Ui:lS;D.outputEncoding!==se&&(D.outputEncoding=se),D.toneMapping!==le&&(D.toneMapping=le),L.legacy!==w&&L.set(()=>({legacy:w})),L.linear!==y&&L.set(()=>({linear:y})),L.flat!==x&&L.set(()=>({flat:x})),d&&!gn.fun(d)&&!vI(d)&&!gn.equ(d,D,Vc)&&Up(D,d),p&&!L.events.handlers&&L.set({events:p(s)}),E&&L.viewport.dpr!==pI(E)&&L.setDpr(E);const pe=s$(n,h);return gn.equ(pe,L.size,Vc)||L.setSize(pe.width,pe.height,pe.updateStyle,pe.top,pe.left),L.frameloop!==M&&L.setFrameloop(M),L.onPointerMissed||L.set({onPointerMissed:T}),C&&!gn.equ(C,L.performance,Vc)&&L.set(z=>({performance:{...z.performance,...C}})),a=g,c=!0,this},render(f){return c||this.configure(),cg.updateContainer(te.exports.createElement(a$,{store:s,children:f,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){xI(n)}}}function a$({store:n,children:e,onCreated:t,rootElement:r}){return Ad(()=>{const i=n.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),n.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),te.exports.createElement(yI.Provider,{value:n},e)}function xI(n,e){const t=Nu.get(n),r=t==null?void 0:t.fiber;if(r){const i=t==null?void 0:t.store.getState();i&&(i.internal.active=!1),cg.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var s,o,a,c;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(c=i.gl)!=null&&c.xr&&i.xr.disconnect(),H7(i),Nu.delete(n),e&&e(n)}catch{}},500)})}}cg.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:te.exports.version});function $x(n,e,t){var r,i,s,o,a;e==null&&(e=100);function c(){var d=Date.now()-o;d=0?r=setTimeout(c,e-d):(r=null,t||(a=n.apply(s,i),s=i=null))}var f=function(){s=this,i=arguments,o=Date.now();var d=t&&!r;return r||(r=setTimeout(c,e)),d&&(a=n.apply(s,i),s=i=null),a};return f.clear=function(){r&&(clearTimeout(r),r=null)},f.flush=function(){r&&(a=n.apply(s,i),s=i=null,clearTimeout(r),r=null)},f}$x.debounce=$x;var W2=$x;function l$(n){let{debounce:e,scroll:t,polyfill:r,offsetSize:i}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=r||(typeof window=="undefined"?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]=te.exports.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=te.exports.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),f=e?typeof e=="number"?e:e.scroll:null,d=e?typeof e=="number"?e:e.resize:null,h=te.exports.useRef(!1);te.exports.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[p,g,v]=te.exports.useMemo(()=>{const _=()=>{if(!c.current.element)return;const{left:M,top:E,width:C,height:P,bottom:R,right:T,x:L,y:D}=c.current.element.getBoundingClientRect(),Y={left:M,top:E,width:C,height:P,bottom:R,right:T,x:L,y:D};c.current.element instanceof HTMLElement&&i&&(Y.height=c.current.element.offsetHeight,Y.width=c.current.element.offsetWidth),Object.freeze(Y),h.current&&!d$(c.current.lastBounds,Y)&&a(c.current.lastBounds=Y)};return[_,d?W2(_,d):_,f?W2(_,f):_]},[a,i,f,d]);function y(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(_=>_.removeEventListener("scroll",v,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null)}function x(){!c.current.element||(c.current.resizeObserver=new s(v),c.current.resizeObserver.observe(c.current.element),t&&c.current.scrollContainers&&c.current.scrollContainers.forEach(_=>_.addEventListener("scroll",v,{capture:!0,passive:!0})))}const w=_=>{!_||_===c.current.element||(y(),c.current.element=_,c.current.scrollContainers=SI(_),x())};return c$(v,Boolean(t)),u$(g),te.exports.useEffect(()=>{y(),x()},[t,v,g]),te.exports.useEffect(()=>y,[]),[w,o,p]}function u$(n){te.exports.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function c$(n,e){te.exports.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function SI(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:r,overflowY:i}=window.getComputedStyle(n);return[t,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...SI(n.parentElement)]}const f$=["x","y","top","bottom","left","right","width","height"],d$=(n,e)=>f$.every(t=>n[t]===e[t]);var h$=Object.defineProperty,p$=Object.defineProperties,m$=Object.getOwnPropertyDescriptors,$2=Object.getOwnPropertySymbols,g$=Object.prototype.hasOwnProperty,v$=Object.prototype.propertyIsEnumerable,j2=(n,e,t)=>e in n?h$(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,X2=(n,e)=>{for(var t in e||(e={}))g$.call(e,t)&&j2(n,t,e[t]);if($2)for(var t of $2(e))v$.call(e,t)&&j2(n,t,e[t]);return n},y$=(n,e)=>p$(n,m$(e));function wI(n,e,t){if(!n)return;if(t(n)===!0)return n;let r=e?n.return:n.child;for(;r;){const i=wI(r,e,t);if(i)return i;r=e?null:r.sibling}}function MI(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const WS=MI(te.exports.createContext(null));class bI extends te.exports.Component{render(){return te.exports.createElement(WS.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:_$,ReactCurrentDispatcher:x$}=te.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S$(){const n=te.exports.useContext(WS);if(!n)throw new Error("its-fine: useFiber must be called within a !");const e=te.exports.useId();return te.exports.useMemo(()=>{var r;return(r=_$.current)!=null?r:wI(n,!1,i=>{let s=i.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}})},[n,e])}function w$(){var n,e;const t=S$(),[r]=te.exports.useState(()=>new Map);r.clear();let i=t;for(;i;){const s=(n=i.type)==null?void 0:n._context;s&&s!==WS&&!r.has(s)&&r.set(s,(e=x$.current)==null?void 0:e.readContext(MI(s))),i=i.return}return te.exports.useMemo(()=>Array.from(r.keys()).reduce((s,o)=>a=>te.exports.createElement(s,null,te.exports.createElement(o.Provider,y$(X2({},a),{value:r.get(o)}))),s=>te.exports.createElement(bI,X2({},s))),[r])}const Yy={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 M$(n){const{handlePointer:e}=Y7(n);return{priority:1,enabled:!0,compute(t,r,i){r.pointer.set(t.offsetX/r.size.width*2-1,-(t.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(Yy).reduce((t,r)=>({...t,[r]:e(r)}),{}),connect:t=>{var r;const{set:i,events:s}=n.getState();s.disconnect==null||s.disconnect(),i(o=>({events:{...o.events,connected:t}})),Object.entries((r=s.handlers)!=null?r:[]).forEach(([o,a])=>{const[c,f]=Yy[o];t.addEventListener(c,a,{passive:f})})},disconnect:()=>{const{set:t,events:r}=n.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([s,o])=>{if(r&&r.connected instanceof HTMLElement){const[a]=Yy[s];r.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const b$=te.exports.forwardRef(function({children:e,fallback:t,resize:r,style:i,gl:s,events:o=M$,eventSource:a,eventPrefix:c,shadows:f,linear:d,flat:h,legacy:p,orthographic:g,frameloop:v,dpr:y,performance:x,raycaster:w,camera:_,onPointerMissed:M,onCreated:E,...C},P){te.exports.useMemo(()=>q7(lg),[]);const R=w$(),[T,L]=l$({scroll:!0,debounce:{scroll:50,resize:0},...r}),D=te.exports.useRef(null),Y=te.exports.useRef(null),[fe,q]=te.exports.useState(null);te.exports.useImperativeHandle(P,()=>D.current);const $=fI(M),[se,le]=te.exports.useState(!1),[pe,z]=te.exports.useState(!1);if(se)throw se;if(pe)throw pe;const F=te.exports.useRef(null);L.width>0&&L.height>0&&fe&&(F.current||(F.current=o$(fe)),F.current.configure({gl:s,events:o,shadows:f,linear:d,flat:h,legacy:p,orthographic:g,frameloop:v,dpr:y,performance:x,raycaster:w,camera:_,size:L,onPointerMissed:(...Z)=>$.current==null?void 0:$.current(...Z),onCreated:Z=>{Z.events.connect==null||Z.events.connect(a?B7(a)?a.current:a:Y.current),c&&Z.setEvents({compute:(k,W)=>{const N=k[c+"X"],me=k[c+"Y"];W.pointer.set(N/W.size.width*2-1,-(me/W.size.height)*2+1),W.raycaster.setFromCamera(W.pointer,W.camera)}}),E==null||E(Z)}}),F.current.render(te.exports.createElement(R,null,te.exports.createElement(dI,{set:z},te.exports.createElement(te.exports.Suspense,{fallback:te.exports.createElement(V7,{set:le})},e))))),Ad(()=>{q(D.current)},[]),te.exports.useEffect(()=>{if(fe)return()=>xI(fe)},[fe]);const G=a?"none":"auto";return te.exports.createElement("div",Ya({ref:Y,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:G,...i}},C),te.exports.createElement("div",{ref:T,style:{width:"100%",height:"100%"}},te.exports.createElement("canvas",{ref:D,style:{display:"block"}},t)))}),E$=te.exports.forwardRef(function(e,t){return te.exports.createElement(bI,null,te.exports.createElement(b$,Ya({},e,{ref:t})))});function T$(n){return function(e){n.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}function td(n){return td=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},td(n)}function C$(n,e){if(td(n)!=="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(td(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function A$(n){var e=C$(n,"string");return td(e)==="symbol"?e:String(e)}function ve(n,e,t){return e=A$(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}class P$ extends Mt{constructor(e,t){super(),ve(this,"isTransformControls",!0),ve(this,"visible",!1),ve(this,"domElement",void 0),ve(this,"raycaster",new HS),ve(this,"gizmo",void 0),ve(this,"plane",void 0),ve(this,"tempVector",new I),ve(this,"tempVector2",new I),ve(this,"tempQuaternion",new Gt),ve(this,"unit",{X:new I(1,0,0),Y:new I(0,1,0),Z:new I(0,0,1)}),ve(this,"pointStart",new I),ve(this,"pointEnd",new I),ve(this,"offset",new I),ve(this,"rotationAxis",new I),ve(this,"startNorm",new I),ve(this,"endNorm",new I),ve(this,"rotationAngle",0),ve(this,"cameraPosition",new I),ve(this,"cameraQuaternion",new Gt),ve(this,"cameraScale",new I),ve(this,"parentPosition",new I),ve(this,"parentQuaternion",new Gt),ve(this,"parentQuaternionInv",new Gt),ve(this,"parentScale",new I),ve(this,"worldPositionStart",new I),ve(this,"worldQuaternionStart",new Gt),ve(this,"worldScaleStart",new I),ve(this,"worldPosition",new I),ve(this,"worldQuaternion",new Gt),ve(this,"worldQuaternionInv",new Gt),ve(this,"worldScale",new I),ve(this,"eye",new I),ve(this,"positionStart",new I),ve(this,"quaternionStart",new Gt),ve(this,"scaleStart",new I),ve(this,"camera",void 0),ve(this,"object",void 0),ve(this,"enabled",!0),ve(this,"axis",null),ve(this,"mode","translate"),ve(this,"translationSnap",null),ve(this,"rotationSnap",null),ve(this,"scaleSnap",null),ve(this,"space","world"),ve(this,"size",1),ve(this,"dragging",!1),ve(this,"showX",!0),ve(this,"showY",!0),ve(this,"showZ",!0),ve(this,"changeEvent",{type:"change"}),ve(this,"mouseDownEvent",{type:"mouseDown",mode:this.mode}),ve(this,"mouseUpEvent",{type:"mouseUp",mode:this.mode}),ve(this,"objectChangeEvent",{type:"objectChange"}),ve(this,"intersectObjectWithRay",(i,s,o)=>{const a=s.intersectObject(i,!0);for(let c=0;c(this.object=i,this.visible=!0,this)),ve(this,"detach",()=>(this.object=void 0,this.visible=!1,this.axis=null,this)),ve(this,"reset",()=>this.enabled?(this.dragging&&this.object!==void 0&&(this.object.position.copy(this.positionStart),this.object.quaternion.copy(this.quaternionStart),this.object.scale.copy(this.scaleStart),this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent),this.pointStart.copy(this.pointEnd)),this):this),ve(this,"updateMatrixWorld",()=>{this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this.parentPosition,this.parentQuaternion,this.parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this.worldScale),this.parentQuaternionInv.copy(this.parentQuaternion).invert(),this.worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this.cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld()}),ve(this,"pointerHover",i=>{if(this.object===void 0||this.dragging===!0)return;this.raycaster.setFromCamera(i,this.camera);const s=this.intersectObjectWithRay(this.gizmo.picker[this.mode],this.raycaster);s?this.axis=s.object.name:this.axis=null}),ve(this,"pointerDown",i=>{if(!(this.object===void 0||this.dragging===!0||i.button!==0)&&this.axis!==null){this.raycaster.setFromCamera(i,this.camera);const s=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(s){let o=this.space;if(this.mode==="scale"?o="local":(this.axis==="E"||this.axis==="XYZE"||this.axis==="XYZ")&&(o="world"),o==="local"&&this.mode==="rotate"){const a=this.rotationSnap;this.axis==="X"&&a&&(this.object.rotation.x=Math.round(this.object.rotation.x/a)*a),this.axis==="Y"&&a&&(this.object.rotation.y=Math.round(this.object.rotation.y/a)*a),this.axis==="Z"&&a&&(this.object.rotation.z=Math.round(this.object.rotation.z/a)*a)}this.object.updateMatrixWorld(),this.object.parent&&this.object.parent.updateMatrixWorld(),this.positionStart.copy(this.object.position),this.quaternionStart.copy(this.object.quaternion),this.scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this.worldScaleStart),this.pointStart.copy(s.point).sub(this.worldPositionStart)}this.dragging=!0,this.mouseDownEvent.mode=this.mode,this.dispatchEvent(this.mouseDownEvent)}}),ve(this,"pointerMove",i=>{const s=this.axis,o=this.mode,a=this.object;let c=this.space;if(o==="scale"?c="local":(s==="E"||s==="XYZE"||s==="XYZ")&&(c="world"),a===void 0||s===null||this.dragging===!1||i.button!==-1)return;this.raycaster.setFromCamera(i,this.camera);const f=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(!!f){if(this.pointEnd.copy(f.point).sub(this.worldPositionStart),o==="translate")this.offset.copy(this.pointEnd).sub(this.pointStart),c==="local"&&s!=="XYZ"&&this.offset.applyQuaternion(this.worldQuaternionInv),s.indexOf("X")===-1&&(this.offset.x=0),s.indexOf("Y")===-1&&(this.offset.y=0),s.indexOf("Z")===-1&&(this.offset.z=0),c==="local"&&s!=="XYZ"?this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale):this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale),a.position.copy(this.offset).add(this.positionStart),this.translationSnap&&(c==="local"&&(a.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()),s.search("X")!==-1&&(a.position.x=Math.round(a.position.x/this.translationSnap)*this.translationSnap),s.search("Y")!==-1&&(a.position.y=Math.round(a.position.y/this.translationSnap)*this.translationSnap),s.search("Z")!==-1&&(a.position.z=Math.round(a.position.z/this.translationSnap)*this.translationSnap),a.position.applyQuaternion(this.quaternionStart)),c==="world"&&(a.parent&&a.position.add(this.tempVector.setFromMatrixPosition(a.parent.matrixWorld)),s.search("X")!==-1&&(a.position.x=Math.round(a.position.x/this.translationSnap)*this.translationSnap),s.search("Y")!==-1&&(a.position.y=Math.round(a.position.y/this.translationSnap)*this.translationSnap),s.search("Z")!==-1&&(a.position.z=Math.round(a.position.z/this.translationSnap)*this.translationSnap),a.parent&&a.position.sub(this.tempVector.setFromMatrixPosition(a.parent.matrixWorld))));else if(o==="scale"){if(s.search("XYZ")!==-1){let d=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(d*=-1),this.tempVector2.set(d,d,d)}else this.tempVector.copy(this.pointStart),this.tempVector2.copy(this.pointEnd),this.tempVector.applyQuaternion(this.worldQuaternionInv),this.tempVector2.applyQuaternion(this.worldQuaternionInv),this.tempVector2.divide(this.tempVector),s.search("X")===-1&&(this.tempVector2.x=1),s.search("Y")===-1&&(this.tempVector2.y=1),s.search("Z")===-1&&(this.tempVector2.z=1);a.scale.copy(this.scaleStart).multiply(this.tempVector2),this.scaleSnap&&this.object&&(s.search("X")!==-1&&(this.object.scale.x=Math.round(a.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),s.search("Y")!==-1&&(a.scale.y=Math.round(a.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),s.search("Z")!==-1&&(a.scale.z=Math.round(a.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(o==="rotate"){this.offset.copy(this.pointEnd).sub(this.pointStart);const d=20/this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));s==="E"?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this.startNorm.copy(this.pointStart).normalize(),this.endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this.endNorm.cross(this.startNorm).dot(this.eye)<0?1:-1):s==="XYZE"?(this.rotationAxis.copy(this.offset).cross(this.eye).normalize(),this.rotationAngle=this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye))*d):(s==="X"||s==="Y"||s==="Z")&&(this.rotationAxis.copy(this.unit[s]),this.tempVector.copy(this.unit[s]),c==="local"&&this.tempVector.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.offset.dot(this.tempVector.cross(this.eye).normalize())*d),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),c==="local"&&s!=="E"&&s!=="XYZE"?(a.quaternion.copy(this.quaternionStart),a.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.parentQuaternionInv),a.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),a.quaternion.multiply(this.quaternionStart).normalize())}this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent)}}),ve(this,"pointerUp",i=>{i.button===0&&(this.dragging&&this.axis!==null&&(this.mouseUpEvent.mode=this.mode,this.dispatchEvent(this.mouseUpEvent)),this.dragging=!1,this.axis=null)}),ve(this,"getPointer",i=>{var s;if(this.domElement&&(s=this.domElement.ownerDocument)!==null&&s!==void 0&&s.pointerLockElement)return{x:0,y:0,button:i.button};{var o;const a=i.changedTouches?i.changedTouches[0]:i,c=(o=this.domElement)===null||o===void 0?void 0:o.getBoundingClientRect();return{x:(a.clientX-c.left)/c.width*2-1,y:-(a.clientY-c.top)/c.height*2+1,button:i.button}}}),ve(this,"onPointerHover",i=>{if(!!this.enabled)switch(i.pointerType){case"mouse":case"pen":this.pointerHover(this.getPointer(i));break}}),ve(this,"onPointerDown",i=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction="none",this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.pointerHover(this.getPointer(i)),this.pointerDown(this.getPointer(i)))}),ve(this,"onPointerMove",i=>{!this.enabled||this.pointerMove(this.getPointer(i))}),ve(this,"onPointerUp",i=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction="",this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.pointerUp(this.getPointer(i)))}),ve(this,"getMode",()=>this.mode),ve(this,"setMode",i=>{this.mode=i}),ve(this,"setTranslationSnap",i=>{this.translationSnap=i}),ve(this,"setRotationSnap",i=>{this.rotationSnap=i}),ve(this,"setScaleSnap",i=>{this.scaleSnap=i}),ve(this,"setSize",i=>{this.size=i}),ve(this,"setSpace",i=>{this.space=i}),ve(this,"update",()=>{console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}),ve(this,"connect",i=>{i===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=i,this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointermove",this.onPointerHover),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp)}),ve(this,"dispose",()=>{var i,s,o,a,c,f;(i=this.domElement)===null||i===void 0||i.removeEventListener("pointerdown",this.onPointerDown),(s=this.domElement)===null||s===void 0||s.removeEventListener("pointermove",this.onPointerHover),(o=this.domElement)===null||o===void 0||(a=o.ownerDocument)===null||a===void 0||a.removeEventListener("pointermove",this.onPointerMove),(c=this.domElement)===null||c===void 0||(f=c.ownerDocument)===null||f===void 0||f.removeEventListener("pointerup",this.onPointerUp),this.traverse(d=>{const h=d;h.geometry&&h.geometry.dispose(),h.material&&h.material.dispose()})}),this.domElement=t,this.camera=e,this.gizmo=new R$,this.add(this.gizmo),this.plane=new L$,this.add(this.plane);const r=(i,s)=>{let o=s;Object.defineProperty(this,i,{get:function(){return o!==void 0?o:s},set:function(a){o!==a&&(o=a,this.plane[i]=a,this.gizmo[i]=a,this.dispatchEvent({type:i+"-changed",value:a}),this.dispatchEvent(this.changeEvent))}}),this[i]=s,this.plane[i]=s,this.gizmo[i]=s};r("camera",this.camera),r("object",this.object),r("enabled",this.enabled),r("axis",this.axis),r("mode",this.mode),r("translationSnap",this.translationSnap),r("rotationSnap",this.rotationSnap),r("scaleSnap",this.scaleSnap),r("space",this.space),r("size",this.size),r("dragging",this.dragging),r("showX",this.showX),r("showY",this.showY),r("showZ",this.showZ),r("worldPosition",this.worldPosition),r("worldPositionStart",this.worldPositionStart),r("worldQuaternion",this.worldQuaternion),r("worldQuaternionStart",this.worldQuaternionStart),r("cameraPosition",this.cameraPosition),r("cameraQuaternion",this.cameraQuaternion),r("pointStart",this.pointStart),r("pointEnd",this.pointEnd),r("rotationAxis",this.rotationAxis),r("rotationAngle",this.rotationAngle),r("eye",this.eye),t!==void 0&&this.connect(t)}}class R$ extends Mt{constructor(){super(),ve(this,"isTransformControlsGizmo",!0),ve(this,"type","TransformControlsGizmo"),ve(this,"tempVector",new I(0,0,0)),ve(this,"tempEuler",new ll),ve(this,"alignVector",new I(0,1,0)),ve(this,"zeroVector",new I(0,0,0)),ve(this,"lookAtMatrix",new dt),ve(this,"tempQuaternion",new Gt),ve(this,"tempQuaternion2",new Gt),ve(this,"identityQuaternion",new Gt),ve(this,"unitX",new I(1,0,0)),ve(this,"unitY",new I(0,1,0)),ve(this,"unitZ",new I(0,0,1)),ve(this,"gizmo",void 0),ve(this,"picker",void 0),ve(this,"helper",void 0),ve(this,"rotationAxis",new I),ve(this,"cameraPosition",new I),ve(this,"worldPositionStart",new I),ve(this,"worldQuaternionStart",new Gt),ve(this,"worldPosition",new I),ve(this,"worldQuaternion",new Gt),ve(this,"eye",new I),ve(this,"camera",null),ve(this,"enabled",!0),ve(this,"axis",null),ve(this,"mode","translate"),ve(this,"space","world"),ve(this,"size",1),ve(this,"dragging",!1),ve(this,"showX",!0),ve(this,"showY",!0),ve(this,"showZ",!0),ve(this,"updateMatrixWorld",()=>{let G=this.space;this.mode==="scale"&&(G="local");const Z=G==="local"?this.worldQuaternion:this.identityQuaternion;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let k=[];k=k.concat(this.picker[this.mode].children),k=k.concat(this.gizmo[this.mode].children),k=k.concat(this.helper[this.mode].children);for(let W=0;W.9&&(N.visible=!1)),this.axis==="Y"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,Math.PI/2)),N.quaternion.copy(Z).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(Z).dot(this.eye))>.9&&(N.visible=!1)),this.axis==="Z"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),N.quaternion.copy(Z).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(Z).dot(this.eye))>.9&&(N.visible=!1)),this.axis==="XYZE"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),this.alignVector.copy(this.rotationAxis),N.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.zeroVector,this.alignVector,this.unitY)),N.quaternion.multiply(this.tempQuaternion),N.visible=this.dragging),this.axis==="E"&&(N.visible=!1)):N.name==="START"?(N.position.copy(this.worldPositionStart),N.visible=this.dragging):N.name==="END"?(N.position.copy(this.worldPosition),N.visible=this.dragging):N.name==="DELTA"?(N.position.copy(this.worldPositionStart),N.quaternion.copy(this.worldQuaternionStart),this.tempVector.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),this.tempVector.applyQuaternion(this.worldQuaternionStart.clone().invert()),N.scale.copy(this.tempVector),N.visible=this.dragging):(N.quaternion.copy(Z),this.dragging?N.position.copy(this.worldPositionStart):N.position.copy(this.worldPosition),this.axis&&(N.visible=this.axis.search(N.name)!==-1));continue}N.quaternion.copy(Z),this.mode==="translate"||this.mode==="scale"?((N.name==="X"||N.name==="XYZX")&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(Z).dot(this.eye))>.99&&(N.scale.set(1e-10,1e-10,1e-10),N.visible=!1),(N.name==="Y"||N.name==="XYZY")&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(Z).dot(this.eye))>.99&&(N.scale.set(1e-10,1e-10,1e-10),N.visible=!1),(N.name==="Z"||N.name==="XYZZ")&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(Z).dot(this.eye))>.99&&(N.scale.set(1e-10,1e-10,1e-10),N.visible=!1),N.name==="XY"&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(Z).dot(this.eye))<.2&&(N.scale.set(1e-10,1e-10,1e-10),N.visible=!1),N.name==="YZ"&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(Z).dot(this.eye))<.2&&(N.scale.set(1e-10,1e-10,1e-10),N.visible=!1),N.name==="XZ"&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(Z).dot(this.eye))<.2&&(N.scale.set(1e-10,1e-10,1e-10),N.visible=!1),N.name.search("X")!==-1&&(this.alignVector.copy(this.unitX).applyQuaternion(Z).dot(this.eye)<0?N.tag==="fwd"?N.visible=!1:N.scale.x*=-1:N.tag==="bwd"&&(N.visible=!1)),N.name.search("Y")!==-1&&(this.alignVector.copy(this.unitY).applyQuaternion(Z).dot(this.eye)<0?N.tag==="fwd"?N.visible=!1:N.scale.y*=-1:N.tag==="bwd"&&(N.visible=!1)),N.name.search("Z")!==-1&&(this.alignVector.copy(this.unitZ).applyQuaternion(Z).dot(this.eye)<0?N.tag==="fwd"?N.visible=!1:N.scale.z*=-1:N.tag==="bwd"&&(N.visible=!1))):this.mode==="rotate"&&(this.tempQuaternion2.copy(Z),this.alignVector.copy(this.eye).applyQuaternion(this.tempQuaternion.copy(Z).invert()),N.name.search("E")!==-1&&N.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.eye,this.zeroVector,this.unitY)),N.name==="X"&&(this.tempQuaternion.setFromAxisAngle(this.unitX,Math.atan2(-this.alignVector.y,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),N.quaternion.copy(this.tempQuaternion)),N.name==="Y"&&(this.tempQuaternion.setFromAxisAngle(this.unitY,Math.atan2(this.alignVector.x,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),N.quaternion.copy(this.tempQuaternion)),N.name==="Z"&&(this.tempQuaternion.setFromAxisAngle(this.unitZ,Math.atan2(this.alignVector.y,this.alignVector.x)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),N.quaternion.copy(this.tempQuaternion))),N.visible=N.visible&&(N.name.indexOf("X")===-1||this.showX),N.visible=N.visible&&(N.name.indexOf("Y")===-1||this.showY),N.visible=N.visible&&(N.name.indexOf("Z")===-1||this.showZ),N.visible=N.visible&&(N.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),N.material.tempOpacity=N.material.tempOpacity||N.material.opacity,N.material.tempColor=N.material.tempColor||N.material.color.clone(),N.material.color.copy(N.material.tempColor),N.material.opacity=N.material.tempOpacity,this.enabled?this.axis&&(N.name===this.axis?(N.material.opacity=1,N.material.color.lerp(new Ge(1,1,1),.5)):this.axis.split("").some(function(X){return N.name===X})?(N.material.opacity=1,N.material.color.lerp(new Ge(1,1,1),.5)):(N.material.opacity*=.25,N.material.color.lerp(new Ge(1,1,1),.5))):(N.material.opacity*=.5,N.material.color.lerp(new Ge(1,1,1),.5))}super.updateMatrixWorld()});const e=new hs({depthTest:!1,depthWrite:!1,transparent:!0,side:ki,fog:!1,toneMapped:!1}),t=new lr({depthTest:!1,depthWrite:!1,transparent:!0,linewidth:1,fog:!1,toneMapped:!1}),r=e.clone();r.opacity=.15;const i=e.clone();i.opacity=.33;const s=e.clone();s.color.set(16711680);const o=e.clone();o.color.set(65280);const a=e.clone();a.color.set(255);const c=e.clone();c.opacity=.25;const f=c.clone();f.color.set(16776960);const d=c.clone();d.color.set(65535);const h=c.clone();h.color.set(16711935),e.clone().color.set(16776960);const g=t.clone();g.color.set(16711680);const v=t.clone();v.color.set(65280);const y=t.clone();y.color.set(255);const x=t.clone();x.color.set(65535);const w=t.clone();w.color.set(16711935);const _=t.clone();_.color.set(16776960);const M=t.clone();M.color.set(7895160);const E=_.clone();E.opacity=.25;const C=new Bn(0,.05,.2,12,1,!1),P=new hr(.125,.125,.125),R=new ht;R.setAttribute("position",new Xe([0,0,0,1,0,0],3));const T=(G,Z)=>{const k=new ht,W=[];for(let N=0;N<=64*Z;++N)W.push(0,Math.cos(N/32*Math.PI)*G,Math.sin(N/32*Math.PI)*G);return k.setAttribute("position",new Xe(W,3)),k},L=()=>{const G=new ht;return G.setAttribute("position",new Xe([0,0,0,1,1,1],3)),G},D={X:[[new We(C,s),[1,0,0],[0,0,-Math.PI/2],null,"fwd"],[new We(C,s),[1,0,0],[0,0,Math.PI/2],null,"bwd"],[new St(R,g)]],Y:[[new We(C,o),[0,1,0],null,null,"fwd"],[new We(C,o),[0,1,0],[Math.PI,0,0],null,"bwd"],[new St(R,v),null,[0,0,Math.PI/2]]],Z:[[new We(C,a),[0,0,1],[Math.PI/2,0,0],null,"fwd"],[new We(C,a),[0,0,1],[-Math.PI/2,0,0],null,"bwd"],[new St(R,y),null,[0,-Math.PI/2,0]]],XYZ:[[new We(new Vr(.1,0),c.clone()),[0,0,0],[0,0,0]]],XY:[[new We(new Gr(.295,.295),f.clone()),[.15,.15,0]],[new St(R,_),[.18,.3,0],null,[.125,1,1]],[new St(R,_),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new We(new Gr(.295,.295),d.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new St(R,x),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new St(R,x),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new We(new Gr(.295,.295),h.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new St(R,w),[.18,0,.3],null,[.125,1,1]],[new St(R,w),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},Y={X:[[new We(new Bn(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new We(new Bn(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new We(new Bn(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new We(new Vr(.2,0),r)]],XY:[[new We(new Gr(.4,.4),r),[.2,.2,0]]],YZ:[[new We(new Gr(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new We(new Gr(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},fe={START:[[new We(new Vr(.01,2),i),null,null,null,"helper"]],END:[[new We(new Vr(.01,2),i),null,null,null,"helper"]],DELTA:[[new St(L(),i),null,null,null,"helper"]],X:[[new St(R,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new St(R,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new St(R,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},q={X:[[new St(T(1,.5),g)],[new We(new Vr(.04,0),s),[0,0,.99],null,[1,3,1]]],Y:[[new St(T(1,.5),v),null,[0,0,-Math.PI/2]],[new We(new Vr(.04,0),o),[0,0,.99],null,[3,1,1]]],Z:[[new St(T(1,.5),y),null,[0,Math.PI/2,0]],[new We(new Vr(.04,0),a),[.99,0,0],null,[1,3,1]]],E:[[new St(T(1.25,1),E),null,[0,Math.PI/2,0]],[new We(new Bn(.03,0,.15,4,1,!1),E),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new We(new Bn(.03,0,.15,4,1,!1),E),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new We(new Bn(.03,0,.15,4,1,!1),E),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new We(new Bn(.03,0,.15,4,1,!1),E),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new St(T(1,1),M),null,[0,Math.PI/2,0]]]},$={AXIS:[[new St(R,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},se={X:[[new We(new Bs(1,.1,4,24),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new We(new Bs(1,.1,4,24),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new We(new Bs(1,.1,4,24),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new We(new Bs(1.25,.1,2,24),r)]],XYZE:[[new We(new ul(.7,10,8),r)]]},le={X:[[new We(P,s),[.8,0,0],[0,0,-Math.PI/2]],[new St(R,g),null,null,[.8,1,1]]],Y:[[new We(P,o),[0,.8,0]],[new St(R,v),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new We(P,a),[0,0,.8],[Math.PI/2,0,0]],[new St(R,y),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new We(P,f),[.85,.85,0],null,[2,2,.2]],[new St(R,_),[.855,.98,0],null,[.125,1,1]],[new St(R,_),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new We(P,d),[0,.85,.85],null,[.2,2,2]],[new St(R,x),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new St(R,x),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new We(P,h),[.85,0,.85],null,[2,.2,2]],[new St(R,w),[.855,0,.98],null,[.125,1,1]],[new St(R,w),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new We(new hr(.125,.125,.125),c.clone()),[1.1,0,0]]],XYZY:[[new We(new hr(.125,.125,.125),c.clone()),[0,1.1,0]]],XYZZ:[[new We(new hr(.125,.125,.125),c.clone()),[0,0,1.1]]]},pe={X:[[new We(new Bn(.2,0,.8,4,1,!1),r),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new We(new Bn(.2,0,.8,4,1,!1),r),[0,.5,0]]],Z:[[new We(new Bn(.2,0,.8,4,1,!1),r),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new We(P,r),[.85,.85,0],null,[3,3,.2]]],YZ:[[new We(P,r),[0,.85,.85],null,[.2,3,3]]],XZ:[[new We(P,r),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new We(new hr(.2,.2,.2),r),[1.1,0,0]]],XYZY:[[new We(new hr(.2,.2,.2),r),[0,1.1,0]]],XYZZ:[[new We(new hr(.2,.2,.2),r),[0,0,1.1]]]},z={X:[[new St(R,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new St(R,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new St(R,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},F=G=>{const Z=new Mt;for(let k in G)for(let W=G[k].length;W--;){const N=G[k][W][0].clone(),me=G[k][W][1],X=G[k][W][2],Te=G[k][W][3],Ce=G[k][W][4];N.name=k,N.tag=Ce,me&&N.position.set(me[0],me[1],me[2]),X&&N.rotation.set(X[0],X[1],X[2]),Te&&N.scale.set(Te[0],Te[1],Te[2]),N.updateMatrix();const we=N.geometry.clone();we.applyMatrix4(N.matrix),N.geometry=we,N.renderOrder=1/0,N.position.set(0,0,0),N.rotation.set(0,0,0),N.scale.set(1,1,1),Z.add(N)}return Z};this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=F(D)),this.add(this.gizmo.rotate=F(q)),this.add(this.gizmo.scale=F(le)),this.add(this.picker.translate=F(Y)),this.add(this.picker.rotate=F(se)),this.add(this.picker.scale=F(pe)),this.add(this.helper.translate=F(fe)),this.add(this.helper.rotate=F($)),this.add(this.helper.scale=F(z)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}}class L$ extends We{constructor(){super(new Gr(1e5,1e5,2,2),new hs({visible:!1,wireframe:!0,side:ki,transparent:!0,opacity:.1,toneMapped:!1})),ve(this,"isTransformControlsPlane",!0),ve(this,"type","TransformControlsPlane"),ve(this,"unitX",new I(1,0,0)),ve(this,"unitY",new I(0,1,0)),ve(this,"unitZ",new I(0,0,1)),ve(this,"tempVector",new I),ve(this,"dirVector",new I),ve(this,"alignVector",new I),ve(this,"tempMatrix",new dt),ve(this,"identityQuaternion",new Gt),ve(this,"cameraQuaternion",new Gt),ve(this,"worldPosition",new I),ve(this,"worldQuaternion",new Gt),ve(this,"eye",new I),ve(this,"axis",null),ve(this,"mode","translate"),ve(this,"space","world"),ve(this,"updateMatrixWorld",()=>{let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),this.unitX.set(1,0,0).applyQuaternion(e==="local"?this.worldQuaternion:this.identityQuaternion),this.unitY.set(0,1,0).applyQuaternion(e==="local"?this.worldQuaternion:this.identityQuaternion),this.unitZ.set(0,0,1).applyQuaternion(e==="local"?this.worldQuaternion:this.identityQuaternion),this.alignVector.copy(this.unitY),this.mode){case"translate":case"scale":switch(this.axis){case"X":this.alignVector.copy(this.eye).cross(this.unitX),this.dirVector.copy(this.unitX).cross(this.alignVector);break;case"Y":this.alignVector.copy(this.eye).cross(this.unitY),this.dirVector.copy(this.unitY).cross(this.alignVector);break;case"Z":this.alignVector.copy(this.eye).cross(this.unitZ),this.dirVector.copy(this.unitZ).cross(this.alignVector);break;case"XY":this.dirVector.copy(this.unitZ);break;case"YZ":this.dirVector.copy(this.unitX);break;case"XZ":this.alignVector.copy(this.unitZ),this.dirVector.copy(this.unitY);break;case"XYZ":case"E":this.dirVector.set(0,0,0);break}break;case"rotate":default:this.dirVector.set(0,0,0)}this.dirVector.length()===0?this.quaternion.copy(this.cameraQuaternion):(this.tempMatrix.lookAt(this.tempVector.set(0,0,0),this.dirVector,this.alignVector),this.quaternion.setFromRotationMatrix(this.tempMatrix)),super.updateMatrixWorld()})}}var I$=1/0,N$=9007199254740991,D$="[object Arguments]",O$="[object Function]",k$="[object GeneratorFunction]",z$="[object Symbol]",F$=typeof Eo=="object"&&Eo&&Eo.Object===Object&&Eo,U$=typeof self=="object"&&self&&self.Object===Object&&self,B$=F$||U$||Function("return this")();function V$(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function G$(n,e){for(var t=-1,r=n?n.length:0,i=Array(r);++t0&&t(a)?e>1?EI(a,e-1,t,r,i):H$(i,a):r||(i[i.length]=a)}return i}function j$(n,e){return n=Object(n),X$(n,e,function(t,r){return r in n})}function X$(n,e,t){for(var r=-1,i=e.length,s={};++r-1&&n%1==0&&n<=N$}function rj(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function TI(n){return!!n&&typeof n=="object"}function ij(n){return typeof n=="symbol"||TI(n)&&jS.call(n)==z$}var sj=Y$(function(n,e){return n==null?{}:j$(n,G$(EI(e,1),Z$))}),oj=sj;function aj(n,e,t){const{gl:r,size:i,viewport:s}=pi(),o=typeof n=="number"?n:i.width*s.dpr,a=typeof e=="number"?e:i.height*s.dpr,c=(typeof n=="number"?t:n)||{},{samples:f=0,depth:d,...h}=c,p=te.exports.useMemo(()=>{let g;return g=new qr(o,a,{minFilter:un,magFilter:un,encoding:r.outputEncoding,type:Za,...h}),d&&(g.depthTexture=new _S(o,a,os)),g.samples=f,g},[]);return te.exports.useLayoutEffect(()=>{p.setSize(o,a),f&&(p.samples=f)},[f,p,o,a]),te.exports.useEffect(()=>()=>p.dispose(),[]),p}const lj=n=>typeof n=="function",uj=te.exports.forwardRef(({envMap:n,resolution:e=256,frames:t=1/0,makeDefault:r,children:i,...s},o)=>{const a=pi(({set:x})=>x),c=pi(({camera:x})=>x),f=pi(({size:x})=>x),d=te.exports.useRef(null),h=te.exports.useRef(null),p=aj(e);te.exports.useLayoutEffect(()=>{s.manual||(d.current.aspect=f.width/f.height)},[f,s]),te.exports.useLayoutEffect(()=>{d.current.updateProjectionMatrix()});let g=0,v=null;const y=lj(i);return n$(x=>{y&&(t===1/0||g{if(r){const x=c;return a(()=>({camera:d.current})),()=>a(()=>({camera:x}))}},[d,r,a]),te.exports.createElement(te.exports.Fragment,null,te.exports.createElement("perspectiveCamera",Ya({ref:T$([d,o])},s),!y&&i),te.exports.createElement("group",{ref:h},y&&i(p.texture)))});var cj=200,XS="__lodash_hash_undefined__",fj=1/0,CI=9007199254740991,dj="[object Arguments]",hj="[object Function]",pj="[object GeneratorFunction]",mj="[object Symbol]",gj=/[\\^$.*+?()[\]{}|]/g,vj=/^\[object .+?Constructor\]$/,yj=/^(?:0|[1-9]\d*)$/,_j=typeof Eo=="object"&&Eo&&Eo.Object===Object&&Eo,xj=typeof self=="object"&&self&&self.Object===Object&&self,YS=_j||xj||Function("return this")();function Sj(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function wj(n,e){var t=n?n.length:0;return!!t&&Ej(n,e,0)>-1}function Mj(n,e,t){for(var r=-1,i=n?n.length:0;++r-1}function Yj(n,e){var t=this.__data__,r=n0(t,n);return r<0?t.push([n,e]):t[r][1]=e,this}Yu.prototype.clear=Wj;Yu.prototype.delete=$j;Yu.prototype.get=jj;Yu.prototype.has=Xj;Yu.prototype.set=Yj;function qu(n){var e=-1,t=n?n.length:0;for(this.clear();++e=cj&&(s=Pj,o=!1,e=new fg(e));e:for(;++i0&&t(a)?e>1?LI(a,e-1,t,r,i):qS(i,a):r||(i[i.length]=a)}return i}function iX(n,e,t){var r=e(n);return QS(n)?r:qS(r,t(n))}function sX(n){if(!KS(n)||gX(n))return!1;var e=OI(n)||Lj(n)?Dj:vj;return e.test(xX(n))}function oX(n){if(!KS(n))return yX(n);var e=vX(n),t=[];for(var r in n)r=="constructor"&&(e||!Xu.call(n,r))||t.push(r);return t}function aX(n,e){return n=Object(n),lX(n,e,function(t,r){return r in n})}function lX(n,e,t){for(var r=-1,i=e.length,s={};++r-1&&n%1==0&&n-1&&n%1==0&&n<=CI}function KS(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function kI(n){return!!n&&typeof n=="object"}function bX(n){return typeof n=="symbol"||kI(n)&&ZS.call(n)==mj}function EX(n){return DI(n)?nX(n,!0):oX(n)}var TX=uX(function(n,e){return n==null?{}:(e=AI(LI(e,1),_X),aX(n,rX(cX(n),e)))});function zI(){return[]}var CX=TX;const AX=te.exports.forwardRef(({children:n,domElement:e,onChange:t,onMouseDown:r,onMouseUp:i,onObjectChange:s,object:o,makeDefault:a,...c},f)=>{const d=["enabled","axis","mode","translationSnap","rotationSnap","scaleSnap","space","size","showX","showY","showZ"],{camera:h,...p}=c,g=oj(p,d),v=CX(p,d),y=pi($=>$.controls),x=pi($=>$.gl),w=pi($=>$.events),_=pi($=>$.camera),M=pi($=>$.invalidate),E=pi($=>$.get),C=pi($=>$.set),P=h||_,R=e||w.connected||x.domElement,T=te.exports.useMemo(()=>new P$(P,R),[P,R]),L=te.exports.useRef();te.exports.useLayoutEffect(()=>(o?T.attach(o instanceof Mt?o:o.current):L.current instanceof Mt&&T.attach(L.current),()=>void T.detach()),[o,n,T]),te.exports.useEffect(()=>{if(y){const $=se=>y.enabled=!se.value;return T.addEventListener("dragging-changed",$),()=>T.removeEventListener("dragging-changed",$)}},[T,y]);const D=te.exports.useRef(),Y=te.exports.useRef(),fe=te.exports.useRef(),q=te.exports.useRef();return te.exports.useLayoutEffect(()=>void(D.current=t),[t]),te.exports.useLayoutEffect(()=>void(Y.current=r),[r]),te.exports.useLayoutEffect(()=>void(fe.current=i),[i]),te.exports.useLayoutEffect(()=>void(q.current=s),[s]),te.exports.useEffect(()=>{const $=z=>{M(),D.current==null||D.current(z)},se=z=>Y.current==null?void 0:Y.current(z),le=z=>fe.current==null?void 0:fe.current(z),pe=z=>q.current==null?void 0:q.current(z);return T.addEventListener("change",$),T.addEventListener("mouseDown",se),T.addEventListener("mouseUp",le),T.addEventListener("objectChange",pe),()=>{T.removeEventListener("change",$),T.removeEventListener("mouseDown",se),T.removeEventListener("mouseUp",le),T.removeEventListener("objectChange",pe)}},[M,T]),te.exports.useEffect(()=>{if(a){const $=E().controls;return C({controls:T}),()=>C({controls:$})}},[a,T]),T?te.exports.createElement(te.exports.Fragment,null,te.exports.createElement("primitive",Ya({ref:f,object:T},g)),te.exports.createElement("group",Ya({ref:L},v),n)):null}),PX=()=>{},Ql=(n,e)=>{const t=te.exports.useRef(PX);te.exports.useEffect(()=>{t.current=e},[e]),te.exports.useEffect(()=>{const r=i=>{const{action:s,data:o}=i.data;t.current&&s===n&&t.current(o)};return window.addEventListener("message",r),()=>window.removeEventListener("message",r)},[n])},RX=()=>{const{camera:n}=pi(),e=(t,r)=>t>0&&t<90?r:t>-180&&t<-90||t>0?-r:r;return Ql("setCameraPosition",({position:t,rotation:r})=>{n.position.set(t.x,t.z,-t.y),n.rotation.order="YZX",r&&n.rotation.set(is.degToRad(r.x),is.degToRad(e(r.x,r.z)),is.degToRad(r.y)),n.updateProjectionMatrix()}),at(uj,{position:[0,0,10],makeDefault:!0,onUpdate:t=>t.updateProjectionMatrix()})};async function LX(n,e,t){const r={method:"post",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(e)},i=window.GetParentResourceName?window.GetParentResourceName():"nui-frame-app";return await(await fetch(`https://${i}/${n}`,r)).json()}const IX=()=>{const n=te.exports.useRef(null),[e,t]=te.exports.useState(),[r,i]=te.exports.useState("translate"),[s,o]=te.exports.useState("world"),[a,c]=te.exports.useState(),[f,d]=te.exports.useState(),h=()=>{const p={handle:e,position:{x:n.current.position.x,y:-n.current.position.z,z:n.current.position.y},rotation:{x:is.radToDeg(n.current.rotation.x),y:is.radToDeg(-n.current.rotation.z),z:is.radToDeg(n.current.rotation.y)}};LX("gizmo:ChangePosition",p)};return Ql("setGizmoEntity",p=>{t(p.handle),p.handle!==void 0&&(n.current.position.set(p.position.x,p.position.z,-p.position.y),n.current.rotation.order="YZX",n.current.rotation.set(is.degToRad(p.rotation.x),is.degToRad(p.rotation.z),is.degToRad(p.rotation.y)))}),Ql("SetGizmoTransformMode",p=>{p.transformhandler===!0?i("rotate"):i("translate")}),Ql("SetTranslateSnap",p=>{c(p.translatesnapdata)}),Ql("SetRotationSnap",p=>{d(p.rotationsnapdata)}),Ql("SetSpaceMode",p=>{p.spacehandler===!0?o("local"):o("world")}),at(Og,{children:ka(te.exports.Suspense,{fallback:at("p",{children:"Loading Gizmo"}),children:[e!=null&&at(AX,{size:.5,object:n,space:s,translationSnap:a,rotationSnap:f,mode:r,onObjectChange:h}),at("mesh",{ref:n})]})})},NX=()=>ka(E$,{style:{zIndex:1},children:[at(RX,{}),at(IX,{})]}),DX=ds(n=>({container:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}})),OX=()=>{const{classes:n}=DX();return at(Og,{children:at(Vi,{className:n.container,children:at(NX,{})})})};/** + * @remix-run/router v1.2.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 Xx(){return Xx=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0&&(e.hash=n.substr(t),n=n.substr(0,t));let r=n.indexOf("?");r>=0&&(e.search=n.substr(r),n=n.substr(0,r)),n&&(e.pathname=n)}return e}function UX(n){let e=typeof window!="undefined"&&typeof window.location!="undefined"&&window.location.origin!=="null"?window.location.origin:window.location.href,t=typeof n=="string"?n:JS(n);return FI(e,"No window.location.(origin|href) available to create URL for href: "+t),new URL(t,e)}function BX(n,e,t,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=Na.Pop,c=null;function f(){a=Na.Pop,c&&c({action:a,location:p.location})}function d(g,v){a=Na.Push;let y=Yx(p.location,g,v);t&&t(y,g);let x=nC(y),w=p.createHref(y);try{o.pushState(x,"",w)}catch{i.location.assign(w)}s&&c&&c({action:a,location:p.location})}function h(g,v){a=Na.Replace;let y=Yx(p.location,g,v);t&&t(y,g);let x=nC(y),w=p.createHref(y);o.replaceState(x,"",w),s&&c&&c({action:a,location:p.location})}let p={get action(){return a},get location(){return n(i,o)},listen(g){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(tC,f),c=g,()=>{i.removeEventListener(tC,f),c=null}},createHref(g){return e(i,g)},encodeLocation(g){let v=UX(typeof g=="string"?g:JS(g));return{pathname:v.pathname,search:v.search,hash:v.hash}},push:d,replace:h,go(g){return o.go(g)}};return p}var rC;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(rC||(rC={}));function VX(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,r=n.charAt(t);return r&&r!=="/"?null:n.slice(t)||"/"}const GX=["post","put","patch","delete"];[...GX];/** + * React Router v6.6.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 HX(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}const WX=typeof Object.is=="function"?Object.is:HX,{useState:$X,useEffect:jX,useLayoutEffect:XX,useDebugValue:YX}=o_;function qX(n,e,t){const r=e(),[{inst:i},s]=$X({inst:{value:r,getSnapshot:e}});return XX(()=>{i.value=r,i.getSnapshot=e,Zy(i)&&s({inst:i})},[n,r,e]),jX(()=>(Zy(i)&&s({inst:i}),n(()=>{Zy(i)&&s({inst:i})})),[n]),YX(r),r}function Zy(n){const e=n.getSnapshot,t=n.value;try{const r=e();return!WX(t,r)}catch{return!0}}function ZX(n,e,t){return e()}const QX=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",KX=!QX,JX=KX?ZX:qX;"useSyncExternalStore"in o_&&(n=>n.useSyncExternalStore)(o_);const eY=te.exports.createContext(null),UI=te.exports.createContext(null);function tY(){return te.exports.useContext(UI)!=null}var iC;(function(n){n.UseRevalidator="useRevalidator"})(iC||(iC={}));var sC;(function(n){n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator"})(sC||(sC={}));function nY(n){let{basename:e="/",children:t=null,location:r,navigationType:i=Na.Pop,navigator:s,static:o=!1}=n;tY()&&FI(!1);let a=e.replace(/^\/*/,"/"),c=te.exports.useMemo(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof r=="string"&&(r=ew(r));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:g="default"}=r,v=te.exports.useMemo(()=>{let y=VX(f,a);return y==null?null:{pathname:y,search:d,hash:h,state:p,key:g}},[a,f,d,h,p,g]);return v==null?null:te.exports.createElement(eY.Provider,{value:c},te.exports.createElement(UI.Provider,{children:t,value:{location:v,navigationType:i}}))}var oC;(function(n){n[n.pending=0]="pending",n[n.success=1]="success",n[n.error=2]="error"})(oC||(oC={}));new Promise(()=>{});/** + * React Router DOM v6.6.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 rY(n){let{basename:e,children:t,window:r}=n,i=te.exports.useRef();i.current==null&&(i.current=kX({window:r,v5Compat:!0}));let s=i.current,[o,a]=te.exports.useState({action:s.action,location:s.location});return te.exports.useLayoutEffect(()=>s.listen(a),[s]),te.exports.createElement(nY,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}var aC;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmitImpl="useSubmitImpl",n.UseFetcher="useFetcher"})(aC||(aC={}));var lC;(function(n){n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(lC||(lC={}));const tw=te.exports.createContext(null);tw.displayName="@mantine/modals/ModalsContext";function iY(){const n=te.exports.useContext(tw);if(!n)throw new Error("[@mantine/modals] useModals hook was called outside of context, wrap your app with ModalsProvider component");return n}var sY=Object.defineProperty,oY=Object.defineProperties,aY=Object.getOwnPropertyDescriptors,uC=Object.getOwnPropertySymbols,lY=Object.prototype.hasOwnProperty,uY=Object.prototype.propertyIsEnumerable,cC=(n,e,t)=>e in n?sY(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Qy=(n,e)=>{for(var t in e||(e={}))lY.call(e,t)&&cC(n,t,e[t]);if(uC)for(var t of uC(e))uY.call(e,t)&&cC(n,t,e[t]);return n},fC=(n,e)=>oY(n,aY(e));function cY({id:n,cancelProps:e,confirmProps:t,labels:r={cancel:"",confirm:""},closeOnConfirm:i=!0,closeOnCancel:s=!0,groupProps:o,onCancel:a,onConfirm:c,children:f}){const{cancel:d,confirm:h}=r,p=iY(),g=y=>{typeof(e==null?void 0:e.onClick)=="function"&&(e==null||e.onClick(y)),typeof a=="function"&&a(),s&&p.closeModal(n)},v=y=>{typeof(t==null?void 0:t.onClick)=="function"&&(t==null||t.onClick(y)),typeof c=="function"&&c(),i&&p.closeModal(n)};return ke.createElement(ke.Fragment,null,f&&ke.createElement(Vi,{mb:"md"},f),ke.createElement(eR,Qy({position:"right"},o),ke.createElement(uT,fC(Qy({variant:"default"},e),{onClick:g}),(e==null?void 0:e.children)||d),ke.createElement(uT,fC(Qy({},t),{onClick:v}),(t==null?void 0:t.children)||h)))}function fY(n,e){switch(e.type){case"OPEN":return{current:e.payload,modals:[...n.modals,e.payload]};case"CLOSE":return{current:n.modals[n.modals.length-2]||null,modals:n.modals.filter(t=>t.id!==e.payload)};case"CLOSE_ALL":return{current:n.current,modals:[]};default:return n}}const[dY,Pd]=Cz("mantine-modals");Pd("openModal");Pd("closeModal");Pd("closeAllModals");Pd("openConfirmModal");Pd("openContextModal");var hY=Object.defineProperty,pY=Object.defineProperties,mY=Object.getOwnPropertyDescriptors,dg=Object.getOwnPropertySymbols,BI=Object.prototype.hasOwnProperty,VI=Object.prototype.propertyIsEnumerable,dC=(n,e,t)=>e in n?hY(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,pm=(n,e)=>{for(var t in e||(e={}))BI.call(e,t)&&dC(n,t,e[t]);if(dg)for(var t of dg(e))VI.call(e,t)&&dC(n,t,e[t]);return n},hC=(n,e)=>pY(n,mY(e)),_a=(n,e)=>{var t={};for(var r in n)BI.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&dg)for(var r of dg(n))e.indexOf(r)<0&&VI.call(n,r)&&(t[r]=n[r]);return t};function gY(n){if(!n)return{confirmProps:{},modalProps:{}};const e=n,{id:t,children:r,onCancel:i,onConfirm:s,closeOnConfirm:o,closeOnCancel:a,cancelProps:c,confirmProps:f,groupProps:d,labels:h}=e,p=_a(e,["id","children","onCancel","onConfirm","closeOnConfirm","closeOnCancel","cancelProps","confirmProps","groupProps","labels"]);return{confirmProps:{id:t,children:r,onCancel:i,onConfirm:s,closeOnConfirm:o,closeOnCancel:a,cancelProps:c,confirmProps:f,groupProps:d,labels:h},modalProps:pm({id:t},p)}}function vY({children:n,modalProps:e,labels:t,modals:r}){const[i,s]=te.exports.useReducer(fY,{modals:[],current:null}),o=y=>{i.modals.forEach(x=>{var w,_,M,E;x.type==="confirm"&&y&&((_=(w=x.props)==null?void 0:w.onCancel)==null||_.call(w)),(E=(M=x.props)==null?void 0:M.onClose)==null||E.call(M)}),s({type:"CLOSE_ALL"})},a=y=>{var x=y,{modalId:w}=x,_=_a(x,["modalId"]);const M=w||iy();return s({type:"OPEN",payload:{id:M,type:"content",props:_}}),M},c=y=>{var x=y,{modalId:w}=x,_=_a(x,["modalId"]);const M=w||iy();return s({type:"OPEN",payload:{id:M,type:"confirm",props:_}}),M},f=(y,x)=>{var w=x,{modalId:_}=w,M=_a(w,["modalId"]);const E=_||iy();return s({type:"OPEN",payload:{id:E,type:"context",props:M,ctx:y}}),E},d=(y,x)=>{var w,_,M,E;if(i.modals.length<=1){o(x);return}const C=i.modals.find(P=>P.id===y);(C==null?void 0:C.type)==="confirm"&&x&&((_=(w=C.props)==null?void 0:w.onCancel)==null||_.call(w)),(E=(M=C==null?void 0:C.props)==null?void 0:M.onClose)==null||E.call(M),s({type:"CLOSE",payload:C.id})};dY({openModal:a,openConfirmModal:c,openContextModal:y=>{var x=y,{modal:w}=x,_=_a(x,["modal"]);return f(w,_)},closeModal:d,closeAllModals:o});const h={modals:i.modals,openModal:a,openConfirmModal:c,openContextModal:f,closeModal:d,closeAll:o},p=()=>{var y;switch((y=i.current)==null?void 0:y.type){case"context":{const x=i.current.props,{innerProps:w}=x,_=_a(x,["innerProps"]),M=r[i.current.ctx];return{modalProps:_,content:at(M,{innerProps:w,context:h,id:i.current.id})}}case"confirm":{const{modalProps:x,confirmProps:w}=gY(i.current.props);return{modalProps:x,content:at(cY,{...hC(pm({},w),{id:i.current.id,labels:i.current.props.labels||t})})}}case"content":{const x=i.current.props,{children:w}=x;return{modalProps:_a(x,["children"]),content:at(Og,{children:w})}}default:return{modalProps:{},content:null}}},{modalProps:g,content:v}=p();return ka(tw.Provider,{value:h,children:[at(aR,{...hC(pm(pm({zIndex:rS("modal")+1},e),g),{opened:i.modals.length>0,onClose:()=>d(i.current.id)}),children:v}),n]})}function yY(n){const e=new Error(n);if(e.stack===void 0)try{throw e}catch{}return e}var _Y=yY,yt=_Y;function xY(n){return!!n&&typeof n.then=="function"}var sn=xY;function SY(n,e){if(n!=null)return n;throw yt(e!=null?e:"Got unexpected null or undefined")}var on=SY;function pt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}class i0{getValue(){throw yt("BaseLoadable")}toPromise(){throw yt("BaseLoadable")}valueMaybe(){throw yt("BaseLoadable")}valueOrThrow(){throw yt(`Loadable expected value, but in "${this.state}" state`)}promiseMaybe(){throw yt("BaseLoadable")}promiseOrThrow(){throw yt(`Loadable expected promise, but in "${this.state}" state`)}errorMaybe(){throw yt("BaseLoadable")}errorOrThrow(){throw yt(`Loadable expected error, but in "${this.state}" state`)}is(e){return e.state===this.state&&e.contents===this.contents}map(e){throw yt("BaseLoadable")}}class wY extends i0{constructor(e){super(),pt(this,"state","hasValue"),pt(this,"contents",void 0),this.contents=e}getValue(){return this.contents}toPromise(){return Promise.resolve(this.contents)}valueMaybe(){return this.contents}valueOrThrow(){return this.contents}promiseMaybe(){}errorMaybe(){}map(e){try{const t=e(this.contents);return sn(t)?tl(t):Du(t)?t:Rd(t)}catch(t){return sn(t)?tl(t.next(()=>this.map(e))):s0(t)}}}class MY extends i0{constructor(e){super(),pt(this,"state","hasError"),pt(this,"contents",void 0),this.contents=e}getValue(){throw this.contents}toPromise(){return Promise.reject(this.contents)}valueMaybe(){}promiseMaybe(){}errorMaybe(){return this.contents}errorOrThrow(){return this.contents}map(e){return this}}class GI extends i0{constructor(e){super(),pt(this,"state","loading"),pt(this,"contents",void 0),this.contents=e}getValue(){throw this.contents}toPromise(){return this.contents}valueMaybe(){}promiseMaybe(){return this.contents}promiseOrThrow(){return this.contents}errorMaybe(){}map(e){return tl(this.contents.then(t=>{const r=e(t);if(Du(r)){const i=r;switch(i.state){case"hasValue":return i.contents;case"hasError":throw i.contents;case"loading":return i.contents}}return r}).catch(t=>{if(sn(t))return t.then(()=>this.map(e).contents);throw t}))}}function Rd(n){return Object.freeze(new wY(n))}function s0(n){return Object.freeze(new MY(n))}function tl(n){return Object.freeze(new GI(n))}function HI(){return Object.freeze(new GI(new Promise(()=>{})))}function bY(n){return n.every(e=>e.state==="hasValue")?Rd(n.map(e=>e.contents)):n.some(e=>e.state==="hasError")?s0(on(n.find(e=>e.state==="hasError"),"Invalid loadable passed to loadableAll").contents):tl(Promise.all(n.map(e=>e.contents)))}function WI(n){const t=(Array.isArray(n)?n:Object.getOwnPropertyNames(n).map(i=>n[i])).map(i=>Du(i)?i:sn(i)?tl(i):Rd(i)),r=bY(t);return Array.isArray(n)?r:r.map(i=>Object.getOwnPropertyNames(n).reduce((s,o,a)=>({...s,[o]:i[a]}),{}))}function Du(n){return n instanceof i0}const EY={of:n=>sn(n)?tl(n):Du(n)?n:Rd(n),error:n=>s0(n),loading:()=>HI(),all:WI,isLoadable:Du};var hl={loadableWithValue:Rd,loadableWithError:s0,loadableWithPromise:tl,loadableLoading:HI,loadableAll:WI,isLoadable:Du,RecoilLoadable:EY},TY=hl.loadableWithValue,CY=hl.loadableWithError,AY=hl.loadableWithPromise,PY=hl.loadableLoading,RY=hl.loadableAll,LY=hl.isLoadable,IY=hl.RecoilLoadable,Ld=Object.freeze({__proto__:null,loadableWithValue:TY,loadableWithError:CY,loadableWithPromise:AY,loadableLoading:PY,loadableAll:RY,isLoadable:LY,RecoilLoadable:IY});const o0=new Map().set("recoil_hamt_2020",!0).set("recoil_sync_external_store",!0).set("recoil_suppress_rerender_in_callback",!0).set("recoil_memory_managament_2020",!0);function a0(n){var e;return(e=o0.get(n))!==null&&e!==void 0?e:!1}a0.setPass=n=>{o0.set(n,!0)};a0.setFail=n=>{o0.set(n,!1)};a0.clear=()=>{o0.clear()};var Yt=a0;function NY(n,e,{error:t}={}){return null}var DY=NY,nw=DY,Ky,Jy,e_;const OY=(Ky=ke.createMutableSource)!==null&&Ky!==void 0?Ky:ke.unstable_createMutableSource,$I=(Jy=ke.useMutableSource)!==null&&Jy!==void 0?Jy:ke.unstable_useMutableSource,jI=(e_=ke.useSyncExternalStore)!==null&&e_!==void 0?e_:ke.unstable_useSyncExternalStore;function kY(){var n;const{ReactCurrentDispatcher:e,ReactCurrentOwner:t}=ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;return((n=e==null?void 0:e.current)!==null&&n!==void 0?n:t.currentDispatcher).useSyncExternalStore!=null}function zY(){return Yt("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:Yt("recoil_sync_external_store")&&jI!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:Yt("recoil_mutable_source")&&$I!=null&&typeof window!="undefined"&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?Yt("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:Yt("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}function FY(){return!1}var Id={createMutableSource:OY,useMutableSource:$I,useSyncExternalStore:jI,currentRendererSupportsUseSyncExternalStore:kY,reactMode:zY,isFastRefreshEnabled:FY};const XI={RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED:!0};function UY(){var n,e,t;if(typeof process=="undefined"||((n=process)===null||n===void 0?void 0:n.env)==null)return;const r=(e={}.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED)===null||e===void 0||(t=e.toLowerCase())===null||t===void 0?void 0:t.trim();if(r==null||r==="")return;if(!["true","false"].includes(r))throw yt(`({}).RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED value must be 'true', 'false', or empty: ${r}`);XI.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=r==="true"}UY();var YI=XI;class rw{constructor(e){pt(this,"key",void 0),this.key=e}toJSON(){return{key:this.key}}}class qI extends rw{}class ZI extends rw{}function BY(n){return n instanceof qI||n instanceof ZI}var l0={AbstractRecoilValue:rw,RecoilState:qI,RecoilValueReadOnly:ZI,isRecoilValue:BY},VY=l0.AbstractRecoilValue,GY=l0.RecoilState,HY=l0.RecoilValueReadOnly,WY=l0.isRecoilValue,Ou=Object.freeze({__proto__:null,AbstractRecoilValue:VY,RecoilState:GY,RecoilValueReadOnly:HY,isRecoilValue:WY});function $Y(n,e){return function*(){let t=0;for(const r of n)yield e(r,t++)}()}var u0=$Y;class QI{}const jY=new QI,nl=new Map,iw=new Map;function XY(n){return u0(n,e=>on(iw.get(e)))}function YY(n){if(nl.has(n)){const e=`Duplicate atom key "${n}". This is a FATAL ERROR in + production. But it is safe to ignore this warning if it occurred because of + hot module replacement.`;console.warn(e)}}function qY(n){YI.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&YY(n.key),nl.set(n.key,n);const e=n.set==null?new Ou.RecoilValueReadOnly(n.key):new Ou.RecoilState(n.key);return iw.set(n.key,e),e}class KI extends Error{}function ZY(n){const e=nl.get(n);if(e==null)throw new KI(`Missing definition for RecoilValue: "${n}""`);return e}function QY(n){return nl.get(n)}const hg=new Map;function KY(n){var e;if(!Yt("recoil_memory_managament_2020"))return;const t=nl.get(n);if(t!=null&&(e=t.shouldDeleteConfigOnRelease)!==null&&e!==void 0&&e.call(t)){var r;nl.delete(n),(r=JI(n))===null||r===void 0||r(),hg.delete(n)}}function JY(n,e){!Yt("recoil_memory_managament_2020")||(e===void 0?hg.delete(n):hg.set(n,e))}function JI(n){return hg.get(n)}var Ir={nodes:nl,recoilValues:iw,registerNode:qY,getNode:ZY,getNodeMaybe:QY,deleteNodeConfigIfPossible:KY,setConfigDeletionHandler:JY,getConfigDeletionHandler:JI,recoilValuesForKeys:XY,NodeMissingError:KI,DefaultValue:QI,DEFAULT_VALUE:jY};function eq(n,e){e()}var tq={enqueueExecution:eq};function nq(n,e){return e={exports:{}},n(e,e.exports),e.exports}var rq=nq(function(n){var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},t={},r=5,i=Math.pow(2,r),s=i-1,o=i/2,a=i/4,c={},f=function(j){return function(){return j}},d=t.hash=function(Q){var j=typeof Q=="undefined"?"undefined":e(Q);if(j==="number")return Q;j!=="string"&&(Q+="");for(var U=0,de=0,ie=Q.length;de>1&1431655765,j=(j&858993459)+(j>>2&858993459),j=j+(j>>4)&252645135,j+=j>>8,j+=j>>16,j&127},p=function(j,U){return U>>>j&s},g=function(j){return 1<=U;)ie[ye--]=ie[ye];return ie[U]=de,ie}for(var Ae=0,Oe=0,Ye=new Array(ee+1);Ae>>=1;return ye[U]=de,Y(j,Oe+1,ye)},$=function(j,U,de,ie){for(var ee=new Array(U-1),ye=0,Ae=0,Oe=0,Ye=ie.length;Oe1?L(j,this.hash,Ye):Ye[0]}var bt=ie();return bt===c?this:(++Ae.value,se(j,de,this.hash,this,ee,T(j,ee,ye,bt)))},G=function(j,U,de,ie,ee,ye,Ae){var Oe=this.mask,Ye=this.children,bt=p(de,ee),_t=g(bt),Ft=v(Oe,_t),$t=Oe&_t,Zn=$t?Ye[Ft]:P,Nr=Zn._modify(j,U,de+r,ie,ee,ye,Ae);if(Zn===Nr)return this;var vs=pe(j,this),ys=Oe,Wi=void 0;if($t&&R(Nr)){if(ys&=~_t,!ys)return P;if(Ye.length<=2&&fe(Ye[Ft^1]))return Ye[Ft^1];Wi=x(vs,Ft,Ye)}else if(!$t&&!R(Nr)){if(Ye.length>=o)return q(j,bt,Nr,Oe,Ye);ys|=_t,Wi=w(vs,Ft,Nr,Ye)}else Wi=y(vs,Ft,Nr,Ye);return vs?(this.mask=ys,this.children=Wi,this):D(j,ys,Wi)},Z=function(j,U,de,ie,ee,ye,Ae){var Oe=this.size,Ye=this.children,bt=p(de,ee),_t=Ye[bt],Ft=(_t||P)._modify(j,U,de+r,ie,ee,ye,Ae);if(_t===Ft)return this;var $t=pe(j,this),Zn=void 0;if(R(_t)&&!R(Ft))++Oe,Zn=y($t,bt,Ft,Ye);else if(!R(_t)&&R(Ft)){if(--Oe,Oe<=a)return $(j,Oe,bt,Ye);Zn=y($t,bt,P,Ye)}else Zn=y($t,bt,Ft,Ye);return $t?(this.size=Oe,this.children=Zn,this):Y(j,Oe,Zn)};P._modify=function(Q,j,U,de,ie,ee,ye){var Ae=de();return Ae===c?P:(++ye.value,T(Q,ie,ee,Ae))};function k(Q,j,U,de,ie){this._editable=Q,this._edit=j,this._config=U,this._root=de,this._size=ie}k.prototype.setTree=function(Q,j){return this._editable?(this._root=Q,this._size=j,this):Q===this._root?this:new k(this._editable,this._edit,this._config,Q,j)};var W=t.tryGetHash=function(Q,j,U,de){for(var ie=de._root,ee=0,ye=de._config.keyEq;;)switch(ie.type){case _:return ye(U,ie.key)?ie.value:Q;case M:{if(j===ie.hash)for(var Ae=ie.children,Oe=0,Ye=Ae.length;Oe{t.set(i,e(r,i))}),t}var pg=uq;function cq(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function fq(n){return{nodeDeps:pg(n.nodeDeps,e=>new Set(e)),nodeToNodeSubscriptions:pg(n.nodeToNodeSubscriptions,e=>new Set(e))}}function t_(n,e,t,r){const{nodeDeps:i,nodeToNodeSubscriptions:s}=t,o=i.get(n);if(o&&r&&o!==r.nodeDeps.get(n))return;i.set(n,e);const a=o==null?e:pf(e,o);for(const c of a)s.has(c)||s.set(c,new Set),on(s.get(c)).add(n);if(o){const c=pf(o,e);for(const f of c){if(!s.has(f))return;const d=on(s.get(f));d.delete(n),d.size===0&&s.delete(f)}}}function dq(n,e,t,r){var i,s,o,a;const c=t.getState();r===c.currentTree.version||r===((i=c.nextTree)===null||i===void 0?void 0:i.version)||((s=c.previousTree)===null||s===void 0||s.version);const f=t.getGraph(r);if(t_(n,e,f),r===((o=c.previousTree)===null||o===void 0?void 0:o.version)){const h=t.getGraph(c.currentTree.version);t_(n,e,h,f)}if(r===((a=c.previousTree)===null||a===void 0?void 0:a.version)||r===c.currentTree.version){var d;const h=(d=c.nextTree)===null||d===void 0?void 0:d.version;if(h!==void 0){const p=t.getGraph(h);t_(n,e,p,f)}}}var Nd={cloneGraph:fq,graph:cq,saveDepsToStore:dq};let hq=0;const pq=()=>hq++;let mq=0;const gq=()=>mq++;let vq=0;const yq=()=>vq++;var c0={getNextTreeStateVersion:pq,getNextStoreID:gq,getNextComponentID:yq};const{persistentMap:pC}=aq,{graph:_q}=Nd,{getNextTreeStateVersion:eN}=c0;function tN(){const n=eN();return{version:n,stateID:n,transactionMetadata:{},dirtyAtoms:new Set,atomValues:pC(),nonvalidatedAtoms:pC()}}function xq(){const n=tN();return{currentTree:n,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(n.version,_q()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var nN={makeEmptyTreeState:tN,makeEmptyStoreState:xq,getNextTreeStateVersion:eN};class rN{}function Sq(){return new rN}var f0={RetentionZone:rN,retentionZone:Sq};function wq(n,e){const t=new Set(n);return t.add(e),t}function Mq(n,e){const t=new Set(n);return t.delete(e),t}function bq(n,e,t){const r=new Map(n);return r.set(e,t),r}function Eq(n,e,t){const r=new Map(n);return r.set(e,t(r.get(e))),r}function Tq(n,e){const t=new Map(n);return t.delete(e),t}function Cq(n,e){const t=new Map(n);return e.forEach(r=>t.delete(r)),t}var iN={setByAddingToSet:wq,setByDeletingFromSet:Mq,mapBySettingInMap:bq,mapByUpdatingInMap:Eq,mapByDeletingFromMap:Tq,mapByDeletingMultipleFromMap:Cq};function*Aq(n,e){let t=0;for(const r of n)e(r,t++)&&(yield r)}var aw=Aq;function Pq(n,e){return new Proxy(n,{get:(r,i)=>(!(i in r)&&i in e&&(r[i]=e[i]()),r[i]),ownKeys:r=>Object.keys(r)})}var sN=Pq;const{getNode:Dd,getNodeMaybe:Rq,recoilValuesForKeys:mC}=Ir,{RetentionZone:gC}=f0,{setByAddingToSet:Lq}=iN,Iq=Object.freeze(new Set);class Nq extends Error{}function Dq(n,e,t){if(!Yt("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=n.getState().retention;function i(s){let o=r.get(s);o||r.set(s,o=new Set),o.add(e)}if(t instanceof gC)i(t);else if(Array.isArray(t))for(const s of t)i(s);return()=>{if(!Yt("recoil_memory_managament_2020"))return;const{retention:s}=n.getState();function o(a){const c=s.nodesRetainedByZone.get(a);c==null||c.delete(e),c&&c.size===0&&s.nodesRetainedByZone.delete(a)}if(t instanceof gC)o(t);else if(Array.isArray(t))for(const a of t)o(a)}}function lw(n,e,t,r){const i=n.getState();if(i.nodeCleanupFunctions.has(t))return;const s=Dd(t),o=Dq(n,t,s.retainedBy),a=s.init(n,e,r);i.nodeCleanupFunctions.set(t,()=>{a(),o()})}function Oq(n,e,t){lw(n,n.getState().currentTree,e,t)}function kq(n,e){var t;const r=n.getState();(t=r.nodeCleanupFunctions.get(e))===null||t===void 0||t(),r.nodeCleanupFunctions.delete(e)}function zq(n,e,t){return lw(n,e,t,"get"),Dd(t).get(n,e)}function oN(n,e,t){return Dd(t).peek(n,e)}function Fq(n,e,t){var r;const i=Rq(e);return i==null||(r=i.invalidate)===null||r===void 0||r.call(i,n),{...n,atomValues:n.atomValues.clone().delete(e),nonvalidatedAtoms:n.nonvalidatedAtoms.clone().set(e,t),dirtyAtoms:Lq(n.dirtyAtoms,e)}}function Uq(n,e,t,r){const i=Dd(t);if(i.set==null)throw new Nq(`Attempt to set read-only RecoilValue: ${t}`);const s=i.set;return lw(n,e,t,"set"),s(n,e,r)}function Bq(n,e,t){const r=n.getState(),i=n.getGraph(e.version),s=Dd(t).nodeType;return sN({type:s},{loadable:()=>oN(n,e,t),isActive:()=>r.knownAtoms.has(t)||r.knownSelectors.has(t),isSet:()=>s==="selector"?!1:e.atomValues.has(t),isModified:()=>e.dirtyAtoms.has(t),deps:()=>{var o;return mC((o=i.nodeDeps.get(t))!==null&&o!==void 0?o:[])},subscribers:()=>{var o,a;return{nodes:mC(aw(aN(n,e,new Set([t])),c=>c!==t)),components:u0((o=(a=r.nodeToComponentSubscriptions.get(t))===null||a===void 0?void 0:a.values())!==null&&o!==void 0?o:[],([c])=>({name:c}))}}})}function aN(n,e,t){const r=new Set,i=Array.from(t),s=n.getGraph(e.version);for(let a=i.pop();a;a=i.pop()){var o;r.add(a);const c=(o=s.nodeToNodeSubscriptions.get(a))!==null&&o!==void 0?o:Iq;for(const f of c)r.has(f)||i.push(f)}return r}var Qo={getNodeLoadable:zq,peekNodeLoadable:oN,setNodeValue:Uq,initializeNode:Oq,cleanUpNode:kq,setUnvalidatedAtomValue_DEPRECATED:Fq,peekNodeInfo:Bq,getDownstreamNodes:aN};let lN=null;function Vq(n){lN=n}function Gq(){var n;(n=lN)===null||n===void 0||n()}var uN={setInvalidateMemoizedSnapshot:Vq,invalidateMemoizedSnapshot:Gq};const{getDownstreamNodes:Hq,getNodeLoadable:cN,setNodeValue:Wq}=Qo,{getNextComponentID:$q}=c0,{getNode:jq,getNodeMaybe:fN}=Ir,{DefaultValue:uw}=Ir,{reactMode:Xq}=Id,{AbstractRecoilValue:Yq,RecoilState:qq,RecoilValueReadOnly:Zq,isRecoilValue:Qq}=Ou,{invalidateMemoizedSnapshot:Kq}=uN;function Jq(n,{key:e},t=n.getState().currentTree){var r,i;const s=n.getState();t.version===s.currentTree.version||t.version===((r=s.nextTree)===null||r===void 0?void 0:r.version)||(t.version,(i=s.previousTree)===null||i===void 0||i.version);const o=cN(n,t,e);return o.state==="loading"&&o.contents.catch(()=>{}),o}function eZ(n,e){const t=n.clone();return e.forEach((r,i)=>{r.state==="hasValue"&&r.contents instanceof uw?t.delete(i):t.set(i,r)}),t}function tZ(n,e,{key:t},r){if(typeof r=="function"){const i=cN(n,e,t);if(i.state==="loading"){const s=`Tried to set atom or selector "${t}" using an updater function while the current state is pending, this is not currently supported.`;throw yt(s)}else if(i.state==="hasError")throw i.contents;return r(i.contents)}else return r}function nZ(n,e,t){if(t.type==="set"){const{recoilValue:i,valueOrUpdater:s}=t,o=tZ(n,e,i,s),a=Wq(n,e,i.key,o);for(const[c,f]of a.entries())qx(e,c,f)}else if(t.type==="setLoadable"){const{recoilValue:{key:i},loadable:s}=t;qx(e,i,s)}else if(t.type==="markModified"){const{recoilValue:{key:i}}=t;e.dirtyAtoms.add(i)}else if(t.type==="setUnvalidated"){var r;const{recoilValue:{key:i},unvalidatedValue:s}=t,o=fN(i);o==null||(r=o.invalidate)===null||r===void 0||r.call(o,e),e.atomValues.delete(i),e.nonvalidatedAtoms.set(i,s),e.dirtyAtoms.add(i)}else nw(`Unknown action ${t.type}`)}function qx(n,e,t){t.state==="hasValue"&&t.contents instanceof uw?n.atomValues.delete(e):n.atomValues.set(e,t),n.dirtyAtoms.add(e),n.nonvalidatedAtoms.delete(e)}function dN(n,e){n.replaceState(t=>{const r=hN(t);for(const i of e)nZ(n,r,i);return pN(n,r),Kq(),r})}function d0(n,e){if(mf.length){const t=mf[mf.length-1];let r=t.get(n);r||t.set(n,r=[]),r.push(e)}else dN(n,[e])}const mf=[];function rZ(){const n=new Map;return mf.push(n),()=>{for(const[e,t]of n)dN(e,t);mf.pop()}}function hN(n){return{...n,atomValues:n.atomValues.clone(),nonvalidatedAtoms:n.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(n.dirtyAtoms)}}function pN(n,e){const t=Hq(n,e,e.dirtyAtoms);for(const s of t){var r,i;(r=fN(s))===null||r===void 0||(i=r.invalidate)===null||i===void 0||i.call(r,e)}}function mN(n,e,t){d0(n,{type:"set",recoilValue:e,valueOrUpdater:t})}function iZ(n,e,t){if(t instanceof uw)return mN(n,e,t);d0(n,{type:"setLoadable",recoilValue:e,loadable:t})}function sZ(n,e){d0(n,{type:"markModified",recoilValue:e})}function oZ(n,e,t){d0(n,{type:"setUnvalidated",recoilValue:e,unvalidatedValue:t})}function aZ(n,{key:e},t,r=null){const i=$q(),s=n.getState();s.nodeToComponentSubscriptions.has(e)||s.nodeToComponentSubscriptions.set(e,new Map),on(s.nodeToComponentSubscriptions.get(e)).set(i,[r!=null?r:"",t]);const o=Xq();if(o.early&&(o.mode==="LEGACY"||o.mode==="MUTABLE_SOURCE")){const a=n.getState().nextTree;a&&a.dirtyAtoms.has(e)&&t(a)}return{release:()=>{const a=n.getState(),c=a.nodeToComponentSubscriptions.get(e);c===void 0||!c.has(i)||(c.delete(i),c.size===0&&a.nodeToComponentSubscriptions.delete(e))}}}function lZ(n,e){var t;const{currentTree:r}=n.getState(),i=jq(e.key);(t=i.clearCache)===null||t===void 0||t.call(i,n,r)}var ms={RecoilValueReadOnly:Zq,AbstractRecoilValue:Yq,RecoilState:qq,getRecoilValueAsLoadable:Jq,setRecoilValue:mN,setRecoilValueLoadable:iZ,markRecoilValueModified:sZ,setUnvalidatedRecoilValue:oZ,subscribeToRecoilValue:aZ,isRecoilValue:Qq,applyAtomValueWrites:eZ,batchStart:rZ,writeLoadableToTreeState:qx,invalidateDownstreams:pN,copyTreeState:hN,refreshRecoilValue:lZ};function uZ(n,e,t){const r=n.entries();let i=r.next();for(;!i.done;){const s=i.value;if(e.call(t,s[1],s[0],n))return!0;i=r.next()}return!1}var cZ=uZ;const{cleanUpNode:fZ}=Qo,{deleteNodeConfigIfPossible:dZ,getNode:gN}=Ir,{RetentionZone:vN}=f0,hZ=12e4,yN=new Set;function _N(n,e){const t=n.getState(),r=t.currentTree;if(t.nextTree)return;const i=new Set;for(const o of e)if(o instanceof vN)for(const a of vZ(t,o))i.add(a);else i.add(o);const s=pZ(n,i);for(const o of s)gZ(n,r,o)}function pZ(n,e){const t=n.getState(),r=t.currentTree,i=n.getGraph(r.version),s=new Set,o=new Set;return a(e),s;function a(c){const f=new Set,d=mZ(n,r,c,s,o);for(const v of d){var h;if(gN(v).retainedBy==="recoilRoot"){o.add(v);continue}if(((h=t.retention.referenceCounts.get(v))!==null&&h!==void 0?h:0)>0){o.add(v);continue}if(xN(v).some(x=>t.retention.referenceCounts.get(x))){o.add(v);continue}const y=i.nodeToNodeSubscriptions.get(v);if(y&&cZ(y,x=>o.has(x))){o.add(v);continue}s.add(v),f.add(v)}const p=new Set;for(const v of f)for(const y of(g=i.nodeDeps.get(v))!==null&&g!==void 0?g:yN){var g;s.has(y)||p.add(y)}p.size&&a(p)}}function mZ(n,e,t,r,i){const s=n.getGraph(e.version),o=[],a=new Set;for(;t.size>0;)c(on(t.values().next().value));return o;function c(f){if(r.has(f)||i.has(f)){t.delete(f);return}if(a.has(f))return;const d=s.nodeToNodeSubscriptions.get(f);if(d)for(const h of d)c(h);a.add(f),t.delete(f),o.push(f)}}function gZ(n,e,t){if(!Yt("recoil_memory_managament_2020"))return;fZ(n,t);const r=n.getState();r.knownAtoms.delete(t),r.knownSelectors.delete(t),r.nodeTransactionSubscriptions.delete(t),r.retention.referenceCounts.delete(t);const i=xN(t);for(const c of i){var s;(s=r.retention.nodesRetainedByZone.get(c))===null||s===void 0||s.delete(t)}e.atomValues.delete(t),e.dirtyAtoms.delete(t),e.nonvalidatedAtoms.delete(t);const o=r.graphsByVersion.get(e.version);if(o){const c=o.nodeDeps.get(t);if(c!==void 0){o.nodeDeps.delete(t);for(const f of c){var a;(a=o.nodeToNodeSubscriptions.get(f))===null||a===void 0||a.delete(t)}}o.nodeToNodeSubscriptions.delete(t)}dZ(t)}function vZ(n,e){var t;return(t=n.retention.nodesRetainedByZone.get(e))!==null&&t!==void 0?t:yN}function xN(n){const e=gN(n).retainedBy;return e===void 0||e==="components"||e==="recoilRoot"?[]:e instanceof vN?[e]:e}function yZ(n,e){const t=n.getState();t.nextTree?t.retention.retainablesToCheckForRelease.add(e):_N(n,new Set([e]))}function _Z(n,e,t){var r;if(!Yt("recoil_memory_managament_2020"))return;const i=n.getState().retention.referenceCounts,s=((r=i.get(e))!==null&&r!==void 0?r:0)+t;s===0?SN(n,e):i.set(e,s)}function SN(n,e){if(!Yt("recoil_memory_managament_2020"))return;n.getState().retention.referenceCounts.delete(e),yZ(n,e)}function xZ(n){if(!Yt("recoil_memory_managament_2020"))return;const e=n.getState();_N(n,e.retention.retainablesToCheckForRelease),e.retention.retainablesToCheckForRelease.clear()}function SZ(n){return n===void 0?"recoilRoot":n}var pl={SUSPENSE_TIMEOUT_MS:hZ,updateRetainCount:_Z,updateRetainCountToZero:SN,releaseScheduledRetainablesNow:xZ,retainedByOptionWithDefault:SZ};const{unstable_batchedUpdates:wZ}=yz;var MZ={unstable_batchedUpdates:wZ};const{unstable_batchedUpdates:bZ}=MZ;var EZ={unstable_batchedUpdates:bZ};const{batchStart:TZ}=ms,{unstable_batchedUpdates:CZ}=EZ;let cw=CZ;const AZ=n=>{cw=n},PZ=()=>cw,RZ=n=>{cw(()=>{let e=()=>{};try{e=TZ(),n()}finally{e()}})};var h0={getBatcher:PZ,setBatcher:AZ,batchUpdates:RZ};function*LZ(n){for(const e of n)for(const t of e)yield t}var wN=LZ;const MN=typeof Window=="undefined"||typeof window=="undefined",IZ=n=>!MN&&(n===window||n instanceof Window),NZ=typeof navigator!="undefined"&&navigator.product==="ReactNative";var fw={isSSR:MN,isReactNative:NZ,isWindow:IZ};function DZ(n,e){let t;return(...i)=>{t||(t={});const s=e(...i);return Object.hasOwnProperty.call(t,s)||(t[s]=n(...i)),t[s]}}function OZ(n,e){let t,r;return(...s)=>{const o=e(...s);return t===o||(t=o,r=n(...s)),r}}function kZ(n,e){let t,r;return[(...o)=>{const a=e(...o);return t===a||(t=a,r=n(...o)),r},()=>{t=null}]}var zZ={memoizeWithArgsHash:DZ,memoizeOneWithArgsHash:OZ,memoizeOneWithArgsHashAndInvalidation:kZ};const{batchUpdates:Zx}=h0,{initializeNode:FZ,peekNodeInfo:UZ}=Qo,{graph:BZ}=Nd,{getNextStoreID:VZ}=c0,{DEFAULT_VALUE:GZ,recoilValues:vC,recoilValuesForKeys:yC}=Ir,{AbstractRecoilValue:HZ,getRecoilValueAsLoadable:WZ,setRecoilValue:_C,setUnvalidatedRecoilValue:$Z}=ms,{updateRetainCount:mm}=pl,{setInvalidateMemoizedSnapshot:jZ}=uN,{getNextTreeStateVersion:XZ,makeEmptyStoreState:YZ}=nN,{isSSR:qZ}=fw,{memoizeOneWithArgsHashAndInvalidation:ZZ}=zZ;class p0{constructor(e,t){pt(this,"_store",void 0),pt(this,"_refCount",1),pt(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),WZ(this._store,r))),pt(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),pt(this,"getNodes_UNSTABLE",r=>{if(this.checkRefCount_INTERNAL(),(r==null?void 0:r.isModified)===!0){if((r==null?void 0:r.isInitialized)===!1)return[];const o=this._store.getState().currentTree;return yC(o.dirtyAtoms)}const i=this._store.getState().knownAtoms,s=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?vC.values():r.isInitialized===!0?yC(wN([i,s])):aw(vC.values(),({key:o})=>!i.has(o)&&!s.has(o))}),pt(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),UZ(this._store,this._store.getState().currentTree,r))),pt(this,"map",r=>{this.checkRefCount_INTERNAL();const i=new Qx(this,Zx);return r(i),i}),pt(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const i=new Qx(this,Zx);return i.retain(),await r(i),i.autoRelease_INTERNAL(),i}),this._store={storeID:VZ(),parentStoreID:t,getState:()=>e,replaceState:r=>{e.currentTree=r(e.currentTree)},getGraph:r=>{const i=e.graphsByVersion;if(i.has(r))return on(i.get(r));const s=BZ();return i.set(r,s),s},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw yt("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)FZ(this._store,r,"get"),mm(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let e=!1;return()=>{e||(e=!0,this._release())}}autoRelease_INTERNAL(){qZ||window.setTimeout(()=>this._release(),10)}_release(){if(this._refCount--,this._refCount===0){if(this._store.getState().nodeCleanupFunctions.forEach(e=>e()),this._store.getState().nodeCleanupFunctions.clear(),!Yt("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){Yt("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function bN(n,e,t=!1){const r=n.getState(),i=t?XZ():e.version;return{currentTree:{version:t?i:e.version,stateID:t?i:e.stateID,transactionMetadata:{...e.transactionMetadata},dirtyAtoms:new Set(e.dirtyAtoms),atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(i,n.getGraph(e.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(u0(r.nodeCleanupFunctions.entries(),([s])=>[s,()=>{}]))}}function QZ(n){const e=new p0(YZ());return n!=null?e.map(n):e}const[xC,EN]=ZZ((n,e)=>{var t;const r=n.getState(),i=e==="latest"?(t=r.nextTree)!==null&&t!==void 0?t:r.currentTree:on(r.previousTree);return new p0(bN(n,i),n.storeID)},(n,e)=>{var t,r;return String(e)+String(n.storeID)+String((t=n.getState().nextTree)===null||t===void 0?void 0:t.version)+String(n.getState().currentTree.version)+String((r=n.getState().previousTree)===null||r===void 0?void 0:r.version)});jZ(EN);function KZ(n,e="latest"){const t=xC(n,e);return t.isRetained()?t:(EN(),xC(n,e))}class Qx extends p0{constructor(e,t){super(bN(e.getStore_INTERNAL(),e.getStore_INTERNAL().getState().currentTree,!0),e.getStoreID()),pt(this,"_batch",void 0),pt(this,"set",(r,i)=>{this.checkRefCount_INTERNAL();const s=this.getStore_INTERNAL();this._batch(()=>{mm(s,r.key,1),_C(this.getStore_INTERNAL(),r,i)})}),pt(this,"reset",r=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{mm(i,r.key,1),_C(this.getStore_INTERNAL(),r,GZ)})}),pt(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();Zx(()=>{for(const[s,o]of r.entries())mm(i,s,1),$Z(i,new HZ(s),o)})}),this._batch=t}}var m0={Snapshot:p0,MutableSnapshot:Qx,freshSnapshot:QZ,cloneSnapshot:KZ},JZ=m0.Snapshot,eQ=m0.MutableSnapshot,tQ=m0.freshSnapshot,nQ=m0.cloneSnapshot,g0=Object.freeze({__proto__:null,Snapshot:JZ,MutableSnapshot:eQ,freshSnapshot:tQ,cloneSnapshot:nQ});function rQ(...n){const e=new Set;for(const t of n)for(const r of t)e.add(r);return e}var iQ=rQ;const{useRef:sQ}=ke;function oQ(n){const e=sQ(n);return e.current===n&&typeof n=="function"&&(e.current=n()),e}var SC=oQ;const{getNextTreeStateVersion:aQ,makeEmptyStoreState:TN}=nN,{cleanUpNode:lQ,getDownstreamNodes:uQ,initializeNode:cQ,setNodeValue:fQ,setUnvalidatedAtomValue_DEPRECATED:dQ}=Qo,{graph:hQ}=Nd,{cloneGraph:pQ}=Nd,{getNextStoreID:CN}=c0,{createMutableSource:n_,reactMode:AN}=Id,{applyAtomValueWrites:mQ}=ms,{releaseScheduledRetainablesNow:PN}=pl,{freshSnapshot:gQ}=g0,{useCallback:vQ,useContext:RN,useEffect:Kx,useMemo:yQ,useRef:_Q,useState:xQ}=ke;function Gc(){throw yt("This component must be used inside a component.")}const LN=Object.freeze({storeID:CN(),getState:Gc,replaceState:Gc,getGraph:Gc,subscribeToTransactions:Gc,addTransactionMetadata:Gc});let Jx=!1;function wC(n){if(Jx)throw yt("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");const e=n.getState();if(e.nextTree===null){Yt("recoil_memory_managament_2020")&&Yt("recoil_release_on_cascading_update_killswitch_2021")&&e.commitDepth>0&&PN(n);const t=e.currentTree.version,r=aQ();e.nextTree={...e.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},e.graphsByVersion.set(r,pQ(on(e.graphsByVersion.get(t))))}}const IN=ke.createContext({current:LN}),v0=()=>RN(IN),NN=ke.createContext(null);function SQ(){return RN(NN)}function dw(n,e,t){const r=uQ(n,t,t.dirtyAtoms);for(const i of r){const s=e.nodeToComponentSubscriptions.get(i);if(s)for(const[o,[a,c]]of s)c(t)}}function DN(n){const e=n.getState(),t=e.currentTree,r=t.dirtyAtoms;if(r.size){for(const[i,s]of e.nodeTransactionSubscriptions)if(r.has(i))for(const[o,a]of s)a(n);for(const[i,s]of e.transactionSubscriptions)s(n);(!AN().early||e.suspendedComponentResolvers.size>0)&&(dw(n,e,t),e.suspendedComponentResolvers.forEach(i=>i()),e.suspendedComponentResolvers.clear())}e.queuedComponentCallbacks_DEPRECATED.forEach(i=>i(t)),e.queuedComponentCallbacks_DEPRECATED.splice(0,e.queuedComponentCallbacks_DEPRECATED.length)}function wQ(n){const e=n.getState();e.commitDepth++;try{const{nextTree:t}=e;if(t==null)return;e.previousTree=e.currentTree,e.currentTree=t,e.nextTree=null,DN(n),e.previousTree!=null?e.graphsByVersion.delete(e.previousTree.version):nw("Ended batch with no previous state, which is unexpected","recoil"),e.previousTree=null,Yt("recoil_memory_managament_2020")&&t==null&&PN(n)}finally{e.commitDepth--}}function MQ({setNotifyBatcherOfChange:n}){const e=v0(),[,t]=xQ([]);return n(()=>t({})),Kx(()=>(n(()=>t({})),()=>{n(()=>{})}),[n]),Kx(()=>{tq.enqueueExecution("Batcher",()=>{wQ(e.current)})}),null}function bQ(n,e){const t=TN();return e({set:(r,i)=>{const s=t.currentTree,o=fQ(n,s,r.key,i),a=new Set(o.keys()),c=s.nonvalidatedAtoms.clone();for(const f of a)c.delete(f);t.currentTree={...s,dirtyAtoms:iQ(s.dirtyAtoms,a),atomValues:mQ(s.atomValues,o),nonvalidatedAtoms:c}},setUnvalidatedAtomValues:r=>{r.forEach((i,s)=>{t.currentTree=dQ(t.currentTree,s,i)})}}),t}function EQ(n){const e=gQ(n),t=e.getStore_INTERNAL().getState();return e.retain(),t.nodeCleanupFunctions.forEach(r=>r()),t.nodeCleanupFunctions.clear(),t}let MC=0;function TQ({initializeState_DEPRECATED:n,initializeState:e,store_INTERNAL:t,children:r}){let i;const s=g=>{const v=i.current.graphsByVersion;if(v.has(g))return on(v.get(g));const y=hQ();return v.set(g,y),y},o=(g,v)=>{if(v==null){const{transactionSubscriptions:y}=h.current.getState(),x=MC++;return y.set(x,g),{release:()=>{y.delete(x)}}}else{const{nodeTransactionSubscriptions:y}=h.current.getState();y.has(v)||y.set(v,new Map);const x=MC++;return on(y.get(v)).set(x,g),{release:()=>{const w=y.get(v);w&&(w.delete(x),w.size===0&&y.delete(v))}}}},a=g=>{wC(h.current);for(const v of Object.keys(g))on(h.current.getState().nextTree).transactionMetadata[v]=g[v]},c=g=>{wC(h.current);const v=on(i.current.nextTree);let y;try{Jx=!0,y=g(v)}finally{Jx=!1}y!==v&&(i.current.nextTree=y,AN().early&&dw(h.current,i.current,y),on(f.current)())},f=_Q(null),d=vQ(g=>{f.current=g},[f]),h=SC(()=>t!=null?t:{storeID:CN(),getState:()=>i.current,replaceState:c,getGraph:s,subscribeToTransactions:o,addTransactionMetadata:a});t!=null&&(h.current=t),i=SC(()=>n!=null?bQ(h.current,n):e!=null?EQ(e):TN());const p=yQ(()=>n_==null?void 0:n_(i,()=>i.current.currentTree.version),[i]);return Kx(()=>{const g=h.current;for(const v of new Set(g.getState().knownAtoms))cQ(g,v,"get");return()=>{for(const v of g.getState().knownAtoms)lQ(g,v)}},[h]),ke.createElement(IN.Provider,{value:h},ke.createElement(NN.Provider,{value:p},ke.createElement(MQ,{setNotifyBatcherOfChange:d}),r))}function CQ(n){const{override:e,...t}=n,r=v0();return e===!1&&r.current!==LN?n.children:ke.createElement(TQ,t)}function AQ(){return v0().current.storeID}var Ks={RecoilRoot:CQ,useStoreRef:v0,useRecoilMutableSource:SQ,useRecoilStoreID:AQ,notifyComponents_FOR_TESTING:dw,sendEndOfBatchNotifications_FOR_TESTING:DN};function PQ(n,e){if(n===e)return!0;if(n.length!==e.length)return!1;for(let t=0,r=n.length;t{e.current=n}),e.current}var ON=NQ;const{useStoreRef:DQ}=Ks,{SUSPENSE_TIMEOUT_MS:OQ}=pl,{updateRetainCount:Hc}=pl,{RetentionZone:kQ}=f0,{useEffect:zQ,useRef:FQ}=ke,{isSSR:bC}=fw;function UQ(n){if(!!Yt("recoil_memory_managament_2020"))return BQ(n)}function BQ(n){const t=(Array.isArray(n)?n:[n]).map(o=>o instanceof kQ?o:o.key),r=DQ();zQ(()=>{if(!Yt("recoil_memory_managament_2020"))return;const o=r.current;if(i.current&&!bC)window.clearTimeout(i.current),i.current=null;else for(const a of t)Hc(o,a,1);return()=>{for(const a of t)Hc(o,a,-1)}},[r,...t]);const i=FQ(),s=ON(t);if(!bC&&(s===void 0||!RQ(s,t))){const o=r.current;for(const a of t)Hc(o,a,1);if(s)for(const a of s)Hc(o,a,-1);i.current&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{i.current=null;for(const a of t)Hc(o,a,-1)},OQ)}}var hw=UQ;function VQ(){return""}var Od=VQ;const{batchUpdates:GQ}=h0,{DEFAULT_VALUE:kN}=Ir,{currentRendererSupportsUseSyncExternalStore:HQ,reactMode:Zu,useMutableSource:WQ,useSyncExternalStore:$Q}=Id,{useRecoilMutableSource:jQ,useStoreRef:gs}=Ks,{AbstractRecoilValue:e1,getRecoilValueAsLoadable:kd,setRecoilValue:mg,setUnvalidatedRecoilValue:XQ,subscribeToRecoilValue:ku}=ms,{useCallback:Rr,useEffect:zu,useMemo:zN,useRef:gf,useState:pw}=ke,{setByAddingToSet:YQ}=iN;function mw(n,e,t){if(n.state==="hasValue")return n.contents;throw n.state==="loading"?new Promise(i=>{t.current.getState().suspendedComponentResolvers.add(i)}):n.state==="hasError"?n.contents:yt(`Invalid value of loadable atom "${e.key}"`)}function qQ(){const n=Od(),e=gs(),[,t]=pw([]),r=gf(new Set);r.current=new Set;const i=gf(new Set),s=gf(new Map),o=Rr(c=>{const f=s.current.get(c);f&&(f.release(),s.current.delete(c))},[s]),a=Rr((c,f)=>{s.current.has(f)&&t([])},[]);return zu(()=>{const c=e.current;pf(r.current,i.current).forEach(f=>{if(s.current.has(f))return;const d=ku(c,new e1(f),p=>a(p,f),n);s.current.set(f,d),c.getState().nextTree?c.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a(c.getState(),f)}):a(c.getState(),f)}),pf(i.current,r.current).forEach(f=>{o(f)}),i.current=r.current}),zu(()=>{const c=s.current;return pf(r.current,new Set(c.keys())).forEach(f=>{const d=ku(e.current,new e1(f),h=>a(h,f),n);c.set(f,d)}),()=>c.forEach((f,d)=>o(d))},[n,e,o,a]),zN(()=>{function c(v){return y=>{mg(e.current,v,y)}}function f(v){return()=>mg(e.current,v,kN)}function d(v){var y;r.current.has(v.key)||(r.current=YQ(r.current,v.key));const x=e.current.getState();return kd(e.current,v,Zu().early&&(y=x.nextTree)!==null&&y!==void 0?y:x.currentTree)}function h(v){const y=d(v);return mw(y,v,e)}function p(v){return[h(v),c(v)]}function g(v){return[d(v),c(v)]}return{getRecoilValue:h,getRecoilValueLoadable:d,getRecoilState:p,getRecoilStateLoadable:g,getSetRecoilState:c,getResetRecoilState:f}},[r,e])}const ZQ={current:0};function QQ(n){const e=gs(),t=Od(),r=Rr(()=>{var a;const c=e.current,f=c.getState(),d=Zu().early&&(a=f.nextTree)!==null&&a!==void 0?a:f.currentTree;return{loadable:kd(c,n,d),key:n.key}},[e,n]),i=Rr(a=>{let c;return()=>{var f,d;const h=a();return(f=c)!==null&&f!==void 0&&f.loadable.is(h.loadable)&&((d=c)===null||d===void 0?void 0:d.key)===h.key?c:(c=h,h)}},[]),s=zN(()=>i(r),[r,i]),o=Rr(a=>{const c=e.current;return ku(c,n,a,t).release},[e,n,t]);return $Q(o,s,s).loadable}function KQ(n){const e=gs(),t=Rr(()=>{var f;const d=e.current,h=d.getState(),p=Zu().early&&(f=h.nextTree)!==null&&f!==void 0?f:h.currentTree;return kd(d,n,p)},[e,n]),r=Rr(()=>t(),[t]),i=Od(),s=Rr((f,d)=>{const h=e.current;return ku(h,n,()=>{if(!Yt("recoil_suppress_rerender_in_callback"))return d();const g=t();c.current.is(g)||d(),c.current=g},i).release},[e,n,i,t]),o=jQ();if(o==null)throw yt("Recoil hooks must be used in components contained within a component.");const a=WQ(o,r,s),c=gf(a);return zu(()=>{c.current=a}),a}function t1(n){const e=gs(),t=Od(),r=Rr(()=>{var c;const f=e.current,d=f.getState(),h=Zu().early&&(c=d.nextTree)!==null&&c!==void 0?c:d.currentTree;return kd(f,n,h)},[e,n]),i=Rr(()=>({loadable:r(),key:n.key}),[r,n.key]),s=Rr(c=>{const f=i();return c.loadable.is(f.loadable)&&c.key===f.key?c:f},[i]);zu(()=>{const c=ku(e.current,n,f=>{a(s)},t);return a(s),c.release},[t,n,e,s]);const[o,a]=pw(i);return o.key!==n.key?i().loadable:o.loadable}function JQ(n){const e=gs(),[,t]=pw([]),r=Od(),i=Rr(()=>{var a;const c=e.current,f=c.getState(),d=Zu().early&&(a=f.nextTree)!==null&&a!==void 0?a:f.currentTree;return kd(c,n,d)},[e,n]),s=i(),o=gf(s);return zu(()=>{o.current=s}),zu(()=>{const a=e.current,c=a.getState(),f=ku(a,n,h=>{var p;if(!Yt("recoil_suppress_rerender_in_callback"))return t([]);const g=i();(p=o.current)!==null&&p!==void 0&&p.is(g)||t(g),o.current=g},r);if(c.nextTree)a.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{o.current=null,t([])});else{var d;if(!Yt("recoil_suppress_rerender_in_callback"))return t([]);const h=i();(d=o.current)!==null&&d!==void 0&&d.is(h)||t(h),o.current=h}return f.release},[r,i,n,e]),s}function gw(n){return Yt("recoil_memory_managament_2020")&&hw(n),{TRANSITION_SUPPORT:t1,SYNC_EXTERNAL_STORE:HQ()?QQ:t1,MUTABLE_SOURCE:KQ,LEGACY:JQ}[Zu().mode](n)}function FN(n){const e=gs(),t=gw(n);return mw(t,n,e)}function y0(n){const e=gs();return Rr(t=>{mg(e.current,n,t)},[e,n])}function eK(n){const e=gs();return Rr(()=>{mg(e.current,n,kN)},[e,n])}function tK(n){return[FN(n),y0(n)]}function nK(n){return[gw(n),y0(n)]}function rK(){const n=gs();return(e,t={})=>{GQ(()=>{n.current.addTransactionMetadata(t),e.forEach((r,i)=>XQ(n.current,new e1(i),r))})}}function UN(n){return Yt("recoil_memory_managament_2020")&&hw(n),t1(n)}function BN(n){const e=gs(),t=UN(n);return mw(t,n,e)}function iK(n){return[BN(n),y0(n)]}var sK={recoilComponentGetRecoilValueCount_FOR_TESTING:ZQ,useRecoilInterface:qQ,useRecoilState:tK,useRecoilStateLoadable:nK,useRecoilValue:FN,useRecoilValueLoadable:gw,useResetRecoilState:eK,useSetRecoilState:y0,useSetUnvalidatedAtomValues:rK,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:UN,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:BN,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:iK};function oK(n,e){const t=new Map;for(const[r,i]of n)e(i,r)&&t.set(r,i);return t}var aK=oK;function lK(n,e){const t=new Set;for(const r of n)e(r)&&t.add(r);return t}var uK=lK;function cK(...n){const e=new Map;for(let t=0;te.current.subscribeToTransactions(n).release,[n,e])}function CC(n){const e=n.atomValues.toMap(),t=pg(aK(e,(r,i)=>{const o=VN(i).persistence_UNSTABLE;return o!=null&&o.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return fK(n.nonvalidatedAtoms.toMap(),t)}function _K(n){x0(_0(e=>{let t=e.getState().previousTree;const r=e.getState().currentTree;t||(t=e.getState().currentTree);const i=CC(r),s=CC(t),o=pg(pK,c=>{var f,d,h,p;return{persistence_UNSTABLE:{type:(f=(d=c.persistence_UNSTABLE)===null||d===void 0?void 0:d.type)!==null&&f!==void 0?f:"none",backButton:(h=(p=c.persistence_UNSTABLE)===null||p===void 0?void 0:p.backButton)!==null&&h!==void 0?h:!1}}}),a=uK(r.dirtyAtoms,c=>i.has(c)||s.has(c));n({atomValues:i,previousAtomValues:s,atomInfo:o,modifiedAtoms:a,transactionMetadata:{...r.transactionMetadata}})},[n]))}function xK(n){x0(_0(e=>{const t=gg(e,"latest"),r=gg(e,"previous");n({snapshot:t,previousSnapshot:r})},[n]))}function SK(){const n=vw(),[e,t]=yK(()=>gg(n.current)),r=ON(e),i=EC(),s=EC();if(x0(_0(a=>t(gg(a)),[])),GN(()=>{const a=e.retain();if(i.current&&!TC){var c;window.clearTimeout(i.current),i.current=null,(c=s.current)===null||c===void 0||c.call(s),s.current=null}return()=>{window.setTimeout(a,10)}},[e]),r!==e&&!TC){if(i.current){var o;window.clearTimeout(i.current),i.current=null,(o=s.current)===null||o===void 0||o.call(s),s.current=null}s.current=e.retain(),i.current=window.setTimeout(()=>{var a;i.current=null,(a=s.current)===null||a===void 0||a.call(s),s.current=null},vK)}return e}function HN(n,e){var t;const r=n.getState(),i=(t=r.nextTree)!==null&&t!==void 0?t:r.currentTree,s=e.getStore_INTERNAL().getState().currentTree;dK(()=>{const o=new Set;for(const f of[i.atomValues.keys(),s.atomValues.keys()])for(const d of f){var a,c;((a=i.atomValues.get(d))===null||a===void 0?void 0:a.contents)!==((c=s.atomValues.get(d))===null||c===void 0?void 0:c.contents)&&VN(d).shouldRestoreFromSnapshots&&o.add(d)}o.forEach(f=>{gK(n,new mK(f),s.atomValues.has(f)?on(s.atomValues.get(f)):hK)}),n.replaceState(f=>({...f,stateID:e.getID()}))})}function wK(){const n=vw();return _0(e=>HN(n.current,e),[n])}var WN={useRecoilSnapshot:SK,gotoSnapshot:HN,useGotoRecoilSnapshot:wK,useRecoilTransactionObserver:xK,useTransactionObservation_DEPRECATED:_K,useTransactionSubscription_DEPRECATED:x0};const{peekNodeInfo:MK}=Qo,{useStoreRef:bK}=Ks;function EK(){const n=bK();return({key:e})=>MK(n.current,n.current.getState().currentTree,e)}var TK=EK;const{reactMode:CK}=Id,{RecoilRoot:AK,useStoreRef:PK}=Ks,{useMemo:RK}=ke;function LK(){CK().mode==="MUTABLE_SOURCE"&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode. Please consider upgrading to recoil_sync_external_store mode.");const n=PK().current;return RK(()=>{function e({children:t}){return ke.createElement(AK,{store_INTERNAL:n},t)}return e},[n])}var IK=LK;const{loadableWithValue:NK}=Ld,{initializeNode:DK}=Qo,{DEFAULT_VALUE:OK,getNode:kK}=Ir,{copyTreeState:zK,getRecoilValueAsLoadable:FK,invalidateDownstreams:UK,writeLoadableToTreeState:BK}=ms;function AC(n){return kK(n.key).nodeType==="atom"}class VK{constructor(e,t){pt(this,"_store",void 0),pt(this,"_treeState",void 0),pt(this,"_changes",void 0),pt(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!AC(r))throw yt("Reading selectors within atomicUpdate is not supported");const i=FK(this._store,r,this._treeState);if(i.state==="hasValue")return i.contents;throw i.state==="hasError"?i.contents:yt(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),pt(this,"set",(r,i)=>{if(!AC(r))throw yt("Setting selectors within atomicUpdate is not supported");if(typeof i=="function"){const s=this.get(r);this._changes.set(r.key,i(s))}else DK(this._store,r.key,"set"),this._changes.set(r.key,i)}),pt(this,"reset",r=>{this.set(r,OK)}),this._store=e,this._treeState=t,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const e=zK(this._treeState);for(const[t,r]of this._changes)BK(e,t,NK(r));return UK(this._store,e),e}}function GK(n){return e=>{n.replaceState(t=>{const r=new VK(n,t);return e(r),r.newTreeState_INTERNAL()})}}var HK={atomicUpdater:GK},WK=HK.atomicUpdater,$N=Object.freeze({__proto__:null,atomicUpdater:WK});function $K(n,e){if(!n)throw new Error(e)}var jK=$K,Jc=jK;const{atomicUpdater:XK}=$N,{batchUpdates:YK}=h0,{DEFAULT_VALUE:qK}=Ir,{useStoreRef:ZK}=Ks,{refreshRecoilValue:QK,setRecoilValue:PC}=ms,{cloneSnapshot:KK}=g0,{gotoSnapshot:JK}=WN,{useCallback:eJ}=ke;class jN{}const tJ=new jN;function XN(n,e,t,r){let i=tJ,s;if(YK(()=>{const a="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof e!="function")throw yt(a);const c=sN({...r!=null?r:{},set:(d,h)=>PC(n,d,h),reset:d=>PC(n,d,qK),refresh:d=>QK(n,d),gotoSnapshot:d=>JK(n,d),transact_UNSTABLE:d=>XK(n)(d)},{snapshot:()=>{const d=KK(n);return s=d.retain(),d}}),f=e(c);if(typeof f!="function")throw yt(a);i=f(...t)}),i instanceof jN&&Jc(!1),sn(i))i.finally(()=>{var a;(a=s)===null||a===void 0||a()});else{var o;(o=s)===null||o===void 0||o()}return i}function nJ(n,e){const t=ZK();return eJ((...r)=>XN(t.current,n,r),e!=null?[...e,t]:void 0)}var YN={recoilCallback:XN,useRecoilCallback:nJ};const{useStoreRef:rJ}=Ks,{refreshRecoilValue:iJ}=ms,{useCallback:sJ}=ke;function oJ(n){const e=rJ();return sJ(()=>{const t=e.current;iJ(t,n)},[n,e])}var aJ=oJ;const{atomicUpdater:lJ}=$N,{useStoreRef:uJ}=Ks,{useMemo:cJ}=ke;function fJ(n,e){const t=uJ();return cJ(()=>(...r)=>{lJ(t.current)(s=>{n(s)(...r)})},e!=null?[...e,t]:void 0)}var dJ=fJ;class hJ{constructor(e){pt(this,"value",void 0),this.value=e}}var pJ={WrappedValue:hJ},mJ=pJ.WrappedValue,qN=Object.freeze({__proto__:null,WrappedValue:mJ});const{isFastRefreshEnabled:gJ}=Id;class RC extends Error{}class vJ{constructor(e){var t,r,i;pt(this,"_name",void 0),pt(this,"_numLeafs",void 0),pt(this,"_root",void 0),pt(this,"_onHit",void 0),pt(this,"_onSet",void 0),pt(this,"_mapNodeValue",void 0),this._name=e==null?void 0:e.name,this._numLeafs=0,this._root=null,this._onHit=(t=e==null?void 0:e.onHit)!==null&&t!==void 0?t:()=>{},this._onSet=(r=e==null?void 0:e.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(i=e==null?void 0:e.mapNodeValue)!==null&&i!==void 0?i:s=>s}size(){return this._numLeafs}root(){return this._root}get(e,t){var r;return(r=this.getLeafNode(e,t))===null||r===void 0?void 0:r.value}getLeafNode(e,t){if(this._root==null)return;let r=this._root;for(;r;){if(t==null||t.onNodeVisit(r),r.type==="leaf")return this._onHit(r),r;const i=this._mapNodeValue(e(r.nodeKey));r=r.branches.get(i)}}set(e,t,r){const i=()=>{var s,o,a,c;let f,d;for(const[x,w]of e){var h,p,g;const _=this._root;if((_==null?void 0:_.type)==="leaf")throw this.invalidCacheError();const M=f;if(f=M?M.branches.get(d):_,f=(h=f)!==null&&h!==void 0?h:{type:"branch",nodeKey:x,parent:M,branches:new Map,branchKey:d},f.type!=="branch"||f.nodeKey!==x)throw this.invalidCacheError();M==null||M.branches.set(d,f),r==null||(p=r.onNodeVisit)===null||p===void 0||p.call(r,f),d=this._mapNodeValue(w),this._root=(g=this._root)!==null&&g!==void 0?g:f}const v=f?(s=f)===null||s===void 0?void 0:s.branches.get(d):this._root;if(v!=null&&(v.type!=="leaf"||v.branchKey!==d))throw this.invalidCacheError();const y={type:"leaf",value:t,parent:f,branchKey:d};(o=f)===null||o===void 0||o.branches.set(d,y),this._root=(a=this._root)!==null&&a!==void 0?a:y,this._numLeafs++,this._onSet(y),r==null||(c=r.onNodeVisit)===null||c===void 0||c.call(r,y)};try{i()}catch(s){if(s instanceof RC)this.clear(),i();else throw s}}delete(e){const t=this.root();if(!t)return!1;if(e===t)return this._root=null,this._numLeafs=0,!0;let r=e.parent,i=e.branchKey;for(;r;){var s;if(r.branches.delete(i),r===t)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;i=(s=r)===null||s===void 0?void 0:s.branchKey,r=r.parent}for(;r!==t;r=r.parent)if(r==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){const e=gJ()?"Possible Fast Refresh module reload detected. This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values. This happens when selectors do not return consistent values for the same input dependency values. That may also be caused when using Fast Refresh to change a selector implementation. Resetting cache.";throw nw(e+(this._name!=null?` - ${this._name}`:"")),new RC}}var yJ={TreeCache:vJ},_J=yJ.TreeCache,ZN=Object.freeze({__proto__:null,TreeCache:_J});class xJ{constructor(e){var t;pt(this,"_maxSize",void 0),pt(this,"_size",void 0),pt(this,"_head",void 0),pt(this,"_tail",void 0),pt(this,"_map",void 0),pt(this,"_keyMapper",void 0),this._maxSize=e.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(t=e.mapKey)!==null&&t!==void 0?t:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(e){return this._map.has(this._keyMapper(e))}get(e){const t=this._keyMapper(e),r=this._map.get(t);if(!!r)return this.set(e,r.value),r.value}set(e,t){const r=this._keyMapper(e);this._map.get(r)&&this.delete(e);const s=this.head(),o={key:e,right:s,left:null,value:t};s?s.left=o:this._tail=o,this._map.set(r,o),this._head=o,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const e=this.tail();e&&this.delete(e.key)}delete(e){const t=this._keyMapper(e);if(!this._size||!this._map.has(t))return;const r=on(this._map.get(t)),i=r.right,s=r.left;i&&(i.left=r.left),s&&(s.right=r.right),r===this.head()&&(this._head=i),r===this.tail()&&(this._tail=s),this._map.delete(t),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var SJ={LRUCache:xJ},wJ=SJ.LRUCache,QN=Object.freeze({__proto__:null,LRUCache:wJ});const{LRUCache:MJ}=QN,{TreeCache:bJ}=ZN;function EJ({name:n,maxSize:e,mapNodeValue:t=r=>r}){const r=new MJ({maxSize:e}),i=new bJ({name:n,mapNodeValue:t,onHit:s=>{r.set(s,!0)},onSet:s=>{const o=r.tail();r.set(s,!0),o&&i.size()>e&&i.delete(o.key)}});return i}var LC=EJ;function Li(n,e,t){if(typeof n=="string"&&!n.includes('"')&&!n.includes("\\"))return`"${n}"`;switch(typeof n){case"undefined":return"";case"boolean":return n?"true":"false";case"number":case"symbol":return String(n);case"string":return JSON.stringify(n);case"function":if((e==null?void 0:e.allowFunctions)!==!0)throw yt("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${n.name})__`}if(n===null)return"null";if(typeof n!="object"){var r;return(r=JSON.stringify(n))!==null&&r!==void 0?r:""}if(sn(n))return"__PROMISE__";if(Array.isArray(n))return`[${n.map((i,s)=>Li(i,e,s.toString()))}]`;if(typeof n.toJSON=="function")return Li(n.toJSON(t),e,t);if(n instanceof Map){const i={};for(const[s,o]of n)i[typeof s=="string"?s:Li(s,e)]=o;return Li(i,e,t)}return n instanceof Set?Li(Array.from(n).sort((i,s)=>Li(i,e).localeCompare(Li(s,e))),e,t):Symbol!==void 0&&n[Symbol.iterator]!=null&&typeof n[Symbol.iterator]=="function"?Li(Array.from(n),e,t):`{${Object.keys(n).filter(i=>n[i]!==void 0).sort().map(i=>`${Li(i,e)}:${Li(n[i],e,i)}`).join(",")}}`}function TJ(n,e={allowFunctions:!1}){return Li(n,e)}var S0=TJ;const{TreeCache:CJ}=ZN,Bp={equality:"reference",eviction:"keep-all",maxSize:1/0};function AJ({equality:n=Bp.equality,eviction:e=Bp.eviction,maxSize:t=Bp.maxSize}=Bp,r){const i=PJ(n);return RJ(e,t,i,r)}function PJ(n){switch(n){case"reference":return e=>e;case"value":return e=>S0(e)}throw yt(`Unrecognized equality policy ${n}`)}function RJ(n,e,t,r){switch(n){case"keep-all":return new CJ({name:r,mapNodeValue:t});case"lru":return LC({name:r,maxSize:on(e),mapNodeValue:t});case"most-recent":return LC({name:r,maxSize:1,mapNodeValue:t})}throw yt(`Unrecognized eviction policy ${n}`)}var LJ=AJ;function IJ(n){return()=>null}var NJ={startPerfBlock:IJ};const{isLoadable:DJ,loadableWithError:Vp,loadableWithPromise:OJ,loadableWithValue:r_}=Ld,{WrappedValue:KN}=qN,{getNodeLoadable:Gp,peekNodeLoadable:kJ,setNodeValue:zJ}=Qo,{saveDepsToStore:FJ}=Nd,{DEFAULT_VALUE:UJ,getConfigDeletionHandler:BJ,getNode:VJ,registerNode:IC}=Ir,{isRecoilValue:GJ}=Ou,{markRecoilValueModified:NC}=ms,{retainedByOptionWithDefault:HJ}=pl,{recoilCallback:WJ}=YN,{startPerfBlock:$J}=NJ;class JN{}const Wc=new JN,$c=[],Hp=new Map,jJ=(()=>{let n=0;return()=>n++})();function eD(n){let e=null;const{key:t,get:r,cachePolicy_UNSTABLE:i}=n,s=n.set!=null?n.set:void 0,o=new Set,a=LJ(i!=null?i:{equality:"reference",eviction:"keep-all"},t),c=HJ(n.retainedBy_UNSTABLE),f=new Map;let d=0;function h(){return!Yt("recoil_memory_managament_2020")||d>0}function p(k){return k.getState().knownSelectors.add(t),d++,()=>{d--}}function g(){return BJ(t)!==void 0&&!h()}function v(k,W,N,me,X){le(W,me,X),y(k,N)}function y(k,W){$(k,W)&&q(k),w(W,!0)}function x(k,W){$(k,W)&&(on(D(k)).stateVersions.clear(),w(W,!1))}function w(k,W){const N=Hp.get(k);if(N!=null){for(const me of N)NC(me,on(e));W&&Hp.delete(k)}}function _(k,W){let N=Hp.get(W);N==null&&Hp.set(W,N=new Set),N.add(k)}function M(k,W,N,me,X,Te){return W.then(Ce=>{if(!h())throw q(k),Wc;const we=r_(Ce);return v(k,N,X,we,me),Ce}).catch(Ce=>{if(!h())throw q(k),Wc;if(sn(Ce))return E(k,Ce,N,me,X,Te);const we=Vp(Ce);throw v(k,N,X,we,me),Ce})}function E(k,W,N,me,X,Te){return W.then(Ce=>{if(!h())throw q(k),Wc;Te.loadingDepKey!=null&&Te.loadingDepPromise===W?N.atomValues.set(Te.loadingDepKey,r_(Ce)):k.getState().knownSelectors.forEach(ue=>{N.atomValues.delete(ue)});const we=R(k,N);if(we&&we.state!=="loading"){if(($(k,X)||D(k)==null)&&y(k,X),we.state==="hasValue")return we.contents;throw we.contents}if(!$(k,X)){const ue=L(k,N);if(ue!=null)return ue.loadingLoadable.contents}const[be,He]=P(k,N,X);if(be.state!=="loading"&&v(k,N,X,be,He),be.state==="hasError")throw be.contents;return be.contents}).catch(Ce=>{if(Ce instanceof JN)throw Wc;if(!h())throw q(k),Wc;const we=Vp(Ce);throw v(k,N,X,we,me),Ce})}function C(k,W,N,me){var X,Te,Ce,we;if($(k,me)||W.version===((X=k.getState())===null||X===void 0||(Te=X.currentTree)===null||Te===void 0?void 0:Te.version)||W.version===((Ce=k.getState())===null||Ce===void 0||(we=Ce.nextTree)===null||we===void 0?void 0:we.version)){var be,He,ue;FJ(t,N,k,(be=(He=k.getState())===null||He===void 0||(ue=He.nextTree)===null||ue===void 0?void 0:ue.version)!==null&&be!==void 0?be:k.getState().currentTree.version)}for(const ne of N)o.add(ne)}function P(k,W,N){const me=$J(t);let X=!0,Te=!0;const Ce=()=>{me(),Te=!1};let we,be=!1,He;const ue={loadingDepKey:null,loadingDepPromise:null},ne=new Map;function Ee({key:Le}){const qe=Gp(k,W,Le);switch(ne.set(Le,qe),X||(C(k,W,new Set(ne.keys()),N),x(k,N)),qe.state){case"hasValue":return qe.contents;case"hasError":throw qe.contents;case"loading":throw ue.loadingDepKey=Le,ue.loadingDepPromise=qe.contents,qe.contents}throw yt("Invalid Loadable state")}const Ue=Le=>(...qe)=>{if(Te)throw yt("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return e==null&&Jc(!1),WJ(k,Le,qe,{node:e})};try{we=r({get:Ee,getCallback:Ue}),we=GJ(we)?Ee(we):we,DJ(we)&&(we.state==="hasError"&&(be=!0),we=we.contents),sn(we)?we=M(k,we,W,ne,N,ue).finally(Ce):Ce(),we=we instanceof KN?we.value:we}catch(Le){we=Le,sn(we)?we=E(k,we,W,ne,N,ue).finally(Ce):(be=!0,Ce())}return be?He=Vp(we):sn(we)?He=OJ(we):He=r_(we),X=!1,fe(k,N,ne),C(k,W,new Set(ne.keys()),N),[He,ne]}function R(k,W){let N=W.atomValues.get(t);if(N!=null)return N;const me=new Set;try{N=a.get(Te=>(typeof Te!="string"&&Jc(!1),Gp(k,W,Te).contents),{onNodeVisit:Te=>{Te.type==="branch"&&Te.nodeKey!==t&&me.add(Te.nodeKey)}})}catch(Te){throw yt(`Problem with cache lookup for selector "${t}": ${Te.message}`)}if(N){var X;W.atomValues.set(t,N),C(k,W,me,(X=D(k))===null||X===void 0?void 0:X.executionID)}return N}function T(k,W){const N=R(k,W);if(N!=null)return q(k),N;const me=L(k,W);if(me!=null){var X;return((X=me.loadingLoadable)===null||X===void 0?void 0:X.state)==="loading"&&_(k,me.executionID),me.loadingLoadable}const Te=jJ(),[Ce,we]=P(k,W,Te);return Ce.state==="loading"?(Y(k,Te,Ce,we,W),_(k,Te)):(q(k),le(W,Ce,we)),Ce}function L(k,W){const N=wN([f.has(k)?[on(f.get(k))]:[],u0(aw(f,([X])=>X!==k),([,X])=>X)]);function me(X){for(const[Te,Ce]of X)if(!Gp(k,W,Te).is(Ce))return!0;return!1}for(const X of N){if(X.stateVersions.get(W.version)||!me(X.depValuesDiscoveredSoFarDuringAsyncWork))return X.stateVersions.set(W.version,!0),X;X.stateVersions.set(W.version,!1)}}function D(k){return f.get(k)}function Y(k,W,N,me,X){f.set(k,{depValuesDiscoveredSoFarDuringAsyncWork:me,executionID:W,loadingLoadable:N,stateVersions:new Map([[X.version,!0]])})}function fe(k,W,N){if($(k,W)){const me=D(k);me!=null&&(me.depValuesDiscoveredSoFarDuringAsyncWork=N)}}function q(k){f.delete(k)}function $(k,W){var N;return W===((N=D(k))===null||N===void 0?void 0:N.executionID)}function se(k){return Array.from(k.entries()).map(([W,N])=>[W,N.contents])}function le(k,W,N){k.atomValues.set(t,W);try{a.set(se(N),W)}catch(me){throw yt(`Problem with setting cache for selector "${t}": ${me.message}`)}}function pe(k){if($c.includes(t)){const W=`Recoil selector has circular dependencies: ${$c.slice($c.indexOf(t)).join(" \u2192 ")}`;return Vp(yt(W))}$c.push(t);try{return k()}finally{$c.pop()}}function z(k,W){const N=W.atomValues.get(t);return N!=null?N:a.get(me=>{var X;return typeof me!="string"&&Jc(!1),(X=kJ(k,W,me))===null||X===void 0?void 0:X.contents})}function F(k,W){return pe(()=>T(k,W))}function G(k){k.atomValues.delete(t)}function Z(k,W){e==null&&Jc(!1);for(const me of o){var N;const X=VJ(me);(N=X.clearCache)===null||N===void 0||N.call(X,k,W)}o.clear(),G(W),a.clear(),NC(k,e)}return s!=null?e=IC({key:t,nodeType:"selector",peek:z,get:F,set:(W,N,me)=>{let X=!1;const Te=new Map;function Ce({key:ue}){if(X)throw yt("Recoil: Async selector sets are not currently supported.");const ne=Gp(W,N,ue);if(ne.state==="hasValue")return ne.contents;if(ne.state==="loading"){const Ee=`Getting value of asynchronous atom or selector "${ue}" in a pending state while setting selector "${t}" is not yet supported.`;throw yt(Ee)}else throw ne.contents}function we(ue,ne){if(X)throw yt("Recoil: Async selector sets are not currently supported.");const Ee=typeof ne=="function"?ne(Ce(ue)):ne;zJ(W,N,ue.key,Ee).forEach((Le,qe)=>Te.set(qe,Le))}function be(ue){we(ue,UJ)}const He=s({set:we,get:Ce,reset:be},me);if(He!==void 0)throw sn(He)?yt("Recoil: Async selector sets are not currently supported."):yt("Recoil: selector set should be a void function.");return X=!0,Te},init:p,invalidate:G,clearCache:Z,shouldDeleteConfigOnRelease:g,dangerouslyAllowMutability:n.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:c}):e=IC({key:t,nodeType:"selector",peek:z,get:F,init:p,invalidate:G,clearCache:Z,shouldDeleteConfigOnRelease:g,dangerouslyAllowMutability:n.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:c})}eD.value=n=>new KN(n);var Fu=eD;const{isLoadable:XJ,loadableWithError:i_,loadableWithPromise:s_,loadableWithValue:Xl}=Ld,{WrappedValue:tD}=qN,{peekNodeInfo:YJ}=Qo,{DEFAULT_VALUE:Ma,DefaultValue:wo,getConfigDeletionHandler:nD,registerNode:qJ,setConfigDeletionHandler:ZJ}=Ir,{isRecoilValue:QJ}=Ou,{getRecoilValueAsLoadable:KJ,markRecoilValueModified:JJ,setRecoilValue:DC,setRecoilValueLoadable:eee}=ms,{retainedByOptionWithDefault:tee}=pl,jc=n=>n instanceof tD?n.value:n;function nee(n){const{key:e,persistence_UNSTABLE:t}=n,r=tee(n.retainedBy_UNSTABLE);let i=0;function s(_){return s_(_.then(M=>(o=Xl(M),M)).catch(M=>{throw o=i_(M),M}))}let o=sn(n.default)?s(n.default):XJ(n.default)?n.default.state==="loading"?s(n.default.contents):n.default:Xl(jc(n.default));o.contents;let a;const c=new Map;function f(_){return _}function d(_,M){const E=M.then(C=>{var P,R;return((R=((P=_.getState().nextTree)!==null&&P!==void 0?P:_.getState().currentTree).atomValues.get(e))===null||R===void 0?void 0:R.contents)===E&&DC(_,w,C),C}).catch(C=>{var P,R;throw((R=((P=_.getState().nextTree)!==null&&P!==void 0?P:_.getState().currentTree).atomValues.get(e))===null||R===void 0?void 0:R.contents)===E&&eee(_,w,i_(C)),C});return E}function h(_,M,E){var C;i++;const P=()=>{var q;i--,(q=c.get(_))===null||q===void 0||q.forEach($=>$()),c.delete(_)};if(_.getState().knownAtoms.add(e),o.state==="loading"){const q=()=>{var $;(($=_.getState().nextTree)!==null&&$!==void 0?$:_.getState().currentTree).atomValues.has(e)||JJ(_,w)};o.contents.finally(q)}const R=(C=n.effects)!==null&&C!==void 0?C:n.effects_UNSTABLE;if(R!=null){let pe=function(W){if($&&W.key===e){const N=q;return N instanceof wo?p(_,M):sn(N)?s_(N.then(me=>me instanceof wo?o.toPromise():me)):Xl(N)}return KJ(_,W)},z=function(W){return pe(W).toPromise()},F=function(W){var N;const me=YJ(_,(N=_.getState().nextTree)!==null&&N!==void 0?N:_.getState().currentTree,W.key);return $&&W.key===e&&!(q instanceof wo)?{...me,isSet:!0,loadable:pe(W)}:me};var Y=pe,fe=z,D=F;let q=Ma,$=!0,se=!1,le=null;const G=W=>N=>{if($){const me=pe(w),X=me.state==="hasValue"?me.contents:Ma;q=typeof N=="function"?N(X):N,sn(q)&&(q=q.then(Te=>(le={effect:W,value:Te},Te)))}else{if(sn(N))throw yt("Setting atoms to async values is not implemented.");typeof N!="function"&&(le={effect:W,value:jc(N)}),DC(_,w,typeof N=="function"?me=>{const X=jc(N(me));return le={effect:W,value:X},X}:jc(N))}},Z=W=>()=>G(W)(Ma),k=W=>N=>{var me;const{release:X}=_.subscribeToTransactions(Te=>{var Ce;let{currentTree:we,previousTree:be}=Te.getState();be||(be=we);const He=(Ce=we.atomValues.get(e))!==null&&Ce!==void 0?Ce:o;if(He.state==="hasValue"){var ue,ne,Ee,Ue;const Le=He.contents,qe=(ue=be.atomValues.get(e))!==null&&ue!==void 0?ue:o,et=qe.state==="hasValue"?qe.contents:Ma;((ne=le)===null||ne===void 0?void 0:ne.effect)!==W||((Ee=le)===null||Ee===void 0?void 0:Ee.value)!==Le?N(Le,et,!we.atomValues.has(e)):((Ue=le)===null||Ue===void 0?void 0:Ue.effect)===W&&(le=null)}},e);c.set(_,[...(me=c.get(_))!==null&&me!==void 0?me:[],X])};for(const W of R)try{const N=W({node:w,storeID:_.storeID,parentStoreID_UNSTABLE:_.parentStoreID,trigger:E,setSelf:G(W),resetSelf:Z(W),onSet:k(W),getPromise:z,getLoadable:pe,getInfo_UNSTABLE:F});if(N!=null){var T;c.set(_,[...(T=c.get(_))!==null&&T!==void 0?T:[],N])}}catch(N){q=N,se=!0}if($=!1,!(q instanceof wo)){var L;const W=se?i_(q):sn(q)?s_(d(_,q)):Xl(jc(q));W.contents,M.atomValues.set(e,W),(L=_.getState().nextTree)===null||L===void 0||L.atomValues.set(e,W)}}return P}function p(_,M){var E,C;return(E=(C=M.atomValues.get(e))!==null&&C!==void 0?C:a)!==null&&E!==void 0?E:o}function g(_,M){if(M.atomValues.has(e))return on(M.atomValues.get(e));if(M.nonvalidatedAtoms.has(e)){if(a!=null)return a;if(t==null)return o;const E=M.nonvalidatedAtoms.get(e),C=t.validator(E,Ma);return a=C instanceof wo?o:Xl(C),a}else return o}function v(){a=void 0}function y(_,M,E){if(M.atomValues.has(e)){const C=on(M.atomValues.get(e));if(C.state==="hasValue"&&E===C.contents)return new Map}else if(!M.nonvalidatedAtoms.has(e)&&E instanceof wo)return new Map;return a=void 0,new Map().set(e,Xl(E))}function x(){return nD(e)!==void 0&&i<=0}const w=qJ({key:e,nodeType:"atom",peek:p,get:g,set:y,init:h,invalidate:v,shouldDeleteConfigOnRelease:x,dangerouslyAllowMutability:n.dangerouslyAllowMutability,persistence_UNSTABLE:n.persistence_UNSTABLE?{type:n.persistence_UNSTABLE.type,backButton:n.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return w}function yw(n){const{...e}=n,t="default"in n?n.default:new Promise(()=>{});return QJ(t)?ree({...e,default:t}):nee({...e,default:t})}function ree(n){const e=yw({...n,default:Ma,persistence_UNSTABLE:n.persistence_UNSTABLE===void 0?void 0:{...n.persistence_UNSTABLE,validator:r=>r instanceof wo?r:on(n.persistence_UNSTABLE).validator(r,Ma)},effects:n.effects,effects_UNSTABLE:n.effects_UNSTABLE}),t=Fu({key:`${n.key}__withFallback`,get:({get:r})=>{const i=r(e);return i instanceof wo?n.default:i},set:({set:r},i)=>r(e,i),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:n.dangerouslyAllowMutability});return ZJ(t.key,nD(n.key)),t}yw.value=n=>new tD(n);var rD=yw;class iee{constructor(e){var t;pt(this,"_map",void 0),pt(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(t=e==null?void 0:e.mapKey)!==null&&t!==void 0?t:r=>r}size(){return this._map.size}has(e){return this._map.has(this._keyMapper(e))}get(e){return this._map.get(this._keyMapper(e))}set(e,t){this._map.set(this._keyMapper(e),t)}delete(e){this._map.delete(this._keyMapper(e))}clear(){this._map.clear()}}var see={MapCache:iee},oee=see.MapCache,aee=Object.freeze({__proto__:null,MapCache:oee});const{LRUCache:OC}=QN,{MapCache:lee}=aee,Wp={equality:"reference",eviction:"none",maxSize:1/0};function uee({equality:n=Wp.equality,eviction:e=Wp.eviction,maxSize:t=Wp.maxSize}=Wp){const r=cee(n);return fee(e,t,r)}function cee(n){switch(n){case"reference":return e=>e;case"value":return e=>S0(e)}throw yt(`Unrecognized equality policy ${n}`)}function fee(n,e,t){switch(n){case"keep-all":return new lee({mapKey:t});case"lru":return new OC({mapKey:t,maxSize:on(e)});case"most-recent":return new OC({mapKey:t,maxSize:1})}throw yt(`Unrecognized eviction policy ${n}`)}var iD=uee;const{setConfigDeletionHandler:dee}=Ir;function hee(n){var e,t;const r=iD({equality:(e=(t=n.cachePolicyForParams_UNSTABLE)===null||t===void 0?void 0:t.equality)!==null&&e!==void 0?e:"value",eviction:"keep-all"});return i=>{var s,o;const a=r.get(i);if(a!=null)return a;const{cachePolicyForParams_UNSTABLE:c,...f}=n,d="default"in n?n.default:new Promise(()=>{}),h=rD({...f,key:`${n.key}__${(s=S0(i))!==null&&s!==void 0?s:"void"}`,default:typeof d=="function"?d(i):d,retainedBy_UNSTABLE:typeof n.retainedBy_UNSTABLE=="function"?n.retainedBy_UNSTABLE(i):n.retainedBy_UNSTABLE,effects:typeof n.effects=="function"?n.effects(i):typeof n.effects_UNSTABLE=="function"?n.effects_UNSTABLE(i):(o=n.effects)!==null&&o!==void 0?o:n.effects_UNSTABLE});return r.set(i,h),dee(h.key,()=>{r.delete(i)}),h}}var pee=hee;const{setConfigDeletionHandler:mee}=Ir;let gee=0;function vee(n){var e,t;const r=iD({equality:(e=(t=n.cachePolicyForParams_UNSTABLE)===null||t===void 0?void 0:t.equality)!==null&&e!==void 0?e:"value",eviction:"keep-all"});return i=>{var s;let o;try{o=r.get(i)}catch(p){throw yt(`Problem with cache lookup for selector ${n.key}: ${p.message}`)}if(o!=null)return o;const a=`${n.key}__selectorFamily/${(s=S0(i,{allowFunctions:!0}))!==null&&s!==void 0?s:"void"}/${gee++}`,c=p=>n.get(i)(p),f=n.cachePolicy_UNSTABLE,d=typeof n.retainedBy_UNSTABLE=="function"?n.retainedBy_UNSTABLE(i):n.retainedBy_UNSTABLE;let h;if(n.set!=null){const p=n.set;h=Fu({key:a,get:c,set:(v,y)=>p(i)(v,y),cachePolicy_UNSTABLE:f,dangerouslyAllowMutability:n.dangerouslyAllowMutability,retainedBy_UNSTABLE:d})}else h=Fu({key:a,get:c,cachePolicy_UNSTABLE:f,dangerouslyAllowMutability:n.dangerouslyAllowMutability,retainedBy_UNSTABLE:d});return r.set(i,h),mee(h.key,()=>{r.delete(i)}),h}}var Ko=vee;const yee=Ko({key:"__constant",get:n=>()=>n,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function _ee(n){return yee(n)}var xee=_ee;const See=Ko({key:"__error",get:n=>()=>{throw yt(n)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function wee(n){return See(n)}var Mee=wee;function bee(n){return n}var Eee=bee;const{loadableWithError:sD,loadableWithPromise:oD,loadableWithValue:aD}=Ld;function w0(n,e){const t=Array(e.length).fill(void 0),r=Array(e.length).fill(void 0);for(const[i,s]of e.entries())try{t[i]=n(s)}catch(o){r[i]=o}return[t,r]}function Tee(n){return n!=null&&!sn(n)}function M0(n){return Array.isArray(n)?n:Object.getOwnPropertyNames(n).map(e=>n[e])}function n1(n,e){return Array.isArray(n)?e:Object.getOwnPropertyNames(n).reduce((t,r,i)=>({...t,[r]:e[i]}),{})}function wu(n,e,t){const r=t.map((i,s)=>i==null?aD(e[s]):sn(i)?oD(i):sD(i));return n1(n,r)}function Cee(n,e){return e.map((t,r)=>t===void 0?n[r]:t)}const Aee=Ko({key:"__waitForNone",get:n=>({get:e})=>{const t=M0(n),[r,i]=w0(e,t);return wu(n,r,i)},dangerouslyAllowMutability:!0}),Pee=Ko({key:"__waitForAny",get:n=>({get:e})=>{const t=M0(n),[r,i]=w0(e,t);return i.some(s=>!sn(s))?wu(n,r,i):new Promise(s=>{for(const[o,a]of i.entries())sn(a)&&a.then(c=>{r[o]=c,i[o]=void 0,s(wu(n,r,i))}).catch(c=>{i[o]=c,s(wu(n,r,i))})})},dangerouslyAllowMutability:!0}),Ree=Ko({key:"__waitForAll",get:n=>({get:e})=>{const t=M0(n),[r,i]=w0(e,t);if(i.every(o=>o==null))return n1(n,r);const s=i.find(Tee);if(s!=null)throw s;return Promise.all(i).then(o=>n1(n,Cee(r,o)))},dangerouslyAllowMutability:!0}),Lee=Ko({key:"__waitForAllSettled",get:n=>({get:e})=>{const t=M0(n),[r,i]=w0(e,t);return i.every(s=>!sn(s))?wu(n,r,i):Promise.all(i.map((s,o)=>sn(s)?s.then(a=>{r[o]=a,i[o]=void 0}).catch(a=>{r[o]=void 0,i[o]=a}):null)).then(()=>wu(n,r,i))},dangerouslyAllowMutability:!0}),Iee=Ko({key:"__noWait",get:n=>({get:e})=>{try{return Fu.value(aD(e(n)))}catch(t){return Fu.value(sn(t)?oD(t):sD(t))}},dangerouslyAllowMutability:!0});var Nee={waitForNone:Aee,waitForAny:Pee,waitForAll:Ree,waitForAllSettled:Lee,noWait:Iee};const{RecoilLoadable:Dee}=Ld,{DefaultValue:Oee}=Ir,{RecoilRoot:kee,useRecoilStoreID:zee}=Ks,{isRecoilValue:Fee}=Ou,{retentionZone:Uee}=f0,{freshSnapshot:Bee}=g0,{useRecoilState:Vee,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:Gee,useRecoilStateLoadable:Hee,useRecoilValue:Wee,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:$ee,useRecoilValueLoadable:jee,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:Xee,useResetRecoilState:Yee,useSetRecoilState:qee}=sK,{useGotoRecoilSnapshot:Zee,useRecoilSnapshot:Qee,useRecoilTransactionObserver:Kee}=WN,{useRecoilCallback:Jee}=YN,{noWait:ete,waitForAll:tte,waitForAllSettled:nte,waitForAny:rte,waitForNone:ite}=Nee;var ste={DefaultValue:Oee,isRecoilValue:Fee,RecoilLoadable:Dee,RecoilEnv:YI,RecoilRoot:kee,useRecoilStoreID:zee,useRecoilBridgeAcrossReactRoots_UNSTABLE:IK,atom:rD,selector:Fu,atomFamily:pee,selectorFamily:Ko,constSelector:xee,errorSelector:Mee,readOnlySelector:Eee,noWait:ete,waitForNone:ite,waitForAny:rte,waitForAll:tte,waitForAllSettled:nte,useRecoilValue:Wee,useRecoilValueLoadable:jee,useRecoilState:Vee,useRecoilStateLoadable:Hee,useSetRecoilState:qee,useResetRecoilState:Yee,useGetRecoilValueInfo_UNSTABLE:TK,useRecoilRefresher_UNSTABLE:aJ,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:Xee,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:$ee,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:Gee,useRecoilCallback:Jee,useRecoilTransaction_UNSTABLE:dJ,useGotoRecoilSnapshot:Zee,useRecoilSnapshot:Qee,useRecoilTransactionObserver_UNSTABLE:Kee,snapshot_UNSTABLE:Bee,useRetain:hw,retentionZone:Uee},ote=ste.RecoilRoot;a_.createRoot(document.getElementById("root")).render(at(ke.StrictMode,{children:at(rY,{children:at(ote,{children:at(vY,{modalProps:{size:"xs",transition:"slide-up",styles:{inner:{overflow:"hidden"}}},children:at(OX,{})})})})})); diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/html/img/close.png b/resources/[jobs]/[mechanic]/rtx_carlift/html/img/close.png new file mode 100644 index 000000000..5ef6454e1 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift/html/img/close.png differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/html/scripts.js b/resources/[jobs]/[mechanic]/rtx_carlift/html/scripts.js new file mode 100644 index 000000000..2dda4741d --- /dev/null +++ b/resources/[jobs]/[mechanic]/rtx_carlift/html/scripts.js @@ -0,0 +1,257 @@ +var liftresourcename = "rtx_carlift"; + +function closeMain() { + $("body").css("display", "none"); +} +function openMain() { + $("body").css("display", "block"); +} + +$(".closelift").click(function(){ + $.post('https://'+liftresourcename+'/quit', JSON.stringify({})); +}); + +$(".closeliftposfinish").click(function(){ + $.post('https://'+liftresourcename+'/closeliftoffsets', JSON.stringify({})); +}); + +function CarLiftPrepareInterface() { + let reformated1 = document.getElementById("cameraspeeddata"); + var value = (reformated1.value-reformated1.min)/(reformated1.max-reformated1.min)*100 + reformated1.style.background = 'linear-gradient(to right, #ff66ff 0%, #ff66ff ' + value + '%, #ccccc8 ' + value + '%, #ccccc8 100%)' + let reformated2 = document.getElementById("lookspeedxdata"); + var value = (reformated2.value-reformated2.min)/(reformated2.max-reformated2.min)*100 + reformated2.style.background = 'linear-gradient(to right, #ff66ff 0%, #ff66ff ' + value + '%, #ccccc8 ' + value + '%, #ccccc8 100%)' + let reformated3 = document.getElementById("lookspeedydata"); + var value = (reformated3.value-reformated3.min)/(reformated3.max-reformated3.min)*100 + reformated3.style.background = 'linear-gradient(to right, #ff66ff 0%, #ff66ff ' + value + '%, #ccccc8 ' + value + '%, #ccccc8 100%)' + let reformated4 = document.getElementById("translatesnapdata"); + var value = (reformated4.value-reformated4.min)/(reformated4.max-reformated4.min)*100 + reformated4.style.background = 'linear-gradient(to right, #ff66ff 0%, #ff66ff ' + value + '%, #ccccc8 ' + value + '%, #ccccc8 100%)' + let reformated5 = document.getElementById("rotationsnapdata"); + var value = (reformated5.value-reformated5.min)/(reformated5.max-reformated5.min)*100 + reformated5.style.background = 'linear-gradient(to right, #ff66ff 0%, #ff66ff ' + value + '%, #ccccc8 ' + value + '%, #ccccc8 100%)' +} + +CarLiftPrepareInterface(); + +document.getElementById("cameraspeeddata").oninput = function() { + var value = (this.value-this.min)/(this.max-this.min)*100 + this.style.background = 'linear-gradient(to right, #ff66ff 0%, #ff66ff ' + value + '%, #ccccc8 ' + value + '%, #ccccc8 100%)' +}; + +document.getElementById("lookspeedxdata").oninput = function() { + var value = (this.value-this.min)/(this.max-this.min)*100 + this.style.background = 'linear-gradient(to right, #ff66ff 0%, #ff66ff ' + value + '%, #ccccc8 ' + value + '%, #ccccc8 100%)' +}; + +document.getElementById("lookspeedydata").oninput = function() { + var value = (this.value-this.min)/(this.max-this.min)*100 + this.style.background = 'linear-gradient(to right, #ff66ff 0%, #ff66ff ' + value + '%, #ccccc8 ' + value + '%, #ccccc8 100%)' +}; + +document.getElementById("translatesnapdata").oninput = function() { + var value = (this.value-this.min)/(this.max-this.min)*100 + this.style.background = 'linear-gradient(to right, #ff66ff 0%, #ff66ff ' + value + '%, #ccccc8 ' + value + '%, #ccccc8 100%)' +}; + +document.getElementById("rotationsnapdata").oninput = function() { + var value = (this.value-this.min)/(this.max-this.min)*100 + this.style.background = 'linear-gradient(to right, #ff66ff 0%, #ff66ff ' + value + '%, #ccccc8 ' + value + '%, #ccccc8 100%)' +}; + +window.addEventListener('message', function (event) { + + var item = event.data; + + if (item.message == "liftshow") { + $("#liftposshow").hide(); + $("#liftposfinishshow").hide(); + $('#liftshow').show(); + openMain(); + } + + if (item.message == "infonotifyshow") { + document.getElementsByClassName("infonotifytext")[0].innerHTML = item.infonotifytext; + openMain(); + $("#infonotifyshow").show(); + } + + if (item.message == "hide") { + $("#liftshow").hide(); + } + + if (item.message == "hidenotify") { + $("#infonotifyshow").hide(); + } + + if (item.message == "updateinterfacedata") { + liftresourcename = item.liftresourcenamedata; + let root = document.documentElement; + root.style.setProperty('--color', item.interfacecolordata); + } + + if (item.message == "carliftcreatorshow") { + $("#cameraspeeddata").val(""); + $("#lookspeedxdata").val(""); + $("#lookspeedydata").val(""); + $("#translatesnapdata").val(""); + $("#rotationsnapdata").val(""); + CarLiftPrepareInterface(); + $("#posmoretranslate").addClass("active"); + $("#posmorerotation").removeClass("active"); + $("#spacebuttonworld").addClass("active"); + $("#spacebuttonlocal").removeClass("active"); + $("#liftshow").hide(); + $("#liftposfinishshow").hide(); + $("#liftposshow").show(); + openMain(); + } + + if (item.message == "liftposfinishshow") { + var offsetdatacarlift = + ' {\n' + + ' coords = ' + item.carliftposcoordsdata + ',\n' + + ' rotation = ' + item.carliftposrotationdata + ',\n' + + ' currentheight = 0.0,\n' + + ' objecthandler = {frame = nil, lift = nil},\n' + + ' manipulating = false,\n' + + ' manipulatingplayerid = nil,\n' + + ' lifttype = ' + item.carliftpostypedata + ',\n' + + ' buttonuppress = false,\n' + + ' buttondownpress = false,\n' + + ' onlyjoballowed = false,\n' + + ' jobs = {\n' + + ' },\n' + + ' },'; + $(".liftposfinishcopytextdata").val(offsetdatacarlift); + $("#liftshow").hide(); + $("#liftposshow").hide(); + $("#liftposfinishshow").show(); + openMain(); + } + + if (item.message == "updatelifttype") { + document.getElementsByClassName("poscarliftypedatatext")[0].innerHTML = item.carlifttypedata; + } + + if (item.message == "hide") { + $("#liftposshow").hide(); + closeMain(); + } + + if (item.message == "hidecreator") { + $("#liftposfinishshow").hide(); + closeMain(); + } + + document.onkeyup = function (data) { + if (open) { + if (data.which == 27) { + $.post('https://'+liftresourcename+'/quit', JSON.stringify({})); + } + } + }; +}); + +$(".buttonup").mousedown(function() { + $.post('https://'+liftresourcename+'/liftupactivated', JSON.stringify({})); +}); + +$(".buttonup").mouseup(function() { + $.post('https://'+liftresourcename+'/liftupdeactivated', JSON.stringify({})); +}); + +$(".buttondown").mousedown(function() { + $.post('https://'+liftresourcename+'/liftdownactivated', JSON.stringify({})); +}); + +$(".buttondown").mouseup(function() { + $.post('https://'+liftresourcename+'/liftdowndeactivated', JSON.stringify({})); +}); + +$("#posmoretranslate").click(function () { + $(this).addClass("active"); + $("#posmorerotation").removeClass("active"); + $.post('https://'+liftresourcename+'/carliftchangemode', JSON.stringify({ + modetype: "translate" + })); +}); + +$("#posmorerotation").click(function () { + $(this).addClass("active"); + $("#posmoretranslate").removeClass("active"); + $.post('https://'+liftresourcename+'/carliftchangemode', JSON.stringify({ + modetype: "rotate" + })); +}); + +$("#spacebuttonworld").click(function () { + $(this).addClass("active"); + $("#spacebuttonlocal").removeClass("active"); + $.post('https://'+liftresourcename+'/carliftchangespace', JSON.stringify({ + spacetype: "world" + })); +}); + +$(".poscarlifrighttext").click(function () { + $.post('https://'+liftresourcename+'/carliftchangetypeplus', JSON.stringify({})); +}); + +$(".poscarliflefttext").click(function () { + $.post('https://'+liftresourcename+'/carliftchangetypeminus', JSON.stringify({})); +}); + +$(".buttoncopy").click(function () { + var copyText = document.getElementById("liftposfinishcopydata"); + + copyText.select(); + copyText.setSelectionRange(0, 99999); +}); + +$(".createcarliftbutton").click(function () { + $.post('https://'+liftresourcename+'/carliftoffsetget', JSON.stringify({})); +}); + +$("#spacebuttonlocal").click(function () { + $(this).addClass("active"); + $("#spacebuttonworld").removeClass("active"); + $.post('https://'+liftresourcename+'/carliftchangespace', JSON.stringify({ + spacetype: "local" + })); +}); + +function cameraspeedchange(e) { + $.post('https://'+liftresourcename+'/carliftspeedchange', JSON.stringify({ + speedtype: "camera", + speeddata: e.value + })); +} + +function lookspeedxchange(e) { + $.post('https://'+liftresourcename+'/carliftspeedchange', JSON.stringify({ + speedtype: "lookx", + speeddata: e.value + })); +} + +function lookspeedychange(e) { + $.post('https://'+liftresourcename+'/carliftspeedchange', JSON.stringify({ + speedtype: "looky", + speeddata: e.value + })); +} + +function translatesnapchange(e) { + $.post('https://'+liftresourcename+'/carliftsnapchange', JSON.stringify({ + snaptype: "translate", + snapdata: e.value + })); +} + +function rotationsnapchange(e) { + $.post('https://'+liftresourcename+'/carliftsnapchange', JSON.stringify({ + snaptype: "rotate", + snapdata: e.value + })); +} \ No newline at end of file diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/html/styles.css b/resources/[jobs]/[mechanic]/rtx_carlift/html/styles.css new file mode 100644 index 000000000..5738ddc29 --- /dev/null +++ b/resources/[jobs]/[mechanic]/rtx_carlift/html/styles.css @@ -0,0 +1,1156 @@ +@import url('https://kit-pro.fontawesome.com/releases/v5.14.0/css/pro.min.css'); + +:root { + --color: #ff66ff; +} + +@font-face { + font-family: BebasNeueBold; + src: url(BebasNeueBold.ttf); +} + +*{ + user-select: none; /* supported by Chrome and Opera */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ +} + +html { + overflow: hidden; + font-family: 'Open Sans', sans-serif; +} + +body{ + display: none; + color: #a8a8aa; +} + +.lift-container { + width: 14%; + height: 25%; + background-color: rgba(0, 0, 0, 0.8); + border-bottom: 3px solid var(--color); + border-radius: 1px; + margin: 0; + position: absolute; + top: 82%; + left: 90%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; + border-radius: 10px; + display: none; +} + +.closelift { + position: absolute; + margin: 0; + top: 10%; + left: 90%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.buttonup { + position: absolute; + margin: 0; + color: #ffffff; + font-size: 75px; + text-decoration: none; + text-align: center; + top: 58%; + left: 27%; + padding-top: 8px; + padding-bottom: 8px; + padding-left: 8px; + padding-right: 8px; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.buttonup:hover { + cursor: pointer; + color: var(--color); + text-decoration: none; +} + +.buttondown { + position: absolute; + margin: 0; + color: #ffffff; + font-size: 75px; + text-decoration: none; + text-align: center; + top: 58%; + left: 73%; + padding-top: 8px; + padding-bottom: 8px; + padding-left: 8px; + padding-right: 8px; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.buttondown:hover { + cursor: pointer; + color: var(--color); + text-decoration: none; +} + +.liftheadertext { + position: absolute; + margin: 0; + text-decoration: none; + text-align: center; + top: 14%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + font-size: 40px; + color: var(--color); + text-align:center; + font-family: BebasNeueBold; +} + +.liftmaintext { + position: absolute; + margin: 0; + text-decoration: none; + text-align: center; + top: 32%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + font-size: 20px; + color: #ffffff; + text-align:center; + font-family: BebasNeueBold; +} + +.liftuptext { + position: absolute; + margin: 0; + text-decoration: none; + text-align: center; + top: 85%; + left: 27%; + margin-right: -50%; + transform: translate(-50%, -50%); + font-size: 30px; + color: var(--color); + text-align:center; + font-family: BebasNeueBold; +} + +.liftdowntext { + position: absolute; + margin: 0; + text-decoration: none; + text-align: center; + top: 85%; + left: 73%; + margin-right: -50%; + transform: translate(-50%, -50%); + font-size: 30px; + color: var(--color); + text-align:center; + font-family: BebasNeueBold; +} + +.infonotify-container { + width: 17%; + background-color: rgba(0, 0, 0, 0.70); + border-bottom: 3px solid var(--color); + margin: 0; + position: absolute; + top: 50%; + left: 10%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; + border-radius: 10px; + display: none; +} + +.infonotifytext { + padding-top: 10px; + padding-bottom: 10px; + padding-left: 2px; + padding-right: 2px; + vertical-align: middle; + text-align: center; + font-size: 25px; + font-family: BebasNeueBold; + color: #ffffff; +} + +#infobindcolor { + color: var(--color); +} + +.liftpos-container { + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 50%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; + display: none; +} + +.liftposinfosettings { + width: 16%; + height: 86%; + background-color: rgba(0, 0, 0, 0.70); + border-bottom: 3px solid var(--color); + margin: 0; + position: absolute; + top: 50%; + left: 90%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; + border-radius: 10px; +} + +.poscreatormaintext { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 12%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.poscreatortext { + margin: 0; + color: #ffffff; + font-size: 30px; + text-decoration: none; + text-align: center; + float: center; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.posspacemaintext { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 18.5%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.posspacetext { + margin: 0; + color: #ffffff; + font-size: 22px; + text-decoration: none; + text-align: center; + float: center; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.posspacebuttons { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 20%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.buttontypespace { + display: inline-block; + margin: 0; + background-color: rgba(255, 255, 255, 1); + color: #000000; + font-size: 15px; + padding-top: 6px; + padding-bottom: 6px; + padding-left: 10px; + padding-right: 10px; + text-decoration: none; + text-align: center; + float: center; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; + width: 25%; +} + +.buttontypespace.active { + background-color: var(--color); + color: #ffffff; +} + +#spacebuttonworld { + position: absolute; + margin: 0; + top: 19%; + left: 35%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 99999999; +} + +#spacebuttonlocal { + position: absolute; + margin: 0; + top: 19%; + left: 65%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 99999999; +} + +.buttontypelist { + display: inline-block; + margin: 0; + background-color: rgba(0, 0, 0, 0.0); + color: #ffffff; + height: 100%; + width: 30%; + font-size: 14px; + margin-left: 1px; + margin-right: 1px; + text-decoration: none; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.buttontypelist.active { + border-bottom: 16px solid var(--color); + color: #ffffff; +} + +.posmodemaintext { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 27%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.posmodetext { + margin: 0; + color: #ffffff; + font-size: 22px; + text-decoration: none; + text-align: center; + float: center; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.posmodebuttons { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 28.5%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.buttontypemode { + display: inline-block; + margin: 0; + background-color: rgba(255, 255, 255, 1); + color: #000000; + font-size: 15px; + padding-top: 6px; + padding-bottom: 6px; + padding-left: 10px; + padding-right: 10px; + text-decoration: none; + text-align: center; + float: center; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; + width: 25%; +} + +.buttontypemode.active { + background-color: var(--color); + color: #ffffff; +} + + +#posmoretranslate { + position: absolute; + margin: 0; + top: 19%; + left: 35%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 99999999; +} + +#posmorerotation { + position: absolute; + margin: 0; + top: 19%; + left: 65%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 99999999; +} + +.poscamerasettingsmaintext { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 38%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.poscamerasettingstext { + margin: 0; + color: #ffffff; + font-size: 22px; + text-decoration: none; + text-align: center; + float: center; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.poscamerasettingsspeedmaintext { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 42%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; + padding-left: 7%; +} + +.poscamerasettingsspeedtext { + margin: 0; + color: #ffffff; + font-size: 15px; + padding-left: 7px; + padding-right: 7px; + text-decoration: none; + text-align: center; + float: left; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.poscamerasettingslookxspeedmaintext { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 50%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; + padding-left: 7%; +} + +.poscamerasettingslookxspeedtext { + margin: 0; + color: #ffffff; + font-size: 15px; + padding-left: 7px; + padding-right: 7px; + text-decoration: none; + text-align: center; + float: left; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.poscamerasettingslookyspeedmaintext { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 57.5%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; + padding-left: 7%; +} + +.poscamerasettingslookyspeedtext { + margin: 0; + color: #ffffff; + font-size: 15px; + padding-left: 7px; + padding-right: 7px; + text-decoration: none; + text-align: center; + float: left; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.posmovementsettingsmaintext { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 68%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.posmovementsettingstext { + margin: 0; + color: #ffffff; + font-size: 22px; + text-decoration: none; + text-align: center; + float: center; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.posmovementsettingstranslatemaintext { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 73%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; + padding-left: 7%; +} + +.posmovementsettingstranslatetext { + margin: 0; + color: #ffffff; + font-size: 15px; + padding-left: 7px; + padding-right: 7px; + text-decoration: none; + text-align: center; + float: left; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.posmovementsettingsrotationmaintext { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 83%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; + padding-left: 7%; +} + +.posmovementsettingsrotationtext { + margin: 0; + color: #ffffff; + font-size: 15px; + padding-left: 7px; + padding-right: 7px; + text-decoration: none; + text-align: center; + float: left; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.cameraspeed { + -webkit-appearance: none; + appearance: none; + position: absolute; + margin: 0; + background-color: rgba(202, 205, 198, 1.0); + color: #ffffff; + font-size: 35px; + text-decoration: none; + text-align: center; + top: 36%; + left: 49%; + margin-right: -50%; + transform: translate(-50%, -50%); + z-index: 99999999; + width: 96%; + height: 13%; + outline: none; + display: block; +} + +#cameraspeeddata { + background: linear-gradient(to right, var(--color) 0%, var(--color) 50%, #ccccc8 50%, #ccccc8 100%); + border-radius: 5px; + width: 86%; + height: 0.5%; + outline: none; + -webkit-appearance: none; +} + +.cameraspeed::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 14px; + height: 14px; + border-radius: 50%; + background-color: #fffefb; +} + +.lookspeedx { + -webkit-appearance: none; + appearance: none; + position: absolute; + margin: 0; + background-color: rgba(202, 205, 198, 1.0); + color: #ffffff; + font-size: 35px; + text-decoration: none; + text-align: center; + top: 43.5%; + left: 49%; + margin-right: -50%; + transform: translate(-50%, -50%); + z-index: 99999999; + width: 96%; + height: 13%; + outline: none; + display: block; +} + +#lookspeedxdata { + background: linear-gradient(to right, var(--color) 0%, var(--color) 50%, #ccccc8 50%, #ccccc8 100%); + border-radius: 5px; + width: 86%; + height: 0.5%; + outline: none; + -webkit-appearance: none; +} + +.lookspeedx::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 14px; + height: 14px; + border-radius: 50%; + background-color: #fffefb; +} + +.lookspeedy { + -webkit-appearance: none; + appearance: none; + position: absolute; + margin: 0; + background-color: rgba(202, 205, 198, 1.0); + color: #ffffff; + font-size: 35px; + text-decoration: none; + text-align: center; + top: 51.5%; + left: 49%; + margin-right: -50%; + transform: translate(-50%, -50%); + z-index: 99999999; + width: 96%; + height: 13%; + outline: none; + display: block; +} + +#lookspeedydata { + background: linear-gradient(to right, var(--color) 0%, var(--color) 50%, #ccccc8 50%, #ccccc8 100%); + border-radius: 5px; + width: 86%; + height: 0.5%; + outline: none; + -webkit-appearance: none; +} + +.lookspeedy::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 14px; + height: 14px; + border-radius: 50%; + background-color: #fffefb; +} + +.translatesnap { + -webkit-appearance: none; + appearance: none; + position: absolute; + margin: 0; + background-color: rgba(202, 205, 198, 1.0); + color: #ffffff; + font-size: 35px; + text-decoration: none; + text-align: center; + top: 67%; + left: 49%; + margin-right: -50%; + transform: translate(-50%, -50%); + z-index: 99999999; + width: 96%; + height: 13%; + outline: none; + display: block; +} + +#translatesnapdata { + background: linear-gradient(to right, var(--color) 0%, var(--color) 50%, #ccccc8 50%, #ccccc8 100%); + border-radius: 5px; + width: 86%; + height: 0.5%; + outline: none; + -webkit-appearance: none; +} + +.translatesnap::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 14px; + height: 14px; + border-radius: 50%; + background-color: #fffefb; +} + +.rotationsnap { + -webkit-appearance: none; + appearance: none; + position: absolute; + margin: 0; + background-color: rgba(202, 205, 198, 1.0); + color: #ffffff; + font-size: 35px; + text-decoration: none; + text-align: center; + top: 77%; + left: 49%; + margin-right: -50%; + transform: translate(-50%, -50%); + z-index: 99999999; + width: 96%; + height: 13%; + outline: none; + display: block; +} + +#rotationsnapdata { + background: linear-gradient(to right, var(--color) 0%, var(--color) 50%, #ccccc8 50%, #ccccc8 100%); + border-radius: 5px; + width: 86%; + height: 0.5%; + outline: none; + -webkit-appearance: none; +} + +.rotationsnap::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 14px; + height: 14px; + border-radius: 50%; + background-color: #fffefb; +} + +.poscarliftypemaintext { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 91%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.poscarliftypetext { + margin: 0; + color: #ffffff; + font-size: 22px; + text-decoration: none; + text-align: center; + float: center; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.poscarliftypedatamaintext { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 95%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.poscarliftypedatatext { + margin: 0; + color: var(--color); + font-size: 35px; + text-decoration: none; + text-align: center; + float: center; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.poscarlifleftmain { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 96%; + left: 35%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.poscarliflefttext { + margin: 0; + color: #ffffff; + font-size: 25px; + text-decoration: none; + text-align: center; + float: center; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.poscarlifrightmain { + width: 100%; + height: 20%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + position: absolute; + top: 96%; + left: 65%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.poscarlifrighttext { + margin: 0; + color: #ffffff; + font-size: 25px; + text-decoration: none; + text-align: center; + float: center; + overflow: hidden; + z-index: 99999999; + font-family: BebasNeueBold; + border: none; +} + +.createcarliftbutton { + position: absolute; + margin: 0; + background-color: rgba(0, 0, 0, 1); + border-bottom: 3px solid var(--color); + color: #ffffff; + font-size: 25px; + padding-top: 6px; + padding-bottom: 6px; + padding-left: 5px; + padding-right: 5px; + text-decoration: none; + text-align: center; + top: 95%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 99999999; + width: 60%; + border-radius: 8px; +} + +.createcarliftbutton:hover { + background: var(--color); + text-decoration: none; + color: #ffffff; +} + +.liftposfinish-container { + width: 35%; + height: 60%; + background-color: rgba(0, 0, 0, 0.70); + border-bottom: 3px solid var(--color); + border-radius: 10px; + margin: 0; + position: absolute; + top: 50%; + left: 80%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; + display: none; +} + +.headerliftposfinish { + position: absolute; + width:100%; + height: 2%; + color: #ffffff; + display: flex; + background-color: rgba(0, 0, 0, 1); + border-bottom: 3px solid var(--color); + flex-direction: row; + flex-wrap: wrap; + padding-bottom:5%; + margin-right: -50%; + transform: translate(-50%, -50%); + top: 4%; + left: 50%; +} + +.headerliftposfinishtext { + position: absolute; + margin: 0; + font-size: 32px; + color: #ffffff; + text-align: center; + top: 50%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.closeliftposfinish { + position: absolute; + margin: 0; + top: 50%; + left: 95%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; +} + +.offsetspreviewtext { + position: absolute; + margin: 0; + text-decoration: none; + text-align: center; + top: 17%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + font-size: 37px; + color: #ffffff; + text-align:center; + font-family: BebasNeueBold; +} + +.liftposfinishcopytextdatamain { + width: 80%; + height: 50%; + background-color: rgba(0, 0, 0, 0.70); + border: 2px solid var(--color); + border-radius: 10px; + margin: 0; + position: absolute; + top: 50%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 9999999; + color: #ffffff; + display: block; +} + +.liftposfinishcopytextdata { + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.0); + margin: 0; + overflow: hidden; + z-index: 9999999; + color: #ffffff; + display: block; + font-size: 15px; + padding-top: 5%; +} + +.liftposfinishcopytextdata textarea { + font-weight: 100; + border: none; + outline: none; + background: none; + color: #ffffff; + font-size: 15px; + resize: none; + outline: none; +} + +.buttoncopy { + position: absolute; + margin: 0; + background-color: rgba(0, 0, 0, 1); + border-bottom: 3px solid var(--color); + color: #ffffff; + font-size: 35px; + padding-top: 10px; + padding-bottom: 10px; + padding-left: 5px; + padding-right: 5px; + text-decoration: none; + text-align: center; + top: 87%; + left: 50%; + margin-right: -50%; + transform: translate(-50%, -50%); + overflow: hidden; + z-index: 99999999; + width: 40%; + border-radius: 8px; +} + +.buttoncopy:hover { + background: var(--color); + text-decoration: none; + color: #ffffff; +} + +.buttoncopy:hover > #copyicon { + color: #ffffff; +} + +#copyicon { + color: var(--color); +} + +.full-screen { + width: 100%; + height:100%; + display: flex; + align-items: center; +} + +*{ + font-family: BebasNeueBold; +} diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/html/ui.html b/resources/[jobs]/[mechanic]/rtx_carlift/html/ui.html new file mode 100644 index 000000000..8932cdc9f --- /dev/null +++ b/resources/[jobs]/[mechanic]/rtx_carlift/html/ui.html @@ -0,0 +1,99 @@ + + + + + + + +
+
+ +
LIFT
+
Use the buttons to control lift
+
+
UP
+
+
DOWN
+
+
+
Text
+
+
+
+
+
+
CARLIFT CREATOR
+
+
+
Space:
+
+
+ + +
+
+
Mode:
+
+
+ + +
+
+
Camera Settings
+
+
+
Camera Speed:
+
+ + +
+
Look Speed X:
+
+ +
+
Look Speed Y:
+
+ +
+
Movement Settings
+
+
+
Translate Snap
+
+ +
+
Rotation Snap
+
+ +
+
CAR LIFT TYPE
+
+
+
1
+
+
+
+
+
+
+
+
CREATE CAR LIFT
+
+
+
+
+

Car Lift Creator

+ +
+
Offsets preview
+
+ +
+
 Copy offsets
+
+
+ + + + + \ No newline at end of file diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/language/main.lua b/resources/[jobs]/[mechanic]/rtx_carlift/language/main.lua new file mode 100644 index 000000000..32aa155d2 --- /dev/null +++ b/resources/[jobs]/[mechanic]/rtx_carlift/language/main.lua @@ -0,0 +1,9 @@ +Language = { + ["English"] = { + ["presskeytoopen"] = "Press ["..Config.LiftOpenKey.."] to use lift", + ["presskeytoopeninterract"] = "Press "..Config.LiftOpenKey.." to use lift", + ["presskeytoopenclassic"] = "Press ~INPUT_CONTEXT~ to use lift", + ["somealreadyuse"] = "Someone already use this lift", + ["openlift"] = "Lift", + }, +} \ No newline at end of file diff --git a/resources/[jobs]/[mechanic]/rtx_carlift/server/main.lua b/resources/[jobs]/[mechanic]/rtx_carlift/server/main.lua new file mode 100644 index 000000000..63f142efe Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift/server/main.lua differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/.fxap b/resources/[jobs]/[mechanic]/rtx_carlift_objects/.fxap new file mode 100644 index 000000000..d692578a3 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/.fxap differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/fxmanifest.lua b/resources/[jobs]/[mechanic]/rtx_carlift_objects/fxmanifest.lua new file mode 100644 index 000000000..a833bc262 --- /dev/null +++ b/resources/[jobs]/[mechanic]/rtx_carlift_objects/fxmanifest.lua @@ -0,0 +1,36 @@ +fx_version 'adamant' + +game 'gta5' + +description 'RTX CARLIFT OBJECTS' + +version '1.0' + +lua54 'yes' + +data_file 'DLC_ITYP_REQUEST' 'sempre_impexp_carrack.ytyp' +data_file 'DLC_ITYP_REQUEST' 'sempre_impexp_carrack_lift.ytyp' +data_file 'DLC_ITYP_REQUEST' 'sempre_impexp_postlift.ytyp' +data_file 'DLC_ITYP_REQUEST' 'sempre_impexp_postlift_lift.ytyp' +data_file 'DLC_ITYP_REQUEST' 'sempre_supermod_carlift2.ytyp' +data_file 'DLC_ITYP_REQUEST' 'sempre_supermod_carlift2_lift.ytyp' +data_file 'DLC_ITYP_REQUEST' 'sempre_v_45_carlift.ytyp' +data_file 'DLC_ITYP_REQUEST' 'sempre_v_45_carlift_lift.ytyp' + + + + + + + + + + + + + + + + + +dependency '/assetpacks' \ No newline at end of file diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_carrack.ydr b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_carrack.ydr new file mode 100644 index 000000000..e6ad17035 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_carrack.ydr differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_carrack.ytyp b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_carrack.ytyp new file mode 100644 index 000000000..7bf9c7bb1 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_carrack.ytyp differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_carrack_lift.ydr b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_carrack_lift.ydr new file mode 100644 index 000000000..aa0585c3d Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_carrack_lift.ydr differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_carrack_lift.ytyp b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_carrack_lift.ytyp new file mode 100644 index 000000000..e9dee510a Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_carrack_lift.ytyp differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_postlift.ydr b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_postlift.ydr new file mode 100644 index 000000000..cff60da95 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_postlift.ydr differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_postlift.ytyp b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_postlift.ytyp new file mode 100644 index 000000000..7c28b4755 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_postlift.ytyp differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_postlift_lift.ydr b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_postlift_lift.ydr new file mode 100644 index 000000000..1fd4e2b52 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_postlift_lift.ydr differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_postlift_lift.ytyp b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_postlift_lift.ytyp new file mode 100644 index 000000000..aa6d60381 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_impexp_postlift_lift.ytyp differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_supermod_carlift2.ydr b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_supermod_carlift2.ydr new file mode 100644 index 000000000..f0020cfca Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_supermod_carlift2.ydr differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_supermod_carlift2.ytyp b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_supermod_carlift2.ytyp new file mode 100644 index 000000000..0fc32305a Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_supermod_carlift2.ytyp differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_supermod_carlift2_lift.ydr b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_supermod_carlift2_lift.ydr new file mode 100644 index 000000000..cf59ad799 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_supermod_carlift2_lift.ydr differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_supermod_carlift2_lift.ytyp b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_supermod_carlift2_lift.ytyp new file mode 100644 index 000000000..c8b18d9c0 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_supermod_carlift2_lift.ytyp differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_v_45_carlift.ydr b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_v_45_carlift.ydr new file mode 100644 index 000000000..81580de87 Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_v_45_carlift.ydr differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_v_45_carlift.ytyp b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_v_45_carlift.ytyp new file mode 100644 index 000000000..e65e5e2cb Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_v_45_carlift.ytyp differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_v_45_carlift_lift.ydr b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_v_45_carlift_lift.ydr new file mode 100644 index 000000000..e349aff9a Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_v_45_carlift_lift.ydr differ diff --git a/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_v_45_carlift_lift.ytyp b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_v_45_carlift_lift.ytyp new file mode 100644 index 000000000..e7afff10f Binary files /dev/null and b/resources/[jobs]/[mechanic]/rtx_carlift_objects/stream/sempre_v_45_carlift_lift.ytyp differ