From 182fb2e4d63ff31d23cdef5566d35b3ac6d9ad54 Mon Sep 17 00:00:00 2001 From: FarazzShaikh Date: Thu, 21 Nov 2024 19:48:07 +0000 Subject: [PATCH] deploy: 179641002693ea6ff7dc37e9dc488354a71c23f9 --- .../{index-YHW8fYWu.js => index-Cj4-uxMX.js} | 273 +++++++++--------- index.html | 2 +- 2 files changed, 138 insertions(+), 137 deletions(-) rename assets/{index-YHW8fYWu.js => index-Cj4-uxMX.js} (88%) diff --git a/assets/index-YHW8fYWu.js b/assets/index-Cj4-uxMX.js similarity index 88% rename from assets/index-YHW8fYWu.js rename to assets/index-Cj4-uxMX.js index bf6a2e8..85f75e2 100644 --- a/assets/index-YHW8fYWu.js +++ b/assets/index-Cj4-uxMX.js @@ -1,4 +1,4 @@ -function aV(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(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 a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var _v=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _l(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sV={exports:{}},KA={},oV={exports:{}},On={};/** +function aV(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(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 a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var Sv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sV={exports:{}},KA={},oV={exports:{}},On={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function aV(t,e){for(var n=0;nt?"":void 0;function pee(t){return Array.isArray(t)}function es(t){const e=typeof t;return t!=null&&(e==="object"||e==="function")&&!pee(t)}function hee(t){const e=t==null?0:t.length;return e?t[e-1]:void 0}function mee(t){const e=parseFloat(t.toString()),n=t.toString().replace(String(e),"");return{unitless:!n,value:e,unit:n}}function qR(t){if(t==null)return t;const{unitless:e}=mee(t);return e||typeof t=="number"?`${t}px`:t}const bV=(t,e)=>parseInt(t[1],10)>parseInt(e[1],10)?1:-1,zN=t=>Object.fromEntries(Object.entries(t).sort(bV));function $U(t){const e=zN(t);return Object.assign(Object.values(e),e)}function gee(t){const e=Object.keys(zN(t));return new Set(e)}function WU(t){if(!t)return t;t=qR(t)??t;const e=-.02;return typeof t=="number"?`${t+e}`:t.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+e}`)}function Gg(t,e){const n=["@media screen"];return t&&n.push("and",`(min-width: ${qR(t)})`),e&&n.push("and",`(max-width: ${qR(e)})`),n.join(" ")}function bee(t){if(!t)return null;t.base=t.base??"0px";const e=$U(t),n=Object.entries(t).sort(bV).map(([a,s],o,l)=>{let[,u]=l[o+1]??[];return u=parseFloat(u)>0?WU(u):void 0,{_minW:WU(s),breakpoint:a,minW:s,maxW:u,maxWQuery:Gg(null,u),minWQuery:Gg(s),minMaxQuery:Gg(s,u)}}),r=gee(t),i=Array.from(r.values());return{keys:r,normalized:e,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(o=>r.has(o))},asObject:zN(t),asArray:$U(t),details:n,get(a){return n.find(s=>s.breakpoint===a)},media:[null,...e.map(a=>Gg(a)).slice(1)],toArrayValue(a){if(!es(a))throw new Error("toArrayValue: value must be an object");const s=i.map(o=>a[o]??null);for(;hee(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,o,l)=>{const u=i[l];return u!=null&&o!=null&&(s[u]=o),s},{})}}}function XR(...t){return function(n){t.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function yV(t){return w.Children.toArray(t).filter(e=>w.isValidElement(e))}function HN(t){const e=Object.assign({},t);for(let n in e)e[n]===void 0&&delete e[n];return e}function yee(t,e){return`${t} returned \`undefined\`. Seems you forgot to wrap component within ${e}`}function Mo(t={}){const{name:e,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:a,defaultValue:s}=t,o=w.createContext(s);o.displayName=e;function l(){var c;const u=w.useContext(o);if(!u&&n){const d=new Error(a??yee(r,i));throw d.name="ContextError",(c=Error.captureStackTrace)==null||c.call(Error,d,l),d}return u}return[o.Provider,l,o]}const ba=(...t)=>t.filter(Boolean).join(" ");function vee(t,e,n,r){const i=typeof e=="string"?e.split("."):[e];for(r=0;r{const e=new WeakMap;return(r,i,a,s)=>{if(typeof r>"u")return t(r,i,a);e.has(r)||e.set(r,new Map);const o=e.get(r);if(o.has(i))return o.get(i);const l=t(r,i,a,s);return o.set(i,l),l}},vV=Eee(vee),See=t=>t.default||t;function _ee(t){const{wasSelected:e,enabled:n,isSelected:r,mode:i="unmount"}=t;return!!(!n||r||i==="keepMounted"&&e)}function EV(t,e=[]){const n=Object.assign({},t);for(const r of e)r in n&&delete n[r];return n}function Aee(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}const SV=Object.freeze(["base","sm","md","lg","xl","2xl"]);function Tee(t,e){return Array.isArray(t)?t.map(n=>n===null?null:e(n)):es(t)?Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{}):t!=null?e(t):null}function xee(t,e=SV){const n={};return t.forEach((r,i)=>{const a=e[i];r!=null&&(n[a]=r)}),n}const wee=t=>typeof t=="function";function Zs(t,...e){return wee(t)?t(...e):t}function Cee(t,...e){const n=Object.getOwnPropertyDescriptors(t),r=Object.keys(n),i=s=>{const o={};for(let l=0;li(Array.isArray(s)?s:r.filter(s));return e.map(a).concat(i(r))}function jU(t,e,n={}){const{stop:r,getKey:i}=n;function a(s,o=[]){if(es(s)||Array.isArray(s)){const l={};for(const[u,c]of Object.entries(s)){const d=(i==null?void 0:i(u))??u,f=[...o,d];if(r!=null&&r(s,f))return e(s,o);l[d]=a(c,f)}return l}return e(s,o)}return a(t)}var JS={exports:{}};JS.exports;(function(t,e){var n=200,r="__lodash_hash_undefined__",i=800,a=16,s=9007199254740991,o="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",m="[object Function]",g="[object GeneratorFunction]",y="[object Map]",v="[object Number]",b="[object Null]",E="[object Object]",S="[object Proxy]",A="[object RegExp]",I="[object Set]",T="[object String]",R="[object Undefined]",O="[object WeakMap]",N="[object ArrayBuffer]",M="[object DataView]",B="[object Float32Array]",G="[object Float64Array]",W="[object Int8Array]",K="[object Int16Array]",se="[object Int32Array]",ae="[object Uint8Array]",ee="[object Uint8ClampedArray]",F="[object Uint16Array]",ie="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,Ce=/^(?:0|[1-9]\d*)$/,Le={};Le[B]=Le[G]=Le[W]=Le[K]=Le[se]=Le[ae]=Le[ee]=Le[F]=Le[ie]=!0,Le[o]=Le[l]=Le[N]=Le[c]=Le[M]=Le[d]=Le[f]=Le[m]=Le[y]=Le[v]=Le[E]=Le[A]=Le[I]=Le[T]=Le[O]=!1;var j=typeof _v=="object"&&_v&&_v.Object===Object&&_v,ke=typeof self=="object"&&self&&self.Object===Object&&self,Fe=j||ke||Function("return this")(),Ye=e&&!e.nodeType&&e,gt=Ye&&!0&&t&&!t.nodeType&&t,Gt=gt&>.exports===Ye,Ut=Gt&&j.process,Mt=function(){try{var Z=gt&>.require&>.require("util").types;return Z||Ut&&Ut.binding&&Ut.binding("util")}catch{}}(),$e=Mt&&Mt.isTypedArray;function qe(Z,be,Be){switch(Be.length){case 0:return Z.call(be);case 1:return Z.call(be,Be[0]);case 2:return Z.call(be,Be[0],Be[1]);case 3:return Z.call(be,Be[0],Be[1],Be[2])}return Z.apply(be,Be)}function re(Z,be){for(var Be=-1,Wt=Array(Z);++Be-1}function Ct(Z,be){var Be=this.__data__,Wt=Ee(Be,Z);return Wt<0?(++this.size,Be.push([Z,be])):Be[Wt][1]=be,this}Gn.prototype.clear=he,Gn.prototype.delete=_e,Gn.prototype.get=Oe,Gn.prototype.has=Ze,Gn.prototype.set=Ct;function kt(Z){var be=-1,Be=Z==null?0:Z.length;for(this.clear();++be1?Be[kn-1]:void 0,gr=kn>2?Be[2]:void 0;for(In=Z.length>3&&typeof In=="function"?(kn--,In):void 0,gr&&hr(Be[0],Be[1],gr)&&(In=kn<3?void 0:In,kn=1),be=Object(be);++Wt-1&&Z%1==0&&Z0){if(++be>=i)return arguments[0]}else be=0;return Z.apply(void 0,arguments)}}function $c(Z){if(Z!=null){try{return U.call(Z)}catch{}try{return Z+""}catch{}}return""}function Xf(Z,be){return Z===be||Z!==Z&&be!==be}var Wc=Qe(function(){return arguments}())?Qe:function(Z){return Tl(Z)&&ue.call(Z,"callee")&&!zt.call(Z,"callee")},Ln=Array.isArray;function Kf(Z){return Z!=null&&Py(Z.length)&&!zm(Z)}function Fm(Z){return Tl(Z)&&Kf(Z)}var Um=De||Is;function zm(Z){if(!mr(Z))return!1;var be=Ve(Z);return be==m||be==g||be==u||be==S}function Py(Z){return typeof Z=="number"&&Z>-1&&Z%1==0&&Z<=s}function mr(Z){var be=typeof Z;return Z!=null&&(be=="object"||be=="function")}function Tl(Z){return Z!=null&&typeof Z=="object"}function l1(Z){if(!Tl(Z)||Ve(Z)!=E)return!1;var be=tt(Z);if(be===null)return!0;var Be=ue.call(be,"constructor")&&be.constructor;return typeof Be=="function"&&Be instanceof Be&&U.call(Be)==Pe}var Zf=$e?At($e):Ue;function u1(Z){return ar(Z,jc(Z))}function jc(Z){return Kf(Z)?le(Z):ct(Z)}var Rs=Wn(function(Z,be,Be,Wt){Bt(Z,be,Be,Wt)});function c1(Z){return function(){return Z}}function By(Z){return Z}function Is(){return!1}t.exports=Rs})(JS,JS.exports);var Ree=JS.exports;const rl=_l(Ree);function pS(t,e=[]){const n=w.useRef(t);return w.useEffect(()=>{n.current=t}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},e)}function Iee(t){const{value:e,defaultValue:n,onChange:r,shouldUpdate:i=(f,m)=>f!==m}=t,a=pS(r),s=pS(i),[o,l]=w.useState(n),u=e!==void 0,c=u?e:o,d=pS(f=>{const g=typeof f=="function"?f(c):f;s(c,g)&&(u||l(g),a(g))},[u,a,c,s]);return[c,d]}const e_=globalThis!=null&&globalThis.document?w.useLayoutEffect:w.useEffect,YU=(t,e)=>{const n=w.useRef(!1),r=w.useRef(!1);w.useEffect(()=>{if(n.current&&r.current)return t();r.current=!0},e),w.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function Mee(t,e){if(t!=null){if(typeof t=="function"){t(e);return}try{t.current=e}catch{throw new Error(`Cannot assign value '${e}' to ref '${t}'`)}}}function ZA(...t){return e=>{t.forEach(n=>{Mee(n,e)})}}function Nee(...t){return w.useMemo(()=>ZA(...t),t)}function Oee(t,e){const n=pS(t);w.useEffect(()=>{if(e==null)return;let r=null;return r=window.setTimeout(()=>{n()},e),()=>{r&&window.clearTimeout(r)}},[e,n])}const mi={open:(t,e)=>`${t}[data-open], ${t}[open], ${t}[data-state=open] ${e}`,closed:(t,e)=>`${t}[data-closed], ${t}[data-state=closed] ${e}`,hover:(t,e)=>`${t}:hover ${e}, ${t}[data-hover] ${e}`,focus:(t,e)=>`${t}:focus ${e}, ${t}[data-focus] ${e}`,focusVisible:(t,e)=>`${t}:focus-visible ${e}`,focusWithin:(t,e)=>`${t}:focus-within ${e}`,active:(t,e)=>`${t}:active ${e}, ${t}[data-active] ${e}`,disabled:(t,e)=>`${t}:disabled ${e}, ${t}[data-disabled] ${e}`,invalid:(t,e)=>`${t}:invalid ${e}, ${t}[data-invalid] ${e}`,checked:(t,e)=>`${t}:checked ${e}, ${t}[data-checked] ${e}`,indeterminate:(t,e)=>`${t}:indeterminate ${e}, ${t}[aria-checked=mixed] ${e}, ${t}[data-indeterminate] ${e}`,readOnly:(t,e)=>`${t}:read-only ${e}, ${t}[readonly] ${e}, ${t}[data-read-only] ${e}`,expanded:(t,e)=>`${t}:read-only ${e}, ${t}[aria-expanded=true] ${e}, ${t}[data-expanded] ${e}`,placeholderShown:(t,e)=>`${t}:placeholder-shown ${e}`},Wo=t=>_V(e=>t(e,"&"),"[role=group]","[data-group]",".group"),Ml=t=>_V(e=>t(e,"~ &"),"[data-peer]",".peer"),_V=(t,...e)=>e.map(t).join(", "),Dee={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within, &[data-focus-within]",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty, &[data-empty]",_expanded:"&[aria-expanded=true], &[data-expanded], &[data-state=expanded]",_checked:"&[aria-checked=true], &[data-checked], &[data-state=checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate], &[data-state=indeterminate]",_groupOpen:Wo(mi.open),_groupClosed:Wo(mi.closed),_groupHover:Wo(mi.hover),_peerHover:Ml(mi.hover),_groupFocus:Wo(mi.focus),_peerFocus:Ml(mi.focus),_groupFocusVisible:Wo(mi.focusVisible),_peerFocusVisible:Ml(mi.focusVisible),_groupActive:Wo(mi.active),_peerActive:Ml(mi.active),_groupDisabled:Wo(mi.disabled),_peerDisabled:Ml(mi.disabled),_groupInvalid:Wo(mi.invalid),_peerInvalid:Ml(mi.invalid),_groupChecked:Wo(mi.checked),_peerChecked:Ml(mi.checked),_groupFocusWithin:Wo(mi.focusWithin),_peerFocusWithin:Ml(mi.focusWithin),_peerPlaceholderShown:Ml(mi.placeholderShown),_placeholder:"&::placeholder, &[data-placeholder]",_placeholderShown:"&:placeholder-shown, &[data-placeholder-shown]",_fullScreen:"&:fullscreen, &[data-fullscreen]",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]",_open:"&[data-open], &[open], &[data-state=open]",_closed:"&[data-closed], &[data-state=closed]",_complete:"&[data-complete]",_incomplete:"&[data-incomplete]",_current:"&[data-current]"};function QA(t){const e=t.conditions??{},n=Object.fromEntries(Object.entries(e).map(([r,i])=>[`_${r}`,i]));return{...Dee,...n}}function AV(t){return Object.keys(QA(t))}const Lee=t=>/!(important)?$/.test(t),qU=t=>typeof t=="string"?t.replace(/!(important)?$/,"").trim():t,kee=(t,e)=>n=>{const r=String(e),i=Lee(r),a=qU(r),s=t?`${t}.${a}`:a;let o=es(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:e;return o=qU(o),i?`${o} !important`:o};function GN(t){const{scale:e,transform:n,compose:r}=t;return(a,s)=>{const o=kee(e,a)(s);let l=(n==null?void 0:n(o,s))??o;return r&&(l=r(l,s)),l}}const Tv=(...t)=>e=>t.reduce((n,r)=>r(n),e);function Fs(t,e){return n=>{const r={property:n,scale:t};return r.transform=GN({scale:t,transform:e}),r}}const Pee=({rtl:t,ltr:e})=>n=>n.direction==="rtl"?t:e;function Bee(t){const{property:e,scale:n,transform:r}=t;return{scale:n,property:Pee(e),transform:n?GN({scale:n,compose:r}):r}}const TV=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function Fee(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...TV].join(" ")}function Uee(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...TV].join(" ")}const zee={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},Hee={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function Gee(t){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":t,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}const Vee={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},KR={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},$ee=new Set(Object.values(KR)),ZR=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Wee=t=>t.trim();function jee(t,e){if(t==null||ZR.has(t))return t;if(!(QR(t)||ZR.has(t)))return`url('${t}')`;const i=/(^[a-z-A-Z]+)\((.*)\)/g.exec(t),a=i==null?void 0:i[1],s=i==null?void 0:i[2];if(!a||!s)return t;const o=a.includes("-gradient")?a:`${a}-gradient`,[l,...u]=s.split(",").map(Wee).filter(Boolean);if((u==null?void 0:u.length)===0)return t;const c=l in KR?KR[l]:l;u.unshift(c);const d=u.map(f=>{if($ee.has(f))return f;const m=f.indexOf(" "),[g,y]=m!==-1?[f.substr(0,m),f.substr(m+1)]:[f],v=QR(y)?y:y&&y.split(" "),b=`colors.${g}`,E=b in e.__cssMap?e.__cssMap[b].varRef:g;return v?[E,...Array.isArray(v)?v:[v]].join(" "):E});return`${o}(${d.join(", ")})`}const QR=t=>typeof t=="string"&&t.includes("(")&&t.includes(")"),Yee=(t,e)=>jee(t,e??{});function qee(t){return/^var\(--.+\)$/.test(t)}const Xee=t=>{const e=parseFloat(t.toString()),n=t.toString().replace(String(e),"");return{unitless:!n,value:e,unit:n}},jo=t=>e=>`${t}(${e})`,Fn={filter(t){return t!=="auto"?t:zee},backdropFilter(t){return t!=="auto"?t:Hee},ring(t){return Gee(Fn.px(t))},bgClip(t){return t==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:t}},transform(t){return t==="auto"?Fee():t==="auto-gpu"?Uee():t},vh(t){return t==="$100vh"?"var(--chakra-vh)":t},px(t){if(t==null)return t;const{unitless:e}=Xee(t);return e||typeof t=="number"?`${t}px`:t},fraction(t){return typeof t!="number"||t>1?t:`${t*100}%`},float(t,e){const n={left:"right",right:"left"};return e.direction==="rtl"?n[t]:t},degree(t){if(qee(t)||t==null)return t;const e=typeof t=="string"&&!t.endsWith("deg");return typeof t=="number"||e?`${t}deg`:t},gradient:Yee,blur:jo("blur"),opacity:jo("opacity"),brightness:jo("brightness"),contrast:jo("contrast"),dropShadow:jo("drop-shadow"),grayscale:jo("grayscale"),hueRotate:t=>jo("hue-rotate")(Fn.degree(t)),invert:jo("invert"),saturate:jo("saturate"),sepia:jo("sepia"),bgImage(t){return t==null||QR(t)||ZR.has(t)?t:`url(${t})`},outline(t){const e=String(t)==="0"||String(t)==="none";return t!==null&&e?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:t}},flexDirection(t){const{space:e,divide:n}=Vee[t]??{},r={flexDirection:t};return e&&(r[e]=1),n&&(r[n]=1),r}},ye={borderWidths:Fs("borderWidths"),borderStyles:Fs("borderStyles"),colors:Fs("colors"),borders:Fs("borders"),gradients:Fs("gradients",Fn.gradient),radii:Fs("radii",Fn.px),space:Fs("space",Tv(Fn.vh,Fn.px)),spaceT:Fs("space",Tv(Fn.vh,Fn.px)),degreeT(t){return{property:t,transform:Fn.degree}},prop(t,e,n){return{property:t,scale:e,...e&&{transform:GN({scale:e,transform:n})}}},propT(t,e){return{property:t,transform:e}},sizes:Fs("sizes",Tv(Fn.vh,Fn.px)),sizesT:Fs("sizes",Tv(Fn.vh,Fn.fraction)),shadows:Fs("shadows"),logical:Bee,blur:Fs("blur",Fn.blur)},hS={background:ye.colors("background"),backgroundColor:ye.colors("backgroundColor"),backgroundImage:ye.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Fn.bgClip},bgSize:ye.prop("backgroundSize"),bgPosition:ye.prop("backgroundPosition"),bg:ye.colors("background"),bgColor:ye.colors("backgroundColor"),bgPos:ye.prop("backgroundPosition"),bgRepeat:ye.prop("backgroundRepeat"),bgAttachment:ye.prop("backgroundAttachment"),bgGradient:ye.gradients("backgroundImage"),bgClip:{transform:Fn.bgClip}};Object.assign(hS,{bgImage:hS.backgroundImage,bgImg:hS.backgroundImage});const Jn={border:ye.borders("border"),borderWidth:ye.borderWidths("borderWidth"),borderStyle:ye.borderStyles("borderStyle"),borderColor:ye.colors("borderColor"),borderRadius:ye.radii("borderRadius"),borderTop:ye.borders("borderTop"),borderBlockStart:ye.borders("borderBlockStart"),borderTopLeftRadius:ye.radii("borderTopLeftRadius"),borderStartStartRadius:ye.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:ye.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:ye.radii("borderTopRightRadius"),borderStartEndRadius:ye.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:ye.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:ye.borders("borderRight"),borderInlineEnd:ye.borders("borderInlineEnd"),borderBottom:ye.borders("borderBottom"),borderBlockEnd:ye.borders("borderBlockEnd"),borderBottomLeftRadius:ye.radii("borderBottomLeftRadius"),borderBottomRightRadius:ye.radii("borderBottomRightRadius"),borderLeft:ye.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:ye.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:ye.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:ye.borders(["borderLeft","borderRight"]),borderInline:ye.borders("borderInline"),borderY:ye.borders(["borderTop","borderBottom"]),borderBlock:ye.borders("borderBlock"),borderTopWidth:ye.borderWidths("borderTopWidth"),borderBlockStartWidth:ye.borderWidths("borderBlockStartWidth"),borderTopColor:ye.colors("borderTopColor"),borderBlockStartColor:ye.colors("borderBlockStartColor"),borderTopStyle:ye.borderStyles("borderTopStyle"),borderBlockStartStyle:ye.borderStyles("borderBlockStartStyle"),borderBottomWidth:ye.borderWidths("borderBottomWidth"),borderBlockEndWidth:ye.borderWidths("borderBlockEndWidth"),borderBottomColor:ye.colors("borderBottomColor"),borderBlockEndColor:ye.colors("borderBlockEndColor"),borderBottomStyle:ye.borderStyles("borderBottomStyle"),borderBlockEndStyle:ye.borderStyles("borderBlockEndStyle"),borderLeftWidth:ye.borderWidths("borderLeftWidth"),borderInlineStartWidth:ye.borderWidths("borderInlineStartWidth"),borderLeftColor:ye.colors("borderLeftColor"),borderInlineStartColor:ye.colors("borderInlineStartColor"),borderLeftStyle:ye.borderStyles("borderLeftStyle"),borderInlineStartStyle:ye.borderStyles("borderInlineStartStyle"),borderRightWidth:ye.borderWidths("borderRightWidth"),borderInlineEndWidth:ye.borderWidths("borderInlineEndWidth"),borderRightColor:ye.colors("borderRightColor"),borderInlineEndColor:ye.colors("borderInlineEndColor"),borderRightStyle:ye.borderStyles("borderRightStyle"),borderInlineEndStyle:ye.borderStyles("borderInlineEndStyle"),borderTopRadius:ye.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:ye.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:ye.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:ye.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Jn,{rounded:Jn.borderRadius,roundedTop:Jn.borderTopRadius,roundedTopLeft:Jn.borderTopLeftRadius,roundedTopRight:Jn.borderTopRightRadius,roundedTopStart:Jn.borderStartStartRadius,roundedTopEnd:Jn.borderStartEndRadius,roundedBottom:Jn.borderBottomRadius,roundedBottomLeft:Jn.borderBottomLeftRadius,roundedBottomRight:Jn.borderBottomRightRadius,roundedBottomStart:Jn.borderEndStartRadius,roundedBottomEnd:Jn.borderEndEndRadius,roundedLeft:Jn.borderLeftRadius,roundedRight:Jn.borderRightRadius,roundedStart:Jn.borderInlineStartRadius,roundedEnd:Jn.borderInlineEndRadius,borderStart:Jn.borderInlineStart,borderEnd:Jn.borderInlineEnd,borderTopStartRadius:Jn.borderStartStartRadius,borderTopEndRadius:Jn.borderStartEndRadius,borderBottomStartRadius:Jn.borderEndStartRadius,borderBottomEndRadius:Jn.borderEndEndRadius,borderStartRadius:Jn.borderInlineStartRadius,borderEndRadius:Jn.borderInlineEndRadius,borderStartWidth:Jn.borderInlineStartWidth,borderEndWidth:Jn.borderInlineEndWidth,borderStartColor:Jn.borderInlineStartColor,borderEndColor:Jn.borderInlineEndColor,borderStartStyle:Jn.borderInlineStartStyle,borderEndStyle:Jn.borderInlineEndStyle});const Kee={color:ye.colors("color"),textColor:ye.colors("color"),fill:ye.colors("fill"),stroke:ye.colors("stroke"),accentColor:ye.colors("accentColor"),textFillColor:ye.colors("textFillColor")},t_={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Fn.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:ye.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:ye.space("gap"),rowGap:ye.space("rowGap"),columnGap:ye.space("columnGap")};Object.assign(t_,{flexDir:t_.flexDirection});const Gs={width:ye.sizesT("width"),inlineSize:ye.sizesT("inlineSize"),height:ye.sizes("height"),blockSize:ye.sizes("blockSize"),boxSize:ye.sizes(["width","height"]),minWidth:ye.sizes("minWidth"),minInlineSize:ye.sizes("minInlineSize"),minHeight:ye.sizes("minHeight"),minBlockSize:ye.sizes("minBlockSize"),maxWidth:ye.sizes("maxWidth"),maxInlineSize:ye.sizes("maxInlineSize"),maxHeight:ye.sizes("maxHeight"),maxBlockSize:ye.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(t,e)=>{var i,a;return{[`@media screen and (min-width: ${((a=(i=e.__breakpoints)==null?void 0:i.get(t))==null?void 0:a.minW)??t})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(t,e)=>{var i,a;return{[`@media screen and (max-width: ${((a=(i=e.__breakpoints)==null?void 0:i.get(t))==null?void 0:a._minW)??t})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:ye.propT("float",Fn.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Gs,{w:Gs.width,h:Gs.height,minW:Gs.minWidth,maxW:Gs.maxWidth,minH:Gs.minHeight,maxH:Gs.maxHeight,overscroll:Gs.overscrollBehavior,overscrollX:Gs.overscrollBehaviorX,overscrollY:Gs.overscrollBehaviorY});const Zee={filter:{transform:Fn.filter},blur:ye.blur("--chakra-blur"),brightness:ye.propT("--chakra-brightness",Fn.brightness),contrast:ye.propT("--chakra-contrast",Fn.contrast),hueRotate:ye.propT("--chakra-hue-rotate",Fn.hueRotate),invert:ye.propT("--chakra-invert",Fn.invert),saturate:ye.propT("--chakra-saturate",Fn.saturate),dropShadow:ye.propT("--chakra-drop-shadow",Fn.dropShadow),backdropFilter:{transform:Fn.backdropFilter},backdropBlur:ye.blur("--chakra-backdrop-blur"),backdropBrightness:ye.propT("--chakra-backdrop-brightness",Fn.brightness),backdropContrast:ye.propT("--chakra-backdrop-contrast",Fn.contrast),backdropHueRotate:ye.propT("--chakra-backdrop-hue-rotate",Fn.hueRotate),backdropInvert:ye.propT("--chakra-backdrop-invert",Fn.invert),backdropSaturate:ye.propT("--chakra-backdrop-saturate",Fn.saturate)},Qee={ring:{transform:Fn.ring},ringColor:ye.colors("--chakra-ring-color"),ringOffset:ye.prop("--chakra-ring-offset-width"),ringOffsetColor:ye.colors("--chakra-ring-offset-color"),ringInset:ye.prop("--chakra-ring-inset")},Jee={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Fn.outline},outlineOffset:!0,outlineColor:ye.colors("outlineColor")},xV={gridGap:ye.space("gridGap"),gridColumnGap:ye.space("gridColumnGap"),gridRowGap:ye.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0};function ete(t,e,n,r){const i=typeof e=="string"?e.split("."):[e];for(r=0;r{const e=new WeakMap;return(r,i,a,s)=>{if(typeof r>"u")return t(r,i,a);e.has(r)||e.set(r,new Map);const o=e.get(r);if(o.has(i))return o.get(i);const l=t(r,i,a,s);return o.set(i,l),l}},nte=tte(ete),rte={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},ite={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},ow=(t,e,n)=>{const r={},i=nte(t,e,{});for(const a in i)a in n&&n[a]!=null||(r[a]=i[a]);return r},ate={srOnly:{transform(t){return t===!0?rte:t==="focusable"?ite:{}}},layerStyle:{processResult:!0,transform:(t,e,n)=>ow(e,`layerStyles.${t}`,n)},textStyle:{processResult:!0,transform:(t,e,n)=>ow(e,`textStyles.${t}`,n)},apply:{processResult:!0,transform:(t,e,n)=>ow(e,t,n)}},s0={position:!0,pos:ye.prop("position"),zIndex:ye.prop("zIndex","zIndices"),inset:ye.spaceT("inset"),insetX:ye.spaceT(["left","right"]),insetInline:ye.spaceT("insetInline"),insetY:ye.spaceT(["top","bottom"]),insetBlock:ye.spaceT("insetBlock"),top:ye.spaceT("top"),insetBlockStart:ye.spaceT("insetBlockStart"),bottom:ye.spaceT("bottom"),insetBlockEnd:ye.spaceT("insetBlockEnd"),left:ye.spaceT("left"),insetInlineStart:ye.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:ye.spaceT("right"),insetInlineEnd:ye.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(s0,{insetStart:s0.insetInlineStart,insetEnd:s0.insetInlineEnd});const JR={boxShadow:ye.shadows("boxShadow"),mixBlendMode:!0,blendMode:ye.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:ye.prop("backgroundBlendMode"),opacity:!0};Object.assign(JR,{shadow:JR.boxShadow});const Tr={margin:ye.spaceT("margin"),marginTop:ye.spaceT("marginTop"),marginBlockStart:ye.spaceT("marginBlockStart"),marginRight:ye.spaceT("marginRight"),marginInlineEnd:ye.spaceT("marginInlineEnd"),marginBottom:ye.spaceT("marginBottom"),marginBlockEnd:ye.spaceT("marginBlockEnd"),marginLeft:ye.spaceT("marginLeft"),marginInlineStart:ye.spaceT("marginInlineStart"),marginX:ye.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:ye.spaceT("marginInline"),marginY:ye.spaceT(["marginTop","marginBottom"]),marginBlock:ye.spaceT("marginBlock"),padding:ye.space("padding"),paddingTop:ye.space("paddingTop"),paddingBlockStart:ye.space("paddingBlockStart"),paddingRight:ye.space("paddingRight"),paddingBottom:ye.space("paddingBottom"),paddingBlockEnd:ye.space("paddingBlockEnd"),paddingLeft:ye.space("paddingLeft"),paddingInlineStart:ye.space("paddingInlineStart"),paddingInlineEnd:ye.space("paddingInlineEnd"),paddingX:ye.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:ye.space("paddingInline"),paddingY:ye.space(["paddingTop","paddingBottom"]),paddingBlock:ye.space("paddingBlock")};Object.assign(Tr,{m:Tr.margin,mt:Tr.marginTop,mr:Tr.marginRight,me:Tr.marginInlineEnd,marginEnd:Tr.marginInlineEnd,mb:Tr.marginBottom,ml:Tr.marginLeft,ms:Tr.marginInlineStart,marginStart:Tr.marginInlineStart,mx:Tr.marginX,my:Tr.marginY,p:Tr.padding,pt:Tr.paddingTop,py:Tr.paddingY,px:Tr.paddingX,pb:Tr.paddingBottom,pl:Tr.paddingLeft,ps:Tr.paddingInlineStart,paddingStart:Tr.paddingInlineStart,pr:Tr.paddingRight,pe:Tr.paddingInlineEnd,paddingEnd:Tr.paddingInlineEnd});const ste={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:ye.spaceT("scrollMargin"),scrollMarginTop:ye.spaceT("scrollMarginTop"),scrollMarginBottom:ye.spaceT("scrollMarginBottom"),scrollMarginLeft:ye.spaceT("scrollMarginLeft"),scrollMarginRight:ye.spaceT("scrollMarginRight"),scrollMarginX:ye.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:ye.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:ye.spaceT("scrollPadding"),scrollPaddingTop:ye.spaceT("scrollPaddingTop"),scrollPaddingBottom:ye.spaceT("scrollPaddingBottom"),scrollPaddingLeft:ye.spaceT("scrollPaddingLeft"),scrollPaddingRight:ye.spaceT("scrollPaddingRight"),scrollPaddingX:ye.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:ye.spaceT(["scrollPaddingTop","scrollPaddingBottom"])},ote={fontFamily:ye.prop("fontFamily","fonts"),fontSize:ye.prop("fontSize","fontSizes",Fn.px),fontWeight:ye.prop("fontWeight","fontWeights"),lineHeight:ye.prop("lineHeight","lineHeights"),letterSpacing:ye.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(t){if(t===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},lte={textDecorationColor:ye.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:ye.shadows("textShadow")},ute={clipPath:!0,transform:ye.propT("transform",Fn.transform),transformOrigin:!0,translateX:ye.spaceT("--chakra-translate-x"),translateY:ye.spaceT("--chakra-translate-y"),skewX:ye.degreeT("--chakra-skew-x"),skewY:ye.degreeT("--chakra-skew-y"),scaleX:ye.prop("--chakra-scale-x"),scaleY:ye.prop("--chakra-scale-y"),scale:ye.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:ye.degreeT("--chakra-rotate")},cte={listStyleType:!0,listStylePosition:!0,listStylePos:ye.prop("listStylePosition"),listStyleImage:!0,listStyleImg:ye.prop("listStyleImage")},dte={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:ye.prop("transitionDuration","transition.duration"),transitionProperty:ye.prop("transitionProperty","transition.property"),transitionTimingFunction:ye.prop("transitionTimingFunction","transition.easing")},VN=rl({},hS,Jn,Kee,t_,Gs,Zee,Qee,Jee,xV,ate,s0,JR,Tr,ste,ote,lte,ute,cte,dte);Object.assign({},Tr,Gs,t_,xV,s0);const fte=t=>[...Object.keys(VN),...AV(t)],pte=t=>{const e=QA(t),n={...VN,...e};return r=>Object.hasOwnProperty.call(n,r)},hte=t=>e=>{if(!e.__breakpoints)return t;const{isResponsive:n,toArrayValue:r,media:i}=e.__breakpoints,a={};for(const s in t){let o=Zs(t[s],e);if(o==null)continue;if(o=es(o)&&n(o)?r(o):o,!Array.isArray(o)){a[s]=o;continue}const l=o.slice(0,i.length).length;for(let u=0;ut.startsWith("--")&&typeof e=="string"&&!gte(e),yte=(t,e)=>{if(e==null)return e;const n=s=>{var o,l;return(l=(o=t.__cssMap)==null?void 0:o[s])==null?void 0:l.varRef},r=s=>n(s)??s,[i,a]=mte(e);return e=n(i)??r(a)??r(e),e};function vte(t){const{configs:e={},pseudos:n={},theme:r}=t,i=(a,s=!1)=>{var c;const o=Zs(a,r),l=hte(o)(r);let u={};for(let d in l){const f=l[d];let m=Zs(f,r);d in n&&(d=n[d]),bte(d,m)&&(m=yte(r,m));let g=e[d];if(g===!0&&(g={property:d}),es(m)){u[d]=u[d]??{},u[d]=rl({},u[d],i(m,!0));continue}let y=((c=g==null?void 0:g.transform)==null?void 0:c.call(g,m,r,o))??m;y=g!=null&&g.processResult?i(y,!0):y;const v=Zs(g==null?void 0:g.property,r);if(!s&&(g!=null&&g.static)){const b=Zs(g.static,r);u=rl({},u,b)}if(v&&Array.isArray(v)){for(const b of v)u[b]=y;continue}if(v){v==="&"&&es(y)?u=rl({},u,y):u[v]=y;continue}if(es(y)){u=rl({},u,y);continue}u[d]=y}return u};return i}const wV=t=>e=>vte({theme:e,pseudos:QA(e),configs:VN})(t);function _r(t){return{definePartsStyle(e){return e},defineMultiStyleConfig(e){return{parts:t,...e}}}}function Ete(t,e){if(Array.isArray(t))return t;if(es(t))return e(t);if(t!=null)return[t]}function Ste(t,e){for(let n=e+1;n{rl(o,{[S]:c?E[S]:{[b]:E[S]}})});continue}if(!d){c?rl(o,E):o[b]=E;continue}o[b]=E}}return o}}function Ate(t){return e=>{const{variant:n,size:r,theme:i}=e,a=_te(i);return rl({},Zs(t.baseStyle??{},e),a(t,"sizes",r,e),a(t,"variants",n,e))}}function um(t){return EV(t,["styleConfig","size","variant","colorScheme"])}function CV(t){return es(t)&&t.reference?t.reference:String(t)}const JA=(t,...e)=>e.map(CV).join(` ${t} `).replace(/calc/g,""),XU=(...t)=>`calc(${JA("+",...t)})`,KU=(...t)=>`calc(${JA("-",...t)})`,eI=(...t)=>`calc(${JA("*",...t)})`,ZU=(...t)=>`calc(${JA("/",...t)})`,QU=t=>{const e=CV(t);return e!=null&&!Number.isNaN(parseFloat(e))?String(e).startsWith("-")?String(e).slice(1):`-${e}`:eI(e,-1)},Vl=Object.assign(t=>({add:(...e)=>Vl(XU(t,...e)),subtract:(...e)=>Vl(KU(t,...e)),multiply:(...e)=>Vl(eI(t,...e)),divide:(...e)=>Vl(ZU(t,...e)),negate:()=>Vl(QU(t)),toString:()=>t.toString()}),{add:XU,subtract:KU,multiply:eI,divide:ZU,negate:QU});function Tte(t,e="-"){return t.replace(/\s+/g,e)}function xte(t){const e=Tte(t.toString());return Cte(wte(e))}function wte(t){return t.includes("\\.")?t:!Number.isInteger(parseFloat(t.toString()))?t.replace(".","\\."):t}function Cte(t){return t.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function Rte(t,e=""){return[e,t].filter(Boolean).join("-")}function Ite(t,e){return`var(${t}${e?`, ${e}`:""})`}function Mte(t,e=""){return xte(`--${Rte(t,e)}`)}function on(t,e,n){const r=Mte(t,n);return{variable:r,reference:Ite(r,e)}}function Nte(t,e){const n={};for(const r of e){if(Array.isArray(r)){const[i,a]=r;n[i]=on(`${t}-${i}`,a);continue}n[r]=on(`${t}-${r}`)}return n}const Ote=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function Dte(t){return Aee(t,Ote)}function Lte(t){return t.semanticTokens}function kte(t){const{__cssMap:e,__cssVars:n,__breakpoints:r,...i}=t;return i}function Pte(t){const e=Dte(t),n=Lte(t),r=AV(t),i=s=>r.includes(s)||s==="default",a={};return jU(e,(s,o)=>{s!=null&&(a[o.join(".")]={isSemantic:!1,value:s})}),jU(n,(s,o)=>{s!=null&&(a[o.join(".")]={isSemantic:!0,value:s})},{stop:s=>Object.keys(s).every(i)}),a}function JU(t,e){return on(String(t).replace(/\./g,"-"),void 0,e)}function Bte(t){var o;const e=Pte(t),n=(o=t.config)==null?void 0:o.cssVarPrefix,r=QA(t);let i={};const a={};function s(l,u){const d=[String(l).split(".")[0],u].join(".");if(!e[d])return u;const{reference:m}=JU(d,n);return m}for(const[l,u]of Object.entries(e)){const{isSemantic:c,value:d}=u,{variable:f,reference:m}=JU(l,n);if(!c){if(l.startsWith("space")){const y=l.split("."),[v,...b]=y,E=`${v}.-${b.join(".")}`,S=Vl.negate(d),A=Vl.negate(m);a[E]={value:S,var:f,varRef:A}}i[f]=d,a[l]={value:d,var:f,varRef:m};continue}const g=es(d)?d:{default:d};i=rl(i,Object.entries(g).reduce((y,[v,b])=>{if(!b)return y;const E=s(l,`${b}`);if(v==="default")return y[f]=E,y;const S=(r==null?void 0:r[v])??v;return y[S]={[f]:E},y},{})),a[l]={value:m,var:f,varRef:m}}return{cssVars:i,cssMap:a}}function Fte(t){const e=kte(t),{cssMap:n,cssVars:r}=Bte(e),i={"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},a=pte(e);return Object.assign(e,{__cssVars:{...i,...r},__cssMap:n,__breakpoints:bee(e.breakpoints),__isStyleProp:a}),e}function rr(t,e={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function i(...c){r();for(const d of c)e[d]=l(d);return rr(t,e)}function a(...c){for(const d of c)d in e||(e[d]=l(d));return rr(t,e)}function s(){return Object.fromEntries(Object.entries(e).map(([d,f])=>[d,f.selector]))}function o(){return Object.fromEntries(Object.entries(e).map(([d,f])=>[d,f.className]))}function l(c){const m=`chakra-${(["container","root"].includes(c??"")?[t]:[t,c]).filter(Boolean).join("__")}`;return{className:m,selector:`.${m}`,toString:()=>c}}return{parts:i,toPart:l,extend:a,selectors:s,classnames:o,get keys(){return Object.keys(e)},__type:{}}}const Ute=rr("accordion").parts("root","container","button","panel","icon"),zte=rr("alert").parts("title","description","container","icon","spinner"),Hte=rr("avatar").parts("label","badge","container","excessLabel","group"),Gte=rr("breadcrumb").parts("link","item","container","separator");rr("button").parts();const Vte=rr("checkbox").parts("control","icon","container","label");rr("progress").parts("track","filledTrack","label");const $te=rr("drawer").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),Wte=rr("editable").parts("preview","input","textarea"),jte=rr("form").parts("container","requiredIndicator","helperText"),Yte=rr("formError").parts("text","icon"),qte=rr("input").parts("addon","field","element","group"),Xte=rr("list").parts("container","item","icon"),Kte=rr("menu").parts("button","list","item","groupTitle","icon","command","divider"),Zte=rr("modal").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),Qte=rr("numberinput").parts("root","field","stepperGroup","stepper");rr("pininput").parts("field");const Jte=rr("popover").parts("content","header","body","footer","popper","arrow","closeButton"),ene=rr("progress").parts("label","filledTrack","track"),tne=rr("radio").parts("container","control","label"),nne=rr("select").parts("field","icon"),rne=rr("slider").parts("container","track","thumb","filledTrack","mark"),ine=rr("stat").parts("container","label","helpText","number","icon"),ane=rr("switch").parts("container","track","thumb","label"),sne=rr("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),one=rr("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),lne=rr("tag").parts("container","label","closeButton"),une=rr("card").parts("container","header","body","footer");rr("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");const{definePartsStyle:cne,defineMultiStyleConfig:dne}=_r(Ute.keys),fne={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},pne={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},hne={pt:"2",px:"4",pb:"5"},mne={fontSize:"1.25em"},gne=cne({container:fne,button:pne,panel:hne,icon:mne}),bne=dne({baseStyle:gne});function Md(t,e,n){return Math.min(Math.max(t,n),e)}class yne extends Error{constructor(e){super(`Failed to parse color: "${e}"`)}}var Vg=yne;function $N(t){if(typeof t!="string")throw new Vg(t);if(t.trim().toLowerCase()==="transparent")return[0,0,0,0];let e=t.trim();e=wne.test(t)?Sne(t):t;const n=_ne.exec(e);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(o=>parseInt(V0(o,2),16)),parseInt(V0(s[3]||"f",2),16)/255]}const r=Ane.exec(e);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(o=>parseInt(o,16)),parseInt(s[3]||"ff",16)/255]}const i=Tne.exec(e);if(i){const s=Array.from(i).slice(1);return[...s.slice(0,3).map(o=>parseInt(o,10)),parseFloat(s[3]||"1")]}const a=xne.exec(e);if(a){const[s,o,l,u]=Array.from(a).slice(1).map(parseFloat);if(Md(0,100,o)!==o)throw new Vg(t);if(Md(0,100,l)!==l)throw new Vg(t);return[...Cne(s,o,l),Number.isNaN(u)?1:u]}throw new Vg(t)}function vne(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return(e>>>0)%2341}const e4=t=>parseInt(t.replace(/_/g,""),36),Ene="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,e)=>{const n=e4(e.substring(0,3)),r=e4(e.substring(3)).toString(16);let i="";for(let a=0;a<6-r.length;a++)i+="0";return t[n]=`${i}${r}`,t},{});function Sne(t){const e=t.toLowerCase().trim(),n=Ene[vne(e)];if(!n)throw new Vg(t);return`#${n}`}const V0=(t,e)=>Array.from(Array(e)).map(()=>t).join(""),_ne=new RegExp(`^#${V0("([a-f0-9])",3)}([a-f0-9])?$`,"i"),Ane=new RegExp(`^#${V0("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),Tne=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${V0(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),xne=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,wne=/^[a-z]+$/i,t4=t=>Math.round(t*255),Cne=(t,e,n)=>{let r=n/100;if(e===0)return[r,r,r].map(t4);const i=(t%360+360)%360/60,a=(1-Math.abs(2*r-1))*(e/100),s=a*(1-Math.abs(i%2-1));let o=0,l=0,u=0;i>=0&&i<1?(o=a,l=s):i>=1&&i<2?(o=s,l=a):i>=2&&i<3?(l=a,u=s):i>=3&&i<4?(l=s,u=a):i>=4&&i<5?(o=s,u=a):i>=5&&i<6&&(o=a,u=s);const c=r-a/2,d=o+c,f=l+c,m=u+c;return[d,f,m].map(t4)};function Rne(t,e,n,r){return`rgba(${Md(0,255,t).toFixed()}, ${Md(0,255,e).toFixed()}, ${Md(0,255,n).toFixed()}, ${parseFloat(Md(0,1,r).toFixed(3))})`}function Ine(t,e){const[n,r,i,a]=$N(t);return Rne(n,r,i,a-e)}function Mne(t){const[e,n,r,i]=$N(t);let a=s=>{const o=Md(0,255,s).toString(16);return o.length===1?`0${o}`:o};return`#${a(e)}${a(n)}${a(r)}${i<1?a(Math.round(i*255)):""}`}const Nne=t=>Object.keys(t).length===0;function One(t,e,n,r,i){for(e=e.split?e.split("."):e,r=0;r{const r=One(t,`colors.${e}`,e);try{return Mne(r),r}catch{return"#000000"}},Dne=t=>{const[e,n,r]=$N(t);return(e*299+n*587+r*114)/1e3},Lne=t=>e=>{const n=Na(e,t);return Dne(n)<128?"dark":"light"},kne=t=>e=>Lne(t)(e)==="dark",Lh=(t,e)=>n=>{const r=Na(n,t);return Ine(r,1-e)};function n4(t="1rem",e="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( + */var aee=w,see=Symbol.for("react.element"),oee=Symbol.for("react.fragment"),lee=Object.prototype.hasOwnProperty,uee=aee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,cee={key:!0,ref:!0,__self:!0,__source:!0};function gV(t,e,n){var r,i={},a=null,s=null;n!==void 0&&(a=""+n),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)lee.call(e,r)&&!cee.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:see,type:t,key:a,ref:s,props:i,_owner:uee.current}}KA.Fragment=oee;KA.jsx=gV;KA.jsxs=gV;sV.exports=KA;var $=sV.exports;function dee(){return!!(globalThis!=null&&globalThis.document)}function fee(t,...e){if(t==null)throw new TypeError("Cannot convert undefined or null to object");const n={...t};for(const r of e)if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i in n&&delete n[i],n[i]=r[i]);return n}const YR=t=>t?"":void 0;function pee(t){return Array.isArray(t)}function es(t){const e=typeof t;return t!=null&&(e==="object"||e==="function")&&!pee(t)}function hee(t){const e=t==null?0:t.length;return e?t[e-1]:void 0}function mee(t){const e=parseFloat(t.toString()),n=t.toString().replace(String(e),"");return{unitless:!n,value:e,unit:n}}function qR(t){if(t==null)return t;const{unitless:e}=mee(t);return e||typeof t=="number"?`${t}px`:t}const bV=(t,e)=>parseInt(t[1],10)>parseInt(e[1],10)?1:-1,zN=t=>Object.fromEntries(Object.entries(t).sort(bV));function $U(t){const e=zN(t);return Object.assign(Object.values(e),e)}function gee(t){const e=Object.keys(zN(t));return new Set(e)}function WU(t){if(!t)return t;t=qR(t)??t;const e=-.02;return typeof t=="number"?`${t+e}`:t.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+e}`)}function Gg(t,e){const n=["@media screen"];return t&&n.push("and",`(min-width: ${qR(t)})`),e&&n.push("and",`(max-width: ${qR(e)})`),n.join(" ")}function bee(t){if(!t)return null;t.base=t.base??"0px";const e=$U(t),n=Object.entries(t).sort(bV).map(([a,s],o,l)=>{let[,u]=l[o+1]??[];return u=parseFloat(u)>0?WU(u):void 0,{_minW:WU(s),breakpoint:a,minW:s,maxW:u,maxWQuery:Gg(null,u),minWQuery:Gg(s),minMaxQuery:Gg(s,u)}}),r=gee(t),i=Array.from(r.values());return{keys:r,normalized:e,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(o=>r.has(o))},asObject:zN(t),asArray:$U(t),details:n,get(a){return n.find(s=>s.breakpoint===a)},media:[null,...e.map(a=>Gg(a)).slice(1)],toArrayValue(a){if(!es(a))throw new Error("toArrayValue: value must be an object");const s=i.map(o=>a[o]??null);for(;hee(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,o,l)=>{const u=i[l];return u!=null&&o!=null&&(s[u]=o),s},{})}}}function XR(...t){return function(n){t.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function yV(t){return w.Children.toArray(t).filter(e=>w.isValidElement(e))}function HN(t){const e=Object.assign({},t);for(let n in e)e[n]===void 0&&delete e[n];return e}function yee(t,e){return`${t} returned \`undefined\`. Seems you forgot to wrap component within ${e}`}function Mo(t={}){const{name:e,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:a,defaultValue:s}=t,o=w.createContext(s);o.displayName=e;function l(){var c;const u=w.useContext(o);if(!u&&n){const d=new Error(a??yee(r,i));throw d.name="ContextError",(c=Error.captureStackTrace)==null||c.call(Error,d,l),d}return u}return[o.Provider,l,o]}const ba=(...t)=>t.filter(Boolean).join(" ");function vee(t,e,n,r){const i=typeof e=="string"?e.split("."):[e];for(r=0;r{const e=new WeakMap;return(r,i,a,s)=>{if(typeof r>"u")return t(r,i,a);e.has(r)||e.set(r,new Map);const o=e.get(r);if(o.has(i))return o.get(i);const l=t(r,i,a,s);return o.set(i,l),l}},vV=Eee(vee),_ee=t=>t.default||t;function See(t){const{wasSelected:e,enabled:n,isSelected:r,mode:i="unmount"}=t;return!!(!n||r||i==="keepMounted"&&e)}function EV(t,e=[]){const n=Object.assign({},t);for(const r of e)r in n&&delete n[r];return n}function Aee(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}const _V=Object.freeze(["base","sm","md","lg","xl","2xl"]);function xee(t,e){return Array.isArray(t)?t.map(n=>n===null?null:e(n)):es(t)?Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{}):t!=null?e(t):null}function Tee(t,e=_V){const n={};return t.forEach((r,i)=>{const a=e[i];r!=null&&(n[a]=r)}),n}const wee=t=>typeof t=="function";function Zs(t,...e){return wee(t)?t(...e):t}function Cee(t,...e){const n=Object.getOwnPropertyDescriptors(t),r=Object.keys(n),i=s=>{const o={};for(let l=0;li(Array.isArray(s)?s:r.filter(s));return e.map(a).concat(i(r))}function jU(t,e,n={}){const{stop:r,getKey:i}=n;function a(s,o=[]){if(es(s)||Array.isArray(s)){const l={};for(const[u,c]of Object.entries(s)){const d=(i==null?void 0:i(u))??u,f=[...o,d];if(r!=null&&r(s,f))return e(s,o);l[d]=a(c,f)}return l}return e(s,o)}return a(t)}var J_={exports:{}};J_.exports;(function(t,e){var n=200,r="__lodash_hash_undefined__",i=800,a=16,s=9007199254740991,o="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",m="[object Function]",g="[object GeneratorFunction]",y="[object Map]",v="[object Number]",b="[object Null]",E="[object Object]",_="[object Proxy]",A="[object RegExp]",I="[object Set]",x="[object String]",R="[object Undefined]",O="[object WeakMap]",N="[object ArrayBuffer]",M="[object DataView]",B="[object Float32Array]",G="[object Float64Array]",W="[object Int8Array]",K="[object Int16Array]",se="[object Int32Array]",ae="[object Uint8Array]",ee="[object Uint8ClampedArray]",F="[object Uint16Array]",ie="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,Ce=/^(?:0|[1-9]\d*)$/,Le={};Le[B]=Le[G]=Le[W]=Le[K]=Le[se]=Le[ae]=Le[ee]=Le[F]=Le[ie]=!0,Le[o]=Le[l]=Le[N]=Le[c]=Le[M]=Le[d]=Le[f]=Le[m]=Le[y]=Le[v]=Le[E]=Le[A]=Le[I]=Le[x]=Le[O]=!1;var j=typeof Sv=="object"&&Sv&&Sv.Object===Object&&Sv,ke=typeof self=="object"&&self&&self.Object===Object&&self,Fe=j||ke||Function("return this")(),Ye=e&&!e.nodeType&&e,gt=Ye&&!0&&t&&!t.nodeType&&t,Gt=gt&>.exports===Ye,Ut=Gt&&j.process,Mt=function(){try{var Z=gt&>.require&>.require("util").types;return Z||Ut&&Ut.binding&&Ut.binding("util")}catch{}}(),$e=Mt&&Mt.isTypedArray;function qe(Z,be,Be){switch(Be.length){case 0:return Z.call(be);case 1:return Z.call(be,Be[0]);case 2:return Z.call(be,Be[0],Be[1]);case 3:return Z.call(be,Be[0],Be[1],Be[2])}return Z.apply(be,Be)}function re(Z,be){for(var Be=-1,Wt=Array(Z);++Be-1}function Ct(Z,be){var Be=this.__data__,Wt=Ee(Be,Z);return Wt<0?(++this.size,Be.push([Z,be])):Be[Wt][1]=be,this}Gn.prototype.clear=he,Gn.prototype.delete=Se,Gn.prototype.get=Oe,Gn.prototype.has=Ze,Gn.prototype.set=Ct;function kt(Z){var be=-1,Be=Z==null?0:Z.length;for(this.clear();++be1?Be[kn-1]:void 0,gr=kn>2?Be[2]:void 0;for(In=Z.length>3&&typeof In=="function"?(kn--,In):void 0,gr&&hr(Be[0],Be[1],gr)&&(In=kn<3?void 0:In,kn=1),be=Object(be);++Wt-1&&Z%1==0&&Z0){if(++be>=i)return arguments[0]}else be=0;return Z.apply(void 0,arguments)}}function $c(Z){if(Z!=null){try{return U.call(Z)}catch{}try{return Z+""}catch{}}return""}function Xf(Z,be){return Z===be||Z!==Z&&be!==be}var Wc=Qe(function(){return arguments}())?Qe:function(Z){return xl(Z)&&ue.call(Z,"callee")&&!zt.call(Z,"callee")},Ln=Array.isArray;function Kf(Z){return Z!=null&&Py(Z.length)&&!zm(Z)}function Fm(Z){return xl(Z)&&Kf(Z)}var Um=De||Is;function zm(Z){if(!mr(Z))return!1;var be=Ve(Z);return be==m||be==g||be==u||be==_}function Py(Z){return typeof Z=="number"&&Z>-1&&Z%1==0&&Z<=s}function mr(Z){var be=typeof Z;return Z!=null&&(be=="object"||be=="function")}function xl(Z){return Z!=null&&typeof Z=="object"}function l1(Z){if(!xl(Z)||Ve(Z)!=E)return!1;var be=tt(Z);if(be===null)return!0;var Be=ue.call(be,"constructor")&&be.constructor;return typeof Be=="function"&&Be instanceof Be&&U.call(Be)==Pe}var Zf=$e?At($e):Ue;function u1(Z){return ar(Z,jc(Z))}function jc(Z){return Kf(Z)?le(Z):ct(Z)}var Rs=Wn(function(Z,be,Be,Wt){Bt(Z,be,Be,Wt)});function c1(Z){return function(){return Z}}function By(Z){return Z}function Is(){return!1}t.exports=Rs})(J_,J_.exports);var Ree=J_.exports;const rl=Sl(Ree);function p_(t,e=[]){const n=w.useRef(t);return w.useEffect(()=>{n.current=t}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},e)}function Iee(t){const{value:e,defaultValue:n,onChange:r,shouldUpdate:i=(f,m)=>f!==m}=t,a=p_(r),s=p_(i),[o,l]=w.useState(n),u=e!==void 0,c=u?e:o,d=p_(f=>{const g=typeof f=="function"?f(c):f;s(c,g)&&(u||l(g),a(g))},[u,a,c,s]);return[c,d]}const eS=globalThis!=null&&globalThis.document?w.useLayoutEffect:w.useEffect,YU=(t,e)=>{const n=w.useRef(!1),r=w.useRef(!1);w.useEffect(()=>{if(n.current&&r.current)return t();r.current=!0},e),w.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function Mee(t,e){if(t!=null){if(typeof t=="function"){t(e);return}try{t.current=e}catch{throw new Error(`Cannot assign value '${e}' to ref '${t}'`)}}}function ZA(...t){return e=>{t.forEach(n=>{Mee(n,e)})}}function Nee(...t){return w.useMemo(()=>ZA(...t),t)}function Oee(t,e){const n=p_(t);w.useEffect(()=>{if(e==null)return;let r=null;return r=window.setTimeout(()=>{n()},e),()=>{r&&window.clearTimeout(r)}},[e,n])}const mi={open:(t,e)=>`${t}[data-open], ${t}[open], ${t}[data-state=open] ${e}`,closed:(t,e)=>`${t}[data-closed], ${t}[data-state=closed] ${e}`,hover:(t,e)=>`${t}:hover ${e}, ${t}[data-hover] ${e}`,focus:(t,e)=>`${t}:focus ${e}, ${t}[data-focus] ${e}`,focusVisible:(t,e)=>`${t}:focus-visible ${e}`,focusWithin:(t,e)=>`${t}:focus-within ${e}`,active:(t,e)=>`${t}:active ${e}, ${t}[data-active] ${e}`,disabled:(t,e)=>`${t}:disabled ${e}, ${t}[data-disabled] ${e}`,invalid:(t,e)=>`${t}:invalid ${e}, ${t}[data-invalid] ${e}`,checked:(t,e)=>`${t}:checked ${e}, ${t}[data-checked] ${e}`,indeterminate:(t,e)=>`${t}:indeterminate ${e}, ${t}[aria-checked=mixed] ${e}, ${t}[data-indeterminate] ${e}`,readOnly:(t,e)=>`${t}:read-only ${e}, ${t}[readonly] ${e}, ${t}[data-read-only] ${e}`,expanded:(t,e)=>`${t}:read-only ${e}, ${t}[aria-expanded=true] ${e}, ${t}[data-expanded] ${e}`,placeholderShown:(t,e)=>`${t}:placeholder-shown ${e}`},Wo=t=>SV(e=>t(e,"&"),"[role=group]","[data-group]",".group"),Ml=t=>SV(e=>t(e,"~ &"),"[data-peer]",".peer"),SV=(t,...e)=>e.map(t).join(", "),Dee={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within, &[data-focus-within]",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty, &[data-empty]",_expanded:"&[aria-expanded=true], &[data-expanded], &[data-state=expanded]",_checked:"&[aria-checked=true], &[data-checked], &[data-state=checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate], &[data-state=indeterminate]",_groupOpen:Wo(mi.open),_groupClosed:Wo(mi.closed),_groupHover:Wo(mi.hover),_peerHover:Ml(mi.hover),_groupFocus:Wo(mi.focus),_peerFocus:Ml(mi.focus),_groupFocusVisible:Wo(mi.focusVisible),_peerFocusVisible:Ml(mi.focusVisible),_groupActive:Wo(mi.active),_peerActive:Ml(mi.active),_groupDisabled:Wo(mi.disabled),_peerDisabled:Ml(mi.disabled),_groupInvalid:Wo(mi.invalid),_peerInvalid:Ml(mi.invalid),_groupChecked:Wo(mi.checked),_peerChecked:Ml(mi.checked),_groupFocusWithin:Wo(mi.focusWithin),_peerFocusWithin:Ml(mi.focusWithin),_peerPlaceholderShown:Ml(mi.placeholderShown),_placeholder:"&::placeholder, &[data-placeholder]",_placeholderShown:"&:placeholder-shown, &[data-placeholder-shown]",_fullScreen:"&:fullscreen, &[data-fullscreen]",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]",_open:"&[data-open], &[open], &[data-state=open]",_closed:"&[data-closed], &[data-state=closed]",_complete:"&[data-complete]",_incomplete:"&[data-incomplete]",_current:"&[data-current]"};function QA(t){const e=t.conditions??{},n=Object.fromEntries(Object.entries(e).map(([r,i])=>[`_${r}`,i]));return{...Dee,...n}}function AV(t){return Object.keys(QA(t))}const Lee=t=>/!(important)?$/.test(t),qU=t=>typeof t=="string"?t.replace(/!(important)?$/,"").trim():t,kee=(t,e)=>n=>{const r=String(e),i=Lee(r),a=qU(r),s=t?`${t}.${a}`:a;let o=es(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:e;return o=qU(o),i?`${o} !important`:o};function GN(t){const{scale:e,transform:n,compose:r}=t;return(a,s)=>{const o=kee(e,a)(s);let l=(n==null?void 0:n(o,s))??o;return r&&(l=r(l,s)),l}}const xv=(...t)=>e=>t.reduce((n,r)=>r(n),e);function Fs(t,e){return n=>{const r={property:n,scale:t};return r.transform=GN({scale:t,transform:e}),r}}const Pee=({rtl:t,ltr:e})=>n=>n.direction==="rtl"?t:e;function Bee(t){const{property:e,scale:n,transform:r}=t;return{scale:n,property:Pee(e),transform:n?GN({scale:n,compose:r}):r}}const xV=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function Fee(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...xV].join(" ")}function Uee(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...xV].join(" ")}const zee={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},Hee={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function Gee(t){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":t,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}const Vee={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},KR={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},$ee=new Set(Object.values(KR)),ZR=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Wee=t=>t.trim();function jee(t,e){if(t==null||ZR.has(t))return t;if(!(QR(t)||ZR.has(t)))return`url('${t}')`;const i=/(^[a-z-A-Z]+)\((.*)\)/g.exec(t),a=i==null?void 0:i[1],s=i==null?void 0:i[2];if(!a||!s)return t;const o=a.includes("-gradient")?a:`${a}-gradient`,[l,...u]=s.split(",").map(Wee).filter(Boolean);if((u==null?void 0:u.length)===0)return t;const c=l in KR?KR[l]:l;u.unshift(c);const d=u.map(f=>{if($ee.has(f))return f;const m=f.indexOf(" "),[g,y]=m!==-1?[f.substr(0,m),f.substr(m+1)]:[f],v=QR(y)?y:y&&y.split(" "),b=`colors.${g}`,E=b in e.__cssMap?e.__cssMap[b].varRef:g;return v?[E,...Array.isArray(v)?v:[v]].join(" "):E});return`${o}(${d.join(", ")})`}const QR=t=>typeof t=="string"&&t.includes("(")&&t.includes(")"),Yee=(t,e)=>jee(t,e??{});function qee(t){return/^var\(--.+\)$/.test(t)}const Xee=t=>{const e=parseFloat(t.toString()),n=t.toString().replace(String(e),"");return{unitless:!n,value:e,unit:n}},jo=t=>e=>`${t}(${e})`,Fn={filter(t){return t!=="auto"?t:zee},backdropFilter(t){return t!=="auto"?t:Hee},ring(t){return Gee(Fn.px(t))},bgClip(t){return t==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:t}},transform(t){return t==="auto"?Fee():t==="auto-gpu"?Uee():t},vh(t){return t==="$100vh"?"var(--chakra-vh)":t},px(t){if(t==null)return t;const{unitless:e}=Xee(t);return e||typeof t=="number"?`${t}px`:t},fraction(t){return typeof t!="number"||t>1?t:`${t*100}%`},float(t,e){const n={left:"right",right:"left"};return e.direction==="rtl"?n[t]:t},degree(t){if(qee(t)||t==null)return t;const e=typeof t=="string"&&!t.endsWith("deg");return typeof t=="number"||e?`${t}deg`:t},gradient:Yee,blur:jo("blur"),opacity:jo("opacity"),brightness:jo("brightness"),contrast:jo("contrast"),dropShadow:jo("drop-shadow"),grayscale:jo("grayscale"),hueRotate:t=>jo("hue-rotate")(Fn.degree(t)),invert:jo("invert"),saturate:jo("saturate"),sepia:jo("sepia"),bgImage(t){return t==null||QR(t)||ZR.has(t)?t:`url(${t})`},outline(t){const e=String(t)==="0"||String(t)==="none";return t!==null&&e?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:t}},flexDirection(t){const{space:e,divide:n}=Vee[t]??{},r={flexDirection:t};return e&&(r[e]=1),n&&(r[n]=1),r}},ye={borderWidths:Fs("borderWidths"),borderStyles:Fs("borderStyles"),colors:Fs("colors"),borders:Fs("borders"),gradients:Fs("gradients",Fn.gradient),radii:Fs("radii",Fn.px),space:Fs("space",xv(Fn.vh,Fn.px)),spaceT:Fs("space",xv(Fn.vh,Fn.px)),degreeT(t){return{property:t,transform:Fn.degree}},prop(t,e,n){return{property:t,scale:e,...e&&{transform:GN({scale:e,transform:n})}}},propT(t,e){return{property:t,transform:e}},sizes:Fs("sizes",xv(Fn.vh,Fn.px)),sizesT:Fs("sizes",xv(Fn.vh,Fn.fraction)),shadows:Fs("shadows"),logical:Bee,blur:Fs("blur",Fn.blur)},h_={background:ye.colors("background"),backgroundColor:ye.colors("backgroundColor"),backgroundImage:ye.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Fn.bgClip},bgSize:ye.prop("backgroundSize"),bgPosition:ye.prop("backgroundPosition"),bg:ye.colors("background"),bgColor:ye.colors("backgroundColor"),bgPos:ye.prop("backgroundPosition"),bgRepeat:ye.prop("backgroundRepeat"),bgAttachment:ye.prop("backgroundAttachment"),bgGradient:ye.gradients("backgroundImage"),bgClip:{transform:Fn.bgClip}};Object.assign(h_,{bgImage:h_.backgroundImage,bgImg:h_.backgroundImage});const Jn={border:ye.borders("border"),borderWidth:ye.borderWidths("borderWidth"),borderStyle:ye.borderStyles("borderStyle"),borderColor:ye.colors("borderColor"),borderRadius:ye.radii("borderRadius"),borderTop:ye.borders("borderTop"),borderBlockStart:ye.borders("borderBlockStart"),borderTopLeftRadius:ye.radii("borderTopLeftRadius"),borderStartStartRadius:ye.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:ye.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:ye.radii("borderTopRightRadius"),borderStartEndRadius:ye.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:ye.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:ye.borders("borderRight"),borderInlineEnd:ye.borders("borderInlineEnd"),borderBottom:ye.borders("borderBottom"),borderBlockEnd:ye.borders("borderBlockEnd"),borderBottomLeftRadius:ye.radii("borderBottomLeftRadius"),borderBottomRightRadius:ye.radii("borderBottomRightRadius"),borderLeft:ye.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:ye.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:ye.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:ye.borders(["borderLeft","borderRight"]),borderInline:ye.borders("borderInline"),borderY:ye.borders(["borderTop","borderBottom"]),borderBlock:ye.borders("borderBlock"),borderTopWidth:ye.borderWidths("borderTopWidth"),borderBlockStartWidth:ye.borderWidths("borderBlockStartWidth"),borderTopColor:ye.colors("borderTopColor"),borderBlockStartColor:ye.colors("borderBlockStartColor"),borderTopStyle:ye.borderStyles("borderTopStyle"),borderBlockStartStyle:ye.borderStyles("borderBlockStartStyle"),borderBottomWidth:ye.borderWidths("borderBottomWidth"),borderBlockEndWidth:ye.borderWidths("borderBlockEndWidth"),borderBottomColor:ye.colors("borderBottomColor"),borderBlockEndColor:ye.colors("borderBlockEndColor"),borderBottomStyle:ye.borderStyles("borderBottomStyle"),borderBlockEndStyle:ye.borderStyles("borderBlockEndStyle"),borderLeftWidth:ye.borderWidths("borderLeftWidth"),borderInlineStartWidth:ye.borderWidths("borderInlineStartWidth"),borderLeftColor:ye.colors("borderLeftColor"),borderInlineStartColor:ye.colors("borderInlineStartColor"),borderLeftStyle:ye.borderStyles("borderLeftStyle"),borderInlineStartStyle:ye.borderStyles("borderInlineStartStyle"),borderRightWidth:ye.borderWidths("borderRightWidth"),borderInlineEndWidth:ye.borderWidths("borderInlineEndWidth"),borderRightColor:ye.colors("borderRightColor"),borderInlineEndColor:ye.colors("borderInlineEndColor"),borderRightStyle:ye.borderStyles("borderRightStyle"),borderInlineEndStyle:ye.borderStyles("borderInlineEndStyle"),borderTopRadius:ye.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:ye.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:ye.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:ye.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Jn,{rounded:Jn.borderRadius,roundedTop:Jn.borderTopRadius,roundedTopLeft:Jn.borderTopLeftRadius,roundedTopRight:Jn.borderTopRightRadius,roundedTopStart:Jn.borderStartStartRadius,roundedTopEnd:Jn.borderStartEndRadius,roundedBottom:Jn.borderBottomRadius,roundedBottomLeft:Jn.borderBottomLeftRadius,roundedBottomRight:Jn.borderBottomRightRadius,roundedBottomStart:Jn.borderEndStartRadius,roundedBottomEnd:Jn.borderEndEndRadius,roundedLeft:Jn.borderLeftRadius,roundedRight:Jn.borderRightRadius,roundedStart:Jn.borderInlineStartRadius,roundedEnd:Jn.borderInlineEndRadius,borderStart:Jn.borderInlineStart,borderEnd:Jn.borderInlineEnd,borderTopStartRadius:Jn.borderStartStartRadius,borderTopEndRadius:Jn.borderStartEndRadius,borderBottomStartRadius:Jn.borderEndStartRadius,borderBottomEndRadius:Jn.borderEndEndRadius,borderStartRadius:Jn.borderInlineStartRadius,borderEndRadius:Jn.borderInlineEndRadius,borderStartWidth:Jn.borderInlineStartWidth,borderEndWidth:Jn.borderInlineEndWidth,borderStartColor:Jn.borderInlineStartColor,borderEndColor:Jn.borderInlineEndColor,borderStartStyle:Jn.borderInlineStartStyle,borderEndStyle:Jn.borderInlineEndStyle});const Kee={color:ye.colors("color"),textColor:ye.colors("color"),fill:ye.colors("fill"),stroke:ye.colors("stroke"),accentColor:ye.colors("accentColor"),textFillColor:ye.colors("textFillColor")},tS={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Fn.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:ye.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:ye.space("gap"),rowGap:ye.space("rowGap"),columnGap:ye.space("columnGap")};Object.assign(tS,{flexDir:tS.flexDirection});const Gs={width:ye.sizesT("width"),inlineSize:ye.sizesT("inlineSize"),height:ye.sizes("height"),blockSize:ye.sizes("blockSize"),boxSize:ye.sizes(["width","height"]),minWidth:ye.sizes("minWidth"),minInlineSize:ye.sizes("minInlineSize"),minHeight:ye.sizes("minHeight"),minBlockSize:ye.sizes("minBlockSize"),maxWidth:ye.sizes("maxWidth"),maxInlineSize:ye.sizes("maxInlineSize"),maxHeight:ye.sizes("maxHeight"),maxBlockSize:ye.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(t,e)=>{var i,a;return{[`@media screen and (min-width: ${((a=(i=e.__breakpoints)==null?void 0:i.get(t))==null?void 0:a.minW)??t})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(t,e)=>{var i,a;return{[`@media screen and (max-width: ${((a=(i=e.__breakpoints)==null?void 0:i.get(t))==null?void 0:a._minW)??t})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:ye.propT("float",Fn.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Gs,{w:Gs.width,h:Gs.height,minW:Gs.minWidth,maxW:Gs.maxWidth,minH:Gs.minHeight,maxH:Gs.maxHeight,overscroll:Gs.overscrollBehavior,overscrollX:Gs.overscrollBehaviorX,overscrollY:Gs.overscrollBehaviorY});const Zee={filter:{transform:Fn.filter},blur:ye.blur("--chakra-blur"),brightness:ye.propT("--chakra-brightness",Fn.brightness),contrast:ye.propT("--chakra-contrast",Fn.contrast),hueRotate:ye.propT("--chakra-hue-rotate",Fn.hueRotate),invert:ye.propT("--chakra-invert",Fn.invert),saturate:ye.propT("--chakra-saturate",Fn.saturate),dropShadow:ye.propT("--chakra-drop-shadow",Fn.dropShadow),backdropFilter:{transform:Fn.backdropFilter},backdropBlur:ye.blur("--chakra-backdrop-blur"),backdropBrightness:ye.propT("--chakra-backdrop-brightness",Fn.brightness),backdropContrast:ye.propT("--chakra-backdrop-contrast",Fn.contrast),backdropHueRotate:ye.propT("--chakra-backdrop-hue-rotate",Fn.hueRotate),backdropInvert:ye.propT("--chakra-backdrop-invert",Fn.invert),backdropSaturate:ye.propT("--chakra-backdrop-saturate",Fn.saturate)},Qee={ring:{transform:Fn.ring},ringColor:ye.colors("--chakra-ring-color"),ringOffset:ye.prop("--chakra-ring-offset-width"),ringOffsetColor:ye.colors("--chakra-ring-offset-color"),ringInset:ye.prop("--chakra-ring-inset")},Jee={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Fn.outline},outlineOffset:!0,outlineColor:ye.colors("outlineColor")},TV={gridGap:ye.space("gridGap"),gridColumnGap:ye.space("gridColumnGap"),gridRowGap:ye.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0};function ete(t,e,n,r){const i=typeof e=="string"?e.split("."):[e];for(r=0;r{const e=new WeakMap;return(r,i,a,s)=>{if(typeof r>"u")return t(r,i,a);e.has(r)||e.set(r,new Map);const o=e.get(r);if(o.has(i))return o.get(i);const l=t(r,i,a,s);return o.set(i,l),l}},nte=tte(ete),rte={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},ite={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},ow=(t,e,n)=>{const r={},i=nte(t,e,{});for(const a in i)a in n&&n[a]!=null||(r[a]=i[a]);return r},ate={srOnly:{transform(t){return t===!0?rte:t==="focusable"?ite:{}}},layerStyle:{processResult:!0,transform:(t,e,n)=>ow(e,`layerStyles.${t}`,n)},textStyle:{processResult:!0,transform:(t,e,n)=>ow(e,`textStyles.${t}`,n)},apply:{processResult:!0,transform:(t,e,n)=>ow(e,t,n)}},s0={position:!0,pos:ye.prop("position"),zIndex:ye.prop("zIndex","zIndices"),inset:ye.spaceT("inset"),insetX:ye.spaceT(["left","right"]),insetInline:ye.spaceT("insetInline"),insetY:ye.spaceT(["top","bottom"]),insetBlock:ye.spaceT("insetBlock"),top:ye.spaceT("top"),insetBlockStart:ye.spaceT("insetBlockStart"),bottom:ye.spaceT("bottom"),insetBlockEnd:ye.spaceT("insetBlockEnd"),left:ye.spaceT("left"),insetInlineStart:ye.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:ye.spaceT("right"),insetInlineEnd:ye.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(s0,{insetStart:s0.insetInlineStart,insetEnd:s0.insetInlineEnd});const JR={boxShadow:ye.shadows("boxShadow"),mixBlendMode:!0,blendMode:ye.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:ye.prop("backgroundBlendMode"),opacity:!0};Object.assign(JR,{shadow:JR.boxShadow});const xr={margin:ye.spaceT("margin"),marginTop:ye.spaceT("marginTop"),marginBlockStart:ye.spaceT("marginBlockStart"),marginRight:ye.spaceT("marginRight"),marginInlineEnd:ye.spaceT("marginInlineEnd"),marginBottom:ye.spaceT("marginBottom"),marginBlockEnd:ye.spaceT("marginBlockEnd"),marginLeft:ye.spaceT("marginLeft"),marginInlineStart:ye.spaceT("marginInlineStart"),marginX:ye.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:ye.spaceT("marginInline"),marginY:ye.spaceT(["marginTop","marginBottom"]),marginBlock:ye.spaceT("marginBlock"),padding:ye.space("padding"),paddingTop:ye.space("paddingTop"),paddingBlockStart:ye.space("paddingBlockStart"),paddingRight:ye.space("paddingRight"),paddingBottom:ye.space("paddingBottom"),paddingBlockEnd:ye.space("paddingBlockEnd"),paddingLeft:ye.space("paddingLeft"),paddingInlineStart:ye.space("paddingInlineStart"),paddingInlineEnd:ye.space("paddingInlineEnd"),paddingX:ye.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:ye.space("paddingInline"),paddingY:ye.space(["paddingTop","paddingBottom"]),paddingBlock:ye.space("paddingBlock")};Object.assign(xr,{m:xr.margin,mt:xr.marginTop,mr:xr.marginRight,me:xr.marginInlineEnd,marginEnd:xr.marginInlineEnd,mb:xr.marginBottom,ml:xr.marginLeft,ms:xr.marginInlineStart,marginStart:xr.marginInlineStart,mx:xr.marginX,my:xr.marginY,p:xr.padding,pt:xr.paddingTop,py:xr.paddingY,px:xr.paddingX,pb:xr.paddingBottom,pl:xr.paddingLeft,ps:xr.paddingInlineStart,paddingStart:xr.paddingInlineStart,pr:xr.paddingRight,pe:xr.paddingInlineEnd,paddingEnd:xr.paddingInlineEnd});const ste={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:ye.spaceT("scrollMargin"),scrollMarginTop:ye.spaceT("scrollMarginTop"),scrollMarginBottom:ye.spaceT("scrollMarginBottom"),scrollMarginLeft:ye.spaceT("scrollMarginLeft"),scrollMarginRight:ye.spaceT("scrollMarginRight"),scrollMarginX:ye.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:ye.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:ye.spaceT("scrollPadding"),scrollPaddingTop:ye.spaceT("scrollPaddingTop"),scrollPaddingBottom:ye.spaceT("scrollPaddingBottom"),scrollPaddingLeft:ye.spaceT("scrollPaddingLeft"),scrollPaddingRight:ye.spaceT("scrollPaddingRight"),scrollPaddingX:ye.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:ye.spaceT(["scrollPaddingTop","scrollPaddingBottom"])},ote={fontFamily:ye.prop("fontFamily","fonts"),fontSize:ye.prop("fontSize","fontSizes",Fn.px),fontWeight:ye.prop("fontWeight","fontWeights"),lineHeight:ye.prop("lineHeight","lineHeights"),letterSpacing:ye.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(t){if(t===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},lte={textDecorationColor:ye.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:ye.shadows("textShadow")},ute={clipPath:!0,transform:ye.propT("transform",Fn.transform),transformOrigin:!0,translateX:ye.spaceT("--chakra-translate-x"),translateY:ye.spaceT("--chakra-translate-y"),skewX:ye.degreeT("--chakra-skew-x"),skewY:ye.degreeT("--chakra-skew-y"),scaleX:ye.prop("--chakra-scale-x"),scaleY:ye.prop("--chakra-scale-y"),scale:ye.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:ye.degreeT("--chakra-rotate")},cte={listStyleType:!0,listStylePosition:!0,listStylePos:ye.prop("listStylePosition"),listStyleImage:!0,listStyleImg:ye.prop("listStyleImage")},dte={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:ye.prop("transitionDuration","transition.duration"),transitionProperty:ye.prop("transitionProperty","transition.property"),transitionTimingFunction:ye.prop("transitionTimingFunction","transition.easing")},VN=rl({},h_,Jn,Kee,tS,Gs,Zee,Qee,Jee,TV,ate,s0,JR,xr,ste,ote,lte,ute,cte,dte);Object.assign({},xr,Gs,tS,TV,s0);const fte=t=>[...Object.keys(VN),...AV(t)],pte=t=>{const e=QA(t),n={...VN,...e};return r=>Object.hasOwnProperty.call(n,r)},hte=t=>e=>{if(!e.__breakpoints)return t;const{isResponsive:n,toArrayValue:r,media:i}=e.__breakpoints,a={};for(const s in t){let o=Zs(t[s],e);if(o==null)continue;if(o=es(o)&&n(o)?r(o):o,!Array.isArray(o)){a[s]=o;continue}const l=o.slice(0,i.length).length;for(let u=0;ut.startsWith("--")&&typeof e=="string"&&!gte(e),yte=(t,e)=>{if(e==null)return e;const n=s=>{var o,l;return(l=(o=t.__cssMap)==null?void 0:o[s])==null?void 0:l.varRef},r=s=>n(s)??s,[i,a]=mte(e);return e=n(i)??r(a)??r(e),e};function vte(t){const{configs:e={},pseudos:n={},theme:r}=t,i=(a,s=!1)=>{var c;const o=Zs(a,r),l=hte(o)(r);let u={};for(let d in l){const f=l[d];let m=Zs(f,r);d in n&&(d=n[d]),bte(d,m)&&(m=yte(r,m));let g=e[d];if(g===!0&&(g={property:d}),es(m)){u[d]=u[d]??{},u[d]=rl({},u[d],i(m,!0));continue}let y=((c=g==null?void 0:g.transform)==null?void 0:c.call(g,m,r,o))??m;y=g!=null&&g.processResult?i(y,!0):y;const v=Zs(g==null?void 0:g.property,r);if(!s&&(g!=null&&g.static)){const b=Zs(g.static,r);u=rl({},u,b)}if(v&&Array.isArray(v)){for(const b of v)u[b]=y;continue}if(v){v==="&"&&es(y)?u=rl({},u,y):u[v]=y;continue}if(es(y)){u=rl({},u,y);continue}u[d]=y}return u};return i}const wV=t=>e=>vte({theme:e,pseudos:QA(e),configs:VN})(t);function Sr(t){return{definePartsStyle(e){return e},defineMultiStyleConfig(e){return{parts:t,...e}}}}function Ete(t,e){if(Array.isArray(t))return t;if(es(t))return e(t);if(t!=null)return[t]}function _te(t,e){for(let n=e+1;n{rl(o,{[_]:c?E[_]:{[b]:E[_]}})});continue}if(!d){c?rl(o,E):o[b]=E;continue}o[b]=E}}return o}}function Ate(t){return e=>{const{variant:n,size:r,theme:i}=e,a=Ste(i);return rl({},Zs(t.baseStyle??{},e),a(t,"sizes",r,e),a(t,"variants",n,e))}}function um(t){return EV(t,["styleConfig","size","variant","colorScheme"])}function CV(t){return es(t)&&t.reference?t.reference:String(t)}const JA=(t,...e)=>e.map(CV).join(` ${t} `).replace(/calc/g,""),XU=(...t)=>`calc(${JA("+",...t)})`,KU=(...t)=>`calc(${JA("-",...t)})`,eI=(...t)=>`calc(${JA("*",...t)})`,ZU=(...t)=>`calc(${JA("/",...t)})`,QU=t=>{const e=CV(t);return e!=null&&!Number.isNaN(parseFloat(e))?String(e).startsWith("-")?String(e).slice(1):`-${e}`:eI(e,-1)},Vl=Object.assign(t=>({add:(...e)=>Vl(XU(t,...e)),subtract:(...e)=>Vl(KU(t,...e)),multiply:(...e)=>Vl(eI(t,...e)),divide:(...e)=>Vl(ZU(t,...e)),negate:()=>Vl(QU(t)),toString:()=>t.toString()}),{add:XU,subtract:KU,multiply:eI,divide:ZU,negate:QU});function xte(t,e="-"){return t.replace(/\s+/g,e)}function Tte(t){const e=xte(t.toString());return Cte(wte(e))}function wte(t){return t.includes("\\.")?t:!Number.isInteger(parseFloat(t.toString()))?t.replace(".","\\."):t}function Cte(t){return t.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function Rte(t,e=""){return[e,t].filter(Boolean).join("-")}function Ite(t,e){return`var(${t}${e?`, ${e}`:""})`}function Mte(t,e=""){return Tte(`--${Rte(t,e)}`)}function on(t,e,n){const r=Mte(t,n);return{variable:r,reference:Ite(r,e)}}function Nte(t,e){const n={};for(const r of e){if(Array.isArray(r)){const[i,a]=r;n[i]=on(`${t}-${i}`,a);continue}n[r]=on(`${t}-${r}`)}return n}const Ote=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function Dte(t){return Aee(t,Ote)}function Lte(t){return t.semanticTokens}function kte(t){const{__cssMap:e,__cssVars:n,__breakpoints:r,...i}=t;return i}function Pte(t){const e=Dte(t),n=Lte(t),r=AV(t),i=s=>r.includes(s)||s==="default",a={};return jU(e,(s,o)=>{s!=null&&(a[o.join(".")]={isSemantic:!1,value:s})}),jU(n,(s,o)=>{s!=null&&(a[o.join(".")]={isSemantic:!0,value:s})},{stop:s=>Object.keys(s).every(i)}),a}function JU(t,e){return on(String(t).replace(/\./g,"-"),void 0,e)}function Bte(t){var o;const e=Pte(t),n=(o=t.config)==null?void 0:o.cssVarPrefix,r=QA(t);let i={};const a={};function s(l,u){const d=[String(l).split(".")[0],u].join(".");if(!e[d])return u;const{reference:m}=JU(d,n);return m}for(const[l,u]of Object.entries(e)){const{isSemantic:c,value:d}=u,{variable:f,reference:m}=JU(l,n);if(!c){if(l.startsWith("space")){const y=l.split("."),[v,...b]=y,E=`${v}.-${b.join(".")}`,_=Vl.negate(d),A=Vl.negate(m);a[E]={value:_,var:f,varRef:A}}i[f]=d,a[l]={value:d,var:f,varRef:m};continue}const g=es(d)?d:{default:d};i=rl(i,Object.entries(g).reduce((y,[v,b])=>{if(!b)return y;const E=s(l,`${b}`);if(v==="default")return y[f]=E,y;const _=(r==null?void 0:r[v])??v;return y[_]={[f]:E},y},{})),a[l]={value:m,var:f,varRef:m}}return{cssVars:i,cssMap:a}}function Fte(t){const e=kte(t),{cssMap:n,cssVars:r}=Bte(e),i={"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},a=pte(e);return Object.assign(e,{__cssVars:{...i,...r},__cssMap:n,__breakpoints:bee(e.breakpoints),__isStyleProp:a}),e}function rr(t,e={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function i(...c){r();for(const d of c)e[d]=l(d);return rr(t,e)}function a(...c){for(const d of c)d in e||(e[d]=l(d));return rr(t,e)}function s(){return Object.fromEntries(Object.entries(e).map(([d,f])=>[d,f.selector]))}function o(){return Object.fromEntries(Object.entries(e).map(([d,f])=>[d,f.className]))}function l(c){const m=`chakra-${(["container","root"].includes(c??"")?[t]:[t,c]).filter(Boolean).join("__")}`;return{className:m,selector:`.${m}`,toString:()=>c}}return{parts:i,toPart:l,extend:a,selectors:s,classnames:o,get keys(){return Object.keys(e)},__type:{}}}const Ute=rr("accordion").parts("root","container","button","panel","icon"),zte=rr("alert").parts("title","description","container","icon","spinner"),Hte=rr("avatar").parts("label","badge","container","excessLabel","group"),Gte=rr("breadcrumb").parts("link","item","container","separator");rr("button").parts();const Vte=rr("checkbox").parts("control","icon","container","label");rr("progress").parts("track","filledTrack","label");const $te=rr("drawer").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),Wte=rr("editable").parts("preview","input","textarea"),jte=rr("form").parts("container","requiredIndicator","helperText"),Yte=rr("formError").parts("text","icon"),qte=rr("input").parts("addon","field","element","group"),Xte=rr("list").parts("container","item","icon"),Kte=rr("menu").parts("button","list","item","groupTitle","icon","command","divider"),Zte=rr("modal").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),Qte=rr("numberinput").parts("root","field","stepperGroup","stepper");rr("pininput").parts("field");const Jte=rr("popover").parts("content","header","body","footer","popper","arrow","closeButton"),ene=rr("progress").parts("label","filledTrack","track"),tne=rr("radio").parts("container","control","label"),nne=rr("select").parts("field","icon"),rne=rr("slider").parts("container","track","thumb","filledTrack","mark"),ine=rr("stat").parts("container","label","helpText","number","icon"),ane=rr("switch").parts("container","track","thumb","label"),sne=rr("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),one=rr("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),lne=rr("tag").parts("container","label","closeButton"),une=rr("card").parts("container","header","body","footer");rr("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");const{definePartsStyle:cne,defineMultiStyleConfig:dne}=Sr(Ute.keys),fne={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},pne={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},hne={pt:"2",px:"4",pb:"5"},mne={fontSize:"1.25em"},gne=cne({container:fne,button:pne,panel:hne,icon:mne}),bne=dne({baseStyle:gne});function Md(t,e,n){return Math.min(Math.max(t,n),e)}class yne extends Error{constructor(e){super(`Failed to parse color: "${e}"`)}}var Vg=yne;function $N(t){if(typeof t!="string")throw new Vg(t);if(t.trim().toLowerCase()==="transparent")return[0,0,0,0];let e=t.trim();e=wne.test(t)?_ne(t):t;const n=Sne.exec(e);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(o=>parseInt(V0(o,2),16)),parseInt(V0(s[3]||"f",2),16)/255]}const r=Ane.exec(e);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(o=>parseInt(o,16)),parseInt(s[3]||"ff",16)/255]}const i=xne.exec(e);if(i){const s=Array.from(i).slice(1);return[...s.slice(0,3).map(o=>parseInt(o,10)),parseFloat(s[3]||"1")]}const a=Tne.exec(e);if(a){const[s,o,l,u]=Array.from(a).slice(1).map(parseFloat);if(Md(0,100,o)!==o)throw new Vg(t);if(Md(0,100,l)!==l)throw new Vg(t);return[...Cne(s,o,l),Number.isNaN(u)?1:u]}throw new Vg(t)}function vne(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return(e>>>0)%2341}const e4=t=>parseInt(t.replace(/_/g,""),36),Ene="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,e)=>{const n=e4(e.substring(0,3)),r=e4(e.substring(3)).toString(16);let i="";for(let a=0;a<6-r.length;a++)i+="0";return t[n]=`${i}${r}`,t},{});function _ne(t){const e=t.toLowerCase().trim(),n=Ene[vne(e)];if(!n)throw new Vg(t);return`#${n}`}const V0=(t,e)=>Array.from(Array(e)).map(()=>t).join(""),Sne=new RegExp(`^#${V0("([a-f0-9])",3)}([a-f0-9])?$`,"i"),Ane=new RegExp(`^#${V0("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),xne=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${V0(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),Tne=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,wne=/^[a-z]+$/i,t4=t=>Math.round(t*255),Cne=(t,e,n)=>{let r=n/100;if(e===0)return[r,r,r].map(t4);const i=(t%360+360)%360/60,a=(1-Math.abs(2*r-1))*(e/100),s=a*(1-Math.abs(i%2-1));let o=0,l=0,u=0;i>=0&&i<1?(o=a,l=s):i>=1&&i<2?(o=s,l=a):i>=2&&i<3?(l=a,u=s):i>=3&&i<4?(l=s,u=a):i>=4&&i<5?(o=s,u=a):i>=5&&i<6&&(o=a,u=s);const c=r-a/2,d=o+c,f=l+c,m=u+c;return[d,f,m].map(t4)};function Rne(t,e,n,r){return`rgba(${Md(0,255,t).toFixed()}, ${Md(0,255,e).toFixed()}, ${Md(0,255,n).toFixed()}, ${parseFloat(Md(0,1,r).toFixed(3))})`}function Ine(t,e){const[n,r,i,a]=$N(t);return Rne(n,r,i,a-e)}function Mne(t){const[e,n,r,i]=$N(t);let a=s=>{const o=Md(0,255,s).toString(16);return o.length===1?`0${o}`:o};return`#${a(e)}${a(n)}${a(r)}${i<1?a(Math.round(i*255)):""}`}const Nne=t=>Object.keys(t).length===0;function One(t,e,n,r,i){for(e=e.split?e.split("."):e,r=0;r{const r=One(t,`colors.${e}`,e);try{return Mne(r),r}catch{return"#000000"}},Dne=t=>{const[e,n,r]=$N(t);return(e*299+n*587+r*114)/1e3},Lne=t=>e=>{const n=Na(e,t);return Dne(n)<128?"dark":"light"},kne=t=>e=>Lne(t)(e)==="dark",Lh=(t,e)=>n=>{const r=Na(n,t);return Ine(r,1-e)};function n4(t="1rem",e="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( 45deg, ${e} 25%, transparent 25%, @@ -23,19 +23,19 @@ function aV(t,e){for(var n=0;n`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function Bne(t){const e=Pne();return!t||Nne(t)?e:t.string&&t.colors?Une(t.string,t.colors):t.string&&!t.colors?Fne(t.string):t.colors&&!t.string?zne(t.colors):e}function Fne(t){let e=0;if(t.length===0)return e.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function Une(t,e){let n=0;if(t.length===0)return e[0];for(let r=0;rn.colorMode==="dark"?e:t}function WN(t){const{orientation:e,vertical:n,horizontal:r}=t;return e?e==="vertical"?n:r:{}}function RV(t){return es(t)&&t.reference?t.reference:String(t)}const eT=(t,...e)=>e.map(RV).join(` ${t} `).replace(/calc/g,""),r4=(...t)=>`calc(${eT("+",...t)})`,i4=(...t)=>`calc(${eT("-",...t)})`,tI=(...t)=>`calc(${eT("*",...t)})`,a4=(...t)=>`calc(${eT("/",...t)})`,s4=t=>{const e=RV(t);return e!=null&&!Number.isNaN(parseFloat(e))?String(e).startsWith("-")?String(e).slice(1):`-${e}`:tI(e,-1)},$l=Object.assign(t=>({add:(...e)=>$l(r4(t,...e)),subtract:(...e)=>$l(i4(t,...e)),multiply:(...e)=>$l(tI(t,...e)),divide:(...e)=>$l(a4(t,...e)),negate:()=>$l(s4(t)),toString:()=>t.toString()}),{add:r4,subtract:i4,multiply:tI,divide:a4,negate:s4});function Hne(t){return!Number.isInteger(parseFloat(t.toString()))}function Gne(t,e="-"){return t.replace(/\s+/g,e)}function IV(t){const e=Gne(t.toString());return e.includes("\\.")?t:Hne(t)?e.replace(".","\\."):t}function Vne(t,e=""){return[e,IV(t)].filter(Boolean).join("-")}function $ne(t,e){return`var(${IV(t)}${e?`, ${e}`:""})`}function Wne(t,e=""){return`--${Vne(t,e)}`}function Ei(t,e){const n=Wne(t,e==null?void 0:e.prefix);return{variable:n,reference:$ne(n,jne(e==null?void 0:e.fallback))}}function jne(t){return t==null?void 0:t.reference}const{definePartsStyle:Fb,defineMultiStyleConfig:Yne}=_r(zte.keys),ys=on("alert-fg"),fu=on("alert-bg"),qne=Fb({container:{bg:fu.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:ys.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:ys.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function jN(t){const{theme:e,colorScheme:n}=t,r=Lh(`${n}.200`,.16)(e);return{light:`colors.${n}.100`,dark:r}}const Xne=Fb(t=>{const{colorScheme:e}=t,n=jN(t);return{container:{[ys.variable]:`colors.${e}.600`,[fu.variable]:n.light,_dark:{[ys.variable]:`colors.${e}.200`,[fu.variable]:n.dark}}}}),Kne=Fb(t=>{const{colorScheme:e}=t,n=jN(t);return{container:{[ys.variable]:`colors.${e}.600`,[fu.variable]:n.light,_dark:{[ys.variable]:`colors.${e}.200`,[fu.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:ys.reference}}}),Zne=Fb(t=>{const{colorScheme:e}=t,n=jN(t);return{container:{[ys.variable]:`colors.${e}.600`,[fu.variable]:n.light,_dark:{[ys.variable]:`colors.${e}.200`,[fu.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:ys.reference}}}),Qne=Fb(t=>{const{colorScheme:e}=t;return{container:{[ys.variable]:"colors.white",[fu.variable]:`colors.${e}.600`,_dark:{[ys.variable]:"colors.gray.900",[fu.variable]:`colors.${e}.200`},color:ys.reference}}}),Jne={subtle:Xne,"left-accent":Kne,"top-accent":Zne,solid:Qne},ere=Yne({baseStyle:qne,variants:Jne,defaultProps:{variant:"subtle",colorScheme:"blue"}}),MV={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},tre={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},nre={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},NV={...MV,...tre,container:nre},rre=t=>typeof t=="function";function Da(t,...e){return rre(t)?t(...e):t}const{definePartsStyle:OV,defineMultiStyleConfig:ire}=_r(Hte.keys),hh=on("avatar-border-color"),o0=on("avatar-bg"),$0=on("avatar-font-size"),kh=on("avatar-size"),are={borderRadius:"full",border:"0.2em solid",borderColor:hh.reference,[hh.variable]:"white",_dark:{[hh.variable]:"colors.gray.800"}},sre={bg:o0.reference,fontSize:$0.reference,width:kh.reference,height:kh.reference,lineHeight:"1",[o0.variable]:"colors.gray.200",_dark:{[o0.variable]:"colors.whiteAlpha.400"}},ore=t=>{const{name:e,theme:n}=t,r=e?Bne({string:e}):"colors.gray.400",i=kne(r)(n);let a="white";return i||(a="gray.800"),{bg:o0.reference,fontSize:$0.reference,color:a,borderColor:hh.reference,verticalAlign:"top",width:kh.reference,height:kh.reference,"&:not([data-loaded])":{[o0.variable]:r},[hh.variable]:"colors.white",_dark:{[hh.variable]:"colors.gray.800"}}},lre={fontSize:$0.reference,lineHeight:"1"},ure=OV(t=>({badge:Da(are,t),excessLabel:Da(sre,t),container:Da(ore,t),label:lre}));function Nu(t){const e=t!=="100%"?NV[t]:void 0;return OV({container:{[kh.variable]:e??t,[$0.variable]:`calc(${e??t} / 2.5)`},excessLabel:{[kh.variable]:e??t,[$0.variable]:`calc(${e??t} / 2.5)`}})}const cre={"2xs":Nu(4),xs:Nu(6),sm:Nu(8),md:Nu(12),lg:Nu(16),xl:Nu(24),"2xl":Nu(32),full:Nu("100%")},dre=ire({baseStyle:ure,sizes:cre,defaultProps:{size:"md"}}),ti=Nte("badge",["bg","color","shadow"]),fre={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:ti.bg.reference,color:ti.color.reference,boxShadow:ti.shadow.reference},pre=t=>{const{colorScheme:e,theme:n}=t,r=Lh(`${e}.500`,.6)(n);return{[ti.bg.variable]:`colors.${e}.500`,[ti.color.variable]:"colors.white",_dark:{[ti.bg.variable]:r,[ti.color.variable]:"colors.whiteAlpha.800"}}},hre=t=>{const{colorScheme:e,theme:n}=t,r=Lh(`${e}.200`,.16)(n);return{[ti.bg.variable]:`colors.${e}.100`,[ti.color.variable]:`colors.${e}.800`,_dark:{[ti.bg.variable]:r,[ti.color.variable]:`colors.${e}.200`}}},mre=t=>{const{colorScheme:e,theme:n}=t,r=Lh(`${e}.200`,.8)(n);return{[ti.color.variable]:`colors.${e}.500`,_dark:{[ti.color.variable]:r},[ti.shadow.variable]:`inset 0 0 0px 1px ${ti.color.reference}`}},gre={solid:pre,subtle:hre,outline:mre},l0={baseStyle:fre,variants:gre,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:bre,definePartsStyle:yre}=_r(Gte.keys),lw=on("breadcrumb-link-decor"),vre={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:lw.reference,[lw.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[lw.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},Ere=yre({link:vre}),Sre=bre({baseStyle:Ere}),_re={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},DV=t=>{const{colorScheme:e,theme:n}=t;if(e==="gray")return{color:sn("gray.800","whiteAlpha.900")(t),_hover:{bg:sn("gray.100","whiteAlpha.200")(t)},_active:{bg:sn("gray.200","whiteAlpha.300")(t)}};const r=Lh(`${e}.200`,.12)(n),i=Lh(`${e}.200`,.24)(n);return{color:sn(`${e}.600`,`${e}.200`)(t),bg:"transparent",_hover:{bg:sn(`${e}.50`,r)(t)},_active:{bg:sn(`${e}.100`,i)(t)}}},Are=t=>{const{colorScheme:e}=t,n=sn("gray.200","whiteAlpha.300")(t);return{border:"1px solid",borderColor:e==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...Da(DV,t)}},Tre={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},xre=t=>{const{colorScheme:e}=t;if(e==="gray"){const o=sn("gray.100","whiteAlpha.200")(t);return{bg:o,color:sn("gray.800","whiteAlpha.900")(t),_hover:{bg:sn("gray.200","whiteAlpha.300")(t),_disabled:{bg:o}},_active:{bg:sn("gray.300","whiteAlpha.400")(t)}}}const{bg:n=`${e}.500`,color:r="white",hoverBg:i=`${e}.600`,activeBg:a=`${e}.700`}=Tre[e]??{},s=sn(n,`${e}.200`)(t);return{bg:s,color:sn(r,"gray.800")(t),_hover:{bg:sn(i,`${e}.300`)(t),_disabled:{bg:s}},_active:{bg:sn(a,`${e}.400`)(t)}}},wre=t=>{const{colorScheme:e}=t;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:sn(`${e}.500`,`${e}.200`)(t),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:sn(`${e}.700`,`${e}.500`)(t)}}},Cre={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},Rre={ghost:DV,outline:Are,solid:xre,link:wre,unstyled:Cre},Ire={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},Mre={baseStyle:_re,variants:Rre,sizes:Ire,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Wd,defineMultiStyleConfig:Nre}=_r(une.keys),n_=on("card-bg"),nu=on("card-padding"),LV=on("card-shadow"),mS=on("card-radius"),kV=on("card-border-width","0"),PV=on("card-border-color"),Ore=Wd({container:{[n_.variable]:"colors.chakra-body-bg",backgroundColor:n_.reference,boxShadow:LV.reference,borderRadius:mS.reference,color:"chakra-body-text",borderWidth:kV.reference,borderColor:PV.reference},body:{padding:nu.reference,flex:"1 1 0%"},header:{padding:nu.reference},footer:{padding:nu.reference}}),Dre={sm:Wd({container:{[mS.variable]:"radii.base",[nu.variable]:"space.3"}}),md:Wd({container:{[mS.variable]:"radii.md",[nu.variable]:"space.5"}}),lg:Wd({container:{[mS.variable]:"radii.xl",[nu.variable]:"space.7"}})},Lre={elevated:Wd({container:{[LV.variable]:"shadows.base",_dark:{[n_.variable]:"colors.gray.700"}}}),outline:Wd({container:{[kV.variable]:"1px",[PV.variable]:"colors.chakra-border-color"}}),filled:Wd({container:{[n_.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[nu.variable]:0},header:{[nu.variable]:0},footer:{[nu.variable]:0}}},kre=Nre({baseStyle:Ore,variants:Lre,sizes:Dre,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:gS,defineMultiStyleConfig:Pre}=_r(Vte.keys),u0=on("checkbox-size"),Bre=t=>{const{colorScheme:e}=t;return{w:u0.reference,h:u0.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:sn(`${e}.500`,`${e}.200`)(t),borderColor:sn(`${e}.500`,`${e}.200`)(t),color:sn("white","gray.900")(t),_hover:{bg:sn(`${e}.600`,`${e}.300`)(t),borderColor:sn(`${e}.600`,`${e}.300`)(t)},_disabled:{borderColor:sn("gray.200","transparent")(t),bg:sn("gray.200","whiteAlpha.300")(t),color:sn("gray.500","whiteAlpha.500")(t)}},_indeterminate:{bg:sn(`${e}.500`,`${e}.200`)(t),borderColor:sn(`${e}.500`,`${e}.200`)(t),color:sn("white","gray.900")(t)},_disabled:{bg:sn("gray.100","whiteAlpha.100")(t),borderColor:sn("gray.100","transparent")(t)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:sn("red.500","red.300")(t)}}},Fre={_disabled:{cursor:"not-allowed"}},Ure={userSelect:"none",_disabled:{opacity:.4}},zre={transitionProperty:"transform",transitionDuration:"normal"},Hre=gS(t=>({icon:zre,container:Fre,control:Da(Bre,t),label:Ure})),Gre={sm:gS({control:{[u0.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:gS({control:{[u0.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:gS({control:{[u0.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},Xu=Pre({baseStyle:Hre,sizes:Gre,defaultProps:{size:"md",colorScheme:"blue"}}),c0=Ei("close-button-size"),ig=Ei("close-button-bg"),Vre={w:[c0.reference],h:[c0.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[ig.variable]:"colors.blackAlpha.100",_dark:{[ig.variable]:"colors.whiteAlpha.100"}},_active:{[ig.variable]:"colors.blackAlpha.200",_dark:{[ig.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:ig.reference},$re={lg:{[c0.variable]:"sizes.10",fontSize:"md"},md:{[c0.variable]:"sizes.8",fontSize:"xs"},sm:{[c0.variable]:"sizes.6",fontSize:"2xs"}},Wre={baseStyle:Vre,sizes:$re,defaultProps:{size:"md"}},{variants:jre,defaultProps:Yre}=l0,qre={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:ti.bg.reference,color:ti.color.reference,boxShadow:ti.shadow.reference},Xre={baseStyle:qre,variants:jre,defaultProps:Yre},Kre={w:"100%",mx:"auto",maxW:"prose",px:"4"},Zre={baseStyle:Kre},Qre={opacity:.6,borderColor:"inherit"},Jre={borderStyle:"solid"},eie={borderStyle:"dashed"},tie={solid:Jre,dashed:eie},nie={baseStyle:Qre,variants:tie,defaultProps:{variant:"solid"}},{definePartsStyle:nI,defineMultiStyleConfig:rie}=_r($te.keys),uw=on("drawer-bg"),cw=on("drawer-box-shadow");function cp(t){return nI(t==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:t}})}const iie={bg:"blackAlpha.600",zIndex:"modal"},aie={display:"flex",zIndex:"modal",justifyContent:"center"},sie=t=>{const{isFullHeight:e}=t;return{...e&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[uw.variable]:"colors.white",[cw.variable]:"shadows.lg",_dark:{[uw.variable]:"colors.gray.700",[cw.variable]:"shadows.dark-lg"},bg:uw.reference,boxShadow:cw.reference}},oie={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},lie={position:"absolute",top:"2",insetEnd:"3"},uie={px:"6",py:"2",flex:"1",overflow:"auto"},cie={px:"6",py:"4"},die=nI(t=>({overlay:iie,dialogContainer:aie,dialog:Da(sie,t),header:oie,closeButton:lie,body:uie,footer:cie})),fie={xs:cp("xs"),sm:cp("md"),md:cp("lg"),lg:cp("2xl"),xl:cp("4xl"),full:cp("full")},pie=rie({baseStyle:die,sizes:fie,defaultProps:{size:"xs"}}),{definePartsStyle:hie,defineMultiStyleConfig:mie}=_r(Wte.keys),gie={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},bie={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},yie={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},vie=hie({preview:gie,input:bie,textarea:yie}),Eie=mie({baseStyle:vie}),{definePartsStyle:Sie,defineMultiStyleConfig:_ie}=_r(jte.keys),mh=on("form-control-color"),Aie={marginStart:"1",[mh.variable]:"colors.red.500",_dark:{[mh.variable]:"colors.red.300"},color:mh.reference},Tie={mt:"2",[mh.variable]:"colors.gray.600",_dark:{[mh.variable]:"colors.whiteAlpha.600"},color:mh.reference,lineHeight:"normal",fontSize:"sm"},xie=Sie({container:{width:"100%",position:"relative"},requiredIndicator:Aie,helperText:Tie}),wie=_ie({baseStyle:xie}),{definePartsStyle:Cie,defineMultiStyleConfig:Rie}=_r(Yte.keys),gh=on("form-error-color"),Iie={[gh.variable]:"colors.red.500",_dark:{[gh.variable]:"colors.red.300"},color:gh.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},Mie={marginEnd:"0.5em",[gh.variable]:"colors.red.500",_dark:{[gh.variable]:"colors.red.300"},color:gh.reference},Nie=Cie({text:Iie,icon:Mie}),Oie=Rie({baseStyle:Nie}),Die={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},Lie={baseStyle:Die},kie={fontFamily:"heading",fontWeight:"bold"},Pie={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},Bie={baseStyle:kie,sizes:Pie,defaultProps:{size:"xl"}},{definePartsStyle:Kl,defineMultiStyleConfig:Fie}=_r(qte.keys),Up=on("input-height"),zp=on("input-font-size"),Hp=on("input-padding"),Gp=on("input-border-radius"),Uie=Kl({addon:{height:Up.reference,fontSize:zp.reference,px:Hp.reference,borderRadius:Gp.reference},field:{width:"100%",height:Up.reference,fontSize:zp.reference,px:Hp.reference,borderRadius:Gp.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),Ou={lg:{[zp.variable]:"fontSizes.lg",[Hp.variable]:"space.4",[Gp.variable]:"radii.md",[Up.variable]:"sizes.12"},md:{[zp.variable]:"fontSizes.md",[Hp.variable]:"space.4",[Gp.variable]:"radii.md",[Up.variable]:"sizes.10"},sm:{[zp.variable]:"fontSizes.sm",[Hp.variable]:"space.3",[Gp.variable]:"radii.sm",[Up.variable]:"sizes.8"},xs:{[zp.variable]:"fontSizes.xs",[Hp.variable]:"space.2",[Gp.variable]:"radii.sm",[Up.variable]:"sizes.6"}},zie={lg:Kl({field:Ou.lg,group:Ou.lg}),md:Kl({field:Ou.md,group:Ou.md}),sm:Kl({field:Ou.sm,group:Ou.sm}),xs:Kl({field:Ou.xs,group:Ou.xs})};function YN(t){const{focusBorderColor:e,errorBorderColor:n}=t;return{focusBorderColor:e||sn("blue.500","blue.300")(t),errorBorderColor:n||sn("red.500","red.300")(t)}}const Hie=Kl(t=>{const{theme:e}=t,{focusBorderColor:n,errorBorderColor:r}=YN(t);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:sn("gray.300","whiteAlpha.400")(t)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Na(e,r),boxShadow:`0 0 0 1px ${Na(e,r)}`},_focusVisible:{zIndex:1,borderColor:Na(e,n),boxShadow:`0 0 0 1px ${Na(e,n)}`}},addon:{border:"1px solid",borderColor:sn("inherit","whiteAlpha.50")(t),bg:sn("gray.100","whiteAlpha.300")(t)}}}),Gie=Kl(t=>{const{theme:e}=t,{focusBorderColor:n,errorBorderColor:r}=YN(t);return{field:{border:"2px solid",borderColor:"transparent",bg:sn("gray.100","whiteAlpha.50")(t),_hover:{bg:sn("gray.200","whiteAlpha.100")(t)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Na(e,r)},_focusVisible:{bg:"transparent",borderColor:Na(e,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:sn("gray.100","whiteAlpha.50")(t)}}}),Vie=Kl(t=>{const{theme:e}=t,{focusBorderColor:n,errorBorderColor:r}=YN(t);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Na(e,r),boxShadow:`0px 1px 0px 0px ${Na(e,r)}`},_focusVisible:{borderColor:Na(e,n),boxShadow:`0px 1px 0px 0px ${Na(e,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),$ie=Kl({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),Wie={outline:Hie,filled:Gie,flushed:Vie,unstyled:$ie},nr=Fie({baseStyle:Uie,sizes:zie,variants:Wie,defaultProps:{size:"md",variant:"outline"}}),dw=on("kbd-bg"),jie={[dw.variable]:"colors.gray.100",_dark:{[dw.variable]:"colors.whiteAlpha.100"},bg:dw.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Yie={baseStyle:jie},qie={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Xie={baseStyle:qie},{defineMultiStyleConfig:Kie,definePartsStyle:Zie}=_r(Xte.keys),Qie={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},Jie=Zie({icon:Qie}),eae=Kie({baseStyle:Jie}),{defineMultiStyleConfig:tae,definePartsStyle:nae}=_r(Kte.keys),Zo=on("menu-bg"),fw=on("menu-shadow"),rae={[Zo.variable]:"#fff",[fw.variable]:"shadows.sm",_dark:{[Zo.variable]:"colors.gray.700",[fw.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:"dropdown",borderRadius:"md",borderWidth:"1px",bg:Zo.reference,boxShadow:fw.reference},iae={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Zo.variable]:"colors.gray.100",_dark:{[Zo.variable]:"colors.whiteAlpha.100"}},_active:{[Zo.variable]:"colors.gray.200",_dark:{[Zo.variable]:"colors.whiteAlpha.200"}},_expanded:{[Zo.variable]:"colors.gray.100",_dark:{[Zo.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Zo.reference},aae={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},sae={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},oae={opacity:.6},lae={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},uae={transitionProperty:"common",transitionDuration:"normal"},cae=nae({button:uae,list:rae,item:iae,groupTitle:aae,icon:sae,command:oae,divider:lae}),dae=tae({baseStyle:cae}),{defineMultiStyleConfig:fae,definePartsStyle:rI}=_r(Zte.keys),pw=on("modal-bg"),hw=on("modal-shadow"),pae={bg:"blackAlpha.600",zIndex:"modal"},hae=t=>{const{isCentered:e,scrollBehavior:n}=t;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:e?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},mae=t=>{const{isCentered:e,scrollBehavior:n}=t;return{borderRadius:"md",color:"inherit",my:e?"auto":"16",mx:e?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[pw.variable]:"colors.white",[hw.variable]:"shadows.lg",_dark:{[pw.variable]:"colors.gray.700",[hw.variable]:"shadows.dark-lg"},bg:pw.reference,boxShadow:hw.reference}},gae={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},bae={position:"absolute",top:"2",insetEnd:"3"},yae=t=>{const{scrollBehavior:e}=t;return{px:"6",py:"2",flex:"1",overflow:e==="inside"?"auto":void 0}},vae={px:"6",py:"4"},Eae=rI(t=>({overlay:pae,dialogContainer:Da(hae,t),dialog:Da(mae,t),header:gae,closeButton:bae,body:Da(yae,t),footer:vae}));function lo(t){return rI(t==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:t}})}const Sae={xs:lo("xs"),sm:lo("sm"),md:lo("md"),lg:lo("lg"),xl:lo("xl"),"2xl":lo("2xl"),"3xl":lo("3xl"),"4xl":lo("4xl"),"5xl":lo("5xl"),"6xl":lo("6xl"),full:lo("full")},_ae=fae({baseStyle:Eae,sizes:Sae,defaultProps:{size:"md"}}),BV={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},{defineMultiStyleConfig:Aae,definePartsStyle:FV}=_r(Qte.keys),qN=Ei("number-input-stepper-width"),UV=Ei("number-input-input-padding"),Tae=$l(qN).add("0.5rem").toString(),mw=Ei("number-input-bg"),gw=Ei("number-input-color"),bw=Ei("number-input-border-color"),xae={[qN.variable]:"sizes.6",[UV.variable]:Tae},wae=t=>{var e;return((e=Da(nr.baseStyle,t))==null?void 0:e.field)??{}},Cae={width:qN.reference},Rae={borderStart:"1px solid",borderStartColor:bw.reference,color:gw.reference,bg:mw.reference,[gw.variable]:"colors.chakra-body-text",[bw.variable]:"colors.chakra-border-color",_dark:{[gw.variable]:"colors.whiteAlpha.800",[bw.variable]:"colors.whiteAlpha.300"},_active:{[mw.variable]:"colors.gray.200",_dark:{[mw.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},Iae=FV(t=>({root:xae,field:Da(wae,t)??{},stepperGroup:Cae,stepper:Rae}));function xv(t){var a,s;const e=(a=nr.sizes)==null?void 0:a[t],n={lg:"md",md:"md",sm:"sm",xs:"sm"},r=((s=e.field)==null?void 0:s.fontSize)??"md",i=BV.fontSizes[r];return FV({field:{...e.field,paddingInlineEnd:UV.reference,verticalAlign:"top"},stepper:{fontSize:$l(i).multiply(.75).toString(),_first:{borderTopEndRadius:n[t]},_last:{borderBottomEndRadius:n[t],mt:"-1px",borderTopWidth:1}}})}const Mae={xs:xv("xs"),sm:xv("sm"),md:xv("md"),lg:xv("lg")},Nae=Aae({baseStyle:Iae,sizes:Mae,variants:nr.variants,defaultProps:nr.defaultProps});var G9;const Oae={...(G9=nr.baseStyle)==null?void 0:G9.field,textAlign:"center"},Dae={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}};var V9;const Lae={outline:t=>{var e,n;return((n=Da((e=nr.variants)==null?void 0:e.outline,t))==null?void 0:n.field)??{}},flushed:t=>{var e,n;return((n=Da((e=nr.variants)==null?void 0:e.flushed,t))==null?void 0:n.field)??{}},filled:t=>{var e,n;return((n=Da((e=nr.variants)==null?void 0:e.filled,t))==null?void 0:n.field)??{}},unstyled:((V9=nr.variants)==null?void 0:V9.unstyled.field)??{}},kae={baseStyle:Oae,sizes:Dae,variants:Lae,defaultProps:nr.defaultProps},{defineMultiStyleConfig:Pae,definePartsStyle:Bae}=_r(Jte.keys),wv=Ei("popper-bg"),Fae=Ei("popper-arrow-bg"),o4=Ei("popper-arrow-shadow-color"),Uae={zIndex:"popover"},zae={[wv.variable]:"colors.white",bg:wv.reference,[Fae.variable]:wv.reference,[o4.variable]:"colors.gray.200",_dark:{[wv.variable]:"colors.gray.700",[o4.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},Hae={px:3,py:2,borderBottomWidth:"1px"},Gae={px:3,py:2},Vae={px:3,py:2,borderTopWidth:"1px"},$ae={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},Wae=Bae({popper:Uae,content:zae,header:Hae,body:Gae,footer:Vae,closeButton:$ae}),jae=Pae({baseStyle:Wae}),{defineMultiStyleConfig:Yae,definePartsStyle:$g}=_r(ene.keys),qae=t=>{const{colorScheme:e,theme:n,isIndeterminate:r,hasStripe:i}=t,a=sn(n4(),n4("1rem","rgba(0,0,0,0.1)"))(t),s=sn(`${e}.500`,`${e}.200`)(t),o=`linear-gradient( + )`,backgroundSize:`${t} ${t}`}}const Pne=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function Bne(t){const e=Pne();return!t||Nne(t)?e:t.string&&t.colors?Une(t.string,t.colors):t.string&&!t.colors?Fne(t.string):t.colors&&!t.string?zne(t.colors):e}function Fne(t){let e=0;if(t.length===0)return e.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function Une(t,e){let n=0;if(t.length===0)return e[0];for(let r=0;rn.colorMode==="dark"?e:t}function WN(t){const{orientation:e,vertical:n,horizontal:r}=t;return e?e==="vertical"?n:r:{}}function RV(t){return es(t)&&t.reference?t.reference:String(t)}const ex=(t,...e)=>e.map(RV).join(` ${t} `).replace(/calc/g,""),r4=(...t)=>`calc(${ex("+",...t)})`,i4=(...t)=>`calc(${ex("-",...t)})`,tI=(...t)=>`calc(${ex("*",...t)})`,a4=(...t)=>`calc(${ex("/",...t)})`,s4=t=>{const e=RV(t);return e!=null&&!Number.isNaN(parseFloat(e))?String(e).startsWith("-")?String(e).slice(1):`-${e}`:tI(e,-1)},$l=Object.assign(t=>({add:(...e)=>$l(r4(t,...e)),subtract:(...e)=>$l(i4(t,...e)),multiply:(...e)=>$l(tI(t,...e)),divide:(...e)=>$l(a4(t,...e)),negate:()=>$l(s4(t)),toString:()=>t.toString()}),{add:r4,subtract:i4,multiply:tI,divide:a4,negate:s4});function Hne(t){return!Number.isInteger(parseFloat(t.toString()))}function Gne(t,e="-"){return t.replace(/\s+/g,e)}function IV(t){const e=Gne(t.toString());return e.includes("\\.")?t:Hne(t)?e.replace(".","\\."):t}function Vne(t,e=""){return[e,IV(t)].filter(Boolean).join("-")}function $ne(t,e){return`var(${IV(t)}${e?`, ${e}`:""})`}function Wne(t,e=""){return`--${Vne(t,e)}`}function Ei(t,e){const n=Wne(t,e==null?void 0:e.prefix);return{variable:n,reference:$ne(n,jne(e==null?void 0:e.fallback))}}function jne(t){return t==null?void 0:t.reference}const{definePartsStyle:Fb,defineMultiStyleConfig:Yne}=Sr(zte.keys),ys=on("alert-fg"),fu=on("alert-bg"),qne=Fb({container:{bg:fu.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:ys.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:ys.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function jN(t){const{theme:e,colorScheme:n}=t,r=Lh(`${n}.200`,.16)(e);return{light:`colors.${n}.100`,dark:r}}const Xne=Fb(t=>{const{colorScheme:e}=t,n=jN(t);return{container:{[ys.variable]:`colors.${e}.600`,[fu.variable]:n.light,_dark:{[ys.variable]:`colors.${e}.200`,[fu.variable]:n.dark}}}}),Kne=Fb(t=>{const{colorScheme:e}=t,n=jN(t);return{container:{[ys.variable]:`colors.${e}.600`,[fu.variable]:n.light,_dark:{[ys.variable]:`colors.${e}.200`,[fu.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:ys.reference}}}),Zne=Fb(t=>{const{colorScheme:e}=t,n=jN(t);return{container:{[ys.variable]:`colors.${e}.600`,[fu.variable]:n.light,_dark:{[ys.variable]:`colors.${e}.200`,[fu.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:ys.reference}}}),Qne=Fb(t=>{const{colorScheme:e}=t;return{container:{[ys.variable]:"colors.white",[fu.variable]:`colors.${e}.600`,_dark:{[ys.variable]:"colors.gray.900",[fu.variable]:`colors.${e}.200`},color:ys.reference}}}),Jne={subtle:Xne,"left-accent":Kne,"top-accent":Zne,solid:Qne},ere=Yne({baseStyle:qne,variants:Jne,defaultProps:{variant:"subtle",colorScheme:"blue"}}),MV={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},tre={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},nre={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},NV={...MV,...tre,container:nre},rre=t=>typeof t=="function";function Da(t,...e){return rre(t)?t(...e):t}const{definePartsStyle:OV,defineMultiStyleConfig:ire}=Sr(Hte.keys),hh=on("avatar-border-color"),o0=on("avatar-bg"),$0=on("avatar-font-size"),kh=on("avatar-size"),are={borderRadius:"full",border:"0.2em solid",borderColor:hh.reference,[hh.variable]:"white",_dark:{[hh.variable]:"colors.gray.800"}},sre={bg:o0.reference,fontSize:$0.reference,width:kh.reference,height:kh.reference,lineHeight:"1",[o0.variable]:"colors.gray.200",_dark:{[o0.variable]:"colors.whiteAlpha.400"}},ore=t=>{const{name:e,theme:n}=t,r=e?Bne({string:e}):"colors.gray.400",i=kne(r)(n);let a="white";return i||(a="gray.800"),{bg:o0.reference,fontSize:$0.reference,color:a,borderColor:hh.reference,verticalAlign:"top",width:kh.reference,height:kh.reference,"&:not([data-loaded])":{[o0.variable]:r},[hh.variable]:"colors.white",_dark:{[hh.variable]:"colors.gray.800"}}},lre={fontSize:$0.reference,lineHeight:"1"},ure=OV(t=>({badge:Da(are,t),excessLabel:Da(sre,t),container:Da(ore,t),label:lre}));function Nu(t){const e=t!=="100%"?NV[t]:void 0;return OV({container:{[kh.variable]:e??t,[$0.variable]:`calc(${e??t} / 2.5)`},excessLabel:{[kh.variable]:e??t,[$0.variable]:`calc(${e??t} / 2.5)`}})}const cre={"2xs":Nu(4),xs:Nu(6),sm:Nu(8),md:Nu(12),lg:Nu(16),xl:Nu(24),"2xl":Nu(32),full:Nu("100%")},dre=ire({baseStyle:ure,sizes:cre,defaultProps:{size:"md"}}),ti=Nte("badge",["bg","color","shadow"]),fre={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:ti.bg.reference,color:ti.color.reference,boxShadow:ti.shadow.reference},pre=t=>{const{colorScheme:e,theme:n}=t,r=Lh(`${e}.500`,.6)(n);return{[ti.bg.variable]:`colors.${e}.500`,[ti.color.variable]:"colors.white",_dark:{[ti.bg.variable]:r,[ti.color.variable]:"colors.whiteAlpha.800"}}},hre=t=>{const{colorScheme:e,theme:n}=t,r=Lh(`${e}.200`,.16)(n);return{[ti.bg.variable]:`colors.${e}.100`,[ti.color.variable]:`colors.${e}.800`,_dark:{[ti.bg.variable]:r,[ti.color.variable]:`colors.${e}.200`}}},mre=t=>{const{colorScheme:e,theme:n}=t,r=Lh(`${e}.200`,.8)(n);return{[ti.color.variable]:`colors.${e}.500`,_dark:{[ti.color.variable]:r},[ti.shadow.variable]:`inset 0 0 0px 1px ${ti.color.reference}`}},gre={solid:pre,subtle:hre,outline:mre},l0={baseStyle:fre,variants:gre,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:bre,definePartsStyle:yre}=Sr(Gte.keys),lw=on("breadcrumb-link-decor"),vre={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:lw.reference,[lw.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[lw.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},Ere=yre({link:vre}),_re=bre({baseStyle:Ere}),Sre={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},DV=t=>{const{colorScheme:e,theme:n}=t;if(e==="gray")return{color:sn("gray.800","whiteAlpha.900")(t),_hover:{bg:sn("gray.100","whiteAlpha.200")(t)},_active:{bg:sn("gray.200","whiteAlpha.300")(t)}};const r=Lh(`${e}.200`,.12)(n),i=Lh(`${e}.200`,.24)(n);return{color:sn(`${e}.600`,`${e}.200`)(t),bg:"transparent",_hover:{bg:sn(`${e}.50`,r)(t)},_active:{bg:sn(`${e}.100`,i)(t)}}},Are=t=>{const{colorScheme:e}=t,n=sn("gray.200","whiteAlpha.300")(t);return{border:"1px solid",borderColor:e==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...Da(DV,t)}},xre={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},Tre=t=>{const{colorScheme:e}=t;if(e==="gray"){const o=sn("gray.100","whiteAlpha.200")(t);return{bg:o,color:sn("gray.800","whiteAlpha.900")(t),_hover:{bg:sn("gray.200","whiteAlpha.300")(t),_disabled:{bg:o}},_active:{bg:sn("gray.300","whiteAlpha.400")(t)}}}const{bg:n=`${e}.500`,color:r="white",hoverBg:i=`${e}.600`,activeBg:a=`${e}.700`}=xre[e]??{},s=sn(n,`${e}.200`)(t);return{bg:s,color:sn(r,"gray.800")(t),_hover:{bg:sn(i,`${e}.300`)(t),_disabled:{bg:s}},_active:{bg:sn(a,`${e}.400`)(t)}}},wre=t=>{const{colorScheme:e}=t;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:sn(`${e}.500`,`${e}.200`)(t),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:sn(`${e}.700`,`${e}.500`)(t)}}},Cre={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},Rre={ghost:DV,outline:Are,solid:Tre,link:wre,unstyled:Cre},Ire={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},Mre={baseStyle:Sre,variants:Rre,sizes:Ire,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Wd,defineMultiStyleConfig:Nre}=Sr(une.keys),nS=on("card-bg"),nu=on("card-padding"),LV=on("card-shadow"),m_=on("card-radius"),kV=on("card-border-width","0"),PV=on("card-border-color"),Ore=Wd({container:{[nS.variable]:"colors.chakra-body-bg",backgroundColor:nS.reference,boxShadow:LV.reference,borderRadius:m_.reference,color:"chakra-body-text",borderWidth:kV.reference,borderColor:PV.reference},body:{padding:nu.reference,flex:"1 1 0%"},header:{padding:nu.reference},footer:{padding:nu.reference}}),Dre={sm:Wd({container:{[m_.variable]:"radii.base",[nu.variable]:"space.3"}}),md:Wd({container:{[m_.variable]:"radii.md",[nu.variable]:"space.5"}}),lg:Wd({container:{[m_.variable]:"radii.xl",[nu.variable]:"space.7"}})},Lre={elevated:Wd({container:{[LV.variable]:"shadows.base",_dark:{[nS.variable]:"colors.gray.700"}}}),outline:Wd({container:{[kV.variable]:"1px",[PV.variable]:"colors.chakra-border-color"}}),filled:Wd({container:{[nS.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[nu.variable]:0},header:{[nu.variable]:0},footer:{[nu.variable]:0}}},kre=Nre({baseStyle:Ore,variants:Lre,sizes:Dre,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:g_,defineMultiStyleConfig:Pre}=Sr(Vte.keys),u0=on("checkbox-size"),Bre=t=>{const{colorScheme:e}=t;return{w:u0.reference,h:u0.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:sn(`${e}.500`,`${e}.200`)(t),borderColor:sn(`${e}.500`,`${e}.200`)(t),color:sn("white","gray.900")(t),_hover:{bg:sn(`${e}.600`,`${e}.300`)(t),borderColor:sn(`${e}.600`,`${e}.300`)(t)},_disabled:{borderColor:sn("gray.200","transparent")(t),bg:sn("gray.200","whiteAlpha.300")(t),color:sn("gray.500","whiteAlpha.500")(t)}},_indeterminate:{bg:sn(`${e}.500`,`${e}.200`)(t),borderColor:sn(`${e}.500`,`${e}.200`)(t),color:sn("white","gray.900")(t)},_disabled:{bg:sn("gray.100","whiteAlpha.100")(t),borderColor:sn("gray.100","transparent")(t)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:sn("red.500","red.300")(t)}}},Fre={_disabled:{cursor:"not-allowed"}},Ure={userSelect:"none",_disabled:{opacity:.4}},zre={transitionProperty:"transform",transitionDuration:"normal"},Hre=g_(t=>({icon:zre,container:Fre,control:Da(Bre,t),label:Ure})),Gre={sm:g_({control:{[u0.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:g_({control:{[u0.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:g_({control:{[u0.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},Xu=Pre({baseStyle:Hre,sizes:Gre,defaultProps:{size:"md",colorScheme:"blue"}}),c0=Ei("close-button-size"),ig=Ei("close-button-bg"),Vre={w:[c0.reference],h:[c0.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[ig.variable]:"colors.blackAlpha.100",_dark:{[ig.variable]:"colors.whiteAlpha.100"}},_active:{[ig.variable]:"colors.blackAlpha.200",_dark:{[ig.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:ig.reference},$re={lg:{[c0.variable]:"sizes.10",fontSize:"md"},md:{[c0.variable]:"sizes.8",fontSize:"xs"},sm:{[c0.variable]:"sizes.6",fontSize:"2xs"}},Wre={baseStyle:Vre,sizes:$re,defaultProps:{size:"md"}},{variants:jre,defaultProps:Yre}=l0,qre={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:ti.bg.reference,color:ti.color.reference,boxShadow:ti.shadow.reference},Xre={baseStyle:qre,variants:jre,defaultProps:Yre},Kre={w:"100%",mx:"auto",maxW:"prose",px:"4"},Zre={baseStyle:Kre},Qre={opacity:.6,borderColor:"inherit"},Jre={borderStyle:"solid"},eie={borderStyle:"dashed"},tie={solid:Jre,dashed:eie},nie={baseStyle:Qre,variants:tie,defaultProps:{variant:"solid"}},{definePartsStyle:nI,defineMultiStyleConfig:rie}=Sr($te.keys),uw=on("drawer-bg"),cw=on("drawer-box-shadow");function cp(t){return nI(t==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:t}})}const iie={bg:"blackAlpha.600",zIndex:"modal"},aie={display:"flex",zIndex:"modal",justifyContent:"center"},sie=t=>{const{isFullHeight:e}=t;return{...e&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[uw.variable]:"colors.white",[cw.variable]:"shadows.lg",_dark:{[uw.variable]:"colors.gray.700",[cw.variable]:"shadows.dark-lg"},bg:uw.reference,boxShadow:cw.reference}},oie={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},lie={position:"absolute",top:"2",insetEnd:"3"},uie={px:"6",py:"2",flex:"1",overflow:"auto"},cie={px:"6",py:"4"},die=nI(t=>({overlay:iie,dialogContainer:aie,dialog:Da(sie,t),header:oie,closeButton:lie,body:uie,footer:cie})),fie={xs:cp("xs"),sm:cp("md"),md:cp("lg"),lg:cp("2xl"),xl:cp("4xl"),full:cp("full")},pie=rie({baseStyle:die,sizes:fie,defaultProps:{size:"xs"}}),{definePartsStyle:hie,defineMultiStyleConfig:mie}=Sr(Wte.keys),gie={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},bie={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},yie={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},vie=hie({preview:gie,input:bie,textarea:yie}),Eie=mie({baseStyle:vie}),{definePartsStyle:_ie,defineMultiStyleConfig:Sie}=Sr(jte.keys),mh=on("form-control-color"),Aie={marginStart:"1",[mh.variable]:"colors.red.500",_dark:{[mh.variable]:"colors.red.300"},color:mh.reference},xie={mt:"2",[mh.variable]:"colors.gray.600",_dark:{[mh.variable]:"colors.whiteAlpha.600"},color:mh.reference,lineHeight:"normal",fontSize:"sm"},Tie=_ie({container:{width:"100%",position:"relative"},requiredIndicator:Aie,helperText:xie}),wie=Sie({baseStyle:Tie}),{definePartsStyle:Cie,defineMultiStyleConfig:Rie}=Sr(Yte.keys),gh=on("form-error-color"),Iie={[gh.variable]:"colors.red.500",_dark:{[gh.variable]:"colors.red.300"},color:gh.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},Mie={marginEnd:"0.5em",[gh.variable]:"colors.red.500",_dark:{[gh.variable]:"colors.red.300"},color:gh.reference},Nie=Cie({text:Iie,icon:Mie}),Oie=Rie({baseStyle:Nie}),Die={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},Lie={baseStyle:Die},kie={fontFamily:"heading",fontWeight:"bold"},Pie={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},Bie={baseStyle:kie,sizes:Pie,defaultProps:{size:"xl"}},{definePartsStyle:Kl,defineMultiStyleConfig:Fie}=Sr(qte.keys),Up=on("input-height"),zp=on("input-font-size"),Hp=on("input-padding"),Gp=on("input-border-radius"),Uie=Kl({addon:{height:Up.reference,fontSize:zp.reference,px:Hp.reference,borderRadius:Gp.reference},field:{width:"100%",height:Up.reference,fontSize:zp.reference,px:Hp.reference,borderRadius:Gp.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),Ou={lg:{[zp.variable]:"fontSizes.lg",[Hp.variable]:"space.4",[Gp.variable]:"radii.md",[Up.variable]:"sizes.12"},md:{[zp.variable]:"fontSizes.md",[Hp.variable]:"space.4",[Gp.variable]:"radii.md",[Up.variable]:"sizes.10"},sm:{[zp.variable]:"fontSizes.sm",[Hp.variable]:"space.3",[Gp.variable]:"radii.sm",[Up.variable]:"sizes.8"},xs:{[zp.variable]:"fontSizes.xs",[Hp.variable]:"space.2",[Gp.variable]:"radii.sm",[Up.variable]:"sizes.6"}},zie={lg:Kl({field:Ou.lg,group:Ou.lg}),md:Kl({field:Ou.md,group:Ou.md}),sm:Kl({field:Ou.sm,group:Ou.sm}),xs:Kl({field:Ou.xs,group:Ou.xs})};function YN(t){const{focusBorderColor:e,errorBorderColor:n}=t;return{focusBorderColor:e||sn("blue.500","blue.300")(t),errorBorderColor:n||sn("red.500","red.300")(t)}}const Hie=Kl(t=>{const{theme:e}=t,{focusBorderColor:n,errorBorderColor:r}=YN(t);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:sn("gray.300","whiteAlpha.400")(t)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Na(e,r),boxShadow:`0 0 0 1px ${Na(e,r)}`},_focusVisible:{zIndex:1,borderColor:Na(e,n),boxShadow:`0 0 0 1px ${Na(e,n)}`}},addon:{border:"1px solid",borderColor:sn("inherit","whiteAlpha.50")(t),bg:sn("gray.100","whiteAlpha.300")(t)}}}),Gie=Kl(t=>{const{theme:e}=t,{focusBorderColor:n,errorBorderColor:r}=YN(t);return{field:{border:"2px solid",borderColor:"transparent",bg:sn("gray.100","whiteAlpha.50")(t),_hover:{bg:sn("gray.200","whiteAlpha.100")(t)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Na(e,r)},_focusVisible:{bg:"transparent",borderColor:Na(e,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:sn("gray.100","whiteAlpha.50")(t)}}}),Vie=Kl(t=>{const{theme:e}=t,{focusBorderColor:n,errorBorderColor:r}=YN(t);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Na(e,r),boxShadow:`0px 1px 0px 0px ${Na(e,r)}`},_focusVisible:{borderColor:Na(e,n),boxShadow:`0px 1px 0px 0px ${Na(e,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),$ie=Kl({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),Wie={outline:Hie,filled:Gie,flushed:Vie,unstyled:$ie},nr=Fie({baseStyle:Uie,sizes:zie,variants:Wie,defaultProps:{size:"md",variant:"outline"}}),dw=on("kbd-bg"),jie={[dw.variable]:"colors.gray.100",_dark:{[dw.variable]:"colors.whiteAlpha.100"},bg:dw.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Yie={baseStyle:jie},qie={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Xie={baseStyle:qie},{defineMultiStyleConfig:Kie,definePartsStyle:Zie}=Sr(Xte.keys),Qie={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},Jie=Zie({icon:Qie}),eae=Kie({baseStyle:Jie}),{defineMultiStyleConfig:tae,definePartsStyle:nae}=Sr(Kte.keys),Zo=on("menu-bg"),fw=on("menu-shadow"),rae={[Zo.variable]:"#fff",[fw.variable]:"shadows.sm",_dark:{[Zo.variable]:"colors.gray.700",[fw.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:"dropdown",borderRadius:"md",borderWidth:"1px",bg:Zo.reference,boxShadow:fw.reference},iae={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Zo.variable]:"colors.gray.100",_dark:{[Zo.variable]:"colors.whiteAlpha.100"}},_active:{[Zo.variable]:"colors.gray.200",_dark:{[Zo.variable]:"colors.whiteAlpha.200"}},_expanded:{[Zo.variable]:"colors.gray.100",_dark:{[Zo.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Zo.reference},aae={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},sae={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},oae={opacity:.6},lae={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},uae={transitionProperty:"common",transitionDuration:"normal"},cae=nae({button:uae,list:rae,item:iae,groupTitle:aae,icon:sae,command:oae,divider:lae}),dae=tae({baseStyle:cae}),{defineMultiStyleConfig:fae,definePartsStyle:rI}=Sr(Zte.keys),pw=on("modal-bg"),hw=on("modal-shadow"),pae={bg:"blackAlpha.600",zIndex:"modal"},hae=t=>{const{isCentered:e,scrollBehavior:n}=t;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:e?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},mae=t=>{const{isCentered:e,scrollBehavior:n}=t;return{borderRadius:"md",color:"inherit",my:e?"auto":"16",mx:e?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[pw.variable]:"colors.white",[hw.variable]:"shadows.lg",_dark:{[pw.variable]:"colors.gray.700",[hw.variable]:"shadows.dark-lg"},bg:pw.reference,boxShadow:hw.reference}},gae={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},bae={position:"absolute",top:"2",insetEnd:"3"},yae=t=>{const{scrollBehavior:e}=t;return{px:"6",py:"2",flex:"1",overflow:e==="inside"?"auto":void 0}},vae={px:"6",py:"4"},Eae=rI(t=>({overlay:pae,dialogContainer:Da(hae,t),dialog:Da(mae,t),header:gae,closeButton:bae,body:Da(yae,t),footer:vae}));function lo(t){return rI(t==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:t}})}const _ae={xs:lo("xs"),sm:lo("sm"),md:lo("md"),lg:lo("lg"),xl:lo("xl"),"2xl":lo("2xl"),"3xl":lo("3xl"),"4xl":lo("4xl"),"5xl":lo("5xl"),"6xl":lo("6xl"),full:lo("full")},Sae=fae({baseStyle:Eae,sizes:_ae,defaultProps:{size:"md"}}),BV={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},{defineMultiStyleConfig:Aae,definePartsStyle:FV}=Sr(Qte.keys),qN=Ei("number-input-stepper-width"),UV=Ei("number-input-input-padding"),xae=$l(qN).add("0.5rem").toString(),mw=Ei("number-input-bg"),gw=Ei("number-input-color"),bw=Ei("number-input-border-color"),Tae={[qN.variable]:"sizes.6",[UV.variable]:xae},wae=t=>{var e;return((e=Da(nr.baseStyle,t))==null?void 0:e.field)??{}},Cae={width:qN.reference},Rae={borderStart:"1px solid",borderStartColor:bw.reference,color:gw.reference,bg:mw.reference,[gw.variable]:"colors.chakra-body-text",[bw.variable]:"colors.chakra-border-color",_dark:{[gw.variable]:"colors.whiteAlpha.800",[bw.variable]:"colors.whiteAlpha.300"},_active:{[mw.variable]:"colors.gray.200",_dark:{[mw.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},Iae=FV(t=>({root:Tae,field:Da(wae,t)??{},stepperGroup:Cae,stepper:Rae}));function Tv(t){var a,s;const e=(a=nr.sizes)==null?void 0:a[t],n={lg:"md",md:"md",sm:"sm",xs:"sm"},r=((s=e.field)==null?void 0:s.fontSize)??"md",i=BV.fontSizes[r];return FV({field:{...e.field,paddingInlineEnd:UV.reference,verticalAlign:"top"},stepper:{fontSize:$l(i).multiply(.75).toString(),_first:{borderTopEndRadius:n[t]},_last:{borderBottomEndRadius:n[t],mt:"-1px",borderTopWidth:1}}})}const Mae={xs:Tv("xs"),sm:Tv("sm"),md:Tv("md"),lg:Tv("lg")},Nae=Aae({baseStyle:Iae,sizes:Mae,variants:nr.variants,defaultProps:nr.defaultProps});var G9;const Oae={...(G9=nr.baseStyle)==null?void 0:G9.field,textAlign:"center"},Dae={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}};var V9;const Lae={outline:t=>{var e,n;return((n=Da((e=nr.variants)==null?void 0:e.outline,t))==null?void 0:n.field)??{}},flushed:t=>{var e,n;return((n=Da((e=nr.variants)==null?void 0:e.flushed,t))==null?void 0:n.field)??{}},filled:t=>{var e,n;return((n=Da((e=nr.variants)==null?void 0:e.filled,t))==null?void 0:n.field)??{}},unstyled:((V9=nr.variants)==null?void 0:V9.unstyled.field)??{}},kae={baseStyle:Oae,sizes:Dae,variants:Lae,defaultProps:nr.defaultProps},{defineMultiStyleConfig:Pae,definePartsStyle:Bae}=Sr(Jte.keys),wv=Ei("popper-bg"),Fae=Ei("popper-arrow-bg"),o4=Ei("popper-arrow-shadow-color"),Uae={zIndex:"popover"},zae={[wv.variable]:"colors.white",bg:wv.reference,[Fae.variable]:wv.reference,[o4.variable]:"colors.gray.200",_dark:{[wv.variable]:"colors.gray.700",[o4.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},Hae={px:3,py:2,borderBottomWidth:"1px"},Gae={px:3,py:2},Vae={px:3,py:2,borderTopWidth:"1px"},$ae={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},Wae=Bae({popper:Uae,content:zae,header:Hae,body:Gae,footer:Vae,closeButton:$ae}),jae=Pae({baseStyle:Wae}),{defineMultiStyleConfig:Yae,definePartsStyle:$g}=Sr(ene.keys),qae=t=>{const{colorScheme:e,theme:n,isIndeterminate:r,hasStripe:i}=t,a=sn(n4(),n4("1rem","rgba(0,0,0,0.1)"))(t),s=sn(`${e}.500`,`${e}.200`)(t),o=`linear-gradient( to right, transparent 0%, ${Na(n,s)} 50%, transparent 100% - )`;return{...!r&&i&&a,...r?{bgImage:o}:{bgColor:s}}},Xae={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Kae=t=>({bg:sn("gray.100","whiteAlpha.300")(t)}),Zae=t=>({transitionProperty:"common",transitionDuration:"slow",...qae(t)}),Qae=$g(t=>({label:Xae,filledTrack:Zae(t),track:Kae(t)})),Jae={xs:$g({track:{h:"1"}}),sm:$g({track:{h:"2"}}),md:$g({track:{h:"3"}}),lg:$g({track:{h:"4"}})},ese=Yae({sizes:Jae,baseStyle:Qae,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:tse,definePartsStyle:bS}=_r(tne.keys),nse=t=>{var n;const e=(n=Da(Xu.baseStyle,t))==null?void 0:n.control;return{...e,borderRadius:"full",_checked:{...e==null?void 0:e._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},rse=bS(t=>{var e,n;return{label:(e=Xu.baseStyle)==null?void 0:e.call(Xu,t).label,container:(n=Xu.baseStyle)==null?void 0:n.call(Xu,t).container,control:nse(t)}}),ise={md:bS({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:bS({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:bS({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},ase=tse({baseStyle:rse,sizes:ise,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:sse,definePartsStyle:ose}=_r(nne.keys),Cv=on("select-bg");var $9;const lse={...($9=nr.baseStyle)==null?void 0:$9.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Cv.reference,[Cv.variable]:"colors.white",_dark:{[Cv.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Cv.reference}},use={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},cse=ose({field:lse,icon:use}),Rv={paddingInlineEnd:"8"};var W9,j9,Y9,q9,X9,K9,Z9,Q9;const dse={lg:{...(W9=nr.sizes)==null?void 0:W9.lg,field:{...(j9=nr.sizes)==null?void 0:j9.lg.field,...Rv}},md:{...(Y9=nr.sizes)==null?void 0:Y9.md,field:{...(q9=nr.sizes)==null?void 0:q9.md.field,...Rv}},sm:{...(X9=nr.sizes)==null?void 0:X9.sm,field:{...(K9=nr.sizes)==null?void 0:K9.sm.field,...Rv}},xs:{...(Z9=nr.sizes)==null?void 0:Z9.xs,field:{...(Q9=nr.sizes)==null?void 0:Q9.xs.field,...Rv},icon:{insetEnd:"1"}}},fse=sse({baseStyle:cse,sizes:dse,variants:nr.variants,defaultProps:nr.defaultProps}),yw=on("skeleton-start-color"),vw=on("skeleton-end-color"),pse={[yw.variable]:"colors.gray.100",[vw.variable]:"colors.gray.400",_dark:{[yw.variable]:"colors.gray.800",[vw.variable]:"colors.gray.600"},background:yw.reference,borderColor:vw.reference,opacity:.7,borderRadius:"sm"},hse={baseStyle:pse},Ew=on("skip-link-bg"),mse={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[Ew.variable]:"colors.white",_dark:{[Ew.variable]:"colors.gray.700"},bg:Ew.reference}},gse={baseStyle:mse},{defineMultiStyleConfig:bse,definePartsStyle:tT}=_r(rne.keys),of=on("slider-thumb-size"),W0=on("slider-track-size"),Ju=on("slider-bg"),yse=t=>{const{orientation:e}=t;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...WN({orientation:e,vertical:{h:"100%",px:Vl(of.reference).divide(2).toString()},horizontal:{w:"100%",py:Vl(of.reference).divide(2).toString()}})}},vse=t=>({...WN({orientation:t.orientation,horizontal:{h:W0.reference},vertical:{w:W0.reference}}),overflow:"hidden",borderRadius:"sm",[Ju.variable]:"colors.gray.200",_dark:{[Ju.variable]:"colors.whiteAlpha.200"},_disabled:{[Ju.variable]:"colors.gray.300",_dark:{[Ju.variable]:"colors.whiteAlpha.300"}},bg:Ju.reference}),Ese=t=>{const{orientation:e}=t;return{...WN({orientation:e,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:of.reference,h:of.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},Sse=t=>{const{colorScheme:e}=t;return{width:"inherit",height:"inherit",[Ju.variable]:`colors.${e}.500`,_dark:{[Ju.variable]:`colors.${e}.200`},bg:Ju.reference}},_se=tT(t=>({container:yse(t),track:vse(t),thumb:Ese(t),filledTrack:Sse(t)})),Ase=tT({container:{[of.variable]:"sizes.4",[W0.variable]:"sizes.1"}}),Tse=tT({container:{[of.variable]:"sizes.3.5",[W0.variable]:"sizes.1"}}),xse=tT({container:{[of.variable]:"sizes.2.5",[W0.variable]:"sizes.0.5"}}),wse={lg:Ase,md:Tse,sm:xse},Cse=bse({baseStyle:_se,sizes:wse,defaultProps:{size:"md",colorScheme:"blue"}}),wd=Ei("spinner-size"),Rse={width:[wd.reference],height:[wd.reference]},Ise={xs:{[wd.variable]:"sizes.3"},sm:{[wd.variable]:"sizes.4"},md:{[wd.variable]:"sizes.6"},lg:{[wd.variable]:"sizes.8"},xl:{[wd.variable]:"sizes.12"}},Mse={baseStyle:Rse,sizes:Ise,defaultProps:{size:"md"}},{defineMultiStyleConfig:Nse,definePartsStyle:zV}=_r(ine.keys),Ose={fontWeight:"medium"},Dse={opacity:.8,marginBottom:"2"},Lse={verticalAlign:"baseline",fontWeight:"semibold"},kse={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},Pse=zV({container:{},label:Ose,helpText:Dse,number:Lse,icon:kse}),Bse={md:zV({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},Fse=Nse({baseStyle:Pse,sizes:Bse,defaultProps:{size:"md"}}),{defineMultiStyleConfig:Use,definePartsStyle:Wg}=_r(["stepper","step","title","description","indicator","separator","icon","number"]),Wl=on("stepper-indicator-size"),Vp=on("stepper-icon-size"),$p=on("stepper-title-font-size"),jg=on("stepper-description-font-size"),ag=on("stepper-accent-color"),zse=Wg(({colorScheme:t})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[ag.variable]:`colors.${t}.500`,_dark:{[ag.variable]:`colors.${t}.200`}},title:{fontSize:$p.reference,fontWeight:"medium"},description:{fontSize:jg.reference,color:"chakra-subtle-text"},number:{fontSize:$p.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:Vp.reference,height:Vp.reference},indicator:{flexShrink:0,borderRadius:"full",width:Wl.reference,height:Wl.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:ag.reference},"&[data-status=complete]":{bg:ag.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:ag.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${Wl.reference} - 8px)`,top:`calc(${Wl.reference} + 4px)`,insetStart:`calc(${Wl.reference} / 2 - 1px)`}}})),Hse=Use({baseStyle:zse,sizes:{xs:Wg({stepper:{[Wl.variable]:"sizes.4",[Vp.variable]:"sizes.3",[$p.variable]:"fontSizes.xs",[jg.variable]:"fontSizes.xs"}}),sm:Wg({stepper:{[Wl.variable]:"sizes.6",[Vp.variable]:"sizes.4",[$p.variable]:"fontSizes.sm",[jg.variable]:"fontSizes.xs"}}),md:Wg({stepper:{[Wl.variable]:"sizes.8",[Vp.variable]:"sizes.5",[$p.variable]:"fontSizes.md",[jg.variable]:"fontSizes.sm"}}),lg:Wg({stepper:{[Wl.variable]:"sizes.10",[Vp.variable]:"sizes.6",[$p.variable]:"fontSizes.lg",[jg.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Gse,definePartsStyle:yS}=_r(ane.keys),d0=Ei("switch-track-width"),jd=Ei("switch-track-height"),Sw=Ei("switch-track-diff"),Vse=$l.subtract(d0,jd),iI=Ei("switch-thumb-x"),sg=Ei("switch-bg"),$se=t=>{const{colorScheme:e}=t;return{borderRadius:"full",p:"0.5",width:[d0.reference],height:[jd.reference],transitionProperty:"common",transitionDuration:"fast",[sg.variable]:"colors.gray.300",_dark:{[sg.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[sg.variable]:`colors.${e}.500`,_dark:{[sg.variable]:`colors.${e}.200`}},bg:sg.reference}},Wse={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[jd.reference],height:[jd.reference],_checked:{transform:`translateX(${iI.reference})`}},jse=yS(t=>({container:{[Sw.variable]:Vse,[iI.variable]:Sw.reference,_rtl:{[iI.variable]:$l(Sw).negate().toString()}},track:$se(t),thumb:Wse})),Yse={sm:yS({container:{[d0.variable]:"1.375rem",[jd.variable]:"sizes.3"}}),md:yS({container:{[d0.variable]:"1.875rem",[jd.variable]:"sizes.4"}}),lg:yS({container:{[d0.variable]:"2.875rem",[jd.variable]:"sizes.6"}})},qse=Gse({baseStyle:jse,sizes:Yse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Xse,definePartsStyle:bh}=_r(sne.keys),Kse=bh({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),r_={"&[data-is-numeric=true]":{textAlign:"end"}},Zse=bh(t=>{const{colorScheme:e}=t;return{th:{color:sn("gray.600","gray.400")(t),borderBottom:"1px",borderColor:sn(`${e}.100`,`${e}.700`)(t),...r_},td:{borderBottom:"1px",borderColor:sn(`${e}.100`,`${e}.700`)(t),...r_},caption:{color:sn("gray.600","gray.100")(t)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Qse=bh(t=>{const{colorScheme:e}=t;return{th:{color:sn("gray.600","gray.400")(t),borderBottom:"1px",borderColor:sn(`${e}.100`,`${e}.700`)(t),...r_},td:{borderBottom:"1px",borderColor:sn(`${e}.100`,`${e}.700`)(t),...r_},caption:{color:sn("gray.600","gray.100")(t)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:sn(`${e}.100`,`${e}.700`)(t)},td:{background:sn(`${e}.100`,`${e}.700`)(t)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Jse={simple:Zse,striped:Qse,unstyled:{}},eoe={sm:bh({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:bh({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:bh({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},toe=Xse({baseStyle:Kse,variants:Jse,sizes:eoe,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Xa=on("tabs-color"),So=on("tabs-bg"),Iv=on("tabs-border-color"),{defineMultiStyleConfig:noe,definePartsStyle:al}=_r(one.keys),roe=t=>{const{orientation:e}=t;return{display:e==="vertical"?"flex":"block"}},ioe=t=>{const{isFitted:e}=t;return{flex:e?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},aoe=t=>{const{align:e="start",orientation:n}=t;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[e],flexDirection:n==="vertical"?"column":"row"}},soe={p:4},ooe=al(t=>({root:roe(t),tab:ioe(t),tablist:aoe(t),tabpanel:soe})),loe={sm:al({tab:{py:1,px:4,fontSize:"sm"}}),md:al({tab:{fontSize:"md",py:2,px:4}}),lg:al({tab:{fontSize:"lg",py:3,px:4}})},uoe=al(t=>{const{colorScheme:e,orientation:n}=t,r=n==="vertical",i=r?"borderStart":"borderBottom",a=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[a]:"-2px",_selected:{[Xa.variable]:`colors.${e}.600`,_dark:{[Xa.variable]:`colors.${e}.300`},borderColor:"currentColor"},_active:{[So.variable]:"colors.gray.200",_dark:{[So.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Xa.reference,bg:So.reference}}}),coe=al(t=>{const{colorScheme:e}=t;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[Iv.variable]:"transparent",_selected:{[Xa.variable]:`colors.${e}.600`,[Iv.variable]:"colors.white",_dark:{[Xa.variable]:`colors.${e}.300`,[Iv.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:Iv.reference},color:Xa.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),doe=al(t=>{const{colorScheme:e}=t;return{tab:{border:"1px solid",borderColor:"inherit",[So.variable]:"colors.gray.50",_dark:{[So.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[So.variable]:"colors.white",[Xa.variable]:`colors.${e}.600`,_dark:{[So.variable]:"colors.gray.800",[Xa.variable]:`colors.${e}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Xa.reference,bg:So.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),foe=al(t=>{const{colorScheme:e,theme:n}=t;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:Na(n,`${e}.700`),bg:Na(n,`${e}.100`)}}}}),poe=al(t=>{const{colorScheme:e}=t;return{tab:{borderRadius:"full",fontWeight:"semibold",[Xa.variable]:"colors.gray.600",_dark:{[Xa.variable]:"inherit"},_selected:{[Xa.variable]:"colors.white",[So.variable]:`colors.${e}.600`,_dark:{[Xa.variable]:"colors.gray.800",[So.variable]:`colors.${e}.300`}},color:Xa.reference,bg:So.reference}}}),hoe=al({}),moe={line:uoe,enclosed:coe,"enclosed-colored":doe,"soft-rounded":foe,"solid-rounded":poe,unstyled:hoe},goe=noe({baseStyle:ooe,sizes:loe,variants:moe,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:boe,definePartsStyle:Yd}=_r(lne.keys),l4=on("tag-bg"),u4=on("tag-color"),_w=on("tag-shadow"),vS=on("tag-min-height"),ES=on("tag-min-width"),SS=on("tag-font-size"),_S=on("tag-padding-inline"),yoe={fontWeight:"medium",lineHeight:1.2,outline:0,[u4.variable]:ti.color.reference,[l4.variable]:ti.bg.reference,[_w.variable]:ti.shadow.reference,color:u4.reference,bg:l4.reference,boxShadow:_w.reference,borderRadius:"md",minH:vS.reference,minW:ES.reference,fontSize:SS.reference,px:_S.reference,_focusVisible:{[_w.variable]:"shadows.outline"}},voe={lineHeight:1.2,overflow:"visible"},Eoe={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},Soe=Yd({container:yoe,label:voe,closeButton:Eoe}),_oe={sm:Yd({container:{[vS.variable]:"sizes.5",[ES.variable]:"sizes.5",[SS.variable]:"fontSizes.xs",[_S.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Yd({container:{[vS.variable]:"sizes.6",[ES.variable]:"sizes.6",[SS.variable]:"fontSizes.sm",[_S.variable]:"space.2"}}),lg:Yd({container:{[vS.variable]:"sizes.8",[ES.variable]:"sizes.8",[SS.variable]:"fontSizes.md",[_S.variable]:"space.3"}})},Aoe={subtle:Yd(t=>{var e;return{container:(e=l0.variants)==null?void 0:e.subtle(t)}}),solid:Yd(t=>{var e;return{container:(e=l0.variants)==null?void 0:e.solid(t)}}),outline:Yd(t=>{var e;return{container:(e=l0.variants)==null?void 0:e.outline(t)}})},Toe=boe({variants:Aoe,baseStyle:Soe,sizes:_oe,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}});var J9;const xoe={...(J9=nr.baseStyle)==null?void 0:J9.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"};var eV;const woe={outline:t=>{var e;return((e=nr.variants)==null?void 0:e.outline(t).field)??{}},flushed:t=>{var e;return((e=nr.variants)==null?void 0:e.flushed(t).field)??{}},filled:t=>{var e;return((e=nr.variants)==null?void 0:e.filled(t).field)??{}},unstyled:((eV=nr.variants)==null?void 0:eV.unstyled.field)??{}};var tV,nV,rV,iV;const Coe={xs:((tV=nr.sizes)==null?void 0:tV.xs.field)??{},sm:((nV=nr.sizes)==null?void 0:nV.sm.field)??{},md:((rV=nr.sizes)==null?void 0:rV.md.field)??{},lg:((iV=nr.sizes)==null?void 0:iV.lg.field)??{}},Roe={baseStyle:xoe,sizes:Coe,variants:woe,defaultProps:{size:"md",variant:"outline"}},Mv=Ei("tooltip-bg"),Aw=Ei("tooltip-fg"),Ioe=Ei("popper-arrow-bg"),Moe={bg:Mv.reference,color:Aw.reference,[Mv.variable]:"colors.gray.700",[Aw.variable]:"colors.whiteAlpha.900",_dark:{[Mv.variable]:"colors.gray.300",[Aw.variable]:"colors.gray.900"},[Ioe.variable]:Mv.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},Noe={baseStyle:Moe},Ooe={Accordion:bne,Alert:ere,Avatar:dre,Badge:l0,Breadcrumb:Sre,Button:Mre,Checkbox:Xu,CloseButton:Wre,Code:Xre,Container:Zre,Divider:nie,Drawer:pie,Editable:Eie,Form:wie,FormError:Oie,FormLabel:Lie,Heading:Bie,Input:nr,Kbd:Yie,Link:Xie,List:eae,Menu:dae,Modal:_ae,NumberInput:Nae,PinInput:kae,Popover:jae,Progress:ese,Radio:ase,Select:fse,Skeleton:hse,SkipLink:gse,Slider:Cse,Spinner:Mse,Stat:Fse,Switch:qse,Table:toe,Tabs:goe,Tag:Toe,Textarea:Roe,Tooltip:Noe,Card:kre,Stepper:Hse},Doe={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},Loe={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},koe={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"}},Poe={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Boe={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},Foe={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},Uoe={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},zoe={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Hoe={property:Foe,easing:Uoe,duration:zoe},Goe={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},Voe={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},$oe={breakpoints:Loe,zIndices:Goe,radii:Poe,blur:Voe,colors:koe,...BV,sizes:NV,shadows:Boe,space:MV,borders:Doe,transition:Hoe},Woe={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},joe={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},Yoe="ltr",qoe={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},Xoe={semanticTokens:Woe,direction:Yoe,...$oe,components:Ooe,styles:joe,config:qoe};var Koe=!1;function Zoe(t){if(t.sheet)return t.sheet;for(var e=0;e0?Gi(cm,--is):0,Ph--,ci===10&&(Ph=1,rT--),ci}function vs(){return ci=is<$V?Gi(cm,is++):0,Ph++,ci===10&&(Ph=1,rT++),ci}function sl(){return Gi(cm,is)}function AS(){return is}function Ub(t,e){return j0(cm,t,e)}function Y0(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function WV(t){return rT=Ph=1,$V=Qo(cm=t),is=0,[]}function jV(t){return cm="",t}function TS(t){return VV(Ub(is-1,sI(t===91?t+2:t===40?t+1:t)))}function ule(t){for(;(ci=sl())&&ci<33;)vs();return Y0(t)>2||Y0(ci)>3?"":" "}function cle(t,e){for(;--e&&vs()&&!(ci<48||ci>102||ci>57&&ci<65||ci>70&&ci<97););return Ub(t,AS()+(e<6&&sl()==32&&vs()==32))}function sI(t){for(;vs();)switch(ci){case t:return is;case 34:case 39:t!==34&&t!==39&&sI(ci);break;case 40:t===41&&sI(t);break;case 92:vs();break}return is}function dle(t,e){for(;vs()&&t+ci!==57;)if(t+ci===84&&sl()===47)break;return"/*"+Ub(e,is-1)+"*"+nT(t===47?t:vs())}function fle(t){for(;!Y0(sl());)vs();return Ub(t,is)}function ple(t){return jV(xS("",null,null,null,[""],t=WV(t),0,[0],t))}function xS(t,e,n,r,i,a,s,o,l){for(var u=0,c=0,d=s,f=0,m=0,g=0,y=1,v=1,b=1,E=0,S="",A=i,I=a,T=r,R=S;v;)switch(g=E,E=vs()){case 40:if(g!=108&&Gi(R,d-1)==58){aI(R+=tr(TS(E),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:R+=TS(E);break;case 9:case 10:case 13:case 32:R+=ule(g);break;case 92:R+=cle(AS()-1,7);continue;case 47:switch(sl()){case 42:case 47:Nv(hle(dle(vs(),AS()),e,n),l);break;default:R+="/"}break;case 123*y:o[u++]=Qo(R)*b;case 125*y:case 59:case 0:switch(E){case 0:case 125:v=0;case 59+c:b==-1&&(R=tr(R,/\f/g,"")),m>0&&Qo(R)-d&&Nv(m>32?d4(R+";",r,n,d-1):d4(tr(R," ","")+";",r,n,d-2),l);break;case 59:R+=";";default:if(Nv(T=c4(R,e,n,u,c,i,o,S,A=[],I=[],d),a),E===123)if(c===0)xS(R,e,T,T,A,a,d,o,I);else switch(f===99&&Gi(R,3)===110?100:f){case 100:case 108:case 109:case 115:xS(t,T,T,r&&Nv(c4(t,T,T,0,0,i,o,S,i,A=[],d),I),i,I,d,o,r?A:I);break;default:xS(R,T,T,T,[""],I,0,o,I)}}u=c=m=0,y=b=1,S=R="",d=s;break;case 58:d=1+Qo(R),m=g;default:if(y<1){if(E==123)--y;else if(E==125&&y++==0&&lle()==125)continue}switch(R+=nT(E),E*y){case 38:b=c>0?1:(R+="\f",-1);break;case 44:o[u++]=(Qo(R)-1)*b,b=1;break;case 64:sl()===45&&(R+=TS(vs())),f=sl(),c=d=Qo(S=R+=fle(AS())),E++;break;case 45:g===45&&Qo(R)==2&&(y=0)}}return a}function c4(t,e,n,r,i,a,s,o,l,u,c){for(var d=i-1,f=i===0?a:[""],m=ZN(f),g=0,y=0,v=0;g0?f[b]+" "+E:tr(E,/&\f/g,f[b])))&&(l[v++]=S);return iT(t,e,n,i===0?XN:o,l,u,c)}function hle(t,e,n){return iT(t,e,n,HV,nT(ole()),j0(t,2,-2),0)}function d4(t,e,n,r){return iT(t,e,n,KN,j0(t,0,r),j0(t,r+1,-1),r)}function yh(t,e){for(var n="",r=ZN(t),i=0;i6)switch(Gi(t,e+1)){case 109:if(Gi(t,e+4)!==45)break;case 102:return tr(t,/(.+:)(.+)-([^]+)/,"$1"+er+"$2-$3$1"+i_+(Gi(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~aI(t,"stretch")?qV(tr(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Gi(t,e+1)!==115)break;case 6444:switch(Gi(t,Qo(t)-3-(~aI(t,"!important")&&10))){case 107:return tr(t,":",":"+er)+t;case 101:return tr(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+er+(Gi(t,14)===45?"inline-":"")+"box$3$1"+er+"$2$3$1"+ua+"$2box$3")+t}break;case 5936:switch(Gi(t,e+11)){case 114:return er+t+ua+tr(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return er+t+ua+tr(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return er+t+ua+tr(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return er+t+ua+t+t}return t}var Ale=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case KN:e.return=qV(e.value,e.length);break;case GV:return yh([og(e,{value:tr(e.value,"@","@"+er)})],i);case XN:if(e.length)return sle(e.props,function(a){switch(ale(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return yh([og(e,{props:[tr(a,/:(read-\w+)/,":"+i_+"$1")]})],i);case"::placeholder":return yh([og(e,{props:[tr(a,/:(plac\w+)/,":"+er+"input-$1")]}),og(e,{props:[tr(a,/:(plac\w+)/,":"+i_+"$1")]}),og(e,{props:[tr(a,/:(plac\w+)/,ua+"input-$1")]})],i)}return""})}},Tle=[Ale],xle=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var v=y.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=e.stylisPlugins||Tle,a={},s,o=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(y){for(var v=y.getAttribute("data-emotion").split(" "),b=1;b({bg:sn("gray.100","whiteAlpha.300")(t)}),Zae=t=>({transitionProperty:"common",transitionDuration:"slow",...qae(t)}),Qae=$g(t=>({label:Xae,filledTrack:Zae(t),track:Kae(t)})),Jae={xs:$g({track:{h:"1"}}),sm:$g({track:{h:"2"}}),md:$g({track:{h:"3"}}),lg:$g({track:{h:"4"}})},ese=Yae({sizes:Jae,baseStyle:Qae,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:tse,definePartsStyle:b_}=Sr(tne.keys),nse=t=>{var n;const e=(n=Da(Xu.baseStyle,t))==null?void 0:n.control;return{...e,borderRadius:"full",_checked:{...e==null?void 0:e._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},rse=b_(t=>{var e,n;return{label:(e=Xu.baseStyle)==null?void 0:e.call(Xu,t).label,container:(n=Xu.baseStyle)==null?void 0:n.call(Xu,t).container,control:nse(t)}}),ise={md:b_({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:b_({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:b_({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},ase=tse({baseStyle:rse,sizes:ise,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:sse,definePartsStyle:ose}=Sr(nne.keys),Cv=on("select-bg");var $9;const lse={...($9=nr.baseStyle)==null?void 0:$9.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Cv.reference,[Cv.variable]:"colors.white",_dark:{[Cv.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Cv.reference}},use={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},cse=ose({field:lse,icon:use}),Rv={paddingInlineEnd:"8"};var W9,j9,Y9,q9,X9,K9,Z9,Q9;const dse={lg:{...(W9=nr.sizes)==null?void 0:W9.lg,field:{...(j9=nr.sizes)==null?void 0:j9.lg.field,...Rv}},md:{...(Y9=nr.sizes)==null?void 0:Y9.md,field:{...(q9=nr.sizes)==null?void 0:q9.md.field,...Rv}},sm:{...(X9=nr.sizes)==null?void 0:X9.sm,field:{...(K9=nr.sizes)==null?void 0:K9.sm.field,...Rv}},xs:{...(Z9=nr.sizes)==null?void 0:Z9.xs,field:{...(Q9=nr.sizes)==null?void 0:Q9.xs.field,...Rv},icon:{insetEnd:"1"}}},fse=sse({baseStyle:cse,sizes:dse,variants:nr.variants,defaultProps:nr.defaultProps}),yw=on("skeleton-start-color"),vw=on("skeleton-end-color"),pse={[yw.variable]:"colors.gray.100",[vw.variable]:"colors.gray.400",_dark:{[yw.variable]:"colors.gray.800",[vw.variable]:"colors.gray.600"},background:yw.reference,borderColor:vw.reference,opacity:.7,borderRadius:"sm"},hse={baseStyle:pse},Ew=on("skip-link-bg"),mse={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[Ew.variable]:"colors.white",_dark:{[Ew.variable]:"colors.gray.700"},bg:Ew.reference}},gse={baseStyle:mse},{defineMultiStyleConfig:bse,definePartsStyle:tx}=Sr(rne.keys),of=on("slider-thumb-size"),W0=on("slider-track-size"),Ju=on("slider-bg"),yse=t=>{const{orientation:e}=t;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...WN({orientation:e,vertical:{h:"100%",px:Vl(of.reference).divide(2).toString()},horizontal:{w:"100%",py:Vl(of.reference).divide(2).toString()}})}},vse=t=>({...WN({orientation:t.orientation,horizontal:{h:W0.reference},vertical:{w:W0.reference}}),overflow:"hidden",borderRadius:"sm",[Ju.variable]:"colors.gray.200",_dark:{[Ju.variable]:"colors.whiteAlpha.200"},_disabled:{[Ju.variable]:"colors.gray.300",_dark:{[Ju.variable]:"colors.whiteAlpha.300"}},bg:Ju.reference}),Ese=t=>{const{orientation:e}=t;return{...WN({orientation:e,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:of.reference,h:of.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},_se=t=>{const{colorScheme:e}=t;return{width:"inherit",height:"inherit",[Ju.variable]:`colors.${e}.500`,_dark:{[Ju.variable]:`colors.${e}.200`},bg:Ju.reference}},Sse=tx(t=>({container:yse(t),track:vse(t),thumb:Ese(t),filledTrack:_se(t)})),Ase=tx({container:{[of.variable]:"sizes.4",[W0.variable]:"sizes.1"}}),xse=tx({container:{[of.variable]:"sizes.3.5",[W0.variable]:"sizes.1"}}),Tse=tx({container:{[of.variable]:"sizes.2.5",[W0.variable]:"sizes.0.5"}}),wse={lg:Ase,md:xse,sm:Tse},Cse=bse({baseStyle:Sse,sizes:wse,defaultProps:{size:"md",colorScheme:"blue"}}),wd=Ei("spinner-size"),Rse={width:[wd.reference],height:[wd.reference]},Ise={xs:{[wd.variable]:"sizes.3"},sm:{[wd.variable]:"sizes.4"},md:{[wd.variable]:"sizes.6"},lg:{[wd.variable]:"sizes.8"},xl:{[wd.variable]:"sizes.12"}},Mse={baseStyle:Rse,sizes:Ise,defaultProps:{size:"md"}},{defineMultiStyleConfig:Nse,definePartsStyle:zV}=Sr(ine.keys),Ose={fontWeight:"medium"},Dse={opacity:.8,marginBottom:"2"},Lse={verticalAlign:"baseline",fontWeight:"semibold"},kse={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},Pse=zV({container:{},label:Ose,helpText:Dse,number:Lse,icon:kse}),Bse={md:zV({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},Fse=Nse({baseStyle:Pse,sizes:Bse,defaultProps:{size:"md"}}),{defineMultiStyleConfig:Use,definePartsStyle:Wg}=Sr(["stepper","step","title","description","indicator","separator","icon","number"]),Wl=on("stepper-indicator-size"),Vp=on("stepper-icon-size"),$p=on("stepper-title-font-size"),jg=on("stepper-description-font-size"),ag=on("stepper-accent-color"),zse=Wg(({colorScheme:t})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[ag.variable]:`colors.${t}.500`,_dark:{[ag.variable]:`colors.${t}.200`}},title:{fontSize:$p.reference,fontWeight:"medium"},description:{fontSize:jg.reference,color:"chakra-subtle-text"},number:{fontSize:$p.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:Vp.reference,height:Vp.reference},indicator:{flexShrink:0,borderRadius:"full",width:Wl.reference,height:Wl.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:ag.reference},"&[data-status=complete]":{bg:ag.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:ag.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${Wl.reference} - 8px)`,top:`calc(${Wl.reference} + 4px)`,insetStart:`calc(${Wl.reference} / 2 - 1px)`}}})),Hse=Use({baseStyle:zse,sizes:{xs:Wg({stepper:{[Wl.variable]:"sizes.4",[Vp.variable]:"sizes.3",[$p.variable]:"fontSizes.xs",[jg.variable]:"fontSizes.xs"}}),sm:Wg({stepper:{[Wl.variable]:"sizes.6",[Vp.variable]:"sizes.4",[$p.variable]:"fontSizes.sm",[jg.variable]:"fontSizes.xs"}}),md:Wg({stepper:{[Wl.variable]:"sizes.8",[Vp.variable]:"sizes.5",[$p.variable]:"fontSizes.md",[jg.variable]:"fontSizes.sm"}}),lg:Wg({stepper:{[Wl.variable]:"sizes.10",[Vp.variable]:"sizes.6",[$p.variable]:"fontSizes.lg",[jg.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Gse,definePartsStyle:y_}=Sr(ane.keys),d0=Ei("switch-track-width"),jd=Ei("switch-track-height"),_w=Ei("switch-track-diff"),Vse=$l.subtract(d0,jd),iI=Ei("switch-thumb-x"),sg=Ei("switch-bg"),$se=t=>{const{colorScheme:e}=t;return{borderRadius:"full",p:"0.5",width:[d0.reference],height:[jd.reference],transitionProperty:"common",transitionDuration:"fast",[sg.variable]:"colors.gray.300",_dark:{[sg.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[sg.variable]:`colors.${e}.500`,_dark:{[sg.variable]:`colors.${e}.200`}},bg:sg.reference}},Wse={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[jd.reference],height:[jd.reference],_checked:{transform:`translateX(${iI.reference})`}},jse=y_(t=>({container:{[_w.variable]:Vse,[iI.variable]:_w.reference,_rtl:{[iI.variable]:$l(_w).negate().toString()}},track:$se(t),thumb:Wse})),Yse={sm:y_({container:{[d0.variable]:"1.375rem",[jd.variable]:"sizes.3"}}),md:y_({container:{[d0.variable]:"1.875rem",[jd.variable]:"sizes.4"}}),lg:y_({container:{[d0.variable]:"2.875rem",[jd.variable]:"sizes.6"}})},qse=Gse({baseStyle:jse,sizes:Yse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Xse,definePartsStyle:bh}=Sr(sne.keys),Kse=bh({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),rS={"&[data-is-numeric=true]":{textAlign:"end"}},Zse=bh(t=>{const{colorScheme:e}=t;return{th:{color:sn("gray.600","gray.400")(t),borderBottom:"1px",borderColor:sn(`${e}.100`,`${e}.700`)(t),...rS},td:{borderBottom:"1px",borderColor:sn(`${e}.100`,`${e}.700`)(t),...rS},caption:{color:sn("gray.600","gray.100")(t)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Qse=bh(t=>{const{colorScheme:e}=t;return{th:{color:sn("gray.600","gray.400")(t),borderBottom:"1px",borderColor:sn(`${e}.100`,`${e}.700`)(t),...rS},td:{borderBottom:"1px",borderColor:sn(`${e}.100`,`${e}.700`)(t),...rS},caption:{color:sn("gray.600","gray.100")(t)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:sn(`${e}.100`,`${e}.700`)(t)},td:{background:sn(`${e}.100`,`${e}.700`)(t)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Jse={simple:Zse,striped:Qse,unstyled:{}},eoe={sm:bh({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:bh({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:bh({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},toe=Xse({baseStyle:Kse,variants:Jse,sizes:eoe,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Xa=on("tabs-color"),_o=on("tabs-bg"),Iv=on("tabs-border-color"),{defineMultiStyleConfig:noe,definePartsStyle:al}=Sr(one.keys),roe=t=>{const{orientation:e}=t;return{display:e==="vertical"?"flex":"block"}},ioe=t=>{const{isFitted:e}=t;return{flex:e?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},aoe=t=>{const{align:e="start",orientation:n}=t;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[e],flexDirection:n==="vertical"?"column":"row"}},soe={p:4},ooe=al(t=>({root:roe(t),tab:ioe(t),tablist:aoe(t),tabpanel:soe})),loe={sm:al({tab:{py:1,px:4,fontSize:"sm"}}),md:al({tab:{fontSize:"md",py:2,px:4}}),lg:al({tab:{fontSize:"lg",py:3,px:4}})},uoe=al(t=>{const{colorScheme:e,orientation:n}=t,r=n==="vertical",i=r?"borderStart":"borderBottom",a=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[a]:"-2px",_selected:{[Xa.variable]:`colors.${e}.600`,_dark:{[Xa.variable]:`colors.${e}.300`},borderColor:"currentColor"},_active:{[_o.variable]:"colors.gray.200",_dark:{[_o.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Xa.reference,bg:_o.reference}}}),coe=al(t=>{const{colorScheme:e}=t;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[Iv.variable]:"transparent",_selected:{[Xa.variable]:`colors.${e}.600`,[Iv.variable]:"colors.white",_dark:{[Xa.variable]:`colors.${e}.300`,[Iv.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:Iv.reference},color:Xa.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),doe=al(t=>{const{colorScheme:e}=t;return{tab:{border:"1px solid",borderColor:"inherit",[_o.variable]:"colors.gray.50",_dark:{[_o.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[_o.variable]:"colors.white",[Xa.variable]:`colors.${e}.600`,_dark:{[_o.variable]:"colors.gray.800",[Xa.variable]:`colors.${e}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Xa.reference,bg:_o.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),foe=al(t=>{const{colorScheme:e,theme:n}=t;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:Na(n,`${e}.700`),bg:Na(n,`${e}.100`)}}}}),poe=al(t=>{const{colorScheme:e}=t;return{tab:{borderRadius:"full",fontWeight:"semibold",[Xa.variable]:"colors.gray.600",_dark:{[Xa.variable]:"inherit"},_selected:{[Xa.variable]:"colors.white",[_o.variable]:`colors.${e}.600`,_dark:{[Xa.variable]:"colors.gray.800",[_o.variable]:`colors.${e}.300`}},color:Xa.reference,bg:_o.reference}}}),hoe=al({}),moe={line:uoe,enclosed:coe,"enclosed-colored":doe,"soft-rounded":foe,"solid-rounded":poe,unstyled:hoe},goe=noe({baseStyle:ooe,sizes:loe,variants:moe,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:boe,definePartsStyle:Yd}=Sr(lne.keys),l4=on("tag-bg"),u4=on("tag-color"),Sw=on("tag-shadow"),v_=on("tag-min-height"),E_=on("tag-min-width"),__=on("tag-font-size"),S_=on("tag-padding-inline"),yoe={fontWeight:"medium",lineHeight:1.2,outline:0,[u4.variable]:ti.color.reference,[l4.variable]:ti.bg.reference,[Sw.variable]:ti.shadow.reference,color:u4.reference,bg:l4.reference,boxShadow:Sw.reference,borderRadius:"md",minH:v_.reference,minW:E_.reference,fontSize:__.reference,px:S_.reference,_focusVisible:{[Sw.variable]:"shadows.outline"}},voe={lineHeight:1.2,overflow:"visible"},Eoe={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},_oe=Yd({container:yoe,label:voe,closeButton:Eoe}),Soe={sm:Yd({container:{[v_.variable]:"sizes.5",[E_.variable]:"sizes.5",[__.variable]:"fontSizes.xs",[S_.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Yd({container:{[v_.variable]:"sizes.6",[E_.variable]:"sizes.6",[__.variable]:"fontSizes.sm",[S_.variable]:"space.2"}}),lg:Yd({container:{[v_.variable]:"sizes.8",[E_.variable]:"sizes.8",[__.variable]:"fontSizes.md",[S_.variable]:"space.3"}})},Aoe={subtle:Yd(t=>{var e;return{container:(e=l0.variants)==null?void 0:e.subtle(t)}}),solid:Yd(t=>{var e;return{container:(e=l0.variants)==null?void 0:e.solid(t)}}),outline:Yd(t=>{var e;return{container:(e=l0.variants)==null?void 0:e.outline(t)}})},xoe=boe({variants:Aoe,baseStyle:_oe,sizes:Soe,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}});var J9;const Toe={...(J9=nr.baseStyle)==null?void 0:J9.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"};var eV;const woe={outline:t=>{var e;return((e=nr.variants)==null?void 0:e.outline(t).field)??{}},flushed:t=>{var e;return((e=nr.variants)==null?void 0:e.flushed(t).field)??{}},filled:t=>{var e;return((e=nr.variants)==null?void 0:e.filled(t).field)??{}},unstyled:((eV=nr.variants)==null?void 0:eV.unstyled.field)??{}};var tV,nV,rV,iV;const Coe={xs:((tV=nr.sizes)==null?void 0:tV.xs.field)??{},sm:((nV=nr.sizes)==null?void 0:nV.sm.field)??{},md:((rV=nr.sizes)==null?void 0:rV.md.field)??{},lg:((iV=nr.sizes)==null?void 0:iV.lg.field)??{}},Roe={baseStyle:Toe,sizes:Coe,variants:woe,defaultProps:{size:"md",variant:"outline"}},Mv=Ei("tooltip-bg"),Aw=Ei("tooltip-fg"),Ioe=Ei("popper-arrow-bg"),Moe={bg:Mv.reference,color:Aw.reference,[Mv.variable]:"colors.gray.700",[Aw.variable]:"colors.whiteAlpha.900",_dark:{[Mv.variable]:"colors.gray.300",[Aw.variable]:"colors.gray.900"},[Ioe.variable]:Mv.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},Noe={baseStyle:Moe},Ooe={Accordion:bne,Alert:ere,Avatar:dre,Badge:l0,Breadcrumb:_re,Button:Mre,Checkbox:Xu,CloseButton:Wre,Code:Xre,Container:Zre,Divider:nie,Drawer:pie,Editable:Eie,Form:wie,FormError:Oie,FormLabel:Lie,Heading:Bie,Input:nr,Kbd:Yie,Link:Xie,List:eae,Menu:dae,Modal:Sae,NumberInput:Nae,PinInput:kae,Popover:jae,Progress:ese,Radio:ase,Select:fse,Skeleton:hse,SkipLink:gse,Slider:Cse,Spinner:Mse,Stat:Fse,Switch:qse,Table:toe,Tabs:goe,Tag:xoe,Textarea:Roe,Tooltip:Noe,Card:kre,Stepper:Hse},Doe={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},Loe={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},koe={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"}},Poe={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Boe={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},Foe={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},Uoe={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},zoe={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Hoe={property:Foe,easing:Uoe,duration:zoe},Goe={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},Voe={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},$oe={breakpoints:Loe,zIndices:Goe,radii:Poe,blur:Voe,colors:koe,...BV,sizes:NV,shadows:Boe,space:MV,borders:Doe,transition:Hoe},Woe={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},joe={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},Yoe="ltr",qoe={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},Xoe={semanticTokens:Woe,direction:Yoe,...$oe,components:Ooe,styles:joe,config:qoe};var Koe=!1;function Zoe(t){if(t.sheet)return t.sheet;for(var e=0;e0?Gi(cm,--is):0,Ph--,ci===10&&(Ph=1,rx--),ci}function vs(){return ci=is<$V?Gi(cm,is++):0,Ph++,ci===10&&(Ph=1,rx++),ci}function sl(){return Gi(cm,is)}function A_(){return is}function Ub(t,e){return j0(cm,t,e)}function Y0(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function WV(t){return rx=Ph=1,$V=Qo(cm=t),is=0,[]}function jV(t){return cm="",t}function x_(t){return VV(Ub(is-1,sI(t===91?t+2:t===40?t+1:t)))}function ule(t){for(;(ci=sl())&&ci<33;)vs();return Y0(t)>2||Y0(ci)>3?"":" "}function cle(t,e){for(;--e&&vs()&&!(ci<48||ci>102||ci>57&&ci<65||ci>70&&ci<97););return Ub(t,A_()+(e<6&&sl()==32&&vs()==32))}function sI(t){for(;vs();)switch(ci){case t:return is;case 34:case 39:t!==34&&t!==39&&sI(ci);break;case 40:t===41&&sI(t);break;case 92:vs();break}return is}function dle(t,e){for(;vs()&&t+ci!==57;)if(t+ci===84&&sl()===47)break;return"/*"+Ub(e,is-1)+"*"+nx(t===47?t:vs())}function fle(t){for(;!Y0(sl());)vs();return Ub(t,is)}function ple(t){return jV(T_("",null,null,null,[""],t=WV(t),0,[0],t))}function T_(t,e,n,r,i,a,s,o,l){for(var u=0,c=0,d=s,f=0,m=0,g=0,y=1,v=1,b=1,E=0,_="",A=i,I=a,x=r,R=_;v;)switch(g=E,E=vs()){case 40:if(g!=108&&Gi(R,d-1)==58){aI(R+=tr(x_(E),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:R+=x_(E);break;case 9:case 10:case 13:case 32:R+=ule(g);break;case 92:R+=cle(A_()-1,7);continue;case 47:switch(sl()){case 42:case 47:Nv(hle(dle(vs(),A_()),e,n),l);break;default:R+="/"}break;case 123*y:o[u++]=Qo(R)*b;case 125*y:case 59:case 0:switch(E){case 0:case 125:v=0;case 59+c:b==-1&&(R=tr(R,/\f/g,"")),m>0&&Qo(R)-d&&Nv(m>32?d4(R+";",r,n,d-1):d4(tr(R," ","")+";",r,n,d-2),l);break;case 59:R+=";";default:if(Nv(x=c4(R,e,n,u,c,i,o,_,A=[],I=[],d),a),E===123)if(c===0)T_(R,e,x,x,A,a,d,o,I);else switch(f===99&&Gi(R,3)===110?100:f){case 100:case 108:case 109:case 115:T_(t,x,x,r&&Nv(c4(t,x,x,0,0,i,o,_,i,A=[],d),I),i,I,d,o,r?A:I);break;default:T_(R,x,x,x,[""],I,0,o,I)}}u=c=m=0,y=b=1,_=R="",d=s;break;case 58:d=1+Qo(R),m=g;default:if(y<1){if(E==123)--y;else if(E==125&&y++==0&&lle()==125)continue}switch(R+=nx(E),E*y){case 38:b=c>0?1:(R+="\f",-1);break;case 44:o[u++]=(Qo(R)-1)*b,b=1;break;case 64:sl()===45&&(R+=x_(vs())),f=sl(),c=d=Qo(_=R+=fle(A_())),E++;break;case 45:g===45&&Qo(R)==2&&(y=0)}}return a}function c4(t,e,n,r,i,a,s,o,l,u,c){for(var d=i-1,f=i===0?a:[""],m=ZN(f),g=0,y=0,v=0;g0?f[b]+" "+E:tr(E,/&\f/g,f[b])))&&(l[v++]=_);return ix(t,e,n,i===0?XN:o,l,u,c)}function hle(t,e,n){return ix(t,e,n,HV,nx(ole()),j0(t,2,-2),0)}function d4(t,e,n,r){return ix(t,e,n,KN,j0(t,0,r),j0(t,r+1,-1),r)}function yh(t,e){for(var n="",r=ZN(t),i=0;i6)switch(Gi(t,e+1)){case 109:if(Gi(t,e+4)!==45)break;case 102:return tr(t,/(.+:)(.+)-([^]+)/,"$1"+er+"$2-$3$1"+iS+(Gi(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~aI(t,"stretch")?qV(tr(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Gi(t,e+1)!==115)break;case 6444:switch(Gi(t,Qo(t)-3-(~aI(t,"!important")&&10))){case 107:return tr(t,":",":"+er)+t;case 101:return tr(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+er+(Gi(t,14)===45?"inline-":"")+"box$3$1"+er+"$2$3$1"+ua+"$2box$3")+t}break;case 5936:switch(Gi(t,e+11)){case 114:return er+t+ua+tr(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return er+t+ua+tr(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return er+t+ua+tr(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return er+t+ua+t+t}return t}var Ale=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case KN:e.return=qV(e.value,e.length);break;case GV:return yh([og(e,{value:tr(e.value,"@","@"+er)})],i);case XN:if(e.length)return sle(e.props,function(a){switch(ale(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return yh([og(e,{props:[tr(a,/:(read-\w+)/,":"+iS+"$1")]})],i);case"::placeholder":return yh([og(e,{props:[tr(a,/:(plac\w+)/,":"+er+"input-$1")]}),og(e,{props:[tr(a,/:(plac\w+)/,":"+iS+"$1")]}),og(e,{props:[tr(a,/:(plac\w+)/,ua+"input-$1")]})],i)}return""})}},xle=[Ale],Tle=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var v=y.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=e.stylisPlugins||xle,a={},s,o=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(y){for(var v=y.getAttribute("data-emotion").split(" "),b=1;b=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.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 Ble={animationIterationCount:1,aspectRatio: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,scale: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},Fle=!1,Ule=/[A-Z]|^ms/g,zle=/_EMO_([^_]+?)_([^]*?)_EMO_/g,t$=function(e){return e.charCodeAt(1)===45},h4=function(e){return e!=null&&typeof e!="boolean"},Tw=YV(function(t){return t$(t)?t:t.replace(Ule,"-$&").toLowerCase()}),m4=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(zle,function(r,i,a){return Jo={name:i,styles:a,next:Jo},i})}return Ble[e]!==1&&!t$(e)&&typeof n=="number"&&n!==0?n+"px":n},Hle="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function q0(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Jo={name:i.name,styles:i.styles,next:Jo},i.name;var a=n;if(a.styles!==void 0){var s=a.next;if(s!==void 0)for(;s!==void 0;)Jo={name:s.name,styles:s.styles,next:Jo},s=s.next;var o=a.styles+";";return o}return Gle(t,e,n)}case"function":{if(t!==void 0){var l=Jo,u=n(t);return Jo=l,q0(t,e,u)}break}}var c=n;if(e==null)return c;var d=e[c];return d!==void 0?d:c}function Gle(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i{const a=e?r.preventTransition():void 0;document.documentElement.dataset.theme=i,document.documentElement.style.colorScheme=i,a==null||a()},setClassName(i){document.body.classList.add(i?Ov.dark:Ov.light),document.body.classList.remove(i?Ov.light:Ov.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(i){return r.query().matches??i==="dark"?"dark":"light"},addListener(i){const a=r.query(),s=o=>{i(o.matches?"dark":"light")};return typeof a.addListener=="function"?a.addListener(s):a.addEventListener("change",s),()=>{typeof a.removeListener=="function"?a.removeListener(s):a.removeEventListener("change",s)}},preventTransition(){const i=document.createElement("style");return i.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),n!==void 0&&(i.nonce=n),document.head.appendChild(i),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(i)})})}}};return r}const Zle="chakra-ui-color-mode";function Qle(t){return{ssr:!1,type:"localStorage",get(e){if(!(globalThis!=null&&globalThis.document))return e;let n;try{n=localStorage.getItem(t)||e}catch{}return n||e},set(e){try{localStorage.setItem(t,e)}catch{}}}}const Jle=Qle(Zle),y4=()=>{},eue=dee()?w.useLayoutEffect:w.useEffect;function v4(t,e){return t.type==="cookie"&&t.ssr?t.get(e):e}const i$=n2(function(e,n){const{value:r,children:i,options:{useSystemColorMode:a,initialColorMode:s,disableTransitionOnChange:o}={},colorModeManager:l=Jle}=e,u=s==="dark"?"dark":"light",[c,d]=w.useState(()=>v4(l,u)),[f,m]=w.useState(()=>v4(l)),{getSystemTheme:g,setClassName:y,setDataset:v,addListener:b}=w.useMemo(()=>Kle({preventTransition:o,nonce:n==null?void 0:n.nonce}),[o,n==null?void 0:n.nonce]),E=s==="system"&&!c?f:c,S=w.useCallback(T=>{const R=T==="system"?g():T;d(R),y(R==="dark"),v(R),l.set(R)},[l,g,y,v]);eue(()=>{s==="system"&&m(g())},[]),w.useEffect(()=>{const T=l.get();if(T){S(T);return}if(s==="system"){S("system");return}S(u)},[l,u,s,S]);const A=w.useCallback(()=>{S(E==="dark"?"light":"dark")},[E,S]);w.useEffect(()=>{if(a)return b(S)},[a,b,S]);const I=w.useMemo(()=>({colorMode:r??E,toggleColorMode:r?y4:A,setColorMode:r?y4:S,forced:r!==void 0}),[E,A,S,r]);return $.jsx(r2.Provider,{value:I,children:i})});i$.displayName="ColorModeProvider";const a$=String.raw,s$=a$` + */var Pi=typeof Symbol=="function"&&Symbol.for,QN=Pi?Symbol.for("react.element"):60103,JN=Pi?Symbol.for("react.portal"):60106,ax=Pi?Symbol.for("react.fragment"):60107,sx=Pi?Symbol.for("react.strict_mode"):60108,ox=Pi?Symbol.for("react.profiler"):60114,lx=Pi?Symbol.for("react.provider"):60109,ux=Pi?Symbol.for("react.context"):60110,e2=Pi?Symbol.for("react.async_mode"):60111,cx=Pi?Symbol.for("react.concurrent_mode"):60111,dx=Pi?Symbol.for("react.forward_ref"):60112,fx=Pi?Symbol.for("react.suspense"):60113,wle=Pi?Symbol.for("react.suspense_list"):60120,px=Pi?Symbol.for("react.memo"):60115,hx=Pi?Symbol.for("react.lazy"):60116,Cle=Pi?Symbol.for("react.block"):60121,Rle=Pi?Symbol.for("react.fundamental"):60117,Ile=Pi?Symbol.for("react.responder"):60118,Mle=Pi?Symbol.for("react.scope"):60119;function Ts(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case QN:switch(t=t.type,t){case e2:case cx:case ax:case ox:case sx:case fx:return t;default:switch(t=t&&t.$$typeof,t){case ux:case dx:case hx:case px:case lx:return t;default:return e}}case JN:return e}}}function KV(t){return Ts(t)===cx}lr.AsyncMode=e2;lr.ConcurrentMode=cx;lr.ContextConsumer=ux;lr.ContextProvider=lx;lr.Element=QN;lr.ForwardRef=dx;lr.Fragment=ax;lr.Lazy=hx;lr.Memo=px;lr.Portal=JN;lr.Profiler=ox;lr.StrictMode=sx;lr.Suspense=fx;lr.isAsyncMode=function(t){return KV(t)||Ts(t)===e2};lr.isConcurrentMode=KV;lr.isContextConsumer=function(t){return Ts(t)===ux};lr.isContextProvider=function(t){return Ts(t)===lx};lr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===QN};lr.isForwardRef=function(t){return Ts(t)===dx};lr.isFragment=function(t){return Ts(t)===ax};lr.isLazy=function(t){return Ts(t)===hx};lr.isMemo=function(t){return Ts(t)===px};lr.isPortal=function(t){return Ts(t)===JN};lr.isProfiler=function(t){return Ts(t)===ox};lr.isStrictMode=function(t){return Ts(t)===sx};lr.isSuspense=function(t){return Ts(t)===fx};lr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===ax||t===cx||t===ox||t===sx||t===fx||t===wle||typeof t=="object"&&t!==null&&(t.$$typeof===hx||t.$$typeof===px||t.$$typeof===lx||t.$$typeof===ux||t.$$typeof===dx||t.$$typeof===Rle||t.$$typeof===Ile||t.$$typeof===Mle||t.$$typeof===Cle)};lr.typeOf=Ts;XV.exports=lr;var Nle=XV.exports,ZV=Nle,Ole={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Dle={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},QV={};QV[ZV.ForwardRef]=Ole;QV[ZV.Memo]=Dle;var Lle=!0;function kle(t,e,n){var r="";return n.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):i&&(r+=i+" ")}),r}var JV=function(e,n,r){var i=e.key+"-"+n.name;(r===!1||Lle===!1)&&e.registered[i]===void 0&&(e.registered[i]=n.styles)},e$=function(e,n,r){JV(e,n,r);var i=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var a=n;do e.insert(n===a?"."+i:"",a,e.sheet,!0),a=a.next;while(a!==void 0)}};function Ple(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.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 Ble={animationIterationCount:1,aspectRatio: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,scale: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},Fle=!1,Ule=/[A-Z]|^ms/g,zle=/_EMO_([^_]+?)_([^]*?)_EMO_/g,t$=function(e){return e.charCodeAt(1)===45},h4=function(e){return e!=null&&typeof e!="boolean"},xw=YV(function(t){return t$(t)?t:t.replace(Ule,"-$&").toLowerCase()}),m4=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(zle,function(r,i,a){return Jo={name:i,styles:a,next:Jo},i})}return Ble[e]!==1&&!t$(e)&&typeof n=="number"&&n!==0?n+"px":n},Hle="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function q0(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Jo={name:i.name,styles:i.styles,next:Jo},i.name;var a=n;if(a.styles!==void 0){var s=a.next;if(s!==void 0)for(;s!==void 0;)Jo={name:s.name,styles:s.styles,next:Jo},s=s.next;var o=a.styles+";";return o}return Gle(t,e,n)}case"function":{if(t!==void 0){var l=Jo,u=n(t);return Jo=l,q0(t,e,u)}break}}var c=n;if(e==null)return c;var d=e[c];return d!==void 0?d:c}function Gle(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i{const a=e?r.preventTransition():void 0;document.documentElement.dataset.theme=i,document.documentElement.style.colorScheme=i,a==null||a()},setClassName(i){document.body.classList.add(i?Ov.dark:Ov.light),document.body.classList.remove(i?Ov.light:Ov.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(i){return r.query().matches??i==="dark"?"dark":"light"},addListener(i){const a=r.query(),s=o=>{i(o.matches?"dark":"light")};return typeof a.addListener=="function"?a.addListener(s):a.addEventListener("change",s),()=>{typeof a.removeListener=="function"?a.removeListener(s):a.removeEventListener("change",s)}},preventTransition(){const i=document.createElement("style");return i.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),n!==void 0&&(i.nonce=n),document.head.appendChild(i),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(i)})})}}};return r}const Zle="chakra-ui-color-mode";function Qle(t){return{ssr:!1,type:"localStorage",get(e){if(!(globalThis!=null&&globalThis.document))return e;let n;try{n=localStorage.getItem(t)||e}catch{}return n||e},set(e){try{localStorage.setItem(t,e)}catch{}}}}const Jle=Qle(Zle),y4=()=>{},eue=dee()?w.useLayoutEffect:w.useEffect;function v4(t,e){return t.type==="cookie"&&t.ssr?t.get(e):e}const i$=n2(function(e,n){const{value:r,children:i,options:{useSystemColorMode:a,initialColorMode:s,disableTransitionOnChange:o}={},colorModeManager:l=Jle}=e,u=s==="dark"?"dark":"light",[c,d]=w.useState(()=>v4(l,u)),[f,m]=w.useState(()=>v4(l)),{getSystemTheme:g,setClassName:y,setDataset:v,addListener:b}=w.useMemo(()=>Kle({preventTransition:o,nonce:n==null?void 0:n.nonce}),[o,n==null?void 0:n.nonce]),E=s==="system"&&!c?f:c,_=w.useCallback(x=>{const R=x==="system"?g():x;d(R),y(R==="dark"),v(R),l.set(R)},[l,g,y,v]);eue(()=>{s==="system"&&m(g())},[]),w.useEffect(()=>{const x=l.get();if(x){_(x);return}if(s==="system"){_("system");return}_(u)},[l,u,s,_]);const A=w.useCallback(()=>{_(E==="dark"?"light":"dark")},[E,_]);w.useEffect(()=>{if(a)return b(_)},[a,b,_]);const I=w.useMemo(()=>({colorMode:r??E,toggleColorMode:r?y4:A,setColorMode:r?y4:_,forced:r!==void 0}),[E,A,_,r]);return $.jsx(r2.Provider,{value:I,children:i})});i$.displayName="ColorModeProvider";const a$=String.raw,s$=a$` :root, :host { --chakra-vh: 100vh; @@ -61,7 +61,7 @@ function aV(t,e){for(var n=0;n$.jsx(mT,{styles:s$}),nue=({scope:t=""})=>$.jsx(mT,{styles:a$` +`,tue=()=>$.jsx(mx,{styles:s$}),nue=({scope:t=""})=>$.jsx(mx,{styles:a$` html { line-height: 1.5; -webkit-text-size-adjust: 100%; @@ -314,7 +314,7 @@ function aV(t,e){for(var n=0;nFte(n),[n]);return $.jsxs(Yle,{theme:i,children:[$.jsx(iue,{root:e}),r]})}function iue({root:t=":host, :root"}){const e=[t,"[data-theme]"].join(",");return $.jsx(mT,{styles:n=>({[e]:n.__cssVars})})}Mo({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function aue(){const{colorMode:t}=i2();return $.jsx(mT,{styles:e=>{const n=vV(e,"styles.global"),r=Zs(n,{theme:e,colorMode:t});return r?wV(r)(e):void 0}})}const[sue,oue]=Mo({strict:!1,name:"PortalManagerContext"});function o$(t){const{children:e,zIndex:n}=t;return $.jsx(sue,{value:{zIndex:n},children:e})}o$.displayName="PortalManager";const a2=w.createContext({getDocument(){return document},getWindow(){return window}});a2.displayName="EnvironmentContext";function lue({defer:t}={}){const[,e]=w.useReducer(n=>n+1,0);return e_(()=>{t&&e()},[t]),w.useContext(a2)}function l$(t){const{children:e,environment:n,disabled:r}=t,i=w.useRef(null),a=w.useMemo(()=>n||{getDocument:()=>{var o;return((o=i.current)==null?void 0:o.ownerDocument)??document},getWindow:()=>{var o;return((o=i.current)==null?void 0:o.ownerDocument.defaultView)??window}},[n]),s=!r||!n;return $.jsxs(a2.Provider,{value:a,children:[e,s&&$.jsx("span",{id:"__chakra_env",hidden:!0,ref:i})]})}l$.displayName="EnvironmentProvider";const uue=t=>{const{children:e,colorModeManager:n,portalZIndex:r,resetScope:i,resetCSS:a=!0,theme:s={},environment:o,cssVarsRoot:l,disableEnvironment:u,disableGlobalStyle:c}=t,d=$.jsx(l$,{environment:o,disabled:u,children:e});return $.jsx(rue,{theme:s,cssVarsRoot:l,children:$.jsxs(i$,{colorModeManager:n,options:s.config,children:[a?$.jsx(nue,{scope:i}):$.jsx(tue,{}),!c&&$.jsx(aue,{}),r?$.jsx(o$,{zIndex:r,children:d}):d]})})};function cue(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...r)=>t(...r);return new Proxy(n,{get:(r,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}function gT(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const oI=t=>Array.isArray(t);function u$(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function s2(t,e,n,r){if(typeof e=="function"){const[i,a]=E4(r);e=e(n!==void 0?n:t.custom,i,a)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,a]=E4(r);e=e(n!==void 0?n:t.custom,i,a)}return e}function bT(t,e,n){const r=t.getProps();return s2(r,e,n!==void 0?n:r.custom,t)}const o2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],l2=["initial",...o2],zb=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Cf=new Set(zb),ru=t=>t*1e3,iu=t=>t/1e3,due={type:"spring",stiffness:500,damping:25,restSpeed:10},fue=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),pue={type:"keyframes",duration:.8},hue={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mue=(t,{keyframes:e})=>e.length>2?pue:Cf.has(t)?t.startsWith("scale")?fue(e[1]):due:hue;function u2(t,e){return t?t[e]||t.default||t:void 0}const gue={skipAnimations:!1,useManualTiming:!1},bue=t=>t!==null;function yT(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(bue),a=e&&n!=="loop"&&e%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const ma=t=>t;function yue(t){let e=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function o(u){a.has(u)&&(l.schedule(u),t()),u(s)}const l={schedule:(u,c=!1,d=!1)=>{const m=d&&r?e:n;return c&&a.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(s=u,r){i=!0;return}r=!0,[e,n]=[n,e],n.clear(),e.forEach(o),r=!1,i&&(i=!1,l.process(u))}};return l}const Dv=["read","resolveKeyframes","update","preRender","render","postRender"],vue=40;function c$(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,s=Dv.reduce((b,E)=>(b[E]=yue(a),b),{}),{read:o,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=s,m=()=>{const b=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(b-i.timestamp,vue),1),i.timestamp=b,i.isProcessing=!0,o.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(m))},g=()=>{n=!0,r=!0,i.isProcessing||t(m)};return{schedule:Dv.reduce((b,E)=>{const S=s[E];return b[E]=(A,I=!1,T=!1)=>(n||g(),S.schedule(A,I,T)),b},{}),cancel:b=>{for(let E=0;E(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Eue=1e-7,Sue=12;function _ue(t,e,n,r,i){let a,s,o=0;do s=e+(n-e)/2,a=d$(s,r,i)-t,a>0?n=s:e=s;while(Math.abs(a)>Eue&&++o_ue(a,0,1,t,n);return a=>a===0||a===1?a:d$(i(a),e,r)}const f$=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,p$=t=>e=>1-t(1-e),h$=Hb(.33,1.53,.69,.99),c2=p$(h$),m$=f$(c2),g$=t=>(t*=2)<1?.5*c2(t):.5*(2-Math.pow(2,-10*(t-1))),d2=t=>1-Math.sin(Math.acos(t)),b$=p$(d2),y$=f$(d2),v$=t=>/^0[^.\s]+$/u.test(t);function Aue(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||v$(t):!0}let lI=ma;const E$=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),S$=t=>e=>typeof e=="string"&&e.startsWith(t),_$=S$("--"),Tue=S$("var(--"),f2=t=>Tue(t)?xue.test(t.split("/*")[0].trim()):!1,xue=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,wue=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Cue(t){const e=wue.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}function A$(t,e,n=1){const[r,i]=Cue(t);if(!r)return;const a=window.getComputedStyle(e).getPropertyValue(r);if(a){const s=a.trim();return E$(s)?parseFloat(s):s}return f2(i)?A$(i,e,n+1):i}const Ec=(t,e,n)=>n>e?e:ntypeof t=="number",parse:parseFloat,transform:t=>t},Z0={...dm,transform:t=>Ec(0,1,t)},Lv={...dm,default:1},Gb=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),$u=Gb("deg"),ol=Gb("%"),cn=Gb("px"),Rue=Gb("vh"),Iue=Gb("vw"),S4={...ol,parse:t=>ol.parse(t)/100,transform:t=>ol.transform(t*100)},Mue=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),_4=t=>t===dm||t===cn,A4=(t,e)=>parseFloat(t.split(", ")[e]),T4=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return A4(i[1],e);{const a=r.match(/^matrix\((.+)\)$/u);return a?A4(a[1],t):0}},Nue=new Set(["x","y","z"]),Oue=zb.filter(t=>!Nue.has(t));function Due(t){const e=[];return Oue.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Bh={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:T4(4,13),y:T4(5,14)};Bh.translateX=Bh.x;Bh.translateY=Bh.y;const T$=t=>e=>e.test(t),Lue={test:t=>t==="auto",parse:t=>t},x$=[dm,cn,ol,$u,Iue,Rue,Lue],x4=t=>x$.find(T$(t)),qd=new Set;let uI=!1,cI=!1;function w$(){if(cI){const t=Array.from(qd).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=Due(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,s])=>{var o;(o=r.getValue(a))===null||o===void 0||o.set(s)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}cI=!1,uI=!1,qd.forEach(t=>t.complete()),qd.clear()}function C$(){qd.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(cI=!0)})}function kue(){C$(),w$()}class p2{constructor(e,n,r,i,a,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(qd.add(this),uI||(uI=!0,dr.read(C$),dr.resolveKeyframes(w$))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;for(let a=0;aMath.round(t*1e5)/1e5,h2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Pue(t){return t==null}const Bue=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,m2=(t,e)=>n=>!!(typeof n=="string"&&Bue.test(n)&&n.startsWith(t)||e&&!Pue(n)&&Object.prototype.hasOwnProperty.call(n,e)),R$=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,a,s,o]=r.match(h2);return{[t]:parseFloat(i),[e]:parseFloat(a),[n]:parseFloat(s),alpha:o!==void 0?parseFloat(o):1}},Fue=t=>Ec(0,255,t),ww={...dm,transform:t=>Math.round(Fue(t))},Nd={test:m2("rgb","red"),parse:R$("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+ww.transform(t)+", "+ww.transform(e)+", "+ww.transform(n)+", "+f0(Z0.transform(r))+")"};function Uue(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const dI={test:m2("#"),parse:Uue,transform:Nd.transform},Wp={test:m2("hsl","hue"),parse:R$("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+ol.transform(f0(e))+", "+ol.transform(f0(n))+", "+f0(Z0.transform(r))+")"},ca={test:t=>Nd.test(t)||dI.test(t)||Wp.test(t),parse:t=>Nd.test(t)?Nd.parse(t):Wp.test(t)?Wp.parse(t):dI.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Nd.transform(t):Wp.transform(t)},zue=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Hue(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(h2))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(zue))===null||n===void 0?void 0:n.length)||0)>0}const I$="number",M$="color",Gue="var",Vue="var(",w4="${}",$ue=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Q0(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const o=e.replace($ue,l=>(ca.test(l)?(r.color.push(a),i.push(M$),n.push(ca.parse(l))):l.startsWith(Vue)?(r.var.push(a),i.push(Gue),n.push(l)):(r.number.push(a),i.push(I$),n.push(parseFloat(l))),++a,w4)).split(w4);return{values:n,split:o,indexes:r,types:i}}function N$(t){return Q0(t).values}function O$(t){const{split:e,types:n}=Q0(t),r=e.length;return i=>{let a="";for(let s=0;stypeof t=="number"?0:t;function jue(t){const e=N$(t);return O$(t)(e.map(Wue))}const Sc={test:Hue,parse:N$,createTransformer:O$,getAnimatableNone:jue},Yue=new Set(["brightness","contrast","saturate","opacity"]);function que(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(h2)||[];if(!r)return t;const i=n.replace(r,"");let a=Yue.has(e)?1:0;return r!==n&&(a*=100),e+"("+a+i+")"}const Xue=/\b([a-z-]*)\(.*?\)/gu,fI={...Sc,getAnimatableNone:t=>{const e=t.match(Xue);return e?e.map(que).join(" "):t}},Kue={borderWidth:cn,borderTopWidth:cn,borderRightWidth:cn,borderBottomWidth:cn,borderLeftWidth:cn,borderRadius:cn,radius:cn,borderTopLeftRadius:cn,borderTopRightRadius:cn,borderBottomRightRadius:cn,borderBottomLeftRadius:cn,width:cn,maxWidth:cn,height:cn,maxHeight:cn,top:cn,right:cn,bottom:cn,left:cn,padding:cn,paddingTop:cn,paddingRight:cn,paddingBottom:cn,paddingLeft:cn,margin:cn,marginTop:cn,marginRight:cn,marginBottom:cn,marginLeft:cn,backgroundPositionX:cn,backgroundPositionY:cn},Zue={rotate:$u,rotateX:$u,rotateY:$u,rotateZ:$u,scale:Lv,scaleX:Lv,scaleY:Lv,scaleZ:Lv,skew:$u,skewX:$u,skewY:$u,distance:cn,translateX:cn,translateY:cn,translateZ:cn,x:cn,y:cn,z:cn,perspective:cn,transformPerspective:cn,opacity:Z0,originX:S4,originY:S4,originZ:cn},C4={...dm,transform:Math.round},g2={...Kue,...Zue,zIndex:C4,size:cn,fillOpacity:Z0,strokeOpacity:Z0,numOctaves:C4},Que={...g2,color:ca,backgroundColor:ca,outlineColor:ca,fill:ca,stroke:ca,borderColor:ca,borderTopColor:ca,borderRightColor:ca,borderBottomColor:ca,borderLeftColor:ca,filter:fI,WebkitFilter:fI},b2=t=>Que[t];function D$(t,e){let n=b2(t);return n!==fI&&(n=Sc),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Jue=new Set(["auto","none","0"]);function ece(t,e,n){let r=0,i;for(;r{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function y2(t){return typeof t=="function"}let wS;function tce(){wS=void 0}const ll={now:()=>(wS===void 0&&ll.set(zi.isProcessing||gue.useManualTiming?zi.timestamp:performance.now()),wS),set:t=>{wS=t,queueMicrotask(tce)}},R4=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Sc.test(t)||t==="0")&&!t.startsWith("url("));function nce(t){const e=t[0];if(t.length===1)return!0;for(let n=0;nice?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&kue(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=ll.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:s,onComplete:o,onUpdate:l,isGenerator:u}=this.options;if(!u&&!rce(e,r,i,a))if(s)this.options.duration=0;else{l==null||l(yT(e,this.options,n)),o==null||o(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function P$(t,e){return e?t*(1e3/e):0}const ace=5;function B$(t,e,n){const r=Math.max(e-ace,0);return P$(n-t(r),e-r)}const Cw=.001,sce=.01,oce=10,lce=.05,uce=1;function cce({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let i,a,s=1-e;s=Ec(lce,uce,s),t=Ec(sce,oce,iu(t)),s<1?(i=u=>{const c=u*s,d=c*t,f=c-n,m=pI(u,s),g=Math.exp(-d);return Cw-f/m*g},a=u=>{const d=u*s*t,f=d*n+n,m=Math.pow(s,2)*Math.pow(u,2)*t,g=Math.exp(-d),y=pI(Math.pow(u,2),s);return(-i(u)+Cw>0?-1:1)*((f-m)*g)/y}):(i=u=>{const c=Math.exp(-u*t),d=(u-n)*t+1;return-Cw+c*d},a=u=>{const c=Math.exp(-u*t),d=(n-u)*(t*t);return c*d});const o=5/t,l=fce(i,a,o);if(t=ru(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:t}}}const dce=12;function fce(t,e,n){let r=n;for(let i=1;it[n]!==void 0)}function mce(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!I4(t,hce)&&I4(t,pce)){const n=cce(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function F$({keyframes:t,restDelta:e,restSpeed:n,...r}){const i=t[0],a=t[t.length-1],s={done:!1,value:i},{stiffness:o,damping:l,mass:u,duration:c,velocity:d,isResolvedFromDuration:f}=mce({...r,velocity:-iu(r.velocity||0)}),m=d||0,g=l/(2*Math.sqrt(o*u)),y=a-i,v=iu(Math.sqrt(o/u)),b=Math.abs(y)<5;n||(n=b?.01:2),e||(e=b?.005:.5);let E;if(g<1){const S=pI(v,g);E=A=>{const I=Math.exp(-g*v*A);return a-I*((m+g*v*y)/S*Math.sin(S*A)+y*Math.cos(S*A))}}else if(g===1)E=S=>a-Math.exp(-v*S)*(y+(m+v*y)*S);else{const S=v*Math.sqrt(g*g-1);E=A=>{const I=Math.exp(-g*v*A),T=Math.min(S*A,300);return a-I*((m+g*v*y)*Math.sinh(T)+S*y*Math.cosh(T))/S}}return{calculatedDuration:f&&c||null,next:S=>{const A=E(S);if(f)s.done=S>=c;else{let I=0;g<1&&(I=S===0?ru(m):B$(E,S,A));const T=Math.abs(I)<=n,R=Math.abs(a-A)<=e;s.done=T&&R}return s.value=s.done?a:A,s}}}function M4({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:s,min:o,max:l,restDelta:u=.5,restSpeed:c}){const d=t[0],f={done:!1,value:d},m=O=>o!==void 0&&Ol,g=O=>o===void 0?l:l===void 0||Math.abs(o-O)-y*Math.exp(-O/r),S=O=>b+E(O),A=O=>{const N=E(O),M=S(O);f.done=Math.abs(N)<=u,f.value=f.done?b:M};let I,T;const R=O=>{m(f.value)&&(I=O,T=F$({keyframes:[f.value,g(f.value)],velocity:B$(S,O,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return R(0),{calculatedDuration:null,next:O=>{let N=!1;return!T&&I===void 0&&(N=!0,A(O),R(O)),I!==void 0&&O>=I?T.next(O-I):(!N&&A(O),f)}}}const gce=Hb(.42,0,1,1),bce=Hb(0,0,.58,1),U$=Hb(.42,0,.58,1),yce=t=>Array.isArray(t)&&typeof t[0]!="number",v2=t=>Array.isArray(t)&&typeof t[0]=="number",N4={linear:ma,easeIn:gce,easeInOut:U$,easeOut:bce,circIn:d2,circInOut:y$,circOut:b$,backIn:c2,backInOut:m$,backOut:h$,anticipate:g$},O4=t=>{if(v2(t)){lI(t.length===4);const[e,n,r,i]=t;return Hb(e,n,r,i)}else if(typeof t=="string")return lI(N4[t]!==void 0),N4[t];return t},vce=(t,e)=>n=>e(t(n)),au=(...t)=>t.reduce(vce),Fh=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},Fr=(t,e,n)=>t+(e-t)*n;function Rw(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ece({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,a=0,s=0;if(!e)i=a=s=n;else{const o=n<.5?n*(1+e):n+e-n*e,l=2*n-o;i=Rw(l,o,t+1/3),a=Rw(l,o,t),s=Rw(l,o,t-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(s*255),alpha:r}}function a_(t,e){return n=>n>0?e:t}const Iw=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},Sce=[dI,Nd,Wp],_ce=t=>Sce.find(e=>e.test(t));function D4(t){const e=_ce(t);if(!e)return!1;let n=e.parse(t);return e===Wp&&(n=Ece(n)),n}const L4=(t,e)=>{const n=D4(t),r=D4(e);if(!n||!r)return a_(t,e);const i={...n};return a=>(i.red=Iw(n.red,r.red,a),i.green=Iw(n.green,r.green,a),i.blue=Iw(n.blue,r.blue,a),i.alpha=Fr(n.alpha,r.alpha,a),Nd.transform(i))},hI=new Set(["none","hidden"]);function Ace(t,e){return hI.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Tce(t,e){return n=>Fr(t,e,n)}function E2(t){return typeof t=="number"?Tce:typeof t=="string"?f2(t)?a_:ca.test(t)?L4:Cce:Array.isArray(t)?z$:typeof t=="object"?ca.test(t)?L4:xce:a_}function z$(t,e){const n=[...t],r=n.length,i=t.map((a,s)=>E2(a)(a,e[s]));return a=>{for(let s=0;s{for(const a in r)n[a]=r[a](i);return n}}function wce(t,e){var n;const r=[],i={color:0,var:0,number:0};for(let a=0;a{const n=Sc.createTransformer(e),r=Q0(t),i=Q0(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?hI.has(t)&&!i.values.length||hI.has(e)&&!r.values.length?Ace(t,e):au(z$(wce(r,i),i.values),n):a_(t,e)};function H$(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Fr(t,e,n):E2(t)(t,e)}function Rce(t,e,n){const r=[],i=n||H$,a=t.length-1;for(let s=0;se[0];if(a===2&&t[0]===t[1])return()=>e[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=Rce(e,r,i),o=s.length,l=u=>{let c=0;if(o>1)for(;cl(Ec(t[0],t[a-1],u)):l}function Mce(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Fh(0,e,r);t.push(Fr(n,1,i))}}function Nce(t){const e=[0];return Mce(e,t.length-1),e}function Oce(t,e){return t.map(n=>n*e)}function Dce(t,e){return t.map(()=>e||U$).splice(0,t.length-1)}function s_({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=yce(r)?r.map(O4):O4(r),a={done:!1,value:e[0]},s=Oce(n&&n.length===e.length?n:Nce(e),t),o=Ice(s,e,{ease:Array.isArray(i)?i:Dce(e,i)});return{calculatedDuration:t,next:l=>(a.value=o(l),a.done=l>=t,a)}}const k4=2e4;function Lce(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e=k4?1/0:e}const kce=t=>{const e=({timestamp:n})=>t(n);return{start:()=>dr.update(e,!0),stop:()=>vc(e),now:()=>zi.isProcessing?zi.timestamp:ll.now()}},Pce={decay:M4,inertia:M4,tween:s_,keyframes:s_,spring:F$},Bce=t=>t/100;class S2 extends k${constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:a}=this.options,s=(i==null?void 0:i.KeyframeResolver)||p2,o=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(a,o,n,r,i),this.resolver.scheduleResolve()}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:s=0}=this.options,o=y2(n)?n:Pce[n]||s_;let l,u;o!==s_&&typeof e[0]!="number"&&(l=au(Bce,H$(e[0],e[1])),e=[0,100]);const c=o({...this.options,keyframes:e});a==="mirror"&&(u=o({...this.options,keyframes:[...e].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=Lce(c));const{calculatedDuration:d}=c,f=d+i,m=f*(r+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:m}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:s,mapPercentToKeyframes:o,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:d}=r;if(this.startTime===null)return a.next(0);const{delay:f,repeat:m,repeatType:g,repeatDelay:y,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const b=this.currentTime-f*(this.speed>=0?1:-1),E=this.speed>=0?b<0:b>c;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let S=this.currentTime,A=a;if(m){const O=Math.min(this.currentTime,c)/d;let N=Math.floor(O),M=O%1;!M&&O>=1&&(M=1),M===1&&N--,N=Math.min(N,m+1),!!(N%2)&&(g==="reverse"?(M=1-M,y&&(M-=y/d)):g==="mirror"&&(A=s)),S=Ec(0,1,M)*d}const I=E?{done:!1,value:l[0]}:A.next(S);o&&(I.value=o(I.value));let{done:T}=I;!E&&u!==null&&(T=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return R&&i!==void 0&&(I.value=yT(l,this.options,i)),v&&v(I.value),R&&this.finish(),I}get duration(){const{resolved:e}=this;return e?iu(e.calculatedDuration):0}get time(){return iu(this.currentTime)}set time(e){e=ru(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=iu(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=kce,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Fce=new Set(["opacity","clipPath","filter","transform"]),Uce=10,zce=(t,e)=>{let n="";const r=Math.max(Math.round(e/Uce),2);for(let i=0;i(e===void 0&&(e=t()),e)}const Hce={linearEasing:void 0};function Gce(t,e){const n=_2(t);return()=>{var r;return(r=Hce[e])!==null&&r!==void 0?r:n()}}const o_=Gce(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function G$(t){return!!(typeof t=="function"&&o_()||!t||typeof t=="string"&&(t in mI||o_())||v2(t)||Array.isArray(t)&&t.every(G$))}const Yg=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,mI={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yg([0,.65,.55,1]),circOut:Yg([.55,0,1,.45]),backIn:Yg([.31,.01,.66,-.59]),backOut:Yg([.33,1.53,.69,.99])};function V$(t,e){if(t)return typeof t=="function"&&o_()?zce(t,e):v2(t)?Yg(t):Array.isArray(t)?t.map(n=>V$(n,e)||mI.easeOut):mI[t]}function Vce(t,e,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=V$(o,i);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:s==="reverse"?"alternate":"normal"})}function P4(t,e){t.timeline=e,t.onfinish=null}const $ce=_2(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),l_=10,Wce=2e4;function jce(t){return y2(t.type)||t.type==="spring"||!G$(t.ease)}function Yce(t,e){const n=new S2({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const i=[];let a=0;for(;!r.done&&athis.onKeyframesResolved(s,o),n,r,i),this.resolver.scheduleResolve()}initPlayback(e,n){var r;let{duration:i=300,times:a,ease:s,type:o,motionValue:l,name:u,startTime:c}=this.options;if(!(!((r=l.owner)===null||r===void 0)&&r.current))return!1;if(typeof s=="string"&&o_()&&qce(s)&&(s=$$[s]),jce(this.options)){const{onComplete:f,onUpdate:m,motionValue:g,element:y,...v}=this.options,b=Yce(e,v);e=b.keyframes,e.length===1&&(e[1]=e[0]),i=b.duration,a=b.times,s=b.ease,o="keyframes"}const d=Vce(l.owner.current,u,e,{...this.options,duration:i,times:a,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(P4(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(yT(e,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:a,type:o,ease:s,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return iu(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return iu(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=ru(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return ma;const{animation:r}=n;P4(r,e)}return ma}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:i,type:a,ease:s,times:o}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:d,element:f,...m}=this.options,g=new S2({...m,keyframes:r,duration:i,type:a,ease:s,times:o,isGenerator:!0}),y=ru(this.time);u.setWithVelocity(g.sample(y-l_).value,g.sample(y).value,l_)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:i,repeatType:a,damping:s,type:o}=e;return $ce()&&r&&Fce.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&a!=="mirror"&&s!==0&&o!=="inertia"}}const Xce=_2(()=>window.ScrollTimeline!==void 0);class Kce{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,n){return Promise.all(this.animations).then(e).catch(n)}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;rXce()&&i.attachTimeline?i.attachTimeline(e):n(i));return()=>{r.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;nn[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Zce({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:s,repeatDelay:o,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const A2=(t,e,n,r={},i,a)=>s=>{const o=u2(r,t)||{},l=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-ru(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:f=>{e.set(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:a?void 0:i};Zce(o)||(c={...c,...mue(t,c)}),c.duration&&(c.duration=ru(c.duration)),c.repeatDelay&&(c.repeatDelay=ru(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),d&&!a&&e.get()!==void 0){const f=yT(c.keyframes,o);if(f!==void 0)return dr.update(()=>{c.onUpdate(f),c.onComplete()}),new Kce([])}return!a&&B4.supports(c)?new B4(c):new S2(c)},Qce=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Jce=t=>oI(t)?t[t.length-1]||0:t;function T2(t,e){t.indexOf(e)===-1&&t.push(e)}function x2(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class w2{constructor(){this.subscriptions=[]}add(e){return T2(this.subscriptions,e),()=>x2(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let a=0;a!isNaN(parseFloat(t));class tde{constructor(e,n={}){this.version="11.11.11",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=ll.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ll.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ede(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new w2);const r=this.events[e].add(n);return e==="change"?()=>{r(),dr.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ll.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>F4)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,F4);return P$(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function J0(t,e){return new tde(t,e)}function nde(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,J0(n))}function rde(t,e){const n=bT(t,e);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const s in a){const o=Jce(a[s]);nde(t,s,o)}}const C2=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ide="framerAppearId",W$="data-"+C2(ide);function j$(t){return t.props[W$]}const pa=t=>!!(t&&t.getVelocity);function ade(t){return!!(pa(t)&&t.add)}function gI(t,e){const n=t.getValue("willChange");if(ade(n))return n.add(e)}function sde({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function Y$(t,e,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:s=t.getDefaultTransition(),transitionEnd:o,...l}=e;r&&(s=r);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const d in l){const f=t.getValue(d,(a=t.latestValues[d])!==null&&a!==void 0?a:null),m=l[d];if(m===void 0||c&&sde(c,d))continue;const g={delay:n,...u2(s||{},d)};let y=!1;if(window.MotionHandoffAnimation){const b=j$(t);if(b){const E=window.MotionHandoffAnimation(b,d,dr);E!==null&&(g.startTime=E,y=!0)}}gI(t,d),f.start(A2(d,f,m,t.shouldReduceMotion&&Cf.has(d)?{type:!1}:g,t,y));const v=f.animation;v&&u.push(v)}return o&&Promise.all(u).then(()=>{dr.update(()=>{o&&rde(t,o)})}),u}function bI(t,e,n={}){var r;const i=bT(t,e,n.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:a=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const s=i?()=>Promise.all(Y$(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=a;return ode(t,e,c+u,d,f,n)}:()=>Promise.resolve(),{when:l}=a;if(l){const[u,c]=l==="beforeChildren"?[s,o]:[o,s];return u().then(()=>c())}else return Promise.all([s(),o(n.delay)])}function ode(t,e,n=0,r=0,i=1,a){const s=[],o=(t.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>o-u*r;return Array.from(t.variantChildren).sort(lde).forEach((u,c)=>{u.notify("AnimationStart",e),s.push(bI(u,e,{...a,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(s)}function lde(t,e){return t.sortNodePosition(e)}function ude(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(a=>bI(t,a,n));r=Promise.all(i)}else if(typeof e=="string")r=bI(t,e,n);else{const i=typeof e=="function"?bT(t,e,n.custom):e;r=Promise.all(Y$(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const cde=l2.length;function q$(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?q$(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;nPromise.all(e.map(({animation:n,options:r})=>ude(t,n,r)))}function hde(t){let e=pde(t),n=U4(),r=!0;const i=l=>(u,c)=>{var d;const f=bT(t,c,l==="exit"?(d=t.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:m,transitionEnd:g,...y}=f;u={...u,...y,...g}}return u};function a(l){e=l(t)}function s(l){const{props:u}=t,c=q$(t.parent)||{},d=[],f=new Set;let m={},g=1/0;for(let v=0;vg&&A,N=!1;const M=Array.isArray(S)?S:[S];let B=M.reduce(i(b),{});I===!1&&(B={});const{prevResolvedValues:G={}}=E,W={...G,...B},K=ee=>{O=!0,f.has(ee)&&(N=!0,f.delete(ee)),E.needsAnimating[ee]=!0;const F=t.getValue(ee);F&&(F.liveStyle=!1)};for(const ee in W){const F=B[ee],ie=G[ee];if(m.hasOwnProperty(ee))continue;let J=!1;oI(F)&&oI(ie)?J=!u$(F,ie):J=F!==ie,J?F!=null?K(ee):f.add(ee):F!==void 0&&f.has(ee)?K(ee):E.protectedKeys[ee]=!0}E.prevProp=S,E.prevResolvedValues=B,E.isActive&&(m={...m,...B}),r&&t.blockInitialAnimation&&(O=!1),O&&(!(T&&R)||N)&&d.push(...M.map(ee=>({animation:ee,options:{type:b}})))}if(f.size){const v={};f.forEach(b=>{const E=t.getBaseTarget(b),S=t.getValue(b);S&&(S.liveStyle=!0),v[b]=E??null}),d.push({animation:v})}let y=!!d.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(y=!1),r=!1,y?e(d):Promise.resolve()}function o(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(f=>{var m;return(m=f.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),n[l].isActive=u;const d=s(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:s,setActive:o,setAnimateFunction:a,getState:()=>n,reset:()=>{n=U4(),r=!0}}}function mde(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!u$(e,t):!1}function rd(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function U4(){return{animate:rd(!0),whileInView:rd(),whileHover:rd(),whileTap:rd(),whileDrag:rd(),whileFocus:rd(),exit:rd()}}class Oc{constructor(e){this.isMounted=!1,this.node=e}update(){}}class gde extends Oc{constructor(e){super(e),e.animationState||(e.animationState=hde(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();gT(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let bde=0;class yde extends Oc{constructor(){super(...arguments),this.id=bde++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const vde={animation:{Feature:gde},exit:{Feature:yde}},X$=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function vT(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const Ede=t=>e=>X$(e)&&t(e,vT(e));function Zl(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function su(t,e,n,r){return Zl(t,e,Ede(n),r)}const z4=(t,e)=>Math.abs(t-e);function Sde(t,e){const n=z4(t.x,e.x),r=z4(t.y,e.y);return Math.sqrt(n**2+r**2)}class K${constructor(e,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Nw(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=Sde(d.offset,{x:0,y:0})>=3;if(!f&&!m)return;const{point:g}=d,{timestamp:y}=zi;this.history.push({...g,timestamp:y});const{onStart:v,onMove:b}=this.handlers;f||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Mw(f,this.transformPagePoint),dr.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Nw(d.type==="pointercancel"?this.lastMoveEventInfo:Mw(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,v),g&&g(d,v)},!X$(e))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=vT(e),o=Mw(s,this.transformPagePoint),{point:l}=o,{timestamp:u}=zi;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,Nw(o,this.history)),this.removeListeners=au(su(this.contextWindow,"pointermove",this.handlePointerMove),su(this.contextWindow,"pointerup",this.handlePointerUp),su(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),vc(this.updatePoint)}}function Mw(t,e){return e?{point:e(t.point)}:t}function H4(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Nw({point:t},e){return{point:t,delta:H4(t,Z$(e)),offset:H4(t,_de(e)),velocity:Ade(e,.1)}}function _de(t){return t[0]}function Z$(t){return t[t.length-1]}function Ade(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=Z$(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>ru(e)));)n--;if(!r)return{x:0,y:0};const a=iu(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const s={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Q$(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const G4=Q$("dragHorizontal"),V4=Q$("dragVertical");function J$(t){let e=!1;if(t==="y")e=V4();else if(t==="x")e=G4();else{const n=G4(),r=V4();n&&r?e=()=>{n(),r()}:(n&&n(),r&&r())}return e}function eW(){const t=J$(!0);return t?(t(),!1):!0}function jp(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}const tW=1e-4,Tde=1-tW,xde=1+tW,nW=.01,wde=0-nW,Cde=0+nW;function As(t){return t.max-t.min}function Rde(t,e,n){return Math.abs(t-e)<=n}function $4(t,e,n,r=.5){t.origin=r,t.originPoint=Fr(e.min,e.max,t.origin),t.scale=As(n)/As(e),t.translate=Fr(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Tde&&t.scale<=xde||isNaN(t.scale))&&(t.scale=1),(t.translate>=wde&&t.translate<=Cde||isNaN(t.translate))&&(t.translate=0)}function p0(t,e,n,r){$4(t.x,e.x,n.x,r?r.originX:void 0),$4(t.y,e.y,n.y,r?r.originY:void 0)}function W4(t,e,n){t.min=n.min+e.min,t.max=t.min+As(e)}function Ide(t,e,n){W4(t.x,e.x,n.x),W4(t.y,e.y,n.y)}function j4(t,e,n){t.min=e.min-n.min,t.max=t.min+As(e)}function h0(t,e,n){j4(t.x,e.x,n.x),j4(t.y,e.y,n.y)}function Mde(t,{min:e,max:n},r){return e!==void 0&&tn&&(t=r?Fr(n,t,r.max):Math.min(t,n)),t}function Y4(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Nde(t,{top:e,left:n,bottom:r,right:i}){return{x:Y4(t.x,n,i),y:Y4(t.y,e,r)}}function q4(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.minr?n=Fh(e.min,e.max-r,t.min):r>i&&(n=Fh(t.min,t.max-i,e.min)),Ec(0,1,n)}function Lde(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const yI=.35;function kde(t=yI){return t===!1?t=0:t===!0&&(t=yI),{x:X4(t,"left","right"),y:X4(t,"top","bottom")}}function X4(t,e,n){return{min:K4(t,e),max:K4(t,n)}}function K4(t,e){return typeof t=="number"?t:t[e]||0}const Z4=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yp=()=>({x:Z4(),y:Z4()}),Q4=()=>({min:0,max:0}),Jr=()=>({x:Q4(),y:Q4()});function Vs(t){return[t("x"),t("y")]}function rW({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Pde({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Bde(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ow(t){return t===void 0||t===1}function vI({scale:t,scaleX:e,scaleY:n}){return!Ow(t)||!Ow(e)||!Ow(n)}function yd(t){return vI(t)||iW(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function iW(t){return J4(t.x)||J4(t.y)}function J4(t){return t&&t!=="0%"}function u_(t,e,n){const r=t-n,i=e*r;return n+i}function ez(t,e,n,r,i){return i!==void 0&&(t=u_(t,i,r)),u_(t,n,r)+e}function EI(t,e=0,n=1,r,i){t.min=ez(t.min,e,n,r,i),t.max=ez(t.max,e,n,r,i)}function aW(t,{x:e,y:n}){EI(t.x,e.translate,e.scale,e.originPoint),EI(t.y,n.translate,n.scale,n.originPoint)}const tz=.999999999999,nz=1.0000000000001;function Fde(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let a,s;for(let o=0;otz&&(e.x=1),e.ytz&&(e.y=1)}function qp(t,e){t.min=t.min+e,t.max=t.max+e}function rz(t,e,n,r,i=.5){const a=Fr(t.min,t.max,i);EI(t,e,n,a,r)}function Xp(t,e){rz(t.x,e.x,e.scaleX,e.scale,e.originX),rz(t.y,e.y,e.scaleY,e.scale,e.originY)}function sW(t,e){return rW(Bde(t.getBoundingClientRect(),e))}function Ude(t,e,n){const r=sW(t,n),{scroll:i}=e;return i&&(qp(r.x,i.offset.x),qp(r.y,i.offset.y)),r}const oW=({current:t})=>t?t.ownerDocument.defaultView:null,zde=new WeakMap;class Hde{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Jr(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(vT(c,"page").point)},a=(c,d)=>{const{drag:f,dragPropagation:m,onDragStart:g}=this.getProps();if(f&&!m&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=J$(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Vs(v=>{let b=this.getAxisMotionValue(v).get()||0;if(ol.test(b)){const{projection:E}=this.visualElement;if(E&&E.layout){const S=E.layout.layoutBox[v];S&&(b=As(S)*(parseFloat(b)/100))}}this.originPoint[v]=b}),g&&dr.postRender(()=>g(c,d)),gI(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},s=(c,d)=>{const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:g,onDrag:y}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:v}=d;if(m&&this.currentDirection===null){this.currentDirection=Gde(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),y&&y(c,d)},o=(c,d)=>this.stop(c,d),l=()=>Vs(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new K$(e,{onSessionStart:i,onStart:a,onMove:s,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:oW(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&dr.postRender(()=>a(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!kv(e,i,this.currentDirection))return;const a=this.getAxisMotionValue(e);let s=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(s=Mde(s,this.constraints[e],this.elastic[e])),a.set(s)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,a=this.constraints;n&&jp(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Nde(i.layoutBox,n):this.constraints=!1,this.elastic=kde(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Vs(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=Lde(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!jp(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=Ude(r,i.root,this.visualElement.getTransformPagePoint());let s=Ode(i.layout.layoutBox,a);if(n){const o=n(Pde(s));this.hasMutatedConstraints=!!o,o&&(s=rW(o))}return s}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Vs(c=>{if(!kv(c,n,this.currentDirection))return;let d=l&&l[c]||{};s&&(d={min:0,max:0});const f=i?200:1e6,m=i?40:1e7,g={type:"inertia",velocity:r?e[c]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(c,g)});return Promise.all(u).then(o)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return gI(this.visualElement,e),r.start(A2(e,r,0,n,this.visualElement,!1))}stopAnimation(){Vs(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Vs(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Vs(n=>{const{drag:r}=this.getProps();if(!kv(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:o}=i.layout.layoutBox[n];a.set(e[n]-Fr(s,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!jp(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Vs(s=>{const o=this.getAxisMotionValue(s);if(o&&this.constraints!==!1){const l=o.get();i[s]=Dde({min:l,max:l},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Vs(s=>{if(!kv(s,e,null))return;const o=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];o.set(Fr(l,u,i[s]))})}addListeners(){if(!this.visualElement.current)return;zde.set(this.visualElement,this);const e=this.visualElement.current,n=su(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();jp(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),dr.read(r);const s=Zl(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Vs(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{s(),n(),a(),o&&o()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:s=yI,dragMomentum:o=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:s,dragMomentum:o}}}function kv(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Gde(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Vde extends Oc{constructor(e){super(e),this.removeGroupControls=ma,this.removeListeners=ma,this.controls=new Hde(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ma}unmount(){this.removeGroupControls(),this.removeListeners()}}const iz=t=>(e,n)=>{t&&dr.postRender(()=>t(e,n))};class $de extends Oc{constructor(){super(...arguments),this.removePointerDownListener=ma}onPointerDown(e){this.session=new K$(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oW(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:iz(e),onStart:iz(n),onMove:r,onEnd:(a,s)=>{delete this.session,i&&dr.postRender(()=>i(a,s))}}}mount(){this.removePointerDownListener=su(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Vb=w.createContext(null);function Wde(){const t=w.useContext(Vb);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,i=w.useId();w.useEffect(()=>r(i),[]);const a=w.useCallback(()=>n&&n(i),[i,n]);return!e&&n?[!1,a]:[!0]}function jde(){return Yde(w.useContext(Vb))}function Yde(t){return t===null?!0:t.isPresent}const R2=w.createContext({}),lW=w.createContext({}),CS={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function az(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const lg={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(cn.test(t))t=parseFloat(t);else return t;const n=az(t,e.target.x),r=az(t,e.target.y);return`${n}% ${r}%`}},qde={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=Sc.parse(t);if(i.length>5)return r;const a=Sc.createTransformer(t),s=typeof i[0]!="number"?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;i[0+s]/=o,i[1+s]/=l;const u=Fr(o,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),a(i)}},c_={};function Xde(t){Object.assign(c_,t)}const{schedule:I2,cancel:Ize}=c$(queueMicrotask,!1);class Kde extends w.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=e;Xde(Zde),a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),CS.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,s=r.projection;return s&&(s.isPresent=a,i||e.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?s.promote():s.relegate()||dr.postRender(()=>{const o=s.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),I2.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function uW(t){const[e,n]=Wde(),r=w.useContext(R2);return $.jsx(Kde,{...t,layoutGroup:r,switchLayoutGroup:w.useContext(lW),isPresent:e,safeToRemove:n})}const Zde={borderRadius:{...lg,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lg,borderTopRightRadius:lg,borderBottomLeftRadius:lg,borderBottomRightRadius:lg,boxShadow:qde},cW=["TopLeft","TopRight","BottomLeft","BottomRight"],Qde=cW.length,sz=t=>typeof t=="string"?parseFloat(t):t,oz=t=>typeof t=="number"||cn.test(t);function Jde(t,e,n,r,i,a){i?(t.opacity=Fr(0,n.opacity!==void 0?n.opacity:1,efe(r)),t.opacityExit=Fr(e.opacity!==void 0?e.opacity:1,0,tfe(r))):a&&(t.opacity=Fr(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;sre?1:n(Fh(t,e,r))}function uz(t,e){t.min=e.min,t.max=e.max}function Us(t,e){uz(t.x,e.x),uz(t.y,e.y)}function cz(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function dz(t,e,n,r,i){return t-=e,t=u_(t,1/n,r),i!==void 0&&(t=u_(t,1/i,r)),t}function nfe(t,e=0,n=1,r=.5,i,a=t,s=t){if(ol.test(e)&&(e=parseFloat(e),e=Fr(s.min,s.max,e/100)-s.min),typeof e!="number")return;let o=Fr(a.min,a.max,r);t===a&&(o-=e),t.min=dz(t.min,e,n,o,i),t.max=dz(t.max,e,n,o,i)}function fz(t,e,[n,r,i],a,s){nfe(t,e[n],e[r],e[i],e.scale,a,s)}const rfe=["x","scaleX","originX"],ife=["y","scaleY","originY"];function pz(t,e,n,r){fz(t.x,e,rfe,n?n.x:void 0,r?r.x:void 0),fz(t.y,e,ife,n?n.y:void 0,r?r.y:void 0)}function hz(t){return t.translate===0&&t.scale===1}function fW(t){return hz(t.x)&&hz(t.y)}function mz(t,e){return t.min===e.min&&t.max===e.max}function afe(t,e){return mz(t.x,e.x)&&mz(t.y,e.y)}function gz(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function pW(t,e){return gz(t.x,e.x)&&gz(t.y,e.y)}function bz(t){return As(t.x)/As(t.y)}function yz(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class sfe{constructor(){this.members=[]}add(e){T2(this.members,e),e.scheduleRender()}remove(e){if(x2(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ofe(t,e,n){let r="";const i=t.x.translate/e.x,a=t.y.translate/e.y,s=(n==null?void 0:n.z)||0;if((i||a||s)&&(r=`translate3d(${i}px, ${a}px, ${s}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:m,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const o=t.x.scale*e.x,l=t.y.scale*e.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const lfe=(t,e)=>t.depth-e.depth;class ufe{constructor(){this.children=[],this.isDirty=!1}add(e){T2(this.children,e),this.isDirty=!0}remove(e){x2(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(lfe),this.isDirty=!1,this.children.forEach(e)}}function RS(t){const e=pa(t)?t.get():t;return Qce(e)?e.toValue():e}function cfe(t,e){const n=ll.now(),r=({timestamp:i})=>{const a=i-n;a>=e&&(vc(r),t(a-e))};return dr.read(r,!0),()=>vc(r)}function dfe(t){return t instanceof SVGElement&&t.tagName!=="svg"}function ffe(t,e,n){const r=pa(t)?t:J0(t);return r.start(A2("",r,e,n)),r.animation}const vd={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},qg=typeof window<"u"&&window.MotionDebug!==void 0,Dw=["","X","Y","Z"],pfe={visibility:"hidden"},vz=1e3;let hfe=0;function Lw(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function hW(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=j$(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",dr,!(i||a))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&hW(r)}function mW({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},o=e==null?void 0:e()){this.id=hfe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,qg&&(vd.totalNodes=vd.resolvedTargetDeltas=vd.recalculatedProjection=0),this.nodes.forEach(bfe),this.nodes.forEach(_fe),this.nodes.forEach(Afe),this.nodes.forEach(yfe),qg&&window.MotionDebug.record(vd)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;t(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=cfe(f,250),CS.hasAnimatedSinceResize&&(CS.hasAnimatedSinceResize=!1,this.nodes.forEach(Sz))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||Rfe,{onLayoutAnimationStart:v,onLayoutAnimationComplete:b}=c.getProps(),E=!this.targetLayout||!pW(this.targetLayout,g)||m,S=!f&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||S||f&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,S);const A={...u2(y,"layout"),onPlay:v,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else f||Sz(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,vc(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Tfe),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&hW(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const I=A/1e3;_z(d.x,s.x,I),_z(d.y,s.y,I),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(h0(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),wfe(this.relativeTarget,this.relativeTargetOrigin,f,I),S&&afe(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=Jr()),Us(S,this.relativeTarget)),y&&(this.animationValues=c,Jde(c,u,this.latestValues,I,E,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(vc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=dr.update(()=>{CS.hasAnimatedSinceResize=!0,this.currentAnimation=ffe(0,vz,{...s,onUpdate:o=>{this.mixTargetDelta(o),s.onUpdate&&s.onUpdate(o)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(vz),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:c}=s;if(!(!o||!l||!u)){if(this!==s&&this.layout&&u&&gW(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Jr();const d=As(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=As(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}Us(o,l),Xp(o,c),p0(this.projectionDeltaWithTransform,this.layoutCorrected,o,c)}}registerSharedNode(s,o){this.sharedNodes.has(s)||this.sharedNodes.set(s,new sfe),this.sharedNodes.get(s).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:o}=this.options;return o?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:o}=this.options;return o?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let o=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&Lw("z",s,u,this.animationValues);for(let c=0;c{var o;return(o=s.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(Ez),this.root.sharedNodes.clear()}}}function mfe(t){t.updateLayout()}function gfe(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:a}=t.options,s=n.source!==t.layout.source;a==="size"?Vs(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],m=As(f);f.min=r[d].min,f.max=f.min+m}):gW(a,n.layoutBox,r)&&Vs(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],m=As(r[d]);f.max=f.min+m,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+m)});const o=Yp();p0(o,r,n.layoutBox);const l=Yp();s?p0(l,t.applyTransform(i,!0),n.measuredBox):p0(l,r,n.layoutBox);const u=!fW(o);let c=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:m}=d;if(f&&m){const g=Jr();h0(g,n.layoutBox,f.layoutBox);const y=Jr();h0(y,r,m.layoutBox),pW(g,y)||(c=!0),d.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=g,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function bfe(t){qg&&vd.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function yfe(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function vfe(t){t.clearSnapshot()}function Ez(t){t.clearMeasurements()}function Efe(t){t.isLayoutDirty=!1}function Sfe(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Sz(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function _fe(t){t.resolveTargetDelta()}function Afe(t){t.calcProjection()}function Tfe(t){t.resetSkewAndRotation()}function xfe(t){t.removeLeadSnapshot()}function _z(t,e,n){t.translate=Fr(e.translate,0,n),t.scale=Fr(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Az(t,e,n,r){t.min=Fr(e.min,n.min,r),t.max=Fr(e.max,n.max,r)}function wfe(t,e,n,r){Az(t.x,e.x,n.x,r),Az(t.y,e.y,n.y,r)}function Cfe(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Rfe={duration:.45,ease:[.4,0,.1,1]},Tz=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),xz=Tz("applewebkit/")&&!Tz("chrome/")?Math.round:ma;function wz(t){t.min=xz(t.min),t.max=xz(t.max)}function Ife(t){wz(t.x),wz(t.y)}function gW(t,e,n){return t==="position"||t==="preserve-aspect"&&!Rde(bz(e),bz(n),.2)}function Mfe(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const Nfe=mW({attachResizeListener:(t,e)=>Zl(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),kw={current:void 0},bW=mW({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!kw.current){const t=new Nfe({});t.mount(window),t.setOptions({layoutScroll:!0}),kw.current=t}return kw.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Ofe={pan:{Feature:$de},drag:{Feature:Vde,ProjectionNode:bW,MeasureLayout:uW}};function Cz(t,e){const n=e?"pointerenter":"pointerleave",r=e?"onHoverStart":"onHoverEnd",i=(a,s)=>{if(a.pointerType==="touch"||eW())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e);const l=o[r];l&&dr.postRender(()=>l(a,s))};return su(t.current,n,i,{passive:!t.getProps()[r]})}class Dfe extends Oc{mount(){this.unmount=au(Cz(this.node,!0),Cz(this.node,!1))}unmount(){}}class Lfe extends Oc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=au(Zl(this.node.current,"focus",()=>this.onFocus()),Zl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const yW=(t,e)=>e?t===e?!0:yW(t,e.parentElement):!1;function Pw(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,vT(n))}class kfe extends Oc{constructor(){super(...arguments),this.removeStartListeners=ma,this.removeEndListeners=ma,this.removeAccessibleListeners=ma,this.startPointerPress=(e,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),a=su(window,"pointerup",(o,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:d}=this.node.getProps(),f=!d&&!yW(this.node.current,o.target)?c:u;f&&dr.update(()=>f(o,l))},{passive:!(r.onTap||r.onPointerUp)}),s=su(window,"pointercancel",(o,l)=>this.cancelPress(o,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=au(a,s),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=a=>{if(a.key!=="Enter"||this.isPressing)return;const s=o=>{o.key!=="Enter"||!this.checkPressEnd()||Pw("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&dr.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Zl(this.node.current,"keyup",s),Pw("down",(o,l)=>{this.startPress(o,l)})},n=Zl(this.node.current,"keydown",e),r=()=>{this.isPressing&&Pw("cancel",(a,s)=>this.cancelPress(a,s))},i=Zl(this.node.current,"blur",r);this.removeAccessibleListeners=au(n,i)}}startPress(e,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&dr.postRender(()=>r(e,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!eW()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&dr.postRender(()=>r(e,n))}mount(){const e=this.node.getProps(),n=su(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),r=Zl(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=au(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const SI=new WeakMap,Bw=new WeakMap,Pfe=t=>{const e=SI.get(t.target);e&&e(t)},Bfe=t=>{t.forEach(Pfe)};function Ffe({root:t,...e}){const n=t||document;Bw.has(n)||Bw.set(n,{});const r=Bw.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(Bfe,{root:t,...e})),r[i]}function Ufe(t,e,n){const r=Ffe(e);return SI.set(t,n),r.observe(t),()=>{SI.delete(t),r.unobserve(t)}}const zfe={some:0,all:1};class Hfe extends Oc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:a}=e,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:zfe[i]},o=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return Ufe(this.node.current,s,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Gfe(e,n))&&this.startObserver()}unmount(){}}function Gfe({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Vfe={inView:{Feature:Hfe},tap:{Feature:kfe},focus:{Feature:Lfe},hover:{Feature:Dfe}},$fe={layout:{ProjectionNode:bW,MeasureLayout:uW}},M2=w.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),ET=w.createContext({}),N2=typeof window<"u",vW=N2?w.useLayoutEffect:w.useEffect,EW=w.createContext({strict:!1});function Wfe(t,e,n,r,i){var a,s;const{visualElement:o}=w.useContext(ET),l=w.useContext(EW),u=w.useContext(Vb),c=w.useContext(M2).reducedMotion,d=w.useRef();r=r||l.renderer,!d.current&&r&&(d.current=r(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const f=d.current,m=w.useContext(lW);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&jfe(d.current,n,i,m);const g=w.useRef(!1);w.useInsertionEffect(()=>{f&&g.current&&f.update(n,u)});const y=n[W$],v=w.useRef(!!y&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,y))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,y)));return vW(()=>{f&&(g.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),I2.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())}),w.useEffect(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),v.current=!1))}),f}function jfe(t,e,n,r){const{layoutId:i,layout:a,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:SW(t.parent)),t.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!s||o&&jp(o),visualElement:t,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function SW(t){if(t)return t.options.allowProjection!==!1?t.projection:SW(t.parent)}function Yfe(t,e,n){return w.useCallback(r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):jp(n)&&(n.current=r))},[e])}function ST(t){return gT(t.animate)||l2.some(e=>K0(t[e]))}function _W(t){return!!(ST(t)||t.variants)}function qfe(t,e){if(ST(t)){const{initial:n,animate:r}=t;return{initial:n===!1||K0(n)?n:void 0,animate:K0(r)?r:void 0}}return t.inherit!==!1?e:{}}function Xfe(t){const{initial:e,animate:n}=qfe(t,w.useContext(ET));return w.useMemo(()=>({initial:e,animate:n}),[Rz(e),Rz(n)])}function Rz(t){return Array.isArray(t)?t.join(" "):t}const Iz={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Uh={};for(const t in Iz)Uh[t]={isEnabled:e=>Iz[t].some(n=>!!e[n])};function Kfe(t){for(const e in t)Uh[e]={...Uh[e],...t[e]}}const Zfe=Symbol.for("motionComponentSymbol");function Qfe({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:i}){t&&Kfe(t);function a(o,l){let u;const c={...w.useContext(M2),...o,layoutId:Jfe(o)},{isStatic:d}=c,f=Xfe(o),m=r(o,d);if(!d&&N2){epe();const g=tpe(c);u=g.MeasureLayout,f.visualElement=Wfe(i,m,c,e,g.ProjectionNode)}return $.jsxs(ET.Provider,{value:f,children:[u&&f.visualElement?$.jsx(u,{visualElement:f.visualElement,...c}):null,n(i,o,Yfe(m,f.visualElement,l),m,d,f.visualElement)]})}const s=w.forwardRef(a);return s[Zfe]=i,s}function Jfe({layoutId:t}){const e=w.useContext(R2).id;return e&&t!==void 0?e+"-"+t:t}function epe(t,e){w.useContext(EW).strict}function tpe(t){const{drag:e,layout:n}=Uh;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const npe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function O2(t){return typeof t!="string"||t.includes("-")?!1:!!(npe.indexOf(t)>-1||/[A-Z]/u.test(t))}function AW(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const a in n)t.style.setProperty(a,n[a])}const TW=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function xW(t,e,n,r){AW(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(TW.has(i)?i:C2(i),e.attrs[i])}function wW(t,{layout:e,layoutId:n}){return Cf.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!c_[t]||t==="opacity")}function D2(t,e,n){var r;const{style:i}=t,a={};for(const s in i)(pa(i[s])||e.style&&pa(e.style[s])||wW(s,t)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[s]=i[s]);return a}function CW(t,e,n){const r=D2(t,e,n);for(const i in t)if(pa(t[i])||pa(e[i])){const a=zb.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=t[i]}return r}function L2(t){const e=w.useRef(null);return e.current===null&&(e.current=t()),e.current}function rpe({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,i,a){const s={latestValues:ipe(r,i,a,t),renderState:e()};return n&&(s.mount=o=>n(r,o,s)),s}const RW=t=>(e,n)=>{const r=w.useContext(ET),i=w.useContext(Vb),a=()=>rpe(t,e,r,i);return n?a():L2(a)};function ipe(t,e,n,r){const i={},a=r(t,{});for(const f in a)i[f]=RS(a[f]);let{initial:s,animate:o}=t;const l=ST(t),u=_W(t);e&&u&&!l&&t.inherit!==!1&&(s===void 0&&(s=e.initial),o===void 0&&(o=e.animate));let c=n?n.initial===!1:!1;c=c||s===!1;const d=c?o:s;if(d&&typeof d!="boolean"&&!gT(d)){const f=Array.isArray(d)?d:[d];for(let m=0;m({style:{},transform:{},transformOrigin:{},vars:{}}),IW=()=>({...k2(),attrs:{}}),MW=(t,e)=>e&&typeof t=="number"?e.transform(t):t,ape={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},spe=zb.length;function ope(t,e,n){let r="",i=!0;for(let a=0;atypeof t=="string"&&t.toLowerCase()==="svg",fpe={useVisualState:RW({scrapeMotionValuesFromProps:CW,createRenderState:IW,onMount:(t,e,{renderState:n,latestValues:r})=>{dr.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),dr.render(()=>{B2(n,r,F2(e.tagName),t.transformTemplate),xW(e,n)})}})},ppe={useVisualState:RW({scrapeMotionValuesFromProps:D2,createRenderState:k2})};function NW(t,e,n){for(const r in e)!pa(e[r])&&!wW(r,n)&&(t[r]=e[r])}function hpe({transformTemplate:t},e){return w.useMemo(()=>{const n=k2();return P2(n,e,t),Object.assign({},n.vars,n.style)},[e])}function mpe(t,e){const n=t.style||{},r={};return NW(r,n,t),Object.assign(r,hpe(t,e)),r}function gpe(t,e){const n={},r=mpe(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const bpe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function d_(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||bpe.has(t)}let OW=t=>!d_(t);function ype(t){t&&(OW=e=>e.startsWith("on")?!d_(e):t(e))}try{ype(require("@emotion/is-prop-valid").default)}catch{}function vpe(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(OW(i)||n===!0&&d_(i)||!e&&!d_(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}function Epe(t,e,n,r){const i=w.useMemo(()=>{const a=IW();return B2(a,e,F2(r),t.transformTemplate),{...a.attrs,style:{...a.style}}},[e]);if(t.style){const a={};NW(a,t.style,t),i.style={...a,...i.style}}return i}function Spe(t=!1){return(n,r,i,{latestValues:a},s)=>{const l=(O2(n)?Epe:gpe)(r,a,s,n),u=vpe(r,typeof n=="string",t),c=n!==w.Fragment?{...u,...l,ref:i}:{},{children:d}=r,f=w.useMemo(()=>pa(d)?d.get():d,[d]);return w.createElement(n,{...c,children:f})}}function _pe(t,e){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...O2(r)?fpe:ppe,preloadedFeatures:t,useRender:Spe(i),createVisualElement:e,Component:r};return Qfe(s)}}const _I={current:null},DW={current:!1};function Ape(){if(DW.current=!0,!!N2)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>_I.current=t.matches;t.addListener(e),e()}else _I.current=!1}function Tpe(t,e,n){for(const r in e){const i=e[r],a=n[r];if(pa(i))t.addValue(r,i);else if(pa(a))t.addValue(r,J0(i,{owner:t}));else if(a!==i)if(t.hasValue(r)){const s=t.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=t.getStaticValue(r);t.addValue(r,J0(s!==void 0?s:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Nz=new WeakMap,xpe=[...x$,ca,Sc],wpe=t=>xpe.find(T$(t)),Oz=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Cpe{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=p2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=ll.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),DW.current||Ape(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:_I.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Nz.delete(this.current),this.projection&&this.projection.unmount(),vc(this.notifyUpdate),vc(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=Cf.has(e),i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&dr.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),a(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Uh){const n=Uh[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Jr()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=J0(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var r;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(E$(i)||v$(i))?i=parseFloat(i):!wpe(i)&&Sc.test(n)&&(i=D$(e,n)),this.setBaseTarget(e,pa(i)?i.get():i)),pa(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const s=s2(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[e])}if(r&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!pa(a)?a:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new w2),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class LW extends Cpe{constructor(){super(...arguments),this.KeyframeResolver=L$}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}}function Rpe(t){return window.getComputedStyle(t)}class Ipe extends LW{constructor(){super(...arguments),this.type="html",this.renderInstance=AW}readValueFromInstance(e,n){if(Cf.has(n)){const r=b2(n);return r&&r.default||0}else{const r=Rpe(e),i=(_$(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return sW(e,n)}build(e,n,r){P2(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return D2(e,n,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;pa(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Mpe extends LW{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Jr}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Cf.has(n)){const r=b2(n);return r&&r.default||0}return n=TW.has(n)?n:C2(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return CW(e,n,r)}build(e,n,r){B2(e,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,n,r,i){xW(e,n,r,i)}mount(e){this.isSVGTag=F2(e.tagName),super.mount(e)}}const Npe=(t,e)=>O2(t)?new Mpe(e):new Ipe(e,{allowProjection:t!==w.Fragment}),Ope=_pe({...vde,...Vfe,...Ofe,...$fe},Npe),Dpe=cue(Ope);class Lpe extends w.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function kpe({children:t,isPresent:e}){const n=w.useId(),r=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=w.useContext(M2);return w.useInsertionEffect(()=>{const{width:s,height:o,top:l,left:u}=i.current;if(e||!r.current||!s||!o)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return a&&(c.nonce=a),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` + `});function rue(t){const{cssVarsRoot:e,theme:n,children:r}=t,i=w.useMemo(()=>Fte(n),[n]);return $.jsxs(Yle,{theme:i,children:[$.jsx(iue,{root:e}),r]})}function iue({root:t=":host, :root"}){const e=[t,"[data-theme]"].join(",");return $.jsx(mx,{styles:n=>({[e]:n.__cssVars})})}Mo({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function aue(){const{colorMode:t}=i2();return $.jsx(mx,{styles:e=>{const n=vV(e,"styles.global"),r=Zs(n,{theme:e,colorMode:t});return r?wV(r)(e):void 0}})}const[sue,oue]=Mo({strict:!1,name:"PortalManagerContext"});function o$(t){const{children:e,zIndex:n}=t;return $.jsx(sue,{value:{zIndex:n},children:e})}o$.displayName="PortalManager";const a2=w.createContext({getDocument(){return document},getWindow(){return window}});a2.displayName="EnvironmentContext";function lue({defer:t}={}){const[,e]=w.useReducer(n=>n+1,0);return eS(()=>{t&&e()},[t]),w.useContext(a2)}function l$(t){const{children:e,environment:n,disabled:r}=t,i=w.useRef(null),a=w.useMemo(()=>n||{getDocument:()=>{var o;return((o=i.current)==null?void 0:o.ownerDocument)??document},getWindow:()=>{var o;return((o=i.current)==null?void 0:o.ownerDocument.defaultView)??window}},[n]),s=!r||!n;return $.jsxs(a2.Provider,{value:a,children:[e,s&&$.jsx("span",{id:"__chakra_env",hidden:!0,ref:i})]})}l$.displayName="EnvironmentProvider";const uue=t=>{const{children:e,colorModeManager:n,portalZIndex:r,resetScope:i,resetCSS:a=!0,theme:s={},environment:o,cssVarsRoot:l,disableEnvironment:u,disableGlobalStyle:c}=t,d=$.jsx(l$,{environment:o,disabled:u,children:e});return $.jsx(rue,{theme:s,cssVarsRoot:l,children:$.jsxs(i$,{colorModeManager:n,options:s.config,children:[a?$.jsx(nue,{scope:i}):$.jsx(tue,{}),!c&&$.jsx(aue,{}),r?$.jsx(o$,{zIndex:r,children:d}):d]})})};function cue(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...r)=>t(...r);return new Proxy(n,{get:(r,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}function gx(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const oI=t=>Array.isArray(t);function u$(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function s2(t,e,n,r){if(typeof e=="function"){const[i,a]=E4(r);e=e(n!==void 0?n:t.custom,i,a)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,a]=E4(r);e=e(n!==void 0?n:t.custom,i,a)}return e}function bx(t,e,n){const r=t.getProps();return s2(r,e,n!==void 0?n:r.custom,t)}const o2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],l2=["initial",...o2],zb=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Cf=new Set(zb),ru=t=>t*1e3,iu=t=>t/1e3,due={type:"spring",stiffness:500,damping:25,restSpeed:10},fue=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),pue={type:"keyframes",duration:.8},hue={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mue=(t,{keyframes:e})=>e.length>2?pue:Cf.has(t)?t.startsWith("scale")?fue(e[1]):due:hue;function u2(t,e){return t?t[e]||t.default||t:void 0}const gue={skipAnimations:!1,useManualTiming:!1},bue=t=>t!==null;function yx(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(bue),a=e&&n!=="loop"&&e%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const ma=t=>t;function yue(t){let e=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function o(u){a.has(u)&&(l.schedule(u),t()),u(s)}const l={schedule:(u,c=!1,d=!1)=>{const m=d&&r?e:n;return c&&a.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(s=u,r){i=!0;return}r=!0,[e,n]=[n,e],n.clear(),e.forEach(o),r=!1,i&&(i=!1,l.process(u))}};return l}const Dv=["read","resolveKeyframes","update","preRender","render","postRender"],vue=40;function c$(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,s=Dv.reduce((b,E)=>(b[E]=yue(a),b),{}),{read:o,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=s,m=()=>{const b=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(b-i.timestamp,vue),1),i.timestamp=b,i.isProcessing=!0,o.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(m))},g=()=>{n=!0,r=!0,i.isProcessing||t(m)};return{schedule:Dv.reduce((b,E)=>{const _=s[E];return b[E]=(A,I=!1,x=!1)=>(n||g(),_.schedule(A,I,x)),b},{}),cancel:b=>{for(let E=0;E(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Eue=1e-7,_ue=12;function Sue(t,e,n,r,i){let a,s,o=0;do s=e+(n-e)/2,a=d$(s,r,i)-t,a>0?n=s:e=s;while(Math.abs(a)>Eue&&++o<_ue);return s}function Hb(t,e,n,r){if(t===e&&n===r)return ma;const i=a=>Sue(a,0,1,t,n);return a=>a===0||a===1?a:d$(i(a),e,r)}const f$=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,p$=t=>e=>1-t(1-e),h$=Hb(.33,1.53,.69,.99),c2=p$(h$),m$=f$(c2),g$=t=>(t*=2)<1?.5*c2(t):.5*(2-Math.pow(2,-10*(t-1))),d2=t=>1-Math.sin(Math.acos(t)),b$=p$(d2),y$=f$(d2),v$=t=>/^0[^.\s]+$/u.test(t);function Aue(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||v$(t):!0}let lI=ma;const E$=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),_$=t=>e=>typeof e=="string"&&e.startsWith(t),S$=_$("--"),xue=_$("var(--"),f2=t=>xue(t)?Tue.test(t.split("/*")[0].trim()):!1,Tue=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,wue=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Cue(t){const e=wue.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}function A$(t,e,n=1){const[r,i]=Cue(t);if(!r)return;const a=window.getComputedStyle(e).getPropertyValue(r);if(a){const s=a.trim();return E$(s)?parseFloat(s):s}return f2(i)?A$(i,e,n+1):i}const Ec=(t,e,n)=>n>e?e:ntypeof t=="number",parse:parseFloat,transform:t=>t},Z0={...dm,transform:t=>Ec(0,1,t)},Lv={...dm,default:1},Gb=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),$u=Gb("deg"),ol=Gb("%"),cn=Gb("px"),Rue=Gb("vh"),Iue=Gb("vw"),_4={...ol,parse:t=>ol.parse(t)/100,transform:t=>ol.transform(t*100)},Mue=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),S4=t=>t===dm||t===cn,A4=(t,e)=>parseFloat(t.split(", ")[e]),x4=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return A4(i[1],e);{const a=r.match(/^matrix\((.+)\)$/u);return a?A4(a[1],t):0}},Nue=new Set(["x","y","z"]),Oue=zb.filter(t=>!Nue.has(t));function Due(t){const e=[];return Oue.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Bh={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:x4(4,13),y:x4(5,14)};Bh.translateX=Bh.x;Bh.translateY=Bh.y;const x$=t=>e=>e.test(t),Lue={test:t=>t==="auto",parse:t=>t},T$=[dm,cn,ol,$u,Iue,Rue,Lue],T4=t=>T$.find(x$(t)),qd=new Set;let uI=!1,cI=!1;function w$(){if(cI){const t=Array.from(qd).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=Due(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,s])=>{var o;(o=r.getValue(a))===null||o===void 0||o.set(s)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}cI=!1,uI=!1,qd.forEach(t=>t.complete()),qd.clear()}function C$(){qd.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(cI=!0)})}function kue(){C$(),w$()}class p2{constructor(e,n,r,i,a,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(qd.add(this),uI||(uI=!0,dr.read(C$),dr.resolveKeyframes(w$))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;for(let a=0;aMath.round(t*1e5)/1e5,h2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Pue(t){return t==null}const Bue=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,m2=(t,e)=>n=>!!(typeof n=="string"&&Bue.test(n)&&n.startsWith(t)||e&&!Pue(n)&&Object.prototype.hasOwnProperty.call(n,e)),R$=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,a,s,o]=r.match(h2);return{[t]:parseFloat(i),[e]:parseFloat(a),[n]:parseFloat(s),alpha:o!==void 0?parseFloat(o):1}},Fue=t=>Ec(0,255,t),ww={...dm,transform:t=>Math.round(Fue(t))},Nd={test:m2("rgb","red"),parse:R$("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+ww.transform(t)+", "+ww.transform(e)+", "+ww.transform(n)+", "+f0(Z0.transform(r))+")"};function Uue(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const dI={test:m2("#"),parse:Uue,transform:Nd.transform},Wp={test:m2("hsl","hue"),parse:R$("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+ol.transform(f0(e))+", "+ol.transform(f0(n))+", "+f0(Z0.transform(r))+")"},ca={test:t=>Nd.test(t)||dI.test(t)||Wp.test(t),parse:t=>Nd.test(t)?Nd.parse(t):Wp.test(t)?Wp.parse(t):dI.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Nd.transform(t):Wp.transform(t)},zue=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Hue(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(h2))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(zue))===null||n===void 0?void 0:n.length)||0)>0}const I$="number",M$="color",Gue="var",Vue="var(",w4="${}",$ue=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Q0(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const o=e.replace($ue,l=>(ca.test(l)?(r.color.push(a),i.push(M$),n.push(ca.parse(l))):l.startsWith(Vue)?(r.var.push(a),i.push(Gue),n.push(l)):(r.number.push(a),i.push(I$),n.push(parseFloat(l))),++a,w4)).split(w4);return{values:n,split:o,indexes:r,types:i}}function N$(t){return Q0(t).values}function O$(t){const{split:e,types:n}=Q0(t),r=e.length;return i=>{let a="";for(let s=0;stypeof t=="number"?0:t;function jue(t){const e=N$(t);return O$(t)(e.map(Wue))}const _c={test:Hue,parse:N$,createTransformer:O$,getAnimatableNone:jue},Yue=new Set(["brightness","contrast","saturate","opacity"]);function que(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(h2)||[];if(!r)return t;const i=n.replace(r,"");let a=Yue.has(e)?1:0;return r!==n&&(a*=100),e+"("+a+i+")"}const Xue=/\b([a-z-]*)\(.*?\)/gu,fI={..._c,getAnimatableNone:t=>{const e=t.match(Xue);return e?e.map(que).join(" "):t}},Kue={borderWidth:cn,borderTopWidth:cn,borderRightWidth:cn,borderBottomWidth:cn,borderLeftWidth:cn,borderRadius:cn,radius:cn,borderTopLeftRadius:cn,borderTopRightRadius:cn,borderBottomRightRadius:cn,borderBottomLeftRadius:cn,width:cn,maxWidth:cn,height:cn,maxHeight:cn,top:cn,right:cn,bottom:cn,left:cn,padding:cn,paddingTop:cn,paddingRight:cn,paddingBottom:cn,paddingLeft:cn,margin:cn,marginTop:cn,marginRight:cn,marginBottom:cn,marginLeft:cn,backgroundPositionX:cn,backgroundPositionY:cn},Zue={rotate:$u,rotateX:$u,rotateY:$u,rotateZ:$u,scale:Lv,scaleX:Lv,scaleY:Lv,scaleZ:Lv,skew:$u,skewX:$u,skewY:$u,distance:cn,translateX:cn,translateY:cn,translateZ:cn,x:cn,y:cn,z:cn,perspective:cn,transformPerspective:cn,opacity:Z0,originX:_4,originY:_4,originZ:cn},C4={...dm,transform:Math.round},g2={...Kue,...Zue,zIndex:C4,size:cn,fillOpacity:Z0,strokeOpacity:Z0,numOctaves:C4},Que={...g2,color:ca,backgroundColor:ca,outlineColor:ca,fill:ca,stroke:ca,borderColor:ca,borderTopColor:ca,borderRightColor:ca,borderBottomColor:ca,borderLeftColor:ca,filter:fI,WebkitFilter:fI},b2=t=>Que[t];function D$(t,e){let n=b2(t);return n!==fI&&(n=_c),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Jue=new Set(["auto","none","0"]);function ece(t,e,n){let r=0,i;for(;r{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function y2(t){return typeof t=="function"}let w_;function tce(){w_=void 0}const ll={now:()=>(w_===void 0&&ll.set(zi.isProcessing||gue.useManualTiming?zi.timestamp:performance.now()),w_),set:t=>{w_=t,queueMicrotask(tce)}},R4=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(_c.test(t)||t==="0")&&!t.startsWith("url("));function nce(t){const e=t[0];if(t.length===1)return!0;for(let n=0;nice?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&kue(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=ll.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:s,onComplete:o,onUpdate:l,isGenerator:u}=this.options;if(!u&&!rce(e,r,i,a))if(s)this.options.duration=0;else{l==null||l(yx(e,this.options,n)),o==null||o(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function P$(t,e){return e?t*(1e3/e):0}const ace=5;function B$(t,e,n){const r=Math.max(e-ace,0);return P$(n-t(r),e-r)}const Cw=.001,sce=.01,oce=10,lce=.05,uce=1;function cce({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let i,a,s=1-e;s=Ec(lce,uce,s),t=Ec(sce,oce,iu(t)),s<1?(i=u=>{const c=u*s,d=c*t,f=c-n,m=pI(u,s),g=Math.exp(-d);return Cw-f/m*g},a=u=>{const d=u*s*t,f=d*n+n,m=Math.pow(s,2)*Math.pow(u,2)*t,g=Math.exp(-d),y=pI(Math.pow(u,2),s);return(-i(u)+Cw>0?-1:1)*((f-m)*g)/y}):(i=u=>{const c=Math.exp(-u*t),d=(u-n)*t+1;return-Cw+c*d},a=u=>{const c=Math.exp(-u*t),d=(n-u)*(t*t);return c*d});const o=5/t,l=fce(i,a,o);if(t=ru(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:t}}}const dce=12;function fce(t,e,n){let r=n;for(let i=1;it[n]!==void 0)}function mce(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!I4(t,hce)&&I4(t,pce)){const n=cce(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function F$({keyframes:t,restDelta:e,restSpeed:n,...r}){const i=t[0],a=t[t.length-1],s={done:!1,value:i},{stiffness:o,damping:l,mass:u,duration:c,velocity:d,isResolvedFromDuration:f}=mce({...r,velocity:-iu(r.velocity||0)}),m=d||0,g=l/(2*Math.sqrt(o*u)),y=a-i,v=iu(Math.sqrt(o/u)),b=Math.abs(y)<5;n||(n=b?.01:2),e||(e=b?.005:.5);let E;if(g<1){const _=pI(v,g);E=A=>{const I=Math.exp(-g*v*A);return a-I*((m+g*v*y)/_*Math.sin(_*A)+y*Math.cos(_*A))}}else if(g===1)E=_=>a-Math.exp(-v*_)*(y+(m+v*y)*_);else{const _=v*Math.sqrt(g*g-1);E=A=>{const I=Math.exp(-g*v*A),x=Math.min(_*A,300);return a-I*((m+g*v*y)*Math.sinh(x)+_*y*Math.cosh(x))/_}}return{calculatedDuration:f&&c||null,next:_=>{const A=E(_);if(f)s.done=_>=c;else{let I=0;g<1&&(I=_===0?ru(m):B$(E,_,A));const x=Math.abs(I)<=n,R=Math.abs(a-A)<=e;s.done=x&&R}return s.value=s.done?a:A,s}}}function M4({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:s,min:o,max:l,restDelta:u=.5,restSpeed:c}){const d=t[0],f={done:!1,value:d},m=O=>o!==void 0&&Ol,g=O=>o===void 0?l:l===void 0||Math.abs(o-O)-y*Math.exp(-O/r),_=O=>b+E(O),A=O=>{const N=E(O),M=_(O);f.done=Math.abs(N)<=u,f.value=f.done?b:M};let I,x;const R=O=>{m(f.value)&&(I=O,x=F$({keyframes:[f.value,g(f.value)],velocity:B$(_,O,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return R(0),{calculatedDuration:null,next:O=>{let N=!1;return!x&&I===void 0&&(N=!0,A(O),R(O)),I!==void 0&&O>=I?x.next(O-I):(!N&&A(O),f)}}}const gce=Hb(.42,0,1,1),bce=Hb(0,0,.58,1),U$=Hb(.42,0,.58,1),yce=t=>Array.isArray(t)&&typeof t[0]!="number",v2=t=>Array.isArray(t)&&typeof t[0]=="number",N4={linear:ma,easeIn:gce,easeInOut:U$,easeOut:bce,circIn:d2,circInOut:y$,circOut:b$,backIn:c2,backInOut:m$,backOut:h$,anticipate:g$},O4=t=>{if(v2(t)){lI(t.length===4);const[e,n,r,i]=t;return Hb(e,n,r,i)}else if(typeof t=="string")return lI(N4[t]!==void 0),N4[t];return t},vce=(t,e)=>n=>e(t(n)),au=(...t)=>t.reduce(vce),Fh=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},Fr=(t,e,n)=>t+(e-t)*n;function Rw(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ece({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,a=0,s=0;if(!e)i=a=s=n;else{const o=n<.5?n*(1+e):n+e-n*e,l=2*n-o;i=Rw(l,o,t+1/3),a=Rw(l,o,t),s=Rw(l,o,t-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(s*255),alpha:r}}function aS(t,e){return n=>n>0?e:t}const Iw=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},_ce=[dI,Nd,Wp],Sce=t=>_ce.find(e=>e.test(t));function D4(t){const e=Sce(t);if(!e)return!1;let n=e.parse(t);return e===Wp&&(n=Ece(n)),n}const L4=(t,e)=>{const n=D4(t),r=D4(e);if(!n||!r)return aS(t,e);const i={...n};return a=>(i.red=Iw(n.red,r.red,a),i.green=Iw(n.green,r.green,a),i.blue=Iw(n.blue,r.blue,a),i.alpha=Fr(n.alpha,r.alpha,a),Nd.transform(i))},hI=new Set(["none","hidden"]);function Ace(t,e){return hI.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function xce(t,e){return n=>Fr(t,e,n)}function E2(t){return typeof t=="number"?xce:typeof t=="string"?f2(t)?aS:ca.test(t)?L4:Cce:Array.isArray(t)?z$:typeof t=="object"?ca.test(t)?L4:Tce:aS}function z$(t,e){const n=[...t],r=n.length,i=t.map((a,s)=>E2(a)(a,e[s]));return a=>{for(let s=0;s{for(const a in r)n[a]=r[a](i);return n}}function wce(t,e){var n;const r=[],i={color:0,var:0,number:0};for(let a=0;a{const n=_c.createTransformer(e),r=Q0(t),i=Q0(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?hI.has(t)&&!i.values.length||hI.has(e)&&!r.values.length?Ace(t,e):au(z$(wce(r,i),i.values),n):aS(t,e)};function H$(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Fr(t,e,n):E2(t)(t,e)}function Rce(t,e,n){const r=[],i=n||H$,a=t.length-1;for(let s=0;se[0];if(a===2&&t[0]===t[1])return()=>e[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=Rce(e,r,i),o=s.length,l=u=>{let c=0;if(o>1)for(;cl(Ec(t[0],t[a-1],u)):l}function Mce(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Fh(0,e,r);t.push(Fr(n,1,i))}}function Nce(t){const e=[0];return Mce(e,t.length-1),e}function Oce(t,e){return t.map(n=>n*e)}function Dce(t,e){return t.map(()=>e||U$).splice(0,t.length-1)}function sS({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=yce(r)?r.map(O4):O4(r),a={done:!1,value:e[0]},s=Oce(n&&n.length===e.length?n:Nce(e),t),o=Ice(s,e,{ease:Array.isArray(i)?i:Dce(e,i)});return{calculatedDuration:t,next:l=>(a.value=o(l),a.done=l>=t,a)}}const k4=2e4;function Lce(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e=k4?1/0:e}const kce=t=>{const e=({timestamp:n})=>t(n);return{start:()=>dr.update(e,!0),stop:()=>vc(e),now:()=>zi.isProcessing?zi.timestamp:ll.now()}},Pce={decay:M4,inertia:M4,tween:sS,keyframes:sS,spring:F$},Bce=t=>t/100;class _2 extends k${constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:a}=this.options,s=(i==null?void 0:i.KeyframeResolver)||p2,o=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(a,o,n,r,i),this.resolver.scheduleResolve()}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:s=0}=this.options,o=y2(n)?n:Pce[n]||sS;let l,u;o!==sS&&typeof e[0]!="number"&&(l=au(Bce,H$(e[0],e[1])),e=[0,100]);const c=o({...this.options,keyframes:e});a==="mirror"&&(u=o({...this.options,keyframes:[...e].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=Lce(c));const{calculatedDuration:d}=c,f=d+i,m=f*(r+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:m}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:s,mapPercentToKeyframes:o,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:d}=r;if(this.startTime===null)return a.next(0);const{delay:f,repeat:m,repeatType:g,repeatDelay:y,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const b=this.currentTime-f*(this.speed>=0?1:-1),E=this.speed>=0?b<0:b>c;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let _=this.currentTime,A=a;if(m){const O=Math.min(this.currentTime,c)/d;let N=Math.floor(O),M=O%1;!M&&O>=1&&(M=1),M===1&&N--,N=Math.min(N,m+1),!!(N%2)&&(g==="reverse"?(M=1-M,y&&(M-=y/d)):g==="mirror"&&(A=s)),_=Ec(0,1,M)*d}const I=E?{done:!1,value:l[0]}:A.next(_);o&&(I.value=o(I.value));let{done:x}=I;!E&&u!==null&&(x=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&x);return R&&i!==void 0&&(I.value=yx(l,this.options,i)),v&&v(I.value),R&&this.finish(),I}get duration(){const{resolved:e}=this;return e?iu(e.calculatedDuration):0}get time(){return iu(this.currentTime)}set time(e){e=ru(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=iu(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=kce,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Fce=new Set(["opacity","clipPath","filter","transform"]),Uce=10,zce=(t,e)=>{let n="";const r=Math.max(Math.round(e/Uce),2);for(let i=0;i(e===void 0&&(e=t()),e)}const Hce={linearEasing:void 0};function Gce(t,e){const n=S2(t);return()=>{var r;return(r=Hce[e])!==null&&r!==void 0?r:n()}}const oS=Gce(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function G$(t){return!!(typeof t=="function"&&oS()||!t||typeof t=="string"&&(t in mI||oS())||v2(t)||Array.isArray(t)&&t.every(G$))}const Yg=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,mI={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yg([0,.65,.55,1]),circOut:Yg([.55,0,1,.45]),backIn:Yg([.31,.01,.66,-.59]),backOut:Yg([.33,1.53,.69,.99])};function V$(t,e){if(t)return typeof t=="function"&&oS()?zce(t,e):v2(t)?Yg(t):Array.isArray(t)?t.map(n=>V$(n,e)||mI.easeOut):mI[t]}function Vce(t,e,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=V$(o,i);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:s==="reverse"?"alternate":"normal"})}function P4(t,e){t.timeline=e,t.onfinish=null}const $ce=S2(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),lS=10,Wce=2e4;function jce(t){return y2(t.type)||t.type==="spring"||!G$(t.ease)}function Yce(t,e){const n=new _2({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const i=[];let a=0;for(;!r.done&&athis.onKeyframesResolved(s,o),n,r,i),this.resolver.scheduleResolve()}initPlayback(e,n){var r;let{duration:i=300,times:a,ease:s,type:o,motionValue:l,name:u,startTime:c}=this.options;if(!(!((r=l.owner)===null||r===void 0)&&r.current))return!1;if(typeof s=="string"&&oS()&&qce(s)&&(s=$$[s]),jce(this.options)){const{onComplete:f,onUpdate:m,motionValue:g,element:y,...v}=this.options,b=Yce(e,v);e=b.keyframes,e.length===1&&(e[1]=e[0]),i=b.duration,a=b.times,s=b.ease,o="keyframes"}const d=Vce(l.owner.current,u,e,{...this.options,duration:i,times:a,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(P4(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(yx(e,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:a,type:o,ease:s,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return iu(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return iu(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=ru(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return ma;const{animation:r}=n;P4(r,e)}return ma}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:i,type:a,ease:s,times:o}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:d,element:f,...m}=this.options,g=new _2({...m,keyframes:r,duration:i,type:a,ease:s,times:o,isGenerator:!0}),y=ru(this.time);u.setWithVelocity(g.sample(y-lS).value,g.sample(y).value,lS)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:i,repeatType:a,damping:s,type:o}=e;return $ce()&&r&&Fce.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&a!=="mirror"&&s!==0&&o!=="inertia"}}const Xce=S2(()=>window.ScrollTimeline!==void 0);class Kce{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,n){return Promise.all(this.animations).then(e).catch(n)}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;rXce()&&i.attachTimeline?i.attachTimeline(e):n(i));return()=>{r.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;nn[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Zce({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:s,repeatDelay:o,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const A2=(t,e,n,r={},i,a)=>s=>{const o=u2(r,t)||{},l=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-ru(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:f=>{e.set(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:a?void 0:i};Zce(o)||(c={...c,...mue(t,c)}),c.duration&&(c.duration=ru(c.duration)),c.repeatDelay&&(c.repeatDelay=ru(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),d&&!a&&e.get()!==void 0){const f=yx(c.keyframes,o);if(f!==void 0)return dr.update(()=>{c.onUpdate(f),c.onComplete()}),new Kce([])}return!a&&B4.supports(c)?new B4(c):new _2(c)},Qce=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Jce=t=>oI(t)?t[t.length-1]||0:t;function x2(t,e){t.indexOf(e)===-1&&t.push(e)}function T2(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class w2{constructor(){this.subscriptions=[]}add(e){return x2(this.subscriptions,e),()=>T2(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let a=0;a!isNaN(parseFloat(t));class tde{constructor(e,n={}){this.version="11.11.11",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=ll.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ll.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ede(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new w2);const r=this.events[e].add(n);return e==="change"?()=>{r(),dr.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ll.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>F4)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,F4);return P$(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function J0(t,e){return new tde(t,e)}function nde(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,J0(n))}function rde(t,e){const n=bx(t,e);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const s in a){const o=Jce(a[s]);nde(t,s,o)}}const C2=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ide="framerAppearId",W$="data-"+C2(ide);function j$(t){return t.props[W$]}const pa=t=>!!(t&&t.getVelocity);function ade(t){return!!(pa(t)&&t.add)}function gI(t,e){const n=t.getValue("willChange");if(ade(n))return n.add(e)}function sde({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function Y$(t,e,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:s=t.getDefaultTransition(),transitionEnd:o,...l}=e;r&&(s=r);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const d in l){const f=t.getValue(d,(a=t.latestValues[d])!==null&&a!==void 0?a:null),m=l[d];if(m===void 0||c&&sde(c,d))continue;const g={delay:n,...u2(s||{},d)};let y=!1;if(window.MotionHandoffAnimation){const b=j$(t);if(b){const E=window.MotionHandoffAnimation(b,d,dr);E!==null&&(g.startTime=E,y=!0)}}gI(t,d),f.start(A2(d,f,m,t.shouldReduceMotion&&Cf.has(d)?{type:!1}:g,t,y));const v=f.animation;v&&u.push(v)}return o&&Promise.all(u).then(()=>{dr.update(()=>{o&&rde(t,o)})}),u}function bI(t,e,n={}){var r;const i=bx(t,e,n.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:a=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const s=i?()=>Promise.all(Y$(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=a;return ode(t,e,c+u,d,f,n)}:()=>Promise.resolve(),{when:l}=a;if(l){const[u,c]=l==="beforeChildren"?[s,o]:[o,s];return u().then(()=>c())}else return Promise.all([s(),o(n.delay)])}function ode(t,e,n=0,r=0,i=1,a){const s=[],o=(t.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>o-u*r;return Array.from(t.variantChildren).sort(lde).forEach((u,c)=>{u.notify("AnimationStart",e),s.push(bI(u,e,{...a,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(s)}function lde(t,e){return t.sortNodePosition(e)}function ude(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(a=>bI(t,a,n));r=Promise.all(i)}else if(typeof e=="string")r=bI(t,e,n);else{const i=typeof e=="function"?bx(t,e,n.custom):e;r=Promise.all(Y$(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const cde=l2.length;function q$(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?q$(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;nPromise.all(e.map(({animation:n,options:r})=>ude(t,n,r)))}function hde(t){let e=pde(t),n=U4(),r=!0;const i=l=>(u,c)=>{var d;const f=bx(t,c,l==="exit"?(d=t.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:m,transitionEnd:g,...y}=f;u={...u,...y,...g}}return u};function a(l){e=l(t)}function s(l){const{props:u}=t,c=q$(t.parent)||{},d=[],f=new Set;let m={},g=1/0;for(let v=0;vg&&A,N=!1;const M=Array.isArray(_)?_:[_];let B=M.reduce(i(b),{});I===!1&&(B={});const{prevResolvedValues:G={}}=E,W={...G,...B},K=ee=>{O=!0,f.has(ee)&&(N=!0,f.delete(ee)),E.needsAnimating[ee]=!0;const F=t.getValue(ee);F&&(F.liveStyle=!1)};for(const ee in W){const F=B[ee],ie=G[ee];if(m.hasOwnProperty(ee))continue;let J=!1;oI(F)&&oI(ie)?J=!u$(F,ie):J=F!==ie,J?F!=null?K(ee):f.add(ee):F!==void 0&&f.has(ee)?K(ee):E.protectedKeys[ee]=!0}E.prevProp=_,E.prevResolvedValues=B,E.isActive&&(m={...m,...B}),r&&t.blockInitialAnimation&&(O=!1),O&&(!(x&&R)||N)&&d.push(...M.map(ee=>({animation:ee,options:{type:b}})))}if(f.size){const v={};f.forEach(b=>{const E=t.getBaseTarget(b),_=t.getValue(b);_&&(_.liveStyle=!0),v[b]=E??null}),d.push({animation:v})}let y=!!d.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(y=!1),r=!1,y?e(d):Promise.resolve()}function o(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(f=>{var m;return(m=f.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),n[l].isActive=u;const d=s(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:s,setActive:o,setAnimateFunction:a,getState:()=>n,reset:()=>{n=U4(),r=!0}}}function mde(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!u$(e,t):!1}function rd(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function U4(){return{animate:rd(!0),whileInView:rd(),whileHover:rd(),whileTap:rd(),whileDrag:rd(),whileFocus:rd(),exit:rd()}}class Oc{constructor(e){this.isMounted=!1,this.node=e}update(){}}class gde extends Oc{constructor(e){super(e),e.animationState||(e.animationState=hde(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();gx(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let bde=0;class yde extends Oc{constructor(){super(...arguments),this.id=bde++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const vde={animation:{Feature:gde},exit:{Feature:yde}},X$=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function vx(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const Ede=t=>e=>X$(e)&&t(e,vx(e));function Zl(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function su(t,e,n,r){return Zl(t,e,Ede(n),r)}const z4=(t,e)=>Math.abs(t-e);function _de(t,e){const n=z4(t.x,e.x),r=z4(t.y,e.y);return Math.sqrt(n**2+r**2)}class K${constructor(e,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Nw(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=_de(d.offset,{x:0,y:0})>=3;if(!f&&!m)return;const{point:g}=d,{timestamp:y}=zi;this.history.push({...g,timestamp:y});const{onStart:v,onMove:b}=this.handlers;f||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Mw(f,this.transformPagePoint),dr.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Nw(d.type==="pointercancel"?this.lastMoveEventInfo:Mw(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,v),g&&g(d,v)},!X$(e))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=vx(e),o=Mw(s,this.transformPagePoint),{point:l}=o,{timestamp:u}=zi;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,Nw(o,this.history)),this.removeListeners=au(su(this.contextWindow,"pointermove",this.handlePointerMove),su(this.contextWindow,"pointerup",this.handlePointerUp),su(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),vc(this.updatePoint)}}function Mw(t,e){return e?{point:e(t.point)}:t}function H4(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Nw({point:t},e){return{point:t,delta:H4(t,Z$(e)),offset:H4(t,Sde(e)),velocity:Ade(e,.1)}}function Sde(t){return t[0]}function Z$(t){return t[t.length-1]}function Ade(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=Z$(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>ru(e)));)n--;if(!r)return{x:0,y:0};const a=iu(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const s={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Q$(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const G4=Q$("dragHorizontal"),V4=Q$("dragVertical");function J$(t){let e=!1;if(t==="y")e=V4();else if(t==="x")e=G4();else{const n=G4(),r=V4();n&&r?e=()=>{n(),r()}:(n&&n(),r&&r())}return e}function eW(){const t=J$(!0);return t?(t(),!1):!0}function jp(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}const tW=1e-4,xde=1-tW,Tde=1+tW,nW=.01,wde=0-nW,Cde=0+nW;function As(t){return t.max-t.min}function Rde(t,e,n){return Math.abs(t-e)<=n}function $4(t,e,n,r=.5){t.origin=r,t.originPoint=Fr(e.min,e.max,t.origin),t.scale=As(n)/As(e),t.translate=Fr(n.min,n.max,t.origin)-t.originPoint,(t.scale>=xde&&t.scale<=Tde||isNaN(t.scale))&&(t.scale=1),(t.translate>=wde&&t.translate<=Cde||isNaN(t.translate))&&(t.translate=0)}function p0(t,e,n,r){$4(t.x,e.x,n.x,r?r.originX:void 0),$4(t.y,e.y,n.y,r?r.originY:void 0)}function W4(t,e,n){t.min=n.min+e.min,t.max=t.min+As(e)}function Ide(t,e,n){W4(t.x,e.x,n.x),W4(t.y,e.y,n.y)}function j4(t,e,n){t.min=e.min-n.min,t.max=t.min+As(e)}function h0(t,e,n){j4(t.x,e.x,n.x),j4(t.y,e.y,n.y)}function Mde(t,{min:e,max:n},r){return e!==void 0&&tn&&(t=r?Fr(n,t,r.max):Math.min(t,n)),t}function Y4(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Nde(t,{top:e,left:n,bottom:r,right:i}){return{x:Y4(t.x,n,i),y:Y4(t.y,e,r)}}function q4(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.minr?n=Fh(e.min,e.max-r,t.min):r>i&&(n=Fh(t.min,t.max-i,e.min)),Ec(0,1,n)}function Lde(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const yI=.35;function kde(t=yI){return t===!1?t=0:t===!0&&(t=yI),{x:X4(t,"left","right"),y:X4(t,"top","bottom")}}function X4(t,e,n){return{min:K4(t,e),max:K4(t,n)}}function K4(t,e){return typeof t=="number"?t:t[e]||0}const Z4=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yp=()=>({x:Z4(),y:Z4()}),Q4=()=>({min:0,max:0}),Jr=()=>({x:Q4(),y:Q4()});function Vs(t){return[t("x"),t("y")]}function rW({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Pde({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Bde(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ow(t){return t===void 0||t===1}function vI({scale:t,scaleX:e,scaleY:n}){return!Ow(t)||!Ow(e)||!Ow(n)}function yd(t){return vI(t)||iW(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function iW(t){return J4(t.x)||J4(t.y)}function J4(t){return t&&t!=="0%"}function uS(t,e,n){const r=t-n,i=e*r;return n+i}function ez(t,e,n,r,i){return i!==void 0&&(t=uS(t,i,r)),uS(t,n,r)+e}function EI(t,e=0,n=1,r,i){t.min=ez(t.min,e,n,r,i),t.max=ez(t.max,e,n,r,i)}function aW(t,{x:e,y:n}){EI(t.x,e.translate,e.scale,e.originPoint),EI(t.y,n.translate,n.scale,n.originPoint)}const tz=.999999999999,nz=1.0000000000001;function Fde(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let a,s;for(let o=0;otz&&(e.x=1),e.ytz&&(e.y=1)}function qp(t,e){t.min=t.min+e,t.max=t.max+e}function rz(t,e,n,r,i=.5){const a=Fr(t.min,t.max,i);EI(t,e,n,a,r)}function Xp(t,e){rz(t.x,e.x,e.scaleX,e.scale,e.originX),rz(t.y,e.y,e.scaleY,e.scale,e.originY)}function sW(t,e){return rW(Bde(t.getBoundingClientRect(),e))}function Ude(t,e,n){const r=sW(t,n),{scroll:i}=e;return i&&(qp(r.x,i.offset.x),qp(r.y,i.offset.y)),r}const oW=({current:t})=>t?t.ownerDocument.defaultView:null,zde=new WeakMap;class Hde{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Jr(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(vx(c,"page").point)},a=(c,d)=>{const{drag:f,dragPropagation:m,onDragStart:g}=this.getProps();if(f&&!m&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=J$(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Vs(v=>{let b=this.getAxisMotionValue(v).get()||0;if(ol.test(b)){const{projection:E}=this.visualElement;if(E&&E.layout){const _=E.layout.layoutBox[v];_&&(b=As(_)*(parseFloat(b)/100))}}this.originPoint[v]=b}),g&&dr.postRender(()=>g(c,d)),gI(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},s=(c,d)=>{const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:g,onDrag:y}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:v}=d;if(m&&this.currentDirection===null){this.currentDirection=Gde(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),y&&y(c,d)},o=(c,d)=>this.stop(c,d),l=()=>Vs(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new K$(e,{onSessionStart:i,onStart:a,onMove:s,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:oW(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&dr.postRender(()=>a(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!kv(e,i,this.currentDirection))return;const a=this.getAxisMotionValue(e);let s=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(s=Mde(s,this.constraints[e],this.elastic[e])),a.set(s)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,a=this.constraints;n&&jp(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Nde(i.layoutBox,n):this.constraints=!1,this.elastic=kde(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Vs(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=Lde(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!jp(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=Ude(r,i.root,this.visualElement.getTransformPagePoint());let s=Ode(i.layout.layoutBox,a);if(n){const o=n(Pde(s));this.hasMutatedConstraints=!!o,o&&(s=rW(o))}return s}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Vs(c=>{if(!kv(c,n,this.currentDirection))return;let d=l&&l[c]||{};s&&(d={min:0,max:0});const f=i?200:1e6,m=i?40:1e7,g={type:"inertia",velocity:r?e[c]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(c,g)});return Promise.all(u).then(o)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return gI(this.visualElement,e),r.start(A2(e,r,0,n,this.visualElement,!1))}stopAnimation(){Vs(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Vs(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Vs(n=>{const{drag:r}=this.getProps();if(!kv(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:o}=i.layout.layoutBox[n];a.set(e[n]-Fr(s,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!jp(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Vs(s=>{const o=this.getAxisMotionValue(s);if(o&&this.constraints!==!1){const l=o.get();i[s]=Dde({min:l,max:l},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Vs(s=>{if(!kv(s,e,null))return;const o=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];o.set(Fr(l,u,i[s]))})}addListeners(){if(!this.visualElement.current)return;zde.set(this.visualElement,this);const e=this.visualElement.current,n=su(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();jp(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),dr.read(r);const s=Zl(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Vs(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{s(),n(),a(),o&&o()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:s=yI,dragMomentum:o=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:s,dragMomentum:o}}}function kv(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Gde(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Vde extends Oc{constructor(e){super(e),this.removeGroupControls=ma,this.removeListeners=ma,this.controls=new Hde(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ma}unmount(){this.removeGroupControls(),this.removeListeners()}}const iz=t=>(e,n)=>{t&&dr.postRender(()=>t(e,n))};class $de extends Oc{constructor(){super(...arguments),this.removePointerDownListener=ma}onPointerDown(e){this.session=new K$(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oW(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:iz(e),onStart:iz(n),onMove:r,onEnd:(a,s)=>{delete this.session,i&&dr.postRender(()=>i(a,s))}}}mount(){this.removePointerDownListener=su(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Vb=w.createContext(null);function Wde(){const t=w.useContext(Vb);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,i=w.useId();w.useEffect(()=>r(i),[]);const a=w.useCallback(()=>n&&n(i),[i,n]);return!e&&n?[!1,a]:[!0]}function jde(){return Yde(w.useContext(Vb))}function Yde(t){return t===null?!0:t.isPresent}const R2=w.createContext({}),lW=w.createContext({}),C_={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function az(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const lg={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(cn.test(t))t=parseFloat(t);else return t;const n=az(t,e.target.x),r=az(t,e.target.y);return`${n}% ${r}%`}},qde={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=_c.parse(t);if(i.length>5)return r;const a=_c.createTransformer(t),s=typeof i[0]!="number"?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;i[0+s]/=o,i[1+s]/=l;const u=Fr(o,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),a(i)}},cS={};function Xde(t){Object.assign(cS,t)}const{schedule:I2,cancel:Ize}=c$(queueMicrotask,!1);class Kde extends w.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=e;Xde(Zde),a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),C_.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,s=r.projection;return s&&(s.isPresent=a,i||e.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?s.promote():s.relegate()||dr.postRender(()=>{const o=s.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),I2.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function uW(t){const[e,n]=Wde(),r=w.useContext(R2);return $.jsx(Kde,{...t,layoutGroup:r,switchLayoutGroup:w.useContext(lW),isPresent:e,safeToRemove:n})}const Zde={borderRadius:{...lg,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lg,borderTopRightRadius:lg,borderBottomLeftRadius:lg,borderBottomRightRadius:lg,boxShadow:qde},cW=["TopLeft","TopRight","BottomLeft","BottomRight"],Qde=cW.length,sz=t=>typeof t=="string"?parseFloat(t):t,oz=t=>typeof t=="number"||cn.test(t);function Jde(t,e,n,r,i,a){i?(t.opacity=Fr(0,n.opacity!==void 0?n.opacity:1,efe(r)),t.opacityExit=Fr(e.opacity!==void 0?e.opacity:1,0,tfe(r))):a&&(t.opacity=Fr(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;sre?1:n(Fh(t,e,r))}function uz(t,e){t.min=e.min,t.max=e.max}function Us(t,e){uz(t.x,e.x),uz(t.y,e.y)}function cz(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function dz(t,e,n,r,i){return t-=e,t=uS(t,1/n,r),i!==void 0&&(t=uS(t,1/i,r)),t}function nfe(t,e=0,n=1,r=.5,i,a=t,s=t){if(ol.test(e)&&(e=parseFloat(e),e=Fr(s.min,s.max,e/100)-s.min),typeof e!="number")return;let o=Fr(a.min,a.max,r);t===a&&(o-=e),t.min=dz(t.min,e,n,o,i),t.max=dz(t.max,e,n,o,i)}function fz(t,e,[n,r,i],a,s){nfe(t,e[n],e[r],e[i],e.scale,a,s)}const rfe=["x","scaleX","originX"],ife=["y","scaleY","originY"];function pz(t,e,n,r){fz(t.x,e,rfe,n?n.x:void 0,r?r.x:void 0),fz(t.y,e,ife,n?n.y:void 0,r?r.y:void 0)}function hz(t){return t.translate===0&&t.scale===1}function fW(t){return hz(t.x)&&hz(t.y)}function mz(t,e){return t.min===e.min&&t.max===e.max}function afe(t,e){return mz(t.x,e.x)&&mz(t.y,e.y)}function gz(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function pW(t,e){return gz(t.x,e.x)&&gz(t.y,e.y)}function bz(t){return As(t.x)/As(t.y)}function yz(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class sfe{constructor(){this.members=[]}add(e){x2(this.members,e),e.scheduleRender()}remove(e){if(T2(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ofe(t,e,n){let r="";const i=t.x.translate/e.x,a=t.y.translate/e.y,s=(n==null?void 0:n.z)||0;if((i||a||s)&&(r=`translate3d(${i}px, ${a}px, ${s}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:m,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const o=t.x.scale*e.x,l=t.y.scale*e.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const lfe=(t,e)=>t.depth-e.depth;class ufe{constructor(){this.children=[],this.isDirty=!1}add(e){x2(this.children,e),this.isDirty=!0}remove(e){T2(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(lfe),this.isDirty=!1,this.children.forEach(e)}}function R_(t){const e=pa(t)?t.get():t;return Qce(e)?e.toValue():e}function cfe(t,e){const n=ll.now(),r=({timestamp:i})=>{const a=i-n;a>=e&&(vc(r),t(a-e))};return dr.read(r,!0),()=>vc(r)}function dfe(t){return t instanceof SVGElement&&t.tagName!=="svg"}function ffe(t,e,n){const r=pa(t)?t:J0(t);return r.start(A2("",r,e,n)),r.animation}const vd={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},qg=typeof window<"u"&&window.MotionDebug!==void 0,Dw=["","X","Y","Z"],pfe={visibility:"hidden"},vz=1e3;let hfe=0;function Lw(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function hW(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=j$(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",dr,!(i||a))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&hW(r)}function mW({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},o=e==null?void 0:e()){this.id=hfe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,qg&&(vd.totalNodes=vd.resolvedTargetDeltas=vd.recalculatedProjection=0),this.nodes.forEach(bfe),this.nodes.forEach(Sfe),this.nodes.forEach(Afe),this.nodes.forEach(yfe),qg&&window.MotionDebug.record(vd)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;t(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=cfe(f,250),C_.hasAnimatedSinceResize&&(C_.hasAnimatedSinceResize=!1,this.nodes.forEach(_z))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||Rfe,{onLayoutAnimationStart:v,onLayoutAnimationComplete:b}=c.getProps(),E=!this.targetLayout||!pW(this.targetLayout,g)||m,_=!f&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||_||f&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,_);const A={...u2(y,"layout"),onPlay:v,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else f||_z(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,vc(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(xfe),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&hW(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const I=A/1e3;Sz(d.x,s.x,I),Sz(d.y,s.y,I),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(h0(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),wfe(this.relativeTarget,this.relativeTargetOrigin,f,I),_&&afe(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=Jr()),Us(_,this.relativeTarget)),y&&(this.animationValues=c,Jde(c,u,this.latestValues,I,E,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(vc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=dr.update(()=>{C_.hasAnimatedSinceResize=!0,this.currentAnimation=ffe(0,vz,{...s,onUpdate:o=>{this.mixTargetDelta(o),s.onUpdate&&s.onUpdate(o)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(vz),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:c}=s;if(!(!o||!l||!u)){if(this!==s&&this.layout&&u&&gW(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Jr();const d=As(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=As(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}Us(o,l),Xp(o,c),p0(this.projectionDeltaWithTransform,this.layoutCorrected,o,c)}}registerSharedNode(s,o){this.sharedNodes.has(s)||this.sharedNodes.set(s,new sfe),this.sharedNodes.get(s).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:o}=this.options;return o?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:o}=this.options;return o?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let o=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&Lw("z",s,u,this.animationValues);for(let c=0;c{var o;return(o=s.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(Ez),this.root.sharedNodes.clear()}}}function mfe(t){t.updateLayout()}function gfe(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:a}=t.options,s=n.source!==t.layout.source;a==="size"?Vs(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],m=As(f);f.min=r[d].min,f.max=f.min+m}):gW(a,n.layoutBox,r)&&Vs(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],m=As(r[d]);f.max=f.min+m,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+m)});const o=Yp();p0(o,r,n.layoutBox);const l=Yp();s?p0(l,t.applyTransform(i,!0),n.measuredBox):p0(l,r,n.layoutBox);const u=!fW(o);let c=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:m}=d;if(f&&m){const g=Jr();h0(g,n.layoutBox,f.layoutBox);const y=Jr();h0(y,r,m.layoutBox),pW(g,y)||(c=!0),d.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=g,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function bfe(t){qg&&vd.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function yfe(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function vfe(t){t.clearSnapshot()}function Ez(t){t.clearMeasurements()}function Efe(t){t.isLayoutDirty=!1}function _fe(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function _z(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Sfe(t){t.resolveTargetDelta()}function Afe(t){t.calcProjection()}function xfe(t){t.resetSkewAndRotation()}function Tfe(t){t.removeLeadSnapshot()}function Sz(t,e,n){t.translate=Fr(e.translate,0,n),t.scale=Fr(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Az(t,e,n,r){t.min=Fr(e.min,n.min,r),t.max=Fr(e.max,n.max,r)}function wfe(t,e,n,r){Az(t.x,e.x,n.x,r),Az(t.y,e.y,n.y,r)}function Cfe(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Rfe={duration:.45,ease:[.4,0,.1,1]},xz=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Tz=xz("applewebkit/")&&!xz("chrome/")?Math.round:ma;function wz(t){t.min=Tz(t.min),t.max=Tz(t.max)}function Ife(t){wz(t.x),wz(t.y)}function gW(t,e,n){return t==="position"||t==="preserve-aspect"&&!Rde(bz(e),bz(n),.2)}function Mfe(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const Nfe=mW({attachResizeListener:(t,e)=>Zl(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),kw={current:void 0},bW=mW({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!kw.current){const t=new Nfe({});t.mount(window),t.setOptions({layoutScroll:!0}),kw.current=t}return kw.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Ofe={pan:{Feature:$de},drag:{Feature:Vde,ProjectionNode:bW,MeasureLayout:uW}};function Cz(t,e){const n=e?"pointerenter":"pointerleave",r=e?"onHoverStart":"onHoverEnd",i=(a,s)=>{if(a.pointerType==="touch"||eW())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e);const l=o[r];l&&dr.postRender(()=>l(a,s))};return su(t.current,n,i,{passive:!t.getProps()[r]})}class Dfe extends Oc{mount(){this.unmount=au(Cz(this.node,!0),Cz(this.node,!1))}unmount(){}}class Lfe extends Oc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=au(Zl(this.node.current,"focus",()=>this.onFocus()),Zl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const yW=(t,e)=>e?t===e?!0:yW(t,e.parentElement):!1;function Pw(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,vx(n))}class kfe extends Oc{constructor(){super(...arguments),this.removeStartListeners=ma,this.removeEndListeners=ma,this.removeAccessibleListeners=ma,this.startPointerPress=(e,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),a=su(window,"pointerup",(o,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:d}=this.node.getProps(),f=!d&&!yW(this.node.current,o.target)?c:u;f&&dr.update(()=>f(o,l))},{passive:!(r.onTap||r.onPointerUp)}),s=su(window,"pointercancel",(o,l)=>this.cancelPress(o,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=au(a,s),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=a=>{if(a.key!=="Enter"||this.isPressing)return;const s=o=>{o.key!=="Enter"||!this.checkPressEnd()||Pw("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&dr.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Zl(this.node.current,"keyup",s),Pw("down",(o,l)=>{this.startPress(o,l)})},n=Zl(this.node.current,"keydown",e),r=()=>{this.isPressing&&Pw("cancel",(a,s)=>this.cancelPress(a,s))},i=Zl(this.node.current,"blur",r);this.removeAccessibleListeners=au(n,i)}}startPress(e,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&dr.postRender(()=>r(e,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!eW()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&dr.postRender(()=>r(e,n))}mount(){const e=this.node.getProps(),n=su(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),r=Zl(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=au(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const _I=new WeakMap,Bw=new WeakMap,Pfe=t=>{const e=_I.get(t.target);e&&e(t)},Bfe=t=>{t.forEach(Pfe)};function Ffe({root:t,...e}){const n=t||document;Bw.has(n)||Bw.set(n,{});const r=Bw.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(Bfe,{root:t,...e})),r[i]}function Ufe(t,e,n){const r=Ffe(e);return _I.set(t,n),r.observe(t),()=>{_I.delete(t),r.unobserve(t)}}const zfe={some:0,all:1};class Hfe extends Oc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:a}=e,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:zfe[i]},o=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return Ufe(this.node.current,s,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Gfe(e,n))&&this.startObserver()}unmount(){}}function Gfe({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Vfe={inView:{Feature:Hfe},tap:{Feature:kfe},focus:{Feature:Lfe},hover:{Feature:Dfe}},$fe={layout:{ProjectionNode:bW,MeasureLayout:uW}},M2=w.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Ex=w.createContext({}),N2=typeof window<"u",vW=N2?w.useLayoutEffect:w.useEffect,EW=w.createContext({strict:!1});function Wfe(t,e,n,r,i){var a,s;const{visualElement:o}=w.useContext(Ex),l=w.useContext(EW),u=w.useContext(Vb),c=w.useContext(M2).reducedMotion,d=w.useRef();r=r||l.renderer,!d.current&&r&&(d.current=r(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const f=d.current,m=w.useContext(lW);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&jfe(d.current,n,i,m);const g=w.useRef(!1);w.useInsertionEffect(()=>{f&&g.current&&f.update(n,u)});const y=n[W$],v=w.useRef(!!y&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,y))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,y)));return vW(()=>{f&&(g.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),I2.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())}),w.useEffect(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),v.current=!1))}),f}function jfe(t,e,n,r){const{layoutId:i,layout:a,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:_W(t.parent)),t.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!s||o&&jp(o),visualElement:t,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function _W(t){if(t)return t.options.allowProjection!==!1?t.projection:_W(t.parent)}function Yfe(t,e,n){return w.useCallback(r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):jp(n)&&(n.current=r))},[e])}function _x(t){return gx(t.animate)||l2.some(e=>K0(t[e]))}function SW(t){return!!(_x(t)||t.variants)}function qfe(t,e){if(_x(t)){const{initial:n,animate:r}=t;return{initial:n===!1||K0(n)?n:void 0,animate:K0(r)?r:void 0}}return t.inherit!==!1?e:{}}function Xfe(t){const{initial:e,animate:n}=qfe(t,w.useContext(Ex));return w.useMemo(()=>({initial:e,animate:n}),[Rz(e),Rz(n)])}function Rz(t){return Array.isArray(t)?t.join(" "):t}const Iz={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Uh={};for(const t in Iz)Uh[t]={isEnabled:e=>Iz[t].some(n=>!!e[n])};function Kfe(t){for(const e in t)Uh[e]={...Uh[e],...t[e]}}const Zfe=Symbol.for("motionComponentSymbol");function Qfe({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:i}){t&&Kfe(t);function a(o,l){let u;const c={...w.useContext(M2),...o,layoutId:Jfe(o)},{isStatic:d}=c,f=Xfe(o),m=r(o,d);if(!d&&N2){epe();const g=tpe(c);u=g.MeasureLayout,f.visualElement=Wfe(i,m,c,e,g.ProjectionNode)}return $.jsxs(Ex.Provider,{value:f,children:[u&&f.visualElement?$.jsx(u,{visualElement:f.visualElement,...c}):null,n(i,o,Yfe(m,f.visualElement,l),m,d,f.visualElement)]})}const s=w.forwardRef(a);return s[Zfe]=i,s}function Jfe({layoutId:t}){const e=w.useContext(R2).id;return e&&t!==void 0?e+"-"+t:t}function epe(t,e){w.useContext(EW).strict}function tpe(t){const{drag:e,layout:n}=Uh;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const npe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function O2(t){return typeof t!="string"||t.includes("-")?!1:!!(npe.indexOf(t)>-1||/[A-Z]/u.test(t))}function AW(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const a in n)t.style.setProperty(a,n[a])}const xW=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function TW(t,e,n,r){AW(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(xW.has(i)?i:C2(i),e.attrs[i])}function wW(t,{layout:e,layoutId:n}){return Cf.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!cS[t]||t==="opacity")}function D2(t,e,n){var r;const{style:i}=t,a={};for(const s in i)(pa(i[s])||e.style&&pa(e.style[s])||wW(s,t)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[s]=i[s]);return a}function CW(t,e,n){const r=D2(t,e,n);for(const i in t)if(pa(t[i])||pa(e[i])){const a=zb.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=t[i]}return r}function L2(t){const e=w.useRef(null);return e.current===null&&(e.current=t()),e.current}function rpe({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,i,a){const s={latestValues:ipe(r,i,a,t),renderState:e()};return n&&(s.mount=o=>n(r,o,s)),s}const RW=t=>(e,n)=>{const r=w.useContext(Ex),i=w.useContext(Vb),a=()=>rpe(t,e,r,i);return n?a():L2(a)};function ipe(t,e,n,r){const i={},a=r(t,{});for(const f in a)i[f]=R_(a[f]);let{initial:s,animate:o}=t;const l=_x(t),u=SW(t);e&&u&&!l&&t.inherit!==!1&&(s===void 0&&(s=e.initial),o===void 0&&(o=e.animate));let c=n?n.initial===!1:!1;c=c||s===!1;const d=c?o:s;if(d&&typeof d!="boolean"&&!gx(d)){const f=Array.isArray(d)?d:[d];for(let m=0;m({style:{},transform:{},transformOrigin:{},vars:{}}),IW=()=>({...k2(),attrs:{}}),MW=(t,e)=>e&&typeof t=="number"?e.transform(t):t,ape={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},spe=zb.length;function ope(t,e,n){let r="",i=!0;for(let a=0;atypeof t=="string"&&t.toLowerCase()==="svg",fpe={useVisualState:RW({scrapeMotionValuesFromProps:CW,createRenderState:IW,onMount:(t,e,{renderState:n,latestValues:r})=>{dr.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),dr.render(()=>{B2(n,r,F2(e.tagName),t.transformTemplate),TW(e,n)})}})},ppe={useVisualState:RW({scrapeMotionValuesFromProps:D2,createRenderState:k2})};function NW(t,e,n){for(const r in e)!pa(e[r])&&!wW(r,n)&&(t[r]=e[r])}function hpe({transformTemplate:t},e){return w.useMemo(()=>{const n=k2();return P2(n,e,t),Object.assign({},n.vars,n.style)},[e])}function mpe(t,e){const n=t.style||{},r={};return NW(r,n,t),Object.assign(r,hpe(t,e)),r}function gpe(t,e){const n={},r=mpe(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const bpe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function dS(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||bpe.has(t)}let OW=t=>!dS(t);function ype(t){t&&(OW=e=>e.startsWith("on")?!dS(e):t(e))}try{ype(require("@emotion/is-prop-valid").default)}catch{}function vpe(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(OW(i)||n===!0&&dS(i)||!e&&!dS(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}function Epe(t,e,n,r){const i=w.useMemo(()=>{const a=IW();return B2(a,e,F2(r),t.transformTemplate),{...a.attrs,style:{...a.style}}},[e]);if(t.style){const a={};NW(a,t.style,t),i.style={...a,...i.style}}return i}function _pe(t=!1){return(n,r,i,{latestValues:a},s)=>{const l=(O2(n)?Epe:gpe)(r,a,s,n),u=vpe(r,typeof n=="string",t),c=n!==w.Fragment?{...u,...l,ref:i}:{},{children:d}=r,f=w.useMemo(()=>pa(d)?d.get():d,[d]);return w.createElement(n,{...c,children:f})}}function Spe(t,e){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...O2(r)?fpe:ppe,preloadedFeatures:t,useRender:_pe(i),createVisualElement:e,Component:r};return Qfe(s)}}const SI={current:null},DW={current:!1};function Ape(){if(DW.current=!0,!!N2)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>SI.current=t.matches;t.addListener(e),e()}else SI.current=!1}function xpe(t,e,n){for(const r in e){const i=e[r],a=n[r];if(pa(i))t.addValue(r,i);else if(pa(a))t.addValue(r,J0(i,{owner:t}));else if(a!==i)if(t.hasValue(r)){const s=t.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=t.getStaticValue(r);t.addValue(r,J0(s!==void 0?s:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Nz=new WeakMap,Tpe=[...T$,ca,_c],wpe=t=>Tpe.find(x$(t)),Oz=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Cpe{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=p2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=ll.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),DW.current||Ape(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:SI.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Nz.delete(this.current),this.projection&&this.projection.unmount(),vc(this.notifyUpdate),vc(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=Cf.has(e),i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&dr.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),a(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Uh){const n=Uh[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Jr()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=J0(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var r;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(E$(i)||v$(i))?i=parseFloat(i):!wpe(i)&&_c.test(n)&&(i=D$(e,n)),this.setBaseTarget(e,pa(i)?i.get():i)),pa(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const s=s2(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[e])}if(r&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!pa(a)?a:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new w2),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class LW extends Cpe{constructor(){super(...arguments),this.KeyframeResolver=L$}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}}function Rpe(t){return window.getComputedStyle(t)}class Ipe extends LW{constructor(){super(...arguments),this.type="html",this.renderInstance=AW}readValueFromInstance(e,n){if(Cf.has(n)){const r=b2(n);return r&&r.default||0}else{const r=Rpe(e),i=(S$(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return sW(e,n)}build(e,n,r){P2(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return D2(e,n,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;pa(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Mpe extends LW{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Jr}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Cf.has(n)){const r=b2(n);return r&&r.default||0}return n=xW.has(n)?n:C2(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return CW(e,n,r)}build(e,n,r){B2(e,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,n,r,i){TW(e,n,r,i)}mount(e){this.isSVGTag=F2(e.tagName),super.mount(e)}}const Npe=(t,e)=>O2(t)?new Mpe(e):new Ipe(e,{allowProjection:t!==w.Fragment}),Ope=Spe({...vde,...Vfe,...Ofe,...$fe},Npe),Dpe=cue(Ope);class Lpe extends w.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function kpe({children:t,isPresent:e}){const n=w.useId(),r=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=w.useContext(M2);return w.useInsertionEffect(()=>{const{width:s,height:o,top:l,left:u}=i.current;if(e||!r.current||!s||!o)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return a&&(c.nonce=a),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${s}px !important; @@ -322,7 +322,7 @@ function aV(t,e){for(var n=0;n{document.head.removeChild(c)}},[e]),$.jsx(Lpe,{isPresent:e,childRef:r,sizeRef:i,children:w.cloneElement(t,{ref:r})})}const Ppe=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:s})=>{const o=L2(Bpe),l=w.useId(),u=w.useCallback(d=>{o.set(d,!0);for(const f of o.values())if(!f)return;r&&r()},[o,r]),c=w.useMemo(()=>({id:l,initial:e,isPresent:n,custom:i,onExitComplete:u,register:d=>(o.set(d,!1),()=>o.delete(d))}),a?[Math.random(),u]:[n,u]);return w.useMemo(()=>{o.forEach((d,f)=>o.set(f,!1))},[n]),w.useEffect(()=>{!n&&!o.size&&r&&r()},[n]),s==="popLayout"&&(t=$.jsx(kpe,{isPresent:n,children:t})),$.jsx(Vb.Provider,{value:c,children:t})};function Bpe(){return new Map}const Pv=t=>t.key||"";function Dz(t){const e=[];return w.Children.forEach(t,n=>{w.isValidElement(n)&&e.push(n)}),e}const Fpe=({children:t,exitBeforeEnter:e,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:a=!0,mode:s="sync"})=>{const o=w.useMemo(()=>Dz(t),[t]),l=o.map(Pv),u=w.useRef(!0),c=w.useRef(o),d=L2(()=>new Map),[f,m]=w.useState(o),[g,y]=w.useState(o);vW(()=>{u.current=!1,c.current=o;for(let E=0;E{const S=Pv(E),A=o===g||l.includes(S),I=()=>{if(d.has(S))d.set(S,!0);else return;let T=!0;d.forEach(R=>{R||(T=!1)}),T&&(b==null||b(),y(c.current),i&&i())};return $.jsx(Ppe,{isPresent:A,initial:!u.current||r?void 0:!1,custom:A?void 0:n,presenceAffectsLayout:a,mode:s,onExitComplete:A?void 0:I,children:E},S)})})},Upe=(t,e)=>t.find(n=>n.id===e);function Lz(t,e){const n=kW(t,e),r=n?t[n].findIndex(i=>i.id===e):-1;return{position:n,index:r}}function kW(t,e){for(const[n,r]of Object.entries(t))if(Upe(r,e))return n}function zpe(t){const e=t.includes("right"),n=t.includes("left");let r="center";return e&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function Hpe(t){const n=t==="top"||t==="bottom"?"0 auto":void 0,r=t.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=t.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,a=t.includes("left")?void 0:"env(safe-area-inset-right, 0px)",s=t.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:a,left:s}}var Gpe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Vpe=YV(function(t){return Gpe.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),$pe=Vpe,Wpe=function(e){return e!=="theme"},kz=function(e){return typeof e=="string"&&e.charCodeAt(0)>96?$pe:Wpe},Pz=function(e,n,r){var i;if(n){var a=n.shouldForwardProp;i=e.__emotion_forwardProp&&a?function(s){return e.__emotion_forwardProp(s)&&a(s)}:a}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},jpe=!1,Ype=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return JV(n,r,i),$le(function(){return e$(n,r,i)}),null},qpe=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,a,s;n!==void 0&&(a=n.label,s=n.target);var o=Pz(e,n,r),l=o||kz(i),u=!l("as");return function(){var c=arguments,d=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(a!==void 0&&d.push("label:"+a+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,m=1;me=>{const{theme:n,css:r,__css:i,sx:a,...s}=e,[o]=Cee(s,n.__isStyleProp),l=Zs(t,e),u=fee({},i,l,HN(o),a),c=wV(u)(e.theme);return r?[c,r]:c};function Fw(t,e){const{baseStyle:n,...r}=e??{};r.shouldForwardProp||(r.shouldForwardProp=Qpe);const i=ehe({baseStyle:n}),a=Jpe(t,r)(i);return w.forwardRef(function(l,u){const{children:c,...d}=l,{colorMode:f,forced:m}=i2(),g=m?f:void 0;return w.createElement(a,{ref:u,"data-theme":g,...d},c)})}function the(){const t=new Map;return new Proxy(Fw,{apply(e,n,r){return Fw(...r)},get(e,n){return t.has(n)||t.set(n,Fw(n)),t.get(n)}})}const Cr=the(),nhe={initial:t=>{const{position:e}=t,n=["top","bottom"].includes(e)?"y":"x";let r=["top-right","bottom-right"].includes(e)?1:-1;return e==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},PW=w.memo(t=>{const{id:e,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:a=!1,position:s="bottom",duration:o=5e3,containerStyle:l,motionVariants:u=nhe,toastSpacing:c="0.5rem"}=t,[d,f]=w.useState(o),m=jde();YU(()=>{m||r==null||r()},[m]),YU(()=>{f(o)},[o]);const g=()=>f(null),y=()=>f(o),v=()=>{m&&i()};w.useEffect(()=>{m&&a&&i()},[m,a,i]),Oee(v,d);const b=w.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),E=w.useMemo(()=>zpe(s),[s]);return $.jsx(Dpe.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:g,onHoverEnd:y,custom:{position:s},style:E,children:$.jsx(Cr.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:b,children:Zs(n,{id:e,onClose:v})})})});PW.displayName="ToastComponent";function Xi(t){return w.forwardRef(t)}var rhe=typeof Element<"u",ihe=typeof Map=="function",ahe=typeof Set=="function",she=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function IS(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!IS(t[r],e[r]))return!1;return!0}var a;if(ihe&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a=t.entries();!(r=a.next()).done;)if(!e.has(r.value[0]))return!1;for(a=t.entries();!(r=a.next()).done;)if(!IS(r.value[1],e.get(r.value[0])))return!1;return!0}if(ahe&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a=t.entries();!(r=a.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(she&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(rhe&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&t.$$typeof)&&!IS(t[i[r]],e[i[r]]))return!1;return!0}return t!==t&&e!==e}var ohe=function(e,n){try{return IS(e,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const lhe=_l(ohe);function U2(){const t=w.useContext(X0);if(!t)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return t}function BW(){const t=i2(),e=U2();return{...t,theme:e}}function FW(t,e={}){const{styleConfig:n,...r}=e,{theme:i,colorMode:a}=BW(),s=t?vV(i,`components.${t}`):void 0,o=n||s,l=rl({theme:i,colorMode:a},(o==null?void 0:o.defaultProps)??{},HN(EV(r,["children"])),(c,d)=>c?void 0:d),u=w.useRef({});if(o){const d=Ate(o)(l);lhe(u.current,d)||(u.current=d)}return u.current}function $b(t,e={}){return FW(t,e)}function UW(t,e={}){return FW(t,e)}const Bz={path:$.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[$.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),$.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),$.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Wb=Xi((t,e)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:a=!1,children:s,className:o,__css:l,...u}=t,c=ba("chakra-icon",o),d=$b("Icon",t),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l,...d},m={ref:e,focusable:a,className:c,__css:f},g=r??Bz.viewBox;if(n&&typeof n!="string")return $.jsx(Cr.svg,{as:n,...m,...u});const y=s??Bz.path;return $.jsx(Cr.svg,{verticalAlign:"middle",viewBox:g,...m,...u,children:y})});Wb.displayName="Icon";function uhe(t){return $.jsx(Wb,{viewBox:"0 0 24 24",...t,children:$.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function che(t){return $.jsx(Wb,{viewBox:"0 0 24 24",...t,children:$.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function Fz(t){return $.jsx(Wb,{viewBox:"0 0 24 24",...t,children:$.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}const dhe=Xle({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),z2=Xi((t,e)=>{const n=$b("Spinner",t),{label:r="Loading...",thickness:i="2px",speed:a="0.45s",emptyColor:s="transparent",className:o,...l}=um(t),u=ba("chakra-spinner",o),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:s,borderLeftColor:s,animation:`${dhe} ${a} linear infinite`,...n};return $.jsx(Cr.div,{ref:e,__css:c,className:u,...l,children:r&&$.jsx(Cr.span,{srOnly:!0,children:r})})});z2.displayName="Spinner";const[fhe,H2]=Mo({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[phe,G2]=Mo({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),zW={info:{icon:che,colorScheme:"blue"},warning:{icon:Fz,colorScheme:"orange"},success:{icon:uhe,colorScheme:"green"},error:{icon:Fz,colorScheme:"red"},loading:{icon:z2,colorScheme:"blue"}};function hhe(t){return zW[t].colorScheme}function mhe(t){return zW[t].icon}const HW=Xi(function(e,n){const{status:r="info",addRole:i=!0,...a}=um(e),s=e.colorScheme??hhe(r),o=UW("Alert",{...e,colorScheme:s}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...o.container};return $.jsx(fhe,{value:{status:r},children:$.jsx(phe,{value:o,children:$.jsx(Cr.div,{"data-status":r,role:i?"alert":void 0,ref:n,...a,className:ba("chakra-alert",e.className),__css:l})})})});HW.displayName="Alert";function GW(t){const{status:e}=H2(),n=mhe(e),r=G2(),i=e==="loading"?r.spinner:r.icon;return $.jsx(Cr.span,{display:"inherit","data-status":e,...t,className:ba("chakra-alert__icon",t.className),__css:i,children:t.children||$.jsx(n,{h:"100%",w:"100%"})})}GW.displayName="AlertIcon";const VW=Xi(function(e,n){const r=G2(),{status:i}=H2();return $.jsx(Cr.div,{ref:n,"data-status":i,...e,className:ba("chakra-alert__title",e.className),__css:r.title})});VW.displayName="AlertTitle";const $W=Xi(function(e,n){const{status:r}=H2(),i=G2(),a={display:"inline",...i.description};return $.jsx(Cr.div,{ref:n,"data-status":r,...e,className:ba("chakra-alert__desc",e.className),__css:a})});$W.displayName="AlertDescription";function ghe(t){return $.jsx(Wb,{focusable:"false","aria-hidden":!0,...t,children:$.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}const WW=Xi(function(e,n){const r=$b("CloseButton",e),{children:i,isDisabled:a,__css:s,...o}=um(e),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return $.jsx(Cr.button,{type:"button","aria-label":"Close",ref:n,disabled:a,__css:{...l,...r,...s},...o,children:i||$.jsx(ghe,{width:"1em",height:"1em"})})});WW.displayName="CloseButton";const bhe=t=>{const{status:e,variant:n="solid",id:r,title:i,isClosable:a,onClose:s,description:o,colorScheme:l,icon:u}=t,c=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return $.jsxs(HW,{addRole:!1,status:e,variant:n,id:c==null?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[$.jsx(GW,{children:u}),$.jsxs(Cr.div,{flex:"1",maxWidth:"100%",children:[i&&$.jsx(VW,{id:c==null?void 0:c.title,children:i}),o&&$.jsx($W,{id:c==null?void 0:c.description,display:"block",children:o})]}),a&&$.jsx(WW,{size:"sm",onClick:s,position:"absolute",insetEnd:1,top:1})]})};function jW(t={}){const{render:e,toastComponent:n=bhe}=t;return i=>typeof e=="function"?e({...i,...t}):$.jsx(n,{...i,...t})}const yhe={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},tl=vhe(yhe);function vhe(t){let e=t;const n=new Set,r=i=>{e=i(e),n.forEach(a=>a())};return{getState:()=>e,subscribe:i=>(n.add(i),()=>{r(()=>t),n.delete(i)}),removeToast:(i,a)=>{r(s=>({...s,[a]:s[a].filter(o=>o.id!=i)}))},notify:(i,a)=>{const s=Ehe(i,a),{position:o,id:l}=s;return r(u=>{const d=o.includes("top")?[s,...u[o]??[]]:[...u[o]??[],s];return{...u,[o]:d}}),l},update:(i,a)=>{i&&r(s=>{const o={...s},{position:l,index:u}=Lz(o,i);return l&&u!==-1&&(o[l][u]={...o[l][u],...a,message:jW(a)}),o})},closeAll:({positions:i}={})=>{r(a=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=a[u].map(c=>({...c,requestClose:!0})),l),{...a}))},close:i=>{r(a=>{const s=kW(a,i);return s?{...a,[s]:a[s].map(o=>o.id==i?{...o,requestClose:!0}:o)}:a})},isActive:i=>!!Lz(tl.getState(),i).position}}let Uz=0;function Ehe(t,e={}){Uz+=1;const n=e.id??Uz,r=e.position??"bottom";return{id:n,message:t,position:r,duration:e.duration,onCloseComplete:e.onCloseComplete,onRequestRemove:()=>tl.removeToast(String(n),r),status:e.status,requestClose:!1,containerStyle:e.containerStyle}}var YW={exports:{}},ws={},qW={exports:{}},XW={};/** + `),()=>{document.head.removeChild(c)}},[e]),$.jsx(Lpe,{isPresent:e,childRef:r,sizeRef:i,children:w.cloneElement(t,{ref:r})})}const Ppe=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:s})=>{const o=L2(Bpe),l=w.useId(),u=w.useCallback(d=>{o.set(d,!0);for(const f of o.values())if(!f)return;r&&r()},[o,r]),c=w.useMemo(()=>({id:l,initial:e,isPresent:n,custom:i,onExitComplete:u,register:d=>(o.set(d,!1),()=>o.delete(d))}),a?[Math.random(),u]:[n,u]);return w.useMemo(()=>{o.forEach((d,f)=>o.set(f,!1))},[n]),w.useEffect(()=>{!n&&!o.size&&r&&r()},[n]),s==="popLayout"&&(t=$.jsx(kpe,{isPresent:n,children:t})),$.jsx(Vb.Provider,{value:c,children:t})};function Bpe(){return new Map}const Pv=t=>t.key||"";function Dz(t){const e=[];return w.Children.forEach(t,n=>{w.isValidElement(n)&&e.push(n)}),e}const Fpe=({children:t,exitBeforeEnter:e,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:a=!0,mode:s="sync"})=>{const o=w.useMemo(()=>Dz(t),[t]),l=o.map(Pv),u=w.useRef(!0),c=w.useRef(o),d=L2(()=>new Map),[f,m]=w.useState(o),[g,y]=w.useState(o);vW(()=>{u.current=!1,c.current=o;for(let E=0;E{const _=Pv(E),A=o===g||l.includes(_),I=()=>{if(d.has(_))d.set(_,!0);else return;let x=!0;d.forEach(R=>{R||(x=!1)}),x&&(b==null||b(),y(c.current),i&&i())};return $.jsx(Ppe,{isPresent:A,initial:!u.current||r?void 0:!1,custom:A?void 0:n,presenceAffectsLayout:a,mode:s,onExitComplete:A?void 0:I,children:E},_)})})},Upe=(t,e)=>t.find(n=>n.id===e);function Lz(t,e){const n=kW(t,e),r=n?t[n].findIndex(i=>i.id===e):-1;return{position:n,index:r}}function kW(t,e){for(const[n,r]of Object.entries(t))if(Upe(r,e))return n}function zpe(t){const e=t.includes("right"),n=t.includes("left");let r="center";return e&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function Hpe(t){const n=t==="top"||t==="bottom"?"0 auto":void 0,r=t.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=t.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,a=t.includes("left")?void 0:"env(safe-area-inset-right, 0px)",s=t.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:a,left:s}}var Gpe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Vpe=YV(function(t){return Gpe.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),$pe=Vpe,Wpe=function(e){return e!=="theme"},kz=function(e){return typeof e=="string"&&e.charCodeAt(0)>96?$pe:Wpe},Pz=function(e,n,r){var i;if(n){var a=n.shouldForwardProp;i=e.__emotion_forwardProp&&a?function(s){return e.__emotion_forwardProp(s)&&a(s)}:a}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},jpe=!1,Ype=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return JV(n,r,i),$le(function(){return e$(n,r,i)}),null},qpe=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,a,s;n!==void 0&&(a=n.label,s=n.target);var o=Pz(e,n,r),l=o||kz(i),u=!l("as");return function(){var c=arguments,d=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(a!==void 0&&d.push("label:"+a+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,m=1;me=>{const{theme:n,css:r,__css:i,sx:a,...s}=e,[o]=Cee(s,n.__isStyleProp),l=Zs(t,e),u=fee({},i,l,HN(o),a),c=wV(u)(e.theme);return r?[c,r]:c};function Fw(t,e){const{baseStyle:n,...r}=e??{};r.shouldForwardProp||(r.shouldForwardProp=Qpe);const i=ehe({baseStyle:n}),a=Jpe(t,r)(i);return w.forwardRef(function(l,u){const{children:c,...d}=l,{colorMode:f,forced:m}=i2(),g=m?f:void 0;return w.createElement(a,{ref:u,"data-theme":g,...d},c)})}function the(){const t=new Map;return new Proxy(Fw,{apply(e,n,r){return Fw(...r)},get(e,n){return t.has(n)||t.set(n,Fw(n)),t.get(n)}})}const Cr=the(),nhe={initial:t=>{const{position:e}=t,n=["top","bottom"].includes(e)?"y":"x";let r=["top-right","bottom-right"].includes(e)?1:-1;return e==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},PW=w.memo(t=>{const{id:e,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:a=!1,position:s="bottom",duration:o=5e3,containerStyle:l,motionVariants:u=nhe,toastSpacing:c="0.5rem"}=t,[d,f]=w.useState(o),m=jde();YU(()=>{m||r==null||r()},[m]),YU(()=>{f(o)},[o]);const g=()=>f(null),y=()=>f(o),v=()=>{m&&i()};w.useEffect(()=>{m&&a&&i()},[m,a,i]),Oee(v,d);const b=w.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),E=w.useMemo(()=>zpe(s),[s]);return $.jsx(Dpe.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:g,onHoverEnd:y,custom:{position:s},style:E,children:$.jsx(Cr.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:b,children:Zs(n,{id:e,onClose:v})})})});PW.displayName="ToastComponent";function Xi(t){return w.forwardRef(t)}var rhe=typeof Element<"u",ihe=typeof Map=="function",ahe=typeof Set=="function",she=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function I_(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!I_(t[r],e[r]))return!1;return!0}var a;if(ihe&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a=t.entries();!(r=a.next()).done;)if(!e.has(r.value[0]))return!1;for(a=t.entries();!(r=a.next()).done;)if(!I_(r.value[1],e.get(r.value[0])))return!1;return!0}if(ahe&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a=t.entries();!(r=a.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(she&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(rhe&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&t.$$typeof)&&!I_(t[i[r]],e[i[r]]))return!1;return!0}return t!==t&&e!==e}var ohe=function(e,n){try{return I_(e,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const lhe=Sl(ohe);function U2(){const t=w.useContext(X0);if(!t)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return t}function BW(){const t=i2(),e=U2();return{...t,theme:e}}function FW(t,e={}){const{styleConfig:n,...r}=e,{theme:i,colorMode:a}=BW(),s=t?vV(i,`components.${t}`):void 0,o=n||s,l=rl({theme:i,colorMode:a},(o==null?void 0:o.defaultProps)??{},HN(EV(r,["children"])),(c,d)=>c?void 0:d),u=w.useRef({});if(o){const d=Ate(o)(l);lhe(u.current,d)||(u.current=d)}return u.current}function $b(t,e={}){return FW(t,e)}function UW(t,e={}){return FW(t,e)}const Bz={path:$.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[$.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),$.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),$.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Wb=Xi((t,e)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:a=!1,children:s,className:o,__css:l,...u}=t,c=ba("chakra-icon",o),d=$b("Icon",t),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l,...d},m={ref:e,focusable:a,className:c,__css:f},g=r??Bz.viewBox;if(n&&typeof n!="string")return $.jsx(Cr.svg,{as:n,...m,...u});const y=s??Bz.path;return $.jsx(Cr.svg,{verticalAlign:"middle",viewBox:g,...m,...u,children:y})});Wb.displayName="Icon";function uhe(t){return $.jsx(Wb,{viewBox:"0 0 24 24",...t,children:$.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function che(t){return $.jsx(Wb,{viewBox:"0 0 24 24",...t,children:$.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function Fz(t){return $.jsx(Wb,{viewBox:"0 0 24 24",...t,children:$.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}const dhe=Xle({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),z2=Xi((t,e)=>{const n=$b("Spinner",t),{label:r="Loading...",thickness:i="2px",speed:a="0.45s",emptyColor:s="transparent",className:o,...l}=um(t),u=ba("chakra-spinner",o),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:s,borderLeftColor:s,animation:`${dhe} ${a} linear infinite`,...n};return $.jsx(Cr.div,{ref:e,__css:c,className:u,...l,children:r&&$.jsx(Cr.span,{srOnly:!0,children:r})})});z2.displayName="Spinner";const[fhe,H2]=Mo({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[phe,G2]=Mo({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),zW={info:{icon:che,colorScheme:"blue"},warning:{icon:Fz,colorScheme:"orange"},success:{icon:uhe,colorScheme:"green"},error:{icon:Fz,colorScheme:"red"},loading:{icon:z2,colorScheme:"blue"}};function hhe(t){return zW[t].colorScheme}function mhe(t){return zW[t].icon}const HW=Xi(function(e,n){const{status:r="info",addRole:i=!0,...a}=um(e),s=e.colorScheme??hhe(r),o=UW("Alert",{...e,colorScheme:s}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...o.container};return $.jsx(fhe,{value:{status:r},children:$.jsx(phe,{value:o,children:$.jsx(Cr.div,{"data-status":r,role:i?"alert":void 0,ref:n,...a,className:ba("chakra-alert",e.className),__css:l})})})});HW.displayName="Alert";function GW(t){const{status:e}=H2(),n=mhe(e),r=G2(),i=e==="loading"?r.spinner:r.icon;return $.jsx(Cr.span,{display:"inherit","data-status":e,...t,className:ba("chakra-alert__icon",t.className),__css:i,children:t.children||$.jsx(n,{h:"100%",w:"100%"})})}GW.displayName="AlertIcon";const VW=Xi(function(e,n){const r=G2(),{status:i}=H2();return $.jsx(Cr.div,{ref:n,"data-status":i,...e,className:ba("chakra-alert__title",e.className),__css:r.title})});VW.displayName="AlertTitle";const $W=Xi(function(e,n){const{status:r}=H2(),i=G2(),a={display:"inline",...i.description};return $.jsx(Cr.div,{ref:n,"data-status":r,...e,className:ba("chakra-alert__desc",e.className),__css:a})});$W.displayName="AlertDescription";function ghe(t){return $.jsx(Wb,{focusable:"false","aria-hidden":!0,...t,children:$.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}const WW=Xi(function(e,n){const r=$b("CloseButton",e),{children:i,isDisabled:a,__css:s,...o}=um(e),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return $.jsx(Cr.button,{type:"button","aria-label":"Close",ref:n,disabled:a,__css:{...l,...r,...s},...o,children:i||$.jsx(ghe,{width:"1em",height:"1em"})})});WW.displayName="CloseButton";const bhe=t=>{const{status:e,variant:n="solid",id:r,title:i,isClosable:a,onClose:s,description:o,colorScheme:l,icon:u}=t,c=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return $.jsxs(HW,{addRole:!1,status:e,variant:n,id:c==null?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[$.jsx(GW,{children:u}),$.jsxs(Cr.div,{flex:"1",maxWidth:"100%",children:[i&&$.jsx(VW,{id:c==null?void 0:c.title,children:i}),o&&$.jsx($W,{id:c==null?void 0:c.description,display:"block",children:o})]}),a&&$.jsx(WW,{size:"sm",onClick:s,position:"absolute",insetEnd:1,top:1})]})};function jW(t={}){const{render:e,toastComponent:n=bhe}=t;return i=>typeof e=="function"?e({...i,...t}):$.jsx(n,{...i,...t})}const yhe={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},tl=vhe(yhe);function vhe(t){let e=t;const n=new Set,r=i=>{e=i(e),n.forEach(a=>a())};return{getState:()=>e,subscribe:i=>(n.add(i),()=>{r(()=>t),n.delete(i)}),removeToast:(i,a)=>{r(s=>({...s,[a]:s[a].filter(o=>o.id!=i)}))},notify:(i,a)=>{const s=Ehe(i,a),{position:o,id:l}=s;return r(u=>{const d=o.includes("top")?[s,...u[o]??[]]:[...u[o]??[],s];return{...u,[o]:d}}),l},update:(i,a)=>{i&&r(s=>{const o={...s},{position:l,index:u}=Lz(o,i);return l&&u!==-1&&(o[l][u]={...o[l][u],...a,message:jW(a)}),o})},closeAll:({positions:i}={})=>{r(a=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=a[u].map(c=>({...c,requestClose:!0})),l),{...a}))},close:i=>{r(a=>{const s=kW(a,i);return s?{...a,[s]:a[s].map(o=>o.id==i?{...o,requestClose:!0}:o)}:a})},isActive:i=>!!Lz(tl.getState(),i).position}}let Uz=0;function Ehe(t,e={}){Uz+=1;const n=e.id??Uz,r=e.position??"bottom";return{id:n,message:t,position:r,duration:e.duration,onCloseComplete:e.onCloseComplete,onRequestRemove:()=>tl.removeToast(String(n),r),status:e.status,requestClose:!1,containerStyle:e.containerStyle}}var YW={exports:{}},ws={},qW={exports:{}},XW={};/** * @license React * scheduler.production.min.js * @@ -330,7 +330,7 @@ function aV(t,e){for(var n=0;n>>1,Ce=F[fe];if(0>>1;fei(ke,J))Fei(Ye,ke)?(F[fe]=Ye,F[Fe]=J,fe=Fe):(F[fe]=ke,F[j]=J,fe=j);else if(Fei(Ye,J))F[fe]=Ye,F[Fe]=J,fe=Fe;else break e}}return ie}function i(F,ie){var J=F.sortIndex-ie.sortIndex;return J!==0?J:F.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],u=[],c=1,d=null,f=3,m=!1,g=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(F){for(var ie=n(u);ie!==null;){if(ie.callback===null)r(u);else if(ie.startTime<=F)r(u),ie.sortIndex=ie.expirationTime,e(l,ie);else break;ie=n(u)}}function A(F){if(y=!1,S(F),!g)if(n(l)!==null)g=!0,ae(I);else{var ie=n(u);ie!==null&&ee(A,ie.startTime-F)}}function I(F,ie){g=!1,y&&(y=!1,b(O),O=-1),m=!0;var J=f;try{for(S(ie),d=n(l);d!==null&&(!(d.expirationTime>ie)||F&&!B());){var fe=d.callback;if(typeof fe=="function"){d.callback=null,f=d.priorityLevel;var Ce=fe(d.expirationTime<=ie);ie=t.unstable_now(),typeof Ce=="function"?d.callback=Ce:d===n(l)&&r(l),S(ie)}else r(l);d=n(l)}if(d!==null)var Le=!0;else{var j=n(u);j!==null&&ee(A,j.startTime-ie),Le=!1}return Le}finally{d=null,f=J,m=!1}}var T=!1,R=null,O=-1,N=5,M=-1;function B(){return!(t.unstable_now()-MF||125fe?(F.sortIndex=J,e(u,F),n(l)===null&&F===n(u)&&(y?(b(O),O=-1):y=!0,ee(A,J-fe))):(F.sortIndex=Ce,e(l,F),g||m||(g=!0,ae(I))),F},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(F){var ie=f;return function(){var J=f;f=ie;try{return F.apply(this,arguments)}finally{f=J}}}})(XW);qW.exports=XW;var She=qW.exports;/** + */(function(t){function e(F,ie){var J=F.length;F.push(ie);e:for(;0>>1,Ce=F[fe];if(0>>1;fei(ke,J))Fei(Ye,ke)?(F[fe]=Ye,F[Fe]=J,fe=Fe):(F[fe]=ke,F[j]=J,fe=j);else if(Fei(Ye,J))F[fe]=Ye,F[Fe]=J,fe=Fe;else break e}}return ie}function i(F,ie){var J=F.sortIndex-ie.sortIndex;return J!==0?J:F.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],u=[],c=1,d=null,f=3,m=!1,g=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(F){for(var ie=n(u);ie!==null;){if(ie.callback===null)r(u);else if(ie.startTime<=F)r(u),ie.sortIndex=ie.expirationTime,e(l,ie);else break;ie=n(u)}}function A(F){if(y=!1,_(F),!g)if(n(l)!==null)g=!0,ae(I);else{var ie=n(u);ie!==null&&ee(A,ie.startTime-F)}}function I(F,ie){g=!1,y&&(y=!1,b(O),O=-1),m=!0;var J=f;try{for(_(ie),d=n(l);d!==null&&(!(d.expirationTime>ie)||F&&!B());){var fe=d.callback;if(typeof fe=="function"){d.callback=null,f=d.priorityLevel;var Ce=fe(d.expirationTime<=ie);ie=t.unstable_now(),typeof Ce=="function"?d.callback=Ce:d===n(l)&&r(l),_(ie)}else r(l);d=n(l)}if(d!==null)var Le=!0;else{var j=n(u);j!==null&&ee(A,j.startTime-ie),Le=!1}return Le}finally{d=null,f=J,m=!1}}var x=!1,R=null,O=-1,N=5,M=-1;function B(){return!(t.unstable_now()-MF||125fe?(F.sortIndex=J,e(u,F),n(l)===null&&F===n(u)&&(y?(b(O),O=-1):y=!0,ee(A,J-fe))):(F.sortIndex=Ce,e(l,F),g||m||(g=!0,ae(I))),F},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(F){var ie=f;return function(){var J=f;f=ie;try{return F.apply(this,arguments)}finally{f=J}}}})(XW);qW.exports=XW;var _he=qW.exports;/** * @license React * react-dom.production.min.js * @@ -338,14 +338,14 @@ function aV(t,e){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),TI=Object.prototype.hasOwnProperty,Ahe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,zz={},Hz={};function The(t){return TI.call(Hz,t)?!0:TI.call(zz,t)?!1:Ahe.test(t)?Hz[t]=!0:(zz[t]=!0,!1)}function xhe(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function whe(t,e,n,r){if(e===null||typeof e>"u"||xhe(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ba(t,e,n,r,i,a,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=s}var Yi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Yi[t]=new Ba(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Yi[e]=new Ba(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Yi[t]=new Ba(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Yi[t]=new Ba(t,2,!1,t,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(t){Yi[t]=new Ba(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Yi[t]=new Ba(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Yi[t]=new Ba(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Yi[t]=new Ba(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Yi[t]=new Ba(t,5,!1,t.toLowerCase(),null,!1,!1)});var V2=/[\-:]([a-z])/g;function $2(t){return t[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(t){var e=t.replace(V2,$2);Yi[e]=new Ba(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(V2,$2);Yi[e]=new Ba(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(V2,$2);Yi[e]=new Ba(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Yi[t]=new Ba(t,1,!1,t.toLowerCase(),null,!1,!1)});Yi.xlinkHref=new Ba("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Yi[t]=new Ba(t,1,!1,t.toLowerCase(),null,!0,!0)});function W2(t,e,n,r){var i=Yi.hasOwnProperty(e)?Yi[e]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xI=Object.prototype.hasOwnProperty,Ahe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,zz={},Hz={};function xhe(t){return xI.call(Hz,t)?!0:xI.call(zz,t)?!1:Ahe.test(t)?Hz[t]=!0:(zz[t]=!0,!1)}function The(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function whe(t,e,n,r){if(e===null||typeof e>"u"||The(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ba(t,e,n,r,i,a,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=s}var Yi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Yi[t]=new Ba(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Yi[e]=new Ba(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Yi[t]=new Ba(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Yi[t]=new Ba(t,2,!1,t,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(t){Yi[t]=new Ba(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Yi[t]=new Ba(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Yi[t]=new Ba(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Yi[t]=new Ba(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Yi[t]=new Ba(t,5,!1,t.toLowerCase(),null,!1,!1)});var V2=/[\-:]([a-z])/g;function $2(t){return t[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(t){var e=t.replace(V2,$2);Yi[e]=new Ba(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(V2,$2);Yi[e]=new Ba(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(V2,$2);Yi[e]=new Ba(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Yi[t]=new Ba(t,1,!1,t.toLowerCase(),null,!1,!1)});Yi.xlinkHref=new Ba("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Yi[t]=new Ba(t,1,!1,t.toLowerCase(),null,!0,!0)});function W2(t,e,n,r){var i=Yi.hasOwnProperty(e)?Yi[e]:null;(i!==null?i.type!==0:r||!(2o||i[s]!==a[o]){var l=` -`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=o);break}}}finally{zw=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Xg(t):""}function Che(t){switch(t.tag){case 5:return Xg(t.type);case 16:return Xg("Lazy");case 13:return Xg("Suspense");case 19:return Xg("SuspenseList");case 0:case 2:case 15:return t=Hw(t.type,!1),t;case 11:return t=Hw(t.type.render,!1),t;case 1:return t=Hw(t.type,!0),t;default:return""}}function RI(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Zp:return"Fragment";case Kp:return"Portal";case xI:return"Profiler";case j2:return"StrictMode";case wI:return"Suspense";case CI:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case QW:return(t.displayName||"Context")+".Consumer";case ZW:return(t._context.displayName||"Context")+".Provider";case Y2:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case q2:return e=t.displayName||null,e!==null?e:RI(t.type)||"Memo";case Ku:e=t._payload,t=t._init;try{return RI(t(e))}catch{}}return null}function Rhe(t){var e=t.type;switch(t.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 t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return RI(e);case 8:return e===j2?"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 _c(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ej(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Ihe(t){var e=ej(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,a.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Fv(t){t._valueTracker||(t._valueTracker=Ihe(t))}function tj(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=ej(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function f_(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function II(t,e){var n=e.checked;return Gr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Vz(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=_c(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function nj(t,e){e=e.checked,e!=null&&W2(t,"checked",e,!1)}function MI(t,e){nj(t,e);var n=_c(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?NI(t,e.type,n):e.hasOwnProperty("defaultValue")&&NI(t,e.type,_c(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function $z(t,e,n){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=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function NI(t,e,n){(e!=="number"||f_(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Kg=Array.isArray;function vh(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Uv.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function tb(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var m0={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},Mhe=["Webkit","ms","Moz","O"];Object.keys(m0).forEach(function(t){Mhe.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),m0[e]=m0[t]})});function sj(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||m0.hasOwnProperty(t)&&m0[t]?(""+e).trim():e+"px"}function oj(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=sj(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var Nhe=Gr({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 LI(t,e){if(e){if(Nhe[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ut(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ut(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ut(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ut(62))}}function kI(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var PI=null;function X2(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var BI=null,Eh=null,Sh=null;function Yz(t){if(t=qb(t)){if(typeof BI!="function")throw Error(ut(280));var e=t.stateNode;e&&(e=wT(e),BI(t.stateNode,t.type,e))}}function lj(t){Eh?Sh?Sh.push(t):Sh=[t]:Eh=t}function uj(){if(Eh){var t=Eh,e=Sh;if(Sh=Eh=null,Yz(t),e)for(t=0;t>>=0,t===0?32:31-(Ghe(t)/Vhe|0)|0}var zv=64,Hv=4194304;function Zg(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function g_(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,a=t.pingedLanes,s=n&268435455;if(s!==0){var o=s&~i;o!==0?r=Zg(o):(a&=s,a!==0&&(r=Zg(a)))}else s=n&~i,s!==0?r=Zg(s):a!==0&&(r=Zg(a));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,a=e&-e,i>=a||i===16&&(a&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function jb(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-_o(e),t[e]=n}function Yhe(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=b0),n6=" ",r6=!1;function Ij(t,e){switch(t){case"keyup":return Sme.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mj(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Qp=!1;function Ame(t,e){switch(t){case"compositionend":return Mj(e);case"keypress":return e.which!==32?null:(r6=!0,n6);case"textInput":return t=e.data,t===n6&&r6?null:t;default:return null}}function Tme(t,e){if(Qp)return t==="compositionend"||!rO&&Ij(t,e)?(t=Cj(),NS=eO=rc=null,Qp=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=o6(n)}}function Lj(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Lj(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function kj(){for(var t=window,e=f_();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=f_(t.document)}return e}function iO(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Dme(t){var e=kj(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Lj(n.ownerDocument.documentElement,n)){if(r!==null&&iO(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!t.extend&&a>r&&(i=r,r=a,a=i),i=l6(n,a);var s=l6(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),a>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Jp=null,VI=null,v0=null,$I=!1;function u6(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$I||Jp==null||Jp!==f_(r)||(r=Jp,"selectionStart"in r&&iO(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}),v0&&ob(v0,r)||(v0=r,r=v_(VI,"onSelect"),0nh||(t.current=KI[nh],KI[nh]=null,nh--)}function Sr(t,e){nh++,KI[nh]=t.current,t.current=e}var Ac={},ga=Lc(Ac),ts=Lc(!1),lf=Ac;function Hh(t,e){var n=t.type.contextTypes;if(!n)return Ac;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=e[a];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ns(t){return t=t.childContextTypes,t!=null}function S_(){wr(ts),wr(ga)}function g6(t,e,n){if(ga.current!==Ac)throw Error(ut(168));Sr(ga,e),Sr(ts,n)}function $j(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(ut(108,Rhe(t)||"Unknown",i));return Gr({},n,r)}function __(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ac,lf=ga.current,Sr(ga,t),Sr(ts,ts.current),!0}function b6(t,e,n){var r=t.stateNode;if(!r)throw Error(ut(169));n?(t=$j(t,e,lf),r.__reactInternalMemoizedMergedChildContext=t,wr(ts),wr(ga),Sr(ga,t)):wr(ts),Sr(ts,n)}var zl=null,CT=!1,tC=!1;function Wj(t){zl===null?zl=[t]:zl.push(t)}function Wme(t){CT=!0,Wj(t)}function kc(){if(!tC&&zl!==null){tC=!0;var t=0,e=or;try{var n=zl;for(or=1;t>=s,i-=s,Ql=1<<32-_o(e)+i|n<O?(N=R,R=null):N=R.sibling;var M=f(b,R,S[O],A);if(M===null){R===null&&(R=N);break}t&&R&&M.alternate===null&&e(b,R),E=a(M,E,O),T===null?I=M:T.sibling=M,T=M,R=N}if(O===S.length)return n(b,R),Nr&&Ed(b,O),I;if(R===null){for(;OO?(N=R,R=null):N=R.sibling;var B=f(b,R,M.value,A);if(B===null){R===null&&(R=N);break}t&&R&&B.alternate===null&&e(b,R),E=a(B,E,O),T===null?I=B:T.sibling=B,T=B,R=N}if(M.done)return n(b,R),Nr&&Ed(b,O),I;if(R===null){for(;!M.done;O++,M=S.next())M=d(b,M.value,A),M!==null&&(E=a(M,E,O),T===null?I=M:T.sibling=M,T=M);return Nr&&Ed(b,O),I}for(R=r(b,R);!M.done;O++,M=S.next())M=m(R,b,O,M.value,A),M!==null&&(t&&M.alternate!==null&&R.delete(M.key===null?O:M.key),E=a(M,E,O),T===null?I=M:T.sibling=M,T=M);return t&&R.forEach(function(G){return e(b,G)}),Nr&&Ed(b,O),I}function v(b,E,S,A){if(typeof S=="object"&&S!==null&&S.type===Zp&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Bv:e:{for(var I=S.key,T=E;T!==null;){if(T.key===I){if(I=S.type,I===Zp){if(T.tag===7){n(b,T.sibling),E=i(T,S.props.children),E.return=b,b=E;break e}}else if(T.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Ku&&E6(I)===T.type){n(b,T.sibling),E=i(T,S.props),E.ref=hg(b,T,S),E.return=b,b=E;break e}n(b,T);break}else e(b,T);T=T.sibling}S.type===Zp?(E=Kd(S.props.children,b.mode,A,S.key),E.return=b,b=E):(A=US(S.type,S.key,S.props,null,b.mode,A),A.ref=hg(b,E,S),A.return=b,b=A)}return s(b);case Kp:e:{for(T=S.key;E!==null;){if(E.key===T)if(E.tag===4&&E.stateNode.containerInfo===S.containerInfo&&E.stateNode.implementation===S.implementation){n(b,E.sibling),E=i(E,S.children||[]),E.return=b,b=E;break e}else{n(b,E);break}else e(b,E);E=E.sibling}E=uC(S,b.mode,A),E.return=b,b=E}return s(b);case Ku:return T=S._init,v(b,E,T(S._payload),A)}if(Kg(S))return g(b,E,S,A);if(ug(S))return y(b,E,S,A);qv(b,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,E!==null&&E.tag===6?(n(b,E.sibling),E=i(E,S),E.return=b,b=E):(n(b,E),E=lC(S,b.mode,A),E.return=b,b=E),s(b)):n(b,E)}return v}var Vh=Xj(!0),Kj=Xj(!1),x_=Lc(null),w_=null,ah=null,lO=null;function uO(){lO=ah=w_=null}function cO(t){var e=x_.current;wr(x_),t._currentValue=e}function JI(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Ah(t,e){w_=t,lO=ah=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Qa=!0),t.firstContext=null)}function no(t){var e=t._currentValue;if(lO!==t)if(t={context:t,memoizedValue:e,next:null},ah===null){if(w_===null)throw Error(ut(308));ah=t,w_.dependencies={lanes:0,firstContext:t}}else ah=ah.next=t;return e}var Dd=null;function dO(t){Dd===null?Dd=[t]:Dd.push(t)}function Zj(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,dO(e)):(n.next=i.next,i.next=n),e.interleaved=n,mu(t,r)}function mu(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Zu=!1;function fO(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Qj(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ou(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function pc(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,qn&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,mu(t,n)}return i=r.interleaved,i===null?(e.next=e,dO(r)):(e.next=i.next,i.next=e),r.interleaved=e,mu(t,n)}function DS(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Z2(t,n)}}function S6(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?i=a=e:a=a.next=e}else i=a=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function C_(t,e,n,r){var i=t.updateQueue;Zu=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,u=l.next;l.next=null,s===null?a=u:s.next=u,s=l;var c=t.alternate;c!==null&&(c=c.updateQueue,o=c.lastBaseUpdate,o!==s&&(o===null?c.firstBaseUpdate=u:o.next=u,c.lastBaseUpdate=l))}if(a!==null){var d=i.baseState;s=0,c=u=l=null,o=a;do{var f=o.lane,m=o.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var g=t,y=o;switch(f=e,m=n,y.tag){case 1:if(g=y.payload,typeof g=="function"){d=g.call(m,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,f=typeof g=="function"?g.call(m,d,f):g,f==null)break e;d=Gr({},d,f);break e;case 2:Zu=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else m={eventTime:m,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},c===null?(u=c=m,l=d):c=c.next=m,s|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else a===null&&(i.shared.lanes=0);df|=s,t.lanes=s,t.memoizedState=d}}function _6(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=rC.transition;rC.transition={};try{t(!1),e()}finally{or=n,rC.transition=r}}function m7(){return ro().memoizedState}function Xme(t,e,n){var r=mc(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},g7(t))b7(e,n);else if(n=Zj(t,e,n,r),n!==null){var i=La();Ao(n,t,r,i),y7(n,e,r)}}function Kme(t,e,n){var r=mc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(g7(t))b7(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,o=a(s,n);if(i.hasEagerState=!0,i.eagerState=o,wo(o,s)){var l=e.interleaved;l===null?(i.next=i,dO(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=Zj(t,e,i,r),n!==null&&(i=La(),Ao(n,t,r,i),y7(n,e,r))}}function g7(t){var e=t.alternate;return t===Hr||e!==null&&e===Hr}function b7(t,e){E0=I_=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function y7(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Z2(t,n)}}var M_={readContext:no,useCallback:ia,useContext:ia,useEffect:ia,useImperativeHandle:ia,useInsertionEffect:ia,useLayoutEffect:ia,useMemo:ia,useReducer:ia,useRef:ia,useState:ia,useDebugValue:ia,useDeferredValue:ia,useTransition:ia,useMutableSource:ia,useSyncExternalStore:ia,useId:ia,unstable_isNewReconciler:!1},Zme={readContext:no,useCallback:function(t,e){return Xo().memoizedState=[t,e===void 0?null:e],t},useContext:no,useEffect:T6,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,kS(4194308,4,c7.bind(null,e,t),n)},useLayoutEffect:function(t,e){return kS(4194308,4,t,e)},useInsertionEffect:function(t,e){return kS(4,2,t,e)},useMemo:function(t,e){var n=Xo();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Xo();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=Xme.bind(null,Hr,t),[r.memoizedState,t]},useRef:function(t){var e=Xo();return t={current:t},e.memoizedState=t},useState:A6,useDebugValue:EO,useDeferredValue:function(t){return Xo().memoizedState=t},useTransition:function(){var t=A6(!1),e=t[0];return t=qme.bind(null,t[1]),Xo().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Hr,i=Xo();if(Nr){if(n===void 0)throw Error(ut(407));n=n()}else{if(n=e(),Oi===null)throw Error(ut(349));cf&30||n7(r,e,n)}i.memoizedState=n;var a={value:n,getSnapshot:e};return i.queue=a,T6(i7.bind(null,r,a,t),[t]),r.flags|=2048,mb(9,r7.bind(null,r,a,n,e),void 0,null),n},useId:function(){var t=Xo(),e=Oi.identifierPrefix;if(Nr){var n=Jl,r=Ql;n=(r&~(1<<32-_o(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=pb++,0")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=o);break}}}finally{zw=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Xg(t):""}function Che(t){switch(t.tag){case 5:return Xg(t.type);case 16:return Xg("Lazy");case 13:return Xg("Suspense");case 19:return Xg("SuspenseList");case 0:case 2:case 15:return t=Hw(t.type,!1),t;case 11:return t=Hw(t.type.render,!1),t;case 1:return t=Hw(t.type,!0),t;default:return""}}function RI(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Zp:return"Fragment";case Kp:return"Portal";case TI:return"Profiler";case j2:return"StrictMode";case wI:return"Suspense";case CI:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case QW:return(t.displayName||"Context")+".Consumer";case ZW:return(t._context.displayName||"Context")+".Provider";case Y2:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case q2:return e=t.displayName||null,e!==null?e:RI(t.type)||"Memo";case Ku:e=t._payload,t=t._init;try{return RI(t(e))}catch{}}return null}function Rhe(t){var e=t.type;switch(t.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 t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return RI(e);case 8:return e===j2?"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 Sc(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ej(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Ihe(t){var e=ej(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,a.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Fv(t){t._valueTracker||(t._valueTracker=Ihe(t))}function tj(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=ej(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function fS(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function II(t,e){var n=e.checked;return Gr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Vz(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Sc(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function nj(t,e){e=e.checked,e!=null&&W2(t,"checked",e,!1)}function MI(t,e){nj(t,e);var n=Sc(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?NI(t,e.type,n):e.hasOwnProperty("defaultValue")&&NI(t,e.type,Sc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function $z(t,e,n){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=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function NI(t,e,n){(e!=="number"||fS(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Kg=Array.isArray;function vh(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Uv.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function tb(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var m0={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},Mhe=["Webkit","ms","Moz","O"];Object.keys(m0).forEach(function(t){Mhe.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),m0[e]=m0[t]})});function sj(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||m0.hasOwnProperty(t)&&m0[t]?(""+e).trim():e+"px"}function oj(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=sj(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var Nhe=Gr({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 LI(t,e){if(e){if(Nhe[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ut(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ut(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ut(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ut(62))}}function kI(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var PI=null;function X2(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var BI=null,Eh=null,_h=null;function Yz(t){if(t=qb(t)){if(typeof BI!="function")throw Error(ut(280));var e=t.stateNode;e&&(e=wx(e),BI(t.stateNode,t.type,e))}}function lj(t){Eh?_h?_h.push(t):_h=[t]:Eh=t}function uj(){if(Eh){var t=Eh,e=_h;if(_h=Eh=null,Yz(t),e)for(t=0;t>>=0,t===0?32:31-(Ghe(t)/Vhe|0)|0}var zv=64,Hv=4194304;function Zg(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function gS(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,a=t.pingedLanes,s=n&268435455;if(s!==0){var o=s&~i;o!==0?r=Zg(o):(a&=s,a!==0&&(r=Zg(a)))}else s=n&~i,s!==0?r=Zg(s):a!==0&&(r=Zg(a));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,a=e&-e,i>=a||i===16&&(a&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function jb(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-So(e),t[e]=n}function Yhe(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=b0),n6=" ",r6=!1;function Ij(t,e){switch(t){case"keyup":return _me.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mj(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Qp=!1;function Ame(t,e){switch(t){case"compositionend":return Mj(e);case"keypress":return e.which!==32?null:(r6=!0,n6);case"textInput":return t=e.data,t===n6&&r6?null:t;default:return null}}function xme(t,e){if(Qp)return t==="compositionend"||!rO&&Ij(t,e)?(t=Cj(),N_=eO=rc=null,Qp=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=o6(n)}}function Lj(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Lj(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function kj(){for(var t=window,e=fS();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=fS(t.document)}return e}function iO(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Dme(t){var e=kj(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Lj(n.ownerDocument.documentElement,n)){if(r!==null&&iO(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!t.extend&&a>r&&(i=r,r=a,a=i),i=l6(n,a);var s=l6(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),a>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Jp=null,VI=null,v0=null,$I=!1;function u6(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$I||Jp==null||Jp!==fS(r)||(r=Jp,"selectionStart"in r&&iO(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}),v0&&ob(v0,r)||(v0=r,r=vS(VI,"onSelect"),0nh||(t.current=KI[nh],KI[nh]=null,nh--)}function _r(t,e){nh++,KI[nh]=t.current,t.current=e}var Ac={},ga=Lc(Ac),ts=Lc(!1),lf=Ac;function Hh(t,e){var n=t.type.contextTypes;if(!n)return Ac;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=e[a];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ns(t){return t=t.childContextTypes,t!=null}function _S(){wr(ts),wr(ga)}function g6(t,e,n){if(ga.current!==Ac)throw Error(ut(168));_r(ga,e),_r(ts,n)}function $j(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(ut(108,Rhe(t)||"Unknown",i));return Gr({},n,r)}function SS(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ac,lf=ga.current,_r(ga,t),_r(ts,ts.current),!0}function b6(t,e,n){var r=t.stateNode;if(!r)throw Error(ut(169));n?(t=$j(t,e,lf),r.__reactInternalMemoizedMergedChildContext=t,wr(ts),wr(ga),_r(ga,t)):wr(ts),_r(ts,n)}var zl=null,Cx=!1,tC=!1;function Wj(t){zl===null?zl=[t]:zl.push(t)}function Wme(t){Cx=!0,Wj(t)}function kc(){if(!tC&&zl!==null){tC=!0;var t=0,e=or;try{var n=zl;for(or=1;t>=s,i-=s,Ql=1<<32-So(e)+i|n<O?(N=R,R=null):N=R.sibling;var M=f(b,R,_[O],A);if(M===null){R===null&&(R=N);break}t&&R&&M.alternate===null&&e(b,R),E=a(M,E,O),x===null?I=M:x.sibling=M,x=M,R=N}if(O===_.length)return n(b,R),Nr&&Ed(b,O),I;if(R===null){for(;O<_.length;O++)R=d(b,_[O],A),R!==null&&(E=a(R,E,O),x===null?I=R:x.sibling=R,x=R);return Nr&&Ed(b,O),I}for(R=r(b,R);O<_.length;O++)N=m(R,b,O,_[O],A),N!==null&&(t&&N.alternate!==null&&R.delete(N.key===null?O:N.key),E=a(N,E,O),x===null?I=N:x.sibling=N,x=N);return t&&R.forEach(function(B){return e(b,B)}),Nr&&Ed(b,O),I}function y(b,E,_,A){var I=ug(_);if(typeof I!="function")throw Error(ut(150));if(_=I.call(_),_==null)throw Error(ut(151));for(var x=I=null,R=E,O=E=0,N=null,M=_.next();R!==null&&!M.done;O++,M=_.next()){R.index>O?(N=R,R=null):N=R.sibling;var B=f(b,R,M.value,A);if(B===null){R===null&&(R=N);break}t&&R&&B.alternate===null&&e(b,R),E=a(B,E,O),x===null?I=B:x.sibling=B,x=B,R=N}if(M.done)return n(b,R),Nr&&Ed(b,O),I;if(R===null){for(;!M.done;O++,M=_.next())M=d(b,M.value,A),M!==null&&(E=a(M,E,O),x===null?I=M:x.sibling=M,x=M);return Nr&&Ed(b,O),I}for(R=r(b,R);!M.done;O++,M=_.next())M=m(R,b,O,M.value,A),M!==null&&(t&&M.alternate!==null&&R.delete(M.key===null?O:M.key),E=a(M,E,O),x===null?I=M:x.sibling=M,x=M);return t&&R.forEach(function(G){return e(b,G)}),Nr&&Ed(b,O),I}function v(b,E,_,A){if(typeof _=="object"&&_!==null&&_.type===Zp&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Bv:e:{for(var I=_.key,x=E;x!==null;){if(x.key===I){if(I=_.type,I===Zp){if(x.tag===7){n(b,x.sibling),E=i(x,_.props.children),E.return=b,b=E;break e}}else if(x.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Ku&&E6(I)===x.type){n(b,x.sibling),E=i(x,_.props),E.ref=hg(b,x,_),E.return=b,b=E;break e}n(b,x);break}else e(b,x);x=x.sibling}_.type===Zp?(E=Kd(_.props.children,b.mode,A,_.key),E.return=b,b=E):(A=U_(_.type,_.key,_.props,null,b.mode,A),A.ref=hg(b,E,_),A.return=b,b=A)}return s(b);case Kp:e:{for(x=_.key;E!==null;){if(E.key===x)if(E.tag===4&&E.stateNode.containerInfo===_.containerInfo&&E.stateNode.implementation===_.implementation){n(b,E.sibling),E=i(E,_.children||[]),E.return=b,b=E;break e}else{n(b,E);break}else e(b,E);E=E.sibling}E=uC(_,b.mode,A),E.return=b,b=E}return s(b);case Ku:return x=_._init,v(b,E,x(_._payload),A)}if(Kg(_))return g(b,E,_,A);if(ug(_))return y(b,E,_,A);qv(b,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,E!==null&&E.tag===6?(n(b,E.sibling),E=i(E,_),E.return=b,b=E):(n(b,E),E=lC(_,b.mode,A),E.return=b,b=E),s(b)):n(b,E)}return v}var Vh=Xj(!0),Kj=Xj(!1),TS=Lc(null),wS=null,ah=null,lO=null;function uO(){lO=ah=wS=null}function cO(t){var e=TS.current;wr(TS),t._currentValue=e}function JI(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Ah(t,e){wS=t,lO=ah=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Qa=!0),t.firstContext=null)}function no(t){var e=t._currentValue;if(lO!==t)if(t={context:t,memoizedValue:e,next:null},ah===null){if(wS===null)throw Error(ut(308));ah=t,wS.dependencies={lanes:0,firstContext:t}}else ah=ah.next=t;return e}var Dd=null;function dO(t){Dd===null?Dd=[t]:Dd.push(t)}function Zj(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,dO(e)):(n.next=i.next,i.next=n),e.interleaved=n,mu(t,r)}function mu(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Zu=!1;function fO(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Qj(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ou(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function pc(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,qn&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,mu(t,n)}return i=r.interleaved,i===null?(e.next=e,dO(r)):(e.next=i.next,i.next=e),r.interleaved=e,mu(t,n)}function D_(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Z2(t,n)}}function _6(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?i=a=e:a=a.next=e}else i=a=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function CS(t,e,n,r){var i=t.updateQueue;Zu=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,u=l.next;l.next=null,s===null?a=u:s.next=u,s=l;var c=t.alternate;c!==null&&(c=c.updateQueue,o=c.lastBaseUpdate,o!==s&&(o===null?c.firstBaseUpdate=u:o.next=u,c.lastBaseUpdate=l))}if(a!==null){var d=i.baseState;s=0,c=u=l=null,o=a;do{var f=o.lane,m=o.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var g=t,y=o;switch(f=e,m=n,y.tag){case 1:if(g=y.payload,typeof g=="function"){d=g.call(m,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,f=typeof g=="function"?g.call(m,d,f):g,f==null)break e;d=Gr({},d,f);break e;case 2:Zu=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else m={eventTime:m,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},c===null?(u=c=m,l=d):c=c.next=m,s|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else a===null&&(i.shared.lanes=0);df|=s,t.lanes=s,t.memoizedState=d}}function S6(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=rC.transition;rC.transition={};try{t(!1),e()}finally{or=n,rC.transition=r}}function m7(){return ro().memoizedState}function Xme(t,e,n){var r=mc(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},g7(t))b7(e,n);else if(n=Zj(t,e,n,r),n!==null){var i=La();Ao(n,t,r,i),y7(n,e,r)}}function Kme(t,e,n){var r=mc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(g7(t))b7(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,o=a(s,n);if(i.hasEagerState=!0,i.eagerState=o,wo(o,s)){var l=e.interleaved;l===null?(i.next=i,dO(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=Zj(t,e,i,r),n!==null&&(i=La(),Ao(n,t,r,i),y7(n,e,r))}}function g7(t){var e=t.alternate;return t===Hr||e!==null&&e===Hr}function b7(t,e){E0=IS=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function y7(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Z2(t,n)}}var MS={readContext:no,useCallback:ia,useContext:ia,useEffect:ia,useImperativeHandle:ia,useInsertionEffect:ia,useLayoutEffect:ia,useMemo:ia,useReducer:ia,useRef:ia,useState:ia,useDebugValue:ia,useDeferredValue:ia,useTransition:ia,useMutableSource:ia,useSyncExternalStore:ia,useId:ia,unstable_isNewReconciler:!1},Zme={readContext:no,useCallback:function(t,e){return Xo().memoizedState=[t,e===void 0?null:e],t},useContext:no,useEffect:x6,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,k_(4194308,4,c7.bind(null,e,t),n)},useLayoutEffect:function(t,e){return k_(4194308,4,t,e)},useInsertionEffect:function(t,e){return k_(4,2,t,e)},useMemo:function(t,e){var n=Xo();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Xo();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=Xme.bind(null,Hr,t),[r.memoizedState,t]},useRef:function(t){var e=Xo();return t={current:t},e.memoizedState=t},useState:A6,useDebugValue:EO,useDeferredValue:function(t){return Xo().memoizedState=t},useTransition:function(){var t=A6(!1),e=t[0];return t=qme.bind(null,t[1]),Xo().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Hr,i=Xo();if(Nr){if(n===void 0)throw Error(ut(407));n=n()}else{if(n=e(),Oi===null)throw Error(ut(349));cf&30||n7(r,e,n)}i.memoizedState=n;var a={value:n,getSnapshot:e};return i.queue=a,x6(i7.bind(null,r,a,t),[t]),r.flags|=2048,mb(9,r7.bind(null,r,a,n,e),void 0,null),n},useId:function(){var t=Xo(),e=Oi.identifierPrefix;if(Nr){var n=Jl,r=Ql;n=(r&~(1<<32-So(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=pb++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[nl]=e,t[cb]=r,R7(t,e,!1,!1),e.stateNode=t;e:{switch(s=kI(n,r),n){case"dialog":Ar("cancel",t),Ar("close",t),i=r;break;case"iframe":case"object":case"embed":Ar("load",t),i=r;break;case"video":case"audio":for(i=0;ijh&&(e.flags|=128,r=!0,mg(a,!1),e.lanes=4194304)}else{if(!r)if(t=R_(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),mg(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Nr)return aa(e),null}else 2*ei()-a.renderingStartTime>jh&&n!==1073741824&&(e.flags|=128,r=!0,mg(a,!1),e.lanes=4194304);a.isBackwards?(s.sibling=e.child,e.child=s):(n=a.last,n!==null?n.sibling=s:e.child=s,a.last=s)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ei(),e.sibling=null,n=Br.current,Sr(Br,r?n&1|2:n&1),e):(aa(e),null);case 22:case 23:return wO(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?hs&1073741824&&(aa(e),e.subtreeFlags&6&&(e.flags|=8192)):aa(e),null;case 24:return null;case 25:return null}throw Error(ut(156,e.tag))}function age(t,e){switch(sO(e),e.tag){case 1:return ns(e.type)&&S_(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return $h(),wr(ts),wr(ga),mO(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return hO(e),null;case 13:if(wr(Br),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ut(340));Gh()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return wr(Br),null;case 4:return $h(),null;case 10:return cO(e.type._context),null;case 22:case 23:return wO(),null;case 24:return null;default:return null}}var Kv=!1,da=!1,sge=typeof WeakSet=="function"?WeakSet:Set,$t=null;function sh(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){jr(t,e,r)}else n.current=null}function lM(t,e,n){try{n()}catch(r){jr(t,e,r)}}var k6=!1;function oge(t,e){if(WI=b_,t=kj(),iO(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,o=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(o=s+i),d!==a||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===t)break t;if(f===n&&++u===i&&(o=s),f===a&&++c===r&&(l=s),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(jI={focusedElem:t,selectionRange:n},b_=!1,$t=e;$t!==null;)if(e=$t,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,$t=t;else for(;$t!==null;){e=$t;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,v=g.memoizedState,b=e.stateNode,E=b.getSnapshotBeforeUpdate(e.elementType===e.type?y:mo(e.type,y),v);b.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var S=e.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ut(163))}}catch(A){jr(e,e.return,A)}if(t=e.sibling,t!==null){t.return=e.return,$t=t;break}$t=e.return}return g=k6,k6=!1,g}function S0(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var a=i.destroy;i.destroy=void 0,a!==void 0&&lM(e,n,a)}i=i.next}while(i!==r)}}function MT(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function uM(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function N7(t){var e=t.alternate;e!==null&&(t.alternate=null,N7(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[nl],delete e[cb],delete e[XI],delete e[Vme],delete e[$me])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function O7(t){return t.tag===5||t.tag===3||t.tag===4}function P6(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||O7(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function cM(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=E_));else if(r!==4&&(t=t.child,t!==null))for(cM(t,e,n),t=t.sibling;t!==null;)cM(t,e,n),t=t.sibling}function dM(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(dM(t,e,n),t=t.sibling;t!==null;)dM(t,e,n),t=t.sibling}var Ui=null,bo=!1;function Du(t,e,n){for(n=n.child;n!==null;)D7(t,e,n),n=n.sibling}function D7(t,e,n){if(ul&&typeof ul.onCommitFiberUnmount=="function")try{ul.onCommitFiberUnmount(_T,n)}catch{}switch(n.tag){case 5:da||sh(n,e);case 6:var r=Ui,i=bo;Ui=null,Du(t,e,n),Ui=r,bo=i,Ui!==null&&(bo?(t=Ui,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ui.removeChild(n.stateNode));break;case 18:Ui!==null&&(bo?(t=Ui,n=n.stateNode,t.nodeType===8?eC(t.parentNode,n):t.nodeType===1&&eC(t,n),ab(t)):eC(Ui,n.stateNode));break;case 4:r=Ui,i=bo,Ui=n.stateNode.containerInfo,bo=!0,Du(t,e,n),Ui=r,bo=i;break;case 0:case 11:case 14:case 15:if(!da&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&lM(n,e,s),i=i.next}while(i!==r)}Du(t,e,n);break;case 1:if(!da&&(sh(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){jr(n,e,o)}Du(t,e,n);break;case 21:Du(t,e,n);break;case 22:n.mode&1?(da=(r=da)||n.memoizedState!==null,Du(t,e,n),da=r):Du(t,e,n);break;default:Du(t,e,n)}}function B6(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new sge),e.forEach(function(r){var i=gge.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function uo(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~a}if(r=i,r=ei()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*uge(r/1960))-r,10t?16:t,ic===null)var r=!1;else{if(t=ic,ic=null,D_=0,qn&6)throw Error(ut(331));var i=qn;for(qn|=4,$t=t.current;$t!==null;){var a=$t,s=a.child;if($t.flags&16){var o=a.deletions;if(o!==null){for(var l=0;lei()-TO?Xd(t,0):AO|=n),rs(t,e)}function H7(t,e){e===0&&(t.mode&1?(e=Hv,Hv<<=1,!(Hv&130023424)&&(Hv=4194304)):e=1);var n=La();t=mu(t,e),t!==null&&(jb(t,e,n),rs(t,n))}function mge(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),H7(t,n)}function gge(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(ut(314))}r!==null&&r.delete(e),H7(t,n)}var G7;G7=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ts.current)Qa=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Qa=!1,rge(t,e,n);Qa=!!(t.flags&131072)}else Qa=!1,Nr&&e.flags&1048576&&jj(e,T_,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;PS(t,e),t=e.pendingProps;var i=Hh(e,ga.current);Ah(e,n),i=bO(null,e,r,t,i,n);var a=yO();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,ns(r)?(a=!0,__(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,fO(e),i.updater=IT,e.stateNode=i,i._reactInternals=e,tM(e,r,t,n),e=iM(null,e,r,!0,a,n)):(e.tag=0,Nr&&a&&aO(e),Ca(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(PS(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=yge(r),t=mo(r,t),i){case 0:e=rM(null,e,r,t,n);break e;case 1:e=O6(null,e,r,t,n);break e;case 11:e=M6(null,e,r,t,n);break e;case 14:e=N6(null,e,r,mo(r.type,t),n);break e}throw Error(ut(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:mo(r,i),rM(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:mo(r,i),O6(t,e,r,i,n);case 3:e:{if(x7(e),t===null)throw Error(ut(387));r=e.pendingProps,a=e.memoizedState,i=a.element,Qj(t,e),C_(e,r,null,n);var s=e.memoizedState;if(r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){i=Wh(Error(ut(423)),e),e=D6(t,e,r,n,i);break e}else if(r!==i){i=Wh(Error(ut(424)),e),e=D6(t,e,r,n,i);break e}else for(bs=fc(e.stateNode.containerInfo.firstChild),Es=e,Nr=!0,vo=null,n=Kj(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Gh(),r===i){e=gu(t,e,n);break e}Ca(t,e,r,n)}e=e.child}return e;case 5:return Jj(e),t===null&&QI(e),r=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,s=i.children,YI(r,i)?s=null:a!==null&&YI(r,a)&&(e.flags|=32),T7(t,e),Ca(t,e,s,n),e.child;case 6:return t===null&&QI(e),null;case 13:return w7(t,e,n);case 4:return pO(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Vh(e,null,r,n):Ca(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:mo(r,i),M6(t,e,r,i,n);case 7:return Ca(t,e,e.pendingProps,n),e.child;case 8:return Ca(t,e,e.pendingProps.children,n),e.child;case 12:return Ca(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,a=e.memoizedProps,s=i.value,Sr(x_,r._currentValue),r._currentValue=s,a!==null)if(wo(a.value,s)){if(a.children===i.children&&!ts.current){e=gu(t,e,n);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){s=a.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(a.tag===1){l=ou(-1,n&-n),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),JI(a.return,n,e),o.lanes|=n;break}l=l.next}}else if(a.tag===10)s=a.type===e.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(ut(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),JI(s,n,e),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}Ca(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Ah(e,n),i=no(i),r=r(i),e.flags|=1,Ca(t,e,r,n),e.child;case 14:return r=e.type,i=mo(r,e.pendingProps),i=mo(r.type,i),N6(t,e,r,i,n);case 15:return _7(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:mo(r,i),PS(t,e),e.tag=1,ns(r)?(t=!0,__(e)):t=!1,Ah(e,n),v7(e,r,i),tM(e,r,i,n),iM(null,e,r,!0,t,n);case 19:return C7(t,e,n);case 22:return A7(t,e,n)}throw Error(ut(156,e.tag))};function V7(t,e){return gj(t,e)}function bge(t,e,n,r){this.tag=t,this.key=n,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 Qs(t,e,n,r){return new bge(t,e,n,r)}function RO(t){return t=t.prototype,!(!t||!t.isReactComponent)}function yge(t){if(typeof t=="function")return RO(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Y2)return 11;if(t===q2)return 14}return 2}function gc(t,e){var n=t.alternate;return n===null?(n=Qs(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function US(t,e,n,r,i,a){var s=2;if(r=t,typeof t=="function")RO(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Zp:return Kd(n.children,i,a,e);case j2:s=8,i|=8;break;case xI:return t=Qs(12,n,e,i|2),t.elementType=xI,t.lanes=a,t;case wI:return t=Qs(13,n,e,i),t.elementType=wI,t.lanes=a,t;case CI:return t=Qs(19,n,e,i),t.elementType=CI,t.lanes=a,t;case JW:return OT(n,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ZW:s=10;break e;case QW:s=9;break e;case Y2:s=11;break e;case q2:s=14;break e;case Ku:s=16,r=null;break e}throw Error(ut(130,t==null?t:typeof t,""))}return e=Qs(s,n,e,i),e.elementType=t,e.type=r,e.lanes=a,e}function Kd(t,e,n,r){return t=Qs(7,t,r,e),t.lanes=n,t}function OT(t,e,n,r){return t=Qs(22,t,r,e),t.elementType=JW,t.lanes=n,t.stateNode={isHidden:!1},t}function lC(t,e,n){return t=Qs(6,t,null,e),t.lanes=n,t}function uC(t,e,n){return e=Qs(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function vge(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vw(0),this.expirationTimes=Vw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vw(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function IO(t,e,n,r,i,a,s,o,l){return t=new vge(t,e,n,o,l),e===1?(e=1,a===!0&&(e|=8)):e=0,a=Qs(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},fO(a),t}function Ege(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Y7)}catch(t){console.error(t)}}Y7(),YW.exports=ws;var Mf=YW.exports;const DO=_l(Mf),xge=aV({__proto__:null,default:DO},[Mf]),[q7,wge]=Mo({strict:!1,name:"PortalContext"}),LO="chakra-portal",Cge=".chakra-portal",Rge=t=>$.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:t.zIndex,top:0,left:0,right:0},children:t.children}),Ige=t=>{const{appendToParentPortal:e,children:n}=t,[r,i]=w.useState(null),a=w.useRef(null),[,s]=w.useState({});w.useEffect(()=>s({}),[]);const o=wge(),l=oue();e_(()=>{if(!r)return;const c=r.ownerDocument,d=e?o??c.body:c.body;if(!d)return;a.current=c.createElement("div"),a.current.className=LO,d.appendChild(a.current),s({});const f=a.current;return()=>{d.contains(f)&&d.removeChild(f)}},[r]);const u=l!=null&&l.zIndex?$.jsx(Rge,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return a.current?Mf.createPortal($.jsx(q7,{value:a.current,children:u}),a.current):$.jsx("span",{ref:c=>{c&&i(c)}})},Mge=t=>{const{children:e,containerRef:n,appendToParentPortal:r}=t,i=n.current,a=i??(typeof window<"u"?document.body:void 0),s=w.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=LO),l},[i]),[,o]=w.useState({});return e_(()=>o({}),[]),e_(()=>{if(!(!s||!a))return a.appendChild(s),()=>{a.removeChild(s)}},[s,a]),a&&s?Mf.createPortal($.jsx(q7,{value:r?s:null,children:e}),s):null};function BT(t){const e={appendToParentPortal:!0,...t},{containerRef:n,...r}=e;return n?$.jsx(Mge,{containerRef:n,...r}):$.jsx(Ige,{...r})}BT.className=LO;BT.selector=Cge;BT.displayName="Portal";const[Nge,Oge]=Mo({name:"ToastOptionsContext",strict:!1}),Dge=t=>{const e=w.useSyncExternalStore(tl.subscribe,tl.getState,tl.getState),{motionVariants:n,component:r=PW,portalProps:i,animatePresenceProps:a}=t,o=Object.keys(e).map(l=>{const u=e[l];return $.jsx("div",{role:"region","aria-live":"polite","aria-label":`Notifications-${l}`,id:`chakra-toast-manager-${l}`,style:Hpe(l),children:$.jsx(Fpe,{...a,initial:!1,children:u.map(c=>$.jsx(r,{motionVariants:n,...c},c.id))})},l)});return $.jsx(BT,{...i,children:o})},Lge=t=>function({children:n,theme:r=t,toastOptions:i,...a}){return $.jsxs(uue,{theme:r,...a,children:[$.jsx(Nge,{value:i==null?void 0:i.defaultOptions,children:n}),$.jsx(Dge,{...i})]})},kge=Lge(Xoe);function W6(t){return t.sort((e,n)=>{const r=e.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}const Pge=t=>typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE;function j6(t,e,n){let r=t+1;return n&&r>=e&&(r=0),r}function Y6(t,e,n){let r=t-1;return n&&r<0&&(r=e),r}const cC=typeof window<"u"?w.useLayoutEffect:w.useEffect,q6=t=>t;var Bge=Object.defineProperty,Fge=(t,e,n)=>e in t?Bge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$r=(t,e,n)=>(Fge(t,typeof e!="symbol"?e+"":e,n),n);class Uge{constructor(){$r(this,"descendants",new Map),$r(this,"register",e=>{if(e!=null)return Pge(e)?this.registerNode(e):n=>{this.registerNode(n,e)}}),$r(this,"unregister",e=>{this.descendants.delete(e);const n=W6(Array.from(this.descendants.keys()));this.assignIndex(n)}),$r(this,"destroy",()=>{this.descendants.clear()}),$r(this,"assignIndex",e=>{this.descendants.forEach(n=>{const r=e.indexOf(n.node);n.index=r,n.node.dataset.index=n.index.toString()})}),$r(this,"count",()=>this.descendants.size),$r(this,"enabledCount",()=>this.enabledValues().length),$r(this,"values",()=>Array.from(this.descendants.values()).sort((n,r)=>n.index-r.index)),$r(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),$r(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),$r(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),$r(this,"first",()=>this.item(0)),$r(this,"firstEnabled",()=>this.enabledItem(0)),$r(this,"last",()=>this.item(this.descendants.size-1)),$r(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),$r(this,"indexOf",e=>{var n;return e?((n=this.descendants.get(e))==null?void 0:n.index)??-1:-1}),$r(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(n=>n.node.isSameNode(e))),$r(this,"next",(e,n=!0)=>{const r=j6(e,this.count(),n);return this.item(r)}),$r(this,"nextEnabled",(e,n=!0)=>{const r=this.item(e);if(!r)return;const i=this.enabledIndexOf(r.node),a=j6(i,this.enabledCount(),n);return this.enabledItem(a)}),$r(this,"prev",(e,n=!0)=>{const r=Y6(e,this.count()-1,n);return this.item(r)}),$r(this,"prevEnabled",(e,n=!0)=>{const r=this.item(e);if(!r)return;const i=this.enabledIndexOf(r.node),a=Y6(i,this.enabledCount()-1,n);return this.enabledItem(a)}),$r(this,"registerNode",(e,n)=>{if(!e||this.descendants.has(e))return;const r=Array.from(this.descendants.keys()).concat(e),i=W6(r);n!=null&&n.disabled&&(n.disabled=!!n.disabled);const a={node:e,index:-1,...n};this.descendants.set(e,a),this.assignIndex(i)})}}function zge(){const[t,e]=Mo({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});return[t,e,()=>{const i=w.useRef(new Uge);return cC(()=>()=>i.current.destroy()),i.current},i=>{const a=e(),[s,o]=w.useState(-1),l=w.useRef(null);cC(()=>()=>{l.current&&a.unregister(l.current)},[]),cC(()=>{if(!l.current)return;const c=Number(l.current.dataset.index);s!=c&&!Number.isNaN(c)&&o(c)});const u=q6(i?a.register(i):a.register);return{descendants:a,index:s,enabledIndex:a.enabledIndexOf(l.current),register:ZA(u,l)}}]}const gM=Cr("div");gM.displayName="Box";const[Nze,Hge]=Mo({strict:!1,name:"ButtonGroupContext"});function Jg(t){const{children:e,className:n,...r}=t,i=w.isValidElement(e)?w.cloneElement(e,{"aria-hidden":!0,focusable:!1}):e,a=ba("chakra-button__icon",n);return $.jsx(Cr.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:a,children:i})}Jg.displayName="ButtonIcon";function bM(t){const{label:e,placement:n,spacing:r="0.5rem",children:i=$.jsx(z2,{color:"currentColor",width:"1em",height:"1em"}),className:a,__css:s,...o}=t,l=ba("chakra-button__spinner",a),u=n==="start"?"marginEnd":"marginStart",c=w.useMemo(()=>({display:"flex",alignItems:"center",position:e?"relative":"absolute",[u]:e?r:0,fontSize:"1em",lineHeight:"normal",...s}),[s,e,u,r]);return $.jsx(Cr.div,{className:l,...o,__css:c,children:i})}bM.displayName="ButtonSpinner";function Gge(t){const[e,n]=w.useState(!t);return{ref:w.useCallback(a=>{a&&n(a.tagName==="BUTTON")},[]),type:e?"button":void 0}}const bb=Xi((t,e)=>{const n=Hge(),r=$b("Button",{...n,...t}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:a,isActive:s,children:o,leftIcon:l,rightIcon:u,loadingText:c,iconSpacing:d="0.5rem",type:f,spinner:m,spinnerPlacement:g="start",className:y,as:v,shouldWrapChildren:b,...E}=um(t),S=w.useMemo(()=>{const R={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:R}}},[r,n]),{ref:A,type:I}=Gge(v),T={rightIcon:u,leftIcon:l,iconSpacing:d,children:o,shouldWrapChildren:b};return $.jsxs(Cr.button,{disabled:i||a,ref:Nee(e,A),as:v,type:f??I,"data-active":YR(s),"data-loading":YR(a),__css:S,className:ba("chakra-button",y),...E,children:[a&&g==="start"&&$.jsx(bM,{className:"chakra-button__spinner--start",label:c,placement:"start",spacing:d,children:m}),a?c||$.jsx(Cr.span,{opacity:0,children:$.jsx(X6,{...T})}):$.jsx(X6,{...T}),a&&g==="end"&&$.jsx(bM,{className:"chakra-button__spinner--end",label:c,placement:"end",spacing:d,children:m})]})});bb.displayName="Button";function X6(t){const{leftIcon:e,rightIcon:n,children:r,iconSpacing:i,shouldWrapChildren:a}=t;return a?$.jsxs("span",{style:{display:"contents"},children:[e&&$.jsx(Jg,{marginEnd:i,children:e}),r,n&&$.jsx(Jg,{marginStart:i,children:n})]}):$.jsxs($.Fragment,{children:[e&&$.jsx(Jg,{marginEnd:i,children:e}),r,n&&$.jsx(Jg,{marginStart:i,children:n})]})}const yM=Xi((t,e)=>{const{icon:n,children:r,isRound:i,"aria-label":a,...s}=t,o=n||r,l=w.isValidElement(o)?w.cloneElement(o,{"aria-hidden":!0,focusable:!1}):null;return $.jsx(bb,{px:"0",py:"0",borderRadius:i?"full":void 0,ref:e,"aria-label":a,...s,children:l})});yM.displayName="IconButton";const X7=Xi(function(e,n){const{direction:r,align:i,justify:a,wrap:s,basis:o,grow:l,shrink:u,...c}=e,d={display:"flex",flexDirection:r,alignItems:i,justifyContent:a,flexWrap:s,flexBasis:o,flexGrow:l,flexShrink:u};return $.jsx(Cr.div,{ref:n,__css:d,...c})});X7.displayName="Flex";function K7(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}var Z7={exports:{}},Vge="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",$ge=Vge,Wge=$ge;function Q7(){}function J7(){}J7.resetWarningCache=Q7;var jge=function(){function t(r,i,a,s,o,l){if(l!==Wge){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:J7,resetWarningCache:Q7};return n.PropTypes=n,n};Z7.exports=jge();var Yge=Z7.exports;const yr=_l(Yge);function hm(t,e,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function o(c){try{u(r.next(c))}catch(d){s(d)}}function l(c){try{u(r.throw(c))}catch(d){s(d)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((r=r.apply(t,e||[])).next())})}function mm(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]0)&&!(i=r.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return a}function Xge(){for(var t=[],e=0;eu!=null);const[o,l]=w.useState(()=>a.map((u,c)=>({media:u,matches:n?!!s[c]:i().matchMedia(u).matches})));return w.useEffect(()=>{const u=i();l(a.map(f=>({media:f,matches:u.matchMedia(f).matches})));const c=a.map(f=>u.matchMedia(f)),d=f=>{l(m=>m.slice().map(g=>g.media===f.media?{...g,matches:f.matches}:g))};return c.forEach(f=>{typeof f.addListener=="function"?f.addListener(d):f.addEventListener("change",d)}),()=>{c.forEach(f=>{typeof f.removeListener=="function"?f.removeListener(d):f.removeEventListener("change",d)})}},[i]),o.map(u=>u.matches)}function Zge(t){var o;const e=es(t)?t:{fallback:t??"base"},r=U2().__breakpoints.details.map(({minMaxQuery:l,breakpoint:u})=>({breakpoint:u,query:l.replace("@media screen and ","")})),i=r.map(l=>l.breakpoint===e.fallback),s=Kge(r.map(l=>l.query),{fallback:i,ssr:e.ssr}).findIndex(l=>l==!0);return((o=r[s])==null?void 0:o.breakpoint)??e.fallback}function Qge(t,e,n=SV){let r=Object.keys(t).indexOf(e);if(r!==-1)return t[e];let i=n.indexOf(e);for(;i>=0;){const a=n[i];if(t.hasOwnProperty(a)){r=i;break}i-=1}if(r!==-1){const a=n[r];return t[a]}}function Jge(t,e){var o;const n=es(e)?e:{fallback:"base"},r=Zge(n),i=U2();if(!r)return;const a=Array.from(((o=i.__breakpoints)==null?void 0:o.keys)||[]),s=Array.isArray(t)?Object.fromEntries(Object.entries(xee(t,a)).map(([l,u])=>[l,u])):t;return Qge(s,r,a)}function e0e(){const t=w.useRef(new Map),e=t.current,n=w.useCallback((i,a,s,o)=>{t.current.set(s,{type:a,el:i,options:o}),i.addEventListener(a,s,o)},[]),r=w.useCallback((i,a,s,o)=>{i.removeEventListener(a,s,o),t.current.delete(s)},[]);return w.useEffect(()=>()=>{e.forEach((i,a)=>{r(i.el,i.type,a,i.options)})},[r,e]),{add:n,remove:r}}function dC(t){var i,a;const e=((a=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:a[0])??t.target,{tagName:n,isContentEditable:r}=e;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function t0e(t={}){const{ref:e,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:a=!0,onMouseDown:s,onMouseUp:o,onClick:l,onKeyDown:u,onKeyUp:c,tabIndex:d,onMouseOver:f,onMouseLeave:m,...g}=t,[y,v]=w.useState(!0),[b,E]=w.useState(!1),S=e0e(),A=ee=>{ee&&ee.tagName!=="BUTTON"&&v(!1)},I=y?d:d||0,T=n&&!r,R=w.useCallback(ee=>{if(n){ee.stopPropagation(),ee.preventDefault();return}ee.currentTarget.focus(),l==null||l(ee)},[n,l]),O=w.useCallback(ee=>{b&&dC(ee)&&(ee.preventDefault(),ee.stopPropagation(),E(!1),S.remove(document,"keyup",O,!1))},[b,S]),N=w.useCallback(ee=>{if(u==null||u(ee),n||ee.defaultPrevented||ee.metaKey||!dC(ee.nativeEvent)||y)return;const F=i&&ee.key==="Enter";a&&ee.key===" "&&(ee.preventDefault(),E(!0)),F&&(ee.preventDefault(),ee.currentTarget.click()),S.add(document,"keyup",O,!1)},[n,y,u,i,a,S,O]),M=w.useCallback(ee=>{if(c==null||c(ee),n||ee.defaultPrevented||ee.metaKey||!dC(ee.nativeEvent)||y)return;a&&ee.key===" "&&(ee.preventDefault(),E(!1),ee.currentTarget.click())},[a,y,n,c]),B=w.useCallback(ee=>{ee.button===0&&(E(!1),S.remove(document,"mouseup",B,!1))},[S]),G=w.useCallback(ee=>{if(ee.button!==0)return;if(n){ee.stopPropagation(),ee.preventDefault();return}y||E(!0),ee.currentTarget.focus({preventScroll:!0}),S.add(document,"mouseup",B,!1),s==null||s(ee)},[n,y,s,S,B]),W=w.useCallback(ee=>{ee.button===0&&(y||E(!1),o==null||o(ee))},[o,y]),K=w.useCallback(ee=>{if(n){ee.preventDefault();return}f==null||f(ee)},[n,f]),se=w.useCallback(ee=>{b&&(ee.preventDefault(),E(!1)),m==null||m(ee)},[b,m]),ae=ZA(e,A);return y?{...g,ref:ae,type:"button","aria-disabled":T?void 0:n,disabled:T,onClick:R,onMouseDown:s,onMouseUp:o,onKeyUp:c,onKeyDown:u,onMouseOver:f,onMouseLeave:m}:{...g,ref:ae,role:"button","data-active":YR(b),"aria-disabled":n?"true":void 0,tabIndex:T?void 0:I,onClick:R,onMouseDown:G,onMouseUp:W,onKeyUp:M,onKeyDown:N,onMouseOver:K,onMouseLeave:se}}const eY=t=>$.jsx(Cr.div,{className:"chakra-stack__item",...t,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...t.__css}});eY.displayName="StackItem";function n0e(t){const{spacing:e,direction:n}=t,r={column:{my:e,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:e,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:e,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:e,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":Tee(n,i=>r[i])}}const P_=Xi((t,e)=>{const{isInline:n,direction:r,align:i,justify:a,spacing:s="0.5rem",wrap:o,children:l,divider:u,className:c,shouldWrapChildren:d,...f}=t,m=n?"row":r??"column",g=w.useMemo(()=>n0e({spacing:s,direction:m}),[s,m]),y=!!u,v=!d&&!y,b=w.useMemo(()=>{const S=yV(l);return v?S:S.map((A,I)=>{const T=typeof A.key<"u"?A.key:I,R=I+1===S.length,N=d?$.jsx(eY,{children:A},T):A;if(!y)return N;const M=w.cloneElement(u,{__css:g}),B=R?null:M;return $.jsxs(w.Fragment,{children:[N,B]},T)})},[u,g,y,v,d,l]),E=ba("chakra-stack",c);return $.jsx(Cr.div,{ref:e,display:"flex",alignItems:i,justifyContent:a,flexDirection:m,flexWrap:o,gap:y?void 0:s,className:E,...f,children:b})});P_.displayName="Stack";const vM=Xi((t,e)=>$.jsx(P_,{align:"center",...t,direction:"column",ref:e}));vM.displayName="VStack";const[r0e,i0e,a0e,s0e]=zge();function o0e(t){const{defaultIndex:e,onChange:n,index:r,isManual:i,isLazy:a,lazyBehavior:s="unmount",orientation:o="horizontal",direction:l="ltr",...u}=t,[c,d]=w.useState(e??0),[f,m]=Iee({defaultValue:e??0,value:r,onChange:n});w.useEffect(()=>{r!=null&&d(r)},[r]);const g=a0e(),y=w.useId();return{id:`tabs-${t.id??y}`,selectedIndex:f,focusedIndex:c,setSelectedIndex:m,setFocusedIndex:d,isManual:i,isLazy:a,lazyBehavior:s,orientation:o,descendants:g,direction:l,htmlProps:u}}const[l0e,FT]=Mo({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function u0e(t){const{focusedIndex:e,orientation:n,direction:r}=FT(),i=i0e(),a=w.useCallback(s=>{const o=()=>{var S;const E=i.nextEnabled(e);E&&((S=E.node)==null||S.focus())},l=()=>{var S;const E=i.prevEnabled(e);E&&((S=E.node)==null||S.focus())},u=()=>{var S;const E=i.firstEnabled();E&&((S=E.node)==null||S.focus())},c=()=>{var S;const E=i.lastEnabled();E&&((S=E.node)==null||S.focus())},d=n==="horizontal",f=n==="vertical",m=s.key,g=r==="ltr"?"ArrowLeft":"ArrowRight",y=r==="ltr"?"ArrowRight":"ArrowLeft",b={[g]:()=>d&&l(),[y]:()=>d&&o(),ArrowDown:()=>f&&o(),ArrowUp:()=>f&&l(),Home:u,End:c}[m];b&&(s.preventDefault(),b(s))},[i,e,n,r]);return{...t,role:"tablist","aria-orientation":n,onKeyDown:XR(t.onKeyDown,a)}}function c0e(t){const{isDisabled:e=!1,isFocusable:n=!1,...r}=t,{setSelectedIndex:i,isManual:a,id:s,setFocusedIndex:o,selectedIndex:l}=FT(),{index:u,register:c}=s0e({disabled:e&&!n}),d=u===l,f=()=>{i(u)},m=()=>{o(u),!a&&!(e&&n)&&i(u)};return{...t0e({...r,ref:ZA(c,t.ref),isDisabled:e,isFocusable:n,onClick:XR(t.onClick,f)}),id:tY(s,u),role:"tab",tabIndex:d?0:-1,type:"button","aria-selected":d,"aria-controls":nY(s,u),onFocus:e?void 0:XR(t.onFocus,m)}}const[d0e,f0e]=Mo({});function p0e(t){const e=FT(),{id:n,selectedIndex:r}=e,a=yV(t.children).map((s,o)=>w.createElement(d0e,{key:s.key??o,value:{isSelected:o===r,id:nY(n,o),tabId:tY(n,o),selectedIndex:r}},s));return{...t,children:a}}function h0e(t){const{children:e,...n}=t,{isLazy:r,lazyBehavior:i}=FT(),{isSelected:a,id:s,tabId:o}=f0e(),l=w.useRef(!1);a&&(l.current=!0);const u=_ee({wasSelected:l.current,isSelected:a,enabled:r,mode:i});return{tabIndex:0,...n,children:u?e:null,role:"tabpanel","aria-labelledby":o,hidden:!a,id:s}}function tY(t,e){return`${t}--tab-${e}`}function nY(t,e){return`${t}--tabpanel-${e}`}const[m0e,UT]=Mo({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),rY=Xi(function(e,n){const r=UW("Tabs",e),{children:i,className:a,...s}=um(e),{htmlProps:o,descendants:l,...u}=o0e(s),c=w.useMemo(()=>u,[u]),{isFitted:d,...f}=o,m={position:"relative",...r.root};return $.jsx(r0e,{value:l,children:$.jsx(l0e,{value:c,children:$.jsx(m0e,{value:r,children:$.jsx(Cr.div,{className:ba("chakra-tabs",a),ref:n,...f,__css:m,children:i})})})})});rY.displayName="Tabs";const zS=Xi(function(e,n){const r=UT(),i=c0e({...e,ref:n}),a={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return $.jsx(Cr.button,{...i,className:ba("chakra-tabs__tab",e.className),__css:a})});zS.displayName="Tab";const iY=Xi(function(e,n){const r=u0e({...e,ref:n}),i=UT(),a={display:"flex",...i.tablist};return $.jsx(Cr.div,{...r,className:ba("chakra-tabs__tablist",e.className),__css:a})});iY.displayName="TabList";const HS=Xi(function(e,n){const r=h0e({...e,ref:n}),i=UT();return $.jsx(Cr.div,{outline:"0",...r,className:ba("chakra-tabs__tab-panel",e.className),__css:i.tabpanel})});HS.displayName="TabPanel";const aY=Xi(function(e,n){const r=p0e(e),i=UT();return $.jsx(Cr.div,{...r,width:"100%",ref:n,className:ba("chakra-tabs__tab-panels",e.className),__css:i.tabpanels})});aY.displayName="TabPanels";function g0e(t,e){const n=t??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[n];return(i==null?void 0:i[e])??n}function b0e(t,e){const n=i=>({...e,...i,position:g0e((i==null?void 0:i.position)??(e==null?void 0:e.position),t)}),r=i=>{const a=n(i),s=jW(a);return tl.notify(s,a)};return r.update=(i,a)=>{tl.update(i,n(a))},r.promise=(i,a)=>{const s=r({...a.loading,status:"loading",duration:null});i.then(o=>r.update(s,{status:"success",duration:5e3,...Zs(a.success,o)})).catch(o=>r.update(s,{status:"error",duration:5e3,...Zs(a.error,o)}))},r.closeAll=tl.closeAll,r.close=tl.close,r.isActive=tl.isActive,r}function y0e(t){const{theme:e}=BW(),n=Oge();return w.useMemo(()=>b0e(e.direction,{...n,...t}),[t,e.direction,n])}const sY=Xi(function(e,n){const r=$b("Text",e),{className:i,align:a,decoration:s,casing:o,...l}=um(e),u=HN({textAlign:e.align,textDecoration:e.decoration,textTransform:e.casing});return $.jsx(Cr.p,{ref:n,className:ba("chakra-text",e.className),...u,...l,__css:r})});sY.displayName="Text";var oY,K6=Mf;oY=K6.createRoot,K6.hydrateRoot;/** +`+a.stack}return{value:t,source:e,stack:i,digest:null}}function sC(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function nM(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var ege=typeof WeakMap=="function"?WeakMap:Map;function E7(t,e,n){n=ou(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){OS||(OS=!0,fM=r),nM(t,e)},n}function _7(t,e,n){n=ou(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){nM(t,e)}}var a=t.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){nM(t,e),typeof r!="function"&&(hc===null?hc=new Set([this]):hc.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),n}function C6(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new ege;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=hge.bind(null,t,e,n),e.then(t,t))}function R6(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function I6(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=ou(-1,1),e.tag=2,pc(n,e,1))),n.lanes|=1),t)}var tge=Eu.ReactCurrentOwner,Qa=!1;function Ca(t,e,n,r){e.child=t===null?Kj(e,null,n,r):Vh(e,t.child,n,r)}function M6(t,e,n,r,i){n=n.render;var a=e.ref;return Ah(e,i),r=bO(t,e,n,r,a,i),n=yO(),t!==null&&!Qa?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,gu(t,e,i)):(Nr&&n&&aO(e),e.flags|=1,Ca(t,e,r,i),e.child)}function N6(t,e,n,r,i){if(t===null){var a=n.type;return typeof a=="function"&&!RO(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=a,S7(t,e,a,r,i)):(t=U_(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!(t.lanes&i)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:ob,n(s,r)&&t.ref===e.ref)return gu(t,e,i)}return e.flags|=1,t=gc(a,r),t.ref=e.ref,t.return=e,e.child=t}function S7(t,e,n,r,i){if(t!==null){var a=t.memoizedProps;if(ob(a,r)&&t.ref===e.ref)if(Qa=!1,e.pendingProps=r=a,(t.lanes&i)!==0)t.flags&131072&&(Qa=!0);else return e.lanes=t.lanes,gu(t,e,i)}return rM(t,e,n,r,i)}function A7(t,e,n){var r=e.pendingProps,i=r.children,a=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},_r(oh,hs),hs|=n;else{if(!(n&1073741824))return t=a!==null?a.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,_r(oh,hs),hs|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,_r(oh,hs),hs|=r}else a!==null?(r=a.baseLanes|n,e.memoizedState=null):r=n,_r(oh,hs),hs|=r;return Ca(t,e,i,n),e.child}function x7(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function rM(t,e,n,r,i){var a=ns(n)?lf:ga.current;return a=Hh(e,a),Ah(e,i),n=bO(t,e,n,r,a,i),r=yO(),t!==null&&!Qa?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,gu(t,e,i)):(Nr&&r&&aO(e),e.flags|=1,Ca(t,e,n,i),e.child)}function O6(t,e,n,r,i){if(ns(n)){var a=!0;SS(e)}else a=!1;if(Ah(e,i),e.stateNode===null)P_(t,e),v7(e,n,r),tM(e,n,r,i),r=!0;else if(t===null){var s=e.stateNode,o=e.memoizedProps;s.props=o;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=no(u):(u=ns(n)?lf:ga.current,u=Hh(e,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==r||l!==u)&&w6(e,s,r,u),Zu=!1;var f=e.memoizedState;s.state=f,CS(e,r,s,i),l=e.memoizedState,o!==r||f!==l||ts.current||Zu?(typeof c=="function"&&(eM(e,n,c,r),l=e.memoizedState),(o=Zu||T6(e,n,o,r,f,l,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),s.props=r,s.state=l,s.context=u,r=o):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,Qj(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:mo(e.type,o),s.props=u,d=e.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=no(l):(l=ns(n)?lf:ga.current,l=Hh(e,l));var m=n.getDerivedStateFromProps;(c=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==d||f!==l)&&w6(e,s,r,l),Zu=!1,f=e.memoizedState,s.state=f,CS(e,r,s,i);var g=e.memoizedState;o!==d||f!==g||ts.current||Zu?(typeof m=="function"&&(eM(e,n,m,r),g=e.memoizedState),(u=Zu||T6(e,n,u,r,f,g,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),s.props=r,s.state=g,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return iM(t,e,n,r,a,i)}function iM(t,e,n,r,i,a){x7(t,e);var s=(e.flags&128)!==0;if(!r&&!s)return i&&b6(e,n,!1),gu(t,e,a);r=e.stateNode,tge.current=e;var o=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&s?(e.child=Vh(e,t.child,null,a),e.child=Vh(e,null,o,a)):Ca(t,e,o,a),e.memoizedState=r.state,i&&b6(e,n,!0),e.child}function T7(t){var e=t.stateNode;e.pendingContext?g6(t,e.pendingContext,e.pendingContext!==e.context):e.context&&g6(t,e.context,!1),pO(t,e.containerInfo)}function D6(t,e,n,r,i){return Gh(),oO(i),e.flags|=256,Ca(t,e,n,r),e.child}var aM={dehydrated:null,treeContext:null,retryLane:0};function sM(t){return{baseLanes:t,cachePool:null,transitions:null}}function w7(t,e,n){var r=e.pendingProps,i=Br.current,a=!1,s=(e.flags&128)!==0,o;if((o=s)||(o=t!==null&&t.memoizedState===null?!1:(i&2)!==0),o?(a=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),_r(Br,i&1),t===null)return QI(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=r.children,t=r.fallback,a?(r=e.mode,a=e.child,s={mode:"hidden",children:s},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=s):a=Ox(s,r,0,null),t=Kd(t,r,n,null),a.return=e,t.return=e,a.sibling=t,e.child=a,e.child.memoizedState=sM(n),e.memoizedState=aM,t):_O(e,s));if(i=t.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return nge(t,e,s,r,o,i,n);if(a){a=r.fallback,s=e.mode,i=t.child,o=i.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=gc(i,l),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?a=gc(o,a):(a=Kd(a,s,n,null),a.flags|=2),a.return=e,r.return=e,r.sibling=a,e.child=r,r=a,a=e.child,s=t.child.memoizedState,s=s===null?sM(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=t.childLanes&~n,e.memoizedState=aM,r}return a=t.child,t=a.sibling,r=gc(a,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function _O(t,e){return e=Ox({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Xv(t,e,n,r){return r!==null&&oO(r),Vh(e,t.child,null,n),t=_O(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function nge(t,e,n,r,i,a,s){if(n)return e.flags&256?(e.flags&=-257,r=sC(Error(ut(422))),Xv(t,e,s,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(a=r.fallback,i=e.mode,r=Ox({mode:"visible",children:r.children},i,0,null),a=Kd(a,i,s,null),a.flags|=2,r.return=e,a.return=e,r.sibling=a,e.child=r,e.mode&1&&Vh(e,t.child,null,s),e.child.memoizedState=sM(s),e.memoizedState=aM,a);if(!(e.mode&1))return Xv(t,e,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,a=Error(ut(419)),r=sC(a,r,void 0),Xv(t,e,s,r)}if(o=(s&t.childLanes)!==0,Qa||o){if(r=Oi,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,mu(t,i),Ao(r,t,i,-1))}return CO(),r=sC(Error(ut(421))),Xv(t,e,s,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=mge.bind(null,t),i._reactRetry=e,null):(t=a.treeContext,bs=fc(i.nextSibling),Es=e,Nr=!0,vo=null,t!==null&&(js[Ys++]=Ql,js[Ys++]=Jl,js[Ys++]=uf,Ql=t.id,Jl=t.overflow,uf=e),e=_O(e,r.children),e.flags|=4096,e)}function L6(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),JI(t.return,e,n)}function oC(t,e,n,r,i){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function C7(t,e,n){var r=e.pendingProps,i=r.revealOrder,a=r.tail;if(Ca(t,e,r.children,n),r=Br.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&L6(t,n,e);else if(t.tag===19)L6(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(_r(Br,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&RS(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),oC(e,!1,i,n,a);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&RS(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}oC(e,!0,n,null,a);break;case"together":oC(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function P_(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function gu(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),df|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(ut(153));if(e.child!==null){for(t=e.child,n=gc(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=gc(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function rge(t,e,n){switch(e.tag){case 3:T7(e),Gh();break;case 5:Jj(e);break;case 1:ns(e.type)&&SS(e);break;case 4:pO(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;_r(TS,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(_r(Br,Br.current&1),e.flags|=128,null):n&e.child.childLanes?w7(t,e,n):(_r(Br,Br.current&1),t=gu(t,e,n),t!==null?t.sibling:null);_r(Br,Br.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return C7(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),_r(Br,Br.current),r)break;return null;case 22:case 23:return e.lanes=0,A7(t,e,n)}return gu(t,e,n)}var R7,oM,I7,M7;R7=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};oM=function(){};I7=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Ld(cl.current);var a=null;switch(n){case"input":i=II(t,i),r=II(t,r),a=[];break;case"select":i=Gr({},i,{value:void 0}),r=Gr({},r,{value:void 0}),a=[];break;case"textarea":i=OI(t,i),r=OI(t,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=ES)}LI(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(s in o)o.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(eb.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var l=r[u];if(o=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(s in o)!o.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&o[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(a||(a=[]),a.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(a=a||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(a=a||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(eb.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ar("scroll",t),a||o===l||(a=[])):(a=a||[]).push(u,l))}n&&(a=a||[]).push("style",n);var u=a;(e.updateQueue=u)&&(e.flags|=4)}};M7=function(t,e,n,r){n!==r&&(e.flags|=4)};function mg(t,e){if(!Nr)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function aa(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function ige(t,e,n){var r=e.pendingProps;switch(sO(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return aa(e),null;case 1:return ns(e.type)&&_S(),aa(e),null;case 3:return r=e.stateNode,$h(),wr(ts),wr(ga),mO(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Yv(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,vo!==null&&(mM(vo),vo=null))),oM(t,e),aa(e),null;case 5:hO(e);var i=Ld(fb.current);if(n=e.type,t!==null&&e.stateNode!=null)I7(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(ut(166));return aa(e),null}if(t=Ld(cl.current),Yv(e)){r=e.stateNode,n=e.type;var a=e.memoizedProps;switch(r[nl]=e,r[cb]=a,t=(e.mode&1)!==0,n){case"dialog":Ar("cancel",r),Ar("close",r);break;case"iframe":case"object":case"embed":Ar("load",r);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[nl]=e,t[cb]=r,R7(t,e,!1,!1),e.stateNode=t;e:{switch(s=kI(n,r),n){case"dialog":Ar("cancel",t),Ar("close",t),i=r;break;case"iframe":case"object":case"embed":Ar("load",t),i=r;break;case"video":case"audio":for(i=0;ijh&&(e.flags|=128,r=!0,mg(a,!1),e.lanes=4194304)}else{if(!r)if(t=RS(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),mg(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Nr)return aa(e),null}else 2*ei()-a.renderingStartTime>jh&&n!==1073741824&&(e.flags|=128,r=!0,mg(a,!1),e.lanes=4194304);a.isBackwards?(s.sibling=e.child,e.child=s):(n=a.last,n!==null?n.sibling=s:e.child=s,a.last=s)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ei(),e.sibling=null,n=Br.current,_r(Br,r?n&1|2:n&1),e):(aa(e),null);case 22:case 23:return wO(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?hs&1073741824&&(aa(e),e.subtreeFlags&6&&(e.flags|=8192)):aa(e),null;case 24:return null;case 25:return null}throw Error(ut(156,e.tag))}function age(t,e){switch(sO(e),e.tag){case 1:return ns(e.type)&&_S(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return $h(),wr(ts),wr(ga),mO(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return hO(e),null;case 13:if(wr(Br),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ut(340));Gh()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return wr(Br),null;case 4:return $h(),null;case 10:return cO(e.type._context),null;case 22:case 23:return wO(),null;case 24:return null;default:return null}}var Kv=!1,da=!1,sge=typeof WeakSet=="function"?WeakSet:Set,$t=null;function sh(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){jr(t,e,r)}else n.current=null}function lM(t,e,n){try{n()}catch(r){jr(t,e,r)}}var k6=!1;function oge(t,e){if(WI=bS,t=kj(),iO(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,o=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(o=s+i),d!==a||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===t)break t;if(f===n&&++u===i&&(o=s),f===a&&++c===r&&(l=s),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(jI={focusedElem:t,selectionRange:n},bS=!1,$t=e;$t!==null;)if(e=$t,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,$t=t;else for(;$t!==null;){e=$t;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,v=g.memoizedState,b=e.stateNode,E=b.getSnapshotBeforeUpdate(e.elementType===e.type?y:mo(e.type,y),v);b.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ut(163))}}catch(A){jr(e,e.return,A)}if(t=e.sibling,t!==null){t.return=e.return,$t=t;break}$t=e.return}return g=k6,k6=!1,g}function _0(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var a=i.destroy;i.destroy=void 0,a!==void 0&&lM(e,n,a)}i=i.next}while(i!==r)}}function Mx(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function uM(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function N7(t){var e=t.alternate;e!==null&&(t.alternate=null,N7(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[nl],delete e[cb],delete e[XI],delete e[Vme],delete e[$me])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function O7(t){return t.tag===5||t.tag===3||t.tag===4}function P6(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||O7(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function cM(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ES));else if(r!==4&&(t=t.child,t!==null))for(cM(t,e,n),t=t.sibling;t!==null;)cM(t,e,n),t=t.sibling}function dM(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(dM(t,e,n),t=t.sibling;t!==null;)dM(t,e,n),t=t.sibling}var Ui=null,bo=!1;function Du(t,e,n){for(n=n.child;n!==null;)D7(t,e,n),n=n.sibling}function D7(t,e,n){if(ul&&typeof ul.onCommitFiberUnmount=="function")try{ul.onCommitFiberUnmount(Sx,n)}catch{}switch(n.tag){case 5:da||sh(n,e);case 6:var r=Ui,i=bo;Ui=null,Du(t,e,n),Ui=r,bo=i,Ui!==null&&(bo?(t=Ui,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ui.removeChild(n.stateNode));break;case 18:Ui!==null&&(bo?(t=Ui,n=n.stateNode,t.nodeType===8?eC(t.parentNode,n):t.nodeType===1&&eC(t,n),ab(t)):eC(Ui,n.stateNode));break;case 4:r=Ui,i=bo,Ui=n.stateNode.containerInfo,bo=!0,Du(t,e,n),Ui=r,bo=i;break;case 0:case 11:case 14:case 15:if(!da&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&lM(n,e,s),i=i.next}while(i!==r)}Du(t,e,n);break;case 1:if(!da&&(sh(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){jr(n,e,o)}Du(t,e,n);break;case 21:Du(t,e,n);break;case 22:n.mode&1?(da=(r=da)||n.memoizedState!==null,Du(t,e,n),da=r):Du(t,e,n);break;default:Du(t,e,n)}}function B6(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new sge),e.forEach(function(r){var i=gge.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function uo(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~a}if(r=i,r=ei()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*uge(r/1960))-r,10t?16:t,ic===null)var r=!1;else{if(t=ic,ic=null,DS=0,qn&6)throw Error(ut(331));var i=qn;for(qn|=4,$t=t.current;$t!==null;){var a=$t,s=a.child;if($t.flags&16){var o=a.deletions;if(o!==null){for(var l=0;lei()-xO?Xd(t,0):AO|=n),rs(t,e)}function H7(t,e){e===0&&(t.mode&1?(e=Hv,Hv<<=1,!(Hv&130023424)&&(Hv=4194304)):e=1);var n=La();t=mu(t,e),t!==null&&(jb(t,e,n),rs(t,n))}function mge(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),H7(t,n)}function gge(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(ut(314))}r!==null&&r.delete(e),H7(t,n)}var G7;G7=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ts.current)Qa=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Qa=!1,rge(t,e,n);Qa=!!(t.flags&131072)}else Qa=!1,Nr&&e.flags&1048576&&jj(e,xS,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;P_(t,e),t=e.pendingProps;var i=Hh(e,ga.current);Ah(e,n),i=bO(null,e,r,t,i,n);var a=yO();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,ns(r)?(a=!0,SS(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,fO(e),i.updater=Ix,e.stateNode=i,i._reactInternals=e,tM(e,r,t,n),e=iM(null,e,r,!0,a,n)):(e.tag=0,Nr&&a&&aO(e),Ca(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(P_(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=yge(r),t=mo(r,t),i){case 0:e=rM(null,e,r,t,n);break e;case 1:e=O6(null,e,r,t,n);break e;case 11:e=M6(null,e,r,t,n);break e;case 14:e=N6(null,e,r,mo(r.type,t),n);break e}throw Error(ut(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:mo(r,i),rM(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:mo(r,i),O6(t,e,r,i,n);case 3:e:{if(T7(e),t===null)throw Error(ut(387));r=e.pendingProps,a=e.memoizedState,i=a.element,Qj(t,e),CS(e,r,null,n);var s=e.memoizedState;if(r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){i=Wh(Error(ut(423)),e),e=D6(t,e,r,n,i);break e}else if(r!==i){i=Wh(Error(ut(424)),e),e=D6(t,e,r,n,i);break e}else for(bs=fc(e.stateNode.containerInfo.firstChild),Es=e,Nr=!0,vo=null,n=Kj(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Gh(),r===i){e=gu(t,e,n);break e}Ca(t,e,r,n)}e=e.child}return e;case 5:return Jj(e),t===null&&QI(e),r=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,s=i.children,YI(r,i)?s=null:a!==null&&YI(r,a)&&(e.flags|=32),x7(t,e),Ca(t,e,s,n),e.child;case 6:return t===null&&QI(e),null;case 13:return w7(t,e,n);case 4:return pO(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Vh(e,null,r,n):Ca(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:mo(r,i),M6(t,e,r,i,n);case 7:return Ca(t,e,e.pendingProps,n),e.child;case 8:return Ca(t,e,e.pendingProps.children,n),e.child;case 12:return Ca(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,a=e.memoizedProps,s=i.value,_r(TS,r._currentValue),r._currentValue=s,a!==null)if(wo(a.value,s)){if(a.children===i.children&&!ts.current){e=gu(t,e,n);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){s=a.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(a.tag===1){l=ou(-1,n&-n),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),JI(a.return,n,e),o.lanes|=n;break}l=l.next}}else if(a.tag===10)s=a.type===e.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(ut(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),JI(s,n,e),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}Ca(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Ah(e,n),i=no(i),r=r(i),e.flags|=1,Ca(t,e,r,n),e.child;case 14:return r=e.type,i=mo(r,e.pendingProps),i=mo(r.type,i),N6(t,e,r,i,n);case 15:return S7(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:mo(r,i),P_(t,e),e.tag=1,ns(r)?(t=!0,SS(e)):t=!1,Ah(e,n),v7(e,r,i),tM(e,r,i,n),iM(null,e,r,!0,t,n);case 19:return C7(t,e,n);case 22:return A7(t,e,n)}throw Error(ut(156,e.tag))};function V7(t,e){return gj(t,e)}function bge(t,e,n,r){this.tag=t,this.key=n,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 Qs(t,e,n,r){return new bge(t,e,n,r)}function RO(t){return t=t.prototype,!(!t||!t.isReactComponent)}function yge(t){if(typeof t=="function")return RO(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Y2)return 11;if(t===q2)return 14}return 2}function gc(t,e){var n=t.alternate;return n===null?(n=Qs(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function U_(t,e,n,r,i,a){var s=2;if(r=t,typeof t=="function")RO(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Zp:return Kd(n.children,i,a,e);case j2:s=8,i|=8;break;case TI:return t=Qs(12,n,e,i|2),t.elementType=TI,t.lanes=a,t;case wI:return t=Qs(13,n,e,i),t.elementType=wI,t.lanes=a,t;case CI:return t=Qs(19,n,e,i),t.elementType=CI,t.lanes=a,t;case JW:return Ox(n,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ZW:s=10;break e;case QW:s=9;break e;case Y2:s=11;break e;case q2:s=14;break e;case Ku:s=16,r=null;break e}throw Error(ut(130,t==null?t:typeof t,""))}return e=Qs(s,n,e,i),e.elementType=t,e.type=r,e.lanes=a,e}function Kd(t,e,n,r){return t=Qs(7,t,r,e),t.lanes=n,t}function Ox(t,e,n,r){return t=Qs(22,t,r,e),t.elementType=JW,t.lanes=n,t.stateNode={isHidden:!1},t}function lC(t,e,n){return t=Qs(6,t,null,e),t.lanes=n,t}function uC(t,e,n){return e=Qs(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function vge(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vw(0),this.expirationTimes=Vw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vw(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function IO(t,e,n,r,i,a,s,o,l){return t=new vge(t,e,n,o,l),e===1?(e=1,a===!0&&(e|=8)):e=0,a=Qs(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},fO(a),t}function Ege(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Y7)}catch(t){console.error(t)}}Y7(),YW.exports=ws;var Mf=YW.exports;const DO=Sl(Mf),Tge=aV({__proto__:null,default:DO},[Mf]),[q7,wge]=Mo({strict:!1,name:"PortalContext"}),LO="chakra-portal",Cge=".chakra-portal",Rge=t=>$.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:t.zIndex,top:0,left:0,right:0},children:t.children}),Ige=t=>{const{appendToParentPortal:e,children:n}=t,[r,i]=w.useState(null),a=w.useRef(null),[,s]=w.useState({});w.useEffect(()=>s({}),[]);const o=wge(),l=oue();eS(()=>{if(!r)return;const c=r.ownerDocument,d=e?o??c.body:c.body;if(!d)return;a.current=c.createElement("div"),a.current.className=LO,d.appendChild(a.current),s({});const f=a.current;return()=>{d.contains(f)&&d.removeChild(f)}},[r]);const u=l!=null&&l.zIndex?$.jsx(Rge,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return a.current?Mf.createPortal($.jsx(q7,{value:a.current,children:u}),a.current):$.jsx("span",{ref:c=>{c&&i(c)}})},Mge=t=>{const{children:e,containerRef:n,appendToParentPortal:r}=t,i=n.current,a=i??(typeof window<"u"?document.body:void 0),s=w.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=LO),l},[i]),[,o]=w.useState({});return eS(()=>o({}),[]),eS(()=>{if(!(!s||!a))return a.appendChild(s),()=>{a.removeChild(s)}},[s,a]),a&&s?Mf.createPortal($.jsx(q7,{value:r?s:null,children:e}),s):null};function Bx(t){const e={appendToParentPortal:!0,...t},{containerRef:n,...r}=e;return n?$.jsx(Mge,{containerRef:n,...r}):$.jsx(Ige,{...r})}Bx.className=LO;Bx.selector=Cge;Bx.displayName="Portal";const[Nge,Oge]=Mo({name:"ToastOptionsContext",strict:!1}),Dge=t=>{const e=w.useSyncExternalStore(tl.subscribe,tl.getState,tl.getState),{motionVariants:n,component:r=PW,portalProps:i,animatePresenceProps:a}=t,o=Object.keys(e).map(l=>{const u=e[l];return $.jsx("div",{role:"region","aria-live":"polite","aria-label":`Notifications-${l}`,id:`chakra-toast-manager-${l}`,style:Hpe(l),children:$.jsx(Fpe,{...a,initial:!1,children:u.map(c=>$.jsx(r,{motionVariants:n,...c},c.id))})},l)});return $.jsx(Bx,{...i,children:o})},Lge=t=>function({children:n,theme:r=t,toastOptions:i,...a}){return $.jsxs(uue,{theme:r,...a,children:[$.jsx(Nge,{value:i==null?void 0:i.defaultOptions,children:n}),$.jsx(Dge,{...i})]})},kge=Lge(Xoe);function W6(t){return t.sort((e,n)=>{const r=e.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}const Pge=t=>typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE;function j6(t,e,n){let r=t+1;return n&&r>=e&&(r=0),r}function Y6(t,e,n){let r=t-1;return n&&r<0&&(r=e),r}const cC=typeof window<"u"?w.useLayoutEffect:w.useEffect,q6=t=>t;var Bge=Object.defineProperty,Fge=(t,e,n)=>e in t?Bge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$r=(t,e,n)=>(Fge(t,typeof e!="symbol"?e+"":e,n),n);class Uge{constructor(){$r(this,"descendants",new Map),$r(this,"register",e=>{if(e!=null)return Pge(e)?this.registerNode(e):n=>{this.registerNode(n,e)}}),$r(this,"unregister",e=>{this.descendants.delete(e);const n=W6(Array.from(this.descendants.keys()));this.assignIndex(n)}),$r(this,"destroy",()=>{this.descendants.clear()}),$r(this,"assignIndex",e=>{this.descendants.forEach(n=>{const r=e.indexOf(n.node);n.index=r,n.node.dataset.index=n.index.toString()})}),$r(this,"count",()=>this.descendants.size),$r(this,"enabledCount",()=>this.enabledValues().length),$r(this,"values",()=>Array.from(this.descendants.values()).sort((n,r)=>n.index-r.index)),$r(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),$r(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),$r(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),$r(this,"first",()=>this.item(0)),$r(this,"firstEnabled",()=>this.enabledItem(0)),$r(this,"last",()=>this.item(this.descendants.size-1)),$r(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),$r(this,"indexOf",e=>{var n;return e?((n=this.descendants.get(e))==null?void 0:n.index)??-1:-1}),$r(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(n=>n.node.isSameNode(e))),$r(this,"next",(e,n=!0)=>{const r=j6(e,this.count(),n);return this.item(r)}),$r(this,"nextEnabled",(e,n=!0)=>{const r=this.item(e);if(!r)return;const i=this.enabledIndexOf(r.node),a=j6(i,this.enabledCount(),n);return this.enabledItem(a)}),$r(this,"prev",(e,n=!0)=>{const r=Y6(e,this.count()-1,n);return this.item(r)}),$r(this,"prevEnabled",(e,n=!0)=>{const r=this.item(e);if(!r)return;const i=this.enabledIndexOf(r.node),a=Y6(i,this.enabledCount()-1,n);return this.enabledItem(a)}),$r(this,"registerNode",(e,n)=>{if(!e||this.descendants.has(e))return;const r=Array.from(this.descendants.keys()).concat(e),i=W6(r);n!=null&&n.disabled&&(n.disabled=!!n.disabled);const a={node:e,index:-1,...n};this.descendants.set(e,a),this.assignIndex(i)})}}function zge(){const[t,e]=Mo({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});return[t,e,()=>{const i=w.useRef(new Uge);return cC(()=>()=>i.current.destroy()),i.current},i=>{const a=e(),[s,o]=w.useState(-1),l=w.useRef(null);cC(()=>()=>{l.current&&a.unregister(l.current)},[]),cC(()=>{if(!l.current)return;const c=Number(l.current.dataset.index);s!=c&&!Number.isNaN(c)&&o(c)});const u=q6(i?a.register(i):a.register);return{descendants:a,index:s,enabledIndex:a.enabledIndexOf(l.current),register:ZA(u,l)}}]}const gM=Cr("div");gM.displayName="Box";const[Nze,Hge]=Mo({strict:!1,name:"ButtonGroupContext"});function Jg(t){const{children:e,className:n,...r}=t,i=w.isValidElement(e)?w.cloneElement(e,{"aria-hidden":!0,focusable:!1}):e,a=ba("chakra-button__icon",n);return $.jsx(Cr.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:a,children:i})}Jg.displayName="ButtonIcon";function bM(t){const{label:e,placement:n,spacing:r="0.5rem",children:i=$.jsx(z2,{color:"currentColor",width:"1em",height:"1em"}),className:a,__css:s,...o}=t,l=ba("chakra-button__spinner",a),u=n==="start"?"marginEnd":"marginStart",c=w.useMemo(()=>({display:"flex",alignItems:"center",position:e?"relative":"absolute",[u]:e?r:0,fontSize:"1em",lineHeight:"normal",...s}),[s,e,u,r]);return $.jsx(Cr.div,{className:l,...o,__css:c,children:i})}bM.displayName="ButtonSpinner";function Gge(t){const[e,n]=w.useState(!t);return{ref:w.useCallback(a=>{a&&n(a.tagName==="BUTTON")},[]),type:e?"button":void 0}}const bb=Xi((t,e)=>{const n=Hge(),r=$b("Button",{...n,...t}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:a,isActive:s,children:o,leftIcon:l,rightIcon:u,loadingText:c,iconSpacing:d="0.5rem",type:f,spinner:m,spinnerPlacement:g="start",className:y,as:v,shouldWrapChildren:b,...E}=um(t),_=w.useMemo(()=>{const R={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:R}}},[r,n]),{ref:A,type:I}=Gge(v),x={rightIcon:u,leftIcon:l,iconSpacing:d,children:o,shouldWrapChildren:b};return $.jsxs(Cr.button,{disabled:i||a,ref:Nee(e,A),as:v,type:f??I,"data-active":YR(s),"data-loading":YR(a),__css:_,className:ba("chakra-button",y),...E,children:[a&&g==="start"&&$.jsx(bM,{className:"chakra-button__spinner--start",label:c,placement:"start",spacing:d,children:m}),a?c||$.jsx(Cr.span,{opacity:0,children:$.jsx(X6,{...x})}):$.jsx(X6,{...x}),a&&g==="end"&&$.jsx(bM,{className:"chakra-button__spinner--end",label:c,placement:"end",spacing:d,children:m})]})});bb.displayName="Button";function X6(t){const{leftIcon:e,rightIcon:n,children:r,iconSpacing:i,shouldWrapChildren:a}=t;return a?$.jsxs("span",{style:{display:"contents"},children:[e&&$.jsx(Jg,{marginEnd:i,children:e}),r,n&&$.jsx(Jg,{marginStart:i,children:n})]}):$.jsxs($.Fragment,{children:[e&&$.jsx(Jg,{marginEnd:i,children:e}),r,n&&$.jsx(Jg,{marginStart:i,children:n})]})}const yM=Xi((t,e)=>{const{icon:n,children:r,isRound:i,"aria-label":a,...s}=t,o=n||r,l=w.isValidElement(o)?w.cloneElement(o,{"aria-hidden":!0,focusable:!1}):null;return $.jsx(bb,{px:"0",py:"0",borderRadius:i?"full":void 0,ref:e,"aria-label":a,...s,children:l})});yM.displayName="IconButton";const X7=Xi(function(e,n){const{direction:r,align:i,justify:a,wrap:s,basis:o,grow:l,shrink:u,...c}=e,d={display:"flex",flexDirection:r,alignItems:i,justifyContent:a,flexWrap:s,flexBasis:o,flexGrow:l,flexShrink:u};return $.jsx(Cr.div,{ref:n,__css:d,...c})});X7.displayName="Flex";function K7(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}var Z7={exports:{}},Vge="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",$ge=Vge,Wge=$ge;function Q7(){}function J7(){}J7.resetWarningCache=Q7;var jge=function(){function t(r,i,a,s,o,l){if(l!==Wge){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:J7,resetWarningCache:Q7};return n.PropTypes=n,n};Z7.exports=jge();var Yge=Z7.exports;const yr=Sl(Yge);function hm(t,e,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function o(c){try{u(r.next(c))}catch(d){s(d)}}function l(c){try{u(r.throw(c))}catch(d){s(d)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((r=r.apply(t,e||[])).next())})}function mm(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]0)&&!(i=r.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return a}function Xge(){for(var t=[],e=0;eu!=null);const[o,l]=w.useState(()=>a.map((u,c)=>({media:u,matches:n?!!s[c]:i().matchMedia(u).matches})));return w.useEffect(()=>{const u=i();l(a.map(f=>({media:f,matches:u.matchMedia(f).matches})));const c=a.map(f=>u.matchMedia(f)),d=f=>{l(m=>m.slice().map(g=>g.media===f.media?{...g,matches:f.matches}:g))};return c.forEach(f=>{typeof f.addListener=="function"?f.addListener(d):f.addEventListener("change",d)}),()=>{c.forEach(f=>{typeof f.removeListener=="function"?f.removeListener(d):f.removeEventListener("change",d)})}},[i]),o.map(u=>u.matches)}function Zge(t){var o;const e=es(t)?t:{fallback:t??"base"},r=U2().__breakpoints.details.map(({minMaxQuery:l,breakpoint:u})=>({breakpoint:u,query:l.replace("@media screen and ","")})),i=r.map(l=>l.breakpoint===e.fallback),s=Kge(r.map(l=>l.query),{fallback:i,ssr:e.ssr}).findIndex(l=>l==!0);return((o=r[s])==null?void 0:o.breakpoint)??e.fallback}function Qge(t,e,n=_V){let r=Object.keys(t).indexOf(e);if(r!==-1)return t[e];let i=n.indexOf(e);for(;i>=0;){const a=n[i];if(t.hasOwnProperty(a)){r=i;break}i-=1}if(r!==-1){const a=n[r];return t[a]}}function Jge(t,e){var o;const n=es(e)?e:{fallback:"base"},r=Zge(n),i=U2();if(!r)return;const a=Array.from(((o=i.__breakpoints)==null?void 0:o.keys)||[]),s=Array.isArray(t)?Object.fromEntries(Object.entries(Tee(t,a)).map(([l,u])=>[l,u])):t;return Qge(s,r,a)}function e0e(){const t=w.useRef(new Map),e=t.current,n=w.useCallback((i,a,s,o)=>{t.current.set(s,{type:a,el:i,options:o}),i.addEventListener(a,s,o)},[]),r=w.useCallback((i,a,s,o)=>{i.removeEventListener(a,s,o),t.current.delete(s)},[]);return w.useEffect(()=>()=>{e.forEach((i,a)=>{r(i.el,i.type,a,i.options)})},[r,e]),{add:n,remove:r}}function dC(t){var i,a;const e=((a=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:a[0])??t.target,{tagName:n,isContentEditable:r}=e;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function t0e(t={}){const{ref:e,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:a=!0,onMouseDown:s,onMouseUp:o,onClick:l,onKeyDown:u,onKeyUp:c,tabIndex:d,onMouseOver:f,onMouseLeave:m,...g}=t,[y,v]=w.useState(!0),[b,E]=w.useState(!1),_=e0e(),A=ee=>{ee&&ee.tagName!=="BUTTON"&&v(!1)},I=y?d:d||0,x=n&&!r,R=w.useCallback(ee=>{if(n){ee.stopPropagation(),ee.preventDefault();return}ee.currentTarget.focus(),l==null||l(ee)},[n,l]),O=w.useCallback(ee=>{b&&dC(ee)&&(ee.preventDefault(),ee.stopPropagation(),E(!1),_.remove(document,"keyup",O,!1))},[b,_]),N=w.useCallback(ee=>{if(u==null||u(ee),n||ee.defaultPrevented||ee.metaKey||!dC(ee.nativeEvent)||y)return;const F=i&&ee.key==="Enter";a&&ee.key===" "&&(ee.preventDefault(),E(!0)),F&&(ee.preventDefault(),ee.currentTarget.click()),_.add(document,"keyup",O,!1)},[n,y,u,i,a,_,O]),M=w.useCallback(ee=>{if(c==null||c(ee),n||ee.defaultPrevented||ee.metaKey||!dC(ee.nativeEvent)||y)return;a&&ee.key===" "&&(ee.preventDefault(),E(!1),ee.currentTarget.click())},[a,y,n,c]),B=w.useCallback(ee=>{ee.button===0&&(E(!1),_.remove(document,"mouseup",B,!1))},[_]),G=w.useCallback(ee=>{if(ee.button!==0)return;if(n){ee.stopPropagation(),ee.preventDefault();return}y||E(!0),ee.currentTarget.focus({preventScroll:!0}),_.add(document,"mouseup",B,!1),s==null||s(ee)},[n,y,s,_,B]),W=w.useCallback(ee=>{ee.button===0&&(y||E(!1),o==null||o(ee))},[o,y]),K=w.useCallback(ee=>{if(n){ee.preventDefault();return}f==null||f(ee)},[n,f]),se=w.useCallback(ee=>{b&&(ee.preventDefault(),E(!1)),m==null||m(ee)},[b,m]),ae=ZA(e,A);return y?{...g,ref:ae,type:"button","aria-disabled":x?void 0:n,disabled:x,onClick:R,onMouseDown:s,onMouseUp:o,onKeyUp:c,onKeyDown:u,onMouseOver:f,onMouseLeave:m}:{...g,ref:ae,role:"button","data-active":YR(b),"aria-disabled":n?"true":void 0,tabIndex:x?void 0:I,onClick:R,onMouseDown:G,onMouseUp:W,onKeyUp:M,onKeyDown:N,onMouseOver:K,onMouseLeave:se}}const eY=t=>$.jsx(Cr.div,{className:"chakra-stack__item",...t,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...t.__css}});eY.displayName="StackItem";function n0e(t){const{spacing:e,direction:n}=t,r={column:{my:e,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:e,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:e,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:e,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":xee(n,i=>r[i])}}const PS=Xi((t,e)=>{const{isInline:n,direction:r,align:i,justify:a,spacing:s="0.5rem",wrap:o,children:l,divider:u,className:c,shouldWrapChildren:d,...f}=t,m=n?"row":r??"column",g=w.useMemo(()=>n0e({spacing:s,direction:m}),[s,m]),y=!!u,v=!d&&!y,b=w.useMemo(()=>{const _=yV(l);return v?_:_.map((A,I)=>{const x=typeof A.key<"u"?A.key:I,R=I+1===_.length,N=d?$.jsx(eY,{children:A},x):A;if(!y)return N;const M=w.cloneElement(u,{__css:g}),B=R?null:M;return $.jsxs(w.Fragment,{children:[N,B]},x)})},[u,g,y,v,d,l]),E=ba("chakra-stack",c);return $.jsx(Cr.div,{ref:e,display:"flex",alignItems:i,justifyContent:a,flexDirection:m,flexWrap:o,gap:y?void 0:s,className:E,...f,children:b})});PS.displayName="Stack";const vM=Xi((t,e)=>$.jsx(PS,{align:"center",...t,direction:"column",ref:e}));vM.displayName="VStack";const[r0e,i0e,a0e,s0e]=zge();function o0e(t){const{defaultIndex:e,onChange:n,index:r,isManual:i,isLazy:a,lazyBehavior:s="unmount",orientation:o="horizontal",direction:l="ltr",...u}=t,[c,d]=w.useState(e??0),[f,m]=Iee({defaultValue:e??0,value:r,onChange:n});w.useEffect(()=>{r!=null&&d(r)},[r]);const g=a0e(),y=w.useId();return{id:`tabs-${t.id??y}`,selectedIndex:f,focusedIndex:c,setSelectedIndex:m,setFocusedIndex:d,isManual:i,isLazy:a,lazyBehavior:s,orientation:o,descendants:g,direction:l,htmlProps:u}}const[l0e,Fx]=Mo({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function u0e(t){const{focusedIndex:e,orientation:n,direction:r}=Fx(),i=i0e(),a=w.useCallback(s=>{const o=()=>{var _;const E=i.nextEnabled(e);E&&((_=E.node)==null||_.focus())},l=()=>{var _;const E=i.prevEnabled(e);E&&((_=E.node)==null||_.focus())},u=()=>{var _;const E=i.firstEnabled();E&&((_=E.node)==null||_.focus())},c=()=>{var _;const E=i.lastEnabled();E&&((_=E.node)==null||_.focus())},d=n==="horizontal",f=n==="vertical",m=s.key,g=r==="ltr"?"ArrowLeft":"ArrowRight",y=r==="ltr"?"ArrowRight":"ArrowLeft",b={[g]:()=>d&&l(),[y]:()=>d&&o(),ArrowDown:()=>f&&o(),ArrowUp:()=>f&&l(),Home:u,End:c}[m];b&&(s.preventDefault(),b(s))},[i,e,n,r]);return{...t,role:"tablist","aria-orientation":n,onKeyDown:XR(t.onKeyDown,a)}}function c0e(t){const{isDisabled:e=!1,isFocusable:n=!1,...r}=t,{setSelectedIndex:i,isManual:a,id:s,setFocusedIndex:o,selectedIndex:l}=Fx(),{index:u,register:c}=s0e({disabled:e&&!n}),d=u===l,f=()=>{i(u)},m=()=>{o(u),!a&&!(e&&n)&&i(u)};return{...t0e({...r,ref:ZA(c,t.ref),isDisabled:e,isFocusable:n,onClick:XR(t.onClick,f)}),id:tY(s,u),role:"tab",tabIndex:d?0:-1,type:"button","aria-selected":d,"aria-controls":nY(s,u),onFocus:e?void 0:XR(t.onFocus,m)}}const[d0e,f0e]=Mo({});function p0e(t){const e=Fx(),{id:n,selectedIndex:r}=e,a=yV(t.children).map((s,o)=>w.createElement(d0e,{key:s.key??o,value:{isSelected:o===r,id:nY(n,o),tabId:tY(n,o),selectedIndex:r}},s));return{...t,children:a}}function h0e(t){const{children:e,...n}=t,{isLazy:r,lazyBehavior:i}=Fx(),{isSelected:a,id:s,tabId:o}=f0e(),l=w.useRef(!1);a&&(l.current=!0);const u=See({wasSelected:l.current,isSelected:a,enabled:r,mode:i});return{tabIndex:0,...n,children:u?e:null,role:"tabpanel","aria-labelledby":o,hidden:!a,id:s}}function tY(t,e){return`${t}--tab-${e}`}function nY(t,e){return`${t}--tabpanel-${e}`}const[m0e,Ux]=Mo({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),rY=Xi(function(e,n){const r=UW("Tabs",e),{children:i,className:a,...s}=um(e),{htmlProps:o,descendants:l,...u}=o0e(s),c=w.useMemo(()=>u,[u]),{isFitted:d,...f}=o,m={position:"relative",...r.root};return $.jsx(r0e,{value:l,children:$.jsx(l0e,{value:c,children:$.jsx(m0e,{value:r,children:$.jsx(Cr.div,{className:ba("chakra-tabs",a),ref:n,...f,__css:m,children:i})})})})});rY.displayName="Tabs";const z_=Xi(function(e,n){const r=Ux(),i=c0e({...e,ref:n}),a={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return $.jsx(Cr.button,{...i,className:ba("chakra-tabs__tab",e.className),__css:a})});z_.displayName="Tab";const iY=Xi(function(e,n){const r=u0e({...e,ref:n}),i=Ux(),a={display:"flex",...i.tablist};return $.jsx(Cr.div,{...r,className:ba("chakra-tabs__tablist",e.className),__css:a})});iY.displayName="TabList";const H_=Xi(function(e,n){const r=h0e({...e,ref:n}),i=Ux();return $.jsx(Cr.div,{outline:"0",...r,className:ba("chakra-tabs__tab-panel",e.className),__css:i.tabpanel})});H_.displayName="TabPanel";const aY=Xi(function(e,n){const r=p0e(e),i=Ux();return $.jsx(Cr.div,{...r,width:"100%",ref:n,className:ba("chakra-tabs__tab-panels",e.className),__css:i.tabpanels})});aY.displayName="TabPanels";function g0e(t,e){const n=t??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[n];return(i==null?void 0:i[e])??n}function b0e(t,e){const n=i=>({...e,...i,position:g0e((i==null?void 0:i.position)??(e==null?void 0:e.position),t)}),r=i=>{const a=n(i),s=jW(a);return tl.notify(s,a)};return r.update=(i,a)=>{tl.update(i,n(a))},r.promise=(i,a)=>{const s=r({...a.loading,status:"loading",duration:null});i.then(o=>r.update(s,{status:"success",duration:5e3,...Zs(a.success,o)})).catch(o=>r.update(s,{status:"error",duration:5e3,...Zs(a.error,o)}))},r.closeAll=tl.closeAll,r.close=tl.close,r.isActive=tl.isActive,r}function y0e(t){const{theme:e}=BW(),n=Oge();return w.useMemo(()=>b0e(e.direction,{...n,...t}),[t,e.direction,n])}const sY=Xi(function(e,n){const r=$b("Text",e),{className:i,align:a,decoration:s,casing:o,...l}=um(e),u=HN({textAlign:e.align,textDecoration:e.decoration,textTransform:e.casing});return $.jsx(Cr.p,{ref:n,className:ba("chakra-text",e.className),...u,...l,__css:r})});sY.displayName="Text";var oY,K6=Mf;oY=K6.createRoot,K6.hydrateRoot;/** * @remix-run/router v1.20.0 * * Copyright (c) Remix Software Inc. @@ -354,8 +354,8 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Mr(){return Mr=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function pf(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function E0e(){return Math.random().toString(36).substr(2,8)}function Q6(t,e){return{usr:t.state,key:t.key,idx:e}}function yb(t,e,n,r){return n===void 0&&(n=null),Mr({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Su(e):e,{state:n,key:e&&e.key||r||E0e()})}function hf(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Su(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function S0e(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,o=ui.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(Mr({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function d(){o=ui.Pop;let v=c(),b=v==null?null:v-u;u=v,l&&l({action:o,location:y.location,delta:b})}function f(v,b){o=ui.Push;let E=yb(y.location,v,b);n&&n(E,v),u=c()+1;let S=Q6(E,u),A=y.createHref(E);try{s.pushState(S,"",A)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(A)}a&&l&&l({action:o,location:y.location,delta:1})}function m(v,b){o=ui.Replace;let E=yb(y.location,v,b);n&&n(E,v),u=c();let S=Q6(E,u),A=y.createHref(E);s.replaceState(S,"",A),a&&l&&l({action:o,location:y.location,delta:0})}function g(v){let b=i.location.origin!=="null"?i.location.origin:i.location.href,E=typeof v=="string"?v:hf(v);return E=E.replace(/ $/,"%20"),Bn(b,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,b)}let y={get action(){return o},get location(){return t(i,s)},listen(v){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Z6,d),l=v,()=>{i.removeEventListener(Z6,d),l=null}},createHref(v){return e(i,v)},createURL:g,encodeLocation(v){let b=g(v);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:m,go(v){return s.go(v)}};return y}var cr;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(cr||(cr={}));const _0e=new Set(["lazy","caseSensitive","path","id","index","children"]);function A0e(t){return t.index===!0}function B_(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((i,a)=>{let s=[...n,String(a)],o=typeof i.id=="string"?i.id:s.join("-");if(Bn(i.index!==!0||!i.children,"Cannot specify children on an index route"),Bn(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),A0e(i)){let l=Mr({},i,e(i),{id:o});return r[o]=l,l}else{let l=Mr({},i,e(i),{id:o,children:void 0});return r[o]=l,i.children&&(l.children=B_(i.children,e,s,r)),l}})}function Cd(t,e,n){return n===void 0&&(n="/"),GS(t,e,n,!1)}function GS(t,e,n,r){let i=typeof e=="string"?Su(e):e,a=gm(i.pathname||"/",n);if(a==null)return null;let s=lY(t);x0e(s);let o=null;for(let l=0;o==null&&l{let l={relativePath:o===void 0?a.path||"":o,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};l.relativePath.startsWith("/")&&(Bn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=lu([r,l.relativePath]),c=n.concat(l);a.children&&a.children.length>0&&(Bn(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),lY(a.children,e,c,u)),!(a.path==null&&!a.index)&&e.push({path:u,score:O0e(u,a.index),routesMeta:c})};return t.forEach((a,s)=>{var o;if(a.path===""||!((o=a.path)!=null&&o.includes("?")))i(a,s);else for(let l of uY(a.path))i(a,s,l)}),e}function uY(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let s=uY(r.join("/")),o=[];return o.push(...s.map(l=>l===""?a:[a,l].join("/"))),i&&o.push(...s),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function x0e(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:D0e(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const w0e=/^:[\w-]+$/,C0e=3,R0e=2,I0e=1,M0e=10,N0e=-2,J6=t=>t==="*";function O0e(t,e){let n=t.split("/"),r=n.length;return n.some(J6)&&(r+=N0e),e&&(r+=R0e),n.filter(i=>!J6(i)).reduce((i,a)=>i+(w0e.test(a)?C0e:a===""?I0e:M0e),r)}function D0e(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function L0e(t,e,n){n===void 0&&(n=!1);let{routesMeta:r}=t,i={},a="/",s=[];for(let o=0;o{let{paramName:f,isOptional:m}=c;if(f==="*"){let y=o[d]||"";s=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const g=o[d];return m&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:t}}function k0e(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),pf(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function P0e(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return pf(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function gm(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function B0e(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Su(t):t;return{pathname:n?n.startsWith("/")?n:F0e(n,e):e,search:z0e(r),hash:H0e(i)}}function F0e(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function fC(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function cY(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function kO(t,e){let n=cY(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function PO(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Su(t):(i=Mr({},t),Bn(!i.pathname||!i.pathname.includes("?"),fC("?","pathname","search",i)),Bn(!i.pathname||!i.pathname.includes("#"),fC("#","pathname","hash",i)),Bn(!i.search||!i.search.includes("#"),fC("#","search","hash",i)));let a=t===""||i.pathname==="",s=a?"/":i.pathname,o;if(s==null)o=n;else{let d=e.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}o=d>=0?e[d]:"/"}let l=B0e(i,o),u=s&&s!=="/"&&s.endsWith("/"),c=(a||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const lu=t=>t.join("/").replace(/\/\/+/g,"/"),U0e=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),z0e=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,H0e=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class F_{constructor(e,n,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function zT(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const dY=["post","put","patch","delete"],G0e=new Set(dY),V0e=["get",...dY],$0e=new Set(V0e),W0e=new Set([301,302,303,307,308]),j0e=new Set([307,308]),pC={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Y0e={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},bg={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},BO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,q0e=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),fY="remix-router-transitions";function X0e(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Bn(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let he=t.detectErrorBoundary;i=_e=>({hasErrorBoundary:he(_e)})}else i=q0e;let a={},s=B_(t.routes,i,void 0,a),o,l=t.basename||"/",u=t.dataStrategy||J0e,c=t.patchRoutesOnNavigation,d=Mr({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),f=null,m=new Set,g=null,y=null,v=null,b=t.hydrationData!=null,E=Cd(s,t.history.location,l),S=null;if(E==null&&!c){let he=Wa(404,{pathname:t.history.location.pathname}),{matches:_e,route:Oe}=dH(s);E=_e,S={[Oe.id]:he}}E&&!t.hydrationData&&mn(E,s,t.history.location.pathname).active&&(E=null);let A;if(E)if(E.some(he=>he.route.lazy))A=!1;else if(!E.some(he=>he.route.loader))A=!0;else if(d.v7_partialHydration){let he=t.hydrationData?t.hydrationData.loaderData:null,_e=t.hydrationData?t.hydrationData.errors:null;if(_e){let Oe=E.findIndex(Ze=>_e[Ze.route.id]!==void 0);A=E.slice(0,Oe+1).every(Ze=>!SM(Ze.route,he,_e))}else A=E.every(Oe=>!SM(Oe.route,he,_e))}else A=t.hydrationData!=null;else if(A=!1,E=[],d.v7_partialHydration){let he=mn(null,s,t.history.location.pathname);he.active&&he.matches&&(E=he.matches)}let I,T={historyAction:t.history.action,location:t.history.location,matches:E,initialized:A,navigation:pC,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||S,fetchers:new Map,blockers:new Map},R=ui.Pop,O=!1,N,M=!1,B=new Map,G=null,W=!1,K=!1,se=[],ae=new Set,ee=new Map,F=0,ie=-1,J=new Map,fe=new Set,Ce=new Map,Le=new Map,j=new Set,ke=new Map,Fe=new Map,Ye;function gt(){if(f=t.history.listen(he=>{let{action:_e,location:Oe,delta:Ze}=he;if(Ye){Ye(),Ye=void 0;return}pf(Fe.size===0||Ze!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ct=ge({currentLocation:T.location,nextLocation:Oe,historyAction:_e});if(Ct&&Ze!=null){let kt=new Promise(Kt=>{Ye=Kt});t.history.go(Ze*-1),rt(Ct,{state:"blocked",location:Oe,proceed(){rt(Ct,{state:"proceeding",proceed:void 0,reset:void 0,location:Oe}),kt.then(()=>t.history.go(Ze))},reset(){let Kt=new Map(T.blockers);Kt.set(Ct,bg),Mt({blockers:Kt})}});return}return At(_e,Oe)}),n){pbe(e,B);let he=()=>hbe(e,B);e.addEventListener("pagehide",he),G=()=>e.removeEventListener("pagehide",he)}return T.initialized||At(ui.Pop,T.location,{initialHydration:!0}),I}function Gt(){f&&f(),G&&G(),m.clear(),N&&N.abort(),T.fetchers.forEach((he,_e)=>tn(_e)),T.blockers.forEach((he,_e)=>De(_e))}function Ut(he){return m.add(he),()=>m.delete(he)}function Mt(he,_e){_e===void 0&&(_e={}),T=Mr({},T,he);let Oe=[],Ze=[];d.v7_fetcherPersist&&T.fetchers.forEach((Ct,kt)=>{Ct.state==="idle"&&(j.has(kt)?Ze.push(kt):Oe.push(kt))}),[...m].forEach(Ct=>Ct(T,{deletedFetchers:Ze,viewTransitionOpts:_e.viewTransitionOpts,flushSync:_e.flushSync===!0})),d.v7_fetcherPersist&&(Oe.forEach(Ct=>T.fetchers.delete(Ct)),Ze.forEach(Ct=>tn(Ct)))}function $e(he,_e,Oe){var Ze,Ct;let{flushSync:kt}=Oe===void 0?{}:Oe,Kt=T.actionData!=null&&T.navigation.formMethod!=null&&yo(T.navigation.formMethod)&&T.navigation.state==="loading"&&((Ze=he.state)==null?void 0:Ze._isRedirect)!==!0,et;_e.actionData?Object.keys(_e.actionData).length>0?et=_e.actionData:et=null:Kt?et=T.actionData:et=null;let Pt=_e.loaderData?uH(T.loaderData,_e.loaderData,_e.matches||[],_e.errors):T.loaderData,Rt=T.blockers;Rt.size>0&&(Rt=new Map(Rt),Rt.forEach((oe,Te)=>Rt.set(Te,bg)));let P=O===!0||T.navigation.formMethod!=null&&yo(T.navigation.formMethod)&&((Ct=he.state)==null?void 0:Ct._isRedirect)!==!0;o&&(s=o,o=void 0),W||R===ui.Pop||(R===ui.Push?t.history.push(he,he.state):R===ui.Replace&&t.history.replace(he,he.state));let z;if(R===ui.Pop){let oe=B.get(T.location.pathname);oe&&oe.has(he.pathname)?z={currentLocation:T.location,nextLocation:he}:B.has(he.pathname)&&(z={currentLocation:he,nextLocation:T.location})}else if(M){let oe=B.get(T.location.pathname);oe?oe.add(he.pathname):(oe=new Set([he.pathname]),B.set(T.location.pathname,oe)),z={currentLocation:T.location,nextLocation:he}}Mt(Mr({},_e,{actionData:et,loaderData:Pt,historyAction:R,location:he,initialized:!0,navigation:pC,revalidation:"idle",restoreScrollPosition:Xt(he,_e.matches||T.matches),preventScrollReset:P,blockers:Rt}),{viewTransitionOpts:z,flushSync:kt===!0}),R=ui.Pop,O=!1,M=!1,W=!1,K=!1,se=[]}async function qe(he,_e){if(typeof he=="number"){t.history.go(he);return}let Oe=EM(T.location,T.matches,l,d.v7_prependBasename,he,d.v7_relativeSplatPath,_e==null?void 0:_e.fromRouteId,_e==null?void 0:_e.relative),{path:Ze,submission:Ct,error:kt}=tH(d.v7_normalizeFormMethod,!1,Oe,_e),Kt=T.location,et=yb(T.location,Ze,_e&&_e.state);et=Mr({},et,t.history.encodeLocation(et));let Pt=_e&&_e.replace!=null?_e.replace:void 0,Rt=ui.Push;Pt===!0?Rt=ui.Replace:Pt===!1||Ct!=null&&yo(Ct.formMethod)&&Ct.formAction===T.location.pathname+T.location.search&&(Rt=ui.Replace);let P=_e&&"preventScrollReset"in _e?_e.preventScrollReset===!0:void 0,z=(_e&&_e.flushSync)===!0,oe=ge({currentLocation:Kt,nextLocation:et,historyAction:Rt});if(oe){rt(oe,{state:"blocked",location:et,proceed(){rt(oe,{state:"proceeding",proceed:void 0,reset:void 0,location:et}),qe(he,_e)},reset(){let Te=new Map(T.blockers);Te.set(oe,bg),Mt({blockers:Te})}});return}return await At(Rt,et,{submission:Ct,pendingError:kt,preventScrollReset:P,replace:_e&&_e.replace,enableViewTransition:_e&&_e.viewTransition,flushSync:z})}function re(){if(Pe(),Mt({revalidation:"loading"}),T.navigation.state!=="submitting"){if(T.navigation.state==="idle"){At(T.historyAction,T.location,{startUninterruptedRevalidation:!0});return}At(R||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:M===!0})}}async function At(he,_e,Oe){N&&N.abort(),N=null,R=he,W=(Oe&&Oe.startUninterruptedRevalidation)===!0,_t(T.location,T.matches),O=(Oe&&Oe.preventScrollReset)===!0,M=(Oe&&Oe.enableViewTransition)===!0;let Ze=o||s,Ct=Oe&&Oe.overrideNavigation,kt=Cd(Ze,_e,l),Kt=(Oe&&Oe.flushSync)===!0,et=mn(kt,Ze,_e.pathname);if(et.active&&et.matches&&(kt=et.matches),!kt){let{error:Re,notFoundMatches:L,route:X}=xe(_e.pathname);$e(_e,{matches:L,loaderData:{},errors:{[X.id]:Re}},{flushSync:Kt});return}if(T.initialized&&!K&&abe(T.location,_e)&&!(Oe&&Oe.submission&&yo(Oe.submission.formMethod))){$e(_e,{matches:kt},{flushSync:Kt});return}N=new AbortController;let Pt=fp(t.history,_e,N.signal,Oe&&Oe.submission),Rt;if(Oe&&Oe.pendingError)Rt=[Rd(kt).route.id,{type:cr.error,error:Oe.pendingError}];else if(Oe&&Oe.submission&&yo(Oe.submission.formMethod)){let Re=await Je(Pt,_e,Oe.submission,kt,et.active,{replace:Oe.replace,flushSync:Kt});if(Re.shortCircuited)return;if(Re.pendingActionResult){let[L,X]=Re.pendingActionResult;if(ms(X)&&zT(X.error)&&X.error.status===404){N=null,$e(_e,{matches:Re.matches,loaderData:{},errors:{[L]:X.error}});return}}kt=Re.matches||kt,Rt=Re.pendingActionResult,Ct=hC(_e,Oe.submission),Kt=!1,et.active=!1,Pt=fp(t.history,Pt.url,Pt.signal)}let{shortCircuited:P,matches:z,loaderData:oe,errors:Te}=await Tt(Pt,_e,kt,et.active,Ct,Oe&&Oe.submission,Oe&&Oe.fetcherSubmission,Oe&&Oe.replace,Oe&&Oe.initialHydration===!0,Kt,Rt);P||(N=null,$e(_e,Mr({matches:z||kt},cH(Rt),{loaderData:oe,errors:Te})))}async function Je(he,_e,Oe,Ze,Ct,kt){kt===void 0&&(kt={}),Pe();let Kt=dbe(_e,Oe);if(Mt({navigation:Kt},{flushSync:kt.flushSync===!0}),Ct){let Rt=await Hn(Ze,_e.pathname,he.signal);if(Rt.type==="aborted")return{shortCircuited:!0};if(Rt.type==="error"){let P=Rd(Rt.partialMatches).route.id;return{matches:Rt.partialMatches,pendingActionResult:[P,{type:cr.error,error:Rt.error}]}}else if(Rt.matches)Ze=Rt.matches;else{let{notFoundMatches:P,error:z,route:oe}=xe(_e.pathname);return{matches:P,pendingActionResult:[oe.id,{type:cr.error,error:z}]}}}let et,Pt=e0(Ze,_e);if(!Pt.route.action&&!Pt.route.lazy)et={type:cr.error,error:Wa(405,{method:he.method,pathname:_e.pathname,routeId:Pt.route.id})};else if(et=(await Se("action",T,he,[Pt],Ze,null))[Pt.route.id],he.signal.aborted)return{shortCircuited:!0};if(kd(et)){let Rt;return kt&&kt.replace!=null?Rt=kt.replace:Rt=sH(et.response.headers.get("Location"),new URL(he.url),l)===T.location.pathname+T.location.search,await ue(he,et,!0,{submission:Oe,replace:Rt}),{shortCircuited:!0}}if(ac(et))throw Wa(400,{type:"defer-action"});if(ms(et)){let Rt=Rd(Ze,Pt.route.id);return(kt&&kt.replace)!==!0&&(R=ui.Push),{matches:Ze,pendingActionResult:[Rt.route.id,et]}}return{matches:Ze,pendingActionResult:[Pt.route.id,et]}}async function Tt(he,_e,Oe,Ze,Ct,kt,Kt,et,Pt,Rt,P){let z=Ct||hC(_e,kt),oe=kt||Kt||pH(z),Te=!W&&(!d.v7_partialHydration||!Pt);if(Ze){if(Te){let ct=ot(P);Mt(Mr({navigation:z},ct!==void 0?{actionData:ct}:{}),{flushSync:Rt})}let Ue=await Hn(Oe,_e.pathname,he.signal);if(Ue.type==="aborted")return{shortCircuited:!0};if(Ue.type==="error"){let ct=Rd(Ue.partialMatches).route.id;return{matches:Ue.partialMatches,loaderData:{},errors:{[ct]:Ue.error}}}else if(Ue.matches)Oe=Ue.matches;else{let{error:ct,notFoundMatches:Bt,route:wt}=xe(_e.pathname);return{matches:Bt,loaderData:{},errors:{[wt.id]:ct}}}}let Re=o||s,[L,X]=rH(t.history,T,Oe,oe,_e,d.v7_partialHydration&&Pt===!0,d.v7_skipActionErrorRevalidation,K,se,ae,j,Ce,fe,Re,l,P);if(Me(Ue=>!(Oe&&Oe.some(ct=>ct.route.id===Ue))||L&&L.some(ct=>ct.route.id===Ue)),ie=++F,L.length===0&&X.length===0){let Ue=Dt();return $e(_e,Mr({matches:Oe,loaderData:{},errors:P&&ms(P[1])?{[P[0]]:P[1].error}:null},cH(P),Ue?{fetchers:new Map(T.fetchers)}:{}),{flushSync:Rt}),{shortCircuited:!0}}if(Te){let Ue={};if(!Ze){Ue.navigation=z;let ct=ot(P);ct!==void 0&&(Ue.actionData=ct)}X.length>0&&(Ue.fetchers=Vt(X)),Mt(Ue,{flushSync:Rt})}X.forEach(Ue=>{Et(Ue.key),Ue.controller&&ee.set(Ue.key,Ue.controller)});let le=()=>X.forEach(Ue=>Et(Ue.key));N&&N.signal.addEventListener("abort",le);let{loaderResults:de,fetcherResults:Q}=await Ge(T,Oe,L,X,he);if(he.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",le),X.forEach(Ue=>ee.delete(Ue.key));let Ee=Jv(de);if(Ee)return await ue(he,Ee.result,!0,{replace:et}),{shortCircuited:!0};if(Ee=Jv(Q),Ee)return fe.add(Ee.key),await ue(he,Ee.result,!0,{replace:et}),{shortCircuited:!0};let{loaderData:we,errors:at}=lH(T,Oe,de,P,X,Q,ke);ke.forEach((Ue,ct)=>{Ue.subscribe(Bt=>{(Bt||Ue.done)&&ke.delete(ct)})}),d.v7_partialHydration&&Pt&&T.errors&&(at=Mr({},T.errors,at));let Ve=Dt(),Qe=bt(ie),lt=Ve||Qe||X.length>0;return Mr({matches:Oe,loaderData:we,errors:at},lt?{fetchers:new Map(T.fetchers)}:{})}function ot(he){if(he&&!ms(he[1]))return{[he[0]]:he[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Vt(he){return he.forEach(_e=>{let Oe=T.fetchers.get(_e.key),Ze=yg(void 0,Oe?Oe.data:void 0);T.fetchers.set(_e.key,Ze)}),new Map(T.fetchers)}function yt(he,_e,Oe,Ze){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Et(he);let Ct=(Ze&&Ze.flushSync)===!0,kt=o||s,Kt=EM(T.location,T.matches,l,d.v7_prependBasename,Oe,d.v7_relativeSplatPath,_e,Ze==null?void 0:Ze.relative),et=Cd(kt,Kt,l),Pt=mn(et,kt,Kt);if(Pt.active&&Pt.matches&&(et=Pt.matches),!et){nt(he,_e,Wa(404,{pathname:Kt}),{flushSync:Ct});return}let{path:Rt,submission:P,error:z}=tH(d.v7_normalizeFormMethod,!0,Kt,Ze);if(z){nt(he,_e,z,{flushSync:Ct});return}let oe=e0(et,Rt),Te=(Ze&&Ze.preventScrollReset)===!0;if(P&&yo(P.formMethod)){q(he,_e,Rt,oe,et,Pt.active,Ct,Te,P);return}Ce.set(he,{routeId:_e,path:Rt}),U(he,_e,Rt,oe,et,Pt.active,Ct,Te,P)}async function q(he,_e,Oe,Ze,Ct,kt,Kt,et,Pt){Pe(),Ce.delete(he);function Rt(xt){if(!xt.route.action&&!xt.route.lazy){let Nt=Wa(405,{method:Pt.formMethod,pathname:Oe,routeId:_e});return nt(he,_e,Nt,{flushSync:Kt}),!0}return!1}if(!kt&&Rt(Ze))return;let P=T.fetchers.get(he);ft(he,fbe(Pt,P),{flushSync:Kt});let z=new AbortController,oe=fp(t.history,Oe,z.signal,Pt);if(kt){let xt=await Hn(Ct,Oe,oe.signal);if(xt.type==="aborted")return;if(xt.type==="error"){nt(he,_e,xt.error,{flushSync:Kt});return}else if(xt.matches){if(Ct=xt.matches,Ze=e0(Ct,Oe),Rt(Ze))return}else{nt(he,_e,Wa(404,{pathname:Oe}),{flushSync:Kt});return}}ee.set(he,z);let Te=F,L=(await Se("action",T,oe,[Ze],Ct,he))[Ze.route.id];if(oe.signal.aborted){ee.get(he)===z&&ee.delete(he);return}if(d.v7_fetcherPersist&&j.has(he)){if(kd(L)||ms(L)){ft(he,Wu(void 0));return}}else{if(kd(L))if(ee.delete(he),ie>Te){ft(he,Wu(void 0));return}else return fe.add(he),ft(he,yg(Pt)),ue(oe,L,!1,{fetcherSubmission:Pt,preventScrollReset:et});if(ms(L)){nt(he,_e,L.error);return}}if(ac(L))throw Wa(400,{type:"defer-action"});let X=T.navigation.location||T.location,le=fp(t.history,X,z.signal),de=o||s,Q=T.navigation.state!=="idle"?Cd(de,T.navigation.location,l):T.matches;Bn(Q,"Didn't find any matches after fetcher action");let Ee=++F;J.set(he,Ee);let we=yg(Pt,L.data);T.fetchers.set(he,we);let[at,Ve]=rH(t.history,T,Q,Pt,X,!1,d.v7_skipActionErrorRevalidation,K,se,ae,j,Ce,fe,de,l,[Ze.route.id,L]);Ve.filter(xt=>xt.key!==he).forEach(xt=>{let Nt=xt.key,pt=T.fetchers.get(Nt),nn=yg(void 0,pt?pt.data:void 0);T.fetchers.set(Nt,nn),Et(Nt),xt.controller&&ee.set(Nt,xt.controller)}),Mt({fetchers:new Map(T.fetchers)});let Qe=()=>Ve.forEach(xt=>Et(xt.key));z.signal.addEventListener("abort",Qe);let{loaderResults:lt,fetcherResults:Ue}=await Ge(T,Q,at,Ve,le);if(z.signal.aborted)return;z.signal.removeEventListener("abort",Qe),J.delete(he),ee.delete(he),Ve.forEach(xt=>ee.delete(xt.key));let ct=Jv(lt);if(ct)return ue(le,ct.result,!1,{preventScrollReset:et});if(ct=Jv(Ue),ct)return fe.add(ct.key),ue(le,ct.result,!1,{preventScrollReset:et});let{loaderData:Bt,errors:wt}=lH(T,Q,lt,void 0,Ve,Ue,ke);if(T.fetchers.has(he)){let xt=Wu(L.data);T.fetchers.set(he,xt)}bt(Ee),T.navigation.state==="loading"&&Ee>ie?(Bn(R,"Expected pending action"),N&&N.abort(),$e(T.navigation.location,{matches:Q,loaderData:Bt,errors:wt,fetchers:new Map(T.fetchers)})):(Mt({errors:wt,loaderData:uH(T.loaderData,Bt,Q,wt),fetchers:new Map(T.fetchers)}),K=!1)}async function U(he,_e,Oe,Ze,Ct,kt,Kt,et,Pt){let Rt=T.fetchers.get(he);ft(he,yg(Pt,Rt?Rt.data:void 0),{flushSync:Kt});let P=new AbortController,z=fp(t.history,Oe,P.signal);if(kt){let L=await Hn(Ct,Oe,z.signal);if(L.type==="aborted")return;if(L.type==="error"){nt(he,_e,L.error,{flushSync:Kt});return}else if(L.matches)Ct=L.matches,Ze=e0(Ct,Oe);else{nt(he,_e,Wa(404,{pathname:Oe}),{flushSync:Kt});return}}ee.set(he,P);let oe=F,Re=(await Se("loader",T,z,[Ze],Ct,he))[Ze.route.id];if(ac(Re)&&(Re=await FO(Re,z.signal,!0)||Re),ee.get(he)===P&&ee.delete(he),!z.signal.aborted){if(j.has(he)){ft(he,Wu(void 0));return}if(kd(Re))if(ie>oe){ft(he,Wu(void 0));return}else{fe.add(he),await ue(z,Re,!1,{preventScrollReset:et});return}if(ms(Re)){nt(he,_e,Re.error);return}Bn(!ac(Re),"Unhandled fetcher deferred data"),ft(he,Wu(Re.data))}}async function ue(he,_e,Oe,Ze){let{submission:Ct,fetcherSubmission:kt,preventScrollReset:Kt,replace:et}=Ze===void 0?{}:Ze;_e.response.headers.has("X-Remix-Revalidate")&&(K=!0);let Pt=_e.response.headers.get("Location");Bn(Pt,"Expected a Location header on the redirect Response"),Pt=sH(Pt,new URL(he.url),l);let Rt=yb(T.location,Pt,{_isRedirect:!0});if(n){let L=!1;if(_e.response.headers.has("X-Remix-Reload-Document"))L=!0;else if(BO.test(Pt)){const X=t.history.createURL(Pt);L=X.origin!==e.location.origin||gm(X.pathname,l)==null}if(L){et?e.location.replace(Pt):e.location.assign(Pt);return}}N=null;let P=et===!0||_e.response.headers.has("X-Remix-Replace")?ui.Replace:ui.Push,{formMethod:z,formAction:oe,formEncType:Te}=T.navigation;!Ct&&!kt&&z&&oe&&Te&&(Ct=pH(T.navigation));let Re=Ct||kt;if(j0e.has(_e.response.status)&&Re&&yo(Re.formMethod))await At(P,Rt,{submission:Mr({},Re,{formAction:Pt}),preventScrollReset:Kt||O,enableViewTransition:Oe?M:void 0});else{let L=hC(Rt,Ct);await At(P,Rt,{overrideNavigation:L,fetcherSubmission:kt,preventScrollReset:Kt||O,enableViewTransition:Oe?M:void 0})}}async function Se(he,_e,Oe,Ze,Ct,kt){let Kt,et={};try{Kt=await ebe(u,he,_e,Oe,Ze,Ct,kt,a,i)}catch(Pt){return Ze.forEach(Rt=>{et[Rt.route.id]={type:cr.error,error:Pt}}),et}for(let[Pt,Rt]of Object.entries(Kt))if(sbe(Rt)){let P=Rt.result;et[Pt]={type:cr.redirect,response:rbe(P,Oe,Pt,Ct,l,d.v7_relativeSplatPath)}}else et[Pt]=await nbe(Rt);return et}async function Ge(he,_e,Oe,Ze,Ct){let kt=he.matches,Kt=Se("loader",he,Ct,Oe,_e,null),et=Promise.all(Ze.map(async P=>{if(P.matches&&P.match&&P.controller){let oe=(await Se("loader",he,fp(t.history,P.path,P.controller.signal),[P.match],P.matches,P.key))[P.match.route.id];return{[P.key]:oe}}else return Promise.resolve({[P.key]:{type:cr.error,error:Wa(404,{pathname:P.path})}})})),Pt=await Kt,Rt=(await et).reduce((P,z)=>Object.assign(P,z),{});return await Promise.all([ube(_e,Pt,Ct.signal,kt,he.loaderData),cbe(_e,Rt,Ze)]),{loaderResults:Pt,fetcherResults:Rt}}function Pe(){K=!0,se.push(...Me()),Ce.forEach((he,_e)=>{ee.has(_e)&&ae.add(_e),Et(_e)})}function ft(he,_e,Oe){Oe===void 0&&(Oe={}),T.fetchers.set(he,_e),Mt({fetchers:new Map(T.fetchers)},{flushSync:(Oe&&Oe.flushSync)===!0})}function nt(he,_e,Oe,Ze){Ze===void 0&&(Ze={});let Ct=Rd(T.matches,_e);tn(he),Mt({errors:{[Ct.route.id]:Oe},fetchers:new Map(T.fetchers)},{flushSync:(Ze&&Ze.flushSync)===!0})}function ht(he){return d.v7_fetcherPersist&&(Le.set(he,(Le.get(he)||0)+1),j.has(he)&&j.delete(he)),T.fetchers.get(he)||Y0e}function tn(he){let _e=T.fetchers.get(he);ee.has(he)&&!(_e&&_e.state==="loading"&&J.has(he))&&Et(he),Ce.delete(he),J.delete(he),fe.delete(he),j.delete(he),ae.delete(he),T.fetchers.delete(he)}function tt(he){if(d.v7_fetcherPersist){let _e=(Le.get(he)||0)-1;_e<=0?(Le.delete(he),j.add(he)):Le.set(he,_e)}else tn(he);Mt({fetchers:new Map(T.fetchers)})}function Et(he){let _e=ee.get(he);_e&&(_e.abort(),ee.delete(he))}function zt(he){for(let _e of he){let Oe=ht(_e),Ze=Wu(Oe.data);T.fetchers.set(_e,Ze)}}function Dt(){let he=[],_e=!1;for(let Oe of fe){let Ze=T.fetchers.get(Oe);Bn(Ze,"Expected fetcher: "+Oe),Ze.state==="loading"&&(fe.delete(Oe),he.push(Oe),_e=!0)}return zt(he),_e}function bt(he){let _e=[];for(let[Oe,Ze]of J)if(Ze0}function me(he,_e){let Oe=T.blockers.get(he)||bg;return Fe.get(he)!==_e&&Fe.set(he,_e),Oe}function De(he){T.blockers.delete(he),Fe.delete(he)}function rt(he,_e){let Oe=T.blockers.get(he)||bg;Bn(Oe.state==="unblocked"&&_e.state==="blocked"||Oe.state==="blocked"&&_e.state==="blocked"||Oe.state==="blocked"&&_e.state==="proceeding"||Oe.state==="blocked"&&_e.state==="unblocked"||Oe.state==="proceeding"&&_e.state==="unblocked","Invalid blocker state transition: "+Oe.state+" -> "+_e.state);let Ze=new Map(T.blockers);Ze.set(he,_e),Mt({blockers:Ze})}function ge(he){let{currentLocation:_e,nextLocation:Oe,historyAction:Ze}=he;if(Fe.size===0)return;Fe.size>1&&pf(!1,"A router only supports one blocker at a time");let Ct=Array.from(Fe.entries()),[kt,Kt]=Ct[Ct.length-1],et=T.blockers.get(kt);if(!(et&&et.state==="proceeding")&&Kt({currentLocation:_e,nextLocation:Oe,historyAction:Ze}))return kt}function xe(he){let _e=Wa(404,{pathname:he}),Oe=o||s,{matches:Ze,route:Ct}=dH(Oe);return Me(),{notFoundMatches:Ze,route:Ct,error:_e}}function Me(he){let _e=[];return ke.forEach((Oe,Ze)=>{(!he||he(Ze))&&(Oe.cancel(),_e.push(Ze),ke.delete(Ze))}),_e}function Xe(he,_e,Oe){if(g=he,v=_e,y=Oe||null,!b&&T.navigation===pC){b=!0;let Ze=Xt(T.location,T.matches);Ze!=null&&Mt({restoreScrollPosition:Ze})}return()=>{g=null,v=null,y=null}}function St(he,_e){return y&&y(he,_e.map(Ze=>T0e(Ze,T.loaderData)))||he.key}function _t(he,_e){if(g&&v){let Oe=St(he,_e);g[Oe]=v()}}function Xt(he,_e){if(g){let Oe=St(he,_e),Ze=g[Oe];if(typeof Ze=="number")return Ze}return null}function mn(he,_e,Oe){if(c)if(he){if(Object.keys(he[0].params).length>0)return{active:!0,matches:GS(_e,Oe,l,!0)}}else return{active:!0,matches:GS(_e,Oe,l,!0)||[]};return{active:!1,matches:null}}async function Hn(he,_e,Oe){if(!c)return{type:"success",matches:he};let Ze=he;for(;;){let Ct=o==null,kt=o||s,Kt=a;try{await c({path:_e,matches:Ze,patch:(Rt,P)=>{Oe.aborted||aH(Rt,P,kt,Kt,i)}})}catch(Rt){return{type:"error",error:Rt,partialMatches:Ze}}finally{Ct&&!Oe.aborted&&(s=[...s])}if(Oe.aborted)return{type:"aborted"};let et=Cd(kt,_e,l);if(et)return{type:"success",matches:et};let Pt=GS(kt,_e,l,!0);if(!Pt||Ze.length===Pt.length&&Ze.every((Rt,P)=>Rt.route.id===Pt[P].route.id))return{type:"success",matches:null};Ze=Pt}}function pn(he){a={},o=B_(he,i,void 0,a)}function Gn(he,_e){let Oe=o==null;aH(he,_e,o||s,a,i),Oe&&(s=[...s],Mt({}))}return I={get basename(){return l},get future(){return d},get state(){return T},get routes(){return s},get window(){return e},initialize:gt,subscribe:Ut,enableScrollRestoration:Xe,navigate:qe,fetch:yt,revalidate:re,createHref:he=>t.history.createHref(he),encodeLocation:he=>t.history.encodeLocation(he),getFetcher:ht,deleteFetcher:tt,dispose:Gt,getBlocker:me,deleteBlocker:De,patchRoutes:Gn,_internalFetchControllers:ee,_internalActiveDeferreds:ke,_internalSetRoutes:pn},I}function K0e(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function EM(t,e,n,r,i,a,s,o){let l,u;if(s){l=[];for(let d of e)if(l.push(d),d.route.id===s){u=d;break}}else l=e,u=e[e.length-1];let c=PO(i||".",kO(l,a),gm(t.pathname,n)||t.pathname,o==="path");if(i==null&&(c.search=t.search,c.hash=t.hash),(i==null||i===""||i===".")&&u){let d=UO(c.search);if(u.route.index&&!d)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&d){let f=new URLSearchParams(c.search),m=f.getAll("index");f.delete("index"),m.filter(y=>y).forEach(y=>f.append("index",y));let g=f.toString();c.search=g?"?"+g:""}}return r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:lu([n,c.pathname])),hf(c)}function tH(t,e,n,r){if(!r||!K0e(r))return{path:n};if(r.formMethod&&!lbe(r.formMethod))return{path:n,error:Wa(405,{method:r.formMethod})};let i=()=>({path:n,error:Wa(400,{type:"invalid-body"})}),a=r.formMethod||"get",s=t?a.toUpperCase():a.toLowerCase(),o=mY(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!yo(s))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,g)=>{let[y,v]=g;return""+m+y+"="+v+` -`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!yo(s))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:o,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}Bn(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=_M(r.formData),u=r.formData;else if(r.body instanceof FormData)l=_M(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=oH(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=oH(l)}catch{return i()}let c={formMethod:s,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(yo(c.formMethod))return{path:n,submission:c};let d=Su(n);return e&&d.search&&UO(d.search)&&l.append("index",""),d.search="?"+l,{path:hf(d),submission:c}}function nH(t,e,n){n===void 0&&(n=!1);let r=t.findIndex(i=>i.route.id===e);return r>=0?t.slice(0,n?r+1:r):t}function rH(t,e,n,r,i,a,s,o,l,u,c,d,f,m,g,y){let v=y?ms(y[1])?y[1].error:y[1].data:void 0,b=t.createURL(e.location),E=t.createURL(i),S=n;a&&e.errors?S=nH(n,Object.keys(e.errors)[0],!0):y&&ms(y[1])&&(S=nH(n,y[0]));let A=y?y[1].statusCode:void 0,I=s&&A&&A>=400,T=S.filter((O,N)=>{let{route:M}=O;if(M.lazy)return!0;if(M.loader==null)return!1;if(a)return SM(M,e.loaderData,e.errors);if(Z0e(e.loaderData,e.matches[N],O)||l.some(W=>W===O.route.id))return!0;let B=e.matches[N],G=O;return iH(O,Mr({currentUrl:b,currentParams:B.params,nextUrl:E,nextParams:G.params},r,{actionResult:v,actionStatus:A,defaultShouldRevalidate:I?!1:o||b.pathname+b.search===E.pathname+E.search||b.search!==E.search||pY(B,G)}))}),R=[];return d.forEach((O,N)=>{if(a||!n.some(K=>K.route.id===O.routeId)||c.has(N))return;let M=Cd(m,O.path,g);if(!M){R.push({key:N,routeId:O.routeId,path:O.path,matches:null,match:null,controller:null});return}let B=e.fetchers.get(N),G=e0(M,O.path),W=!1;f.has(N)?W=!1:u.has(N)?(u.delete(N),W=!0):B&&B.state!=="idle"&&B.data===void 0?W=o:W=iH(G,Mr({currentUrl:b,currentParams:e.matches[e.matches.length-1].params,nextUrl:E,nextParams:n[n.length-1].params},r,{actionResult:v,actionStatus:A,defaultShouldRevalidate:I?!1:o})),W&&R.push({key:N,routeId:O.routeId,path:O.path,matches:M,match:G,controller:new AbortController})}),[T,R]}function SM(t,e,n){if(t.lazy)return!0;if(!t.loader)return!1;let r=e!=null&&e[t.id]!==void 0,i=n!=null&&n[t.id]!==void 0;return!r&&i?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!r&&!i}function Z0e(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function pY(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function iH(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function aH(t,e,n,r,i){var a;let s;if(t){let u=r[t];Bn(u,"No route found to patch children into: routeId = "+t),u.children||(u.children=[]),s=u.children}else s=n;let o=e.filter(u=>!s.some(c=>hY(u,c))),l=B_(o,i,[t||"_","patch",String(((a=s)==null?void 0:a.length)||"0")],r);s.push(...l)}function hY(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,r)=>{var i;return(i=e.children)==null?void 0:i.some(a=>hY(n,a))}):!1}async function Q0e(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let i=n[t.id];Bn(i,"No route found in manifest");let a={};for(let s in r){let l=i[s]!==void 0&&s!=="hasErrorBoundary";pf(!l,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!_0e.has(s)&&(a[s]=r[s])}Object.assign(i,a),Object.assign(i,Mr({},e(i),{lazy:void 0}))}async function J0e(t){let{matches:e}=t,n=e.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,a,s)=>Object.assign(i,{[n[s].route.id]:a}),{})}async function ebe(t,e,n,r,i,a,s,o,l,u){let c=a.map(m=>m.route.lazy?Q0e(m.route,l,o):void 0),d=a.map((m,g)=>{let y=c[g],v=i.some(E=>E.route.id===m.route.id);return Mr({},m,{shouldLoad:v,resolve:async E=>(E&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(v=!0),v?tbe(e,r,m,y,E,u):Promise.resolve({type:cr.data,result:void 0}))})}),f=await t({matches:d,request:r,params:a[0].params,fetcherKey:s,context:u});try{await Promise.all(c)}catch{}return f}async function tbe(t,e,n,r,i,a){let s,o,l=u=>{let c,d=new Promise((g,y)=>c=y);o=()=>c(),e.signal.addEventListener("abort",o);let f=g=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+n.route.id+"]"))):u({request:e,params:n.params,context:a},...g!==void 0?[g]:[]),m=(async()=>{try{return{type:"data",result:await(i?i(y=>f(y)):f())}}catch(g){return{type:"error",result:g}}})();return Promise.race([m,d])};try{let u=n.route[t];if(r)if(u){let c,[d]=await Promise.all([l(u).catch(f=>{c=f}),r]);if(c!==void 0)throw c;s=d}else if(await r,u=n.route[t],u)s=await l(u);else if(t==="action"){let c=new URL(e.url),d=c.pathname+c.search;throw Wa(405,{method:e.method,pathname:d,routeId:n.route.id})}else return{type:cr.data,result:void 0};else if(u)s=await l(u);else{let c=new URL(e.url),d=c.pathname+c.search;throw Wa(404,{pathname:d})}Bn(s.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:cr.error,result:u}}finally{o&&e.signal.removeEventListener("abort",o)}return s}async function nbe(t){let{result:e,type:n}=t;if(gY(e)){let u;try{let c=e.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?e.body==null?u=null:u=await e.json():u=await e.text()}catch(c){return{type:cr.error,error:c}}return n===cr.error?{type:cr.error,error:new F_(e.status,e.statusText,u),statusCode:e.status,headers:e.headers}:{type:cr.data,data:u,statusCode:e.status,headers:e.headers}}if(n===cr.error){if(fH(e)){var r;if(e.data instanceof Error){var i;return{type:cr.error,error:e.data,statusCode:(i=e.init)==null?void 0:i.status}}e=new F_(((r=e.init)==null?void 0:r.status)||500,void 0,e.data)}return{type:cr.error,error:e,statusCode:zT(e)?e.status:void 0}}if(obe(e)){var a,s;return{type:cr.deferred,deferredData:e,statusCode:(a=e.init)==null?void 0:a.status,headers:((s=e.init)==null?void 0:s.headers)&&new Headers(e.init.headers)}}if(fH(e)){var o,l;return{type:cr.data,data:e.data,statusCode:(o=e.init)==null?void 0:o.status,headers:(l=e.init)!=null&&l.headers?new Headers(e.init.headers):void 0}}return{type:cr.data,data:e}}function rbe(t,e,n,r,i,a){let s=t.headers.get("Location");if(Bn(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!BO.test(s)){let o=r.slice(0,r.findIndex(l=>l.route.id===n)+1);s=EM(new URL(e.url),o,i,!0,s,a),t.headers.set("Location",s)}return t}function sH(t,e,n){if(BO.test(t)){let r=t,i=r.startsWith("//")?new URL(e.protocol+r):new URL(r),a=gm(i.pathname,n)!=null;if(i.origin===e.origin&&a)return i.pathname+i.search+i.hash}return t}function fp(t,e,n,r){let i=t.createURL(mY(e)).toString(),a={signal:n};if(r&&yo(r.formMethod)){let{formMethod:s,formEncType:o}=r;a.method=s.toUpperCase(),o==="application/json"?(a.headers=new Headers({"Content-Type":o}),a.body=JSON.stringify(r.json)):o==="text/plain"?a.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?a.body=_M(r.formData):a.body=r.formData}return new Request(i,a)}function _M(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function oH(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function ibe(t,e,n,r,i){let a={},s=null,o,l=!1,u={},c=n&&ms(n[1])?n[1].error:void 0;return t.forEach(d=>{if(!(d.route.id in e))return;let f=d.route.id,m=e[f];if(Bn(!kd(m),"Cannot handle redirect results in processLoaderData"),ms(m)){let g=m.error;c!==void 0&&(g=c,c=void 0),s=s||{};{let y=Rd(t,f);s[y.route.id]==null&&(s[y.route.id]=g)}a[f]=void 0,l||(l=!0,o=zT(m.error)?m.error.status:500),m.headers&&(u[f]=m.headers)}else ac(m)?(r.set(f,m.deferredData),a[f]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!l&&(o=m.statusCode),m.headers&&(u[f]=m.headers)):(a[f]=m.data,m.statusCode&&m.statusCode!==200&&!l&&(o=m.statusCode),m.headers&&(u[f]=m.headers))}),c!==void 0&&n&&(s={[n[0]]:c},a[n[0]]=void 0),{loaderData:a,errors:s,statusCode:o||200,loaderHeaders:u}}function lH(t,e,n,r,i,a,s){let{loaderData:o,errors:l}=ibe(e,n,r,s);return i.forEach(u=>{let{key:c,match:d,controller:f}=u,m=a[c];if(Bn(m,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(ms(m)){let g=Rd(t.matches,d==null?void 0:d.route.id);l&&l[g.route.id]||(l=Mr({},l,{[g.route.id]:m.error})),t.fetchers.delete(c)}else if(kd(m))Bn(!1,"Unhandled fetcher revalidation redirect");else if(ac(m))Bn(!1,"Unhandled fetcher deferred data");else{let g=Wu(m.data);t.fetchers.set(c,g)}}),{loaderData:o,errors:l}}function uH(t,e,n,r){let i=Mr({},e);for(let a of n){let s=a.route.id;if(e.hasOwnProperty(s)?e[s]!==void 0&&(i[s]=e[s]):t[s]!==void 0&&a.route.loader&&(i[s]=t[s]),r&&r.hasOwnProperty(s))break}return i}function cH(t){return t?ms(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Rd(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function dH(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Wa(t,e){let{pathname:n,routeId:r,method:i,type:a,message:s}=e===void 0?{}:e,o="Unknown Server Error",l="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":a==="defer-action"?l="defer() is not supported in actions":a==="invalid-body"&&(l="Unable to encode submission body")):t===403?(o="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):t===404?(o="Not Found",l='No route matches URL "'+n+'"'):t===405&&(o="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new F_(t||500,o,new Error(l),!0)}function Jv(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,i]=e[n];if(kd(i))return{key:r,result:i}}}function mY(t){let e=typeof t=="string"?Su(t):t;return hf(Mr({},e,{hash:""}))}function abe(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function sbe(t){return gY(t.result)&&W0e.has(t.result.status)}function ac(t){return t.type===cr.deferred}function ms(t){return t.type===cr.error}function kd(t){return(t&&t.type)===cr.redirect}function fH(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function obe(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function gY(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function lbe(t){return $0e.has(t.toLowerCase())}function yo(t){return G0e.has(t.toLowerCase())}async function ube(t,e,n,r,i){let a=Object.entries(e);for(let s=0;s(f==null?void 0:f.route.id)===o);if(!u)continue;let c=r.find(f=>f.route.id===u.route.id),d=c!=null&&!pY(c,u)&&(i&&i[u.route.id])!==void 0;ac(l)&&d&&await FO(l,n,!1).then(f=>{f&&(e[o]=f)})}}async function cbe(t,e,n){for(let r=0;r(u==null?void 0:u.route.id)===a)&&ac(o)&&(Bn(s,"Expected an AbortController for revalidating fetcher deferred result"),await FO(o,s.signal,!0).then(u=>{u&&(e[i]=u)}))}}async function FO(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:cr.data,data:t.deferredData.unwrappedData}}catch(i){return{type:cr.error,error:i}}return{type:cr.data,data:t.deferredData.data}}}function UO(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function e0(t,e){let n=typeof e=="string"?Su(e).search:e.search;if(t[t.length-1].route.index&&UO(n||""))return t[t.length-1];let r=cY(t);return r[r.length-1]}function pH(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:a,json:s}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:e,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(s!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function hC(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function dbe(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function yg(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function fbe(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Wu(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function pbe(t,e){try{let n=t.sessionStorage.getItem(fY);if(n){let r=JSON.parse(n);for(let[i,a]of Object.entries(r||{}))a&&Array.isArray(a)&&e.set(i,new Set(a||[]))}}catch{}}function hbe(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(fY,JSON.stringify(n))}catch(r){pf(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + */function Mr(){return Mr=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function pf(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function E0e(){return Math.random().toString(36).substr(2,8)}function Q6(t,e){return{usr:t.state,key:t.key,idx:e}}function yb(t,e,n,r){return n===void 0&&(n=null),Mr({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?_u(e):e,{state:n,key:e&&e.key||r||E0e()})}function hf(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function _u(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function _0e(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,o=ui.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(Mr({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function d(){o=ui.Pop;let v=c(),b=v==null?null:v-u;u=v,l&&l({action:o,location:y.location,delta:b})}function f(v,b){o=ui.Push;let E=yb(y.location,v,b);n&&n(E,v),u=c()+1;let _=Q6(E,u),A=y.createHref(E);try{s.pushState(_,"",A)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(A)}a&&l&&l({action:o,location:y.location,delta:1})}function m(v,b){o=ui.Replace;let E=yb(y.location,v,b);n&&n(E,v),u=c();let _=Q6(E,u),A=y.createHref(E);s.replaceState(_,"",A),a&&l&&l({action:o,location:y.location,delta:0})}function g(v){let b=i.location.origin!=="null"?i.location.origin:i.location.href,E=typeof v=="string"?v:hf(v);return E=E.replace(/ $/,"%20"),Bn(b,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,b)}let y={get action(){return o},get location(){return t(i,s)},listen(v){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Z6,d),l=v,()=>{i.removeEventListener(Z6,d),l=null}},createHref(v){return e(i,v)},createURL:g,encodeLocation(v){let b=g(v);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:m,go(v){return s.go(v)}};return y}var cr;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(cr||(cr={}));const S0e=new Set(["lazy","caseSensitive","path","id","index","children"]);function A0e(t){return t.index===!0}function BS(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((i,a)=>{let s=[...n,String(a)],o=typeof i.id=="string"?i.id:s.join("-");if(Bn(i.index!==!0||!i.children,"Cannot specify children on an index route"),Bn(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),A0e(i)){let l=Mr({},i,e(i),{id:o});return r[o]=l,l}else{let l=Mr({},i,e(i),{id:o,children:void 0});return r[o]=l,i.children&&(l.children=BS(i.children,e,s,r)),l}})}function Cd(t,e,n){return n===void 0&&(n="/"),G_(t,e,n,!1)}function G_(t,e,n,r){let i=typeof e=="string"?_u(e):e,a=gm(i.pathname||"/",n);if(a==null)return null;let s=lY(t);T0e(s);let o=null;for(let l=0;o==null&&l{let l={relativePath:o===void 0?a.path||"":o,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};l.relativePath.startsWith("/")&&(Bn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=lu([r,l.relativePath]),c=n.concat(l);a.children&&a.children.length>0&&(Bn(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),lY(a.children,e,c,u)),!(a.path==null&&!a.index)&&e.push({path:u,score:O0e(u,a.index),routesMeta:c})};return t.forEach((a,s)=>{var o;if(a.path===""||!((o=a.path)!=null&&o.includes("?")))i(a,s);else for(let l of uY(a.path))i(a,s,l)}),e}function uY(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let s=uY(r.join("/")),o=[];return o.push(...s.map(l=>l===""?a:[a,l].join("/"))),i&&o.push(...s),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function T0e(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:D0e(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const w0e=/^:[\w-]+$/,C0e=3,R0e=2,I0e=1,M0e=10,N0e=-2,J6=t=>t==="*";function O0e(t,e){let n=t.split("/"),r=n.length;return n.some(J6)&&(r+=N0e),e&&(r+=R0e),n.filter(i=>!J6(i)).reduce((i,a)=>i+(w0e.test(a)?C0e:a===""?I0e:M0e),r)}function D0e(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function L0e(t,e,n){n===void 0&&(n=!1);let{routesMeta:r}=t,i={},a="/",s=[];for(let o=0;o{let{paramName:f,isOptional:m}=c;if(f==="*"){let y=o[d]||"";s=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const g=o[d];return m&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:t}}function k0e(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),pf(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function P0e(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return pf(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function gm(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function B0e(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?_u(t):t;return{pathname:n?n.startsWith("/")?n:F0e(n,e):e,search:z0e(r),hash:H0e(i)}}function F0e(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function fC(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function cY(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function kO(t,e){let n=cY(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function PO(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=_u(t):(i=Mr({},t),Bn(!i.pathname||!i.pathname.includes("?"),fC("?","pathname","search",i)),Bn(!i.pathname||!i.pathname.includes("#"),fC("#","pathname","hash",i)),Bn(!i.search||!i.search.includes("#"),fC("#","search","hash",i)));let a=t===""||i.pathname==="",s=a?"/":i.pathname,o;if(s==null)o=n;else{let d=e.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}o=d>=0?e[d]:"/"}let l=B0e(i,o),u=s&&s!=="/"&&s.endsWith("/"),c=(a||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const lu=t=>t.join("/").replace(/\/\/+/g,"/"),U0e=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),z0e=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,H0e=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class FS{constructor(e,n,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function zx(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const dY=["post","put","patch","delete"],G0e=new Set(dY),V0e=["get",...dY],$0e=new Set(V0e),W0e=new Set([301,302,303,307,308]),j0e=new Set([307,308]),pC={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Y0e={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},bg={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},BO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,q0e=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),fY="remix-router-transitions";function X0e(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Bn(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let he=t.detectErrorBoundary;i=Se=>({hasErrorBoundary:he(Se)})}else i=q0e;let a={},s=BS(t.routes,i,void 0,a),o,l=t.basename||"/",u=t.dataStrategy||J0e,c=t.patchRoutesOnNavigation,d=Mr({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),f=null,m=new Set,g=null,y=null,v=null,b=t.hydrationData!=null,E=Cd(s,t.history.location,l),_=null;if(E==null&&!c){let he=Wa(404,{pathname:t.history.location.pathname}),{matches:Se,route:Oe}=dH(s);E=Se,_={[Oe.id]:he}}E&&!t.hydrationData&&mn(E,s,t.history.location.pathname).active&&(E=null);let A;if(E)if(E.some(he=>he.route.lazy))A=!1;else if(!E.some(he=>he.route.loader))A=!0;else if(d.v7_partialHydration){let he=t.hydrationData?t.hydrationData.loaderData:null,Se=t.hydrationData?t.hydrationData.errors:null;if(Se){let Oe=E.findIndex(Ze=>Se[Ze.route.id]!==void 0);A=E.slice(0,Oe+1).every(Ze=>!_M(Ze.route,he,Se))}else A=E.every(Oe=>!_M(Oe.route,he,Se))}else A=t.hydrationData!=null;else if(A=!1,E=[],d.v7_partialHydration){let he=mn(null,s,t.history.location.pathname);he.active&&he.matches&&(E=he.matches)}let I,x={historyAction:t.history.action,location:t.history.location,matches:E,initialized:A,navigation:pC,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||_,fetchers:new Map,blockers:new Map},R=ui.Pop,O=!1,N,M=!1,B=new Map,G=null,W=!1,K=!1,se=[],ae=new Set,ee=new Map,F=0,ie=-1,J=new Map,fe=new Set,Ce=new Map,Le=new Map,j=new Set,ke=new Map,Fe=new Map,Ye;function gt(){if(f=t.history.listen(he=>{let{action:Se,location:Oe,delta:Ze}=he;if(Ye){Ye(),Ye=void 0;return}pf(Fe.size===0||Ze!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ct=ge({currentLocation:x.location,nextLocation:Oe,historyAction:Se});if(Ct&&Ze!=null){let kt=new Promise(Kt=>{Ye=Kt});t.history.go(Ze*-1),rt(Ct,{state:"blocked",location:Oe,proceed(){rt(Ct,{state:"proceeding",proceed:void 0,reset:void 0,location:Oe}),kt.then(()=>t.history.go(Ze))},reset(){let Kt=new Map(x.blockers);Kt.set(Ct,bg),Mt({blockers:Kt})}});return}return At(Se,Oe)}),n){pbe(e,B);let he=()=>hbe(e,B);e.addEventListener("pagehide",he),G=()=>e.removeEventListener("pagehide",he)}return x.initialized||At(ui.Pop,x.location,{initialHydration:!0}),I}function Gt(){f&&f(),G&&G(),m.clear(),N&&N.abort(),x.fetchers.forEach((he,Se)=>tn(Se)),x.blockers.forEach((he,Se)=>De(Se))}function Ut(he){return m.add(he),()=>m.delete(he)}function Mt(he,Se){Se===void 0&&(Se={}),x=Mr({},x,he);let Oe=[],Ze=[];d.v7_fetcherPersist&&x.fetchers.forEach((Ct,kt)=>{Ct.state==="idle"&&(j.has(kt)?Ze.push(kt):Oe.push(kt))}),[...m].forEach(Ct=>Ct(x,{deletedFetchers:Ze,viewTransitionOpts:Se.viewTransitionOpts,flushSync:Se.flushSync===!0})),d.v7_fetcherPersist&&(Oe.forEach(Ct=>x.fetchers.delete(Ct)),Ze.forEach(Ct=>tn(Ct)))}function $e(he,Se,Oe){var Ze,Ct;let{flushSync:kt}=Oe===void 0?{}:Oe,Kt=x.actionData!=null&&x.navigation.formMethod!=null&&yo(x.navigation.formMethod)&&x.navigation.state==="loading"&&((Ze=he.state)==null?void 0:Ze._isRedirect)!==!0,et;Se.actionData?Object.keys(Se.actionData).length>0?et=Se.actionData:et=null:Kt?et=x.actionData:et=null;let Pt=Se.loaderData?uH(x.loaderData,Se.loaderData,Se.matches||[],Se.errors):x.loaderData,Rt=x.blockers;Rt.size>0&&(Rt=new Map(Rt),Rt.forEach((oe,xe)=>Rt.set(xe,bg)));let P=O===!0||x.navigation.formMethod!=null&&yo(x.navigation.formMethod)&&((Ct=he.state)==null?void 0:Ct._isRedirect)!==!0;o&&(s=o,o=void 0),W||R===ui.Pop||(R===ui.Push?t.history.push(he,he.state):R===ui.Replace&&t.history.replace(he,he.state));let z;if(R===ui.Pop){let oe=B.get(x.location.pathname);oe&&oe.has(he.pathname)?z={currentLocation:x.location,nextLocation:he}:B.has(he.pathname)&&(z={currentLocation:he,nextLocation:x.location})}else if(M){let oe=B.get(x.location.pathname);oe?oe.add(he.pathname):(oe=new Set([he.pathname]),B.set(x.location.pathname,oe)),z={currentLocation:x.location,nextLocation:he}}Mt(Mr({},Se,{actionData:et,loaderData:Pt,historyAction:R,location:he,initialized:!0,navigation:pC,revalidation:"idle",restoreScrollPosition:Xt(he,Se.matches||x.matches),preventScrollReset:P,blockers:Rt}),{viewTransitionOpts:z,flushSync:kt===!0}),R=ui.Pop,O=!1,M=!1,W=!1,K=!1,se=[]}async function qe(he,Se){if(typeof he=="number"){t.history.go(he);return}let Oe=EM(x.location,x.matches,l,d.v7_prependBasename,he,d.v7_relativeSplatPath,Se==null?void 0:Se.fromRouteId,Se==null?void 0:Se.relative),{path:Ze,submission:Ct,error:kt}=tH(d.v7_normalizeFormMethod,!1,Oe,Se),Kt=x.location,et=yb(x.location,Ze,Se&&Se.state);et=Mr({},et,t.history.encodeLocation(et));let Pt=Se&&Se.replace!=null?Se.replace:void 0,Rt=ui.Push;Pt===!0?Rt=ui.Replace:Pt===!1||Ct!=null&&yo(Ct.formMethod)&&Ct.formAction===x.location.pathname+x.location.search&&(Rt=ui.Replace);let P=Se&&"preventScrollReset"in Se?Se.preventScrollReset===!0:void 0,z=(Se&&Se.flushSync)===!0,oe=ge({currentLocation:Kt,nextLocation:et,historyAction:Rt});if(oe){rt(oe,{state:"blocked",location:et,proceed(){rt(oe,{state:"proceeding",proceed:void 0,reset:void 0,location:et}),qe(he,Se)},reset(){let xe=new Map(x.blockers);xe.set(oe,bg),Mt({blockers:xe})}});return}return await At(Rt,et,{submission:Ct,pendingError:kt,preventScrollReset:P,replace:Se&&Se.replace,enableViewTransition:Se&&Se.viewTransition,flushSync:z})}function re(){if(Pe(),Mt({revalidation:"loading"}),x.navigation.state!=="submitting"){if(x.navigation.state==="idle"){At(x.historyAction,x.location,{startUninterruptedRevalidation:!0});return}At(R||x.historyAction,x.navigation.location,{overrideNavigation:x.navigation,enableViewTransition:M===!0})}}async function At(he,Se,Oe){N&&N.abort(),N=null,R=he,W=(Oe&&Oe.startUninterruptedRevalidation)===!0,St(x.location,x.matches),O=(Oe&&Oe.preventScrollReset)===!0,M=(Oe&&Oe.enableViewTransition)===!0;let Ze=o||s,Ct=Oe&&Oe.overrideNavigation,kt=Cd(Ze,Se,l),Kt=(Oe&&Oe.flushSync)===!0,et=mn(kt,Ze,Se.pathname);if(et.active&&et.matches&&(kt=et.matches),!kt){let{error:Re,notFoundMatches:L,route:X}=Te(Se.pathname);$e(Se,{matches:L,loaderData:{},errors:{[X.id]:Re}},{flushSync:Kt});return}if(x.initialized&&!K&&abe(x.location,Se)&&!(Oe&&Oe.submission&&yo(Oe.submission.formMethod))){$e(Se,{matches:kt},{flushSync:Kt});return}N=new AbortController;let Pt=fp(t.history,Se,N.signal,Oe&&Oe.submission),Rt;if(Oe&&Oe.pendingError)Rt=[Rd(kt).route.id,{type:cr.error,error:Oe.pendingError}];else if(Oe&&Oe.submission&&yo(Oe.submission.formMethod)){let Re=await Je(Pt,Se,Oe.submission,kt,et.active,{replace:Oe.replace,flushSync:Kt});if(Re.shortCircuited)return;if(Re.pendingActionResult){let[L,X]=Re.pendingActionResult;if(ms(X)&&zx(X.error)&&X.error.status===404){N=null,$e(Se,{matches:Re.matches,loaderData:{},errors:{[L]:X.error}});return}}kt=Re.matches||kt,Rt=Re.pendingActionResult,Ct=hC(Se,Oe.submission),Kt=!1,et.active=!1,Pt=fp(t.history,Pt.url,Pt.signal)}let{shortCircuited:P,matches:z,loaderData:oe,errors:xe}=await xt(Pt,Se,kt,et.active,Ct,Oe&&Oe.submission,Oe&&Oe.fetcherSubmission,Oe&&Oe.replace,Oe&&Oe.initialHydration===!0,Kt,Rt);P||(N=null,$e(Se,Mr({matches:z||kt},cH(Rt),{loaderData:oe,errors:xe})))}async function Je(he,Se,Oe,Ze,Ct,kt){kt===void 0&&(kt={}),Pe();let Kt=dbe(Se,Oe);if(Mt({navigation:Kt},{flushSync:kt.flushSync===!0}),Ct){let Rt=await Hn(Ze,Se.pathname,he.signal);if(Rt.type==="aborted")return{shortCircuited:!0};if(Rt.type==="error"){let P=Rd(Rt.partialMatches).route.id;return{matches:Rt.partialMatches,pendingActionResult:[P,{type:cr.error,error:Rt.error}]}}else if(Rt.matches)Ze=Rt.matches;else{let{notFoundMatches:P,error:z,route:oe}=Te(Se.pathname);return{matches:P,pendingActionResult:[oe.id,{type:cr.error,error:z}]}}}let et,Pt=e0(Ze,Se);if(!Pt.route.action&&!Pt.route.lazy)et={type:cr.error,error:Wa(405,{method:he.method,pathname:Se.pathname,routeId:Pt.route.id})};else if(et=(await _e("action",x,he,[Pt],Ze,null))[Pt.route.id],he.signal.aborted)return{shortCircuited:!0};if(kd(et)){let Rt;return kt&&kt.replace!=null?Rt=kt.replace:Rt=sH(et.response.headers.get("Location"),new URL(he.url),l)===x.location.pathname+x.location.search,await ue(he,et,!0,{submission:Oe,replace:Rt}),{shortCircuited:!0}}if(ac(et))throw Wa(400,{type:"defer-action"});if(ms(et)){let Rt=Rd(Ze,Pt.route.id);return(kt&&kt.replace)!==!0&&(R=ui.Push),{matches:Ze,pendingActionResult:[Rt.route.id,et]}}return{matches:Ze,pendingActionResult:[Pt.route.id,et]}}async function xt(he,Se,Oe,Ze,Ct,kt,Kt,et,Pt,Rt,P){let z=Ct||hC(Se,kt),oe=kt||Kt||pH(z),xe=!W&&(!d.v7_partialHydration||!Pt);if(Ze){if(xe){let ct=ot(P);Mt(Mr({navigation:z},ct!==void 0?{actionData:ct}:{}),{flushSync:Rt})}let Ue=await Hn(Oe,Se.pathname,he.signal);if(Ue.type==="aborted")return{shortCircuited:!0};if(Ue.type==="error"){let ct=Rd(Ue.partialMatches).route.id;return{matches:Ue.partialMatches,loaderData:{},errors:{[ct]:Ue.error}}}else if(Ue.matches)Oe=Ue.matches;else{let{error:ct,notFoundMatches:Bt,route:wt}=Te(Se.pathname);return{matches:Bt,loaderData:{},errors:{[wt.id]:ct}}}}let Re=o||s,[L,X]=rH(t.history,x,Oe,oe,Se,d.v7_partialHydration&&Pt===!0,d.v7_skipActionErrorRevalidation,K,se,ae,j,Ce,fe,Re,l,P);if(Me(Ue=>!(Oe&&Oe.some(ct=>ct.route.id===Ue))||L&&L.some(ct=>ct.route.id===Ue)),ie=++F,L.length===0&&X.length===0){let Ue=Dt();return $e(Se,Mr({matches:Oe,loaderData:{},errors:P&&ms(P[1])?{[P[0]]:P[1].error}:null},cH(P),Ue?{fetchers:new Map(x.fetchers)}:{}),{flushSync:Rt}),{shortCircuited:!0}}if(xe){let Ue={};if(!Ze){Ue.navigation=z;let ct=ot(P);ct!==void 0&&(Ue.actionData=ct)}X.length>0&&(Ue.fetchers=Vt(X)),Mt(Ue,{flushSync:Rt})}X.forEach(Ue=>{Et(Ue.key),Ue.controller&&ee.set(Ue.key,Ue.controller)});let le=()=>X.forEach(Ue=>Et(Ue.key));N&&N.signal.addEventListener("abort",le);let{loaderResults:de,fetcherResults:Q}=await Ge(x,Oe,L,X,he);if(he.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",le),X.forEach(Ue=>ee.delete(Ue.key));let Ee=Jv(de);if(Ee)return await ue(he,Ee.result,!0,{replace:et}),{shortCircuited:!0};if(Ee=Jv(Q),Ee)return fe.add(Ee.key),await ue(he,Ee.result,!0,{replace:et}),{shortCircuited:!0};let{loaderData:we,errors:at}=lH(x,Oe,de,P,X,Q,ke);ke.forEach((Ue,ct)=>{Ue.subscribe(Bt=>{(Bt||Ue.done)&&ke.delete(ct)})}),d.v7_partialHydration&&Pt&&x.errors&&(at=Mr({},x.errors,at));let Ve=Dt(),Qe=bt(ie),lt=Ve||Qe||X.length>0;return Mr({matches:Oe,loaderData:we,errors:at},lt?{fetchers:new Map(x.fetchers)}:{})}function ot(he){if(he&&!ms(he[1]))return{[he[0]]:he[1].data};if(x.actionData)return Object.keys(x.actionData).length===0?null:x.actionData}function Vt(he){return he.forEach(Se=>{let Oe=x.fetchers.get(Se.key),Ze=yg(void 0,Oe?Oe.data:void 0);x.fetchers.set(Se.key,Ze)}),new Map(x.fetchers)}function yt(he,Se,Oe,Ze){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Et(he);let Ct=(Ze&&Ze.flushSync)===!0,kt=o||s,Kt=EM(x.location,x.matches,l,d.v7_prependBasename,Oe,d.v7_relativeSplatPath,Se,Ze==null?void 0:Ze.relative),et=Cd(kt,Kt,l),Pt=mn(et,kt,Kt);if(Pt.active&&Pt.matches&&(et=Pt.matches),!et){nt(he,Se,Wa(404,{pathname:Kt}),{flushSync:Ct});return}let{path:Rt,submission:P,error:z}=tH(d.v7_normalizeFormMethod,!0,Kt,Ze);if(z){nt(he,Se,z,{flushSync:Ct});return}let oe=e0(et,Rt),xe=(Ze&&Ze.preventScrollReset)===!0;if(P&&yo(P.formMethod)){q(he,Se,Rt,oe,et,Pt.active,Ct,xe,P);return}Ce.set(he,{routeId:Se,path:Rt}),U(he,Se,Rt,oe,et,Pt.active,Ct,xe,P)}async function q(he,Se,Oe,Ze,Ct,kt,Kt,et,Pt){Pe(),Ce.delete(he);function Rt(Tt){if(!Tt.route.action&&!Tt.route.lazy){let Nt=Wa(405,{method:Pt.formMethod,pathname:Oe,routeId:Se});return nt(he,Se,Nt,{flushSync:Kt}),!0}return!1}if(!kt&&Rt(Ze))return;let P=x.fetchers.get(he);ft(he,fbe(Pt,P),{flushSync:Kt});let z=new AbortController,oe=fp(t.history,Oe,z.signal,Pt);if(kt){let Tt=await Hn(Ct,Oe,oe.signal);if(Tt.type==="aborted")return;if(Tt.type==="error"){nt(he,Se,Tt.error,{flushSync:Kt});return}else if(Tt.matches){if(Ct=Tt.matches,Ze=e0(Ct,Oe),Rt(Ze))return}else{nt(he,Se,Wa(404,{pathname:Oe}),{flushSync:Kt});return}}ee.set(he,z);let xe=F,L=(await _e("action",x,oe,[Ze],Ct,he))[Ze.route.id];if(oe.signal.aborted){ee.get(he)===z&&ee.delete(he);return}if(d.v7_fetcherPersist&&j.has(he)){if(kd(L)||ms(L)){ft(he,Wu(void 0));return}}else{if(kd(L))if(ee.delete(he),ie>xe){ft(he,Wu(void 0));return}else return fe.add(he),ft(he,yg(Pt)),ue(oe,L,!1,{fetcherSubmission:Pt,preventScrollReset:et});if(ms(L)){nt(he,Se,L.error);return}}if(ac(L))throw Wa(400,{type:"defer-action"});let X=x.navigation.location||x.location,le=fp(t.history,X,z.signal),de=o||s,Q=x.navigation.state!=="idle"?Cd(de,x.navigation.location,l):x.matches;Bn(Q,"Didn't find any matches after fetcher action");let Ee=++F;J.set(he,Ee);let we=yg(Pt,L.data);x.fetchers.set(he,we);let[at,Ve]=rH(t.history,x,Q,Pt,X,!1,d.v7_skipActionErrorRevalidation,K,se,ae,j,Ce,fe,de,l,[Ze.route.id,L]);Ve.filter(Tt=>Tt.key!==he).forEach(Tt=>{let Nt=Tt.key,pt=x.fetchers.get(Nt),nn=yg(void 0,pt?pt.data:void 0);x.fetchers.set(Nt,nn),Et(Nt),Tt.controller&&ee.set(Nt,Tt.controller)}),Mt({fetchers:new Map(x.fetchers)});let Qe=()=>Ve.forEach(Tt=>Et(Tt.key));z.signal.addEventListener("abort",Qe);let{loaderResults:lt,fetcherResults:Ue}=await Ge(x,Q,at,Ve,le);if(z.signal.aborted)return;z.signal.removeEventListener("abort",Qe),J.delete(he),ee.delete(he),Ve.forEach(Tt=>ee.delete(Tt.key));let ct=Jv(lt);if(ct)return ue(le,ct.result,!1,{preventScrollReset:et});if(ct=Jv(Ue),ct)return fe.add(ct.key),ue(le,ct.result,!1,{preventScrollReset:et});let{loaderData:Bt,errors:wt}=lH(x,Q,lt,void 0,Ve,Ue,ke);if(x.fetchers.has(he)){let Tt=Wu(L.data);x.fetchers.set(he,Tt)}bt(Ee),x.navigation.state==="loading"&&Ee>ie?(Bn(R,"Expected pending action"),N&&N.abort(),$e(x.navigation.location,{matches:Q,loaderData:Bt,errors:wt,fetchers:new Map(x.fetchers)})):(Mt({errors:wt,loaderData:uH(x.loaderData,Bt,Q,wt),fetchers:new Map(x.fetchers)}),K=!1)}async function U(he,Se,Oe,Ze,Ct,kt,Kt,et,Pt){let Rt=x.fetchers.get(he);ft(he,yg(Pt,Rt?Rt.data:void 0),{flushSync:Kt});let P=new AbortController,z=fp(t.history,Oe,P.signal);if(kt){let L=await Hn(Ct,Oe,z.signal);if(L.type==="aborted")return;if(L.type==="error"){nt(he,Se,L.error,{flushSync:Kt});return}else if(L.matches)Ct=L.matches,Ze=e0(Ct,Oe);else{nt(he,Se,Wa(404,{pathname:Oe}),{flushSync:Kt});return}}ee.set(he,P);let oe=F,Re=(await _e("loader",x,z,[Ze],Ct,he))[Ze.route.id];if(ac(Re)&&(Re=await FO(Re,z.signal,!0)||Re),ee.get(he)===P&&ee.delete(he),!z.signal.aborted){if(j.has(he)){ft(he,Wu(void 0));return}if(kd(Re))if(ie>oe){ft(he,Wu(void 0));return}else{fe.add(he),await ue(z,Re,!1,{preventScrollReset:et});return}if(ms(Re)){nt(he,Se,Re.error);return}Bn(!ac(Re),"Unhandled fetcher deferred data"),ft(he,Wu(Re.data))}}async function ue(he,Se,Oe,Ze){let{submission:Ct,fetcherSubmission:kt,preventScrollReset:Kt,replace:et}=Ze===void 0?{}:Ze;Se.response.headers.has("X-Remix-Revalidate")&&(K=!0);let Pt=Se.response.headers.get("Location");Bn(Pt,"Expected a Location header on the redirect Response"),Pt=sH(Pt,new URL(he.url),l);let Rt=yb(x.location,Pt,{_isRedirect:!0});if(n){let L=!1;if(Se.response.headers.has("X-Remix-Reload-Document"))L=!0;else if(BO.test(Pt)){const X=t.history.createURL(Pt);L=X.origin!==e.location.origin||gm(X.pathname,l)==null}if(L){et?e.location.replace(Pt):e.location.assign(Pt);return}}N=null;let P=et===!0||Se.response.headers.has("X-Remix-Replace")?ui.Replace:ui.Push,{formMethod:z,formAction:oe,formEncType:xe}=x.navigation;!Ct&&!kt&&z&&oe&&xe&&(Ct=pH(x.navigation));let Re=Ct||kt;if(j0e.has(Se.response.status)&&Re&&yo(Re.formMethod))await At(P,Rt,{submission:Mr({},Re,{formAction:Pt}),preventScrollReset:Kt||O,enableViewTransition:Oe?M:void 0});else{let L=hC(Rt,Ct);await At(P,Rt,{overrideNavigation:L,fetcherSubmission:kt,preventScrollReset:Kt||O,enableViewTransition:Oe?M:void 0})}}async function _e(he,Se,Oe,Ze,Ct,kt){let Kt,et={};try{Kt=await ebe(u,he,Se,Oe,Ze,Ct,kt,a,i)}catch(Pt){return Ze.forEach(Rt=>{et[Rt.route.id]={type:cr.error,error:Pt}}),et}for(let[Pt,Rt]of Object.entries(Kt))if(sbe(Rt)){let P=Rt.result;et[Pt]={type:cr.redirect,response:rbe(P,Oe,Pt,Ct,l,d.v7_relativeSplatPath)}}else et[Pt]=await nbe(Rt);return et}async function Ge(he,Se,Oe,Ze,Ct){let kt=he.matches,Kt=_e("loader",he,Ct,Oe,Se,null),et=Promise.all(Ze.map(async P=>{if(P.matches&&P.match&&P.controller){let oe=(await _e("loader",he,fp(t.history,P.path,P.controller.signal),[P.match],P.matches,P.key))[P.match.route.id];return{[P.key]:oe}}else return Promise.resolve({[P.key]:{type:cr.error,error:Wa(404,{pathname:P.path})}})})),Pt=await Kt,Rt=(await et).reduce((P,z)=>Object.assign(P,z),{});return await Promise.all([ube(Se,Pt,Ct.signal,kt,he.loaderData),cbe(Se,Rt,Ze)]),{loaderResults:Pt,fetcherResults:Rt}}function Pe(){K=!0,se.push(...Me()),Ce.forEach((he,Se)=>{ee.has(Se)&&ae.add(Se),Et(Se)})}function ft(he,Se,Oe){Oe===void 0&&(Oe={}),x.fetchers.set(he,Se),Mt({fetchers:new Map(x.fetchers)},{flushSync:(Oe&&Oe.flushSync)===!0})}function nt(he,Se,Oe,Ze){Ze===void 0&&(Ze={});let Ct=Rd(x.matches,Se);tn(he),Mt({errors:{[Ct.route.id]:Oe},fetchers:new Map(x.fetchers)},{flushSync:(Ze&&Ze.flushSync)===!0})}function ht(he){return d.v7_fetcherPersist&&(Le.set(he,(Le.get(he)||0)+1),j.has(he)&&j.delete(he)),x.fetchers.get(he)||Y0e}function tn(he){let Se=x.fetchers.get(he);ee.has(he)&&!(Se&&Se.state==="loading"&&J.has(he))&&Et(he),Ce.delete(he),J.delete(he),fe.delete(he),j.delete(he),ae.delete(he),x.fetchers.delete(he)}function tt(he){if(d.v7_fetcherPersist){let Se=(Le.get(he)||0)-1;Se<=0?(Le.delete(he),j.add(he)):Le.set(he,Se)}else tn(he);Mt({fetchers:new Map(x.fetchers)})}function Et(he){let Se=ee.get(he);Se&&(Se.abort(),ee.delete(he))}function zt(he){for(let Se of he){let Oe=ht(Se),Ze=Wu(Oe.data);x.fetchers.set(Se,Ze)}}function Dt(){let he=[],Se=!1;for(let Oe of fe){let Ze=x.fetchers.get(Oe);Bn(Ze,"Expected fetcher: "+Oe),Ze.state==="loading"&&(fe.delete(Oe),he.push(Oe),Se=!0)}return zt(he),Se}function bt(he){let Se=[];for(let[Oe,Ze]of J)if(Ze0}function me(he,Se){let Oe=x.blockers.get(he)||bg;return Fe.get(he)!==Se&&Fe.set(he,Se),Oe}function De(he){x.blockers.delete(he),Fe.delete(he)}function rt(he,Se){let Oe=x.blockers.get(he)||bg;Bn(Oe.state==="unblocked"&&Se.state==="blocked"||Oe.state==="blocked"&&Se.state==="blocked"||Oe.state==="blocked"&&Se.state==="proceeding"||Oe.state==="blocked"&&Se.state==="unblocked"||Oe.state==="proceeding"&&Se.state==="unblocked","Invalid blocker state transition: "+Oe.state+" -> "+Se.state);let Ze=new Map(x.blockers);Ze.set(he,Se),Mt({blockers:Ze})}function ge(he){let{currentLocation:Se,nextLocation:Oe,historyAction:Ze}=he;if(Fe.size===0)return;Fe.size>1&&pf(!1,"A router only supports one blocker at a time");let Ct=Array.from(Fe.entries()),[kt,Kt]=Ct[Ct.length-1],et=x.blockers.get(kt);if(!(et&&et.state==="proceeding")&&Kt({currentLocation:Se,nextLocation:Oe,historyAction:Ze}))return kt}function Te(he){let Se=Wa(404,{pathname:he}),Oe=o||s,{matches:Ze,route:Ct}=dH(Oe);return Me(),{notFoundMatches:Ze,route:Ct,error:Se}}function Me(he){let Se=[];return ke.forEach((Oe,Ze)=>{(!he||he(Ze))&&(Oe.cancel(),Se.push(Ze),ke.delete(Ze))}),Se}function Xe(he,Se,Oe){if(g=he,v=Se,y=Oe||null,!b&&x.navigation===pC){b=!0;let Ze=Xt(x.location,x.matches);Ze!=null&&Mt({restoreScrollPosition:Ze})}return()=>{g=null,v=null,y=null}}function _t(he,Se){return y&&y(he,Se.map(Ze=>x0e(Ze,x.loaderData)))||he.key}function St(he,Se){if(g&&v){let Oe=_t(he,Se);g[Oe]=v()}}function Xt(he,Se){if(g){let Oe=_t(he,Se),Ze=g[Oe];if(typeof Ze=="number")return Ze}return null}function mn(he,Se,Oe){if(c)if(he){if(Object.keys(he[0].params).length>0)return{active:!0,matches:G_(Se,Oe,l,!0)}}else return{active:!0,matches:G_(Se,Oe,l,!0)||[]};return{active:!1,matches:null}}async function Hn(he,Se,Oe){if(!c)return{type:"success",matches:he};let Ze=he;for(;;){let Ct=o==null,kt=o||s,Kt=a;try{await c({path:Se,matches:Ze,patch:(Rt,P)=>{Oe.aborted||aH(Rt,P,kt,Kt,i)}})}catch(Rt){return{type:"error",error:Rt,partialMatches:Ze}}finally{Ct&&!Oe.aborted&&(s=[...s])}if(Oe.aborted)return{type:"aborted"};let et=Cd(kt,Se,l);if(et)return{type:"success",matches:et};let Pt=G_(kt,Se,l,!0);if(!Pt||Ze.length===Pt.length&&Ze.every((Rt,P)=>Rt.route.id===Pt[P].route.id))return{type:"success",matches:null};Ze=Pt}}function pn(he){a={},o=BS(he,i,void 0,a)}function Gn(he,Se){let Oe=o==null;aH(he,Se,o||s,a,i),Oe&&(s=[...s],Mt({}))}return I={get basename(){return l},get future(){return d},get state(){return x},get routes(){return s},get window(){return e},initialize:gt,subscribe:Ut,enableScrollRestoration:Xe,navigate:qe,fetch:yt,revalidate:re,createHref:he=>t.history.createHref(he),encodeLocation:he=>t.history.encodeLocation(he),getFetcher:ht,deleteFetcher:tt,dispose:Gt,getBlocker:me,deleteBlocker:De,patchRoutes:Gn,_internalFetchControllers:ee,_internalActiveDeferreds:ke,_internalSetRoutes:pn},I}function K0e(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function EM(t,e,n,r,i,a,s,o){let l,u;if(s){l=[];for(let d of e)if(l.push(d),d.route.id===s){u=d;break}}else l=e,u=e[e.length-1];let c=PO(i||".",kO(l,a),gm(t.pathname,n)||t.pathname,o==="path");if(i==null&&(c.search=t.search,c.hash=t.hash),(i==null||i===""||i===".")&&u){let d=UO(c.search);if(u.route.index&&!d)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&d){let f=new URLSearchParams(c.search),m=f.getAll("index");f.delete("index"),m.filter(y=>y).forEach(y=>f.append("index",y));let g=f.toString();c.search=g?"?"+g:""}}return r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:lu([n,c.pathname])),hf(c)}function tH(t,e,n,r){if(!r||!K0e(r))return{path:n};if(r.formMethod&&!lbe(r.formMethod))return{path:n,error:Wa(405,{method:r.formMethod})};let i=()=>({path:n,error:Wa(400,{type:"invalid-body"})}),a=r.formMethod||"get",s=t?a.toUpperCase():a.toLowerCase(),o=mY(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!yo(s))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,g)=>{let[y,v]=g;return""+m+y+"="+v+` +`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!yo(s))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:o,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}Bn(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=SM(r.formData),u=r.formData;else if(r.body instanceof FormData)l=SM(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=oH(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=oH(l)}catch{return i()}let c={formMethod:s,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(yo(c.formMethod))return{path:n,submission:c};let d=_u(n);return e&&d.search&&UO(d.search)&&l.append("index",""),d.search="?"+l,{path:hf(d),submission:c}}function nH(t,e,n){n===void 0&&(n=!1);let r=t.findIndex(i=>i.route.id===e);return r>=0?t.slice(0,n?r+1:r):t}function rH(t,e,n,r,i,a,s,o,l,u,c,d,f,m,g,y){let v=y?ms(y[1])?y[1].error:y[1].data:void 0,b=t.createURL(e.location),E=t.createURL(i),_=n;a&&e.errors?_=nH(n,Object.keys(e.errors)[0],!0):y&&ms(y[1])&&(_=nH(n,y[0]));let A=y?y[1].statusCode:void 0,I=s&&A&&A>=400,x=_.filter((O,N)=>{let{route:M}=O;if(M.lazy)return!0;if(M.loader==null)return!1;if(a)return _M(M,e.loaderData,e.errors);if(Z0e(e.loaderData,e.matches[N],O)||l.some(W=>W===O.route.id))return!0;let B=e.matches[N],G=O;return iH(O,Mr({currentUrl:b,currentParams:B.params,nextUrl:E,nextParams:G.params},r,{actionResult:v,actionStatus:A,defaultShouldRevalidate:I?!1:o||b.pathname+b.search===E.pathname+E.search||b.search!==E.search||pY(B,G)}))}),R=[];return d.forEach((O,N)=>{if(a||!n.some(K=>K.route.id===O.routeId)||c.has(N))return;let M=Cd(m,O.path,g);if(!M){R.push({key:N,routeId:O.routeId,path:O.path,matches:null,match:null,controller:null});return}let B=e.fetchers.get(N),G=e0(M,O.path),W=!1;f.has(N)?W=!1:u.has(N)?(u.delete(N),W=!0):B&&B.state!=="idle"&&B.data===void 0?W=o:W=iH(G,Mr({currentUrl:b,currentParams:e.matches[e.matches.length-1].params,nextUrl:E,nextParams:n[n.length-1].params},r,{actionResult:v,actionStatus:A,defaultShouldRevalidate:I?!1:o})),W&&R.push({key:N,routeId:O.routeId,path:O.path,matches:M,match:G,controller:new AbortController})}),[x,R]}function _M(t,e,n){if(t.lazy)return!0;if(!t.loader)return!1;let r=e!=null&&e[t.id]!==void 0,i=n!=null&&n[t.id]!==void 0;return!r&&i?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!r&&!i}function Z0e(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function pY(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function iH(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function aH(t,e,n,r,i){var a;let s;if(t){let u=r[t];Bn(u,"No route found to patch children into: routeId = "+t),u.children||(u.children=[]),s=u.children}else s=n;let o=e.filter(u=>!s.some(c=>hY(u,c))),l=BS(o,i,[t||"_","patch",String(((a=s)==null?void 0:a.length)||"0")],r);s.push(...l)}function hY(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,r)=>{var i;return(i=e.children)==null?void 0:i.some(a=>hY(n,a))}):!1}async function Q0e(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let i=n[t.id];Bn(i,"No route found in manifest");let a={};for(let s in r){let l=i[s]!==void 0&&s!=="hasErrorBoundary";pf(!l,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!S0e.has(s)&&(a[s]=r[s])}Object.assign(i,a),Object.assign(i,Mr({},e(i),{lazy:void 0}))}async function J0e(t){let{matches:e}=t,n=e.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,a,s)=>Object.assign(i,{[n[s].route.id]:a}),{})}async function ebe(t,e,n,r,i,a,s,o,l,u){let c=a.map(m=>m.route.lazy?Q0e(m.route,l,o):void 0),d=a.map((m,g)=>{let y=c[g],v=i.some(E=>E.route.id===m.route.id);return Mr({},m,{shouldLoad:v,resolve:async E=>(E&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(v=!0),v?tbe(e,r,m,y,E,u):Promise.resolve({type:cr.data,result:void 0}))})}),f=await t({matches:d,request:r,params:a[0].params,fetcherKey:s,context:u});try{await Promise.all(c)}catch{}return f}async function tbe(t,e,n,r,i,a){let s,o,l=u=>{let c,d=new Promise((g,y)=>c=y);o=()=>c(),e.signal.addEventListener("abort",o);let f=g=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+n.route.id+"]"))):u({request:e,params:n.params,context:a},...g!==void 0?[g]:[]),m=(async()=>{try{return{type:"data",result:await(i?i(y=>f(y)):f())}}catch(g){return{type:"error",result:g}}})();return Promise.race([m,d])};try{let u=n.route[t];if(r)if(u){let c,[d]=await Promise.all([l(u).catch(f=>{c=f}),r]);if(c!==void 0)throw c;s=d}else if(await r,u=n.route[t],u)s=await l(u);else if(t==="action"){let c=new URL(e.url),d=c.pathname+c.search;throw Wa(405,{method:e.method,pathname:d,routeId:n.route.id})}else return{type:cr.data,result:void 0};else if(u)s=await l(u);else{let c=new URL(e.url),d=c.pathname+c.search;throw Wa(404,{pathname:d})}Bn(s.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:cr.error,result:u}}finally{o&&e.signal.removeEventListener("abort",o)}return s}async function nbe(t){let{result:e,type:n}=t;if(gY(e)){let u;try{let c=e.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?e.body==null?u=null:u=await e.json():u=await e.text()}catch(c){return{type:cr.error,error:c}}return n===cr.error?{type:cr.error,error:new FS(e.status,e.statusText,u),statusCode:e.status,headers:e.headers}:{type:cr.data,data:u,statusCode:e.status,headers:e.headers}}if(n===cr.error){if(fH(e)){var r;if(e.data instanceof Error){var i;return{type:cr.error,error:e.data,statusCode:(i=e.init)==null?void 0:i.status}}e=new FS(((r=e.init)==null?void 0:r.status)||500,void 0,e.data)}return{type:cr.error,error:e,statusCode:zx(e)?e.status:void 0}}if(obe(e)){var a,s;return{type:cr.deferred,deferredData:e,statusCode:(a=e.init)==null?void 0:a.status,headers:((s=e.init)==null?void 0:s.headers)&&new Headers(e.init.headers)}}if(fH(e)){var o,l;return{type:cr.data,data:e.data,statusCode:(o=e.init)==null?void 0:o.status,headers:(l=e.init)!=null&&l.headers?new Headers(e.init.headers):void 0}}return{type:cr.data,data:e}}function rbe(t,e,n,r,i,a){let s=t.headers.get("Location");if(Bn(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!BO.test(s)){let o=r.slice(0,r.findIndex(l=>l.route.id===n)+1);s=EM(new URL(e.url),o,i,!0,s,a),t.headers.set("Location",s)}return t}function sH(t,e,n){if(BO.test(t)){let r=t,i=r.startsWith("//")?new URL(e.protocol+r):new URL(r),a=gm(i.pathname,n)!=null;if(i.origin===e.origin&&a)return i.pathname+i.search+i.hash}return t}function fp(t,e,n,r){let i=t.createURL(mY(e)).toString(),a={signal:n};if(r&&yo(r.formMethod)){let{formMethod:s,formEncType:o}=r;a.method=s.toUpperCase(),o==="application/json"?(a.headers=new Headers({"Content-Type":o}),a.body=JSON.stringify(r.json)):o==="text/plain"?a.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?a.body=SM(r.formData):a.body=r.formData}return new Request(i,a)}function SM(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function oH(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function ibe(t,e,n,r,i){let a={},s=null,o,l=!1,u={},c=n&&ms(n[1])?n[1].error:void 0;return t.forEach(d=>{if(!(d.route.id in e))return;let f=d.route.id,m=e[f];if(Bn(!kd(m),"Cannot handle redirect results in processLoaderData"),ms(m)){let g=m.error;c!==void 0&&(g=c,c=void 0),s=s||{};{let y=Rd(t,f);s[y.route.id]==null&&(s[y.route.id]=g)}a[f]=void 0,l||(l=!0,o=zx(m.error)?m.error.status:500),m.headers&&(u[f]=m.headers)}else ac(m)?(r.set(f,m.deferredData),a[f]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!l&&(o=m.statusCode),m.headers&&(u[f]=m.headers)):(a[f]=m.data,m.statusCode&&m.statusCode!==200&&!l&&(o=m.statusCode),m.headers&&(u[f]=m.headers))}),c!==void 0&&n&&(s={[n[0]]:c},a[n[0]]=void 0),{loaderData:a,errors:s,statusCode:o||200,loaderHeaders:u}}function lH(t,e,n,r,i,a,s){let{loaderData:o,errors:l}=ibe(e,n,r,s);return i.forEach(u=>{let{key:c,match:d,controller:f}=u,m=a[c];if(Bn(m,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(ms(m)){let g=Rd(t.matches,d==null?void 0:d.route.id);l&&l[g.route.id]||(l=Mr({},l,{[g.route.id]:m.error})),t.fetchers.delete(c)}else if(kd(m))Bn(!1,"Unhandled fetcher revalidation redirect");else if(ac(m))Bn(!1,"Unhandled fetcher deferred data");else{let g=Wu(m.data);t.fetchers.set(c,g)}}),{loaderData:o,errors:l}}function uH(t,e,n,r){let i=Mr({},e);for(let a of n){let s=a.route.id;if(e.hasOwnProperty(s)?e[s]!==void 0&&(i[s]=e[s]):t[s]!==void 0&&a.route.loader&&(i[s]=t[s]),r&&r.hasOwnProperty(s))break}return i}function cH(t){return t?ms(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Rd(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function dH(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Wa(t,e){let{pathname:n,routeId:r,method:i,type:a,message:s}=e===void 0?{}:e,o="Unknown Server Error",l="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":a==="defer-action"?l="defer() is not supported in actions":a==="invalid-body"&&(l="Unable to encode submission body")):t===403?(o="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):t===404?(o="Not Found",l='No route matches URL "'+n+'"'):t===405&&(o="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new FS(t||500,o,new Error(l),!0)}function Jv(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,i]=e[n];if(kd(i))return{key:r,result:i}}}function mY(t){let e=typeof t=="string"?_u(t):t;return hf(Mr({},e,{hash:""}))}function abe(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function sbe(t){return gY(t.result)&&W0e.has(t.result.status)}function ac(t){return t.type===cr.deferred}function ms(t){return t.type===cr.error}function kd(t){return(t&&t.type)===cr.redirect}function fH(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function obe(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function gY(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function lbe(t){return $0e.has(t.toLowerCase())}function yo(t){return G0e.has(t.toLowerCase())}async function ube(t,e,n,r,i){let a=Object.entries(e);for(let s=0;s(f==null?void 0:f.route.id)===o);if(!u)continue;let c=r.find(f=>f.route.id===u.route.id),d=c!=null&&!pY(c,u)&&(i&&i[u.route.id])!==void 0;ac(l)&&d&&await FO(l,n,!1).then(f=>{f&&(e[o]=f)})}}async function cbe(t,e,n){for(let r=0;r(u==null?void 0:u.route.id)===a)&&ac(o)&&(Bn(s,"Expected an AbortController for revalidating fetcher deferred result"),await FO(o,s.signal,!0).then(u=>{u&&(e[i]=u)}))}}async function FO(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:cr.data,data:t.deferredData.unwrappedData}}catch(i){return{type:cr.error,error:i}}return{type:cr.data,data:t.deferredData.data}}}function UO(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function e0(t,e){let n=typeof e=="string"?_u(e).search:e.search;if(t[t.length-1].route.index&&UO(n||""))return t[t.length-1];let r=cY(t);return r[r.length-1]}function pH(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:a,json:s}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:e,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(s!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function hC(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function dbe(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function yg(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function fbe(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Wu(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function pbe(t,e){try{let n=t.sessionStorage.getItem(fY);if(n){let r=JSON.parse(n);for(let[i,a]of Object.entries(r||{}))a&&Array.isArray(a)&&e.set(i,new Set(a||[]))}}catch{}}function hbe(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(fY,JSON.stringify(n))}catch(r){pf(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** * React Router v6.27.0 * * Copyright (c) Remix Software Inc. @@ -364,7 +364,7 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function U_(){return U_=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),w.useCallback(function(u,c){if(c===void 0&&(c={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let d=PO(u,JSON.parse(s),a,c.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:lu([e,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[e,r,s,a,t])}const SY=w.createContext(null);function bbe(){return w.useContext(SY)}function ybe(t){let e=w.useContext(Pc).outlet;return e&&w.createElement(SY.Provider,{value:t},e)}function _Y(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=w.useContext(Nf),{matches:i}=w.useContext(Pc),{pathname:a}=bm(),s=JSON.stringify(kO(i,r.v7_relativeSplatPath));return w.useMemo(()=>PO(t,JSON.parse(s),a,n==="path"),[t,s,a,n])}function vbe(t,e,n,r){Kb()||Bn(!1);let{navigator:i}=w.useContext(Nf),{matches:a}=w.useContext(Pc),s=a[a.length-1],o=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=bm(),c;c=u;let d=c.pathname||"/",f=d;if(l!=="/"){let y=l.replace(/^\//,"").split("/");f="/"+d.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=Cd(t,{pathname:f});return Tbe(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},o,y.params),pathname:lu([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:lu([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r)}function Ebe(){let t=Rbe(),e=zT(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},e),n?w.createElement("pre",{style:i},n):null,null)}const Sbe=w.createElement(Ebe,null);class _be extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?w.createElement(Pc.Provider,{value:this.props.routeContext},w.createElement(yY.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Abe(t){let{routeContext:e,match:n,children:r}=t,i=w.useContext(HT);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(Pc.Provider,{value:e},r)}function Tbe(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var a;if(!n)return null;if(n.errors)t=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,o=(i=n)==null?void 0:i.errors;if(o!=null){let c=s.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);c>=0||Bn(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,d,f)=>{let m,g=!1,y=null,v=null;n&&(m=o&&d.route.id?o[d.route.id]:void 0,y=d.route.errorElement||Sbe,l&&(u<0&&f===0?(Mbe("route-fallback"),g=!0,v=null):u===f&&(g=!0,v=d.route.hydrateFallbackElement||null)));let b=e.concat(s.slice(0,f+1)),E=()=>{let S;return m?S=y:g?S=v:d.route.Component?S=w.createElement(d.route.Component,null):d.route.element?S=d.route.element:S=c,w.createElement(Abe,{match:d,routeContext:{outlet:c,matches:b,isDataRoute:n!=null},children:S})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?w.createElement(_be,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:E(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):E()},null)}var AY=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(AY||{}),z_=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(z_||{});function xbe(t){let e=w.useContext(HT);return e||Bn(!1),e}function wbe(t){let e=w.useContext(bY);return e||Bn(!1),e}function Cbe(t){let e=w.useContext(Pc);return e||Bn(!1),e}function TY(t){let e=Cbe(),n=e.matches[e.matches.length-1];return n.route.id||Bn(!1),n.route.id}function Rbe(){var t;let e=w.useContext(yY),n=wbe(z_.UseRouteError),r=TY(z_.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function Ibe(){let{router:t}=xbe(AY.UseNavigateStable),e=TY(z_.UseNavigateStable),n=w.useRef(!1);return vY(()=>{n.current=!0}),w.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,U_({fromRouteId:e},a)))},[t,e])}const hH={};function Mbe(t,e,n){hH[t]||(hH[t]=!0)}function Nbe(t){return ybe(t.context)}function Obe(t){let{basename:e="/",children:n=null,location:r,navigationType:i=ui.Pop,navigator:a,static:s=!1,future:o}=t;Kb()&&Bn(!1);let l=e.replace(/^\/*/,"/"),u=w.useMemo(()=>({basename:l,navigator:a,static:s,future:U_({v7_relativeSplatPath:!1},o)}),[l,o,a,s]);typeof r=="string"&&(r=Su(r));let{pathname:c="/",search:d="",hash:f="",state:m=null,key:g="default"}=r,y=w.useMemo(()=>{let v=gm(c,l);return v==null?null:{location:{pathname:v,search:d,hash:f,state:m,key:g},navigationType:i}},[l,c,d,f,m,g,i]);return y==null?null:w.createElement(Nf.Provider,{value:u},w.createElement(zO.Provider,{children:n,value:y}))}new Promise(()=>{});function Dbe(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:w.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:w.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:w.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** + */function US(){return US=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),w.useCallback(function(u,c){if(c===void 0&&(c={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let d=PO(u,JSON.parse(s),a,c.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:lu([e,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[e,r,s,a,t])}const _Y=w.createContext(null);function bbe(){return w.useContext(_Y)}function ybe(t){let e=w.useContext(Pc).outlet;return e&&w.createElement(_Y.Provider,{value:t},e)}function SY(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=w.useContext(Nf),{matches:i}=w.useContext(Pc),{pathname:a}=bm(),s=JSON.stringify(kO(i,r.v7_relativeSplatPath));return w.useMemo(()=>PO(t,JSON.parse(s),a,n==="path"),[t,s,a,n])}function vbe(t,e,n,r){Kb()||Bn(!1);let{navigator:i}=w.useContext(Nf),{matches:a}=w.useContext(Pc),s=a[a.length-1],o=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=bm(),c;c=u;let d=c.pathname||"/",f=d;if(l!=="/"){let y=l.replace(/^\//,"").split("/");f="/"+d.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=Cd(t,{pathname:f});return xbe(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},o,y.params),pathname:lu([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:lu([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r)}function Ebe(){let t=Rbe(),e=zx(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},e),n?w.createElement("pre",{style:i},n):null,null)}const _be=w.createElement(Ebe,null);class Sbe extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?w.createElement(Pc.Provider,{value:this.props.routeContext},w.createElement(yY.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Abe(t){let{routeContext:e,match:n,children:r}=t,i=w.useContext(Hx);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(Pc.Provider,{value:e},r)}function xbe(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var a;if(!n)return null;if(n.errors)t=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,o=(i=n)==null?void 0:i.errors;if(o!=null){let c=s.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);c>=0||Bn(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,d,f)=>{let m,g=!1,y=null,v=null;n&&(m=o&&d.route.id?o[d.route.id]:void 0,y=d.route.errorElement||_be,l&&(u<0&&f===0?(Mbe("route-fallback"),g=!0,v=null):u===f&&(g=!0,v=d.route.hydrateFallbackElement||null)));let b=e.concat(s.slice(0,f+1)),E=()=>{let _;return m?_=y:g?_=v:d.route.Component?_=w.createElement(d.route.Component,null):d.route.element?_=d.route.element:_=c,w.createElement(Abe,{match:d,routeContext:{outlet:c,matches:b,isDataRoute:n!=null},children:_})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?w.createElement(Sbe,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:E(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):E()},null)}var AY=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(AY||{}),zS=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(zS||{});function Tbe(t){let e=w.useContext(Hx);return e||Bn(!1),e}function wbe(t){let e=w.useContext(bY);return e||Bn(!1),e}function Cbe(t){let e=w.useContext(Pc);return e||Bn(!1),e}function xY(t){let e=Cbe(),n=e.matches[e.matches.length-1];return n.route.id||Bn(!1),n.route.id}function Rbe(){var t;let e=w.useContext(yY),n=wbe(zS.UseRouteError),r=xY(zS.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function Ibe(){let{router:t}=Tbe(AY.UseNavigateStable),e=xY(zS.UseNavigateStable),n=w.useRef(!1);return vY(()=>{n.current=!0}),w.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,US({fromRouteId:e},a)))},[t,e])}const hH={};function Mbe(t,e,n){hH[t]||(hH[t]=!0)}function Nbe(t){return ybe(t.context)}function Obe(t){let{basename:e="/",children:n=null,location:r,navigationType:i=ui.Pop,navigator:a,static:s=!1,future:o}=t;Kb()&&Bn(!1);let l=e.replace(/^\/*/,"/"),u=w.useMemo(()=>({basename:l,navigator:a,static:s,future:US({v7_relativeSplatPath:!1},o)}),[l,o,a,s]);typeof r=="string"&&(r=_u(r));let{pathname:c="/",search:d="",hash:f="",state:m=null,key:g="default"}=r,y=w.useMemo(()=>{let v=gm(c,l);return v==null?null:{location:{pathname:v,search:d,hash:f,state:m,key:g},navigationType:i}},[l,c,d,f,m,g,i]);return y==null?null:w.createElement(Nf.Provider,{value:u},w.createElement(zO.Provider,{children:n,value:y}))}new Promise(()=>{});function Dbe(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:w.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:w.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:w.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** * React Router DOM v6.27.0 * * Copyright (c) Remix Software Inc. @@ -373,15 +373,15 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function vb(){return vb=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function kbe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Pbe(t,e){return t.button===0&&(!e||e==="_self")&&!kbe(t)}const Bbe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Fbe="6";try{window.__reactRouterVersion=Fbe}catch{}function Ube(t,e){return X0e({basename:void 0,future:vb({},void 0,{v7_prependBasename:!0}),history:v0e({window:void 0}),hydrationData:zbe(),routes:t,mapRouteProperties:Dbe,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function zbe(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=vb({},e,{errors:Hbe(e.errors)})),e}function Hbe(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,i]of e)if(i&&i.__type==="RouteErrorResponse")n[r]=new F_(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let a=window[i.__subType];if(typeof a=="function")try{let s=new a(i.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let a=new Error(i.message);a.stack="",n[r]=a}}else n[r]=i;return n}const Gbe=w.createContext({isTransitioning:!1}),Vbe=w.createContext(new Map),$be="startTransition",mH=QS[$be],Wbe="flushSync",gH=xge[Wbe];function jbe(t){mH?mH(t):t()}function vg(t){gH?gH(t):t()}class Ybe{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function qbe(t){let{fallbackElement:e,router:n,future:r}=t,[i,a]=w.useState(n.state),[s,o]=w.useState(),[l,u]=w.useState({isTransitioning:!1}),[c,d]=w.useState(),[f,m]=w.useState(),[g,y]=w.useState(),v=w.useRef(new Map),{v7_startTransition:b}=r||{},E=w.useCallback(O=>{b?jbe(O):O()},[b]),S=w.useCallback((O,N)=>{let{deletedFetchers:M,flushSync:B,viewTransitionOpts:G}=N;M.forEach(K=>v.current.delete(K)),O.fetchers.forEach((K,se)=>{K.data!==void 0&&v.current.set(se,K.data)});let W=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!G||W){B?vg(()=>a(O)):E(()=>a(O));return}if(B){vg(()=>{f&&(c&&c.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let K=n.window.document.startViewTransition(()=>{vg(()=>a(O))});K.finished.finally(()=>{vg(()=>{d(void 0),m(void 0),o(void 0),u({isTransitioning:!1})})}),vg(()=>m(K));return}f?(c&&c.resolve(),f.skipTransition(),y({state:O,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(o(O),u({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[n.window,f,c,v,E]);w.useLayoutEffect(()=>n.subscribe(S),[n,S]),w.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new Ybe)},[l]),w.useEffect(()=>{if(c&&s&&n.window){let O=s,N=c.promise,M=n.window.document.startViewTransition(async()=>{E(()=>a(O)),await N});M.finished.finally(()=>{d(void 0),m(void 0),o(void 0),u({isTransitioning:!1})}),m(M)}},[E,s,c,n.window]),w.useEffect(()=>{c&&s&&i.location.key===s.location.key&&c.resolve()},[c,f,i.location,s]),w.useEffect(()=>{!l.isTransitioning&&g&&(o(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),y(void 0))},[l.isTransitioning,g]),w.useEffect(()=>{},[]);let A=w.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:O=>n.navigate(O),push:(O,N,M)=>n.navigate(O,{state:N,preventScrollReset:M==null?void 0:M.preventScrollReset}),replace:(O,N,M)=>n.navigate(O,{replace:!0,state:N,preventScrollReset:M==null?void 0:M.preventScrollReset})}),[n]),I=n.basename||"/",T=w.useMemo(()=>({router:n,navigator:A,static:!1,basename:I}),[n,A,I]),R=w.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return w.createElement(w.Fragment,null,w.createElement(HT.Provider,{value:T},w.createElement(bY.Provider,{value:i},w.createElement(Vbe.Provider,{value:v.current},w.createElement(Gbe.Provider,{value:l},w.createElement(Obe,{basename:I,location:i.location,navigationType:i.historyAction,navigator:A,future:R},i.initialized||n.future.v7_partialHydration?w.createElement(Xbe,{routes:n.routes,future:n.future,state:i}):e))))),null)}const Xbe=w.memo(Kbe);function Kbe(t){let{routes:e,future:n,state:r}=t;return vbe(e,void 0,r,n)}const Zbe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Qbe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jbe=w.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:a,replace:s,state:o,target:l,to:u,preventScrollReset:c,viewTransition:d}=e,f=Lbe(e,Bbe),{basename:m}=w.useContext(Nf),g,y=!1;if(typeof u=="string"&&Qbe.test(u)&&(g=u,Zbe))try{let S=new URL(window.location.href),A=u.startsWith("//")?new URL(S.protocol+u):new URL(u),I=gm(A.pathname,m);A.origin===S.origin&&I!=null?u=I+A.search+A.hash:y=!0}catch{}let v=mbe(u,{relative:i}),b=eye(u,{replace:s,state:o,target:l,preventScrollReset:c,relative:i,viewTransition:d});function E(S){r&&r(S),S.defaultPrevented||b(S)}return w.createElement("a",vb({},f,{href:g||v,onClick:y||a?r:E,ref:n,target:l}))});var bH;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(bH||(bH={}));var yH;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(yH||(yH={}));function eye(t,e){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,viewTransition:o}=e===void 0?{}:e,l=EY(),u=bm(),c=_Y(t,{relative:s});return w.useCallback(d=>{if(Pbe(d,n)){d.preventDefault();let f=r!==void 0?r:hf(u)===hf(c);l(t,{replace:f,state:i,preventScrollReset:a,relative:s,viewTransition:o})}},[u,l,c,r,i,n,t,a,s,o])}/** + */function vb(){return vb=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function kbe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Pbe(t,e){return t.button===0&&(!e||e==="_self")&&!kbe(t)}const Bbe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Fbe="6";try{window.__reactRouterVersion=Fbe}catch{}function Ube(t,e){return X0e({basename:void 0,future:vb({},void 0,{v7_prependBasename:!0}),history:v0e({window:void 0}),hydrationData:zbe(),routes:t,mapRouteProperties:Dbe,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function zbe(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=vb({},e,{errors:Hbe(e.errors)})),e}function Hbe(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,i]of e)if(i&&i.__type==="RouteErrorResponse")n[r]=new FS(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let a=window[i.__subType];if(typeof a=="function")try{let s=new a(i.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let a=new Error(i.message);a.stack="",n[r]=a}}else n[r]=i;return n}const Gbe=w.createContext({isTransitioning:!1}),Vbe=w.createContext(new Map),$be="startTransition",mH=Q_[$be],Wbe="flushSync",gH=Tge[Wbe];function jbe(t){mH?mH(t):t()}function vg(t){gH?gH(t):t()}class Ybe{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function qbe(t){let{fallbackElement:e,router:n,future:r}=t,[i,a]=w.useState(n.state),[s,o]=w.useState(),[l,u]=w.useState({isTransitioning:!1}),[c,d]=w.useState(),[f,m]=w.useState(),[g,y]=w.useState(),v=w.useRef(new Map),{v7_startTransition:b}=r||{},E=w.useCallback(O=>{b?jbe(O):O()},[b]),_=w.useCallback((O,N)=>{let{deletedFetchers:M,flushSync:B,viewTransitionOpts:G}=N;M.forEach(K=>v.current.delete(K)),O.fetchers.forEach((K,se)=>{K.data!==void 0&&v.current.set(se,K.data)});let W=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!G||W){B?vg(()=>a(O)):E(()=>a(O));return}if(B){vg(()=>{f&&(c&&c.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let K=n.window.document.startViewTransition(()=>{vg(()=>a(O))});K.finished.finally(()=>{vg(()=>{d(void 0),m(void 0),o(void 0),u({isTransitioning:!1})})}),vg(()=>m(K));return}f?(c&&c.resolve(),f.skipTransition(),y({state:O,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(o(O),u({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[n.window,f,c,v,E]);w.useLayoutEffect(()=>n.subscribe(_),[n,_]),w.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new Ybe)},[l]),w.useEffect(()=>{if(c&&s&&n.window){let O=s,N=c.promise,M=n.window.document.startViewTransition(async()=>{E(()=>a(O)),await N});M.finished.finally(()=>{d(void 0),m(void 0),o(void 0),u({isTransitioning:!1})}),m(M)}},[E,s,c,n.window]),w.useEffect(()=>{c&&s&&i.location.key===s.location.key&&c.resolve()},[c,f,i.location,s]),w.useEffect(()=>{!l.isTransitioning&&g&&(o(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),y(void 0))},[l.isTransitioning,g]),w.useEffect(()=>{},[]);let A=w.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:O=>n.navigate(O),push:(O,N,M)=>n.navigate(O,{state:N,preventScrollReset:M==null?void 0:M.preventScrollReset}),replace:(O,N,M)=>n.navigate(O,{replace:!0,state:N,preventScrollReset:M==null?void 0:M.preventScrollReset})}),[n]),I=n.basename||"/",x=w.useMemo(()=>({router:n,navigator:A,static:!1,basename:I}),[n,A,I]),R=w.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return w.createElement(w.Fragment,null,w.createElement(Hx.Provider,{value:x},w.createElement(bY.Provider,{value:i},w.createElement(Vbe.Provider,{value:v.current},w.createElement(Gbe.Provider,{value:l},w.createElement(Obe,{basename:I,location:i.location,navigationType:i.historyAction,navigator:A,future:R},i.initialized||n.future.v7_partialHydration?w.createElement(Xbe,{routes:n.routes,future:n.future,state:i}):e))))),null)}const Xbe=w.memo(Kbe);function Kbe(t){let{routes:e,future:n,state:r}=t;return vbe(e,void 0,r,n)}const Zbe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Qbe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jbe=w.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:a,replace:s,state:o,target:l,to:u,preventScrollReset:c,viewTransition:d}=e,f=Lbe(e,Bbe),{basename:m}=w.useContext(Nf),g,y=!1;if(typeof u=="string"&&Qbe.test(u)&&(g=u,Zbe))try{let _=new URL(window.location.href),A=u.startsWith("//")?new URL(_.protocol+u):new URL(u),I=gm(A.pathname,m);A.origin===_.origin&&I!=null?u=I+A.search+A.hash:y=!0}catch{}let v=mbe(u,{relative:i}),b=eye(u,{replace:s,state:o,target:l,preventScrollReset:c,relative:i,viewTransition:d});function E(_){r&&r(_),_.defaultPrevented||b(_)}return w.createElement("a",vb({},f,{href:g||v,onClick:y||a?r:E,ref:n,target:l}))});var bH;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(bH||(bH={}));var yH;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(yH||(yH={}));function eye(t,e){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,viewTransition:o}=e===void 0?{}:e,l=EY(),u=bm(),c=SY(t,{relative:s});return w.useCallback(d=>{if(Pbe(d,n)){d.preventDefault();let f=r!==void 0?r:hf(u)===hf(c);l(t,{replace:f,state:i,preventScrollReset:a,relative:s,viewTransition:o})}},[u,l,c,r,i,n,t,a,s,o])}/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT - */const Of="170",_d={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Ad={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},xY=0,AM=1,wY=2,tye=3,CY=0,GT=1,T0=2,go=3,gl=0,ka=1,fa=2,dl=0,Zd=1,TM=2,xM=3,wM=4,RY=5,nc=100,IY=101,MY=102,NY=103,OY=104,DY=200,LY=201,kY=202,PY=203,H_=204,G_=205,BY=206,FY=207,UY=208,zY=209,HY=210,GY=211,VY=212,$Y=213,WY=214,V_=0,$_=1,W_=2,mf=3,j_=4,Y_=5,q_=6,X_=7,Zb=0,jY=1,YY=2,fl=0,qY=1,XY=2,KY=3,HO=4,ZY=5,QY=6,JY=7,CM="attached",eq="detached",Tc=300,bl=301,xc=302,Yh=303,Eb=304,ym=306,wc=1e3,ni=1001,qh=1002,pi=1003,VT=1004,nye=1004,Pd=1005,rye=1005,Xn=1006,xh=1007,iye=1007,Js=1008,RM=1008,as=1009,$T=1010,WT=1011,Xh=1012,Qb=1013,yl=1014,Or=1015,fi=1016,jT=1017,YT=1018,gf=1020,GO=35902,VO=1021,$O=1022,ri=1023,WO=1024,jO=1025,Qd=1026,bf=1027,Jb=1028,ey=1029,YO=1030,qT=1031,aye=1032,XT=1033,x0=33776,w0=33777,C0=33778,R0=33779,K_=35840,Z_=35841,Q_=35842,J_=35843,eA=36196,tA=37492,nA=37496,rA=37808,iA=37809,aA=37810,sA=37811,oA=37812,lA=37813,uA=37814,cA=37815,dA=37816,fA=37817,pA=37818,hA=37819,mA=37820,gA=37821,I0=36492,bA=36494,yA=36495,qO=36283,vA=36284,EA=36285,SA=36286,tq=2200,nq=2201,rq=2202,Kh=2300,Zh=2301,VS=2302,Bd=2400,Fd=2401,Sb=2402,KT=2500,XO=2501,iq=0,KO=1,_A=2,aq=3200,sq=3201,sye=3202,oye=3203,Bc=0,oq=1,jl="",Ia="srgb",vl="srgb-linear",ty="linear",sr="srgb",lye=0,Td=7680,uye=7681,cye=7682,dye=7683,fye=34055,pye=34056,hye=5386,mye=512,gye=513,bye=514,yye=515,vye=516,Eye=517,Sye=518,IM=519,lq=512,uq=513,cq=514,ZO=515,dq=516,fq=517,pq=518,hq=519,_b=35044,_ye=35048,Aye=35040,Tye=35045,xye=35049,wye=35041,Cye=35046,Rye=35050,Iye=35042,Mye="100",MM="300 es",il=2e3,Ab=2001;class No{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const a=i.indexOf(n);a!==-1&&i.splice(a,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 a=0,s=i.length;a>8&255]+sa[t>>16&255]+sa[t>>24&255]+"-"+sa[e&255]+sa[e>>8&255]+"-"+sa[e>>16&15|64]+sa[e>>24&255]+"-"+sa[n&63|128]+sa[n>>8&255]+"-"+sa[n>>16&255]+sa[n>>24&255]+sa[r&255]+sa[r>>8&255]+sa[r>>16&255]+sa[r>>24&255]).toLowerCase()}function Yr(t,e,n){return Math.max(e,Math.min(n,t))}function QO(t,e){return(t%e+e)%e}function Nye(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function Oye(t,e,n){return t!==e?(n-t)/(e-t):0}function M0(t,e,n){return(1-n)*t+n*e}function Dye(t,e,n,r){return M0(t,e,1-Math.exp(-n*r))}function Lye(t,e=1){return e-Math.abs(QO(t,e*2)-e)}function kye(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function Pye(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function Bye(t,e){return t+Math.floor(Math.random()*(e-t+1))}function Fye(t,e){return t+Math.random()*(e-t)}function Uye(t){return t*(.5-Math.random())}function zye(t){t!==void 0&&(vH=t);let e=vH+=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 Hye(t){return t*Jd}function Gye(t){return t*Qh}function Vye(t){return(t&t-1)===0&&t!==0}function $ye(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Wye(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function jye(t,e,n,r,i){const a=Math.cos,s=Math.sin,o=a(n/2),l=s(n/2),u=a((e+r)/2),c=s((e+r)/2),d=a((e-r)/2),f=s((e-r)/2),m=a((r-e)/2),g=s((r-e)/2);switch(i){case"XYX":t.set(o*c,l*d,l*f,o*u);break;case"YZY":t.set(l*f,o*c,l*d,o*u);break;case"ZXZ":t.set(l*d,l*f,o*c,o*u);break;case"XZX":t.set(o*c,l*g,l*m,o*u);break;case"YXY":t.set(l*m,o*c,l*g,o*u);break;case"ZYZ":t.set(l*g,l*m,o*c,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Ma(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Sn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const bc={DEG2RAD:Jd,RAD2DEG:Qh,generateUUID:Ss,clamp:Yr,euclideanModulo:QO,mapLinear:Nye,inverseLerp:Oye,lerp:M0,damp:Dye,pingpong:Lye,smoothstep:kye,smootherstep:Pye,randInt:Bye,randFloat:Fye,randFloatSpread:Uye,seededRandom:zye,degToRad:Hye,radToDeg:Gye,isPowerOfTwo:Vye,ceilPowerOfTwo:$ye,floorPowerOfTwo:Wye,setQuaternionFromProperEuler:jye,normalize:Sn,denormalize:Ma};class Ke{constructor(e=0,n=0){Ke.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.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 n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Yr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),a=this.x-e.x,s=this.y-e.y;return this.x=a*r-s*i+e.x,this.y=a*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class vn{constructor(e,n,r,i,a,s,o,l,u){vn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,a,s,o,l,u)}set(e,n,r,i,a,s,o,l,u){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=n,c[4]=a,c[5]=l,c[6]=r,c[7]=s,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,a=this.elements,s=r[0],o=r[3],l=r[6],u=r[1],c=r[4],d=r[7],f=r[2],m=r[5],g=r[8],y=i[0],v=i[3],b=i[6],E=i[1],S=i[4],A=i[7],I=i[2],T=i[5],R=i[8];return a[0]=s*y+o*E+l*I,a[3]=s*v+o*S+l*T,a[6]=s*b+o*A+l*R,a[1]=u*y+c*E+d*I,a[4]=u*v+c*S+d*T,a[7]=u*b+c*A+d*R,a[2]=f*y+m*E+g*I,a[5]=f*v+m*S+g*T,a[8]=f*b+m*A+g*R,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8];return n*s*c-n*o*u-r*a*c+r*o*l+i*a*u-i*s*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],d=c*s-o*u,f=o*l-c*a,m=u*a-s*l,g=n*d+r*f+i*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/g;return e[0]=d*y,e[1]=(i*u-c*r)*y,e[2]=(o*r-i*s)*y,e[3]=f*y,e[4]=(c*n-i*l)*y,e[5]=(i*a-o*n)*y,e[6]=m*y,e[7]=(r*l-u*n)*y,e[8]=(s*n-r*a)*y,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,a,s,o){const l=Math.cos(a),u=Math.sin(a);return this.set(r*l,r*u,-r*(l*s+u*o)+s+e,-i*u,i*l,-i*(-u*s+l*o)+o+n,0,0,1),this}scale(e,n){return this.premultiply(mC.makeScale(e,n)),this}rotate(e){return this.premultiply(mC.makeRotation(-e)),this}translate(e,n){return this.premultiply(mC.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const mC=new vn;function mq(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const Yye={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function lh(t,e){return new Yye[t](e)}function Tb(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function gq(){const t=Tb("canvas");return t.style.display="block",t}const EH={};function t0(t){t in EH||(EH[t]=!0,console.warn(t))}function qye(t,e,n){return new Promise(function(r,i){function a(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}function Xye(t){const e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function Kye(t){const e=t.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const Un={enabled:!0,workingColorSpace:vl,spaces:{},convert:function(t,e,n){return this.enabled===!1||e===n||!e||!n||(this.spaces[e].transfer===sr&&(t.r=uu(t.r),t.g=uu(t.g),t.b=uu(t.b)),this.spaces[e].primaries!==this.spaces[n].primaries&&(t.applyMatrix3(this.spaces[e].toXYZ),t.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===sr&&(t.r=wh(t.r),t.g=wh(t.g),t.b=wh(t.b))),t},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return t===jl?ty:this.spaces[t].transfer},getLuminanceCoefficients:function(t,e=this.workingColorSpace){return t.fromArray(this.spaces[e].luminanceCoefficients)},define:function(t){Object.assign(this.spaces,t)},_getMatrix:function(t,e,n){return t.copy(this.spaces[e].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(t){return this.spaces[t].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(t=this.workingColorSpace){return this.spaces[t].workingColorSpaceConfig.unpackColorSpace}};function uu(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function wh(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const SH=[.64,.33,.3,.6,.15,.06],_H=[.2126,.7152,.0722],AH=[.3127,.329],TH=new vn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),xH=new vn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);Un.define({[vl]:{primaries:SH,whitePoint:AH,transfer:ty,toXYZ:TH,fromXYZ:xH,luminanceCoefficients:_H,workingColorSpaceConfig:{unpackColorSpace:Ia},outputColorSpaceConfig:{drawingBufferColorSpace:Ia}},[Ia]:{primaries:SH,whitePoint:AH,transfer:sr,toXYZ:TH,fromXYZ:xH,luminanceCoefficients:_H,outputColorSpaceConfig:{drawingBufferColorSpace:Ia}}});let pp;class bq{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{pp===void 0&&(pp=Tb("canvas")),pp.width=e.width,pp.height=e.height;const r=pp.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=pp}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Tb("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),a=i.data;for(let s=0;s0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Tc)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case wc:e.x=e.x-Math.floor(e.x);break;case ni:e.x=e.x<0?0:1;break;case qh: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 wc:e.y=e.y-Math.floor(e.y);break;case ni:e.y=e.y<0?0:1;break;case qh:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}$n.DEFAULT_IMAGE=null;$n.DEFAULT_MAPPING=Tc;$n.DEFAULT_ANISOTROPY=1;class Yn{constructor(e=0,n=0,r=0,i=1){Yn.prototype.isVector4=!0,this.x=e,this.y=n,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,n,r,i){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.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 n=this.x,r=this.y,i=this.z,a=this.w,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*a,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*a,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*a,this.w=s[3]*n+s[7]*r+s[11]*i+s[15]*a,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,a;const l=e.elements,u=l[0],c=l[4],d=l[8],f=l[1],m=l[5],g=l[9],y=l[2],v=l[6],b=l[10];if(Math.abs(c-f)<.01&&Math.abs(d-y)<.01&&Math.abs(g-v)<.01){if(Math.abs(c+f)<.1&&Math.abs(d+y)<.1&&Math.abs(g+v)<.1&&Math.abs(u+m+b-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const S=(u+1)/2,A=(m+1)/2,I=(b+1)/2,T=(c+f)/4,R=(d+y)/4,O=(g+v)/4;return S>A&&S>I?S<.01?(r=0,i=.707106781,a=.707106781):(r=Math.sqrt(S),i=T/r,a=R/r):A>I?A<.01?(r=.707106781,i=0,a=.707106781):(i=Math.sqrt(A),r=T/i,a=O/i):I<.01?(r=.707106781,i=.707106781,a=0):(a=Math.sqrt(I),r=R/a,i=O/a),this.set(r,i,a,n),this}let E=Math.sqrt((v-g)*(v-g)+(d-y)*(d-y)+(f-c)*(f-c));return Math.abs(E)<.001&&(E=1),this.x=(v-g)/E,this.y=(d-y)/E,this.z=(f-c)/E,this.w=Math.acos((u+m+b-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),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 yq extends No{constructor(e=1,n=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Yn(0,0,e,n),this.scissorTest=!1,this.viewport=new Yn(0,0,e,n);const i={width:e,height:n,depth:1};r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Xn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},r);const a=new $n(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace);a.flipY=!1,a.generateMipmaps=r.generateMipmaps,a.internalFormat=r.internalFormat,this.textures=[];const s=r.count;for(let o=0;o=0?1:-1,S=1-b*b;if(S>Number.EPSILON){const I=Math.sqrt(S),T=Math.atan2(I,b*E);v=Math.sin(v*T)/I,o=Math.sin(o*T)/I}const A=o*E;if(l=l*v+f*A,u=u*v+m*A,c=c*v+g*A,d=d*v+y*A,v===1-o){const I=1/Math.sqrt(l*l+u*u+c*c+d*d);l*=I,u*=I,c*=I,d*=I}}e[n]=l,e[n+1]=u,e[n+2]=c,e[n+3]=d}static multiplyQuaternionsFlat(e,n,r,i,a,s){const o=r[i],l=r[i+1],u=r[i+2],c=r[i+3],d=a[s],f=a[s+1],m=a[s+2],g=a[s+3];return e[n]=o*g+c*d+l*m-u*f,e[n+1]=l*g+c*f+u*d-o*m,e[n+2]=u*g+c*m+o*f-l*d,e[n+3]=c*g-o*d-l*f-u*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,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,n=!0){const r=e._x,i=e._y,a=e._z,s=e._order,o=Math.cos,l=Math.sin,u=o(r/2),c=o(i/2),d=o(a/2),f=l(r/2),m=l(i/2),g=l(a/2);switch(s){case"XYZ":this._x=f*c*d+u*m*g,this._y=u*m*d-f*c*g,this._z=u*c*g+f*m*d,this._w=u*c*d-f*m*g;break;case"YXZ":this._x=f*c*d+u*m*g,this._y=u*m*d-f*c*g,this._z=u*c*g-f*m*d,this._w=u*c*d+f*m*g;break;case"ZXY":this._x=f*c*d-u*m*g,this._y=u*m*d+f*c*g,this._z=u*c*g+f*m*d,this._w=u*c*d-f*m*g;break;case"ZYX":this._x=f*c*d-u*m*g,this._y=u*m*d+f*c*g,this._z=u*c*g-f*m*d,this._w=u*c*d+f*m*g;break;case"YZX":this._x=f*c*d+u*m*g,this._y=u*m*d+f*c*g,this._z=u*c*g-f*m*d,this._w=u*c*d-f*m*g;break;case"XZY":this._x=f*c*d-u*m*g,this._y=u*m*d-f*c*g,this._z=u*c*g+f*m*d,this._w=u*c*d+f*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/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 n=e.elements,r=n[0],i=n[4],a=n[8],s=n[1],o=n[5],l=n[9],u=n[2],c=n[6],d=n[10],f=r+o+d;if(f>0){const m=.5/Math.sqrt(f+1);this._w=.25/m,this._x=(c-l)*m,this._y=(a-u)*m,this._z=(s-i)*m}else if(r>o&&r>d){const m=2*Math.sqrt(1+r-o-d);this._w=(c-l)/m,this._x=.25*m,this._y=(i+s)/m,this._z=(a+u)/m}else if(o>d){const m=2*Math.sqrt(1+o-r-d);this._w=(a-u)/m,this._x=(i+s)/m,this._y=.25*m,this._z=(l+c)/m}else{const m=2*Math.sqrt(1+d-r-o);this._w=(s-i)/m,this._x=(a+u)/m,this._y=(l+c)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+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*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Yr(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/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,n){const r=e._x,i=e._y,a=e._z,s=e._w,o=n._x,l=n._y,u=n._z,c=n._w;return this._x=r*c+s*o+i*u-a*l,this._y=i*c+s*l+a*o-r*u,this._z=a*c+s*u+r*l-i*o,this._w=s*c-r*o-i*l-a*u,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,a=this._z,s=this._w;let o=s*e._w+r*e._x+i*e._y+a*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=r,this._y=i,this._z=a,this;const l=1-o*o;if(l<=Number.EPSILON){const m=1-n;return this._w=m*s+n*this._w,this._x=m*r+n*this._x,this._y=m*i+n*this._y,this._z=m*a+n*this._z,this.normalize(),this}const u=Math.sqrt(l),c=Math.atan2(u,o),d=Math.sin((1-n)*c)/u,f=Math.sin(n*c)/u;return this._w=s*d+this._w*f,this._x=r*d+this._x*f,this._y=i*d+this._y*f,this._z=a*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),a=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),a*Math.sin(n),a*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class H{constructor(e=0,n=0,r=0){H.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.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,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(wH.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(wH.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,a=e.elements;return this.x=a[0]*n+a[3]*r+a[6]*i,this.y=a[1]*n+a[4]*r+a[7]*i,this.z=a[2]*n+a[5]*r+a[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,a=e.elements,s=1/(a[3]*n+a[7]*r+a[11]*i+a[15]);return this.x=(a[0]*n+a[4]*r+a[8]*i+a[12])*s,this.y=(a[1]*n+a[5]*r+a[9]*i+a[13])*s,this.z=(a[2]*n+a[6]*r+a[10]*i+a[14])*s,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,a=e.x,s=e.y,o=e.z,l=e.w,u=2*(s*i-o*r),c=2*(o*n-a*i),d=2*(a*r-s*n);return this.x=n+l*u+s*d-o*c,this.y=r+l*c+o*u-a*d,this.z=i+l*d+a*c-s*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i,this.y=a[1]*n+a[5]*r+a[9]*i,this.z=a[2]*n+a[6]*r+a[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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,a=e.z,s=n.x,o=n.y,l=n.z;return this.x=i*l-a*o,this.y=a*s-r*l,this.z=r*o-i*s,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return bC.copy(this).projectOnVector(e),this.sub(bC)}reflect(e){return this.sub(bC.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Yr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+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,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const bC=new H,wH=new Mn;class Di{constructor(e=new H(1/0,1/0,1/0),n=new H(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,r=e.length;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,co),co.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Eg),tE.subVectors(this.max,Eg),hp.subVectors(e.a,Eg),mp.subVectors(e.b,Eg),gp.subVectors(e.c,Eg),Lu.subVectors(mp,hp),ku.subVectors(gp,mp),id.subVectors(hp,gp);let n=[0,-Lu.z,Lu.y,0,-ku.z,ku.y,0,-id.z,id.y,Lu.z,0,-Lu.x,ku.z,0,-ku.x,id.z,0,-id.x,-Lu.y,Lu.x,0,-ku.y,ku.x,0,-id.y,id.x,0];return!yC(n,hp,mp,gp,tE)||(n=[1,0,0,0,1,0,0,0,1],!yC(n,hp,mp,gp,tE))?!1:(nE.crossVectors(Lu,ku),n=[nE.x,nE.y,nE.z],yC(n,hp,mp,gp,tE))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,co).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(co).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:(Nl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nl),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 Nl=[new H,new H,new H,new H,new H,new H,new H,new H],co=new H,eE=new Di,hp=new H,mp=new H,gp=new H,Lu=new H,ku=new H,id=new H,Eg=new H,tE=new H,nE=new H,ad=new H;function yC(t,e,n,r,i){for(let a=0,s=t.length-3;a<=s;a+=3){ad.fromArray(t,a);const o=i.x*Math.abs(ad.x)+i.y*Math.abs(ad.y)+i.z*Math.abs(ad.z),l=e.dot(ad),u=n.dot(ad),c=r.dot(ad);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>o)return!1}return!0}const tve=new Di,Sg=new H,vC=new H;let Li=class{constructor(e=new H,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):tve.setFromPoints(e).getCenter(r);let i=0;for(let a=0,s=e.length;athis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}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;Sg.subVectors(e,this.center);const n=Sg.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(Sg,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?this.radius=Math.max(this.radius,e.radius):(vC.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Sg.copy(e.center).add(vC)),this.expandByPoint(Sg.copy(e.center).sub(vC))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};const Ol=new H,EC=new H,rE=new H,Pu=new H,SC=new H,iE=new H,_C=new H;class Df{constructor(e=new H,n=new H(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ol)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Ol.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Ol.copy(this.origin).addScaledVector(this.direction,n),Ol.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){EC.copy(e).add(n).multiplyScalar(.5),rE.copy(n).sub(e).normalize(),Pu.copy(this.origin).sub(EC);const a=e.distanceTo(n)*.5,s=-this.direction.dot(rE),o=Pu.dot(this.direction),l=-Pu.dot(rE),u=Pu.lengthSq(),c=Math.abs(1-s*s);let d,f,m,g;if(c>0)if(d=s*l-o,f=s*o-l,g=a*c,d>=0)if(f>=-g)if(f<=g){const y=1/c;d*=y,f*=y,m=d*(d+s*f+2*o)+f*(s*d+f+2*l)+u}else f=a,d=Math.max(0,-(s*f+o)),m=-d*d+f*(f+2*l)+u;else f=-a,d=Math.max(0,-(s*f+o)),m=-d*d+f*(f+2*l)+u;else f<=-g?(d=Math.max(0,-(-s*a+o)),f=d>0?-a:Math.min(Math.max(-a,-l),a),m=-d*d+f*(f+2*l)+u):f<=g?(d=0,f=Math.min(Math.max(-a,-l),a),m=f*(f+2*l)+u):(d=Math.max(0,-(s*a+o)),f=d>0?a:Math.min(Math.max(-a,-l),a),m=-d*d+f*(f+2*l)+u);else f=s>0?-a:a,d=Math.max(0,-(s*f+o)),m=-d*d+f*(f+2*l)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(EC).addScaledVector(rE,f),m}intersectSphere(e,n){Ol.subVectors(e.center,this.origin);const r=Ol.dot(this.direction),i=Ol.dot(Ol)-r*r,a=e.radius*e.radius;if(i>a)return null;const s=Math.sqrt(a-i),o=r-s,l=r+s;return l<0?null:o<0?this.at(l,n):this.at(o,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,a,s,o,l;const u=1/this.direction.x,c=1/this.direction.y,d=1/this.direction.z,f=this.origin;return u>=0?(r=(e.min.x-f.x)*u,i=(e.max.x-f.x)*u):(r=(e.max.x-f.x)*u,i=(e.min.x-f.x)*u),c>=0?(a=(e.min.y-f.y)*c,s=(e.max.y-f.y)*c):(a=(e.max.y-f.y)*c,s=(e.min.y-f.y)*c),r>s||a>i||((a>r||isNaN(r))&&(r=a),(s=0?(o=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(o=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),r>l||o>i)||((o>r||r!==r)&&(r=o),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,Ol)!==null}intersectTriangle(e,n,r,i,a){SC.subVectors(n,e),iE.subVectors(r,e),_C.crossVectors(SC,iE);let s=this.direction.dot(_C),o;if(s>0){if(i)return null;o=1}else if(s<0)o=-1,s=-s;else return null;Pu.subVectors(this.origin,e);const l=o*this.direction.dot(iE.crossVectors(Pu,iE));if(l<0)return null;const u=o*this.direction.dot(SC.cross(Pu));if(u<0||l+u>s)return null;const c=-o*Pu.dot(_C);return c<0?null:this.at(c/s,a)}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 en{constructor(e,n,r,i,a,s,o,l,u,c,d,f,m,g,y,v){en.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,a,s,o,l,u,c,d,f,m,g,y,v)}set(e,n,r,i,a,s,o,l,u,c,d,f,m,g,y,v){const b=this.elements;return b[0]=e,b[4]=n,b[8]=r,b[12]=i,b[1]=a,b[5]=s,b[9]=o,b[13]=l,b[2]=u,b[6]=c,b[10]=d,b[14]=f,b[3]=m,b[7]=g,b[11]=y,b[15]=v,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 en().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/bp.setFromMatrixColumn(e,0).length(),a=1/bp.setFromMatrixColumn(e,1).length(),s=1/bp.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*a,n[5]=r[5]*a,n[6]=r[6]*a,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,a=e.z,s=Math.cos(r),o=Math.sin(r),l=Math.cos(i),u=Math.sin(i),c=Math.cos(a),d=Math.sin(a);if(e.order==="XYZ"){const f=s*c,m=s*d,g=o*c,y=o*d;n[0]=l*c,n[4]=-l*d,n[8]=u,n[1]=m+g*u,n[5]=f-y*u,n[9]=-o*l,n[2]=y-f*u,n[6]=g+m*u,n[10]=s*l}else if(e.order==="YXZ"){const f=l*c,m=l*d,g=u*c,y=u*d;n[0]=f+y*o,n[4]=g*o-m,n[8]=s*u,n[1]=s*d,n[5]=s*c,n[9]=-o,n[2]=m*o-g,n[6]=y+f*o,n[10]=s*l}else if(e.order==="ZXY"){const f=l*c,m=l*d,g=u*c,y=u*d;n[0]=f-y*o,n[4]=-s*d,n[8]=g+m*o,n[1]=m+g*o,n[5]=s*c,n[9]=y-f*o,n[2]=-s*u,n[6]=o,n[10]=s*l}else if(e.order==="ZYX"){const f=s*c,m=s*d,g=o*c,y=o*d;n[0]=l*c,n[4]=g*u-m,n[8]=f*u+y,n[1]=l*d,n[5]=y*u+f,n[9]=m*u-g,n[2]=-u,n[6]=o*l,n[10]=s*l}else if(e.order==="YZX"){const f=s*l,m=s*u,g=o*l,y=o*u;n[0]=l*c,n[4]=y-f*d,n[8]=g*d+m,n[1]=d,n[5]=s*c,n[9]=-o*c,n[2]=-u*c,n[6]=m*d+g,n[10]=f-y*d}else if(e.order==="XZY"){const f=s*l,m=s*u,g=o*l,y=o*u;n[0]=l*c,n[4]=-d,n[8]=u*c,n[1]=f*d+y,n[5]=s*c,n[9]=m*d-g,n[2]=g*d-m,n[6]=o*c,n[10]=y*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(nve,e,rve)}lookAt(e,n,r){const i=this.elements;return ds.subVectors(e,n),ds.lengthSq()===0&&(ds.z=1),ds.normalize(),Bu.crossVectors(r,ds),Bu.lengthSq()===0&&(Math.abs(r.z)===1?ds.x+=1e-4:ds.z+=1e-4,ds.normalize(),Bu.crossVectors(r,ds)),Bu.normalize(),aE.crossVectors(ds,Bu),i[0]=Bu.x,i[4]=aE.x,i[8]=ds.x,i[1]=Bu.y,i[5]=aE.y,i[9]=ds.y,i[2]=Bu.z,i[6]=aE.z,i[10]=ds.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,a=this.elements,s=r[0],o=r[4],l=r[8],u=r[12],c=r[1],d=r[5],f=r[9],m=r[13],g=r[2],y=r[6],v=r[10],b=r[14],E=r[3],S=r[7],A=r[11],I=r[15],T=i[0],R=i[4],O=i[8],N=i[12],M=i[1],B=i[5],G=i[9],W=i[13],K=i[2],se=i[6],ae=i[10],ee=i[14],F=i[3],ie=i[7],J=i[11],fe=i[15];return a[0]=s*T+o*M+l*K+u*F,a[4]=s*R+o*B+l*se+u*ie,a[8]=s*O+o*G+l*ae+u*J,a[12]=s*N+o*W+l*ee+u*fe,a[1]=c*T+d*M+f*K+m*F,a[5]=c*R+d*B+f*se+m*ie,a[9]=c*O+d*G+f*ae+m*J,a[13]=c*N+d*W+f*ee+m*fe,a[2]=g*T+y*M+v*K+b*F,a[6]=g*R+y*B+v*se+b*ie,a[10]=g*O+y*G+v*ae+b*J,a[14]=g*N+y*W+v*ee+b*fe,a[3]=E*T+S*M+A*K+I*F,a[7]=E*R+S*B+A*se+I*ie,a[11]=E*O+S*G+A*ae+I*J,a[15]=E*N+S*W+A*ee+I*fe,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],a=e[12],s=e[1],o=e[5],l=e[9],u=e[13],c=e[2],d=e[6],f=e[10],m=e[14],g=e[3],y=e[7],v=e[11],b=e[15];return g*(+a*l*d-i*u*d-a*o*f+r*u*f+i*o*m-r*l*m)+y*(+n*l*m-n*u*f+a*s*f-i*s*m+i*u*c-a*l*c)+v*(+n*u*d-n*o*m-a*s*d+r*s*m+a*o*c-r*u*c)+b*(-i*o*c-n*l*d+n*o*f+i*s*d-r*s*f+r*l*c)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,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]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],m=e[11],g=e[12],y=e[13],v=e[14],b=e[15],E=d*v*u-y*f*u+y*l*m-o*v*m-d*l*b+o*f*b,S=g*f*u-c*v*u-g*l*m+s*v*m+c*l*b-s*f*b,A=c*y*u-g*d*u+g*o*m-s*y*m-c*o*b+s*d*b,I=g*d*l-c*y*l-g*o*f+s*y*f+c*o*v-s*d*v,T=n*E+r*S+i*A+a*I;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/T;return e[0]=E*R,e[1]=(y*f*a-d*v*a-y*i*m+r*v*m+d*i*b-r*f*b)*R,e[2]=(o*v*a-y*l*a+y*i*u-r*v*u-o*i*b+r*l*b)*R,e[3]=(d*l*a-o*f*a-d*i*u+r*f*u+o*i*m-r*l*m)*R,e[4]=S*R,e[5]=(c*v*a-g*f*a+g*i*m-n*v*m-c*i*b+n*f*b)*R,e[6]=(g*l*a-s*v*a-g*i*u+n*v*u+s*i*b-n*l*b)*R,e[7]=(s*f*a-c*l*a+c*i*u-n*f*u-s*i*m+n*l*m)*R,e[8]=A*R,e[9]=(g*d*a-c*y*a-g*r*m+n*y*m+c*r*b-n*d*b)*R,e[10]=(s*y*a-g*o*a+g*r*u-n*y*u-s*r*b+n*o*b)*R,e[11]=(c*o*a-s*d*a-c*r*u+n*d*u+s*r*m-n*o*m)*R,e[12]=I*R,e[13]=(c*y*i-g*d*i+g*r*f-n*y*f-c*r*v+n*d*v)*R,e[14]=(g*o*i-s*y*i-g*r*l+n*y*l+s*r*v-n*o*v)*R,e[15]=(s*d*i-c*o*i+c*r*l-n*d*l-s*r*f+n*o*f)*R,this}scale(e){const n=this.elements,r=e.x,i=e.y,a=e.z;return n[0]*=r,n[4]*=i,n[8]*=a,n[1]*=r,n[5]*=i,n[9]*=a,n[2]*=r,n[6]*=i,n[10]*=a,n[3]*=r,n[7]*=i,n[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,n=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(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),a=1-r,s=e.x,o=e.y,l=e.z,u=a*s,c=a*o;return this.set(u*s+r,u*o-i*l,u*l+i*o,0,u*o+i*l,c*o+r,c*l-i*s,0,u*l-i*o,c*l+i*s,a*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,a,s){return this.set(1,r,a,0,e,1,s,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,a=n._x,s=n._y,o=n._z,l=n._w,u=a+a,c=s+s,d=o+o,f=a*u,m=a*c,g=a*d,y=s*c,v=s*d,b=o*d,E=l*u,S=l*c,A=l*d,I=r.x,T=r.y,R=r.z;return i[0]=(1-(y+b))*I,i[1]=(m+A)*I,i[2]=(g-S)*I,i[3]=0,i[4]=(m-A)*T,i[5]=(1-(f+b))*T,i[6]=(v+E)*T,i[7]=0,i[8]=(g+S)*R,i[9]=(v-E)*R,i[10]=(1-(f+y))*R,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let a=bp.set(i[0],i[1],i[2]).length();const s=bp.set(i[4],i[5],i[6]).length(),o=bp.set(i[8],i[9],i[10]).length();this.determinant()<0&&(a=-a),e.x=i[12],e.y=i[13],e.z=i[14],fo.copy(this);const u=1/a,c=1/s,d=1/o;return fo.elements[0]*=u,fo.elements[1]*=u,fo.elements[2]*=u,fo.elements[4]*=c,fo.elements[5]*=c,fo.elements[6]*=c,fo.elements[8]*=d,fo.elements[9]*=d,fo.elements[10]*=d,n.setFromRotationMatrix(fo),r.x=a,r.y=s,r.z=o,this}makePerspective(e,n,r,i,a,s,o=il){const l=this.elements,u=2*a/(n-e),c=2*a/(r-i),d=(n+e)/(n-e),f=(r+i)/(r-i);let m,g;if(o===il)m=-(s+a)/(s-a),g=-2*s*a/(s-a);else if(o===Ab)m=-s/(s-a),g=-s*a/(s-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=u,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=c,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=g,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,a,s,o=il){const l=this.elements,u=1/(n-e),c=1/(r-i),d=1/(s-a),f=(n+e)*u,m=(r+i)*c;let g,y;if(o===il)g=(s+a)*d,y=-2*d;else if(o===Ab)g=a*d,y=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=y,l[14]=-g,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const bp=new H,fo=new en,nve=new H(0,0,0),rve=new H(1,1,1),Bu=new H,aE=new H,ds=new H,CH=new en,RH=new Mn;class ss{constructor(e=0,n=0,r=0,i=ss.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,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,n,r,i=this._order){return this._x=e,this._y=n,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,n=this._order,r=!0){const i=e.elements,a=i[0],s=i[4],o=i[8],l=i[1],u=i[5],c=i[9],d=i[2],f=i[6],m=i[10];switch(n){case"XYZ":this._y=Math.asin(Yr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,m),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Yr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,a),this._z=0);break;case"ZXY":this._x=Math.asin(Yr(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-Yr(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(Yr(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-d,a)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-Yr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(o,a)):(this._x=Math.atan2(-c,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return CH.makeRotationFromQuaternion(e),this.setFromRotationMatrix(CH,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return RH.setFromEuler(this),this.setFromQuaternion(RH,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=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+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}}ss.DEFAULT_ORDER="XYZ";class ef{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function a(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=a(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let u=0,c=l.length;u0){i.children=[];for(let o=0;o0){i.animations=[];for(let o=0;o0&&(r.geometries=o),l.length>0&&(r.materials=l),u.length>0&&(r.textures=u),c.length>0&&(r.images=c),d.length>0&&(r.shapes=d),f.length>0&&(r.skeletons=f),m.length>0&&(r.animations=m),g.length>0&&(r.nodes=g)}return r.object=i,r;function s(o){const l=[];for(const u in o){const c=o[u];delete c.metadata,l.push(c)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!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.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(a)):i.set(0,0,0)}static getBarycoord(e,n,r,i,a){po.subVectors(i,n),Ll.subVectors(r,n),TC.subVectors(e,n);const s=po.dot(po),o=po.dot(Ll),l=po.dot(TC),u=Ll.dot(Ll),c=Ll.dot(TC),d=s*u-o*o;if(d===0)return a.set(0,0,0),null;const f=1/d,m=(u*l-o*c)*f,g=(s*c-o*l)*f;return a.set(1-m-g,g,m)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,kl)===null?!1:kl.x>=0&&kl.y>=0&&kl.x+kl.y<=1}static getInterpolation(e,n,r,i,a,s,o,l){return this.getBarycoord(e,n,r,i,kl)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(a,kl.x),l.addScaledVector(s,kl.y),l.addScaledVector(o,kl.z),l)}static getInterpolatedAttribute(e,n,r,i,a,s){return RC.setScalar(0),IC.setScalar(0),MC.setScalar(0),RC.fromBufferAttribute(e,n),IC.fromBufferAttribute(e,r),MC.fromBufferAttribute(e,i),s.setScalar(0),s.addScaledVector(RC,a.x),s.addScaledVector(IC,a.y),s.addScaledVector(MC,a.z),s}static isFrontFacing(e,n,r,i){return po.subVectors(r,n),Ll.subVectors(e,n),po.cross(Ll).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),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 po.subVectors(this.c,this.b),Ll.subVectors(this.a,this.b),po.cross(Ll).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ka.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Ka.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,r,i,a){return Ka.getInterpolation(e,this.a,this.b,this.c,n,r,i,a)}containsPoint(e){return Ka.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ka.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,a=this.c;let s,o;Ep.subVectors(i,r),Sp.subVectors(a,r),xC.subVectors(e,r);const l=Ep.dot(xC),u=Sp.dot(xC);if(l<=0&&u<=0)return n.copy(r);wC.subVectors(e,i);const c=Ep.dot(wC),d=Sp.dot(wC);if(c>=0&&d<=c)return n.copy(i);const f=l*d-c*u;if(f<=0&&l>=0&&c<=0)return s=l/(l-c),n.copy(r).addScaledVector(Ep,s);CC.subVectors(e,a);const m=Ep.dot(CC),g=Sp.dot(CC);if(g>=0&&m<=g)return n.copy(a);const y=m*u-l*g;if(y<=0&&u>=0&&g<=0)return o=u/(u-g),n.copy(r).addScaledVector(Sp,o);const v=c*g-m*d;if(v<=0&&d-c>=0&&m-g>=0)return LH.subVectors(a,i),o=(d-c)/(d-c+(m-g)),n.copy(i).addScaledVector(LH,o);const b=1/(v+y+f);return s=y*b,o=f*b,n.copy(r).addScaledVector(Ep,s).addScaledVector(Sp,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const vq={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},Fu={h:0,s:0,l:0},oE={h:0,s:0,l:0};function NC(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let vt=class{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Ia){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Un.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Un.workingColorSpace){return this.r=e,this.g=n,this.b=r,Un.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Un.workingColorSpace){if(e=QO(e,1),n=Yr(n,0,1),r=Yr(r,0,1),n===0)this.r=this.g=this.b=r;else{const a=r<=.5?r*(1+n):r+n-r*n,s=2*r-a;this.r=NC(s,a,e+1/3),this.g=NC(s,a,e),this.b=NC(s,a,e-1/3)}return Un.toWorkingColorSpace(this,i),this}setStyle(e,n=Ia){function r(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const s=i[1],o=i[2];switch(s){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,n);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,n);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const a=i[1],s=a.length;if(s===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,n);if(s===6)return this.setHex(parseInt(a,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Ia){const r=vq[e.toLowerCase()];return r!==void 0?this.setHex(r,n):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=uu(e.r),this.g=uu(e.g),this.b=uu(e.b),this}copyLinearToSRGB(e){return this.r=wh(e.r),this.g=wh(e.g),this.b=wh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ia){return Un.fromWorkingColorSpace(oa.copy(this),e),Math.round(Yr(oa.r*255,0,255))*65536+Math.round(Yr(oa.g*255,0,255))*256+Math.round(Yr(oa.b*255,0,255))}getHexString(e=Ia){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Un.workingColorSpace){Un.fromWorkingColorSpace(oa.copy(this),n);const r=oa.r,i=oa.g,a=oa.b,s=Math.max(r,i,a),o=Math.min(r,i,a);let l,u;const c=(o+s)/2;if(o===s)l=0,u=0;else{const d=s-o;switch(u=c<=.5?d/(s+o):d/(2-s-o),s){case r:l=(i-a)/d+(i0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.6,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!==void 0&&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.dispersion!==void 0&&(r.dispersion=this.dispersion),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.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.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.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),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&&this.attenuationDistance!==1/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!==Zd&&(r.blending=this.blending),this.side!==gl&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==H_&&(r.blendSrc=this.blendSrc),this.blendDst!==G_&&(r.blendDst=this.blendDst),this.blendEquation!==nc&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==mf&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==IM&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Td&&(r.stencilFail=this.stencilFail),this.stencilZFail!==Td&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==Td&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),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.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),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=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(a){const s=[];for(const o in a){const l=a[o];delete l.metadata,s.push(l)}return s}if(n){const a=i(e.textures),s=i(e.images);a.length>0&&(r.textures=a),s.length>0&&(r.images=s)}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.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let a=0;a!==i;++a)r[a]=n[a].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.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class $i extends ii{static get type(){return"MeshBasicMaterial"}constructor(e){super(),this.isMeshBasicMaterial=!0,this.color=new vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ss,this.combine=Zb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Yl=uve();function uve(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const u=l-127;u<-27?(r[l]=0,r[l|256]=32768,i[l]=24,i[l|256]=24):u<-14?(r[l]=1024>>-u-14,r[l|256]=1024>>-u-14|32768,i[l]=-u-1,i[l|256]=-u-1):u<=15?(r[l]=u+15<<10,r[l|256]=u+15<<10|32768,i[l]=13,i[l|256]=13):u<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[l|256]=13)}const a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,c=0;for(;!(u&8388608);)u<<=1,c-=8388608;u&=-8388609,c+=947912704,a[l]=u|c}for(let l=1024;l<2048;++l)a[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)s[l]=l<<23;s[31]=1199570944,s[32]=2147483648;for(let l=33;l<63;++l)s[l]=2147483648+(l-32<<23);s[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:s,offsetTable:o}}function $a(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Yr(t,-65504,65504),Yl.floatView[0]=t;const e=Yl.uint32View[0],n=e>>23&511;return Yl.baseTable[n]+((e&8388607)>>Yl.shiftTable[n])}function n0(t){const e=t>>10;return Yl.uint32View[0]=Yl.mantissaTable[Yl.offsetTable[e]+(t&1023)]+Yl.exponentTable[e],Yl.floatView[0]}const zd={toHalfFloat:$a,fromHalfFloat:n0},oi=new H,lE=new Ke;class Kn{constructor(e,n,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=_b,this.updateRanges=[],this.gpuType=Or,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,a=this.itemSize;in.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Di);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new H(-1/0,-1/0,-1/0),new H(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let r=0,i=n.length;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const u=r[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let a=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],c=[];for(let d=0,f=u.length;d0&&(i[l]=c,a=!0)}a&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.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 n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const u in i){const c=i[u];this.setAttribute(u,c.clone(n))}const a=e.morphAttributes;for(const u in a){const c=[],d=a[u];for(let f=0,m=d.length;f0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;a(e.far-e.near)**2))&&(kH.copy(a).invert(),sd.copy(e.ray).applyMatrix4(kH),!(r.boundingBox!==null&&sd.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,sd)))}_computeIntersections(e,n,r){let i;const a=this.geometry,s=this.material,o=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,d=a.attributes.normal,f=a.groups,m=a.drawRange;if(o!==null)if(Array.isArray(s))for(let g=0,y=f.length;gn.far?null:{distance:u,point:hE.clone(),object:t}}function mE(t,e,n,r,i,a,s,o,l,u){t.getVertexPosition(o,cE),t.getVertexPosition(l,dE),t.getVertexPosition(u,fE);const c=bve(t,e,n,r,cE,dE,fE,BH);if(c){const d=new H;Ka.getBarycoord(BH,cE,dE,fE,d),i&&(c.uv=Ka.getInterpolatedAttribute(i,o,l,u,d,new Ke)),a&&(c.uv1=Ka.getInterpolatedAttribute(a,o,l,u,d,new Ke)),s&&(c.normal=Ka.getInterpolatedAttribute(s,o,l,u,d,new H),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const f={a:o,b:l,c:u,normal:new H,materialIndex:0};Ka.getNormal(cE,dE,fE,f.normal),c.face=f,c.barycoord=d}return c}class Ya extends fn{constructor(e=1,n=1,r=1,i=1,a=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:a,depthSegments:s};const o=this;i=Math.floor(i),a=Math.floor(a),s=Math.floor(s);const l=[],u=[],c=[],d=[];let f=0,m=0;g("z","y","x",-1,-1,r,n,e,s,a,0),g("z","y","x",1,-1,r,n,-e,s,a,1),g("x","z","y",1,1,e,r,n,i,s,2),g("x","z","y",1,-1,e,r,-n,i,s,3),g("x","y","z",1,-1,e,n,r,i,a,4),g("x","y","z",-1,-1,e,n,-r,i,a,5),this.setIndex(l),this.setAttribute("position",new qt(u,3)),this.setAttribute("normal",new qt(c,3)),this.setAttribute("uv",new qt(d,2));function g(y,v,b,E,S,A,I,T,R,O,N){const M=A/R,B=I/O,G=A/2,W=I/2,K=T/2,se=R+1,ae=O+1;let ee=0,F=0;const ie=new H;for(let J=0;J0?1:-1,c.push(ie.x,ie.y,ie.z),d.push(Ce/R),d.push(1-J/O),ee+=1}}for(let J=0;J>8&255]+sa[t>>16&255]+sa[t>>24&255]+"-"+sa[e&255]+sa[e>>8&255]+"-"+sa[e>>16&15|64]+sa[e>>24&255]+"-"+sa[n&63|128]+sa[n>>8&255]+"-"+sa[n>>16&255]+sa[n>>24&255]+sa[r&255]+sa[r>>8&255]+sa[r>>16&255]+sa[r>>24&255]).toLowerCase()}function Yr(t,e,n){return Math.max(e,Math.min(n,t))}function QO(t,e){return(t%e+e)%e}function Nye(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function Oye(t,e,n){return t!==e?(n-t)/(e-t):0}function M0(t,e,n){return(1-n)*t+n*e}function Dye(t,e,n,r){return M0(t,e,1-Math.exp(-n*r))}function Lye(t,e=1){return e-Math.abs(QO(t,e*2)-e)}function kye(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function Pye(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function Bye(t,e){return t+Math.floor(Math.random()*(e-t+1))}function Fye(t,e){return t+Math.random()*(e-t)}function Uye(t){return t*(.5-Math.random())}function zye(t){t!==void 0&&(vH=t);let e=vH+=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 Hye(t){return t*Jd}function Gye(t){return t*Qh}function Vye(t){return(t&t-1)===0&&t!==0}function $ye(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Wye(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function jye(t,e,n,r,i){const a=Math.cos,s=Math.sin,o=a(n/2),l=s(n/2),u=a((e+r)/2),c=s((e+r)/2),d=a((e-r)/2),f=s((e-r)/2),m=a((r-e)/2),g=s((r-e)/2);switch(i){case"XYX":t.set(o*c,l*d,l*f,o*u);break;case"YZY":t.set(l*f,o*c,l*d,o*u);break;case"ZXZ":t.set(l*d,l*f,o*c,o*u);break;case"XZX":t.set(o*c,l*g,l*m,o*u);break;case"YXY":t.set(l*m,o*c,l*g,o*u);break;case"ZYZ":t.set(l*g,l*m,o*c,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Ma(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function _n(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const bc={DEG2RAD:Jd,RAD2DEG:Qh,generateUUID:_s,clamp:Yr,euclideanModulo:QO,mapLinear:Nye,inverseLerp:Oye,lerp:M0,damp:Dye,pingpong:Lye,smoothstep:kye,smootherstep:Pye,randInt:Bye,randFloat:Fye,randFloatSpread:Uye,seededRandom:zye,degToRad:Hye,radToDeg:Gye,isPowerOfTwo:Vye,ceilPowerOfTwo:$ye,floorPowerOfTwo:Wye,setQuaternionFromProperEuler:jye,normalize:_n,denormalize:Ma};class Ke{constructor(e=0,n=0){Ke.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.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 n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Yr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),a=this.x-e.x,s=this.y-e.y;return this.x=a*r-s*i+e.x,this.y=a*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class vn{constructor(e,n,r,i,a,s,o,l,u){vn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,a,s,o,l,u)}set(e,n,r,i,a,s,o,l,u){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=n,c[4]=a,c[5]=l,c[6]=r,c[7]=s,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,a=this.elements,s=r[0],o=r[3],l=r[6],u=r[1],c=r[4],d=r[7],f=r[2],m=r[5],g=r[8],y=i[0],v=i[3],b=i[6],E=i[1],_=i[4],A=i[7],I=i[2],x=i[5],R=i[8];return a[0]=s*y+o*E+l*I,a[3]=s*v+o*_+l*x,a[6]=s*b+o*A+l*R,a[1]=u*y+c*E+d*I,a[4]=u*v+c*_+d*x,a[7]=u*b+c*A+d*R,a[2]=f*y+m*E+g*I,a[5]=f*v+m*_+g*x,a[8]=f*b+m*A+g*R,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8];return n*s*c-n*o*u-r*a*c+r*o*l+i*a*u-i*s*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],d=c*s-o*u,f=o*l-c*a,m=u*a-s*l,g=n*d+r*f+i*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/g;return e[0]=d*y,e[1]=(i*u-c*r)*y,e[2]=(o*r-i*s)*y,e[3]=f*y,e[4]=(c*n-i*l)*y,e[5]=(i*a-o*n)*y,e[6]=m*y,e[7]=(r*l-u*n)*y,e[8]=(s*n-r*a)*y,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,a,s,o){const l=Math.cos(a),u=Math.sin(a);return this.set(r*l,r*u,-r*(l*s+u*o)+s+e,-i*u,i*l,-i*(-u*s+l*o)+o+n,0,0,1),this}scale(e,n){return this.premultiply(mC.makeScale(e,n)),this}rotate(e){return this.premultiply(mC.makeRotation(-e)),this}translate(e,n){return this.premultiply(mC.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const mC=new vn;function mq(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const Yye={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function lh(t,e){return new Yye[t](e)}function xb(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function gq(){const t=xb("canvas");return t.style.display="block",t}const EH={};function t0(t){t in EH||(EH[t]=!0,console.warn(t))}function qye(t,e,n){return new Promise(function(r,i){function a(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}function Xye(t){const e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function Kye(t){const e=t.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const Un={enabled:!0,workingColorSpace:vl,spaces:{},convert:function(t,e,n){return this.enabled===!1||e===n||!e||!n||(this.spaces[e].transfer===sr&&(t.r=uu(t.r),t.g=uu(t.g),t.b=uu(t.b)),this.spaces[e].primaries!==this.spaces[n].primaries&&(t.applyMatrix3(this.spaces[e].toXYZ),t.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===sr&&(t.r=wh(t.r),t.g=wh(t.g),t.b=wh(t.b))),t},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return t===jl?ty:this.spaces[t].transfer},getLuminanceCoefficients:function(t,e=this.workingColorSpace){return t.fromArray(this.spaces[e].luminanceCoefficients)},define:function(t){Object.assign(this.spaces,t)},_getMatrix:function(t,e,n){return t.copy(this.spaces[e].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(t){return this.spaces[t].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(t=this.workingColorSpace){return this.spaces[t].workingColorSpaceConfig.unpackColorSpace}};function uu(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function wh(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const _H=[.64,.33,.3,.6,.15,.06],SH=[.2126,.7152,.0722],AH=[.3127,.329],xH=new vn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),TH=new vn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);Un.define({[vl]:{primaries:_H,whitePoint:AH,transfer:ty,toXYZ:xH,fromXYZ:TH,luminanceCoefficients:SH,workingColorSpaceConfig:{unpackColorSpace:Ia},outputColorSpaceConfig:{drawingBufferColorSpace:Ia}},[Ia]:{primaries:_H,whitePoint:AH,transfer:sr,toXYZ:xH,fromXYZ:TH,luminanceCoefficients:SH,outputColorSpaceConfig:{drawingBufferColorSpace:Ia}}});let pp;class bq{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{pp===void 0&&(pp=xb("canvas")),pp.width=e.width,pp.height=e.height;const r=pp.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=pp}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=xb("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),a=i.data;for(let s=0;s0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==xc)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case wc:e.x=e.x-Math.floor(e.x);break;case ni:e.x=e.x<0?0:1;break;case qh: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 wc:e.y=e.y-Math.floor(e.y);break;case ni:e.y=e.y<0?0:1;break;case qh:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}$n.DEFAULT_IMAGE=null;$n.DEFAULT_MAPPING=xc;$n.DEFAULT_ANISOTROPY=1;class Yn{constructor(e=0,n=0,r=0,i=1){Yn.prototype.isVector4=!0,this.x=e,this.y=n,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,n,r,i){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.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 n=this.x,r=this.y,i=this.z,a=this.w,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*a,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*a,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*a,this.w=s[3]*n+s[7]*r+s[11]*i+s[15]*a,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,a;const l=e.elements,u=l[0],c=l[4],d=l[8],f=l[1],m=l[5],g=l[9],y=l[2],v=l[6],b=l[10];if(Math.abs(c-f)<.01&&Math.abs(d-y)<.01&&Math.abs(g-v)<.01){if(Math.abs(c+f)<.1&&Math.abs(d+y)<.1&&Math.abs(g+v)<.1&&Math.abs(u+m+b-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const _=(u+1)/2,A=(m+1)/2,I=(b+1)/2,x=(c+f)/4,R=(d+y)/4,O=(g+v)/4;return _>A&&_>I?_<.01?(r=0,i=.707106781,a=.707106781):(r=Math.sqrt(_),i=x/r,a=R/r):A>I?A<.01?(r=.707106781,i=0,a=.707106781):(i=Math.sqrt(A),r=x/i,a=O/i):I<.01?(r=.707106781,i=.707106781,a=0):(a=Math.sqrt(I),r=R/a,i=O/a),this.set(r,i,a,n),this}let E=Math.sqrt((v-g)*(v-g)+(d-y)*(d-y)+(f-c)*(f-c));return Math.abs(E)<.001&&(E=1),this.x=(v-g)/E,this.y=(d-y)/E,this.z=(f-c)/E,this.w=Math.acos((u+m+b-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),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 yq extends No{constructor(e=1,n=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Yn(0,0,e,n),this.scissorTest=!1,this.viewport=new Yn(0,0,e,n);const i={width:e,height:n,depth:1};r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Xn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},r);const a=new $n(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace);a.flipY=!1,a.generateMipmaps=r.generateMipmaps,a.internalFormat=r.internalFormat,this.textures=[];const s=r.count;for(let o=0;o=0?1:-1,_=1-b*b;if(_>Number.EPSILON){const I=Math.sqrt(_),x=Math.atan2(I,b*E);v=Math.sin(v*x)/I,o=Math.sin(o*x)/I}const A=o*E;if(l=l*v+f*A,u=u*v+m*A,c=c*v+g*A,d=d*v+y*A,v===1-o){const I=1/Math.sqrt(l*l+u*u+c*c+d*d);l*=I,u*=I,c*=I,d*=I}}e[n]=l,e[n+1]=u,e[n+2]=c,e[n+3]=d}static multiplyQuaternionsFlat(e,n,r,i,a,s){const o=r[i],l=r[i+1],u=r[i+2],c=r[i+3],d=a[s],f=a[s+1],m=a[s+2],g=a[s+3];return e[n]=o*g+c*d+l*m-u*f,e[n+1]=l*g+c*f+u*d-o*m,e[n+2]=u*g+c*m+o*f-l*d,e[n+3]=c*g-o*d-l*f-u*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,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,n=!0){const r=e._x,i=e._y,a=e._z,s=e._order,o=Math.cos,l=Math.sin,u=o(r/2),c=o(i/2),d=o(a/2),f=l(r/2),m=l(i/2),g=l(a/2);switch(s){case"XYZ":this._x=f*c*d+u*m*g,this._y=u*m*d-f*c*g,this._z=u*c*g+f*m*d,this._w=u*c*d-f*m*g;break;case"YXZ":this._x=f*c*d+u*m*g,this._y=u*m*d-f*c*g,this._z=u*c*g-f*m*d,this._w=u*c*d+f*m*g;break;case"ZXY":this._x=f*c*d-u*m*g,this._y=u*m*d+f*c*g,this._z=u*c*g+f*m*d,this._w=u*c*d-f*m*g;break;case"ZYX":this._x=f*c*d-u*m*g,this._y=u*m*d+f*c*g,this._z=u*c*g-f*m*d,this._w=u*c*d+f*m*g;break;case"YZX":this._x=f*c*d+u*m*g,this._y=u*m*d+f*c*g,this._z=u*c*g-f*m*d,this._w=u*c*d-f*m*g;break;case"XZY":this._x=f*c*d-u*m*g,this._y=u*m*d-f*c*g,this._z=u*c*g+f*m*d,this._w=u*c*d+f*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/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 n=e.elements,r=n[0],i=n[4],a=n[8],s=n[1],o=n[5],l=n[9],u=n[2],c=n[6],d=n[10],f=r+o+d;if(f>0){const m=.5/Math.sqrt(f+1);this._w=.25/m,this._x=(c-l)*m,this._y=(a-u)*m,this._z=(s-i)*m}else if(r>o&&r>d){const m=2*Math.sqrt(1+r-o-d);this._w=(c-l)/m,this._x=.25*m,this._y=(i+s)/m,this._z=(a+u)/m}else if(o>d){const m=2*Math.sqrt(1+o-r-d);this._w=(a-u)/m,this._x=(i+s)/m,this._y=.25*m,this._z=(l+c)/m}else{const m=2*Math.sqrt(1+d-r-o);this._w=(s-i)/m,this._x=(a+u)/m,this._y=(l+c)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+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*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Yr(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/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,n){const r=e._x,i=e._y,a=e._z,s=e._w,o=n._x,l=n._y,u=n._z,c=n._w;return this._x=r*c+s*o+i*u-a*l,this._y=i*c+s*l+a*o-r*u,this._z=a*c+s*u+r*l-i*o,this._w=s*c-r*o-i*l-a*u,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,a=this._z,s=this._w;let o=s*e._w+r*e._x+i*e._y+a*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=r,this._y=i,this._z=a,this;const l=1-o*o;if(l<=Number.EPSILON){const m=1-n;return this._w=m*s+n*this._w,this._x=m*r+n*this._x,this._y=m*i+n*this._y,this._z=m*a+n*this._z,this.normalize(),this}const u=Math.sqrt(l),c=Math.atan2(u,o),d=Math.sin((1-n)*c)/u,f=Math.sin(n*c)/u;return this._w=s*d+this._w*f,this._x=r*d+this._x*f,this._y=i*d+this._y*f,this._z=a*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),a=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),a*Math.sin(n),a*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class H{constructor(e=0,n=0,r=0){H.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.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,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(wH.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(wH.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,a=e.elements;return this.x=a[0]*n+a[3]*r+a[6]*i,this.y=a[1]*n+a[4]*r+a[7]*i,this.z=a[2]*n+a[5]*r+a[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,a=e.elements,s=1/(a[3]*n+a[7]*r+a[11]*i+a[15]);return this.x=(a[0]*n+a[4]*r+a[8]*i+a[12])*s,this.y=(a[1]*n+a[5]*r+a[9]*i+a[13])*s,this.z=(a[2]*n+a[6]*r+a[10]*i+a[14])*s,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,a=e.x,s=e.y,o=e.z,l=e.w,u=2*(s*i-o*r),c=2*(o*n-a*i),d=2*(a*r-s*n);return this.x=n+l*u+s*d-o*c,this.y=r+l*c+o*u-a*d,this.z=i+l*d+a*c-s*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i,this.y=a[1]*n+a[5]*r+a[9]*i,this.z=a[2]*n+a[6]*r+a[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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,a=e.z,s=n.x,o=n.y,l=n.z;return this.x=i*l-a*o,this.y=a*s-r*l,this.z=r*o-i*s,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return bC.copy(this).projectOnVector(e),this.sub(bC)}reflect(e){return this.sub(bC.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Yr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+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,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const bC=new H,wH=new Mn;class Di{constructor(e=new H(1/0,1/0,1/0),n=new H(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,r=e.length;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,co),co.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Eg),tE.subVectors(this.max,Eg),hp.subVectors(e.a,Eg),mp.subVectors(e.b,Eg),gp.subVectors(e.c,Eg),Lu.subVectors(mp,hp),ku.subVectors(gp,mp),id.subVectors(hp,gp);let n=[0,-Lu.z,Lu.y,0,-ku.z,ku.y,0,-id.z,id.y,Lu.z,0,-Lu.x,ku.z,0,-ku.x,id.z,0,-id.x,-Lu.y,Lu.x,0,-ku.y,ku.x,0,-id.y,id.x,0];return!yC(n,hp,mp,gp,tE)||(n=[1,0,0,0,1,0,0,0,1],!yC(n,hp,mp,gp,tE))?!1:(nE.crossVectors(Lu,ku),n=[nE.x,nE.y,nE.z],yC(n,hp,mp,gp,tE))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,co).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(co).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:(Nl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nl),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 Nl=[new H,new H,new H,new H,new H,new H,new H,new H],co=new H,eE=new Di,hp=new H,mp=new H,gp=new H,Lu=new H,ku=new H,id=new H,Eg=new H,tE=new H,nE=new H,ad=new H;function yC(t,e,n,r,i){for(let a=0,s=t.length-3;a<=s;a+=3){ad.fromArray(t,a);const o=i.x*Math.abs(ad.x)+i.y*Math.abs(ad.y)+i.z*Math.abs(ad.z),l=e.dot(ad),u=n.dot(ad),c=r.dot(ad);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>o)return!1}return!0}const tve=new Di,_g=new H,vC=new H;let Li=class{constructor(e=new H,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):tve.setFromPoints(e).getCenter(r);let i=0;for(let a=0,s=e.length;athis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}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;_g.subVectors(e,this.center);const n=_g.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(_g,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?this.radius=Math.max(this.radius,e.radius):(vC.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(_g.copy(e.center).add(vC)),this.expandByPoint(_g.copy(e.center).sub(vC))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};const Ol=new H,EC=new H,rE=new H,Pu=new H,_C=new H,iE=new H,SC=new H;class Df{constructor(e=new H,n=new H(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ol)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Ol.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Ol.copy(this.origin).addScaledVector(this.direction,n),Ol.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){EC.copy(e).add(n).multiplyScalar(.5),rE.copy(n).sub(e).normalize(),Pu.copy(this.origin).sub(EC);const a=e.distanceTo(n)*.5,s=-this.direction.dot(rE),o=Pu.dot(this.direction),l=-Pu.dot(rE),u=Pu.lengthSq(),c=Math.abs(1-s*s);let d,f,m,g;if(c>0)if(d=s*l-o,f=s*o-l,g=a*c,d>=0)if(f>=-g)if(f<=g){const y=1/c;d*=y,f*=y,m=d*(d+s*f+2*o)+f*(s*d+f+2*l)+u}else f=a,d=Math.max(0,-(s*f+o)),m=-d*d+f*(f+2*l)+u;else f=-a,d=Math.max(0,-(s*f+o)),m=-d*d+f*(f+2*l)+u;else f<=-g?(d=Math.max(0,-(-s*a+o)),f=d>0?-a:Math.min(Math.max(-a,-l),a),m=-d*d+f*(f+2*l)+u):f<=g?(d=0,f=Math.min(Math.max(-a,-l),a),m=f*(f+2*l)+u):(d=Math.max(0,-(s*a+o)),f=d>0?a:Math.min(Math.max(-a,-l),a),m=-d*d+f*(f+2*l)+u);else f=s>0?-a:a,d=Math.max(0,-(s*f+o)),m=-d*d+f*(f+2*l)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(EC).addScaledVector(rE,f),m}intersectSphere(e,n){Ol.subVectors(e.center,this.origin);const r=Ol.dot(this.direction),i=Ol.dot(Ol)-r*r,a=e.radius*e.radius;if(i>a)return null;const s=Math.sqrt(a-i),o=r-s,l=r+s;return l<0?null:o<0?this.at(l,n):this.at(o,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,a,s,o,l;const u=1/this.direction.x,c=1/this.direction.y,d=1/this.direction.z,f=this.origin;return u>=0?(r=(e.min.x-f.x)*u,i=(e.max.x-f.x)*u):(r=(e.max.x-f.x)*u,i=(e.min.x-f.x)*u),c>=0?(a=(e.min.y-f.y)*c,s=(e.max.y-f.y)*c):(a=(e.max.y-f.y)*c,s=(e.min.y-f.y)*c),r>s||a>i||((a>r||isNaN(r))&&(r=a),(s=0?(o=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(o=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),r>l||o>i)||((o>r||r!==r)&&(r=o),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,Ol)!==null}intersectTriangle(e,n,r,i,a){_C.subVectors(n,e),iE.subVectors(r,e),SC.crossVectors(_C,iE);let s=this.direction.dot(SC),o;if(s>0){if(i)return null;o=1}else if(s<0)o=-1,s=-s;else return null;Pu.subVectors(this.origin,e);const l=o*this.direction.dot(iE.crossVectors(Pu,iE));if(l<0)return null;const u=o*this.direction.dot(_C.cross(Pu));if(u<0||l+u>s)return null;const c=-o*Pu.dot(SC);return c<0?null:this.at(c/s,a)}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 en{constructor(e,n,r,i,a,s,o,l,u,c,d,f,m,g,y,v){en.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,a,s,o,l,u,c,d,f,m,g,y,v)}set(e,n,r,i,a,s,o,l,u,c,d,f,m,g,y,v){const b=this.elements;return b[0]=e,b[4]=n,b[8]=r,b[12]=i,b[1]=a,b[5]=s,b[9]=o,b[13]=l,b[2]=u,b[6]=c,b[10]=d,b[14]=f,b[3]=m,b[7]=g,b[11]=y,b[15]=v,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 en().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/bp.setFromMatrixColumn(e,0).length(),a=1/bp.setFromMatrixColumn(e,1).length(),s=1/bp.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*a,n[5]=r[5]*a,n[6]=r[6]*a,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,a=e.z,s=Math.cos(r),o=Math.sin(r),l=Math.cos(i),u=Math.sin(i),c=Math.cos(a),d=Math.sin(a);if(e.order==="XYZ"){const f=s*c,m=s*d,g=o*c,y=o*d;n[0]=l*c,n[4]=-l*d,n[8]=u,n[1]=m+g*u,n[5]=f-y*u,n[9]=-o*l,n[2]=y-f*u,n[6]=g+m*u,n[10]=s*l}else if(e.order==="YXZ"){const f=l*c,m=l*d,g=u*c,y=u*d;n[0]=f+y*o,n[4]=g*o-m,n[8]=s*u,n[1]=s*d,n[5]=s*c,n[9]=-o,n[2]=m*o-g,n[6]=y+f*o,n[10]=s*l}else if(e.order==="ZXY"){const f=l*c,m=l*d,g=u*c,y=u*d;n[0]=f-y*o,n[4]=-s*d,n[8]=g+m*o,n[1]=m+g*o,n[5]=s*c,n[9]=y-f*o,n[2]=-s*u,n[6]=o,n[10]=s*l}else if(e.order==="ZYX"){const f=s*c,m=s*d,g=o*c,y=o*d;n[0]=l*c,n[4]=g*u-m,n[8]=f*u+y,n[1]=l*d,n[5]=y*u+f,n[9]=m*u-g,n[2]=-u,n[6]=o*l,n[10]=s*l}else if(e.order==="YZX"){const f=s*l,m=s*u,g=o*l,y=o*u;n[0]=l*c,n[4]=y-f*d,n[8]=g*d+m,n[1]=d,n[5]=s*c,n[9]=-o*c,n[2]=-u*c,n[6]=m*d+g,n[10]=f-y*d}else if(e.order==="XZY"){const f=s*l,m=s*u,g=o*l,y=o*u;n[0]=l*c,n[4]=-d,n[8]=u*c,n[1]=f*d+y,n[5]=s*c,n[9]=m*d-g,n[2]=g*d-m,n[6]=o*c,n[10]=y*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(nve,e,rve)}lookAt(e,n,r){const i=this.elements;return ds.subVectors(e,n),ds.lengthSq()===0&&(ds.z=1),ds.normalize(),Bu.crossVectors(r,ds),Bu.lengthSq()===0&&(Math.abs(r.z)===1?ds.x+=1e-4:ds.z+=1e-4,ds.normalize(),Bu.crossVectors(r,ds)),Bu.normalize(),aE.crossVectors(ds,Bu),i[0]=Bu.x,i[4]=aE.x,i[8]=ds.x,i[1]=Bu.y,i[5]=aE.y,i[9]=ds.y,i[2]=Bu.z,i[6]=aE.z,i[10]=ds.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,a=this.elements,s=r[0],o=r[4],l=r[8],u=r[12],c=r[1],d=r[5],f=r[9],m=r[13],g=r[2],y=r[6],v=r[10],b=r[14],E=r[3],_=r[7],A=r[11],I=r[15],x=i[0],R=i[4],O=i[8],N=i[12],M=i[1],B=i[5],G=i[9],W=i[13],K=i[2],se=i[6],ae=i[10],ee=i[14],F=i[3],ie=i[7],J=i[11],fe=i[15];return a[0]=s*x+o*M+l*K+u*F,a[4]=s*R+o*B+l*se+u*ie,a[8]=s*O+o*G+l*ae+u*J,a[12]=s*N+o*W+l*ee+u*fe,a[1]=c*x+d*M+f*K+m*F,a[5]=c*R+d*B+f*se+m*ie,a[9]=c*O+d*G+f*ae+m*J,a[13]=c*N+d*W+f*ee+m*fe,a[2]=g*x+y*M+v*K+b*F,a[6]=g*R+y*B+v*se+b*ie,a[10]=g*O+y*G+v*ae+b*J,a[14]=g*N+y*W+v*ee+b*fe,a[3]=E*x+_*M+A*K+I*F,a[7]=E*R+_*B+A*se+I*ie,a[11]=E*O+_*G+A*ae+I*J,a[15]=E*N+_*W+A*ee+I*fe,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],a=e[12],s=e[1],o=e[5],l=e[9],u=e[13],c=e[2],d=e[6],f=e[10],m=e[14],g=e[3],y=e[7],v=e[11],b=e[15];return g*(+a*l*d-i*u*d-a*o*f+r*u*f+i*o*m-r*l*m)+y*(+n*l*m-n*u*f+a*s*f-i*s*m+i*u*c-a*l*c)+v*(+n*u*d-n*o*m-a*s*d+r*s*m+a*o*c-r*u*c)+b*(-i*o*c-n*l*d+n*o*f+i*s*d-r*s*f+r*l*c)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,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]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],m=e[11],g=e[12],y=e[13],v=e[14],b=e[15],E=d*v*u-y*f*u+y*l*m-o*v*m-d*l*b+o*f*b,_=g*f*u-c*v*u-g*l*m+s*v*m+c*l*b-s*f*b,A=c*y*u-g*d*u+g*o*m-s*y*m-c*o*b+s*d*b,I=g*d*l-c*y*l-g*o*f+s*y*f+c*o*v-s*d*v,x=n*E+r*_+i*A+a*I;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/x;return e[0]=E*R,e[1]=(y*f*a-d*v*a-y*i*m+r*v*m+d*i*b-r*f*b)*R,e[2]=(o*v*a-y*l*a+y*i*u-r*v*u-o*i*b+r*l*b)*R,e[3]=(d*l*a-o*f*a-d*i*u+r*f*u+o*i*m-r*l*m)*R,e[4]=_*R,e[5]=(c*v*a-g*f*a+g*i*m-n*v*m-c*i*b+n*f*b)*R,e[6]=(g*l*a-s*v*a-g*i*u+n*v*u+s*i*b-n*l*b)*R,e[7]=(s*f*a-c*l*a+c*i*u-n*f*u-s*i*m+n*l*m)*R,e[8]=A*R,e[9]=(g*d*a-c*y*a-g*r*m+n*y*m+c*r*b-n*d*b)*R,e[10]=(s*y*a-g*o*a+g*r*u-n*y*u-s*r*b+n*o*b)*R,e[11]=(c*o*a-s*d*a-c*r*u+n*d*u+s*r*m-n*o*m)*R,e[12]=I*R,e[13]=(c*y*i-g*d*i+g*r*f-n*y*f-c*r*v+n*d*v)*R,e[14]=(g*o*i-s*y*i-g*r*l+n*y*l+s*r*v-n*o*v)*R,e[15]=(s*d*i-c*o*i+c*r*l-n*d*l-s*r*f+n*o*f)*R,this}scale(e){const n=this.elements,r=e.x,i=e.y,a=e.z;return n[0]*=r,n[4]*=i,n[8]*=a,n[1]*=r,n[5]*=i,n[9]*=a,n[2]*=r,n[6]*=i,n[10]*=a,n[3]*=r,n[7]*=i,n[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,n=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(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),a=1-r,s=e.x,o=e.y,l=e.z,u=a*s,c=a*o;return this.set(u*s+r,u*o-i*l,u*l+i*o,0,u*o+i*l,c*o+r,c*l-i*s,0,u*l-i*o,c*l+i*s,a*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,a,s){return this.set(1,r,a,0,e,1,s,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,a=n._x,s=n._y,o=n._z,l=n._w,u=a+a,c=s+s,d=o+o,f=a*u,m=a*c,g=a*d,y=s*c,v=s*d,b=o*d,E=l*u,_=l*c,A=l*d,I=r.x,x=r.y,R=r.z;return i[0]=(1-(y+b))*I,i[1]=(m+A)*I,i[2]=(g-_)*I,i[3]=0,i[4]=(m-A)*x,i[5]=(1-(f+b))*x,i[6]=(v+E)*x,i[7]=0,i[8]=(g+_)*R,i[9]=(v-E)*R,i[10]=(1-(f+y))*R,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let a=bp.set(i[0],i[1],i[2]).length();const s=bp.set(i[4],i[5],i[6]).length(),o=bp.set(i[8],i[9],i[10]).length();this.determinant()<0&&(a=-a),e.x=i[12],e.y=i[13],e.z=i[14],fo.copy(this);const u=1/a,c=1/s,d=1/o;return fo.elements[0]*=u,fo.elements[1]*=u,fo.elements[2]*=u,fo.elements[4]*=c,fo.elements[5]*=c,fo.elements[6]*=c,fo.elements[8]*=d,fo.elements[9]*=d,fo.elements[10]*=d,n.setFromRotationMatrix(fo),r.x=a,r.y=s,r.z=o,this}makePerspective(e,n,r,i,a,s,o=il){const l=this.elements,u=2*a/(n-e),c=2*a/(r-i),d=(n+e)/(n-e),f=(r+i)/(r-i);let m,g;if(o===il)m=-(s+a)/(s-a),g=-2*s*a/(s-a);else if(o===Ab)m=-s/(s-a),g=-s*a/(s-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=u,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=c,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=g,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,a,s,o=il){const l=this.elements,u=1/(n-e),c=1/(r-i),d=1/(s-a),f=(n+e)*u,m=(r+i)*c;let g,y;if(o===il)g=(s+a)*d,y=-2*d;else if(o===Ab)g=a*d,y=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=y,l[14]=-g,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const bp=new H,fo=new en,nve=new H(0,0,0),rve=new H(1,1,1),Bu=new H,aE=new H,ds=new H,CH=new en,RH=new Mn;class ss{constructor(e=0,n=0,r=0,i=ss.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,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,n,r,i=this._order){return this._x=e,this._y=n,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,n=this._order,r=!0){const i=e.elements,a=i[0],s=i[4],o=i[8],l=i[1],u=i[5],c=i[9],d=i[2],f=i[6],m=i[10];switch(n){case"XYZ":this._y=Math.asin(Yr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,m),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Yr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,a),this._z=0);break;case"ZXY":this._x=Math.asin(Yr(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-Yr(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(Yr(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-d,a)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-Yr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(o,a)):(this._x=Math.atan2(-c,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return CH.makeRotationFromQuaternion(e),this.setFromRotationMatrix(CH,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return RH.setFromEuler(this),this.setFromQuaternion(RH,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=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+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}}ss.DEFAULT_ORDER="XYZ";class ef{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function a(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=a(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let u=0,c=l.length;u0){i.children=[];for(let o=0;o0){i.animations=[];for(let o=0;o0&&(r.geometries=o),l.length>0&&(r.materials=l),u.length>0&&(r.textures=u),c.length>0&&(r.images=c),d.length>0&&(r.shapes=d),f.length>0&&(r.skeletons=f),m.length>0&&(r.animations=m),g.length>0&&(r.nodes=g)}return r.object=i,r;function s(o){const l=[];for(const u in o){const c=o[u];delete c.metadata,l.push(c)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!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.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(a)):i.set(0,0,0)}static getBarycoord(e,n,r,i,a){po.subVectors(i,n),Ll.subVectors(r,n),xC.subVectors(e,n);const s=po.dot(po),o=po.dot(Ll),l=po.dot(xC),u=Ll.dot(Ll),c=Ll.dot(xC),d=s*u-o*o;if(d===0)return a.set(0,0,0),null;const f=1/d,m=(u*l-o*c)*f,g=(s*c-o*l)*f;return a.set(1-m-g,g,m)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,kl)===null?!1:kl.x>=0&&kl.y>=0&&kl.x+kl.y<=1}static getInterpolation(e,n,r,i,a,s,o,l){return this.getBarycoord(e,n,r,i,kl)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(a,kl.x),l.addScaledVector(s,kl.y),l.addScaledVector(o,kl.z),l)}static getInterpolatedAttribute(e,n,r,i,a,s){return RC.setScalar(0),IC.setScalar(0),MC.setScalar(0),RC.fromBufferAttribute(e,n),IC.fromBufferAttribute(e,r),MC.fromBufferAttribute(e,i),s.setScalar(0),s.addScaledVector(RC,a.x),s.addScaledVector(IC,a.y),s.addScaledVector(MC,a.z),s}static isFrontFacing(e,n,r,i){return po.subVectors(r,n),Ll.subVectors(e,n),po.cross(Ll).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),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 po.subVectors(this.c,this.b),Ll.subVectors(this.a,this.b),po.cross(Ll).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ka.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Ka.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,r,i,a){return Ka.getInterpolation(e,this.a,this.b,this.c,n,r,i,a)}containsPoint(e){return Ka.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ka.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,a=this.c;let s,o;Ep.subVectors(i,r),_p.subVectors(a,r),TC.subVectors(e,r);const l=Ep.dot(TC),u=_p.dot(TC);if(l<=0&&u<=0)return n.copy(r);wC.subVectors(e,i);const c=Ep.dot(wC),d=_p.dot(wC);if(c>=0&&d<=c)return n.copy(i);const f=l*d-c*u;if(f<=0&&l>=0&&c<=0)return s=l/(l-c),n.copy(r).addScaledVector(Ep,s);CC.subVectors(e,a);const m=Ep.dot(CC),g=_p.dot(CC);if(g>=0&&m<=g)return n.copy(a);const y=m*u-l*g;if(y<=0&&u>=0&&g<=0)return o=u/(u-g),n.copy(r).addScaledVector(_p,o);const v=c*g-m*d;if(v<=0&&d-c>=0&&m-g>=0)return LH.subVectors(a,i),o=(d-c)/(d-c+(m-g)),n.copy(i).addScaledVector(LH,o);const b=1/(v+y+f);return s=y*b,o=f*b,n.copy(r).addScaledVector(Ep,s).addScaledVector(_p,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const vq={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},Fu={h:0,s:0,l:0},oE={h:0,s:0,l:0};function NC(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let vt=class{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Ia){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Un.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Un.workingColorSpace){return this.r=e,this.g=n,this.b=r,Un.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Un.workingColorSpace){if(e=QO(e,1),n=Yr(n,0,1),r=Yr(r,0,1),n===0)this.r=this.g=this.b=r;else{const a=r<=.5?r*(1+n):r+n-r*n,s=2*r-a;this.r=NC(s,a,e+1/3),this.g=NC(s,a,e),this.b=NC(s,a,e-1/3)}return Un.toWorkingColorSpace(this,i),this}setStyle(e,n=Ia){function r(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const s=i[1],o=i[2];switch(s){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,n);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,n);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const a=i[1],s=a.length;if(s===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,n);if(s===6)return this.setHex(parseInt(a,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Ia){const r=vq[e.toLowerCase()];return r!==void 0?this.setHex(r,n):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=uu(e.r),this.g=uu(e.g),this.b=uu(e.b),this}copyLinearToSRGB(e){return this.r=wh(e.r),this.g=wh(e.g),this.b=wh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ia){return Un.fromWorkingColorSpace(oa.copy(this),e),Math.round(Yr(oa.r*255,0,255))*65536+Math.round(Yr(oa.g*255,0,255))*256+Math.round(Yr(oa.b*255,0,255))}getHexString(e=Ia){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Un.workingColorSpace){Un.fromWorkingColorSpace(oa.copy(this),n);const r=oa.r,i=oa.g,a=oa.b,s=Math.max(r,i,a),o=Math.min(r,i,a);let l,u;const c=(o+s)/2;if(o===s)l=0,u=0;else{const d=s-o;switch(u=c<=.5?d/(s+o):d/(2-s-o),s){case r:l=(i-a)/d+(i0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.6,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!==void 0&&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.dispersion!==void 0&&(r.dispersion=this.dispersion),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.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.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.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),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&&this.attenuationDistance!==1/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!==Zd&&(r.blending=this.blending),this.side!==gl&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==HS&&(r.blendSrc=this.blendSrc),this.blendDst!==GS&&(r.blendDst=this.blendDst),this.blendEquation!==nc&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==mf&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==IM&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==xd&&(r.stencilFail=this.stencilFail),this.stencilZFail!==xd&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==xd&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),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.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),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=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(a){const s=[];for(const o in a){const l=a[o];delete l.metadata,s.push(l)}return s}if(n){const a=i(e.textures),s=i(e.images);a.length>0&&(r.textures=a),s.length>0&&(r.images=s)}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.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let a=0;a!==i;++a)r[a]=n[a].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.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class $i extends ii{static get type(){return"MeshBasicMaterial"}constructor(e){super(),this.isMeshBasicMaterial=!0,this.color=new vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ss,this.combine=Zb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Yl=uve();function uve(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const u=l-127;u<-27?(r[l]=0,r[l|256]=32768,i[l]=24,i[l|256]=24):u<-14?(r[l]=1024>>-u-14,r[l|256]=1024>>-u-14|32768,i[l]=-u-1,i[l|256]=-u-1):u<=15?(r[l]=u+15<<10,r[l|256]=u+15<<10|32768,i[l]=13,i[l|256]=13):u<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[l|256]=13)}const a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,c=0;for(;!(u&8388608);)u<<=1,c-=8388608;u&=-8388609,c+=947912704,a[l]=u|c}for(let l=1024;l<2048;++l)a[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)s[l]=l<<23;s[31]=1199570944,s[32]=2147483648;for(let l=33;l<63;++l)s[l]=2147483648+(l-32<<23);s[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:s,offsetTable:o}}function $a(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Yr(t,-65504,65504),Yl.floatView[0]=t;const e=Yl.uint32View[0],n=e>>23&511;return Yl.baseTable[n]+((e&8388607)>>Yl.shiftTable[n])}function n0(t){const e=t>>10;return Yl.uint32View[0]=Yl.mantissaTable[Yl.offsetTable[e]+(t&1023)]+Yl.exponentTable[e],Yl.floatView[0]}const zd={toHalfFloat:$a,fromHalfFloat:n0},oi=new H,lE=new Ke;class Kn{constructor(e,n,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=Sb,this.updateRanges=[],this.gpuType=Or,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,a=this.itemSize;in.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Di);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new H(-1/0,-1/0,-1/0),new H(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let r=0,i=n.length;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const u=r[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let a=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],c=[];for(let d=0,f=u.length;d0&&(i[l]=c,a=!0)}a&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.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 n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const u in i){const c=i[u];this.setAttribute(u,c.clone(n))}const a=e.morphAttributes;for(const u in a){const c=[],d=a[u];for(let f=0,m=d.length;f0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;a(e.far-e.near)**2))&&(kH.copy(a).invert(),sd.copy(e.ray).applyMatrix4(kH),!(r.boundingBox!==null&&sd.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,sd)))}_computeIntersections(e,n,r){let i;const a=this.geometry,s=this.material,o=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,d=a.attributes.normal,f=a.groups,m=a.drawRange;if(o!==null)if(Array.isArray(s))for(let g=0,y=f.length;gn.far?null:{distance:u,point:hE.clone(),object:t}}function mE(t,e,n,r,i,a,s,o,l,u){t.getVertexPosition(o,cE),t.getVertexPosition(l,dE),t.getVertexPosition(u,fE);const c=bve(t,e,n,r,cE,dE,fE,BH);if(c){const d=new H;Ka.getBarycoord(BH,cE,dE,fE,d),i&&(c.uv=Ka.getInterpolatedAttribute(i,o,l,u,d,new Ke)),a&&(c.uv1=Ka.getInterpolatedAttribute(a,o,l,u,d,new Ke)),s&&(c.normal=Ka.getInterpolatedAttribute(s,o,l,u,d,new H),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const f={a:o,b:l,c:u,normal:new H,materialIndex:0};Ka.getNormal(cE,dE,fE,f.normal),c.face=f,c.barycoord=d}return c}class Ya extends fn{constructor(e=1,n=1,r=1,i=1,a=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:a,depthSegments:s};const o=this;i=Math.floor(i),a=Math.floor(a),s=Math.floor(s);const l=[],u=[],c=[],d=[];let f=0,m=0;g("z","y","x",-1,-1,r,n,e,s,a,0),g("z","y","x",1,-1,r,n,-e,s,a,1),g("x","z","y",1,1,e,r,n,i,s,2),g("x","z","y",1,-1,e,r,-n,i,s,3),g("x","y","z",1,-1,e,n,r,i,a,4),g("x","y","z",-1,-1,e,n,-r,i,a,5),this.setIndex(l),this.setAttribute("position",new qt(u,3)),this.setAttribute("normal",new qt(c,3)),this.setAttribute("uv",new qt(d,2));function g(y,v,b,E,_,A,I,x,R,O,N){const M=A/R,B=I/O,G=A/2,W=I/2,K=x/2,se=R+1,ae=O+1;let ee=0,F=0;const ie=new H;for(let J=0;J0?1:-1,c.push(ie.x,ie.y,ie.z),d.push(Ce/R),d.push(1-J/O),ee+=1}}for(let J=0;J0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class ny extends _n{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new en,this.projectionMatrix=new en,this.projectionMatrixInverse=new en,this.coordinateSystem=il}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Uu=new H,FH=new Ke,UH=new Ke;let qr=class extends ny{constructor(e=50,n=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=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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 n=.5*this.getFilmHeight()/e;this.fov=Qh*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Jd*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Qh*2*Math.atan(Math.tan(Jd*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,r){Uu.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Uu.x,Uu.y).multiplyScalar(-e/Uu.z),Uu.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(Uu.x,Uu.y).multiplyScalar(-e/Uu.z)}getViewSize(e,n){return this.getViewBounds(e,FH,UH),n.subVectors(UH,FH)}setViewOffset(e,n,r,i,a,s){this.aspect=e/n,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=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Jd*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,a=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,u=s.fullHeight;a+=s.offsetX*i/l,n-=s.offsetY*r/u,i*=s.width/l,r*=s.height/u}const o=this.filmOffset;o!==0&&(a+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+i,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}};const Ap=-90,Tp=1;class Sq extends _n{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new qr(Ap,Tp,e,n);i.layers=this.layers,this.add(i);const a=new qr(Ap,Tp,e,n);a.layers=this.layers,this.add(a);const s=new qr(Ap,Tp,e,n);s.layers=this.layers,this.add(s);const o=new qr(Ap,Tp,e,n);o.layers=this.layers,this.add(o);const l=new qr(Ap,Tp,e,n);l.layers=this.layers,this.add(l);const u=new qr(Ap,Tp,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,a,s,o,l]=n;for(const u of n)this.remove(u);if(e===il)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ab)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of n)this.add(u),u.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,s,o,l,u,c]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const y=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,a),e.setRenderTarget(r,1,i),e.render(n,s),e.setRenderTarget(r,2,i),e.render(n,o),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,u),r.texture.generateMipmaps=y,e.setRenderTarget(r,5,i),e.render(n,c),e.setRenderTarget(d,f,m),e.xr.enabled=g,r.texture.needsPMREMUpdate=!0}}class ry extends $n{constructor(e,n,r,i,a,s,o,l,u,c){e=e!==void 0?e:[],n=n!==void 0?n:bl,super(e,n,r,i,a,s,o,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class rD extends ki{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new ry(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Xn}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class qi extends ii{static get type(){return"ShaderMaterial"}constructor(e){super(),this.isShaderMaterial=!0,this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=vve,this.fragmentShader=Eve,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Jh(e.uniforms),this.uniformsGroups=yve(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const i in this.uniforms){const s=this.uniforms[i].value;s&&s.isTexture?n.uniforms[i]={type:"t",value:s.toJSON(e).uuid}:s&&s.isColor?n.uniforms[i]={type:"c",value:s.getHex()}:s&&s.isVector2?n.uniforms[i]={type:"v2",value:s.toArray()}:s&&s.isVector3?n.uniforms[i]={type:"v3",value:s.toArray()}:s&&s.isVector4?n.uniforms[i]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?n.uniforms[i]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?n.uniforms[i]={type:"m4",value:s.toArray()}:n.uniforms[i]={value:s}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class ny extends Sn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new en,this.projectionMatrix=new en,this.projectionMatrixInverse=new en,this.coordinateSystem=il}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Uu=new H,FH=new Ke,UH=new Ke;let qr=class extends ny{constructor(e=50,n=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=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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 n=.5*this.getFilmHeight()/e;this.fov=Qh*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Jd*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Qh*2*Math.atan(Math.tan(Jd*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,r){Uu.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Uu.x,Uu.y).multiplyScalar(-e/Uu.z),Uu.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(Uu.x,Uu.y).multiplyScalar(-e/Uu.z)}getViewSize(e,n){return this.getViewBounds(e,FH,UH),n.subVectors(UH,FH)}setViewOffset(e,n,r,i,a,s){this.aspect=e/n,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=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Jd*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,a=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,u=s.fullHeight;a+=s.offsetX*i/l,n-=s.offsetY*r/u,i*=s.width/l,r*=s.height/u}const o=this.filmOffset;o!==0&&(a+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+i,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}};const Ap=-90,xp=1;class _q extends Sn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new qr(Ap,xp,e,n);i.layers=this.layers,this.add(i);const a=new qr(Ap,xp,e,n);a.layers=this.layers,this.add(a);const s=new qr(Ap,xp,e,n);s.layers=this.layers,this.add(s);const o=new qr(Ap,xp,e,n);o.layers=this.layers,this.add(o);const l=new qr(Ap,xp,e,n);l.layers=this.layers,this.add(l);const u=new qr(Ap,xp,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,a,s,o,l]=n;for(const u of n)this.remove(u);if(e===il)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ab)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of n)this.add(u),u.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,s,o,l,u,c]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const y=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,a),e.setRenderTarget(r,1,i),e.render(n,s),e.setRenderTarget(r,2,i),e.render(n,o),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,u),r.texture.generateMipmaps=y,e.setRenderTarget(r,5,i),e.render(n,c),e.setRenderTarget(d,f,m),e.xr.enabled=g,r.texture.needsPMREMUpdate=!0}}class ry extends $n{constructor(e,n,r,i,a,s,o,l,u,c){e=e!==void 0?e:[],n=n!==void 0?n:bl,super(e,n,r,i,a,s,o,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class rD extends ki{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new ry(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Xn}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -416,9 +416,9 @@ Error generating stack: `+a.message+` gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},i=new Ya(5,5,5),a=new qi({name:"CubemapFromEquirect",uniforms:Jh(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:ka,blending:dl});a.uniforms.tEquirect.value=n;const s=new Ot(i,a),o=n.minFilter;return n.minFilter===Js&&(n.minFilter=Xn),new Sq(1,10,this).update(e,s),n.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(e,n,r,i){const a=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(n,r,i);e.setRenderTarget(a)}}const LC=new H,Sve=new H,_ve=new vn;let Hl=class{constructor(e=new H(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,r,i){return this.normal.set(e,n,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,r){const i=LC.subVectors(r,n).cross(Sve.subVectors(e,n)).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,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const r=e.delta(LC),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/i;return a<0||a>1?null:n.copy(e.start).addScaledVector(r,a)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>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,n){const r=n||_ve.getNormalMatrix(e),i=this.coplanarPoint(LC).applyMatrix4(e),a=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(a),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 od=new Li,gE=new H;class iy{constructor(e=new Hl,n=new Hl,r=new Hl,i=new Hl,a=new Hl,s=new Hl){this.planes=[e,n,r,i,a,s]}set(e,n,r,i,a,s){const o=this.planes;return o[0].copy(e),o[1].copy(n),o[2].copy(r),o[3].copy(i),o[4].copy(a),o[5].copy(s),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=il){const r=this.planes,i=e.elements,a=i[0],s=i[1],o=i[2],l=i[3],u=i[4],c=i[5],d=i[6],f=i[7],m=i[8],g=i[9],y=i[10],v=i[11],b=i[12],E=i[13],S=i[14],A=i[15];if(r[0].setComponents(l-a,f-u,v-m,A-b).normalize(),r[1].setComponents(l+a,f+u,v+m,A+b).normalize(),r[2].setComponents(l+s,f+c,v+g,A+E).normalize(),r[3].setComponents(l-s,f-c,v-g,A-E).normalize(),r[4].setComponents(l-o,f-d,v-y,A-S).normalize(),n===il)r[5].setComponents(l+o,f+d,v+y,A+S).normalize();else if(n===Ab)r[5].setComponents(o,d,y,S).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),od.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),od.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(od)}intersectsSprite(e){return od.center.set(0,0,0),od.radius=.7071067811865476,od.applyMatrix4(e.matrixWorld),this.intersectsSphere(od)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let a=0;a<6;a++)if(n[a].distanceToPoint(r)0?e.max.x:e.min.x,gE.y=i.normal.y>0?e.max.y:e.min.y,gE.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(gE)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function _q(){let t=null,e=!1,n=null,r=null;function i(a,s){n(a,s),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(a){n=a},setContext:function(a){t=a}}}function Ave(t){const e=new WeakMap;function n(o,l){const u=o.array,c=o.usage,d=u.byteLength,f=t.createBuffer();t.bindBuffer(l,f),t.bufferData(l,u,c),o.onUploadCallback();let m;if(u instanceof Float32Array)m=t.FLOAT;else if(u instanceof Uint16Array)o.isFloat16BufferAttribute?m=t.HALF_FLOAT:m=t.UNSIGNED_SHORT;else if(u instanceof Int16Array)m=t.SHORT;else if(u instanceof Uint32Array)m=t.UNSIGNED_INT;else if(u instanceof Int32Array)m=t.INT;else if(u instanceof Int8Array)m=t.BYTE;else if(u instanceof Uint8Array)m=t.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)m=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:f,type:m,bytesPerElement:u.BYTES_PER_ELEMENT,version:o.version,size:d}}function r(o,l,u){const c=l.array,d=l.updateRanges;if(t.bindBuffer(u,o),d.length===0)t.bufferSubData(u,0,c);else{d.sort((m,g)=>m.start-g.start);let f=0;for(let m=1;m1?null:n.copy(e.start).addScaledVector(r,a)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>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,n){const r=n||Sve.getNormalMatrix(e),i=this.coplanarPoint(LC).applyMatrix4(e),a=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(a),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 od=new Li,gE=new H;class iy{constructor(e=new Hl,n=new Hl,r=new Hl,i=new Hl,a=new Hl,s=new Hl){this.planes=[e,n,r,i,a,s]}set(e,n,r,i,a,s){const o=this.planes;return o[0].copy(e),o[1].copy(n),o[2].copy(r),o[3].copy(i),o[4].copy(a),o[5].copy(s),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=il){const r=this.planes,i=e.elements,a=i[0],s=i[1],o=i[2],l=i[3],u=i[4],c=i[5],d=i[6],f=i[7],m=i[8],g=i[9],y=i[10],v=i[11],b=i[12],E=i[13],_=i[14],A=i[15];if(r[0].setComponents(l-a,f-u,v-m,A-b).normalize(),r[1].setComponents(l+a,f+u,v+m,A+b).normalize(),r[2].setComponents(l+s,f+c,v+g,A+E).normalize(),r[3].setComponents(l-s,f-c,v-g,A-E).normalize(),r[4].setComponents(l-o,f-d,v-y,A-_).normalize(),n===il)r[5].setComponents(l+o,f+d,v+y,A+_).normalize();else if(n===Ab)r[5].setComponents(o,d,y,_).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),od.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),od.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(od)}intersectsSprite(e){return od.center.set(0,0,0),od.radius=.7071067811865476,od.applyMatrix4(e.matrixWorld),this.intersectsSphere(od)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let a=0;a<6;a++)if(n[a].distanceToPoint(r)0?e.max.x:e.min.x,gE.y=i.normal.y>0?e.max.y:e.min.y,gE.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(gE)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Sq(){let t=null,e=!1,n=null,r=null;function i(a,s){n(a,s),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(a){n=a},setContext:function(a){t=a}}}function Ave(t){const e=new WeakMap;function n(o,l){const u=o.array,c=o.usage,d=u.byteLength,f=t.createBuffer();t.bindBuffer(l,f),t.bufferData(l,u,c),o.onUploadCallback();let m;if(u instanceof Float32Array)m=t.FLOAT;else if(u instanceof Uint16Array)o.isFloat16BufferAttribute?m=t.HALF_FLOAT:m=t.UNSIGNED_SHORT;else if(u instanceof Int16Array)m=t.SHORT;else if(u instanceof Uint32Array)m=t.UNSIGNED_INT;else if(u instanceof Int32Array)m=t.INT;else if(u instanceof Int8Array)m=t.BYTE;else if(u instanceof Uint8Array)m=t.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)m=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:f,type:m,bytesPerElement:u.BYTES_PER_ELEMENT,version:o.version,size:d}}function r(o,l,u){const c=l.array,d=l.updateRanges;if(t.bindBuffer(u,o),d.length===0)t.bufferSubData(u,0,c);else{d.sort((m,g)=>m.start-g.start);let f=0;for(let m=1;m 0 +#endif`,a_e=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -2248,7 +2248,7 @@ gl_Position = projectionMatrix * mvPosition;`,tSe=`#ifdef DITHERING } return mix( 1.0, shadow, shadowIntensity ); } -#endif`,sSe=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,s_e=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -2289,7 +2289,7 @@ gl_Position = projectionMatrix * mvPosition;`,tSe=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,oSe=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,o_e=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -2321,7 +2321,7 @@ gl_Position = projectionMatrix * mvPosition;`,tSe=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,lSe=`float getShadowMask() { +#endif`,l_e=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2353,12 +2353,12 @@ gl_Position = projectionMatrix * mvPosition;`,tSe=`#ifdef DITHERING #endif #endif return shadow; -}`,uSe=`#ifdef USE_SKINNING +}`,u_e=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,cSe=`#ifdef USE_SKINNING +#endif`,c_e=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2373,7 +2373,7 @@ gl_Position = projectionMatrix * mvPosition;`,tSe=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,dSe=`#ifdef USE_SKINNING +#endif`,d_e=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2381,7 +2381,7 @@ gl_Position = projectionMatrix * mvPosition;`,tSe=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,fSe=`#ifdef USE_SKINNING +#endif`,f_e=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2392,17 +2392,17 @@ gl_Position = projectionMatrix * mvPosition;`,tSe=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,pSe=`float specularStrength; +#endif`,p_e=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,hSe=`#ifdef USE_SPECULARMAP +#endif`,h_e=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,mSe=`#if defined( TONE_MAPPING ) +#endif`,m_e=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,gSe=`#ifndef saturate +#endif`,g_e=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2499,7 +2499,7 @@ vec3 NeutralToneMapping( vec3 color ) { float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,bSe=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,b_e=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2520,7 +2520,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,bSe=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,ySe=`#ifdef USE_TRANSMISSION +#endif`,y_e=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2651,7 +2651,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,bSe=`#ifdef USE_TRANSMIS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,vSe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,v_e=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2721,7 +2721,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,bSe=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,ESe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,E_e=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2815,7 +2815,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,bSe=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,SSe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,__e=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2886,7 +2886,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,bSe=`#ifdef USE_TRANSMIS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,_Se=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,S_e=`#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_BATCHING worldPosition = batchingMatrix * worldPosition; @@ -2895,12 +2895,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,bSe=`#ifdef USE_TRANSMIS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const ASe=`varying vec2 vUv; +#endif`;const A_e=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,TSe=`uniform sampler2D t2D; +}`,x_e=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2912,14 +2912,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,xSe=`varying vec3 vWorldDirection; +}`,T_e=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,wSe=`#ifdef ENVMAP_TYPE_CUBE +}`,w_e=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2942,14 +2942,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,CSe=`varying vec3 vWorldDirection; +}`,C_e=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,RSe=`uniform samplerCube tCube; +}`,R_e=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2959,7 +2959,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,ISe=`#include +}`,I_e=`#include #include #include #include @@ -2986,7 +2986,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,MSe=`#if DEPTH_PACKING == 3200 +}`,M_e=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -3020,7 +3020,7 @@ void main() { #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif -}`,NSe=`#define DISTANCE +}`,N_e=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -3047,7 +3047,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,OSe=`#define DISTANCE +}`,O_e=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -3071,13 +3071,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,DSe=`varying vec3 vWorldDirection; +}`,D_e=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,LSe=`uniform sampler2D tEquirect; +}`,L_e=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -3086,7 +3086,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,kSe=`uniform float scale; +}`,k_e=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -3108,7 +3108,7 @@ void main() { #include #include #include -}`,PSe=`uniform vec3 diffuse; +}`,P_e=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -3136,7 +3136,7 @@ void main() { #include #include #include -}`,BSe=`#include +}`,B_e=`#include #include #include #include @@ -3168,7 +3168,7 @@ void main() { #include #include #include -}`,FSe=`uniform vec3 diffuse; +}`,F_e=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -3216,7 +3216,7 @@ void main() { #include #include #include -}`,USe=`#define LAMBERT +}`,U_e=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -3255,7 +3255,7 @@ void main() { #include #include #include -}`,zSe=`#define LAMBERT +}`,z_e=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3312,7 +3312,7 @@ void main() { #include #include #include -}`,HSe=`#define MATCAP +}`,H_e=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -3346,7 +3346,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,GSe=`#define MATCAP +}`,G_e=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3392,7 +3392,7 @@ void main() { #include #include #include -}`,VSe=`#define NORMAL +}`,V_e=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3425,7 +3425,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,$Se=`#define NORMAL +}`,$_e=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3447,7 +3447,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,WSe=`#define PHONG +}`,W_e=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3486,7 +3486,7 @@ void main() { #include #include #include -}`,jSe=`#define PHONG +}`,j_e=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3545,7 +3545,7 @@ void main() { #include #include #include -}`,YSe=`#define STANDARD +}`,Y_e=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3588,7 +3588,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,qSe=`#define STANDARD +}`,q_e=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3713,7 +3713,7 @@ void main() { #include #include #include -}`,XSe=`#define TOON +}`,X_e=`#define TOON varying vec3 vViewPosition; #include #include @@ -3750,7 +3750,7 @@ void main() { #include #include #include -}`,KSe=`#define TOON +}`,K_e=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3803,7 +3803,7 @@ void main() { #include #include #include -}`,ZSe=`uniform float size; +}`,Z_e=`uniform float size; uniform float scale; #include #include @@ -3834,7 +3834,7 @@ void main() { #include #include #include -}`,QSe=`uniform vec3 diffuse; +}`,Q_e=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3859,7 +3859,7 @@ void main() { #include #include #include -}`,JSe=`#include +}`,J_e=`#include #include #include #include @@ -3882,7 +3882,7 @@ void main() { #include #include #include -}`,e_e=`uniform vec3 color; +}`,eSe=`uniform vec3 color; uniform float opacity; #include #include @@ -3898,7 +3898,7 @@ void main() { #include #include #include -}`,t_e=`uniform float rotation; +}`,tSe=`uniform float rotation; uniform vec2 center; #include #include @@ -3922,7 +3922,7 @@ void main() { #include #include #include -}`,n_e=`uniform vec3 diffuse; +}`,nSe=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3947,7 +3947,7 @@ void main() { #include #include #include -}`,yn={alphahash_fragment:Tve,alphahash_pars_fragment:xve,alphamap_fragment:wve,alphamap_pars_fragment:Cve,alphatest_fragment:Rve,alphatest_pars_fragment:Ive,aomap_fragment:Mve,aomap_pars_fragment:Nve,batching_pars_vertex:Ove,batching_vertex:Dve,begin_vertex:Lve,beginnormal_vertex:kve,bsdfs:Pve,iridescence_fragment:Bve,bumpmap_pars_fragment:Fve,clipping_planes_fragment:Uve,clipping_planes_pars_fragment:zve,clipping_planes_pars_vertex:Hve,clipping_planes_vertex:Gve,color_fragment:Vve,color_pars_fragment:$ve,color_pars_vertex:Wve,color_vertex:jve,common:Yve,cube_uv_reflection_fragment:qve,defaultnormal_vertex:Xve,displacementmap_pars_vertex:Kve,displacementmap_vertex:Zve,emissivemap_fragment:Qve,emissivemap_pars_fragment:Jve,colorspace_fragment:eEe,colorspace_pars_fragment:tEe,envmap_fragment:nEe,envmap_common_pars_fragment:rEe,envmap_pars_fragment:iEe,envmap_pars_vertex:aEe,envmap_physical_pars_fragment:gEe,envmap_vertex:sEe,fog_vertex:oEe,fog_pars_vertex:lEe,fog_fragment:uEe,fog_pars_fragment:cEe,gradientmap_pars_fragment:dEe,lightmap_pars_fragment:fEe,lights_lambert_fragment:pEe,lights_lambert_pars_fragment:hEe,lights_pars_begin:mEe,lights_toon_fragment:bEe,lights_toon_pars_fragment:yEe,lights_phong_fragment:vEe,lights_phong_pars_fragment:EEe,lights_physical_fragment:SEe,lights_physical_pars_fragment:_Ee,lights_fragment_begin:AEe,lights_fragment_maps:TEe,lights_fragment_end:xEe,logdepthbuf_fragment:wEe,logdepthbuf_pars_fragment:CEe,logdepthbuf_pars_vertex:REe,logdepthbuf_vertex:IEe,map_fragment:MEe,map_pars_fragment:NEe,map_particle_fragment:OEe,map_particle_pars_fragment:DEe,metalnessmap_fragment:LEe,metalnessmap_pars_fragment:kEe,morphinstance_vertex:PEe,morphcolor_vertex:BEe,morphnormal_vertex:FEe,morphtarget_pars_vertex:UEe,morphtarget_vertex:zEe,normal_fragment_begin:HEe,normal_fragment_maps:GEe,normal_pars_fragment:VEe,normal_pars_vertex:$Ee,normal_vertex:WEe,normalmap_pars_fragment:jEe,clearcoat_normal_fragment_begin:YEe,clearcoat_normal_fragment_maps:qEe,clearcoat_pars_fragment:XEe,iridescence_pars_fragment:KEe,opaque_fragment:ZEe,packing:QEe,premultiplied_alpha_fragment:JEe,project_vertex:eSe,dithering_fragment:tSe,dithering_pars_fragment:nSe,roughnessmap_fragment:rSe,roughnessmap_pars_fragment:iSe,shadowmap_pars_fragment:aSe,shadowmap_pars_vertex:sSe,shadowmap_vertex:oSe,shadowmask_pars_fragment:lSe,skinbase_vertex:uSe,skinning_pars_vertex:cSe,skinning_vertex:dSe,skinnormal_vertex:fSe,specularmap_fragment:pSe,specularmap_pars_fragment:hSe,tonemapping_fragment:mSe,tonemapping_pars_fragment:gSe,transmission_fragment:bSe,transmission_pars_fragment:ySe,uv_pars_fragment:vSe,uv_pars_vertex:ESe,uv_vertex:SSe,worldpos_vertex:_Se,background_vert:ASe,background_frag:TSe,backgroundCube_vert:xSe,backgroundCube_frag:wSe,cube_vert:CSe,cube_frag:RSe,depth_vert:ISe,depth_frag:MSe,distanceRGBA_vert:NSe,distanceRGBA_frag:OSe,equirect_vert:DSe,equirect_frag:LSe,linedashed_vert:kSe,linedashed_frag:PSe,meshbasic_vert:BSe,meshbasic_frag:FSe,meshlambert_vert:USe,meshlambert_frag:zSe,meshmatcap_vert:HSe,meshmatcap_frag:GSe,meshnormal_vert:VSe,meshnormal_frag:$Se,meshphong_vert:WSe,meshphong_frag:jSe,meshphysical_vert:YSe,meshphysical_frag:qSe,meshtoon_vert:XSe,meshtoon_frag:KSe,points_vert:ZSe,points_frag:QSe,shadow_vert:JSe,shadow_frag:e_e,sprite_vert:t_e,sprite_frag:n_e},It={common:{diffuse:{value:new vt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new vn},alphaMap:{value:null},alphaMapTransform:{value:new vn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new vn}},envmap:{envMap:{value:null},envMapRotation:{value:new vn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new vn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new vn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new vn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new vn},normalScale:{value:new Ke(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new vn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new vn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new vn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new vn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new vt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 vt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new vn},alphaTest:{value:0},uvTransform:{value:new vn}},sprite:{diffuse:{value:new vt(16777215)},opacity:{value:1},center:{value:new Ke(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new vn},alphaMap:{value:null},alphaMapTransform:{value:new vn},alphaTest:{value:0}}},Eo={basic:{uniforms:wa([It.common,It.specularmap,It.envmap,It.aomap,It.lightmap,It.fog]),vertexShader:yn.meshbasic_vert,fragmentShader:yn.meshbasic_frag},lambert:{uniforms:wa([It.common,It.specularmap,It.envmap,It.aomap,It.lightmap,It.emissivemap,It.bumpmap,It.normalmap,It.displacementmap,It.fog,It.lights,{emissive:{value:new vt(0)}}]),vertexShader:yn.meshlambert_vert,fragmentShader:yn.meshlambert_frag},phong:{uniforms:wa([It.common,It.specularmap,It.envmap,It.aomap,It.lightmap,It.emissivemap,It.bumpmap,It.normalmap,It.displacementmap,It.fog,It.lights,{emissive:{value:new vt(0)},specular:{value:new vt(1118481)},shininess:{value:30}}]),vertexShader:yn.meshphong_vert,fragmentShader:yn.meshphong_frag},standard:{uniforms:wa([It.common,It.envmap,It.aomap,It.lightmap,It.emissivemap,It.bumpmap,It.normalmap,It.displacementmap,It.roughnessmap,It.metalnessmap,It.fog,It.lights,{emissive:{value:new vt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yn.meshphysical_vert,fragmentShader:yn.meshphysical_frag},toon:{uniforms:wa([It.common,It.aomap,It.lightmap,It.emissivemap,It.bumpmap,It.normalmap,It.displacementmap,It.gradientmap,It.fog,It.lights,{emissive:{value:new vt(0)}}]),vertexShader:yn.meshtoon_vert,fragmentShader:yn.meshtoon_frag},matcap:{uniforms:wa([It.common,It.bumpmap,It.normalmap,It.displacementmap,It.fog,{matcap:{value:null}}]),vertexShader:yn.meshmatcap_vert,fragmentShader:yn.meshmatcap_frag},points:{uniforms:wa([It.points,It.fog]),vertexShader:yn.points_vert,fragmentShader:yn.points_frag},dashed:{uniforms:wa([It.common,It.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yn.linedashed_vert,fragmentShader:yn.linedashed_frag},depth:{uniforms:wa([It.common,It.displacementmap]),vertexShader:yn.depth_vert,fragmentShader:yn.depth_frag},normal:{uniforms:wa([It.common,It.bumpmap,It.normalmap,It.displacementmap,{opacity:{value:1}}]),vertexShader:yn.meshnormal_vert,fragmentShader:yn.meshnormal_frag},sprite:{uniforms:wa([It.sprite,It.fog]),vertexShader:yn.sprite_vert,fragmentShader:yn.sprite_frag},background:{uniforms:{uvTransform:{value:new vn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yn.background_vert,fragmentShader:yn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new vn}},vertexShader:yn.backgroundCube_vert,fragmentShader:yn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yn.cube_vert,fragmentShader:yn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yn.equirect_vert,fragmentShader:yn.equirect_frag},distanceRGBA:{uniforms:wa([It.common,It.displacementmap,{referencePosition:{value:new H},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yn.distanceRGBA_vert,fragmentShader:yn.distanceRGBA_frag},shadow:{uniforms:wa([It.lights,It.fog,{color:{value:new vt(0)},opacity:{value:1}}]),vertexShader:yn.shadow_vert,fragmentShader:yn.shadow_frag}};Eo.physical={uniforms:wa([Eo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new vn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new vn},clearcoatNormalScale:{value:new Ke(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new vn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new vn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new vn},sheen:{value:0},sheenColor:{value:new vt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new vn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new vn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new vn},transmissionSamplerSize:{value:new Ke},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new vn},attenuationDistance:{value:0},attenuationColor:{value:new vt(0)},specularColor:{value:new vt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new vn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new vn},anisotropyVector:{value:new Ke},anisotropyMap:{value:null},anisotropyMapTransform:{value:new vn}}]),vertexShader:yn.meshphysical_vert,fragmentShader:yn.meshphysical_frag};const bE={r:0,b:0,g:0},ld=new ss,r_e=new en;function i_e(t,e,n,r,i,a,s){const o=new vt(0);let l=a===!0?0:1,u,c,d=null,f=0,m=null;function g(E){let S=E.isScene===!0?E.background:null;return S&&S.isTexture&&(S=(E.backgroundBlurriness>0?n:e).get(S)),S}function y(E){let S=!1;const A=g(E);A===null?b(o,l):A&&A.isColor&&(b(A,1),S=!0);const I=t.xr.getEnvironmentBlendMode();I==="additive"?r.buffers.color.setClear(0,0,0,1,s):I==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,s),(t.autoClear||S)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function v(E,S){const A=g(S);A&&(A.isCubeTexture||A.mapping===ym)?(c===void 0&&(c=new Ot(new Ya(1,1,1),new qi({name:"BackgroundCubeMaterial",uniforms:Jh(Eo.backgroundCube.uniforms),vertexShader:Eo.backgroundCube.vertexShader,fragmentShader:Eo.backgroundCube.fragmentShader,side:ka,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(I,T,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),ld.copy(S.backgroundRotation),ld.x*=-1,ld.y*=-1,ld.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(ld.y*=-1,ld.z*=-1),c.material.uniforms.envMap.value=A,c.material.uniforms.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(r_e.makeRotationFromEuler(ld)),c.material.toneMapped=Un.getTransfer(A.colorSpace)!==sr,(d!==A||f!==A.version||m!==t.toneMapping)&&(c.material.needsUpdate=!0,d=A,f=A.version,m=t.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null)):A&&A.isTexture&&(u===void 0&&(u=new Ot(new Vi(2,2),new qi({name:"BackgroundMaterial",uniforms:Jh(Eo.background.uniforms),vertexShader:Eo.background.vertexShader,fragmentShader:Eo.background.fragmentShader,side:gl,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=A,u.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,u.material.toneMapped=Un.getTransfer(A.colorSpace)!==sr,A.matrixAutoUpdate===!0&&A.updateMatrix(),u.material.uniforms.uvTransform.value.copy(A.matrix),(d!==A||f!==A.version||m!==t.toneMapping)&&(u.material.needsUpdate=!0,d=A,f=A.version,m=t.toneMapping),u.layers.enableAll(),E.unshift(u,u.geometry,u.material,0,0,null))}function b(E,S){E.getRGB(bE,Eq(t)),r.buffers.color.setClear(bE.r,bE.g,bE.b,S,s)}return{getClearColor:function(){return o},setClearColor:function(E,S=1){o.set(E),l=S,b(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,b(o,l)},render:y,addToRenderList:v}}function a_e(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),r={},i=f(null);let a=i,s=!1;function o(M,B,G,W,K){let se=!1;const ae=d(W,G,B);a!==ae&&(a=ae,u(a.object)),se=m(M,W,G,K),se&&g(M,W,G,K),K!==null&&e.update(K,t.ELEMENT_ARRAY_BUFFER),(se||s)&&(s=!1,A(M,B,G,W),K!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(K).buffer))}function l(){return t.createVertexArray()}function u(M){return t.bindVertexArray(M)}function c(M){return t.deleteVertexArray(M)}function d(M,B,G){const W=G.wireframe===!0;let K=r[M.id];K===void 0&&(K={},r[M.id]=K);let se=K[B.id];se===void 0&&(se={},K[B.id]=se);let ae=se[W];return ae===void 0&&(ae=f(l()),se[W]=ae),ae}function f(M){const B=[],G=[],W=[];for(let K=0;K=0){const J=K[F];let fe=se[F];if(fe===void 0&&(F==="instanceMatrix"&&M.instanceMatrix&&(fe=M.instanceMatrix),F==="instanceColor"&&M.instanceColor&&(fe=M.instanceColor)),J===void 0||J.attribute!==fe||fe&&J.data!==fe.data)return!0;ae++}return a.attributesNum!==ae||a.index!==W}function g(M,B,G,W){const K={},se=B.attributes;let ae=0;const ee=G.getAttributes();for(const F in ee)if(ee[F].location>=0){let J=se[F];J===void 0&&(F==="instanceMatrix"&&M.instanceMatrix&&(J=M.instanceMatrix),F==="instanceColor"&&M.instanceColor&&(J=M.instanceColor));const fe={};fe.attribute=J,J&&J.data&&(fe.data=J.data),K[F]=fe,ae++}a.attributes=K,a.attributesNum=ae,a.index=W}function y(){const M=a.newAttributes;for(let B=0,G=M.length;B=0){let ie=K[ee];if(ie===void 0&&(ee==="instanceMatrix"&&M.instanceMatrix&&(ie=M.instanceMatrix),ee==="instanceColor"&&M.instanceColor&&(ie=M.instanceColor)),ie!==void 0){const J=ie.normalized,fe=ie.itemSize,Ce=e.get(ie);if(Ce===void 0)continue;const Le=Ce.buffer,j=Ce.type,ke=Ce.bytesPerElement,Fe=j===t.INT||j===t.UNSIGNED_INT||ie.gpuType===Qb;if(ie.isInterleavedBufferAttribute){const Ye=ie.data,gt=Ye.stride,Gt=ie.offset;if(Ye.isInstancedInterleavedBuffer){for(let Ut=0;Ut0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";R="mediump"}return R==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let u=n.precision!==void 0?n.precision:"highp";const c=l(u);c!==u&&(console.warn("THREE.WebGLRenderer:",u,"not supported, using",c,"instead."),u=c);const d=n.logarithmicDepthBuffer===!0,f=n.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),m=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),g=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),y=t.getParameter(t.MAX_TEXTURE_SIZE),v=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),b=t.getParameter(t.MAX_VERTEX_ATTRIBS),E=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),S=t.getParameter(t.MAX_VARYING_VECTORS),A=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),I=g>0,T=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:l,textureFormatReadable:s,textureTypeReadable:o,precision:u,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:m,maxVertexTextures:g,maxTextureSize:y,maxCubemapSize:v,maxAttributes:b,maxVertexUniforms:E,maxVaryings:S,maxFragmentUniforms:A,vertexTextures:I,maxSamples:T}}function l_e(t){const e=this;let n=null,r=0,i=!1,a=!1;const s=new Hl,o=new vn,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const m=d.length!==0||f||r!==0||i;return i=f,r=d.length,m},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(d,f){n=c(d,f,0)},this.setState=function(d,f,m){const g=d.clippingPlanes,y=d.clipIntersection,v=d.clipShadows,b=t.get(d);if(!i||g===null||g.length===0||a&&!v)a?c(null):u();else{const E=a?0:r,S=E*4;let A=b.clippingState||null;l.value=A,A=c(g,f,S,m);for(let I=0;I!==S;++I)A[I]=n[I];b.clippingState=A,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=E}};function u(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function c(d,f,m,g){const y=d!==null?d.length:0;let v=null;if(y!==0){if(v=l.value,g!==!0||v===null){const b=m+y*4,E=f.matrixWorldInverse;o.getNormalMatrix(E),(v===null||v.length0){const u=new rD(l.height);return u.fromEquirectangularTexture(t,s),e.set(s,u),s.addEventListener("dispose",i),n(u.texture,s.mapping)}else return null}}return s}function i(s){const o=s.target;o.removeEventListener("dispose",i);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function a(){e=new WeakMap}return{get:r,dispose:a}}class pl extends ny{constructor(e=-1,n=1,r=1,i=-1,a=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=a,this.far=s,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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,n,r,i,a,s){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=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let a=r-e,s=r+e,o=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=u*this.view.offsetX,s=a+u*this.view.width,o-=c*this.view.offsetY,l=o-c*this.view.height}this.projectionMatrix.makeOrthographic(a,s,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const uh=4,zH=[.125,.215,.35,.446,.526,.582],Id=20,kC=new pl,HH=new vt;let PC=null,BC=0,FC=0,UC=!1;const xd=(1+Math.sqrt(5))/2,xp=1/xd,GH=[new H(-xd,xp,0),new H(xd,xp,0),new H(-xp,0,xd),new H(xp,0,xd),new H(0,xd,-xp),new H(0,xd,xp),new H(-1,1,-1),new H(1,1,-1),new H(-1,1,1),new H(1,1,1)];class NM{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,n=0,r=.1,i=100){PC=this._renderer.getRenderTarget(),BC=this._renderer.getActiveCubeFace(),FC=this._renderer.getActiveMipmapLevel(),UC=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(e,r,i,a),n>0&&this._blur(a,0,0,n),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=WH(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=$H(),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?S:0,S,S),c.setRenderTarget(i),y&&c.render(g,o),c.render(e,o)}g.geometry.dispose(),g.material.dispose(),c.toneMapping=f,c.autoClear=d,e.background=v}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===bl||e.mapping===xc;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=WH()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=$H());const a=i?this._cubemapMaterial:this._equirectMaterial,s=new Ot(this._lodPlanes[0],a),o=a.uniforms;o.envMap.value=e;const l=this._cubeSize;yE(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(s,kC)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;const i=this._lodPlanes.length;for(let a=1;aId&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${Id}`);const b=[];let E=0;for(let R=0;RS-uh?i-S+uh:0),T=4*(this._cubeSize-A);yE(n,I,T,3*A,2*A),l.setRenderTarget(n),l.render(d,kC)}}function c_e(t){const e=[],n=[],r=[];let i=t;const a=t-uh+1+zH.length;for(let s=0;st-uh?l=zH[s-t+uh-1]:s===0&&(l=0),r.push(l);const u=1/(o-2),c=-u,d=1+u,f=[c,c,d,c,d,d,c,c,d,d,c,d],m=6,g=6,y=3,v=2,b=1,E=new Float32Array(y*g*m),S=new Float32Array(v*g*m),A=new Float32Array(b*g*m);for(let T=0;T2?0:-1,N=[R,O,0,R+2/3,O,0,R+2/3,O+1,0,R,O,0,R+2/3,O+1,0,R,O+1,0];E.set(N,y*g*T),S.set(f,v*g*T);const M=[T,T,T,T,T,T];A.set(M,b*g*T)}const I=new fn;I.setAttribute("position",new Kn(E,y)),I.setAttribute("uv",new Kn(S,v)),I.setAttribute("faceIndex",new Kn(A,b)),e.push(I),i>uh&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function VH(t,e,n){const r=new ki(t,e,n);return r.texture.mapping=ym,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function yE(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function d_e(t,e,n){const r=new Float32Array(Id),i=new H(0,1,0);return new qi({name:"SphericalGaussianBlur",defines:{n:Id,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:iD(),fragmentShader:` +}`,yn={alphahash_fragment:xve,alphahash_pars_fragment:Tve,alphamap_fragment:wve,alphamap_pars_fragment:Cve,alphatest_fragment:Rve,alphatest_pars_fragment:Ive,aomap_fragment:Mve,aomap_pars_fragment:Nve,batching_pars_vertex:Ove,batching_vertex:Dve,begin_vertex:Lve,beginnormal_vertex:kve,bsdfs:Pve,iridescence_fragment:Bve,bumpmap_pars_fragment:Fve,clipping_planes_fragment:Uve,clipping_planes_pars_fragment:zve,clipping_planes_pars_vertex:Hve,clipping_planes_vertex:Gve,color_fragment:Vve,color_pars_fragment:$ve,color_pars_vertex:Wve,color_vertex:jve,common:Yve,cube_uv_reflection_fragment:qve,defaultnormal_vertex:Xve,displacementmap_pars_vertex:Kve,displacementmap_vertex:Zve,emissivemap_fragment:Qve,emissivemap_pars_fragment:Jve,colorspace_fragment:eEe,colorspace_pars_fragment:tEe,envmap_fragment:nEe,envmap_common_pars_fragment:rEe,envmap_pars_fragment:iEe,envmap_pars_vertex:aEe,envmap_physical_pars_fragment:gEe,envmap_vertex:sEe,fog_vertex:oEe,fog_pars_vertex:lEe,fog_fragment:uEe,fog_pars_fragment:cEe,gradientmap_pars_fragment:dEe,lightmap_pars_fragment:fEe,lights_lambert_fragment:pEe,lights_lambert_pars_fragment:hEe,lights_pars_begin:mEe,lights_toon_fragment:bEe,lights_toon_pars_fragment:yEe,lights_phong_fragment:vEe,lights_phong_pars_fragment:EEe,lights_physical_fragment:_Ee,lights_physical_pars_fragment:SEe,lights_fragment_begin:AEe,lights_fragment_maps:xEe,lights_fragment_end:TEe,logdepthbuf_fragment:wEe,logdepthbuf_pars_fragment:CEe,logdepthbuf_pars_vertex:REe,logdepthbuf_vertex:IEe,map_fragment:MEe,map_pars_fragment:NEe,map_particle_fragment:OEe,map_particle_pars_fragment:DEe,metalnessmap_fragment:LEe,metalnessmap_pars_fragment:kEe,morphinstance_vertex:PEe,morphcolor_vertex:BEe,morphnormal_vertex:FEe,morphtarget_pars_vertex:UEe,morphtarget_vertex:zEe,normal_fragment_begin:HEe,normal_fragment_maps:GEe,normal_pars_fragment:VEe,normal_pars_vertex:$Ee,normal_vertex:WEe,normalmap_pars_fragment:jEe,clearcoat_normal_fragment_begin:YEe,clearcoat_normal_fragment_maps:qEe,clearcoat_pars_fragment:XEe,iridescence_pars_fragment:KEe,opaque_fragment:ZEe,packing:QEe,premultiplied_alpha_fragment:JEe,project_vertex:e_e,dithering_fragment:t_e,dithering_pars_fragment:n_e,roughnessmap_fragment:r_e,roughnessmap_pars_fragment:i_e,shadowmap_pars_fragment:a_e,shadowmap_pars_vertex:s_e,shadowmap_vertex:o_e,shadowmask_pars_fragment:l_e,skinbase_vertex:u_e,skinning_pars_vertex:c_e,skinning_vertex:d_e,skinnormal_vertex:f_e,specularmap_fragment:p_e,specularmap_pars_fragment:h_e,tonemapping_fragment:m_e,tonemapping_pars_fragment:g_e,transmission_fragment:b_e,transmission_pars_fragment:y_e,uv_pars_fragment:v_e,uv_pars_vertex:E_e,uv_vertex:__e,worldpos_vertex:S_e,background_vert:A_e,background_frag:x_e,backgroundCube_vert:T_e,backgroundCube_frag:w_e,cube_vert:C_e,cube_frag:R_e,depth_vert:I_e,depth_frag:M_e,distanceRGBA_vert:N_e,distanceRGBA_frag:O_e,equirect_vert:D_e,equirect_frag:L_e,linedashed_vert:k_e,linedashed_frag:P_e,meshbasic_vert:B_e,meshbasic_frag:F_e,meshlambert_vert:U_e,meshlambert_frag:z_e,meshmatcap_vert:H_e,meshmatcap_frag:G_e,meshnormal_vert:V_e,meshnormal_frag:$_e,meshphong_vert:W_e,meshphong_frag:j_e,meshphysical_vert:Y_e,meshphysical_frag:q_e,meshtoon_vert:X_e,meshtoon_frag:K_e,points_vert:Z_e,points_frag:Q_e,shadow_vert:J_e,shadow_frag:eSe,sprite_vert:tSe,sprite_frag:nSe},It={common:{diffuse:{value:new vt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new vn},alphaMap:{value:null},alphaMapTransform:{value:new vn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new vn}},envmap:{envMap:{value:null},envMapRotation:{value:new vn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new vn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new vn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new vn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new vn},normalScale:{value:new Ke(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new vn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new vn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new vn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new vn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new vt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 vt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new vn},alphaTest:{value:0},uvTransform:{value:new vn}},sprite:{diffuse:{value:new vt(16777215)},opacity:{value:1},center:{value:new Ke(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new vn},alphaMap:{value:null},alphaMapTransform:{value:new vn},alphaTest:{value:0}}},Eo={basic:{uniforms:wa([It.common,It.specularmap,It.envmap,It.aomap,It.lightmap,It.fog]),vertexShader:yn.meshbasic_vert,fragmentShader:yn.meshbasic_frag},lambert:{uniforms:wa([It.common,It.specularmap,It.envmap,It.aomap,It.lightmap,It.emissivemap,It.bumpmap,It.normalmap,It.displacementmap,It.fog,It.lights,{emissive:{value:new vt(0)}}]),vertexShader:yn.meshlambert_vert,fragmentShader:yn.meshlambert_frag},phong:{uniforms:wa([It.common,It.specularmap,It.envmap,It.aomap,It.lightmap,It.emissivemap,It.bumpmap,It.normalmap,It.displacementmap,It.fog,It.lights,{emissive:{value:new vt(0)},specular:{value:new vt(1118481)},shininess:{value:30}}]),vertexShader:yn.meshphong_vert,fragmentShader:yn.meshphong_frag},standard:{uniforms:wa([It.common,It.envmap,It.aomap,It.lightmap,It.emissivemap,It.bumpmap,It.normalmap,It.displacementmap,It.roughnessmap,It.metalnessmap,It.fog,It.lights,{emissive:{value:new vt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yn.meshphysical_vert,fragmentShader:yn.meshphysical_frag},toon:{uniforms:wa([It.common,It.aomap,It.lightmap,It.emissivemap,It.bumpmap,It.normalmap,It.displacementmap,It.gradientmap,It.fog,It.lights,{emissive:{value:new vt(0)}}]),vertexShader:yn.meshtoon_vert,fragmentShader:yn.meshtoon_frag},matcap:{uniforms:wa([It.common,It.bumpmap,It.normalmap,It.displacementmap,It.fog,{matcap:{value:null}}]),vertexShader:yn.meshmatcap_vert,fragmentShader:yn.meshmatcap_frag},points:{uniforms:wa([It.points,It.fog]),vertexShader:yn.points_vert,fragmentShader:yn.points_frag},dashed:{uniforms:wa([It.common,It.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yn.linedashed_vert,fragmentShader:yn.linedashed_frag},depth:{uniforms:wa([It.common,It.displacementmap]),vertexShader:yn.depth_vert,fragmentShader:yn.depth_frag},normal:{uniforms:wa([It.common,It.bumpmap,It.normalmap,It.displacementmap,{opacity:{value:1}}]),vertexShader:yn.meshnormal_vert,fragmentShader:yn.meshnormal_frag},sprite:{uniforms:wa([It.sprite,It.fog]),vertexShader:yn.sprite_vert,fragmentShader:yn.sprite_frag},background:{uniforms:{uvTransform:{value:new vn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yn.background_vert,fragmentShader:yn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new vn}},vertexShader:yn.backgroundCube_vert,fragmentShader:yn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yn.cube_vert,fragmentShader:yn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yn.equirect_vert,fragmentShader:yn.equirect_frag},distanceRGBA:{uniforms:wa([It.common,It.displacementmap,{referencePosition:{value:new H},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yn.distanceRGBA_vert,fragmentShader:yn.distanceRGBA_frag},shadow:{uniforms:wa([It.lights,It.fog,{color:{value:new vt(0)},opacity:{value:1}}]),vertexShader:yn.shadow_vert,fragmentShader:yn.shadow_frag}};Eo.physical={uniforms:wa([Eo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new vn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new vn},clearcoatNormalScale:{value:new Ke(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new vn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new vn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new vn},sheen:{value:0},sheenColor:{value:new vt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new vn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new vn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new vn},transmissionSamplerSize:{value:new Ke},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new vn},attenuationDistance:{value:0},attenuationColor:{value:new vt(0)},specularColor:{value:new vt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new vn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new vn},anisotropyVector:{value:new Ke},anisotropyMap:{value:null},anisotropyMapTransform:{value:new vn}}]),vertexShader:yn.meshphysical_vert,fragmentShader:yn.meshphysical_frag};const bE={r:0,b:0,g:0},ld=new ss,rSe=new en;function iSe(t,e,n,r,i,a,s){const o=new vt(0);let l=a===!0?0:1,u,c,d=null,f=0,m=null;function g(E){let _=E.isScene===!0?E.background:null;return _&&_.isTexture&&(_=(E.backgroundBlurriness>0?n:e).get(_)),_}function y(E){let _=!1;const A=g(E);A===null?b(o,l):A&&A.isColor&&(b(A,1),_=!0);const I=t.xr.getEnvironmentBlendMode();I==="additive"?r.buffers.color.setClear(0,0,0,1,s):I==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,s),(t.autoClear||_)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function v(E,_){const A=g(_);A&&(A.isCubeTexture||A.mapping===ym)?(c===void 0&&(c=new Ot(new Ya(1,1,1),new qi({name:"BackgroundCubeMaterial",uniforms:Jh(Eo.backgroundCube.uniforms),vertexShader:Eo.backgroundCube.vertexShader,fragmentShader:Eo.backgroundCube.fragmentShader,side:ka,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(I,x,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),ld.copy(_.backgroundRotation),ld.x*=-1,ld.y*=-1,ld.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(ld.y*=-1,ld.z*=-1),c.material.uniforms.envMap.value=A,c.material.uniforms.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(rSe.makeRotationFromEuler(ld)),c.material.toneMapped=Un.getTransfer(A.colorSpace)!==sr,(d!==A||f!==A.version||m!==t.toneMapping)&&(c.material.needsUpdate=!0,d=A,f=A.version,m=t.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null)):A&&A.isTexture&&(u===void 0&&(u=new Ot(new Vi(2,2),new qi({name:"BackgroundMaterial",uniforms:Jh(Eo.background.uniforms),vertexShader:Eo.background.vertexShader,fragmentShader:Eo.background.fragmentShader,side:gl,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=A,u.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,u.material.toneMapped=Un.getTransfer(A.colorSpace)!==sr,A.matrixAutoUpdate===!0&&A.updateMatrix(),u.material.uniforms.uvTransform.value.copy(A.matrix),(d!==A||f!==A.version||m!==t.toneMapping)&&(u.material.needsUpdate=!0,d=A,f=A.version,m=t.toneMapping),u.layers.enableAll(),E.unshift(u,u.geometry,u.material,0,0,null))}function b(E,_){E.getRGB(bE,Eq(t)),r.buffers.color.setClear(bE.r,bE.g,bE.b,_,s)}return{getClearColor:function(){return o},setClearColor:function(E,_=1){o.set(E),l=_,b(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,b(o,l)},render:y,addToRenderList:v}}function aSe(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),r={},i=f(null);let a=i,s=!1;function o(M,B,G,W,K){let se=!1;const ae=d(W,G,B);a!==ae&&(a=ae,u(a.object)),se=m(M,W,G,K),se&&g(M,W,G,K),K!==null&&e.update(K,t.ELEMENT_ARRAY_BUFFER),(se||s)&&(s=!1,A(M,B,G,W),K!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(K).buffer))}function l(){return t.createVertexArray()}function u(M){return t.bindVertexArray(M)}function c(M){return t.deleteVertexArray(M)}function d(M,B,G){const W=G.wireframe===!0;let K=r[M.id];K===void 0&&(K={},r[M.id]=K);let se=K[B.id];se===void 0&&(se={},K[B.id]=se);let ae=se[W];return ae===void 0&&(ae=f(l()),se[W]=ae),ae}function f(M){const B=[],G=[],W=[];for(let K=0;K=0){const J=K[F];let fe=se[F];if(fe===void 0&&(F==="instanceMatrix"&&M.instanceMatrix&&(fe=M.instanceMatrix),F==="instanceColor"&&M.instanceColor&&(fe=M.instanceColor)),J===void 0||J.attribute!==fe||fe&&J.data!==fe.data)return!0;ae++}return a.attributesNum!==ae||a.index!==W}function g(M,B,G,W){const K={},se=B.attributes;let ae=0;const ee=G.getAttributes();for(const F in ee)if(ee[F].location>=0){let J=se[F];J===void 0&&(F==="instanceMatrix"&&M.instanceMatrix&&(J=M.instanceMatrix),F==="instanceColor"&&M.instanceColor&&(J=M.instanceColor));const fe={};fe.attribute=J,J&&J.data&&(fe.data=J.data),K[F]=fe,ae++}a.attributes=K,a.attributesNum=ae,a.index=W}function y(){const M=a.newAttributes;for(let B=0,G=M.length;B=0){let ie=K[ee];if(ie===void 0&&(ee==="instanceMatrix"&&M.instanceMatrix&&(ie=M.instanceMatrix),ee==="instanceColor"&&M.instanceColor&&(ie=M.instanceColor)),ie!==void 0){const J=ie.normalized,fe=ie.itemSize,Ce=e.get(ie);if(Ce===void 0)continue;const Le=Ce.buffer,j=Ce.type,ke=Ce.bytesPerElement,Fe=j===t.INT||j===t.UNSIGNED_INT||ie.gpuType===Qb;if(ie.isInterleavedBufferAttribute){const Ye=ie.data,gt=Ye.stride,Gt=ie.offset;if(Ye.isInstancedInterleavedBuffer){for(let Ut=0;Ut0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";R="mediump"}return R==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let u=n.precision!==void 0?n.precision:"highp";const c=l(u);c!==u&&(console.warn("THREE.WebGLRenderer:",u,"not supported, using",c,"instead."),u=c);const d=n.logarithmicDepthBuffer===!0,f=n.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),m=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),g=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),y=t.getParameter(t.MAX_TEXTURE_SIZE),v=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),b=t.getParameter(t.MAX_VERTEX_ATTRIBS),E=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),_=t.getParameter(t.MAX_VARYING_VECTORS),A=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),I=g>0,x=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:l,textureFormatReadable:s,textureTypeReadable:o,precision:u,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:m,maxVertexTextures:g,maxTextureSize:y,maxCubemapSize:v,maxAttributes:b,maxVertexUniforms:E,maxVaryings:_,maxFragmentUniforms:A,vertexTextures:I,maxSamples:x}}function lSe(t){const e=this;let n=null,r=0,i=!1,a=!1;const s=new Hl,o=new vn,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const m=d.length!==0||f||r!==0||i;return i=f,r=d.length,m},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(d,f){n=c(d,f,0)},this.setState=function(d,f,m){const g=d.clippingPlanes,y=d.clipIntersection,v=d.clipShadows,b=t.get(d);if(!i||g===null||g.length===0||a&&!v)a?c(null):u();else{const E=a?0:r,_=E*4;let A=b.clippingState||null;l.value=A,A=c(g,f,_,m);for(let I=0;I!==_;++I)A[I]=n[I];b.clippingState=A,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=E}};function u(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function c(d,f,m,g){const y=d!==null?d.length:0;let v=null;if(y!==0){if(v=l.value,g!==!0||v===null){const b=m+y*4,E=f.matrixWorldInverse;o.getNormalMatrix(E),(v===null||v.length0){const u=new rD(l.height);return u.fromEquirectangularTexture(t,s),e.set(s,u),s.addEventListener("dispose",i),n(u.texture,s.mapping)}else return null}}return s}function i(s){const o=s.target;o.removeEventListener("dispose",i);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function a(){e=new WeakMap}return{get:r,dispose:a}}class pl extends ny{constructor(e=-1,n=1,r=1,i=-1,a=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=a,this.far=s,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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,n,r,i,a,s){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=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let a=r-e,s=r+e,o=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=u*this.view.offsetX,s=a+u*this.view.width,o-=c*this.view.offsetY,l=o-c*this.view.height}this.projectionMatrix.makeOrthographic(a,s,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const uh=4,zH=[.125,.215,.35,.446,.526,.582],Id=20,kC=new pl,HH=new vt;let PC=null,BC=0,FC=0,UC=!1;const Td=(1+Math.sqrt(5))/2,Tp=1/Td,GH=[new H(-Td,Tp,0),new H(Td,Tp,0),new H(-Tp,0,Td),new H(Tp,0,Td),new H(0,Td,-Tp),new H(0,Td,Tp),new H(-1,1,-1),new H(1,1,-1),new H(-1,1,1),new H(1,1,1)];class NM{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,n=0,r=.1,i=100){PC=this._renderer.getRenderTarget(),BC=this._renderer.getActiveCubeFace(),FC=this._renderer.getActiveMipmapLevel(),UC=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(e,r,i,a),n>0&&this._blur(a,0,0,n),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=WH(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=$H(),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?_:0,_,_),c.setRenderTarget(i),y&&c.render(g,o),c.render(e,o)}g.geometry.dispose(),g.material.dispose(),c.toneMapping=f,c.autoClear=d,e.background=v}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===bl||e.mapping===Tc;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=WH()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=$H());const a=i?this._cubemapMaterial:this._equirectMaterial,s=new Ot(this._lodPlanes[0],a),o=a.uniforms;o.envMap.value=e;const l=this._cubeSize;yE(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(s,kC)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;const i=this._lodPlanes.length;for(let a=1;aId&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${Id}`);const b=[];let E=0;for(let R=0;R_-uh?i-_+uh:0),x=4*(this._cubeSize-A);yE(n,I,x,3*A,2*A),l.setRenderTarget(n),l.render(d,kC)}}function cSe(t){const e=[],n=[],r=[];let i=t;const a=t-uh+1+zH.length;for(let s=0;st-uh?l=zH[s-t+uh-1]:s===0&&(l=0),r.push(l);const u=1/(o-2),c=-u,d=1+u,f=[c,c,d,c,d,d,c,c,d,d,c,d],m=6,g=6,y=3,v=2,b=1,E=new Float32Array(y*g*m),_=new Float32Array(v*g*m),A=new Float32Array(b*g*m);for(let x=0;x2?0:-1,N=[R,O,0,R+2/3,O,0,R+2/3,O+1,0,R,O,0,R+2/3,O+1,0,R,O+1,0];E.set(N,y*g*x),_.set(f,v*g*x);const M=[x,x,x,x,x,x];A.set(M,b*g*x)}const I=new fn;I.setAttribute("position",new Kn(E,y)),I.setAttribute("uv",new Kn(_,v)),I.setAttribute("faceIndex",new Kn(A,b)),e.push(I),i>uh&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function VH(t,e,n){const r=new ki(t,e,n);return r.texture.mapping=ym,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function yE(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function dSe(t,e,n){const r=new Float32Array(Id),i=new H(0,1,0);return new qi({name:"SphericalGaussianBlur",defines:{n:Id,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:iD(),fragmentShader:` precision mediump float; precision mediump int; @@ -4097,7 +4097,7 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function f_e(t){let e=new WeakMap,n=null;function r(o){if(o&&o.isTexture){const l=o.mapping,u=l===Yh||l===Eb,c=l===bl||l===xc;if(u||c){let d=e.get(o);const f=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==f)return n===null&&(n=new NM(t)),d=u?n.fromEquirectangular(o,d):n.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),d.texture;if(d!==void 0)return d.texture;{const m=o.image;return u&&m&&m.height>0||c&&m&&i(m)?(n===null&&(n=new NM(t)),d=u?n.fromEquirectangular(o):n.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),o.addEventListener("dispose",a),d.texture):null}}}return o}function i(o){let l=0;const u=6;for(let c=0;ce.maxTextureSize&&(T=Math.ceil(I/e.maxTextureSize),I=e.maxTextureSize);const R=new Float32Array(I*T*4*d),O=new ZT(R,I,T,d);O.type=Or,O.needsUpdate=!0;const N=A*4;for(let B=0;B0)return t;const i=e*n;let a=YH[i];if(a===void 0&&(a=new Float32Array(i),YH[i]=a),e!==0){r.toArray(a,0);for(let s=1,o=0;s!==e;++s)o+=n,t[s].toArray(a,o)}return a}function yi(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n0||c&&m&&i(m)?(n===null&&(n=new NM(t)),d=u?n.fromEquirectangular(o):n.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),o.addEventListener("dispose",a),d.texture):null}}}return o}function i(o){let l=0;const u=6;for(let c=0;ce.maxTextureSize&&(x=Math.ceil(I/e.maxTextureSize),I=e.maxTextureSize);const R=new Float32Array(I*x*4*d),O=new Zx(R,I,x,d);O.type=Or,O.needsUpdate=!0;const N=A*4;for(let B=0;B0)return t;const i=e*n;let a=YH[i];if(a===void 0&&(a=new Float32Array(i),YH[i]=a),e!==0){r.toArray(a,0);for(let s=1,o=0;s!==e;++s)o+=n,t[s].toArray(a,o)}return a}function yi(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${o}: ${n[s]}`)}return r.join(` `)}const e5=new vn;function fAe(t){Un._getMatrix(e5,Un.workingColorSpace,t);const e=`mat3( ${e5.elements.map(n=>n.toFixed(4))} )`;switch(Un.getTransfer(t)){case ty:return[e,"LinearTransferOETF"];case sr:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function t5(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const a=/ERROR: 0:(\d+)/.exec(i);if(a){const s=parseInt(a[1]);return n.toUpperCase()+` @@ -4107,7 +4107,7 @@ void main() { `)}function hAe(t,e){let n;switch(e){case qY:n="Linear";break;case XY:n="Reinhard";break;case KY:n="Cineon";break;case HO:n="ACESFilmic";break;case QY:n="AgX";break;case JY:n="Neutral";break;case ZY:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const vE=new H;function mAe(){Un.getLuminanceCoefficients(vE);const t=vE.x.toFixed(4),e=vE.y.toFixed(4),n=vE.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(` `)}function gAe(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(r0).join(` `)}function bAe(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` -`)}function yAe(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function OM(t){return t.replace(vAe,SAe)}const EAe=new Map;function SAe(t,e){let n=yn[e];if(n===void 0){const r=EAe.get(e);if(r!==void 0)n=yn[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return OM(n)}const _Ae=/#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 i5(t){return t.replace(_Ae,AAe)}function AAe(t,e,n,r){let i="";for(let a=parseInt(e);a/gm;function OM(t){return t.replace(vAe,_Ae)}const EAe=new Map;function _Ae(t,e){let n=yn[e];if(n===void 0){const r=EAe.get(e);if(r!==void 0)n=yn[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return OM(n)}const SAe=/#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 i5(t){return t.replace(SAe,AAe)}function AAe(t,e,n,r){let i="";for(let a=parseInt(e);a0&&(v+=` `),b=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(r0).join(` @@ -4141,14 +4141,14 @@ void main() { `)+` `+v,b=["#define varying in",n.glslVersion===MM?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===MM?"":"#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(` `)+` -`+b);const S=E+v+s,A=E+b+o,I=JH(i,i.VERTEX_SHADER,S),T=JH(i,i.FRAGMENT_SHADER,A);i.attachShader(y,I),i.attachShader(y,T),n.index0AttributeName!==void 0?i.bindAttribLocation(y,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(y,0,"position"),i.linkProgram(y);function R(B){if(t.debug.checkShaderErrors){const G=i.getProgramInfoLog(y).trim(),W=i.getShaderInfoLog(I).trim(),K=i.getShaderInfoLog(T).trim();let se=!0,ae=!0;if(i.getProgramParameter(y,i.LINK_STATUS)===!1)if(se=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,y,I,T);else{const ee=t5(i,I,"vertex"),F=t5(i,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(y,i.VALIDATE_STATUS)+` +`+b);const _=E+v+s,A=E+b+o,I=JH(i,i.VERTEX_SHADER,_),x=JH(i,i.FRAGMENT_SHADER,A);i.attachShader(y,I),i.attachShader(y,x),n.index0AttributeName!==void 0?i.bindAttribLocation(y,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(y,0,"position"),i.linkProgram(y);function R(B){if(t.debug.checkShaderErrors){const G=i.getProgramInfoLog(y).trim(),W=i.getShaderInfoLog(I).trim(),K=i.getShaderInfoLog(x).trim();let se=!0,ae=!0;if(i.getProgramParameter(y,i.LINK_STATUS)===!1)if(se=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,y,I,x);else{const ee=t5(i,I,"vertex"),F=t5(i,x,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(y,i.VALIDATE_STATUS)+` Material Name: `+B.name+` Material Type: `+B.type+` Program Info Log: `+G+` `+ee+` -`+F)}else G!==""?console.warn("THREE.WebGLProgram: Program Info Log:",G):(W===""||K==="")&&(ae=!1);ae&&(B.diagnostics={runnable:se,programLog:G,vertexShader:{log:W,prefix:v},fragmentShader:{log:K,prefix:b}})}i.deleteShader(I),i.deleteShader(T),O=new $S(i,y),N=yAe(i,y)}let O;this.getUniforms=function(){return O===void 0&&R(this),O};let N;this.getAttributes=function(){return N===void 0&&R(this),N};let M=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(y,uAe)),M},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(y),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=cAe++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=I,this.fragmentShader=T,this}let MAe=0;class NAe{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),a=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(a)===!1&&(s.add(a),a.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)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 n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new OAe(e),n.set(e,r)),r}}class OAe{constructor(e){this.id=MAe++,this.code=e,this.usedTimes=0}}function DAe(t,e,n,r,i,a,s){const o=new ef,l=new NAe,u=new Set,c=[],d=i.logarithmicDepthBuffer,f=i.vertexTextures;let m=i.precision;const g={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(N){return u.add(N),N===0?"uv":`uv${N}`}function v(N,M,B,G,W){const K=G.fog,se=W.geometry,ae=N.isMeshStandardMaterial?G.environment:null,ee=(N.isMeshStandardMaterial?n:e).get(N.envMap||ae),F=ee&&ee.mapping===ym?ee.image.height:null,ie=g[N.type];N.precision!==null&&(m=i.getMaxPrecision(N.precision),m!==N.precision&&console.warn("THREE.WebGLProgram.getParameters:",N.precision,"not supported, using",m,"instead."));const J=se.morphAttributes.position||se.morphAttributes.normal||se.morphAttributes.color,fe=J!==void 0?J.length:0;let Ce=0;se.morphAttributes.position!==void 0&&(Ce=1),se.morphAttributes.normal!==void 0&&(Ce=2),se.morphAttributes.color!==void 0&&(Ce=3);let Le,j,ke,Fe;if(ie){const pn=Eo[ie];Le=pn.vertexShader,j=pn.fragmentShader}else Le=N.vertexShader,j=N.fragmentShader,l.update(N),ke=l.getVertexShaderID(N),Fe=l.getFragmentShaderID(N);const Ye=t.getRenderTarget(),gt=t.state.buffers.depth.getReversed(),Gt=W.isInstancedMesh===!0,Ut=W.isBatchedMesh===!0,Mt=!!N.map,$e=!!N.matcap,qe=!!ee,re=!!N.aoMap,At=!!N.lightMap,Je=!!N.bumpMap,Tt=!!N.normalMap,ot=!!N.displacementMap,Vt=!!N.emissiveMap,yt=!!N.metalnessMap,q=!!N.roughnessMap,U=N.anisotropy>0,ue=N.clearcoat>0,Se=N.dispersion>0,Ge=N.iridescence>0,Pe=N.sheen>0,ft=N.transmission>0,nt=U&&!!N.anisotropyMap,ht=ue&&!!N.clearcoatMap,tn=ue&&!!N.clearcoatNormalMap,tt=ue&&!!N.clearcoatRoughnessMap,Et=Ge&&!!N.iridescenceMap,zt=Ge&&!!N.iridescenceThicknessMap,Dt=Pe&&!!N.sheenColorMap,bt=Pe&&!!N.sheenRoughnessMap,me=!!N.specularMap,De=!!N.specularColorMap,rt=!!N.specularIntensityMap,ge=ft&&!!N.transmissionMap,xe=ft&&!!N.thicknessMap,Me=!!N.gradientMap,Xe=!!N.alphaMap,St=N.alphaTest>0,_t=!!N.alphaHash,Xt=!!N.extensions;let mn=fl;N.toneMapped&&(Ye===null||Ye.isXRRenderTarget===!0)&&(mn=t.toneMapping);const Hn={shaderID:ie,shaderType:N.type,shaderName:N.name,vertexShader:Le,fragmentShader:j,defines:N.defines,customVertexShaderID:ke,customFragmentShaderID:Fe,isRawShaderMaterial:N.isRawShaderMaterial===!0,glslVersion:N.glslVersion,precision:m,batching:Ut,batchingColor:Ut&&W._colorsTexture!==null,instancing:Gt,instancingColor:Gt&&W.instanceColor!==null,instancingMorph:Gt&&W.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:Ye===null?t.outputColorSpace:Ye.isXRRenderTarget===!0?Ye.texture.colorSpace:vl,alphaToCoverage:!!N.alphaToCoverage,map:Mt,matcap:$e,envMap:qe,envMapMode:qe&&ee.mapping,envMapCubeUVHeight:F,aoMap:re,lightMap:At,bumpMap:Je,normalMap:Tt,displacementMap:f&&ot,emissiveMap:Vt,normalMapObjectSpace:Tt&&N.normalMapType===oq,normalMapTangentSpace:Tt&&N.normalMapType===Bc,metalnessMap:yt,roughnessMap:q,anisotropy:U,anisotropyMap:nt,clearcoat:ue,clearcoatMap:ht,clearcoatNormalMap:tn,clearcoatRoughnessMap:tt,dispersion:Se,iridescence:Ge,iridescenceMap:Et,iridescenceThicknessMap:zt,sheen:Pe,sheenColorMap:Dt,sheenRoughnessMap:bt,specularMap:me,specularColorMap:De,specularIntensityMap:rt,transmission:ft,transmissionMap:ge,thicknessMap:xe,gradientMap:Me,opaque:N.transparent===!1&&N.blending===Zd&&N.alphaToCoverage===!1,alphaMap:Xe,alphaTest:St,alphaHash:_t,combine:N.combine,mapUv:Mt&&y(N.map.channel),aoMapUv:re&&y(N.aoMap.channel),lightMapUv:At&&y(N.lightMap.channel),bumpMapUv:Je&&y(N.bumpMap.channel),normalMapUv:Tt&&y(N.normalMap.channel),displacementMapUv:ot&&y(N.displacementMap.channel),emissiveMapUv:Vt&&y(N.emissiveMap.channel),metalnessMapUv:yt&&y(N.metalnessMap.channel),roughnessMapUv:q&&y(N.roughnessMap.channel),anisotropyMapUv:nt&&y(N.anisotropyMap.channel),clearcoatMapUv:ht&&y(N.clearcoatMap.channel),clearcoatNormalMapUv:tn&&y(N.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:tt&&y(N.clearcoatRoughnessMap.channel),iridescenceMapUv:Et&&y(N.iridescenceMap.channel),iridescenceThicknessMapUv:zt&&y(N.iridescenceThicknessMap.channel),sheenColorMapUv:Dt&&y(N.sheenColorMap.channel),sheenRoughnessMapUv:bt&&y(N.sheenRoughnessMap.channel),specularMapUv:me&&y(N.specularMap.channel),specularColorMapUv:De&&y(N.specularColorMap.channel),specularIntensityMapUv:rt&&y(N.specularIntensityMap.channel),transmissionMapUv:ge&&y(N.transmissionMap.channel),thicknessMapUv:xe&&y(N.thicknessMap.channel),alphaMapUv:Xe&&y(N.alphaMap.channel),vertexTangents:!!se.attributes.tangent&&(Tt||U),vertexColors:N.vertexColors,vertexAlphas:N.vertexColors===!0&&!!se.attributes.color&&se.attributes.color.itemSize===4,pointsUvs:W.isPoints===!0&&!!se.attributes.uv&&(Mt||Xe),fog:!!K,useFog:N.fog===!0,fogExp2:!!K&&K.isFogExp2,flatShading:N.flatShading===!0,sizeAttenuation:N.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:gt,skinning:W.isSkinnedMesh===!0,morphTargets:se.morphAttributes.position!==void 0,morphNormals:se.morphAttributes.normal!==void 0,morphColors:se.morphAttributes.color!==void 0,morphTargetsCount:fe,morphTextureStride:Ce,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:N.dithering,shadowMapEnabled:t.shadowMap.enabled&&B.length>0,shadowMapType:t.shadowMap.type,toneMapping:mn,decodeVideoTexture:Mt&&N.map.isVideoTexture===!0&&Un.getTransfer(N.map.colorSpace)===sr,decodeVideoTextureEmissive:Vt&&N.emissiveMap.isVideoTexture===!0&&Un.getTransfer(N.emissiveMap.colorSpace)===sr,premultipliedAlpha:N.premultipliedAlpha,doubleSided:N.side===fa,flipSided:N.side===ka,useDepthPacking:N.depthPacking>=0,depthPacking:N.depthPacking||0,index0AttributeName:N.index0AttributeName,extensionClipCullDistance:Xt&&N.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Xt&&N.extensions.multiDraw===!0||Ut)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:N.customProgramCacheKey()};return Hn.vertexUv1s=u.has(1),Hn.vertexUv2s=u.has(2),Hn.vertexUv3s=u.has(3),u.clear(),Hn}function b(N){const M=[];if(N.shaderID?M.push(N.shaderID):(M.push(N.customVertexShaderID),M.push(N.customFragmentShaderID)),N.defines!==void 0)for(const B in N.defines)M.push(B),M.push(N.defines[B]);return N.isRawShaderMaterial===!1&&(E(M,N),S(M,N),M.push(t.outputColorSpace)),M.push(N.customProgramCacheKey),M.join()}function E(N,M){N.push(M.precision),N.push(M.outputColorSpace),N.push(M.envMapMode),N.push(M.envMapCubeUVHeight),N.push(M.mapUv),N.push(M.alphaMapUv),N.push(M.lightMapUv),N.push(M.aoMapUv),N.push(M.bumpMapUv),N.push(M.normalMapUv),N.push(M.displacementMapUv),N.push(M.emissiveMapUv),N.push(M.metalnessMapUv),N.push(M.roughnessMapUv),N.push(M.anisotropyMapUv),N.push(M.clearcoatMapUv),N.push(M.clearcoatNormalMapUv),N.push(M.clearcoatRoughnessMapUv),N.push(M.iridescenceMapUv),N.push(M.iridescenceThicknessMapUv),N.push(M.sheenColorMapUv),N.push(M.sheenRoughnessMapUv),N.push(M.specularMapUv),N.push(M.specularColorMapUv),N.push(M.specularIntensityMapUv),N.push(M.transmissionMapUv),N.push(M.thicknessMapUv),N.push(M.combine),N.push(M.fogExp2),N.push(M.sizeAttenuation),N.push(M.morphTargetsCount),N.push(M.morphAttributeCount),N.push(M.numDirLights),N.push(M.numPointLights),N.push(M.numSpotLights),N.push(M.numSpotLightMaps),N.push(M.numHemiLights),N.push(M.numRectAreaLights),N.push(M.numDirLightShadows),N.push(M.numPointLightShadows),N.push(M.numSpotLightShadows),N.push(M.numSpotLightShadowsWithMaps),N.push(M.numLightProbes),N.push(M.shadowMapType),N.push(M.toneMapping),N.push(M.numClippingPlanes),N.push(M.numClipIntersection),N.push(M.depthPacking)}function S(N,M){o.disableAll(),M.supportsVertexTextures&&o.enable(0),M.instancing&&o.enable(1),M.instancingColor&&o.enable(2),M.instancingMorph&&o.enable(3),M.matcap&&o.enable(4),M.envMap&&o.enable(5),M.normalMapObjectSpace&&o.enable(6),M.normalMapTangentSpace&&o.enable(7),M.clearcoat&&o.enable(8),M.iridescence&&o.enable(9),M.alphaTest&&o.enable(10),M.vertexColors&&o.enable(11),M.vertexAlphas&&o.enable(12),M.vertexUv1s&&o.enable(13),M.vertexUv2s&&o.enable(14),M.vertexUv3s&&o.enable(15),M.vertexTangents&&o.enable(16),M.anisotropy&&o.enable(17),M.alphaHash&&o.enable(18),M.batching&&o.enable(19),M.dispersion&&o.enable(20),M.batchingColor&&o.enable(21),N.push(o.mask),o.disableAll(),M.fog&&o.enable(0),M.useFog&&o.enable(1),M.flatShading&&o.enable(2),M.logarithmicDepthBuffer&&o.enable(3),M.reverseDepthBuffer&&o.enable(4),M.skinning&&o.enable(5),M.morphTargets&&o.enable(6),M.morphNormals&&o.enable(7),M.morphColors&&o.enable(8),M.premultipliedAlpha&&o.enable(9),M.shadowMapEnabled&&o.enable(10),M.doubleSided&&o.enable(11),M.flipSided&&o.enable(12),M.useDepthPacking&&o.enable(13),M.dithering&&o.enable(14),M.transmission&&o.enable(15),M.sheen&&o.enable(16),M.opaque&&o.enable(17),M.pointsUvs&&o.enable(18),M.decodeVideoTexture&&o.enable(19),M.decodeVideoTextureEmissive&&o.enable(20),M.alphaToCoverage&&o.enable(21),N.push(o.mask)}function A(N){const M=g[N.type];let B;if(M){const G=Eo[M];B=nD.clone(G.uniforms)}else B=N.uniforms;return B}function I(N,M){let B;for(let G=0,W=c.length;G0?r.push(b):m.transparent===!0?i.push(b):n.push(b)}function l(d,f,m,g,y,v){const b=s(d,f,m,g,y,v);m.transmission>0?r.unshift(b):m.transparent===!0?i.unshift(b):n.unshift(b)}function u(d,f){n.length>1&&n.sort(d||kAe),r.length>1&&r.sort(f||s5),i.length>1&&i.sort(f||s5)}function c(){for(let d=e,f=t.length;d=a.length?(s=new o5,a.push(s)):s=a[i],s}function n(){t=new WeakMap}return{get:e,dispose:n}}function BAe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new H,color:new vt};break;case"SpotLight":n={position:new H,direction:new H,color:new vt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new H,color:new vt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new H,skyColor:new vt,groundColor:new vt};break;case"RectAreaLight":n={color:new vt,position:new H,halfWidth:new H,halfHeight:new H};break}return t[e.id]=n,n}}}function FAe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let UAe=0;function zAe(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function HAe(t){const e=new BAe,n=FAe(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)r.probe.push(new H);const i=new H,a=new en,s=new en;function o(u){let c=0,d=0,f=0;for(let N=0;N<9;N++)r.probe[N].set(0,0,0);let m=0,g=0,y=0,v=0,b=0,E=0,S=0,A=0,I=0,T=0,R=0;u.sort(zAe);for(let N=0,M=u.length;N0&&(t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=It.LTC_FLOAT_1,r.rectAreaLTC2=It.LTC_FLOAT_2):(r.rectAreaLTC1=It.LTC_HALF_1,r.rectAreaLTC2=It.LTC_HALF_2)),r.ambient[0]=c,r.ambient[1]=d,r.ambient[2]=f;const O=r.hash;(O.directionalLength!==m||O.pointLength!==g||O.spotLength!==y||O.rectAreaLength!==v||O.hemiLength!==b||O.numDirectionalShadows!==E||O.numPointShadows!==S||O.numSpotShadows!==A||O.numSpotMaps!==I||O.numLightProbes!==R)&&(r.directional.length=m,r.spot.length=y,r.rectArea.length=v,r.point.length=g,r.hemi.length=b,r.directionalShadow.length=E,r.directionalShadowMap.length=E,r.pointShadow.length=S,r.pointShadowMap.length=S,r.spotShadow.length=A,r.spotShadowMap.length=A,r.directionalShadowMatrix.length=E,r.pointShadowMatrix.length=S,r.spotLightMatrix.length=A+I-T,r.spotLightMap.length=I,r.numSpotLightShadowsWithMaps=T,r.numLightProbes=R,O.directionalLength=m,O.pointLength=g,O.spotLength=y,O.rectAreaLength=v,O.hemiLength=b,O.numDirectionalShadows=E,O.numPointShadows=S,O.numSpotShadows=A,O.numSpotMaps=I,O.numLightProbes=R,r.version=UAe++)}function l(u,c){let d=0,f=0,m=0,g=0,y=0;const v=c.matrixWorldInverse;for(let b=0,E=u.length;b=s.length?(o=new l5(t),s.push(o)):o=s[a],o}function r(){e=new WeakMap}return{get:n,dispose:r}}class ay extends ii{static get type(){return"MeshDepthMaterial"}constructor(e){super(),this.isMeshDepthMaterial=!0,this.depthPacking=aq,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 ex extends ii{static get type(){return"MeshDistanceMaterial"}constructor(e){super(),this.isMeshDistanceMaterial=!0,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const VAe=`void main() { +`+F)}else G!==""?console.warn("THREE.WebGLProgram: Program Info Log:",G):(W===""||K==="")&&(ae=!1);ae&&(B.diagnostics={runnable:se,programLog:G,vertexShader:{log:W,prefix:v},fragmentShader:{log:K,prefix:b}})}i.deleteShader(I),i.deleteShader(x),O=new $_(i,y),N=yAe(i,y)}let O;this.getUniforms=function(){return O===void 0&&R(this),O};let N;this.getAttributes=function(){return N===void 0&&R(this),N};let M=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(y,uAe)),M},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(y),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=cAe++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=I,this.fragmentShader=x,this}let MAe=0;class NAe{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),a=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(a)===!1&&(s.add(a),a.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)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 n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new OAe(e),n.set(e,r)),r}}class OAe{constructor(e){this.id=MAe++,this.code=e,this.usedTimes=0}}function DAe(t,e,n,r,i,a,s){const o=new ef,l=new NAe,u=new Set,c=[],d=i.logarithmicDepthBuffer,f=i.vertexTextures;let m=i.precision;const g={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(N){return u.add(N),N===0?"uv":`uv${N}`}function v(N,M,B,G,W){const K=G.fog,se=W.geometry,ae=N.isMeshStandardMaterial?G.environment:null,ee=(N.isMeshStandardMaterial?n:e).get(N.envMap||ae),F=ee&&ee.mapping===ym?ee.image.height:null,ie=g[N.type];N.precision!==null&&(m=i.getMaxPrecision(N.precision),m!==N.precision&&console.warn("THREE.WebGLProgram.getParameters:",N.precision,"not supported, using",m,"instead."));const J=se.morphAttributes.position||se.morphAttributes.normal||se.morphAttributes.color,fe=J!==void 0?J.length:0;let Ce=0;se.morphAttributes.position!==void 0&&(Ce=1),se.morphAttributes.normal!==void 0&&(Ce=2),se.morphAttributes.color!==void 0&&(Ce=3);let Le,j,ke,Fe;if(ie){const pn=Eo[ie];Le=pn.vertexShader,j=pn.fragmentShader}else Le=N.vertexShader,j=N.fragmentShader,l.update(N),ke=l.getVertexShaderID(N),Fe=l.getFragmentShaderID(N);const Ye=t.getRenderTarget(),gt=t.state.buffers.depth.getReversed(),Gt=W.isInstancedMesh===!0,Ut=W.isBatchedMesh===!0,Mt=!!N.map,$e=!!N.matcap,qe=!!ee,re=!!N.aoMap,At=!!N.lightMap,Je=!!N.bumpMap,xt=!!N.normalMap,ot=!!N.displacementMap,Vt=!!N.emissiveMap,yt=!!N.metalnessMap,q=!!N.roughnessMap,U=N.anisotropy>0,ue=N.clearcoat>0,_e=N.dispersion>0,Ge=N.iridescence>0,Pe=N.sheen>0,ft=N.transmission>0,nt=U&&!!N.anisotropyMap,ht=ue&&!!N.clearcoatMap,tn=ue&&!!N.clearcoatNormalMap,tt=ue&&!!N.clearcoatRoughnessMap,Et=Ge&&!!N.iridescenceMap,zt=Ge&&!!N.iridescenceThicknessMap,Dt=Pe&&!!N.sheenColorMap,bt=Pe&&!!N.sheenRoughnessMap,me=!!N.specularMap,De=!!N.specularColorMap,rt=!!N.specularIntensityMap,ge=ft&&!!N.transmissionMap,Te=ft&&!!N.thicknessMap,Me=!!N.gradientMap,Xe=!!N.alphaMap,_t=N.alphaTest>0,St=!!N.alphaHash,Xt=!!N.extensions;let mn=fl;N.toneMapped&&(Ye===null||Ye.isXRRenderTarget===!0)&&(mn=t.toneMapping);const Hn={shaderID:ie,shaderType:N.type,shaderName:N.name,vertexShader:Le,fragmentShader:j,defines:N.defines,customVertexShaderID:ke,customFragmentShaderID:Fe,isRawShaderMaterial:N.isRawShaderMaterial===!0,glslVersion:N.glslVersion,precision:m,batching:Ut,batchingColor:Ut&&W._colorsTexture!==null,instancing:Gt,instancingColor:Gt&&W.instanceColor!==null,instancingMorph:Gt&&W.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:Ye===null?t.outputColorSpace:Ye.isXRRenderTarget===!0?Ye.texture.colorSpace:vl,alphaToCoverage:!!N.alphaToCoverage,map:Mt,matcap:$e,envMap:qe,envMapMode:qe&&ee.mapping,envMapCubeUVHeight:F,aoMap:re,lightMap:At,bumpMap:Je,normalMap:xt,displacementMap:f&&ot,emissiveMap:Vt,normalMapObjectSpace:xt&&N.normalMapType===oq,normalMapTangentSpace:xt&&N.normalMapType===Bc,metalnessMap:yt,roughnessMap:q,anisotropy:U,anisotropyMap:nt,clearcoat:ue,clearcoatMap:ht,clearcoatNormalMap:tn,clearcoatRoughnessMap:tt,dispersion:_e,iridescence:Ge,iridescenceMap:Et,iridescenceThicknessMap:zt,sheen:Pe,sheenColorMap:Dt,sheenRoughnessMap:bt,specularMap:me,specularColorMap:De,specularIntensityMap:rt,transmission:ft,transmissionMap:ge,thicknessMap:Te,gradientMap:Me,opaque:N.transparent===!1&&N.blending===Zd&&N.alphaToCoverage===!1,alphaMap:Xe,alphaTest:_t,alphaHash:St,combine:N.combine,mapUv:Mt&&y(N.map.channel),aoMapUv:re&&y(N.aoMap.channel),lightMapUv:At&&y(N.lightMap.channel),bumpMapUv:Je&&y(N.bumpMap.channel),normalMapUv:xt&&y(N.normalMap.channel),displacementMapUv:ot&&y(N.displacementMap.channel),emissiveMapUv:Vt&&y(N.emissiveMap.channel),metalnessMapUv:yt&&y(N.metalnessMap.channel),roughnessMapUv:q&&y(N.roughnessMap.channel),anisotropyMapUv:nt&&y(N.anisotropyMap.channel),clearcoatMapUv:ht&&y(N.clearcoatMap.channel),clearcoatNormalMapUv:tn&&y(N.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:tt&&y(N.clearcoatRoughnessMap.channel),iridescenceMapUv:Et&&y(N.iridescenceMap.channel),iridescenceThicknessMapUv:zt&&y(N.iridescenceThicknessMap.channel),sheenColorMapUv:Dt&&y(N.sheenColorMap.channel),sheenRoughnessMapUv:bt&&y(N.sheenRoughnessMap.channel),specularMapUv:me&&y(N.specularMap.channel),specularColorMapUv:De&&y(N.specularColorMap.channel),specularIntensityMapUv:rt&&y(N.specularIntensityMap.channel),transmissionMapUv:ge&&y(N.transmissionMap.channel),thicknessMapUv:Te&&y(N.thicknessMap.channel),alphaMapUv:Xe&&y(N.alphaMap.channel),vertexTangents:!!se.attributes.tangent&&(xt||U),vertexColors:N.vertexColors,vertexAlphas:N.vertexColors===!0&&!!se.attributes.color&&se.attributes.color.itemSize===4,pointsUvs:W.isPoints===!0&&!!se.attributes.uv&&(Mt||Xe),fog:!!K,useFog:N.fog===!0,fogExp2:!!K&&K.isFogExp2,flatShading:N.flatShading===!0,sizeAttenuation:N.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:gt,skinning:W.isSkinnedMesh===!0,morphTargets:se.morphAttributes.position!==void 0,morphNormals:se.morphAttributes.normal!==void 0,morphColors:se.morphAttributes.color!==void 0,morphTargetsCount:fe,morphTextureStride:Ce,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:N.dithering,shadowMapEnabled:t.shadowMap.enabled&&B.length>0,shadowMapType:t.shadowMap.type,toneMapping:mn,decodeVideoTexture:Mt&&N.map.isVideoTexture===!0&&Un.getTransfer(N.map.colorSpace)===sr,decodeVideoTextureEmissive:Vt&&N.emissiveMap.isVideoTexture===!0&&Un.getTransfer(N.emissiveMap.colorSpace)===sr,premultipliedAlpha:N.premultipliedAlpha,doubleSided:N.side===fa,flipSided:N.side===ka,useDepthPacking:N.depthPacking>=0,depthPacking:N.depthPacking||0,index0AttributeName:N.index0AttributeName,extensionClipCullDistance:Xt&&N.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Xt&&N.extensions.multiDraw===!0||Ut)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:N.customProgramCacheKey()};return Hn.vertexUv1s=u.has(1),Hn.vertexUv2s=u.has(2),Hn.vertexUv3s=u.has(3),u.clear(),Hn}function b(N){const M=[];if(N.shaderID?M.push(N.shaderID):(M.push(N.customVertexShaderID),M.push(N.customFragmentShaderID)),N.defines!==void 0)for(const B in N.defines)M.push(B),M.push(N.defines[B]);return N.isRawShaderMaterial===!1&&(E(M,N),_(M,N),M.push(t.outputColorSpace)),M.push(N.customProgramCacheKey),M.join()}function E(N,M){N.push(M.precision),N.push(M.outputColorSpace),N.push(M.envMapMode),N.push(M.envMapCubeUVHeight),N.push(M.mapUv),N.push(M.alphaMapUv),N.push(M.lightMapUv),N.push(M.aoMapUv),N.push(M.bumpMapUv),N.push(M.normalMapUv),N.push(M.displacementMapUv),N.push(M.emissiveMapUv),N.push(M.metalnessMapUv),N.push(M.roughnessMapUv),N.push(M.anisotropyMapUv),N.push(M.clearcoatMapUv),N.push(M.clearcoatNormalMapUv),N.push(M.clearcoatRoughnessMapUv),N.push(M.iridescenceMapUv),N.push(M.iridescenceThicknessMapUv),N.push(M.sheenColorMapUv),N.push(M.sheenRoughnessMapUv),N.push(M.specularMapUv),N.push(M.specularColorMapUv),N.push(M.specularIntensityMapUv),N.push(M.transmissionMapUv),N.push(M.thicknessMapUv),N.push(M.combine),N.push(M.fogExp2),N.push(M.sizeAttenuation),N.push(M.morphTargetsCount),N.push(M.morphAttributeCount),N.push(M.numDirLights),N.push(M.numPointLights),N.push(M.numSpotLights),N.push(M.numSpotLightMaps),N.push(M.numHemiLights),N.push(M.numRectAreaLights),N.push(M.numDirLightShadows),N.push(M.numPointLightShadows),N.push(M.numSpotLightShadows),N.push(M.numSpotLightShadowsWithMaps),N.push(M.numLightProbes),N.push(M.shadowMapType),N.push(M.toneMapping),N.push(M.numClippingPlanes),N.push(M.numClipIntersection),N.push(M.depthPacking)}function _(N,M){o.disableAll(),M.supportsVertexTextures&&o.enable(0),M.instancing&&o.enable(1),M.instancingColor&&o.enable(2),M.instancingMorph&&o.enable(3),M.matcap&&o.enable(4),M.envMap&&o.enable(5),M.normalMapObjectSpace&&o.enable(6),M.normalMapTangentSpace&&o.enable(7),M.clearcoat&&o.enable(8),M.iridescence&&o.enable(9),M.alphaTest&&o.enable(10),M.vertexColors&&o.enable(11),M.vertexAlphas&&o.enable(12),M.vertexUv1s&&o.enable(13),M.vertexUv2s&&o.enable(14),M.vertexUv3s&&o.enable(15),M.vertexTangents&&o.enable(16),M.anisotropy&&o.enable(17),M.alphaHash&&o.enable(18),M.batching&&o.enable(19),M.dispersion&&o.enable(20),M.batchingColor&&o.enable(21),N.push(o.mask),o.disableAll(),M.fog&&o.enable(0),M.useFog&&o.enable(1),M.flatShading&&o.enable(2),M.logarithmicDepthBuffer&&o.enable(3),M.reverseDepthBuffer&&o.enable(4),M.skinning&&o.enable(5),M.morphTargets&&o.enable(6),M.morphNormals&&o.enable(7),M.morphColors&&o.enable(8),M.premultipliedAlpha&&o.enable(9),M.shadowMapEnabled&&o.enable(10),M.doubleSided&&o.enable(11),M.flipSided&&o.enable(12),M.useDepthPacking&&o.enable(13),M.dithering&&o.enable(14),M.transmission&&o.enable(15),M.sheen&&o.enable(16),M.opaque&&o.enable(17),M.pointsUvs&&o.enable(18),M.decodeVideoTexture&&o.enable(19),M.decodeVideoTextureEmissive&&o.enable(20),M.alphaToCoverage&&o.enable(21),N.push(o.mask)}function A(N){const M=g[N.type];let B;if(M){const G=Eo[M];B=nD.clone(G.uniforms)}else B=N.uniforms;return B}function I(N,M){let B;for(let G=0,W=c.length;G0?r.push(b):m.transparent===!0?i.push(b):n.push(b)}function l(d,f,m,g,y,v){const b=s(d,f,m,g,y,v);m.transmission>0?r.unshift(b):m.transparent===!0?i.unshift(b):n.unshift(b)}function u(d,f){n.length>1&&n.sort(d||kAe),r.length>1&&r.sort(f||s5),i.length>1&&i.sort(f||s5)}function c(){for(let d=e,f=t.length;d=a.length?(s=new o5,a.push(s)):s=a[i],s}function n(){t=new WeakMap}return{get:e,dispose:n}}function BAe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new H,color:new vt};break;case"SpotLight":n={position:new H,direction:new H,color:new vt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new H,color:new vt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new H,skyColor:new vt,groundColor:new vt};break;case"RectAreaLight":n={color:new vt,position:new H,halfWidth:new H,halfHeight:new H};break}return t[e.id]=n,n}}}function FAe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let UAe=0;function zAe(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function HAe(t){const e=new BAe,n=FAe(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)r.probe.push(new H);const i=new H,a=new en,s=new en;function o(u){let c=0,d=0,f=0;for(let N=0;N<9;N++)r.probe[N].set(0,0,0);let m=0,g=0,y=0,v=0,b=0,E=0,_=0,A=0,I=0,x=0,R=0;u.sort(zAe);for(let N=0,M=u.length;N0&&(t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=It.LTC_FLOAT_1,r.rectAreaLTC2=It.LTC_FLOAT_2):(r.rectAreaLTC1=It.LTC_HALF_1,r.rectAreaLTC2=It.LTC_HALF_2)),r.ambient[0]=c,r.ambient[1]=d,r.ambient[2]=f;const O=r.hash;(O.directionalLength!==m||O.pointLength!==g||O.spotLength!==y||O.rectAreaLength!==v||O.hemiLength!==b||O.numDirectionalShadows!==E||O.numPointShadows!==_||O.numSpotShadows!==A||O.numSpotMaps!==I||O.numLightProbes!==R)&&(r.directional.length=m,r.spot.length=y,r.rectArea.length=v,r.point.length=g,r.hemi.length=b,r.directionalShadow.length=E,r.directionalShadowMap.length=E,r.pointShadow.length=_,r.pointShadowMap.length=_,r.spotShadow.length=A,r.spotShadowMap.length=A,r.directionalShadowMatrix.length=E,r.pointShadowMatrix.length=_,r.spotLightMatrix.length=A+I-x,r.spotLightMap.length=I,r.numSpotLightShadowsWithMaps=x,r.numLightProbes=R,O.directionalLength=m,O.pointLength=g,O.spotLength=y,O.rectAreaLength=v,O.hemiLength=b,O.numDirectionalShadows=E,O.numPointShadows=_,O.numSpotShadows=A,O.numSpotMaps=I,O.numLightProbes=R,r.version=UAe++)}function l(u,c){let d=0,f=0,m=0,g=0,y=0;const v=c.matrixWorldInverse;for(let b=0,E=u.length;b=s.length?(o=new l5(t),s.push(o)):o=s[a],o}function r(){e=new WeakMap}return{get:n,dispose:r}}class ay extends ii{static get type(){return"MeshDepthMaterial"}constructor(e){super(),this.isMeshDepthMaterial=!0,this.depthPacking=aq,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 eT extends ii{static get type(){return"MeshDistanceMaterial"}constructor(e){super(),this.isMeshDistanceMaterial=!0,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const VAe=`void main() { gl_Position = vec4( position, 1.0 ); }`,$Ae=`uniform sampler2D shadow_pass; uniform vec2 resolution; @@ -4176,12 +4176,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function WAe(t,e,n){let r=new iy;const i=new Ke,a=new Ke,s=new Yn,o=new ay({depthPacking:sq}),l=new ex,u={},c=n.maxTextureSize,d={[gl]:ka,[ka]:gl,[fa]:fa},f=new qi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ke},radius:{value:4}},vertexShader:VAe,fragmentShader:$Ae}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const g=new fn;g.setAttribute("position",new Kn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new Ot(g,f),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=GT;let b=this.type;this.render=function(T,R,O){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||T.length===0)return;const N=t.getRenderTarget(),M=t.getActiveCubeFace(),B=t.getActiveMipmapLevel(),G=t.state;G.setBlending(dl),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const W=b!==go&&this.type===go,K=b===go&&this.type!==go;for(let se=0,ae=T.length;sec||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/ie.x),i.x=a.x*ie.x,F.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/ie.y),i.y=a.y*ie.y,F.mapSize.y=a.y)),F.map===null||W===!0||K===!0){const fe=this.type!==go?{minFilter:pi,magFilter:pi}:{};F.map!==null&&F.map.dispose(),F.map=new ki(i.x,i.y,fe),F.map.texture.name=ee.name+".shadowMap",F.camera.updateProjectionMatrix()}t.setRenderTarget(F.map),t.clear();const J=F.getViewportCount();for(let fe=0;fe0||R.map&&R.alphaTest>0){const G=M.uuid,W=R.uuid;let K=u[G];K===void 0&&(K={},u[G]=K);let se=K[W];se===void 0&&(se=M.clone(),K[W]=se,R.addEventListener("dispose",I)),M=se}if(M.visible=R.visible,M.wireframe=R.wireframe,N===go?M.side=R.shadowSide!==null?R.shadowSide:R.side:M.side=R.shadowSide!==null?R.shadowSide:d[R.side],M.alphaMap=R.alphaMap,M.alphaTest=R.alphaTest,M.map=R.map,M.clipShadows=R.clipShadows,M.clippingPlanes=R.clippingPlanes,M.clipIntersection=R.clipIntersection,M.displacementMap=R.displacementMap,M.displacementScale=R.displacementScale,M.displacementBias=R.displacementBias,M.wireframeLinewidth=R.wireframeLinewidth,M.linewidth=R.linewidth,O.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const G=t.properties.get(M);G.light=O}return M}function A(T,R,O,N,M){if(T.visible===!1)return;if(T.layers.test(R.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&M===go)&&(!T.frustumCulled||r.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,T.matrixWorld);const W=e.update(T),K=T.material;if(Array.isArray(K)){const se=W.groups;for(let ae=0,ee=se.length;ae=1):F.indexOf("OpenGL ES")!==-1&&(ee=parseFloat(/^OpenGL ES (\d)/.exec(F)[1]),ae=ee>=2);let ie=null,J={};const fe=t.getParameter(t.SCISSOR_BOX),Ce=t.getParameter(t.VIEWPORT),Le=new Yn().fromArray(fe),j=new Yn().fromArray(Ce);function ke(ge,xe,Me,Xe){const St=new Uint8Array(4),_t=t.createTexture();t.bindTexture(ge,_t),t.texParameteri(ge,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(ge,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Xt=0;Xte?(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t}function XAe(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t}function KAe(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t}function DM(t,e,n,r){const i=ZAe(r);switch(n){case VO:return t*e;case WO:return t*e;case jO:return t*e*2;case Jb:return t*e/i.components*i.byteLength;case ey:return t*e/i.components*i.byteLength;case YO:return t*e*2/i.components*i.byteLength;case qT:return t*e*2/i.components*i.byteLength;case $O:return t*e*3/i.components*i.byteLength;case ri:return t*e*4/i.components*i.byteLength;case XT:return t*e*4/i.components*i.byteLength;case x0:case w0:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case C0:case R0:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case Z_:case J_:return Math.max(t,16)*Math.max(e,8)/4;case K_:case Q_:return Math.max(t,8)*Math.max(e,8)/2;case eA:case tA:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case nA:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case rA:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case iA:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case aA:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case sA:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case oA:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case lA:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case uA:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case cA:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case dA:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case fA:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case pA:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case hA:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case mA:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case gA:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case I0:case bA:case yA:return Math.ceil(t/4)*Math.ceil(e/4)*16;case qO:case vA:return Math.ceil(t/4)*Math.ceil(e/4)*8;case EA:case SA:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function ZAe(t){switch(t){case as:case $T:return{byteLength:1,components:1};case Xh:case WT:case fi:return{byteLength:2,components:1};case jT:case YT:return{byteLength:2,components:4};case yl:case Qb:case Or:return{byteLength:4,components:1};case GO:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}const QAe={contain:qAe,cover:XAe,fill:KAe,getByteLength:DM};function JAe(t,e,n,r,i,a,s){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new Ke,c=new WeakMap;let d;const f=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(q,U){return m?new OffscreenCanvas(q,U):Tb("canvas")}function y(q,U,ue){let Se=1;const Ge=yt(q);if((Ge.width>ue||Ge.height>ue)&&(Se=ue/Math.max(Ge.width,Ge.height)),Se<1)if(typeof HTMLImageElement<"u"&&q instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&q instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&q instanceof ImageBitmap||typeof VideoFrame<"u"&&q instanceof VideoFrame){const Pe=Math.floor(Se*Ge.width),ft=Math.floor(Se*Ge.height);d===void 0&&(d=g(Pe,ft));const nt=U?g(Pe,ft):d;return nt.width=Pe,nt.height=ft,nt.getContext("2d").drawImage(q,0,0,Pe,ft),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ge.width+"x"+Ge.height+") to ("+Pe+"x"+ft+")."),nt}else return"data"in q&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ge.width+"x"+Ge.height+")."),q;return q}function v(q){return q.generateMipmaps}function b(q){t.generateMipmap(q)}function E(q){return q.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:q.isWebGL3DRenderTarget?t.TEXTURE_3D:q.isWebGLArrayRenderTarget||q.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function S(q,U,ue,Se,Ge=!1){if(q!==null){if(t[q]!==void 0)return t[q];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+q+"'")}let Pe=U;if(U===t.RED&&(ue===t.FLOAT&&(Pe=t.R32F),ue===t.HALF_FLOAT&&(Pe=t.R16F),ue===t.UNSIGNED_BYTE&&(Pe=t.R8)),U===t.RED_INTEGER&&(ue===t.UNSIGNED_BYTE&&(Pe=t.R8UI),ue===t.UNSIGNED_SHORT&&(Pe=t.R16UI),ue===t.UNSIGNED_INT&&(Pe=t.R32UI),ue===t.BYTE&&(Pe=t.R8I),ue===t.SHORT&&(Pe=t.R16I),ue===t.INT&&(Pe=t.R32I)),U===t.RG&&(ue===t.FLOAT&&(Pe=t.RG32F),ue===t.HALF_FLOAT&&(Pe=t.RG16F),ue===t.UNSIGNED_BYTE&&(Pe=t.RG8)),U===t.RG_INTEGER&&(ue===t.UNSIGNED_BYTE&&(Pe=t.RG8UI),ue===t.UNSIGNED_SHORT&&(Pe=t.RG16UI),ue===t.UNSIGNED_INT&&(Pe=t.RG32UI),ue===t.BYTE&&(Pe=t.RG8I),ue===t.SHORT&&(Pe=t.RG16I),ue===t.INT&&(Pe=t.RG32I)),U===t.RGB_INTEGER&&(ue===t.UNSIGNED_BYTE&&(Pe=t.RGB8UI),ue===t.UNSIGNED_SHORT&&(Pe=t.RGB16UI),ue===t.UNSIGNED_INT&&(Pe=t.RGB32UI),ue===t.BYTE&&(Pe=t.RGB8I),ue===t.SHORT&&(Pe=t.RGB16I),ue===t.INT&&(Pe=t.RGB32I)),U===t.RGBA_INTEGER&&(ue===t.UNSIGNED_BYTE&&(Pe=t.RGBA8UI),ue===t.UNSIGNED_SHORT&&(Pe=t.RGBA16UI),ue===t.UNSIGNED_INT&&(Pe=t.RGBA32UI),ue===t.BYTE&&(Pe=t.RGBA8I),ue===t.SHORT&&(Pe=t.RGBA16I),ue===t.INT&&(Pe=t.RGBA32I)),U===t.RGB&&ue===t.UNSIGNED_INT_5_9_9_9_REV&&(Pe=t.RGB9_E5),U===t.RGBA){const ft=Ge?ty:Un.getTransfer(Se);ue===t.FLOAT&&(Pe=t.RGBA32F),ue===t.HALF_FLOAT&&(Pe=t.RGBA16F),ue===t.UNSIGNED_BYTE&&(Pe=ft===sr?t.SRGB8_ALPHA8:t.RGBA8),ue===t.UNSIGNED_SHORT_4_4_4_4&&(Pe=t.RGBA4),ue===t.UNSIGNED_SHORT_5_5_5_1&&(Pe=t.RGB5_A1)}return(Pe===t.R16F||Pe===t.R32F||Pe===t.RG16F||Pe===t.RG32F||Pe===t.RGBA16F||Pe===t.RGBA32F)&&e.get("EXT_color_buffer_float"),Pe}function A(q,U){let ue;return q?U===null||U===yl||U===gf?ue=t.DEPTH24_STENCIL8:U===Or?ue=t.DEPTH32F_STENCIL8:U===Xh&&(ue=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):U===null||U===yl||U===gf?ue=t.DEPTH_COMPONENT24:U===Or?ue=t.DEPTH_COMPONENT32F:U===Xh&&(ue=t.DEPTH_COMPONENT16),ue}function I(q,U){return v(q)===!0||q.isFramebufferTexture&&q.minFilter!==pi&&q.minFilter!==Xn?Math.log2(Math.max(U.width,U.height))+1:q.mipmaps!==void 0&&q.mipmaps.length>0?q.mipmaps.length:q.isCompressedTexture&&Array.isArray(q.image)?U.mipmaps.length:1}function T(q){const U=q.target;U.removeEventListener("dispose",T),O(U),U.isVideoTexture&&c.delete(U)}function R(q){const U=q.target;U.removeEventListener("dispose",R),M(U)}function O(q){const U=r.get(q);if(U.__webglInit===void 0)return;const ue=q.source,Se=f.get(ue);if(Se){const Ge=Se[U.__cacheKey];Ge.usedTimes--,Ge.usedTimes===0&&N(q),Object.keys(Se).length===0&&f.delete(ue)}r.remove(q)}function N(q){const U=r.get(q);t.deleteTexture(U.__webglTexture);const ue=q.source,Se=f.get(ue);delete Se[U.__cacheKey],s.memory.textures--}function M(q){const U=r.get(q);if(q.depthTexture&&(q.depthTexture.dispose(),r.remove(q.depthTexture)),q.isWebGLCubeRenderTarget)for(let Se=0;Se<6;Se++){if(Array.isArray(U.__webglFramebuffer[Se]))for(let Ge=0;Ge=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+q+" texture units while this GPU supports only "+i.maxTextures),B+=1,q}function K(q){const U=[];return U.push(q.wrapS),U.push(q.wrapT),U.push(q.wrapR||0),U.push(q.magFilter),U.push(q.minFilter),U.push(q.anisotropy),U.push(q.internalFormat),U.push(q.format),U.push(q.type),U.push(q.generateMipmaps),U.push(q.premultiplyAlpha),U.push(q.flipY),U.push(q.unpackAlignment),U.push(q.colorSpace),U.join()}function se(q,U){const ue=r.get(q);if(q.isVideoTexture&&ot(q),q.isRenderTargetTexture===!1&&q.version>0&&ue.__version!==q.version){const Se=q.image;if(Se===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Se.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{j(ue,q,U);return}}n.bindTexture(t.TEXTURE_2D,ue.__webglTexture,t.TEXTURE0+U)}function ae(q,U){const ue=r.get(q);if(q.version>0&&ue.__version!==q.version){j(ue,q,U);return}n.bindTexture(t.TEXTURE_2D_ARRAY,ue.__webglTexture,t.TEXTURE0+U)}function ee(q,U){const ue=r.get(q);if(q.version>0&&ue.__version!==q.version){j(ue,q,U);return}n.bindTexture(t.TEXTURE_3D,ue.__webglTexture,t.TEXTURE0+U)}function F(q,U){const ue=r.get(q);if(q.version>0&&ue.__version!==q.version){ke(ue,q,U);return}n.bindTexture(t.TEXTURE_CUBE_MAP,ue.__webglTexture,t.TEXTURE0+U)}const ie={[wc]:t.REPEAT,[ni]:t.CLAMP_TO_EDGE,[qh]:t.MIRRORED_REPEAT},J={[pi]:t.NEAREST,[VT]:t.NEAREST_MIPMAP_NEAREST,[Pd]:t.NEAREST_MIPMAP_LINEAR,[Xn]:t.LINEAR,[xh]:t.LINEAR_MIPMAP_NEAREST,[Js]:t.LINEAR_MIPMAP_LINEAR},fe={[lq]:t.NEVER,[hq]:t.ALWAYS,[uq]:t.LESS,[ZO]:t.LEQUAL,[cq]:t.EQUAL,[pq]:t.GEQUAL,[dq]:t.GREATER,[fq]:t.NOTEQUAL};function Ce(q,U){if(U.type===Or&&e.has("OES_texture_float_linear")===!1&&(U.magFilter===Xn||U.magFilter===xh||U.magFilter===Pd||U.magFilter===Js||U.minFilter===Xn||U.minFilter===xh||U.minFilter===Pd||U.minFilter===Js)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(q,t.TEXTURE_WRAP_S,ie[U.wrapS]),t.texParameteri(q,t.TEXTURE_WRAP_T,ie[U.wrapT]),(q===t.TEXTURE_3D||q===t.TEXTURE_2D_ARRAY)&&t.texParameteri(q,t.TEXTURE_WRAP_R,ie[U.wrapR]),t.texParameteri(q,t.TEXTURE_MAG_FILTER,J[U.magFilter]),t.texParameteri(q,t.TEXTURE_MIN_FILTER,J[U.minFilter]),U.compareFunction&&(t.texParameteri(q,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(q,t.TEXTURE_COMPARE_FUNC,fe[U.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(U.magFilter===pi||U.minFilter!==Pd&&U.minFilter!==Js||U.type===Or&&e.has("OES_texture_float_linear")===!1)return;if(U.anisotropy>1||r.get(U).__currentAnisotropy){const ue=e.get("EXT_texture_filter_anisotropic");t.texParameterf(q,ue.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,i.getMaxAnisotropy())),r.get(U).__currentAnisotropy=U.anisotropy}}}function Le(q,U){let ue=!1;q.__webglInit===void 0&&(q.__webglInit=!0,U.addEventListener("dispose",T));const Se=U.source;let Ge=f.get(Se);Ge===void 0&&(Ge={},f.set(Se,Ge));const Pe=K(U);if(Pe!==q.__cacheKey){Ge[Pe]===void 0&&(Ge[Pe]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,ue=!0),Ge[Pe].usedTimes++;const ft=Ge[q.__cacheKey];ft!==void 0&&(Ge[q.__cacheKey].usedTimes--,ft.usedTimes===0&&N(U)),q.__cacheKey=Pe,q.__webglTexture=Ge[Pe].texture}return ue}function j(q,U,ue){let Se=t.TEXTURE_2D;(U.isDataArrayTexture||U.isCompressedArrayTexture)&&(Se=t.TEXTURE_2D_ARRAY),U.isData3DTexture&&(Se=t.TEXTURE_3D);const Ge=Le(q,U),Pe=U.source;n.bindTexture(Se,q.__webglTexture,t.TEXTURE0+ue);const ft=r.get(Pe);if(Pe.version!==ft.__version||Ge===!0){n.activeTexture(t.TEXTURE0+ue);const nt=Un.getPrimaries(Un.workingColorSpace),ht=U.colorSpace===jl?null:Un.getPrimaries(U.colorSpace),tn=U.colorSpace===jl||nt===ht?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,U.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,U.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,tn);let tt=y(U.image,!1,i.maxTextureSize);tt=Vt(U,tt);const Et=a.convert(U.format,U.colorSpace),zt=a.convert(U.type);let Dt=S(U.internalFormat,Et,zt,U.colorSpace,U.isVideoTexture);Ce(Se,U);let bt;const me=U.mipmaps,De=U.isVideoTexture!==!0,rt=ft.__version===void 0||Ge===!0,ge=Pe.dataReady,xe=I(U,tt);if(U.isDepthTexture)Dt=A(U.format===bf,U.type),rt&&(De?n.texStorage2D(t.TEXTURE_2D,1,Dt,tt.width,tt.height):n.texImage2D(t.TEXTURE_2D,0,Dt,tt.width,tt.height,0,Et,zt,null));else if(U.isDataTexture)if(me.length>0){De&&rt&&n.texStorage2D(t.TEXTURE_2D,xe,Dt,me[0].width,me[0].height);for(let Me=0,Xe=me.length;Me0){const St=DM(bt.width,bt.height,U.format,U.type);for(const _t of U.layerUpdates){const Xt=bt.data.subarray(_t*St/bt.data.BYTES_PER_ELEMENT,(_t+1)*St/bt.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Me,0,0,_t,bt.width,bt.height,1,Et,Xt)}U.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Me,0,0,0,bt.width,bt.height,tt.depth,Et,bt.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,Me,Dt,bt.width,bt.height,tt.depth,0,bt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else De?ge&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,Me,0,0,0,bt.width,bt.height,tt.depth,Et,zt,bt.data):n.texImage3D(t.TEXTURE_2D_ARRAY,Me,Dt,bt.width,bt.height,tt.depth,0,Et,zt,bt.data)}else{De&&rt&&n.texStorage2D(t.TEXTURE_2D,xe,Dt,me[0].width,me[0].height);for(let Me=0,Xe=me.length;Me0){const Me=DM(tt.width,tt.height,U.format,U.type);for(const Xe of U.layerUpdates){const St=tt.data.subarray(Xe*Me/tt.data.BYTES_PER_ELEMENT,(Xe+1)*Me/tt.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,Xe,tt.width,tt.height,1,Et,zt,St)}U.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,tt.width,tt.height,tt.depth,Et,zt,tt.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,Dt,tt.width,tt.height,tt.depth,0,Et,zt,tt.data);else if(U.isData3DTexture)De?(rt&&n.texStorage3D(t.TEXTURE_3D,xe,Dt,tt.width,tt.height,tt.depth),ge&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,tt.width,tt.height,tt.depth,Et,zt,tt.data)):n.texImage3D(t.TEXTURE_3D,0,Dt,tt.width,tt.height,tt.depth,0,Et,zt,tt.data);else if(U.isFramebufferTexture){if(rt)if(De)n.texStorage2D(t.TEXTURE_2D,xe,Dt,tt.width,tt.height);else{let Me=tt.width,Xe=tt.height;for(let St=0;St>=1,Xe>>=1}}else if(me.length>0){if(De&&rt){const Me=yt(me[0]);n.texStorage2D(t.TEXTURE_2D,xe,Dt,Me.width,Me.height)}for(let Me=0,Xe=me.length;Me0&&xe++;const Xe=yt(Et[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,xe,me,Xe.width,Xe.height)}for(let Xe=0;Xe<6;Xe++)if(tt){De?ge&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,0,0,0,Et[Xe].width,Et[Xe].height,Dt,bt,Et[Xe].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,0,me,Et[Xe].width,Et[Xe].height,0,Dt,bt,Et[Xe].data);for(let St=0;St>Pe),zt=Math.max(1,U.height>>Pe);Ge===t.TEXTURE_3D||Ge===t.TEXTURE_2D_ARRAY?n.texImage3D(Ge,Pe,ht,Et,zt,U.depth,0,ft,nt,null):n.texImage2D(Ge,Pe,ht,Et,zt,0,ft,nt,null)}n.bindFramebuffer(t.FRAMEBUFFER,q),Tt(U)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,Se,Ge,tt.__webglTexture,0,Je(U)):(Ge===t.TEXTURE_2D||Ge>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&Ge<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,Se,Ge,tt.__webglTexture,Pe),n.bindFramebuffer(t.FRAMEBUFFER,null)}function Ye(q,U,ue){if(t.bindRenderbuffer(t.RENDERBUFFER,q),U.depthBuffer){const Se=U.depthTexture,Ge=Se&&Se.isDepthTexture?Se.type:null,Pe=A(U.stencilBuffer,Ge),ft=U.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,nt=Je(U);Tt(U)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,nt,Pe,U.width,U.height):ue?t.renderbufferStorageMultisample(t.RENDERBUFFER,nt,Pe,U.width,U.height):t.renderbufferStorage(t.RENDERBUFFER,Pe,U.width,U.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,ft,t.RENDERBUFFER,q)}else{const Se=U.textures;for(let Ge=0;Ge{delete U.__boundDepthTexture,delete U.__depthDisposeCallback,Se.removeEventListener("dispose",Ge)};Se.addEventListener("dispose",Ge),U.__depthDisposeCallback=Ge}U.__boundDepthTexture=Se}if(q.depthTexture&&!U.__autoAllocateDepthBuffer){if(ue)throw new Error("target.depthTexture not supported in Cube render targets");gt(U.__webglFramebuffer,q)}else if(ue){U.__webglDepthbuffer=[];for(let Se=0;Se<6;Se++)if(n.bindFramebuffer(t.FRAMEBUFFER,U.__webglFramebuffer[Se]),U.__webglDepthbuffer[Se]===void 0)U.__webglDepthbuffer[Se]=t.createRenderbuffer(),Ye(U.__webglDepthbuffer[Se],q,!1);else{const Ge=q.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Pe=U.__webglDepthbuffer[Se];t.bindRenderbuffer(t.RENDERBUFFER,Pe),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ge,t.RENDERBUFFER,Pe)}}else if(n.bindFramebuffer(t.FRAMEBUFFER,U.__webglFramebuffer),U.__webglDepthbuffer===void 0)U.__webglDepthbuffer=t.createRenderbuffer(),Ye(U.__webglDepthbuffer,q,!1);else{const Se=q.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ge=U.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,Ge),t.framebufferRenderbuffer(t.FRAMEBUFFER,Se,t.RENDERBUFFER,Ge)}n.bindFramebuffer(t.FRAMEBUFFER,null)}function Ut(q,U,ue){const Se=r.get(q);U!==void 0&&Fe(Se.__webglFramebuffer,q,q.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),ue!==void 0&&Gt(q)}function Mt(q){const U=q.texture,ue=r.get(q),Se=r.get(U);q.addEventListener("dispose",R);const Ge=q.textures,Pe=q.isWebGLCubeRenderTarget===!0,ft=Ge.length>1;if(ft||(Se.__webglTexture===void 0&&(Se.__webglTexture=t.createTexture()),Se.__version=U.version,s.memory.textures++),Pe){ue.__webglFramebuffer=[];for(let nt=0;nt<6;nt++)if(U.mipmaps&&U.mipmaps.length>0){ue.__webglFramebuffer[nt]=[];for(let ht=0;ht0){ue.__webglFramebuffer=[];for(let nt=0;nt0&&Tt(q)===!1){ue.__webglMultisampledFramebuffer=t.createFramebuffer(),ue.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,ue.__webglMultisampledFramebuffer);for(let nt=0;nt0)for(let ht=0;ht0)for(let ht=0;ht0){if(Tt(q)===!1){const U=q.textures,ue=q.width,Se=q.height;let Ge=t.COLOR_BUFFER_BIT;const Pe=q.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ft=r.get(q),nt=U.length>1;if(nt)for(let ht=0;ht0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&U.__useRenderToTexture!==!1}function ot(q){const U=s.render.frame;c.get(q)!==U&&(c.set(q,U),q.update())}function Vt(q,U){const ue=q.colorSpace,Se=q.format,Ge=q.type;return q.isCompressedTexture===!0||q.isVideoTexture===!0||ue!==vl&&ue!==jl&&(Un.getTransfer(ue)===sr?(Se!==ri||Ge!==as)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ue)),U}function yt(q){return typeof HTMLImageElement<"u"&&q instanceof HTMLImageElement?(u.width=q.naturalWidth||q.width,u.height=q.naturalHeight||q.height):typeof VideoFrame<"u"&&q instanceof VideoFrame?(u.width=q.displayWidth,u.height=q.displayHeight):(u.width=q.width,u.height=q.height),u}this.allocateTextureUnit=W,this.resetTextureUnits=G,this.setTexture2D=se,this.setTexture2DArray=ae,this.setTexture3D=ee,this.setTextureCube=F,this.rebindTextures=Ut,this.setupRenderTarget=Mt,this.updateRenderTargetMipmap=$e,this.updateMultisampleRenderTarget=At,this.setupDepthRenderbuffer=Gt,this.setupFrameBufferTexture=Fe,this.useMultisampledRTT=Tt}function Cq(t,e){function n(r,i=jl){let a;const s=Un.getTransfer(i);if(r===as)return t.UNSIGNED_BYTE;if(r===jT)return t.UNSIGNED_SHORT_4_4_4_4;if(r===YT)return t.UNSIGNED_SHORT_5_5_5_1;if(r===GO)return t.UNSIGNED_INT_5_9_9_9_REV;if(r===$T)return t.BYTE;if(r===WT)return t.SHORT;if(r===Xh)return t.UNSIGNED_SHORT;if(r===Qb)return t.INT;if(r===yl)return t.UNSIGNED_INT;if(r===Or)return t.FLOAT;if(r===fi)return t.HALF_FLOAT;if(r===VO)return t.ALPHA;if(r===$O)return t.RGB;if(r===ri)return t.RGBA;if(r===WO)return t.LUMINANCE;if(r===jO)return t.LUMINANCE_ALPHA;if(r===Qd)return t.DEPTH_COMPONENT;if(r===bf)return t.DEPTH_STENCIL;if(r===Jb)return t.RED;if(r===ey)return t.RED_INTEGER;if(r===YO)return t.RG;if(r===qT)return t.RG_INTEGER;if(r===XT)return t.RGBA_INTEGER;if(r===x0||r===w0||r===C0||r===R0)if(s===sr)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===x0)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===w0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===C0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===R0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===x0)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===w0)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===C0)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===R0)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===K_||r===Z_||r===Q_||r===J_)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===K_)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===Z_)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===Q_)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===J_)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===eA||r===tA||r===nA)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===eA||r===tA)return s===sr?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===nA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===rA||r===iA||r===aA||r===sA||r===oA||r===lA||r===uA||r===cA||r===dA||r===fA||r===pA||r===hA||r===mA||r===gA)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===rA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===iA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===aA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===sA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===oA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===lA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===uA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===cA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===dA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===fA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===pA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===hA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===mA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===gA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===I0||r===bA||r===yA)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===I0)return s===sr?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===bA)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===yA)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===qO||r===vA||r===EA||r===SA)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===I0)return a.COMPRESSED_RED_RGTC1_EXT;if(r===vA)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===EA)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===SA)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===gf?t.UNSIGNED_INT_24_8:t[r]!==void 0?t[r]:null}return{convert:n}}class Rq extends qr{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class eu extends _n{constructor(){super(),this.isGroup=!0,this.type="Group"}}const eTe={type:"move"};class HC{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new eu,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 eu,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new H,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new H),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new eu,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new H,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new H),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const r of e.hand.values())this._getHandJoint(n,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,a=null,s=null;const o=this._targetRay,l=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){s=!0;for(const y of e.hand.values()){const v=n.getJointPose(y,r),b=this._getHandJoint(u,y);v!==null&&(b.matrix.fromArray(v.transform.matrix),b.matrix.decompose(b.position,b.rotation,b.scale),b.matrixWorldNeedsUpdate=!0,b.jointRadius=v.radius),b.visible=v!==null}const c=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],f=c.position.distanceTo(d.position),m=.02,g=.005;u.inputState.pinching&&f>m+g?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=m-g&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(a=n.getPose(e.gripSpace,r),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&a!==null&&(i=a),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(eTe)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=s!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new eu;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}const tTe=` +}`;function WAe(t,e,n){let r=new iy;const i=new Ke,a=new Ke,s=new Yn,o=new ay({depthPacking:sq}),l=new eT,u={},c=n.maxTextureSize,d={[gl]:ka,[ka]:gl,[fa]:fa},f=new qi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ke},radius:{value:4}},vertexShader:VAe,fragmentShader:$Ae}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const g=new fn;g.setAttribute("position",new Kn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new Ot(g,f),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Gx;let b=this.type;this.render=function(x,R,O){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||x.length===0)return;const N=t.getRenderTarget(),M=t.getActiveCubeFace(),B=t.getActiveMipmapLevel(),G=t.state;G.setBlending(dl),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const W=b!==go&&this.type===go,K=b===go&&this.type!==go;for(let se=0,ae=x.length;sec||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/ie.x),i.x=a.x*ie.x,F.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/ie.y),i.y=a.y*ie.y,F.mapSize.y=a.y)),F.map===null||W===!0||K===!0){const fe=this.type!==go?{minFilter:pi,magFilter:pi}:{};F.map!==null&&F.map.dispose(),F.map=new ki(i.x,i.y,fe),F.map.texture.name=ee.name+".shadowMap",F.camera.updateProjectionMatrix()}t.setRenderTarget(F.map),t.clear();const J=F.getViewportCount();for(let fe=0;fe0||R.map&&R.alphaTest>0){const G=M.uuid,W=R.uuid;let K=u[G];K===void 0&&(K={},u[G]=K);let se=K[W];se===void 0&&(se=M.clone(),K[W]=se,R.addEventListener("dispose",I)),M=se}if(M.visible=R.visible,M.wireframe=R.wireframe,N===go?M.side=R.shadowSide!==null?R.shadowSide:R.side:M.side=R.shadowSide!==null?R.shadowSide:d[R.side],M.alphaMap=R.alphaMap,M.alphaTest=R.alphaTest,M.map=R.map,M.clipShadows=R.clipShadows,M.clippingPlanes=R.clippingPlanes,M.clipIntersection=R.clipIntersection,M.displacementMap=R.displacementMap,M.displacementScale=R.displacementScale,M.displacementBias=R.displacementBias,M.wireframeLinewidth=R.wireframeLinewidth,M.linewidth=R.linewidth,O.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const G=t.properties.get(M);G.light=O}return M}function A(x,R,O,N,M){if(x.visible===!1)return;if(x.layers.test(R.layers)&&(x.isMesh||x.isLine||x.isPoints)&&(x.castShadow||x.receiveShadow&&M===go)&&(!x.frustumCulled||r.intersectsObject(x))){x.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,x.matrixWorld);const W=e.update(x),K=x.material;if(Array.isArray(K)){const se=W.groups;for(let ae=0,ee=se.length;ae=1):F.indexOf("OpenGL ES")!==-1&&(ee=parseFloat(/^OpenGL ES (\d)/.exec(F)[1]),ae=ee>=2);let ie=null,J={};const fe=t.getParameter(t.SCISSOR_BOX),Ce=t.getParameter(t.VIEWPORT),Le=new Yn().fromArray(fe),j=new Yn().fromArray(Ce);function ke(ge,Te,Me,Xe){const _t=new Uint8Array(4),St=t.createTexture();t.bindTexture(ge,St),t.texParameteri(ge,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(ge,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Xt=0;Xte?(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t}function XAe(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t}function KAe(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t}function DM(t,e,n,r){const i=ZAe(r);switch(n){case VO:return t*e;case WO:return t*e;case jO:return t*e*2;case Jb:return t*e/i.components*i.byteLength;case ey:return t*e/i.components*i.byteLength;case YO:return t*e*2/i.components*i.byteLength;case qx:return t*e*2/i.components*i.byteLength;case $O:return t*e*3/i.components*i.byteLength;case ri:return t*e*4/i.components*i.byteLength;case Xx:return t*e*4/i.components*i.byteLength;case T0:case w0:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case C0:case R0:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case ZS:case JS:return Math.max(t,16)*Math.max(e,8)/4;case KS:case QS:return Math.max(t,8)*Math.max(e,8)/2;case eA:case tA:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case nA:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case rA:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case iA:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case aA:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case sA:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case oA:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case lA:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case uA:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case cA:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case dA:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case fA:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case pA:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case hA:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case mA:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case gA:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case I0:case bA:case yA:return Math.ceil(t/4)*Math.ceil(e/4)*16;case qO:case vA:return Math.ceil(t/4)*Math.ceil(e/4)*8;case EA:case _A:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function ZAe(t){switch(t){case as:case $x:return{byteLength:1,components:1};case Xh:case Wx:case fi:return{byteLength:2,components:1};case jx:case Yx:return{byteLength:2,components:4};case yl:case Qb:case Or:return{byteLength:4,components:1};case GO:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}const QAe={contain:qAe,cover:XAe,fill:KAe,getByteLength:DM};function JAe(t,e,n,r,i,a,s){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new Ke,c=new WeakMap;let d;const f=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(q,U){return m?new OffscreenCanvas(q,U):xb("canvas")}function y(q,U,ue){let _e=1;const Ge=yt(q);if((Ge.width>ue||Ge.height>ue)&&(_e=ue/Math.max(Ge.width,Ge.height)),_e<1)if(typeof HTMLImageElement<"u"&&q instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&q instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&q instanceof ImageBitmap||typeof VideoFrame<"u"&&q instanceof VideoFrame){const Pe=Math.floor(_e*Ge.width),ft=Math.floor(_e*Ge.height);d===void 0&&(d=g(Pe,ft));const nt=U?g(Pe,ft):d;return nt.width=Pe,nt.height=ft,nt.getContext("2d").drawImage(q,0,0,Pe,ft),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ge.width+"x"+Ge.height+") to ("+Pe+"x"+ft+")."),nt}else return"data"in q&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ge.width+"x"+Ge.height+")."),q;return q}function v(q){return q.generateMipmaps}function b(q){t.generateMipmap(q)}function E(q){return q.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:q.isWebGL3DRenderTarget?t.TEXTURE_3D:q.isWebGLArrayRenderTarget||q.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function _(q,U,ue,_e,Ge=!1){if(q!==null){if(t[q]!==void 0)return t[q];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+q+"'")}let Pe=U;if(U===t.RED&&(ue===t.FLOAT&&(Pe=t.R32F),ue===t.HALF_FLOAT&&(Pe=t.R16F),ue===t.UNSIGNED_BYTE&&(Pe=t.R8)),U===t.RED_INTEGER&&(ue===t.UNSIGNED_BYTE&&(Pe=t.R8UI),ue===t.UNSIGNED_SHORT&&(Pe=t.R16UI),ue===t.UNSIGNED_INT&&(Pe=t.R32UI),ue===t.BYTE&&(Pe=t.R8I),ue===t.SHORT&&(Pe=t.R16I),ue===t.INT&&(Pe=t.R32I)),U===t.RG&&(ue===t.FLOAT&&(Pe=t.RG32F),ue===t.HALF_FLOAT&&(Pe=t.RG16F),ue===t.UNSIGNED_BYTE&&(Pe=t.RG8)),U===t.RG_INTEGER&&(ue===t.UNSIGNED_BYTE&&(Pe=t.RG8UI),ue===t.UNSIGNED_SHORT&&(Pe=t.RG16UI),ue===t.UNSIGNED_INT&&(Pe=t.RG32UI),ue===t.BYTE&&(Pe=t.RG8I),ue===t.SHORT&&(Pe=t.RG16I),ue===t.INT&&(Pe=t.RG32I)),U===t.RGB_INTEGER&&(ue===t.UNSIGNED_BYTE&&(Pe=t.RGB8UI),ue===t.UNSIGNED_SHORT&&(Pe=t.RGB16UI),ue===t.UNSIGNED_INT&&(Pe=t.RGB32UI),ue===t.BYTE&&(Pe=t.RGB8I),ue===t.SHORT&&(Pe=t.RGB16I),ue===t.INT&&(Pe=t.RGB32I)),U===t.RGBA_INTEGER&&(ue===t.UNSIGNED_BYTE&&(Pe=t.RGBA8UI),ue===t.UNSIGNED_SHORT&&(Pe=t.RGBA16UI),ue===t.UNSIGNED_INT&&(Pe=t.RGBA32UI),ue===t.BYTE&&(Pe=t.RGBA8I),ue===t.SHORT&&(Pe=t.RGBA16I),ue===t.INT&&(Pe=t.RGBA32I)),U===t.RGB&&ue===t.UNSIGNED_INT_5_9_9_9_REV&&(Pe=t.RGB9_E5),U===t.RGBA){const ft=Ge?ty:Un.getTransfer(_e);ue===t.FLOAT&&(Pe=t.RGBA32F),ue===t.HALF_FLOAT&&(Pe=t.RGBA16F),ue===t.UNSIGNED_BYTE&&(Pe=ft===sr?t.SRGB8_ALPHA8:t.RGBA8),ue===t.UNSIGNED_SHORT_4_4_4_4&&(Pe=t.RGBA4),ue===t.UNSIGNED_SHORT_5_5_5_1&&(Pe=t.RGB5_A1)}return(Pe===t.R16F||Pe===t.R32F||Pe===t.RG16F||Pe===t.RG32F||Pe===t.RGBA16F||Pe===t.RGBA32F)&&e.get("EXT_color_buffer_float"),Pe}function A(q,U){let ue;return q?U===null||U===yl||U===gf?ue=t.DEPTH24_STENCIL8:U===Or?ue=t.DEPTH32F_STENCIL8:U===Xh&&(ue=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):U===null||U===yl||U===gf?ue=t.DEPTH_COMPONENT24:U===Or?ue=t.DEPTH_COMPONENT32F:U===Xh&&(ue=t.DEPTH_COMPONENT16),ue}function I(q,U){return v(q)===!0||q.isFramebufferTexture&&q.minFilter!==pi&&q.minFilter!==Xn?Math.log2(Math.max(U.width,U.height))+1:q.mipmaps!==void 0&&q.mipmaps.length>0?q.mipmaps.length:q.isCompressedTexture&&Array.isArray(q.image)?U.mipmaps.length:1}function x(q){const U=q.target;U.removeEventListener("dispose",x),O(U),U.isVideoTexture&&c.delete(U)}function R(q){const U=q.target;U.removeEventListener("dispose",R),M(U)}function O(q){const U=r.get(q);if(U.__webglInit===void 0)return;const ue=q.source,_e=f.get(ue);if(_e){const Ge=_e[U.__cacheKey];Ge.usedTimes--,Ge.usedTimes===0&&N(q),Object.keys(_e).length===0&&f.delete(ue)}r.remove(q)}function N(q){const U=r.get(q);t.deleteTexture(U.__webglTexture);const ue=q.source,_e=f.get(ue);delete _e[U.__cacheKey],s.memory.textures--}function M(q){const U=r.get(q);if(q.depthTexture&&(q.depthTexture.dispose(),r.remove(q.depthTexture)),q.isWebGLCubeRenderTarget)for(let _e=0;_e<6;_e++){if(Array.isArray(U.__webglFramebuffer[_e]))for(let Ge=0;Ge=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+q+" texture units while this GPU supports only "+i.maxTextures),B+=1,q}function K(q){const U=[];return U.push(q.wrapS),U.push(q.wrapT),U.push(q.wrapR||0),U.push(q.magFilter),U.push(q.minFilter),U.push(q.anisotropy),U.push(q.internalFormat),U.push(q.format),U.push(q.type),U.push(q.generateMipmaps),U.push(q.premultiplyAlpha),U.push(q.flipY),U.push(q.unpackAlignment),U.push(q.colorSpace),U.join()}function se(q,U){const ue=r.get(q);if(q.isVideoTexture&&ot(q),q.isRenderTargetTexture===!1&&q.version>0&&ue.__version!==q.version){const _e=q.image;if(_e===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(_e.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{j(ue,q,U);return}}n.bindTexture(t.TEXTURE_2D,ue.__webglTexture,t.TEXTURE0+U)}function ae(q,U){const ue=r.get(q);if(q.version>0&&ue.__version!==q.version){j(ue,q,U);return}n.bindTexture(t.TEXTURE_2D_ARRAY,ue.__webglTexture,t.TEXTURE0+U)}function ee(q,U){const ue=r.get(q);if(q.version>0&&ue.__version!==q.version){j(ue,q,U);return}n.bindTexture(t.TEXTURE_3D,ue.__webglTexture,t.TEXTURE0+U)}function F(q,U){const ue=r.get(q);if(q.version>0&&ue.__version!==q.version){ke(ue,q,U);return}n.bindTexture(t.TEXTURE_CUBE_MAP,ue.__webglTexture,t.TEXTURE0+U)}const ie={[wc]:t.REPEAT,[ni]:t.CLAMP_TO_EDGE,[qh]:t.MIRRORED_REPEAT},J={[pi]:t.NEAREST,[Vx]:t.NEAREST_MIPMAP_NEAREST,[Pd]:t.NEAREST_MIPMAP_LINEAR,[Xn]:t.LINEAR,[Th]:t.LINEAR_MIPMAP_NEAREST,[Js]:t.LINEAR_MIPMAP_LINEAR},fe={[lq]:t.NEVER,[hq]:t.ALWAYS,[uq]:t.LESS,[ZO]:t.LEQUAL,[cq]:t.EQUAL,[pq]:t.GEQUAL,[dq]:t.GREATER,[fq]:t.NOTEQUAL};function Ce(q,U){if(U.type===Or&&e.has("OES_texture_float_linear")===!1&&(U.magFilter===Xn||U.magFilter===Th||U.magFilter===Pd||U.magFilter===Js||U.minFilter===Xn||U.minFilter===Th||U.minFilter===Pd||U.minFilter===Js)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(q,t.TEXTURE_WRAP_S,ie[U.wrapS]),t.texParameteri(q,t.TEXTURE_WRAP_T,ie[U.wrapT]),(q===t.TEXTURE_3D||q===t.TEXTURE_2D_ARRAY)&&t.texParameteri(q,t.TEXTURE_WRAP_R,ie[U.wrapR]),t.texParameteri(q,t.TEXTURE_MAG_FILTER,J[U.magFilter]),t.texParameteri(q,t.TEXTURE_MIN_FILTER,J[U.minFilter]),U.compareFunction&&(t.texParameteri(q,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(q,t.TEXTURE_COMPARE_FUNC,fe[U.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(U.magFilter===pi||U.minFilter!==Pd&&U.minFilter!==Js||U.type===Or&&e.has("OES_texture_float_linear")===!1)return;if(U.anisotropy>1||r.get(U).__currentAnisotropy){const ue=e.get("EXT_texture_filter_anisotropic");t.texParameterf(q,ue.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,i.getMaxAnisotropy())),r.get(U).__currentAnisotropy=U.anisotropy}}}function Le(q,U){let ue=!1;q.__webglInit===void 0&&(q.__webglInit=!0,U.addEventListener("dispose",x));const _e=U.source;let Ge=f.get(_e);Ge===void 0&&(Ge={},f.set(_e,Ge));const Pe=K(U);if(Pe!==q.__cacheKey){Ge[Pe]===void 0&&(Ge[Pe]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,ue=!0),Ge[Pe].usedTimes++;const ft=Ge[q.__cacheKey];ft!==void 0&&(Ge[q.__cacheKey].usedTimes--,ft.usedTimes===0&&N(U)),q.__cacheKey=Pe,q.__webglTexture=Ge[Pe].texture}return ue}function j(q,U,ue){let _e=t.TEXTURE_2D;(U.isDataArrayTexture||U.isCompressedArrayTexture)&&(_e=t.TEXTURE_2D_ARRAY),U.isData3DTexture&&(_e=t.TEXTURE_3D);const Ge=Le(q,U),Pe=U.source;n.bindTexture(_e,q.__webglTexture,t.TEXTURE0+ue);const ft=r.get(Pe);if(Pe.version!==ft.__version||Ge===!0){n.activeTexture(t.TEXTURE0+ue);const nt=Un.getPrimaries(Un.workingColorSpace),ht=U.colorSpace===jl?null:Un.getPrimaries(U.colorSpace),tn=U.colorSpace===jl||nt===ht?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,U.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,U.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,tn);let tt=y(U.image,!1,i.maxTextureSize);tt=Vt(U,tt);const Et=a.convert(U.format,U.colorSpace),zt=a.convert(U.type);let Dt=_(U.internalFormat,Et,zt,U.colorSpace,U.isVideoTexture);Ce(_e,U);let bt;const me=U.mipmaps,De=U.isVideoTexture!==!0,rt=ft.__version===void 0||Ge===!0,ge=Pe.dataReady,Te=I(U,tt);if(U.isDepthTexture)Dt=A(U.format===bf,U.type),rt&&(De?n.texStorage2D(t.TEXTURE_2D,1,Dt,tt.width,tt.height):n.texImage2D(t.TEXTURE_2D,0,Dt,tt.width,tt.height,0,Et,zt,null));else if(U.isDataTexture)if(me.length>0){De&&rt&&n.texStorage2D(t.TEXTURE_2D,Te,Dt,me[0].width,me[0].height);for(let Me=0,Xe=me.length;Me0){const _t=DM(bt.width,bt.height,U.format,U.type);for(const St of U.layerUpdates){const Xt=bt.data.subarray(St*_t/bt.data.BYTES_PER_ELEMENT,(St+1)*_t/bt.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Me,0,0,St,bt.width,bt.height,1,Et,Xt)}U.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Me,0,0,0,bt.width,bt.height,tt.depth,Et,bt.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,Me,Dt,bt.width,bt.height,tt.depth,0,bt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else De?ge&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,Me,0,0,0,bt.width,bt.height,tt.depth,Et,zt,bt.data):n.texImage3D(t.TEXTURE_2D_ARRAY,Me,Dt,bt.width,bt.height,tt.depth,0,Et,zt,bt.data)}else{De&&rt&&n.texStorage2D(t.TEXTURE_2D,Te,Dt,me[0].width,me[0].height);for(let Me=0,Xe=me.length;Me0){const Me=DM(tt.width,tt.height,U.format,U.type);for(const Xe of U.layerUpdates){const _t=tt.data.subarray(Xe*Me/tt.data.BYTES_PER_ELEMENT,(Xe+1)*Me/tt.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,Xe,tt.width,tt.height,1,Et,zt,_t)}U.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,tt.width,tt.height,tt.depth,Et,zt,tt.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,Dt,tt.width,tt.height,tt.depth,0,Et,zt,tt.data);else if(U.isData3DTexture)De?(rt&&n.texStorage3D(t.TEXTURE_3D,Te,Dt,tt.width,tt.height,tt.depth),ge&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,tt.width,tt.height,tt.depth,Et,zt,tt.data)):n.texImage3D(t.TEXTURE_3D,0,Dt,tt.width,tt.height,tt.depth,0,Et,zt,tt.data);else if(U.isFramebufferTexture){if(rt)if(De)n.texStorage2D(t.TEXTURE_2D,Te,Dt,tt.width,tt.height);else{let Me=tt.width,Xe=tt.height;for(let _t=0;_t>=1,Xe>>=1}}else if(me.length>0){if(De&&rt){const Me=yt(me[0]);n.texStorage2D(t.TEXTURE_2D,Te,Dt,Me.width,Me.height)}for(let Me=0,Xe=me.length;Me0&&Te++;const Xe=yt(Et[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,Te,me,Xe.width,Xe.height)}for(let Xe=0;Xe<6;Xe++)if(tt){De?ge&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,0,0,0,Et[Xe].width,Et[Xe].height,Dt,bt,Et[Xe].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,0,me,Et[Xe].width,Et[Xe].height,0,Dt,bt,Et[Xe].data);for(let _t=0;_t>Pe),zt=Math.max(1,U.height>>Pe);Ge===t.TEXTURE_3D||Ge===t.TEXTURE_2D_ARRAY?n.texImage3D(Ge,Pe,ht,Et,zt,U.depth,0,ft,nt,null):n.texImage2D(Ge,Pe,ht,Et,zt,0,ft,nt,null)}n.bindFramebuffer(t.FRAMEBUFFER,q),xt(U)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,_e,Ge,tt.__webglTexture,0,Je(U)):(Ge===t.TEXTURE_2D||Ge>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&Ge<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,_e,Ge,tt.__webglTexture,Pe),n.bindFramebuffer(t.FRAMEBUFFER,null)}function Ye(q,U,ue){if(t.bindRenderbuffer(t.RENDERBUFFER,q),U.depthBuffer){const _e=U.depthTexture,Ge=_e&&_e.isDepthTexture?_e.type:null,Pe=A(U.stencilBuffer,Ge),ft=U.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,nt=Je(U);xt(U)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,nt,Pe,U.width,U.height):ue?t.renderbufferStorageMultisample(t.RENDERBUFFER,nt,Pe,U.width,U.height):t.renderbufferStorage(t.RENDERBUFFER,Pe,U.width,U.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,ft,t.RENDERBUFFER,q)}else{const _e=U.textures;for(let Ge=0;Ge<_e.length;Ge++){const Pe=_e[Ge],ft=a.convert(Pe.format,Pe.colorSpace),nt=a.convert(Pe.type),ht=_(Pe.internalFormat,ft,nt,Pe.colorSpace),tn=Je(U);ue&&xt(U)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,tn,ht,U.width,U.height):xt(U)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,tn,ht,U.width,U.height):t.renderbufferStorage(t.RENDERBUFFER,ht,U.width,U.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function gt(q,U){if(U&&U.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,q),!(U.depthTexture&&U.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const _e=r.get(U.depthTexture);_e.__renderTarget=U,(!_e.__webglTexture||U.depthTexture.image.width!==U.width||U.depthTexture.image.height!==U.height)&&(U.depthTexture.image.width=U.width,U.depthTexture.image.height=U.height,U.depthTexture.needsUpdate=!0),se(U.depthTexture,0);const Ge=_e.__webglTexture,Pe=Je(U);if(U.depthTexture.format===Qd)xt(U)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,Ge,0,Pe):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,Ge,0);else if(U.depthTexture.format===bf)xt(U)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,Ge,0,Pe):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,Ge,0);else throw new Error("Unknown depthTexture format")}function Gt(q){const U=r.get(q),ue=q.isWebGLCubeRenderTarget===!0;if(U.__boundDepthTexture!==q.depthTexture){const _e=q.depthTexture;if(U.__depthDisposeCallback&&U.__depthDisposeCallback(),_e){const Ge=()=>{delete U.__boundDepthTexture,delete U.__depthDisposeCallback,_e.removeEventListener("dispose",Ge)};_e.addEventListener("dispose",Ge),U.__depthDisposeCallback=Ge}U.__boundDepthTexture=_e}if(q.depthTexture&&!U.__autoAllocateDepthBuffer){if(ue)throw new Error("target.depthTexture not supported in Cube render targets");gt(U.__webglFramebuffer,q)}else if(ue){U.__webglDepthbuffer=[];for(let _e=0;_e<6;_e++)if(n.bindFramebuffer(t.FRAMEBUFFER,U.__webglFramebuffer[_e]),U.__webglDepthbuffer[_e]===void 0)U.__webglDepthbuffer[_e]=t.createRenderbuffer(),Ye(U.__webglDepthbuffer[_e],q,!1);else{const Ge=q.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Pe=U.__webglDepthbuffer[_e];t.bindRenderbuffer(t.RENDERBUFFER,Pe),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ge,t.RENDERBUFFER,Pe)}}else if(n.bindFramebuffer(t.FRAMEBUFFER,U.__webglFramebuffer),U.__webglDepthbuffer===void 0)U.__webglDepthbuffer=t.createRenderbuffer(),Ye(U.__webglDepthbuffer,q,!1);else{const _e=q.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ge=U.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,Ge),t.framebufferRenderbuffer(t.FRAMEBUFFER,_e,t.RENDERBUFFER,Ge)}n.bindFramebuffer(t.FRAMEBUFFER,null)}function Ut(q,U,ue){const _e=r.get(q);U!==void 0&&Fe(_e.__webglFramebuffer,q,q.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),ue!==void 0&&Gt(q)}function Mt(q){const U=q.texture,ue=r.get(q),_e=r.get(U);q.addEventListener("dispose",R);const Ge=q.textures,Pe=q.isWebGLCubeRenderTarget===!0,ft=Ge.length>1;if(ft||(_e.__webglTexture===void 0&&(_e.__webglTexture=t.createTexture()),_e.__version=U.version,s.memory.textures++),Pe){ue.__webglFramebuffer=[];for(let nt=0;nt<6;nt++)if(U.mipmaps&&U.mipmaps.length>0){ue.__webglFramebuffer[nt]=[];for(let ht=0;ht0){ue.__webglFramebuffer=[];for(let nt=0;nt0&&xt(q)===!1){ue.__webglMultisampledFramebuffer=t.createFramebuffer(),ue.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,ue.__webglMultisampledFramebuffer);for(let nt=0;nt0)for(let ht=0;ht0)for(let ht=0;ht0){if(xt(q)===!1){const U=q.textures,ue=q.width,_e=q.height;let Ge=t.COLOR_BUFFER_BIT;const Pe=q.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ft=r.get(q),nt=U.length>1;if(nt)for(let ht=0;ht0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&U.__useRenderToTexture!==!1}function ot(q){const U=s.render.frame;c.get(q)!==U&&(c.set(q,U),q.update())}function Vt(q,U){const ue=q.colorSpace,_e=q.format,Ge=q.type;return q.isCompressedTexture===!0||q.isVideoTexture===!0||ue!==vl&&ue!==jl&&(Un.getTransfer(ue)===sr?(_e!==ri||Ge!==as)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ue)),U}function yt(q){return typeof HTMLImageElement<"u"&&q instanceof HTMLImageElement?(u.width=q.naturalWidth||q.width,u.height=q.naturalHeight||q.height):typeof VideoFrame<"u"&&q instanceof VideoFrame?(u.width=q.displayWidth,u.height=q.displayHeight):(u.width=q.width,u.height=q.height),u}this.allocateTextureUnit=W,this.resetTextureUnits=G,this.setTexture2D=se,this.setTexture2DArray=ae,this.setTexture3D=ee,this.setTextureCube=F,this.rebindTextures=Ut,this.setupRenderTarget=Mt,this.updateRenderTargetMipmap=$e,this.updateMultisampleRenderTarget=At,this.setupDepthRenderbuffer=Gt,this.setupFrameBufferTexture=Fe,this.useMultisampledRTT=xt}function Cq(t,e){function n(r,i=jl){let a;const s=Un.getTransfer(i);if(r===as)return t.UNSIGNED_BYTE;if(r===jx)return t.UNSIGNED_SHORT_4_4_4_4;if(r===Yx)return t.UNSIGNED_SHORT_5_5_5_1;if(r===GO)return t.UNSIGNED_INT_5_9_9_9_REV;if(r===$x)return t.BYTE;if(r===Wx)return t.SHORT;if(r===Xh)return t.UNSIGNED_SHORT;if(r===Qb)return t.INT;if(r===yl)return t.UNSIGNED_INT;if(r===Or)return t.FLOAT;if(r===fi)return t.HALF_FLOAT;if(r===VO)return t.ALPHA;if(r===$O)return t.RGB;if(r===ri)return t.RGBA;if(r===WO)return t.LUMINANCE;if(r===jO)return t.LUMINANCE_ALPHA;if(r===Qd)return t.DEPTH_COMPONENT;if(r===bf)return t.DEPTH_STENCIL;if(r===Jb)return t.RED;if(r===ey)return t.RED_INTEGER;if(r===YO)return t.RG;if(r===qx)return t.RG_INTEGER;if(r===Xx)return t.RGBA_INTEGER;if(r===T0||r===w0||r===C0||r===R0)if(s===sr)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===T0)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===w0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===C0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===R0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===T0)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===w0)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===C0)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===R0)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===KS||r===ZS||r===QS||r===JS)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===KS)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===ZS)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===QS)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===JS)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===eA||r===tA||r===nA)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===eA||r===tA)return s===sr?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===nA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===rA||r===iA||r===aA||r===sA||r===oA||r===lA||r===uA||r===cA||r===dA||r===fA||r===pA||r===hA||r===mA||r===gA)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===rA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===iA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===aA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===sA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===oA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===lA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===uA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===cA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===dA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===fA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===pA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===hA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===mA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===gA)return s===sr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===I0||r===bA||r===yA)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===I0)return s===sr?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===bA)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===yA)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===qO||r===vA||r===EA||r===_A)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===I0)return a.COMPRESSED_RED_RGTC1_EXT;if(r===vA)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===EA)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===_A)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===gf?t.UNSIGNED_INT_24_8:t[r]!==void 0?t[r]:null}return{convert:n}}class Rq extends qr{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class eu extends Sn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const exe={type:"move"};class HC{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new eu,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 eu,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new H,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new H),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new eu,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new H,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new H),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const r of e.hand.values())this._getHandJoint(n,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,a=null,s=null;const o=this._targetRay,l=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){s=!0;for(const y of e.hand.values()){const v=n.getJointPose(y,r),b=this._getHandJoint(u,y);v!==null&&(b.matrix.fromArray(v.transform.matrix),b.matrix.decompose(b.position,b.rotation,b.scale),b.matrixWorldNeedsUpdate=!0,b.jointRadius=v.radius),b.visible=v!==null}const c=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],f=c.position.distanceTo(d.position),m=.02,g=.005;u.inputState.pinching&&f>m+g?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=m-g&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(a=n.getPose(e.gripSpace,r),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&a!==null&&(i=a),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(exe)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=s!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new eu;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}const txe=` void main() { gl_Position = vec4( position, 1.0 ); -}`,nTe=` +}`,nxe=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -4200,7 +4200,7 @@ void main() { } -}`;class rTe{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n,r){if(this.texture===null){const i=new $n,a=e.properties.get(i);a.__webglTexture=n.texture,(n.depthNear!=r.depthNear||n.depthFar!=r.depthFar)&&(this.depthNear=n.depthNear,this.depthFar=n.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,r=new qi({vertexShader:tTe,fragmentShader:nTe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Ot(new Vi(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class iTe extends No{constructor(e,n){super();const r=this;let i=null,a=1,s=null,o="local-floor",l=1,u=null,c=null,d=null,f=null,m=null,g=null;const y=new rTe,v=n.getContextAttributes();let b=null,E=null;const S=[],A=[],I=new Ke;let T=null;const R=new qr;R.viewport=new Yn;const O=new qr;O.viewport=new Yn;const N=[R,O],M=new Rq;let B=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(j){let ke=S[j];return ke===void 0&&(ke=new HC,S[j]=ke),ke.getTargetRaySpace()},this.getControllerGrip=function(j){let ke=S[j];return ke===void 0&&(ke=new HC,S[j]=ke),ke.getGripSpace()},this.getHand=function(j){let ke=S[j];return ke===void 0&&(ke=new HC,S[j]=ke),ke.getHandSpace()};function W(j){const ke=A.indexOf(j.inputSource);if(ke===-1)return;const Fe=S[ke];Fe!==void 0&&(Fe.update(j.inputSource,j.frame,u||s),Fe.dispatchEvent({type:j.type,data:j.inputSource}))}function K(){i.removeEventListener("select",W),i.removeEventListener("selectstart",W),i.removeEventListener("selectend",W),i.removeEventListener("squeeze",W),i.removeEventListener("squeezestart",W),i.removeEventListener("squeezeend",W),i.removeEventListener("end",K),i.removeEventListener("inputsourceschange",se);for(let j=0;j=0&&(A[Ye]=null,S[Ye].disconnect(Fe))}for(let ke=0;ke=A.length){A.push(Fe),Ye=Gt;break}else if(A[Gt]===null){A[Gt]=Fe,Ye=Gt;break}if(Ye===-1)break}const gt=S[Ye];gt&>.connect(Fe)}}const ae=new H,ee=new H;function F(j,ke,Fe){ae.setFromMatrixPosition(ke.matrixWorld),ee.setFromMatrixPosition(Fe.matrixWorld);const Ye=ae.distanceTo(ee),gt=ke.projectionMatrix.elements,Gt=Fe.projectionMatrix.elements,Ut=gt[14]/(gt[10]-1),Mt=gt[14]/(gt[10]+1),$e=(gt[9]+1)/gt[5],qe=(gt[9]-1)/gt[5],re=(gt[8]-1)/gt[0],At=(Gt[8]+1)/Gt[0],Je=Ut*re,Tt=Ut*At,ot=Ye/(-re+At),Vt=ot*-re;if(ke.matrixWorld.decompose(j.position,j.quaternion,j.scale),j.translateX(Vt),j.translateZ(ot),j.matrixWorld.compose(j.position,j.quaternion,j.scale),j.matrixWorldInverse.copy(j.matrixWorld).invert(),gt[10]===-1)j.projectionMatrix.copy(ke.projectionMatrix),j.projectionMatrixInverse.copy(ke.projectionMatrixInverse);else{const yt=Ut+ot,q=Mt+ot,U=Je-Vt,ue=Tt+(Ye-Vt),Se=$e*Mt/q*yt,Ge=qe*Mt/q*yt;j.projectionMatrix.makePerspective(U,ue,Se,Ge,yt,q),j.projectionMatrixInverse.copy(j.projectionMatrix).invert()}}function ie(j,ke){ke===null?j.matrixWorld.copy(j.matrix):j.matrixWorld.multiplyMatrices(ke.matrixWorld,j.matrix),j.matrixWorldInverse.copy(j.matrixWorld).invert()}this.updateCamera=function(j){if(i===null)return;let ke=j.near,Fe=j.far;y.texture!==null&&(y.depthNear>0&&(ke=y.depthNear),y.depthFar>0&&(Fe=y.depthFar)),M.near=O.near=R.near=ke,M.far=O.far=R.far=Fe,(B!==M.near||G!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),B=M.near,G=M.far),R.layers.mask=j.layers.mask|2,O.layers.mask=j.layers.mask|4,M.layers.mask=R.layers.mask|O.layers.mask;const Ye=j.parent,gt=M.cameras;ie(M,Ye);for(let Gt=0;Gt0&&(v.alphaTest.value=b.alphaTest);const E=e.get(b),S=E.envMap,A=E.envMapRotation;S&&(v.envMap.value=S,ud.copy(A),ud.x*=-1,ud.y*=-1,ud.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(ud.y*=-1,ud.z*=-1),v.envMapRotation.value.setFromMatrix4(aTe.makeRotationFromEuler(ud)),v.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,v.reflectivity.value=b.reflectivity,v.ior.value=b.ior,v.refractionRatio.value=b.refractionRatio),b.lightMap&&(v.lightMap.value=b.lightMap,v.lightMapIntensity.value=b.lightMapIntensity,n(b.lightMap,v.lightMapTransform)),b.aoMap&&(v.aoMap.value=b.aoMap,v.aoMapIntensity.value=b.aoMapIntensity,n(b.aoMap,v.aoMapTransform))}function s(v,b){v.diffuse.value.copy(b.color),v.opacity.value=b.opacity,b.map&&(v.map.value=b.map,n(b.map,v.mapTransform))}function o(v,b){v.dashSize.value=b.dashSize,v.totalSize.value=b.dashSize+b.gapSize,v.scale.value=b.scale}function l(v,b,E,S){v.diffuse.value.copy(b.color),v.opacity.value=b.opacity,v.size.value=b.size*E,v.scale.value=S*.5,b.map&&(v.map.value=b.map,n(b.map,v.uvTransform)),b.alphaMap&&(v.alphaMap.value=b.alphaMap,n(b.alphaMap,v.alphaMapTransform)),b.alphaTest>0&&(v.alphaTest.value=b.alphaTest)}function u(v,b){v.diffuse.value.copy(b.color),v.opacity.value=b.opacity,v.rotation.value=b.rotation,b.map&&(v.map.value=b.map,n(b.map,v.mapTransform)),b.alphaMap&&(v.alphaMap.value=b.alphaMap,n(b.alphaMap,v.alphaMapTransform)),b.alphaTest>0&&(v.alphaTest.value=b.alphaTest)}function c(v,b){v.specular.value.copy(b.specular),v.shininess.value=Math.max(b.shininess,1e-4)}function d(v,b){b.gradientMap&&(v.gradientMap.value=b.gradientMap)}function f(v,b){v.metalness.value=b.metalness,b.metalnessMap&&(v.metalnessMap.value=b.metalnessMap,n(b.metalnessMap,v.metalnessMapTransform)),v.roughness.value=b.roughness,b.roughnessMap&&(v.roughnessMap.value=b.roughnessMap,n(b.roughnessMap,v.roughnessMapTransform)),b.envMap&&(v.envMapIntensity.value=b.envMapIntensity)}function m(v,b,E){v.ior.value=b.ior,b.sheen>0&&(v.sheenColor.value.copy(b.sheenColor).multiplyScalar(b.sheen),v.sheenRoughness.value=b.sheenRoughness,b.sheenColorMap&&(v.sheenColorMap.value=b.sheenColorMap,n(b.sheenColorMap,v.sheenColorMapTransform)),b.sheenRoughnessMap&&(v.sheenRoughnessMap.value=b.sheenRoughnessMap,n(b.sheenRoughnessMap,v.sheenRoughnessMapTransform))),b.clearcoat>0&&(v.clearcoat.value=b.clearcoat,v.clearcoatRoughness.value=b.clearcoatRoughness,b.clearcoatMap&&(v.clearcoatMap.value=b.clearcoatMap,n(b.clearcoatMap,v.clearcoatMapTransform)),b.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=b.clearcoatRoughnessMap,n(b.clearcoatRoughnessMap,v.clearcoatRoughnessMapTransform)),b.clearcoatNormalMap&&(v.clearcoatNormalMap.value=b.clearcoatNormalMap,n(b.clearcoatNormalMap,v.clearcoatNormalMapTransform),v.clearcoatNormalScale.value.copy(b.clearcoatNormalScale),b.side===ka&&v.clearcoatNormalScale.value.negate())),b.dispersion>0&&(v.dispersion.value=b.dispersion),b.iridescence>0&&(v.iridescence.value=b.iridescence,v.iridescenceIOR.value=b.iridescenceIOR,v.iridescenceThicknessMinimum.value=b.iridescenceThicknessRange[0],v.iridescenceThicknessMaximum.value=b.iridescenceThicknessRange[1],b.iridescenceMap&&(v.iridescenceMap.value=b.iridescenceMap,n(b.iridescenceMap,v.iridescenceMapTransform)),b.iridescenceThicknessMap&&(v.iridescenceThicknessMap.value=b.iridescenceThicknessMap,n(b.iridescenceThicknessMap,v.iridescenceThicknessMapTransform))),b.transmission>0&&(v.transmission.value=b.transmission,v.transmissionSamplerMap.value=E.texture,v.transmissionSamplerSize.value.set(E.width,E.height),b.transmissionMap&&(v.transmissionMap.value=b.transmissionMap,n(b.transmissionMap,v.transmissionMapTransform)),v.thickness.value=b.thickness,b.thicknessMap&&(v.thicknessMap.value=b.thicknessMap,n(b.thicknessMap,v.thicknessMapTransform)),v.attenuationDistance.value=b.attenuationDistance,v.attenuationColor.value.copy(b.attenuationColor)),b.anisotropy>0&&(v.anisotropyVector.value.set(b.anisotropy*Math.cos(b.anisotropyRotation),b.anisotropy*Math.sin(b.anisotropyRotation)),b.anisotropyMap&&(v.anisotropyMap.value=b.anisotropyMap,n(b.anisotropyMap,v.anisotropyMapTransform))),v.specularIntensity.value=b.specularIntensity,v.specularColor.value.copy(b.specularColor),b.specularColorMap&&(v.specularColorMap.value=b.specularColorMap,n(b.specularColorMap,v.specularColorMapTransform)),b.specularIntensityMap&&(v.specularIntensityMap.value=b.specularIntensityMap,n(b.specularIntensityMap,v.specularIntensityMapTransform))}function g(v,b){b.matcap&&(v.matcap.value=b.matcap)}function y(v,b){const E=e.get(b).light;v.referencePosition.value.setFromMatrixPosition(E.matrixWorld),v.nearDistance.value=E.shadow.camera.near,v.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function oTe(t,e,n,r){let i={},a={},s=[];const o=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(E,S){const A=S.program;r.uniformBlockBinding(E,A)}function u(E,S){let A=i[E.id];A===void 0&&(g(E),A=c(E),i[E.id]=A,E.addEventListener("dispose",v));const I=S.program;r.updateUBOMapping(E,I);const T=e.render.frame;a[E.id]!==T&&(f(E),a[E.id]=T)}function c(E){const S=d();E.__bindingPointIndex=S;const A=t.createBuffer(),I=E.__size,T=E.usage;return t.bindBuffer(t.UNIFORM_BUFFER,A),t.bufferData(t.UNIFORM_BUFFER,I,T),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,S,A),A}function d(){for(let E=0;E0&&(A+=I-T),E.__size=A,E.__cache={},this}function y(E){const S={boundary:0,storage:0};return typeof E=="number"||typeof E=="boolean"?(S.boundary=4,S.storage=4):E.isVector2?(S.boundary=8,S.storage=8):E.isVector3||E.isColor?(S.boundary=16,S.storage=12):E.isVector4?(S.boundary=16,S.storage=16):E.isMatrix3?(S.boundary=48,S.storage=48):E.isMatrix4?(S.boundary=64,S.storage=64):E.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",E),S}function v(E){const S=E.target;S.removeEventListener("dispose",v);const A=s.indexOf(S.__bindingPointIndex);s.splice(A,1),t.deleteBuffer(i[S.id]),delete i[S.id],delete a[S.id]}function b(){for(const E in i)t.deleteBuffer(i[E]);s=[],i={},a={}}return{bind:l,update:u,dispose:b}}class aD{constructor(e={}){const{canvas:n=gq(),context:r=null,depth:i=!0,stencil:a=!1,alpha:s=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:f=!1}=e;this.isWebGLRenderer=!0;let m;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");m=r.getContextAttributes().alpha}else m=s;const g=new Uint32Array(4),y=new Int32Array(4);let v=null,b=null;const E=[],S=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Ia,this.toneMapping=fl,this.toneMappingExposure=1;const A=this;let I=!1,T=0,R=0,O=null,N=-1,M=null;const B=new Yn,G=new Yn;let W=null;const K=new vt(0);let se=0,ae=n.width,ee=n.height,F=1,ie=null,J=null;const fe=new Yn(0,0,ae,ee),Ce=new Yn(0,0,ae,ee);let Le=!1;const j=new iy;let ke=!1,Fe=!1;const Ye=new en,gt=new en,Gt=new H,Ut=new Yn,Mt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let $e=!1;function qe(){return O===null?F:1}let re=r;function At(L,X){return n.getContext(L,X)}try{const L={alpha:!0,depth:i,stencil:a,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Of}`),n.addEventListener("webglcontextlost",Xe,!1),n.addEventListener("webglcontextrestored",St,!1),n.addEventListener("webglcontextcreationerror",_t,!1),re===null){const X="webgl2";if(re=At(X,L),re===null)throw At(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(L){throw console.error("THREE.WebGLRenderer: "+L.message),L}let Je,Tt,ot,Vt,yt,q,U,ue,Se,Ge,Pe,ft,nt,ht,tn,tt,Et,zt,Dt,bt,me,De,rt,ge;function xe(){Je=new p_e(re),Je.init(),De=new Cq(re,Je),Tt=new o_e(re,Je,e,De),ot=new YAe(re,Je),Tt.reverseDepthBuffer&&f&&ot.buffers.depth.setReversed(!0),Vt=new g_e(re),yt=new LAe,q=new JAe(re,Je,ot,yt,Tt,De,Vt),U=new u_e(A),ue=new f_e(A),Se=new Ave(re),rt=new a_e(re,Se),Ge=new h_e(re,Se,Vt,rt),Pe=new y_e(re,Ge,Se,Vt),Dt=new b_e(re,Tt,q),tt=new l_e(yt),ft=new DAe(A,U,ue,Je,Tt,rt,tt),nt=new sTe(A,yt),ht=new PAe,tn=new GAe(Je),zt=new i_e(A,U,ue,ot,Pe,m,l),Et=new WAe(A,Pe,Tt),ge=new oTe(re,Vt,Tt,ot),bt=new s_e(re,Je,Vt),me=new m_e(re,Je,Vt),Vt.programs=ft.programs,A.capabilities=Tt,A.extensions=Je,A.properties=yt,A.renderLists=ht,A.shadowMap=Et,A.state=ot,A.info=Vt}xe();const Me=new iTe(A,re);this.xr=Me,this.getContext=function(){return re},this.getContextAttributes=function(){return re.getContextAttributes()},this.forceContextLoss=function(){const L=Je.get("WEBGL_lose_context");L&&L.loseContext()},this.forceContextRestore=function(){const L=Je.get("WEBGL_lose_context");L&&L.restoreContext()},this.getPixelRatio=function(){return F},this.setPixelRatio=function(L){L!==void 0&&(F=L,this.setSize(ae,ee,!1))},this.getSize=function(L){return L.set(ae,ee)},this.setSize=function(L,X,le=!0){if(Me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}ae=L,ee=X,n.width=Math.floor(L*F),n.height=Math.floor(X*F),le===!0&&(n.style.width=L+"px",n.style.height=X+"px"),this.setViewport(0,0,L,X)},this.getDrawingBufferSize=function(L){return L.set(ae*F,ee*F).floor()},this.setDrawingBufferSize=function(L,X,le){ae=L,ee=X,F=le,n.width=Math.floor(L*le),n.height=Math.floor(X*le),this.setViewport(0,0,L,X)},this.getCurrentViewport=function(L){return L.copy(B)},this.getViewport=function(L){return L.copy(fe)},this.setViewport=function(L,X,le,de){L.isVector4?fe.set(L.x,L.y,L.z,L.w):fe.set(L,X,le,de),ot.viewport(B.copy(fe).multiplyScalar(F).round())},this.getScissor=function(L){return L.copy(Ce)},this.setScissor=function(L,X,le,de){L.isVector4?Ce.set(L.x,L.y,L.z,L.w):Ce.set(L,X,le,de),ot.scissor(G.copy(Ce).multiplyScalar(F).round())},this.getScissorTest=function(){return Le},this.setScissorTest=function(L){ot.setScissorTest(Le=L)},this.setOpaqueSort=function(L){ie=L},this.setTransparentSort=function(L){J=L},this.getClearColor=function(L){return L.copy(zt.getClearColor())},this.setClearColor=function(){zt.setClearColor.apply(zt,arguments)},this.getClearAlpha=function(){return zt.getClearAlpha()},this.setClearAlpha=function(){zt.setClearAlpha.apply(zt,arguments)},this.clear=function(L=!0,X=!0,le=!0){let de=0;if(L){let Q=!1;if(O!==null){const Ee=O.texture.format;Q=Ee===XT||Ee===qT||Ee===ey}if(Q){const Ee=O.texture.type,we=Ee===as||Ee===yl||Ee===Xh||Ee===gf||Ee===jT||Ee===YT,at=zt.getClearColor(),Ve=zt.getClearAlpha(),Qe=at.r,lt=at.g,Ue=at.b;we?(g[0]=Qe,g[1]=lt,g[2]=Ue,g[3]=Ve,re.clearBufferuiv(re.COLOR,0,g)):(y[0]=Qe,y[1]=lt,y[2]=Ue,y[3]=Ve,re.clearBufferiv(re.COLOR,0,y))}else de|=re.COLOR_BUFFER_BIT}X&&(de|=re.DEPTH_BUFFER_BIT),le&&(de|=re.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),re.clear(de)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",Xe,!1),n.removeEventListener("webglcontextrestored",St,!1),n.removeEventListener("webglcontextcreationerror",_t,!1),ht.dispose(),tn.dispose(),yt.dispose(),U.dispose(),ue.dispose(),Pe.dispose(),rt.dispose(),ge.dispose(),ft.dispose(),Me.dispose(),Me.removeEventListener("sessionstart",_e),Me.removeEventListener("sessionend",Oe),Ze.stop()};function Xe(L){L.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function St(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1;const L=Vt.autoReset,X=Et.enabled,le=Et.autoUpdate,de=Et.needsUpdate,Q=Et.type;xe(),Vt.autoReset=L,Et.enabled=X,Et.autoUpdate=le,Et.needsUpdate=de,Et.type=Q}function _t(L){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",L.statusMessage)}function Xt(L){const X=L.target;X.removeEventListener("dispose",Xt),mn(X)}function mn(L){Hn(L),yt.remove(L)}function Hn(L){const X=yt.get(L).programs;X!==void 0&&(X.forEach(function(le){ft.releaseProgram(le)}),L.isShaderMaterial&&ft.releaseShaderCache(L))}this.renderBufferDirect=function(L,X,le,de,Q,Ee){X===null&&(X=Mt);const we=Q.isMesh&&Q.matrixWorld.determinant()<0,at=oe(L,X,le,de,Q);ot.setMaterial(de,we);let Ve=le.index,Qe=1;if(de.wireframe===!0){if(Ve=Ge.getWireframeAttribute(le),Ve===void 0)return;Qe=2}const lt=le.drawRange,Ue=le.attributes.position;let ct=lt.start*Qe,Bt=(lt.start+lt.count)*Qe;Ee!==null&&(ct=Math.max(ct,Ee.start*Qe),Bt=Math.min(Bt,(Ee.start+Ee.count)*Qe)),Ve!==null?(ct=Math.max(ct,0),Bt=Math.min(Bt,Ve.count)):Ue!=null&&(ct=Math.max(ct,0),Bt=Math.min(Bt,Ue.count));const wt=Bt-ct;if(wt<0||wt===1/0)return;rt.setup(Q,de,at,le,Ve);let xt,Nt=bt;if(Ve!==null&&(xt=Se.get(Ve),Nt=me,Nt.setIndex(xt)),Q.isMesh)de.wireframe===!0?(ot.setLineWidth(de.wireframeLinewidth*qe()),Nt.setMode(re.LINES)):Nt.setMode(re.TRIANGLES);else if(Q.isLine){let pt=de.linewidth;pt===void 0&&(pt=1),ot.setLineWidth(pt*qe()),Q.isLineSegments?Nt.setMode(re.LINES):Q.isLineLoop?Nt.setMode(re.LINE_LOOP):Nt.setMode(re.LINE_STRIP)}else Q.isPoints?Nt.setMode(re.POINTS):Q.isSprite&&Nt.setMode(re.TRIANGLES);if(Q.isBatchedMesh)if(Q._multiDrawInstances!==null)Nt.renderMultiDrawInstances(Q._multiDrawStarts,Q._multiDrawCounts,Q._multiDrawCount,Q._multiDrawInstances);else if(Je.get("WEBGL_multi_draw"))Nt.renderMultiDraw(Q._multiDrawStarts,Q._multiDrawCounts,Q._multiDrawCount);else{const pt=Q._multiDrawStarts,nn=Q._multiDrawCounts,Zt=Q._multiDrawCount,ir=Ve?Se.get(Ve).bytesPerElement:1,ar=yt.get(de).currentProgram.getUniforms();for(let Wn=0;Wn{function Ee(){if(de.forEach(function(we){yt.get(we).currentProgram.isReady()&&de.delete(we)}),de.size===0){Q(L);return}setTimeout(Ee,10)}Je.get("KHR_parallel_shader_compile")!==null?Ee():setTimeout(Ee,10)})};let Gn=null;function he(L){Gn&&Gn(L)}function _e(){Ze.stop()}function Oe(){Ze.start()}const Ze=new _q;Ze.setAnimationLoop(he),typeof self<"u"&&Ze.setContext(self),this.setAnimationLoop=function(L){Gn=L,Me.setAnimationLoop(L),L===null?Ze.stop():Ze.start()},Me.addEventListener("sessionstart",_e),Me.addEventListener("sessionend",Oe),this.render=function(L,X){if(X!==void 0&&X.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;if(L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),Me.enabled===!0&&Me.isPresenting===!0&&(Me.cameraAutoUpdate===!0&&Me.updateCamera(X),X=Me.getCamera()),L.isScene===!0&&L.onBeforeRender(A,L,X,O),b=tn.get(L,S.length),b.init(X),S.push(b),gt.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),j.setFromProjectionMatrix(gt),Fe=this.localClippingEnabled,ke=tt.init(this.clippingPlanes,Fe),v=ht.get(L,E.length),v.init(),E.push(v),Me.enabled===!0&&Me.isPresenting===!0){const Ee=A.xr.getDepthSensingMesh();Ee!==null&&Ct(Ee,X,-1/0,A.sortObjects)}Ct(L,X,0,A.sortObjects),v.finish(),A.sortObjects===!0&&v.sort(ie,J),$e=Me.enabled===!1||Me.isPresenting===!1||Me.hasDepthSensing()===!1,$e&&zt.addToRenderList(v,L),this.info.render.frame++,ke===!0&&tt.beginShadows();const le=b.state.shadowsArray;Et.render(le,L,X),ke===!0&&tt.endShadows(),this.info.autoReset===!0&&this.info.reset();const de=v.opaque,Q=v.transmissive;if(b.setupLights(),X.isArrayCamera){const Ee=X.cameras;if(Q.length>0)for(let we=0,at=Ee.length;we0&&Kt(de,Q,L,X),$e&&zt.render(L),kt(v,L,X);O!==null&&(q.updateMultisampleRenderTarget(O),q.updateRenderTargetMipmap(O)),L.isScene===!0&&L.onAfterRender(A,L,X),rt.resetDefaultState(),N=-1,M=null,S.pop(),S.length>0?(b=S[S.length-1],ke===!0&&tt.setGlobalState(A.clippingPlanes,b.state.camera)):b=null,E.pop(),E.length>0?v=E[E.length-1]:v=null};function Ct(L,X,le,de){if(L.visible===!1)return;if(L.layers.test(X.layers)){if(L.isGroup)le=L.renderOrder;else if(L.isLOD)L.autoUpdate===!0&&L.update(X);else if(L.isLight)b.pushLight(L),L.castShadow&&b.pushShadow(L);else if(L.isSprite){if(!L.frustumCulled||j.intersectsSprite(L)){de&&Ut.setFromMatrixPosition(L.matrixWorld).applyMatrix4(gt);const we=Pe.update(L),at=L.material;at.visible&&v.push(L,we,at,le,Ut.z,null)}}else if((L.isMesh||L.isLine||L.isPoints)&&(!L.frustumCulled||j.intersectsObject(L))){const we=Pe.update(L),at=L.material;if(de&&(L.boundingSphere!==void 0?(L.boundingSphere===null&&L.computeBoundingSphere(),Ut.copy(L.boundingSphere.center)):(we.boundingSphere===null&&we.computeBoundingSphere(),Ut.copy(we.boundingSphere.center)),Ut.applyMatrix4(L.matrixWorld).applyMatrix4(gt)),Array.isArray(at)){const Ve=we.groups;for(let Qe=0,lt=Ve.length;Qe0&&et(Q,X,le),Ee.length>0&&et(Ee,X,le),we.length>0&&et(we,X,le),ot.buffers.depth.setTest(!0),ot.buffers.depth.setMask(!0),ot.buffers.color.setMask(!0),ot.setPolygonOffset(!1)}function Kt(L,X,le,de){if((le.isScene===!0?le.overrideMaterial:null)!==null)return;b.state.transmissionRenderTarget[de.id]===void 0&&(b.state.transmissionRenderTarget[de.id]=new ki(1,1,{generateMipmaps:!0,type:Je.has("EXT_color_buffer_half_float")||Je.has("EXT_color_buffer_float")?fi:as,minFilter:Js,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Un.workingColorSpace}));const Ee=b.state.transmissionRenderTarget[de.id],we=de.viewport||B;Ee.setSize(we.z,we.w);const at=A.getRenderTarget();A.setRenderTarget(Ee),A.getClearColor(K),se=A.getClearAlpha(),se<1&&A.setClearColor(16777215,.5),A.clear(),$e&&zt.render(le);const Ve=A.toneMapping;A.toneMapping=fl;const Qe=de.viewport;if(de.viewport!==void 0&&(de.viewport=void 0),b.setupLightsView(de),ke===!0&&tt.setGlobalState(A.clippingPlanes,de),et(L,le,de),q.updateMultisampleRenderTarget(Ee),q.updateRenderTargetMipmap(Ee),Je.has("WEBGL_multisampled_render_to_texture")===!1){let lt=!1;for(let Ue=0,ct=X.length;Ue0),Ue=!!le.morphAttributes.position,ct=!!le.morphAttributes.normal,Bt=!!le.morphAttributes.color;let wt=fl;de.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(wt=A.toneMapping);const xt=le.morphAttributes.position||le.morphAttributes.normal||le.morphAttributes.color,Nt=xt!==void 0?xt.length:0,pt=yt.get(de),nn=b.state.lights;if(ke===!0&&(Fe===!0||L!==M)){const wn=L===M&&de.id===N;tt.setState(de,L,wn)}let Zt=!1;de.version===pt.__version?(pt.needsLights&&pt.lightsStateVersion!==nn.state.version||pt.outputColorSpace!==at||Q.isBatchedMesh&&pt.batching===!1||!Q.isBatchedMesh&&pt.batching===!0||Q.isBatchedMesh&&pt.batchingColor===!0&&Q.colorTexture===null||Q.isBatchedMesh&&pt.batchingColor===!1&&Q.colorTexture!==null||Q.isInstancedMesh&&pt.instancing===!1||!Q.isInstancedMesh&&pt.instancing===!0||Q.isSkinnedMesh&&pt.skinning===!1||!Q.isSkinnedMesh&&pt.skinning===!0||Q.isInstancedMesh&&pt.instancingColor===!0&&Q.instanceColor===null||Q.isInstancedMesh&&pt.instancingColor===!1&&Q.instanceColor!==null||Q.isInstancedMesh&&pt.instancingMorph===!0&&Q.morphTexture===null||Q.isInstancedMesh&&pt.instancingMorph===!1&&Q.morphTexture!==null||pt.envMap!==Ve||de.fog===!0&&pt.fog!==Ee||pt.numClippingPlanes!==void 0&&(pt.numClippingPlanes!==tt.numPlanes||pt.numIntersection!==tt.numIntersection)||pt.vertexAlphas!==Qe||pt.vertexTangents!==lt||pt.morphTargets!==Ue||pt.morphNormals!==ct||pt.morphColors!==Bt||pt.toneMapping!==wt||pt.morphTargetsCount!==Nt)&&(Zt=!0):(Zt=!0,pt.__version=de.version);let ir=pt.currentProgram;Zt===!0&&(ir=Rt(de,X,Q));let ar=!1,Wn=!1,Rn=!1;const un=ir.getUniforms(),hn=pt.uniforms;if(ot.useProgram(ir.program)&&(ar=!0,Wn=!0,Rn=!0),de.id!==N&&(N=de.id,Wn=!0),ar||M!==L){ot.buffers.depth.getReversed()?(Ye.copy(L.projectionMatrix),Xye(Ye),Kye(Ye),un.setValue(re,"projectionMatrix",Ye)):un.setValue(re,"projectionMatrix",L.projectionMatrix),un.setValue(re,"viewMatrix",L.matrixWorldInverse);const Kr=un.map.cameraPosition;Kr!==void 0&&Kr.setValue(re,Gt.setFromMatrixPosition(L.matrixWorld)),Tt.logarithmicDepthBuffer&&un.setValue(re,"logDepthBufFC",2/(Math.log(L.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&un.setValue(re,"isOrthographic",L.isOrthographicCamera===!0),M!==L&&(M=L,Wn=!0,Rn=!0)}if(Q.isSkinnedMesh){un.setOptional(re,Q,"bindMatrix"),un.setOptional(re,Q,"bindMatrixInverse");const wn=Q.skeleton;wn&&(wn.boneTexture===null&&wn.computeBoneTexture(),un.setValue(re,"boneTexture",wn.boneTexture,q))}Q.isBatchedMesh&&(un.setOptional(re,Q,"batchingTexture"),un.setValue(re,"batchingTexture",Q._matricesTexture,q),un.setOptional(re,Q,"batchingIdTexture"),un.setValue(re,"batchingIdTexture",Q._indirectTexture,q),un.setOptional(re,Q,"batchingColorTexture"),Q._colorsTexture!==null&&un.setValue(re,"batchingColorTexture",Q._colorsTexture,q));const An=le.morphAttributes;if((An.position!==void 0||An.normal!==void 0||An.color!==void 0)&&Dt.update(Q,le,ir),(Wn||pt.receiveShadow!==Q.receiveShadow)&&(pt.receiveShadow=Q.receiveShadow,un.setValue(re,"receiveShadow",Q.receiveShadow)),de.isMeshGouraudMaterial&&de.envMap!==null&&(hn.envMap.value=Ve,hn.flipEnvMap.value=Ve.isCubeTexture&&Ve.isRenderTargetTexture===!1?-1:1),de.isMeshStandardMaterial&&de.envMap===null&&X.environment!==null&&(hn.envMapIntensity.value=X.environmentIntensity),Wn&&(un.setValue(re,"toneMappingExposure",A.toneMappingExposure),pt.needsLights&&Te(hn,Rn),Ee&&de.fog===!0&&nt.refreshFogUniforms(hn,Ee),nt.refreshMaterialUniforms(hn,de,F,ee,b.state.transmissionRenderTarget[L.id]),$S.upload(re,P(pt),hn,q)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&($S.upload(re,P(pt),hn,q),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&un.setValue(re,"center",Q.center),un.setValue(re,"modelViewMatrix",Q.modelViewMatrix),un.setValue(re,"normalMatrix",Q.normalMatrix),un.setValue(re,"modelMatrix",Q.matrixWorld),de.isShaderMaterial||de.isRawShaderMaterial){const wn=de.uniformsGroups;for(let Kr=0,hr=wn.length;Kr0&&q.useMultisampledRTT(L)===!1?Q=yt.get(L).__webglMultisampledFramebuffer:Array.isArray(lt)?Q=lt[le]:Q=lt,B.copy(L.viewport),G.copy(L.scissor),W=L.scissorTest}else B.copy(fe).multiplyScalar(F).floor(),G.copy(Ce).multiplyScalar(F).floor(),W=Le;if(ot.bindFramebuffer(re.FRAMEBUFFER,Q)&&de&&ot.drawBuffers(L,Q),ot.viewport(B),ot.scissor(G),ot.setScissorTest(W),Ee){const Ve=yt.get(L.texture);re.framebufferTexture2D(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_CUBE_MAP_POSITIVE_X+X,Ve.__webglTexture,le)}else if(we){const Ve=yt.get(L.texture),Qe=X||0;re.framebufferTextureLayer(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,Ve.__webglTexture,le||0,Qe)}N=-1},this.readRenderTargetPixels=function(L,X,le,de,Q,Ee,we){if(!(L&&L.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let at=yt.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&we!==void 0&&(at=at[we]),at){ot.bindFramebuffer(re.FRAMEBUFFER,at);try{const Ve=L.texture,Qe=Ve.format,lt=Ve.type;if(!Tt.textureFormatReadable(Qe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Tt.textureTypeReadable(lt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}X>=0&&X<=L.width-de&&le>=0&&le<=L.height-Q&&re.readPixels(X,le,de,Q,De.convert(Qe),De.convert(lt),Ee)}finally{const Ve=O!==null?yt.get(O).__webglFramebuffer:null;ot.bindFramebuffer(re.FRAMEBUFFER,Ve)}}},this.readRenderTargetPixelsAsync=async function(L,X,le,de,Q,Ee,we){if(!(L&&L.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let at=yt.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&we!==void 0&&(at=at[we]),at){const Ve=L.texture,Qe=Ve.format,lt=Ve.type;if(!Tt.textureFormatReadable(Qe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Tt.textureTypeReadable(lt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(X>=0&&X<=L.width-de&&le>=0&&le<=L.height-Q){ot.bindFramebuffer(re.FRAMEBUFFER,at);const Ue=re.createBuffer();re.bindBuffer(re.PIXEL_PACK_BUFFER,Ue),re.bufferData(re.PIXEL_PACK_BUFFER,Ee.byteLength,re.STREAM_READ),re.readPixels(X,le,de,Q,De.convert(Qe),De.convert(lt),0);const ct=O!==null?yt.get(O).__webglFramebuffer:null;ot.bindFramebuffer(re.FRAMEBUFFER,ct);const Bt=re.fenceSync(re.SYNC_GPU_COMMANDS_COMPLETE,0);return re.flush(),await qye(re,Bt,4),re.bindBuffer(re.PIXEL_PACK_BUFFER,Ue),re.getBufferSubData(re.PIXEL_PACK_BUFFER,0,Ee),re.deleteBuffer(Ue),re.deleteSync(Bt),Ee}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(L,X=null,le=0){L.isTexture!==!0&&(t0("WebGLRenderer: copyFramebufferToTexture function signature has changed."),X=arguments[0]||null,L=arguments[1]);const de=Math.pow(2,-le),Q=Math.floor(L.image.width*de),Ee=Math.floor(L.image.height*de),we=X!==null?X.x:0,at=X!==null?X.y:0;q.setTexture2D(L,0),re.copyTexSubImage2D(re.TEXTURE_2D,le,0,0,we,at,Q,Ee),ot.unbindTexture()},this.copyTextureToTexture=function(L,X,le=null,de=null,Q=0){L.isTexture!==!0&&(t0("WebGLRenderer: copyTextureToTexture function signature has changed."),de=arguments[0]||null,L=arguments[1],X=arguments[2],Q=arguments[3]||0,le=null);let Ee,we,at,Ve,Qe,lt,Ue,ct,Bt;const wt=L.isCompressedTexture?L.mipmaps[Q]:L.image;le!==null?(Ee=le.max.x-le.min.x,we=le.max.y-le.min.y,at=le.isBox3?le.max.z-le.min.z:1,Ve=le.min.x,Qe=le.min.y,lt=le.isBox3?le.min.z:0):(Ee=wt.width,we=wt.height,at=wt.depth||1,Ve=0,Qe=0,lt=0),de!==null?(Ue=de.x,ct=de.y,Bt=de.z):(Ue=0,ct=0,Bt=0);const xt=De.convert(X.format),Nt=De.convert(X.type);let pt;X.isData3DTexture?(q.setTexture3D(X,0),pt=re.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(q.setTexture2DArray(X,0),pt=re.TEXTURE_2D_ARRAY):(q.setTexture2D(X,0),pt=re.TEXTURE_2D),re.pixelStorei(re.UNPACK_FLIP_Y_WEBGL,X.flipY),re.pixelStorei(re.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),re.pixelStorei(re.UNPACK_ALIGNMENT,X.unpackAlignment);const nn=re.getParameter(re.UNPACK_ROW_LENGTH),Zt=re.getParameter(re.UNPACK_IMAGE_HEIGHT),ir=re.getParameter(re.UNPACK_SKIP_PIXELS),ar=re.getParameter(re.UNPACK_SKIP_ROWS),Wn=re.getParameter(re.UNPACK_SKIP_IMAGES);re.pixelStorei(re.UNPACK_ROW_LENGTH,wt.width),re.pixelStorei(re.UNPACK_IMAGE_HEIGHT,wt.height),re.pixelStorei(re.UNPACK_SKIP_PIXELS,Ve),re.pixelStorei(re.UNPACK_SKIP_ROWS,Qe),re.pixelStorei(re.UNPACK_SKIP_IMAGES,lt);const Rn=L.isDataArrayTexture||L.isData3DTexture,un=X.isDataArrayTexture||X.isData3DTexture;if(L.isRenderTargetTexture||L.isDepthTexture){const hn=yt.get(L),An=yt.get(X),wn=yt.get(hn.__renderTarget),Kr=yt.get(An.__renderTarget);ot.bindFramebuffer(re.READ_FRAMEBUFFER,wn.__webglFramebuffer),ot.bindFramebuffer(re.DRAW_FRAMEBUFFER,Kr.__webglFramebuffer);for(let hr=0;hr0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}};class sy{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=_b,this.updateRanges=[],this.version=0,this.uuid=Ss()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}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,n,r){e*=this.stride,r*=n.stride;for(let i=0,a=this.stride;ie.far||n.push({distance:l,point:Tg.clone(),uv:Ka.getInterpolation(Tg,EE,wg,SE,u5,GC,c5,new Ke),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function _E(t,e,n,r,i,a){Ip.subVectors(t,n).addScalar(.5).multiply(r),i!==void 0?(xg.x=a*Ip.x-i*Ip.y,xg.y=i*Ip.x+a*Ip.y):xg.copy(Ip),t.copy(e),t.x+=xg.x,t.y+=xg.y,t.applyMatrix4(Iq)}const AE=new H,d5=new H;class Nq extends _n{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 n=e.levels;for(let r=0,i=n.length;r0){let r,i;for(r=1,i=n.length;r0){AE.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(AE);this.getObjectForDistance(i).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){AE.setFromMatrixPosition(e.matrixWorld),d5.setFromMatrixPosition(this.matrixWorld);const r=AE.distanceTo(d5)/e.zoom;n[0].object.visible=!0;let i,a;for(i=1,a=n.length;i=s)n[i-1].object.visible=!1,n[i].object.visible=!0;else break}for(this._currentLevel=i-1;i=a.length&&a.push({start:-1,count:-1,z:-1,index:-1});const o=a[this.index];s.push(o),this.index++,o.start=e,o.count=n,o.z=r,o.index=i}reset(){this.list.length=0,this.index=0}}const Ga=new en,hTe=new vt(1,1,1),jC=new iy,wE=new Di,cd=new Li,Ig=new H,E5=new H,mTe=new H,YC=new pTe,la=new Ot,CE=[];function gTe(t,e,n=0){const r=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const i=t.count;for(let a=0;a65535?new Uint32Array(i):new Uint16Array(i);n.setIndex(new Kn(a,1))}this._geometryInitialized=!0}}_validateGeometry(e){const n=this.geometry;if(!!e.getIndex()!=!!n.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in n.attributes){if(!e.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=e.getAttribute(r),a=n.getAttribute(r);if(i.itemSize!==a.itemSize||i.normalized!==a.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Di);const e=this.boundingBox,n=this._instanceInfo;e.makeEmpty();for(let r=0,i=n.length;r=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("BatchedMesh: Maximum item count reached.");const r={visible:!0,active:!0,geometryIndex:e};let i=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(WC),i=this._availableInstanceIds.shift(),this._instanceInfo[i]=r):(i=this._instanceInfo.length,this._instanceInfo.push(r));const a=this._matricesTexture;Ga.identity().toArray(a.image.data,i*16),a.needsUpdate=!0;const s=this._colorsTexture;return s&&(hTe.toArray(s.image.data,i*4),s.needsUpdate=!0),this._visibilityChanged=!0,i}addGeometry(e,n=-1,r=-1){this._initializeGeometry(e),this._validateGeometry(e);const i={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},a=this._geometryInfo;i.vertexStart=this._nextVertexStart,i.reservedVertexCount=n===-1?e.getAttribute("position").count:n;const s=e.getIndex();if(s!==null&&(i.indexStart=this._nextIndexStart,i.reservedIndexCount=r===-1?s.count:r),i.indexStart!==-1&&i.indexStart+i.reservedIndexCount>this._maxIndexCount||i.vertexStart+i.reservedVertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(WC),l=this._availableGeometryIds.shift(),a[l]=i):(l=this._geometryCount,this._geometryCount++,a.push(i)),this.setGeometryAt(l,e),this._nextIndexStart=i.indexStart+i.reservedIndexCount,this._nextVertexStart=i.vertexStart+i.reservedVertexCount,l}setGeometryAt(e,n){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(n);const r=this.geometry,i=r.getIndex()!==null,a=r.getIndex(),s=n.getIndex(),o=this._geometryInfo[e];if(i&&s.count>o.reservedIndexCount||n.attributes.position.count>o.reservedVertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,u=o.reservedVertexCount;o.vertexCount=n.getAttribute("position").count;for(const c in r.attributes){const d=n.getAttribute(c),f=r.getAttribute(c);gTe(d,f,l);const m=d.itemSize;for(let g=d.count,y=u;g=n.length||n[e].active===!1)return this;const r=this._instanceInfo;for(let i=0,a=r.length;i=n.length||n[e].active===!1?this:(n[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this)}optimize(){let e=0,n=0;const r=this._geometryInfo,i=r.map((s,o)=>o).sort((s,o)=>r[s].vertexStart-r[o].vertexStart),a=this.geometry;for(let s=0,o=r.length;s=this._geometryCount)return null;const r=this.geometry,i=this._geometryInfo[e];if(i.boundingBox===null){const a=new Di,s=r.index,o=r.attributes.position;for(let l=i.start,u=i.start+i.count;l=this._geometryCount)return null;const r=this.geometry,i=this._geometryInfo[e];if(i.boundingSphere===null){const a=new Li;this.getBoundingBoxAt(e,wE),wE.getCenter(a.center);const s=r.index,o=r.attributes.position;let l=0;for(let u=i.start,c=i.start+i.count;u=r.length||r[e].active===!1?this:(n.toArray(a,e*16),i.needsUpdate=!0,this)}getMatrixAt(e,n){const r=this._instanceInfo,i=this._matricesTexture.image.data;return e>=r.length||r[e].active===!1?null:n.fromArray(i,e*16)}setColorAt(e,n){this._colorsTexture===null&&this._initColorsTexture();const r=this._colorsTexture,i=this._colorsTexture.image.data,a=this._instanceInfo;return e>=a.length||a[e].active===!1?this:(n.toArray(i,e*4),r.needsUpdate=!0,this)}getColorAt(e,n){const r=this._colorsTexture.image.data,i=this._instanceInfo;return e>=i.length||i[e].active===!1?null:n.fromArray(r,e*4)}setVisibleAt(e,n){const r=this._instanceInfo;return e>=r.length||r[e].active===!1||r[e].visible===n?this:(r[e].visible=n,this._visibilityChanged=!0,this)}getVisibleAt(e){const n=this._instanceInfo;return e>=n.length||n[e].active===!1?!1:n[e].visible}setGeometryIdAt(e,n){const r=this._instanceInfo,i=this._geometryInfo;return e>=r.length||r[e].active===!1||n>=i.length||i[n].active===!1?null:(r[e].geometryIndex=n,this)}getGeometryIdAt(e){const n=this._instanceInfo;return e>=n.length||n[e].active===!1?-1:n[e].geometryIndex}getGeometryRangeAt(e,n={}){if(e<0||e>=this._geometryCount)return null;const r=this._geometryInfo[e];return n.vertexStart=r.vertexStart,n.vertexCount=r.vertexCount,n.reservedVertexCount=r.reservedVertexCount,n.indexStart=r.indexStart,n.indexCount=r.indexCount,n.reservedIndexCount=r.reservedIndexCount,n.start=r.start,n.count=r.count,n}setInstanceCount(e){const n=this._availableInstanceIds,r=this._instanceInfo;for(n.sort(WC);n[n.length-1]===r.length;)r.pop(),n.pop();if(eo.active);if(Math.max(...r.map(o=>o.vertexStart+o.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${n}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...r.map(l=>l.indexStart+l.reservedIndexCount))>n)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${n}. Cannot shrink further.`);const a=this.geometry;a.dispose(),this._maxVertexCount=e,this._maxIndexCount=n,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new fn,this._initializeGeometry(a));const s=this.geometry;a.index&&dd(a.index.array,s.index.array);for(const o in a.attributes)dd(a.attributes[o].array,s.attributes[o].array)}raycast(e,n){const r=this._instanceInfo,i=this._geometryInfo,a=this.matrixWorld,s=this.geometry;la.material=this.material,la.geometry.index=s.index,la.geometry.attributes=s.attributes,la.geometry.boundingBox===null&&(la.geometry.boundingBox=new Di),la.geometry.boundingSphere===null&&(la.geometry.boundingSphere=new Li);for(let o=0,l=r.length;o({...n,boundingBox:n.boundingBox!==null?n.boundingBox.clone():null,boundingSphere:n.boundingSphere!==null?n.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(n=>({...n})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,n,r,i,a){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=i.getIndex(),o=s===null?1:s.array.BYTES_PER_ELEMENT,l=this._instanceInfo,u=this._multiDrawStarts,c=this._multiDrawCounts,d=this._geometryInfo,f=this.perObjectFrustumCulled,m=this._indirectTexture,g=m.image.data;f&&(Ga.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),jC.setFromProjectionMatrix(Ga,e.coordinateSystem));let y=0;if(this.sortObjects){Ga.copy(this.matrixWorld).invert(),Ig.setFromMatrixPosition(r.matrixWorld).applyMatrix4(Ga),E5.set(0,0,-1).transformDirection(r.matrixWorld).transformDirection(Ga);for(let E=0,S=l.length;E0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;ar)return;qC.applyMatrix4(t.matrixWorld);const l=e.ray.origin.distanceTo(qC);if(!(le.far))return{distance:l,point:_5.clone().applyMatrix4(t.matrixWorld),index:i,face:null,faceIndex:null,barycoord:null,object:t}}const A5=new H,T5=new H;class Oo extends xn{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,a=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;ai.far)return;a.push({distance:u,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:s})}}class bTe extends $n{constructor(e,n,r,i,a,s,o,l,u){super(e,n,r,i,a,s,o,l,u),this.isVideoTexture=!0,this.minFilter=s!==void 0?s:Xn,this.magFilter=a!==void 0?a:Xn,this.generateMipmaps=!1;const c=this;function d(){c.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class yTe extends $n{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=pi,this.minFilter=pi,this.generateMipmaps=!1,this.needsUpdate=!0}}class ix extends $n{constructor(e,n,r,i,a,s,o,l,u,c,d,f){super(null,s,o,l,u,c,i,a,d,f),this.isCompressedTexture=!0,this.image={width:n,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class vTe extends ix{constructor(e,n,r,i,a,s){super(e,n,r,a,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=ni,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ETe extends ix{constructor(e,n,r){super(void 0,e[0].width,e[0].height,n,r,bl),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class STe extends $n{constructor(e,n,r,i,a,s,o,l,u){super(e,n,r,i,a,s,o,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Do{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,n){const r=this.getUtoTmapping(e);return this.getPoint(r,n)}getPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPoint(r/e));return n}getSpacedPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n}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 n=[];let r,i=this.getPoint(0),a=0;n.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),a+=r.distanceTo(i),n.push(a),i=r;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n){const r=this.getLengths();let i=0;const a=r.length;let s;n?s=n:s=e*r[a-1];let o=0,l=a-1,u;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),u=r[i]-s,u<0)o=i+1;else if(u>0)l=i-1;else{l=i;break}if(i=l,r[i]===s)return i/(a-1);const c=r[i],f=r[i+1]-c,m=(s-c)/f;return(i+m)/(a-1)}getTangent(e,n){let i=e-1e-4,a=e+1e-4;i<0&&(i=0),a>1&&(a=1);const s=this.getPoint(i),o=this.getPoint(a),l=n||(s.isVector2?new Ke:new H);return l.copy(o).sub(s).normalize(),l}getTangentAt(e,n){const r=this.getUtoTmapping(e);return this.getTangent(r,n)}computeFrenetFrames(e,n){const r=new H,i=[],a=[],s=[],o=new H,l=new en;for(let m=0;m<=e;m++){const g=m/e;i[m]=this.getTangentAt(g,new H)}a[0]=new H,s[0]=new H;let u=Number.MAX_VALUE;const c=Math.abs(i[0].x),d=Math.abs(i[0].y),f=Math.abs(i[0].z);c<=u&&(u=c,r.set(1,0,0)),d<=u&&(u=d,r.set(0,1,0)),f<=u&&r.set(0,0,1),o.crossVectors(i[0],r).normalize(),a[0].crossVectors(i[0],o),s[0].crossVectors(i[0],a[0]);for(let m=1;m<=e;m++){if(a[m]=a[m-1].clone(),s[m]=s[m-1].clone(),o.crossVectors(i[m-1],i[m]),o.length()>Number.EPSILON){o.normalize();const g=Math.acos(Yr(i[m-1].dot(i[m]),-1,1));a[m].applyMatrix4(l.makeRotationAxis(o,g))}s[m].crossVectors(i[m],a[m])}if(n===!0){let m=Math.acos(Yr(a[0].dot(a[e]),-1,1));m/=e,i[0].dot(o.crossVectors(a[0],a[e]))>0&&(m=-m);for(let g=1;g<=e;g++)a[g].applyMatrix4(l.makeRotationAxis(i[g],m*g)),s[g].crossVectors(i[g],a[g])}return{tangents:i,normals:a,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class ax extends Do{constructor(e=0,n=0,r=1,i=1,a=0,s=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=r,this.yRadius=i,this.aStartAngle=a,this.aEndAngle=s,this.aClockwise=o,this.aRotation=l}getPoint(e,n=new Ke){const r=n,i=Math.PI*2;let a=this.aEndAngle-this.aStartAngle;const s=Math.abs(a)i;)a-=i;a0?0:(Math.floor(Math.abs(o)/a)+1)*a:l===0&&o===a-1&&(o=a-2,l=1);let u,c;this.closed||o>0?u=i[(o-1)%a]:(OE.subVectors(i[0],i[1]).add(i[0]),u=OE);const d=i[o%a],f=i[(o+1)%a];if(this.closed||o+2i.length-2?i.length-1:s+1],d=i[s>i.length-3?i.length-1:s+2];return r.set(C5(o,l.x,u.x,c.x,d.x),C5(o,l.y,u.y,c.y,d.y)),r}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n=r){const s=i[a]-r,o=this.curves[a],l=o.getLength(),u=l===0?0:1-s/l;return o.getPointAt(u,n)}a++}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 n=0;for(let r=0,i=this.curves.length;r1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,r=e.curves.length;n0){const d=u.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(u);const c=u.getPoint(1);return this.currentPoint.copy(c),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 uy extends fn{constructor(e=[new Ke(0,-.5),new Ke(.5,0),new Ke(0,.5)],n=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:r,phiLength:i},n=Math.floor(n),i=Yr(i,0,Math.PI*2);const a=[],s=[],o=[],l=[],u=[],c=1/n,d=new H,f=new Ke,m=new H,g=new H,y=new H;let v=0,b=0;for(let E=0;E<=e.length-1;E++)switch(E){case 0:v=e[E+1].x-e[E].x,b=e[E+1].y-e[E].y,m.x=b*1,m.y=-v,m.z=b*0,y.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(y.x,y.y,y.z);break;default:v=e[E+1].x-e[E].x,b=e[E+1].y-e[E].y,m.x=b*1,m.y=-v,m.z=b*0,g.copy(m),m.x+=y.x,m.y+=y.y,m.z+=y.z,m.normalize(),l.push(m.x,m.y,m.z),y.copy(g)}for(let E=0;E<=n;E++){const S=r+E*c*i,A=Math.sin(S),I=Math.cos(S);for(let T=0;T<=e.length-1;T++){d.x=e[T].x*A,d.y=e[T].y,d.z=e[T].x*I,s.push(d.x,d.y,d.z),f.x=E/n,f.y=T/(e.length-1),o.push(f.x,f.y);const R=l[3*T+0]*A,O=l[3*T+1],N=l[3*T+0]*I;u.push(R,O,N)}}for(let E=0;E0&&S(!0),n>0&&S(!1)),this.setIndex(c),this.setAttribute("position",new qt(d,3)),this.setAttribute("normal",new qt(f,3)),this.setAttribute("uv",new qt(m,2));function E(){const A=new H,I=new H;let T=0;const R=(n-e)/r;for(let O=0;O<=a;O++){const N=[],M=O/a,B=M*(n-e)+e;for(let G=0;G<=i;G++){const W=G/i,K=W*l+o,se=Math.sin(K),ae=Math.cos(K);I.x=B*se,I.y=-M*r+v,I.z=B*ae,d.push(I.x,I.y,I.z),A.set(se,R,ae).normalize(),f.push(A.x,A.y,A.z),m.push(W,1-M),N.push(g++)}y.push(N)}for(let O=0;O0||N!==0)&&(c.push(M,B,W),T+=3),(n>0||N!==a-1)&&(c.push(B,G,W),T+=3)}u.addGroup(b,T,0),b+=T}function S(A){const I=g,T=new Ke,R=new H;let O=0;const N=A===!0?e:n,M=A===!0?1:-1;for(let G=1;G<=i;G++)d.push(0,v*M,0),f.push(0,M,0),m.push(.5,.5),g++;const B=g;for(let G=0;G<=i;G++){const K=G/i*l+o,se=Math.cos(K),ae=Math.sin(K);R.x=N*ae,R.y=v*M,R.z=N*se,d.push(R.x,R.y,R.z),f.push(0,M,0),T.x=se*.5+.5,T.y=ae*.5*M+.5,m.push(T.x,T.y),g++}for(let G=0;G.9&&R<.1&&(S<.2&&(s[E+0]+=1),A<.2&&(s[E+2]+=1),I<.2&&(s[E+4]+=1))}}function f(E){a.push(E.x,E.y,E.z)}function m(E,S){const A=E*3;S.x=e[A+0],S.y=e[A+1],S.z=e[A+2]}function g(){const E=new H,S=new H,A=new H,I=new H,T=new Ke,R=new Ke,O=new Ke;for(let N=0,M=0;N80*n){o=u=t[0],l=c=t[1];for(let g=n;gu&&(u=d),f>c&&(c=f);m=Math.max(u-o,c-l),m=m!==0?32767/m:0}return wb(a,s,n,o,l,m,0),s}};function Uq(t,e,n,r,i){let a,s;if(i===WTe(t,e,n,r)>0)for(a=e;a=e;a-=r)s=R5(a,t[a],t[a+1],s);return s&&cx(s,s.next)&&(Rb(s),s=s.next),s}function vf(t,e){if(!t)return t;e||(e=t);let n=t,r;do if(r=!1,!n.steiner&&(cx(n,n.next)||Ur(n.prev,n,n.next)===0)){if(Rb(n),n=e=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==e);return e}function wb(t,e,n,r,i,a,s){if(!t)return;!s&&a&&UTe(t,r,i,a);let o=t,l,u;for(;t.prev!==t.next;){if(l=t.prev,u=t.next,a?NTe(t,r,i,a):MTe(t)){e.push(l.i/n|0),e.push(t.i/n|0),e.push(u.i/n|0),Rb(t),t=u.next,o=u.next;continue}if(t=u,t===o){s?s===1?(t=OTe(vf(t),e,n),wb(t,e,n,r,i,a,2)):s===2&&DTe(t,e,n,r,i,a):wb(vf(t),e,n,r,i,a,1);break}}}function MTe(t){const e=t.prev,n=t,r=t.next;if(Ur(e,n,r)>=0)return!1;const i=e.x,a=n.x,s=r.x,o=e.y,l=n.y,u=r.y,c=ia?i>s?i:s:a>s?a:s,m=o>l?o>u?o:u:l>u?l:u;let g=r.next;for(;g!==e;){if(g.x>=c&&g.x<=f&&g.y>=d&&g.y<=m&&ch(i,o,a,l,s,u,g.x,g.y)&&Ur(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function NTe(t,e,n,r){const i=t.prev,a=t,s=t.next;if(Ur(i,a,s)>=0)return!1;const o=i.x,l=a.x,u=s.x,c=i.y,d=a.y,f=s.y,m=ol?o>u?o:u:l>u?l:u,v=c>d?c>f?c:f:d>f?d:f,b=kM(m,g,e,n,r),E=kM(y,v,e,n,r);let S=t.prevZ,A=t.nextZ;for(;S&&S.z>=b&&A&&A.z<=E;){if(S.x>=m&&S.x<=y&&S.y>=g&&S.y<=v&&S!==i&&S!==s&&ch(o,c,l,d,u,f,S.x,S.y)&&Ur(S.prev,S,S.next)>=0||(S=S.prevZ,A.x>=m&&A.x<=y&&A.y>=g&&A.y<=v&&A!==i&&A!==s&&ch(o,c,l,d,u,f,A.x,A.y)&&Ur(A.prev,A,A.next)>=0))return!1;A=A.nextZ}for(;S&&S.z>=b;){if(S.x>=m&&S.x<=y&&S.y>=g&&S.y<=v&&S!==i&&S!==s&&ch(o,c,l,d,u,f,S.x,S.y)&&Ur(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;A&&A.z<=E;){if(A.x>=m&&A.x<=y&&A.y>=g&&A.y<=v&&A!==i&&A!==s&&ch(o,c,l,d,u,f,A.x,A.y)&&Ur(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function OTe(t,e,n){let r=t;do{const i=r.prev,a=r.next.next;!cx(i,a)&&zq(i,r,r.next,a)&&Cb(i,a)&&Cb(a,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(a.i/n|0),Rb(r),Rb(r.next),r=t=a),r=r.next}while(r!==t);return vf(r)}function DTe(t,e,n,r,i,a){let s=t;do{let o=s.next.next;for(;o!==s.prev;){if(s.i!==o.i&>e(s,o)){let l=Hq(s,o);s=vf(s,s.next),l=vf(l,l.next),wb(s,e,n,r,i,a,0),wb(l,e,n,r,i,a,0);return}o=o.next}s=s.next}while(s!==t)}function LTe(t,e,n,r){const i=[];let a,s,o,l,u;for(a=0,s=e.length;a=n.next.y&&n.next.y!==n.y){const f=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(f<=a&&f>r&&(r=f,i=n.x=n.x&&n.x>=l&&a!==n.x&&ch(si.x||n.x===i.x&&FTe(i,n)))&&(i=n,c=d)),n=n.next;while(n!==o);return i}function FTe(t,e){return Ur(t.prev,t,e.prev)<0&&Ur(e.next,t,t.next)<0}function UTe(t,e,n,r){let i=t;do i.z===0&&(i.z=kM(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,zTe(i)}function zTe(t){let e,n,r,i,a,s,o,l,u=1;do{for(n=t,t=null,a=null,s=0;n;){for(s++,r=n,o=0,e=0;e0||l>0&&r;)o!==0&&(l===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,o--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(s>1);return t}function kM(t,e,n,r,i){return t=(t-n)*i|0,e=(e-r)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function HTe(t){let e=t,n=t;do(e.x=(t-s)*(a-o)&&(t-s)*(r-o)>=(n-s)*(e-o)&&(n-s)*(a-o)>=(i-s)*(r-o)}function GTe(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!VTe(t,e)&&(Cb(t,e)&&Cb(e,t)&&$Te(t,e)&&(Ur(t.prev,t,e.prev)||Ur(t,e.prev,e))||cx(t,e)&&Ur(t.prev,t,t.next)>0&&Ur(e.prev,e,e.next)>0)}function Ur(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function cx(t,e){return t.x===e.x&&t.y===e.y}function zq(t,e,n,r){const i=BE(Ur(t,e,n)),a=BE(Ur(t,e,r)),s=BE(Ur(n,r,t)),o=BE(Ur(n,r,e));return!!(i!==a&&s!==o||i===0&&PE(t,n,e)||a===0&&PE(t,r,e)||s===0&&PE(n,t,r)||o===0&&PE(n,e,r))}function PE(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function BE(t){return t>0?1:t<0?-1:0}function VTe(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&zq(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Cb(t,e){return Ur(t.prev,t,t.next)<0?Ur(t,e,t.next)>=0&&Ur(t,t.prev,e)>=0:Ur(t,e,t.prev)<0||Ur(t,t.next,e)<0}function $Te(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,a=(t.y+e.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==t);return r}function Hq(t,e){const n=new PM(t.i,t.x,t.y),r=new PM(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function R5(t,e,n,r){const i=new PM(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Rb(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function PM(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function WTe(t,e,n,r){let i=0;for(let a=e,s=n-r;a2&&t[e-1].equals(t[0])&&t.pop()}function M5(t,e){for(let n=0;nNumber.EPSILON){const Se=Math.sqrt(U),Ge=Math.sqrt(yt*yt+q*q),Pe=qe.x-Vt/Se,ft=qe.y+ot/Se,nt=re.x-q/Ge,ht=re.y+yt/Ge,tn=((nt-Pe)*q-(ht-ft)*yt)/(ot*q-Vt*yt);At=Pe+ot*tn-$e.x,Je=ft+Vt*tn-$e.y;const tt=At*At+Je*Je;if(tt<=2)return new Ke(At,Je);Tt=Math.sqrt(tt/2)}else{let Se=!1;ot>Number.EPSILON?yt>Number.EPSILON&&(Se=!0):ot<-Number.EPSILON?yt<-Number.EPSILON&&(Se=!0):Math.sign(Vt)===Math.sign(q)&&(Se=!0),Se?(At=-Vt,Je=ot,Tt=Math.sqrt(U)):(At=ot,Je=Vt,Tt=Math.sqrt(U/2))}return new Ke(At/Tt,Je/Tt)}const ie=[];for(let $e=0,qe=K.length,re=qe-1,At=$e+1;$e=0;$e--){const qe=$e/v,re=m*Math.cos(qe*Math.PI/2),At=g*Math.sin(qe*Math.PI/2)+y;for(let Je=0,Tt=K.length;Je=0;){const At=re;let Je=re-1;Je<0&&(Je=$e.length-1);for(let Tt=0,ot=c+v*2;Tt0)&&m.push(S,A,T),(b!==r-1||l0!=e>0&&this.version++,this._anisotropy=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 dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=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.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,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.dispersion=e.dispersion,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 bD extends ii{static get type(){return"MeshPhongMaterial"}constructor(e){super(),this.isMeshPhongMaterial=!0,this.color=new vt(16777215),this.specular=new vt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Bc,this.normalScale=new Ke(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ss,this.combine=Zb,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.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Wq extends ii{static get type(){return"MeshToonMaterial"}constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.color=new vt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Bc,this.normalScale=new Ke(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 jq extends ii{static get type(){return"MeshNormalMaterial"}constructor(e){super(),this.isMeshNormalMaterial=!0,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Bc,this.normalScale=new Ke(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 bx extends ii{static get type(){return"MeshLambertMaterial"}constructor(e){super(),this.isMeshLambertMaterial=!0,this.color=new vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Bc,this.normalScale=new Ke(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ss,this.combine=Zb,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.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Yq extends ii{static get type(){return"MeshMatcapMaterial"}constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.color=new vt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Bc,this.normalScale=new Ke(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 qq extends Ki{static get type(){return"LineDashedMaterial"}constructor(e){super(),this.isLineDashedMaterial=!0,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 Hd(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function Xq(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Kq(t){function e(i,a){return t[i]-t[a]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function BM(t,e,n){const r=t.length,i=new t.constructor(r);for(let a=0,s=0;s!==r;++a){const o=n[a]*e;for(let l=0;l!==e;++l)i[s++]=t[o+l]}return i}function yD(t,e,n,r){let i=1,a=t[0];for(;a!==void 0&&a[r]===void 0;)a=t[i++];if(a===void 0)return;let s=a[r];if(s!==void 0)if(Array.isArray(s))do s=a[r],s!==void 0&&(e.push(a.time),n.push.apply(n,s)),a=t[i++];while(a!==void 0);else if(s.toArray!==void 0)do s=a[r],s!==void 0&&(e.push(a.time),s.toArray(n,n.length)),a=t[i++];while(a!==void 0);else do s=a[r],s!==void 0&&(e.push(a.time),n.push(s)),a=t[i++];while(a!==void 0)}function XTe(t,e,n,r,i=30){const a=t.clone();a.name=e;const s=[];for(let l=0;l=r)){d.push(u.times[m]);for(let y=0;ya.tracks[l].times[0]&&(o=a.tracks[l].times[0]);for(let l=0;l=o.times[g]){const b=g*d+c,E=b+d-c;y=o.values.slice(b,E)}else{const b=o.createInterpolant(),E=c,S=d-c;b.evaluate(a),y=b.resultBuffer.slice(E,S)}l==="quaternion"&&new Mn().fromArray(y).normalize().conjugate().toArray(y);const v=u.times.length;for(let b=0;b=a)){const o=n[1];e=a)break t}s=r,r=0;break n}break e}for(;r>>1;en;)--s;if(++s,a!==0||s!==i){a>=s&&(s=Math.max(s,1),a=s-1);const o=this.getValueSize();this.times=r.slice(a,s),this.values=this.values.slice(a*o,s*o)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,a=r.length;a===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let o=0;o!==a;o++){const l=r[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,s),e=!1;break}s=l}if(i!==void 0&&Xq(i))for(let o=0,l=i.length;o!==l;++o){const u=i[o];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===VS,a=e.length-1;let s=1;for(let o=1;o0){e[s]=e[a];for(let o=a*r,l=s*r,u=0;u!==r;++u)n[l+u]=n[o+u];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=n.slice(0,s*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}Lo.prototype.TimeBufferType=Float32Array;Lo.prototype.ValueBufferType=Float32Array;Lo.prototype.DefaultInterpolation=Zh;class kf extends Lo{constructor(e,n,r){super(e,n,r)}}kf.prototype.ValueTypeName="bool";kf.prototype.ValueBufferType=Array;kf.prototype.DefaultInterpolation=Kh;kf.prototype.InterpolantFactoryMethodLinear=void 0;kf.prototype.InterpolantFactoryMethodSmooth=void 0;class ED extends Lo{}ED.prototype.ValueTypeName="color";class Ef extends Lo{}Ef.prototype.ValueTypeName="number";class Jq extends _m{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=(r-n)/(i-n);let u=e*o;for(let c=u+o;u!==c;u+=4)Mn.slerpFlat(a,0,s,u-o,s,u,l);return a}}class Sf extends Lo{InterpolantFactoryMethodLinear(e){return new Jq(this.times,this.values,this.getValueSize(),e)}}Sf.prototype.ValueTypeName="quaternion";Sf.prototype.InterpolantFactoryMethodSmooth=void 0;class Pf extends Lo{constructor(e,n,r){super(e,n,r)}}Pf.prototype.ValueTypeName="string";Pf.prototype.ValueBufferType=Array;Pf.prototype.DefaultInterpolation=Kh;Pf.prototype.InterpolantFactoryMethodLinear=void 0;Pf.prototype.InterpolantFactoryMethodSmooth=void 0;class _f extends Lo{}_f.prototype.ValueTypeName="vector";class tm{constructor(e="",n=-1,r=[],i=KT){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=Ss(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let s=0,o=r.length;s!==o;++s)n.push(JTe(r[s]).scale(i));const a=new this(e.name,e.duration,n,e.blendMode);return a.uuid=e.uuid,a}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let a=0,s=r.length;a!==s;++a)n.push(Lo.toJSON(r[a]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const a=n.length,s=[];for(let o=0;o1){const d=c[1];let f=i[d];f||(i[d]=f=[]),f.push(u)}}const s=[];for(const o in i)s.push(this.CreateFromMorphTargetSequence(o,i[o],n,r));return s}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(d,f,m,g,y){if(m.length!==0){const v=[],b=[];yD(m,v,b,g),v.length!==0&&y.push(new d(f,v,b))}},i=[],a=e.name||"default",s=e.fps||30,o=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let d=0;d{n&&n(a),this.manager.itemEnd(e)},0),a;if(Pl[e]!==void 0){Pl[e].push({onLoad:n,onProgress:r,onError:i});return}Pl[e]=[],Pl[e].push({onLoad:n,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(s).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const c=Pl[e],d=u.body.getReader(),f=u.headers.get("X-File-Size")||u.headers.get("Content-Length"),m=f?parseInt(f):0,g=m!==0;let y=0;const v=new ReadableStream({start(b){E();function E(){d.read().then(({done:S,value:A})=>{if(S)b.close();else{y+=A.byteLength;const I=new ProgressEvent("progress",{lengthComputable:g,loaded:y,total:m});for(let T=0,R=c.length;T{b.error(S)})}}});return new Response(v)}else throw new exe(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(c=>new DOMParser().parseFromString(c,o));case"json":return u.json();default:if(o===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(o),f=d&&d[1]?d[1].toLowerCase():void 0,m=new TextDecoder(f);return u.arrayBuffer().then(g=>m.decode(g))}}}).then(u=>{tu.add(e,u);const c=Pl[e];delete Pl[e];for(let d=0,f=c.length;d{const c=Pl[e];if(c===void 0)throw this.manager.itemError(e),u;delete Pl[e];for(let d=0,f=c.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class txe extends Zi{constructor(e){super(e)}load(e,n,r,i){const a=this,s=new ji(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(o){try{n(a.parse(JSON.parse(o)))}catch(l){i?i(l):console.error(l),a.manager.itemError(e)}},r,i)}parse(e){const n=[];for(let r=0;r0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const a in e.uniforms){const s=e.uniforms[a];switch(i.uniforms[a]={},s.type){case"t":i.uniforms[a].value=r(s.value);break;case"c":i.uniforms[a].value=new vt().setHex(s.value);break;case"v2":i.uniforms[a].value=new Ke().fromArray(s.value);break;case"v3":i.uniforms[a].value=new H().fromArray(s.value);break;case"v4":i.uniforms[a].value=new Yn().fromArray(s.value);break;case"m3":i.uniforms[a].value=new vn().fromArray(s.value);break;case"m4":i.uniforms[a].value=new en().fromArray(s.value);break;default:i.uniforms[a].value=s.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 a in e.extensions)i.extensions[a]=e.extensions[a];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),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 a=e.normalScale;Array.isArray(a)===!1&&(a=[a,a]),i.normalScale=new Ke().fromArray(a)}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.envMapRotation!==void 0&&i.envMapRotation.fromArray(e.envMapRotation),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 Ke().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.anisotropyMap!==void 0&&(i.anisotropyMap=r(e.anisotropyMap)),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}createMaterialFromType(e){return vx.createMaterialFromType(e)}static createMaterialFromType(e){const n={ShadowMaterial:Vq,SpriteMaterial:sD,RawShaderMaterial:$q,ShaderMaterial:qi,PointsMaterial:ly,MeshPhysicalMaterial:ya,MeshStandardMaterial:Lf,MeshPhongMaterial:bD,MeshToonMaterial:Wq,MeshNormalMaterial:jq,MeshLambertMaterial:bx,MeshDepthMaterial:ay,MeshDistanceMaterial:ex,MeshBasicMaterial:$i,MeshMatcapMaterial:Yq,LineDashedMaterial:qq,LineBasicMaterial:Ki,Material:ii};return new n[e]}}class yc{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let r=0,i=e.length;r0){const l=new yx(n);a=new Ib(l),a.setCrossOrigin(this.crossOrigin);for(let u=0,c=e.length;u0){i=new Ib(this.manager),i.setCrossOrigin(this.crossOrigin);for(let s=0,o=e.length;s{const v=new Di;v.min.fromArray(y.boxMin),v.max.fromArray(y.boxMax);const b=new Li;return b.radius=y.sphereRadius,b.center.fromArray(y.sphereCenter),{boxInitialized:y.boxInitialized,box:v,sphereInitialized:y.sphereInitialized,sphere:b}}),s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._geometryCount=e.geometryCount,s._matricesTexture=u(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(s._colorsTexture=u(e.colorsTexture.uuid));break;case"LOD":s=new Nq;break;case"Line":s=new xn(o(e.geometry),l(e.material));break;case"LineLoop":s=new uD(o(e.geometry),l(e.material));break;case"LineSegments":s=new Oo(o(e.geometry),l(e.material));break;case"PointCloud":case"Points":s=new cD(o(e.geometry),l(e.material));break;case"Sprite":s=new Mq(l(e.material));break;case"Group":s=new eu;break;case"Bone":s=new rx;break;default:s=new _n}if(s.uuid=e.uuid,e.name!==void 0&&(s.name=e.name),e.matrix!==void 0?(s.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(e.position!==void 0&&s.position.fromArray(e.position),e.rotation!==void 0&&s.rotation.fromArray(e.rotation),e.quaternion!==void 0&&s.quaternion.fromArray(e.quaternion),e.scale!==void 0&&s.scale.fromArray(e.scale)),e.up!==void 0&&s.up.fromArray(e.up),e.castShadow!==void 0&&(s.castShadow=e.castShadow),e.receiveShadow!==void 0&&(s.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(s.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(s.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(s.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(s.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(s.visible=e.visible),e.frustumCulled!==void 0&&(s.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(s.renderOrder=e.renderOrder),e.userData!==void 0&&(s.userData=e.userData),e.layers!==void 0&&(s.layers.mask=e.layers),e.children!==void 0){const f=e.children;for(let m=0;m"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,s=tu.get(e);if(s!==void 0){if(a.manager.itemStart(e),s.then){s.then(u=>{n&&n(u),a.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){n&&n(s),a.manager.itemEnd(e)},0),s}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const l=fetch(e,o).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(a.options,{colorSpaceConversion:"none"}))}).then(function(u){return tu.add(e,u),n&&n(u),a.manager.itemEnd(e),u}).catch(function(u){i&&i(u),tu.remove(e),a.manager.itemError(e),a.manager.itemEnd(e)});tu.add(e,l),a.manager.itemStart(e)}}let FE;class wD{static getContext(){return FE===void 0&&(FE=new(window.AudioContext||window.webkitAudioContext)),FE}static setContext(e){FE=e}}class lxe extends Zi{constructor(e){super(e)}load(e,n,r,i){const a=this,s=new ji(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(l){try{const u=l.slice(0);wD.getContext().decodeAudioData(u,function(d){n(d)}).catch(o)}catch(u){o(u)}},r,i);function o(l){i?i(l):console.error(l),a.manager.itemError(e)}}}const F5=new en,U5=new en,fd=new en;class uxe{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new qr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new qr,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,fd.copy(e.projectionMatrix);const i=n.eyeSep/2,a=i*n.near/n.focus,s=n.near*Math.tan(Jd*n.fov*.5)/n.zoom;let o,l;U5.elements[12]=-i,F5.elements[12]=i,o=-s*n.aspect+a,l=s*n.aspect+a,fd.elements[0]=2*n.near/(l-o),fd.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(fd),o=-s*n.aspect-a,l=s*n.aspect-a,fd.elements[0]=2*n.near/(l-o),fd.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(fd)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(U5),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(F5)}}class CD{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=z5(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const n=z5();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}function z5(){return performance.now()}const pd=new H,H5=new Mn,cxe=new H,hd=new H;class dxe extends _n{constructor(){super(),this.type="AudioListener",this.context=wD.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new CD}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const n=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(pd,H5,cxe),hd.set(0,0,-1).applyQuaternion(H5),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(pd.x,i),n.positionY.linearRampToValueAtTime(pd.y,i),n.positionZ.linearRampToValueAtTime(pd.z,i),n.forwardX.linearRampToValueAtTime(hd.x,i),n.forwardY.linearRampToValueAtTime(hd.y,i),n.forwardZ.linearRampToValueAtTime(hd.z,i),n.upX.linearRampToValueAtTime(r.x,i),n.upY.linearRampToValueAtTime(r.y,i),n.upZ.linearRampToValueAtTime(r.z,i)}else n.setPosition(pd.x,pd.y,pd.z),n.setOrientation(hd.x,hd.y,hd.z,r.x,r.y,r.z)}}class cX extends _n{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,n=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e0&&this._mixBufferRegionAdditive(r,i,this._addIndex*n,1,n);for(let l=n,u=n+n;l!==u;++l)if(r[l]!==r[l+n]){o.setValue(r,i);break}}saveOriginalState(){const e=this.binding,n=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(n,i);for(let a=r,s=i;a!==s;++a)n[a]=n[i+a%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,n=e+this.valueSize;for(let r=e;r=.5)for(let s=0;s!==a;++s)e[n+s]=e[r+s]}_slerp(e,n,r,i){Mn.slerpFlat(e,n,e,n,e,r,i)}_slerpAdditive(e,n,r,i,a){const s=this._workIndex*a;Mn.multiplyQuaternionsFlat(e,s,e,n,e,r),Mn.slerpFlat(e,n,e,n,e,s,i)}_lerp(e,n,r,i,a){const s=1-i;for(let o=0;o!==a;++o){const l=n+o;e[l]=e[l]*s+e[r+o]*i}}_lerpAdditive(e,n,r,i,a){for(let s=0;s!==a;++s){const o=n+s;e[o]=e[o]+e[r+s]*i}}}const RD="\\[\\]\\.:\\/",mxe=new RegExp("["+RD+"]","g"),ID="[^"+RD+"]",gxe="[^"+RD.replace("\\.","")+"]",bxe=/((?:WC+[\/:])*)/.source.replace("WC",ID),yxe=/(WCOD+)?/.source.replace("WCOD",gxe),vxe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ID),Exe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ID),Sxe=new RegExp("^"+bxe+yxe+vxe+Exe+"$"),_xe=["material","materials","bones","map"];class Axe{constructor(e,n,r){const i=r||Vn.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,a=r.length;i!==a;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class Vn{constructor(e,n,r){this.path=n,this.parsedPath=r||Vn.parseTrackName(n),this.node=Vn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new Vn.Composite(e,n,r):new Vn(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(mxe,"")}static parseTrackName(e){const n=Sxe.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const a=r.nodeName.substring(i+1);_xe.indexOf(a)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=a)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(a){for(let s=0;s=a){const d=a++,f=e[d];n[f.uuid]=c,e[c]=f,n[u]=d,e[d]=l;for(let m=0,g=i;m!==g;++m){const y=r[m],v=y[d],b=y[c];y[c]=v,y[d]=b}}}this.nCachedObjects_=a}uncache(){const e=this._objects,n=this._indicesByUUID,r=this._bindings,i=r.length;let a=this.nCachedObjects_,s=e.length;for(let o=0,l=arguments.length;o!==l;++o){const u=arguments[o],c=u.uuid,d=n[c];if(d!==void 0)if(delete n[c],d0&&(n[m.uuid]=d),e[d]=m,e.pop();for(let g=0,y=i;g!==y;++g){const v=r[g];v[d]=v[f],v.pop()}}}this.nCachedObjects_=a}subscribe_(e,n){const r=this._bindingsIndicesByPath;let i=r[e];const a=this._bindings;if(i!==void 0)return a[i];const s=this._paths,o=this._parsedPaths,l=this._objects,u=l.length,c=this.nCachedObjects_,d=new Array(u);i=a.length,r[e]=i,s.push(e),o.push(n),a.push(d);for(let f=c,m=l.length;f!==m;++f){const g=l[f];d[f]=new Vn(g,e,n)}return d}unsubscribe_(e){const n=this._bindingsIndicesByPath,r=n[e];if(r!==void 0){const i=this._paths,a=this._parsedPaths,s=this._bindings,o=s.length-1,l=s[o],u=e[o];n[u]=r,s[r]=l,s.pop(),a[r]=a[o],a.pop(),i[r]=i[o],i.pop()}}}class fX{constructor(e,n,r=null,i=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=r,this.blendMode=i;const a=n.tracks,s=a.length,o=new Array(s),l={endingStart:Bd,endingEnd:Bd};for(let u=0;u!==s;++u){const c=a[u].createInterpolant(null);o[u]=c,c.settings=l}this._interpolantSettings=l,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=nq,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,n){return this.loop=e,this.repetitions=n,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,n,r){if(e.fadeOut(n),this.fadeIn(n),r){const i=this._clip.duration,a=e._clip.duration,s=a/i,o=i/a;e.warp(1,s,n),this.warp(o,1,n)}return this}crossFadeTo(e,n,r){return e.crossFadeFrom(this,n,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,n,r){const i=this._mixer,a=i.time,s=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);const l=o.parameterPositions,u=o.sampleValues;return l[0]=a,l[1]=a+r,u[0]=e/s,u[1]=n/s,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,n,r,i){if(!this.enabled){this._updateWeight(e);return}const a=this._startTime;if(a!==null){const l=(e-a)*r;l<0||r===0?n=0:(this._startTime=null,n=r*l)}n*=this._updateTimeScale(e);const s=this._updateTime(n),o=this._updateWeight(e);if(o>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case XO:for(let c=0,d=l.length;c!==d;++c)l[c].evaluate(s),u[c].accumulateAdditive(o);break;case KT:default:for(let c=0,d=l.length;c!==d;++c)l[c].evaluate(s),u[c].accumulate(i,o)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,r=this.loop;let i=this.time+e,a=this._loopCount;const s=r===rq;if(e===0)return a===-1?i:s&&(a&1)===1?n-i:i;if(r===tq){a===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=n)i=n;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(a===-1&&(e>=0?(a=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),i>=n||i<0){const o=Math.floor(i/n);i-=n*o,a+=Math.abs(o);const l=this.repetitions-a;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?n:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const u=e<0;this._setEndings(u,!u,s)}else this._setEndings(!1,!1,s);this._loopCount=a,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=i;if(s&&(a&1)===1)return n-i}return i}_setEndings(e,n,r){const i=this._interpolantSettings;r?(i.endingStart=Fd,i.endingEnd=Fd):(e?i.endingStart=this.zeroSlopeAtStart?Fd:Bd:i.endingStart=Sb,n?i.endingEnd=this.zeroSlopeAtEnd?Fd:Bd:i.endingEnd=Sb)}_scheduleFading(e,n,r){const i=this._mixer,a=i.time;let s=this._weightInterpolant;s===null&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,l=s.sampleValues;return o[0]=a,l[0]=n,o[1]=a+e,l[1]=r,this}}const xxe=new Float32Array(1);class wxe extends No{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const r=e._localRoot||this._root,i=e._clip.tracks,a=i.length,s=e._propertyBindings,o=e._interpolants,l=r.uuid,u=this._bindingsByRootAndName;let c=u[l];c===void 0&&(c={},u[l]=c);for(let d=0;d!==a;++d){const f=i[d],m=f.name;let g=c[m];if(g!==void 0)++g.referenceCount,s[d]=g;else{if(g=s[d],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,m));continue}const y=n&&n._propertyBindings[d].binding.parsedPath;g=new dX(Vn.create(r,m,y),f.ValueTypeName,f.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,m),s[d]=g}o[d].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,a=this._actionsByClip[i];this._bindAction(e,a&&a.knownActions[0]),this._addInactiveAction(e,i,r)}const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const a=n[r];a.useCount++===0&&(this._lendBinding(a),a.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const a=n[r];--a.useCount===0&&(a.restoreOriginalState(),this._takeBackBinding(a))}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 n=e._cacheIndex;return n!==null&&n=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const n=this._actions,r=this._nActiveActions,i=this.time+=e,a=Math.sign(e),s=this._accuIndex^=1;for(let u=0;u!==r;++u)n[u]._update(i,e,a,s);const o=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)o[u].apply(s);return this}setTime(e){this.time=0;for(let n=0;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,W5).distanceTo(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}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 j5=new H,UE=new H;class Dxe{constructor(e=new H,n=new H){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),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,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){j5.subVectors(e,this.start),UE.subVectors(this.end,this.start);const r=UE.dot(UE);let a=UE.dot(j5)/r;return n&&(a=Yr(a,0,1)),a}closestPointToPoint(e,n,r){const i=this.closestPointToPointParameter(e,n);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 Y5=new H;class Lxe extends _n{constructor(e,n){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const r=new fn,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 s=0,o=1,l=32;s1)for(let d=0;d.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Q5.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(Q5,n)}}setLength(e,n=e*.2,r=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(r,n,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 jxe extends Oo{constructor(e=1){const n=[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 fn;i.setAttribute("position",new qt(n,3)),i.setAttribute("color",new qt(r,3));const a=new Ki({vertexColors:!0,toneMapped:!1});super(i,a),this.type="AxesHelper"}setColors(e,n,r){const i=new vt,a=this.geometry.attributes.color.array;return i.set(e),i.toArray(a,0),i.toArray(a,3),i.set(n),i.toArray(a,6),i.toArray(a,9),i.set(r),i.toArray(a,12),i.toArray(a,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Yxe{constructor(){this.type="ShapePath",this.color=new vt,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new xb,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,r,i){return this.currentPath.quadraticCurveTo(e,n,r,i),this}bezierCurveTo(e,n,r,i,a,s){return this.currentPath.bezierCurveTo(e,n,r,i,a,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(b){const E=[];for(let S=0,A=b.length;SNumber.EPSILON){if(M<0&&(R=E[T],N=-N,O=E[I],M=-M),b.yO.y)continue;if(b.y===R.y){if(b.x===R.x)return!0}else{const B=M*(b.x-R.x)-N*(b.y-R.y);if(B===0)return!0;if(B<0)continue;A=!A}}else{if(b.y!==R.y)continue;if(O.x<=b.x&&b.x<=R.x||R.x<=b.x&&b.x<=O.x)return!0}}return A}const i=hl.isClockWise,a=this.subPaths;if(a.length===0)return[];let s,o,l;const u=[];if(a.length===1)return o=a[0],l=new tf,l.curves=o.curves,u.push(l),u;let c=!i(a[0].getPoints());c=e?!c:c;const d=[],f=[];let m=[],g=0,y;f[g]=void 0,m[g]=[];for(let b=0,E=a.length;b1){let b=!1,E=0;for(let S=0,A=f.length;S0&&b===!1&&(m=d)}let v;for(let b=0,E=f.length;b=0&&(A[Ye]=null,_[Ye].disconnect(Fe))}for(let ke=0;ke=A.length){A.push(Fe),Ye=Gt;break}else if(A[Gt]===null){A[Gt]=Fe,Ye=Gt;break}if(Ye===-1)break}const gt=_[Ye];gt&>.connect(Fe)}}const ae=new H,ee=new H;function F(j,ke,Fe){ae.setFromMatrixPosition(ke.matrixWorld),ee.setFromMatrixPosition(Fe.matrixWorld);const Ye=ae.distanceTo(ee),gt=ke.projectionMatrix.elements,Gt=Fe.projectionMatrix.elements,Ut=gt[14]/(gt[10]-1),Mt=gt[14]/(gt[10]+1),$e=(gt[9]+1)/gt[5],qe=(gt[9]-1)/gt[5],re=(gt[8]-1)/gt[0],At=(Gt[8]+1)/Gt[0],Je=Ut*re,xt=Ut*At,ot=Ye/(-re+At),Vt=ot*-re;if(ke.matrixWorld.decompose(j.position,j.quaternion,j.scale),j.translateX(Vt),j.translateZ(ot),j.matrixWorld.compose(j.position,j.quaternion,j.scale),j.matrixWorldInverse.copy(j.matrixWorld).invert(),gt[10]===-1)j.projectionMatrix.copy(ke.projectionMatrix),j.projectionMatrixInverse.copy(ke.projectionMatrixInverse);else{const yt=Ut+ot,q=Mt+ot,U=Je-Vt,ue=xt+(Ye-Vt),_e=$e*Mt/q*yt,Ge=qe*Mt/q*yt;j.projectionMatrix.makePerspective(U,ue,_e,Ge,yt,q),j.projectionMatrixInverse.copy(j.projectionMatrix).invert()}}function ie(j,ke){ke===null?j.matrixWorld.copy(j.matrix):j.matrixWorld.multiplyMatrices(ke.matrixWorld,j.matrix),j.matrixWorldInverse.copy(j.matrixWorld).invert()}this.updateCamera=function(j){if(i===null)return;let ke=j.near,Fe=j.far;y.texture!==null&&(y.depthNear>0&&(ke=y.depthNear),y.depthFar>0&&(Fe=y.depthFar)),M.near=O.near=R.near=ke,M.far=O.far=R.far=Fe,(B!==M.near||G!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),B=M.near,G=M.far),R.layers.mask=j.layers.mask|2,O.layers.mask=j.layers.mask|4,M.layers.mask=R.layers.mask|O.layers.mask;const Ye=j.parent,gt=M.cameras;ie(M,Ye);for(let Gt=0;Gt0&&(v.alphaTest.value=b.alphaTest);const E=e.get(b),_=E.envMap,A=E.envMapRotation;_&&(v.envMap.value=_,ud.copy(A),ud.x*=-1,ud.y*=-1,ud.z*=-1,_.isCubeTexture&&_.isRenderTargetTexture===!1&&(ud.y*=-1,ud.z*=-1),v.envMapRotation.value.setFromMatrix4(axe.makeRotationFromEuler(ud)),v.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,v.reflectivity.value=b.reflectivity,v.ior.value=b.ior,v.refractionRatio.value=b.refractionRatio),b.lightMap&&(v.lightMap.value=b.lightMap,v.lightMapIntensity.value=b.lightMapIntensity,n(b.lightMap,v.lightMapTransform)),b.aoMap&&(v.aoMap.value=b.aoMap,v.aoMapIntensity.value=b.aoMapIntensity,n(b.aoMap,v.aoMapTransform))}function s(v,b){v.diffuse.value.copy(b.color),v.opacity.value=b.opacity,b.map&&(v.map.value=b.map,n(b.map,v.mapTransform))}function o(v,b){v.dashSize.value=b.dashSize,v.totalSize.value=b.dashSize+b.gapSize,v.scale.value=b.scale}function l(v,b,E,_){v.diffuse.value.copy(b.color),v.opacity.value=b.opacity,v.size.value=b.size*E,v.scale.value=_*.5,b.map&&(v.map.value=b.map,n(b.map,v.uvTransform)),b.alphaMap&&(v.alphaMap.value=b.alphaMap,n(b.alphaMap,v.alphaMapTransform)),b.alphaTest>0&&(v.alphaTest.value=b.alphaTest)}function u(v,b){v.diffuse.value.copy(b.color),v.opacity.value=b.opacity,v.rotation.value=b.rotation,b.map&&(v.map.value=b.map,n(b.map,v.mapTransform)),b.alphaMap&&(v.alphaMap.value=b.alphaMap,n(b.alphaMap,v.alphaMapTransform)),b.alphaTest>0&&(v.alphaTest.value=b.alphaTest)}function c(v,b){v.specular.value.copy(b.specular),v.shininess.value=Math.max(b.shininess,1e-4)}function d(v,b){b.gradientMap&&(v.gradientMap.value=b.gradientMap)}function f(v,b){v.metalness.value=b.metalness,b.metalnessMap&&(v.metalnessMap.value=b.metalnessMap,n(b.metalnessMap,v.metalnessMapTransform)),v.roughness.value=b.roughness,b.roughnessMap&&(v.roughnessMap.value=b.roughnessMap,n(b.roughnessMap,v.roughnessMapTransform)),b.envMap&&(v.envMapIntensity.value=b.envMapIntensity)}function m(v,b,E){v.ior.value=b.ior,b.sheen>0&&(v.sheenColor.value.copy(b.sheenColor).multiplyScalar(b.sheen),v.sheenRoughness.value=b.sheenRoughness,b.sheenColorMap&&(v.sheenColorMap.value=b.sheenColorMap,n(b.sheenColorMap,v.sheenColorMapTransform)),b.sheenRoughnessMap&&(v.sheenRoughnessMap.value=b.sheenRoughnessMap,n(b.sheenRoughnessMap,v.sheenRoughnessMapTransform))),b.clearcoat>0&&(v.clearcoat.value=b.clearcoat,v.clearcoatRoughness.value=b.clearcoatRoughness,b.clearcoatMap&&(v.clearcoatMap.value=b.clearcoatMap,n(b.clearcoatMap,v.clearcoatMapTransform)),b.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=b.clearcoatRoughnessMap,n(b.clearcoatRoughnessMap,v.clearcoatRoughnessMapTransform)),b.clearcoatNormalMap&&(v.clearcoatNormalMap.value=b.clearcoatNormalMap,n(b.clearcoatNormalMap,v.clearcoatNormalMapTransform),v.clearcoatNormalScale.value.copy(b.clearcoatNormalScale),b.side===ka&&v.clearcoatNormalScale.value.negate())),b.dispersion>0&&(v.dispersion.value=b.dispersion),b.iridescence>0&&(v.iridescence.value=b.iridescence,v.iridescenceIOR.value=b.iridescenceIOR,v.iridescenceThicknessMinimum.value=b.iridescenceThicknessRange[0],v.iridescenceThicknessMaximum.value=b.iridescenceThicknessRange[1],b.iridescenceMap&&(v.iridescenceMap.value=b.iridescenceMap,n(b.iridescenceMap,v.iridescenceMapTransform)),b.iridescenceThicknessMap&&(v.iridescenceThicknessMap.value=b.iridescenceThicknessMap,n(b.iridescenceThicknessMap,v.iridescenceThicknessMapTransform))),b.transmission>0&&(v.transmission.value=b.transmission,v.transmissionSamplerMap.value=E.texture,v.transmissionSamplerSize.value.set(E.width,E.height),b.transmissionMap&&(v.transmissionMap.value=b.transmissionMap,n(b.transmissionMap,v.transmissionMapTransform)),v.thickness.value=b.thickness,b.thicknessMap&&(v.thicknessMap.value=b.thicknessMap,n(b.thicknessMap,v.thicknessMapTransform)),v.attenuationDistance.value=b.attenuationDistance,v.attenuationColor.value.copy(b.attenuationColor)),b.anisotropy>0&&(v.anisotropyVector.value.set(b.anisotropy*Math.cos(b.anisotropyRotation),b.anisotropy*Math.sin(b.anisotropyRotation)),b.anisotropyMap&&(v.anisotropyMap.value=b.anisotropyMap,n(b.anisotropyMap,v.anisotropyMapTransform))),v.specularIntensity.value=b.specularIntensity,v.specularColor.value.copy(b.specularColor),b.specularColorMap&&(v.specularColorMap.value=b.specularColorMap,n(b.specularColorMap,v.specularColorMapTransform)),b.specularIntensityMap&&(v.specularIntensityMap.value=b.specularIntensityMap,n(b.specularIntensityMap,v.specularIntensityMapTransform))}function g(v,b){b.matcap&&(v.matcap.value=b.matcap)}function y(v,b){const E=e.get(b).light;v.referencePosition.value.setFromMatrixPosition(E.matrixWorld),v.nearDistance.value=E.shadow.camera.near,v.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function oxe(t,e,n,r){let i={},a={},s=[];const o=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(E,_){const A=_.program;r.uniformBlockBinding(E,A)}function u(E,_){let A=i[E.id];A===void 0&&(g(E),A=c(E),i[E.id]=A,E.addEventListener("dispose",v));const I=_.program;r.updateUBOMapping(E,I);const x=e.render.frame;a[E.id]!==x&&(f(E),a[E.id]=x)}function c(E){const _=d();E.__bindingPointIndex=_;const A=t.createBuffer(),I=E.__size,x=E.usage;return t.bindBuffer(t.UNIFORM_BUFFER,A),t.bufferData(t.UNIFORM_BUFFER,I,x),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,_,A),A}function d(){for(let E=0;E0&&(A+=I-x),E.__size=A,E.__cache={},this}function y(E){const _={boundary:0,storage:0};return typeof E=="number"||typeof E=="boolean"?(_.boundary=4,_.storage=4):E.isVector2?(_.boundary=8,_.storage=8):E.isVector3||E.isColor?(_.boundary=16,_.storage=12):E.isVector4?(_.boundary=16,_.storage=16):E.isMatrix3?(_.boundary=48,_.storage=48):E.isMatrix4?(_.boundary=64,_.storage=64):E.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",E),_}function v(E){const _=E.target;_.removeEventListener("dispose",v);const A=s.indexOf(_.__bindingPointIndex);s.splice(A,1),t.deleteBuffer(i[_.id]),delete i[_.id],delete a[_.id]}function b(){for(const E in i)t.deleteBuffer(i[E]);s=[],i={},a={}}return{bind:l,update:u,dispose:b}}class aD{constructor(e={}){const{canvas:n=gq(),context:r=null,depth:i=!0,stencil:a=!1,alpha:s=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:f=!1}=e;this.isWebGLRenderer=!0;let m;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");m=r.getContextAttributes().alpha}else m=s;const g=new Uint32Array(4),y=new Int32Array(4);let v=null,b=null;const E=[],_=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Ia,this.toneMapping=fl,this.toneMappingExposure=1;const A=this;let I=!1,x=0,R=0,O=null,N=-1,M=null;const B=new Yn,G=new Yn;let W=null;const K=new vt(0);let se=0,ae=n.width,ee=n.height,F=1,ie=null,J=null;const fe=new Yn(0,0,ae,ee),Ce=new Yn(0,0,ae,ee);let Le=!1;const j=new iy;let ke=!1,Fe=!1;const Ye=new en,gt=new en,Gt=new H,Ut=new Yn,Mt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let $e=!1;function qe(){return O===null?F:1}let re=r;function At(L,X){return n.getContext(L,X)}try{const L={alpha:!0,depth:i,stencil:a,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Of}`),n.addEventListener("webglcontextlost",Xe,!1),n.addEventListener("webglcontextrestored",_t,!1),n.addEventListener("webglcontextcreationerror",St,!1),re===null){const X="webgl2";if(re=At(X,L),re===null)throw At(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(L){throw console.error("THREE.WebGLRenderer: "+L.message),L}let Je,xt,ot,Vt,yt,q,U,ue,_e,Ge,Pe,ft,nt,ht,tn,tt,Et,zt,Dt,bt,me,De,rt,ge;function Te(){Je=new pSe(re),Je.init(),De=new Cq(re,Je),xt=new oSe(re,Je,e,De),ot=new YAe(re,Je),xt.reverseDepthBuffer&&f&&ot.buffers.depth.setReversed(!0),Vt=new gSe(re),yt=new LAe,q=new JAe(re,Je,ot,yt,xt,De,Vt),U=new uSe(A),ue=new fSe(A),_e=new Ave(re),rt=new aSe(re,_e),Ge=new hSe(re,_e,Vt,rt),Pe=new ySe(re,Ge,_e,Vt),Dt=new bSe(re,xt,q),tt=new lSe(yt),ft=new DAe(A,U,ue,Je,xt,rt,tt),nt=new sxe(A,yt),ht=new PAe,tn=new GAe(Je),zt=new iSe(A,U,ue,ot,Pe,m,l),Et=new WAe(A,Pe,xt),ge=new oxe(re,Vt,xt,ot),bt=new sSe(re,Je,Vt),me=new mSe(re,Je,Vt),Vt.programs=ft.programs,A.capabilities=xt,A.extensions=Je,A.properties=yt,A.renderLists=ht,A.shadowMap=Et,A.state=ot,A.info=Vt}Te();const Me=new ixe(A,re);this.xr=Me,this.getContext=function(){return re},this.getContextAttributes=function(){return re.getContextAttributes()},this.forceContextLoss=function(){const L=Je.get("WEBGL_lose_context");L&&L.loseContext()},this.forceContextRestore=function(){const L=Je.get("WEBGL_lose_context");L&&L.restoreContext()},this.getPixelRatio=function(){return F},this.setPixelRatio=function(L){L!==void 0&&(F=L,this.setSize(ae,ee,!1))},this.getSize=function(L){return L.set(ae,ee)},this.setSize=function(L,X,le=!0){if(Me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}ae=L,ee=X,n.width=Math.floor(L*F),n.height=Math.floor(X*F),le===!0&&(n.style.width=L+"px",n.style.height=X+"px"),this.setViewport(0,0,L,X)},this.getDrawingBufferSize=function(L){return L.set(ae*F,ee*F).floor()},this.setDrawingBufferSize=function(L,X,le){ae=L,ee=X,F=le,n.width=Math.floor(L*le),n.height=Math.floor(X*le),this.setViewport(0,0,L,X)},this.getCurrentViewport=function(L){return L.copy(B)},this.getViewport=function(L){return L.copy(fe)},this.setViewport=function(L,X,le,de){L.isVector4?fe.set(L.x,L.y,L.z,L.w):fe.set(L,X,le,de),ot.viewport(B.copy(fe).multiplyScalar(F).round())},this.getScissor=function(L){return L.copy(Ce)},this.setScissor=function(L,X,le,de){L.isVector4?Ce.set(L.x,L.y,L.z,L.w):Ce.set(L,X,le,de),ot.scissor(G.copy(Ce).multiplyScalar(F).round())},this.getScissorTest=function(){return Le},this.setScissorTest=function(L){ot.setScissorTest(Le=L)},this.setOpaqueSort=function(L){ie=L},this.setTransparentSort=function(L){J=L},this.getClearColor=function(L){return L.copy(zt.getClearColor())},this.setClearColor=function(){zt.setClearColor.apply(zt,arguments)},this.getClearAlpha=function(){return zt.getClearAlpha()},this.setClearAlpha=function(){zt.setClearAlpha.apply(zt,arguments)},this.clear=function(L=!0,X=!0,le=!0){let de=0;if(L){let Q=!1;if(O!==null){const Ee=O.texture.format;Q=Ee===Xx||Ee===qx||Ee===ey}if(Q){const Ee=O.texture.type,we=Ee===as||Ee===yl||Ee===Xh||Ee===gf||Ee===jx||Ee===Yx,at=zt.getClearColor(),Ve=zt.getClearAlpha(),Qe=at.r,lt=at.g,Ue=at.b;we?(g[0]=Qe,g[1]=lt,g[2]=Ue,g[3]=Ve,re.clearBufferuiv(re.COLOR,0,g)):(y[0]=Qe,y[1]=lt,y[2]=Ue,y[3]=Ve,re.clearBufferiv(re.COLOR,0,y))}else de|=re.COLOR_BUFFER_BIT}X&&(de|=re.DEPTH_BUFFER_BIT),le&&(de|=re.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),re.clear(de)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",Xe,!1),n.removeEventListener("webglcontextrestored",_t,!1),n.removeEventListener("webglcontextcreationerror",St,!1),ht.dispose(),tn.dispose(),yt.dispose(),U.dispose(),ue.dispose(),Pe.dispose(),rt.dispose(),ge.dispose(),ft.dispose(),Me.dispose(),Me.removeEventListener("sessionstart",Se),Me.removeEventListener("sessionend",Oe),Ze.stop()};function Xe(L){L.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function _t(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1;const L=Vt.autoReset,X=Et.enabled,le=Et.autoUpdate,de=Et.needsUpdate,Q=Et.type;Te(),Vt.autoReset=L,Et.enabled=X,Et.autoUpdate=le,Et.needsUpdate=de,Et.type=Q}function St(L){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",L.statusMessage)}function Xt(L){const X=L.target;X.removeEventListener("dispose",Xt),mn(X)}function mn(L){Hn(L),yt.remove(L)}function Hn(L){const X=yt.get(L).programs;X!==void 0&&(X.forEach(function(le){ft.releaseProgram(le)}),L.isShaderMaterial&&ft.releaseShaderCache(L))}this.renderBufferDirect=function(L,X,le,de,Q,Ee){X===null&&(X=Mt);const we=Q.isMesh&&Q.matrixWorld.determinant()<0,at=oe(L,X,le,de,Q);ot.setMaterial(de,we);let Ve=le.index,Qe=1;if(de.wireframe===!0){if(Ve=Ge.getWireframeAttribute(le),Ve===void 0)return;Qe=2}const lt=le.drawRange,Ue=le.attributes.position;let ct=lt.start*Qe,Bt=(lt.start+lt.count)*Qe;Ee!==null&&(ct=Math.max(ct,Ee.start*Qe),Bt=Math.min(Bt,(Ee.start+Ee.count)*Qe)),Ve!==null?(ct=Math.max(ct,0),Bt=Math.min(Bt,Ve.count)):Ue!=null&&(ct=Math.max(ct,0),Bt=Math.min(Bt,Ue.count));const wt=Bt-ct;if(wt<0||wt===1/0)return;rt.setup(Q,de,at,le,Ve);let Tt,Nt=bt;if(Ve!==null&&(Tt=_e.get(Ve),Nt=me,Nt.setIndex(Tt)),Q.isMesh)de.wireframe===!0?(ot.setLineWidth(de.wireframeLinewidth*qe()),Nt.setMode(re.LINES)):Nt.setMode(re.TRIANGLES);else if(Q.isLine){let pt=de.linewidth;pt===void 0&&(pt=1),ot.setLineWidth(pt*qe()),Q.isLineSegments?Nt.setMode(re.LINES):Q.isLineLoop?Nt.setMode(re.LINE_LOOP):Nt.setMode(re.LINE_STRIP)}else Q.isPoints?Nt.setMode(re.POINTS):Q.isSprite&&Nt.setMode(re.TRIANGLES);if(Q.isBatchedMesh)if(Q._multiDrawInstances!==null)Nt.renderMultiDrawInstances(Q._multiDrawStarts,Q._multiDrawCounts,Q._multiDrawCount,Q._multiDrawInstances);else if(Je.get("WEBGL_multi_draw"))Nt.renderMultiDraw(Q._multiDrawStarts,Q._multiDrawCounts,Q._multiDrawCount);else{const pt=Q._multiDrawStarts,nn=Q._multiDrawCounts,Zt=Q._multiDrawCount,ir=Ve?_e.get(Ve).bytesPerElement:1,ar=yt.get(de).currentProgram.getUniforms();for(let Wn=0;Wn{function Ee(){if(de.forEach(function(we){yt.get(we).currentProgram.isReady()&&de.delete(we)}),de.size===0){Q(L);return}setTimeout(Ee,10)}Je.get("KHR_parallel_shader_compile")!==null?Ee():setTimeout(Ee,10)})};let Gn=null;function he(L){Gn&&Gn(L)}function Se(){Ze.stop()}function Oe(){Ze.start()}const Ze=new Sq;Ze.setAnimationLoop(he),typeof self<"u"&&Ze.setContext(self),this.setAnimationLoop=function(L){Gn=L,Me.setAnimationLoop(L),L===null?Ze.stop():Ze.start()},Me.addEventListener("sessionstart",Se),Me.addEventListener("sessionend",Oe),this.render=function(L,X){if(X!==void 0&&X.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;if(L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),Me.enabled===!0&&Me.isPresenting===!0&&(Me.cameraAutoUpdate===!0&&Me.updateCamera(X),X=Me.getCamera()),L.isScene===!0&&L.onBeforeRender(A,L,X,O),b=tn.get(L,_.length),b.init(X),_.push(b),gt.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),j.setFromProjectionMatrix(gt),Fe=this.localClippingEnabled,ke=tt.init(this.clippingPlanes,Fe),v=ht.get(L,E.length),v.init(),E.push(v),Me.enabled===!0&&Me.isPresenting===!0){const Ee=A.xr.getDepthSensingMesh();Ee!==null&&Ct(Ee,X,-1/0,A.sortObjects)}Ct(L,X,0,A.sortObjects),v.finish(),A.sortObjects===!0&&v.sort(ie,J),$e=Me.enabled===!1||Me.isPresenting===!1||Me.hasDepthSensing()===!1,$e&&zt.addToRenderList(v,L),this.info.render.frame++,ke===!0&&tt.beginShadows();const le=b.state.shadowsArray;Et.render(le,L,X),ke===!0&&tt.endShadows(),this.info.autoReset===!0&&this.info.reset();const de=v.opaque,Q=v.transmissive;if(b.setupLights(),X.isArrayCamera){const Ee=X.cameras;if(Q.length>0)for(let we=0,at=Ee.length;we0&&Kt(de,Q,L,X),$e&&zt.render(L),kt(v,L,X);O!==null&&(q.updateMultisampleRenderTarget(O),q.updateRenderTargetMipmap(O)),L.isScene===!0&&L.onAfterRender(A,L,X),rt.resetDefaultState(),N=-1,M=null,_.pop(),_.length>0?(b=_[_.length-1],ke===!0&&tt.setGlobalState(A.clippingPlanes,b.state.camera)):b=null,E.pop(),E.length>0?v=E[E.length-1]:v=null};function Ct(L,X,le,de){if(L.visible===!1)return;if(L.layers.test(X.layers)){if(L.isGroup)le=L.renderOrder;else if(L.isLOD)L.autoUpdate===!0&&L.update(X);else if(L.isLight)b.pushLight(L),L.castShadow&&b.pushShadow(L);else if(L.isSprite){if(!L.frustumCulled||j.intersectsSprite(L)){de&&Ut.setFromMatrixPosition(L.matrixWorld).applyMatrix4(gt);const we=Pe.update(L),at=L.material;at.visible&&v.push(L,we,at,le,Ut.z,null)}}else if((L.isMesh||L.isLine||L.isPoints)&&(!L.frustumCulled||j.intersectsObject(L))){const we=Pe.update(L),at=L.material;if(de&&(L.boundingSphere!==void 0?(L.boundingSphere===null&&L.computeBoundingSphere(),Ut.copy(L.boundingSphere.center)):(we.boundingSphere===null&&we.computeBoundingSphere(),Ut.copy(we.boundingSphere.center)),Ut.applyMatrix4(L.matrixWorld).applyMatrix4(gt)),Array.isArray(at)){const Ve=we.groups;for(let Qe=0,lt=Ve.length;Qe0&&et(Q,X,le),Ee.length>0&&et(Ee,X,le),we.length>0&&et(we,X,le),ot.buffers.depth.setTest(!0),ot.buffers.depth.setMask(!0),ot.buffers.color.setMask(!0),ot.setPolygonOffset(!1)}function Kt(L,X,le,de){if((le.isScene===!0?le.overrideMaterial:null)!==null)return;b.state.transmissionRenderTarget[de.id]===void 0&&(b.state.transmissionRenderTarget[de.id]=new ki(1,1,{generateMipmaps:!0,type:Je.has("EXT_color_buffer_half_float")||Je.has("EXT_color_buffer_float")?fi:as,minFilter:Js,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Un.workingColorSpace}));const Ee=b.state.transmissionRenderTarget[de.id],we=de.viewport||B;Ee.setSize(we.z,we.w);const at=A.getRenderTarget();A.setRenderTarget(Ee),A.getClearColor(K),se=A.getClearAlpha(),se<1&&A.setClearColor(16777215,.5),A.clear(),$e&&zt.render(le);const Ve=A.toneMapping;A.toneMapping=fl;const Qe=de.viewport;if(de.viewport!==void 0&&(de.viewport=void 0),b.setupLightsView(de),ke===!0&&tt.setGlobalState(A.clippingPlanes,de),et(L,le,de),q.updateMultisampleRenderTarget(Ee),q.updateRenderTargetMipmap(Ee),Je.has("WEBGL_multisampled_render_to_texture")===!1){let lt=!1;for(let Ue=0,ct=X.length;Ue0),Ue=!!le.morphAttributes.position,ct=!!le.morphAttributes.normal,Bt=!!le.morphAttributes.color;let wt=fl;de.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(wt=A.toneMapping);const Tt=le.morphAttributes.position||le.morphAttributes.normal||le.morphAttributes.color,Nt=Tt!==void 0?Tt.length:0,pt=yt.get(de),nn=b.state.lights;if(ke===!0&&(Fe===!0||L!==M)){const wn=L===M&&de.id===N;tt.setState(de,L,wn)}let Zt=!1;de.version===pt.__version?(pt.needsLights&&pt.lightsStateVersion!==nn.state.version||pt.outputColorSpace!==at||Q.isBatchedMesh&&pt.batching===!1||!Q.isBatchedMesh&&pt.batching===!0||Q.isBatchedMesh&&pt.batchingColor===!0&&Q.colorTexture===null||Q.isBatchedMesh&&pt.batchingColor===!1&&Q.colorTexture!==null||Q.isInstancedMesh&&pt.instancing===!1||!Q.isInstancedMesh&&pt.instancing===!0||Q.isSkinnedMesh&&pt.skinning===!1||!Q.isSkinnedMesh&&pt.skinning===!0||Q.isInstancedMesh&&pt.instancingColor===!0&&Q.instanceColor===null||Q.isInstancedMesh&&pt.instancingColor===!1&&Q.instanceColor!==null||Q.isInstancedMesh&&pt.instancingMorph===!0&&Q.morphTexture===null||Q.isInstancedMesh&&pt.instancingMorph===!1&&Q.morphTexture!==null||pt.envMap!==Ve||de.fog===!0&&pt.fog!==Ee||pt.numClippingPlanes!==void 0&&(pt.numClippingPlanes!==tt.numPlanes||pt.numIntersection!==tt.numIntersection)||pt.vertexAlphas!==Qe||pt.vertexTangents!==lt||pt.morphTargets!==Ue||pt.morphNormals!==ct||pt.morphColors!==Bt||pt.toneMapping!==wt||pt.morphTargetsCount!==Nt)&&(Zt=!0):(Zt=!0,pt.__version=de.version);let ir=pt.currentProgram;Zt===!0&&(ir=Rt(de,X,Q));let ar=!1,Wn=!1,Rn=!1;const un=ir.getUniforms(),hn=pt.uniforms;if(ot.useProgram(ir.program)&&(ar=!0,Wn=!0,Rn=!0),de.id!==N&&(N=de.id,Wn=!0),ar||M!==L){ot.buffers.depth.getReversed()?(Ye.copy(L.projectionMatrix),Xye(Ye),Kye(Ye),un.setValue(re,"projectionMatrix",Ye)):un.setValue(re,"projectionMatrix",L.projectionMatrix),un.setValue(re,"viewMatrix",L.matrixWorldInverse);const Kr=un.map.cameraPosition;Kr!==void 0&&Kr.setValue(re,Gt.setFromMatrixPosition(L.matrixWorld)),xt.logarithmicDepthBuffer&&un.setValue(re,"logDepthBufFC",2/(Math.log(L.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&un.setValue(re,"isOrthographic",L.isOrthographicCamera===!0),M!==L&&(M=L,Wn=!0,Rn=!0)}if(Q.isSkinnedMesh){un.setOptional(re,Q,"bindMatrix"),un.setOptional(re,Q,"bindMatrixInverse");const wn=Q.skeleton;wn&&(wn.boneTexture===null&&wn.computeBoneTexture(),un.setValue(re,"boneTexture",wn.boneTexture,q))}Q.isBatchedMesh&&(un.setOptional(re,Q,"batchingTexture"),un.setValue(re,"batchingTexture",Q._matricesTexture,q),un.setOptional(re,Q,"batchingIdTexture"),un.setValue(re,"batchingIdTexture",Q._indirectTexture,q),un.setOptional(re,Q,"batchingColorTexture"),Q._colorsTexture!==null&&un.setValue(re,"batchingColorTexture",Q._colorsTexture,q));const An=le.morphAttributes;if((An.position!==void 0||An.normal!==void 0||An.color!==void 0)&&Dt.update(Q,le,ir),(Wn||pt.receiveShadow!==Q.receiveShadow)&&(pt.receiveShadow=Q.receiveShadow,un.setValue(re,"receiveShadow",Q.receiveShadow)),de.isMeshGouraudMaterial&&de.envMap!==null&&(hn.envMap.value=Ve,hn.flipEnvMap.value=Ve.isCubeTexture&&Ve.isRenderTargetTexture===!1?-1:1),de.isMeshStandardMaterial&&de.envMap===null&&X.environment!==null&&(hn.envMapIntensity.value=X.environmentIntensity),Wn&&(un.setValue(re,"toneMappingExposure",A.toneMappingExposure),pt.needsLights&&xe(hn,Rn),Ee&&de.fog===!0&&nt.refreshFogUniforms(hn,Ee),nt.refreshMaterialUniforms(hn,de,F,ee,b.state.transmissionRenderTarget[L.id]),$_.upload(re,P(pt),hn,q)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&($_.upload(re,P(pt),hn,q),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&un.setValue(re,"center",Q.center),un.setValue(re,"modelViewMatrix",Q.modelViewMatrix),un.setValue(re,"normalMatrix",Q.normalMatrix),un.setValue(re,"modelMatrix",Q.matrixWorld),de.isShaderMaterial||de.isRawShaderMaterial){const wn=de.uniformsGroups;for(let Kr=0,hr=wn.length;Kr0&&q.useMultisampledRTT(L)===!1?Q=yt.get(L).__webglMultisampledFramebuffer:Array.isArray(lt)?Q=lt[le]:Q=lt,B.copy(L.viewport),G.copy(L.scissor),W=L.scissorTest}else B.copy(fe).multiplyScalar(F).floor(),G.copy(Ce).multiplyScalar(F).floor(),W=Le;if(ot.bindFramebuffer(re.FRAMEBUFFER,Q)&&de&&ot.drawBuffers(L,Q),ot.viewport(B),ot.scissor(G),ot.setScissorTest(W),Ee){const Ve=yt.get(L.texture);re.framebufferTexture2D(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_CUBE_MAP_POSITIVE_X+X,Ve.__webglTexture,le)}else if(we){const Ve=yt.get(L.texture),Qe=X||0;re.framebufferTextureLayer(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,Ve.__webglTexture,le||0,Qe)}N=-1},this.readRenderTargetPixels=function(L,X,le,de,Q,Ee,we){if(!(L&&L.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let at=yt.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&we!==void 0&&(at=at[we]),at){ot.bindFramebuffer(re.FRAMEBUFFER,at);try{const Ve=L.texture,Qe=Ve.format,lt=Ve.type;if(!xt.textureFormatReadable(Qe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!xt.textureTypeReadable(lt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}X>=0&&X<=L.width-de&&le>=0&&le<=L.height-Q&&re.readPixels(X,le,de,Q,De.convert(Qe),De.convert(lt),Ee)}finally{const Ve=O!==null?yt.get(O).__webglFramebuffer:null;ot.bindFramebuffer(re.FRAMEBUFFER,Ve)}}},this.readRenderTargetPixelsAsync=async function(L,X,le,de,Q,Ee,we){if(!(L&&L.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let at=yt.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&we!==void 0&&(at=at[we]),at){const Ve=L.texture,Qe=Ve.format,lt=Ve.type;if(!xt.textureFormatReadable(Qe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!xt.textureTypeReadable(lt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(X>=0&&X<=L.width-de&&le>=0&&le<=L.height-Q){ot.bindFramebuffer(re.FRAMEBUFFER,at);const Ue=re.createBuffer();re.bindBuffer(re.PIXEL_PACK_BUFFER,Ue),re.bufferData(re.PIXEL_PACK_BUFFER,Ee.byteLength,re.STREAM_READ),re.readPixels(X,le,de,Q,De.convert(Qe),De.convert(lt),0);const ct=O!==null?yt.get(O).__webglFramebuffer:null;ot.bindFramebuffer(re.FRAMEBUFFER,ct);const Bt=re.fenceSync(re.SYNC_GPU_COMMANDS_COMPLETE,0);return re.flush(),await qye(re,Bt,4),re.bindBuffer(re.PIXEL_PACK_BUFFER,Ue),re.getBufferSubData(re.PIXEL_PACK_BUFFER,0,Ee),re.deleteBuffer(Ue),re.deleteSync(Bt),Ee}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(L,X=null,le=0){L.isTexture!==!0&&(t0("WebGLRenderer: copyFramebufferToTexture function signature has changed."),X=arguments[0]||null,L=arguments[1]);const de=Math.pow(2,-le),Q=Math.floor(L.image.width*de),Ee=Math.floor(L.image.height*de),we=X!==null?X.x:0,at=X!==null?X.y:0;q.setTexture2D(L,0),re.copyTexSubImage2D(re.TEXTURE_2D,le,0,0,we,at,Q,Ee),ot.unbindTexture()},this.copyTextureToTexture=function(L,X,le=null,de=null,Q=0){L.isTexture!==!0&&(t0("WebGLRenderer: copyTextureToTexture function signature has changed."),de=arguments[0]||null,L=arguments[1],X=arguments[2],Q=arguments[3]||0,le=null);let Ee,we,at,Ve,Qe,lt,Ue,ct,Bt;const wt=L.isCompressedTexture?L.mipmaps[Q]:L.image;le!==null?(Ee=le.max.x-le.min.x,we=le.max.y-le.min.y,at=le.isBox3?le.max.z-le.min.z:1,Ve=le.min.x,Qe=le.min.y,lt=le.isBox3?le.min.z:0):(Ee=wt.width,we=wt.height,at=wt.depth||1,Ve=0,Qe=0,lt=0),de!==null?(Ue=de.x,ct=de.y,Bt=de.z):(Ue=0,ct=0,Bt=0);const Tt=De.convert(X.format),Nt=De.convert(X.type);let pt;X.isData3DTexture?(q.setTexture3D(X,0),pt=re.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(q.setTexture2DArray(X,0),pt=re.TEXTURE_2D_ARRAY):(q.setTexture2D(X,0),pt=re.TEXTURE_2D),re.pixelStorei(re.UNPACK_FLIP_Y_WEBGL,X.flipY),re.pixelStorei(re.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),re.pixelStorei(re.UNPACK_ALIGNMENT,X.unpackAlignment);const nn=re.getParameter(re.UNPACK_ROW_LENGTH),Zt=re.getParameter(re.UNPACK_IMAGE_HEIGHT),ir=re.getParameter(re.UNPACK_SKIP_PIXELS),ar=re.getParameter(re.UNPACK_SKIP_ROWS),Wn=re.getParameter(re.UNPACK_SKIP_IMAGES);re.pixelStorei(re.UNPACK_ROW_LENGTH,wt.width),re.pixelStorei(re.UNPACK_IMAGE_HEIGHT,wt.height),re.pixelStorei(re.UNPACK_SKIP_PIXELS,Ve),re.pixelStorei(re.UNPACK_SKIP_ROWS,Qe),re.pixelStorei(re.UNPACK_SKIP_IMAGES,lt);const Rn=L.isDataArrayTexture||L.isData3DTexture,un=X.isDataArrayTexture||X.isData3DTexture;if(L.isRenderTargetTexture||L.isDepthTexture){const hn=yt.get(L),An=yt.get(X),wn=yt.get(hn.__renderTarget),Kr=yt.get(An.__renderTarget);ot.bindFramebuffer(re.READ_FRAMEBUFFER,wn.__webglFramebuffer),ot.bindFramebuffer(re.DRAW_FRAMEBUFFER,Kr.__webglFramebuffer);for(let hr=0;hr0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}};class sy{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=Sb,this.updateRanges=[],this.version=0,this.uuid=_s()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}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,n,r){e*=this.stride,r*=n.stride;for(let i=0,a=this.stride;ie.far||n.push({distance:l,point:xg.clone(),uv:Ka.getInterpolation(xg,EE,wg,_E,u5,GC,c5,new Ke),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function SE(t,e,n,r,i,a){Ip.subVectors(t,n).addScalar(.5).multiply(r),i!==void 0?(Tg.x=a*Ip.x-i*Ip.y,Tg.y=i*Ip.x+a*Ip.y):Tg.copy(Ip),t.copy(e),t.x+=Tg.x,t.y+=Tg.y,t.applyMatrix4(Iq)}const AE=new H,d5=new H;class Nq extends Sn{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 n=e.levels;for(let r=0,i=n.length;r0){let r,i;for(r=1,i=n.length;r0){AE.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(AE);this.getObjectForDistance(i).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){AE.setFromMatrixPosition(e.matrixWorld),d5.setFromMatrixPosition(this.matrixWorld);const r=AE.distanceTo(d5)/e.zoom;n[0].object.visible=!0;let i,a;for(i=1,a=n.length;i=s)n[i-1].object.visible=!1,n[i].object.visible=!0;else break}for(this._currentLevel=i-1;i=a.length&&a.push({start:-1,count:-1,z:-1,index:-1});const o=a[this.index];s.push(o),this.index++,o.start=e,o.count=n,o.z=r,o.index=i}reset(){this.list.length=0,this.index=0}}const Ga=new en,hxe=new vt(1,1,1),jC=new iy,wE=new Di,cd=new Li,Ig=new H,E5=new H,mxe=new H,YC=new pxe,la=new Ot,CE=[];function gxe(t,e,n=0){const r=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const i=t.count;for(let a=0;a65535?new Uint32Array(i):new Uint16Array(i);n.setIndex(new Kn(a,1))}this._geometryInitialized=!0}}_validateGeometry(e){const n=this.geometry;if(!!e.getIndex()!=!!n.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in n.attributes){if(!e.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=e.getAttribute(r),a=n.getAttribute(r);if(i.itemSize!==a.itemSize||i.normalized!==a.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Di);const e=this.boundingBox,n=this._instanceInfo;e.makeEmpty();for(let r=0,i=n.length;r=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("BatchedMesh: Maximum item count reached.");const r={visible:!0,active:!0,geometryIndex:e};let i=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(WC),i=this._availableInstanceIds.shift(),this._instanceInfo[i]=r):(i=this._instanceInfo.length,this._instanceInfo.push(r));const a=this._matricesTexture;Ga.identity().toArray(a.image.data,i*16),a.needsUpdate=!0;const s=this._colorsTexture;return s&&(hxe.toArray(s.image.data,i*4),s.needsUpdate=!0),this._visibilityChanged=!0,i}addGeometry(e,n=-1,r=-1){this._initializeGeometry(e),this._validateGeometry(e);const i={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},a=this._geometryInfo;i.vertexStart=this._nextVertexStart,i.reservedVertexCount=n===-1?e.getAttribute("position").count:n;const s=e.getIndex();if(s!==null&&(i.indexStart=this._nextIndexStart,i.reservedIndexCount=r===-1?s.count:r),i.indexStart!==-1&&i.indexStart+i.reservedIndexCount>this._maxIndexCount||i.vertexStart+i.reservedVertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(WC),l=this._availableGeometryIds.shift(),a[l]=i):(l=this._geometryCount,this._geometryCount++,a.push(i)),this.setGeometryAt(l,e),this._nextIndexStart=i.indexStart+i.reservedIndexCount,this._nextVertexStart=i.vertexStart+i.reservedVertexCount,l}setGeometryAt(e,n){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(n);const r=this.geometry,i=r.getIndex()!==null,a=r.getIndex(),s=n.getIndex(),o=this._geometryInfo[e];if(i&&s.count>o.reservedIndexCount||n.attributes.position.count>o.reservedVertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,u=o.reservedVertexCount;o.vertexCount=n.getAttribute("position").count;for(const c in r.attributes){const d=n.getAttribute(c),f=r.getAttribute(c);gxe(d,f,l);const m=d.itemSize;for(let g=d.count,y=u;g=n.length||n[e].active===!1)return this;const r=this._instanceInfo;for(let i=0,a=r.length;i=n.length||n[e].active===!1?this:(n[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this)}optimize(){let e=0,n=0;const r=this._geometryInfo,i=r.map((s,o)=>o).sort((s,o)=>r[s].vertexStart-r[o].vertexStart),a=this.geometry;for(let s=0,o=r.length;s=this._geometryCount)return null;const r=this.geometry,i=this._geometryInfo[e];if(i.boundingBox===null){const a=new Di,s=r.index,o=r.attributes.position;for(let l=i.start,u=i.start+i.count;l=this._geometryCount)return null;const r=this.geometry,i=this._geometryInfo[e];if(i.boundingSphere===null){const a=new Li;this.getBoundingBoxAt(e,wE),wE.getCenter(a.center);const s=r.index,o=r.attributes.position;let l=0;for(let u=i.start,c=i.start+i.count;u=r.length||r[e].active===!1?this:(n.toArray(a,e*16),i.needsUpdate=!0,this)}getMatrixAt(e,n){const r=this._instanceInfo,i=this._matricesTexture.image.data;return e>=r.length||r[e].active===!1?null:n.fromArray(i,e*16)}setColorAt(e,n){this._colorsTexture===null&&this._initColorsTexture();const r=this._colorsTexture,i=this._colorsTexture.image.data,a=this._instanceInfo;return e>=a.length||a[e].active===!1?this:(n.toArray(i,e*4),r.needsUpdate=!0,this)}getColorAt(e,n){const r=this._colorsTexture.image.data,i=this._instanceInfo;return e>=i.length||i[e].active===!1?null:n.fromArray(r,e*4)}setVisibleAt(e,n){const r=this._instanceInfo;return e>=r.length||r[e].active===!1||r[e].visible===n?this:(r[e].visible=n,this._visibilityChanged=!0,this)}getVisibleAt(e){const n=this._instanceInfo;return e>=n.length||n[e].active===!1?!1:n[e].visible}setGeometryIdAt(e,n){const r=this._instanceInfo,i=this._geometryInfo;return e>=r.length||r[e].active===!1||n>=i.length||i[n].active===!1?null:(r[e].geometryIndex=n,this)}getGeometryIdAt(e){const n=this._instanceInfo;return e>=n.length||n[e].active===!1?-1:n[e].geometryIndex}getGeometryRangeAt(e,n={}){if(e<0||e>=this._geometryCount)return null;const r=this._geometryInfo[e];return n.vertexStart=r.vertexStart,n.vertexCount=r.vertexCount,n.reservedVertexCount=r.reservedVertexCount,n.indexStart=r.indexStart,n.indexCount=r.indexCount,n.reservedIndexCount=r.reservedIndexCount,n.start=r.start,n.count=r.count,n}setInstanceCount(e){const n=this._availableInstanceIds,r=this._instanceInfo;for(n.sort(WC);n[n.length-1]===r.length;)r.pop(),n.pop();if(eo.active);if(Math.max(...r.map(o=>o.vertexStart+o.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${n}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...r.map(l=>l.indexStart+l.reservedIndexCount))>n)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${n}. Cannot shrink further.`);const a=this.geometry;a.dispose(),this._maxVertexCount=e,this._maxIndexCount=n,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new fn,this._initializeGeometry(a));const s=this.geometry;a.index&&dd(a.index.array,s.index.array);for(const o in a.attributes)dd(a.attributes[o].array,s.attributes[o].array)}raycast(e,n){const r=this._instanceInfo,i=this._geometryInfo,a=this.matrixWorld,s=this.geometry;la.material=this.material,la.geometry.index=s.index,la.geometry.attributes=s.attributes,la.geometry.boundingBox===null&&(la.geometry.boundingBox=new Di),la.geometry.boundingSphere===null&&(la.geometry.boundingSphere=new Li);for(let o=0,l=r.length;o({...n,boundingBox:n.boundingBox!==null?n.boundingBox.clone():null,boundingSphere:n.boundingSphere!==null?n.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(n=>({...n})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,n,r,i,a){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=i.getIndex(),o=s===null?1:s.array.BYTES_PER_ELEMENT,l=this._instanceInfo,u=this._multiDrawStarts,c=this._multiDrawCounts,d=this._geometryInfo,f=this.perObjectFrustumCulled,m=this._indirectTexture,g=m.image.data;f&&(Ga.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),jC.setFromProjectionMatrix(Ga,e.coordinateSystem));let y=0;if(this.sortObjects){Ga.copy(this.matrixWorld).invert(),Ig.setFromMatrixPosition(r.matrixWorld).applyMatrix4(Ga),E5.set(0,0,-1).transformDirection(r.matrixWorld).transformDirection(Ga);for(let E=0,_=l.length;E<_;E++)if(l[E].visible&&l[E].active){const A=l[E].geometryIndex;this.getMatrixAt(E,Ga),this.getBoundingSphereAt(A,cd).applyMatrix4(Ga);let I=!1;if(f&&(I=!jC.intersectsSphere(cd)),!I){const x=d[A],R=mxe.subVectors(cd.center,Ig).dot(E5);YC.push(x.start,x.count,R,E)}}const v=YC.list,b=this.customSort;b===null?v.sort(a.transparent?fxe:dxe):b.call(this,v,r);for(let E=0,_=v.length;E<_;E++){const A=v[E];u[y]=A.start*o,c[y]=A.count,g[y]=A.index,y++}YC.reset()}else for(let v=0,b=l.length;v0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;ar)return;qC.applyMatrix4(t.matrixWorld);const l=e.ray.origin.distanceTo(qC);if(!(le.far))return{distance:l,point:S5.clone().applyMatrix4(t.matrixWorld),index:i,face:null,faceIndex:null,barycoord:null,object:t}}const A5=new H,x5=new H;class Oo extends Tn{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,a=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;ai.far)return;a.push({distance:u,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:s})}}class bxe extends $n{constructor(e,n,r,i,a,s,o,l,u){super(e,n,r,i,a,s,o,l,u),this.isVideoTexture=!0,this.minFilter=s!==void 0?s:Xn,this.magFilter=a!==void 0?a:Xn,this.generateMipmaps=!1;const c=this;function d(){c.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class yxe extends $n{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=pi,this.minFilter=pi,this.generateMipmaps=!1,this.needsUpdate=!0}}class iT extends $n{constructor(e,n,r,i,a,s,o,l,u,c,d,f){super(null,s,o,l,u,c,i,a,d,f),this.isCompressedTexture=!0,this.image={width:n,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class vxe extends iT{constructor(e,n,r,i,a,s){super(e,n,r,a,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=ni,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Exe extends iT{constructor(e,n,r){super(void 0,e[0].width,e[0].height,n,r,bl),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class _xe extends $n{constructor(e,n,r,i,a,s,o,l,u){super(e,n,r,i,a,s,o,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Do{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,n){const r=this.getUtoTmapping(e);return this.getPoint(r,n)}getPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPoint(r/e));return n}getSpacedPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n}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 n=[];let r,i=this.getPoint(0),a=0;n.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),a+=r.distanceTo(i),n.push(a),i=r;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n){const r=this.getLengths();let i=0;const a=r.length;let s;n?s=n:s=e*r[a-1];let o=0,l=a-1,u;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),u=r[i]-s,u<0)o=i+1;else if(u>0)l=i-1;else{l=i;break}if(i=l,r[i]===s)return i/(a-1);const c=r[i],f=r[i+1]-c,m=(s-c)/f;return(i+m)/(a-1)}getTangent(e,n){let i=e-1e-4,a=e+1e-4;i<0&&(i=0),a>1&&(a=1);const s=this.getPoint(i),o=this.getPoint(a),l=n||(s.isVector2?new Ke:new H);return l.copy(o).sub(s).normalize(),l}getTangentAt(e,n){const r=this.getUtoTmapping(e);return this.getTangent(r,n)}computeFrenetFrames(e,n){const r=new H,i=[],a=[],s=[],o=new H,l=new en;for(let m=0;m<=e;m++){const g=m/e;i[m]=this.getTangentAt(g,new H)}a[0]=new H,s[0]=new H;let u=Number.MAX_VALUE;const c=Math.abs(i[0].x),d=Math.abs(i[0].y),f=Math.abs(i[0].z);c<=u&&(u=c,r.set(1,0,0)),d<=u&&(u=d,r.set(0,1,0)),f<=u&&r.set(0,0,1),o.crossVectors(i[0],r).normalize(),a[0].crossVectors(i[0],o),s[0].crossVectors(i[0],a[0]);for(let m=1;m<=e;m++){if(a[m]=a[m-1].clone(),s[m]=s[m-1].clone(),o.crossVectors(i[m-1],i[m]),o.length()>Number.EPSILON){o.normalize();const g=Math.acos(Yr(i[m-1].dot(i[m]),-1,1));a[m].applyMatrix4(l.makeRotationAxis(o,g))}s[m].crossVectors(i[m],a[m])}if(n===!0){let m=Math.acos(Yr(a[0].dot(a[e]),-1,1));m/=e,i[0].dot(o.crossVectors(a[0],a[e]))>0&&(m=-m);for(let g=1;g<=e;g++)a[g].applyMatrix4(l.makeRotationAxis(i[g],m*g)),s[g].crossVectors(i[g],a[g])}return{tangents:i,normals:a,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class aT extends Do{constructor(e=0,n=0,r=1,i=1,a=0,s=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=r,this.yRadius=i,this.aStartAngle=a,this.aEndAngle=s,this.aClockwise=o,this.aRotation=l}getPoint(e,n=new Ke){const r=n,i=Math.PI*2;let a=this.aEndAngle-this.aStartAngle;const s=Math.abs(a)i;)a-=i;a0?0:(Math.floor(Math.abs(o)/a)+1)*a:l===0&&o===a-1&&(o=a-2,l=1);let u,c;this.closed||o>0?u=i[(o-1)%a]:(OE.subVectors(i[0],i[1]).add(i[0]),u=OE);const d=i[o%a],f=i[(o+1)%a];if(this.closed||o+2i.length-2?i.length-1:s+1],d=i[s>i.length-3?i.length-1:s+2];return r.set(C5(o,l.x,u.x,c.x,d.x),C5(o,l.y,u.y,c.y,d.y)),r}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n=r){const s=i[a]-r,o=this.curves[a],l=o.getLength(),u=l===0?0:1-s/l;return o.getPointAt(u,n)}a++}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 n=0;for(let r=0,i=this.curves.length;r1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,r=e.curves.length;n0){const d=u.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(u);const c=u.getPoint(1);return this.currentPoint.copy(c),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 uy extends fn{constructor(e=[new Ke(0,-.5),new Ke(.5,0),new Ke(0,.5)],n=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:r,phiLength:i},n=Math.floor(n),i=Yr(i,0,Math.PI*2);const a=[],s=[],o=[],l=[],u=[],c=1/n,d=new H,f=new Ke,m=new H,g=new H,y=new H;let v=0,b=0;for(let E=0;E<=e.length-1;E++)switch(E){case 0:v=e[E+1].x-e[E].x,b=e[E+1].y-e[E].y,m.x=b*1,m.y=-v,m.z=b*0,y.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(y.x,y.y,y.z);break;default:v=e[E+1].x-e[E].x,b=e[E+1].y-e[E].y,m.x=b*1,m.y=-v,m.z=b*0,g.copy(m),m.x+=y.x,m.y+=y.y,m.z+=y.z,m.normalize(),l.push(m.x,m.y,m.z),y.copy(g)}for(let E=0;E<=n;E++){const _=r+E*c*i,A=Math.sin(_),I=Math.cos(_);for(let x=0;x<=e.length-1;x++){d.x=e[x].x*A,d.y=e[x].y,d.z=e[x].x*I,s.push(d.x,d.y,d.z),f.x=E/n,f.y=x/(e.length-1),o.push(f.x,f.y);const R=l[3*x+0]*A,O=l[3*x+1],N=l[3*x+0]*I;u.push(R,O,N)}}for(let E=0;E0&&_(!0),n>0&&_(!1)),this.setIndex(c),this.setAttribute("position",new qt(d,3)),this.setAttribute("normal",new qt(f,3)),this.setAttribute("uv",new qt(m,2));function E(){const A=new H,I=new H;let x=0;const R=(n-e)/r;for(let O=0;O<=a;O++){const N=[],M=O/a,B=M*(n-e)+e;for(let G=0;G<=i;G++){const W=G/i,K=W*l+o,se=Math.sin(K),ae=Math.cos(K);I.x=B*se,I.y=-M*r+v,I.z=B*ae,d.push(I.x,I.y,I.z),A.set(se,R,ae).normalize(),f.push(A.x,A.y,A.z),m.push(W,1-M),N.push(g++)}y.push(N)}for(let O=0;O0||N!==0)&&(c.push(M,B,W),x+=3),(n>0||N!==a-1)&&(c.push(B,G,W),x+=3)}u.addGroup(b,x,0),b+=x}function _(A){const I=g,x=new Ke,R=new H;let O=0;const N=A===!0?e:n,M=A===!0?1:-1;for(let G=1;G<=i;G++)d.push(0,v*M,0),f.push(0,M,0),m.push(.5,.5),g++;const B=g;for(let G=0;G<=i;G++){const K=G/i*l+o,se=Math.cos(K),ae=Math.sin(K);R.x=N*ae,R.y=v*M,R.z=N*se,d.push(R.x,R.y,R.z),f.push(0,M,0),x.x=se*.5+.5,x.y=ae*.5*M+.5,m.push(x.x,x.y),g++}for(let G=0;G.9&&R<.1&&(_<.2&&(s[E+0]+=1),A<.2&&(s[E+2]+=1),I<.2&&(s[E+4]+=1))}}function f(E){a.push(E.x,E.y,E.z)}function m(E,_){const A=E*3;_.x=e[A+0],_.y=e[A+1],_.z=e[A+2]}function g(){const E=new H,_=new H,A=new H,I=new H,x=new Ke,R=new Ke,O=new Ke;for(let N=0,M=0;N80*n){o=u=t[0],l=c=t[1];for(let g=n;gu&&(u=d),f>c&&(c=f);m=Math.max(u-o,c-l),m=m!==0?32767/m:0}return wb(a,s,n,o,l,m,0),s}};function Uq(t,e,n,r,i){let a,s;if(i===Wxe(t,e,n,r)>0)for(a=e;a=e;a-=r)s=R5(a,t[a],t[a+1],s);return s&&cT(s,s.next)&&(Rb(s),s=s.next),s}function vf(t,e){if(!t)return t;e||(e=t);let n=t,r;do if(r=!1,!n.steiner&&(cT(n,n.next)||Ur(n.prev,n,n.next)===0)){if(Rb(n),n=e=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==e);return e}function wb(t,e,n,r,i,a,s){if(!t)return;!s&&a&&Uxe(t,r,i,a);let o=t,l,u;for(;t.prev!==t.next;){if(l=t.prev,u=t.next,a?Nxe(t,r,i,a):Mxe(t)){e.push(l.i/n|0),e.push(t.i/n|0),e.push(u.i/n|0),Rb(t),t=u.next,o=u.next;continue}if(t=u,t===o){s?s===1?(t=Oxe(vf(t),e,n),wb(t,e,n,r,i,a,2)):s===2&&Dxe(t,e,n,r,i,a):wb(vf(t),e,n,r,i,a,1);break}}}function Mxe(t){const e=t.prev,n=t,r=t.next;if(Ur(e,n,r)>=0)return!1;const i=e.x,a=n.x,s=r.x,o=e.y,l=n.y,u=r.y,c=ia?i>s?i:s:a>s?a:s,m=o>l?o>u?o:u:l>u?l:u;let g=r.next;for(;g!==e;){if(g.x>=c&&g.x<=f&&g.y>=d&&g.y<=m&&ch(i,o,a,l,s,u,g.x,g.y)&&Ur(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function Nxe(t,e,n,r){const i=t.prev,a=t,s=t.next;if(Ur(i,a,s)>=0)return!1;const o=i.x,l=a.x,u=s.x,c=i.y,d=a.y,f=s.y,m=ol?o>u?o:u:l>u?l:u,v=c>d?c>f?c:f:d>f?d:f,b=kM(m,g,e,n,r),E=kM(y,v,e,n,r);let _=t.prevZ,A=t.nextZ;for(;_&&_.z>=b&&A&&A.z<=E;){if(_.x>=m&&_.x<=y&&_.y>=g&&_.y<=v&&_!==i&&_!==s&&ch(o,c,l,d,u,f,_.x,_.y)&&Ur(_.prev,_,_.next)>=0||(_=_.prevZ,A.x>=m&&A.x<=y&&A.y>=g&&A.y<=v&&A!==i&&A!==s&&ch(o,c,l,d,u,f,A.x,A.y)&&Ur(A.prev,A,A.next)>=0))return!1;A=A.nextZ}for(;_&&_.z>=b;){if(_.x>=m&&_.x<=y&&_.y>=g&&_.y<=v&&_!==i&&_!==s&&ch(o,c,l,d,u,f,_.x,_.y)&&Ur(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;A&&A.z<=E;){if(A.x>=m&&A.x<=y&&A.y>=g&&A.y<=v&&A!==i&&A!==s&&ch(o,c,l,d,u,f,A.x,A.y)&&Ur(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function Oxe(t,e,n){let r=t;do{const i=r.prev,a=r.next.next;!cT(i,a)&&zq(i,r,r.next,a)&&Cb(i,a)&&Cb(a,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(a.i/n|0),Rb(r),Rb(r.next),r=t=a),r=r.next}while(r!==t);return vf(r)}function Dxe(t,e,n,r,i,a){let s=t;do{let o=s.next.next;for(;o!==s.prev;){if(s.i!==o.i&&Gxe(s,o)){let l=Hq(s,o);s=vf(s,s.next),l=vf(l,l.next),wb(s,e,n,r,i,a,0),wb(l,e,n,r,i,a,0);return}o=o.next}s=s.next}while(s!==t)}function Lxe(t,e,n,r){const i=[];let a,s,o,l,u;for(a=0,s=e.length;a=n.next.y&&n.next.y!==n.y){const f=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(f<=a&&f>r&&(r=f,i=n.x=n.x&&n.x>=l&&a!==n.x&&ch(si.x||n.x===i.x&&Fxe(i,n)))&&(i=n,c=d)),n=n.next;while(n!==o);return i}function Fxe(t,e){return Ur(t.prev,t,e.prev)<0&&Ur(e.next,t,t.next)<0}function Uxe(t,e,n,r){let i=t;do i.z===0&&(i.z=kM(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,zxe(i)}function zxe(t){let e,n,r,i,a,s,o,l,u=1;do{for(n=t,t=null,a=null,s=0;n;){for(s++,r=n,o=0,e=0;e0||l>0&&r;)o!==0&&(l===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,o--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(s>1);return t}function kM(t,e,n,r,i){return t=(t-n)*i|0,e=(e-r)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Hxe(t){let e=t,n=t;do(e.x=(t-s)*(a-o)&&(t-s)*(r-o)>=(n-s)*(e-o)&&(n-s)*(a-o)>=(i-s)*(r-o)}function Gxe(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Vxe(t,e)&&(Cb(t,e)&&Cb(e,t)&&$xe(t,e)&&(Ur(t.prev,t,e.prev)||Ur(t,e.prev,e))||cT(t,e)&&Ur(t.prev,t,t.next)>0&&Ur(e.prev,e,e.next)>0)}function Ur(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function cT(t,e){return t.x===e.x&&t.y===e.y}function zq(t,e,n,r){const i=BE(Ur(t,e,n)),a=BE(Ur(t,e,r)),s=BE(Ur(n,r,t)),o=BE(Ur(n,r,e));return!!(i!==a&&s!==o||i===0&&PE(t,n,e)||a===0&&PE(t,r,e)||s===0&&PE(n,t,r)||o===0&&PE(n,e,r))}function PE(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function BE(t){return t>0?1:t<0?-1:0}function Vxe(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&zq(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Cb(t,e){return Ur(t.prev,t,t.next)<0?Ur(t,e,t.next)>=0&&Ur(t,t.prev,e)>=0:Ur(t,e,t.prev)<0||Ur(t,t.next,e)<0}function $xe(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,a=(t.y+e.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==t);return r}function Hq(t,e){const n=new PM(t.i,t.x,t.y),r=new PM(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function R5(t,e,n,r){const i=new PM(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Rb(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function PM(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Wxe(t,e,n,r){let i=0;for(let a=e,s=n-r;a2&&t[e-1].equals(t[0])&&t.pop()}function M5(t,e){for(let n=0;nNumber.EPSILON){const _e=Math.sqrt(U),Ge=Math.sqrt(yt*yt+q*q),Pe=qe.x-Vt/_e,ft=qe.y+ot/_e,nt=re.x-q/Ge,ht=re.y+yt/Ge,tn=((nt-Pe)*q-(ht-ft)*yt)/(ot*q-Vt*yt);At=Pe+ot*tn-$e.x,Je=ft+Vt*tn-$e.y;const tt=At*At+Je*Je;if(tt<=2)return new Ke(At,Je);xt=Math.sqrt(tt/2)}else{let _e=!1;ot>Number.EPSILON?yt>Number.EPSILON&&(_e=!0):ot<-Number.EPSILON?yt<-Number.EPSILON&&(_e=!0):Math.sign(Vt)===Math.sign(q)&&(_e=!0),_e?(At=-Vt,Je=ot,xt=Math.sqrt(U)):(At=ot,Je=Vt,xt=Math.sqrt(U/2))}return new Ke(At/xt,Je/xt)}const ie=[];for(let $e=0,qe=K.length,re=qe-1,At=$e+1;$e=0;$e--){const qe=$e/v,re=m*Math.cos(qe*Math.PI/2),At=g*Math.sin(qe*Math.PI/2)+y;for(let Je=0,xt=K.length;Je=0;){const At=re;let Je=re-1;Je<0&&(Je=$e.length-1);for(let xt=0,ot=c+v*2;xt0)&&m.push(_,A,x),(b!==r-1||l0!=e>0&&this.version++,this._anisotropy=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 dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=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.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,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.dispersion=e.dispersion,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 bD extends ii{static get type(){return"MeshPhongMaterial"}constructor(e){super(),this.isMeshPhongMaterial=!0,this.color=new vt(16777215),this.specular=new vt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Bc,this.normalScale=new Ke(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ss,this.combine=Zb,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.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Wq extends ii{static get type(){return"MeshToonMaterial"}constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.color=new vt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Bc,this.normalScale=new Ke(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 jq extends ii{static get type(){return"MeshNormalMaterial"}constructor(e){super(),this.isMeshNormalMaterial=!0,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Bc,this.normalScale=new Ke(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 bT extends ii{static get type(){return"MeshLambertMaterial"}constructor(e){super(),this.isMeshLambertMaterial=!0,this.color=new vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Bc,this.normalScale=new Ke(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ss,this.combine=Zb,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.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Yq extends ii{static get type(){return"MeshMatcapMaterial"}constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.color=new vt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Bc,this.normalScale=new Ke(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 qq extends Ki{static get type(){return"LineDashedMaterial"}constructor(e){super(),this.isLineDashedMaterial=!0,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 Hd(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function Xq(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Kq(t){function e(i,a){return t[i]-t[a]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function BM(t,e,n){const r=t.length,i=new t.constructor(r);for(let a=0,s=0;s!==r;++a){const o=n[a]*e;for(let l=0;l!==e;++l)i[s++]=t[o+l]}return i}function yD(t,e,n,r){let i=1,a=t[0];for(;a!==void 0&&a[r]===void 0;)a=t[i++];if(a===void 0)return;let s=a[r];if(s!==void 0)if(Array.isArray(s))do s=a[r],s!==void 0&&(e.push(a.time),n.push.apply(n,s)),a=t[i++];while(a!==void 0);else if(s.toArray!==void 0)do s=a[r],s!==void 0&&(e.push(a.time),s.toArray(n,n.length)),a=t[i++];while(a!==void 0);else do s=a[r],s!==void 0&&(e.push(a.time),n.push(s)),a=t[i++];while(a!==void 0)}function Xxe(t,e,n,r,i=30){const a=t.clone();a.name=e;const s=[];for(let l=0;l=r)){d.push(u.times[m]);for(let y=0;ya.tracks[l].times[0]&&(o=a.tracks[l].times[0]);for(let l=0;l=o.times[g]){const b=g*d+c,E=b+d-c;y=o.values.slice(b,E)}else{const b=o.createInterpolant(),E=c,_=d-c;b.evaluate(a),y=b.resultBuffer.slice(E,_)}l==="quaternion"&&new Mn().fromArray(y).normalize().conjugate().toArray(y);const v=u.times.length;for(let b=0;b=a)){const o=n[1];e=a)break t}s=r,r=0;break n}break e}for(;r>>1;en;)--s;if(++s,a!==0||s!==i){a>=s&&(s=Math.max(s,1),a=s-1);const o=this.getValueSize();this.times=r.slice(a,s),this.values=this.values.slice(a*o,s*o)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,a=r.length;a===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let o=0;o!==a;o++){const l=r[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,s),e=!1;break}s=l}if(i!==void 0&&Xq(i))for(let o=0,l=i.length;o!==l;++o){const u=i[o];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===V_,a=e.length-1;let s=1;for(let o=1;o0){e[s]=e[a];for(let o=a*r,l=s*r,u=0;u!==r;++u)n[l+u]=n[o+u];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=n.slice(0,s*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}Lo.prototype.TimeBufferType=Float32Array;Lo.prototype.ValueBufferType=Float32Array;Lo.prototype.DefaultInterpolation=Zh;class kf extends Lo{constructor(e,n,r){super(e,n,r)}}kf.prototype.ValueTypeName="bool";kf.prototype.ValueBufferType=Array;kf.prototype.DefaultInterpolation=Kh;kf.prototype.InterpolantFactoryMethodLinear=void 0;kf.prototype.InterpolantFactoryMethodSmooth=void 0;class ED extends Lo{}ED.prototype.ValueTypeName="color";class Ef extends Lo{}Ef.prototype.ValueTypeName="number";class Jq extends Sm{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=(r-n)/(i-n);let u=e*o;for(let c=u+o;u!==c;u+=4)Mn.slerpFlat(a,0,s,u-o,s,u,l);return a}}class _f extends Lo{InterpolantFactoryMethodLinear(e){return new Jq(this.times,this.values,this.getValueSize(),e)}}_f.prototype.ValueTypeName="quaternion";_f.prototype.InterpolantFactoryMethodSmooth=void 0;class Pf extends Lo{constructor(e,n,r){super(e,n,r)}}Pf.prototype.ValueTypeName="string";Pf.prototype.ValueBufferType=Array;Pf.prototype.DefaultInterpolation=Kh;Pf.prototype.InterpolantFactoryMethodLinear=void 0;Pf.prototype.InterpolantFactoryMethodSmooth=void 0;class Sf extends Lo{}Sf.prototype.ValueTypeName="vector";class tm{constructor(e="",n=-1,r=[],i=Kx){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=_s(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let s=0,o=r.length;s!==o;++s)n.push(Jxe(r[s]).scale(i));const a=new this(e.name,e.duration,n,e.blendMode);return a.uuid=e.uuid,a}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let a=0,s=r.length;a!==s;++a)n.push(Lo.toJSON(r[a]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const a=n.length,s=[];for(let o=0;o1){const d=c[1];let f=i[d];f||(i[d]=f=[]),f.push(u)}}const s=[];for(const o in i)s.push(this.CreateFromMorphTargetSequence(o,i[o],n,r));return s}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(d,f,m,g,y){if(m.length!==0){const v=[],b=[];yD(m,v,b,g),v.length!==0&&y.push(new d(f,v,b))}},i=[],a=e.name||"default",s=e.fps||30,o=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let d=0;d{n&&n(a),this.manager.itemEnd(e)},0),a;if(Pl[e]!==void 0){Pl[e].push({onLoad:n,onProgress:r,onError:i});return}Pl[e]=[],Pl[e].push({onLoad:n,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(s).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const c=Pl[e],d=u.body.getReader(),f=u.headers.get("X-File-Size")||u.headers.get("Content-Length"),m=f?parseInt(f):0,g=m!==0;let y=0;const v=new ReadableStream({start(b){E();function E(){d.read().then(({done:_,value:A})=>{if(_)b.close();else{y+=A.byteLength;const I=new ProgressEvent("progress",{lengthComputable:g,loaded:y,total:m});for(let x=0,R=c.length;x{b.error(_)})}}});return new Response(v)}else throw new eTe(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(c=>new DOMParser().parseFromString(c,o));case"json":return u.json();default:if(o===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(o),f=d&&d[1]?d[1].toLowerCase():void 0,m=new TextDecoder(f);return u.arrayBuffer().then(g=>m.decode(g))}}}).then(u=>{tu.add(e,u);const c=Pl[e];delete Pl[e];for(let d=0,f=c.length;d{const c=Pl[e];if(c===void 0)throw this.manager.itemError(e),u;delete Pl[e];for(let d=0,f=c.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class tTe extends Zi{constructor(e){super(e)}load(e,n,r,i){const a=this,s=new ji(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(o){try{n(a.parse(JSON.parse(o)))}catch(l){i?i(l):console.error(l),a.manager.itemError(e)}},r,i)}parse(e){const n=[];for(let r=0;r0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const a in e.uniforms){const s=e.uniforms[a];switch(i.uniforms[a]={},s.type){case"t":i.uniforms[a].value=r(s.value);break;case"c":i.uniforms[a].value=new vt().setHex(s.value);break;case"v2":i.uniforms[a].value=new Ke().fromArray(s.value);break;case"v3":i.uniforms[a].value=new H().fromArray(s.value);break;case"v4":i.uniforms[a].value=new Yn().fromArray(s.value);break;case"m3":i.uniforms[a].value=new vn().fromArray(s.value);break;case"m4":i.uniforms[a].value=new en().fromArray(s.value);break;default:i.uniforms[a].value=s.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 a in e.extensions)i.extensions[a]=e.extensions[a];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),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 a=e.normalScale;Array.isArray(a)===!1&&(a=[a,a]),i.normalScale=new Ke().fromArray(a)}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.envMapRotation!==void 0&&i.envMapRotation.fromArray(e.envMapRotation),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 Ke().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.anisotropyMap!==void 0&&(i.anisotropyMap=r(e.anisotropyMap)),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}createMaterialFromType(e){return vT.createMaterialFromType(e)}static createMaterialFromType(e){const n={ShadowMaterial:Vq,SpriteMaterial:sD,RawShaderMaterial:$q,ShaderMaterial:qi,PointsMaterial:ly,MeshPhysicalMaterial:ya,MeshStandardMaterial:Lf,MeshPhongMaterial:bD,MeshToonMaterial:Wq,MeshNormalMaterial:jq,MeshLambertMaterial:bT,MeshDepthMaterial:ay,MeshDistanceMaterial:eT,MeshBasicMaterial:$i,MeshMatcapMaterial:Yq,LineDashedMaterial:qq,LineBasicMaterial:Ki,Material:ii};return new n[e]}}class yc{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let r=0,i=e.length;r0){const l=new yT(n);a=new Ib(l),a.setCrossOrigin(this.crossOrigin);for(let u=0,c=e.length;u0){i=new Ib(this.manager),i.setCrossOrigin(this.crossOrigin);for(let s=0,o=e.length;s{const v=new Di;v.min.fromArray(y.boxMin),v.max.fromArray(y.boxMax);const b=new Li;return b.radius=y.sphereRadius,b.center.fromArray(y.sphereCenter),{boxInitialized:y.boxInitialized,box:v,sphereInitialized:y.sphereInitialized,sphere:b}}),s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._geometryCount=e.geometryCount,s._matricesTexture=u(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(s._colorsTexture=u(e.colorsTexture.uuid));break;case"LOD":s=new Nq;break;case"Line":s=new Tn(o(e.geometry),l(e.material));break;case"LineLoop":s=new uD(o(e.geometry),l(e.material));break;case"LineSegments":s=new Oo(o(e.geometry),l(e.material));break;case"PointCloud":case"Points":s=new cD(o(e.geometry),l(e.material));break;case"Sprite":s=new Mq(l(e.material));break;case"Group":s=new eu;break;case"Bone":s=new rT;break;default:s=new Sn}if(s.uuid=e.uuid,e.name!==void 0&&(s.name=e.name),e.matrix!==void 0?(s.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(e.position!==void 0&&s.position.fromArray(e.position),e.rotation!==void 0&&s.rotation.fromArray(e.rotation),e.quaternion!==void 0&&s.quaternion.fromArray(e.quaternion),e.scale!==void 0&&s.scale.fromArray(e.scale)),e.up!==void 0&&s.up.fromArray(e.up),e.castShadow!==void 0&&(s.castShadow=e.castShadow),e.receiveShadow!==void 0&&(s.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(s.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(s.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(s.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(s.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(s.visible=e.visible),e.frustumCulled!==void 0&&(s.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(s.renderOrder=e.renderOrder),e.userData!==void 0&&(s.userData=e.userData),e.layers!==void 0&&(s.layers.mask=e.layers),e.children!==void 0){const f=e.children;for(let m=0;m"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,s=tu.get(e);if(s!==void 0){if(a.manager.itemStart(e),s.then){s.then(u=>{n&&n(u),a.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){n&&n(s),a.manager.itemEnd(e)},0),s}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const l=fetch(e,o).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(a.options,{colorSpaceConversion:"none"}))}).then(function(u){return tu.add(e,u),n&&n(u),a.manager.itemEnd(e),u}).catch(function(u){i&&i(u),tu.remove(e),a.manager.itemError(e),a.manager.itemEnd(e)});tu.add(e,l),a.manager.itemStart(e)}}let FE;class wD{static getContext(){return FE===void 0&&(FE=new(window.AudioContext||window.webkitAudioContext)),FE}static setContext(e){FE=e}}class lTe extends Zi{constructor(e){super(e)}load(e,n,r,i){const a=this,s=new ji(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(l){try{const u=l.slice(0);wD.getContext().decodeAudioData(u,function(d){n(d)}).catch(o)}catch(u){o(u)}},r,i);function o(l){i?i(l):console.error(l),a.manager.itemError(e)}}}const F5=new en,U5=new en,fd=new en;class uTe{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new qr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new qr,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,fd.copy(e.projectionMatrix);const i=n.eyeSep/2,a=i*n.near/n.focus,s=n.near*Math.tan(Jd*n.fov*.5)/n.zoom;let o,l;U5.elements[12]=-i,F5.elements[12]=i,o=-s*n.aspect+a,l=s*n.aspect+a,fd.elements[0]=2*n.near/(l-o),fd.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(fd),o=-s*n.aspect-a,l=s*n.aspect-a,fd.elements[0]=2*n.near/(l-o),fd.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(fd)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(U5),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(F5)}}class CD{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=z5(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const n=z5();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}function z5(){return performance.now()}const pd=new H,H5=new Mn,cTe=new H,hd=new H;class dTe extends Sn{constructor(){super(),this.type="AudioListener",this.context=wD.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new CD}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const n=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(pd,H5,cTe),hd.set(0,0,-1).applyQuaternion(H5),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(pd.x,i),n.positionY.linearRampToValueAtTime(pd.y,i),n.positionZ.linearRampToValueAtTime(pd.z,i),n.forwardX.linearRampToValueAtTime(hd.x,i),n.forwardY.linearRampToValueAtTime(hd.y,i),n.forwardZ.linearRampToValueAtTime(hd.z,i),n.upX.linearRampToValueAtTime(r.x,i),n.upY.linearRampToValueAtTime(r.y,i),n.upZ.linearRampToValueAtTime(r.z,i)}else n.setPosition(pd.x,pd.y,pd.z),n.setOrientation(hd.x,hd.y,hd.z,r.x,r.y,r.z)}}class cX extends Sn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,n=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e0&&this._mixBufferRegionAdditive(r,i,this._addIndex*n,1,n);for(let l=n,u=n+n;l!==u;++l)if(r[l]!==r[l+n]){o.setValue(r,i);break}}saveOriginalState(){const e=this.binding,n=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(n,i);for(let a=r,s=i;a!==s;++a)n[a]=n[i+a%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,n=e+this.valueSize;for(let r=e;r=.5)for(let s=0;s!==a;++s)e[n+s]=e[r+s]}_slerp(e,n,r,i){Mn.slerpFlat(e,n,e,n,e,r,i)}_slerpAdditive(e,n,r,i,a){const s=this._workIndex*a;Mn.multiplyQuaternionsFlat(e,s,e,n,e,r),Mn.slerpFlat(e,n,e,n,e,s,i)}_lerp(e,n,r,i,a){const s=1-i;for(let o=0;o!==a;++o){const l=n+o;e[l]=e[l]*s+e[r+o]*i}}_lerpAdditive(e,n,r,i,a){for(let s=0;s!==a;++s){const o=n+s;e[o]=e[o]+e[r+s]*i}}}const RD="\\[\\]\\.:\\/",mTe=new RegExp("["+RD+"]","g"),ID="[^"+RD+"]",gTe="[^"+RD.replace("\\.","")+"]",bTe=/((?:WC+[\/:])*)/.source.replace("WC",ID),yTe=/(WCOD+)?/.source.replace("WCOD",gTe),vTe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ID),ETe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ID),_Te=new RegExp("^"+bTe+yTe+vTe+ETe+"$"),STe=["material","materials","bones","map"];class ATe{constructor(e,n,r){const i=r||Vn.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,a=r.length;i!==a;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class Vn{constructor(e,n,r){this.path=n,this.parsedPath=r||Vn.parseTrackName(n),this.node=Vn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new Vn.Composite(e,n,r):new Vn(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(mTe,"")}static parseTrackName(e){const n=_Te.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const a=r.nodeName.substring(i+1);STe.indexOf(a)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=a)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(a){for(let s=0;s=a){const d=a++,f=e[d];n[f.uuid]=c,e[c]=f,n[u]=d,e[d]=l;for(let m=0,g=i;m!==g;++m){const y=r[m],v=y[d],b=y[c];y[c]=v,y[d]=b}}}this.nCachedObjects_=a}uncache(){const e=this._objects,n=this._indicesByUUID,r=this._bindings,i=r.length;let a=this.nCachedObjects_,s=e.length;for(let o=0,l=arguments.length;o!==l;++o){const u=arguments[o],c=u.uuid,d=n[c];if(d!==void 0)if(delete n[c],d0&&(n[m.uuid]=d),e[d]=m,e.pop();for(let g=0,y=i;g!==y;++g){const v=r[g];v[d]=v[f],v.pop()}}}this.nCachedObjects_=a}subscribe_(e,n){const r=this._bindingsIndicesByPath;let i=r[e];const a=this._bindings;if(i!==void 0)return a[i];const s=this._paths,o=this._parsedPaths,l=this._objects,u=l.length,c=this.nCachedObjects_,d=new Array(u);i=a.length,r[e]=i,s.push(e),o.push(n),a.push(d);for(let f=c,m=l.length;f!==m;++f){const g=l[f];d[f]=new Vn(g,e,n)}return d}unsubscribe_(e){const n=this._bindingsIndicesByPath,r=n[e];if(r!==void 0){const i=this._paths,a=this._parsedPaths,s=this._bindings,o=s.length-1,l=s[o],u=e[o];n[u]=r,s[r]=l,s.pop(),a[r]=a[o],a.pop(),i[r]=i[o],i.pop()}}}class fX{constructor(e,n,r=null,i=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=r,this.blendMode=i;const a=n.tracks,s=a.length,o=new Array(s),l={endingStart:Bd,endingEnd:Bd};for(let u=0;u!==s;++u){const c=a[u].createInterpolant(null);o[u]=c,c.settings=l}this._interpolantSettings=l,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=nq,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,n){return this.loop=e,this.repetitions=n,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,n,r){if(e.fadeOut(n),this.fadeIn(n),r){const i=this._clip.duration,a=e._clip.duration,s=a/i,o=i/a;e.warp(1,s,n),this.warp(o,1,n)}return this}crossFadeTo(e,n,r){return e.crossFadeFrom(this,n,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,n,r){const i=this._mixer,a=i.time,s=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);const l=o.parameterPositions,u=o.sampleValues;return l[0]=a,l[1]=a+r,u[0]=e/s,u[1]=n/s,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,n,r,i){if(!this.enabled){this._updateWeight(e);return}const a=this._startTime;if(a!==null){const l=(e-a)*r;l<0||r===0?n=0:(this._startTime=null,n=r*l)}n*=this._updateTimeScale(e);const s=this._updateTime(n),o=this._updateWeight(e);if(o>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case XO:for(let c=0,d=l.length;c!==d;++c)l[c].evaluate(s),u[c].accumulateAdditive(o);break;case Kx:default:for(let c=0,d=l.length;c!==d;++c)l[c].evaluate(s),u[c].accumulate(i,o)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,r=this.loop;let i=this.time+e,a=this._loopCount;const s=r===rq;if(e===0)return a===-1?i:s&&(a&1)===1?n-i:i;if(r===tq){a===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=n)i=n;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(a===-1&&(e>=0?(a=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),i>=n||i<0){const o=Math.floor(i/n);i-=n*o,a+=Math.abs(o);const l=this.repetitions-a;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?n:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const u=e<0;this._setEndings(u,!u,s)}else this._setEndings(!1,!1,s);this._loopCount=a,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=i;if(s&&(a&1)===1)return n-i}return i}_setEndings(e,n,r){const i=this._interpolantSettings;r?(i.endingStart=Fd,i.endingEnd=Fd):(e?i.endingStart=this.zeroSlopeAtStart?Fd:Bd:i.endingStart=_b,n?i.endingEnd=this.zeroSlopeAtEnd?Fd:Bd:i.endingEnd=_b)}_scheduleFading(e,n,r){const i=this._mixer,a=i.time;let s=this._weightInterpolant;s===null&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,l=s.sampleValues;return o[0]=a,l[0]=n,o[1]=a+e,l[1]=r,this}}const TTe=new Float32Array(1);class wTe extends No{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const r=e._localRoot||this._root,i=e._clip.tracks,a=i.length,s=e._propertyBindings,o=e._interpolants,l=r.uuid,u=this._bindingsByRootAndName;let c=u[l];c===void 0&&(c={},u[l]=c);for(let d=0;d!==a;++d){const f=i[d],m=f.name;let g=c[m];if(g!==void 0)++g.referenceCount,s[d]=g;else{if(g=s[d],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,m));continue}const y=n&&n._propertyBindings[d].binding.parsedPath;g=new dX(Vn.create(r,m,y),f.ValueTypeName,f.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,m),s[d]=g}o[d].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,a=this._actionsByClip[i];this._bindAction(e,a&&a.knownActions[0]),this._addInactiveAction(e,i,r)}const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const a=n[r];a.useCount++===0&&(this._lendBinding(a),a.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const a=n[r];--a.useCount===0&&(a.restoreOriginalState(),this._takeBackBinding(a))}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 n=e._cacheIndex;return n!==null&&n=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const n=this._actions,r=this._nActiveActions,i=this.time+=e,a=Math.sign(e),s=this._accuIndex^=1;for(let u=0;u!==r;++u)n[u]._update(i,e,a,s);const o=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)o[u].apply(s);return this}setTime(e){this.time=0;for(let n=0;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,W5).distanceTo(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}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 j5=new H,UE=new H;class DTe{constructor(e=new H,n=new H){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),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,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){j5.subVectors(e,this.start),UE.subVectors(this.end,this.start);const r=UE.dot(UE);let a=UE.dot(j5)/r;return n&&(a=Yr(a,0,1)),a}closestPointToPoint(e,n,r){const i=this.closestPointToPointParameter(e,n);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 Y5=new H;class LTe extends Sn{constructor(e,n){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const r=new fn,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 s=0,o=1,l=32;s1)for(let d=0;d.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Q5.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(Q5,n)}}setLength(e,n=e*.2,r=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(r,n,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 jTe extends Oo{constructor(e=1){const n=[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 fn;i.setAttribute("position",new qt(n,3)),i.setAttribute("color",new qt(r,3));const a=new Ki({vertexColors:!0,toneMapped:!1});super(i,a),this.type="AxesHelper"}setColors(e,n,r){const i=new vt,a=this.geometry.attributes.color.array;return i.set(e),i.toArray(a,0),i.toArray(a,3),i.set(n),i.toArray(a,6),i.toArray(a,9),i.set(r),i.toArray(a,12),i.toArray(a,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class YTe{constructor(){this.type="ShapePath",this.color=new vt,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new Tb,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,r,i){return this.currentPath.quadraticCurveTo(e,n,r,i),this}bezierCurveTo(e,n,r,i,a,s){return this.currentPath.bezierCurveTo(e,n,r,i,a,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(b){const E=[];for(let _=0,A=b.length;_Number.EPSILON){if(M<0&&(R=E[x],N=-N,O=E[I],M=-M),b.yO.y)continue;if(b.y===R.y){if(b.x===R.x)return!0}else{const B=M*(b.x-R.x)-N*(b.y-R.y);if(B===0)return!0;if(B<0)continue;A=!A}}else{if(b.y!==R.y)continue;if(O.x<=b.x&&b.x<=R.x||R.x<=b.x&&b.x<=O.x)return!0}}return A}const i=hl.isClockWise,a=this.subPaths;if(a.length===0)return[];let s,o,l;const u=[];if(a.length===1)return o=a[0],l=new tf,l.curves=o.curves,u.push(l),u;let c=!i(a[0].getPoints());c=e?!c:c;const d=[],f=[];let m=[],g=0,y;f[g]=void 0,m[g]=[];for(let b=0,E=a.length;b1){let b=!1,E=0;for(let _=0,A=f.length;_0&&b===!1&&(m=d)}let v;for(let b=0,E=f.length;b{const d=typeof u=="function"?u(e):u;if(d!==e){const f=e;e=c?d:Object.assign({},e,d),n.forEach(m=>m(e,f))}},i=()=>e,a=(u,c=i,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let f=c(e);function m(){const g=c(e);if(!d(f,g)){const y=f;u(f=g,y)}}return n.add(m),()=>n.delete(m)},l={setState:r,getState:i,subscribe:(u,c,d)=>c||d?a(u,c,d):(n.add(u),()=>n.delete(u)),destroy:()=>n.clear()};return e=t(r,i,l),l}const Qxe=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),J5=Qxe?w.useEffect:w.useLayoutEffect;function OD(t){const e=typeof t=="function"?Zxe(t):t,n=(r=e.getState,i=Object.is)=>{const[,a]=w.useReducer(v=>v+1,0),s=e.getState(),o=w.useRef(s),l=w.useRef(r),u=w.useRef(i),c=w.useRef(!1),d=w.useRef();d.current===void 0&&(d.current=r(s));let f,m=!1;(o.current!==s||l.current!==r||u.current!==i||c.current)&&(f=r(s),m=!i(d.current,f)),J5(()=>{m&&(d.current=f),o.current=s,l.current=r,u.current=i,c.current=!1});const g=w.useRef(s);J5(()=>{const v=()=>{try{const E=e.getState(),S=l.current(E);u.current(d.current,S)||(o.current=E,d.current=S,a())}catch{c.current=!0,a()}},b=e.subscribe(v);return e.getState()!==g.current&&v(),b},[]);const y=m?f:d.current;return w.useDebugValue(y),y};return Object.assign(n,e),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[n,e];return{next(){const i=r.length<=0;return{value:r.shift(),done:i}}}},n}const Jxe=t=>typeof t=="object"&&typeof t.then=="function",Gd=[];function gX(t,e,n=(r,i)=>r===i){if(t===e)return!0;if(!t||!e)return!1;const r=t.length;if(e.length!==r)return!1;for(let i=0;i0&&(a.timeout&&clearTimeout(a.timeout),a.timeout=setTimeout(a.remove,r.lifespan)),a.response;if(!n)throw a.promise}const i={keys:e,equal:r.equal,remove:()=>{const a=Gd.indexOf(i);a!==-1&&Gd.splice(a,1)},promise:(Jxe(t)?t:t(...e)).then(a=>{i.response=a,r.lifespan&&r.lifespan>0&&(i.timeout=setTimeout(i.remove,r.lifespan))}).catch(a=>i.error=a)};if(Gd.push(i),!n)throw i.promise}const e1e=(t,e,n)=>bX(t,e,!1,n),t1e=(t,e,n)=>void bX(t,e,!0,n),n1e=t=>{if(t===void 0||t.length===0)Gd.splice(0,Gd.length);else{const e=Gd.find(n=>gX(t,n.keys,n.equal));e&&e.remove()}};var yX={exports:{}},vX={exports:{}},EX={};/** + */Bf.ConcurrentRoot=1;Bf.ContinuousEventPriority=4;Bf.DefaultEventPriority=16;Bf.DiscreteEventPriority=1;Bf.IdleEventPriority=536870912;Bf.LegacyRoot=0;mX.exports=Bf;var dh=mX.exports;function ZTe(t){let e;const n=new Set,r=(u,c)=>{const d=typeof u=="function"?u(e):u;if(d!==e){const f=e;e=c?d:Object.assign({},e,d),n.forEach(m=>m(e,f))}},i=()=>e,a=(u,c=i,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let f=c(e);function m(){const g=c(e);if(!d(f,g)){const y=f;u(f=g,y)}}return n.add(m),()=>n.delete(m)},l={setState:r,getState:i,subscribe:(u,c,d)=>c||d?a(u,c,d):(n.add(u),()=>n.delete(u)),destroy:()=>n.clear()};return e=t(r,i,l),l}const QTe=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),J5=QTe?w.useEffect:w.useLayoutEffect;function OD(t){const e=typeof t=="function"?ZTe(t):t,n=(r=e.getState,i=Object.is)=>{const[,a]=w.useReducer(v=>v+1,0),s=e.getState(),o=w.useRef(s),l=w.useRef(r),u=w.useRef(i),c=w.useRef(!1),d=w.useRef();d.current===void 0&&(d.current=r(s));let f,m=!1;(o.current!==s||l.current!==r||u.current!==i||c.current)&&(f=r(s),m=!i(d.current,f)),J5(()=>{m&&(d.current=f),o.current=s,l.current=r,u.current=i,c.current=!1});const g=w.useRef(s);J5(()=>{const v=()=>{try{const E=e.getState(),_=l.current(E);u.current(d.current,_)||(o.current=E,d.current=_,a())}catch{c.current=!0,a()}},b=e.subscribe(v);return e.getState()!==g.current&&v(),b},[]);const y=m?f:d.current;return w.useDebugValue(y),y};return Object.assign(n,e),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[n,e];return{next(){const i=r.length<=0;return{value:r.shift(),done:i}}}},n}const JTe=t=>typeof t=="object"&&typeof t.then=="function",Gd=[];function gX(t,e,n=(r,i)=>r===i){if(t===e)return!0;if(!t||!e)return!1;const r=t.length;if(e.length!==r)return!1;for(let i=0;i0&&(a.timeout&&clearTimeout(a.timeout),a.timeout=setTimeout(a.remove,r.lifespan)),a.response;if(!n)throw a.promise}const i={keys:e,equal:r.equal,remove:()=>{const a=Gd.indexOf(i);a!==-1&&Gd.splice(a,1)},promise:(JTe(t)?t:t(...e)).then(a=>{i.response=a,r.lifespan&&r.lifespan>0&&(i.timeout=setTimeout(i.remove,r.lifespan))}).catch(a=>i.error=a)};if(Gd.push(i),!n)throw i.promise}const e1e=(t,e,n)=>bX(t,e,!1,n),t1e=(t,e,n)=>void bX(t,e,!0,n),n1e=t=>{if(t===void 0||t.length===0)Gd.splice(0,Gd.length);else{const e=Gd.find(n=>gX(t,n.keys,n.equal));e&&e.remove()}};var yX={exports:{}},vX={exports:{}},EX={};/** * @license React * scheduler.production.min.js * @@ -4216,7 +4216,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(F,ie){var J=F.length;F.push(ie);e:for(;0>>1,Ce=F[fe];if(0>>1;fei(ke,J))Fei(Ye,ke)?(F[fe]=Ye,F[Fe]=J,fe=Fe):(F[fe]=ke,F[j]=J,fe=j);else if(Fei(Ye,J))F[fe]=Ye,F[Fe]=J,fe=Fe;else break e}}return ie}function i(F,ie){var J=F.sortIndex-ie.sortIndex;return J!==0?J:F.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],u=[],c=1,d=null,f=3,m=!1,g=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(F){for(var ie=n(u);ie!==null;){if(ie.callback===null)r(u);else if(ie.startTime<=F)r(u),ie.sortIndex=ie.expirationTime,e(l,ie);else break;ie=n(u)}}function A(F){if(y=!1,S(F),!g)if(n(l)!==null)g=!0,ae(I);else{var ie=n(u);ie!==null&&ee(A,ie.startTime-F)}}function I(F,ie){g=!1,y&&(y=!1,b(O),O=-1),m=!0;var J=f;try{for(S(ie),d=n(l);d!==null&&(!(d.expirationTime>ie)||F&&!B());){var fe=d.callback;if(typeof fe=="function"){d.callback=null,f=d.priorityLevel;var Ce=fe(d.expirationTime<=ie);ie=t.unstable_now(),typeof Ce=="function"?d.callback=Ce:d===n(l)&&r(l),S(ie)}else r(l);d=n(l)}if(d!==null)var Le=!0;else{var j=n(u);j!==null&&ee(A,j.startTime-ie),Le=!1}return Le}finally{d=null,f=J,m=!1}}var T=!1,R=null,O=-1,N=5,M=-1;function B(){return!(t.unstable_now()-MF||125fe?(F.sortIndex=J,e(u,F),n(l)===null&&F===n(u)&&(y?(b(O),O=-1):y=!0,ee(A,J-fe))):(F.sortIndex=Ce,e(l,F),g||m||(g=!0,ae(I))),F},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(F){var ie=f;return function(){var J=f;f=ie;try{return F.apply(this,arguments)}finally{f=J}}}})(EX);vX.exports=EX;var zM=vX.exports;/** + */(function(t){function e(F,ie){var J=F.length;F.push(ie);e:for(;0>>1,Ce=F[fe];if(0>>1;fei(ke,J))Fei(Ye,ke)?(F[fe]=Ye,F[Fe]=J,fe=Fe):(F[fe]=ke,F[j]=J,fe=j);else if(Fei(Ye,J))F[fe]=Ye,F[Fe]=J,fe=Fe;else break e}}return ie}function i(F,ie){var J=F.sortIndex-ie.sortIndex;return J!==0?J:F.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],u=[],c=1,d=null,f=3,m=!1,g=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(F){for(var ie=n(u);ie!==null;){if(ie.callback===null)r(u);else if(ie.startTime<=F)r(u),ie.sortIndex=ie.expirationTime,e(l,ie);else break;ie=n(u)}}function A(F){if(y=!1,_(F),!g)if(n(l)!==null)g=!0,ae(I);else{var ie=n(u);ie!==null&&ee(A,ie.startTime-F)}}function I(F,ie){g=!1,y&&(y=!1,b(O),O=-1),m=!0;var J=f;try{for(_(ie),d=n(l);d!==null&&(!(d.expirationTime>ie)||F&&!B());){var fe=d.callback;if(typeof fe=="function"){d.callback=null,f=d.priorityLevel;var Ce=fe(d.expirationTime<=ie);ie=t.unstable_now(),typeof Ce=="function"?d.callback=Ce:d===n(l)&&r(l),_(ie)}else r(l);d=n(l)}if(d!==null)var Le=!0;else{var j=n(u);j!==null&&ee(A,j.startTime-ie),Le=!1}return Le}finally{d=null,f=J,m=!1}}var x=!1,R=null,O=-1,N=5,M=-1;function B(){return!(t.unstable_now()-MF||125fe?(F.sortIndex=J,e(u,F),n(l)===null&&F===n(u)&&(y?(b(O),O=-1):y=!0,ee(A,J-fe))):(F.sortIndex=Ce,e(l,F),g||m||(g=!0,ae(I))),F},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(F){var ie=f;return function(){var J=f;f=ie;try{return F.apply(this,arguments)}finally{f=J}}}})(EX);vX.exports=EX;var zM=vX.exports;/** * @license React * react-reconciler.production.min.js * @@ -4224,17 +4224,17 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r1e=function(e){var n={},r=w,i=zM,a=Object.assign;function s(p){for(var h="https://reactjs.org/docs/error-decoder.html?invariant="+p,_=1;_ve||D[ne]!==k[ve]){var We=` -`+D[ne].replace(" at new "," at ");return p.displayName&&We.includes("")&&(We=We.replace("",p.displayName)),We}while(1<=ne&&0<=ve);break}}}finally{Ve=!1,Error.prepareStackTrace=_}return(p=p?p.displayName||p.name:"")?at(p):""}var lt=Object.prototype.hasOwnProperty,Ue=[],ct=-1;function Bt(p){return{current:p}}function wt(p){0>ct||(p.current=Ue[ct],Ue[ct]=null,ct--)}function xt(p,h){ct++,Ue[ct]=p.current,p.current=h}var Nt={},pt=Bt(Nt),nn=Bt(!1),Zt=Nt;function ir(p,h){var _=p.type.contextTypes;if(!_)return Nt;var x=p.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===h)return x.__reactInternalMemoizedMaskedChildContext;var D={},k;for(k in _)D[k]=h[k];return x&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=h,p.__reactInternalMemoizedMaskedChildContext=D),D}function ar(p){return p=p.childContextTypes,p!=null}function Wn(){wt(nn),wt(pt)}function Rn(p,h,_){if(pt.current!==Nt)throw Error(s(168));xt(pt,h),xt(nn,_)}function un(p,h,_){var x=p.stateNode;if(h=h.childContextTypes,typeof x.getChildContext!="function")return _;x=x.getChildContext();for(var D in x)if(!(D in h))throw Error(s(108,O(p)||"Unknown",D));return a({},_,x)}function hn(p){return p=(p=p.stateNode)&&p.__reactInternalMemoizedMergedChildContext||Nt,Zt=pt.current,xt(pt,p),xt(nn,nn.current),!0}function An(p,h,_){var x=p.stateNode;if(!x)throw Error(s(169));_?(p=un(p,h,Zt),x.__reactInternalMemoizedMergedChildContext=p,wt(nn),wt(pt),xt(pt,p)):wt(nn),xt(nn,_)}var wn=Math.clz32?Math.clz32:Sa,Kr=Math.log,hr=Math.LN2;function Sa(p){return p>>>=0,p===0?32:31-(Kr(p)/hr|0)|0}var Yf=64,Gc=4194304;function Vc(p){switch(p&-p){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 p&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return p&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return p}}function qf(p,h){var _=p.pendingLanes;if(_===0)return 0;var x=0,D=p.suspendedLanes,k=p.pingedLanes,ne=_&268435455;if(ne!==0){var ve=ne&~D;ve!==0?x=Vc(ve):(k&=ne,k!==0&&(x=Vc(k)))}else ne=_&~D,ne!==0?x=Vc(ne):k!==0&&(x=Vc(k));if(x===0)return 0;if(h!==0&&h!==x&&!(h&D)&&(D=x&-x,k=h&-h,D>=k||D===16&&(k&4194240)!==0))return h;if(x&4&&(x|=_&16),h=p.entangledLanes,h!==0)for(p=p.entanglements,h&=x;0_;_++)h.push(p);return h}function $c(p,h,_){p.pendingLanes|=h,h!==536870912&&(p.suspendedLanes=0,p.pingedLanes=0),p=p.eventTimes,h=31-wn(h),p[h]=_}function Xf(p,h){var _=p.pendingLanes&~h;p.pendingLanes=h,p.suspendedLanes=0,p.pingedLanes=0,p.expiredLanes&=h,p.mutableReadLanes&=h,p.entangledLanes&=h,h=p.entanglements;var x=p.eventTimes;for(p=p.expirationTimes;0<_;){var D=31-wn(_),k=1<>=ne,D-=ne,wl=1<<32-wn(h)+D|_<Zn?(Ti=bn,bn=null):Ti=bn.sibling;var Qn=rn(Ne,bn,ze[Zn],Ft);if(Qn===null){bn===null&&(bn=Ti);break}p&&bn&&Qn.alternate===null&&h(Ne,bn),Ae=k(Qn,Ae,Zn),Tn===null?Qt=Qn:Tn.sibling=Qn,Tn=Qn,bn=Ti}if(Zn===ze.length)return _(Ne,bn),Rr&&Xc(Ne,Zn),Qt;if(bn===null){for(;ZnZn?(Ti=bn,bn=null):Ti=bn.sibling;var Mu=rn(Ne,bn,Qn.value,Ft);if(Mu===null){bn===null&&(bn=Ti);break}p&&bn&&Mu.alternate===null&&h(Ne,bn),Ae=k(Mu,Ae,Zn),Tn===null?Qt=Mu:Tn.sibling=Mu,Tn=Mu,bn=Ti}if(Qn.done)return _(Ne,bn),Rr&&Xc(Ne,Zn),Qt;if(bn===null){for(;!Qn.done;Zn++,Qn=ze.next())Qn=gn(Ne,Qn.value,Ft),Qn!==null&&(Ae=k(Qn,Ae,Zn),Tn===null?Qt=Qn:Tn.sibling=Qn,Tn=Qn);return Rr&&Xc(Ne,Zn),Qt}for(bn=x(Ne,bn);!Qn.done;Zn++,Qn=ze.next())Qn=pr(bn,Ne,Zn,Qn.value,Ft),Qn!==null&&(p&&Qn.alternate!==null&&bn.delete(Qn.key===null?Zn:Qn.key),Ae=k(Qn,Ae,Zn),Tn===null?Qt=Qn:Tn.sibling=Qn,Tn=Qn);return p&&bn.forEach(function(VJ){return h(Ne,VJ)}),Rr&&Xc(Ne,Zn),Qt}function Bs(Ne,Ae,ze,Ft){if(typeof ze=="object"&&ze!==null&&ze.type===c&&ze.key===null&&(ze=ze.props.children),typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case l:e:{for(var Qt=ze.key,Tn=Ae;Tn!==null;){if(Tn.key===Qt){if(Qt=ze.type,Qt===c){if(Tn.tag===7){_(Ne,Tn.sibling),Ae=D(Tn,ze.props.children),Ae.return=Ne,Ne=Ae;break e}}else if(Tn.elementType===Qt||typeof Qt=="object"&&Qt!==null&&Qt.$$typeof===S&&xF(Qt)===Tn.type){_(Ne,Tn.sibling),Ae=D(Tn,ze.props),Ae.ref=Vm(Ne,Tn,ze),Ae.return=Ne,Ne=Ae;break e}_(Ne,Tn);break}else h(Ne,Tn);Tn=Tn.sibling}ze.type===c?(Ae=nd(ze.props.children,Ne.mode,Ft,ze.key),Ae.return=Ne,Ne=Ae):(Ft=Ev(ze.type,ze.key,ze.props,null,Ne.mode,Ft),Ft.ref=Vm(Ne,Ae,ze),Ft.return=Ne,Ne=Ft)}return ne(Ne);case u:e:{for(Tn=ze.key;Ae!==null;){if(Ae.key===Tn)if(Ae.tag===4&&Ae.stateNode.containerInfo===ze.containerInfo&&Ae.stateNode.implementation===ze.implementation){_(Ne,Ae.sibling),Ae=D(Ae,ze.children||[]),Ae.return=Ne,Ne=Ae;break e}else{_(Ne,Ae);break}else h(Ne,Ae);Ae=Ae.sibling}Ae=iw(ze,Ne.mode,Ft),Ae.return=Ne,Ne=Ae}return ne(Ne);case S:return Tn=ze._init,Bs(Ne,Ae,Tn(ze._payload),Ft)}if(se(ze))return Jt(Ne,Ae,ze,Ft);if(T(ze))return ra(Ne,Ae,ze,Ft);Vy(Ne,ze)}return typeof ze=="string"&&ze!==""||typeof ze=="number"?(ze=""+ze,Ae!==null&&Ae.tag===6?(_(Ne,Ae.sibling),Ae=D(Ae,ze),Ae.return=Ne,Ne=Ae):(_(Ne,Ae),Ae=rw(ze,Ne.mode,Ft),Ae.return=Ne,Ne=Ae),ne(Ne)):_(Ne,Ae)}return Bs}var rp=wF(!0),CF=wF(!1),$m={},Ds=Bt($m),Wm=Bt($m),ip=Bt($m);function Go(p){if(p===$m)throw Error(s(174));return p}function S1(p,h){xt(ip,h),xt(Wm,p),xt(Ds,$m),p=ee(h),wt(Ds),xt(Ds,p)}function ap(){wt(Ds),wt(Wm),wt(ip)}function RF(p){var h=Go(ip.current),_=Go(Ds.current);h=F(_,p.type,h),_!==h&&(xt(Wm,p),xt(Ds,h))}function _1(p){Wm.current===p&&(wt(Ds),wt(Wm))}var Lr=Bt(0);function $y(p){for(var h=p;h!==null;){if(h.tag===13){var _=h.memoizedState;if(_!==null&&(_=_.dehydrated,_===null||Ze(_)||Ct(_)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if(h.flags&128)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===p)break;for(;h.sibling===null;){if(h.return===null||h.return===p)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var A1=[];function T1(){for(var p=0;p_?_:4,p(!0);var x=Ls.transition;Ls.transition={};try{p(!1),h()}finally{Ln=_,Ls.transition=x}}function GF(){return Vo().memoizedState}function gJ(p,h,_){var x=Cu(p);_={lane:x,action:_,hasEagerState:!1,eagerState:null,next:null},VF(p)?$F(h,_):(WF(p,h,_),_=Aa(),p=ks(p,x,_),p!==null&&jF(p,h,x))}function bJ(p,h,_){var x=Cu(p),D={lane:x,action:_,hasEagerState:!1,eagerState:null,next:null};if(VF(p))$F(h,D);else{WF(p,h,D);var k=p.alternate;if(p.lanes===0&&(k===null||k.lanes===0)&&(k=h.lastRenderedReducer,k!==null))try{var ne=h.lastRenderedState,ve=k(ne,_);if(D.hasEagerState=!0,D.eagerState=ve,Is(ve,ne))return}catch{}finally{}_=Aa(),p=ks(p,x,_),p!==null&&jF(p,h,x)}}function VF(p){var h=p.alternate;return p===Vr||h!==null&&h===Vr}function $F(p,h){jm=jy=!0;var _=p.pending;_===null?h.next=h:(h.next=_.next,_.next=h),p.pending=h}function WF(p,h,_){ai!==null&&p.mode&1&&!(Cn&2)?(p=h.interleaved,p===null?(_.next=_,Ho===null?Ho=[h]:Ho.push(h)):(_.next=p.next,p.next=_),h.interleaved=_):(p=h.pending,p===null?_.next=_:(_.next=p.next,p.next=_),h.pending=_)}function jF(p,h,_){if(_&4194240){var x=h.lanes;x&=p.pendingLanes,_|=x,h.lanes=_,Wc(p,_)}}var Zy={readContext:Ms,useCallback:ta,useContext:ta,useEffect:ta,useImperativeHandle:ta,useInsertionEffect:ta,useLayoutEffect:ta,useMemo:ta,useReducer:ta,useRef:ta,useState:ta,useDebugValue:ta,useDeferredValue:ta,useTransition:ta,useMutableSource:ta,useSyncExternalStore:ta,useId:ta,unstable_isNewReconciler:!1},yJ={readContext:Ms,useCallback:function(p,h){return Rl().memoizedState=[p,h===void 0?null:h],p},useContext:Ms,useEffect:I1,useImperativeHandle:function(p,h,_){return _=_!=null?_.concat([p]):null,Xy(4194308,4,FF.bind(null,h,p),_)},useLayoutEffect:function(p,h){return Xy(4194308,4,p,h)},useInsertionEffect:function(p,h){return Xy(4,2,p,h)},useMemo:function(p,h){var _=Rl();return h=h===void 0?null:h,p=p(),_.memoizedState=[p,h],p},useReducer:function(p,h,_){var x=Rl();return h=_!==void 0?_(h):h,x.memoizedState=x.baseState=h,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:p,lastRenderedState:h},x.queue=p,p=p.dispatch=gJ.bind(null,Vr,p),[x.memoizedState,p]},useRef:function(p){var h=Rl();return p={current:p},h.memoizedState=p},useState:R1,useDebugValue:M1,useDeferredValue:function(p){var h=R1(p),_=h[0],x=h[1];return I1(function(){var D=Ls.transition;Ls.transition={};try{x(p)}finally{Ls.transition=D}},[p]),_},useTransition:function(){var p=R1(!1),h=p[0];return p=mJ.bind(null,p[1]),Rl().memoizedState=p,[h,p]},useMutableSource:function(){},useSyncExternalStore:function(p,h,_){var x=Vr,D=Rl();if(Rr){if(_===void 0)throw Error(s(407));_=_()}else{if(_=h(),ai===null)throw Error(s(349));sp&30||NF(x,h,_)}D.memoizedState=_;var k={value:_,getSnapshot:h};return D.queue=k,I1(DF.bind(null,x,k,p),[p]),x.flags|=2048,qm(9,OF.bind(null,x,k,_,h),void 0,null),_},useId:function(){var p=Rl(),h=ai.identifierPrefix;if(Rr){var _=Cl,x=wl;_=(x&~(1<<32-wn(x)-1)).toString(32)+_,h=":"+h+"R"+_,_=Ym++,0<_&&(h+="H"+_.toString(32)),h+=":"}else _=hJ++,h=":"+h+"r"+_.toString(32)+":";return p.memoizedState=h},unstable_isNewReconciler:!1},vJ={readContext:Ms,useCallback:zF,useContext:Ms,useEffect:Xm,useImperativeHandle:UF,useInsertionEffect:PF,useLayoutEffect:BF,useMemo:HF,useReducer:Yy,useRef:kF,useState:function(){return Yy(Kc)},useDebugValue:M1,useDeferredValue:function(p){var h=Yy(Kc),_=h[0],x=h[1];return Xm(function(){var D=Ls.transition;Ls.transition={};try{x(p)}finally{Ls.transition=D}},[p]),_},useTransition:function(){var p=Yy(Kc)[0],h=Vo().memoizedState;return[p,h]},useMutableSource:IF,useSyncExternalStore:MF,useId:GF,unstable_isNewReconciler:!1},EJ={readContext:Ms,useCallback:zF,useContext:Ms,useEffect:Xm,useImperativeHandle:UF,useInsertionEffect:PF,useLayoutEffect:BF,useMemo:HF,useReducer:qy,useRef:kF,useState:function(){return qy(Kc)},useDebugValue:M1,useDeferredValue:function(p){var h=qy(Kc),_=h[0],x=h[1];return Xm(function(){var D=Ls.transition;Ls.transition={};try{x(p)}finally{Ls.transition=D}},[p]),_},useTransition:function(){var p=qy(Kc)[0],h=Vo().memoizedState;return[p,h]},useMutableSource:IF,useSyncExternalStore:MF,useId:GF,unstable_isNewReconciler:!1};function N1(p,h){try{var _="",x=h;do _+=br(x),x=x.return;while(x);var D=_}catch(k){D=` +`+D[ne].replace(" at new "," at ");return p.displayName&&We.includes("")&&(We=We.replace("",p.displayName)),We}while(1<=ne&&0<=ve);break}}}finally{Ve=!1,Error.prepareStackTrace=S}return(p=p?p.displayName||p.name:"")?at(p):""}var lt=Object.prototype.hasOwnProperty,Ue=[],ct=-1;function Bt(p){return{current:p}}function wt(p){0>ct||(p.current=Ue[ct],Ue[ct]=null,ct--)}function Tt(p,h){ct++,Ue[ct]=p.current,p.current=h}var Nt={},pt=Bt(Nt),nn=Bt(!1),Zt=Nt;function ir(p,h){var S=p.type.contextTypes;if(!S)return Nt;var T=p.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===h)return T.__reactInternalMemoizedMaskedChildContext;var D={},k;for(k in S)D[k]=h[k];return T&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=h,p.__reactInternalMemoizedMaskedChildContext=D),D}function ar(p){return p=p.childContextTypes,p!=null}function Wn(){wt(nn),wt(pt)}function Rn(p,h,S){if(pt.current!==Nt)throw Error(s(168));Tt(pt,h),Tt(nn,S)}function un(p,h,S){var T=p.stateNode;if(h=h.childContextTypes,typeof T.getChildContext!="function")return S;T=T.getChildContext();for(var D in T)if(!(D in h))throw Error(s(108,O(p)||"Unknown",D));return a({},S,T)}function hn(p){return p=(p=p.stateNode)&&p.__reactInternalMemoizedMergedChildContext||Nt,Zt=pt.current,Tt(pt,p),Tt(nn,nn.current),!0}function An(p,h,S){var T=p.stateNode;if(!T)throw Error(s(169));S?(p=un(p,h,Zt),T.__reactInternalMemoizedMergedChildContext=p,wt(nn),wt(pt),Tt(pt,p)):wt(nn),Tt(nn,S)}var wn=Math.clz32?Math.clz32:_a,Kr=Math.log,hr=Math.LN2;function _a(p){return p>>>=0,p===0?32:31-(Kr(p)/hr|0)|0}var Yf=64,Gc=4194304;function Vc(p){switch(p&-p){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 p&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return p&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return p}}function qf(p,h){var S=p.pendingLanes;if(S===0)return 0;var T=0,D=p.suspendedLanes,k=p.pingedLanes,ne=S&268435455;if(ne!==0){var ve=ne&~D;ve!==0?T=Vc(ve):(k&=ne,k!==0&&(T=Vc(k)))}else ne=S&~D,ne!==0?T=Vc(ne):k!==0&&(T=Vc(k));if(T===0)return 0;if(h!==0&&h!==T&&!(h&D)&&(D=T&-T,k=h&-h,D>=k||D===16&&(k&4194240)!==0))return h;if(T&4&&(T|=S&16),h=p.entangledLanes,h!==0)for(p=p.entanglements,h&=T;0S;S++)h.push(p);return h}function $c(p,h,S){p.pendingLanes|=h,h!==536870912&&(p.suspendedLanes=0,p.pingedLanes=0),p=p.eventTimes,h=31-wn(h),p[h]=S}function Xf(p,h){var S=p.pendingLanes&~h;p.pendingLanes=h,p.suspendedLanes=0,p.pingedLanes=0,p.expiredLanes&=h,p.mutableReadLanes&=h,p.entangledLanes&=h,h=p.entanglements;var T=p.eventTimes;for(p=p.expirationTimes;0>=ne,D-=ne,wl=1<<32-wn(h)+D|S<Zn?(xi=bn,bn=null):xi=bn.sibling;var Qn=rn(Ne,bn,ze[Zn],Ft);if(Qn===null){bn===null&&(bn=xi);break}p&&bn&&Qn.alternate===null&&h(Ne,bn),Ae=k(Qn,Ae,Zn),xn===null?Qt=Qn:xn.sibling=Qn,xn=Qn,bn=xi}if(Zn===ze.length)return S(Ne,bn),Rr&&Xc(Ne,Zn),Qt;if(bn===null){for(;ZnZn?(xi=bn,bn=null):xi=bn.sibling;var Mu=rn(Ne,bn,Qn.value,Ft);if(Mu===null){bn===null&&(bn=xi);break}p&&bn&&Mu.alternate===null&&h(Ne,bn),Ae=k(Mu,Ae,Zn),xn===null?Qt=Mu:xn.sibling=Mu,xn=Mu,bn=xi}if(Qn.done)return S(Ne,bn),Rr&&Xc(Ne,Zn),Qt;if(bn===null){for(;!Qn.done;Zn++,Qn=ze.next())Qn=gn(Ne,Qn.value,Ft),Qn!==null&&(Ae=k(Qn,Ae,Zn),xn===null?Qt=Qn:xn.sibling=Qn,xn=Qn);return Rr&&Xc(Ne,Zn),Qt}for(bn=T(Ne,bn);!Qn.done;Zn++,Qn=ze.next())Qn=pr(bn,Ne,Zn,Qn.value,Ft),Qn!==null&&(p&&Qn.alternate!==null&&bn.delete(Qn.key===null?Zn:Qn.key),Ae=k(Qn,Ae,Zn),xn===null?Qt=Qn:xn.sibling=Qn,xn=Qn);return p&&bn.forEach(function(VJ){return h(Ne,VJ)}),Rr&&Xc(Ne,Zn),Qt}function Bs(Ne,Ae,ze,Ft){if(typeof ze=="object"&&ze!==null&&ze.type===c&&ze.key===null&&(ze=ze.props.children),typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case l:e:{for(var Qt=ze.key,xn=Ae;xn!==null;){if(xn.key===Qt){if(Qt=ze.type,Qt===c){if(xn.tag===7){S(Ne,xn.sibling),Ae=D(xn,ze.props.children),Ae.return=Ne,Ne=Ae;break e}}else if(xn.elementType===Qt||typeof Qt=="object"&&Qt!==null&&Qt.$$typeof===_&&TF(Qt)===xn.type){S(Ne,xn.sibling),Ae=D(xn,ze.props),Ae.ref=Vm(Ne,xn,ze),Ae.return=Ne,Ne=Ae;break e}S(Ne,xn);break}else h(Ne,xn);xn=xn.sibling}ze.type===c?(Ae=nd(ze.props.children,Ne.mode,Ft,ze.key),Ae.return=Ne,Ne=Ae):(Ft=Ev(ze.type,ze.key,ze.props,null,Ne.mode,Ft),Ft.ref=Vm(Ne,Ae,ze),Ft.return=Ne,Ne=Ft)}return ne(Ne);case u:e:{for(xn=ze.key;Ae!==null;){if(Ae.key===xn)if(Ae.tag===4&&Ae.stateNode.containerInfo===ze.containerInfo&&Ae.stateNode.implementation===ze.implementation){S(Ne,Ae.sibling),Ae=D(Ae,ze.children||[]),Ae.return=Ne,Ne=Ae;break e}else{S(Ne,Ae);break}else h(Ne,Ae);Ae=Ae.sibling}Ae=iw(ze,Ne.mode,Ft),Ae.return=Ne,Ne=Ae}return ne(Ne);case _:return xn=ze._init,Bs(Ne,Ae,xn(ze._payload),Ft)}if(se(ze))return Jt(Ne,Ae,ze,Ft);if(x(ze))return ra(Ne,Ae,ze,Ft);Vy(Ne,ze)}return typeof ze=="string"&&ze!==""||typeof ze=="number"?(ze=""+ze,Ae!==null&&Ae.tag===6?(S(Ne,Ae.sibling),Ae=D(Ae,ze),Ae.return=Ne,Ne=Ae):(S(Ne,Ae),Ae=rw(ze,Ne.mode,Ft),Ae.return=Ne,Ne=Ae),ne(Ne)):S(Ne,Ae)}return Bs}var rp=wF(!0),CF=wF(!1),$m={},Ds=Bt($m),Wm=Bt($m),ip=Bt($m);function Go(p){if(p===$m)throw Error(s(174));return p}function _1(p,h){Tt(ip,h),Tt(Wm,p),Tt(Ds,$m),p=ee(h),wt(Ds),Tt(Ds,p)}function ap(){wt(Ds),wt(Wm),wt(ip)}function RF(p){var h=Go(ip.current),S=Go(Ds.current);h=F(S,p.type,h),S!==h&&(Tt(Wm,p),Tt(Ds,h))}function S1(p){Wm.current===p&&(wt(Ds),wt(Wm))}var Lr=Bt(0);function $y(p){for(var h=p;h!==null;){if(h.tag===13){var S=h.memoizedState;if(S!==null&&(S=S.dehydrated,S===null||Ze(S)||Ct(S)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if(h.flags&128)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===p)break;for(;h.sibling===null;){if(h.return===null||h.return===p)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var A1=[];function x1(){for(var p=0;pS?S:4,p(!0);var T=Ls.transition;Ls.transition={};try{p(!1),h()}finally{Ln=S,Ls.transition=T}}function GF(){return Vo().memoizedState}function gJ(p,h,S){var T=Cu(p);S={lane:T,action:S,hasEagerState:!1,eagerState:null,next:null},VF(p)?$F(h,S):(WF(p,h,S),S=Aa(),p=ks(p,T,S),p!==null&&jF(p,h,T))}function bJ(p,h,S){var T=Cu(p),D={lane:T,action:S,hasEagerState:!1,eagerState:null,next:null};if(VF(p))$F(h,D);else{WF(p,h,D);var k=p.alternate;if(p.lanes===0&&(k===null||k.lanes===0)&&(k=h.lastRenderedReducer,k!==null))try{var ne=h.lastRenderedState,ve=k(ne,S);if(D.hasEagerState=!0,D.eagerState=ve,Is(ve,ne))return}catch{}finally{}S=Aa(),p=ks(p,T,S),p!==null&&jF(p,h,T)}}function VF(p){var h=p.alternate;return p===Vr||h!==null&&h===Vr}function $F(p,h){jm=jy=!0;var S=p.pending;S===null?h.next=h:(h.next=S.next,S.next=h),p.pending=h}function WF(p,h,S){ai!==null&&p.mode&1&&!(Cn&2)?(p=h.interleaved,p===null?(S.next=S,Ho===null?Ho=[h]:Ho.push(h)):(S.next=p.next,p.next=S),h.interleaved=S):(p=h.pending,p===null?S.next=S:(S.next=p.next,p.next=S),h.pending=S)}function jF(p,h,S){if(S&4194240){var T=h.lanes;T&=p.pendingLanes,S|=T,h.lanes=S,Wc(p,S)}}var Zy={readContext:Ms,useCallback:ta,useContext:ta,useEffect:ta,useImperativeHandle:ta,useInsertionEffect:ta,useLayoutEffect:ta,useMemo:ta,useReducer:ta,useRef:ta,useState:ta,useDebugValue:ta,useDeferredValue:ta,useTransition:ta,useMutableSource:ta,useSyncExternalStore:ta,useId:ta,unstable_isNewReconciler:!1},yJ={readContext:Ms,useCallback:function(p,h){return Rl().memoizedState=[p,h===void 0?null:h],p},useContext:Ms,useEffect:I1,useImperativeHandle:function(p,h,S){return S=S!=null?S.concat([p]):null,Xy(4194308,4,FF.bind(null,h,p),S)},useLayoutEffect:function(p,h){return Xy(4194308,4,p,h)},useInsertionEffect:function(p,h){return Xy(4,2,p,h)},useMemo:function(p,h){var S=Rl();return h=h===void 0?null:h,p=p(),S.memoizedState=[p,h],p},useReducer:function(p,h,S){var T=Rl();return h=S!==void 0?S(h):h,T.memoizedState=T.baseState=h,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:p,lastRenderedState:h},T.queue=p,p=p.dispatch=gJ.bind(null,Vr,p),[T.memoizedState,p]},useRef:function(p){var h=Rl();return p={current:p},h.memoizedState=p},useState:R1,useDebugValue:M1,useDeferredValue:function(p){var h=R1(p),S=h[0],T=h[1];return I1(function(){var D=Ls.transition;Ls.transition={};try{T(p)}finally{Ls.transition=D}},[p]),S},useTransition:function(){var p=R1(!1),h=p[0];return p=mJ.bind(null,p[1]),Rl().memoizedState=p,[h,p]},useMutableSource:function(){},useSyncExternalStore:function(p,h,S){var T=Vr,D=Rl();if(Rr){if(S===void 0)throw Error(s(407));S=S()}else{if(S=h(),ai===null)throw Error(s(349));sp&30||NF(T,h,S)}D.memoizedState=S;var k={value:S,getSnapshot:h};return D.queue=k,I1(DF.bind(null,T,k,p),[p]),T.flags|=2048,qm(9,OF.bind(null,T,k,S,h),void 0,null),S},useId:function(){var p=Rl(),h=ai.identifierPrefix;if(Rr){var S=Cl,T=wl;S=(T&~(1<<32-wn(T)-1)).toString(32)+S,h=":"+h+"R"+S,S=Ym++,0X1&&(h.flags|=128,x=!0,Qm(D,!1),h.lanes=4194304)}else{if(!x)if(p=$y(k),p!==null){if(h.flags|=128,x=!0,p=p.updateQueue,p!==null&&(h.updateQueue=p,h.flags|=4),Qm(D,!0),D.tail===null&&D.tailMode==="hidden"&&!k.alternate&&!Rr)return na(h),null}else 2*mr()-D.renderingStartTime>X1&&_!==1073741824&&(h.flags|=128,x=!0,Qm(D,!1),h.lanes=4194304);D.isBackwards?(k.sibling=h.child,h.child=k):(p=D.last,p!==null?p.sibling=k:h.child=k,D.last=k)}return D.tail!==null?(h=D.tail,D.rendering=h,D.tail=h.sibling,D.renderingStartTime=mr(),h.sibling=null,p=Lr.current,xt(Lr,x?p&1|2:p&1),h):(na(h),null);case 22:case 23:return ew(),x=h.memoizedState!==null,p!==null&&p.memoizedState!==null!==x&&(h.flags|=8192),x&&h.mode&1?cs&1073741824&&(na(h),Mt&&h.subtreeFlags&6&&(h.flags|=8192)):na(h),null;case 24:return null;case 25:return null}throw Error(s(156,h.tag))}var AJ=o.ReactCurrentOwner,us=!1;function _a(p,h,_,x){h.child=p===null?CF(h,null,_,x):rp(h,p.child,_,x)}function eU(p,h,_,x,D){_=_.render;var k=h.ref;return Jf(h,D),x=w1(p,h,_,x,k,D),_=C1(),p!==null&&!us?(h.updateQueue=p.updateQueue,h.flags&=-2053,p.lanes&=~D,Il(p,h,D)):(Rr&&_&&g1(h),h.flags|=1,_a(p,h,x,D),h.child)}function tU(p,h,_,x,D){if(p===null){var k=_.type;return typeof k=="function"&&!nw(k)&&k.defaultProps===void 0&&_.compare===null&&_.defaultProps===void 0?(h.tag=15,h.type=k,nU(p,h,k,x,D)):(p=Ev(_.type,null,x,h,h.mode,D),p.ref=h.ref,p.return=h,h.child=p)}if(k=p.child,!(p.lanes&D)){var ne=k.memoizedProps;if(_=_.compare,_=_!==null?_:Pn,_(ne,x)&&p.ref===h.ref)return Il(p,h,D)}return h.flags|=1,p=Iu(k,x),p.ref=h.ref,p.return=h,h.child=p}function nU(p,h,_,x,D){if(p!==null&&Pn(p.memoizedProps,x)&&p.ref===h.ref)if(us=!1,(p.lanes&D)!==0)p.flags&131072&&(us=!0);else return h.lanes=p.lanes,Il(p,h,D);return D1(p,h,_,x,D)}function rU(p,h,_){var x=h.pendingProps,D=x.children,k=p!==null?p.memoizedState:null;if(x.mode==="hidden")if(!(h.mode&1))h.memoizedState={baseLanes:0,cachePool:null},xt(op,cs),cs|=_;else if(_&1073741824)h.memoizedState={baseLanes:0,cachePool:null},x=k!==null?k.baseLanes:_,xt(op,cs),cs|=x;else return p=k!==null?k.baseLanes|_:_,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:p,cachePool:null},h.updateQueue=null,xt(op,cs),cs|=p,null;else k!==null?(x=k.baseLanes|_,h.memoizedState=null):x=_,xt(op,cs),cs|=x;return _a(p,h,D,_),h.child}function iU(p,h){var _=h.ref;(p===null&&_!==null||p!==null&&p.ref!==_)&&(h.flags|=512,h.flags|=2097152)}function D1(p,h,_,x,D){var k=ar(_)?Zt:pt.current;return k=ir(h,k),Jf(h,D),_=w1(p,h,_,x,k,D),x=C1(),p!==null&&!us?(h.updateQueue=p.updateQueue,h.flags&=-2053,p.lanes&=~D,Il(p,h,D)):(Rr&&x&&g1(h),h.flags|=1,_a(p,h,_,D),h.child)}function aU(p,h,_,x,D){if(ar(_)){var k=!0;hn(h)}else k=!1;if(Jf(h,D),h.stateNode===null)p!==null&&(p.alternate=null,h.alternate=null,h.flags|=2),vF(h,_,x),m1(h,_,x,D),x=!0;else if(p===null){var ne=h.stateNode,ve=h.memoizedProps;ne.props=ve;var We=ne.context,mt=_.contextType;typeof mt=="object"&&mt!==null?mt=Ms(mt):(mt=ar(_)?Zt:pt.current,mt=ir(h,mt));var jt=_.getDerivedStateFromProps,gn=typeof jt=="function"||typeof ne.getSnapshotBeforeUpdate=="function";gn||typeof ne.UNSAFE_componentWillReceiveProps!="function"&&typeof ne.componentWillReceiveProps!="function"||(ve!==x||We!==mt)&&EF(h,ne,x,mt),Au=!1;var rn=h.memoizedState;ne.state=rn,Uy(h,x,ne,D),We=h.memoizedState,ve!==x||rn!==We||nn.current||Au?(typeof jt=="function"&&(h1(h,_,jt,x),We=h.memoizedState),(ve=Au||yF(h,_,ve,x,rn,We,mt))?(gn||typeof ne.UNSAFE_componentWillMount!="function"&&typeof ne.componentWillMount!="function"||(typeof ne.componentWillMount=="function"&&ne.componentWillMount(),typeof ne.UNSAFE_componentWillMount=="function"&&ne.UNSAFE_componentWillMount()),typeof ne.componentDidMount=="function"&&(h.flags|=4194308)):(typeof ne.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=x,h.memoizedState=We),ne.props=x,ne.state=We,ne.context=mt,x=ve):(typeof ne.componentDidMount=="function"&&(h.flags|=4194308),x=!1)}else{ne=h.stateNode,hF(p,h),ve=h.memoizedProps,mt=h.type===h.elementType?ve:Dr(h.type,ve),ne.props=mt,gn=h.pendingProps,rn=ne.context,We=_.contextType,typeof We=="object"&&We!==null?We=Ms(We):(We=ar(_)?Zt:pt.current,We=ir(h,We));var pr=_.getDerivedStateFromProps;(jt=typeof pr=="function"||typeof ne.getSnapshotBeforeUpdate=="function")||typeof ne.UNSAFE_componentWillReceiveProps!="function"&&typeof ne.componentWillReceiveProps!="function"||(ve!==gn||rn!==We)&&EF(h,ne,x,We),Au=!1,rn=h.memoizedState,ne.state=rn,Uy(h,x,ne,D);var Jt=h.memoizedState;ve!==gn||rn!==Jt||nn.current||Au?(typeof pr=="function"&&(h1(h,_,pr,x),Jt=h.memoizedState),(mt=Au||yF(h,_,mt,x,rn,Jt,We)||!1)?(jt||typeof ne.UNSAFE_componentWillUpdate!="function"&&typeof ne.componentWillUpdate!="function"||(typeof ne.componentWillUpdate=="function"&&ne.componentWillUpdate(x,Jt,We),typeof ne.UNSAFE_componentWillUpdate=="function"&&ne.UNSAFE_componentWillUpdate(x,Jt,We)),typeof ne.componentDidUpdate=="function"&&(h.flags|=4),typeof ne.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof ne.componentDidUpdate!="function"||ve===p.memoizedProps&&rn===p.memoizedState||(h.flags|=4),typeof ne.getSnapshotBeforeUpdate!="function"||ve===p.memoizedProps&&rn===p.memoizedState||(h.flags|=1024),h.memoizedProps=x,h.memoizedState=Jt),ne.props=x,ne.state=Jt,ne.context=We,x=mt):(typeof ne.componentDidUpdate!="function"||ve===p.memoizedProps&&rn===p.memoizedState||(h.flags|=4),typeof ne.getSnapshotBeforeUpdate!="function"||ve===p.memoizedProps&&rn===p.memoizedState||(h.flags|=1024),x=!1)}return L1(p,h,_,x,k,D)}function L1(p,h,_,x,D,k){iU(p,h);var ne=(h.flags&128)!==0;if(!x&&!ne)return D&&An(h,_,!1),Il(p,h,k);x=h.stateNode,AJ.current=h;var ve=ne&&typeof _.getDerivedStateFromError!="function"?null:x.render();return h.flags|=1,p!==null&&ne?(h.child=rp(h,p.child,null,k),h.child=rp(h,null,ve,k)):_a(p,h,ve,k),h.memoizedState=x.state,D&&An(h,_,!0),h.child}function sU(p){var h=p.stateNode;h.pendingContext?Rn(p,h.pendingContext,h.pendingContext!==h.context):h.context&&Rn(p,h.context,!1),S1(p,h.containerInfo)}function oU(p,h,_,x,D){return np(),E1(D),h.flags|=256,_a(p,h,_,x),h.child}var ev={dehydrated:null,treeContext:null,retryLane:0};function tv(p){return{baseLanes:p,cachePool:null}}function lU(p,h,_){var x=h.pendingProps,D=Lr.current,k=!1,ne=(h.flags&128)!==0,ve;if((ve=ne)||(ve=p!==null&&p.memoizedState===null?!1:(D&2)!==0),ve?(k=!0,h.flags&=-129):(p===null||p.memoizedState!==null)&&(D|=1),xt(Lr,D&1),p===null)return v1(h),p=h.memoizedState,p!==null&&(p=p.dehydrated,p!==null)?(h.mode&1?Ct(p)?h.lanes=8:h.lanes=1073741824:h.lanes=1,null):(D=x.children,p=x.fallback,k?(x=h.mode,k=h.child,D={mode:"hidden",children:D},!(x&1)&&k!==null?(k.childLanes=0,k.pendingProps=D):k=Sv(D,x,0,null),p=nd(p,x,_,null),k.return=h,p.return=h,k.sibling=p,h.child=k,h.child.memoizedState=tv(_),h.memoizedState=ev,p):k1(h,D));if(D=p.memoizedState,D!==null){if(ve=D.dehydrated,ve!==null){if(ne)return h.flags&256?(h.flags&=-257,nv(p,h,_,Error(s(422)))):h.memoizedState!==null?(h.child=p.child,h.flags|=128,null):(k=x.fallback,D=h.mode,x=Sv({mode:"visible",children:x.children},D,0,null),k=nd(k,D,_,null),k.flags|=2,x.return=h,k.return=h,x.sibling=k,h.child=x,h.mode&1&&rp(h,p.child,null,_),h.child.memoizedState=tv(_),h.memoizedState=ev,k);if(!(h.mode&1))h=nv(p,h,_,null);else if(Ct(ve))h=nv(p,h,_,Error(s(419)));else if(x=(_&p.childLanes)!==0,us||x){if(x=ai,x!==null){switch(_&-_){case 4:k=2;break;case 16:k=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:k=32;break;case 536870912:k=268435456;break;default:k=0}x=k&(x.suspendedLanes|_)?0:k,x!==0&&x!==D.retryLane&&(D.retryLane=x,ks(p,x,-1))}tw(),h=nv(p,h,_,Error(s(421)))}else Ze(ve)?(h.flags|=128,h.child=p.child,h=PJ.bind(null,p),kt(ve,h),h=null):(_=D.treeContext,qe&&(ls=Rt(ve),os=h,Rr=!0,oo=null,Hm=!1,_!==null&&(Ns[Os++]=wl,Ns[Os++]=Cl,Ns[Os++]=qc,wl=_.id,Cl=_.overflow,qc=h)),h=k1(h,h.pendingProps.children),h.flags|=4096);return h}return k?(x=cU(p,h,x.children,x.fallback,_),k=h.child,D=p.child.memoizedState,k.memoizedState=D===null?tv(_):{baseLanes:D.baseLanes|_,cachePool:null},k.childLanes=p.childLanes&~_,h.memoizedState=ev,x):(_=uU(p,h,x.children,_),h.memoizedState=null,_)}return k?(x=cU(p,h,x.children,x.fallback,_),k=h.child,D=p.child.memoizedState,k.memoizedState=D===null?tv(_):{baseLanes:D.baseLanes|_,cachePool:null},k.childLanes=p.childLanes&~_,h.memoizedState=ev,x):(_=uU(p,h,x.children,_),h.memoizedState=null,_)}function k1(p,h){return h=Sv({mode:"visible",children:h},p.mode,0,null),h.return=p,p.child=h}function uU(p,h,_,x){var D=p.child;return p=D.sibling,_=Iu(D,{mode:"visible",children:_}),!(h.mode&1)&&(_.lanes=x),_.return=h,_.sibling=null,p!==null&&(x=h.deletions,x===null?(h.deletions=[p],h.flags|=16):x.push(p)),h.child=_}function cU(p,h,_,x,D){var k=h.mode;p=p.child;var ne=p.sibling,ve={mode:"hidden",children:_};return!(k&1)&&h.child!==p?(_=h.child,_.childLanes=0,_.pendingProps=ve,h.deletions=null):(_=Iu(p,ve),_.subtreeFlags=p.subtreeFlags&14680064),ne!==null?x=Iu(ne,x):(x=nd(x,k,D,null),x.flags|=2),x.return=h,_.return=h,_.sibling=x,h.child=_,x}function nv(p,h,_,x){return x!==null&&E1(x),rp(h,p.child,null,_),p=k1(h,h.pendingProps.children),p.flags|=2,h.memoizedState=null,p}function dU(p,h,_){p.lanes|=h;var x=p.alternate;x!==null&&(x.lanes|=h),f1(p.return,h,_)}function P1(p,h,_,x,D){var k=p.memoizedState;k===null?p.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:x,tail:_,tailMode:D}:(k.isBackwards=h,k.rendering=null,k.renderingStartTime=0,k.last=x,k.tail=_,k.tailMode=D)}function fU(p,h,_){var x=h.pendingProps,D=x.revealOrder,k=x.tail;if(_a(p,h,x.children,_),x=Lr.current,x&2)x=x&1|2,h.flags|=128;else{if(p!==null&&p.flags&128)e:for(p=h.child;p!==null;){if(p.tag===13)p.memoizedState!==null&&dU(p,_,h);else if(p.tag===19)dU(p,_,h);else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===h)break e;for(;p.sibling===null;){if(p.return===null||p.return===h)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}x&=1}if(xt(Lr,x),!(h.mode&1))h.memoizedState=null;else switch(D){case"forwards":for(_=h.child,D=null;_!==null;)p=_.alternate,p!==null&&$y(p)===null&&(D=_),_=_.sibling;_=D,_===null?(D=h.child,h.child=null):(D=_.sibling,_.sibling=null),P1(h,!1,D,_,k);break;case"backwards":for(_=null,D=h.child,h.child=null;D!==null;){if(p=D.alternate,p!==null&&$y(p)===null){h.child=D;break}p=D.sibling,D.sibling=_,_=D,D=p}P1(h,!0,_,null,k);break;case"together":P1(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function Il(p,h,_){if(p!==null&&(h.dependencies=p.dependencies),lp|=h.lanes,!(_&h.childLanes))return null;if(p!==null&&h.child!==p.child)throw Error(s(153));if(h.child!==null){for(p=h.child,_=Iu(p,p.pendingProps),h.child=_,_.return=h;p.sibling!==null;)p=p.sibling,_=_.sibling=Iu(p,p.pendingProps),_.return=h;_.sibling=null}return h.child}function TJ(p,h,_){switch(h.tag){case 3:sU(h),np();break;case 5:RF(h);break;case 1:ar(h.type)&&hn(h);break;case 4:S1(h,h.stateNode.containerInfo);break;case 10:pF(h,h.type._context,h.memoizedProps.value);break;case 13:var x=h.memoizedState;if(x!==null)return x.dehydrated!==null?(xt(Lr,Lr.current&1),h.flags|=128,null):_&h.child.childLanes?lU(p,h,_):(xt(Lr,Lr.current&1),p=Il(p,h,_),p!==null?p.sibling:null);xt(Lr,Lr.current&1);break;case 19:if(x=(_&h.childLanes)!==0,p.flags&128){if(x)return fU(p,h,_);h.flags|=128}var D=h.memoizedState;if(D!==null&&(D.rendering=null,D.tail=null,D.lastEffect=null),xt(Lr,Lr.current),x)break;return null;case 22:case 23:return h.lanes=0,rU(p,h,_)}return Il(p,h,_)}function xJ(p,h){switch(b1(h),h.tag){case 1:return ar(h.type)&&Wn(),p=h.flags,p&65536?(h.flags=p&-65537|128,h):null;case 3:return ap(),wt(nn),wt(pt),T1(),p=h.flags,p&65536&&!(p&128)?(h.flags=p&-65537|128,h):null;case 5:return _1(h),null;case 13:if(wt(Lr),p=h.memoizedState,p!==null&&p.dehydrated!==null){if(h.alternate===null)throw Error(s(340));np()}return p=h.flags,p&65536?(h.flags=p&-65537|128,h):null;case 19:return wt(Lr),null;case 4:return ap(),null;case 10:return d1(h.type._context),null;case 22:case 23:return ew(),null;case 24:return null;default:return null}}var rv=!1,Zc=!1,wJ=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function iv(p,h){var _=p.ref;if(_!==null)if(typeof _=="function")try{_(null)}catch(x){Ha(p,h,x)}else _.current=null}function B1(p,h,_){try{_()}catch(x){Ha(p,h,x)}}var pU=!1;function CJ(p,h){for(ie(p.containerInfo),Lt=h;Lt!==null;)if(p=Lt,h=p.child,(p.subtreeFlags&1028)!==0&&h!==null)h.return=p,Lt=h;else for(;Lt!==null;){p=Lt;try{var _=p.alternate;if(p.flags&1024)switch(p.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var x=_.memoizedProps,D=_.memoizedState,k=p.stateNode,ne=k.getSnapshotBeforeUpdate(p.elementType===p.type?x:Dr(p.type,x),D);k.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:Mt&&Xe(p.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(ve){Ha(p,p.return,ve)}if(h=p.sibling,h!==null){h.return=p.return,Lt=h;break}Lt=p.return}return _=pU,pU=!1,_}function Qc(p,h,_){var x=h.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var D=x=x.next;do{if((D.tag&p)===p){var k=D.destroy;D.destroy=void 0,k!==void 0&&B1(h,_,k)}D=D.next}while(D!==x)}}function Jm(p,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var _=h=h.next;do{if((_.tag&p)===p){var x=_.create;_.destroy=x()}_=_.next}while(_!==h)}}function F1(p){var h=p.ref;if(h!==null){var _=p.stateNode;switch(p.tag){case 5:p=ae(_);break;default:p=_}typeof h=="function"?h(p):h.current=p}}function hU(p,h,_){if(Rs&&typeof Rs.onCommitFiberUnmount=="function")try{Rs.onCommitFiberUnmount(jc,h)}catch{}switch(h.tag){case 0:case 11:case 14:case 15:if(p=h.updateQueue,p!==null&&(p=p.lastEffect,p!==null)){var x=p=p.next;do{var D=x,k=D.destroy;D=D.tag,k!==void 0&&(D&2||D&4)&&B1(h,_,k),x=x.next}while(x!==p)}break;case 1:if(iv(h,_),p=h.stateNode,typeof p.componentWillUnmount=="function")try{p.props=h.memoizedProps,p.state=h.memoizedState,p.componentWillUnmount()}catch(ne){Ha(h,_,ne)}break;case 5:iv(h,_);break;case 4:Mt?EU(p,h,_):$e&&$e&&(h=h.stateNode.containerInfo,_=_t(h),Hn(h,_))}}function mU(p,h,_){for(var x=h;;)if(hU(p,x,_),x.child===null||Mt&&x.tag===4){if(x===h)break;for(;x.sibling===null;){if(x.return===null||x.return===h)return;x=x.return}x.sibling.return=x.return,x=x.sibling}else x.child.return=x,x=x.child}function gU(p){var h=p.alternate;h!==null&&(p.alternate=null,gU(h)),p.child=null,p.deletions=null,p.sibling=null,p.tag===5&&(h=p.stateNode,h!==null&&Tt(h)),p.stateNode=null,p.return=null,p.dependencies=null,p.memoizedProps=null,p.memoizedState=null,p.pendingProps=null,p.stateNode=null,p.updateQueue=null}function bU(p){return p.tag===5||p.tag===3||p.tag===4}function yU(p){e:for(;;){for(;p.sibling===null;){if(p.return===null||bU(p.return))return null;p=p.return}for(p.sibling.return=p.return,p=p.sibling;p.tag!==5&&p.tag!==6&&p.tag!==18;){if(p.flags&2||p.child===null||p.tag===4)continue e;p.child.return=p,p=p.child}if(!(p.flags&2))return p.stateNode}}function vU(p){if(Mt){e:{for(var h=p.return;h!==null;){if(bU(h))break e;h=h.return}throw Error(s(160))}var _=h;switch(_.tag){case 5:h=_.stateNode,_.flags&32&&(De(h),_.flags&=-33),_=yU(p),z1(p,_,h);break;case 3:case 4:h=_.stateNode.containerInfo,_=yU(p),U1(p,_,h);break;default:throw Error(s(161))}}}function U1(p,h,_){var x=p.tag;if(x===5||x===6)p=p.stateNode,h?Dt(_,p,h):ht(_,p);else if(x!==4&&(p=p.child,p!==null))for(U1(p,h,_),p=p.sibling;p!==null;)U1(p,h,_),p=p.sibling}function z1(p,h,_){var x=p.tag;if(x===5||x===6)p=p.stateNode,h?zt(_,p,h):nt(_,p);else if(x!==4&&(p=p.child,p!==null))for(z1(p,h,_),p=p.sibling;p!==null;)z1(p,h,_),p=p.sibling}function EU(p,h,_){for(var x=h,D=!1,k,ne;;){if(!D){D=x.return;e:for(;;){if(D===null)throw Error(s(160));switch(k=D.stateNode,D.tag){case 5:ne=!1;break e;case 3:k=k.containerInfo,ne=!0;break e;case 4:k=k.containerInfo,ne=!0;break e}D=D.return}D=!0}if(x.tag===5||x.tag===6)mU(p,x,_),ne?me(k,x.stateNode):bt(k,x.stateNode);else if(x.tag===18)ne?le(k,x.stateNode):X(k,x.stateNode);else if(x.tag===4){if(x.child!==null){k=x.stateNode.containerInfo,ne=!0,x.child.return=x,x=x.child;continue}}else if(hU(p,x,_),x.child!==null){x.child.return=x,x=x.child;continue}if(x===h)break;for(;x.sibling===null;){if(x.return===null||x.return===h)return;x=x.return,x.tag===4&&(D=!1)}x.sibling.return=x.return,x=x.sibling}}function H1(p,h){if(Mt){switch(h.tag){case 0:case 11:case 14:case 15:Qc(3,h,h.return),Jm(3,h),Qc(5,h,h.return);return;case 1:return;case 5:var _=h.stateNode;if(_!=null){var x=h.memoizedProps;p=p!==null?p.memoizedProps:x;var D=h.type,k=h.updateQueue;h.updateQueue=null,k!==null&&Et(_,k,D,p,x,h)}return;case 6:if(h.stateNode===null)throw Error(s(162));_=h.memoizedProps,tn(h.stateNode,p!==null?p.memoizedProps:_,_);return;case 3:qe&&p!==null&&p.memoizedState.isDehydrated&&Re(h.stateNode.containerInfo);return;case 12:return;case 13:av(h);return;case 19:av(h);return;case 17:return}throw Error(s(163))}switch(h.tag){case 0:case 11:case 14:case 15:Qc(3,h,h.return),Jm(3,h),Qc(5,h,h.return);return;case 12:return;case 13:av(h);return;case 19:av(h);return;case 3:qe&&p!==null&&p.memoizedState.isDehydrated&&Re(h.stateNode.containerInfo);break;case 22:case 23:return}e:if($e){switch(h.tag){case 1:case 5:case 6:break e;case 3:case 4:h=h.stateNode,Hn(h.containerInfo,h.pendingChildren);break e}throw Error(s(163))}}function av(p){var h=p.updateQueue;if(h!==null){p.updateQueue=null;var _=p.stateNode;_===null&&(_=p.stateNode=new wJ),h.forEach(function(x){var D=BJ.bind(null,p,x);_.has(x)||(_.add(x),x.then(D,D))})}}function RJ(p,h){for(Lt=h;Lt!==null;){h=Lt;var _=h.deletions;if(_!==null)for(var x=0;x<_.length;x++){var D=_[x];try{var k=p;Mt?EU(k,D,h):mU(k,D,h);var ne=D.alternate;ne!==null&&(ne.return=null),D.return=null}catch(Qt){Ha(D,h,Qt)}}if(_=h.child,h.subtreeFlags&12854&&_!==null)_.return=h,Lt=_;else for(;Lt!==null;){h=Lt;try{var ve=h.flags;if(ve&32&&Mt&&De(h.stateNode),ve&512){var We=h.alternate;if(We!==null){var mt=We.ref;mt!==null&&(typeof mt=="function"?mt(null):mt.current=null)}}if(ve&8192)switch(h.tag){case 13:if(h.memoizedState!==null){var jt=h.alternate;(jt===null||jt.memoizedState===null)&&(q1=mr())}break;case 22:var gn=h.memoizedState!==null,rn=h.alternate,pr=rn!==null&&rn.memoizedState!==null;if(_=h,Mt){e:if(x=_,D=gn,k=null,Mt)for(var Jt=x;;){if(Jt.tag===5){if(k===null){k=Jt;var ra=Jt.stateNode;D?rt(ra):xe(Jt.stateNode,Jt.memoizedProps)}}else if(Jt.tag===6){if(k===null){var Bs=Jt.stateNode;D?ge(Bs):Me(Bs,Jt.memoizedProps)}}else if((Jt.tag!==22&&Jt.tag!==23||Jt.memoizedState===null||Jt===x)&&Jt.child!==null){Jt.child.return=Jt,Jt=Jt.child;continue}if(Jt===x)break;for(;Jt.sibling===null;){if(Jt.return===null||Jt.return===x)break e;k===Jt&&(k=null),Jt=Jt.return}k===Jt&&(k=null),Jt.sibling.return=Jt.return,Jt=Jt.sibling}}if(gn&&!pr&&_.mode&1){Lt=_;for(var Ne=_.child;Ne!==null;){for(_=Lt=Ne;Lt!==null;){x=Lt;var Ae=x.child;switch(x.tag){case 0:case 11:case 14:case 15:Qc(4,x,x.return);break;case 1:iv(x,x.return);var ze=x.stateNode;if(typeof ze.componentWillUnmount=="function"){var Ft=x.return;try{ze.props=x.memoizedProps,ze.state=x.memoizedState,ze.componentWillUnmount()}catch(Qt){Ha(x,Ft,Qt)}}break;case 5:iv(x,x.return);break;case 22:if(x.memoizedState!==null){AU(_);continue}}Ae!==null?(Ae.return=x,Lt=Ae):AU(_)}Ne=Ne.sibling}}}switch(ve&4102){case 2:vU(h),h.flags&=-3;break;case 6:vU(h),h.flags&=-3,H1(h.alternate,h);break;case 4096:h.flags&=-4097;break;case 4100:h.flags&=-4097,H1(h.alternate,h);break;case 4:H1(h.alternate,h)}}catch(Qt){Ha(h,h.return,Qt)}if(_=h.sibling,_!==null){_.return=h.return,Lt=_;break}Lt=h.return}}}function IJ(p,h,_){Lt=p,SU(p)}function SU(p,h,_){for(var x=(p.mode&1)!==0;Lt!==null;){var D=Lt,k=D.child;if(D.tag===22&&x){var ne=D.memoizedState!==null||rv;if(!ne){var ve=D.alternate,We=ve!==null&&ve.memoizedState!==null||Zc;ve=rv;var mt=Zc;if(rv=ne,(Zc=We)&&!mt)for(Lt=D;Lt!==null;)ne=Lt,We=ne.child,ne.tag===22&&ne.memoizedState!==null?TU(D):We!==null?(We.return=ne,Lt=We):TU(D);for(;k!==null;)Lt=k,SU(k),k=k.sibling;Lt=D,rv=ve,Zc=mt}_U(p)}else D.subtreeFlags&8772&&k!==null?(k.return=D,Lt=k):_U(p)}}function _U(p){for(;Lt!==null;){var h=Lt;if(h.flags&8772){var _=h.alternate;try{if(h.flags&8772)switch(h.tag){case 0:case 11:case 15:Zc||Jm(5,h);break;case 1:var x=h.stateNode;if(h.flags&4&&!Zc)if(_===null)x.componentDidMount();else{var D=h.elementType===h.type?_.memoizedProps:Dr(h.type,_.memoizedProps);x.componentDidUpdate(D,_.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var k=h.updateQueue;k!==null&&gF(h,k,x);break;case 3:var ne=h.updateQueue;if(ne!==null){if(_=null,h.child!==null)switch(h.child.tag){case 5:_=ae(h.child.stateNode);break;case 1:_=h.child.stateNode}gF(h,ne,_)}break;case 5:var ve=h.stateNode;_===null&&h.flags&4&&tt(ve,h.type,h.memoizedProps,h);break;case 6:break;case 4:break;case 12:break;case 13:if(qe&&h.memoizedState===null){var We=h.alternate;if(We!==null){var mt=We.memoizedState;if(mt!==null){var jt=mt.dehydrated;jt!==null&&L(jt)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(s(163))}Zc||h.flags&512&&F1(h)}catch(gn){Ha(h,h.return,gn)}}if(h===p){Lt=null;break}if(_=h.sibling,_!==null){_.return=h.return,Lt=_;break}Lt=h.return}}function AU(p){for(;Lt!==null;){var h=Lt;if(h===p){Lt=null;break}var _=h.sibling;if(_!==null){_.return=h.return,Lt=_;break}Lt=h.return}}function TU(p){for(;Lt!==null;){var h=Lt;try{switch(h.tag){case 0:case 11:case 15:var _=h.return;try{Jm(4,h)}catch(We){Ha(h,_,We)}break;case 1:var x=h.stateNode;if(typeof x.componentDidMount=="function"){var D=h.return;try{x.componentDidMount()}catch(We){Ha(h,D,We)}}var k=h.return;try{F1(h)}catch(We){Ha(h,k,We)}break;case 5:var ne=h.return;try{F1(h)}catch(We){Ha(h,ne,We)}}}catch(We){Ha(h,h.return,We)}if(h===p){Lt=null;break}var ve=h.sibling;if(ve!==null){ve.return=h.return,Lt=ve;break}Lt=h.return}}var sv=0,ov=1,lv=2,uv=3,cv=4;if(typeof Symbol=="function"&&Symbol.for){var eg=Symbol.for;sv=eg("selector.component"),ov=eg("selector.has_pseudo_class"),lv=eg("selector.role"),uv=eg("selector.test_id"),cv=eg("selector.text")}function G1(p){var h=re(p);if(h!=null){if(typeof h.memoizedProps["data-testname"]!="string")throw Error(s(364));return h}if(p=q(p),p===null)throw Error(s(362));return p.stateNode.current}function V1(p,h){switch(h.$$typeof){case sv:if(p.type===h.value)return!0;break;case ov:e:{h=h.value,p=[p,0];for(var _=0;_";case ov:return":has("+($1(p)||"")+")";case lv:return'[role="'+p.value+'"]';case cv:return'"'+p.value+'"';case uv:return'[data-testname="'+p.value+'"]';default:throw Error(s(365))}}function xU(p,h){var _=[];p=[p,0];for(var x=0;xD&&(D=ne),x&=~k}if(x=D,x=mr()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*MJ(x/1960))-x,10p?16:p,wu===null)var x=!1;else{if(p=wu,wu=null,mv=0,Cn&6)throw Error(s(331));var D=Cn;for(Cn|=4,Lt=p.current;Lt!==null;){var k=Lt,ne=k.child;if(Lt.flags&16){var ve=k.deletions;if(ve!==null){for(var We=0;Wemr()-q1?Jc(p,0):Y1|=_),za(p,h)}function LU(p,h){h===0&&(p.mode&1?(h=Gc,Gc<<=1,!(Gc&130023424)&&(Gc=4194304)):h=1);var _=Aa();p=yv(p,h),p!==null&&($c(p,h,_),za(p,_))}function PJ(p){var h=p.memoizedState,_=0;h!==null&&(_=h.retryLane),LU(p,_)}function BJ(p,h){var _=0;switch(p.tag){case 13:var x=p.stateNode,D=p.memoizedState;D!==null&&(_=D.retryLane);break;case 19:x=p.stateNode;break;default:throw Error(s(314))}x!==null&&x.delete(h),LU(p,_)}var kU;kU=function(p,h,_){if(p!==null)if(p.memoizedProps!==h.pendingProps||nn.current)us=!0;else{if(!(p.lanes&_)&&!(h.flags&128))return us=!1,TJ(p,h,_);us=!!(p.flags&131072)}else us=!1,Rr&&h.flags&1048576&&SF(h,Gy,h.index);switch(h.lanes=0,h.tag){case 2:var x=h.type;p!==null&&(p.alternate=null,h.alternate=null,h.flags|=2),p=h.pendingProps;var D=ir(h,pt.current);Jf(h,_),D=w1(null,h,x,p,D,_);var k=C1();return h.flags|=1,typeof D=="object"&&D!==null&&typeof D.render=="function"&&D.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,ar(x)?(k=!0,hn(h)):k=!1,h.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,p1(h),D.updater=zy,h.stateNode=D,D._reactInternals=h,m1(h,x,p,_),h=L1(null,h,x,!0,k,_)):(h.tag=0,Rr&&k&&g1(h),_a(null,h,D,_),h=h.child),h;case 16:x=h.elementType;e:{switch(p!==null&&(p.alternate=null,h.alternate=null,h.flags|=2),p=h.pendingProps,D=x._init,x=D(x._payload),h.type=x,D=h.tag=UJ(x),p=Dr(x,p),D){case 0:h=D1(null,h,x,p,_);break e;case 1:h=aU(null,h,x,p,_);break e;case 11:h=eU(null,h,x,p,_);break e;case 14:h=tU(null,h,x,Dr(x.type,p),_);break e}throw Error(s(306,x,""))}return h;case 0:return x=h.type,D=h.pendingProps,D=h.elementType===x?D:Dr(x,D),D1(p,h,x,D,_);case 1:return x=h.type,D=h.pendingProps,D=h.elementType===x?D:Dr(x,D),aU(p,h,x,D,_);case 3:e:{if(sU(h),p===null)throw Error(s(387));x=h.pendingProps,k=h.memoizedState,D=k.element,hF(p,h),Uy(h,x,null,_);var ne=h.memoizedState;if(x=ne.element,qe&&k.isDehydrated)if(k={element:x,isDehydrated:!1,cache:ne.cache,transitions:ne.transitions},h.updateQueue.baseState=k,h.memoizedState=k,h.flags&256){D=Error(s(423)),h=oU(p,h,x,_,D);break e}else if(x!==D){D=Error(s(424)),h=oU(p,h,x,_,D);break e}else for(qe&&(ls=Pt(h.stateNode.containerInfo),os=h,Rr=!0,oo=null,Hm=!1),_=CF(h,null,x,_),h.child=_;_;)_.flags=_.flags&-3|4096,_=_.sibling;else{if(np(),x===D){h=Il(p,h,_);break e}_a(p,h,x,_)}h=h.child}return h;case 5:return RF(h),p===null&&v1(h),x=h.type,D=h.pendingProps,k=p!==null?p.memoizedProps:null,ne=D.children,ke(x,D)?ne=null:k!==null&&ke(x,k)&&(h.flags|=32),iU(p,h),_a(p,h,ne,_),h.child;case 6:return p===null&&v1(h),null;case 13:return lU(p,h,_);case 4:return S1(h,h.stateNode.containerInfo),x=h.pendingProps,p===null?h.child=rp(h,null,x,_):_a(p,h,x,_),h.child;case 11:return x=h.type,D=h.pendingProps,D=h.elementType===x?D:Dr(x,D),eU(p,h,x,D,_);case 7:return _a(p,h,h.pendingProps,_),h.child;case 8:return _a(p,h,h.pendingProps.children,_),h.child;case 12:return _a(p,h,h.pendingProps.children,_),h.child;case 10:e:{if(x=h.type._context,D=h.pendingProps,k=h.memoizedProps,ne=D.value,pF(h,x,ne),k!==null)if(Is(k.value,ne)){if(k.children===D.children&&!nn.current){h=Il(p,h,_);break e}}else for(k=h.child,k!==null&&(k.return=h);k!==null;){var ve=k.dependencies;if(ve!==null){ne=k.child;for(var We=ve.firstContext;We!==null;){if(We.context===x){if(k.tag===1){We=xl(-1,_&-_),We.tag=2;var mt=k.updateQueue;if(mt!==null){mt=mt.shared;var jt=mt.pending;jt===null?We.next=We:(We.next=jt.next,jt.next=We),mt.pending=We}}k.lanes|=_,We=k.alternate,We!==null&&(We.lanes|=_),f1(k.return,_,h),ve.lanes|=_;break}We=We.next}}else if(k.tag===10)ne=k.type===h.type?null:k.child;else if(k.tag===18){if(ne=k.return,ne===null)throw Error(s(341));ne.lanes|=_,ve=ne.alternate,ve!==null&&(ve.lanes|=_),f1(ne,_,h),ne=k.sibling}else ne=k.child;if(ne!==null)ne.return=k;else for(ne=k;ne!==null;){if(ne===h){ne=null;break}if(k=ne.sibling,k!==null){k.return=ne.return,ne=k;break}ne=ne.return}k=ne}_a(p,h,D.children,_),h=h.child}return h;case 9:return D=h.type,x=h.pendingProps.children,Jf(h,_),D=Ms(D),x=x(D),h.flags|=1,_a(p,h,x,_),h.child;case 14:return x=h.type,D=Dr(x,h.pendingProps),D=Dr(x.type,D),tU(p,h,x,D,_);case 15:return nU(p,h,h.type,h.pendingProps,_);case 17:return x=h.type,D=h.pendingProps,D=h.elementType===x?D:Dr(x,D),p!==null&&(p.alternate=null,h.alternate=null,h.flags|=2),h.tag=1,ar(x)?(p=!0,hn(h)):p=!1,Jf(h,_),vF(h,x,D),m1(h,x,D,_),L1(null,h,x,!0,p,_);case 19:return fU(p,h,_);case 22:return rU(p,h,_)}throw Error(s(156,h.tag))};function PU(p,h){return Fm(p,h)}function FJ(p,h,_,x){this.tag=p,this.key=_,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ps(p,h,_,x){return new FJ(p,h,_,x)}function nw(p){return p=p.prototype,!(!p||!p.isReactComponent)}function UJ(p){if(typeof p=="function")return nw(p)?1:0;if(p!=null){if(p=p.$$typeof,p===y)return 11;if(p===E)return 14}return 2}function Iu(p,h){var _=p.alternate;return _===null?(_=Ps(p.tag,h,p.key,p.mode),_.elementType=p.elementType,_.type=p.type,_.stateNode=p.stateNode,_.alternate=p,p.alternate=_):(_.pendingProps=h,_.type=p.type,_.flags=0,_.subtreeFlags=0,_.deletions=null),_.flags=p.flags&14680064,_.childLanes=p.childLanes,_.lanes=p.lanes,_.child=p.child,_.memoizedProps=p.memoizedProps,_.memoizedState=p.memoizedState,_.updateQueue=p.updateQueue,h=p.dependencies,_.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},_.sibling=p.sibling,_.index=p.index,_.ref=p.ref,_}function Ev(p,h,_,x,D,k){var ne=2;if(x=p,typeof p=="function")nw(p)&&(ne=1);else if(typeof p=="string")ne=5;else e:switch(p){case c:return nd(_.children,D,k,h);case d:ne=8,D|=8;break;case f:return p=Ps(12,_,h,D|2),p.elementType=f,p.lanes=k,p;case v:return p=Ps(13,_,h,D),p.elementType=v,p.lanes=k,p;case b:return p=Ps(19,_,h,D),p.elementType=b,p.lanes=k,p;case A:return Sv(_,D,k,h);default:if(typeof p=="object"&&p!==null)switch(p.$$typeof){case m:ne=10;break e;case g:ne=9;break e;case y:ne=11;break e;case E:ne=14;break e;case S:ne=16,x=null;break e}throw Error(s(130,p==null?p:typeof p,""))}return h=Ps(ne,_,h,D),h.elementType=p,h.type=x,h.lanes=k,h}function nd(p,h,_,x){return p=Ps(7,p,x,h),p.lanes=_,p}function Sv(p,h,_,x){return p=Ps(22,p,x,h),p.elementType=A,p.lanes=_,p.stateNode={},p}function rw(p,h,_){return p=Ps(6,p,null,h),p.lanes=_,p}function iw(p,h,_){return h=Ps(4,p.children!==null?p.children:[],p.key,h),h.lanes=_,h.stateNode={containerInfo:p.containerInfo,pendingChildren:null,implementation:p.implementation},h}function zJ(p,h,_,x,D){this.tag=h,this.containerInfo=p,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Gt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bm(0),this.expirationTimes=Bm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bm(0),this.identifierPrefix=x,this.onRecoverableError=D,qe&&(this.mutableSourceEagerHydrationData=null)}function BU(p,h,_,x,D,k,ne,ve,We){return p=new zJ(p,h,_,ve,We),h===1?(h=1,k===!0&&(h|=8)):h=0,k=Ps(3,null,null,h),p.current=k,k.stateNode=p,k.memoizedState={element:x,isDehydrated:_,cache:null,transitions:null},p1(k),p}function FU(p){if(!p)return Nt;p=p._reactInternals;e:{if(N(p)!==p||p.tag!==1)throw Error(s(170));var h=p;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(ar(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(s(171))}if(p.tag===1){var _=p.type;if(ar(_))return un(p,_,h)}return h}function UU(p){var h=p._reactInternals;if(h===void 0)throw typeof p.render=="function"?Error(s(188)):(p=Object.keys(p).join(","),Error(s(268,p)));return p=G(h),p===null?null:p.stateNode}function zU(p,h){if(p=p.memoizedState,p!==null&&p.dehydrated!==null){var _=p.retryLane;p.retryLane=_!==0&&_=mt&&k>=gn&&D<=jt&&ne<=rn){p.splice(h,1);break}else if(x!==mt||_.width!==We.width||rnne){if(!(k!==gn||_.height!==We.height||jtD)){mt>x&&(We.width+=mt-x,We.x=x),jtk&&(We.height+=gn-k,We.y=k),rn_&&(_=ne)),ne ")+` +`+k.stack}return{value:p,source:h,stack:D}}function O1(p,h){try{console.error(h.value)}catch(S){setTimeout(function(){throw S})}}var _J=typeof WeakMap=="function"?WeakMap:Map;function YF(p,h,S){S=Tl(-1,S),S.tag=3,S.payload={element:null};var T=h.value;return S.callback=function(){pv||(pv=!0,K1=T),O1(p,h)},S}function qF(p,h,S){S=Tl(-1,S),S.tag=3;var T=p.type.getDerivedStateFromError;if(typeof T=="function"){var D=h.value;S.payload=function(){return T(D)},S.callback=function(){O1(p,h)}}var k=p.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(S.callback=function(){O1(p,h),typeof T!="function"&&(Tu===null?Tu=new Set([this]):Tu.add(this));var ne=h.stack;this.componentDidCatch(h.value,{componentStack:ne!==null?ne:""})}),S}function XF(p,h,S){var T=p.pingCache;if(T===null){T=p.pingCache=new _J;var D=new Set;T.set(h,D)}else D=T.get(h),D===void 0&&(D=new Set,T.set(h,D));D.has(S)||(D.add(S),p=kJ.bind(null,p,h,S),h.then(p,p))}function KF(p){do{var h;if((h=p.tag===13)&&(h=p.memoizedState,h=h!==null?h.dehydrated!==null:!0),h)return p;p=p.return}while(p!==null);return null}function ZF(p,h,S,T,D){return p.mode&1?(p.flags|=65536,p.lanes=D,p):(p===h?p.flags|=65536:(p.flags|=128,S.flags|=131072,S.flags&=-52805,S.tag===1&&(S.alternate===null?S.tag=17:(h=Tl(-1,1),h.tag=2,xu(S,h))),S.lanes|=1),p)}function $o(p){p.flags|=4}function QF(p,h){if(p!==null&&p.child===h.child)return!0;if(h.flags&16)return!1;for(p=h.child;p!==null;){if(p.flags&12854||p.subtreeFlags&12854)return!1;p=p.sibling}return!0}var Km,Zm,Qy,Jy;if(Mt)Km=function(p,h){for(var S=h.child;S!==null;){if(S.tag===5||S.tag===6)Ce(p,S.stateNode);else if(S.tag!==4&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===h)break;for(;S.sibling===null;){if(S.return===null||S.return===h)return;S=S.return}S.sibling.return=S.return,S=S.sibling}},Zm=function(){},Qy=function(p,h,S,T,D){if(p=p.memoizedProps,p!==T){var k=h.stateNode,ne=Go(Ds.current);S=j(k,S,p,T,D,ne),(h.updateQueue=S)&&$o(h)}},Jy=function(p,h,S,T){S!==T&&$o(h)};else if($e){Km=function(p,h,S,T){for(var D=h.child;D!==null;){if(D.tag===5){var k=D.stateNode;S&&T&&(k=pn(k,D.type,D.memoizedProps,D)),Ce(p,k)}else if(D.tag===6)k=D.stateNode,S&&T&&(k=Gn(k,D.memoizedProps,D)),Ce(p,k);else if(D.tag!==4){if(D.tag===22&&D.memoizedState!==null)k=D.child,k!==null&&(k.return=D),Km(p,D,!0,!0);else if(D.child!==null){D.child.return=D,D=D.child;continue}}if(D===h)break;for(;D.sibling===null;){if(D.return===null||D.return===h)return;D=D.return}D.sibling.return=D.return,D=D.sibling}};var JF=function(p,h,S,T){for(var D=h.child;D!==null;){if(D.tag===5){var k=D.stateNode;S&&T&&(k=pn(k,D.type,D.memoizedProps,D)),Xt(p,k)}else if(D.tag===6)k=D.stateNode,S&&T&&(k=Gn(k,D.memoizedProps,D)),Xt(p,k);else if(D.tag!==4){if(D.tag===22&&D.memoizedState!==null)k=D.child,k!==null&&(k.return=D),JF(p,D,!0,!0);else if(D.child!==null){D.child.return=D,D=D.child;continue}}if(D===h)break;for(;D.sibling===null;){if(D.return===null||D.return===h)return;D=D.return}D.sibling.return=D.return,D=D.sibling}};Zm=function(p,h){var S=h.stateNode;if(!QF(p,h)){p=S.containerInfo;var T=St(p);JF(T,h,!1,!1),S.pendingChildren=T,$o(h),mn(p,T)}},Qy=function(p,h,S,T,D){var k=p.stateNode,ne=p.memoizedProps;if((p=QF(p,h))&&ne===T)h.stateNode=k;else{var ve=h.stateNode,We=Go(Ds.current),mt=null;ne!==T&&(mt=j(ve,S,ne,T,D,We)),p&&mt===null?h.stateNode=k:(k=_t(k,mt,S,ne,T,h,p,ve),Le(k,S,T,D,We)&&$o(h),h.stateNode=k,p?$o(h):Km(k,h,!1,!1))}},Jy=function(p,h,S,T){S!==T?(p=Go(ip.current),S=Go(Ds.current),h.stateNode=Fe(T,p,S,h),$o(h)):h.stateNode=p.stateNode}}else Zm=function(){},Qy=function(){},Jy=function(){};function Qm(p,h){if(!Rr)switch(p.tailMode){case"hidden":h=p.tail;for(var S=null;h!==null;)h.alternate!==null&&(S=h),h=h.sibling;S===null?p.tail=null:S.sibling=null;break;case"collapsed":S=p.tail;for(var T=null;S!==null;)S.alternate!==null&&(T=S),S=S.sibling;T===null?h||p.tail===null?p.tail=null:p.tail.sibling=null:T.sibling=null}}function na(p){var h=p.alternate!==null&&p.alternate.child===p.child,S=0,T=0;if(h)for(var D=p.child;D!==null;)S|=D.lanes|D.childLanes,T|=D.subtreeFlags&14680064,T|=D.flags&14680064,D.return=p,D=D.sibling;else for(D=p.child;D!==null;)S|=D.lanes|D.childLanes,T|=D.subtreeFlags,T|=D.flags,D.return=p,D=D.sibling;return p.subtreeFlags|=T,p.childLanes=S,h}function SJ(p,h,S){var T=h.pendingProps;switch(b1(h),h.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return na(h),null;case 1:return ar(h.type)&&Wn(),na(h),null;case 3:return T=h.stateNode,ap(),wt(nn),wt(pt),x1(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(p===null||p.child===null)&&(Gm(h)?$o(h):p===null||p.memoizedState.isDehydrated&&!(h.flags&256)||(h.flags|=1024,oo!==null&&(J1(oo),oo=null))),Zm(p,h),na(h),null;case 5:S1(h),S=Go(ip.current);var D=h.type;if(p!==null&&h.stateNode!=null)Qy(p,h,D,T,S),p.ref!==h.ref&&(h.flags|=512,h.flags|=2097152);else{if(!T){if(h.stateNode===null)throw Error(s(166));return na(h),null}if(p=Go(Ds.current),Gm(h)){if(!qe)throw Error(s(175));p=P(h.stateNode,h.type,h.memoizedProps,S,p,h,!Hm),h.updateQueue=p,p!==null&&$o(h)}else{var k=fe(D,T,S,p,h);Km(k,h,!1,!1),h.stateNode=k,Le(k,D,T,S,p)&&$o(h)}h.ref!==null&&(h.flags|=512,h.flags|=2097152)}return na(h),null;case 6:if(p&&h.stateNode!=null)Jy(p,h,p.memoizedProps,T);else{if(typeof T!="string"&&h.stateNode===null)throw Error(s(166));if(p=Go(ip.current),S=Go(Ds.current),Gm(h)){if(!qe)throw Error(s(176));if(p=h.stateNode,T=h.memoizedProps,(S=z(p,T,h,!Hm))&&(D=os,D!==null))switch(k=(D.mode&1)!==0,D.tag){case 3:Q(D.stateNode.containerInfo,p,T,k);break;case 5:Ee(D.type,D.memoizedProps,D.stateNode,p,T,k)}S&&$o(h)}else h.stateNode=Fe(T,p,S,h)}return na(h),null;case 13:if(wt(Lr),T=h.memoizedState,Rr&&ls!==null&&h.mode&1&&!(h.flags&128)){for(p=ls;p;)p=Kt(p);return np(),h.flags|=98560,h}if(T!==null&&T.dehydrated!==null){if(T=Gm(h),p===null){if(!T)throw Error(s(318));if(!qe)throw Error(s(344));if(p=h.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));oe(p,h)}else np(),!(h.flags&128)&&(h.memoizedState=null),h.flags|=4;return na(h),null}return oo!==null&&(J1(oo),oo=null),h.flags&128?(h.lanes=S,h):(T=T!==null,S=!1,p===null?Gm(h):S=p.memoizedState!==null,T&&!S&&(h.child.flags|=8192,h.mode&1&&(p===null||Lr.current&1?hi===0&&(hi=3):tw())),h.updateQueue!==null&&(h.flags|=4),na(h),null);case 4:return ap(),Zm(p,h),p===null&&At(h.stateNode.containerInfo),na(h),null;case 10:return d1(h.type._context),na(h),null;case 17:return ar(h.type)&&Wn(),na(h),null;case 19:if(wt(Lr),D=h.memoizedState,D===null)return na(h),null;if(T=(h.flags&128)!==0,k=D.rendering,k===null)if(T)Qm(D,!1);else{if(hi!==0||p!==null&&p.flags&128)for(p=h.child;p!==null;){if(k=$y(p),k!==null){for(h.flags|=128,Qm(D,!1),p=k.updateQueue,p!==null&&(h.updateQueue=p,h.flags|=4),h.subtreeFlags=0,p=S,T=h.child;T!==null;)S=T,D=p,S.flags&=14680066,k=S.alternate,k===null?(S.childLanes=0,S.lanes=D,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=k.childLanes,S.lanes=k.lanes,S.child=k.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=k.memoizedProps,S.memoizedState=k.memoizedState,S.updateQueue=k.updateQueue,S.type=k.type,D=k.dependencies,S.dependencies=D===null?null:{lanes:D.lanes,firstContext:D.firstContext}),T=T.sibling;return Tt(Lr,Lr.current&1|2),h.child}p=p.sibling}D.tail!==null&&mr()>X1&&(h.flags|=128,T=!0,Qm(D,!1),h.lanes=4194304)}else{if(!T)if(p=$y(k),p!==null){if(h.flags|=128,T=!0,p=p.updateQueue,p!==null&&(h.updateQueue=p,h.flags|=4),Qm(D,!0),D.tail===null&&D.tailMode==="hidden"&&!k.alternate&&!Rr)return na(h),null}else 2*mr()-D.renderingStartTime>X1&&S!==1073741824&&(h.flags|=128,T=!0,Qm(D,!1),h.lanes=4194304);D.isBackwards?(k.sibling=h.child,h.child=k):(p=D.last,p!==null?p.sibling=k:h.child=k,D.last=k)}return D.tail!==null?(h=D.tail,D.rendering=h,D.tail=h.sibling,D.renderingStartTime=mr(),h.sibling=null,p=Lr.current,Tt(Lr,T?p&1|2:p&1),h):(na(h),null);case 22:case 23:return ew(),T=h.memoizedState!==null,p!==null&&p.memoizedState!==null!==T&&(h.flags|=8192),T&&h.mode&1?cs&1073741824&&(na(h),Mt&&h.subtreeFlags&6&&(h.flags|=8192)):na(h),null;case 24:return null;case 25:return null}throw Error(s(156,h.tag))}var AJ=o.ReactCurrentOwner,us=!1;function Sa(p,h,S,T){h.child=p===null?CF(h,null,S,T):rp(h,p.child,S,T)}function eU(p,h,S,T,D){S=S.render;var k=h.ref;return Jf(h,D),T=w1(p,h,S,T,k,D),S=C1(),p!==null&&!us?(h.updateQueue=p.updateQueue,h.flags&=-2053,p.lanes&=~D,Il(p,h,D)):(Rr&&S&&g1(h),h.flags|=1,Sa(p,h,T,D),h.child)}function tU(p,h,S,T,D){if(p===null){var k=S.type;return typeof k=="function"&&!nw(k)&&k.defaultProps===void 0&&S.compare===null&&S.defaultProps===void 0?(h.tag=15,h.type=k,nU(p,h,k,T,D)):(p=Ev(S.type,null,T,h,h.mode,D),p.ref=h.ref,p.return=h,h.child=p)}if(k=p.child,!(p.lanes&D)){var ne=k.memoizedProps;if(S=S.compare,S=S!==null?S:Pn,S(ne,T)&&p.ref===h.ref)return Il(p,h,D)}return h.flags|=1,p=Iu(k,T),p.ref=h.ref,p.return=h,h.child=p}function nU(p,h,S,T,D){if(p!==null&&Pn(p.memoizedProps,T)&&p.ref===h.ref)if(us=!1,(p.lanes&D)!==0)p.flags&131072&&(us=!0);else return h.lanes=p.lanes,Il(p,h,D);return D1(p,h,S,T,D)}function rU(p,h,S){var T=h.pendingProps,D=T.children,k=p!==null?p.memoizedState:null;if(T.mode==="hidden")if(!(h.mode&1))h.memoizedState={baseLanes:0,cachePool:null},Tt(op,cs),cs|=S;else if(S&1073741824)h.memoizedState={baseLanes:0,cachePool:null},T=k!==null?k.baseLanes:S,Tt(op,cs),cs|=T;else return p=k!==null?k.baseLanes|S:S,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:p,cachePool:null},h.updateQueue=null,Tt(op,cs),cs|=p,null;else k!==null?(T=k.baseLanes|S,h.memoizedState=null):T=S,Tt(op,cs),cs|=T;return Sa(p,h,D,S),h.child}function iU(p,h){var S=h.ref;(p===null&&S!==null||p!==null&&p.ref!==S)&&(h.flags|=512,h.flags|=2097152)}function D1(p,h,S,T,D){var k=ar(S)?Zt:pt.current;return k=ir(h,k),Jf(h,D),S=w1(p,h,S,T,k,D),T=C1(),p!==null&&!us?(h.updateQueue=p.updateQueue,h.flags&=-2053,p.lanes&=~D,Il(p,h,D)):(Rr&&T&&g1(h),h.flags|=1,Sa(p,h,S,D),h.child)}function aU(p,h,S,T,D){if(ar(S)){var k=!0;hn(h)}else k=!1;if(Jf(h,D),h.stateNode===null)p!==null&&(p.alternate=null,h.alternate=null,h.flags|=2),vF(h,S,T),m1(h,S,T,D),T=!0;else if(p===null){var ne=h.stateNode,ve=h.memoizedProps;ne.props=ve;var We=ne.context,mt=S.contextType;typeof mt=="object"&&mt!==null?mt=Ms(mt):(mt=ar(S)?Zt:pt.current,mt=ir(h,mt));var jt=S.getDerivedStateFromProps,gn=typeof jt=="function"||typeof ne.getSnapshotBeforeUpdate=="function";gn||typeof ne.UNSAFE_componentWillReceiveProps!="function"&&typeof ne.componentWillReceiveProps!="function"||(ve!==T||We!==mt)&&EF(h,ne,T,mt),Au=!1;var rn=h.memoizedState;ne.state=rn,Uy(h,T,ne,D),We=h.memoizedState,ve!==T||rn!==We||nn.current||Au?(typeof jt=="function"&&(h1(h,S,jt,T),We=h.memoizedState),(ve=Au||yF(h,S,ve,T,rn,We,mt))?(gn||typeof ne.UNSAFE_componentWillMount!="function"&&typeof ne.componentWillMount!="function"||(typeof ne.componentWillMount=="function"&&ne.componentWillMount(),typeof ne.UNSAFE_componentWillMount=="function"&&ne.UNSAFE_componentWillMount()),typeof ne.componentDidMount=="function"&&(h.flags|=4194308)):(typeof ne.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=T,h.memoizedState=We),ne.props=T,ne.state=We,ne.context=mt,T=ve):(typeof ne.componentDidMount=="function"&&(h.flags|=4194308),T=!1)}else{ne=h.stateNode,hF(p,h),ve=h.memoizedProps,mt=h.type===h.elementType?ve:Dr(h.type,ve),ne.props=mt,gn=h.pendingProps,rn=ne.context,We=S.contextType,typeof We=="object"&&We!==null?We=Ms(We):(We=ar(S)?Zt:pt.current,We=ir(h,We));var pr=S.getDerivedStateFromProps;(jt=typeof pr=="function"||typeof ne.getSnapshotBeforeUpdate=="function")||typeof ne.UNSAFE_componentWillReceiveProps!="function"&&typeof ne.componentWillReceiveProps!="function"||(ve!==gn||rn!==We)&&EF(h,ne,T,We),Au=!1,rn=h.memoizedState,ne.state=rn,Uy(h,T,ne,D);var Jt=h.memoizedState;ve!==gn||rn!==Jt||nn.current||Au?(typeof pr=="function"&&(h1(h,S,pr,T),Jt=h.memoizedState),(mt=Au||yF(h,S,mt,T,rn,Jt,We)||!1)?(jt||typeof ne.UNSAFE_componentWillUpdate!="function"&&typeof ne.componentWillUpdate!="function"||(typeof ne.componentWillUpdate=="function"&&ne.componentWillUpdate(T,Jt,We),typeof ne.UNSAFE_componentWillUpdate=="function"&&ne.UNSAFE_componentWillUpdate(T,Jt,We)),typeof ne.componentDidUpdate=="function"&&(h.flags|=4),typeof ne.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof ne.componentDidUpdate!="function"||ve===p.memoizedProps&&rn===p.memoizedState||(h.flags|=4),typeof ne.getSnapshotBeforeUpdate!="function"||ve===p.memoizedProps&&rn===p.memoizedState||(h.flags|=1024),h.memoizedProps=T,h.memoizedState=Jt),ne.props=T,ne.state=Jt,ne.context=We,T=mt):(typeof ne.componentDidUpdate!="function"||ve===p.memoizedProps&&rn===p.memoizedState||(h.flags|=4),typeof ne.getSnapshotBeforeUpdate!="function"||ve===p.memoizedProps&&rn===p.memoizedState||(h.flags|=1024),T=!1)}return L1(p,h,S,T,k,D)}function L1(p,h,S,T,D,k){iU(p,h);var ne=(h.flags&128)!==0;if(!T&&!ne)return D&&An(h,S,!1),Il(p,h,k);T=h.stateNode,AJ.current=h;var ve=ne&&typeof S.getDerivedStateFromError!="function"?null:T.render();return h.flags|=1,p!==null&&ne?(h.child=rp(h,p.child,null,k),h.child=rp(h,null,ve,k)):Sa(p,h,ve,k),h.memoizedState=T.state,D&&An(h,S,!0),h.child}function sU(p){var h=p.stateNode;h.pendingContext?Rn(p,h.pendingContext,h.pendingContext!==h.context):h.context&&Rn(p,h.context,!1),_1(p,h.containerInfo)}function oU(p,h,S,T,D){return np(),E1(D),h.flags|=256,Sa(p,h,S,T),h.child}var ev={dehydrated:null,treeContext:null,retryLane:0};function tv(p){return{baseLanes:p,cachePool:null}}function lU(p,h,S){var T=h.pendingProps,D=Lr.current,k=!1,ne=(h.flags&128)!==0,ve;if((ve=ne)||(ve=p!==null&&p.memoizedState===null?!1:(D&2)!==0),ve?(k=!0,h.flags&=-129):(p===null||p.memoizedState!==null)&&(D|=1),Tt(Lr,D&1),p===null)return v1(h),p=h.memoizedState,p!==null&&(p=p.dehydrated,p!==null)?(h.mode&1?Ct(p)?h.lanes=8:h.lanes=1073741824:h.lanes=1,null):(D=T.children,p=T.fallback,k?(T=h.mode,k=h.child,D={mode:"hidden",children:D},!(T&1)&&k!==null?(k.childLanes=0,k.pendingProps=D):k=_v(D,T,0,null),p=nd(p,T,S,null),k.return=h,p.return=h,k.sibling=p,h.child=k,h.child.memoizedState=tv(S),h.memoizedState=ev,p):k1(h,D));if(D=p.memoizedState,D!==null){if(ve=D.dehydrated,ve!==null){if(ne)return h.flags&256?(h.flags&=-257,nv(p,h,S,Error(s(422)))):h.memoizedState!==null?(h.child=p.child,h.flags|=128,null):(k=T.fallback,D=h.mode,T=_v({mode:"visible",children:T.children},D,0,null),k=nd(k,D,S,null),k.flags|=2,T.return=h,k.return=h,T.sibling=k,h.child=T,h.mode&1&&rp(h,p.child,null,S),h.child.memoizedState=tv(S),h.memoizedState=ev,k);if(!(h.mode&1))h=nv(p,h,S,null);else if(Ct(ve))h=nv(p,h,S,Error(s(419)));else if(T=(S&p.childLanes)!==0,us||T){if(T=ai,T!==null){switch(S&-S){case 4:k=2;break;case 16:k=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:k=32;break;case 536870912:k=268435456;break;default:k=0}T=k&(T.suspendedLanes|S)?0:k,T!==0&&T!==D.retryLane&&(D.retryLane=T,ks(p,T,-1))}tw(),h=nv(p,h,S,Error(s(421)))}else Ze(ve)?(h.flags|=128,h.child=p.child,h=PJ.bind(null,p),kt(ve,h),h=null):(S=D.treeContext,qe&&(ls=Rt(ve),os=h,Rr=!0,oo=null,Hm=!1,S!==null&&(Ns[Os++]=wl,Ns[Os++]=Cl,Ns[Os++]=qc,wl=S.id,Cl=S.overflow,qc=h)),h=k1(h,h.pendingProps.children),h.flags|=4096);return h}return k?(T=cU(p,h,T.children,T.fallback,S),k=h.child,D=p.child.memoizedState,k.memoizedState=D===null?tv(S):{baseLanes:D.baseLanes|S,cachePool:null},k.childLanes=p.childLanes&~S,h.memoizedState=ev,T):(S=uU(p,h,T.children,S),h.memoizedState=null,S)}return k?(T=cU(p,h,T.children,T.fallback,S),k=h.child,D=p.child.memoizedState,k.memoizedState=D===null?tv(S):{baseLanes:D.baseLanes|S,cachePool:null},k.childLanes=p.childLanes&~S,h.memoizedState=ev,T):(S=uU(p,h,T.children,S),h.memoizedState=null,S)}function k1(p,h){return h=_v({mode:"visible",children:h},p.mode,0,null),h.return=p,p.child=h}function uU(p,h,S,T){var D=p.child;return p=D.sibling,S=Iu(D,{mode:"visible",children:S}),!(h.mode&1)&&(S.lanes=T),S.return=h,S.sibling=null,p!==null&&(T=h.deletions,T===null?(h.deletions=[p],h.flags|=16):T.push(p)),h.child=S}function cU(p,h,S,T,D){var k=h.mode;p=p.child;var ne=p.sibling,ve={mode:"hidden",children:S};return!(k&1)&&h.child!==p?(S=h.child,S.childLanes=0,S.pendingProps=ve,h.deletions=null):(S=Iu(p,ve),S.subtreeFlags=p.subtreeFlags&14680064),ne!==null?T=Iu(ne,T):(T=nd(T,k,D,null),T.flags|=2),T.return=h,S.return=h,S.sibling=T,h.child=S,T}function nv(p,h,S,T){return T!==null&&E1(T),rp(h,p.child,null,S),p=k1(h,h.pendingProps.children),p.flags|=2,h.memoizedState=null,p}function dU(p,h,S){p.lanes|=h;var T=p.alternate;T!==null&&(T.lanes|=h),f1(p.return,h,S)}function P1(p,h,S,T,D){var k=p.memoizedState;k===null?p.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:T,tail:S,tailMode:D}:(k.isBackwards=h,k.rendering=null,k.renderingStartTime=0,k.last=T,k.tail=S,k.tailMode=D)}function fU(p,h,S){var T=h.pendingProps,D=T.revealOrder,k=T.tail;if(Sa(p,h,T.children,S),T=Lr.current,T&2)T=T&1|2,h.flags|=128;else{if(p!==null&&p.flags&128)e:for(p=h.child;p!==null;){if(p.tag===13)p.memoizedState!==null&&dU(p,S,h);else if(p.tag===19)dU(p,S,h);else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===h)break e;for(;p.sibling===null;){if(p.return===null||p.return===h)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}T&=1}if(Tt(Lr,T),!(h.mode&1))h.memoizedState=null;else switch(D){case"forwards":for(S=h.child,D=null;S!==null;)p=S.alternate,p!==null&&$y(p)===null&&(D=S),S=S.sibling;S=D,S===null?(D=h.child,h.child=null):(D=S.sibling,S.sibling=null),P1(h,!1,D,S,k);break;case"backwards":for(S=null,D=h.child,h.child=null;D!==null;){if(p=D.alternate,p!==null&&$y(p)===null){h.child=D;break}p=D.sibling,D.sibling=S,S=D,D=p}P1(h,!0,S,null,k);break;case"together":P1(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function Il(p,h,S){if(p!==null&&(h.dependencies=p.dependencies),lp|=h.lanes,!(S&h.childLanes))return null;if(p!==null&&h.child!==p.child)throw Error(s(153));if(h.child!==null){for(p=h.child,S=Iu(p,p.pendingProps),h.child=S,S.return=h;p.sibling!==null;)p=p.sibling,S=S.sibling=Iu(p,p.pendingProps),S.return=h;S.sibling=null}return h.child}function xJ(p,h,S){switch(h.tag){case 3:sU(h),np();break;case 5:RF(h);break;case 1:ar(h.type)&&hn(h);break;case 4:_1(h,h.stateNode.containerInfo);break;case 10:pF(h,h.type._context,h.memoizedProps.value);break;case 13:var T=h.memoizedState;if(T!==null)return T.dehydrated!==null?(Tt(Lr,Lr.current&1),h.flags|=128,null):S&h.child.childLanes?lU(p,h,S):(Tt(Lr,Lr.current&1),p=Il(p,h,S),p!==null?p.sibling:null);Tt(Lr,Lr.current&1);break;case 19:if(T=(S&h.childLanes)!==0,p.flags&128){if(T)return fU(p,h,S);h.flags|=128}var D=h.memoizedState;if(D!==null&&(D.rendering=null,D.tail=null,D.lastEffect=null),Tt(Lr,Lr.current),T)break;return null;case 22:case 23:return h.lanes=0,rU(p,h,S)}return Il(p,h,S)}function TJ(p,h){switch(b1(h),h.tag){case 1:return ar(h.type)&&Wn(),p=h.flags,p&65536?(h.flags=p&-65537|128,h):null;case 3:return ap(),wt(nn),wt(pt),x1(),p=h.flags,p&65536&&!(p&128)?(h.flags=p&-65537|128,h):null;case 5:return S1(h),null;case 13:if(wt(Lr),p=h.memoizedState,p!==null&&p.dehydrated!==null){if(h.alternate===null)throw Error(s(340));np()}return p=h.flags,p&65536?(h.flags=p&-65537|128,h):null;case 19:return wt(Lr),null;case 4:return ap(),null;case 10:return d1(h.type._context),null;case 22:case 23:return ew(),null;case 24:return null;default:return null}}var rv=!1,Zc=!1,wJ=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function iv(p,h){var S=p.ref;if(S!==null)if(typeof S=="function")try{S(null)}catch(T){Ha(p,h,T)}else S.current=null}function B1(p,h,S){try{S()}catch(T){Ha(p,h,T)}}var pU=!1;function CJ(p,h){for(ie(p.containerInfo),Lt=h;Lt!==null;)if(p=Lt,h=p.child,(p.subtreeFlags&1028)!==0&&h!==null)h.return=p,Lt=h;else for(;Lt!==null;){p=Lt;try{var S=p.alternate;if(p.flags&1024)switch(p.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var T=S.memoizedProps,D=S.memoizedState,k=p.stateNode,ne=k.getSnapshotBeforeUpdate(p.elementType===p.type?T:Dr(p.type,T),D);k.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:Mt&&Xe(p.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(ve){Ha(p,p.return,ve)}if(h=p.sibling,h!==null){h.return=p.return,Lt=h;break}Lt=p.return}return S=pU,pU=!1,S}function Qc(p,h,S){var T=h.updateQueue;if(T=T!==null?T.lastEffect:null,T!==null){var D=T=T.next;do{if((D.tag&p)===p){var k=D.destroy;D.destroy=void 0,k!==void 0&&B1(h,S,k)}D=D.next}while(D!==T)}}function Jm(p,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var S=h=h.next;do{if((S.tag&p)===p){var T=S.create;S.destroy=T()}S=S.next}while(S!==h)}}function F1(p){var h=p.ref;if(h!==null){var S=p.stateNode;switch(p.tag){case 5:p=ae(S);break;default:p=S}typeof h=="function"?h(p):h.current=p}}function hU(p,h,S){if(Rs&&typeof Rs.onCommitFiberUnmount=="function")try{Rs.onCommitFiberUnmount(jc,h)}catch{}switch(h.tag){case 0:case 11:case 14:case 15:if(p=h.updateQueue,p!==null&&(p=p.lastEffect,p!==null)){var T=p=p.next;do{var D=T,k=D.destroy;D=D.tag,k!==void 0&&(D&2||D&4)&&B1(h,S,k),T=T.next}while(T!==p)}break;case 1:if(iv(h,S),p=h.stateNode,typeof p.componentWillUnmount=="function")try{p.props=h.memoizedProps,p.state=h.memoizedState,p.componentWillUnmount()}catch(ne){Ha(h,S,ne)}break;case 5:iv(h,S);break;case 4:Mt?EU(p,h,S):$e&&$e&&(h=h.stateNode.containerInfo,S=St(h),Hn(h,S))}}function mU(p,h,S){for(var T=h;;)if(hU(p,T,S),T.child===null||Mt&&T.tag===4){if(T===h)break;for(;T.sibling===null;){if(T.return===null||T.return===h)return;T=T.return}T.sibling.return=T.return,T=T.sibling}else T.child.return=T,T=T.child}function gU(p){var h=p.alternate;h!==null&&(p.alternate=null,gU(h)),p.child=null,p.deletions=null,p.sibling=null,p.tag===5&&(h=p.stateNode,h!==null&&xt(h)),p.stateNode=null,p.return=null,p.dependencies=null,p.memoizedProps=null,p.memoizedState=null,p.pendingProps=null,p.stateNode=null,p.updateQueue=null}function bU(p){return p.tag===5||p.tag===3||p.tag===4}function yU(p){e:for(;;){for(;p.sibling===null;){if(p.return===null||bU(p.return))return null;p=p.return}for(p.sibling.return=p.return,p=p.sibling;p.tag!==5&&p.tag!==6&&p.tag!==18;){if(p.flags&2||p.child===null||p.tag===4)continue e;p.child.return=p,p=p.child}if(!(p.flags&2))return p.stateNode}}function vU(p){if(Mt){e:{for(var h=p.return;h!==null;){if(bU(h))break e;h=h.return}throw Error(s(160))}var S=h;switch(S.tag){case 5:h=S.stateNode,S.flags&32&&(De(h),S.flags&=-33),S=yU(p),z1(p,S,h);break;case 3:case 4:h=S.stateNode.containerInfo,S=yU(p),U1(p,S,h);break;default:throw Error(s(161))}}}function U1(p,h,S){var T=p.tag;if(T===5||T===6)p=p.stateNode,h?Dt(S,p,h):ht(S,p);else if(T!==4&&(p=p.child,p!==null))for(U1(p,h,S),p=p.sibling;p!==null;)U1(p,h,S),p=p.sibling}function z1(p,h,S){var T=p.tag;if(T===5||T===6)p=p.stateNode,h?zt(S,p,h):nt(S,p);else if(T!==4&&(p=p.child,p!==null))for(z1(p,h,S),p=p.sibling;p!==null;)z1(p,h,S),p=p.sibling}function EU(p,h,S){for(var T=h,D=!1,k,ne;;){if(!D){D=T.return;e:for(;;){if(D===null)throw Error(s(160));switch(k=D.stateNode,D.tag){case 5:ne=!1;break e;case 3:k=k.containerInfo,ne=!0;break e;case 4:k=k.containerInfo,ne=!0;break e}D=D.return}D=!0}if(T.tag===5||T.tag===6)mU(p,T,S),ne?me(k,T.stateNode):bt(k,T.stateNode);else if(T.tag===18)ne?le(k,T.stateNode):X(k,T.stateNode);else if(T.tag===4){if(T.child!==null){k=T.stateNode.containerInfo,ne=!0,T.child.return=T,T=T.child;continue}}else if(hU(p,T,S),T.child!==null){T.child.return=T,T=T.child;continue}if(T===h)break;for(;T.sibling===null;){if(T.return===null||T.return===h)return;T=T.return,T.tag===4&&(D=!1)}T.sibling.return=T.return,T=T.sibling}}function H1(p,h){if(Mt){switch(h.tag){case 0:case 11:case 14:case 15:Qc(3,h,h.return),Jm(3,h),Qc(5,h,h.return);return;case 1:return;case 5:var S=h.stateNode;if(S!=null){var T=h.memoizedProps;p=p!==null?p.memoizedProps:T;var D=h.type,k=h.updateQueue;h.updateQueue=null,k!==null&&Et(S,k,D,p,T,h)}return;case 6:if(h.stateNode===null)throw Error(s(162));S=h.memoizedProps,tn(h.stateNode,p!==null?p.memoizedProps:S,S);return;case 3:qe&&p!==null&&p.memoizedState.isDehydrated&&Re(h.stateNode.containerInfo);return;case 12:return;case 13:av(h);return;case 19:av(h);return;case 17:return}throw Error(s(163))}switch(h.tag){case 0:case 11:case 14:case 15:Qc(3,h,h.return),Jm(3,h),Qc(5,h,h.return);return;case 12:return;case 13:av(h);return;case 19:av(h);return;case 3:qe&&p!==null&&p.memoizedState.isDehydrated&&Re(h.stateNode.containerInfo);break;case 22:case 23:return}e:if($e){switch(h.tag){case 1:case 5:case 6:break e;case 3:case 4:h=h.stateNode,Hn(h.containerInfo,h.pendingChildren);break e}throw Error(s(163))}}function av(p){var h=p.updateQueue;if(h!==null){p.updateQueue=null;var S=p.stateNode;S===null&&(S=p.stateNode=new wJ),h.forEach(function(T){var D=BJ.bind(null,p,T);S.has(T)||(S.add(T),T.then(D,D))})}}function RJ(p,h){for(Lt=h;Lt!==null;){h=Lt;var S=h.deletions;if(S!==null)for(var T=0;T";case ov:return":has("+($1(p)||"")+")";case lv:return'[role="'+p.value+'"]';case cv:return'"'+p.value+'"';case uv:return'[data-testname="'+p.value+'"]';default:throw Error(s(365))}}function TU(p,h){var S=[];p=[p,0];for(var T=0;TD&&(D=ne),T&=~k}if(T=D,T=mr()-T,T=(120>T?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*MJ(T/1960))-T,10p?16:p,wu===null)var T=!1;else{if(p=wu,wu=null,mv=0,Cn&6)throw Error(s(331));var D=Cn;for(Cn|=4,Lt=p.current;Lt!==null;){var k=Lt,ne=k.child;if(Lt.flags&16){var ve=k.deletions;if(ve!==null){for(var We=0;Wemr()-q1?Jc(p,0):Y1|=S),za(p,h)}function LU(p,h){h===0&&(p.mode&1?(h=Gc,Gc<<=1,!(Gc&130023424)&&(Gc=4194304)):h=1);var S=Aa();p=yv(p,h),p!==null&&($c(p,h,S),za(p,S))}function PJ(p){var h=p.memoizedState,S=0;h!==null&&(S=h.retryLane),LU(p,S)}function BJ(p,h){var S=0;switch(p.tag){case 13:var T=p.stateNode,D=p.memoizedState;D!==null&&(S=D.retryLane);break;case 19:T=p.stateNode;break;default:throw Error(s(314))}T!==null&&T.delete(h),LU(p,S)}var kU;kU=function(p,h,S){if(p!==null)if(p.memoizedProps!==h.pendingProps||nn.current)us=!0;else{if(!(p.lanes&S)&&!(h.flags&128))return us=!1,xJ(p,h,S);us=!!(p.flags&131072)}else us=!1,Rr&&h.flags&1048576&&_F(h,Gy,h.index);switch(h.lanes=0,h.tag){case 2:var T=h.type;p!==null&&(p.alternate=null,h.alternate=null,h.flags|=2),p=h.pendingProps;var D=ir(h,pt.current);Jf(h,S),D=w1(null,h,T,p,D,S);var k=C1();return h.flags|=1,typeof D=="object"&&D!==null&&typeof D.render=="function"&&D.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,ar(T)?(k=!0,hn(h)):k=!1,h.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,p1(h),D.updater=zy,h.stateNode=D,D._reactInternals=h,m1(h,T,p,S),h=L1(null,h,T,!0,k,S)):(h.tag=0,Rr&&k&&g1(h),Sa(null,h,D,S),h=h.child),h;case 16:T=h.elementType;e:{switch(p!==null&&(p.alternate=null,h.alternate=null,h.flags|=2),p=h.pendingProps,D=T._init,T=D(T._payload),h.type=T,D=h.tag=UJ(T),p=Dr(T,p),D){case 0:h=D1(null,h,T,p,S);break e;case 1:h=aU(null,h,T,p,S);break e;case 11:h=eU(null,h,T,p,S);break e;case 14:h=tU(null,h,T,Dr(T.type,p),S);break e}throw Error(s(306,T,""))}return h;case 0:return T=h.type,D=h.pendingProps,D=h.elementType===T?D:Dr(T,D),D1(p,h,T,D,S);case 1:return T=h.type,D=h.pendingProps,D=h.elementType===T?D:Dr(T,D),aU(p,h,T,D,S);case 3:e:{if(sU(h),p===null)throw Error(s(387));T=h.pendingProps,k=h.memoizedState,D=k.element,hF(p,h),Uy(h,T,null,S);var ne=h.memoizedState;if(T=ne.element,qe&&k.isDehydrated)if(k={element:T,isDehydrated:!1,cache:ne.cache,transitions:ne.transitions},h.updateQueue.baseState=k,h.memoizedState=k,h.flags&256){D=Error(s(423)),h=oU(p,h,T,S,D);break e}else if(T!==D){D=Error(s(424)),h=oU(p,h,T,S,D);break e}else for(qe&&(ls=Pt(h.stateNode.containerInfo),os=h,Rr=!0,oo=null,Hm=!1),S=CF(h,null,T,S),h.child=S;S;)S.flags=S.flags&-3|4096,S=S.sibling;else{if(np(),T===D){h=Il(p,h,S);break e}Sa(p,h,T,S)}h=h.child}return h;case 5:return RF(h),p===null&&v1(h),T=h.type,D=h.pendingProps,k=p!==null?p.memoizedProps:null,ne=D.children,ke(T,D)?ne=null:k!==null&&ke(T,k)&&(h.flags|=32),iU(p,h),Sa(p,h,ne,S),h.child;case 6:return p===null&&v1(h),null;case 13:return lU(p,h,S);case 4:return _1(h,h.stateNode.containerInfo),T=h.pendingProps,p===null?h.child=rp(h,null,T,S):Sa(p,h,T,S),h.child;case 11:return T=h.type,D=h.pendingProps,D=h.elementType===T?D:Dr(T,D),eU(p,h,T,D,S);case 7:return Sa(p,h,h.pendingProps,S),h.child;case 8:return Sa(p,h,h.pendingProps.children,S),h.child;case 12:return Sa(p,h,h.pendingProps.children,S),h.child;case 10:e:{if(T=h.type._context,D=h.pendingProps,k=h.memoizedProps,ne=D.value,pF(h,T,ne),k!==null)if(Is(k.value,ne)){if(k.children===D.children&&!nn.current){h=Il(p,h,S);break e}}else for(k=h.child,k!==null&&(k.return=h);k!==null;){var ve=k.dependencies;if(ve!==null){ne=k.child;for(var We=ve.firstContext;We!==null;){if(We.context===T){if(k.tag===1){We=Tl(-1,S&-S),We.tag=2;var mt=k.updateQueue;if(mt!==null){mt=mt.shared;var jt=mt.pending;jt===null?We.next=We:(We.next=jt.next,jt.next=We),mt.pending=We}}k.lanes|=S,We=k.alternate,We!==null&&(We.lanes|=S),f1(k.return,S,h),ve.lanes|=S;break}We=We.next}}else if(k.tag===10)ne=k.type===h.type?null:k.child;else if(k.tag===18){if(ne=k.return,ne===null)throw Error(s(341));ne.lanes|=S,ve=ne.alternate,ve!==null&&(ve.lanes|=S),f1(ne,S,h),ne=k.sibling}else ne=k.child;if(ne!==null)ne.return=k;else for(ne=k;ne!==null;){if(ne===h){ne=null;break}if(k=ne.sibling,k!==null){k.return=ne.return,ne=k;break}ne=ne.return}k=ne}Sa(p,h,D.children,S),h=h.child}return h;case 9:return D=h.type,T=h.pendingProps.children,Jf(h,S),D=Ms(D),T=T(D),h.flags|=1,Sa(p,h,T,S),h.child;case 14:return T=h.type,D=Dr(T,h.pendingProps),D=Dr(T.type,D),tU(p,h,T,D,S);case 15:return nU(p,h,h.type,h.pendingProps,S);case 17:return T=h.type,D=h.pendingProps,D=h.elementType===T?D:Dr(T,D),p!==null&&(p.alternate=null,h.alternate=null,h.flags|=2),h.tag=1,ar(T)?(p=!0,hn(h)):p=!1,Jf(h,S),vF(h,T,D),m1(h,T,D,S),L1(null,h,T,!0,p,S);case 19:return fU(p,h,S);case 22:return rU(p,h,S)}throw Error(s(156,h.tag))};function PU(p,h){return Fm(p,h)}function FJ(p,h,S,T){this.tag=p,this.key=S,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ps(p,h,S,T){return new FJ(p,h,S,T)}function nw(p){return p=p.prototype,!(!p||!p.isReactComponent)}function UJ(p){if(typeof p=="function")return nw(p)?1:0;if(p!=null){if(p=p.$$typeof,p===y)return 11;if(p===E)return 14}return 2}function Iu(p,h){var S=p.alternate;return S===null?(S=Ps(p.tag,h,p.key,p.mode),S.elementType=p.elementType,S.type=p.type,S.stateNode=p.stateNode,S.alternate=p,p.alternate=S):(S.pendingProps=h,S.type=p.type,S.flags=0,S.subtreeFlags=0,S.deletions=null),S.flags=p.flags&14680064,S.childLanes=p.childLanes,S.lanes=p.lanes,S.child=p.child,S.memoizedProps=p.memoizedProps,S.memoizedState=p.memoizedState,S.updateQueue=p.updateQueue,h=p.dependencies,S.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},S.sibling=p.sibling,S.index=p.index,S.ref=p.ref,S}function Ev(p,h,S,T,D,k){var ne=2;if(T=p,typeof p=="function")nw(p)&&(ne=1);else if(typeof p=="string")ne=5;else e:switch(p){case c:return nd(S.children,D,k,h);case d:ne=8,D|=8;break;case f:return p=Ps(12,S,h,D|2),p.elementType=f,p.lanes=k,p;case v:return p=Ps(13,S,h,D),p.elementType=v,p.lanes=k,p;case b:return p=Ps(19,S,h,D),p.elementType=b,p.lanes=k,p;case A:return _v(S,D,k,h);default:if(typeof p=="object"&&p!==null)switch(p.$$typeof){case m:ne=10;break e;case g:ne=9;break e;case y:ne=11;break e;case E:ne=14;break e;case _:ne=16,T=null;break e}throw Error(s(130,p==null?p:typeof p,""))}return h=Ps(ne,S,h,D),h.elementType=p,h.type=T,h.lanes=k,h}function nd(p,h,S,T){return p=Ps(7,p,T,h),p.lanes=S,p}function _v(p,h,S,T){return p=Ps(22,p,T,h),p.elementType=A,p.lanes=S,p.stateNode={},p}function rw(p,h,S){return p=Ps(6,p,null,h),p.lanes=S,p}function iw(p,h,S){return h=Ps(4,p.children!==null?p.children:[],p.key,h),h.lanes=S,h.stateNode={containerInfo:p.containerInfo,pendingChildren:null,implementation:p.implementation},h}function zJ(p,h,S,T,D){this.tag=h,this.containerInfo=p,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Gt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bm(0),this.expirationTimes=Bm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bm(0),this.identifierPrefix=T,this.onRecoverableError=D,qe&&(this.mutableSourceEagerHydrationData=null)}function BU(p,h,S,T,D,k,ne,ve,We){return p=new zJ(p,h,S,ve,We),h===1?(h=1,k===!0&&(h|=8)):h=0,k=Ps(3,null,null,h),p.current=k,k.stateNode=p,k.memoizedState={element:T,isDehydrated:S,cache:null,transitions:null},p1(k),p}function FU(p){if(!p)return Nt;p=p._reactInternals;e:{if(N(p)!==p||p.tag!==1)throw Error(s(170));var h=p;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(ar(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(s(171))}if(p.tag===1){var S=p.type;if(ar(S))return un(p,S,h)}return h}function UU(p){var h=p._reactInternals;if(h===void 0)throw typeof p.render=="function"?Error(s(188)):(p=Object.keys(p).join(","),Error(s(268,p)));return p=G(h),p===null?null:p.stateNode}function zU(p,h){if(p=p.memoizedState,p!==null&&p.dehydrated!==null){var S=p.retryLane;p.retryLane=S!==0&&S=mt&&k>=gn&&D<=jt&&ne<=rn){p.splice(h,1);break}else if(T!==mt||S.width!==We.width||rnne){if(!(k!==gn||S.height!==We.height||jtD)){mt>T&&(We.width+=mt-T,We.x=T),jtk&&(We.height+=gn-k,We.y=k),rnS&&(S=ne)),ne ")+` No matching component was found for: - `)+p.join(" > ")}return null},n.getPublicRootInstance=function(p){if(p=p.current,!p.child)return null;switch(p.child.tag){case 5:return ae(p.child.stateNode);default:return p.child.stateNode}},n.injectIntoDevTools=function(p){if(p={bundleType:p.bundleType,version:p.version,rendererPackageName:p.rendererPackageName,rendererConfig:p.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:HJ,findFiberByHostInstance:p.findFiberByHostInstance||GJ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")p=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)p=!0;else{try{jc=h.inject(p),Rs=h}catch{}p=!!h.checkDCE}}return p},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(p,h,_,x){if(!yt)throw Error(s(363));p=W1(p,h);var D=ft(p,_,x).disconnect;return{disconnect:function(){D()}}},n.registerMutableSourceForHydration=function(p,h){var _=h._getVersion;_=_(h._source),p.mutableSourceEagerHydrationData==null?p.mutableSourceEagerHydrationData=[h,_]:p.mutableSourceEagerHydrationData.push(h,_)},n.runWithPriority=function(p,h){var _=Ln;try{return Ln=p,h()}finally{Ln=_}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(p,h,_,x){var D=h.current,k=Aa(),ne=Cu(D);return _=FU(_),h.context===null?h.context=_:h.pendingContext=_,h=xl(k,ne),h.payload={element:p},x=x===void 0?null:x,x!==null&&(h.callback=x),Tu(D,h),p=ks(D,ne,k),p!==null&&Fy(p,D,ne),ne},n};yX.exports=r1e;var i1e=yX.exports;const a1e=_l(i1e),DD={},LD=t=>void Object.assign(DD,t);function s1e(t,e){function n(c,{args:d=[],attach:f,...m},g){let y=`${c[0].toUpperCase()}${c.slice(1)}`,v;if(c==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const b=m.object;v=Bp(b,{type:c,root:g,attach:f,primitive:!0})}else{const b=DD[y];if(!b)throw new Error(`R3F: ${y} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(d))throw new Error("R3F: The args prop must be an array!");v=Bp(new b(...d),{type:c,root:g,attach:f,memoizedProps:{args:d}})}return v.__r3f.attach===void 0&&(v instanceof fn?v.__r3f.attach="geometry":v instanceof ii&&(v.__r3f.attach="material")),y!=="inject"&&aR(v,m),v}function r(c,d){let f=!1;if(d){var m,g;(m=d.__r3f)!=null&&m.attach?iR(c,d,d.__r3f.attach):d.isObject3D&&c.isObject3D&&(c.add(d),f=!0),f||(g=c.__r3f)==null||g.objects.push(d),d.__r3f||Bp(d,{}),d.__r3f.parent=c,GM(d),Fp(d)}}function i(c,d,f){let m=!1;if(d){var g,y;if((g=d.__r3f)!=null&&g.attach)iR(c,d,d.__r3f.attach);else if(d.isObject3D&&c.isObject3D){d.parent=c,d.dispatchEvent({type:"added"}),c.dispatchEvent({type:"childadded",child:d});const v=c.children.filter(E=>E!==d),b=v.indexOf(f);c.children=[...v.slice(0,b),d,...v.slice(b)],m=!0}m||(y=c.__r3f)==null||y.objects.push(d),d.__r3f||Bp(d,{}),d.__r3f.parent=c,GM(d),Fp(d)}}function a(c,d,f=!1){c&&[...c].forEach(m=>s(d,m,f))}function s(c,d,f){if(d){var m,g,y;if(d.__r3f&&(d.__r3f.parent=null),(m=c.__r3f)!=null&&m.objects&&(c.__r3f.objects=c.__r3f.objects.filter(A=>A!==d)),(g=d.__r3f)!=null&&g.attach)iG(c,d,d.__r3f.attach);else if(d.isObject3D&&c.isObject3D){var v;c.remove(d),(v=d.__r3f)!=null&&v.root&&h1e(WS(d),d)}const E=(y=d.__r3f)==null?void 0:y.primitive,S=!E&&(f===void 0?d.dispose!==null:f);if(!E){var b;a((b=d.__r3f)==null?void 0:b.objects,d,S),a(d.children,d,S)}if(delete d.__r3f,S&&d.dispose&&d.type!=="Scene"){const A=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?zM.unstable_scheduleCallback(zM.unstable_IdlePriority,A):A()}Fp(c)}}function o(c,d,f,m){var g;const y=(g=c.__r3f)==null?void 0:g.parent;if(!y)return;const v=n(d,f,c.__r3f.root);if(c.children){for(const b of c.children)b.__r3f&&r(v,b);c.children=c.children.filter(b=>!b.__r3f)}c.__r3f.objects.forEach(b=>r(v,b)),c.__r3f.objects=[],c.__r3f.autoRemovedBeforeAppend||s(y,c),v.parent&&(v.__r3f.autoRemovedBeforeAppend=!0),r(y,v),v.raycast&&v.__r3f.eventCount&&WS(v).getState().internal.interaction.push(v),[m,m.alternate].forEach(b=>{b!==null&&(b.stateNode=v,b.ref&&(typeof b.ref=="function"?b.ref(v):b.ref.current=v))})}const l=()=>{};return{reconciler:a1e({createInstance:n,removeChild:s,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(c,d)=>{if(!d)return;const f=c.getState().scene;f.__r3f&&(f.__r3f.root=c,r(f,d))},removeChildFromContainer:(c,d)=>{d&&s(c.getState().scene,d)},insertInContainerBefore:(c,d,f)=>{if(!d||!f)return;const m=c.getState().scene;m.__r3f&&i(m,d,f)},getRootHostContext:()=>null,getChildHostContext:c=>c,finalizeInitialChildren(c){var d;return!!((d=c==null?void 0:c.__r3f)!=null?d:{}).handlers},prepareUpdate(c,d,f,m){var g;if(((g=c==null?void 0:c.__r3f)!=null?g:{}).primitive&&m.object&&m.object!==c)return[!0];{const{args:v=[],children:b,...E}=m,{args:S=[],children:A,...I}=f;if(!Array.isArray(v))throw new Error("R3F: the args prop must be an array!");if(v.some((R,O)=>R!==S[O]))return[!0];const T=CX(c,E,I,!0);return T.changes.length?[!1,T]:null}},commitUpdate(c,[d,f],m,g,y,v){d?o(c,m,y,v):aR(c,f)},commitMount(c,d,f,m){var g;const y=(g=c.__r3f)!=null?g:{};c.raycast&&y.handlers&&y.eventCount&&WS(c).getState().internal.interaction.push(c)},getPublicInstance:c=>c,prepareForCommit:()=>null,preparePortalMount:c=>Bp(c.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(c){var d;const{attach:f,parent:m}=(d=c.__r3f)!=null?d:{};f&&m&&iG(m,c,f),c.isObject3D&&(c.visible=!1),Fp(c)},unhideInstance(c,d){var f;const{attach:m,parent:g}=(f=c.__r3f)!=null?f:{};m&&g&&iR(g,c,m),(c.isObject3D&&d.visible==null||d.visible)&&(c.visible=!0),Fp(c)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():dh.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Er.fun(performance.now)?performance.now:Er.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Er.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Er.fun(clearTimeout)?clearTimeout:void 0}),applyProps:aR}}var eG,tG;const rR=t=>"colorSpace"in t||"outputColorSpace"in t,SX=()=>{var t;return(t=DD.ColorManagement)!=null?t:null},_X=t=>t&&t.isOrthographicCamera,o1e=t=>t&&t.hasOwnProperty("current"),dy=typeof window<"u"&&((eG=window.document)!=null&&eG.createElement||((tG=window.navigator)==null?void 0:tG.product)==="ReactNative")?w.useLayoutEffect:w.useEffect;function AX(t){const e=w.useRef(t);return dy(()=>void(e.current=t),[t]),e}function l1e({set:t}){return dy(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}class TX extends w.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}TX.getDerivedStateFromError=()=>({error:!0});const xX="__default",nG=new Map,u1e=t=>t&&!!t.memoized&&!!t.changes;function wX(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}const Og=t=>{var e;return(e=t.__r3f)==null?void 0:e.root.getState()};function WS(t){let e=t.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const Er={obj:t=>t===Object(t)&&!Er.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:r="reference",strict:i=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(Er.str(t)||Er.num(t)||Er.boo(t))return t===e;const a=Er.obj(t);if(a&&r==="reference")return t===e;const s=Er.arr(t);if(s&&n==="reference")return t===e;if((s||a)&&t===e)return!0;let o;for(o in t)if(!(o in e))return!1;if(a&&n==="shallow"&&r==="shallow"){for(o in i?e:t)if(!Er.equ(t[o],e[o],{strict:i,objects:"reference"}))return!1}else for(o in i?e:t)if(t[o]!==e[o])return!1;if(Er.und(o)){if(s&&t.length===0&&e.length===0||a&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function c1e(t){const e={nodes:{},materials:{}};return t&&t.traverse(n=>{n.name&&(e.nodes[n.name]=n),n.material&&!e.materials[n.material.name]&&(e.materials[n.material.name]=n.material)}),e}function d1e(t){t.dispose&&t.type!=="Scene"&&t.dispose();for(const e in t)e.dispose==null||e.dispose(),delete t[e]}function Bp(t,e){const n=t;return n.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},t}function HM(t,e){let n=t;if(e.includes("-")){const r=e.split("-"),i=r.pop();return n=r.reduce((a,s)=>a[s],t),{target:n,key:i}}else return{target:n,key:e}}const rG=/-\d+$/;function iR(t,e,n){if(Er.str(n)){if(rG.test(n)){const a=n.replace(rG,""),{target:s,key:o}=HM(t,a);Array.isArray(s[o])||(s[o]=[])}const{target:r,key:i}=HM(t,n);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=n(t,e)}function iG(t,e,n){var r,i;if(Er.str(n)){const{target:a,key:s}=HM(t,n),o=e.__r3f.previousAttach;o===void 0?delete a[s]:a[s]=o}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(t,e);(i=e.__r3f)==null||delete i.previousAttach}function CX(t,{children:e,key:n,ref:r,...i},{children:a,key:s,ref:o,...l}={},u=!1){const c=t.__r3f,d=Object.entries(i),f=[];if(u){const g=Object.keys(l);for(let y=0;y{var v;if((v=t.__r3f)!=null&&v.primitive&&g==="object"||Er.equ(y,l[g]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(g))return f.push([g,y,!0,[]]);let b=[];g.includes("-")&&(b=g.split("-")),f.push([g,y,!1,b]);for(const E in i){const S=i[E];E.startsWith(`${g}-`)&&f.push([E,S,!1,E.split("-")])}});const m={...i};return c!=null&&c.memoizedProps&&c!=null&&c.memoizedProps.args&&(m.args=c.memoizedProps.args),c!=null&&c.memoizedProps&&c!=null&&c.memoizedProps.attach&&(m.attach=c.memoizedProps.attach),{memoized:m,changes:f}}const f1e=typeof process<"u"&&!1;function aR(t,e){var n;const r=t.__r3f,i=r==null?void 0:r.root,a=i==null||i.getState==null?void 0:i.getState(),{memoized:s,changes:o}=u1e(e)?e:CX(t,e),l=r==null?void 0:r.eventCount;t.__r3f&&(t.__r3f.memoizedProps=s);for(let c=0;cb[E],t),!(v&&v.set))){const[b,...E]=g.reverse();y=E.reverse().reduce((S,A)=>S[A],t),d=b}if(f===xX+"remove")if(y.constructor){let b=nG.get(y.constructor);b||(b=new y.constructor,nG.set(y.constructor,b)),f=b[d]}else f=0;if(m&&r)f?r.handlers[d]=f:delete r.handlers[d],r.eventCount=Object.keys(r.handlers).length;else if(v&&v.set&&(v.copy||v instanceof ef)){if(Array.isArray(f))v.fromArray?v.fromArray(f):v.set(...f);else if(v.copy&&f&&f.constructor&&(f1e?v.constructor.name===f.constructor.name:v.constructor===f.constructor))v.copy(f);else if(f!==void 0){const b=v instanceof vt;!b&&v.setScalar?v.setScalar(f):v instanceof ef&&f instanceof ef?v.mask=f.mask:v.set(f),!SX()&&a&&!a.linear&&b&&v.convertSRGBToLinear()}}else if(y[d]=f,y[d]instanceof $n&&y[d].format===ri&&y[d].type===as&&a){const b=y[d];rR(b)&&rR(a.gl)?b.colorSpace=a.gl.outputColorSpace:b.encoding=a.gl.outputEncoding}Fp(t)}if(r&&r.parent&&t.raycast&&l!==r.eventCount){const c=WS(t).getState().internal,d=c.interaction.indexOf(t);d>-1&&c.interaction.splice(d,1),r.eventCount&&c.interaction.push(t)}return!(o.length===1&&o[0][0]==="onUpdate")&&o.length&&(n=t.__r3f)!=null&&n.parent&&GM(t),t}function Fp(t){var e,n;const r=(e=t.__r3f)==null||(n=e.root)==null||n.getState==null?void 0:n.getState();r&&r.internal.frames===0&&r.invalidate()}function GM(t){t.onUpdate==null||t.onUpdate(t)}function RX(t,e){t.manual||(_X(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix(),t.updateMatrixWorld())}function WE(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function p1e(){var t;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return dh.DefaultEventPriority;switch((t=e.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return dh.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return dh.ContinuousEventPriority;default:return dh.DefaultEventPriority}}function IX(t,e,n,r){const i=n.get(e);i&&(n.delete(e),n.size===0&&(t.delete(r),i.target.releasePointerCapture(r)))}function h1e(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(r=>r!==e),n.initialHits=n.initialHits.filter(r=>r!==e),n.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&n.hovered.delete(i)}),n.capturedMap.forEach((r,i)=>{IX(n.capturedMap,e,r,i)})}function m1e(t){function e(l){const{internal:u}=t.getState(),c=l.offsetX-u.initialClick[0],d=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(c*c+d*d))}function n(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(c=>{var d;return(d=u.__r3f)==null?void 0:d.handlers["onPointer"+c]}))}function r(l,u){const c=t.getState(),d=new Set,f=[],m=u?u(c.internal.interaction):c.internal.interaction;for(let b=0;b{const S=Og(b.object),A=Og(E.object);return!S||!A?b.distance-E.distance:A.events.priority-S.events.priority||b.distance-E.distance}).filter(b=>{const E=WE(b);return d.has(E)?!1:(d.add(E),!0)});c.events.filter&&(y=c.events.filter(y,c));for(const b of y){let E=b.object;for(;E;){var v;(v=E.__r3f)!=null&&v.eventCount&&f.push({...b,eventObject:E}),E=E.parent}}if("pointerId"in l&&c.internal.capturedMap.has(l.pointerId))for(let b of c.internal.capturedMap.get(l.pointerId).values())d.has(WE(b.intersection))||f.push(b.intersection);return f}function i(l,u,c,d){const f=t.getState();if(l.length){const m={stopped:!1};for(const g of l){const y=Og(g.object)||f,{raycaster:v,pointer:b,camera:E,internal:S}=y,A=new H(b.x,b.y,0).unproject(E),I=M=>{var B,G;return(B=(G=S.capturedMap.get(M))==null?void 0:G.has(g.eventObject))!=null?B:!1},T=M=>{const B={intersection:g,target:u.target};S.capturedMap.has(M)?S.capturedMap.get(M).set(g.eventObject,B):S.capturedMap.set(M,new Map([[g.eventObject,B]])),u.target.setPointerCapture(M)},R=M=>{const B=S.capturedMap.get(M);B&&IX(S.capturedMap,g.eventObject,B,M)};let O={};for(let M in u){let B=u[M];typeof B!="function"&&(O[M]=B)}let N={...g,...O,pointer:b,intersections:l,stopped:m.stopped,delta:c,unprojectedPoint:A,ray:v.ray,camera:E,stopPropagation(){const M="pointerId"in u&&S.capturedMap.get(u.pointerId);if((!M||M.has(g.eventObject))&&(N.stopped=m.stopped=!0,S.hovered.size&&Array.from(S.hovered.values()).find(B=>B.eventObject===g.eventObject))){const B=l.slice(0,l.indexOf(g));a([...B,g])}},target:{hasPointerCapture:I,setPointerCapture:T,releasePointerCapture:R},currentTarget:{hasPointerCapture:I,setPointerCapture:T,releasePointerCapture:R},nativeEvent:u};if(d(N),m.stopped===!0)break}}return l}function a(l){const{internal:u}=t.getState();for(const c of u.hovered.values())if(!l.length||!l.find(d=>d.object===c.object&&d.index===c.index&&d.instanceId===c.instanceId)){const f=c.eventObject.__r3f,m=f==null?void 0:f.handlers;if(u.hovered.delete(WE(c)),f!=null&&f.eventCount){const g={...c,intersections:l};m.onPointerOut==null||m.onPointerOut(g),m.onPointerLeave==null||m.onPointerLeave(g)}}}function s(l,u){for(let c=0;ca([]);case"onLostPointerCapture":return u=>{const{internal:c}=t.getState();"pointerId"in u&&c.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{c.capturedMap.has(u.pointerId)&&(c.capturedMap.delete(u.pointerId),a([]))})}}return function(c){const{onPointerMissed:d,internal:f}=t.getState();f.lastEvent.current=c;const m=l==="onPointerMove",g=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",v=r(c,m?n:void 0),b=g?e(c):0;l==="onPointerDown"&&(f.initialClick=[c.offsetX,c.offsetY],f.initialHits=v.map(S=>S.eventObject)),g&&!v.length&&b<=2&&(s(c,f.interaction),d&&d(c)),m&&a(v);function E(S){const A=S.eventObject,I=A.__r3f,T=I==null?void 0:I.handlers;if(I!=null&&I.eventCount)if(m){if(T.onPointerOver||T.onPointerEnter||T.onPointerOut||T.onPointerLeave){const R=WE(S),O=f.hovered.get(R);O?O.stopped&&S.stopPropagation():(f.hovered.set(R,S),T.onPointerOver==null||T.onPointerOver(S),T.onPointerEnter==null||T.onPointerEnter(S))}T.onPointerMove==null||T.onPointerMove(S)}else{const R=T[l];R?(!g||f.initialHits.includes(A))&&(s(c,f.interaction.filter(O=>!f.initialHits.includes(O))),R(S)):g&&f.initialHits.includes(A)&&s(c,f.interaction.filter(O=>!f.initialHits.includes(O)))}}i(v,c,b,E)}}return{handlePointer:o}}const g1e=["set","get","setSize","setFrameloop","setDpr","events","invalidate","advance","size","viewport"],MX=t=>!!(t!=null&&t.render),kD=w.createContext(null),b1e=(t,e)=>{const n=OD((o,l)=>{const u=new H,c=new H,d=new H;function f(b=l().camera,E=c,S=l().size){const{width:A,height:I,top:T,left:R}=S,O=A/I;E instanceof H?d.copy(E):d.set(...E);const N=b.getWorldPosition(u).distanceTo(d);if(_X(b))return{width:A/b.zoom,height:I/b.zoom,top:T,left:R,factor:1,distance:N,aspect:O};{const M=b.fov*Math.PI/180,B=2*Math.tan(M/2)*N,G=B*(A/I);return{width:G,height:B,top:T,left:R,factor:A/G,distance:N,aspect:O}}}let m;const g=b=>o(E=>({performance:{...E.performance,current:b}})),y=new Ke;return{set:o,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(b=1)=>t(l(),b),advance:(b,E)=>e(b,E,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new CD,pointer:y,mouse:y,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const b=l();m&&clearTimeout(m),b.performance.current!==b.performance.min&&g(b.performance.min),m=setTimeout(()=>g(l().performance.max),b.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:f},setEvents:b=>o(E=>({...E,events:{...E.events,...b}})),setSize:(b,E,S,A,I)=>{const T=l().camera,R={width:b,height:E,top:A||0,left:I||0,updateStyle:S};o(O=>({size:R,viewport:{...O.viewport,...f(T,c,R)}}))},setDpr:b=>o(E=>{const S=wX(b);return{viewport:{...E.viewport,dpr:S,initialDpr:E.viewport.initialDpr||S}}}),setFrameloop:(b="always")=>{const E=l().clock;E.stop(),E.elapsedTime=0,b!=="never"&&(E.start(),E.elapsedTime=0),o(()=>({frameloop:b}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:w.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(b,E,S)=>{const A=l().internal;return A.priority=A.priority+(E>0?1:0),A.subscribers.push({ref:b,priority:E,store:S}),A.subscribers=A.subscribers.sort((I,T)=>I.priority-T.priority),()=>{const I=l().internal;I!=null&&I.subscribers&&(I.priority=I.priority-(E>0?1:0),I.subscribers=I.subscribers.filter(T=>T.ref!==b))}}}}}),r=n.getState();let i=r.size,a=r.viewport.dpr,s=r.camera;return n.subscribe(()=>{const{camera:o,size:l,viewport:u,gl:c,set:d}=n.getState();if(l.width!==i.width||l.height!==i.height||u.dpr!==a){var f;i=l,a=u.dpr,RX(o,l),c.setPixelRatio(u.dpr);const m=(f=l.updateStyle)!=null?f:typeof HTMLCanvasElement<"u"&&c.domElement instanceof HTMLCanvasElement;c.setSize(l.width,l.height,m)}o!==s&&(s=o,d(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(o)}})))}),n.subscribe(o=>t(o)),n};let jE,y1e=new Set,v1e=new Set,E1e=new Set;function sR(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function Dg(t,e){switch(t){case"before":return sR(y1e,e);case"after":return sR(v1e,e);case"tail":return sR(E1e,e)}}let oR,lR;function uR(t,e,n){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof t=="number"&&(r=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),oR=e.internal.subscribers,jE=0;jE0)&&!((c=a.gl.xr)!=null&&c.isPresenting)&&(r+=uR(u,a))}if(n=!1,Dg("after",u),r===0)return Dg("tail",u),e=!1,cancelAnimationFrame(i)}function o(u,c=1){var d;if(!u)return t.forEach(f=>o(f.store.getState(),c));(d=u.gl.xr)!=null&&d.isPresenting||!u.internal.active||u.frameloop==="never"||(c>1?u.internal.frames=Math.min(60,u.internal.frames+c):n?u.internal.frames=2:u.internal.frames=1,e||(e=!0,requestAnimationFrame(s)))}function l(u,c=!0,d,f){if(c&&Dg("before",u),d)uR(u,d,f);else for(const m of t.values())uR(u,m.store.getState());c&&Dg("after",u)}return{loop:s,invalidate:o,advance:l}}function PD(){const t=w.useContext(kD);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function zn(t=n=>n,e){return PD()(t,e)}function ko(t,e=0){const n=PD(),r=n.getState().internal.subscribe,i=AX(t);return dy(()=>r(i,e,n),[e,r,n]),null}const aG=new WeakMap;function NX(t,e){return function(n,...r){let i=aG.get(n);return i||(i=new n,aG.set(n,i)),t&&t(i),Promise.all(r.map(a=>new Promise((s,o)=>i.load(a,l=>{l.scene&&Object.assign(l,c1e(l.scene)),s(l)},e,l=>o(new Error(`Could not load ${a}: ${l==null?void 0:l.message}`))))))}}function io(t,e,n,r){const i=Array.isArray(e)?e:[e],a=e1e(NX(n,r),[t,...i],{equal:Er.equ});return Array.isArray(e)?a:a[0]}io.preload=function(t,e,n){const r=Array.isArray(e)?e:[e];return t1e(NX(n),[t,...r])};io.clear=function(t,e){const n=Array.isArray(e)?e:[e];return n1e([t,...n])};const nm=new Map,{invalidate:sG,advance:oG}=S1e(nm),{reconciler:Mb,applyProps:Qu}=s1e(nm,p1e),Np={objects:"shallow",strict:!1},_1e=(t,e)=>{const n=typeof t=="function"?t(e):t;return MX(n)?n:new aD({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...t})};function A1e(t,e){const n=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:a,left:s,updateStyle:o=n}=e;return{width:r,height:i,top:a,left:s,updateStyle:o}}else if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:r,height:i,top:a,left:s}=t.parentElement.getBoundingClientRect();return{width:r,height:i,top:a,left:s,updateStyle:n}}else if(typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0,updateStyle:n};return{width:0,height:0,top:0,left:0}}function T1e(t){const e=nm.get(t),n=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,a=r||b1e(sG,oG),s=n||Mb.createContainer(a,dh.ConcurrentRoot,null,!1,null,"",i,null);e||nm.set(t,{fiber:s,store:a});let o,l=!1,u;return{configure(c={}){let{gl:d,size:f,scene:m,events:g,onCreated:y,shadows:v=!1,linear:b=!1,flat:E=!1,legacy:S=!1,orthographic:A=!1,frameloop:I="always",dpr:T=[1,2],performance:R,raycaster:O,camera:N,onPointerMissed:M}=c,B=a.getState(),G=B.gl;B.gl||B.set({gl:G=_1e(d,t)});let W=B.raycaster;W||B.set({raycaster:W=new Ex});const{params:K,...se}=O||{};if(Er.equ(se,W,Np)||Qu(W,{...se}),Er.equ(K,W.params,Np)||Qu(W,{params:{...W.params,...K}}),!B.camera||B.camera===u&&!Er.equ(u,N,Np)){u=N;const J=N instanceof ny,fe=J?N:A?new pl(0,0,0,0,.1,1e3):new qr(75,0,.1,1e3);J||(fe.position.z=5,N&&(Qu(fe,N),("aspect"in N||"left"in N||"right"in N||"bottom"in N||"top"in N)&&(fe.manual=!0,fe.updateProjectionMatrix())),!B.camera&&!(N!=null&&N.rotation)&&fe.lookAt(0,0,0)),B.set({camera:fe}),W.camera=fe}if(!B.scene){let J;m instanceof em?J=m:(J=new em,m&&Qu(J,m)),B.set({scene:Bp(J)})}if(!B.xr){var ae;const J=(Le,j)=>{const ke=a.getState();ke.frameloop!=="never"&&oG(Le,!0,ke,j)},fe=()=>{const Le=a.getState();Le.gl.xr.enabled=Le.gl.xr.isPresenting,Le.gl.xr.setAnimationLoop(Le.gl.xr.isPresenting?J:null),Le.gl.xr.isPresenting||sG(Le)},Ce={connect(){const Le=a.getState().gl;Le.xr.addEventListener("sessionstart",fe),Le.xr.addEventListener("sessionend",fe)},disconnect(){const Le=a.getState().gl;Le.xr.removeEventListener("sessionstart",fe),Le.xr.removeEventListener("sessionend",fe)}};typeof((ae=G.xr)==null?void 0:ae.addEventListener)=="function"&&Ce.connect(),B.set({xr:Ce})}if(G.shadowMap){const J=G.shadowMap.enabled,fe=G.shadowMap.type;if(G.shadowMap.enabled=!!v,Er.boo(v))G.shadowMap.type=T0;else if(Er.str(v)){var ee;const Ce={basic:CY,percentage:GT,soft:T0,variance:go};G.shadowMap.type=(ee=Ce[v])!=null?ee:T0}else Er.obj(v)&&Object.assign(G.shadowMap,v);(J!==G.shadowMap.enabled||fe!==G.shadowMap.type)&&(G.shadowMap.needsUpdate=!0)}const F=SX();F&&("enabled"in F?F.enabled=!S:"legacyMode"in F&&(F.legacyMode=S)),l||Qu(G,{outputEncoding:b?3e3:3001,toneMapping:E?fl:HO}),B.legacy!==S&&B.set(()=>({legacy:S})),B.linear!==b&&B.set(()=>({linear:b})),B.flat!==E&&B.set(()=>({flat:E})),d&&!Er.fun(d)&&!MX(d)&&!Er.equ(d,G,Np)&&Qu(G,d),g&&!B.events.handlers&&B.set({events:g(a)});const ie=A1e(t,f);return Er.equ(ie,B.size,Np)||B.setSize(ie.width,ie.height,ie.updateStyle,ie.top,ie.left),T&&B.viewport.dpr!==wX(T)&&B.setDpr(T),B.frameloop!==I&&B.setFrameloop(I),B.onPointerMissed||B.set({onPointerMissed:M}),R&&!Er.equ(R,B.performance,Np)&&B.set(J=>({performance:{...J.performance,...R}})),o=y,l=!0,this},render(c){return l||this.configure(),Mb.updateContainer($.jsx(x1e,{store:a,children:c,onCreated:o,rootElement:t}),s,null,()=>{}),a},unmount(){OX(t)}}}function x1e({store:t,children:e,onCreated:n,rootElement:r}){return dy(()=>{const i=t.getState();i.set(a=>({internal:{...a.internal,active:!0}})),n&&n(i),t.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),$.jsx(kD.Provider,{value:t,children:e})}function OX(t,e){const n=nm.get(t),r=n==null?void 0:n.fiber;if(r){const i=n==null?void 0:n.store.getState();i&&(i.internal.active=!1),Mb.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var a,s,o,l;i.events.disconnect==null||i.events.disconnect(),(a=i.gl)==null||(s=a.renderLists)==null||s.dispose==null||s.dispose(),(o=i.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),d1e(i),nm.delete(t)}catch{}},500)})}}function w1e(t,e,n){return $.jsx(C1e,{children:t,container:e,state:n},e.uuid)}function C1e({state:t={},children:e,container:n}){const{events:r,size:i,...a}=t,s=PD(),[o]=w.useState(()=>new Ex),[l]=w.useState(()=>new Ke),u=w.useCallback((d,f)=>{const m={...d};Object.keys(d).forEach(y=>{(g1e.includes(y)||d[y]!==f[y]&&f[y])&&delete m[y]});let g;if(f&&i){const y=f.camera;g=d.viewport.getCurrentViewport(y,new H,i),y!==d.camera&&RX(y,i)}return{...m,scene:n,raycaster:o,pointer:l,mouse:l,previousRoot:s,events:{...d.events,...f==null?void 0:f.events,...r},size:{...d.size,...i},viewport:{...d.viewport,...g},...a}},[t]),[c]=w.useState(()=>{const d=s.getState();return OD((m,g)=>({...d,scene:n,raycaster:o,pointer:l,mouse:l,previousRoot:s,events:{...d.events,...r},size:{...d.size,...i},...a,set:m,get:g,setEvents:y=>m(v=>({...v,events:{...v.events,...y}}))}))});return w.useEffect(()=>{const d=s.subscribe(f=>c.setState(m=>u(f,m)));return()=>{d()}},[u]),w.useEffect(()=>{c.setState(d=>u(s.getState(),d))},[u]),w.useEffect(()=>()=>{c.destroy()},[]),$.jsx($.Fragment,{children:Mb.createPortal($.jsx(kD.Provider,{value:c,children:e}),c,null)})}Mb.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:w.version});const cR={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 R1e(t){const{handlePointer:e}=m1e(t);return{priority:1,enabled:!0,compute(n,r,i){r.pointer.set(n.offsetX/r.size.width*2-1,-(n.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(cR).reduce((n,r)=>({...n,[r]:e(r)}),{}),update:()=>{var n;const{events:r,internal:i}=t.getState();(n=i.lastEvent)!=null&&n.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:n=>{var r;const{set:i,events:a}=t.getState();a.disconnect==null||a.disconnect(),i(s=>({events:{...s.events,connected:n}})),Object.entries((r=a.handlers)!=null?r:[]).forEach(([s,o])=>{const[l,u]=cR[s];n.addEventListener(l,o,{passive:u})})},disconnect:()=>{const{set:n,events:r}=t.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([a,s])=>{if(r&&r.connected instanceof HTMLElement){const[o]=cR[a];r.connected.removeEventListener(o,s)}}),n(a=>({events:{...a.events,connected:void 0}}))}}}}function VM(t,e,n){var r,i,a,s,o;e==null&&(e=100);function l(){var c=Date.now()-s;c=0?r=setTimeout(l,e-c):(r=null,n||(o=t.apply(a,i),a=i=null))}var u=function(){a=this,i=arguments,s=Date.now();var c=n&&!r;return r||(r=setTimeout(l,e)),c&&(o=t.apply(a,i),a=i=null),o};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(o=t.apply(a,i),a=i=null,clearTimeout(r),r=null)},u}VM.debounce=VM;var I1e=VM;const lG=_l(I1e);var M1e=Object.defineProperty,N1e=Object.defineProperties,O1e=Object.getOwnPropertyDescriptors,uG=Object.getOwnPropertySymbols,D1e=Object.prototype.hasOwnProperty,L1e=Object.prototype.propertyIsEnumerable,cG=(t,e,n)=>e in t?M1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,dG=(t,e)=>{for(var n in e||(e={}))D1e.call(e,n)&&cG(t,n,e[n]);if(uG)for(var n of uG(e))L1e.call(e,n)&&cG(t,n,e[n]);return t},k1e=(t,e)=>N1e(t,O1e(e)),fG,pG;typeof window<"u"&&((fG=window.document)!=null&&fG.createElement||((pG=window.navigator)==null?void 0:pG.product)==="ReactNative")?w.useLayoutEffect:w.useEffect;function DX(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=t.child;for(;r;){const i=DX(r,e,n);if(i)return i;r=r.sibling}}function LX(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const hG=console.error;console.error=function(){const t=[...arguments].join("");if(t!=null&&t.startsWith("Warning:")&&t.includes("useContext")){console.error=hG;return}return hG.apply(this,arguments)};const BD=LX(w.createContext(null));class kX extends w.Component{render(){return w.createElement(BD.Provider,{value:this._reactInternals},this.props.children)}}function P1e(){const t=w.useContext(BD);if(t===null)throw new Error("its-fine: useFiber must be called within a !");const e=w.useId();return w.useMemo(()=>{for(const r of[t,t==null?void 0:t.alternate]){if(!r)continue;const i=DX(r,!1,a=>{let s=a.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[t,e])}function B1e(){const t=P1e(),[e]=w.useState(()=>new Map);e.clear();let n=t;for(;n;){if(n.type&&typeof n.type=="object"){const i=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;i&&i!==BD&&!e.has(i)&&e.set(i,w.useContext(LX(i)))}n=n.return}return e}function F1e(){const t=B1e();return w.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>w.createElement(e,null,w.createElement(n.Provider,k1e(dG({},r),{value:t.get(n)}))),e=>w.createElement(kX,dG({},e))),[t])}function U1e({debounce:t,scroll:e,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=n||typeof window<"u"&&window.ResizeObserver,[a,s]=w.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!i)return a.width=1280,a.height=800,[()=>{},a,()=>{}];const o=w.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a,orientationHandler:null}),l=t?typeof t=="number"?t:t.scroll:null,u=t?typeof t=="number"?t:t.resize:null,c=w.useRef(!1);w.useEffect(()=>(c.current=!0,()=>void(c.current=!1)));const[d,f,m]=w.useMemo(()=>{const b=()=>{if(!o.current.element)return;const{left:E,top:S,width:A,height:I,bottom:T,right:R,x:O,y:N}=o.current.element.getBoundingClientRect(),M={left:E,top:S,width:A,height:I,bottom:T,right:R,x:O,y:N};o.current.element instanceof HTMLElement&&r&&(M.height=o.current.element.offsetHeight,M.width=o.current.element.offsetWidth),Object.freeze(M),c.current&&!V1e(o.current.lastBounds,M)&&s(o.current.lastBounds=M)};return[b,u?lG(b,u):b,l?lG(b,l):b]},[s,r,l,u]);function g(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(b=>b.removeEventListener("scroll",m,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function y(){var b;o.current.element&&(o.current.resizeObserver=new i(f),(b=o.current.resizeObserver)==null||b.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(E=>E.addEventListener("scroll",m,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const v=b=>{!b||b===o.current.element||(g(),o.current.element=b,o.current.scrollContainers=PX(b),y())};return H1e(m,!!e),z1e(f),w.useEffect(()=>{g(),y()},[e,m,f]),w.useEffect(()=>g,[]),[v,a,d]}function z1e(t){w.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function H1e(t,e){w.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function PX(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(a=>a==="auto"||a==="scroll")&&e.push(t),[...e,...PX(t.parentElement)]}const G1e=["x","y","top","bottom","left","right","width","height"],V1e=(t,e)=>G1e.every(n=>t[n]===e[n]),$1e=w.forwardRef(function({children:e,fallback:n,resize:r,style:i,gl:a,events:s=R1e,eventSource:o,eventPrefix:l,shadows:u,linear:c,flat:d,legacy:f,orthographic:m,frameloop:g,dpr:y,performance:v,raycaster:b,camera:E,scene:S,onPointerMissed:A,onCreated:I,...T},R){w.useMemo(()=>LD(Kxe),[]);const O=F1e(),[N,M]=U1e({scroll:!0,debounce:{scroll:50,resize:0},...r}),B=w.useRef(null),G=w.useRef(null);w.useImperativeHandle(R,()=>B.current);const W=AX(A),[K,se]=w.useState(!1),[ae,ee]=w.useState(!1);if(K)throw K;if(ae)throw ae;const F=w.useRef(null);dy(()=>{const J=B.current;M.width>0&&M.height>0&&J&&(F.current||(F.current=T1e(J)),F.current.configure({gl:a,events:s,shadows:u,linear:c,flat:d,legacy:f,orthographic:m,frameloop:g,dpr:y,performance:v,raycaster:b,camera:E,scene:S,size:M,onPointerMissed:(...fe)=>W.current==null?void 0:W.current(...fe),onCreated:fe=>{fe.events.connect==null||fe.events.connect(o?o1e(o)?o.current:o:G.current),l&&fe.setEvents({compute:(Ce,Le)=>{const j=Ce[l+"X"],ke=Ce[l+"Y"];Le.pointer.set(j/Le.size.width*2-1,-(ke/Le.size.height)*2+1),Le.raycaster.setFromCamera(Le.pointer,Le.camera)}}),I==null||I(fe)}}),F.current.render($.jsx(O,{children:$.jsx(TX,{set:ee,children:$.jsx(w.Suspense,{fallback:$.jsx(l1e,{set:se}),children:e})})})))}),w.useEffect(()=>{const J=B.current;if(J)return()=>OX(J)},[]);const ie=o?"none":"auto";return $.jsx("div",{ref:G,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:ie,...i},...T,children:$.jsx("div",{ref:N,style:{width:"100%",height:"100%"},children:$.jsx("canvas",{ref:B,style:{display:"block"},children:n})})})}),W1e=w.forwardRef(function(e,n){return $.jsx(kX,{children:$.jsx($1e,{...e,ref:n})})});function j1e(t,e,n){return Math.max(e,Math.min(t,n))}const ha={toVector(t,e){return t===void 0&&(t=e),Array.isArray(t)?t:[t,t]},add(t,e){return[t[0]+e[0],t[1]+e[1]]},sub(t,e){return[t[0]-e[0],t[1]-e[1]]},addTo(t,e){t[0]+=e[0],t[1]+=e[1]},subTo(t,e){t[0]-=e[0],t[1]-=e[1]}};function mG(t,e,n){return e===0||Math.abs(e)===1/0?Math.pow(t,n*5):t*e*n/(e+n*t)}function gG(t,e,n,r=.15){return r===0?j1e(t,e,n):tn?+mG(t-n,n-e,r)+n:t}function Y1e(t,[e,n],[r,i]){const[[a,s],[o,l]]=t;return[gG(e,a,s,r),gG(n,o,l,i)]}function q1e(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function X1e(t){var e=q1e(t,"string");return typeof e=="symbol"?e:String(e)}function ja(t,e,n){return e=X1e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bG(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function zr(t){for(var e=1;e{var n,r;return e.target===t.currentTarget||((n=t.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,e.target))})}function rwe(t){return t.type==="touchend"||t.type==="touchcancel"?t.changedTouches:t.targetTouches}function UX(t){return Sx(t)?rwe(t)[0]:t}function iwe(t){return nwe(t).map(e=>e.identifier)}function dR(t){const e=UX(t);return Sx(t)?e.identifier:e.pointerId}function vG(t){const e=UX(t);return[e.clientX,e.clientY]}function awe(t){const e={};if("buttons"in t&&(e.buttons=t.buttons),"shiftKey"in t){const{shiftKey:n,altKey:r,metaKey:i,ctrlKey:a}=t;Object.assign(e,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:a})}return e}function wA(t,...e){return typeof t=="function"?t(...e):t}function swe(){}function owe(...t){return t.length===0?swe:t.length===1?t[0]:function(){let e;for(const n of t)e=n.apply(this,arguments)||e;return e}}function EG(t,e){return Object.assign({},e,t||{})}const lwe=32;class uwe{constructor(e,n,r){this.ctrl=e,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:n,ingKey:r,args:i}=this;n[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=i,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=e.target,n.currentTarget=e.currentTarget,n.lastOffset=r.from?wA(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=e.timeStamp)}computeValues(e){const n=this.state;n._values=e,n.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:n,config:r,shared:i}=this;n.args=this.args;let a=0;if(e&&(n.event=e,r.preventDefault&&e.cancelable&&n.event.preventDefault(),n.type=e.type,i.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,i.locked=!!document.pointerLockElement,Object.assign(i,awe(e)),i.down=i.pressed=i.buttons%2===1||i.touches>0,a=e.timeStamp-n.timeStamp,n.timeStamp=e.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const T=n._delta.map(Math.abs);ha.addTo(n._distance,T)}this.axisIntent&&this.axisIntent(e);const[s,o]=n._movement,[l,u]=r.threshold,{_step:c,values:d}=n;if(r.hasCustomTransform?(c[0]===!1&&(c[0]=Math.abs(s)>=l&&d[0]),c[1]===!1&&(c[1]=Math.abs(o)>=u&&d[1])):(c[0]===!1&&(c[0]=Math.abs(s)>=l&&Math.sign(s)*l),c[1]===!1&&(c[1]=Math.abs(o)>=u&&Math.sign(o)*u)),n.intentional=c[0]!==!1||c[1]!==!1,!n.intentional)return;const f=[0,0];if(r.hasCustomTransform){const[T,R]=d;f[0]=c[0]!==!1?T-c[0]:0,f[1]=c[1]!==!1?R-c[1]:0}else f[0]=c[0]!==!1?s-c[0]:0,f[1]=c[1]!==!1?o-c[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(f);const m=n.offset,g=n._active&&!n._blocked||n.active;g&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=i[this.ingKey]=n._active,e&&(n.first&&("bounds"in r&&(n._bounds=wA(r.bounds,n)),this.setup&&this.setup()),n.movement=f,this.computeOffset()));const[y,v]=n.offset,[[b,E],[S,A]]=n._bounds;n.overflow=[yE?1:0,vA?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const I=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=Y1e(n._bounds,n.offset,I),n.delta=ha.sub(n.offset,m),this.computeMovement(),g&&(!n.last||a>lwe)){n.delta=ha.sub(n.offset,m);const T=n.delta.map(Math.abs);ha.addTo(n.distance,T),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&a>0&&(n.velocity=[T[0]/a,T[1]/a],n.timeDelta=a)}}emit(){const e=this.state,n=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const i=this.handler(zr(zr(zr({},n),e),{},{[this.aliasKey]:e.values}));i!==void 0&&(e.memo=i)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function cwe([t,e],n){const r=Math.abs(t),i=Math.abs(e);if(r>i&&r>n)return"x";if(i>r&&i>n)return"y"}class dwe extends uwe{constructor(...e){super(...e),ja(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ha.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ha.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const n=this.state,r=this.config;if(!n.axis&&e){const i=typeof r.axisThreshold=="object"?r.axisThreshold[FX(e)]:r.axisThreshold;n.axis=cwe(n._movement,i)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const fwe=t=>t,SG=.15,zX={enabled(t=!0){return t},eventOptions(t,e,n){return zr(zr({},n.shared.eventOptions),t)},preventDefault(t=!1){return t},triggerAllEvents(t=!1){return t},rubberband(t=0){switch(t){case!0:return[SG,SG];case!1:return[0,0];default:return ha.toVector(t)}},from(t){if(typeof t=="function")return t;if(t!=null)return ha.toVector(t)},transform(t,e,n){const r=t||n.shared.transform;return this.hasCustomTransform=!!r,r||fwe},threshold(t){return ha.toVector(t,0)}},pwe=0,fy=zr(zr({},zX),{},{axis(t,e,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(t=pwe){return t},bounds(t={}){if(typeof t=="function")return a=>fy.bounds(t(a));if("current"in t)return()=>t.current;if(typeof HTMLElement=="function"&&t instanceof HTMLElement)return t;const{left:e=-1/0,right:n=1/0,top:r=-1/0,bottom:i=1/0}=t;return[[e,n],[r,i]]}}),_G={ArrowRight:(t,e=1)=>[t*e,0],ArrowLeft:(t,e=1)=>[-1*t*e,0],ArrowUp:(t,e=1)=>[0,-1*t*e],ArrowDown:(t,e=1)=>[0,t*e]};class hwe extends dwe{constructor(...e){super(...e),ja(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const n=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),i={left:n.left-r.left+e.offset[0],right:n.right-r.right+e.offset[0],top:n.top-r.top+e.offset[1],bottom:n.bottom-r.bottom+e.offset[1]};e._bounds=fy.bounds(i)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const n=this.config,r=this.state;if(e.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(e.buttons):n.pointerButtons!==-1&&n.pointerButtons!==e.buttons))return;const i=this.ctrl.setEventIds(e);n.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(i&&i.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=dR(e),r._pointerActive=!0,this.computeValues(vG(e)),this.computeInitial(),n.preventScrollAxis&&FX(e)!=="mouse"?(r._active=!1,this.setupScrollPrevention(e)):n.delay>0?(this.setupDelayTrigger(e),n.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const n=this.state,r=this.config;if(!n._pointerActive)return;const i=dR(e);if(n._pointerId!==void 0&&i!==n._pointerId)return;const a=vG(e);if(document.pointerLockElement===e.target?n._delta=[e.movementX,e.movementY]:(n._delta=ha.sub(a,n._values),this.computeValues(a)),ha.addTo(n._movement,n._delta),this.compute(e),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(e);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const i=dR(e);if(n._pointerId!==void 0&&i!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[a,s]=n._distance;if(n.tap=a<=r.tapsThreshold&&s<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[o,l]=n._delta,[u,c]=n._movement,[d,f]=r.swipe.velocity,[m,g]=r.swipe.distance,y=r.swipe.duration;if(n.elapsedTimed&&Math.abs(u)>m&&(n.swipe[0]=Math.sign(o)),b>f&&Math.abs(c)>g&&(n.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const n=this.config,r=n.device;n.pointerLock&&e.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,mwe(e);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const n=_G[e.key];if(n){const r=this.state,i=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=n(this.config.keyboardDisplacement,i),r._keyboardActive=!0,ha.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in _G&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const n=this.config.device;e(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(n,"change",this.pointerMove.bind(this)),e(n,"end",this.pointerUp.bind(this)),e(n,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function mwe(t){"persist"in t&&typeof t.persist=="function"&&t.persist()}const py=typeof window<"u"&&window.document&&window.document.createElement;function HX(){return py&&"ontouchstart"in window}function gwe(){return HX()||py&&window.navigator.maxTouchPoints>1}function bwe(){return py&&"onpointerdown"in window}function ywe(){return py&&"exitPointerLock"in window.document}function vwe(){try{return"constructor"in GestureEvent}catch{return!1}}const qs={isBrowser:py,gesture:vwe(),touch:HX(),touchscreen:gwe(),pointer:bwe(),pointerLock:ywe()},Ewe=250,Swe=180,_we=.5,Awe=50,Twe=250,xwe=10,AG={mouse:0,touch:0,pen:8},wwe=zr(zr({},fy),{},{device(t,e,{pointer:{touch:n=!1,lock:r=!1,mouse:i=!1}={}}){return this.pointerLock=r&&qs.pointerLock,qs.touch&&n?"touch":this.pointerLock?"mouse":qs.pointer&&!i?"pointer":qs.touch?"touch":"mouse"},preventScrollAxis(t,e,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&t?Ewe:void 0,!(!qs.touchscreen||n===!1))return t||(n!==void 0?"y":void 0)},pointerCapture(t,e,{pointer:{capture:n=!0,buttons:r=1,keys:i=!0}={}}){return this.pointerButtons=r,this.keys=i,!this.pointerLock&&this.device==="pointer"&&n},threshold(t,e,{filterTaps:n=!1,tapsThreshold:r=3,axis:i=void 0}){const a=ha.toVector(t,n?r:i?1:0);return this.filterTaps=n,this.tapsThreshold=r,a},swipe({velocity:t=_we,distance:e=Awe,duration:n=Twe}={}){return{velocity:this.transform(ha.toVector(t)),distance:this.transform(ha.toVector(e)),duration:n}},delay(t=0){switch(t){case!0:return Swe;case!1:return 0;default:return t}},axisThreshold(t){return t?zr(zr({},AG),t):AG},keyboardDisplacement(t=xwe){return t}});zr(zr({},zX),{},{device(t,e,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!qs.touch&&qs.gesture)return"gesture";if(qs.touch&&r)return"touch";if(qs.touchscreen){if(qs.pointer)return"pointer";if(qs.touch)return"touch"}},bounds(t,e,{scaleBounds:n={},angleBounds:r={}}){const i=s=>{const o=EG(wA(n,s),{min:-1/0,max:1/0});return[o.min,o.max]},a=s=>{const o=EG(wA(r,s),{min:-1/0,max:1/0});return[o.min,o.max]};return typeof n!="function"&&typeof r!="function"?[i(),a()]:s=>[i(s),a(s)]},threshold(t,e,n){return this.lockDirection=n.axis==="lock",ha.toVector(t,this.lockDirection?[.1,3]:0)},modifierKey(t){return t===void 0?"ctrlKey":t},pinchOnWheel(t=!0){return t}});zr(zr({},fy),{},{mouseOnly:(t=!0)=>t});zr(zr({},fy),{},{mouseOnly:(t=!0)=>t});const GX=new Map,$M=new Map;function Cwe(t){GX.set(t.key,t.engine),$M.set(t.key,t.resolver)}const Rwe={key:"drag",engine:hwe,resolver:wwe};function Iwe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function Mwe(t,e){if(t==null)return{};var n=Iwe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}const Nwe={target(t){if(t)return()=>"current"in t?t.current:t},enabled(t=!0){return t},window(t=qs.isBrowser?window:void 0){return t},eventOptions({passive:t=!0,capture:e=!1}={}){return{passive:t,capture:e}},transform(t){return t}},Owe=["target","eventOptions","window","enabled","transform"];function jS(t={},e){const n={};for(const[r,i]of Object.entries(e))switch(typeof i){case"function":n[r]=i.call(n,t[r],r,t);break;case"object":n[r]=jS(t[r],i);break;case"boolean":i&&(n[r]=t[r]);break}return n}function Dwe(t,e,n={}){const r=t,{target:i,eventOptions:a,window:s,enabled:o,transform:l}=r,u=Mwe(r,Owe);if(n.shared=jS({target:i,eventOptions:a,window:s,enabled:o,transform:l},Nwe),e){const c=$M.get(e);n[e]=jS(zr({shared:n.shared},u),c)}else for(const c in u){const d=$M.get(c);d&&(n[c]=jS(zr({shared:n.shared},u[c]),d))}return n}class VX{constructor(e,n){ja(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=n}add(e,n,r,i,a){const s=this._listeners,o=twe(n,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=zr(zr({},l),a);e.addEventListener(o,i,u);const c=()=>{e.removeEventListener(o,i,u),s.delete(c)};return s.add(c),c}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class Lwe{constructor(){ja(this,"_timeouts",new Map)}add(e,n,r=140,...i){this.remove(e),this._timeouts.set(e,window.setTimeout(n,r,...i))}remove(e){const n=this._timeouts.get(e);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class kwe{constructor(e){ja(this,"gestures",new Set),ja(this,"_targetEventStore",new VX(this)),ja(this,"gestureEventStores",{}),ja(this,"gestureTimeoutStores",{}),ja(this,"handlers",{}),ja(this,"config",{}),ja(this,"pointerIds",new Set),ja(this,"touchIds",new Set),ja(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Pwe(this,e)}setEventIds(e){if(Sx(e))return this.touchIds=new Set(iwe(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,n){this.handlers=e,this.nativeHandlers=n}applyConfig(e,n){this.config=Dwe(e,n,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const n=this.config.shared,r={};let i;if(!(n.target&&(i=n.target(),!i))){if(n.enabled){for(const s of this.gestures){const o=this.config[s],l=TG(r,o.eventOptions,!!i);if(o.enabled){const u=GX.get(s);new u(this,e,s).bind(l)}}const a=TG(r,n.eventOptions,!!i);for(const s in this.nativeHandlers)a(s,"",o=>this.nativeHandlers[s](zr(zr({},this.state.shared),{},{event:o,args:e})),void 0,!0)}for(const a in r)r[a]=owe(...r[a]);if(!i)return r;for(const a in r){const{device:s,capture:o,passive:l}=ewe(a);this._targetEventStore.add(i,s,"",r[a],{capture:o,passive:l})}}}}function Op(t,e){t.gestures.add(e),t.gestureEventStores[e]=new VX(t,e),t.gestureTimeoutStores[e]=new Lwe}function Pwe(t,e){e.drag&&Op(t,"drag"),e.wheel&&Op(t,"wheel"),e.scroll&&Op(t,"scroll"),e.move&&Op(t,"move"),e.pinch&&Op(t,"pinch"),e.hover&&Op(t,"hover")}const TG=(t,e,n)=>(r,i,a,s={},o=!1)=>{var l,u;const c=(l=s.capture)!==null&&l!==void 0?l:e.capture,d=(u=s.passive)!==null&&u!==void 0?u:e.passive;let f=o?r:Q1e(r,i,c);n&&d&&(f+="Passive"),t[f]=t[f]||[],t[f].push(a)};function Bwe(t,e={},n,r){const i=pe.useMemo(()=>new kwe(t),[]);if(i.applyHandlers(t,r),i.applyConfig(e,n),pe.useEffect(i.effect.bind(i)),pe.useEffect(()=>i.clean.bind(i),[]),e.target===void 0)return i.bind.bind(i)}function Fwe(t,e){return Cwe(Rwe),Bwe({drag:t},e||{},"drag")}const Uwe=t=>(e,n,r)=>{const i=r.subscribe;return r.subscribe=(s,o,l)=>{let u=s;if(o){const c=(l==null?void 0:l.equalityFn)||Object.is;let d=s(r.getState());u=f=>{const m=s(f);if(!c(d,m)){const g=d;o(d=m,g)}},l!=null&&l.fireImmediately&&o(d,d)}return i(u)},t(e,n,r)},zwe=parseInt(Of.replace(/\D+/g,""));function xG(t,e){if(e===iq)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===_A||e===KO){let n=t.getIndex();if(n===null){const s=[],o=t.getAttribute("position");if(o!==void 0){for(let l=0;l>>1|(xr&21845)<<1;Hu=(Hu&52428)>>>2|(Hu&13107)<<2,Hu=(Hu&61680)>>>4|(Hu&3855)<<4,jM[xr]=((Hu&65280)>>>8|(Hu&255)<<8)>>>1}var D0=function(t,e,n){for(var r=t.length,i=0,a=new oc(e);i>>l]=u}else for(o=new oc(r),i=0;i>>15-t[i]);return o},hy=new Ks(288);for(var xr=0;xr<144;++xr)hy[xr]=8;for(var xr=144;xr<256;++xr)hy[xr]=9;for(var xr=256;xr<280;++xr)hy[xr]=7;for(var xr=280;xr<288;++xr)hy[xr]=8;var XX=new Ks(32);for(var xr=0;xr<32;++xr)XX[xr]=5;var Wwe=D0(hy,9,1),jwe=D0(XX,5,1),fR=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},ho=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},pR=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},Ywe=function(t){return(t/8|0)+(t&7&&1)},qwe=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof oc?oc:t instanceof WM?WM:Ks)(n-e);return r.set(t.subarray(e,n)),r},Xwe=function(t,e,n){var r=t.length;if(!r||n&&!n.l&&r<5)return e||new Ks(0);var i=!e||n,a=!n||n.i;n||(n={}),e||(e=new Ks(r*3));var s=function(Fe){var Ye=e.length;if(Fe>Ye){var gt=new Ks(Math.max(Ye*2,Fe));gt.set(e),e=gt}},o=n.f||0,l=n.p||0,u=n.b||0,c=n.l,d=n.d,f=n.m,m=n.n,g=r*8;do{if(!c){n.f=o=ho(t,l,1);var y=ho(t,l+1,3);if(l+=3,y)if(y==1)c=Wwe,d=jwe,f=9,m=5;else if(y==2){var S=ho(t,l,31)+257,A=ho(t,l+10,15)+4,I=S+ho(t,l+5,31)+1;l+=14;for(var T=new Ks(I),R=new Ks(19),O=0;O>>4;if(v<16)T[O++]=v;else{var W=0,K=0;for(v==16?(K=3+ho(t,l,3),l+=2,W=T[O-1]):v==17?(K=3+ho(t,l,7),l+=3):v==18&&(K=11+ho(t,l,127),l+=7);K--;)T[O++]=W}}var se=T.subarray(0,S),ae=T.subarray(S);f=fR(se),m=fR(ae),c=D0(se,f,1),d=D0(ae,m,1)}else throw"invalid block type";else{var v=Ywe(l)+4,b=t[v-4]|t[v-3]<<8,E=v+b;if(E>r){if(a)throw"unexpected EOF";break}i&&s(u+b),e.set(t.subarray(v,E),u),n.b=u+=b,n.p=l=E*8;continue}if(l>g){if(a)throw"unexpected EOF";break}}i&&s(u+131072);for(var ee=(1<>>4;if(l+=W&15,l>g){if(a)throw"unexpected EOF";break}if(!W)throw"invalid length/literal";if(J<256)e[u++]=J;else if(J==256){ie=l,c=null;break}else{var fe=J-254;if(J>264){var O=J-257,Ce=$X[O];fe=ho(t,l,(1<>>4;if(!Le)throw"invalid distance";l+=Le&15;var ae=$we[j];if(j>3){var Ce=WX[j];ae+=pR(t,l)&(1<g){if(a)throw"unexpected EOF";break}i&&s(u+131072);for(var ke=u+fe;u>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(t[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function YE(t,e){return Xwe((Zwe(t),t.subarray(2,-4)),e)}var Qwe=typeof TextDecoder<"u"&&new TextDecoder,Jwe=0;try{Qwe.decode(Kwe,{stream:!0}),Jwe=1}catch{}const eCe=t=>t&&t.isCubeTexture;class tCe extends Ot{constructor(e,n){var r,i;const a=eCe(e),o=((i=a?(r=e.image[0])==null?void 0:r.width:e.image.width)!=null?i:1024)/4,l=Math.floor(Math.log2(o)),u=Math.pow(2,l),c=3*Math.max(u,16*7),d=4*u,f=[a?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/c}`,`#define CUBEUV_TEXEL_HEIGHT ${1/d}`,`#define CUBEUV_MAX_MIP ${l}.0`],m=` + `)+p.join(" > ")}return null},n.getPublicRootInstance=function(p){if(p=p.current,!p.child)return null;switch(p.child.tag){case 5:return ae(p.child.stateNode);default:return p.child.stateNode}},n.injectIntoDevTools=function(p){if(p={bundleType:p.bundleType,version:p.version,rendererPackageName:p.rendererPackageName,rendererConfig:p.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:HJ,findFiberByHostInstance:p.findFiberByHostInstance||GJ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")p=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)p=!0;else{try{jc=h.inject(p),Rs=h}catch{}p=!!h.checkDCE}}return p},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(p,h,S,T){if(!yt)throw Error(s(363));p=W1(p,h);var D=ft(p,S,T).disconnect;return{disconnect:function(){D()}}},n.registerMutableSourceForHydration=function(p,h){var S=h._getVersion;S=S(h._source),p.mutableSourceEagerHydrationData==null?p.mutableSourceEagerHydrationData=[h,S]:p.mutableSourceEagerHydrationData.push(h,S)},n.runWithPriority=function(p,h){var S=Ln;try{return Ln=p,h()}finally{Ln=S}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(p,h,S,T){var D=h.current,k=Aa(),ne=Cu(D);return S=FU(S),h.context===null?h.context=S:h.pendingContext=S,h=Tl(k,ne),h.payload={element:p},T=T===void 0?null:T,T!==null&&(h.callback=T),xu(D,h),p=ks(D,ne,k),p!==null&&Fy(p,D,ne),ne},n};yX.exports=r1e;var i1e=yX.exports;const a1e=Sl(i1e),DD={},LD=t=>void Object.assign(DD,t);function s1e(t,e){function n(c,{args:d=[],attach:f,...m},g){let y=`${c[0].toUpperCase()}${c.slice(1)}`,v;if(c==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const b=m.object;v=Bp(b,{type:c,root:g,attach:f,primitive:!0})}else{const b=DD[y];if(!b)throw new Error(`R3F: ${y} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(d))throw new Error("R3F: The args prop must be an array!");v=Bp(new b(...d),{type:c,root:g,attach:f,memoizedProps:{args:d}})}return v.__r3f.attach===void 0&&(v instanceof fn?v.__r3f.attach="geometry":v instanceof ii&&(v.__r3f.attach="material")),y!=="inject"&&aR(v,m),v}function r(c,d){let f=!1;if(d){var m,g;(m=d.__r3f)!=null&&m.attach?iR(c,d,d.__r3f.attach):d.isObject3D&&c.isObject3D&&(c.add(d),f=!0),f||(g=c.__r3f)==null||g.objects.push(d),d.__r3f||Bp(d,{}),d.__r3f.parent=c,GM(d),Fp(d)}}function i(c,d,f){let m=!1;if(d){var g,y;if((g=d.__r3f)!=null&&g.attach)iR(c,d,d.__r3f.attach);else if(d.isObject3D&&c.isObject3D){d.parent=c,d.dispatchEvent({type:"added"}),c.dispatchEvent({type:"childadded",child:d});const v=c.children.filter(E=>E!==d),b=v.indexOf(f);c.children=[...v.slice(0,b),d,...v.slice(b)],m=!0}m||(y=c.__r3f)==null||y.objects.push(d),d.__r3f||Bp(d,{}),d.__r3f.parent=c,GM(d),Fp(d)}}function a(c,d,f=!1){c&&[...c].forEach(m=>s(d,m,f))}function s(c,d,f){if(d){var m,g,y;if(d.__r3f&&(d.__r3f.parent=null),(m=c.__r3f)!=null&&m.objects&&(c.__r3f.objects=c.__r3f.objects.filter(A=>A!==d)),(g=d.__r3f)!=null&&g.attach)iG(c,d,d.__r3f.attach);else if(d.isObject3D&&c.isObject3D){var v;c.remove(d),(v=d.__r3f)!=null&&v.root&&h1e(W_(d),d)}const E=(y=d.__r3f)==null?void 0:y.primitive,_=!E&&(f===void 0?d.dispose!==null:f);if(!E){var b;a((b=d.__r3f)==null?void 0:b.objects,d,_),a(d.children,d,_)}if(delete d.__r3f,_&&d.dispose&&d.type!=="Scene"){const A=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?zM.unstable_scheduleCallback(zM.unstable_IdlePriority,A):A()}Fp(c)}}function o(c,d,f,m){var g;const y=(g=c.__r3f)==null?void 0:g.parent;if(!y)return;const v=n(d,f,c.__r3f.root);if(c.children){for(const b of c.children)b.__r3f&&r(v,b);c.children=c.children.filter(b=>!b.__r3f)}c.__r3f.objects.forEach(b=>r(v,b)),c.__r3f.objects=[],c.__r3f.autoRemovedBeforeAppend||s(y,c),v.parent&&(v.__r3f.autoRemovedBeforeAppend=!0),r(y,v),v.raycast&&v.__r3f.eventCount&&W_(v).getState().internal.interaction.push(v),[m,m.alternate].forEach(b=>{b!==null&&(b.stateNode=v,b.ref&&(typeof b.ref=="function"?b.ref(v):b.ref.current=v))})}const l=()=>{};return{reconciler:a1e({createInstance:n,removeChild:s,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(c,d)=>{if(!d)return;const f=c.getState().scene;f.__r3f&&(f.__r3f.root=c,r(f,d))},removeChildFromContainer:(c,d)=>{d&&s(c.getState().scene,d)},insertInContainerBefore:(c,d,f)=>{if(!d||!f)return;const m=c.getState().scene;m.__r3f&&i(m,d,f)},getRootHostContext:()=>null,getChildHostContext:c=>c,finalizeInitialChildren(c){var d;return!!((d=c==null?void 0:c.__r3f)!=null?d:{}).handlers},prepareUpdate(c,d,f,m){var g;if(((g=c==null?void 0:c.__r3f)!=null?g:{}).primitive&&m.object&&m.object!==c)return[!0];{const{args:v=[],children:b,...E}=m,{args:_=[],children:A,...I}=f;if(!Array.isArray(v))throw new Error("R3F: the args prop must be an array!");if(v.some((R,O)=>R!==_[O]))return[!0];const x=CX(c,E,I,!0);return x.changes.length?[!1,x]:null}},commitUpdate(c,[d,f],m,g,y,v){d?o(c,m,y,v):aR(c,f)},commitMount(c,d,f,m){var g;const y=(g=c.__r3f)!=null?g:{};c.raycast&&y.handlers&&y.eventCount&&W_(c).getState().internal.interaction.push(c)},getPublicInstance:c=>c,prepareForCommit:()=>null,preparePortalMount:c=>Bp(c.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(c){var d;const{attach:f,parent:m}=(d=c.__r3f)!=null?d:{};f&&m&&iG(m,c,f),c.isObject3D&&(c.visible=!1),Fp(c)},unhideInstance(c,d){var f;const{attach:m,parent:g}=(f=c.__r3f)!=null?f:{};m&&g&&iR(g,c,m),(c.isObject3D&&d.visible==null||d.visible)&&(c.visible=!0),Fp(c)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():dh.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Er.fun(performance.now)?performance.now:Er.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Er.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Er.fun(clearTimeout)?clearTimeout:void 0}),applyProps:aR}}var eG,tG;const rR=t=>"colorSpace"in t||"outputColorSpace"in t,_X=()=>{var t;return(t=DD.ColorManagement)!=null?t:null},SX=t=>t&&t.isOrthographicCamera,o1e=t=>t&&t.hasOwnProperty("current"),dy=typeof window<"u"&&((eG=window.document)!=null&&eG.createElement||((tG=window.navigator)==null?void 0:tG.product)==="ReactNative")?w.useLayoutEffect:w.useEffect;function AX(t){const e=w.useRef(t);return dy(()=>void(e.current=t),[t]),e}function l1e({set:t}){return dy(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}class xX extends w.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}xX.getDerivedStateFromError=()=>({error:!0});const TX="__default",nG=new Map,u1e=t=>t&&!!t.memoized&&!!t.changes;function wX(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}const Og=t=>{var e;return(e=t.__r3f)==null?void 0:e.root.getState()};function W_(t){let e=t.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const Er={obj:t=>t===Object(t)&&!Er.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:r="reference",strict:i=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(Er.str(t)||Er.num(t)||Er.boo(t))return t===e;const a=Er.obj(t);if(a&&r==="reference")return t===e;const s=Er.arr(t);if(s&&n==="reference")return t===e;if((s||a)&&t===e)return!0;let o;for(o in t)if(!(o in e))return!1;if(a&&n==="shallow"&&r==="shallow"){for(o in i?e:t)if(!Er.equ(t[o],e[o],{strict:i,objects:"reference"}))return!1}else for(o in i?e:t)if(t[o]!==e[o])return!1;if(Er.und(o)){if(s&&t.length===0&&e.length===0||a&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function c1e(t){const e={nodes:{},materials:{}};return t&&t.traverse(n=>{n.name&&(e.nodes[n.name]=n),n.material&&!e.materials[n.material.name]&&(e.materials[n.material.name]=n.material)}),e}function d1e(t){t.dispose&&t.type!=="Scene"&&t.dispose();for(const e in t)e.dispose==null||e.dispose(),delete t[e]}function Bp(t,e){const n=t;return n.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},t}function HM(t,e){let n=t;if(e.includes("-")){const r=e.split("-"),i=r.pop();return n=r.reduce((a,s)=>a[s],t),{target:n,key:i}}else return{target:n,key:e}}const rG=/-\d+$/;function iR(t,e,n){if(Er.str(n)){if(rG.test(n)){const a=n.replace(rG,""),{target:s,key:o}=HM(t,a);Array.isArray(s[o])||(s[o]=[])}const{target:r,key:i}=HM(t,n);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=n(t,e)}function iG(t,e,n){var r,i;if(Er.str(n)){const{target:a,key:s}=HM(t,n),o=e.__r3f.previousAttach;o===void 0?delete a[s]:a[s]=o}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(t,e);(i=e.__r3f)==null||delete i.previousAttach}function CX(t,{children:e,key:n,ref:r,...i},{children:a,key:s,ref:o,...l}={},u=!1){const c=t.__r3f,d=Object.entries(i),f=[];if(u){const g=Object.keys(l);for(let y=0;y{var v;if((v=t.__r3f)!=null&&v.primitive&&g==="object"||Er.equ(y,l[g]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(g))return f.push([g,y,!0,[]]);let b=[];g.includes("-")&&(b=g.split("-")),f.push([g,y,!1,b]);for(const E in i){const _=i[E];E.startsWith(`${g}-`)&&f.push([E,_,!1,E.split("-")])}});const m={...i};return c!=null&&c.memoizedProps&&c!=null&&c.memoizedProps.args&&(m.args=c.memoizedProps.args),c!=null&&c.memoizedProps&&c!=null&&c.memoizedProps.attach&&(m.attach=c.memoizedProps.attach),{memoized:m,changes:f}}const f1e=typeof process<"u"&&!1;function aR(t,e){var n;const r=t.__r3f,i=r==null?void 0:r.root,a=i==null||i.getState==null?void 0:i.getState(),{memoized:s,changes:o}=u1e(e)?e:CX(t,e),l=r==null?void 0:r.eventCount;t.__r3f&&(t.__r3f.memoizedProps=s);for(let c=0;cb[E],t),!(v&&v.set))){const[b,...E]=g.reverse();y=E.reverse().reduce((_,A)=>_[A],t),d=b}if(f===TX+"remove")if(y.constructor){let b=nG.get(y.constructor);b||(b=new y.constructor,nG.set(y.constructor,b)),f=b[d]}else f=0;if(m&&r)f?r.handlers[d]=f:delete r.handlers[d],r.eventCount=Object.keys(r.handlers).length;else if(v&&v.set&&(v.copy||v instanceof ef)){if(Array.isArray(f))v.fromArray?v.fromArray(f):v.set(...f);else if(v.copy&&f&&f.constructor&&(f1e?v.constructor.name===f.constructor.name:v.constructor===f.constructor))v.copy(f);else if(f!==void 0){const b=v instanceof vt;!b&&v.setScalar?v.setScalar(f):v instanceof ef&&f instanceof ef?v.mask=f.mask:v.set(f),!_X()&&a&&!a.linear&&b&&v.convertSRGBToLinear()}}else if(y[d]=f,y[d]instanceof $n&&y[d].format===ri&&y[d].type===as&&a){const b=y[d];rR(b)&&rR(a.gl)?b.colorSpace=a.gl.outputColorSpace:b.encoding=a.gl.outputEncoding}Fp(t)}if(r&&r.parent&&t.raycast&&l!==r.eventCount){const c=W_(t).getState().internal,d=c.interaction.indexOf(t);d>-1&&c.interaction.splice(d,1),r.eventCount&&c.interaction.push(t)}return!(o.length===1&&o[0][0]==="onUpdate")&&o.length&&(n=t.__r3f)!=null&&n.parent&&GM(t),t}function Fp(t){var e,n;const r=(e=t.__r3f)==null||(n=e.root)==null||n.getState==null?void 0:n.getState();r&&r.internal.frames===0&&r.invalidate()}function GM(t){t.onUpdate==null||t.onUpdate(t)}function RX(t,e){t.manual||(SX(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix(),t.updateMatrixWorld())}function WE(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function p1e(){var t;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return dh.DefaultEventPriority;switch((t=e.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return dh.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return dh.ContinuousEventPriority;default:return dh.DefaultEventPriority}}function IX(t,e,n,r){const i=n.get(e);i&&(n.delete(e),n.size===0&&(t.delete(r),i.target.releasePointerCapture(r)))}function h1e(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(r=>r!==e),n.initialHits=n.initialHits.filter(r=>r!==e),n.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&n.hovered.delete(i)}),n.capturedMap.forEach((r,i)=>{IX(n.capturedMap,e,r,i)})}function m1e(t){function e(l){const{internal:u}=t.getState(),c=l.offsetX-u.initialClick[0],d=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(c*c+d*d))}function n(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(c=>{var d;return(d=u.__r3f)==null?void 0:d.handlers["onPointer"+c]}))}function r(l,u){const c=t.getState(),d=new Set,f=[],m=u?u(c.internal.interaction):c.internal.interaction;for(let b=0;b{const _=Og(b.object),A=Og(E.object);return!_||!A?b.distance-E.distance:A.events.priority-_.events.priority||b.distance-E.distance}).filter(b=>{const E=WE(b);return d.has(E)?!1:(d.add(E),!0)});c.events.filter&&(y=c.events.filter(y,c));for(const b of y){let E=b.object;for(;E;){var v;(v=E.__r3f)!=null&&v.eventCount&&f.push({...b,eventObject:E}),E=E.parent}}if("pointerId"in l&&c.internal.capturedMap.has(l.pointerId))for(let b of c.internal.capturedMap.get(l.pointerId).values())d.has(WE(b.intersection))||f.push(b.intersection);return f}function i(l,u,c,d){const f=t.getState();if(l.length){const m={stopped:!1};for(const g of l){const y=Og(g.object)||f,{raycaster:v,pointer:b,camera:E,internal:_}=y,A=new H(b.x,b.y,0).unproject(E),I=M=>{var B,G;return(B=(G=_.capturedMap.get(M))==null?void 0:G.has(g.eventObject))!=null?B:!1},x=M=>{const B={intersection:g,target:u.target};_.capturedMap.has(M)?_.capturedMap.get(M).set(g.eventObject,B):_.capturedMap.set(M,new Map([[g.eventObject,B]])),u.target.setPointerCapture(M)},R=M=>{const B=_.capturedMap.get(M);B&&IX(_.capturedMap,g.eventObject,B,M)};let O={};for(let M in u){let B=u[M];typeof B!="function"&&(O[M]=B)}let N={...g,...O,pointer:b,intersections:l,stopped:m.stopped,delta:c,unprojectedPoint:A,ray:v.ray,camera:E,stopPropagation(){const M="pointerId"in u&&_.capturedMap.get(u.pointerId);if((!M||M.has(g.eventObject))&&(N.stopped=m.stopped=!0,_.hovered.size&&Array.from(_.hovered.values()).find(B=>B.eventObject===g.eventObject))){const B=l.slice(0,l.indexOf(g));a([...B,g])}},target:{hasPointerCapture:I,setPointerCapture:x,releasePointerCapture:R},currentTarget:{hasPointerCapture:I,setPointerCapture:x,releasePointerCapture:R},nativeEvent:u};if(d(N),m.stopped===!0)break}}return l}function a(l){const{internal:u}=t.getState();for(const c of u.hovered.values())if(!l.length||!l.find(d=>d.object===c.object&&d.index===c.index&&d.instanceId===c.instanceId)){const f=c.eventObject.__r3f,m=f==null?void 0:f.handlers;if(u.hovered.delete(WE(c)),f!=null&&f.eventCount){const g={...c,intersections:l};m.onPointerOut==null||m.onPointerOut(g),m.onPointerLeave==null||m.onPointerLeave(g)}}}function s(l,u){for(let c=0;ca([]);case"onLostPointerCapture":return u=>{const{internal:c}=t.getState();"pointerId"in u&&c.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{c.capturedMap.has(u.pointerId)&&(c.capturedMap.delete(u.pointerId),a([]))})}}return function(c){const{onPointerMissed:d,internal:f}=t.getState();f.lastEvent.current=c;const m=l==="onPointerMove",g=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",v=r(c,m?n:void 0),b=g?e(c):0;l==="onPointerDown"&&(f.initialClick=[c.offsetX,c.offsetY],f.initialHits=v.map(_=>_.eventObject)),g&&!v.length&&b<=2&&(s(c,f.interaction),d&&d(c)),m&&a(v);function E(_){const A=_.eventObject,I=A.__r3f,x=I==null?void 0:I.handlers;if(I!=null&&I.eventCount)if(m){if(x.onPointerOver||x.onPointerEnter||x.onPointerOut||x.onPointerLeave){const R=WE(_),O=f.hovered.get(R);O?O.stopped&&_.stopPropagation():(f.hovered.set(R,_),x.onPointerOver==null||x.onPointerOver(_),x.onPointerEnter==null||x.onPointerEnter(_))}x.onPointerMove==null||x.onPointerMove(_)}else{const R=x[l];R?(!g||f.initialHits.includes(A))&&(s(c,f.interaction.filter(O=>!f.initialHits.includes(O))),R(_)):g&&f.initialHits.includes(A)&&s(c,f.interaction.filter(O=>!f.initialHits.includes(O)))}}i(v,c,b,E)}}return{handlePointer:o}}const g1e=["set","get","setSize","setFrameloop","setDpr","events","invalidate","advance","size","viewport"],MX=t=>!!(t!=null&&t.render),kD=w.createContext(null),b1e=(t,e)=>{const n=OD((o,l)=>{const u=new H,c=new H,d=new H;function f(b=l().camera,E=c,_=l().size){const{width:A,height:I,top:x,left:R}=_,O=A/I;E instanceof H?d.copy(E):d.set(...E);const N=b.getWorldPosition(u).distanceTo(d);if(SX(b))return{width:A/b.zoom,height:I/b.zoom,top:x,left:R,factor:1,distance:N,aspect:O};{const M=b.fov*Math.PI/180,B=2*Math.tan(M/2)*N,G=B*(A/I);return{width:G,height:B,top:x,left:R,factor:A/G,distance:N,aspect:O}}}let m;const g=b=>o(E=>({performance:{...E.performance,current:b}})),y=new Ke;return{set:o,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(b=1)=>t(l(),b),advance:(b,E)=>e(b,E,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new CD,pointer:y,mouse:y,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const b=l();m&&clearTimeout(m),b.performance.current!==b.performance.min&&g(b.performance.min),m=setTimeout(()=>g(l().performance.max),b.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:f},setEvents:b=>o(E=>({...E,events:{...E.events,...b}})),setSize:(b,E,_,A,I)=>{const x=l().camera,R={width:b,height:E,top:A||0,left:I||0,updateStyle:_};o(O=>({size:R,viewport:{...O.viewport,...f(x,c,R)}}))},setDpr:b=>o(E=>{const _=wX(b);return{viewport:{...E.viewport,dpr:_,initialDpr:E.viewport.initialDpr||_}}}),setFrameloop:(b="always")=>{const E=l().clock;E.stop(),E.elapsedTime=0,b!=="never"&&(E.start(),E.elapsedTime=0),o(()=>({frameloop:b}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:w.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(b,E,_)=>{const A=l().internal;return A.priority=A.priority+(E>0?1:0),A.subscribers.push({ref:b,priority:E,store:_}),A.subscribers=A.subscribers.sort((I,x)=>I.priority-x.priority),()=>{const I=l().internal;I!=null&&I.subscribers&&(I.priority=I.priority-(E>0?1:0),I.subscribers=I.subscribers.filter(x=>x.ref!==b))}}}}}),r=n.getState();let i=r.size,a=r.viewport.dpr,s=r.camera;return n.subscribe(()=>{const{camera:o,size:l,viewport:u,gl:c,set:d}=n.getState();if(l.width!==i.width||l.height!==i.height||u.dpr!==a){var f;i=l,a=u.dpr,RX(o,l),c.setPixelRatio(u.dpr);const m=(f=l.updateStyle)!=null?f:typeof HTMLCanvasElement<"u"&&c.domElement instanceof HTMLCanvasElement;c.setSize(l.width,l.height,m)}o!==s&&(s=o,d(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(o)}})))}),n.subscribe(o=>t(o)),n};let jE,y1e=new Set,v1e=new Set,E1e=new Set;function sR(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function Dg(t,e){switch(t){case"before":return sR(y1e,e);case"after":return sR(v1e,e);case"tail":return sR(E1e,e)}}let oR,lR;function uR(t,e,n){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof t=="number"&&(r=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),oR=e.internal.subscribers,jE=0;jE0)&&!((c=a.gl.xr)!=null&&c.isPresenting)&&(r+=uR(u,a))}if(n=!1,Dg("after",u),r===0)return Dg("tail",u),e=!1,cancelAnimationFrame(i)}function o(u,c=1){var d;if(!u)return t.forEach(f=>o(f.store.getState(),c));(d=u.gl.xr)!=null&&d.isPresenting||!u.internal.active||u.frameloop==="never"||(c>1?u.internal.frames=Math.min(60,u.internal.frames+c):n?u.internal.frames=2:u.internal.frames=1,e||(e=!0,requestAnimationFrame(s)))}function l(u,c=!0,d,f){if(c&&Dg("before",u),d)uR(u,d,f);else for(const m of t.values())uR(u,m.store.getState());c&&Dg("after",u)}return{loop:s,invalidate:o,advance:l}}function PD(){const t=w.useContext(kD);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function zn(t=n=>n,e){return PD()(t,e)}function ko(t,e=0){const n=PD(),r=n.getState().internal.subscribe,i=AX(t);return dy(()=>r(i,e,n),[e,r,n]),null}const aG=new WeakMap;function NX(t,e){return function(n,...r){let i=aG.get(n);return i||(i=new n,aG.set(n,i)),t&&t(i),Promise.all(r.map(a=>new Promise((s,o)=>i.load(a,l=>{l.scene&&Object.assign(l,c1e(l.scene)),s(l)},e,l=>o(new Error(`Could not load ${a}: ${l==null?void 0:l.message}`))))))}}function io(t,e,n,r){const i=Array.isArray(e)?e:[e],a=e1e(NX(n,r),[t,...i],{equal:Er.equ});return Array.isArray(e)?a:a[0]}io.preload=function(t,e,n){const r=Array.isArray(e)?e:[e];return t1e(NX(n),[t,...r])};io.clear=function(t,e){const n=Array.isArray(e)?e:[e];return n1e([t,...n])};const nm=new Map,{invalidate:sG,advance:oG}=_1e(nm),{reconciler:Mb,applyProps:Qu}=s1e(nm,p1e),Np={objects:"shallow",strict:!1},S1e=(t,e)=>{const n=typeof t=="function"?t(e):t;return MX(n)?n:new aD({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...t})};function A1e(t,e){const n=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:a,left:s,updateStyle:o=n}=e;return{width:r,height:i,top:a,left:s,updateStyle:o}}else if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:r,height:i,top:a,left:s}=t.parentElement.getBoundingClientRect();return{width:r,height:i,top:a,left:s,updateStyle:n}}else if(typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0,updateStyle:n};return{width:0,height:0,top:0,left:0}}function x1e(t){const e=nm.get(t),n=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,a=r||b1e(sG,oG),s=n||Mb.createContainer(a,dh.ConcurrentRoot,null,!1,null,"",i,null);e||nm.set(t,{fiber:s,store:a});let o,l=!1,u;return{configure(c={}){let{gl:d,size:f,scene:m,events:g,onCreated:y,shadows:v=!1,linear:b=!1,flat:E=!1,legacy:_=!1,orthographic:A=!1,frameloop:I="always",dpr:x=[1,2],performance:R,raycaster:O,camera:N,onPointerMissed:M}=c,B=a.getState(),G=B.gl;B.gl||B.set({gl:G=S1e(d,t)});let W=B.raycaster;W||B.set({raycaster:W=new ET});const{params:K,...se}=O||{};if(Er.equ(se,W,Np)||Qu(W,{...se}),Er.equ(K,W.params,Np)||Qu(W,{params:{...W.params,...K}}),!B.camera||B.camera===u&&!Er.equ(u,N,Np)){u=N;const J=N instanceof ny,fe=J?N:A?new pl(0,0,0,0,.1,1e3):new qr(75,0,.1,1e3);J||(fe.position.z=5,N&&(Qu(fe,N),("aspect"in N||"left"in N||"right"in N||"bottom"in N||"top"in N)&&(fe.manual=!0,fe.updateProjectionMatrix())),!B.camera&&!(N!=null&&N.rotation)&&fe.lookAt(0,0,0)),B.set({camera:fe}),W.camera=fe}if(!B.scene){let J;m instanceof em?J=m:(J=new em,m&&Qu(J,m)),B.set({scene:Bp(J)})}if(!B.xr){var ae;const J=(Le,j)=>{const ke=a.getState();ke.frameloop!=="never"&&oG(Le,!0,ke,j)},fe=()=>{const Le=a.getState();Le.gl.xr.enabled=Le.gl.xr.isPresenting,Le.gl.xr.setAnimationLoop(Le.gl.xr.isPresenting?J:null),Le.gl.xr.isPresenting||sG(Le)},Ce={connect(){const Le=a.getState().gl;Le.xr.addEventListener("sessionstart",fe),Le.xr.addEventListener("sessionend",fe)},disconnect(){const Le=a.getState().gl;Le.xr.removeEventListener("sessionstart",fe),Le.xr.removeEventListener("sessionend",fe)}};typeof((ae=G.xr)==null?void 0:ae.addEventListener)=="function"&&Ce.connect(),B.set({xr:Ce})}if(G.shadowMap){const J=G.shadowMap.enabled,fe=G.shadowMap.type;if(G.shadowMap.enabled=!!v,Er.boo(v))G.shadowMap.type=x0;else if(Er.str(v)){var ee;const Ce={basic:CY,percentage:Gx,soft:x0,variance:go};G.shadowMap.type=(ee=Ce[v])!=null?ee:x0}else Er.obj(v)&&Object.assign(G.shadowMap,v);(J!==G.shadowMap.enabled||fe!==G.shadowMap.type)&&(G.shadowMap.needsUpdate=!0)}const F=_X();F&&("enabled"in F?F.enabled=!_:"legacyMode"in F&&(F.legacyMode=_)),l||Qu(G,{outputEncoding:b?3e3:3001,toneMapping:E?fl:HO}),B.legacy!==_&&B.set(()=>({legacy:_})),B.linear!==b&&B.set(()=>({linear:b})),B.flat!==E&&B.set(()=>({flat:E})),d&&!Er.fun(d)&&!MX(d)&&!Er.equ(d,G,Np)&&Qu(G,d),g&&!B.events.handlers&&B.set({events:g(a)});const ie=A1e(t,f);return Er.equ(ie,B.size,Np)||B.setSize(ie.width,ie.height,ie.updateStyle,ie.top,ie.left),x&&B.viewport.dpr!==wX(x)&&B.setDpr(x),B.frameloop!==I&&B.setFrameloop(I),B.onPointerMissed||B.set({onPointerMissed:M}),R&&!Er.equ(R,B.performance,Np)&&B.set(J=>({performance:{...J.performance,...R}})),o=y,l=!0,this},render(c){return l||this.configure(),Mb.updateContainer($.jsx(T1e,{store:a,children:c,onCreated:o,rootElement:t}),s,null,()=>{}),a},unmount(){OX(t)}}}function T1e({store:t,children:e,onCreated:n,rootElement:r}){return dy(()=>{const i=t.getState();i.set(a=>({internal:{...a.internal,active:!0}})),n&&n(i),t.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),$.jsx(kD.Provider,{value:t,children:e})}function OX(t,e){const n=nm.get(t),r=n==null?void 0:n.fiber;if(r){const i=n==null?void 0:n.store.getState();i&&(i.internal.active=!1),Mb.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var a,s,o,l;i.events.disconnect==null||i.events.disconnect(),(a=i.gl)==null||(s=a.renderLists)==null||s.dispose==null||s.dispose(),(o=i.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),d1e(i),nm.delete(t)}catch{}},500)})}}function w1e(t,e,n){return $.jsx(C1e,{children:t,container:e,state:n},e.uuid)}function C1e({state:t={},children:e,container:n}){const{events:r,size:i,...a}=t,s=PD(),[o]=w.useState(()=>new ET),[l]=w.useState(()=>new Ke),u=w.useCallback((d,f)=>{const m={...d};Object.keys(d).forEach(y=>{(g1e.includes(y)||d[y]!==f[y]&&f[y])&&delete m[y]});let g;if(f&&i){const y=f.camera;g=d.viewport.getCurrentViewport(y,new H,i),y!==d.camera&&RX(y,i)}return{...m,scene:n,raycaster:o,pointer:l,mouse:l,previousRoot:s,events:{...d.events,...f==null?void 0:f.events,...r},size:{...d.size,...i},viewport:{...d.viewport,...g},...a}},[t]),[c]=w.useState(()=>{const d=s.getState();return OD((m,g)=>({...d,scene:n,raycaster:o,pointer:l,mouse:l,previousRoot:s,events:{...d.events,...r},size:{...d.size,...i},...a,set:m,get:g,setEvents:y=>m(v=>({...v,events:{...v.events,...y}}))}))});return w.useEffect(()=>{const d=s.subscribe(f=>c.setState(m=>u(f,m)));return()=>{d()}},[u]),w.useEffect(()=>{c.setState(d=>u(s.getState(),d))},[u]),w.useEffect(()=>()=>{c.destroy()},[]),$.jsx($.Fragment,{children:Mb.createPortal($.jsx(kD.Provider,{value:c,children:e}),c,null)})}Mb.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:w.version});const cR={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 R1e(t){const{handlePointer:e}=m1e(t);return{priority:1,enabled:!0,compute(n,r,i){r.pointer.set(n.offsetX/r.size.width*2-1,-(n.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(cR).reduce((n,r)=>({...n,[r]:e(r)}),{}),update:()=>{var n;const{events:r,internal:i}=t.getState();(n=i.lastEvent)!=null&&n.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:n=>{var r;const{set:i,events:a}=t.getState();a.disconnect==null||a.disconnect(),i(s=>({events:{...s.events,connected:n}})),Object.entries((r=a.handlers)!=null?r:[]).forEach(([s,o])=>{const[l,u]=cR[s];n.addEventListener(l,o,{passive:u})})},disconnect:()=>{const{set:n,events:r}=t.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([a,s])=>{if(r&&r.connected instanceof HTMLElement){const[o]=cR[a];r.connected.removeEventListener(o,s)}}),n(a=>({events:{...a.events,connected:void 0}}))}}}}function VM(t,e,n){var r,i,a,s,o;e==null&&(e=100);function l(){var c=Date.now()-s;c=0?r=setTimeout(l,e-c):(r=null,n||(o=t.apply(a,i),a=i=null))}var u=function(){a=this,i=arguments,s=Date.now();var c=n&&!r;return r||(r=setTimeout(l,e)),c&&(o=t.apply(a,i),a=i=null),o};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(o=t.apply(a,i),a=i=null,clearTimeout(r),r=null)},u}VM.debounce=VM;var I1e=VM;const lG=Sl(I1e);var M1e=Object.defineProperty,N1e=Object.defineProperties,O1e=Object.getOwnPropertyDescriptors,uG=Object.getOwnPropertySymbols,D1e=Object.prototype.hasOwnProperty,L1e=Object.prototype.propertyIsEnumerable,cG=(t,e,n)=>e in t?M1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,dG=(t,e)=>{for(var n in e||(e={}))D1e.call(e,n)&&cG(t,n,e[n]);if(uG)for(var n of uG(e))L1e.call(e,n)&&cG(t,n,e[n]);return t},k1e=(t,e)=>N1e(t,O1e(e)),fG,pG;typeof window<"u"&&((fG=window.document)!=null&&fG.createElement||((pG=window.navigator)==null?void 0:pG.product)==="ReactNative")?w.useLayoutEffect:w.useEffect;function DX(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=t.child;for(;r;){const i=DX(r,e,n);if(i)return i;r=r.sibling}}function LX(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const hG=console.error;console.error=function(){const t=[...arguments].join("");if(t!=null&&t.startsWith("Warning:")&&t.includes("useContext")){console.error=hG;return}return hG.apply(this,arguments)};const BD=LX(w.createContext(null));class kX extends w.Component{render(){return w.createElement(BD.Provider,{value:this._reactInternals},this.props.children)}}function P1e(){const t=w.useContext(BD);if(t===null)throw new Error("its-fine: useFiber must be called within a !");const e=w.useId();return w.useMemo(()=>{for(const r of[t,t==null?void 0:t.alternate]){if(!r)continue;const i=DX(r,!1,a=>{let s=a.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[t,e])}function B1e(){const t=P1e(),[e]=w.useState(()=>new Map);e.clear();let n=t;for(;n;){if(n.type&&typeof n.type=="object"){const i=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;i&&i!==BD&&!e.has(i)&&e.set(i,w.useContext(LX(i)))}n=n.return}return e}function F1e(){const t=B1e();return w.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>w.createElement(e,null,w.createElement(n.Provider,k1e(dG({},r),{value:t.get(n)}))),e=>w.createElement(kX,dG({},e))),[t])}function U1e({debounce:t,scroll:e,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=n||typeof window<"u"&&window.ResizeObserver,[a,s]=w.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!i)return a.width=1280,a.height=800,[()=>{},a,()=>{}];const o=w.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a,orientationHandler:null}),l=t?typeof t=="number"?t:t.scroll:null,u=t?typeof t=="number"?t:t.resize:null,c=w.useRef(!1);w.useEffect(()=>(c.current=!0,()=>void(c.current=!1)));const[d,f,m]=w.useMemo(()=>{const b=()=>{if(!o.current.element)return;const{left:E,top:_,width:A,height:I,bottom:x,right:R,x:O,y:N}=o.current.element.getBoundingClientRect(),M={left:E,top:_,width:A,height:I,bottom:x,right:R,x:O,y:N};o.current.element instanceof HTMLElement&&r&&(M.height=o.current.element.offsetHeight,M.width=o.current.element.offsetWidth),Object.freeze(M),c.current&&!V1e(o.current.lastBounds,M)&&s(o.current.lastBounds=M)};return[b,u?lG(b,u):b,l?lG(b,l):b]},[s,r,l,u]);function g(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(b=>b.removeEventListener("scroll",m,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function y(){var b;o.current.element&&(o.current.resizeObserver=new i(f),(b=o.current.resizeObserver)==null||b.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(E=>E.addEventListener("scroll",m,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const v=b=>{!b||b===o.current.element||(g(),o.current.element=b,o.current.scrollContainers=PX(b),y())};return H1e(m,!!e),z1e(f),w.useEffect(()=>{g(),y()},[e,m,f]),w.useEffect(()=>g,[]),[v,a,d]}function z1e(t){w.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function H1e(t,e){w.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function PX(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(a=>a==="auto"||a==="scroll")&&e.push(t),[...e,...PX(t.parentElement)]}const G1e=["x","y","top","bottom","left","right","width","height"],V1e=(t,e)=>G1e.every(n=>t[n]===e[n]),$1e=w.forwardRef(function({children:e,fallback:n,resize:r,style:i,gl:a,events:s=R1e,eventSource:o,eventPrefix:l,shadows:u,linear:c,flat:d,legacy:f,orthographic:m,frameloop:g,dpr:y,performance:v,raycaster:b,camera:E,scene:_,onPointerMissed:A,onCreated:I,...x},R){w.useMemo(()=>LD(KTe),[]);const O=F1e(),[N,M]=U1e({scroll:!0,debounce:{scroll:50,resize:0},...r}),B=w.useRef(null),G=w.useRef(null);w.useImperativeHandle(R,()=>B.current);const W=AX(A),[K,se]=w.useState(!1),[ae,ee]=w.useState(!1);if(K)throw K;if(ae)throw ae;const F=w.useRef(null);dy(()=>{const J=B.current;M.width>0&&M.height>0&&J&&(F.current||(F.current=x1e(J)),F.current.configure({gl:a,events:s,shadows:u,linear:c,flat:d,legacy:f,orthographic:m,frameloop:g,dpr:y,performance:v,raycaster:b,camera:E,scene:_,size:M,onPointerMissed:(...fe)=>W.current==null?void 0:W.current(...fe),onCreated:fe=>{fe.events.connect==null||fe.events.connect(o?o1e(o)?o.current:o:G.current),l&&fe.setEvents({compute:(Ce,Le)=>{const j=Ce[l+"X"],ke=Ce[l+"Y"];Le.pointer.set(j/Le.size.width*2-1,-(ke/Le.size.height)*2+1),Le.raycaster.setFromCamera(Le.pointer,Le.camera)}}),I==null||I(fe)}}),F.current.render($.jsx(O,{children:$.jsx(xX,{set:ee,children:$.jsx(w.Suspense,{fallback:$.jsx(l1e,{set:se}),children:e})})})))}),w.useEffect(()=>{const J=B.current;if(J)return()=>OX(J)},[]);const ie=o?"none":"auto";return $.jsx("div",{ref:G,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:ie,...i},...x,children:$.jsx("div",{ref:N,style:{width:"100%",height:"100%"},children:$.jsx("canvas",{ref:B,style:{display:"block"},children:n})})})}),W1e=w.forwardRef(function(e,n){return $.jsx(kX,{children:$.jsx($1e,{...e,ref:n})})});function j1e(t,e,n){return Math.max(e,Math.min(t,n))}const ha={toVector(t,e){return t===void 0&&(t=e),Array.isArray(t)?t:[t,t]},add(t,e){return[t[0]+e[0],t[1]+e[1]]},sub(t,e){return[t[0]-e[0],t[1]-e[1]]},addTo(t,e){t[0]+=e[0],t[1]+=e[1]},subTo(t,e){t[0]-=e[0],t[1]-=e[1]}};function mG(t,e,n){return e===0||Math.abs(e)===1/0?Math.pow(t,n*5):t*e*n/(e+n*t)}function gG(t,e,n,r=.15){return r===0?j1e(t,e,n):tn?+mG(t-n,n-e,r)+n:t}function Y1e(t,[e,n],[r,i]){const[[a,s],[o,l]]=t;return[gG(e,a,s,r),gG(n,o,l,i)]}function q1e(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function X1e(t){var e=q1e(t,"string");return typeof e=="symbol"?e:String(e)}function ja(t,e,n){return e=X1e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bG(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function zr(t){for(var e=1;e{var n,r;return e.target===t.currentTarget||((n=t.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,e.target))})}function rwe(t){return t.type==="touchend"||t.type==="touchcancel"?t.changedTouches:t.targetTouches}function UX(t){return _T(t)?rwe(t)[0]:t}function iwe(t){return nwe(t).map(e=>e.identifier)}function dR(t){const e=UX(t);return _T(t)?e.identifier:e.pointerId}function vG(t){const e=UX(t);return[e.clientX,e.clientY]}function awe(t){const e={};if("buttons"in t&&(e.buttons=t.buttons),"shiftKey"in t){const{shiftKey:n,altKey:r,metaKey:i,ctrlKey:a}=t;Object.assign(e,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:a})}return e}function wA(t,...e){return typeof t=="function"?t(...e):t}function swe(){}function owe(...t){return t.length===0?swe:t.length===1?t[0]:function(){let e;for(const n of t)e=n.apply(this,arguments)||e;return e}}function EG(t,e){return Object.assign({},e,t||{})}const lwe=32;class uwe{constructor(e,n,r){this.ctrl=e,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:n,ingKey:r,args:i}=this;n[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=i,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=e.target,n.currentTarget=e.currentTarget,n.lastOffset=r.from?wA(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=e.timeStamp)}computeValues(e){const n=this.state;n._values=e,n.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:n,config:r,shared:i}=this;n.args=this.args;let a=0;if(e&&(n.event=e,r.preventDefault&&e.cancelable&&n.event.preventDefault(),n.type=e.type,i.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,i.locked=!!document.pointerLockElement,Object.assign(i,awe(e)),i.down=i.pressed=i.buttons%2===1||i.touches>0,a=e.timeStamp-n.timeStamp,n.timeStamp=e.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const x=n._delta.map(Math.abs);ha.addTo(n._distance,x)}this.axisIntent&&this.axisIntent(e);const[s,o]=n._movement,[l,u]=r.threshold,{_step:c,values:d}=n;if(r.hasCustomTransform?(c[0]===!1&&(c[0]=Math.abs(s)>=l&&d[0]),c[1]===!1&&(c[1]=Math.abs(o)>=u&&d[1])):(c[0]===!1&&(c[0]=Math.abs(s)>=l&&Math.sign(s)*l),c[1]===!1&&(c[1]=Math.abs(o)>=u&&Math.sign(o)*u)),n.intentional=c[0]!==!1||c[1]!==!1,!n.intentional)return;const f=[0,0];if(r.hasCustomTransform){const[x,R]=d;f[0]=c[0]!==!1?x-c[0]:0,f[1]=c[1]!==!1?R-c[1]:0}else f[0]=c[0]!==!1?s-c[0]:0,f[1]=c[1]!==!1?o-c[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(f);const m=n.offset,g=n._active&&!n._blocked||n.active;g&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=i[this.ingKey]=n._active,e&&(n.first&&("bounds"in r&&(n._bounds=wA(r.bounds,n)),this.setup&&this.setup()),n.movement=f,this.computeOffset()));const[y,v]=n.offset,[[b,E],[_,A]]=n._bounds;n.overflow=[yE?1:0,v<_?-1:v>A?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const I=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=Y1e(n._bounds,n.offset,I),n.delta=ha.sub(n.offset,m),this.computeMovement(),g&&(!n.last||a>lwe)){n.delta=ha.sub(n.offset,m);const x=n.delta.map(Math.abs);ha.addTo(n.distance,x),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&a>0&&(n.velocity=[x[0]/a,x[1]/a],n.timeDelta=a)}}emit(){const e=this.state,n=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const i=this.handler(zr(zr(zr({},n),e),{},{[this.aliasKey]:e.values}));i!==void 0&&(e.memo=i)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function cwe([t,e],n){const r=Math.abs(t),i=Math.abs(e);if(r>i&&r>n)return"x";if(i>r&&i>n)return"y"}class dwe extends uwe{constructor(...e){super(...e),ja(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ha.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ha.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const n=this.state,r=this.config;if(!n.axis&&e){const i=typeof r.axisThreshold=="object"?r.axisThreshold[FX(e)]:r.axisThreshold;n.axis=cwe(n._movement,i)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const fwe=t=>t,_G=.15,zX={enabled(t=!0){return t},eventOptions(t,e,n){return zr(zr({},n.shared.eventOptions),t)},preventDefault(t=!1){return t},triggerAllEvents(t=!1){return t},rubberband(t=0){switch(t){case!0:return[_G,_G];case!1:return[0,0];default:return ha.toVector(t)}},from(t){if(typeof t=="function")return t;if(t!=null)return ha.toVector(t)},transform(t,e,n){const r=t||n.shared.transform;return this.hasCustomTransform=!!r,r||fwe},threshold(t){return ha.toVector(t,0)}},pwe=0,fy=zr(zr({},zX),{},{axis(t,e,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(t=pwe){return t},bounds(t={}){if(typeof t=="function")return a=>fy.bounds(t(a));if("current"in t)return()=>t.current;if(typeof HTMLElement=="function"&&t instanceof HTMLElement)return t;const{left:e=-1/0,right:n=1/0,top:r=-1/0,bottom:i=1/0}=t;return[[e,n],[r,i]]}}),SG={ArrowRight:(t,e=1)=>[t*e,0],ArrowLeft:(t,e=1)=>[-1*t*e,0],ArrowUp:(t,e=1)=>[0,-1*t*e],ArrowDown:(t,e=1)=>[0,t*e]};class hwe extends dwe{constructor(...e){super(...e),ja(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const n=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),i={left:n.left-r.left+e.offset[0],right:n.right-r.right+e.offset[0],top:n.top-r.top+e.offset[1],bottom:n.bottom-r.bottom+e.offset[1]};e._bounds=fy.bounds(i)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const n=this.config,r=this.state;if(e.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(e.buttons):n.pointerButtons!==-1&&n.pointerButtons!==e.buttons))return;const i=this.ctrl.setEventIds(e);n.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(i&&i.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=dR(e),r._pointerActive=!0,this.computeValues(vG(e)),this.computeInitial(),n.preventScrollAxis&&FX(e)!=="mouse"?(r._active=!1,this.setupScrollPrevention(e)):n.delay>0?(this.setupDelayTrigger(e),n.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const n=this.state,r=this.config;if(!n._pointerActive)return;const i=dR(e);if(n._pointerId!==void 0&&i!==n._pointerId)return;const a=vG(e);if(document.pointerLockElement===e.target?n._delta=[e.movementX,e.movementY]:(n._delta=ha.sub(a,n._values),this.computeValues(a)),ha.addTo(n._movement,n._delta),this.compute(e),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(e);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const i=dR(e);if(n._pointerId!==void 0&&i!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[a,s]=n._distance;if(n.tap=a<=r.tapsThreshold&&s<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[o,l]=n._delta,[u,c]=n._movement,[d,f]=r.swipe.velocity,[m,g]=r.swipe.distance,y=r.swipe.duration;if(n.elapsedTimed&&Math.abs(u)>m&&(n.swipe[0]=Math.sign(o)),b>f&&Math.abs(c)>g&&(n.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const n=this.config,r=n.device;n.pointerLock&&e.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,mwe(e);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const n=SG[e.key];if(n){const r=this.state,i=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=n(this.config.keyboardDisplacement,i),r._keyboardActive=!0,ha.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in SG&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const n=this.config.device;e(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(n,"change",this.pointerMove.bind(this)),e(n,"end",this.pointerUp.bind(this)),e(n,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function mwe(t){"persist"in t&&typeof t.persist=="function"&&t.persist()}const py=typeof window<"u"&&window.document&&window.document.createElement;function HX(){return py&&"ontouchstart"in window}function gwe(){return HX()||py&&window.navigator.maxTouchPoints>1}function bwe(){return py&&"onpointerdown"in window}function ywe(){return py&&"exitPointerLock"in window.document}function vwe(){try{return"constructor"in GestureEvent}catch{return!1}}const qs={isBrowser:py,gesture:vwe(),touch:HX(),touchscreen:gwe(),pointer:bwe(),pointerLock:ywe()},Ewe=250,_we=180,Swe=.5,Awe=50,xwe=250,Twe=10,AG={mouse:0,touch:0,pen:8},wwe=zr(zr({},fy),{},{device(t,e,{pointer:{touch:n=!1,lock:r=!1,mouse:i=!1}={}}){return this.pointerLock=r&&qs.pointerLock,qs.touch&&n?"touch":this.pointerLock?"mouse":qs.pointer&&!i?"pointer":qs.touch?"touch":"mouse"},preventScrollAxis(t,e,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&t?Ewe:void 0,!(!qs.touchscreen||n===!1))return t||(n!==void 0?"y":void 0)},pointerCapture(t,e,{pointer:{capture:n=!0,buttons:r=1,keys:i=!0}={}}){return this.pointerButtons=r,this.keys=i,!this.pointerLock&&this.device==="pointer"&&n},threshold(t,e,{filterTaps:n=!1,tapsThreshold:r=3,axis:i=void 0}){const a=ha.toVector(t,n?r:i?1:0);return this.filterTaps=n,this.tapsThreshold=r,a},swipe({velocity:t=Swe,distance:e=Awe,duration:n=xwe}={}){return{velocity:this.transform(ha.toVector(t)),distance:this.transform(ha.toVector(e)),duration:n}},delay(t=0){switch(t){case!0:return _we;case!1:return 0;default:return t}},axisThreshold(t){return t?zr(zr({},AG),t):AG},keyboardDisplacement(t=Twe){return t}});zr(zr({},zX),{},{device(t,e,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!qs.touch&&qs.gesture)return"gesture";if(qs.touch&&r)return"touch";if(qs.touchscreen){if(qs.pointer)return"pointer";if(qs.touch)return"touch"}},bounds(t,e,{scaleBounds:n={},angleBounds:r={}}){const i=s=>{const o=EG(wA(n,s),{min:-1/0,max:1/0});return[o.min,o.max]},a=s=>{const o=EG(wA(r,s),{min:-1/0,max:1/0});return[o.min,o.max]};return typeof n!="function"&&typeof r!="function"?[i(),a()]:s=>[i(s),a(s)]},threshold(t,e,n){return this.lockDirection=n.axis==="lock",ha.toVector(t,this.lockDirection?[.1,3]:0)},modifierKey(t){return t===void 0?"ctrlKey":t},pinchOnWheel(t=!0){return t}});zr(zr({},fy),{},{mouseOnly:(t=!0)=>t});zr(zr({},fy),{},{mouseOnly:(t=!0)=>t});const GX=new Map,$M=new Map;function Cwe(t){GX.set(t.key,t.engine),$M.set(t.key,t.resolver)}const Rwe={key:"drag",engine:hwe,resolver:wwe};function Iwe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function Mwe(t,e){if(t==null)return{};var n=Iwe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}const Nwe={target(t){if(t)return()=>"current"in t?t.current:t},enabled(t=!0){return t},window(t=qs.isBrowser?window:void 0){return t},eventOptions({passive:t=!0,capture:e=!1}={}){return{passive:t,capture:e}},transform(t){return t}},Owe=["target","eventOptions","window","enabled","transform"];function j_(t={},e){const n={};for(const[r,i]of Object.entries(e))switch(typeof i){case"function":n[r]=i.call(n,t[r],r,t);break;case"object":n[r]=j_(t[r],i);break;case"boolean":i&&(n[r]=t[r]);break}return n}function Dwe(t,e,n={}){const r=t,{target:i,eventOptions:a,window:s,enabled:o,transform:l}=r,u=Mwe(r,Owe);if(n.shared=j_({target:i,eventOptions:a,window:s,enabled:o,transform:l},Nwe),e){const c=$M.get(e);n[e]=j_(zr({shared:n.shared},u),c)}else for(const c in u){const d=$M.get(c);d&&(n[c]=j_(zr({shared:n.shared},u[c]),d))}return n}class VX{constructor(e,n){ja(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=n}add(e,n,r,i,a){const s=this._listeners,o=twe(n,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=zr(zr({},l),a);e.addEventListener(o,i,u);const c=()=>{e.removeEventListener(o,i,u),s.delete(c)};return s.add(c),c}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class Lwe{constructor(){ja(this,"_timeouts",new Map)}add(e,n,r=140,...i){this.remove(e),this._timeouts.set(e,window.setTimeout(n,r,...i))}remove(e){const n=this._timeouts.get(e);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class kwe{constructor(e){ja(this,"gestures",new Set),ja(this,"_targetEventStore",new VX(this)),ja(this,"gestureEventStores",{}),ja(this,"gestureTimeoutStores",{}),ja(this,"handlers",{}),ja(this,"config",{}),ja(this,"pointerIds",new Set),ja(this,"touchIds",new Set),ja(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Pwe(this,e)}setEventIds(e){if(_T(e))return this.touchIds=new Set(iwe(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,n){this.handlers=e,this.nativeHandlers=n}applyConfig(e,n){this.config=Dwe(e,n,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const n=this.config.shared,r={};let i;if(!(n.target&&(i=n.target(),!i))){if(n.enabled){for(const s of this.gestures){const o=this.config[s],l=xG(r,o.eventOptions,!!i);if(o.enabled){const u=GX.get(s);new u(this,e,s).bind(l)}}const a=xG(r,n.eventOptions,!!i);for(const s in this.nativeHandlers)a(s,"",o=>this.nativeHandlers[s](zr(zr({},this.state.shared),{},{event:o,args:e})),void 0,!0)}for(const a in r)r[a]=owe(...r[a]);if(!i)return r;for(const a in r){const{device:s,capture:o,passive:l}=ewe(a);this._targetEventStore.add(i,s,"",r[a],{capture:o,passive:l})}}}}function Op(t,e){t.gestures.add(e),t.gestureEventStores[e]=new VX(t,e),t.gestureTimeoutStores[e]=new Lwe}function Pwe(t,e){e.drag&&Op(t,"drag"),e.wheel&&Op(t,"wheel"),e.scroll&&Op(t,"scroll"),e.move&&Op(t,"move"),e.pinch&&Op(t,"pinch"),e.hover&&Op(t,"hover")}const xG=(t,e,n)=>(r,i,a,s={},o=!1)=>{var l,u;const c=(l=s.capture)!==null&&l!==void 0?l:e.capture,d=(u=s.passive)!==null&&u!==void 0?u:e.passive;let f=o?r:Q1e(r,i,c);n&&d&&(f+="Passive"),t[f]=t[f]||[],t[f].push(a)};function Bwe(t,e={},n,r){const i=pe.useMemo(()=>new kwe(t),[]);if(i.applyHandlers(t,r),i.applyConfig(e,n),pe.useEffect(i.effect.bind(i)),pe.useEffect(()=>i.clean.bind(i),[]),e.target===void 0)return i.bind.bind(i)}function Fwe(t,e){return Cwe(Rwe),Bwe({drag:t},e||{},"drag")}const Uwe=t=>(e,n,r)=>{const i=r.subscribe;return r.subscribe=(s,o,l)=>{let u=s;if(o){const c=(l==null?void 0:l.equalityFn)||Object.is;let d=s(r.getState());u=f=>{const m=s(f);if(!c(d,m)){const g=d;o(d=m,g)}},l!=null&&l.fireImmediately&&o(d,d)}return i(u)},t(e,n,r)},zwe=parseInt(Of.replace(/\D+/g,""));function TG(t,e){if(e===iq)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===SA||e===KO){let n=t.getIndex();if(n===null){const s=[],o=t.getAttribute("position");if(o!==void 0){for(let l=0;l>>1|(Tr&21845)<<1;Hu=(Hu&52428)>>>2|(Hu&13107)<<2,Hu=(Hu&61680)>>>4|(Hu&3855)<<4,jM[Tr]=((Hu&65280)>>>8|(Hu&255)<<8)>>>1}var D0=function(t,e,n){for(var r=t.length,i=0,a=new oc(e);i>>l]=u}else for(o=new oc(r),i=0;i>>15-t[i]);return o},hy=new Ks(288);for(var Tr=0;Tr<144;++Tr)hy[Tr]=8;for(var Tr=144;Tr<256;++Tr)hy[Tr]=9;for(var Tr=256;Tr<280;++Tr)hy[Tr]=7;for(var Tr=280;Tr<288;++Tr)hy[Tr]=8;var XX=new Ks(32);for(var Tr=0;Tr<32;++Tr)XX[Tr]=5;var Wwe=D0(hy,9,1),jwe=D0(XX,5,1),fR=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},ho=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},pR=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},Ywe=function(t){return(t/8|0)+(t&7&&1)},qwe=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof oc?oc:t instanceof WM?WM:Ks)(n-e);return r.set(t.subarray(e,n)),r},Xwe=function(t,e,n){var r=t.length;if(!r||n&&!n.l&&r<5)return e||new Ks(0);var i=!e||n,a=!n||n.i;n||(n={}),e||(e=new Ks(r*3));var s=function(Fe){var Ye=e.length;if(Fe>Ye){var gt=new Ks(Math.max(Ye*2,Fe));gt.set(e),e=gt}},o=n.f||0,l=n.p||0,u=n.b||0,c=n.l,d=n.d,f=n.m,m=n.n,g=r*8;do{if(!c){n.f=o=ho(t,l,1);var y=ho(t,l+1,3);if(l+=3,y)if(y==1)c=Wwe,d=jwe,f=9,m=5;else if(y==2){var _=ho(t,l,31)+257,A=ho(t,l+10,15)+4,I=_+ho(t,l+5,31)+1;l+=14;for(var x=new Ks(I),R=new Ks(19),O=0;O>>4;if(v<16)x[O++]=v;else{var W=0,K=0;for(v==16?(K=3+ho(t,l,3),l+=2,W=x[O-1]):v==17?(K=3+ho(t,l,7),l+=3):v==18&&(K=11+ho(t,l,127),l+=7);K--;)x[O++]=W}}var se=x.subarray(0,_),ae=x.subarray(_);f=fR(se),m=fR(ae),c=D0(se,f,1),d=D0(ae,m,1)}else throw"invalid block type";else{var v=Ywe(l)+4,b=t[v-4]|t[v-3]<<8,E=v+b;if(E>r){if(a)throw"unexpected EOF";break}i&&s(u+b),e.set(t.subarray(v,E),u),n.b=u+=b,n.p=l=E*8;continue}if(l>g){if(a)throw"unexpected EOF";break}}i&&s(u+131072);for(var ee=(1<>>4;if(l+=W&15,l>g){if(a)throw"unexpected EOF";break}if(!W)throw"invalid length/literal";if(J<256)e[u++]=J;else if(J==256){ie=l,c=null;break}else{var fe=J-254;if(J>264){var O=J-257,Ce=$X[O];fe=ho(t,l,(1<>>4;if(!Le)throw"invalid distance";l+=Le&15;var ae=$we[j];if(j>3){var Ce=WX[j];ae+=pR(t,l)&(1<g){if(a)throw"unexpected EOF";break}i&&s(u+131072);for(var ke=u+fe;u>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(t[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function YE(t,e){return Xwe((Zwe(t),t.subarray(2,-4)),e)}var Qwe=typeof TextDecoder<"u"&&new TextDecoder,Jwe=0;try{Qwe.decode(Kwe,{stream:!0}),Jwe=1}catch{}const eCe=t=>t&&t.isCubeTexture;class tCe extends Ot{constructor(e,n){var r,i;const a=eCe(e),o=((i=a?(r=e.image[0])==null?void 0:r.width:e.image.width)!=null?i:1024)/4,l=Math.floor(Math.log2(o)),u=Math.pow(2,l),c=3*Math.max(u,16*7),d=4*u,f=[a?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/c}`,`#define CUBEUV_TEXEL_HEIGHT ${1/d}`,`#define CUBEUV_MAX_MIP ${l}.0`],m=` varying vec3 vWorldPosition; void main() { @@ -4315,7 +4315,7 @@ No matching component was found for: #include #include <${parseInt(Of.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}> } - `,y={map:{value:e},height:{value:(n==null?void 0:n.height)||15},radius:{value:(n==null?void 0:n.radius)||100}},v=new Em(1,16),b=new qi({uniforms:y,fragmentShader:g,vertexShader:m,side:fa});super(v,b)}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}}var nCe=Object.defineProperty,rCe=(t,e,n)=>e in t?nCe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,je=(t,e,n)=>(rCe(t,typeof e!="symbol"?e+"":e,n),n);let iCe=class extends _n{constructor(e,n){super(),je(this,"isTransformControls",!0),je(this,"visible",!1),je(this,"domElement"),je(this,"raycaster",new Ex),je(this,"gizmo"),je(this,"plane"),je(this,"tempVector",new H),je(this,"tempVector2",new H),je(this,"tempQuaternion",new Mn),je(this,"unit",{X:new H(1,0,0),Y:new H(0,1,0),Z:new H(0,0,1)}),je(this,"pointStart",new H),je(this,"pointEnd",new H),je(this,"offset",new H),je(this,"rotationAxis",new H),je(this,"startNorm",new H),je(this,"endNorm",new H),je(this,"rotationAngle",0),je(this,"cameraPosition",new H),je(this,"cameraQuaternion",new Mn),je(this,"cameraScale",new H),je(this,"parentPosition",new H),je(this,"parentQuaternion",new Mn),je(this,"parentQuaternionInv",new Mn),je(this,"parentScale",new H),je(this,"worldPositionStart",new H),je(this,"worldQuaternionStart",new Mn),je(this,"worldScaleStart",new H),je(this,"worldPosition",new H),je(this,"worldQuaternion",new Mn),je(this,"worldQuaternionInv",new Mn),je(this,"worldScale",new H),je(this,"eye",new H),je(this,"positionStart",new H),je(this,"quaternionStart",new Mn),je(this,"scaleStart",new H),je(this,"camera"),je(this,"object"),je(this,"enabled",!0),je(this,"axis",null),je(this,"mode","translate"),je(this,"translationSnap",null),je(this,"rotationSnap",null),je(this,"scaleSnap",null),je(this,"space","world"),je(this,"size",1),je(this,"dragging",!1),je(this,"showX",!0),je(this,"showY",!0),je(this,"showZ",!0),je(this,"changeEvent",{type:"change"}),je(this,"mouseDownEvent",{type:"mouseDown",mode:this.mode}),je(this,"mouseUpEvent",{type:"mouseUp",mode:this.mode}),je(this,"objectChangeEvent",{type:"objectChange"}),je(this,"intersectObjectWithRay",(i,a,s)=>{const o=a.intersectObject(i,!0);for(let l=0;l(this.object=i,this.visible=!0,this)),je(this,"detach",()=>(this.object=void 0,this.visible=!1,this.axis=null,this)),je(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),je(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()}),je(this,"pointerHover",i=>{if(this.object===void 0||this.dragging===!0)return;this.raycaster.setFromCamera(i,this.camera);const a=this.intersectObjectWithRay(this.gizmo.picker[this.mode],this.raycaster);a?this.axis=a.object.name:this.axis=null}),je(this,"pointerDown",i=>{if(!(this.object===void 0||this.dragging===!0||i.button!==0)&&this.axis!==null){this.raycaster.setFromCamera(i,this.camera);const a=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(a){let s=this.space;if(this.mode==="scale"?s="local":(this.axis==="E"||this.axis==="XYZE"||this.axis==="XYZ")&&(s="world"),s==="local"&&this.mode==="rotate"){const o=this.rotationSnap;this.axis==="X"&&o&&(this.object.rotation.x=Math.round(this.object.rotation.x/o)*o),this.axis==="Y"&&o&&(this.object.rotation.y=Math.round(this.object.rotation.y/o)*o),this.axis==="Z"&&o&&(this.object.rotation.z=Math.round(this.object.rotation.z/o)*o)}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(a.point).sub(this.worldPositionStart)}this.dragging=!0,this.mouseDownEvent.mode=this.mode,this.dispatchEvent(this.mouseDownEvent)}}),je(this,"pointerMove",i=>{const a=this.axis,s=this.mode,o=this.object;let l=this.space;if(s==="scale"?l="local":(a==="E"||a==="XYZE"||a==="XYZ")&&(l="world"),o===void 0||a===null||this.dragging===!1||i.button!==-1)return;this.raycaster.setFromCamera(i,this.camera);const u=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(u){if(this.pointEnd.copy(u.point).sub(this.worldPositionStart),s==="translate")this.offset.copy(this.pointEnd).sub(this.pointStart),l==="local"&&a!=="XYZ"&&this.offset.applyQuaternion(this.worldQuaternionInv),a.indexOf("X")===-1&&(this.offset.x=0),a.indexOf("Y")===-1&&(this.offset.y=0),a.indexOf("Z")===-1&&(this.offset.z=0),l==="local"&&a!=="XYZ"?this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale):this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale),o.position.copy(this.offset).add(this.positionStart),this.translationSnap&&(l==="local"&&(o.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()),a.search("X")!==-1&&(o.position.x=Math.round(o.position.x/this.translationSnap)*this.translationSnap),a.search("Y")!==-1&&(o.position.y=Math.round(o.position.y/this.translationSnap)*this.translationSnap),a.search("Z")!==-1&&(o.position.z=Math.round(o.position.z/this.translationSnap)*this.translationSnap),o.position.applyQuaternion(this.quaternionStart)),l==="world"&&(o.parent&&o.position.add(this.tempVector.setFromMatrixPosition(o.parent.matrixWorld)),a.search("X")!==-1&&(o.position.x=Math.round(o.position.x/this.translationSnap)*this.translationSnap),a.search("Y")!==-1&&(o.position.y=Math.round(o.position.y/this.translationSnap)*this.translationSnap),a.search("Z")!==-1&&(o.position.z=Math.round(o.position.z/this.translationSnap)*this.translationSnap),o.parent&&o.position.sub(this.tempVector.setFromMatrixPosition(o.parent.matrixWorld))));else if(s==="scale"){if(a.search("XYZ")!==-1){let c=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(c*=-1),this.tempVector2.set(c,c,c)}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),a.search("X")===-1&&(this.tempVector2.x=1),a.search("Y")===-1&&(this.tempVector2.y=1),a.search("Z")===-1&&(this.tempVector2.z=1);o.scale.copy(this.scaleStart).multiply(this.tempVector2),this.scaleSnap&&this.object&&(a.search("X")!==-1&&(this.object.scale.x=Math.round(o.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),a.search("Y")!==-1&&(o.scale.y=Math.round(o.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),a.search("Z")!==-1&&(o.scale.z=Math.round(o.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this.offset.copy(this.pointEnd).sub(this.pointStart);const c=20/this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));a==="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):a==="XYZE"?(this.rotationAxis.copy(this.offset).cross(this.eye).normalize(),this.rotationAngle=this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye))*c):(a==="X"||a==="Y"||a==="Z")&&(this.rotationAxis.copy(this.unit[a]),this.tempVector.copy(this.unit[a]),l==="local"&&this.tempVector.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.offset.dot(this.tempVector.cross(this.eye).normalize())*c),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),l==="local"&&a!=="E"&&a!=="XYZE"?(o.quaternion.copy(this.quaternionStart),o.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.parentQuaternionInv),o.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),o.quaternion.multiply(this.quaternionStart).normalize())}this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent)}}),je(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)}),je(this,"getPointer",i=>{var a;if(this.domElement&&((a=this.domElement.ownerDocument)!=null&&a.pointerLockElement))return{x:0,y:0,button:i.button};{const s=i.changedTouches?i.changedTouches[0]:i,o=this.domElement.getBoundingClientRect();return{x:(s.clientX-o.left)/o.width*2-1,y:-(s.clientY-o.top)/o.height*2+1,button:i.button}}}),je(this,"onPointerHover",i=>{if(this.enabled)switch(i.pointerType){case"mouse":case"pen":this.pointerHover(this.getPointer(i));break}}),je(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)))}),je(this,"onPointerMove",i=>{this.enabled&&this.pointerMove(this.getPointer(i))}),je(this,"onPointerUp",i=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction="",this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.pointerUp(this.getPointer(i)))}),je(this,"getMode",()=>this.mode),je(this,"setMode",i=>{this.mode=i}),je(this,"setTranslationSnap",i=>{this.translationSnap=i}),je(this,"setRotationSnap",i=>{this.rotationSnap=i}),je(this,"setScaleSnap",i=>{this.scaleSnap=i}),je(this,"setSize",i=>{this.size=i}),je(this,"setSpace",i=>{this.space=i}),je(this,"update",()=>{console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}),je(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)}),je(this,"dispose",()=>{var i,a,s,o,l,u;(i=this.domElement)==null||i.removeEventListener("pointerdown",this.onPointerDown),(a=this.domElement)==null||a.removeEventListener("pointermove",this.onPointerHover),(o=(s=this.domElement)==null?void 0:s.ownerDocument)==null||o.removeEventListener("pointermove",this.onPointerMove),(u=(l=this.domElement)==null?void 0:l.ownerDocument)==null||u.removeEventListener("pointerup",this.onPointerUp),this.traverse(c=>{const d=c;d.geometry&&d.geometry.dispose(),d.material&&d.material.dispose()})}),this.domElement=n,this.camera=e,this.gizmo=new aCe,this.add(this.gizmo),this.plane=new sCe,this.add(this.plane);const r=(i,a)=>{let s=a;Object.defineProperty(this,i,{get:function(){return s!==void 0?s:a},set:function(o){s!==o&&(s=o,this.plane[i]=o,this.gizmo[i]=o,this.dispatchEvent({type:i+"-changed",value:o}),this.dispatchEvent(this.changeEvent))}}),this[i]=a,this.plane[i]=a,this.gizmo[i]=a};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),n!==void 0&&this.connect(n)}};class aCe extends _n{constructor(){super(),je(this,"isTransformControlsGizmo",!0),je(this,"type","TransformControlsGizmo"),je(this,"tempVector",new H(0,0,0)),je(this,"tempEuler",new ss),je(this,"alignVector",new H(0,1,0)),je(this,"zeroVector",new H(0,0,0)),je(this,"lookAtMatrix",new en),je(this,"tempQuaternion",new Mn),je(this,"tempQuaternion2",new Mn),je(this,"identityQuaternion",new Mn),je(this,"unitX",new H(1,0,0)),je(this,"unitY",new H(0,1,0)),je(this,"unitZ",new H(0,0,1)),je(this,"gizmo"),je(this,"picker"),je(this,"helper"),je(this,"rotationAxis",new H),je(this,"cameraPosition",new H),je(this,"worldPositionStart",new H),je(this,"worldQuaternionStart",new Mn),je(this,"worldPosition",new H),je(this,"worldQuaternion",new Mn),je(this,"eye",new H),je(this,"camera",null),je(this,"enabled",!0),je(this,"axis",null),je(this,"mode","translate"),je(this,"space","world"),je(this,"size",1),je(this,"dragging",!1),je(this,"showX",!0),je(this,"showY",!0),je(this,"showZ",!0),je(this,"updateMatrixWorld",()=>{let J=this.space;this.mode==="scale"&&(J="local");const fe=J==="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 Ce=[];Ce=Ce.concat(this.picker[this.mode].children),Ce=Ce.concat(this.gizmo[this.mode].children),Ce=Ce.concat(this.helper[this.mode].children);for(let Le=0;Le.9&&(j.visible=!1)),this.axis==="Y"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,Math.PI/2)),j.quaternion.copy(fe).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(fe).dot(this.eye))>.9&&(j.visible=!1)),this.axis==="Z"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),j.quaternion.copy(fe).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(fe).dot(this.eye))>.9&&(j.visible=!1)),this.axis==="XYZE"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),this.alignVector.copy(this.rotationAxis),j.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.zeroVector,this.alignVector,this.unitY)),j.quaternion.multiply(this.tempQuaternion),j.visible=this.dragging),this.axis==="E"&&(j.visible=!1)):j.name==="START"?(j.position.copy(this.worldPositionStart),j.visible=this.dragging):j.name==="END"?(j.position.copy(this.worldPosition),j.visible=this.dragging):j.name==="DELTA"?(j.position.copy(this.worldPositionStart),j.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()),j.scale.copy(this.tempVector),j.visible=this.dragging):(j.quaternion.copy(fe),this.dragging?j.position.copy(this.worldPositionStart):j.position.copy(this.worldPosition),this.axis&&(j.visible=this.axis.search(j.name)!==-1));continue}j.quaternion.copy(fe),this.mode==="translate"||this.mode==="scale"?((j.name==="X"||j.name==="XYZX")&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(fe).dot(this.eye))>.99&&(j.scale.set(1e-10,1e-10,1e-10),j.visible=!1),(j.name==="Y"||j.name==="XYZY")&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(fe).dot(this.eye))>.99&&(j.scale.set(1e-10,1e-10,1e-10),j.visible=!1),(j.name==="Z"||j.name==="XYZZ")&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(fe).dot(this.eye))>.99&&(j.scale.set(1e-10,1e-10,1e-10),j.visible=!1),j.name==="XY"&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(fe).dot(this.eye))<.2&&(j.scale.set(1e-10,1e-10,1e-10),j.visible=!1),j.name==="YZ"&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(fe).dot(this.eye))<.2&&(j.scale.set(1e-10,1e-10,1e-10),j.visible=!1),j.name==="XZ"&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(fe).dot(this.eye))<.2&&(j.scale.set(1e-10,1e-10,1e-10),j.visible=!1),j.name.search("X")!==-1&&(this.alignVector.copy(this.unitX).applyQuaternion(fe).dot(this.eye)<0?j.tag==="fwd"?j.visible=!1:j.scale.x*=-1:j.tag==="bwd"&&(j.visible=!1)),j.name.search("Y")!==-1&&(this.alignVector.copy(this.unitY).applyQuaternion(fe).dot(this.eye)<0?j.tag==="fwd"?j.visible=!1:j.scale.y*=-1:j.tag==="bwd"&&(j.visible=!1)),j.name.search("Z")!==-1&&(this.alignVector.copy(this.unitZ).applyQuaternion(fe).dot(this.eye)<0?j.tag==="fwd"?j.visible=!1:j.scale.z*=-1:j.tag==="bwd"&&(j.visible=!1))):this.mode==="rotate"&&(this.tempQuaternion2.copy(fe),this.alignVector.copy(this.eye).applyQuaternion(this.tempQuaternion.copy(fe).invert()),j.name.search("E")!==-1&&j.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.eye,this.zeroVector,this.unitY)),j.name==="X"&&(this.tempQuaternion.setFromAxisAngle(this.unitX,Math.atan2(-this.alignVector.y,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),j.quaternion.copy(this.tempQuaternion)),j.name==="Y"&&(this.tempQuaternion.setFromAxisAngle(this.unitY,Math.atan2(this.alignVector.x,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),j.quaternion.copy(this.tempQuaternion)),j.name==="Z"&&(this.tempQuaternion.setFromAxisAngle(this.unitZ,Math.atan2(this.alignVector.y,this.alignVector.x)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),j.quaternion.copy(this.tempQuaternion))),j.visible=j.visible&&(j.name.indexOf("X")===-1||this.showX),j.visible=j.visible&&(j.name.indexOf("Y")===-1||this.showY),j.visible=j.visible&&(j.name.indexOf("Z")===-1||this.showZ),j.visible=j.visible&&(j.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),j.material.tempOpacity=j.material.tempOpacity||j.material.opacity,j.material.tempColor=j.material.tempColor||j.material.color.clone(),j.material.color.copy(j.material.tempColor),j.material.opacity=j.material.tempOpacity,this.enabled?this.axis&&(j.name===this.axis?(j.material.opacity=1,j.material.color.lerp(new vt(1,1,1),.5)):this.axis.split("").some(function(Fe){return j.name===Fe})?(j.material.opacity=1,j.material.color.lerp(new vt(1,1,1),.5)):(j.material.opacity*=.25,j.material.color.lerp(new vt(1,1,1),.5))):(j.material.opacity*=.5,j.material.color.lerp(new vt(1,1,1),.5))}super.updateMatrixWorld()});const e=new $i({depthTest:!1,depthWrite:!1,transparent:!0,side:fa,fog:!1,toneMapped:!1}),n=new Ki({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 a=e.clone();a.color.set(16711680);const s=e.clone();s.color.set(65280);const o=e.clone();o.color.set(255);const l=e.clone();l.opacity=.25;const u=l.clone();u.color.set(16776960);const c=l.clone();c.color.set(65535);const d=l.clone();d.color.set(16711935),e.clone().color.set(16776960);const m=n.clone();m.color.set(16711680);const g=n.clone();g.color.set(65280);const y=n.clone();y.color.set(255);const v=n.clone();v.color.set(65535);const b=n.clone();b.color.set(16711935);const E=n.clone();E.color.set(16776960);const S=n.clone();S.color.set(7895160);const A=E.clone();A.opacity=.25;const I=new Hi(0,.05,.2,12,1,!1),T=new Ya(.125,.125,.125),R=new fn;R.setAttribute("position",new qt([0,0,0,1,0,0],3));const O=(J,fe)=>{const Ce=new fn,Le=[];for(let j=0;j<=64*fe;++j)Le.push(0,Math.cos(j/32*Math.PI)*J,Math.sin(j/32*Math.PI)*J);return Ce.setAttribute("position",new qt(Le,3)),Ce},N=()=>{const J=new fn;return J.setAttribute("position",new qt([0,0,0,1,1,1],3)),J},M={X:[[new Ot(I,a),[1,0,0],[0,0,-Math.PI/2],null,"fwd"],[new Ot(I,a),[1,0,0],[0,0,Math.PI/2],null,"bwd"],[new xn(R,m)]],Y:[[new Ot(I,s),[0,1,0],null,null,"fwd"],[new Ot(I,s),[0,1,0],[Math.PI,0,0],null,"bwd"],[new xn(R,g),null,[0,0,Math.PI/2]]],Z:[[new Ot(I,o),[0,0,1],[Math.PI/2,0,0],null,"fwd"],[new Ot(I,o),[0,0,1],[-Math.PI/2,0,0],null,"bwd"],[new xn(R,y),null,[0,-Math.PI/2,0]]],XYZ:[[new Ot(new Ws(.1,0),l.clone()),[0,0,0],[0,0,0]]],XY:[[new Ot(new Vi(.295,.295),u.clone()),[.15,.15,0]],[new xn(R,E),[.18,.3,0],null,[.125,1,1]],[new xn(R,E),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new Ot(new Vi(.295,.295),c.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new xn(R,v),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new xn(R,v),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new Ot(new Vi(.295,.295),d.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new xn(R,b),[.18,0,.3],null,[.125,1,1]],[new xn(R,b),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},B={X:[[new Ot(new Hi(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new Ot(new Hi(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new Ot(new Hi(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new Ot(new Ws(.2,0),r)]],XY:[[new Ot(new Vi(.4,.4),r),[.2,.2,0]]],YZ:[[new Ot(new Vi(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new Ot(new Vi(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},G={START:[[new Ot(new Ws(.01,2),i),null,null,null,"helper"]],END:[[new Ot(new Ws(.01,2),i),null,null,null,"helper"]],DELTA:[[new xn(N(),i),null,null,null,"helper"]],X:[[new xn(R,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new xn(R,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new xn(R,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},W={X:[[new xn(O(1,.5),m)],[new Ot(new Ws(.04,0),a),[0,0,.99],null,[1,3,1]]],Y:[[new xn(O(1,.5),g),null,[0,0,-Math.PI/2]],[new Ot(new Ws(.04,0),s),[0,0,.99],null,[3,1,1]]],Z:[[new xn(O(1,.5),y),null,[0,Math.PI/2,0]],[new Ot(new Ws(.04,0),o),[.99,0,0],null,[1,3,1]]],E:[[new xn(O(1.25,1),A),null,[0,Math.PI/2,0]],[new Ot(new Hi(.03,0,.15,4,1,!1),A),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new Ot(new Hi(.03,0,.15,4,1,!1),A),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new Ot(new Hi(.03,0,.15,4,1,!1),A),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new Ot(new Hi(.03,0,.15,4,1,!1),A),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new xn(O(1,1),S),null,[0,Math.PI/2,0]]]},K={AXIS:[[new xn(R,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},se={X:[[new Ot(new sc(1,.1,4,24),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new Ot(new sc(1,.1,4,24),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new Ot(new sc(1,.1,4,24),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new Ot(new sc(1.25,.1,2,24),r)]],XYZE:[[new Ot(new Sm(.7,10,8),r)]]},ae={X:[[new Ot(T,a),[.8,0,0],[0,0,-Math.PI/2]],[new xn(R,m),null,null,[.8,1,1]]],Y:[[new Ot(T,s),[0,.8,0]],[new xn(R,g),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new Ot(T,o),[0,0,.8],[Math.PI/2,0,0]],[new xn(R,y),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new Ot(T,u),[.85,.85,0],null,[2,2,.2]],[new xn(R,E),[.855,.98,0],null,[.125,1,1]],[new xn(R,E),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new Ot(T,c),[0,.85,.85],null,[.2,2,2]],[new xn(R,v),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new xn(R,v),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new Ot(T,d),[.85,0,.85],null,[2,.2,2]],[new xn(R,b),[.855,0,.98],null,[.125,1,1]],[new xn(R,b),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new Ot(new Ya(.125,.125,.125),l.clone()),[1.1,0,0]]],XYZY:[[new Ot(new Ya(.125,.125,.125),l.clone()),[0,1.1,0]]],XYZZ:[[new Ot(new Ya(.125,.125,.125),l.clone()),[0,0,1.1]]]},ee={X:[[new Ot(new Hi(.2,0,.8,4,1,!1),r),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new Ot(new Hi(.2,0,.8,4,1,!1),r),[0,.5,0]]],Z:[[new Ot(new Hi(.2,0,.8,4,1,!1),r),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new Ot(T,r),[.85,.85,0],null,[3,3,.2]]],YZ:[[new Ot(T,r),[0,.85,.85],null,[.2,3,3]]],XZ:[[new Ot(T,r),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new Ot(new Ya(.2,.2,.2),r),[1.1,0,0]]],XYZY:[[new Ot(new Ya(.2,.2,.2),r),[0,1.1,0]]],XYZZ:[[new Ot(new Ya(.2,.2,.2),r),[0,0,1.1]]]},F={X:[[new xn(R,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new xn(R,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new xn(R,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},ie=J=>{const fe=new _n;for(let Ce in J)for(let Le=J[Ce].length;Le--;){const j=J[Ce][Le][0].clone(),ke=J[Ce][Le][1],Fe=J[Ce][Le][2],Ye=J[Ce][Le][3],gt=J[Ce][Le][4];j.name=Ce,j.tag=gt,ke&&j.position.set(ke[0],ke[1],ke[2]),Fe&&j.rotation.set(Fe[0],Fe[1],Fe[2]),Ye&&j.scale.set(Ye[0],Ye[1],Ye[2]),j.updateMatrix();const Gt=j.geometry.clone();Gt.applyMatrix4(j.matrix),j.geometry=Gt,j.renderOrder=1/0,j.position.set(0,0,0),j.rotation.set(0,0,0),j.scale.set(1,1,1),fe.add(j)}return fe};this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=ie(M)),this.add(this.gizmo.rotate=ie(W)),this.add(this.gizmo.scale=ie(ae)),this.add(this.picker.translate=ie(B)),this.add(this.picker.rotate=ie(se)),this.add(this.picker.scale=ie(ee)),this.add(this.helper.translate=ie(G)),this.add(this.helper.rotate=ie(K)),this.add(this.helper.scale=ie(F)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}}class sCe extends Ot{constructor(){super(new Vi(1e5,1e5,2,2),new $i({visible:!1,wireframe:!0,side:fa,transparent:!0,opacity:.1,toneMapped:!1})),je(this,"isTransformControlsPlane",!0),je(this,"type","TransformControlsPlane"),je(this,"unitX",new H(1,0,0)),je(this,"unitY",new H(0,1,0)),je(this,"unitZ",new H(0,0,1)),je(this,"tempVector",new H),je(this,"dirVector",new H),je(this,"alignVector",new H),je(this,"tempMatrix",new en),je(this,"identityQuaternion",new Mn),je(this,"cameraQuaternion",new Mn),je(this,"worldPosition",new H),je(this,"worldQuaternion",new Mn),je(this,"eye",new H),je(this,"axis",null),je(this,"mode","translate"),je(this,"space","world"),je(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 oCe=Object.defineProperty,lCe=(t,e,n)=>e in t?oCe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,an=(t,e,n)=>(lCe(t,typeof e!="symbol"?e+"":e,n),n);const qE=new Df,wG=new Hl,uCe=Math.cos(70*(Math.PI/180)),CG=(t,e)=>(t%e+e)%e;let cCe=class extends No{constructor(e,n){super(),an(this,"object"),an(this,"domElement"),an(this,"enabled",!0),an(this,"target",new H),an(this,"minDistance",0),an(this,"maxDistance",1/0),an(this,"minZoom",0),an(this,"maxZoom",1/0),an(this,"minPolarAngle",0),an(this,"maxPolarAngle",Math.PI),an(this,"minAzimuthAngle",-1/0),an(this,"maxAzimuthAngle",1/0),an(this,"enableDamping",!1),an(this,"dampingFactor",.05),an(this,"enableZoom",!0),an(this,"zoomSpeed",1),an(this,"enableRotate",!0),an(this,"rotateSpeed",1),an(this,"enablePan",!0),an(this,"panSpeed",1),an(this,"screenSpacePanning",!0),an(this,"keyPanSpeed",7),an(this,"zoomToCursor",!1),an(this,"autoRotate",!1),an(this,"autoRotateSpeed",2),an(this,"reverseOrbit",!1),an(this,"reverseHorizontalOrbit",!1),an(this,"reverseVerticalOrbit",!1),an(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),an(this,"mouseButtons",{LEFT:_d.ROTATE,MIDDLE:_d.DOLLY,RIGHT:_d.PAN}),an(this,"touches",{ONE:Ad.ROTATE,TWO:Ad.DOLLY_PAN}),an(this,"target0"),an(this,"position0"),an(this,"zoom0"),an(this,"_domElementKeyEvents",null),an(this,"getPolarAngle"),an(this,"getAzimuthalAngle"),an(this,"setPolarAngle"),an(this,"setAzimuthalAngle"),an(this,"getDistance"),an(this,"getZoomScale"),an(this,"listenToKeyEvents"),an(this,"stopListenToKeyEvents"),an(this,"saveState"),an(this,"reset"),an(this,"update"),an(this,"connect"),an(this,"dispose"),an(this,"dollyIn"),an(this,"dollyOut"),an(this,"getScale"),an(this,"setScale"),this.object=e,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=me=>{let De=CG(me,2*Math.PI),rt=c.phi;rt<0&&(rt+=2*Math.PI),De<0&&(De+=2*Math.PI);let ge=Math.abs(De-rt);2*Math.PI-ge{let De=CG(me,2*Math.PI),rt=c.theta;rt<0&&(rt+=2*Math.PI),De<0&&(De+=2*Math.PI);let ge=Math.abs(De-rt);2*Math.PI-ger.object.position.distanceTo(r.target),this.listenToKeyEvents=me=>{me.addEventListener("keydown",nt),this._domElementKeyEvents=me},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",nt),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=o.NONE},this.update=(()=>{const me=new H,De=new H(0,1,0),rt=new Mn().setFromUnitVectors(e.up,De),ge=rt.clone().invert(),xe=new H,Me=new Mn,Xe=2*Math.PI;return function(){const _t=r.object.position;rt.setFromUnitVectors(e.up,De),ge.copy(rt).invert(),me.copy(_t).sub(r.target),me.applyQuaternion(rt),c.setFromVector3(me),r.autoRotate&&l===o.NONE&&K(G()),r.enableDamping?(c.theta+=d.theta*r.dampingFactor,c.phi+=d.phi*r.dampingFactor):(c.theta+=d.theta,c.phi+=d.phi);let Xt=r.minAzimuthAngle,mn=r.maxAzimuthAngle;isFinite(Xt)&&isFinite(mn)&&(Xt<-Math.PI?Xt+=Xe:Xt>Math.PI&&(Xt-=Xe),mn<-Math.PI?mn+=Xe:mn>Math.PI&&(mn-=Xe),Xt<=mn?c.theta=Math.max(Xt,Math.min(mn,c.theta)):c.theta=c.theta>(Xt+mn)/2?Math.max(Xt,c.theta):Math.min(mn,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(m,r.dampingFactor):r.target.add(m),r.zoomToCursor&&N||r.object.isOrthographicCamera?c.radius=Le(c.radius):c.radius=Le(c.radius*f),me.setFromSpherical(c),me.applyQuaternion(ge),_t.copy(r.target).add(me),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(d.theta*=1-r.dampingFactor,d.phi*=1-r.dampingFactor,m.multiplyScalar(1-r.dampingFactor)):(d.set(0,0,0),m.set(0,0,0));let Hn=!1;if(r.zoomToCursor&&N){let pn=null;if(r.object instanceof qr&&r.object.isPerspectiveCamera){const Gn=me.length();pn=Le(Gn*f);const he=Gn-pn;r.object.position.addScaledVector(R,he),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const Gn=new H(O.x,O.y,0);Gn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/f)),r.object.updateProjectionMatrix(),Hn=!0;const he=new H(O.x,O.y,0);he.unproject(r.object),r.object.position.sub(he).add(Gn),r.object.updateMatrixWorld(),pn=me.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;pn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(pn).add(r.object.position):(qE.origin.copy(r.object.position),qE.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(qE.direction))u||8*(1-Me.dot(r.object.quaternion))>u?(r.dispatchEvent(i),xe.copy(r.object.position),Me.copy(r.object.quaternion),Hn=!1,!0):!1}})(),this.connect=me=>{r.domElement=me,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",tt),r.domElement.addEventListener("pointerdown",U),r.domElement.addEventListener("pointercancel",Se),r.domElement.addEventListener("wheel",ft)},this.dispose=()=>{var me,De,rt,ge,xe,Me;r.domElement&&(r.domElement.style.touchAction="auto"),(me=r.domElement)==null||me.removeEventListener("contextmenu",tt),(De=r.domElement)==null||De.removeEventListener("pointerdown",U),(rt=r.domElement)==null||rt.removeEventListener("pointercancel",Se),(ge=r.domElement)==null||ge.removeEventListener("wheel",ft),(xe=r.domElement)==null||xe.ownerDocument.removeEventListener("pointermove",ue),(Me=r.domElement)==null||Me.ownerDocument.removeEventListener("pointerup",Se),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",nt)};const r=this,i={type:"change"},a={type:"start"},s={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=o.NONE;const u=1e-6,c=new UM,d=new UM;let f=1;const m=new H,g=new Ke,y=new Ke,v=new Ke,b=new Ke,E=new Ke,S=new Ke,A=new Ke,I=new Ke,T=new Ke,R=new H,O=new Ke;let N=!1;const M=[],B={};function G(){return 2*Math.PI/60/60*r.autoRotateSpeed}function W(){return Math.pow(.95,r.zoomSpeed)}function K(me){r.reverseOrbit||r.reverseHorizontalOrbit?d.theta+=me:d.theta-=me}function se(me){r.reverseOrbit||r.reverseVerticalOrbit?d.phi+=me:d.phi-=me}const ae=(()=>{const me=new H;return function(rt,ge){me.setFromMatrixColumn(ge,0),me.multiplyScalar(-rt),m.add(me)}})(),ee=(()=>{const me=new H;return function(rt,ge){r.screenSpacePanning===!0?me.setFromMatrixColumn(ge,1):(me.setFromMatrixColumn(ge,0),me.crossVectors(r.object.up,me)),me.multiplyScalar(rt),m.add(me)}})(),F=(()=>{const me=new H;return function(rt,ge){const xe=r.domElement;if(xe&&r.object instanceof qr&&r.object.isPerspectiveCamera){const Me=r.object.position;me.copy(Me).sub(r.target);let Xe=me.length();Xe*=Math.tan(r.object.fov/2*Math.PI/180),ae(2*rt*Xe/xe.clientHeight,r.object.matrix),ee(2*ge*Xe/xe.clientHeight,r.object.matrix)}else xe&&r.object instanceof pl&&r.object.isOrthographicCamera?(ae(rt*(r.object.right-r.object.left)/r.object.zoom/xe.clientWidth,r.object.matrix),ee(ge*(r.object.top-r.object.bottom)/r.object.zoom/xe.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function ie(me){r.object instanceof qr&&r.object.isPerspectiveCamera||r.object instanceof pl&&r.object.isOrthographicCamera?f=me:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function J(me){ie(f/me)}function fe(me){ie(f*me)}function Ce(me){if(!r.zoomToCursor||!r.domElement)return;N=!0;const De=r.domElement.getBoundingClientRect(),rt=me.clientX-De.left,ge=me.clientY-De.top,xe=De.width,Me=De.height;O.x=rt/xe*2-1,O.y=-(ge/Me)*2+1,R.set(O.x,O.y,1).unproject(r.object).sub(r.object.position).normalize()}function Le(me){return Math.max(r.minDistance,Math.min(r.maxDistance,me))}function j(me){g.set(me.clientX,me.clientY)}function ke(me){Ce(me),A.set(me.clientX,me.clientY)}function Fe(me){b.set(me.clientX,me.clientY)}function Ye(me){y.set(me.clientX,me.clientY),v.subVectors(y,g).multiplyScalar(r.rotateSpeed);const De=r.domElement;De&&(K(2*Math.PI*v.x/De.clientHeight),se(2*Math.PI*v.y/De.clientHeight)),g.copy(y),r.update()}function gt(me){I.set(me.clientX,me.clientY),T.subVectors(I,A),T.y>0?J(W()):T.y<0&&fe(W()),A.copy(I),r.update()}function Gt(me){E.set(me.clientX,me.clientY),S.subVectors(E,b).multiplyScalar(r.panSpeed),F(S.x,S.y),b.copy(E),r.update()}function Ut(me){Ce(me),me.deltaY<0?fe(W()):me.deltaY>0&&J(W()),r.update()}function Mt(me){let De=!1;switch(me.code){case r.keys.UP:F(0,r.keyPanSpeed),De=!0;break;case r.keys.BOTTOM:F(0,-r.keyPanSpeed),De=!0;break;case r.keys.LEFT:F(r.keyPanSpeed,0),De=!0;break;case r.keys.RIGHT:F(-r.keyPanSpeed,0),De=!0;break}De&&(me.preventDefault(),r.update())}function $e(){if(M.length==1)g.set(M[0].pageX,M[0].pageY);else{const me=.5*(M[0].pageX+M[1].pageX),De=.5*(M[0].pageY+M[1].pageY);g.set(me,De)}}function qe(){if(M.length==1)b.set(M[0].pageX,M[0].pageY);else{const me=.5*(M[0].pageX+M[1].pageX),De=.5*(M[0].pageY+M[1].pageY);b.set(me,De)}}function re(){const me=M[0].pageX-M[1].pageX,De=M[0].pageY-M[1].pageY,rt=Math.sqrt(me*me+De*De);A.set(0,rt)}function At(){r.enableZoom&&re(),r.enablePan&&qe()}function Je(){r.enableZoom&&re(),r.enableRotate&&$e()}function Tt(me){if(M.length==1)y.set(me.pageX,me.pageY);else{const rt=bt(me),ge=.5*(me.pageX+rt.x),xe=.5*(me.pageY+rt.y);y.set(ge,xe)}v.subVectors(y,g).multiplyScalar(r.rotateSpeed);const De=r.domElement;De&&(K(2*Math.PI*v.x/De.clientHeight),se(2*Math.PI*v.y/De.clientHeight)),g.copy(y)}function ot(me){if(M.length==1)E.set(me.pageX,me.pageY);else{const De=bt(me),rt=.5*(me.pageX+De.x),ge=.5*(me.pageY+De.y);E.set(rt,ge)}S.subVectors(E,b).multiplyScalar(r.panSpeed),F(S.x,S.y),b.copy(E)}function Vt(me){const De=bt(me),rt=me.pageX-De.x,ge=me.pageY-De.y,xe=Math.sqrt(rt*rt+ge*ge);I.set(0,xe),T.set(0,Math.pow(I.y/A.y,r.zoomSpeed)),J(T.y),A.copy(I)}function yt(me){r.enableZoom&&Vt(me),r.enablePan&&ot(me)}function q(me){r.enableZoom&&Vt(me),r.enableRotate&&Tt(me)}function U(me){var De,rt;r.enabled!==!1&&(M.length===0&&((De=r.domElement)==null||De.ownerDocument.addEventListener("pointermove",ue),(rt=r.domElement)==null||rt.ownerDocument.addEventListener("pointerup",Se)),Et(me),me.pointerType==="touch"?ht(me):Ge(me))}function ue(me){r.enabled!==!1&&(me.pointerType==="touch"?tn(me):Pe(me))}function Se(me){var De,rt,ge;zt(me),M.length===0&&((De=r.domElement)==null||De.releasePointerCapture(me.pointerId),(rt=r.domElement)==null||rt.ownerDocument.removeEventListener("pointermove",ue),(ge=r.domElement)==null||ge.ownerDocument.removeEventListener("pointerup",Se)),r.dispatchEvent(s),l=o.NONE}function Ge(me){let De;switch(me.button){case 0:De=r.mouseButtons.LEFT;break;case 1:De=r.mouseButtons.MIDDLE;break;case 2:De=r.mouseButtons.RIGHT;break;default:De=-1}switch(De){case _d.DOLLY:if(r.enableZoom===!1)return;ke(me),l=o.DOLLY;break;case _d.ROTATE:if(me.ctrlKey||me.metaKey||me.shiftKey){if(r.enablePan===!1)return;Fe(me),l=o.PAN}else{if(r.enableRotate===!1)return;j(me),l=o.ROTATE}break;case _d.PAN:if(me.ctrlKey||me.metaKey||me.shiftKey){if(r.enableRotate===!1)return;j(me),l=o.ROTATE}else{if(r.enablePan===!1)return;Fe(me),l=o.PAN}break;default:l=o.NONE}l!==o.NONE&&r.dispatchEvent(a)}function Pe(me){if(r.enabled!==!1)switch(l){case o.ROTATE:if(r.enableRotate===!1)return;Ye(me);break;case o.DOLLY:if(r.enableZoom===!1)return;gt(me);break;case o.PAN:if(r.enablePan===!1)return;Gt(me);break}}function ft(me){r.enabled===!1||r.enableZoom===!1||l!==o.NONE&&l!==o.ROTATE||(me.preventDefault(),r.dispatchEvent(a),Ut(me),r.dispatchEvent(s))}function nt(me){r.enabled===!1||r.enablePan===!1||Mt(me)}function ht(me){switch(Dt(me),M.length){case 1:switch(r.touches.ONE){case Ad.ROTATE:if(r.enableRotate===!1)return;$e(),l=o.TOUCH_ROTATE;break;case Ad.PAN:if(r.enablePan===!1)return;qe(),l=o.TOUCH_PAN;break;default:l=o.NONE}break;case 2:switch(r.touches.TWO){case Ad.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;At(),l=o.TOUCH_DOLLY_PAN;break;case Ad.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Je(),l=o.TOUCH_DOLLY_ROTATE;break;default:l=o.NONE}break;default:l=o.NONE}l!==o.NONE&&r.dispatchEvent(a)}function tn(me){switch(Dt(me),l){case o.TOUCH_ROTATE:if(r.enableRotate===!1)return;Tt(me),r.update();break;case o.TOUCH_PAN:if(r.enablePan===!1)return;ot(me),r.update();break;case o.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;yt(me),r.update();break;case o.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;q(me),r.update();break;default:l=o.NONE}}function tt(me){r.enabled!==!1&&me.preventDefault()}function Et(me){M.push(me)}function zt(me){delete B[me.pointerId];for(let De=0;De{fe(me),r.update()},this.dollyOut=(me=W())=>{J(me),r.update()},this.getScale=()=>f,this.setScale=me=>{ie(me),r.update()},this.getZoomScale=()=>W(),n!==void 0&&this.connect(n),this.update()}};function CA(t){if(typeof TextDecoder<"u")return new TextDecoder().decode(t);let e="";for(let n=0,r=t.length;n=2.0 are supported."));return}const l=new $Ce(a,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&o[c]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+c+'".')}}l.setExtensions(s),l.setPlugins(o),l.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,a){r.parse(e,n,i,a)})}}function fCe(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const Nn={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class pCe{constructor(e){this.parser=e,this.name=Nn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,a.source,s)}}class CCe{constructor(e){this.parser=e,this.name=Nn.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[n])return null;const s=a.extensions[n],o=i.images[s.source];let l=r.textureLoader;if(o.uri){const u=r.options.manager.getHandler(o.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class RCe{constructor(e){this.parser=e,this.name=Nn.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[n])return null;const s=a.extensions[n],o=i.images[s.source];let l=r.textureLoader;if(o.uri){const u=r.options.manager.getHandler(o.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class ICe{constructor(e){this.name=Nn.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],a=this.parser.getDependency("buffer",i.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return a.then(function(o){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,d=i.byteStride,f=new Uint8Array(o,l,u);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(c,d,f,i.mode,i.filter).then(function(m){return m.buffer}):s.ready.then(function(){const m=new ArrayBuffer(c*d);return s.decodeGltfBuffer(new Uint8Array(m),c,d,f,i.mode,i.filter),m})})}else return null}}class MCe{constructor(e){this.name=Nn.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==$s.TRIANGLES&&u.mode!==$s.TRIANGLE_STRIP&&u.mode!==$s.TRIANGLE_FAN&&u.mode!==void 0)return null;const s=r.extensions[this.name].attributes,o=[],l={};for(const u in s)o.push(this.parser.getDependency("accessor",s[u]).then(c=>(l[u]=c,l[u])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(u=>{const c=u.pop(),d=c.isGroup?c.children:[c],f=u[0].count,m=[];for(const g of d){const y=new en,v=new H,b=new Mn,E=new H(1,1,1),S=new lD(g.geometry,g.material,f);for(let A=0;A=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Gu={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},BCe={CUBICSPLINE:void 0,LINEAR:Zh,STEP:Kh},mR={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function FCe(t){return t.DefaultMaterial===void 0&&(t.DefaultMaterial=new Lf({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:gl})),t.DefaultMaterial}function bd(t,e,n){for(const r in n.extensions)t[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=n.extensions[r])}function Ul(t,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(t.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function UCe(t,e,n){let r=!1,i=!1,a=!1;for(let u=0,c=e.length;u0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const VCe=new en;class $Ce{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new fCe,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=!1,a=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,a=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||r||i&&a<98?this.textureLoader=new cy(this.options.manager):this.textureLoader=new uX(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new ji(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(s){const o={scene:s[0][i.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:i.asset,parser:r,userData:{}};return bd(a,o,i),Ul(o,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(o)})).then(function(){for(const l of o.scenes)l.updateMatrixWorld();e(o)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,a=n.length;i{const l=this.associations.get(s);l!=null&&this.associations.set(o,l);for(const[u,c]of s.children.entries())a(c,o.children[u])};return a(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&v.setY(N,T[R*l+1]),l>=3&&v.setZ(N,T[R*l+2]),l>=4&&v.setW(N,T[R*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){const n=this.json,r=this.options,a=n.textures[e].source,s=n.images[a];let o=this.textureLoader;if(s.uri){const l=r.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,a,o)}loadTextureImage(e,n,r){const i=this,a=this.json,s=a.textures[e],o=a.images[n],l=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,r).then(function(c){c.flipY=!1,c.name=s.name||o.name||"",c.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(c.name=o.uri);const f=(a.samplers||{})[s.sampler]||{};return c.magFilter=MG[f.magFilter]||Xn,c.minFilter=MG[f.minFilter]||Js,c.wrapS=NG[f.wrapS]||wc,c.wrapT=NG[f.wrapT]||wc,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,n){const r=this,i=this.json,a=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const s=i.images[e],o=self.URL||self.webkitURL;let l=s.uri||"",u=!1;if(s.bufferView!==void 0)l=r.getDependency("bufferView",s.bufferView).then(function(d){u=!0;const f=new Blob([d],{type:s.mimeType});return l=o.createObjectURL(f),l});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(d){return new Promise(function(f,m){let g=f;n.isImageBitmapLoader===!0&&(g=function(y){const v=new $n(y);v.needsUpdate=!0,f(v)}),n.load(yc.resolveURL(d,a.path),g,void 0,m)})}).then(function(d){return u===!0&&o.revokeObjectURL(l),Ul(d,s),d.userData.mimeType=s.mimeType||GCe(s.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=c,c}assignTexture(e,n,r,i){const a=this;return this.getDependency("texture",r.index).then(function(s){if(!s)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(s=s.clone(),s.channel=r.texCoord),a.extensions[Nn.KHR_TEXTURE_TRANSFORM]){const o=r.extensions!==void 0?r.extensions[Nn.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=a.associations.get(s);s=a.extensions[Nn.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),a.associations.set(s,l)}}return i!==void 0&&(typeof i=="number"&&(i=i===RG?Vd:cu),"colorSpace"in s?s.colorSpace=i:s.encoding=i===Vd?RG:dCe),e[n]=s,s})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,a=n.attributes.color!==void 0,s=n.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+r.uuid;let l=this.cache.get(o);l||(l=new ly,ii.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(o,l)),r=l}else if(e.isLine){const o="LineBasicMaterial:"+r.uuid;let l=this.cache.get(o);l||(l=new Ki,ii.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(o,l)),r=l}if(i||a||s){let o="ClonedMaterial:"+r.uuid+":";i&&(o+="derivative-tangents:"),a&&(o+="vertex-colors:"),s&&(o+="flat-shading:");let l=this.cache.get(o);l||(l=r.clone(),a&&(l.vertexColors=!0),s&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(o,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return Lf}loadMaterial(e){const n=this,r=this.json,i=this.extensions,a=r.materials[e];let s;const o={},l=a.extensions||{},u=[];if(l[Nn.KHR_MATERIALS_UNLIT]){const d=i[Nn.KHR_MATERIALS_UNLIT];s=d.getMaterialType(),u.push(d.extendParams(o,a,n))}else{const d=a.pbrMetallicRoughness||{};if(o.color=new vt(1,1,1),o.opacity=1,Array.isArray(d.baseColorFactor)){const f=d.baseColorFactor;o.color.setRGB(f[0],f[1],f[2],cu),o.opacity=f[3]}d.baseColorTexture!==void 0&&u.push(n.assignTexture(o,"map",d.baseColorTexture,Vd)),o.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,o.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(o,"metalnessMap",d.metallicRoughnessTexture)),u.push(n.assignTexture(o,"roughnessMap",d.metallicRoughnessTexture))),s=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,o)})))}a.doubleSided===!0&&(o.side=fa);const c=a.alphaMode||mR.OPAQUE;if(c===mR.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,c===mR.MASK&&(o.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&s!==$i&&(u.push(n.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new Ke(1,1),a.normalTexture.scale!==void 0)){const d=a.normalTexture.scale;o.normalScale.set(d,d)}if(a.occlusionTexture!==void 0&&s!==$i&&(u.push(n.assignTexture(o,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&s!==$i){const d=a.emissiveFactor;o.emissive=new vt().setRGB(d[0],d[1],d[2],cu)}return a.emissiveTexture!==void 0&&s!==$i&&u.push(n.assignTexture(o,"emissiveMap",a.emissiveTexture,Vd)),Promise.all(u).then(function(){const d=new s(o);return a.name&&(d.name=a.name),Ul(d,a),n.associations.set(d,{materials:e}),a.extensions&&bd(i,d,a),d})}createUniqueName(e){const n=Vn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function a(o){return r[Nn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,n).then(function(l){return OG(l,o,n)})}const s=[];for(let o=0,l=e.length;o0&&zCe(b,a),b.name=n.createUniqueName(a.name||"mesh_"+e),Ul(b,a),v.extensions&&bd(i,b,v),n.assignFinalMaterial(b),d.push(b)}for(let m=0,g=d.length;m1?c=new eu:u.length===1?c=u[0]:c=new _n,c!==u[0])for(let d=0,f=u.length;d{const d=new Map;for(const[f,m]of i.associations)(f instanceof ii||f instanceof $n)&&d.set(f,m);return c.traverse(f=>{const m=i.associations.get(f);m!=null&&d.set(f,m)}),d};return i.associations=u(a),a})}_createAnimationTracks(e,n,r,i,a){const s=[],o=e.name?e.name:e.uuid,l=[];Gu[a.path]===Gu.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(o);let u;switch(Gu[a.path]){case Gu.weights:u=Ef;break;case Gu.rotation:u=Sf;break;case Gu.position:case Gu.scale:u=_f;break;default:switch(r.itemSize){case 1:u=Ef;break;case 2:case 3:default:u=_f;break}break}const c=i.interpolation!==void 0?BCe[i.interpolation]:Zh,d=this._getArrayFromAccessor(r);for(let f=0,m=l.length;fe in t?nCe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,je=(t,e,n)=>(rCe(t,typeof e!="symbol"?e+"":e,n),n);let iCe=class extends Sn{constructor(e,n){super(),je(this,"isTransformControls",!0),je(this,"visible",!1),je(this,"domElement"),je(this,"raycaster",new ET),je(this,"gizmo"),je(this,"plane"),je(this,"tempVector",new H),je(this,"tempVector2",new H),je(this,"tempQuaternion",new Mn),je(this,"unit",{X:new H(1,0,0),Y:new H(0,1,0),Z:new H(0,0,1)}),je(this,"pointStart",new H),je(this,"pointEnd",new H),je(this,"offset",new H),je(this,"rotationAxis",new H),je(this,"startNorm",new H),je(this,"endNorm",new H),je(this,"rotationAngle",0),je(this,"cameraPosition",new H),je(this,"cameraQuaternion",new Mn),je(this,"cameraScale",new H),je(this,"parentPosition",new H),je(this,"parentQuaternion",new Mn),je(this,"parentQuaternionInv",new Mn),je(this,"parentScale",new H),je(this,"worldPositionStart",new H),je(this,"worldQuaternionStart",new Mn),je(this,"worldScaleStart",new H),je(this,"worldPosition",new H),je(this,"worldQuaternion",new Mn),je(this,"worldQuaternionInv",new Mn),je(this,"worldScale",new H),je(this,"eye",new H),je(this,"positionStart",new H),je(this,"quaternionStart",new Mn),je(this,"scaleStart",new H),je(this,"camera"),je(this,"object"),je(this,"enabled",!0),je(this,"axis",null),je(this,"mode","translate"),je(this,"translationSnap",null),je(this,"rotationSnap",null),je(this,"scaleSnap",null),je(this,"space","world"),je(this,"size",1),je(this,"dragging",!1),je(this,"showX",!0),je(this,"showY",!0),je(this,"showZ",!0),je(this,"changeEvent",{type:"change"}),je(this,"mouseDownEvent",{type:"mouseDown",mode:this.mode}),je(this,"mouseUpEvent",{type:"mouseUp",mode:this.mode}),je(this,"objectChangeEvent",{type:"objectChange"}),je(this,"intersectObjectWithRay",(i,a,s)=>{const o=a.intersectObject(i,!0);for(let l=0;l(this.object=i,this.visible=!0,this)),je(this,"detach",()=>(this.object=void 0,this.visible=!1,this.axis=null,this)),je(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),je(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()}),je(this,"pointerHover",i=>{if(this.object===void 0||this.dragging===!0)return;this.raycaster.setFromCamera(i,this.camera);const a=this.intersectObjectWithRay(this.gizmo.picker[this.mode],this.raycaster);a?this.axis=a.object.name:this.axis=null}),je(this,"pointerDown",i=>{if(!(this.object===void 0||this.dragging===!0||i.button!==0)&&this.axis!==null){this.raycaster.setFromCamera(i,this.camera);const a=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(a){let s=this.space;if(this.mode==="scale"?s="local":(this.axis==="E"||this.axis==="XYZE"||this.axis==="XYZ")&&(s="world"),s==="local"&&this.mode==="rotate"){const o=this.rotationSnap;this.axis==="X"&&o&&(this.object.rotation.x=Math.round(this.object.rotation.x/o)*o),this.axis==="Y"&&o&&(this.object.rotation.y=Math.round(this.object.rotation.y/o)*o),this.axis==="Z"&&o&&(this.object.rotation.z=Math.round(this.object.rotation.z/o)*o)}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(a.point).sub(this.worldPositionStart)}this.dragging=!0,this.mouseDownEvent.mode=this.mode,this.dispatchEvent(this.mouseDownEvent)}}),je(this,"pointerMove",i=>{const a=this.axis,s=this.mode,o=this.object;let l=this.space;if(s==="scale"?l="local":(a==="E"||a==="XYZE"||a==="XYZ")&&(l="world"),o===void 0||a===null||this.dragging===!1||i.button!==-1)return;this.raycaster.setFromCamera(i,this.camera);const u=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(u){if(this.pointEnd.copy(u.point).sub(this.worldPositionStart),s==="translate")this.offset.copy(this.pointEnd).sub(this.pointStart),l==="local"&&a!=="XYZ"&&this.offset.applyQuaternion(this.worldQuaternionInv),a.indexOf("X")===-1&&(this.offset.x=0),a.indexOf("Y")===-1&&(this.offset.y=0),a.indexOf("Z")===-1&&(this.offset.z=0),l==="local"&&a!=="XYZ"?this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale):this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale),o.position.copy(this.offset).add(this.positionStart),this.translationSnap&&(l==="local"&&(o.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()),a.search("X")!==-1&&(o.position.x=Math.round(o.position.x/this.translationSnap)*this.translationSnap),a.search("Y")!==-1&&(o.position.y=Math.round(o.position.y/this.translationSnap)*this.translationSnap),a.search("Z")!==-1&&(o.position.z=Math.round(o.position.z/this.translationSnap)*this.translationSnap),o.position.applyQuaternion(this.quaternionStart)),l==="world"&&(o.parent&&o.position.add(this.tempVector.setFromMatrixPosition(o.parent.matrixWorld)),a.search("X")!==-1&&(o.position.x=Math.round(o.position.x/this.translationSnap)*this.translationSnap),a.search("Y")!==-1&&(o.position.y=Math.round(o.position.y/this.translationSnap)*this.translationSnap),a.search("Z")!==-1&&(o.position.z=Math.round(o.position.z/this.translationSnap)*this.translationSnap),o.parent&&o.position.sub(this.tempVector.setFromMatrixPosition(o.parent.matrixWorld))));else if(s==="scale"){if(a.search("XYZ")!==-1){let c=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(c*=-1),this.tempVector2.set(c,c,c)}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),a.search("X")===-1&&(this.tempVector2.x=1),a.search("Y")===-1&&(this.tempVector2.y=1),a.search("Z")===-1&&(this.tempVector2.z=1);o.scale.copy(this.scaleStart).multiply(this.tempVector2),this.scaleSnap&&this.object&&(a.search("X")!==-1&&(this.object.scale.x=Math.round(o.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),a.search("Y")!==-1&&(o.scale.y=Math.round(o.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),a.search("Z")!==-1&&(o.scale.z=Math.round(o.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this.offset.copy(this.pointEnd).sub(this.pointStart);const c=20/this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));a==="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):a==="XYZE"?(this.rotationAxis.copy(this.offset).cross(this.eye).normalize(),this.rotationAngle=this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye))*c):(a==="X"||a==="Y"||a==="Z")&&(this.rotationAxis.copy(this.unit[a]),this.tempVector.copy(this.unit[a]),l==="local"&&this.tempVector.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.offset.dot(this.tempVector.cross(this.eye).normalize())*c),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),l==="local"&&a!=="E"&&a!=="XYZE"?(o.quaternion.copy(this.quaternionStart),o.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.parentQuaternionInv),o.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),o.quaternion.multiply(this.quaternionStart).normalize())}this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent)}}),je(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)}),je(this,"getPointer",i=>{var a;if(this.domElement&&((a=this.domElement.ownerDocument)!=null&&a.pointerLockElement))return{x:0,y:0,button:i.button};{const s=i.changedTouches?i.changedTouches[0]:i,o=this.domElement.getBoundingClientRect();return{x:(s.clientX-o.left)/o.width*2-1,y:-(s.clientY-o.top)/o.height*2+1,button:i.button}}}),je(this,"onPointerHover",i=>{if(this.enabled)switch(i.pointerType){case"mouse":case"pen":this.pointerHover(this.getPointer(i));break}}),je(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)))}),je(this,"onPointerMove",i=>{this.enabled&&this.pointerMove(this.getPointer(i))}),je(this,"onPointerUp",i=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction="",this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.pointerUp(this.getPointer(i)))}),je(this,"getMode",()=>this.mode),je(this,"setMode",i=>{this.mode=i}),je(this,"setTranslationSnap",i=>{this.translationSnap=i}),je(this,"setRotationSnap",i=>{this.rotationSnap=i}),je(this,"setScaleSnap",i=>{this.scaleSnap=i}),je(this,"setSize",i=>{this.size=i}),je(this,"setSpace",i=>{this.space=i}),je(this,"update",()=>{console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}),je(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)}),je(this,"dispose",()=>{var i,a,s,o,l,u;(i=this.domElement)==null||i.removeEventListener("pointerdown",this.onPointerDown),(a=this.domElement)==null||a.removeEventListener("pointermove",this.onPointerHover),(o=(s=this.domElement)==null?void 0:s.ownerDocument)==null||o.removeEventListener("pointermove",this.onPointerMove),(u=(l=this.domElement)==null?void 0:l.ownerDocument)==null||u.removeEventListener("pointerup",this.onPointerUp),this.traverse(c=>{const d=c;d.geometry&&d.geometry.dispose(),d.material&&d.material.dispose()})}),this.domElement=n,this.camera=e,this.gizmo=new aCe,this.add(this.gizmo),this.plane=new sCe,this.add(this.plane);const r=(i,a)=>{let s=a;Object.defineProperty(this,i,{get:function(){return s!==void 0?s:a},set:function(o){s!==o&&(s=o,this.plane[i]=o,this.gizmo[i]=o,this.dispatchEvent({type:i+"-changed",value:o}),this.dispatchEvent(this.changeEvent))}}),this[i]=a,this.plane[i]=a,this.gizmo[i]=a};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),n!==void 0&&this.connect(n)}};class aCe extends Sn{constructor(){super(),je(this,"isTransformControlsGizmo",!0),je(this,"type","TransformControlsGizmo"),je(this,"tempVector",new H(0,0,0)),je(this,"tempEuler",new ss),je(this,"alignVector",new H(0,1,0)),je(this,"zeroVector",new H(0,0,0)),je(this,"lookAtMatrix",new en),je(this,"tempQuaternion",new Mn),je(this,"tempQuaternion2",new Mn),je(this,"identityQuaternion",new Mn),je(this,"unitX",new H(1,0,0)),je(this,"unitY",new H(0,1,0)),je(this,"unitZ",new H(0,0,1)),je(this,"gizmo"),je(this,"picker"),je(this,"helper"),je(this,"rotationAxis",new H),je(this,"cameraPosition",new H),je(this,"worldPositionStart",new H),je(this,"worldQuaternionStart",new Mn),je(this,"worldPosition",new H),je(this,"worldQuaternion",new Mn),je(this,"eye",new H),je(this,"camera",null),je(this,"enabled",!0),je(this,"axis",null),je(this,"mode","translate"),je(this,"space","world"),je(this,"size",1),je(this,"dragging",!1),je(this,"showX",!0),je(this,"showY",!0),je(this,"showZ",!0),je(this,"updateMatrixWorld",()=>{let J=this.space;this.mode==="scale"&&(J="local");const fe=J==="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 Ce=[];Ce=Ce.concat(this.picker[this.mode].children),Ce=Ce.concat(this.gizmo[this.mode].children),Ce=Ce.concat(this.helper[this.mode].children);for(let Le=0;Le.9&&(j.visible=!1)),this.axis==="Y"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,Math.PI/2)),j.quaternion.copy(fe).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(fe).dot(this.eye))>.9&&(j.visible=!1)),this.axis==="Z"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),j.quaternion.copy(fe).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(fe).dot(this.eye))>.9&&(j.visible=!1)),this.axis==="XYZE"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),this.alignVector.copy(this.rotationAxis),j.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.zeroVector,this.alignVector,this.unitY)),j.quaternion.multiply(this.tempQuaternion),j.visible=this.dragging),this.axis==="E"&&(j.visible=!1)):j.name==="START"?(j.position.copy(this.worldPositionStart),j.visible=this.dragging):j.name==="END"?(j.position.copy(this.worldPosition),j.visible=this.dragging):j.name==="DELTA"?(j.position.copy(this.worldPositionStart),j.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()),j.scale.copy(this.tempVector),j.visible=this.dragging):(j.quaternion.copy(fe),this.dragging?j.position.copy(this.worldPositionStart):j.position.copy(this.worldPosition),this.axis&&(j.visible=this.axis.search(j.name)!==-1));continue}j.quaternion.copy(fe),this.mode==="translate"||this.mode==="scale"?((j.name==="X"||j.name==="XYZX")&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(fe).dot(this.eye))>.99&&(j.scale.set(1e-10,1e-10,1e-10),j.visible=!1),(j.name==="Y"||j.name==="XYZY")&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(fe).dot(this.eye))>.99&&(j.scale.set(1e-10,1e-10,1e-10),j.visible=!1),(j.name==="Z"||j.name==="XYZZ")&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(fe).dot(this.eye))>.99&&(j.scale.set(1e-10,1e-10,1e-10),j.visible=!1),j.name==="XY"&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(fe).dot(this.eye))<.2&&(j.scale.set(1e-10,1e-10,1e-10),j.visible=!1),j.name==="YZ"&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(fe).dot(this.eye))<.2&&(j.scale.set(1e-10,1e-10,1e-10),j.visible=!1),j.name==="XZ"&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(fe).dot(this.eye))<.2&&(j.scale.set(1e-10,1e-10,1e-10),j.visible=!1),j.name.search("X")!==-1&&(this.alignVector.copy(this.unitX).applyQuaternion(fe).dot(this.eye)<0?j.tag==="fwd"?j.visible=!1:j.scale.x*=-1:j.tag==="bwd"&&(j.visible=!1)),j.name.search("Y")!==-1&&(this.alignVector.copy(this.unitY).applyQuaternion(fe).dot(this.eye)<0?j.tag==="fwd"?j.visible=!1:j.scale.y*=-1:j.tag==="bwd"&&(j.visible=!1)),j.name.search("Z")!==-1&&(this.alignVector.copy(this.unitZ).applyQuaternion(fe).dot(this.eye)<0?j.tag==="fwd"?j.visible=!1:j.scale.z*=-1:j.tag==="bwd"&&(j.visible=!1))):this.mode==="rotate"&&(this.tempQuaternion2.copy(fe),this.alignVector.copy(this.eye).applyQuaternion(this.tempQuaternion.copy(fe).invert()),j.name.search("E")!==-1&&j.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.eye,this.zeroVector,this.unitY)),j.name==="X"&&(this.tempQuaternion.setFromAxisAngle(this.unitX,Math.atan2(-this.alignVector.y,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),j.quaternion.copy(this.tempQuaternion)),j.name==="Y"&&(this.tempQuaternion.setFromAxisAngle(this.unitY,Math.atan2(this.alignVector.x,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),j.quaternion.copy(this.tempQuaternion)),j.name==="Z"&&(this.tempQuaternion.setFromAxisAngle(this.unitZ,Math.atan2(this.alignVector.y,this.alignVector.x)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),j.quaternion.copy(this.tempQuaternion))),j.visible=j.visible&&(j.name.indexOf("X")===-1||this.showX),j.visible=j.visible&&(j.name.indexOf("Y")===-1||this.showY),j.visible=j.visible&&(j.name.indexOf("Z")===-1||this.showZ),j.visible=j.visible&&(j.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),j.material.tempOpacity=j.material.tempOpacity||j.material.opacity,j.material.tempColor=j.material.tempColor||j.material.color.clone(),j.material.color.copy(j.material.tempColor),j.material.opacity=j.material.tempOpacity,this.enabled?this.axis&&(j.name===this.axis?(j.material.opacity=1,j.material.color.lerp(new vt(1,1,1),.5)):this.axis.split("").some(function(Fe){return j.name===Fe})?(j.material.opacity=1,j.material.color.lerp(new vt(1,1,1),.5)):(j.material.opacity*=.25,j.material.color.lerp(new vt(1,1,1),.5))):(j.material.opacity*=.5,j.material.color.lerp(new vt(1,1,1),.5))}super.updateMatrixWorld()});const e=new $i({depthTest:!1,depthWrite:!1,transparent:!0,side:fa,fog:!1,toneMapped:!1}),n=new Ki({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 a=e.clone();a.color.set(16711680);const s=e.clone();s.color.set(65280);const o=e.clone();o.color.set(255);const l=e.clone();l.opacity=.25;const u=l.clone();u.color.set(16776960);const c=l.clone();c.color.set(65535);const d=l.clone();d.color.set(16711935),e.clone().color.set(16776960);const m=n.clone();m.color.set(16711680);const g=n.clone();g.color.set(65280);const y=n.clone();y.color.set(255);const v=n.clone();v.color.set(65535);const b=n.clone();b.color.set(16711935);const E=n.clone();E.color.set(16776960);const _=n.clone();_.color.set(7895160);const A=E.clone();A.opacity=.25;const I=new Hi(0,.05,.2,12,1,!1),x=new Ya(.125,.125,.125),R=new fn;R.setAttribute("position",new qt([0,0,0,1,0,0],3));const O=(J,fe)=>{const Ce=new fn,Le=[];for(let j=0;j<=64*fe;++j)Le.push(0,Math.cos(j/32*Math.PI)*J,Math.sin(j/32*Math.PI)*J);return Ce.setAttribute("position",new qt(Le,3)),Ce},N=()=>{const J=new fn;return J.setAttribute("position",new qt([0,0,0,1,1,1],3)),J},M={X:[[new Ot(I,a),[1,0,0],[0,0,-Math.PI/2],null,"fwd"],[new Ot(I,a),[1,0,0],[0,0,Math.PI/2],null,"bwd"],[new Tn(R,m)]],Y:[[new Ot(I,s),[0,1,0],null,null,"fwd"],[new Ot(I,s),[0,1,0],[Math.PI,0,0],null,"bwd"],[new Tn(R,g),null,[0,0,Math.PI/2]]],Z:[[new Ot(I,o),[0,0,1],[Math.PI/2,0,0],null,"fwd"],[new Ot(I,o),[0,0,1],[-Math.PI/2,0,0],null,"bwd"],[new Tn(R,y),null,[0,-Math.PI/2,0]]],XYZ:[[new Ot(new Ws(.1,0),l.clone()),[0,0,0],[0,0,0]]],XY:[[new Ot(new Vi(.295,.295),u.clone()),[.15,.15,0]],[new Tn(R,E),[.18,.3,0],null,[.125,1,1]],[new Tn(R,E),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new Ot(new Vi(.295,.295),c.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new Tn(R,v),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new Tn(R,v),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new Ot(new Vi(.295,.295),d.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new Tn(R,b),[.18,0,.3],null,[.125,1,1]],[new Tn(R,b),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},B={X:[[new Ot(new Hi(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new Ot(new Hi(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new Ot(new Hi(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new Ot(new Ws(.2,0),r)]],XY:[[new Ot(new Vi(.4,.4),r),[.2,.2,0]]],YZ:[[new Ot(new Vi(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new Ot(new Vi(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},G={START:[[new Ot(new Ws(.01,2),i),null,null,null,"helper"]],END:[[new Ot(new Ws(.01,2),i),null,null,null,"helper"]],DELTA:[[new Tn(N(),i),null,null,null,"helper"]],X:[[new Tn(R,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Tn(R,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Tn(R,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},W={X:[[new Tn(O(1,.5),m)],[new Ot(new Ws(.04,0),a),[0,0,.99],null,[1,3,1]]],Y:[[new Tn(O(1,.5),g),null,[0,0,-Math.PI/2]],[new Ot(new Ws(.04,0),s),[0,0,.99],null,[3,1,1]]],Z:[[new Tn(O(1,.5),y),null,[0,Math.PI/2,0]],[new Ot(new Ws(.04,0),o),[.99,0,0],null,[1,3,1]]],E:[[new Tn(O(1.25,1),A),null,[0,Math.PI/2,0]],[new Ot(new Hi(.03,0,.15,4,1,!1),A),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new Ot(new Hi(.03,0,.15,4,1,!1),A),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new Ot(new Hi(.03,0,.15,4,1,!1),A),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new Ot(new Hi(.03,0,.15,4,1,!1),A),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new Tn(O(1,1),_),null,[0,Math.PI/2,0]]]},K={AXIS:[[new Tn(R,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},se={X:[[new Ot(new sc(1,.1,4,24),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new Ot(new sc(1,.1,4,24),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new Ot(new sc(1,.1,4,24),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new Ot(new sc(1.25,.1,2,24),r)]],XYZE:[[new Ot(new _m(.7,10,8),r)]]},ae={X:[[new Ot(x,a),[.8,0,0],[0,0,-Math.PI/2]],[new Tn(R,m),null,null,[.8,1,1]]],Y:[[new Ot(x,s),[0,.8,0]],[new Tn(R,g),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new Ot(x,o),[0,0,.8],[Math.PI/2,0,0]],[new Tn(R,y),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new Ot(x,u),[.85,.85,0],null,[2,2,.2]],[new Tn(R,E),[.855,.98,0],null,[.125,1,1]],[new Tn(R,E),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new Ot(x,c),[0,.85,.85],null,[.2,2,2]],[new Tn(R,v),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new Tn(R,v),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new Ot(x,d),[.85,0,.85],null,[2,.2,2]],[new Tn(R,b),[.855,0,.98],null,[.125,1,1]],[new Tn(R,b),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new Ot(new Ya(.125,.125,.125),l.clone()),[1.1,0,0]]],XYZY:[[new Ot(new Ya(.125,.125,.125),l.clone()),[0,1.1,0]]],XYZZ:[[new Ot(new Ya(.125,.125,.125),l.clone()),[0,0,1.1]]]},ee={X:[[new Ot(new Hi(.2,0,.8,4,1,!1),r),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new Ot(new Hi(.2,0,.8,4,1,!1),r),[0,.5,0]]],Z:[[new Ot(new Hi(.2,0,.8,4,1,!1),r),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new Ot(x,r),[.85,.85,0],null,[3,3,.2]]],YZ:[[new Ot(x,r),[0,.85,.85],null,[.2,3,3]]],XZ:[[new Ot(x,r),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new Ot(new Ya(.2,.2,.2),r),[1.1,0,0]]],XYZY:[[new Ot(new Ya(.2,.2,.2),r),[0,1.1,0]]],XYZZ:[[new Ot(new Ya(.2,.2,.2),r),[0,0,1.1]]]},F={X:[[new Tn(R,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Tn(R,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Tn(R,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},ie=J=>{const fe=new Sn;for(let Ce in J)for(let Le=J[Ce].length;Le--;){const j=J[Ce][Le][0].clone(),ke=J[Ce][Le][1],Fe=J[Ce][Le][2],Ye=J[Ce][Le][3],gt=J[Ce][Le][4];j.name=Ce,j.tag=gt,ke&&j.position.set(ke[0],ke[1],ke[2]),Fe&&j.rotation.set(Fe[0],Fe[1],Fe[2]),Ye&&j.scale.set(Ye[0],Ye[1],Ye[2]),j.updateMatrix();const Gt=j.geometry.clone();Gt.applyMatrix4(j.matrix),j.geometry=Gt,j.renderOrder=1/0,j.position.set(0,0,0),j.rotation.set(0,0,0),j.scale.set(1,1,1),fe.add(j)}return fe};this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=ie(M)),this.add(this.gizmo.rotate=ie(W)),this.add(this.gizmo.scale=ie(ae)),this.add(this.picker.translate=ie(B)),this.add(this.picker.rotate=ie(se)),this.add(this.picker.scale=ie(ee)),this.add(this.helper.translate=ie(G)),this.add(this.helper.rotate=ie(K)),this.add(this.helper.scale=ie(F)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}}class sCe extends Ot{constructor(){super(new Vi(1e5,1e5,2,2),new $i({visible:!1,wireframe:!0,side:fa,transparent:!0,opacity:.1,toneMapped:!1})),je(this,"isTransformControlsPlane",!0),je(this,"type","TransformControlsPlane"),je(this,"unitX",new H(1,0,0)),je(this,"unitY",new H(0,1,0)),je(this,"unitZ",new H(0,0,1)),je(this,"tempVector",new H),je(this,"dirVector",new H),je(this,"alignVector",new H),je(this,"tempMatrix",new en),je(this,"identityQuaternion",new Mn),je(this,"cameraQuaternion",new Mn),je(this,"worldPosition",new H),je(this,"worldQuaternion",new Mn),je(this,"eye",new H),je(this,"axis",null),je(this,"mode","translate"),je(this,"space","world"),je(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 oCe=Object.defineProperty,lCe=(t,e,n)=>e in t?oCe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,an=(t,e,n)=>(lCe(t,typeof e!="symbol"?e+"":e,n),n);const qE=new Df,wG=new Hl,uCe=Math.cos(70*(Math.PI/180)),CG=(t,e)=>(t%e+e)%e;let cCe=class extends No{constructor(e,n){super(),an(this,"object"),an(this,"domElement"),an(this,"enabled",!0),an(this,"target",new H),an(this,"minDistance",0),an(this,"maxDistance",1/0),an(this,"minZoom",0),an(this,"maxZoom",1/0),an(this,"minPolarAngle",0),an(this,"maxPolarAngle",Math.PI),an(this,"minAzimuthAngle",-1/0),an(this,"maxAzimuthAngle",1/0),an(this,"enableDamping",!1),an(this,"dampingFactor",.05),an(this,"enableZoom",!0),an(this,"zoomSpeed",1),an(this,"enableRotate",!0),an(this,"rotateSpeed",1),an(this,"enablePan",!0),an(this,"panSpeed",1),an(this,"screenSpacePanning",!0),an(this,"keyPanSpeed",7),an(this,"zoomToCursor",!1),an(this,"autoRotate",!1),an(this,"autoRotateSpeed",2),an(this,"reverseOrbit",!1),an(this,"reverseHorizontalOrbit",!1),an(this,"reverseVerticalOrbit",!1),an(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),an(this,"mouseButtons",{LEFT:Sd.ROTATE,MIDDLE:Sd.DOLLY,RIGHT:Sd.PAN}),an(this,"touches",{ONE:Ad.ROTATE,TWO:Ad.DOLLY_PAN}),an(this,"target0"),an(this,"position0"),an(this,"zoom0"),an(this,"_domElementKeyEvents",null),an(this,"getPolarAngle"),an(this,"getAzimuthalAngle"),an(this,"setPolarAngle"),an(this,"setAzimuthalAngle"),an(this,"getDistance"),an(this,"getZoomScale"),an(this,"listenToKeyEvents"),an(this,"stopListenToKeyEvents"),an(this,"saveState"),an(this,"reset"),an(this,"update"),an(this,"connect"),an(this,"dispose"),an(this,"dollyIn"),an(this,"dollyOut"),an(this,"getScale"),an(this,"setScale"),this.object=e,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=me=>{let De=CG(me,2*Math.PI),rt=c.phi;rt<0&&(rt+=2*Math.PI),De<0&&(De+=2*Math.PI);let ge=Math.abs(De-rt);2*Math.PI-ge{let De=CG(me,2*Math.PI),rt=c.theta;rt<0&&(rt+=2*Math.PI),De<0&&(De+=2*Math.PI);let ge=Math.abs(De-rt);2*Math.PI-ger.object.position.distanceTo(r.target),this.listenToKeyEvents=me=>{me.addEventListener("keydown",nt),this._domElementKeyEvents=me},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",nt),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=o.NONE},this.update=(()=>{const me=new H,De=new H(0,1,0),rt=new Mn().setFromUnitVectors(e.up,De),ge=rt.clone().invert(),Te=new H,Me=new Mn,Xe=2*Math.PI;return function(){const St=r.object.position;rt.setFromUnitVectors(e.up,De),ge.copy(rt).invert(),me.copy(St).sub(r.target),me.applyQuaternion(rt),c.setFromVector3(me),r.autoRotate&&l===o.NONE&&K(G()),r.enableDamping?(c.theta+=d.theta*r.dampingFactor,c.phi+=d.phi*r.dampingFactor):(c.theta+=d.theta,c.phi+=d.phi);let Xt=r.minAzimuthAngle,mn=r.maxAzimuthAngle;isFinite(Xt)&&isFinite(mn)&&(Xt<-Math.PI?Xt+=Xe:Xt>Math.PI&&(Xt-=Xe),mn<-Math.PI?mn+=Xe:mn>Math.PI&&(mn-=Xe),Xt<=mn?c.theta=Math.max(Xt,Math.min(mn,c.theta)):c.theta=c.theta>(Xt+mn)/2?Math.max(Xt,c.theta):Math.min(mn,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(m,r.dampingFactor):r.target.add(m),r.zoomToCursor&&N||r.object.isOrthographicCamera?c.radius=Le(c.radius):c.radius=Le(c.radius*f),me.setFromSpherical(c),me.applyQuaternion(ge),St.copy(r.target).add(me),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(d.theta*=1-r.dampingFactor,d.phi*=1-r.dampingFactor,m.multiplyScalar(1-r.dampingFactor)):(d.set(0,0,0),m.set(0,0,0));let Hn=!1;if(r.zoomToCursor&&N){let pn=null;if(r.object instanceof qr&&r.object.isPerspectiveCamera){const Gn=me.length();pn=Le(Gn*f);const he=Gn-pn;r.object.position.addScaledVector(R,he),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const Gn=new H(O.x,O.y,0);Gn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/f)),r.object.updateProjectionMatrix(),Hn=!0;const he=new H(O.x,O.y,0);he.unproject(r.object),r.object.position.sub(he).add(Gn),r.object.updateMatrixWorld(),pn=me.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;pn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(pn).add(r.object.position):(qE.origin.copy(r.object.position),qE.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(qE.direction))u||8*(1-Me.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Te.copy(r.object.position),Me.copy(r.object.quaternion),Hn=!1,!0):!1}})(),this.connect=me=>{r.domElement=me,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",tt),r.domElement.addEventListener("pointerdown",U),r.domElement.addEventListener("pointercancel",_e),r.domElement.addEventListener("wheel",ft)},this.dispose=()=>{var me,De,rt,ge,Te,Me;r.domElement&&(r.domElement.style.touchAction="auto"),(me=r.domElement)==null||me.removeEventListener("contextmenu",tt),(De=r.domElement)==null||De.removeEventListener("pointerdown",U),(rt=r.domElement)==null||rt.removeEventListener("pointercancel",_e),(ge=r.domElement)==null||ge.removeEventListener("wheel",ft),(Te=r.domElement)==null||Te.ownerDocument.removeEventListener("pointermove",ue),(Me=r.domElement)==null||Me.ownerDocument.removeEventListener("pointerup",_e),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",nt)};const r=this,i={type:"change"},a={type:"start"},s={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=o.NONE;const u=1e-6,c=new UM,d=new UM;let f=1;const m=new H,g=new Ke,y=new Ke,v=new Ke,b=new Ke,E=new Ke,_=new Ke,A=new Ke,I=new Ke,x=new Ke,R=new H,O=new Ke;let N=!1;const M=[],B={};function G(){return 2*Math.PI/60/60*r.autoRotateSpeed}function W(){return Math.pow(.95,r.zoomSpeed)}function K(me){r.reverseOrbit||r.reverseHorizontalOrbit?d.theta+=me:d.theta-=me}function se(me){r.reverseOrbit||r.reverseVerticalOrbit?d.phi+=me:d.phi-=me}const ae=(()=>{const me=new H;return function(rt,ge){me.setFromMatrixColumn(ge,0),me.multiplyScalar(-rt),m.add(me)}})(),ee=(()=>{const me=new H;return function(rt,ge){r.screenSpacePanning===!0?me.setFromMatrixColumn(ge,1):(me.setFromMatrixColumn(ge,0),me.crossVectors(r.object.up,me)),me.multiplyScalar(rt),m.add(me)}})(),F=(()=>{const me=new H;return function(rt,ge){const Te=r.domElement;if(Te&&r.object instanceof qr&&r.object.isPerspectiveCamera){const Me=r.object.position;me.copy(Me).sub(r.target);let Xe=me.length();Xe*=Math.tan(r.object.fov/2*Math.PI/180),ae(2*rt*Xe/Te.clientHeight,r.object.matrix),ee(2*ge*Xe/Te.clientHeight,r.object.matrix)}else Te&&r.object instanceof pl&&r.object.isOrthographicCamera?(ae(rt*(r.object.right-r.object.left)/r.object.zoom/Te.clientWidth,r.object.matrix),ee(ge*(r.object.top-r.object.bottom)/r.object.zoom/Te.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function ie(me){r.object instanceof qr&&r.object.isPerspectiveCamera||r.object instanceof pl&&r.object.isOrthographicCamera?f=me:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function J(me){ie(f/me)}function fe(me){ie(f*me)}function Ce(me){if(!r.zoomToCursor||!r.domElement)return;N=!0;const De=r.domElement.getBoundingClientRect(),rt=me.clientX-De.left,ge=me.clientY-De.top,Te=De.width,Me=De.height;O.x=rt/Te*2-1,O.y=-(ge/Me)*2+1,R.set(O.x,O.y,1).unproject(r.object).sub(r.object.position).normalize()}function Le(me){return Math.max(r.minDistance,Math.min(r.maxDistance,me))}function j(me){g.set(me.clientX,me.clientY)}function ke(me){Ce(me),A.set(me.clientX,me.clientY)}function Fe(me){b.set(me.clientX,me.clientY)}function Ye(me){y.set(me.clientX,me.clientY),v.subVectors(y,g).multiplyScalar(r.rotateSpeed);const De=r.domElement;De&&(K(2*Math.PI*v.x/De.clientHeight),se(2*Math.PI*v.y/De.clientHeight)),g.copy(y),r.update()}function gt(me){I.set(me.clientX,me.clientY),x.subVectors(I,A),x.y>0?J(W()):x.y<0&&fe(W()),A.copy(I),r.update()}function Gt(me){E.set(me.clientX,me.clientY),_.subVectors(E,b).multiplyScalar(r.panSpeed),F(_.x,_.y),b.copy(E),r.update()}function Ut(me){Ce(me),me.deltaY<0?fe(W()):me.deltaY>0&&J(W()),r.update()}function Mt(me){let De=!1;switch(me.code){case r.keys.UP:F(0,r.keyPanSpeed),De=!0;break;case r.keys.BOTTOM:F(0,-r.keyPanSpeed),De=!0;break;case r.keys.LEFT:F(r.keyPanSpeed,0),De=!0;break;case r.keys.RIGHT:F(-r.keyPanSpeed,0),De=!0;break}De&&(me.preventDefault(),r.update())}function $e(){if(M.length==1)g.set(M[0].pageX,M[0].pageY);else{const me=.5*(M[0].pageX+M[1].pageX),De=.5*(M[0].pageY+M[1].pageY);g.set(me,De)}}function qe(){if(M.length==1)b.set(M[0].pageX,M[0].pageY);else{const me=.5*(M[0].pageX+M[1].pageX),De=.5*(M[0].pageY+M[1].pageY);b.set(me,De)}}function re(){const me=M[0].pageX-M[1].pageX,De=M[0].pageY-M[1].pageY,rt=Math.sqrt(me*me+De*De);A.set(0,rt)}function At(){r.enableZoom&&re(),r.enablePan&&qe()}function Je(){r.enableZoom&&re(),r.enableRotate&&$e()}function xt(me){if(M.length==1)y.set(me.pageX,me.pageY);else{const rt=bt(me),ge=.5*(me.pageX+rt.x),Te=.5*(me.pageY+rt.y);y.set(ge,Te)}v.subVectors(y,g).multiplyScalar(r.rotateSpeed);const De=r.domElement;De&&(K(2*Math.PI*v.x/De.clientHeight),se(2*Math.PI*v.y/De.clientHeight)),g.copy(y)}function ot(me){if(M.length==1)E.set(me.pageX,me.pageY);else{const De=bt(me),rt=.5*(me.pageX+De.x),ge=.5*(me.pageY+De.y);E.set(rt,ge)}_.subVectors(E,b).multiplyScalar(r.panSpeed),F(_.x,_.y),b.copy(E)}function Vt(me){const De=bt(me),rt=me.pageX-De.x,ge=me.pageY-De.y,Te=Math.sqrt(rt*rt+ge*ge);I.set(0,Te),x.set(0,Math.pow(I.y/A.y,r.zoomSpeed)),J(x.y),A.copy(I)}function yt(me){r.enableZoom&&Vt(me),r.enablePan&&ot(me)}function q(me){r.enableZoom&&Vt(me),r.enableRotate&&xt(me)}function U(me){var De,rt;r.enabled!==!1&&(M.length===0&&((De=r.domElement)==null||De.ownerDocument.addEventListener("pointermove",ue),(rt=r.domElement)==null||rt.ownerDocument.addEventListener("pointerup",_e)),Et(me),me.pointerType==="touch"?ht(me):Ge(me))}function ue(me){r.enabled!==!1&&(me.pointerType==="touch"?tn(me):Pe(me))}function _e(me){var De,rt,ge;zt(me),M.length===0&&((De=r.domElement)==null||De.releasePointerCapture(me.pointerId),(rt=r.domElement)==null||rt.ownerDocument.removeEventListener("pointermove",ue),(ge=r.domElement)==null||ge.ownerDocument.removeEventListener("pointerup",_e)),r.dispatchEvent(s),l=o.NONE}function Ge(me){let De;switch(me.button){case 0:De=r.mouseButtons.LEFT;break;case 1:De=r.mouseButtons.MIDDLE;break;case 2:De=r.mouseButtons.RIGHT;break;default:De=-1}switch(De){case Sd.DOLLY:if(r.enableZoom===!1)return;ke(me),l=o.DOLLY;break;case Sd.ROTATE:if(me.ctrlKey||me.metaKey||me.shiftKey){if(r.enablePan===!1)return;Fe(me),l=o.PAN}else{if(r.enableRotate===!1)return;j(me),l=o.ROTATE}break;case Sd.PAN:if(me.ctrlKey||me.metaKey||me.shiftKey){if(r.enableRotate===!1)return;j(me),l=o.ROTATE}else{if(r.enablePan===!1)return;Fe(me),l=o.PAN}break;default:l=o.NONE}l!==o.NONE&&r.dispatchEvent(a)}function Pe(me){if(r.enabled!==!1)switch(l){case o.ROTATE:if(r.enableRotate===!1)return;Ye(me);break;case o.DOLLY:if(r.enableZoom===!1)return;gt(me);break;case o.PAN:if(r.enablePan===!1)return;Gt(me);break}}function ft(me){r.enabled===!1||r.enableZoom===!1||l!==o.NONE&&l!==o.ROTATE||(me.preventDefault(),r.dispatchEvent(a),Ut(me),r.dispatchEvent(s))}function nt(me){r.enabled===!1||r.enablePan===!1||Mt(me)}function ht(me){switch(Dt(me),M.length){case 1:switch(r.touches.ONE){case Ad.ROTATE:if(r.enableRotate===!1)return;$e(),l=o.TOUCH_ROTATE;break;case Ad.PAN:if(r.enablePan===!1)return;qe(),l=o.TOUCH_PAN;break;default:l=o.NONE}break;case 2:switch(r.touches.TWO){case Ad.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;At(),l=o.TOUCH_DOLLY_PAN;break;case Ad.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Je(),l=o.TOUCH_DOLLY_ROTATE;break;default:l=o.NONE}break;default:l=o.NONE}l!==o.NONE&&r.dispatchEvent(a)}function tn(me){switch(Dt(me),l){case o.TOUCH_ROTATE:if(r.enableRotate===!1)return;xt(me),r.update();break;case o.TOUCH_PAN:if(r.enablePan===!1)return;ot(me),r.update();break;case o.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;yt(me),r.update();break;case o.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;q(me),r.update();break;default:l=o.NONE}}function tt(me){r.enabled!==!1&&me.preventDefault()}function Et(me){M.push(me)}function zt(me){delete B[me.pointerId];for(let De=0;De{fe(me),r.update()},this.dollyOut=(me=W())=>{J(me),r.update()},this.getScale=()=>f,this.setScale=me=>{ie(me),r.update()},this.getZoomScale=()=>W(),n!==void 0&&this.connect(n),this.update()}};function CA(t){if(typeof TextDecoder<"u")return new TextDecoder().decode(t);let e="";for(let n=0,r=t.length;n=2.0 are supported."));return}const l=new $Ce(a,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&o[c]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+c+'".')}}l.setExtensions(s),l.setPlugins(o),l.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,a){r.parse(e,n,i,a)})}}function fCe(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const Nn={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class pCe{constructor(e){this.parser=e,this.name=Nn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,a.source,s)}}class CCe{constructor(e){this.parser=e,this.name=Nn.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[n])return null;const s=a.extensions[n],o=i.images[s.source];let l=r.textureLoader;if(o.uri){const u=r.options.manager.getHandler(o.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class RCe{constructor(e){this.parser=e,this.name=Nn.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[n])return null;const s=a.extensions[n],o=i.images[s.source];let l=r.textureLoader;if(o.uri){const u=r.options.manager.getHandler(o.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class ICe{constructor(e){this.name=Nn.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],a=this.parser.getDependency("buffer",i.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return a.then(function(o){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,d=i.byteStride,f=new Uint8Array(o,l,u);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(c,d,f,i.mode,i.filter).then(function(m){return m.buffer}):s.ready.then(function(){const m=new ArrayBuffer(c*d);return s.decodeGltfBuffer(new Uint8Array(m),c,d,f,i.mode,i.filter),m})})}else return null}}class MCe{constructor(e){this.name=Nn.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==$s.TRIANGLES&&u.mode!==$s.TRIANGLE_STRIP&&u.mode!==$s.TRIANGLE_FAN&&u.mode!==void 0)return null;const s=r.extensions[this.name].attributes,o=[],l={};for(const u in s)o.push(this.parser.getDependency("accessor",s[u]).then(c=>(l[u]=c,l[u])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(u=>{const c=u.pop(),d=c.isGroup?c.children:[c],f=u[0].count,m=[];for(const g of d){const y=new en,v=new H,b=new Mn,E=new H(1,1,1),_=new lD(g.geometry,g.material,f);for(let A=0;A=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Gu={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},BCe={CUBICSPLINE:void 0,LINEAR:Zh,STEP:Kh},mR={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function FCe(t){return t.DefaultMaterial===void 0&&(t.DefaultMaterial=new Lf({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:gl})),t.DefaultMaterial}function bd(t,e,n){for(const r in n.extensions)t[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=n.extensions[r])}function Ul(t,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(t.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function UCe(t,e,n){let r=!1,i=!1,a=!1;for(let u=0,c=e.length;u0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const VCe=new en;class $Ce{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new fCe,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=!1,a=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,a=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||r||i&&a<98?this.textureLoader=new cy(this.options.manager):this.textureLoader=new uX(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new ji(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(s){const o={scene:s[0][i.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:i.asset,parser:r,userData:{}};return bd(a,o,i),Ul(o,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(o)})).then(function(){for(const l of o.scenes)l.updateMatrixWorld();e(o)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,a=n.length;i{const l=this.associations.get(s);l!=null&&this.associations.set(o,l);for(const[u,c]of s.children.entries())a(c,o.children[u])};return a(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&v.setY(N,x[R*l+1]),l>=3&&v.setZ(N,x[R*l+2]),l>=4&&v.setW(N,x[R*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){const n=this.json,r=this.options,a=n.textures[e].source,s=n.images[a];let o=this.textureLoader;if(s.uri){const l=r.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,a,o)}loadTextureImage(e,n,r){const i=this,a=this.json,s=a.textures[e],o=a.images[n],l=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,r).then(function(c){c.flipY=!1,c.name=s.name||o.name||"",c.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(c.name=o.uri);const f=(a.samplers||{})[s.sampler]||{};return c.magFilter=MG[f.magFilter]||Xn,c.minFilter=MG[f.minFilter]||Js,c.wrapS=NG[f.wrapS]||wc,c.wrapT=NG[f.wrapT]||wc,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,n){const r=this,i=this.json,a=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const s=i.images[e],o=self.URL||self.webkitURL;let l=s.uri||"",u=!1;if(s.bufferView!==void 0)l=r.getDependency("bufferView",s.bufferView).then(function(d){u=!0;const f=new Blob([d],{type:s.mimeType});return l=o.createObjectURL(f),l});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(d){return new Promise(function(f,m){let g=f;n.isImageBitmapLoader===!0&&(g=function(y){const v=new $n(y);v.needsUpdate=!0,f(v)}),n.load(yc.resolveURL(d,a.path),g,void 0,m)})}).then(function(d){return u===!0&&o.revokeObjectURL(l),Ul(d,s),d.userData.mimeType=s.mimeType||GCe(s.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=c,c}assignTexture(e,n,r,i){const a=this;return this.getDependency("texture",r.index).then(function(s){if(!s)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(s=s.clone(),s.channel=r.texCoord),a.extensions[Nn.KHR_TEXTURE_TRANSFORM]){const o=r.extensions!==void 0?r.extensions[Nn.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=a.associations.get(s);s=a.extensions[Nn.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),a.associations.set(s,l)}}return i!==void 0&&(typeof i=="number"&&(i=i===RG?Vd:cu),"colorSpace"in s?s.colorSpace=i:s.encoding=i===Vd?RG:dCe),e[n]=s,s})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,a=n.attributes.color!==void 0,s=n.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+r.uuid;let l=this.cache.get(o);l||(l=new ly,ii.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(o,l)),r=l}else if(e.isLine){const o="LineBasicMaterial:"+r.uuid;let l=this.cache.get(o);l||(l=new Ki,ii.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(o,l)),r=l}if(i||a||s){let o="ClonedMaterial:"+r.uuid+":";i&&(o+="derivative-tangents:"),a&&(o+="vertex-colors:"),s&&(o+="flat-shading:");let l=this.cache.get(o);l||(l=r.clone(),a&&(l.vertexColors=!0),s&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(o,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return Lf}loadMaterial(e){const n=this,r=this.json,i=this.extensions,a=r.materials[e];let s;const o={},l=a.extensions||{},u=[];if(l[Nn.KHR_MATERIALS_UNLIT]){const d=i[Nn.KHR_MATERIALS_UNLIT];s=d.getMaterialType(),u.push(d.extendParams(o,a,n))}else{const d=a.pbrMetallicRoughness||{};if(o.color=new vt(1,1,1),o.opacity=1,Array.isArray(d.baseColorFactor)){const f=d.baseColorFactor;o.color.setRGB(f[0],f[1],f[2],cu),o.opacity=f[3]}d.baseColorTexture!==void 0&&u.push(n.assignTexture(o,"map",d.baseColorTexture,Vd)),o.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,o.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(o,"metalnessMap",d.metallicRoughnessTexture)),u.push(n.assignTexture(o,"roughnessMap",d.metallicRoughnessTexture))),s=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,o)})))}a.doubleSided===!0&&(o.side=fa);const c=a.alphaMode||mR.OPAQUE;if(c===mR.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,c===mR.MASK&&(o.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&s!==$i&&(u.push(n.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new Ke(1,1),a.normalTexture.scale!==void 0)){const d=a.normalTexture.scale;o.normalScale.set(d,d)}if(a.occlusionTexture!==void 0&&s!==$i&&(u.push(n.assignTexture(o,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&s!==$i){const d=a.emissiveFactor;o.emissive=new vt().setRGB(d[0],d[1],d[2],cu)}return a.emissiveTexture!==void 0&&s!==$i&&u.push(n.assignTexture(o,"emissiveMap",a.emissiveTexture,Vd)),Promise.all(u).then(function(){const d=new s(o);return a.name&&(d.name=a.name),Ul(d,a),n.associations.set(d,{materials:e}),a.extensions&&bd(i,d,a),d})}createUniqueName(e){const n=Vn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function a(o){return r[Nn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,n).then(function(l){return OG(l,o,n)})}const s=[];for(let o=0,l=e.length;o0&&zCe(b,a),b.name=n.createUniqueName(a.name||"mesh_"+e),Ul(b,a),v.extensions&&bd(i,b,v),n.assignFinalMaterial(b),d.push(b)}for(let m=0,g=d.length;m1?c=new eu:u.length===1?c=u[0]:c=new Sn,c!==u[0])for(let d=0,f=u.length;d{const d=new Map;for(const[f,m]of i.associations)(f instanceof ii||f instanceof $n)&&d.set(f,m);return c.traverse(f=>{const m=i.associations.get(f);m!=null&&d.set(f,m)}),d};return i.associations=u(a),a})}_createAnimationTracks(e,n,r,i,a){const s=[],o=e.name?e.name:e.uuid,l=[];Gu[a.path]===Gu.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(o);let u;switch(Gu[a.path]){case Gu.weights:u=Ef;break;case Gu.rotation:u=_f;break;case Gu.position:case Gu.scale:u=Sf;break;default:switch(r.itemSize){case 1:u=Ef;break;case 2:case 3:default:u=Sf;break}break}const c=i.interpolation!==void 0?BCe[i.interpolation]:Zh,d=this._getArrayFromAccessor(r);for(let f=0,m=l.length;f(W=ae.indexOf(c))&&K=O.byteLength||!(se=d(O)))&&s(1,"no header found"),(ae=se.match(N))||s(3,"bad initial token"),K.valid|=1,K.programtype=ae[1],K.string+=se+` `;se=d(O),se!==!1;){if(K.string+=se+` `,se.charAt(0)==="#"){K.comments+=se+` -`;continue}if((ae=se.match(M))&&(K.gamma=parseFloat(ae[1])),(ae=se.match(B))&&(K.exposure=parseFloat(ae[1])),(ae=se.match(G))&&(K.valid|=2,K.format=ae[1]),(ae=se.match(W))&&(K.valid|=4,K.height=parseInt(ae[1],10),K.width=parseInt(ae[2],10)),K.valid&2&&K.valid&4)break}return K.valid&2||s(3,"missing format specifier"),K.valid&4||s(3,"missing image size specifier"),K},m=function(O,N,M){const B=N;if(B<8||B>32767||O[0]!==2||O[1]!==2||O[2]&128)return new Uint8Array(O);B!==(O[2]<<8|O[3])&&s(3,"wrong scanline width");const G=new Uint8Array(4*N*M);G.length||s(4,"unable to allocate buffer space");let W=0,K=0;const se=4*B,ae=new Uint8Array(4),ee=new Uint8Array(se);let F=M;for(;F>0&&KO.byteLength&&s(1),ae[0]=O[K++],ae[1]=O[K++],ae[2]=O[K++],ae[3]=O[K++],(ae[0]!=2||ae[1]!=2||(ae[2]<<8|ae[3])!=B)&&s(3,"bad rgbe scanline format");let ie=0,J;for(;ie128;if(Ce&&(J-=128),(J===0||ie+J>se)&&s(3,"bad scanline data"),Ce){const Le=O[K++];for(let j=0;j>3]&1<<(Te&7))&&(z[oe++]=Te);for(var Re=oe-1;oe<65536;)z[oe++]=0;return Re}function B(P){for(var z=0;z<16384;z++)P[z]={},P[z].len=0,P[z].lit=0,P[z].p=null}const G={l:0,c:0,lc:0};function W(P,z,oe,Te,Re){for(;oe>oe&(1<0;--z){var Te=oe+K[z]>>1;K[z]=oe,oe=Te}for(var z=0;z<65537;++z){var Re=P[z];Re>0&&(P[z]=Re|K[Re]++<<6)}}function ae(P,z,oe,Te,Re,L,X){for(var le=oe,de=0,Q=0;Re<=L;Re++){if(le.value-oe.value>Te)return!1;W(6,de,Q,P,le);var Ee=G.l;if(de=G.c,Q=G.lc,X[Re]=Ee,Ee==63){if(le.value-oe.value>Te)throw"Something wrong with hufUnpackEncTable";W(8,de,Q,P,le);var we=G.l+6;if(de=G.c,Q=G.lc,Re+we>L+1)throw"Something wrong with hufUnpackEncTable";for(;we--;)X[Re++]=0;Re--}else if(Ee>=59){var we=Ee-59+2;if(Re+we>L+1)throw"Something wrong with hufUnpackEncTable";for(;we--;)X[Re++]=0;Re--}}se(X)}function ee(P){return P&63}function F(P){return P>>6}function ie(P,z,oe,Te){for(;z<=oe;z++){var Re=F(P[z]),L=ee(P[z]);if(Re>>L)throw"Invalid table entry";if(L>14){var X=Te[Re>>L-14];if(X.len)throw"Invalid table entry";if(X.lit++,X.p){var le=X.p;X.p=new Array(X.lit);for(var de=0;de0;de--){var X=Te[(Re<<14-L)+Q];if(X.len||X.p)throw"Invalid table entry";X.len=L,X.lit=z,Q++}}return!0}const J={c:0,lc:0};function fe(P,z,oe,Te){P=P<<8|bt(oe,Te),z+=8,J.c=P,J.lc=z}const Ce={c:0,lc:0};function Le(P,z,oe,Te,Re,L,X,le,de,Q){if(P==z){Te<8&&(fe(oe,Te,Re,X),oe=J.c,Te=J.lc),Te-=8;var Ee=oe>>Te,Ee=new Uint8Array([Ee])[0];if(de.value+Ee>Q)return!1;for(var we=le[de.value-1];Ee-- >0;)le[de.value++]=we}else if(de.value32767?z-65536:z}const Fe={a:0,b:0};function Ye(P,z){var oe=ke(P),Te=ke(z),Re=Te,L=oe+(Re&1)+(Re>>1),X=L,le=L-Re;Fe.a=X,Fe.b=le}function gt(P,z){var oe=j(P),Te=j(z),Re=oe-(Te>>1)&65535,L=Te+Re-32768&65535;Fe.a=L,Fe.b=Re}function Gt(P,z,oe,Te,Re,L,X){for(var le=X<16384,de=oe>Re?Re:oe,Q=1,Ee;Q<=de;)Q<<=1;for(Q>>=1,Ee=Q,Q>>=1;Q>=1;){for(var we=0,at=we+L*(Re-Ee),Ve=L*Q,Qe=L*Ee,lt=Te*Q,Ue=Te*Ee,ct,Bt,wt,xt;we<=at;we+=Qe){for(var Nt=we,pt=we+Te*(oe-Ee);Nt<=pt;Nt+=Ue){var nn=Nt+lt,Zt=Nt+Ve,ir=Zt+lt;le?(Ye(P[Nt+z],P[Zt+z]),ct=Fe.a,wt=Fe.b,Ye(P[nn+z],P[ir+z]),Bt=Fe.a,xt=Fe.b,Ye(ct,Bt),P[Nt+z]=Fe.a,P[nn+z]=Fe.b,Ye(wt,xt),P[Zt+z]=Fe.a,P[ir+z]=Fe.b):(gt(P[Nt+z],P[Zt+z]),ct=Fe.a,wt=Fe.b,gt(P[nn+z],P[ir+z]),Bt=Fe.a,xt=Fe.b,gt(ct,Bt),P[Nt+z]=Fe.a,P[nn+z]=Fe.b,gt(wt,xt),P[Zt+z]=Fe.a,P[ir+z]=Fe.b)}if(oe&Q){var Zt=Nt+Ve;le?Ye(P[Nt+z],P[Zt+z]):gt(P[Nt+z],P[Zt+z]),ct=Fe.a,P[Zt+z]=Fe.b,P[Nt+z]=ct}}if(Re&Q)for(var Nt=we,pt=we+Te*(oe-Ee);Nt<=pt;Nt+=Ue){var nn=Nt+lt;le?Ye(P[Nt+z],P[nn+z]):gt(P[Nt+z],P[nn+z]),ct=Fe.a,P[nn+z]=Fe.b,P[Nt+z]=ct}Ee=Q,Q>>=1}return we}function Ut(P,z,oe,Te,Re,L,X,le,de,Q){for(var Ee=0,we=0,at=le,Ve=Math.trunc(Re.value+(L+7)/8);Re.value=14;){var Qe=Ee>>we-14&16383,lt=z[Qe];if(lt.len)we-=lt.len,Le(lt.lit,X,Ee,we,oe,Te,Re,de,Q,at),Ee=Ce.c,we=Ce.lc;else{if(!lt.p)throw"hufDecode issues";var Ue;for(Ue=0;Ue=ct&&F(P[lt.p[Ue]])==(Ee>>we-ct&(1<>=Bt,we-=Bt;we>0;){var lt=z[Ee<<14-we&16383];if(lt.len)we-=lt.len,Le(lt.lit,X,Ee,we,oe,Te,Re,de,Q,at),Ee=Ce.c,we=Ce.lc;else throw"hufDecode issues"}return!0}function Mt(P,z,oe,Te,Re,L){var X={value:0},le=oe.value,de=Dt(z,oe),Q=Dt(z,oe);oe.value+=4;var Ee=Dt(z,oe);if(oe.value+=4,de<0||de>=65537||Q<0||Q>=65537)throw"Something wrong with HUF_ENCSIZE";var we=new Array(65537),at=new Array(16384);B(at);var Ve=Te-(oe.value-le);if(ae(P,z,oe,Ve,de,Q,we),Ee>8*(Te-(oe.value-le)))throw"Something wrong with hufUncompress";ie(we,de,Q,at),Ut(we,at,P,z,oe,Ee,Q,L,Re,X)}function $e(P,z,oe){for(var Te=0;TeL||(z[Re++]=P[oe++],Re>L));)z[Re++]=P[Te++]}function At(P){for(var z=P.byteLength,oe=new Array,Te=0,Re=new DataView(P);z>0;){var L=Re.getInt8(Te++);if(L<0){var X=-L;z-=X+1;for(var le=0;le>8==255?Re+=Te&255:(oe[Re]=Te,Re++),P.value++}function ot(P,z){z[0]=xe(P[0]),z[1]=xe(P[1]),z[2]=xe(P[5]),z[3]=xe(P[6]),z[4]=xe(P[14]),z[5]=xe(P[15]),z[6]=xe(P[27]),z[7]=xe(P[28]),z[8]=xe(P[2]),z[9]=xe(P[4]),z[10]=xe(P[7]),z[11]=xe(P[13]),z[12]=xe(P[16]),z[13]=xe(P[26]),z[14]=xe(P[29]),z[15]=xe(P[42]),z[16]=xe(P[3]),z[17]=xe(P[8]),z[18]=xe(P[12]),z[19]=xe(P[17]),z[20]=xe(P[25]),z[21]=xe(P[30]),z[22]=xe(P[41]),z[23]=xe(P[43]),z[24]=xe(P[9]),z[25]=xe(P[11]),z[26]=xe(P[18]),z[27]=xe(P[24]),z[28]=xe(P[31]),z[29]=xe(P[40]),z[30]=xe(P[44]),z[31]=xe(P[53]),z[32]=xe(P[10]),z[33]=xe(P[19]),z[34]=xe(P[23]),z[35]=xe(P[32]),z[36]=xe(P[39]),z[37]=xe(P[45]),z[38]=xe(P[52]),z[39]=xe(P[54]),z[40]=xe(P[20]),z[41]=xe(P[22]),z[42]=xe(P[33]),z[43]=xe(P[38]),z[44]=xe(P[46]),z[45]=xe(P[51]),z[46]=xe(P[55]),z[47]=xe(P[60]),z[48]=xe(P[21]),z[49]=xe(P[34]),z[50]=xe(P[37]),z[51]=xe(P[47]),z[52]=xe(P[50]),z[53]=xe(P[56]),z[54]=xe(P[59]),z[55]=xe(P[61]),z[56]=xe(P[35]),z[57]=xe(P[36]),z[58]=xe(P[48]),z[59]=xe(P[49]),z[60]=xe(P[57]),z[61]=xe(P[58]),z[62]=xe(P[62]),z[63]=xe(P[63])}function Vt(P){const z=.5*Math.cos(.7853975),oe=.5*Math.cos(3.14159/16),Te=.5*Math.cos(3.14159/8),Re=.5*Math.cos(3*3.14159/16),L=.5*Math.cos(5*3.14159/16),X=.5*Math.cos(3*3.14159/8),le=.5*Math.cos(7*3.14159/16);for(var de=new Array(4),Q=new Array(4),Ee=new Array(4),we=new Array(4),at=0;at<8;++at){var Ve=at*8;de[0]=Te*P[Ve+2],de[1]=X*P[Ve+2],de[2]=Te*P[Ve+6],de[3]=X*P[Ve+6],Q[0]=oe*P[Ve+1]+Re*P[Ve+3]+L*P[Ve+5]+le*P[Ve+7],Q[1]=Re*P[Ve+1]-le*P[Ve+3]-oe*P[Ve+5]-L*P[Ve+7],Q[2]=L*P[Ve+1]-oe*P[Ve+3]+le*P[Ve+5]+Re*P[Ve+7],Q[3]=le*P[Ve+1]-L*P[Ve+3]+Re*P[Ve+5]-oe*P[Ve+7],Ee[0]=z*(P[Ve+0]+P[Ve+4]),Ee[3]=z*(P[Ve+0]-P[Ve+4]),Ee[1]=de[0]+de[3],Ee[2]=de[1]-de[2],we[0]=Ee[0]+Ee[1],we[1]=Ee[3]+Ee[2],we[2]=Ee[3]-Ee[2],we[3]=Ee[0]-Ee[1],P[Ve+0]=we[0]+Q[0],P[Ve+1]=we[1]+Q[1],P[Ve+2]=we[2]+Q[2],P[Ve+3]=we[3]+Q[3],P[Ve+4]=we[3]-Q[3],P[Ve+5]=we[2]-Q[2],P[Ve+6]=we[1]-Q[1],P[Ve+7]=we[0]-Q[0]}for(var Qe=0;Qe<8;++Qe)de[0]=Te*P[16+Qe],de[1]=X*P[16+Qe],de[2]=Te*P[48+Qe],de[3]=X*P[48+Qe],Q[0]=oe*P[8+Qe]+Re*P[24+Qe]+L*P[40+Qe]+le*P[56+Qe],Q[1]=Re*P[8+Qe]-le*P[24+Qe]-oe*P[40+Qe]-L*P[56+Qe],Q[2]=L*P[8+Qe]-oe*P[24+Qe]+le*P[40+Qe]+Re*P[56+Qe],Q[3]=le*P[8+Qe]-L*P[24+Qe]+Re*P[40+Qe]-oe*P[56+Qe],Ee[0]=z*(P[Qe]+P[32+Qe]),Ee[3]=z*(P[Qe]-P[32+Qe]),Ee[1]=de[0]+de[3],Ee[2]=de[1]-de[2],we[0]=Ee[0]+Ee[1],we[1]=Ee[3]+Ee[2],we[2]=Ee[3]-Ee[2],we[3]=Ee[0]-Ee[1],P[0+Qe]=we[0]+Q[0],P[8+Qe]=we[1]+Q[1],P[16+Qe]=we[2]+Q[2],P[24+Qe]=we[3]+Q[3],P[32+Qe]=we[3]-Q[3],P[40+Qe]=we[2]-Q[2],P[48+Qe]=we[1]-Q[1],P[56+Qe]=we[0]-Q[0]}function yt(P){for(var z=0;z<64;++z){var oe=P[0][z],Te=P[1][z],Re=P[2][z];P[0][z]=oe+1.5747*Re,P[1][z]=oe-.1873*Te-.4682*Re,P[2][z]=oe+1.8556*Te}}function q(P,z,oe){for(var Te=0;Te<64;++Te)z[oe+Te]=zd.toHalfFloat(U(P[Te]))}function U(P){return P<=1?Math.sign(P)*Math.pow(Math.abs(P),2.2):Math.sign(P)*Math.pow(N,Math.abs(P)-1)}function ue(P){return new DataView(P.array.buffer,P.offset.value,P.size)}function Se(P){var z=P.viewer.buffer.slice(P.offset.value,P.offset.value+P.size),oe=new Uint8Array(At(z)),Te=new Uint8Array(oe.length);return qe(oe),re(oe,Te),new DataView(Te.buffer)}function Ge(P){var z=P.array.slice(P.offset.value,P.offset.value+P.size),oe=YE(z),Te=new Uint8Array(oe.length);return qe(oe),re(oe,Te),new DataView(Te.buffer)}function Pe(P){for(var z=P.viewer,oe={value:P.offset.value},Te=new Uint16Array(P.width*P.scanlineBlockSize*(P.channels*P.type)),Re=new Uint8Array(8192),L=0,X=new Array(P.channels),le=0;le=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(de<=Q)for(var le=0;le0;){var le=ht(z.buffer,oe),de=me(z,oe),Q=de>>2&3,Ee=(de>>4)-1,we=new Int8Array([Ee])[0],at=me(z,oe);L.push({name:le,index:we,type:at,compression:Q}),X-=le.length+3}for(var Ve=Kt.channels,Qe=new Array(P.channels),lt=0;lt=0&&(Bt.idx[xt.index]=wt),Ue.offset=wt)}if(Re.acCompressedSize>0)switch(Re.acCompression){case 0:var nn=new Uint16Array(Re.totalAcUncompressedCount);Mt(P.array,z,oe,Re.acCompressedSize,nn,Re.totalAcUncompressedCount);break;case 1:var Nt=P.array.slice(oe.value,oe.value+Re.totalAcUncompressedCount),pt=YE(Nt),nn=new Uint16Array(pt.buffer);oe.value+=Re.totalAcUncompressedCount;break}if(Re.dcCompressedSize>0){var Zt={array:P.array,offset:oe,size:Re.dcCompressedSize},ir=new Uint16Array(Ge(Zt).buffer);oe.value+=Re.dcCompressedSize}if(Re.rleRawSize>0){var Nt=P.array.slice(oe.value,oe.value+Re.rleCompressedSize),pt=YE(Nt),ar=At(pt.buffer);oe.value+=Re.rleCompressedSize}for(var Wn=0,Rn=new Array(Qe.length),lt=0;lt>10,oe=P&1023;return(P>>15?-1:1)*(z?z===31?oe?NaN:1/0:Math.pow(2,z-15)*(1+oe/1024):6103515625e-14*(oe/1024))}function Me(P,z){var oe=P.getUint16(z.value,!0);return z.value+=2,oe}function Xe(P,z){return xe(Me(P,z))}function St(P,z,oe,Te){for(var Re=oe.value,L=[];oe.valueet.height?et.height-z:et.scanlineBlockSize;const Te=et.size=et.height)break;for(let X=0;X{const o={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(s,o).then(n).catch(i)},r,i)}decodeDracoFile(e,n,r,i){const a={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,a).then(n)}decodeGeometry(e,n){for(const l in n.attributeTypes){const u=n.attributeTypes[l];u.BYTES_PER_ELEMENT!==void 0&&(n.attributeTypes[l]=u.name)}const r=JSON.stringify(n);if(bR.has(e)){const l=bR.get(e);if(l.key===r)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const a=this.workerNextTaskID++,s=e.byteLength,o=this._getWorker(a,s).then(l=>(i=l,new Promise((u,c)=>{i._callbacks[a]={resolve:u,reject:c},i.postMessage({type:"decode",id:a,taskConfig:n,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return o.catch(()=>!0).then(()=>{i&&a&&this._releaseTask(i,a)}),bR.set(e,{key:r,promise:o}),o}_createGeometry(e){const n=new fn;e.index&&n.setIndex(new Kn(e.index.array,1));for(let r=0;r{r.load(e,i,void 0,a)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",n=[];return e?n.push(this._loadLibrary("draco_decoder.js","text")):(n.push(this._loadLibrary("draco_wasm_wrapper.js","text")),n.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(n).then(r=>{const i=r[0];e||(this.decoderConfig.wasmBinary=r[1]);const a=ZCe.toString(),s=["/* draco decoder */",i,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,n){return this._initDecoder().then(()=>{if(this.workerPool.lengtha._taskLoad?-1:1});const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=n,r._taskLoad+=n,r})}_releaseTask(e,n){e._taskLoad-=e._taskCosts[n],delete e._callbacks[n],delete e._taskCosts[n]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const d=c.draco,f=new d.Decoder,m=new d.DecoderBuffer;m.Init(new Int8Array(l),l.byteLength);try{const g=n(d,f,m,u),y=g.attributes.map(v=>v.array.buffer);g.index&&y.push(g.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:g},y)}catch(g){console.error(g),self.postMessage({type:"error",id:o.id,error:g.message})}finally{d.destroy(m),d.destroy(f)}});break}};function n(s,o,l,u){const c=u.attributeIDs,d=u.attributeTypes;let f,m;const g=o.GetEncodedGeometryType(l);if(g===s.TRIANGULAR_MESH)f=new s.Mesh,m=o.DecodeBufferToMesh(l,f);else if(g===s.POINT_CLOUD)f=new s.PointCloud,m=o.DecodeBufferToPointCloud(l,f);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!m.ok()||f.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+m.error_msg());const y={index:null,attributes:[]};for(const v in c){const b=self[d[v]];let E,S;if(u.useUniqueIDs)S=c[v],E=o.GetAttributeByUniqueId(f,S);else{if(S=o.GetAttributeId(f,s[c[v]]),S===-1)continue;E=o.GetAttribute(f,S)}y.attributes.push(i(s,o,f,v,b,E))}return g===s.TRIANGULAR_MESH&&(y.index=r(s,o,f)),s.destroy(f),y}function r(s,o,l){const c=l.num_faces()*3,d=c*4,f=s._malloc(d);o.GetTrianglesUInt32Array(l,d,f);const m=new Uint32Array(s.HEAPF32.buffer,f,c).slice();return s._free(f),{array:m,itemSize:1}}function i(s,o,l,u,c,d){const f=d.num_components(),g=l.num_points()*f,y=g*c.BYTES_PER_ELEMENT,v=a(s,c),b=s._malloc(y);o.GetAttributeDataArrayForAllPoints(l,d,v,y,b);const E=new c(s.HEAPF32.buffer,b,g).slice();return s._free(b),{name:u,array:E,itemSize:f}}function a(s,o){switch(o){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}let XE;const yR=()=>{if(XE)return XE;const t="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let i=t;WebAssembly.validate(n)&&(i=e);let a;const s=WebAssembly.instantiate(o(i),{}).then(d=>{a=d.instance,a.exports.__wasm_call_ctors()});function o(d){const f=new Uint8Array(d.length);for(let g=0;g96?y-71:y>64?y-65:y>47?y+4:y>46?63:62}let m=0;for(let g=0;g{const d=nD.clone({[u]:{value:c}});return{...l,...d}},{}),vertexShader:e,fragmentShader:n}),this.key="",o.forEach(([l])=>Object.defineProperty(this,l,{get:()=>this.uniforms[l].value,set:u=>this.uniforms[l].value=u})),Object.assign(this,s)}};return i.key=bc.generateUUID(),i}const vR=t=>t===Object(t)&&!Array.isArray(t)&&typeof t!="function";function Ax(t,e){const n=zn(a=>a.gl),r=io(cy,vR(t)?Object.values(t):t);return w.useLayoutEffect(()=>{e==null||e(r)},[e]),w.useEffect(()=>{if("initTexture"in n){let a=[];Array.isArray(r)?a=r:r instanceof $n?a=[r]:vR(r)&&(a=Object.values(r)),a.forEach(s=>{s instanceof $n&&n.initTexture(s)})}},[n,r]),w.useMemo(()=>{if(vR(t)){const a={};let s=0;for(const o in t)a[o]=r[s++];return a}else return r},[t,r])}Ax.preload=t=>io.preload(cy,t);Ax.clear=t=>io.clear(cy,t);const QCe=()=>parseInt(Of.replace(/\D+/g,"")),JX=QCe();let KE=null,eK="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function tK(t=!0,e=!0,n){return r=>{n&&n(r),t&&(KE||(KE=new KCe),KE.setDecoderPath(typeof t=="string"?t:eK),r.setDRACOLoader(KE)),e&&r.setMeshoptDecoder(typeof yR=="function"?yR():yR)}}const Tx=(t,e,n,r)=>io(FD,t,tK(e,n,r));Tx.preload=(t,e,n,r)=>io.preload(FD,t,tK(e,n,r));Tx.clear=t=>io.clear(FD,t);Tx.setDecoderPath=t=>{eK=t};function JCe(t,e,n){const r=zn(f=>f.size),i=zn(f=>f.viewport),a=typeof t=="number"?t:r.width*i.dpr,s=r.height*i.dpr,o=(typeof t=="number"?n:t)||{},{samples:l=0,depth:u,...c}=o,d=w.useMemo(()=>{const f=new ki(a,s,{minFilter:Xn,magFilter:Xn,type:fi,...c});return u&&(f.depthTexture=new QT(a,s,Or)),f.samples=l,f},[]);return w.useLayoutEffect(()=>{d.setSize(a,s),l&&(d.samples=l)},[l,d,a,s]),w.useEffect(()=>()=>d.dispose(),[]),d}const eRe=t=>typeof t=="function",my=w.forwardRef(({envMap:t,resolution:e=256,frames:n=1/0,makeDefault:r,children:i,...a},s)=>{const o=zn(({set:v})=>v),l=zn(({camera:v})=>v),u=zn(({size:v})=>v),c=w.useRef(null);w.useImperativeHandle(s,()=>c.current,[]);const d=w.useRef(null),f=JCe(e);w.useLayoutEffect(()=>{a.manual||(c.current.aspect=u.width/u.height)},[u,a]),w.useLayoutEffect(()=>{c.current.updateProjectionMatrix()});let m=0,g=null;const y=eRe(i);return ko(v=>{y&&(n===1/0||m{if(r){const v=l;return o(()=>({camera:c.current})),()=>o(()=>({camera:v}))}},[c,r,o]),w.createElement(w.Fragment,null,w.createElement("perspectiveCamera",Mi({ref:c},a),!y&&i),w.createElement("group",{ref:d},y&&i(f.texture)))}),Ff=w.forwardRef(({makeDefault:t,camera:e,regress:n,domElement:r,enableDamping:i=!0,keyEvents:a=!1,onChange:s,onStart:o,onEnd:l,...u},c)=>{const d=zn(T=>T.invalidate),f=zn(T=>T.camera),m=zn(T=>T.gl),g=zn(T=>T.events),y=zn(T=>T.setEvents),v=zn(T=>T.set),b=zn(T=>T.get),E=zn(T=>T.performance),S=e||f,A=r||g.connected||m.domElement,I=w.useMemo(()=>new cCe(S),[S]);return ko(()=>{I.enabled&&I.update()},-1),w.useEffect(()=>(a&&I.connect(a===!0?A:a),I.connect(A),()=>void I.dispose()),[a,A,n,I,d]),w.useEffect(()=>{const T=N=>{d(),n&&E.regress(),s&&s(N)},R=N=>{o&&o(N)},O=N=>{l&&l(N)};return I.addEventListener("change",T),I.addEventListener("start",R),I.addEventListener("end",O),()=>{I.removeEventListener("start",R),I.removeEventListener("end",O),I.removeEventListener("change",T)}},[s,o,l,I,d,y]),w.useEffect(()=>{if(t){const T=b().controls;return v({controls:I}),()=>v({controls:T})}},[t,I]),w.createElement("primitive",Mi({ref:c,object:I,enableDamping:i},u))}),nK=w.forwardRef(({children:t,domElement:e,onChange:n,onMouseDown:r,onMouseUp:i,onObjectChange:a,object:s,makeDefault:o,camera:l,enabled:u,axis:c,mode:d,translationSnap:f,rotationSnap:m,scaleSnap:g,space:y,size:v,showX:b,showY:E,showZ:S,...A},I)=>{const T=zn(fe=>fe.controls),R=zn(fe=>fe.gl),O=zn(fe=>fe.events),N=zn(fe=>fe.camera),M=zn(fe=>fe.invalidate),B=zn(fe=>fe.get),G=zn(fe=>fe.set),W=l||N,K=e||O.connected||R.domElement,se=w.useMemo(()=>new iCe(W,K),[W,K]),ae=w.useRef(null);w.useLayoutEffect(()=>(s?se.attach(s instanceof _n?s:s.current):ae.current instanceof _n&&se.attach(ae.current),()=>void se.detach()),[s,t,se]),w.useEffect(()=>{if(T){const fe=Ce=>T.enabled=!Ce.value;return se.addEventListener("dragging-changed",fe),()=>se.removeEventListener("dragging-changed",fe)}},[se,T]);const ee=w.useRef(),F=w.useRef(),ie=w.useRef(),J=w.useRef();return w.useLayoutEffect(()=>void(ee.current=n),[n]),w.useLayoutEffect(()=>void(F.current=r),[r]),w.useLayoutEffect(()=>void(ie.current=i),[i]),w.useLayoutEffect(()=>void(J.current=a),[a]),w.useEffect(()=>{const fe=ke=>{M(),ee.current==null||ee.current(ke)},Ce=ke=>F.current==null?void 0:F.current(ke),Le=ke=>ie.current==null?void 0:ie.current(ke),j=ke=>J.current==null?void 0:J.current(ke);return se.addEventListener("change",fe),se.addEventListener("mouseDown",Ce),se.addEventListener("mouseUp",Le),se.addEventListener("objectChange",j),()=>{se.removeEventListener("change",fe),se.removeEventListener("mouseDown",Ce),se.removeEventListener("mouseUp",Le),se.removeEventListener("objectChange",j)}},[M,se]),w.useEffect(()=>{if(o){const fe=B().controls;return G({controls:se}),()=>G({controls:fe})}},[o,se]),w.createElement(w.Fragment,null,w.createElement("primitive",{ref:I,object:se,enabled:u,axis:c,mode:d,translationSnap:f,rotationSnap:m,scaleSnap:g,space:y,size:v,showX:b,showY:E,showZ:S}),w.createElement("group",Mi({ref:ae},A),t))});function tRe(t,e,...n){const r=w.useRef(),i=zn(a=>a.scene);return w.useLayoutEffect(()=>{let a;if(t&&t!=null&&t.current&&e&&(r.current=a=new e(t.current,...n)),a)return a.traverse(s=>s.raycast=()=>null),i.add(a),()=>{r.current=void 0,i.remove(a),a.dispose==null||a.dispose()}},[i,e,t,...n]),ko(()=>{var a;return void((a=r.current)==null||a.update==null?void 0:a.update())}),r}const rK=w.forwardRef(function({children:e,disable:n,disableX:r,disableY:i,disableZ:a,left:s,right:o,top:l,bottom:u,front:c,back:d,onCentered:f,precise:m=!0,cacheKey:g=0,...y},v){const b=w.useRef(null),E=w.useRef(null),S=w.useRef(null);return w.useLayoutEffect(()=>{E.current.matrixWorld.identity();const A=new Di().setFromObject(S.current,m),I=new H,T=new Li,R=A.max.x-A.min.x,O=A.max.y-A.min.y,N=A.max.z-A.min.z;A.getCenter(I),A.getBoundingSphere(T);const M=l?O/2:u?-O/2:0,B=s?-R/2:o?R/2:0,G=c?N/2:d?-N/2:0;E.current.position.set(n||r?0:-I.x+B,n||i?0:-I.y+M,n||a?0:-I.z+G),typeof f<"u"&&f({parent:b.current.parent,container:b.current,width:R,height:O,depth:N,boundingBox:A,boundingSphere:T,center:I,verticalAlignment:M,horizontalAlignment:B,depthAlignment:G})},[g,f,l,s,c,n,r,i,a,m,o,u,d]),w.useImperativeHandle(v,()=>b.current,[]),w.createElement("group",Mi({ref:b},y),w.createElement("group",{ref:E},w.createElement("group",{ref:S},e)))}),nRe=3e3,rRe=3001,iRe=QX({},"void main() { }","void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard; }");function iK(t,e){const n=t+"Geometry";return w.forwardRef(({args:r,children:i,...a},s)=>{const o=w.useRef(null);return w.useImperativeHandle(s,()=>o.current),w.useLayoutEffect(()=>void(e==null?void 0:e(o.current))),w.createElement("mesh",Mi({ref:o},a),w.createElement(n,{attach:"geometry",args:r}),i)})}const aK=iK("sphere"),aRe=iK("plane");var Hs=function(t){return t[t.NONE=0]="NONE",t[t.START=1]="START",t[t.ACTIVE=2]="ACTIVE",t}(Hs||{});const Dp=t=>t&&t.isOrthographicCamera,sRe=t=>t&&t.isBox3,oRe=t=>1-Math.exp(-5*t)+.007*t,sK=w.createContext(null);function oK({children:t,maxDuration:e=1,margin:n=1.2,observe:r,fit:i,clip:a,interpolateFunc:s=oRe,onFit:o}){const l=w.useRef(null),{camera:u,size:c,invalidate:d}=zn(),f=zn(I=>I.controls),m=w.useRef(o);m.current=o;const g=w.useRef({camPos:new H,camRot:new Mn,camZoom:1}),y=w.useRef({camPos:void 0,camRot:void 0,camZoom:void 0,camUp:void 0,target:void 0}),v=w.useRef(Hs.NONE),b=w.useRef(0),[E]=w.useState(()=>new Di),S=w.useMemo(()=>{function I(){const T=E.getSize(new H),R=E.getCenter(new H),O=Math.max(T.x,T.y,T.z),N=Dp(u)?O*4:O/(2*Math.atan(Math.PI*u.fov/360)),M=Dp(u)?O*4:N/u.aspect,B=n*Math.max(N,M);return{box:E,size:T,center:R,distance:B}}return{getSize:I,refresh(T){if(sRe(T))E.copy(T);else{const R=T||l.current;if(!R)return this;R.updateWorldMatrix(!0,!0),E.setFromObject(R)}if(E.isEmpty()){const R=u.position.length()||10;E.setFromCenterAndSize(new H,new H(R,R,R))}return g.current.camPos.copy(u.position),g.current.camRot.copy(u.quaternion),Dp(u)&&(g.current.camZoom=u.zoom),y.current.camPos=void 0,y.current.camRot=void 0,y.current.camZoom=void 0,y.current.camUp=void 0,y.current.target=void 0,this},reset(){const{center:T,distance:R}=I(),O=u.position.clone().sub(T).normalize();y.current.camPos=T.clone().addScaledVector(O,R),y.current.target=T.clone();const N=new en().lookAt(y.current.camPos,y.current.target,u.up);return y.current.camRot=new Mn().setFromRotationMatrix(N),v.current=Hs.START,b.current=0,this},moveTo(T){return y.current.camPos=Array.isArray(T)?new H(...T):T.clone(),v.current=Hs.START,b.current=0,this},lookAt({target:T,up:R}){y.current.target=Array.isArray(T)?new H(...T):T.clone(),R?y.current.camUp=Array.isArray(R)?new H(...R):R.clone():y.current.camUp=u.up.clone();const O=new en().lookAt(y.current.camPos||u.position,y.current.target,y.current.camUp);return y.current.camRot=new Mn().setFromRotationMatrix(O),v.current=Hs.START,b.current=0,this},to({position:T,target:R}){return this.moveTo(T).lookAt({target:R})},fit(){if(!Dp(u))return this.reset();let T=0,R=0;const O=[new H(E.min.x,E.min.y,E.min.z),new H(E.min.x,E.max.y,E.min.z),new H(E.min.x,E.min.y,E.max.z),new H(E.min.x,E.max.y,E.max.z),new H(E.max.x,E.max.y,E.max.z),new H(E.max.x,E.max.y,E.min.z),new H(E.max.x,E.min.y,E.max.z),new H(E.max.x,E.min.y,E.min.z)],N=y.current.camPos||u.position,M=y.current.target||(f==null?void 0:f.target),B=y.current.camUp||u.up,G=M?new en().lookAt(N,M,B).setPosition(N).invert():u.matrixWorldInverse;for(const se of O)se.applyMatrix4(G),T=Math.max(T,Math.abs(se.y)),R=Math.max(R,Math.abs(se.x));T*=2,R*=2;const W=(u.top-u.bottom)/T,K=(u.right-u.left)/R;return y.current.camZoom=Math.min(W,K)/n,v.current=Hs.START,b.current=0,m.current&&m.current(this.getSize()),this},clip(){const{distance:T}=I();return u.near=T/100,u.far=T*100,u.updateProjectionMatrix(),f&&(f.maxDistance=T*10,f.update()),d(),this}}},[E,u,f,n,d]);w.useLayoutEffect(()=>{if(f){const I=()=>{if(f&&y.current.target&&v.current!==Hs.NONE){const T=new H().setFromMatrixColumn(u.matrix,2),R=g.current.camPos.distanceTo(f.target),O=(y.current.camPos||g.current.camPos).distanceTo(y.current.target),N=(1-b.current)*R+b.current*O;f.target.copy(u.position).addScaledVector(T,-N),f.update()}v.current=Hs.NONE};return f.addEventListener("start",I),()=>f.removeEventListener("start",I)}},[f]);const A=w.useRef(0);return w.useLayoutEffect(()=>{(r||A.current++===0)&&(S.refresh(),i&&S.reset().fit(),a&&S.clip())},[c,a,i,r,u,f]),ko((I,T)=>{if(v.current===Hs.START)v.current=Hs.ACTIVE,d();else if(v.current===Hs.ACTIVE){if(b.current+=T/e,b.current>=1)y.current.camPos&&u.position.copy(y.current.camPos),y.current.camRot&&u.quaternion.copy(y.current.camRot),y.current.camUp&&u.up.copy(y.current.camUp),y.current.camZoom&&Dp(u)&&(u.zoom=y.current.camZoom),u.updateMatrixWorld(),u.updateProjectionMatrix(),f&&y.current.target&&(f.target.copy(y.current.target),f.update()),v.current=Hs.NONE;else{const R=s(b.current);y.current.camPos&&u.position.lerpVectors(g.current.camPos,y.current.camPos,R),y.current.camRot&&u.quaternion.slerpQuaternions(g.current.camRot,y.current.camRot,R),y.current.camUp&&u.up.set(0,1,0).applyQuaternion(u.quaternion),y.current.camZoom&&Dp(u)&&(u.zoom=(1-R)*g.current.camZoom+R*y.current.camZoom),u.updateMatrixWorld(),u.updateProjectionMatrix()}d()}}),w.createElement("group",{ref:l},w.createElement(sK.Provider,{value:S},t))}function lK(){return w.useContext(sK)}const uK=(t,e,n)=>{let r;switch(t){case as:r=new Uint8ClampedArray(e*n*4);break;case fi:r=new Uint16Array(e*n*4);break;case yl:r=new Uint32Array(e*n*4);break;case $T:r=new Int8Array(e*n*4);break;case WT:r=new Int16Array(e*n*4);break;case Qb:r=new Int32Array(e*n*4);break;case Or:r=new Float32Array(e*n*4);break;default:throw new Error("Unsupported data type")}return r};let ZE;const lRe=(t,e,n,r)=>{if(ZE!==void 0)return ZE;const i=new ki(1,1,r);e.setRenderTarget(i);const a=new Ot(new Vi,new $i({color:16777215}));e.render(a,n),e.setRenderTarget(null);const s=uK(t,i.width,i.height);return e.readRenderTargetPixels(i,0,0,i.width,i.height,s),i.dispose(),a.geometry.dispose(),a.material.dispose(),ZE=s[0]!==0,ZE};class UD{constructor(e){var n,r,i,a,s,o,l,u,c,d,f,m,g,y,v,b;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(S){throw this._renderer.setRenderTarget(null),S}this._renderer.setRenderTarget(null)},this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace=e.colorSpace;const E={format:ri,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:((n=e.renderTargetOptions)===null||n===void 0?void 0:n.anisotropy)!==void 0?(r=e.renderTargetOptions)===null||r===void 0?void 0:r.anisotropy:1,generateMipmaps:((i=e.renderTargetOptions)===null||i===void 0?void 0:i.generateMipmaps)!==void 0?(a=e.renderTargetOptions)===null||a===void 0?void 0:a.generateMipmaps:!1,magFilter:((s=e.renderTargetOptions)===null||s===void 0?void 0:s.magFilter)!==void 0?(o=e.renderTargetOptions)===null||o===void 0?void 0:o.magFilter:Xn,minFilter:((l=e.renderTargetOptions)===null||l===void 0?void 0:l.minFilter)!==void 0?(u=e.renderTargetOptions)===null||u===void 0?void 0:u.minFilter:Xn,samples:((c=e.renderTargetOptions)===null||c===void 0?void 0:c.samples)!==void 0?(d=e.renderTargetOptions)===null||d===void 0?void 0:d.samples:void 0,wrapS:((f=e.renderTargetOptions)===null||f===void 0?void 0:f.wrapS)!==void 0?(m=e.renderTargetOptions)===null||m===void 0?void 0:m.wrapS:ni,wrapT:((g=e.renderTargetOptions)===null||g===void 0?void 0:g.wrapT)!==void 0?(y=e.renderTargetOptions)===null||y===void 0?void 0:y.wrapT:ni};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=UD.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new em,this._camera=new pl,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!lRe(this._type,this._renderer,this._camera,E)){let S;switch(this._type){case fi:S=this._renderer.extensions.has("EXT_color_buffer_float")?Or:void 0;break}S!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${Or}`),this._type=S):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new Ot(new Vi,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new ki(this.width,this.height,E),this._renderTarget.texture.mapping=((v=e.renderTargetOptions)===null||v===void 0?void 0:v.mapping)!==void 0?(b=e.renderTargetOptions)===null||b===void 0?void 0:b.mapping:Tc}static instantiateRenderer(){const e=new aD;return e.setSize(128,128),e}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const e=uK(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){const n=new To(this.toArray(),this.width,this.height,ri,this._type,(e==null?void 0:e.mapping)||Tc,(e==null?void 0:e.wrapS)||ni,(e==null?void 0:e.wrapT)||ni,(e==null?void 0:e.magFilter)||Xn,(e==null?void 0:e.minFilter)||Xn,(e==null?void 0:e.anisotropy)||1,vl);return n.generateMipmaps=(e==null?void 0:e.generateMipmaps)!==void 0?e==null?void 0:e.generateMipmaps:!1,n}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof qi&&Object.values(this.material.uniforms).forEach(n=>{n.value instanceof $n&&n.value.dispose()}),Object.values(this.material).forEach(n=>{n instanceof $n&&n.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}const uRe=` +`;continue}if((ae=se.match(M))&&(K.gamma=parseFloat(ae[1])),(ae=se.match(B))&&(K.exposure=parseFloat(ae[1])),(ae=se.match(G))&&(K.valid|=2,K.format=ae[1]),(ae=se.match(W))&&(K.valid|=4,K.height=parseInt(ae[1],10),K.width=parseInt(ae[2],10)),K.valid&2&&K.valid&4)break}return K.valid&2||s(3,"missing format specifier"),K.valid&4||s(3,"missing image size specifier"),K},m=function(O,N,M){const B=N;if(B<8||B>32767||O[0]!==2||O[1]!==2||O[2]&128)return new Uint8Array(O);B!==(O[2]<<8|O[3])&&s(3,"wrong scanline width");const G=new Uint8Array(4*N*M);G.length||s(4,"unable to allocate buffer space");let W=0,K=0;const se=4*B,ae=new Uint8Array(4),ee=new Uint8Array(se);let F=M;for(;F>0&&KO.byteLength&&s(1),ae[0]=O[K++],ae[1]=O[K++],ae[2]=O[K++],ae[3]=O[K++],(ae[0]!=2||ae[1]!=2||(ae[2]<<8|ae[3])!=B)&&s(3,"bad rgbe scanline format");let ie=0,J;for(;ie128;if(Ce&&(J-=128),(J===0||ie+J>se)&&s(3,"bad scanline data"),Ce){const Le=O[K++];for(let j=0;j>3]&1<<(xe&7))&&(z[oe++]=xe);for(var Re=oe-1;oe<65536;)z[oe++]=0;return Re}function B(P){for(var z=0;z<16384;z++)P[z]={},P[z].len=0,P[z].lit=0,P[z].p=null}const G={l:0,c:0,lc:0};function W(P,z,oe,xe,Re){for(;oe>oe&(1<0;--z){var xe=oe+K[z]>>1;K[z]=oe,oe=xe}for(var z=0;z<65537;++z){var Re=P[z];Re>0&&(P[z]=Re|K[Re]++<<6)}}function ae(P,z,oe,xe,Re,L,X){for(var le=oe,de=0,Q=0;Re<=L;Re++){if(le.value-oe.value>xe)return!1;W(6,de,Q,P,le);var Ee=G.l;if(de=G.c,Q=G.lc,X[Re]=Ee,Ee==63){if(le.value-oe.value>xe)throw"Something wrong with hufUnpackEncTable";W(8,de,Q,P,le);var we=G.l+6;if(de=G.c,Q=G.lc,Re+we>L+1)throw"Something wrong with hufUnpackEncTable";for(;we--;)X[Re++]=0;Re--}else if(Ee>=59){var we=Ee-59+2;if(Re+we>L+1)throw"Something wrong with hufUnpackEncTable";for(;we--;)X[Re++]=0;Re--}}se(X)}function ee(P){return P&63}function F(P){return P>>6}function ie(P,z,oe,xe){for(;z<=oe;z++){var Re=F(P[z]),L=ee(P[z]);if(Re>>L)throw"Invalid table entry";if(L>14){var X=xe[Re>>L-14];if(X.len)throw"Invalid table entry";if(X.lit++,X.p){var le=X.p;X.p=new Array(X.lit);for(var de=0;de0;de--){var X=xe[(Re<<14-L)+Q];if(X.len||X.p)throw"Invalid table entry";X.len=L,X.lit=z,Q++}}return!0}const J={c:0,lc:0};function fe(P,z,oe,xe){P=P<<8|bt(oe,xe),z+=8,J.c=P,J.lc=z}const Ce={c:0,lc:0};function Le(P,z,oe,xe,Re,L,X,le,de,Q){if(P==z){xe<8&&(fe(oe,xe,Re,X),oe=J.c,xe=J.lc),xe-=8;var Ee=oe>>xe,Ee=new Uint8Array([Ee])[0];if(de.value+Ee>Q)return!1;for(var we=le[de.value-1];Ee-- >0;)le[de.value++]=we}else if(de.value32767?z-65536:z}const Fe={a:0,b:0};function Ye(P,z){var oe=ke(P),xe=ke(z),Re=xe,L=oe+(Re&1)+(Re>>1),X=L,le=L-Re;Fe.a=X,Fe.b=le}function gt(P,z){var oe=j(P),xe=j(z),Re=oe-(xe>>1)&65535,L=xe+Re-32768&65535;Fe.a=L,Fe.b=Re}function Gt(P,z,oe,xe,Re,L,X){for(var le=X<16384,de=oe>Re?Re:oe,Q=1,Ee;Q<=de;)Q<<=1;for(Q>>=1,Ee=Q,Q>>=1;Q>=1;){for(var we=0,at=we+L*(Re-Ee),Ve=L*Q,Qe=L*Ee,lt=xe*Q,Ue=xe*Ee,ct,Bt,wt,Tt;we<=at;we+=Qe){for(var Nt=we,pt=we+xe*(oe-Ee);Nt<=pt;Nt+=Ue){var nn=Nt+lt,Zt=Nt+Ve,ir=Zt+lt;le?(Ye(P[Nt+z],P[Zt+z]),ct=Fe.a,wt=Fe.b,Ye(P[nn+z],P[ir+z]),Bt=Fe.a,Tt=Fe.b,Ye(ct,Bt),P[Nt+z]=Fe.a,P[nn+z]=Fe.b,Ye(wt,Tt),P[Zt+z]=Fe.a,P[ir+z]=Fe.b):(gt(P[Nt+z],P[Zt+z]),ct=Fe.a,wt=Fe.b,gt(P[nn+z],P[ir+z]),Bt=Fe.a,Tt=Fe.b,gt(ct,Bt),P[Nt+z]=Fe.a,P[nn+z]=Fe.b,gt(wt,Tt),P[Zt+z]=Fe.a,P[ir+z]=Fe.b)}if(oe&Q){var Zt=Nt+Ve;le?Ye(P[Nt+z],P[Zt+z]):gt(P[Nt+z],P[Zt+z]),ct=Fe.a,P[Zt+z]=Fe.b,P[Nt+z]=ct}}if(Re&Q)for(var Nt=we,pt=we+xe*(oe-Ee);Nt<=pt;Nt+=Ue){var nn=Nt+lt;le?Ye(P[Nt+z],P[nn+z]):gt(P[Nt+z],P[nn+z]),ct=Fe.a,P[nn+z]=Fe.b,P[Nt+z]=ct}Ee=Q,Q>>=1}return we}function Ut(P,z,oe,xe,Re,L,X,le,de,Q){for(var Ee=0,we=0,at=le,Ve=Math.trunc(Re.value+(L+7)/8);Re.value=14;){var Qe=Ee>>we-14&16383,lt=z[Qe];if(lt.len)we-=lt.len,Le(lt.lit,X,Ee,we,oe,xe,Re,de,Q,at),Ee=Ce.c,we=Ce.lc;else{if(!lt.p)throw"hufDecode issues";var Ue;for(Ue=0;Ue=ct&&F(P[lt.p[Ue]])==(Ee>>we-ct&(1<>=Bt,we-=Bt;we>0;){var lt=z[Ee<<14-we&16383];if(lt.len)we-=lt.len,Le(lt.lit,X,Ee,we,oe,xe,Re,de,Q,at),Ee=Ce.c,we=Ce.lc;else throw"hufDecode issues"}return!0}function Mt(P,z,oe,xe,Re,L){var X={value:0},le=oe.value,de=Dt(z,oe),Q=Dt(z,oe);oe.value+=4;var Ee=Dt(z,oe);if(oe.value+=4,de<0||de>=65537||Q<0||Q>=65537)throw"Something wrong with HUF_ENCSIZE";var we=new Array(65537),at=new Array(16384);B(at);var Ve=xe-(oe.value-le);if(ae(P,z,oe,Ve,de,Q,we),Ee>8*(xe-(oe.value-le)))throw"Something wrong with hufUncompress";ie(we,de,Q,at),Ut(we,at,P,z,oe,Ee,Q,L,Re,X)}function $e(P,z,oe){for(var xe=0;xeL||(z[Re++]=P[oe++],Re>L));)z[Re++]=P[xe++]}function At(P){for(var z=P.byteLength,oe=new Array,xe=0,Re=new DataView(P);z>0;){var L=Re.getInt8(xe++);if(L<0){var X=-L;z-=X+1;for(var le=0;le>8==255?Re+=xe&255:(oe[Re]=xe,Re++),P.value++}function ot(P,z){z[0]=Te(P[0]),z[1]=Te(P[1]),z[2]=Te(P[5]),z[3]=Te(P[6]),z[4]=Te(P[14]),z[5]=Te(P[15]),z[6]=Te(P[27]),z[7]=Te(P[28]),z[8]=Te(P[2]),z[9]=Te(P[4]),z[10]=Te(P[7]),z[11]=Te(P[13]),z[12]=Te(P[16]),z[13]=Te(P[26]),z[14]=Te(P[29]),z[15]=Te(P[42]),z[16]=Te(P[3]),z[17]=Te(P[8]),z[18]=Te(P[12]),z[19]=Te(P[17]),z[20]=Te(P[25]),z[21]=Te(P[30]),z[22]=Te(P[41]),z[23]=Te(P[43]),z[24]=Te(P[9]),z[25]=Te(P[11]),z[26]=Te(P[18]),z[27]=Te(P[24]),z[28]=Te(P[31]),z[29]=Te(P[40]),z[30]=Te(P[44]),z[31]=Te(P[53]),z[32]=Te(P[10]),z[33]=Te(P[19]),z[34]=Te(P[23]),z[35]=Te(P[32]),z[36]=Te(P[39]),z[37]=Te(P[45]),z[38]=Te(P[52]),z[39]=Te(P[54]),z[40]=Te(P[20]),z[41]=Te(P[22]),z[42]=Te(P[33]),z[43]=Te(P[38]),z[44]=Te(P[46]),z[45]=Te(P[51]),z[46]=Te(P[55]),z[47]=Te(P[60]),z[48]=Te(P[21]),z[49]=Te(P[34]),z[50]=Te(P[37]),z[51]=Te(P[47]),z[52]=Te(P[50]),z[53]=Te(P[56]),z[54]=Te(P[59]),z[55]=Te(P[61]),z[56]=Te(P[35]),z[57]=Te(P[36]),z[58]=Te(P[48]),z[59]=Te(P[49]),z[60]=Te(P[57]),z[61]=Te(P[58]),z[62]=Te(P[62]),z[63]=Te(P[63])}function Vt(P){const z=.5*Math.cos(.7853975),oe=.5*Math.cos(3.14159/16),xe=.5*Math.cos(3.14159/8),Re=.5*Math.cos(3*3.14159/16),L=.5*Math.cos(5*3.14159/16),X=.5*Math.cos(3*3.14159/8),le=.5*Math.cos(7*3.14159/16);for(var de=new Array(4),Q=new Array(4),Ee=new Array(4),we=new Array(4),at=0;at<8;++at){var Ve=at*8;de[0]=xe*P[Ve+2],de[1]=X*P[Ve+2],de[2]=xe*P[Ve+6],de[3]=X*P[Ve+6],Q[0]=oe*P[Ve+1]+Re*P[Ve+3]+L*P[Ve+5]+le*P[Ve+7],Q[1]=Re*P[Ve+1]-le*P[Ve+3]-oe*P[Ve+5]-L*P[Ve+7],Q[2]=L*P[Ve+1]-oe*P[Ve+3]+le*P[Ve+5]+Re*P[Ve+7],Q[3]=le*P[Ve+1]-L*P[Ve+3]+Re*P[Ve+5]-oe*P[Ve+7],Ee[0]=z*(P[Ve+0]+P[Ve+4]),Ee[3]=z*(P[Ve+0]-P[Ve+4]),Ee[1]=de[0]+de[3],Ee[2]=de[1]-de[2],we[0]=Ee[0]+Ee[1],we[1]=Ee[3]+Ee[2],we[2]=Ee[3]-Ee[2],we[3]=Ee[0]-Ee[1],P[Ve+0]=we[0]+Q[0],P[Ve+1]=we[1]+Q[1],P[Ve+2]=we[2]+Q[2],P[Ve+3]=we[3]+Q[3],P[Ve+4]=we[3]-Q[3],P[Ve+5]=we[2]-Q[2],P[Ve+6]=we[1]-Q[1],P[Ve+7]=we[0]-Q[0]}for(var Qe=0;Qe<8;++Qe)de[0]=xe*P[16+Qe],de[1]=X*P[16+Qe],de[2]=xe*P[48+Qe],de[3]=X*P[48+Qe],Q[0]=oe*P[8+Qe]+Re*P[24+Qe]+L*P[40+Qe]+le*P[56+Qe],Q[1]=Re*P[8+Qe]-le*P[24+Qe]-oe*P[40+Qe]-L*P[56+Qe],Q[2]=L*P[8+Qe]-oe*P[24+Qe]+le*P[40+Qe]+Re*P[56+Qe],Q[3]=le*P[8+Qe]-L*P[24+Qe]+Re*P[40+Qe]-oe*P[56+Qe],Ee[0]=z*(P[Qe]+P[32+Qe]),Ee[3]=z*(P[Qe]-P[32+Qe]),Ee[1]=de[0]+de[3],Ee[2]=de[1]-de[2],we[0]=Ee[0]+Ee[1],we[1]=Ee[3]+Ee[2],we[2]=Ee[3]-Ee[2],we[3]=Ee[0]-Ee[1],P[0+Qe]=we[0]+Q[0],P[8+Qe]=we[1]+Q[1],P[16+Qe]=we[2]+Q[2],P[24+Qe]=we[3]+Q[3],P[32+Qe]=we[3]-Q[3],P[40+Qe]=we[2]-Q[2],P[48+Qe]=we[1]-Q[1],P[56+Qe]=we[0]-Q[0]}function yt(P){for(var z=0;z<64;++z){var oe=P[0][z],xe=P[1][z],Re=P[2][z];P[0][z]=oe+1.5747*Re,P[1][z]=oe-.1873*xe-.4682*Re,P[2][z]=oe+1.8556*xe}}function q(P,z,oe){for(var xe=0;xe<64;++xe)z[oe+xe]=zd.toHalfFloat(U(P[xe]))}function U(P){return P<=1?Math.sign(P)*Math.pow(Math.abs(P),2.2):Math.sign(P)*Math.pow(N,Math.abs(P)-1)}function ue(P){return new DataView(P.array.buffer,P.offset.value,P.size)}function _e(P){var z=P.viewer.buffer.slice(P.offset.value,P.offset.value+P.size),oe=new Uint8Array(At(z)),xe=new Uint8Array(oe.length);return qe(oe),re(oe,xe),new DataView(xe.buffer)}function Ge(P){var z=P.array.slice(P.offset.value,P.offset.value+P.size),oe=YE(z),xe=new Uint8Array(oe.length);return qe(oe),re(oe,xe),new DataView(xe.buffer)}function Pe(P){for(var z=P.viewer,oe={value:P.offset.value},xe=new Uint16Array(P.width*P.scanlineBlockSize*(P.channels*P.type)),Re=new Uint8Array(8192),L=0,X=new Array(P.channels),le=0;le=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(de<=Q)for(var le=0;le0;){var le=ht(z.buffer,oe),de=me(z,oe),Q=de>>2&3,Ee=(de>>4)-1,we=new Int8Array([Ee])[0],at=me(z,oe);L.push({name:le,index:we,type:at,compression:Q}),X-=le.length+3}for(var Ve=Kt.channels,Qe=new Array(P.channels),lt=0;lt=0&&(Bt.idx[Tt.index]=wt),Ue.offset=wt)}if(Re.acCompressedSize>0)switch(Re.acCompression){case 0:var nn=new Uint16Array(Re.totalAcUncompressedCount);Mt(P.array,z,oe,Re.acCompressedSize,nn,Re.totalAcUncompressedCount);break;case 1:var Nt=P.array.slice(oe.value,oe.value+Re.totalAcUncompressedCount),pt=YE(Nt),nn=new Uint16Array(pt.buffer);oe.value+=Re.totalAcUncompressedCount;break}if(Re.dcCompressedSize>0){var Zt={array:P.array,offset:oe,size:Re.dcCompressedSize},ir=new Uint16Array(Ge(Zt).buffer);oe.value+=Re.dcCompressedSize}if(Re.rleRawSize>0){var Nt=P.array.slice(oe.value,oe.value+Re.rleCompressedSize),pt=YE(Nt),ar=At(pt.buffer);oe.value+=Re.rleCompressedSize}for(var Wn=0,Rn=new Array(Qe.length),lt=0;lt>10,oe=P&1023;return(P>>15?-1:1)*(z?z===31?oe?NaN:1/0:Math.pow(2,z-15)*(1+oe/1024):6103515625e-14*(oe/1024))}function Me(P,z){var oe=P.getUint16(z.value,!0);return z.value+=2,oe}function Xe(P,z){return Te(Me(P,z))}function _t(P,z,oe,xe){for(var Re=oe.value,L=[];oe.valueet.height?et.height-z:et.scanlineBlockSize;const xe=et.size=et.height)break;for(let X=0;X{const o={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(s,o).then(n).catch(i)},r,i)}decodeDracoFile(e,n,r,i){const a={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,a).then(n)}decodeGeometry(e,n){for(const l in n.attributeTypes){const u=n.attributeTypes[l];u.BYTES_PER_ELEMENT!==void 0&&(n.attributeTypes[l]=u.name)}const r=JSON.stringify(n);if(bR.has(e)){const l=bR.get(e);if(l.key===r)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const a=this.workerNextTaskID++,s=e.byteLength,o=this._getWorker(a,s).then(l=>(i=l,new Promise((u,c)=>{i._callbacks[a]={resolve:u,reject:c},i.postMessage({type:"decode",id:a,taskConfig:n,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return o.catch(()=>!0).then(()=>{i&&a&&this._releaseTask(i,a)}),bR.set(e,{key:r,promise:o}),o}_createGeometry(e){const n=new fn;e.index&&n.setIndex(new Kn(e.index.array,1));for(let r=0;r{r.load(e,i,void 0,a)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",n=[];return e?n.push(this._loadLibrary("draco_decoder.js","text")):(n.push(this._loadLibrary("draco_wasm_wrapper.js","text")),n.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(n).then(r=>{const i=r[0];e||(this.decoderConfig.wasmBinary=r[1]);const a=ZCe.toString(),s=["/* draco decoder */",i,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(` +`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,n){return this._initDecoder().then(()=>{if(this.workerPool.lengtha._taskLoad?-1:1});const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=n,r._taskLoad+=n,r})}_releaseTask(e,n){e._taskLoad-=e._taskCosts[n],delete e._callbacks[n],delete e._taskCosts[n]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const d=c.draco,f=new d.Decoder,m=new d.DecoderBuffer;m.Init(new Int8Array(l),l.byteLength);try{const g=n(d,f,m,u),y=g.attributes.map(v=>v.array.buffer);g.index&&y.push(g.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:g},y)}catch(g){console.error(g),self.postMessage({type:"error",id:o.id,error:g.message})}finally{d.destroy(m),d.destroy(f)}});break}};function n(s,o,l,u){const c=u.attributeIDs,d=u.attributeTypes;let f,m;const g=o.GetEncodedGeometryType(l);if(g===s.TRIANGULAR_MESH)f=new s.Mesh,m=o.DecodeBufferToMesh(l,f);else if(g===s.POINT_CLOUD)f=new s.PointCloud,m=o.DecodeBufferToPointCloud(l,f);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!m.ok()||f.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+m.error_msg());const y={index:null,attributes:[]};for(const v in c){const b=self[d[v]];let E,_;if(u.useUniqueIDs)_=c[v],E=o.GetAttributeByUniqueId(f,_);else{if(_=o.GetAttributeId(f,s[c[v]]),_===-1)continue;E=o.GetAttribute(f,_)}y.attributes.push(i(s,o,f,v,b,E))}return g===s.TRIANGULAR_MESH&&(y.index=r(s,o,f)),s.destroy(f),y}function r(s,o,l){const c=l.num_faces()*3,d=c*4,f=s._malloc(d);o.GetTrianglesUInt32Array(l,d,f);const m=new Uint32Array(s.HEAPF32.buffer,f,c).slice();return s._free(f),{array:m,itemSize:1}}function i(s,o,l,u,c,d){const f=d.num_components(),g=l.num_points()*f,y=g*c.BYTES_PER_ELEMENT,v=a(s,c),b=s._malloc(y);o.GetAttributeDataArrayForAllPoints(l,d,v,y,b);const E=new c(s.HEAPF32.buffer,b,g).slice();return s._free(b),{name:u,array:E,itemSize:f}}function a(s,o){switch(o){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}let XE;const yR=()=>{if(XE)return XE;const t="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let i=t;WebAssembly.validate(n)&&(i=e);let a;const s=WebAssembly.instantiate(o(i),{}).then(d=>{a=d.instance,a.exports.__wasm_call_ctors()});function o(d){const f=new Uint8Array(d.length);for(let g=0;g96?y-71:y>64?y-65:y>47?y+4:y>46?63:62}let m=0;for(let g=0;g{const d=nD.clone({[u]:{value:c}});return{...l,...d}},{}),vertexShader:e,fragmentShader:n}),this.key="",o.forEach(([l])=>Object.defineProperty(this,l,{get:()=>this.uniforms[l].value,set:u=>this.uniforms[l].value=u})),Object.assign(this,s)}};return i.key=bc.generateUUID(),i}const vR=t=>t===Object(t)&&!Array.isArray(t)&&typeof t!="function";function AT(t,e){const n=zn(a=>a.gl),r=io(cy,vR(t)?Object.values(t):t);return w.useLayoutEffect(()=>{e==null||e(r)},[e]),w.useEffect(()=>{if("initTexture"in n){let a=[];Array.isArray(r)?a=r:r instanceof $n?a=[r]:vR(r)&&(a=Object.values(r)),a.forEach(s=>{s instanceof $n&&n.initTexture(s)})}},[n,r]),w.useMemo(()=>{if(vR(t)){const a={};let s=0;for(const o in t)a[o]=r[s++];return a}else return r},[t,r])}AT.preload=t=>io.preload(cy,t);AT.clear=t=>io.clear(cy,t);const QCe=()=>parseInt(Of.replace(/\D+/g,"")),JX=QCe();let KE=null,eK="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function tK(t=!0,e=!0,n){return r=>{n&&n(r),t&&(KE||(KE=new KCe),KE.setDecoderPath(typeof t=="string"?t:eK),r.setDRACOLoader(KE)),e&&r.setMeshoptDecoder(typeof yR=="function"?yR():yR)}}const xT=(t,e,n,r)=>io(FD,t,tK(e,n,r));xT.preload=(t,e,n,r)=>io.preload(FD,t,tK(e,n,r));xT.clear=t=>io.clear(FD,t);xT.setDecoderPath=t=>{eK=t};function JCe(t,e,n){const r=zn(f=>f.size),i=zn(f=>f.viewport),a=typeof t=="number"?t:r.width*i.dpr,s=r.height*i.dpr,o=(typeof t=="number"?n:t)||{},{samples:l=0,depth:u,...c}=o,d=w.useMemo(()=>{const f=new ki(a,s,{minFilter:Xn,magFilter:Xn,type:fi,...c});return u&&(f.depthTexture=new Qx(a,s,Or)),f.samples=l,f},[]);return w.useLayoutEffect(()=>{d.setSize(a,s),l&&(d.samples=l)},[l,d,a,s]),w.useEffect(()=>()=>d.dispose(),[]),d}const eRe=t=>typeof t=="function",my=w.forwardRef(({envMap:t,resolution:e=256,frames:n=1/0,makeDefault:r,children:i,...a},s)=>{const o=zn(({set:v})=>v),l=zn(({camera:v})=>v),u=zn(({size:v})=>v),c=w.useRef(null);w.useImperativeHandle(s,()=>c.current,[]);const d=w.useRef(null),f=JCe(e);w.useLayoutEffect(()=>{a.manual||(c.current.aspect=u.width/u.height)},[u,a]),w.useLayoutEffect(()=>{c.current.updateProjectionMatrix()});let m=0,g=null;const y=eRe(i);return ko(v=>{y&&(n===1/0||m{if(r){const v=l;return o(()=>({camera:c.current})),()=>o(()=>({camera:v}))}},[c,r,o]),w.createElement(w.Fragment,null,w.createElement("perspectiveCamera",Mi({ref:c},a),!y&&i),w.createElement("group",{ref:d},y&&i(f.texture)))}),Ff=w.forwardRef(({makeDefault:t,camera:e,regress:n,domElement:r,enableDamping:i=!0,keyEvents:a=!1,onChange:s,onStart:o,onEnd:l,...u},c)=>{const d=zn(x=>x.invalidate),f=zn(x=>x.camera),m=zn(x=>x.gl),g=zn(x=>x.events),y=zn(x=>x.setEvents),v=zn(x=>x.set),b=zn(x=>x.get),E=zn(x=>x.performance),_=e||f,A=r||g.connected||m.domElement,I=w.useMemo(()=>new cCe(_),[_]);return ko(()=>{I.enabled&&I.update()},-1),w.useEffect(()=>(a&&I.connect(a===!0?A:a),I.connect(A),()=>void I.dispose()),[a,A,n,I,d]),w.useEffect(()=>{const x=N=>{d(),n&&E.regress(),s&&s(N)},R=N=>{o&&o(N)},O=N=>{l&&l(N)};return I.addEventListener("change",x),I.addEventListener("start",R),I.addEventListener("end",O),()=>{I.removeEventListener("start",R),I.removeEventListener("end",O),I.removeEventListener("change",x)}},[s,o,l,I,d,y]),w.useEffect(()=>{if(t){const x=b().controls;return v({controls:I}),()=>v({controls:x})}},[t,I]),w.createElement("primitive",Mi({ref:c,object:I,enableDamping:i},u))}),nK=w.forwardRef(({children:t,domElement:e,onChange:n,onMouseDown:r,onMouseUp:i,onObjectChange:a,object:s,makeDefault:o,camera:l,enabled:u,axis:c,mode:d,translationSnap:f,rotationSnap:m,scaleSnap:g,space:y,size:v,showX:b,showY:E,showZ:_,...A},I)=>{const x=zn(fe=>fe.controls),R=zn(fe=>fe.gl),O=zn(fe=>fe.events),N=zn(fe=>fe.camera),M=zn(fe=>fe.invalidate),B=zn(fe=>fe.get),G=zn(fe=>fe.set),W=l||N,K=e||O.connected||R.domElement,se=w.useMemo(()=>new iCe(W,K),[W,K]),ae=w.useRef(null);w.useLayoutEffect(()=>(s?se.attach(s instanceof Sn?s:s.current):ae.current instanceof Sn&&se.attach(ae.current),()=>void se.detach()),[s,t,se]),w.useEffect(()=>{if(x){const fe=Ce=>x.enabled=!Ce.value;return se.addEventListener("dragging-changed",fe),()=>se.removeEventListener("dragging-changed",fe)}},[se,x]);const ee=w.useRef(),F=w.useRef(),ie=w.useRef(),J=w.useRef();return w.useLayoutEffect(()=>void(ee.current=n),[n]),w.useLayoutEffect(()=>void(F.current=r),[r]),w.useLayoutEffect(()=>void(ie.current=i),[i]),w.useLayoutEffect(()=>void(J.current=a),[a]),w.useEffect(()=>{const fe=ke=>{M(),ee.current==null||ee.current(ke)},Ce=ke=>F.current==null?void 0:F.current(ke),Le=ke=>ie.current==null?void 0:ie.current(ke),j=ke=>J.current==null?void 0:J.current(ke);return se.addEventListener("change",fe),se.addEventListener("mouseDown",Ce),se.addEventListener("mouseUp",Le),se.addEventListener("objectChange",j),()=>{se.removeEventListener("change",fe),se.removeEventListener("mouseDown",Ce),se.removeEventListener("mouseUp",Le),se.removeEventListener("objectChange",j)}},[M,se]),w.useEffect(()=>{if(o){const fe=B().controls;return G({controls:se}),()=>G({controls:fe})}},[o,se]),w.createElement(w.Fragment,null,w.createElement("primitive",{ref:I,object:se,enabled:u,axis:c,mode:d,translationSnap:f,rotationSnap:m,scaleSnap:g,space:y,size:v,showX:b,showY:E,showZ:_}),w.createElement("group",Mi({ref:ae},A),t))});function tRe(t,e,...n){const r=w.useRef(),i=zn(a=>a.scene);return w.useLayoutEffect(()=>{let a;if(t&&t!=null&&t.current&&e&&(r.current=a=new e(t.current,...n)),a)return a.traverse(s=>s.raycast=()=>null),i.add(a),()=>{r.current=void 0,i.remove(a),a.dispose==null||a.dispose()}},[i,e,t,...n]),ko(()=>{var a;return void((a=r.current)==null||a.update==null?void 0:a.update())}),r}const rK=w.forwardRef(function({children:e,disable:n,disableX:r,disableY:i,disableZ:a,left:s,right:o,top:l,bottom:u,front:c,back:d,onCentered:f,precise:m=!0,cacheKey:g=0,...y},v){const b=w.useRef(null),E=w.useRef(null),_=w.useRef(null);return w.useLayoutEffect(()=>{E.current.matrixWorld.identity();const A=new Di().setFromObject(_.current,m),I=new H,x=new Li,R=A.max.x-A.min.x,O=A.max.y-A.min.y,N=A.max.z-A.min.z;A.getCenter(I),A.getBoundingSphere(x);const M=l?O/2:u?-O/2:0,B=s?-R/2:o?R/2:0,G=c?N/2:d?-N/2:0;E.current.position.set(n||r?0:-I.x+B,n||i?0:-I.y+M,n||a?0:-I.z+G),typeof f<"u"&&f({parent:b.current.parent,container:b.current,width:R,height:O,depth:N,boundingBox:A,boundingSphere:x,center:I,verticalAlignment:M,horizontalAlignment:B,depthAlignment:G})},[g,f,l,s,c,n,r,i,a,m,o,u,d]),w.useImperativeHandle(v,()=>b.current,[]),w.createElement("group",Mi({ref:b},y),w.createElement("group",{ref:E},w.createElement("group",{ref:_},e)))}),nRe=3e3,rRe=3001,iRe=QX({},"void main() { }","void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard; }");function iK(t,e){const n=t+"Geometry";return w.forwardRef(({args:r,children:i,...a},s)=>{const o=w.useRef(null);return w.useImperativeHandle(s,()=>o.current),w.useLayoutEffect(()=>void(e==null?void 0:e(o.current))),w.createElement("mesh",Mi({ref:o},a),w.createElement(n,{attach:"geometry",args:r}),i)})}const aK=iK("sphere"),aRe=iK("plane");var Hs=function(t){return t[t.NONE=0]="NONE",t[t.START=1]="START",t[t.ACTIVE=2]="ACTIVE",t}(Hs||{});const Dp=t=>t&&t.isOrthographicCamera,sRe=t=>t&&t.isBox3,oRe=t=>1-Math.exp(-5*t)+.007*t,sK=w.createContext(null);function oK({children:t,maxDuration:e=1,margin:n=1.2,observe:r,fit:i,clip:a,interpolateFunc:s=oRe,onFit:o}){const l=w.useRef(null),{camera:u,size:c,invalidate:d}=zn(),f=zn(I=>I.controls),m=w.useRef(o);m.current=o;const g=w.useRef({camPos:new H,camRot:new Mn,camZoom:1}),y=w.useRef({camPos:void 0,camRot:void 0,camZoom:void 0,camUp:void 0,target:void 0}),v=w.useRef(Hs.NONE),b=w.useRef(0),[E]=w.useState(()=>new Di),_=w.useMemo(()=>{function I(){const x=E.getSize(new H),R=E.getCenter(new H),O=Math.max(x.x,x.y,x.z),N=Dp(u)?O*4:O/(2*Math.atan(Math.PI*u.fov/360)),M=Dp(u)?O*4:N/u.aspect,B=n*Math.max(N,M);return{box:E,size:x,center:R,distance:B}}return{getSize:I,refresh(x){if(sRe(x))E.copy(x);else{const R=x||l.current;if(!R)return this;R.updateWorldMatrix(!0,!0),E.setFromObject(R)}if(E.isEmpty()){const R=u.position.length()||10;E.setFromCenterAndSize(new H,new H(R,R,R))}return g.current.camPos.copy(u.position),g.current.camRot.copy(u.quaternion),Dp(u)&&(g.current.camZoom=u.zoom),y.current.camPos=void 0,y.current.camRot=void 0,y.current.camZoom=void 0,y.current.camUp=void 0,y.current.target=void 0,this},reset(){const{center:x,distance:R}=I(),O=u.position.clone().sub(x).normalize();y.current.camPos=x.clone().addScaledVector(O,R),y.current.target=x.clone();const N=new en().lookAt(y.current.camPos,y.current.target,u.up);return y.current.camRot=new Mn().setFromRotationMatrix(N),v.current=Hs.START,b.current=0,this},moveTo(x){return y.current.camPos=Array.isArray(x)?new H(...x):x.clone(),v.current=Hs.START,b.current=0,this},lookAt({target:x,up:R}){y.current.target=Array.isArray(x)?new H(...x):x.clone(),R?y.current.camUp=Array.isArray(R)?new H(...R):R.clone():y.current.camUp=u.up.clone();const O=new en().lookAt(y.current.camPos||u.position,y.current.target,y.current.camUp);return y.current.camRot=new Mn().setFromRotationMatrix(O),v.current=Hs.START,b.current=0,this},to({position:x,target:R}){return this.moveTo(x).lookAt({target:R})},fit(){if(!Dp(u))return this.reset();let x=0,R=0;const O=[new H(E.min.x,E.min.y,E.min.z),new H(E.min.x,E.max.y,E.min.z),new H(E.min.x,E.min.y,E.max.z),new H(E.min.x,E.max.y,E.max.z),new H(E.max.x,E.max.y,E.max.z),new H(E.max.x,E.max.y,E.min.z),new H(E.max.x,E.min.y,E.max.z),new H(E.max.x,E.min.y,E.min.z)],N=y.current.camPos||u.position,M=y.current.target||(f==null?void 0:f.target),B=y.current.camUp||u.up,G=M?new en().lookAt(N,M,B).setPosition(N).invert():u.matrixWorldInverse;for(const se of O)se.applyMatrix4(G),x=Math.max(x,Math.abs(se.y)),R=Math.max(R,Math.abs(se.x));x*=2,R*=2;const W=(u.top-u.bottom)/x,K=(u.right-u.left)/R;return y.current.camZoom=Math.min(W,K)/n,v.current=Hs.START,b.current=0,m.current&&m.current(this.getSize()),this},clip(){const{distance:x}=I();return u.near=x/100,u.far=x*100,u.updateProjectionMatrix(),f&&(f.maxDistance=x*10,f.update()),d(),this}}},[E,u,f,n,d]);w.useLayoutEffect(()=>{if(f){const I=()=>{if(f&&y.current.target&&v.current!==Hs.NONE){const x=new H().setFromMatrixColumn(u.matrix,2),R=g.current.camPos.distanceTo(f.target),O=(y.current.camPos||g.current.camPos).distanceTo(y.current.target),N=(1-b.current)*R+b.current*O;f.target.copy(u.position).addScaledVector(x,-N),f.update()}v.current=Hs.NONE};return f.addEventListener("start",I),()=>f.removeEventListener("start",I)}},[f]);const A=w.useRef(0);return w.useLayoutEffect(()=>{(r||A.current++===0)&&(_.refresh(),i&&_.reset().fit(),a&&_.clip())},[c,a,i,r,u,f]),ko((I,x)=>{if(v.current===Hs.START)v.current=Hs.ACTIVE,d();else if(v.current===Hs.ACTIVE){if(b.current+=x/e,b.current>=1)y.current.camPos&&u.position.copy(y.current.camPos),y.current.camRot&&u.quaternion.copy(y.current.camRot),y.current.camUp&&u.up.copy(y.current.camUp),y.current.camZoom&&Dp(u)&&(u.zoom=y.current.camZoom),u.updateMatrixWorld(),u.updateProjectionMatrix(),f&&y.current.target&&(f.target.copy(y.current.target),f.update()),v.current=Hs.NONE;else{const R=s(b.current);y.current.camPos&&u.position.lerpVectors(g.current.camPos,y.current.camPos,R),y.current.camRot&&u.quaternion.slerpQuaternions(g.current.camRot,y.current.camRot,R),y.current.camUp&&u.up.set(0,1,0).applyQuaternion(u.quaternion),y.current.camZoom&&Dp(u)&&(u.zoom=(1-R)*g.current.camZoom+R*y.current.camZoom),u.updateMatrixWorld(),u.updateProjectionMatrix()}d()}}),w.createElement("group",{ref:l},w.createElement(sK.Provider,{value:_},t))}function lK(){return w.useContext(sK)}const uK=(t,e,n)=>{let r;switch(t){case as:r=new Uint8ClampedArray(e*n*4);break;case fi:r=new Uint16Array(e*n*4);break;case yl:r=new Uint32Array(e*n*4);break;case $x:r=new Int8Array(e*n*4);break;case Wx:r=new Int16Array(e*n*4);break;case Qb:r=new Int32Array(e*n*4);break;case Or:r=new Float32Array(e*n*4);break;default:throw new Error("Unsupported data type")}return r};let ZE;const lRe=(t,e,n,r)=>{if(ZE!==void 0)return ZE;const i=new ki(1,1,r);e.setRenderTarget(i);const a=new Ot(new Vi,new $i({color:16777215}));e.render(a,n),e.setRenderTarget(null);const s=uK(t,i.width,i.height);return e.readRenderTargetPixels(i,0,0,i.width,i.height,s),i.dispose(),a.geometry.dispose(),a.material.dispose(),ZE=s[0]!==0,ZE};class UD{constructor(e){var n,r,i,a,s,o,l,u,c,d,f,m,g,y,v,b;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(_){throw this._renderer.setRenderTarget(null),_}this._renderer.setRenderTarget(null)},this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace=e.colorSpace;const E={format:ri,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:((n=e.renderTargetOptions)===null||n===void 0?void 0:n.anisotropy)!==void 0?(r=e.renderTargetOptions)===null||r===void 0?void 0:r.anisotropy:1,generateMipmaps:((i=e.renderTargetOptions)===null||i===void 0?void 0:i.generateMipmaps)!==void 0?(a=e.renderTargetOptions)===null||a===void 0?void 0:a.generateMipmaps:!1,magFilter:((s=e.renderTargetOptions)===null||s===void 0?void 0:s.magFilter)!==void 0?(o=e.renderTargetOptions)===null||o===void 0?void 0:o.magFilter:Xn,minFilter:((l=e.renderTargetOptions)===null||l===void 0?void 0:l.minFilter)!==void 0?(u=e.renderTargetOptions)===null||u===void 0?void 0:u.minFilter:Xn,samples:((c=e.renderTargetOptions)===null||c===void 0?void 0:c.samples)!==void 0?(d=e.renderTargetOptions)===null||d===void 0?void 0:d.samples:void 0,wrapS:((f=e.renderTargetOptions)===null||f===void 0?void 0:f.wrapS)!==void 0?(m=e.renderTargetOptions)===null||m===void 0?void 0:m.wrapS:ni,wrapT:((g=e.renderTargetOptions)===null||g===void 0?void 0:g.wrapT)!==void 0?(y=e.renderTargetOptions)===null||y===void 0?void 0:y.wrapT:ni};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=UD.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new em,this._camera=new pl,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!lRe(this._type,this._renderer,this._camera,E)){let _;switch(this._type){case fi:_=this._renderer.extensions.has("EXT_color_buffer_float")?Or:void 0;break}_!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${Or}`),this._type=_):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new Ot(new Vi,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new ki(this.width,this.height,E),this._renderTarget.texture.mapping=((v=e.renderTargetOptions)===null||v===void 0?void 0:v.mapping)!==void 0?(b=e.renderTargetOptions)===null||b===void 0?void 0:b.mapping:xc}static instantiateRenderer(){const e=new aD;return e.setSize(128,128),e}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const e=uK(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){const n=new xo(this.toArray(),this.width,this.height,ri,this._type,(e==null?void 0:e.mapping)||xc,(e==null?void 0:e.wrapS)||ni,(e==null?void 0:e.wrapT)||ni,(e==null?void 0:e.magFilter)||Xn,(e==null?void 0:e.minFilter)||Xn,(e==null?void 0:e.anisotropy)||1,vl);return n.generateMipmaps=(e==null?void 0:e.generateMipmaps)!==void 0?e==null?void 0:e.generateMipmaps:!1,n}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof qi&&Object.values(this.material.uniforms).forEach(n=>{n.value instanceof $n&&n.value.dispose()}),Object.values(this.material).forEach(n=>{n instanceof $n&&n.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}const uRe=` varying vec2 vUv; void main() { @@ -4418,9 +4418,9 @@ void main() { vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor )); gl_FragColor = vec4( clampedHdrColor , 1.0 ); } -`;class dRe extends qi{constructor({gamma:e,offsetHdr:n,offsetSdr:r,gainMapMin:i,gainMapMax:a,maxDisplayBoost:s,hdrCapacityMin:o,hdrCapacityMax:l,sdr:u,gainMap:c}){super({name:"GainMapDecoderMaterial",vertexShader:uRe,fragmentShader:cRe,uniforms:{sdr:{value:u},gainMap:{value:c},gamma:{value:new H(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new H().fromArray(n)},offsetSdr:{value:new H().fromArray(r)},gainMapMin:{value:new H().fromArray(i)},gainMapMax:{value:new H().fromArray(a)},weightFactor:{value:(Math.log2(s)-o)/(l-o)}},blending:dl,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=s,this._hdrCapacityMin=o,this._hdrCapacityMax=l,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){const e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){const n=this.uniforms.gamma.value;n.x=1/e[0],n.y=1/e[1],n.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){const e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class cK extends Error{}class dK extends Error{}const Pg=(t,e,n)=>{var r;let i;const a=(r=t.attributes.getNamedItem(e))===null||r===void 0?void 0:r.nodeValue;if(a)i=a;else{const s=t.getElementsByTagName(e)[0];if(s){const o=s.getElementsByTagName("rdf:li");if(o.length===3)i=Array.from(o).map(l=>l.innerHTML);else throw new Error(`Gainmap metadata contains an array of items for ${e} but its length is not 3`)}else{if(n)return n;throw new Error(`Can't find ${e} in gainmap metadata`)}}return i},fRe=t=>{var e,n;let r;typeof TextDecoder<"u"?r=new TextDecoder().decode(t):r=t.toString();let i=r.indexOf("",i);r.slice(i,s+10);const o=r.slice(i,s+10);try{const u=a.parseFromString(o,"text/xml").getElementsByTagName("rdf:Description")[0],c=Pg(u,"hdrgm:GainMapMin","0"),d=Pg(u,"hdrgm:GainMapMax"),f=Pg(u,"hdrgm:Gamma","1"),m=Pg(u,"hdrgm:OffsetSDR","0.015625"),g=Pg(u,"hdrgm:OffsetHDR","0.015625");let y=(e=u.attributes.getNamedItem("hdrgm:HDRCapacityMin"))===null||e===void 0?void 0:e.nodeValue;y||(y="0");const v=(n=u.attributes.getNamedItem("hdrgm:HDRCapacityMax"))===null||n===void 0?void 0:n.nodeValue;if(!v)throw new Error("Incomplete gainmap metadata");return{gainMapMin:Array.isArray(c)?c.map(b=>parseFloat(b)):[parseFloat(c),parseFloat(c),parseFloat(c)],gainMapMax:Array.isArray(d)?d.map(b=>parseFloat(b)):[parseFloat(d),parseFloat(d),parseFloat(d)],gamma:Array.isArray(f)?f.map(b=>parseFloat(b)):[parseFloat(f),parseFloat(f),parseFloat(f)],offsetSdr:Array.isArray(m)?m.map(b=>parseFloat(b)):[parseFloat(m),parseFloat(m),parseFloat(m)],offsetHdr:Array.isArray(g)?g.map(b=>parseFloat(b)):[parseFloat(g),parseFloat(g),parseFloat(g)],hdrCapacityMin:parseFloat(y),hdrCapacityMax:parseFloat(v)}}catch{}i=r.indexOf("{const i=this.options.debug,a=new DataView(e.buffer);if(a.getUint16(0)!==65496){r(new Error("Not a valid jpeg"));return}const s=a.byteLength;let o=2,l=0,u;for(;o250){r(new Error(`Found no marker after ${l} loops 😵`));return}if(a.getUint8(o)!==255){r(new Error(`Not a valid marker at offset 0x${o.toString(16)}, found: 0x${a.getUint8(o).toString(16)}`));return}if(u=a.getUint8(o+1),i&&console.log(`Marker: ${u.toString(16)}`),u===226){i&&console.log("Found APP2 marker (0xffe2)");const c=o+4;if(a.getUint32(c)===1297106432){const d=c+4;let f;if(a.getUint16(d)===18761)f=!1;else if(a.getUint16(d)===19789)f=!0;else{r(new Error("No valid endianness marker found in TIFF header"));return}if(a.getUint16(d+2,!f)!==42){r(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const m=a.getUint32(d+4,!f);if(m<8){r(new Error("Not valid TIFF data! (First offset less than 8)"));return}const g=d+m,y=a.getUint16(g,!f),v=g+2;let b=0;for(let I=v;I{const e=fRe(t);if(!e)throw new dK("Gain map XMP metadata not found");const r=await new pRe({extractFII:!0,extractNonFII:!0}).extract(t);if(r.length!==2)throw new cK("Gain map recovery image not found");return{sdr:new Uint8Array(await r[0].arrayBuffer()),gainMap:new Uint8Array(await r[1].arrayBuffer()),metadata:e}},DG=t=>new Promise((e,n)=>{const r=document.createElement("img");r.onload=()=>{e(r)},r.onerror=i=>{n(i)},r.src=URL.createObjectURL(t)});class fK extends Zi{constructor(e,n){super(n),e&&(this._renderer=e),this._internalLoadingManager=new yx}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: An existing WebGL Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const e=new dRe({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new $n,sdr:new $n});return new UD({width:16,height:16,type:fi,colorSpace:vl,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async render(e,n,r,i){const a=i?new Blob([i],{type:"image/jpeg"}):void 0,s=new Blob([r],{type:"image/jpeg"});let o,l,u=!1;if(typeof createImageBitmap>"u"){const f=await Promise.all([a?DG(a):Promise.resolve(void 0),DG(s)]);l=f[0],o=f[1],u=!0}else{const f=await Promise.all([a?createImageBitmap(a,{imageOrientation:"flipY"}):Promise.resolve(void 0),createImageBitmap(s,{imageOrientation:"flipY"})]);l=f[0],o=f[1]}const c=new $n(l||new ImageData(2,2),Tc,ni,ni,Xn,RM,ri,as,1,vl);c.flipY=u,c.needsUpdate=!0;const d=new $n(o,Tc,ni,ni,Xn,RM,ri,as,1,Ia);d.flipY=u,d.needsUpdate=!0,e.width=o.width,e.height=o.height,e.material.gainMap=c,e.material.sdr=d,e.material.gainMapMin=n.gainMapMin,e.material.gainMapMax=n.gainMapMax,e.material.offsetHdr=n.offsetHdr,e.material.offsetSdr=n.offsetSdr,e.material.gamma=n.gamma,e.material.hdrCapacityMin=n.hdrCapacityMin,e.material.hdrCapacityMax=n.hdrCapacityMax,e.material.maxDisplayBoost=Math.pow(2,n.hdrCapacityMax),e.material.needsUpdate=!0,e.render()}}class mRe extends fK{load([e,n,r],i,a,s){const o=this.prepareQuadRenderer();let l,u,c;const d=async()=>{if(l&&u&&c){try{await this.render(o,c,l,u)}catch(N){this.manager.itemError(e),this.manager.itemError(n),this.manager.itemError(r),typeof s=="function"&&s(N),o.disposeOnDemandRenderer();return}typeof i=="function"&&i(o),this.manager.itemEnd(e),this.manager.itemEnd(n),this.manager.itemEnd(r),o.disposeOnDemandRenderer()}};let f=!0,m=0,g=0,y=!0,v=0,b=0,E=!0,S=0,A=0;const I=()=>{if(typeof a=="function"){const N=m+v+S,M=g+b+A,B=f&&y&&E;a(new ProgressEvent("progress",{lengthComputable:B,loaded:M,total:N}))}};this.manager.itemStart(e),this.manager.itemStart(n),this.manager.itemStart(r);const T=new ji(this._internalLoadingManager);T.setResponseType("arraybuffer"),T.setRequestHeader(this.requestHeader),T.setPath(this.path),T.setWithCredentials(this.withCredentials),T.load(e,async N=>{if(typeof N=="string")throw new Error("Invalid sdr buffer");l=N,await d()},N=>{f=N.lengthComputable,g=N.loaded,m=N.total,I()},N=>{this.manager.itemError(e),typeof s=="function"&&s(N)});const R=new ji(this._internalLoadingManager);R.setResponseType("arraybuffer"),R.setRequestHeader(this.requestHeader),R.setPath(this.path),R.setWithCredentials(this.withCredentials),R.load(n,async N=>{if(typeof N=="string")throw new Error("Invalid gainmap buffer");u=N,await d()},N=>{y=N.lengthComputable,b=N.loaded,v=N.total,I()},N=>{this.manager.itemError(n),typeof s=="function"&&s(N)});const O=new ji(this._internalLoadingManager);return O.setRequestHeader(this.requestHeader),O.setPath(this.path),O.setWithCredentials(this.withCredentials),O.load(r,async N=>{if(typeof N!="string")throw new Error("Invalid metadata string");c=JSON.parse(N),await d()},N=>{E=N.lengthComputable,A=N.loaded,S=N.total,I()},N=>{this.manager.itemError(r),typeof s=="function"&&s(N)}),o}}class gRe extends fK{load(e,n,r,i){const a=this.prepareQuadRenderer(),s=new ji(this._internalLoadingManager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(this.withCredentials),this.manager.itemStart(e),s.load(e,async o=>{if(typeof o=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const l=new Uint8Array(o);let u,c,d;try{const f=await hRe(l);u=f.sdr,c=f.gainMap,d=f.metadata}catch(f){if(f instanceof dK||f instanceof cK)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),d={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},u=l;else throw f}try{await this.render(a,d,u,c)}catch(f){this.manager.itemError(e),typeof i=="function"&&i(f),a.disposeOnDemandRenderer();return}typeof n=="function"&&n(a),this.manager.itemEnd(e),a.disposeOnDemandRenderer()},r,o=>{this.manager.itemError(e),typeof i=="function"&&i(o)}),a}}const Nb={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},pK="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",Rh=t=>Array.isArray(t),zD=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function xx({files:t=zD,path:e="",preset:n=void 0,encoding:r=void 0,extensions:i}={}){let a=null,s=!1;n&&(HD(n),t=Nb[n],e=pK),s=Rh(t);const{extension:o,isCubemap:l}=GD(t);if(a=VD(o),!a)throw new Error("useEnvironment: Unrecognized file extension: "+t);const u=zn(m=>m.gl);w.useLayoutEffect(()=>{if(o!=="webp"&&o!=="jpg"&&o!=="jpeg")return;function m(){io.clear(a,s?[t]:t)}u.domElement.addEventListener("webglcontextlost",m,{once:!0})},[t,u.domElement]);const c=io(a,s?[t]:t,m=>{(o==="webp"||o==="jpg"||o==="jpeg")&&m.setRenderer(u),m.setPath==null||m.setPath(e),i&&i(m)});let d=s?c[0]:c;if(o==="jpg"||o==="jpeg"||o==="webp"){var f;d=(f=d.renderTarget)==null?void 0:f.texture}return d.mapping=l?bl:Yh,"colorSpace"in d?d.colorSpace=r??l?"srgb":"srgb-linear":d.encoding=r??l?rRe:nRe,d}const bRe={files:zD,path:"",preset:void 0,extensions:void 0};xx.preload=t=>{const e={...bRe,...t};let{files:n,path:r=""}=e;const{preset:i,extensions:a}=e;i&&(HD(i),n=Nb[i],r=pK);const{extension:s}=GD(n);if(s==="webp"||s==="jpg"||s==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const o=VD(s);if(!o)throw new Error("useEnvironment: Unrecognized file extension: "+n);io.preload(o,Rh(n)?[n]:n,l=>{l.setPath==null||l.setPath(r),a&&a(l)})};const yRe={files:zD,preset:void 0};xx.clear=t=>{const e={...yRe,...t};let{files:n}=e;const{preset:r}=e;r&&(HD(r),n=Nb[r]);const{extension:i}=GD(n),a=VD(i);if(!a)throw new Error("useEnvironment: Unrecognized file extension: "+n);io.clear(a,Rh(n)?[n]:n)};function HD(t){if(!(t in Nb))throw new Error("Preset must be one of: "+Object.keys(Nb).join(", "))}function GD(t){var e;const n=Rh(t)&&t.length===6,r=Rh(t)&&t.length===3&&t.some(s=>s.endsWith("json")),i=Rh(t)?t[0]:t;return{extension:n?"cube":r?"webp":i.startsWith("data:application/exr")?"exr":i.startsWith("data:application/hdr")?"hdr":i.startsWith("data:image/jpeg")?"jpg":(e=i.split(".").pop())==null||(e=e.split("?"))==null||(e=e.shift())==null?void 0:e.toLowerCase(),isCubemap:n,isGainmap:r}}function VD(t){return t==="cube"?tX:t==="hdr"?qCe:t==="exr"?XCe:t==="jpg"||t==="jpeg"?gRe:t==="webp"?mRe:null}const vRe=t=>t.current&&t.current.isScene,ERe=t=>vRe(t)?t.current:t;function $D(t,e,n,r,i={}){var a,s,o,l,u;i={backgroundBlurriness:(a=i.blur)!==null&&a!==void 0?a:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};const c=ERe(e||n),d=c.background,f=c.environment,m={backgroundBlurriness:c.backgroundBlurriness,backgroundIntensity:c.backgroundIntensity,backgroundRotation:(s=(o=c.backgroundRotation)==null||o.clone==null?void 0:o.clone())!==null&&s!==void 0?s:[0,0,0],environmentIntensity:c.environmentIntensity,environmentRotation:(l=(u=c.environmentRotation)==null||u.clone==null?void 0:u.clone())!==null&&l!==void 0?l:[0,0,0]};return t!=="only"&&(c.environment=r),t&&(c.background=r),Qu(c,i),()=>{t!=="only"&&(c.environment=f),t&&(c.background=d),Qu(c,m)}}function WD({scene:t,background:e=!1,map:n,...r}){const i=zn(a=>a.scene);return w.useLayoutEffect(()=>{if(n)return $D(e,t,i,n,r)}),null}function hK({background:t=!1,scene:e,blur:n,backgroundBlurriness:r,backgroundIntensity:i,backgroundRotation:a,environmentIntensity:s,environmentRotation:o,...l}){const u=xx(l),c=zn(d=>d.scene);return w.useLayoutEffect(()=>$D(t,e,c,u,{blur:n,backgroundBlurriness:r,backgroundIntensity:i,backgroundRotation:a,environmentIntensity:s,environmentRotation:o})),null}function SRe({children:t,near:e=1,far:n=1e3,resolution:r=256,frames:i=1,map:a,background:s=!1,blur:o,backgroundBlurriness:l,backgroundIntensity:u,backgroundRotation:c,environmentIntensity:d,environmentRotation:f,scene:m,files:g,path:y,preset:v=void 0,extensions:b}){const E=zn(O=>O.gl),S=zn(O=>O.scene),A=w.useRef(null),[I]=w.useState(()=>new em),T=w.useMemo(()=>{const O=new rD(r);return O.texture.type=fi,O},[r]);w.useLayoutEffect(()=>(i===1&&A.current.update(E,I),$D(s,m,S,T.texture,{blur:o,backgroundBlurriness:l,backgroundIntensity:u,backgroundRotation:c,environmentIntensity:d,environmentRotation:f})),[t,I,T.texture,m,S,s,i,E]);let R=1;return ko(()=>{(i===1/0||RLD({GroundProjectedEnvImpl:tCe}),[]);const o=w.useMemo(()=>[s],[s]),l=(e=t.ground)==null?void 0:e.height,u=(n=t.ground)==null?void 0:n.radius,c=(r=(i=t.ground)==null?void 0:i.scale)!==null&&r!==void 0?r:1e3;return w.createElement(w.Fragment,null,w.createElement(WD,Mi({},t,{map:s})),w.createElement("groundProjectedEnvImpl",{args:o,scale:c,height:l,radius:u}))}function gy(t){return t.ground?w.createElement(_Re,t):t.map?w.createElement(WD,t):t.children?w.createElement(SRe,t):w.createElement(hK,t)}const jD=w.forwardRef(({scale:t=10,frames:e=1/0,opacity:n=1,width:r=1,height:i=1,blur:a=1,near:s=0,far:o=10,resolution:l=512,smooth:u=!0,color:c="#000000",depthWrite:d=!1,renderOrder:f,...m},g)=>{const y=w.useRef(null),v=zn(K=>K.scene),b=zn(K=>K.gl),E=w.useRef(null);r=r*(Array.isArray(t)?t[0]:t||1),i=i*(Array.isArray(t)?t[1]:t||1);const[S,A,I,T,R,O,N]=w.useMemo(()=>{const K=new ki(l,l),se=new ki(l,l);se.texture.generateMipmaps=K.texture.generateMipmaps=!1;const ae=new Vi(r,i).rotateX(Math.PI/2),ee=new Ot(ae),F=new ay;F.depthTest=F.depthWrite=!1,F.onBeforeCompile=fe=>{fe.uniforms={...fe.uniforms,ucolor:{value:new vt(c)}},fe.fragmentShader=fe.fragmentShader.replace("void main() {",`uniform vec3 ucolor; +`;class dRe extends qi{constructor({gamma:e,offsetHdr:n,offsetSdr:r,gainMapMin:i,gainMapMax:a,maxDisplayBoost:s,hdrCapacityMin:o,hdrCapacityMax:l,sdr:u,gainMap:c}){super({name:"GainMapDecoderMaterial",vertexShader:uRe,fragmentShader:cRe,uniforms:{sdr:{value:u},gainMap:{value:c},gamma:{value:new H(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new H().fromArray(n)},offsetSdr:{value:new H().fromArray(r)},gainMapMin:{value:new H().fromArray(i)},gainMapMax:{value:new H().fromArray(a)},weightFactor:{value:(Math.log2(s)-o)/(l-o)}},blending:dl,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=s,this._hdrCapacityMin=o,this._hdrCapacityMax=l,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){const e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){const n=this.uniforms.gamma.value;n.x=1/e[0],n.y=1/e[1],n.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){const e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class cK extends Error{}class dK extends Error{}const Pg=(t,e,n)=>{var r;let i;const a=(r=t.attributes.getNamedItem(e))===null||r===void 0?void 0:r.nodeValue;if(a)i=a;else{const s=t.getElementsByTagName(e)[0];if(s){const o=s.getElementsByTagName("rdf:li");if(o.length===3)i=Array.from(o).map(l=>l.innerHTML);else throw new Error(`Gainmap metadata contains an array of items for ${e} but its length is not 3`)}else{if(n)return n;throw new Error(`Can't find ${e} in gainmap metadata`)}}return i},fRe=t=>{var e,n;let r;typeof TextDecoder<"u"?r=new TextDecoder().decode(t):r=t.toString();let i=r.indexOf("",i);r.slice(i,s+10);const o=r.slice(i,s+10);try{const u=a.parseFromString(o,"text/xml").getElementsByTagName("rdf:Description")[0],c=Pg(u,"hdrgm:GainMapMin","0"),d=Pg(u,"hdrgm:GainMapMax"),f=Pg(u,"hdrgm:Gamma","1"),m=Pg(u,"hdrgm:OffsetSDR","0.015625"),g=Pg(u,"hdrgm:OffsetHDR","0.015625");let y=(e=u.attributes.getNamedItem("hdrgm:HDRCapacityMin"))===null||e===void 0?void 0:e.nodeValue;y||(y="0");const v=(n=u.attributes.getNamedItem("hdrgm:HDRCapacityMax"))===null||n===void 0?void 0:n.nodeValue;if(!v)throw new Error("Incomplete gainmap metadata");return{gainMapMin:Array.isArray(c)?c.map(b=>parseFloat(b)):[parseFloat(c),parseFloat(c),parseFloat(c)],gainMapMax:Array.isArray(d)?d.map(b=>parseFloat(b)):[parseFloat(d),parseFloat(d),parseFloat(d)],gamma:Array.isArray(f)?f.map(b=>parseFloat(b)):[parseFloat(f),parseFloat(f),parseFloat(f)],offsetSdr:Array.isArray(m)?m.map(b=>parseFloat(b)):[parseFloat(m),parseFloat(m),parseFloat(m)],offsetHdr:Array.isArray(g)?g.map(b=>parseFloat(b)):[parseFloat(g),parseFloat(g),parseFloat(g)],hdrCapacityMin:parseFloat(y),hdrCapacityMax:parseFloat(v)}}catch{}i=r.indexOf("{const i=this.options.debug,a=new DataView(e.buffer);if(a.getUint16(0)!==65496){r(new Error("Not a valid jpeg"));return}const s=a.byteLength;let o=2,l=0,u;for(;o250){r(new Error(`Found no marker after ${l} loops 😵`));return}if(a.getUint8(o)!==255){r(new Error(`Not a valid marker at offset 0x${o.toString(16)}, found: 0x${a.getUint8(o).toString(16)}`));return}if(u=a.getUint8(o+1),i&&console.log(`Marker: ${u.toString(16)}`),u===226){i&&console.log("Found APP2 marker (0xffe2)");const c=o+4;if(a.getUint32(c)===1297106432){const d=c+4;let f;if(a.getUint16(d)===18761)f=!1;else if(a.getUint16(d)===19789)f=!0;else{r(new Error("No valid endianness marker found in TIFF header"));return}if(a.getUint16(d+2,!f)!==42){r(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const m=a.getUint32(d+4,!f);if(m<8){r(new Error("Not valid TIFF data! (First offset less than 8)"));return}const g=d+m,y=a.getUint16(g,!f),v=g+2;let b=0;for(let I=v;I{const e=fRe(t);if(!e)throw new dK("Gain map XMP metadata not found");const r=await new pRe({extractFII:!0,extractNonFII:!0}).extract(t);if(r.length!==2)throw new cK("Gain map recovery image not found");return{sdr:new Uint8Array(await r[0].arrayBuffer()),gainMap:new Uint8Array(await r[1].arrayBuffer()),metadata:e}},DG=t=>new Promise((e,n)=>{const r=document.createElement("img");r.onload=()=>{e(r)},r.onerror=i=>{n(i)},r.src=URL.createObjectURL(t)});class fK extends Zi{constructor(e,n){super(n),e&&(this._renderer=e),this._internalLoadingManager=new yT}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: An existing WebGL Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const e=new dRe({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new $n,sdr:new $n});return new UD({width:16,height:16,type:fi,colorSpace:vl,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async render(e,n,r,i){const a=i?new Blob([i],{type:"image/jpeg"}):void 0,s=new Blob([r],{type:"image/jpeg"});let o,l,u=!1;if(typeof createImageBitmap>"u"){const f=await Promise.all([a?DG(a):Promise.resolve(void 0),DG(s)]);l=f[0],o=f[1],u=!0}else{const f=await Promise.all([a?createImageBitmap(a,{imageOrientation:"flipY"}):Promise.resolve(void 0),createImageBitmap(s,{imageOrientation:"flipY"})]);l=f[0],o=f[1]}const c=new $n(l||new ImageData(2,2),xc,ni,ni,Xn,RM,ri,as,1,vl);c.flipY=u,c.needsUpdate=!0;const d=new $n(o,xc,ni,ni,Xn,RM,ri,as,1,Ia);d.flipY=u,d.needsUpdate=!0,e.width=o.width,e.height=o.height,e.material.gainMap=c,e.material.sdr=d,e.material.gainMapMin=n.gainMapMin,e.material.gainMapMax=n.gainMapMax,e.material.offsetHdr=n.offsetHdr,e.material.offsetSdr=n.offsetSdr,e.material.gamma=n.gamma,e.material.hdrCapacityMin=n.hdrCapacityMin,e.material.hdrCapacityMax=n.hdrCapacityMax,e.material.maxDisplayBoost=Math.pow(2,n.hdrCapacityMax),e.material.needsUpdate=!0,e.render()}}class mRe extends fK{load([e,n,r],i,a,s){const o=this.prepareQuadRenderer();let l,u,c;const d=async()=>{if(l&&u&&c){try{await this.render(o,c,l,u)}catch(N){this.manager.itemError(e),this.manager.itemError(n),this.manager.itemError(r),typeof s=="function"&&s(N),o.disposeOnDemandRenderer();return}typeof i=="function"&&i(o),this.manager.itemEnd(e),this.manager.itemEnd(n),this.manager.itemEnd(r),o.disposeOnDemandRenderer()}};let f=!0,m=0,g=0,y=!0,v=0,b=0,E=!0,_=0,A=0;const I=()=>{if(typeof a=="function"){const N=m+v+_,M=g+b+A,B=f&&y&&E;a(new ProgressEvent("progress",{lengthComputable:B,loaded:M,total:N}))}};this.manager.itemStart(e),this.manager.itemStart(n),this.manager.itemStart(r);const x=new ji(this._internalLoadingManager);x.setResponseType("arraybuffer"),x.setRequestHeader(this.requestHeader),x.setPath(this.path),x.setWithCredentials(this.withCredentials),x.load(e,async N=>{if(typeof N=="string")throw new Error("Invalid sdr buffer");l=N,await d()},N=>{f=N.lengthComputable,g=N.loaded,m=N.total,I()},N=>{this.manager.itemError(e),typeof s=="function"&&s(N)});const R=new ji(this._internalLoadingManager);R.setResponseType("arraybuffer"),R.setRequestHeader(this.requestHeader),R.setPath(this.path),R.setWithCredentials(this.withCredentials),R.load(n,async N=>{if(typeof N=="string")throw new Error("Invalid gainmap buffer");u=N,await d()},N=>{y=N.lengthComputable,b=N.loaded,v=N.total,I()},N=>{this.manager.itemError(n),typeof s=="function"&&s(N)});const O=new ji(this._internalLoadingManager);return O.setRequestHeader(this.requestHeader),O.setPath(this.path),O.setWithCredentials(this.withCredentials),O.load(r,async N=>{if(typeof N!="string")throw new Error("Invalid metadata string");c=JSON.parse(N),await d()},N=>{E=N.lengthComputable,A=N.loaded,_=N.total,I()},N=>{this.manager.itemError(r),typeof s=="function"&&s(N)}),o}}class gRe extends fK{load(e,n,r,i){const a=this.prepareQuadRenderer(),s=new ji(this._internalLoadingManager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(this.withCredentials),this.manager.itemStart(e),s.load(e,async o=>{if(typeof o=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const l=new Uint8Array(o);let u,c,d;try{const f=await hRe(l);u=f.sdr,c=f.gainMap,d=f.metadata}catch(f){if(f instanceof dK||f instanceof cK)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),d={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},u=l;else throw f}try{await this.render(a,d,u,c)}catch(f){this.manager.itemError(e),typeof i=="function"&&i(f),a.disposeOnDemandRenderer();return}typeof n=="function"&&n(a),this.manager.itemEnd(e),a.disposeOnDemandRenderer()},r,o=>{this.manager.itemError(e),typeof i=="function"&&i(o)}),a}}const Nb={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},pK="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",Rh=t=>Array.isArray(t),zD=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function TT({files:t=zD,path:e="",preset:n=void 0,encoding:r=void 0,extensions:i}={}){let a=null,s=!1;n&&(HD(n),t=Nb[n],e=pK),s=Rh(t);const{extension:o,isCubemap:l}=GD(t);if(a=VD(o),!a)throw new Error("useEnvironment: Unrecognized file extension: "+t);const u=zn(m=>m.gl);w.useLayoutEffect(()=>{if(o!=="webp"&&o!=="jpg"&&o!=="jpeg")return;function m(){io.clear(a,s?[t]:t)}u.domElement.addEventListener("webglcontextlost",m,{once:!0})},[t,u.domElement]);const c=io(a,s?[t]:t,m=>{(o==="webp"||o==="jpg"||o==="jpeg")&&m.setRenderer(u),m.setPath==null||m.setPath(e),i&&i(m)});let d=s?c[0]:c;if(o==="jpg"||o==="jpeg"||o==="webp"){var f;d=(f=d.renderTarget)==null?void 0:f.texture}return d.mapping=l?bl:Yh,"colorSpace"in d?d.colorSpace=r??l?"srgb":"srgb-linear":d.encoding=r??l?rRe:nRe,d}const bRe={files:zD,path:"",preset:void 0,extensions:void 0};TT.preload=t=>{const e={...bRe,...t};let{files:n,path:r=""}=e;const{preset:i,extensions:a}=e;i&&(HD(i),n=Nb[i],r=pK);const{extension:s}=GD(n);if(s==="webp"||s==="jpg"||s==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const o=VD(s);if(!o)throw new Error("useEnvironment: Unrecognized file extension: "+n);io.preload(o,Rh(n)?[n]:n,l=>{l.setPath==null||l.setPath(r),a&&a(l)})};const yRe={files:zD,preset:void 0};TT.clear=t=>{const e={...yRe,...t};let{files:n}=e;const{preset:r}=e;r&&(HD(r),n=Nb[r]);const{extension:i}=GD(n),a=VD(i);if(!a)throw new Error("useEnvironment: Unrecognized file extension: "+n);io.clear(a,Rh(n)?[n]:n)};function HD(t){if(!(t in Nb))throw new Error("Preset must be one of: "+Object.keys(Nb).join(", "))}function GD(t){var e;const n=Rh(t)&&t.length===6,r=Rh(t)&&t.length===3&&t.some(s=>s.endsWith("json")),i=Rh(t)?t[0]:t;return{extension:n?"cube":r?"webp":i.startsWith("data:application/exr")?"exr":i.startsWith("data:application/hdr")?"hdr":i.startsWith("data:image/jpeg")?"jpg":(e=i.split(".").pop())==null||(e=e.split("?"))==null||(e=e.shift())==null?void 0:e.toLowerCase(),isCubemap:n,isGainmap:r}}function VD(t){return t==="cube"?tX:t==="hdr"?qCe:t==="exr"?XCe:t==="jpg"||t==="jpeg"?gRe:t==="webp"?mRe:null}const vRe=t=>t.current&&t.current.isScene,ERe=t=>vRe(t)?t.current:t;function $D(t,e,n,r,i={}){var a,s,o,l,u;i={backgroundBlurriness:(a=i.blur)!==null&&a!==void 0?a:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};const c=ERe(e||n),d=c.background,f=c.environment,m={backgroundBlurriness:c.backgroundBlurriness,backgroundIntensity:c.backgroundIntensity,backgroundRotation:(s=(o=c.backgroundRotation)==null||o.clone==null?void 0:o.clone())!==null&&s!==void 0?s:[0,0,0],environmentIntensity:c.environmentIntensity,environmentRotation:(l=(u=c.environmentRotation)==null||u.clone==null?void 0:u.clone())!==null&&l!==void 0?l:[0,0,0]};return t!=="only"&&(c.environment=r),t&&(c.background=r),Qu(c,i),()=>{t!=="only"&&(c.environment=f),t&&(c.background=d),Qu(c,m)}}function WD({scene:t,background:e=!1,map:n,...r}){const i=zn(a=>a.scene);return w.useLayoutEffect(()=>{if(n)return $D(e,t,i,n,r)}),null}function hK({background:t=!1,scene:e,blur:n,backgroundBlurriness:r,backgroundIntensity:i,backgroundRotation:a,environmentIntensity:s,environmentRotation:o,...l}){const u=TT(l),c=zn(d=>d.scene);return w.useLayoutEffect(()=>$D(t,e,c,u,{blur:n,backgroundBlurriness:r,backgroundIntensity:i,backgroundRotation:a,environmentIntensity:s,environmentRotation:o})),null}function _Re({children:t,near:e=1,far:n=1e3,resolution:r=256,frames:i=1,map:a,background:s=!1,blur:o,backgroundBlurriness:l,backgroundIntensity:u,backgroundRotation:c,environmentIntensity:d,environmentRotation:f,scene:m,files:g,path:y,preset:v=void 0,extensions:b}){const E=zn(O=>O.gl),_=zn(O=>O.scene),A=w.useRef(null),[I]=w.useState(()=>new em),x=w.useMemo(()=>{const O=new rD(r);return O.texture.type=fi,O},[r]);w.useLayoutEffect(()=>(i===1&&A.current.update(E,I),$D(s,m,_,x.texture,{blur:o,backgroundBlurriness:l,backgroundIntensity:u,backgroundRotation:c,environmentIntensity:d,environmentRotation:f})),[t,I,x.texture,m,_,s,i,E]);let R=1;return ko(()=>{(i===1/0||RLD({GroundProjectedEnvImpl:tCe}),[]);const o=w.useMemo(()=>[s],[s]),l=(e=t.ground)==null?void 0:e.height,u=(n=t.ground)==null?void 0:n.radius,c=(r=(i=t.ground)==null?void 0:i.scale)!==null&&r!==void 0?r:1e3;return w.createElement(w.Fragment,null,w.createElement(WD,Mi({},t,{map:s})),w.createElement("groundProjectedEnvImpl",{args:o,scale:c,height:l,radius:u}))}function gy(t){return t.ground?w.createElement(SRe,t):t.map?w.createElement(WD,t):t.children?w.createElement(_Re,t):w.createElement(hK,t)}const jD=w.forwardRef(({scale:t=10,frames:e=1/0,opacity:n=1,width:r=1,height:i=1,blur:a=1,near:s=0,far:o=10,resolution:l=512,smooth:u=!0,color:c="#000000",depthWrite:d=!1,renderOrder:f,...m},g)=>{const y=w.useRef(null),v=zn(K=>K.scene),b=zn(K=>K.gl),E=w.useRef(null);r=r*(Array.isArray(t)?t[0]:t||1),i=i*(Array.isArray(t)?t[1]:t||1);const[_,A,I,x,R,O,N]=w.useMemo(()=>{const K=new ki(l,l),se=new ki(l,l);se.texture.generateMipmaps=K.texture.generateMipmaps=!1;const ae=new Vi(r,i).rotateX(Math.PI/2),ee=new Ot(ae),F=new ay;F.depthTest=F.depthWrite=!1,F.onBeforeCompile=fe=>{fe.uniforms={...fe.uniforms,ucolor:{value:new vt(c)}},fe.fragmentShader=fe.fragmentShader.replace("void main() {",`uniform vec3 ucolor; void main() { - `),fe.fragmentShader=fe.fragmentShader.replace("vec4( vec3( 1.0 - fragCoordZ ), opacity );","vec4( ucolor * fragCoordZ * 2.0, ( 1.0 - fragCoordZ ) * 1.0 );")};const ie=new qi(jCe),J=new qi(YCe);return J.depthTest=ie.depthTest=!1,[K,ae,F,ee,ie,J,se]},[l,r,i,t,c]),M=K=>{T.visible=!0,T.material=R,R.uniforms.tDiffuse.value=S.texture,R.uniforms.h.value=K*1/256,b.setRenderTarget(N),b.render(T,E.current),T.material=O,O.uniforms.tDiffuse.value=N.texture,O.uniforms.v.value=K*1/256,b.setRenderTarget(S),b.render(T,E.current),T.visible=!1};let B=0,G,W;return ko(()=>{E.current&&(e===1/0||By.current,[]),w.createElement("group",Mi({"rotation-x":Math.PI/2},m,{ref:y}),w.createElement("mesh",{renderOrder:f,geometry:A,scale:[1,-1,1],rotation:[-Math.PI/2,0,0]},w.createElement("meshBasicMaterial",{transparent:!0,map:S.texture,opacity:n,depthWrite:d})),w.createElement("orthographicCamera",{ref:E,args:[-r/2,r/2,i/2,-i/2,s,o]}))});function ARe(t){return t.isLight}function TRe(t){return!!t.geometry}const mK=w.createContext(null),xRe=QX({color:new vt,blend:2,alphaTest:.75,opacity:0,map:null},`varying vec2 vUv; + `),fe.fragmentShader=fe.fragmentShader.replace("vec4( vec3( 1.0 - fragCoordZ ), opacity );","vec4( ucolor * fragCoordZ * 2.0, ( 1.0 - fragCoordZ ) * 1.0 );")};const ie=new qi(jCe),J=new qi(YCe);return J.depthTest=ie.depthTest=!1,[K,ae,F,ee,ie,J,se]},[l,r,i,t,c]),M=K=>{x.visible=!0,x.material=R,R.uniforms.tDiffuse.value=_.texture,R.uniforms.h.value=K*1/256,b.setRenderTarget(N),b.render(x,E.current),x.material=O,O.uniforms.tDiffuse.value=N.texture,O.uniforms.v.value=K*1/256,b.setRenderTarget(_),b.render(x,E.current),x.visible=!1};let B=0,G,W;return ko(()=>{E.current&&(e===1/0||By.current,[]),w.createElement("group",Mi({"rotation-x":Math.PI/2},m,{ref:y}),w.createElement("mesh",{renderOrder:f,geometry:A,scale:[1,-1,1],rotation:[-Math.PI/2,0,0]},w.createElement("meshBasicMaterial",{transparent:!0,map:_.texture,opacity:n,depthWrite:d})),w.createElement("orthographicCamera",{ref:E,args:[-r/2,r/2,i/2,-i/2,s,o]}))});function ARe(t){return t.isLight}function xRe(t){return!!t.geometry}const mK=w.createContext(null),TRe=QX({color:new vt,blend:2,alphaTest:.75,opacity:0,map:null},`varying vec2 vUv; void main() { gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.); vUv = uv; @@ -4435,14 +4435,14 @@ void main() { gl_FragColor = vec4(color * sampledDiffuseColor.r * blend, max(0.0, (1.0 - (sampledDiffuseColor.r + sampledDiffuseColor.g + sampledDiffuseColor.b) / alphaTest)) * opacity); #include #include <${JX>=154?"colorspace_fragment":"encodings_fragment"}> - }`),gK=w.forwardRef(({children:t,temporal:e,frames:n=40,limit:r=1/0,blend:i=20,scale:a=10,opacity:s=1,alphaTest:o=.75,color:l="black",colorBlend:u=2,resolution:c=1024,toneMapped:d=!0,...f},m)=>{LD({SoftShadowMaterial:xRe});const g=zn(T=>T.gl),y=zn(T=>T.scene),v=zn(T=>T.camera),b=zn(T=>T.invalidate),E=w.useRef(null),S=w.useRef(null),[A]=w.useState(()=>new wRe(g,y,c));w.useLayoutEffect(()=>{A.configure(E.current)},[]);const I=w.useMemo(()=>({lights:new Map,temporal:!!e,frames:Math.max(2,n),blend:Math.max(2,n===1/0?i:n),count:0,getMesh:()=>E.current,reset:()=>{A.clear();const T=E.current.material;T.opacity=0,T.alphaTest=0,I.count=0},update:(T=1)=>{const R=E.current.material;I.temporal?(R.opacity=Math.min(s,R.opacity+s/I.blend),R.alphaTest=Math.min(o,R.alphaTest+o/I.blend)):(R.opacity=s,R.alphaTest=o),S.current.visible=!0,A.prepare();for(let O=0;ON.update()),A.update(v,I.blend);S.current.visible=!1,A.finish()}}),[A,v,y,e,n,i,s,o]);return w.useLayoutEffect(()=>{I.reset(),!I.temporal&&I.frames!==1/0&&I.update(I.blend)}),w.useImperativeHandle(m,()=>I,[I]),ko(()=>{(I.temporal||I.frames===1/0)&&I.countnull,ref:S},w.createElement(mK.Provider,{value:I},t)),w.createElement("mesh",{receiveShadow:!0,ref:E,scale:a,rotation:[-Math.PI/2,0,0]},w.createElement("planeGeometry",null),w.createElement("softShadowMaterial",{transparent:!0,depthWrite:!1,toneMapped:d,color:l,blend:u,map:A.progressiveLightMap2.texture})))}),bK=w.forwardRef(({castShadow:t=!0,bias:e=.001,mapSize:n=512,size:r=5,near:i=.5,far:a=500,frames:s=1,position:o=[0,0,0],radius:l=1,amount:u=8,intensity:c=JX>=155?Math.PI:1,ambient:d=.5,...f},m)=>{const g=w.useRef(null),y=new H(...o).length(),v=w.useContext(mK),b=w.useCallback(()=>{let S;if(g.current)for(let A=0;Ad)S.position.set(o[0]+bc.randFloatSpread(l),o[1]+bc.randFloatSpread(l),o[2]+bc.randFloatSpread(l));else{let I=Math.acos(2*Math.random()-1)-Math.PI/2,T=2*Math.PI*Math.random();S.position.set(Math.cos(I)*Math.cos(T)*y,Math.abs(Math.cos(I)*Math.sin(T)*y),Math.sin(I)*y)}},[l,d,y,...o]),E=w.useMemo(()=>({update:b}),[b]);return w.useImperativeHandle(m,()=>E,[E]),w.useLayoutEffect(()=>{var S;const A=g.current;return v&&((S=v.lights)==null||S.set(A.uuid,E)),()=>{var I;return void(v==null||(I=v.lights)==null?void 0:I.delete(A.uuid))}},[v,E]),w.createElement("group",Mi({ref:g},f),Array.from({length:u},(S,A)=>w.createElement("directionalLight",{key:A,castShadow:t,"shadow-bias":e,"shadow-mapSize":[n,n],intensity:c/u},w.createElement("orthographicCamera",{attach:"shadow-camera",args:[-r,r,r,-r,i,a]}))))});class wRe{constructor(e,n,r=1024){this.renderer=e,this.res=r,this.scene=n,this.buffer1Active=!1,this.lights=[],this.meshes=[],this.object=null,this.clearColor=new vt,this.clearAlpha=0;const i={type:fi,magFilter:pi,minFilter:pi};this.progressiveLightMap1=new ki(this.res,this.res,i),this.progressiveLightMap2=new ki(this.res,this.res,i),this.discardMat=new iRe,this.targetMat=new bx({fog:!1}),this.previousShadowMap={value:this.progressiveLightMap1.texture},this.averagingWindow={value:100},this.targetMat.onBeforeCompile=a=>{a.vertexShader=`varying vec2 vUv; + }`),gK=w.forwardRef(({children:t,temporal:e,frames:n=40,limit:r=1/0,blend:i=20,scale:a=10,opacity:s=1,alphaTest:o=.75,color:l="black",colorBlend:u=2,resolution:c=1024,toneMapped:d=!0,...f},m)=>{LD({SoftShadowMaterial:TRe});const g=zn(x=>x.gl),y=zn(x=>x.scene),v=zn(x=>x.camera),b=zn(x=>x.invalidate),E=w.useRef(null),_=w.useRef(null),[A]=w.useState(()=>new wRe(g,y,c));w.useLayoutEffect(()=>{A.configure(E.current)},[]);const I=w.useMemo(()=>({lights:new Map,temporal:!!e,frames:Math.max(2,n),blend:Math.max(2,n===1/0?i:n),count:0,getMesh:()=>E.current,reset:()=>{A.clear();const x=E.current.material;x.opacity=0,x.alphaTest=0,I.count=0},update:(x=1)=>{const R=E.current.material;I.temporal?(R.opacity=Math.min(s,R.opacity+s/I.blend),R.alphaTest=Math.min(o,R.alphaTest+o/I.blend)):(R.opacity=s,R.alphaTest=o),_.current.visible=!0,A.prepare();for(let O=0;ON.update()),A.update(v,I.blend);_.current.visible=!1,A.finish()}}),[A,v,y,e,n,i,s,o]);return w.useLayoutEffect(()=>{I.reset(),!I.temporal&&I.frames!==1/0&&I.update(I.blend)}),w.useImperativeHandle(m,()=>I,[I]),ko(()=>{(I.temporal||I.frames===1/0)&&I.countnull,ref:_},w.createElement(mK.Provider,{value:I},t)),w.createElement("mesh",{receiveShadow:!0,ref:E,scale:a,rotation:[-Math.PI/2,0,0]},w.createElement("planeGeometry",null),w.createElement("softShadowMaterial",{transparent:!0,depthWrite:!1,toneMapped:d,color:l,blend:u,map:A.progressiveLightMap2.texture})))}),bK=w.forwardRef(({castShadow:t=!0,bias:e=.001,mapSize:n=512,size:r=5,near:i=.5,far:a=500,frames:s=1,position:o=[0,0,0],radius:l=1,amount:u=8,intensity:c=JX>=155?Math.PI:1,ambient:d=.5,...f},m)=>{const g=w.useRef(null),y=new H(...o).length(),v=w.useContext(mK),b=w.useCallback(()=>{let _;if(g.current)for(let A=0;Ad)_.position.set(o[0]+bc.randFloatSpread(l),o[1]+bc.randFloatSpread(l),o[2]+bc.randFloatSpread(l));else{let I=Math.acos(2*Math.random()-1)-Math.PI/2,x=2*Math.PI*Math.random();_.position.set(Math.cos(I)*Math.cos(x)*y,Math.abs(Math.cos(I)*Math.sin(x)*y),Math.sin(I)*y)}},[l,d,y,...o]),E=w.useMemo(()=>({update:b}),[b]);return w.useImperativeHandle(m,()=>E,[E]),w.useLayoutEffect(()=>{var _;const A=g.current;return v&&((_=v.lights)==null||_.set(A.uuid,E)),()=>{var I;return void(v==null||(I=v.lights)==null?void 0:I.delete(A.uuid))}},[v,E]),w.createElement("group",Mi({ref:g},f),Array.from({length:u},(_,A)=>w.createElement("directionalLight",{key:A,castShadow:t,"shadow-bias":e,"shadow-mapSize":[n,n],intensity:c/u},w.createElement("orthographicCamera",{attach:"shadow-camera",args:[-r,r,r,-r,i,a]}))))});class wRe{constructor(e,n,r=1024){this.renderer=e,this.res=r,this.scene=n,this.buffer1Active=!1,this.lights=[],this.meshes=[],this.object=null,this.clearColor=new vt,this.clearAlpha=0;const i={type:fi,magFilter:pi,minFilter:pi};this.progressiveLightMap1=new ki(this.res,this.res,i),this.progressiveLightMap2=new ki(this.res,this.res,i),this.discardMat=new iRe,this.targetMat=new bT({fog:!1}),this.previousShadowMap={value:this.progressiveLightMap1.texture},this.averagingWindow={value:100},this.targetMat.onBeforeCompile=a=>{a.vertexShader=`varying vec2 vUv; `+a.vertexShader.slice(0,-1)+"vUv = uv; gl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }";const s=a.fragmentShader.indexOf("void main() {");a.fragmentShader=`varying vec2 vUv; `+a.fragmentShader.slice(0,s)+`uniform sampler2D previousShadowMap; uniform float averagingWindow; `+a.fragmentShader.slice(s-1,-1)+` vec3 texelOld = texture2D(previousShadowMap, vUv).rgb; gl_FragColor.rgb = mix(texelOld, gl_FragColor.rgb, 1.0/ averagingWindow); - }`,a.uniforms.previousShadowMap=this.previousShadowMap,a.uniforms.averagingWindow=this.averagingWindow}}clear(){this.renderer.getClearColor(this.clearColor),this.clearAlpha=this.renderer.getClearAlpha(),this.renderer.setClearColor("black",1),this.renderer.setRenderTarget(this.progressiveLightMap1),this.renderer.clear(),this.renderer.setRenderTarget(this.progressiveLightMap2),this.renderer.clear(),this.renderer.setRenderTarget(null),this.renderer.setClearColor(this.clearColor,this.clearAlpha),this.lights=[],this.meshes=[],this.scene.traverse(e=>{TRe(e)?this.meshes.push({object:e,material:e.material}):ARe(e)&&this.lights.push({object:e,intensity:e.intensity})})}prepare(){this.lights.forEach(e=>e.object.intensity=0),this.meshes.forEach(e=>e.object.material=this.discardMat)}finish(){this.lights.forEach(e=>e.object.intensity=e.intensity),this.meshes.forEach(e=>e.object.material=e.material)}configure(e){this.object=e}update(e,n=100){if(!this.object)return;this.averagingWindow.value=n,this.object.material=this.targetMat;const r=this.buffer1Active?this.progressiveLightMap1:this.progressiveLightMap2,i=this.buffer1Active?this.progressiveLightMap2:this.progressiveLightMap1,a=this.scene.background;this.scene.background=null,this.renderer.setRenderTarget(r),this.previousShadowMap.value=i.texture,this.buffer1Active=!this.buffer1Active,this.renderer.render(this.scene,e),this.renderer.setRenderTarget(null),this.scene.background=a}}const CRe=` + }`,a.uniforms.previousShadowMap=this.previousShadowMap,a.uniforms.averagingWindow=this.averagingWindow}}clear(){this.renderer.getClearColor(this.clearColor),this.clearAlpha=this.renderer.getClearAlpha(),this.renderer.setClearColor("black",1),this.renderer.setRenderTarget(this.progressiveLightMap1),this.renderer.clear(),this.renderer.setRenderTarget(this.progressiveLightMap2),this.renderer.clear(),this.renderer.setRenderTarget(null),this.renderer.setClearColor(this.clearColor,this.clearAlpha),this.lights=[],this.meshes=[],this.scene.traverse(e=>{xRe(e)?this.meshes.push({object:e,material:e.material}):ARe(e)&&this.lights.push({object:e,intensity:e.intensity})})}prepare(){this.lights.forEach(e=>e.object.intensity=0),this.meshes.forEach(e=>e.object.material=this.discardMat)}finish(){this.lights.forEach(e=>e.object.intensity=e.intensity),this.meshes.forEach(e=>e.object.material=e.material)}configure(e){this.object=e}update(e,n=100){if(!this.object)return;this.averagingWindow.value=n,this.object.material=this.targetMat;const r=this.buffer1Active?this.progressiveLightMap1:this.progressiveLightMap2,i=this.buffer1Active?this.progressiveLightMap2:this.progressiveLightMap1,a=this.scene.background;this.scene.background=null,this.renderer.setRenderTarget(r),this.previousShadowMap.value=i.texture,this.buffer1Active=!this.buffer1Active,this.renderer.render(this.scene,e),this.renderer.setRenderTarget(null),this.scene.background=a}}const CRe=` #ifdef IS_VERTEX vec3 csm_Position; @@ -4651,17 +4651,17 @@ vec3 texelOld = texture2D(previousShadowMap, vUv).rgb; material.thickness = ${Ht.thickness}; `},[`${Ht.iridescence}`]:{"material.iridescence = iridescence;":` material.iridescence = ${Ht.iridescence}; - `}},kRe={clearcoat:[Ht.clearcoat,Ht.clearcoatNormal,Ht.clearcoatRoughness],transmission:[Ht.transmission],iridescence:[Ht.iridescence]};function PRe(t){let e=0;for(let i=0;i>>0;return String(n)}function BRe(t){try{new t}catch(e){if(e.message.indexOf("is not a constructor")>=0)return!1}return!0}function LG(t){return t.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"")}let wx=class extends ii{constructor({baseMaterial:e,vertexShader:n,fragmentShader:r,uniforms:i,patchMap:a,cacheKey:s,...o}){if(!e)throw new Error("CustomShaderMaterial: baseMaterial is required.");let l;if(BRe(e)){const y=Object.keys(o).length===0;l=new e(y?void 0:o)}else l=e,Object.assign(l,o);if(["ShaderMaterial","RawShaderMaterial"].includes(l.type))throw new Error(`CustomShaderMaterial does not support ${l.type} as a base material.`);super(),this.uniforms={},this.vertexShader="",this.fragmentShader="";const c=l;c.name=`CustomShaderMaterial<${l.name||l.type}>`,c.update=this.update.bind(c),c.__csm={prevOnBeforeCompile:l.onBeforeCompile};const m={...c.uniforms||{},...i||{}};c.uniforms=this.uniforms=m,c.vertexShader=this.vertexShader=n||"",c.fragmentShader=this.fragmentShader=r||"",c.update({fragmentShader:c.fragmentShader,vertexShader:c.vertexShader,uniforms:c.uniforms,patchMap:a,cacheKey:s}),Object.assign(this,c);const g=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(c));for(const y in g){const v=g[y];(v.get||v.set)&&Object.defineProperty(this,y,v)}return Object.defineProperty(this,"type",{get(){return l.type},set(y){l.type=y}}),this}update({fragmentShader:e,vertexShader:n,uniforms:r,cacheKey:i,patchMap:a}){const s=LG(n||""),o=LG(e||""),l=this;r&&(l.uniforms=r),n&&(l.vertexShader=n),e&&(l.fragmentShader=e),Object.entries(kRe).forEach(([f,m])=>{for(const g in m){const y=m[g];(o&&o.includes(y)||s&&s.includes(y))&&(l[f]||(l[f]=1))}});const u=l.__csm.prevOnBeforeCompile,c=(f,m,g)=>{let y,v="";if(m){const E=m.search(/void\s+main\s*\(\s*\)\s*{/);if(E!==-1){v=m.slice(0,E);let S=0,A=-1;for(let I=E;I>>0;return String(n)}function BRe(t){try{new t}catch(e){if(e.message.indexOf("is not a constructor")>=0)return!1}return!0}function LG(t){return t.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"")}let wT=class extends ii{constructor({baseMaterial:e,vertexShader:n,fragmentShader:r,uniforms:i,patchMap:a,cacheKey:s,...o}){if(!e)throw new Error("CustomShaderMaterial: baseMaterial is required.");let l;if(BRe(e)){const y=Object.keys(o).length===0;l=new e(y?void 0:o)}else l=e,Object.assign(l,o);if(["ShaderMaterial","RawShaderMaterial"].includes(l.type))throw new Error(`CustomShaderMaterial does not support ${l.type} as a base material.`);super(),this.uniforms={},this.vertexShader="",this.fragmentShader="";const c=l;c.name=`CustomShaderMaterial<${l.name||l.type}>`,c.update=this.update.bind(c),c.__csm={prevOnBeforeCompile:l.onBeforeCompile,baseMaterial:l,vertexShader:n,fragmentShader:r,uniforms:i,patchMap:a,cacheKey:s};const m={...c.uniforms||{},...i||{}};c.uniforms=this.uniforms=m,c.vertexShader=this.vertexShader=n||"",c.fragmentShader=this.fragmentShader=r||"",c.update({fragmentShader:c.fragmentShader,vertexShader:c.vertexShader,uniforms:c.uniforms,patchMap:a,cacheKey:s}),Object.assign(this,c);const g=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(c));for(const y in g){const v=g[y];(v.get||v.set)&&Object.defineProperty(this,y,v)}return Object.defineProperty(this,"type",{get(){return l.type},set(y){l.type=y}}),this}update({fragmentShader:e,vertexShader:n,uniforms:r,cacheKey:i,patchMap:a}){const s=LG(n||""),o=LG(e||""),l=this;r&&(l.uniforms=r),n&&(l.vertexShader=n),e&&(l.fragmentShader=e),Object.entries(kRe).forEach(([f,m])=>{for(const g in m){const y=m[g];(o&&o.includes(y)||s&&s.includes(y))&&(l[f]||(l[f]=1))}});const u=l.__csm.prevOnBeforeCompile,c=(f,m,g)=>{let y,v="";if(m){const E=m.search(/void\s+main\s*\(\s*\)\s*{/);if(E!==-1){v=m.slice(0,E);let _=0,A=-1;for(let I=E;I{for(const S in E){const A=S==="*"||s&&s.includes(S);if(S==="*"||o&&o.includes(S)||A){const T=DRe[S];if(T&&T!=="*"&&(Array.isArray(T)?!T.includes(y):T!==y)){console.error(`CustomShaderMaterial: ${S} is not available in ${y}. Shader cannot compile.`);return}const R=E[S];for(const O in R){const N=R[O];if(typeof N=="object"){const M=N.type,B=N.value;M==="fs"?f.fragmentShader=f.fragmentShader.replace(O,B):M==="vs"&&(f.vertexShader=f.vertexShader.replace(O,B))}else N&&(f.vertexShader=f.vertexShader.replace(O,N),f.fragmentShader=f.fragmentShader.replace(O,N))}}}};b(LRe),b(g),f.vertexShader=c(f.vertexShader,s,!1),f.fragmentShader=c(f.fragmentShader,o,!0),r&&(f.uniforms={...f.uniforms,...l.uniforms}),l.uniforms=f.uniforms};const d=l.customProgramCacheKey;l.customProgramCacheKey=()=>((i==null?void 0:i())||PRe((s||"")+(o||"")))+(d==null?void 0:d.call(l)),l.needsUpdate=!0}};const FRe={rembrandt:{main:[1,2,1],fill:[-2,-.5,-2]},portrait:{main:[-1,2,.5],fill:[-1,.5,-1.5]},upfront:{main:[0,2,1],fill:[-1,.5,-1.5]},soft:{main:[-2,4,4],fill:[-1,.5,-1.5]}};function URe({radius:t,adjustCamera:e}){const n=lK();return w.useEffect(()=>{e&&n.refresh().clip().fit()},[t,e]),null}function zRe({children:t,center:e,adjustCamera:n=!0,intensity:r=.5,shadows:i="contact",environment:a="city",preset:s="rembrandt",...o}){const l=typeof s=="string"?FRe[s]:s,[{radius:u,height:c},d]=w.useState({radius:0,width:0,height:0,depth:0}),f=(i==null?void 0:i.bias)??-1e-4,m=(i==null?void 0:i.normalBias)??0,g=(i==null?void 0:i.size)??1024,y=(i==null?void 0:i.offset)??0,v=i==="contact"||(i==null?void 0:i.type)==="contact",b=i==="accumulative"||(i==null?void 0:i.type)==="accumulative",E={...typeof i=="object"?i:{}},S=a?typeof a=="string"?{preset:a}:a:null,A=w.useCallback(I=>{const{width:T,height:R,depth:O,boundingSphere:N}=I;d({radius:N.radius,width:T,height:R,depth:O}),e!=null&&e.onCentered&&e.onCentered(I)},[]);return $.jsxs($.Fragment,{children:[$.jsx("ambientLight",{intensity:r/3}),$.jsx("spotLight",{penumbra:1,position:[l.main[0]*u,l.main[1]*u,l.main[2]*u],intensity:r*2,castShadow:!!i,"shadow-bias":f,"shadow-normalBias":m,"shadow-mapSize":g}),$.jsx("pointLight",{position:[l.fill[0]*u,l.fill[1]*u,l.fill[2]*u],intensity:r}),$.jsxs(oK,{fit:!!n,clip:!!n,margin:Number(n),observe:!0,...o,children:[$.jsx(URe,{radius:u,adjustCamera:n}),$.jsx(rK,{...e,position:[0,y/2,0],onCentered:A,children:t})]}),$.jsxs("group",{position:[0,-c/2-y/2,0],children:[$.jsx(w.Suspense,{children:v&&$.jsx(jD,{scale:u*4,far:u,blur:2,...E})}),$.jsx(w.Suspense,{children:b&&$.jsx(gK,{temporal:!0,frames:100,alphaTest:.9,toneMapped:!0,scale:u*4,...E,children:$.jsx(bK,{amount:E.amount??8,radius:E.radius??u,ambient:E.ambient??.5,intensity:E.intensity??1,position:[l.main[0]*u,l.main[1]*u,l.main[2]*u],size:u*4,bias:-f,mapSize:g})})})]}),$.jsx(w.Suspense,{children:a&&$.jsx(gy,{...S})})]})}class HRe extends wx{constructor(){super({baseMaterial:ya,metalness:1,roughness:0,anisotropy:1})}}function GRe(){const t=new HRe;return $.jsxs($.Fragment,{children:[$.jsx(Ff,{}),$.jsx(zRe,{adjustCamera:1.5,environment:{preset:"sunset",background:!0,blur:4},preset:"upfront",shadows:{type:"accumulative",colorBlend:2,alphaTest:.3,opacity:.6,radius:3},children:$.jsx(aK,{castShadow:!0,args:[1,32,32],material:t})})]})}const VRe=`\r +`+f.fragmentShader;const b=E=>{for(const _ in E){const A=_==="*"||s&&s.includes(_);if(_==="*"||o&&o.includes(_)||A){const x=DRe[_];if(x&&x!=="*"&&(Array.isArray(x)?!x.includes(y):x!==y)){console.error(`CustomShaderMaterial: ${_} is not available in ${y}. Shader cannot compile.`);return}const R=E[_];for(const O in R){const N=R[O];if(typeof N=="object"){const M=N.type,B=N.value;M==="fs"?f.fragmentShader=f.fragmentShader.replace(O,B):M==="vs"&&(f.vertexShader=f.vertexShader.replace(O,B))}else N&&(f.vertexShader=f.vertexShader.replace(O,N),f.fragmentShader=f.fragmentShader.replace(O,N))}}}};b(LRe),b(g),f.vertexShader=c(f.vertexShader,s,!1),f.fragmentShader=c(f.fragmentShader,o,!0),r&&(f.uniforms={...f.uniforms,...l.uniforms}),l.uniforms=f.uniforms};const d=l.customProgramCacheKey;l.customProgramCacheKey=()=>((i==null?void 0:i())||PRe((s||"")+(o||"")))+(d==null?void 0:d.call(l)),l.needsUpdate=!0}clone(){const e=this;return new e.constructor({baseMaterial:e.__csm.baseMaterial.clone(),vertexShader:e.__csm.vertexShader,fragmentShader:e.__csm.fragmentShader,uniforms:e.__csm.uniforms,patchMap:e.__csm.patchMap,cacheKey:e.__csm.cacheKey})}};const FRe={rembrandt:{main:[1,2,1],fill:[-2,-.5,-2]},portrait:{main:[-1,2,.5],fill:[-1,.5,-1.5]},upfront:{main:[0,2,1],fill:[-1,.5,-1.5]},soft:{main:[-2,4,4],fill:[-1,.5,-1.5]}};function URe({radius:t,adjustCamera:e}){const n=lK();return w.useEffect(()=>{e&&n.refresh().clip().fit()},[t,e]),null}function zRe({children:t,center:e,adjustCamera:n=!0,intensity:r=.5,shadows:i="contact",environment:a="city",preset:s="rembrandt",...o}){const l=typeof s=="string"?FRe[s]:s,[{radius:u,height:c},d]=w.useState({radius:0,width:0,height:0,depth:0}),f=(i==null?void 0:i.bias)??-1e-4,m=(i==null?void 0:i.normalBias)??0,g=(i==null?void 0:i.size)??1024,y=(i==null?void 0:i.offset)??0,v=i==="contact"||(i==null?void 0:i.type)==="contact",b=i==="accumulative"||(i==null?void 0:i.type)==="accumulative",E={...typeof i=="object"?i:{}},_=a?typeof a=="string"?{preset:a}:a:null,A=w.useCallback(I=>{const{width:x,height:R,depth:O,boundingSphere:N}=I;d({radius:N.radius,width:x,height:R,depth:O}),e!=null&&e.onCentered&&e.onCentered(I)},[]);return $.jsxs($.Fragment,{children:[$.jsx("ambientLight",{intensity:r/3}),$.jsx("spotLight",{penumbra:1,position:[l.main[0]*u,l.main[1]*u,l.main[2]*u],intensity:r*2,castShadow:!!i,"shadow-bias":f,"shadow-normalBias":m,"shadow-mapSize":g}),$.jsx("pointLight",{position:[l.fill[0]*u,l.fill[1]*u,l.fill[2]*u],intensity:r}),$.jsxs(oK,{fit:!!n,clip:!!n,margin:Number(n),observe:!0,...o,children:[$.jsx(URe,{radius:u,adjustCamera:n}),$.jsx(rK,{...e,position:[0,y/2,0],onCentered:A,children:t})]}),$.jsxs("group",{position:[0,-c/2-y/2,0],children:[$.jsx(w.Suspense,{children:v&&$.jsx(jD,{scale:u*4,far:u,blur:2,...E})}),$.jsx(w.Suspense,{children:b&&$.jsx(gK,{temporal:!0,frames:100,alphaTest:.9,toneMapped:!0,scale:u*4,...E,children:$.jsx(bK,{amount:E.amount??8,radius:E.radius??u,ambient:E.ambient??.5,intensity:E.intensity??1,position:[l.main[0]*u,l.main[1]*u,l.main[2]*u],size:u*4,bias:-f,mapSize:g})})})]}),$.jsx(w.Suspense,{children:a&&$.jsx(gy,{..._})})]})}class HRe extends wT{constructor(){super({baseMaterial:ya,metalness:1,roughness:0,anisotropy:1})}}function GRe(){const t=new HRe;return $.jsxs($.Fragment,{children:[$.jsx(Ff,{}),$.jsx(zRe,{adjustCamera:1.5,environment:{preset:"sunset",background:!0,blur:4},preset:"upfront",shadows:{type:"accumulative",colorBlend:2,alphaTest:.3,opacity:.6,radius:3},children:$.jsx(aK,{castShadow:!0,args:[1,32,32],material:t})})]})}const VRe=`\r varying vec2 vUv;\r \r void func1() {\r @@ -4697,20 +4697,20 @@ varying vec2 vUv;\r \r void main() {\r vUv = uv;\r -}`;function WRe(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function yK(...t){return e=>t.forEach(n=>WRe(n,e))}function Uf(...t){return w.useCallback(yK(...t),t)}var vK=w.forwardRef((t,e)=>{const{children:n,...r}=t,i=w.Children.toArray(n),a=i.find(jRe);if(a){const s=a.props.children,o=i.map(l=>l===a?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return $.jsx(XM,{...r,ref:e,children:w.isValidElement(s)?w.cloneElement(s,void 0,o):null})}return $.jsx(XM,{...r,ref:e,children:n})});vK.displayName="Slot";var XM=w.forwardRef((t,e)=>{const{children:n,...r}=t;if(w.isValidElement(n)){const i=qRe(n);return w.cloneElement(n,{...YRe(r,n.props),ref:e?yK(e,i):i})}return w.Children.count(n)>1?w.Children.only(null):null});XM.displayName="SlotClone";var EK=({children:t})=>$.jsx($.Fragment,{children:t});function jRe(t){return w.isValidElement(t)&&t.type===EK}function YRe(t,e){const n={...e};for(const r in e){const i=t[r],a=e[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{a(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...t,...n}}function qRe(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var XRe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],zc=XRe.reduce((t,e)=>{const n=w.forwardRef((r,i)=>{const{asChild:a,...s}=r,o=a?vK:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),$.jsx(o,{...s,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function KRe(t,e){t&&Mf.flushSync(()=>t.dispatchEvent(e))}var Af=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},ZRe="Portal",SK=w.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[i,a]=w.useState(!1);Af(()=>a(!0),[]);const s=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return s?DO.createPortal($.jsx(zc.div,{...r,ref:e}),s):null});SK.displayName=ZRe;var QRe=SK,kG=Object.prototype.hasOwnProperty;function Ob(t,e){var n,r;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&Ob(t[r],e[r]););return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(kG.call(t,n)&&++r&&!kG.call(e,n)||!(n in e)||!Ob(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}var Cx=function(e,n,r,i){this.name=e,this.fn=n,this.args=r,this.modifiers=i};Cx.prototype._test=function(e){var n=this.fn;try{Ih(this.modifiers.slice(),n,this)(e)}catch{n=function(){return!1}}try{return Ih(this.modifiers.slice(),n,this)(e)}catch{return!1}};Cx.prototype._check=function(e){try{Ih(this.modifiers.slice(),this.fn,this)(e)}catch{if(Ih(this.modifiers.slice(),function(r){return r},this)(!1))return}if(!Ih(this.modifiers.slice(),this.fn,this)(e))throw null};Cx.prototype._testAsync=function(e){var n=this;return new Promise(function(r,i){AK(n.modifiers.slice(),n.fn,n)(e).then(function(a){a?r(e):i(null)}).catch(function(a){return i(a)})})};function _K(t,e){return e===void 0&&(e="simple"),typeof t=="object"?t[e]:t}function Ih(t,e,n){if(t.length){var r=t.shift(),i=Ih(t,e,n);return r.perform(i,n)}else return _K(e)}function AK(t,e,n){if(t.length){var r=t.shift(),i=AK(t,e,n);return r.performAsync(i,n)}else return function(a){return Promise.resolve(_K(e,"async")(a))}}var JRe=function(e,n,r){this.name=e,this.perform=n,this.performAsync=r},YD=function(t){function e(n,r,i,a){for(var s=[],o=arguments.length-4;o-- >0;)s[o]=arguments[o+4];t.call(this,s),t.captureStackTrace&&t.captureStackTrace(this,e),this.rule=n,this.value=r,this.cause=i,this.target=a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),El=function(e,n){e===void 0&&(e=[]),n===void 0&&(n=[]),this.chain=e,this.nextRuleModifiers=n};El.prototype._applyRule=function(e,n){var r=this;return function(){for(var i=[],a=arguments.length;a--;)i[a]=arguments[a];return r.chain.push(new Cx(n,e.apply(r,i),i,r.nextRuleModifiers)),r.nextRuleModifiers=[],r}};El.prototype._applyModifier=function(e,n){return this.nextRuleModifiers.push(new JRe(n,e.simple,e.async)),this};El.prototype._clone=function(){return new El(this.chain.slice(),this.nextRuleModifiers.slice())};El.prototype.test=function(e){return this.chain.every(function(n){return n._test(e)})};El.prototype.testAll=function(e){var n=[];return this.chain.forEach(function(r){try{r._check(e)}catch(i){n.push(new YD(r,e,i))}}),n};El.prototype.check=function(e){this.chain.forEach(function(n){try{n._check(e)}catch(r){throw new YD(n,e,r)}})};El.prototype.testAsync=function(e){var n=this;return new Promise(function(r,i){TK(e,n.chain.slice(),r,i)})};function TK(t,e,n,r){if(e.length){var i=e.shift();i._testAsync(t).then(function(){TK(t,e,n,r)},function(a){r(new YD(i,t,a))})}else n(t)}var PG=function(t,e){return e&&typeof t=="string"&&t.trim().length===0?!0:t==null};function eIe(t,e){return e===void 0&&(e=!1),{simple:function(n){return PG(n,e)||t.check(n)===void 0},async:function(n){return PG(n,e)||t.testAsync(n)}}}function Ja(){return typeof Proxy<"u"?xK(new El):KM(new El)}var Db={};Ja.extend=function(t){Object.assign(Db,t)};Ja.clearCustomRules=function(){Db={}};function xK(t){return new Proxy(t,{get:function(n,r){if(r in n)return n[r];var i=xK(t._clone());if(r in RA)return i._applyModifier(RA[r],r);if(r in Db)return i._applyRule(Db[r],r);if(r in ZM)return i._applyRule(ZM[r],r)}})}function KM(t){var e=function(i,a){return Object.keys(i).forEach(function(s){a[s]=function(){for(var o=[],l=arguments.length;l--;)o[l]=arguments[l];var u=KM(a._clone()),c=u._applyRule(i[s],s).apply(void 0,o);return c}}),a},n=e(ZM,t),r=e(Db,n);return Object.keys(RA).forEach(function(i){Object.defineProperty(r,i,{get:function(){var a=KM(r._clone());return a._applyModifier(RA[i],i)}})}),r}var RA={not:{simple:function(t){return function(e){return!t(e)}},async:function(t){return function(e){return Promise.resolve(t(e)).then(function(n){return!n}).catch(function(){return!0})}}},some:{simple:function(t){return function(e){return QE(e).some(function(n){try{return t(n)}catch{return!1}})}},async:function(t){return function(e){return Promise.all(QE(e).map(function(n){try{return t(n).catch(function(){return!1})}catch{return!1}})).then(function(n){return n.some(Boolean)})}}},every:{simple:function(t){return function(e){return e!==!1&&QE(e).every(t)}},async:function(t){return function(e){return Promise.all(QE(e).map(t)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(t,e){return function(n){return BG(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&t(n):t(n)}},async:function(t,e){return function(n){return Promise.resolve(t(n)).then(function(r){return BG(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&r:r}).catch(function(){return!1})}}}};function BG(t){return t&&t.name==="schema"&&t.args.length>0&&typeof t.args[0]=="object"}function QE(t){return typeof t=="string"?t.split(""):t}var ZM={equal:function(t){return function(e){return e==t}},exact:function(t){return function(e){return e===t}},number:function(t){return t===void 0&&(t=!0),function(e){return typeof e=="number"&&(t||isFinite(e))}},integer:function(){return function(t){var e=Number.isInteger||tIe;return e(t)}},numeric:function(){return function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},string:function(){return Lp("string")},boolean:function(){return Lp("boolean")},undefined:function(){return Lp("undefined")},null:function(){return Lp("null")},array:function(){return Lp("array")},object:function(){return Lp("object")},instanceOf:function(t){return function(e){return e instanceof t}},pattern:function(t){return function(e){return t.test(e)}},lowercase:function(){return function(t){return typeof t=="boolean"||t===t.toLowerCase()&&t.trim()!==""}},uppercase:function(){return function(t){return t===t.toUpperCase()&&t.trim()!==""}},vowel:function(){return function(t){return/^[aeiou]+$/i.test(t)}},consonant:function(){return function(t){return/^(?=[^aeiou])([a-z]+)$/i.test(t)}},first:function(t){return function(e){return e[0]==t}},last:function(t){return function(e){return e[e.length-1]==t}},empty:function(){return function(t){return t.length===0}},length:function(t,e){return function(n){return n.length>=t&&n.length<=(e||t)}},minLength:function(t){return function(e){return e.length>=t}},maxLength:function(t){return function(e){return e.length<=t}},negative:function(){return function(t){return t<0}},positive:function(){return function(t){return t>=0}},between:function(t,e){return function(n){return n>=t&&n<=e}},range:function(t,e){return function(n){return n>=t&&n<=e}},lessThan:function(t){return function(e){return et}},greaterThanOrEqual:function(t){return function(e){return e>=t}},even:function(){return function(t){return t%2===0}},odd:function(){return function(t){return t%2!==0}},includes:function(t){return function(e){return~e.indexOf(t)}},schema:function(t){return nIe(t)},passesAnyOf:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(n){return t.some(function(r){return r.test(n)})}},optional:eIe};function Lp(t){return function(e){return Array.isArray(e)&&t==="array"||e===null&&t==="null"||typeof e===t}}function tIe(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}function nIe(t){return{simple:function(e){var n=[];if(Object.keys(t).forEach(function(r){var i=t[r];try{i.check((e||{})[r])}catch(a){a.target=r,n.push(a)}}),n.length>0)throw n;return!0},async:function(e){var n=[],r=Object.keys(t).map(function(i){var a=t[i];return a.testAsync((e||{})[i]).catch(function(s){s.target=i,n.push(s)})});return Promise.all(r).then(function(){if(n.length>0)throw n;return!0})}}}var ur="colors",xa="sizes",Yt="space",rIe={gap:Yt,gridGap:Yt,columnGap:Yt,gridColumnGap:Yt,rowGap:Yt,gridRowGap:Yt,inset:Yt,insetBlock:Yt,insetBlockEnd:Yt,insetBlockStart:Yt,insetInline:Yt,insetInlineEnd:Yt,insetInlineStart:Yt,margin:Yt,marginTop:Yt,marginRight:Yt,marginBottom:Yt,marginLeft:Yt,marginBlock:Yt,marginBlockEnd:Yt,marginBlockStart:Yt,marginInline:Yt,marginInlineEnd:Yt,marginInlineStart:Yt,padding:Yt,paddingTop:Yt,paddingRight:Yt,paddingBottom:Yt,paddingLeft:Yt,paddingBlock:Yt,paddingBlockEnd:Yt,paddingBlockStart:Yt,paddingInline:Yt,paddingInlineEnd:Yt,paddingInlineStart:Yt,top:Yt,right:Yt,bottom:Yt,left:Yt,scrollMargin:Yt,scrollMarginTop:Yt,scrollMarginRight:Yt,scrollMarginBottom:Yt,scrollMarginLeft:Yt,scrollMarginX:Yt,scrollMarginY:Yt,scrollMarginBlock:Yt,scrollMarginBlockEnd:Yt,scrollMarginBlockStart:Yt,scrollMarginInline:Yt,scrollMarginInlineEnd:Yt,scrollMarginInlineStart:Yt,scrollPadding:Yt,scrollPaddingTop:Yt,scrollPaddingRight:Yt,scrollPaddingBottom:Yt,scrollPaddingLeft:Yt,scrollPaddingX:Yt,scrollPaddingY:Yt,scrollPaddingBlock:Yt,scrollPaddingBlockEnd:Yt,scrollPaddingBlockStart:Yt,scrollPaddingInline:Yt,scrollPaddingInlineEnd:Yt,scrollPaddingInlineStart:Yt,fontSize:"fontSizes",background:ur,backgroundColor:ur,backgroundImage:ur,borderImage:ur,border:ur,borderBlock:ur,borderBlockEnd:ur,borderBlockStart:ur,borderBottom:ur,borderBottomColor:ur,borderColor:ur,borderInline:ur,borderInlineEnd:ur,borderInlineStart:ur,borderLeft:ur,borderLeftColor:ur,borderRight:ur,borderRightColor:ur,borderTop:ur,borderTopColor:ur,caretColor:ur,color:ur,columnRuleColor:ur,fill:ur,outline:ur,outlineColor:ur,stroke:ur,textDecorationColor:ur,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:xa,minBlockSize:xa,maxBlockSize:xa,inlineSize:xa,minInlineSize:xa,maxInlineSize:xa,width:xa,minWidth:xa,maxWidth:xa,height:xa,minHeight:xa,maxHeight:xa,flexBasis:xa,gridTemplateColumns:xa,gridTemplateRows:xa,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},iIe=(t,e)=>typeof e=="function"?{"()":Function.prototype.toString.call(e)}:e,Am=()=>{const t=Object.create(null);return(e,n,...r)=>{const i=(a=>JSON.stringify(a,iIe))(e);return i in t?t[i]:t[i]=n(e,...r)}},nf=Symbol.for("sxs.internal"),qD=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),FG=t=>{for(const e in t)return!0;return!1},{hasOwnProperty:aIe}=Object.prototype,QM=t=>t.includes("-")?t:t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),sIe=/\s+(?![^()]*\))/,kp=t=>e=>t(...typeof e=="string"?String(e).split(sIe):[e]),UG={appearance:t=>({WebkitAppearance:t,appearance:t}),backfaceVisibility:t=>({WebkitBackfaceVisibility:t,backfaceVisibility:t}),backdropFilter:t=>({WebkitBackdropFilter:t,backdropFilter:t}),backgroundClip:t=>({WebkitBackgroundClip:t,backgroundClip:t}),boxDecorationBreak:t=>({WebkitBoxDecorationBreak:t,boxDecorationBreak:t}),clipPath:t=>({WebkitClipPath:t,clipPath:t}),content:t=>({content:t.includes('"')||t.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(t)?t:`"${t}"`}),hyphens:t=>({WebkitHyphens:t,hyphens:t}),maskImage:t=>({WebkitMaskImage:t,maskImage:t}),maskSize:t=>({WebkitMaskSize:t,maskSize:t}),tabSize:t=>({MozTabSize:t,tabSize:t}),textSizeAdjust:t=>({WebkitTextSizeAdjust:t,textSizeAdjust:t}),userSelect:t=>({WebkitUserSelect:t,userSelect:t}),marginBlock:kp((t,e)=>({marginBlockStart:t,marginBlockEnd:e||t})),marginInline:kp((t,e)=>({marginInlineStart:t,marginInlineEnd:e||t})),maxSize:kp((t,e)=>({maxBlockSize:t,maxInlineSize:e||t})),minSize:kp((t,e)=>({minBlockSize:t,minInlineSize:e||t})),paddingBlock:kp((t,e)=>({paddingBlockStart:t,paddingBlockEnd:e||t})),paddingInline:kp((t,e)=>({paddingInlineStart:t,paddingInlineEnd:e||t}))},ER=/([\d.]+)([^]*)/,oIe=(t,e)=>t.length?t.reduce((n,r)=>(n.push(...e.map(i=>i.includes("&")?i.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(i)?`:is(${r})`:r):r+" "+i)),n),[]):e,lIe=(t,e)=>t in uIe&&typeof e=="string"?e.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,r,i,a)=>r+(i==="stretch"?`-moz-available${a};${QM(t)}:${r}-webkit-fill-available`:`-moz-fit-content${a};${QM(t)}:${r}fit-content`)+a):String(e),uIe={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},bu=t=>t?t+"-":"",wK=(t,e,n)=>t.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(r,i,a,s,o)=>s=="$"==!!a?r:(i||s=="--"?"calc(":"")+"var(--"+(s==="$"?bu(e)+(o.includes("$")?"":bu(n))+o.replace(/\$/g,"-"):o)+")"+(i||s=="--"?"*"+(i||"")+(a||"1")+")":"")),cIe=/\s*,\s*(?![^()]*\))/,dIe=Object.prototype.toString,fh=(t,e,n,r,i)=>{let a,s,o;const l=(u,c,d)=>{let f,m;const g=y=>{for(f in y){const E=f.charCodeAt(0)===64,S=E&&Array.isArray(y[f])?y[f]:[y[f]];for(m of S){const A=/[A-Z]/.test(b=f)?b:b.replace(/-[^]/g,T=>T[1].toUpperCase()),I=typeof m=="object"&&m&&m.toString===dIe&&(!r.utils[A]||!c.length);if(A in r.utils&&!I){const T=r.utils[A];if(T!==s){s=T,g(T(m)),s=null;continue}}else if(A in UG){const T=UG[A];if(T!==o){o=T,g(T(m)),o=null;continue}}if(E&&(v=f.slice(1)in r.media?"@media "+r.media[f.slice(1)]:f,f=v.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(T,R,O,N,M,B)=>{const G=ER.test(R),W=.0625*(G?-1:1),[K,se]=G?[N,R]:[R,N];return"("+(O[0]==="="?"":O[0]===">"===G?"max-":"min-")+K+":"+(O[0]!=="="&&O.length===1?se.replace(ER,(ae,ee,F)=>Number(ee)+W*(O===">"?1:-1)+F):se)+(M?") and ("+(M[0]===">"?"min-":"max-")+K+":"+(M.length===1?B.replace(ER,(ae,ee,F)=>Number(ee)+W*(M===">"?-1:1)+F):B):"")+")"})),I){const T=E?d.concat(f):[...d],R=E?[...c]:oIe(c,f.split(cIe));a!==void 0&&i(zG(...a)),a=void 0,l(m,R,T)}else a===void 0&&(a=[[],c,d]),f=E||f.charCodeAt(0)!==36?f:`--${bu(r.prefix)}${f.slice(1).replace(/\$/g,"-")}`,m=I?m:typeof m=="number"?m&&A in fIe?String(m)+"px":String(m):wK(lIe(A,m??""),r.prefix,r.themeMap[A]),a[0].push(`${E?`${f} `:`${QM(f)}:`}${m}`)}}var v,b};g(u),a!==void 0&&i(zG(...a)),a=void 0};l(t,e,n)},zG=(t,e,n)=>`${n.map(r=>`${r}{`).join("")}${e.length?`${e.join(",")}{`:""}${t.join(";")}${e.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,fIe={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},HG=t=>String.fromCharCode(t+(t>25?39:97)),rf=t=>(e=>{let n,r="";for(n=Math.abs(e);n>52;n=n/52|0)r=HG(n%52)+r;return HG(n%52)+r})(((e,n)=>{let r=n.length;for(;r;)e=33*e^n.charCodeAt(--r);return e})(5381,JSON.stringify(t))>>>0),i0=["themed","global","styled","onevar","resonevar","allvar","inline"],pIe=t=>{if(t.href&&!t.href.startsWith(location.origin))return!1;try{return!!t.cssRules}catch{return!1}},hIe=t=>{let e;const n=()=>{const{cssRules:i}=e.sheet;return[].map.call(i,(a,s)=>{const{cssText:o}=a;let l="";if(o.startsWith("--sxs"))return"";if(i[s-1]&&(l=i[s-1].cssText).startsWith("--sxs")){if(!a.cssRules.length)return"";for(const u in e.rules)if(e.rules[u].group===a)return`--sxs{--sxs:${[...e.rules[u].cache].join(" ")}}${o}`;return a.cssRules.length?`${l}${o}`:""}return o}).join("")},r=()=>{if(e){const{rules:o,sheet:l}=e;if(!l.deleteRule){for(;Object(Object(l.cssRules)[0]).type===3;)l.cssRules.splice(0,1);l.cssRules=[]}for(const u in o)delete o[u]}const i=Object(t).styleSheets||[];for(const o of i)if(pIe(o)){for(let l=0,u=o.cssRules;u[l];++l){const c=Object(u[l]);if(c.type!==1)continue;const d=Object(u[l+1]);if(d.type!==4)continue;++l;const{cssText:f}=c;if(!f.startsWith("--sxs"))continue;const m=f.slice(14,-3).trim().split(/\s+/),g=i0[m[0]];g&&(e||(e={sheet:o,reset:r,rules:{},toString:n}),e.rules[g]={group:d,index:l,cache:new Set(m)})}if(e)break}if(!e){const o=(l,u)=>({type:u,cssRules:[],insertRule(c,d){this.cssRules.splice(d,0,o(c,{import:3,undefined:1}[(c.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return l==="@media{}"?`@media{${[].map.call(this.cssRules,c=>c.cssText).join("")}}`:l}});e={sheet:t?(t.head||t).appendChild(document.createElement("style")).sheet:o("","text/css"),rules:{},reset:r,toString:n}}const{sheet:a,rules:s}=e;for(let o=i0.length-1;o>=0;--o){const l=i0[o];if(!s[l]){const u=i0[o+1],c=s[u]?s[u].index:a.cssRules.length;a.insertRule("@media{}",c),a.insertRule(`--sxs{--sxs:${o}}`,c),s[l]={group:a.cssRules[c+1],index:c,cache:new Set([o])}}mIe(s[l])}};return r(),e},mIe=t=>{const e=t.group;let n=e.cssRules.length;t.apply=r=>{try{e.insertRule(r,n),++n}catch{}}},Bg=Symbol(),gIe=Am(),GG=(t,e)=>gIe(t,()=>(...n)=>{let r={type:null,composers:new Set};for(const i of n)if(i!=null)if(i[nf]){r.type==null&&(r.type=i[nf].type);for(const a of i[nf].composers)r.composers.add(a)}else i.constructor!==Object||i.$$typeof?r.type==null&&(r.type=i):r.composers.add(bIe(i,t));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),yIe(t,r,e)}),bIe=({variants:t,compoundVariants:e,defaultVariants:n,...r},i)=>{const a=`${bu(i.prefix)}c-${rf(r)}`,s=[],o=[],l=Object.create(null),u=[];for(const f in n)l[f]=String(n[f]);if(typeof t=="object"&&t)for(const f in t){c=l,d=f,aIe.call(c,d)||(l[f]="undefined");const m=t[f];for(const g in m){const y={[f]:String(g)};String(g)==="undefined"&&u.push(f);const v=m[g],b=[y,v,!FG(v)];s.push(b)}}var c,d;if(typeof e=="object"&&e)for(const f of e){let{css:m,...g}=f;m=typeof m=="object"&&m||{};for(const v in g)g[v]=String(g[v]);const y=[g,m,!FG(m)];o.push(y)}return[a,r,s,o,l,u]},yIe=(t,e,n)=>{const[r,i,a,s]=vIe(e.composers),o=typeof e.type=="function"||e.type.$$typeof?(d=>{function f(){for(let m=0;mf.rules[m]={apply:g=>f[Bg].push([m,g])}),f})(n):null,l=(o||n).rules,u=`.${r}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,c=d=>{d=typeof d=="object"&&d||EIe;const{css:f,...m}=d,g={};for(const b in a)if(delete m[b],b in d){let E=d[b];typeof E=="object"&&E?g[b]={"@initial":a[b],...E}:(E=String(E),g[b]=E!=="undefined"||s.has(b)?E:a[b])}else g[b]=a[b];const y=new Set([...i]);for(const[b,E,S,A]of e.composers){n.rules.styled.cache.has(b)||(n.rules.styled.cache.add(b),fh(E,[`.${b}`],[],t,R=>{l.styled.apply(R)}));const I=VG(S,g,t.media),T=VG(A,g,t.media,!0);for(const R of I)if(R!==void 0)for(const[O,N,M]of R){const B=`${b}-${rf(N)}-${O}`;y.add(B);const G=(M?n.rules.resonevar:n.rules.onevar).cache,W=M?l.resonevar:l.onevar;G.has(B)||(G.add(B),fh(N,[`.${B}`],[],t,K=>{W.apply(K)}))}for(const R of T)if(R!==void 0)for(const[O,N]of R){const M=`${b}-${rf(N)}-${O}`;y.add(M),n.rules.allvar.cache.has(M)||(n.rules.allvar.cache.add(M),fh(N,[`.${M}`],[],t,B=>{l.allvar.apply(B)}))}}if(typeof f=="object"&&f){const b=`${r}-i${rf(f)}-css`;y.add(b),n.rules.inline.cache.has(b)||(n.rules.inline.cache.add(b),fh(f,[`.${b}`],[],t,E=>{l.inline.apply(E)}))}for(const b of String(d.className||"").trim().split(/\s+/))b&&y.add(b);const v=m.className=[...y].join(" ");return{type:e.type,className:v,selector:u,props:m,toString:()=>v,deferredInjector:o}};return qD(c,{className:r,selector:u,[nf]:e,toString:()=>(n.rules.styled.cache.has(r)||c(),r)})},vIe=t=>{let e="";const n=[],r={},i=[];for(const[a,,,,s,o]of t){e===""&&(e=a),n.push(a),i.push(...o);for(const l in s){const u=s[l];(r[l]===void 0||u!=="undefined"||o.includes(u))&&(r[l]=u)}}return[e,n,r,new Set(i)]},VG=(t,e,n,r)=>{const i=[];e:for(let[a,s,o]of t){if(o)continue;let l,u=0,c=!1;for(l in a){const d=a[l];let f=e[l];if(f!==d){if(typeof f!="object"||!f)continue e;{let m,g,y=0;for(const v in f){if(d===String(f[v])){if(v!=="@initial"){const b=v.slice(1);(g=g||[]).push(b in n?n[b]:v.replace(/^@media ?/,"")),c=!0}u+=y,m=!0}++y}if(g&&g.length&&(s={["@media "+g.join(", ")]:s}),!m)continue e}}}(i[u]=i[u]||[]).push([r?"cv":`${l}-${a[l]}`,s,c])}return i},EIe={},SIe=Am(),_Ie=(t,e)=>SIe(t,()=>(...n)=>{const r=()=>{for(let i of n){i=typeof i=="object"&&i||{};let a=rf(i);if(!e.rules.global.cache.has(a)){if(e.rules.global.cache.add(a),"@import"in i){let s=[].indexOf.call(e.sheet.cssRules,e.rules.themed.group)-1;for(let o of[].concat(i["@import"]))o=o.includes('"')||o.includes("'")?o:`"${o}"`,e.sheet.insertRule(`@import ${o};`,s++);delete i["@import"]}fh(i,[],[],t,s=>{e.rules.global.apply(s)})}}return""};return qD(r,{toString:r})}),AIe=Am(),TIe=(t,e)=>AIe(t,()=>n=>{const r=`${bu(t.prefix)}k-${rf(n)}`,i=()=>{if(!e.rules.global.cache.has(r)){e.rules.global.cache.add(r);const a=[];fh(n,[],[],t,o=>a.push(o));const s=`@keyframes ${r}{${a.join("")}}`;e.rules.global.apply(s)}return r};return qD(i,{get name(){return i()},toString:i})}),xIe=class{constructor(t,e,n,r){this.token=t==null?"":String(t),this.value=e==null?"":String(e),this.scale=n==null?"":String(n),this.prefix=r==null?"":String(r)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+bu(this.prefix)+bu(this.scale)+this.token}toString(){return this.computedValue}},wIe=Am(),CIe=(t,e)=>wIe(t,()=>(n,r)=>{r=typeof n=="object"&&n||Object(r);const i=`.${n=(n=typeof n=="string"?n:"")||`${bu(t.prefix)}t-${rf(r)}`}`,a={},s=[];for(const l in r){a[l]={};for(const u in r[l]){const c=`--${bu(t.prefix)}${l}-${u}`,d=wK(String(r[l][u]),t.prefix,l);a[l][u]=new xIe(u,d,l,t.prefix),s.push(`${c}:${d}`)}}const o=()=>{if(s.length&&!e.rules.themed.cache.has(n)){e.rules.themed.cache.add(n);const l=`${r===t.theme?":root,":""}.${n}{${s.join(";")}}`;e.rules.themed.apply(l)}return n};return{...a,get className(){return o()},selector:i,toString:o}}),RIe=Am(),IIe=Am(),MIe=t=>{const e=(n=>{let r=!1;const i=RIe(n,a=>{r=!0;const s="prefix"in(a=typeof a=="object"&&a||{})?String(a.prefix):"",o=typeof a.media=="object"&&a.media||{},l=typeof a.root=="object"?a.root||null:globalThis.document||null,u=typeof a.theme=="object"&&a.theme||{},c={prefix:s,media:o,theme:u,themeMap:typeof a.themeMap=="object"&&a.themeMap||{...rIe},utils:typeof a.utils=="object"&&a.utils||{}},d=hIe(l),f={css:GG(c,d),globalCss:_Ie(c,d),keyframes:TIe(c,d),createTheme:CIe(c,d),reset(){d.reset(),f.theme.toString()},theme:{},sheet:d,config:c,prefix:s,getCssText:d.toString,toString:d.toString};return String(f.theme=f.createTheme(u)),f});return r||i.reset(),i})(t);return e.styled=(({config:n,sheet:r})=>IIe(n,()=>{const i=GG(n,r);return(...a)=>{const s=i(...a),o=s[nf].type,l=pe.forwardRef((u,c)=>{const d=u&&u.as||o,{props:f,deferredInjector:m}=s(u);return delete f.as,f.ref=c,m?pe.createElement(pe.Fragment,null,pe.createElement(d,f),pe.createElement(m,null)):pe.createElement(d,f)});return l.className=s.className,l.displayName=`Styled.${o.displayName||o.name||o}`,l.selector=s.selector,l.toString=()=>s.selector,l[nf]=s[nf],l}}))(e),e};function Gl(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function NIe(t,e=[]){let n=[];function r(a,s){const o=w.createContext(s),l=n.length;n=[...n,s];const u=d=>{var b;const{scope:f,children:m,...g}=d,y=((b=f==null?void 0:f[t])==null?void 0:b[l])||o,v=w.useMemo(()=>g,Object.values(g));return $.jsx(y.Provider,{value:v,children:m})};u.displayName=a+"Provider";function c(d,f){var y;const m=((y=f==null?void 0:f[t])==null?void 0:y[l])||o,g=w.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[u,c]}const i=()=>{const a=n.map(s=>w.createContext(s));return function(o){const l=(o==null?void 0:o[t])||a;return w.useMemo(()=>({[`__scope${t}`]:{...o,[t]:l}}),[o,l])}};return i.scopeName=t,[r,OIe(i,...e)]}function OIe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:l,scopeName:u})=>{const d=l(a)[`__scope${u}`];return{...o,...d}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}function Tm(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function DIe(t,e=globalThis==null?void 0:globalThis.document){const n=Tm(t);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var LIe="DismissableLayer",JM="dismissableLayer.update",kIe="dismissableLayer.pointerDownOutside",PIe="dismissableLayer.focusOutside",$G,CK=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),RK=w.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:o,...l}=t,u=w.useContext(CK),[c,d]=w.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=w.useState({}),g=Uf(e,R=>d(R)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),E=c?y.indexOf(c):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,A=E>=b,I=UIe(R=>{const O=R.target,N=[...u.branches].some(M=>M.contains(O));!A||N||(i==null||i(R),s==null||s(R),R.defaultPrevented||o==null||o())},f),T=zIe(R=>{const O=R.target;[...u.branches].some(M=>M.contains(O))||(a==null||a(R),s==null||s(R),R.defaultPrevented||o==null||o())},f);return DIe(R=>{E===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},f),w.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&($G=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),WG(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=$G)}},[c,f,n,u]),w.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),WG())},[c,u]),w.useEffect(()=>{const R=()=>m({});return document.addEventListener(JM,R),()=>document.removeEventListener(JM,R)},[]),$.jsx(zc.div,{...l,ref:g,style:{pointerEvents:S?A?"auto":"none":void 0,...t.style},onFocusCapture:Gl(t.onFocusCapture,T.onFocusCapture),onBlurCapture:Gl(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Gl(t.onPointerDownCapture,I.onPointerDownCapture)})});RK.displayName=LIe;var BIe="DismissableLayerBranch",FIe=w.forwardRef((t,e)=>{const n=w.useContext(CK),r=w.useRef(null),i=Uf(e,r);return w.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),$.jsx(zc.div,{...t,ref:i})});FIe.displayName=BIe;function UIe(t,e=globalThis==null?void 0:globalThis.document){const n=Tm(t),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const a=o=>{if(o.target&&!r.current){let l=function(){IK(kIe,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",a),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function zIe(t,e=globalThis==null?void 0:globalThis.document){const n=Tm(t),r=w.useRef(!1);return w.useEffect(()=>{const i=a=>{a.target&&!r.current&&IK(PIe,n,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function WG(){const t=new CustomEvent(JM);document.dispatchEvent(t)}function IK(t,e,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?KRe(i,a):i.dispatchEvent(a)}var HIe=QS.useId||(()=>{}),GIe=0;function VIe(t){const[e,n]=w.useState(HIe());return Af(()=>{n(r=>r??String(GIe++))},[t]),e?`radix-${e}`:""}const $Ie=["top","right","bottom","left"],Rc=Math.min,gs=Math.max,IA=Math.round,JE=Math.floor,ml=t=>({x:t,y:t}),WIe={left:"right",right:"left",bottom:"top",top:"bottom"},jIe={start:"end",end:"start"};function eN(t,e,n){return gs(t,Rc(e,n))}function yu(t,e){return typeof t=="function"?t(e):t}function vu(t){return t.split("-")[0]}function xm(t){return t.split("-")[1]}function XD(t){return t==="x"?"y":"x"}function KD(t){return t==="y"?"height":"width"}function Ic(t){return["top","bottom"].includes(vu(t))?"y":"x"}function ZD(t){return XD(Ic(t))}function YIe(t,e,n){n===void 0&&(n=!1);const r=xm(t),i=ZD(t),a=KD(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=MA(s)),[s,MA(s)]}function qIe(t){const e=MA(t);return[tN(t),e,tN(e)]}function tN(t){return t.replace(/start|end/g,e=>jIe[e])}function XIe(t,e,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?a:s;default:return[]}}function KIe(t,e,n,r){const i=xm(t);let a=XIe(vu(t),n==="start",r);return i&&(a=a.map(s=>s+"-"+i),e&&(a=a.concat(a.map(tN)))),a}function MA(t){return t.replace(/left|right|bottom|top/g,e=>WIe[e])}function ZIe(t){return{top:0,right:0,bottom:0,left:0,...t}}function MK(t){return typeof t!="number"?ZIe(t):{top:t,right:t,bottom:t,left:t}}function NA(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function jG(t,e,n){let{reference:r,floating:i}=t;const a=Ic(e),s=ZD(e),o=KD(s),l=vu(e),u=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[o]/2-i[o]/2;let m;switch(l){case"top":m={x:c,y:r.y-i.height};break;case"bottom":m={x:c,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-i.width,y:d};break;default:m={x:r.x,y:r.y}}switch(xm(e)){case"start":m[s]-=f*(n&&u?-1:1);break;case"end":m[s]+=f*(n&&u?-1:1);break}return m}const QIe=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:s}=n,o=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let u=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:d}=jG(u,r,l),f=r,m={},g=0;for(let y=0;y({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:a,platform:s,elements:o,middlewareData:l}=e,{element:u,padding:c=0}=yu(t,e)||{};if(u==null)return{};const d=MK(c),f={x:n,y:r},m=ZD(i),g=KD(m),y=await s.getDimensions(u),v=m==="y",b=v?"top":"left",E=v?"bottom":"right",S=v?"clientHeight":"clientWidth",A=a.reference[g]+a.reference[m]-f[m]-a.floating[g],I=f[m]-a.reference[m],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let R=T?T[S]:0;(!R||!await(s.isElement==null?void 0:s.isElement(T)))&&(R=o.floating[S]||a.floating[g]);const O=A/2-I/2,N=R/2-y[g]/2-1,M=Rc(d[b],N),B=Rc(d[E],N),G=M,W=R-y[g]-B,K=R/2-y[g]/2+O,se=eN(G,K,W),ae=!l.arrow&&xm(i)!=null&&K!==se&&a.reference[g]/2-(KK<=0)){var B,G;const K=(((B=a.flip)==null?void 0:B.index)||0)+1,se=R[K];if(se)return{data:{index:K,overflows:M},reset:{placement:se}};let ae=(G=M.filter(ee=>ee.overflows[0]<=0).sort((ee,F)=>ee.overflows[1]-F.overflows[1])[0])==null?void 0:G.placement;if(!ae)switch(m){case"bestFit":{var W;const ee=(W=M.filter(F=>{if(T){const ie=Ic(F.placement);return ie===E||ie==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(ie=>ie>0).reduce((ie,J)=>ie+J,0)]).sort((F,ie)=>F[1]-ie[1])[0])==null?void 0:W[0];ee&&(ae=ee);break}case"initialPlacement":ae=o;break}if(i!==ae)return{reset:{placement:ae}}}return{}}}};function YG(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function qG(t){return $Ie.some(e=>t[e]>=0)}const tMe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=yu(t,e);switch(r){case"referenceHidden":{const a=await Lb(e,{...i,elementContext:"reference"}),s=YG(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:qG(s)}}}case"escaped":{const a=await Lb(e,{...i,altBoundary:!0}),s=YG(a,n.floating);return{data:{escapedOffsets:s,escaped:qG(s)}}}default:return{}}}}};async function nMe(t,e){const{placement:n,platform:r,elements:i}=t,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=vu(n),o=xm(n),l=Ic(n)==="y",u=["left","top"].includes(s)?-1:1,c=a&&l?-1:1,d=yu(e,t);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof g=="number"&&(m=o==="end"?g*-1:g),l?{x:m*c,y:f*u}:{x:f*u,y:m*c}}const rMe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:a,placement:s,middlewareData:o}=e,l=await nMe(e,t);return s===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:s}}}}},iMe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:o={fn:v=>{let{x:b,y:E}=v;return{x:b,y:E}}},...l}=yu(t,e),u={x:n,y:r},c=await Lb(e,l),d=Ic(vu(i)),f=XD(d);let m=u[f],g=u[d];if(a){const v=f==="y"?"top":"left",b=f==="y"?"bottom":"right",E=m+c[v],S=m-c[b];m=eN(E,m,S)}if(s){const v=d==="y"?"top":"left",b=d==="y"?"bottom":"right",E=g+c[v],S=g-c[b];g=eN(E,g,S)}const y=o.fn({...e,[f]:m,[d]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:a,[d]:s}}}}}},aMe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:a,middlewareData:s}=e,{offset:o=0,mainAxis:l=!0,crossAxis:u=!0}=yu(t,e),c={x:n,y:r},d=Ic(i),f=XD(d);let m=c[f],g=c[d];const y=yu(o,e),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const S=f==="y"?"height":"width",A=a.reference[f]-a.floating[S]+v.mainAxis,I=a.reference[f]+a.reference[S]-v.mainAxis;mI&&(m=I)}if(u){var b,E;const S=f==="y"?"width":"height",A=["top","left"].includes(vu(i)),I=a.reference[d]-a.floating[S]+(A&&((b=s.offset)==null?void 0:b[d])||0)+(A?0:v.crossAxis),T=a.reference[d]+a.reference[S]+(A?0:((E=s.offset)==null?void 0:E[d])||0)-(A?v.crossAxis:0);gT&&(g=T)}return{[f]:m,[d]:g}}}},sMe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:a,platform:s,elements:o}=e,{apply:l=()=>{},...u}=yu(t,e),c=await Lb(e,u),d=vu(i),f=xm(i),m=Ic(i)==="y",{width:g,height:y}=a.floating;let v,b;d==="top"||d==="bottom"?(v=d,b=f===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(b=d,v=f==="end"?"top":"bottom");const E=y-c.top-c.bottom,S=g-c.left-c.right,A=Rc(y-c[v],E),I=Rc(g-c[b],S),T=!e.middlewareData.shift;let R=A,O=I;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(R=E),T&&!f){const M=gs(c.left,0),B=gs(c.right,0),G=gs(c.top,0),W=gs(c.bottom,0);m?O=g-2*(M!==0||B!==0?M+B:gs(c.left,c.right)):R=y-2*(G!==0||W!==0?G+W:gs(c.top,c.bottom))}await l({...e,availableWidth:O,availableHeight:R});const N=await s.getDimensions(o.floating);return g!==N.width||y!==N.height?{reset:{rects:!0}}:{}}}};function Rx(){return typeof window<"u"}function wm(t){return NK(t)?(t.nodeName||"").toLowerCase():"#document"}function _s(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Al(t){var e;return(e=(NK(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function NK(t){return Rx()?t instanceof Node||t instanceof _s(t).Node:!1}function Co(t){return Rx()?t instanceof Element||t instanceof _s(t).Element:!1}function Sl(t){return Rx()?t instanceof HTMLElement||t instanceof _s(t).HTMLElement:!1}function XG(t){return!Rx()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof _s(t).ShadowRoot}function by(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Ro(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function oMe(t){return["table","td","th"].includes(wm(t))}function Ix(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function QD(t){const e=JD(),n=Co(t)?Ro(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function lMe(t){let e=Mc(t);for(;Sl(e)&&!rm(e);){if(QD(e))return e;if(Ix(e))return null;e=Mc(e)}return null}function JD(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function rm(t){return["html","body","#document"].includes(wm(t))}function Ro(t){return _s(t).getComputedStyle(t)}function Mx(t){return Co(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Mc(t){if(wm(t)==="html")return t;const e=t.assignedSlot||t.parentNode||XG(t)&&t.host||Al(t);return XG(e)?e.host:e}function OK(t){const e=Mc(t);return rm(e)?t.ownerDocument?t.ownerDocument.body:t.body:Sl(e)&&by(e)?e:OK(e)}function kb(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=OK(t),a=i===((r=t.ownerDocument)==null?void 0:r.body),s=_s(i);if(a){const o=nN(s);return e.concat(s,s.visualViewport||[],by(i)?i:[],o&&n?kb(o):[])}return e.concat(i,kb(i,[],n))}function nN(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function DK(t){const e=Ro(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Sl(t),a=i?t.offsetWidth:n,s=i?t.offsetHeight:r,o=IA(n)!==a||IA(r)!==s;return o&&(n=a,r=s),{width:n,height:r,$:o}}function eL(t){return Co(t)?t:t.contextElement}function Mh(t){const e=eL(t);if(!Sl(e))return ml(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:a}=DK(e);let s=(a?IA(n.width):n.width)/r,o=(a?IA(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const uMe=ml(0);function LK(t){const e=_s(t);return!JD()||!e.visualViewport?uMe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function cMe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==_s(t)?!1:e}function Tf(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),a=eL(t);let s=ml(1);e&&(r?Co(r)&&(s=Mh(r)):s=Mh(t));const o=cMe(a,n,r)?LK(a):ml(0);let l=(i.left+o.x)/s.x,u=(i.top+o.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(a){const f=_s(a),m=r&&Co(r)?_s(r):r;let g=f,y=nN(g);for(;y&&r&&m!==g;){const v=Mh(y),b=y.getBoundingClientRect(),E=Ro(y),S=b.left+(y.clientLeft+parseFloat(E.paddingLeft))*v.x,A=b.top+(y.clientTop+parseFloat(E.paddingTop))*v.y;l*=v.x,u*=v.y,c*=v.x,d*=v.y,l+=S,u+=A,g=_s(y),y=nN(g)}}return NA({width:c,height:d,x:l,y:u})}function tL(t,e){const n=Mx(t).scrollLeft;return e?e.left+n:Tf(Al(t)).left+n}function kK(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:tL(t,r)),a=r.top+e.scrollTop;return{x:i,y:a}}function dMe(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const a=i==="fixed",s=Al(r),o=e?Ix(e.floating):!1;if(r===s||o&&a)return n;let l={scrollLeft:0,scrollTop:0},u=ml(1);const c=ml(0),d=Sl(r);if((d||!d&&!a)&&((wm(r)!=="body"||by(s))&&(l=Mx(r)),Sl(r))){const m=Tf(r);u=Mh(r),c.x=m.x+r.clientLeft,c.y=m.y+r.clientTop}const f=s&&!d&&!a?kK(s,l,!0):ml(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function fMe(t){return Array.from(t.getClientRects())}function pMe(t){const e=Al(t),n=Mx(t),r=t.ownerDocument.body,i=gs(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=gs(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+tL(t);const o=-n.scrollTop;return Ro(r).direction==="rtl"&&(s+=gs(e.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:o}}function hMe(t,e){const n=_s(t),r=Al(t),i=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,o=0,l=0;if(i){a=i.width,s=i.height;const u=JD();(!u||u&&e==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:a,height:s,x:o,y:l}}function mMe(t,e){const n=Tf(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,a=Sl(t)?Mh(t):ml(1),s=t.clientWidth*a.x,o=t.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:s,height:o,x:l,y:u}}function KG(t,e,n){let r;if(e==="viewport")r=hMe(t,n);else if(e==="document")r=pMe(Al(t));else if(Co(e))r=mMe(e,n);else{const i=LK(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return NA(r)}function PK(t,e){const n=Mc(t);return n===e||!Co(n)||rm(n)?!1:Ro(n).position==="fixed"||PK(n,e)}function gMe(t,e){const n=e.get(t);if(n)return n;let r=kb(t,[],!1).filter(o=>Co(o)&&wm(o)!=="body"),i=null;const a=Ro(t).position==="fixed";let s=a?Mc(t):t;for(;Co(s)&&!rm(s);){const o=Ro(s),l=QD(s);!l&&o.position==="fixed"&&(i=null),(a?!l&&!i:!l&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||by(s)&&!l&&PK(t,s))?r=r.filter(c=>c!==s):i=o,s=Mc(s)}return e.set(t,r),r}function bMe(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?Ix(e)?[]:gMe(e,this._c):[].concat(n),r],o=s[0],l=s.reduce((u,c)=>{const d=KG(e,c,i);return u.top=gs(d.top,u.top),u.right=Rc(d.right,u.right),u.bottom=Rc(d.bottom,u.bottom),u.left=gs(d.left,u.left),u},KG(e,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function yMe(t){const{width:e,height:n}=DK(t);return{width:e,height:n}}function vMe(t,e,n){const r=Sl(e),i=Al(e),a=n==="fixed",s=Tf(t,!0,a,e);let o={scrollLeft:0,scrollTop:0};const l=ml(0);if(r||!r&&!a)if((wm(e)!=="body"||by(i))&&(o=Mx(e)),r){const f=Tf(e,!0,a,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=tL(i));const u=i&&!r&&!a?kK(i,o):ml(0),c=s.left+o.scrollLeft-l.x-u.x,d=s.top+o.scrollTop-l.y-u.y;return{x:c,y:d,width:s.width,height:s.height}}function SR(t){return Ro(t).position==="static"}function ZG(t,e){if(!Sl(t)||Ro(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Al(t)===n&&(n=n.ownerDocument.body),n}function BK(t,e){const n=_s(t);if(Ix(t))return n;if(!Sl(t)){let i=Mc(t);for(;i&&!rm(i);){if(Co(i)&&!SR(i))return i;i=Mc(i)}return n}let r=ZG(t,e);for(;r&&oMe(r)&&SR(r);)r=ZG(r,e);return r&&rm(r)&&SR(r)&&!QD(r)?n:r||lMe(t)||n}const EMe=async function(t){const e=this.getOffsetParent||BK,n=this.getDimensions,r=await n(t.floating);return{reference:vMe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function SMe(t){return Ro(t).direction==="rtl"}const _Me={convertOffsetParentRelativeRectToViewportRelativeRect:dMe,getDocumentElement:Al,getClippingRect:bMe,getOffsetParent:BK,getElementRects:EMe,getClientRects:fMe,getDimensions:yMe,getScale:Mh,isElement:Co,isRTL:SMe};function AMe(t,e){let n=null,r;const i=Al(t);function a(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function s(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),a();const{left:u,top:c,width:d,height:f}=t.getBoundingClientRect();if(o||e(),!d||!f)return;const m=JE(c),g=JE(i.clientWidth-(u+d)),y=JE(i.clientHeight-(c+f)),v=JE(u),E={rootMargin:-m+"px "+-g+"px "+-y+"px "+-v+"px",threshold:gs(0,Rc(1,l))||1};let S=!0;function A(I){const T=I[0].intersectionRatio;if(T!==l){if(!S)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(A,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,E)}n.observe(t)}return s(!0),a}function TMe(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=eL(t),c=i||a?[...u?kb(u):[],...kb(e)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const d=u&&o?AMe(u,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(b=>{let[E]=b;E&&E.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(e)})),n()}),u&&!l&&m.observe(u),m.observe(e));let g,y=l?Tf(t):null;l&&v();function v(){const b=Tf(t);y&&(b.x!==y.x||b.y!==y.y||b.width!==y.width||b.height!==y.height)&&n(),y=b,g=requestAnimationFrame(v)}return n(),()=>{var b;c.forEach(E=>{i&&E.removeEventListener("scroll",n),a&&E.removeEventListener("resize",n)}),d==null||d(),(b=m)==null||b.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const xMe=rMe,wMe=iMe,CMe=eMe,RMe=sMe,IMe=tMe,QG=JIe,MMe=aMe,NMe=(t,e,n)=>{const r=new Map,i={platform:_Me,...n},a={...i.platform,_c:r};return QIe(t,e,{...i,platform:a})};var YS=typeof document<"u"?w.useLayoutEffect:w.useEffect;function OA(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!OA(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&t.$$typeof)&&!OA(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function FK(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function JG(t,e){const n=FK(t);return Math.round(e*n)/n}function _R(t){const e=w.useRef(t);return YS(()=>{e.current=t}),e}function OMe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:o=!0,whileElementsMounted:l,open:u}=t,[c,d]=w.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,m]=w.useState(r);OA(f,r)||m(r);const[g,y]=w.useState(null),[v,b]=w.useState(null),E=w.useCallback(F=>{F!==T.current&&(T.current=F,y(F))},[]),S=w.useCallback(F=>{F!==R.current&&(R.current=F,b(F))},[]),A=a||g,I=s||v,T=w.useRef(null),R=w.useRef(null),O=w.useRef(c),N=l!=null,M=_R(l),B=_R(i),G=_R(u),W=w.useCallback(()=>{if(!T.current||!R.current)return;const F={placement:e,strategy:n,middleware:f};B.current&&(F.platform=B.current),NMe(T.current,R.current,F).then(ie=>{const J={...ie,isPositioned:G.current!==!1};K.current&&!OA(O.current,J)&&(O.current=J,Mf.flushSync(()=>{d(J)}))})},[f,e,n,B,G]);YS(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(F=>({...F,isPositioned:!1})))},[u]);const K=w.useRef(!1);YS(()=>(K.current=!0,()=>{K.current=!1}),[]),YS(()=>{if(A&&(T.current=A),I&&(R.current=I),A&&I){if(M.current)return M.current(A,I,W);W()}},[A,I,W,M,N]);const se=w.useMemo(()=>({reference:T,floating:R,setReference:E,setFloating:S}),[E,S]),ae=w.useMemo(()=>({reference:A,floating:I}),[A,I]),ee=w.useMemo(()=>{const F={position:n,left:0,top:0};if(!ae.floating)return F;const ie=JG(ae.floating,c.x),J=JG(ae.floating,c.y);return o?{...F,transform:"translate("+ie+"px, "+J+"px)",...FK(ae.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:J}},[n,o,ae.floating,c.x,c.y]);return w.useMemo(()=>({...c,update:W,refs:se,elements:ae,floatingStyles:ee}),[c,W,se,ae,ee])}const DMe=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?QG({element:r.current,padding:i}).fn(n):{}:r?QG({element:r,padding:i}).fn(n):{}}}},LMe=(t,e)=>({...xMe(t),options:[t,e]}),kMe=(t,e)=>({...wMe(t),options:[t,e]}),PMe=(t,e)=>({...MMe(t),options:[t,e]}),BMe=(t,e)=>({...CMe(t),options:[t,e]}),FMe=(t,e)=>({...RMe(t),options:[t,e]}),UMe=(t,e)=>({...IMe(t),options:[t,e]}),zMe=(t,e)=>({...DMe(t),options:[t,e]});var HMe="Arrow",UK=w.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...a}=t;return $.jsx(zc.svg,{...a,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:$.jsx("polygon",{points:"0,0 30,0 15,10"})})});UK.displayName=HMe;var GMe=UK;function VMe(t,e=[]){let n=[];function r(a,s){const o=w.createContext(s),l=n.length;n=[...n,s];function u(d){const{scope:f,children:m,...g}=d,y=(f==null?void 0:f[t][l])||o,v=w.useMemo(()=>g,Object.values(g));return $.jsx(y.Provider,{value:v,children:m})}function c(d,f){const m=(f==null?void 0:f[t][l])||o,g=w.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,c]}const i=()=>{const a=n.map(s=>w.createContext(s));return function(o){const l=(o==null?void 0:o[t])||a;return w.useMemo(()=>({[`__scope${t}`]:{...o,[t]:l}}),[o,l])}};return i.scopeName=t,[r,$Me(i,...e)]}function $Me(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:l,scopeName:u})=>{const d=l(a)[`__scope${u}`];return{...o,...d}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}function WMe(t){const[e,n]=w.useState(void 0);return Af(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,o;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,o=u.blockSize}else s=t.offsetWidth,o=t.offsetHeight;n({width:s,height:o})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var nL="Popper",[zK,HK]=VMe(nL),[jMe,GK]=zK(nL),VK=t=>{const{__scopePopper:e,children:n}=t,[r,i]=w.useState(null);return $.jsx(jMe,{scope:e,anchor:r,onAnchorChange:i,children:n})};VK.displayName=nL;var $K="PopperAnchor",WK=w.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,a=GK($K,n),s=w.useRef(null),o=Uf(e,s);return w.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:$.jsx(zc.div,{...i,ref:o})});WK.displayName=$K;var rL="PopperContent",[YMe,qMe]=zK(rL),jK=w.forwardRef((t,e)=>{var Ye,gt,Gt,Ut,Mt,$e;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:g,...y}=t,v=GK(rL,n),[b,E]=w.useState(null),S=Uf(e,qe=>E(qe)),[A,I]=w.useState(null),T=WMe(A),R=(T==null?void 0:T.width)??0,O=(T==null?void 0:T.height)??0,N=r+(a!=="center"?"-"+a:""),M=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},B=Array.isArray(u)?u:[u],G=B.length>0,W={padding:M,boundary:B.filter(KMe),altBoundary:G},{refs:K,floatingStyles:se,placement:ae,isPositioned:ee,middlewareData:F}=OMe({strategy:"fixed",placement:N,whileElementsMounted:(...qe)=>TMe(...qe,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[LMe({mainAxis:i+O,alignmentAxis:s}),l&&kMe({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?PMe():void 0,...W}),l&&BMe({...W}),FMe({...W,apply:({elements:qe,rects:re,availableWidth:At,availableHeight:Je})=>{const{width:Tt,height:ot}=re.reference,Vt=qe.floating.style;Vt.setProperty("--radix-popper-available-width",`${At}px`),Vt.setProperty("--radix-popper-available-height",`${Je}px`),Vt.setProperty("--radix-popper-anchor-width",`${Tt}px`),Vt.setProperty("--radix-popper-anchor-height",`${ot}px`)}}),A&&zMe({element:A,padding:o}),ZMe({arrowWidth:R,arrowHeight:O}),f&&UMe({strategy:"referenceHidden",...W})]}),[ie,J]=XK(ae),fe=Tm(g);Af(()=>{ee&&(fe==null||fe())},[ee,fe]);const Ce=(Ye=F.arrow)==null?void 0:Ye.x,Le=(gt=F.arrow)==null?void 0:gt.y,j=((Gt=F.arrow)==null?void 0:Gt.centerOffset)!==0,[ke,Fe]=w.useState();return Af(()=>{b&&Fe(window.getComputedStyle(b).zIndex)},[b]),$.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:ee?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[(Ut=F.transformOrigin)==null?void 0:Ut.x,(Mt=F.transformOrigin)==null?void 0:Mt.y].join(" "),...(($e=F.hide)==null?void 0:$e.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:$.jsx(YMe,{scope:n,placedSide:ie,onArrowChange:I,arrowX:Ce,arrowY:Le,shouldHideArrow:j,children:$.jsx(zc.div,{"data-side":ie,"data-align":J,...y,ref:S,style:{...y.style,animation:ee?void 0:"none"}})})})});jK.displayName=rL;var YK="PopperArrow",XMe={top:"bottom",right:"left",bottom:"top",left:"right"},qK=w.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,a=qMe(YK,r),s=XMe[a.placedSide];return $.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:$.jsx(GMe,{...i,ref:n,style:{...i.style,display:"block"}})})});qK.displayName=YK;function KMe(t){return t!==null}var ZMe=t=>({name:"transformOrigin",options:t,fn(e){var v,b,E;const{placement:n,rects:r,middlewareData:i}=e,s=((v=i.arrow)==null?void 0:v.centerOffset)!==0,o=s?0:t.arrowWidth,l=s?0:t.arrowHeight,[u,c]=XK(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((b=i.arrow)==null?void 0:b.x)??0)+o/2,m=(((E=i.arrow)==null?void 0:E.y)??0)+l/2;let g="",y="";return u==="bottom"?(g=s?d:`${f}px`,y=`${-l}px`):u==="top"?(g=s?d:`${f}px`,y=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,y=s?d:`${m}px`):u==="left"&&(g=`${r.floating.width+l}px`,y=s?d:`${m}px`),{data:{x:g,y}}}});function XK(t){const[e,n="center"]=t.split("-");return[e,n]}var QMe=VK,JMe=WK,eNe=jK,tNe=qK;function nNe(t,e){return w.useReducer((n,r)=>e[n][r]??n,t)}var KK=t=>{const{present:e,children:n}=t,r=rNe(e),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),a=Uf(r.ref,iNe(i));return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:a}):null};KK.displayName="Presence";function rNe(t){const[e,n]=w.useState(),r=w.useRef({}),i=w.useRef(t),a=w.useRef("none"),s=t?"mounted":"unmounted",[o,l]=nNe(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=eS(r.current);a.current=o==="mounted"?u:"none"},[o]),Af(()=>{const u=r.current,c=i.current;if(c!==t){const f=a.current,m=eS(u);t?l("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Af(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,d=m=>{const y=eS(r.current).includes(m.animationName);if(m.target===e&&y&&(l("ANIMATION_END"),!i.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",u=c.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},f=m=>{m.target===e&&(a.current=eS(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{c.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:w.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function eS(t){return(t==null?void 0:t.animationName)||"none"}function iNe(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function aNe({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=sNe({defaultProp:e,onChange:n}),a=t!==void 0,s=a?t:r,o=Tm(n),l=w.useCallback(u=>{if(a){const d=typeof u=="function"?u(t):u;d!==t&&o(d)}else i(u)},[a,t,i,o]);return[s,l]}function sNe({defaultProp:t,onChange:e}){const n=w.useState(t),[r]=n,i=w.useRef(r),a=Tm(e);return w.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var oNe="VisuallyHidden",ZK=w.forwardRef((t,e)=>$.jsx(zc.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));ZK.displayName=oNe;var lNe=ZK,[Nx,Hze]=NIe("Tooltip",[HK]),Ox=HK(),uNe="TooltipProvider",rN="tooltip.open",[Gze,iL]=Nx(uNe),Dx="Tooltip",[cNe,Lx]=Nx(Dx),QK=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:s,delayDuration:o}=t,l=iL(Dx,t.__scopeTooltip),u=Ox(e),[c,d]=w.useState(null),f=VIe(),m=w.useRef(0),g=s??l.disableHoverableContent,y=o??l.delayDuration,v=w.useRef(!1),[b=!1,E]=aNe({prop:r,defaultProp:i,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(rN))):l.onClose(),a==null||a(R)}}),S=w.useMemo(()=>b?v.current?"delayed-open":"instant-open":"closed",[b]),A=w.useCallback(()=>{window.clearTimeout(m.current),v.current=!1,E(!0)},[E]),I=w.useCallback(()=>{window.clearTimeout(m.current),E(!1)},[E]),T=w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,E(!0)},y)},[y,E]);return w.useEffect(()=>()=>window.clearTimeout(m.current),[]),$.jsx(QMe,{...u,children:$.jsx(cNe,{scope:e,contentId:f,open:b,stateAttribute:S,trigger:c,onTriggerChange:d,onTriggerEnter:w.useCallback(()=>{l.isOpenDelayed?T():A()},[l.isOpenDelayed,T,A]),onTriggerLeave:w.useCallback(()=>{g?I():window.clearTimeout(m.current)},[I,g]),onOpen:A,onClose:I,disableHoverableContent:g,children:n})})};QK.displayName=Dx;var iN="TooltipTrigger",JK=w.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Lx(iN,n),a=iL(iN,n),s=Ox(n),o=w.useRef(null),l=Uf(e,o,i.onTriggerChange),u=w.useRef(!1),c=w.useRef(!1),d=w.useCallback(()=>u.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),$.jsx(JMe,{asChild:!0,...s,children:$.jsx(zc.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Gl(t.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:Gl(t.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:Gl(t.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Gl(t.onFocus,()=>{u.current||i.onOpen()}),onBlur:Gl(t.onBlur,i.onClose),onClick:Gl(t.onClick,i.onClose)})})});JK.displayName=iN;var dNe="TooltipPortal",[Vze,fNe]=Nx(dNe,{forceMount:void 0}),im="TooltipContent",eZ=w.forwardRef((t,e)=>{const n=fNe(im,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=t,s=Lx(im,t.__scopeTooltip);return $.jsx(KK,{present:r||s.open,children:s.disableHoverableContent?$.jsx(tZ,{side:i,...a,ref:e}):$.jsx(pNe,{side:i,...a,ref:e})})}),pNe=w.forwardRef((t,e)=>{const n=Lx(im,t.__scopeTooltip),r=iL(im,t.__scopeTooltip),i=w.useRef(null),a=Uf(e,i),[s,o]=w.useState(null),{trigger:l,onClose:u}=n,c=i.current,{onPointerInTransitChange:d}=r,f=w.useCallback(()=>{o(null),d(!1)},[d]),m=w.useCallback((g,y)=>{const v=g.currentTarget,b={x:g.clientX,y:g.clientY},E=gNe(b,v.getBoundingClientRect()),S=bNe(b,E),A=yNe(y.getBoundingClientRect()),I=ENe([...S,...A]);o(I),d(!0)},[d]);return w.useEffect(()=>()=>f(),[f]),w.useEffect(()=>{if(l&&c){const g=v=>m(v,c),y=v=>m(v,l);return l.addEventListener("pointerleave",g),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",g),c.removeEventListener("pointerleave",y)}}},[l,c,m,f]),w.useEffect(()=>{if(s){const g=y=>{const v=y.target,b={x:y.clientX,y:y.clientY},E=(l==null?void 0:l.contains(v))||(c==null?void 0:c.contains(v)),S=!vNe(b,s);E?f():S&&(f(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,c,s,u,f]),$.jsx(tZ,{...t,ref:a})}),[hNe,mNe]=Nx(Dx,{isInside:!1}),tZ=w.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...o}=t,l=Lx(im,n),u=Ox(n),{onClose:c}=l;return w.useEffect(()=>(document.addEventListener(rN,c),()=>document.removeEventListener(rN,c)),[c]),w.useEffect(()=>{if(l.trigger){const d=f=>{const m=f.target;m!=null&&m.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),$.jsx(RK,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:$.jsxs(eNe,{"data-state":l.stateAttribute,...u,...o,ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[$.jsx(EK,{children:r}),$.jsx(hNe,{scope:n,isInside:!0,children:$.jsx(lNe,{id:l.contentId,role:"tooltip",children:i||r})})]})})});eZ.displayName=im;var nZ="TooltipArrow",rZ=w.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Ox(n);return mNe(nZ,n).isInside?null:$.jsx(tNe,{...i,...r,ref:e})});rZ.displayName=nZ;function gNe(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),a=Math.abs(e.left-t.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function bNe(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function yNe(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function vNe(t,e){const{x:n,y:r}=t;let i=!1;for(let a=0,s=e.length-1;ar!=c>r&&n<(u-o)*(r-l)/(c-l)+o&&(i=!i)}return i}function ENe(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),SNe(e)}function SNe(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const a=e[e.length-1],s=e[e.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var _Ne=QK,ANe=JK,TNe=eZ,xNe=rZ;function wNe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function fr(t,e){if(t==null)return{};var n=wNe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}let Pr;(function(t){t[t.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",t[t.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",t[t.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",t[t.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",t[t.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",t[t.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",t[t.THEME_ERROR=6]="THEME_ERROR",t[t.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",t[t.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",t[t.EMPTY_KEY=9]="EMPTY_KEY"})(Pr||(Pr={}));const CNe={[Pr.UNSUPPORTED_INPUT]:(t,e)=>[`An input with type \`${t}\` input was found at path \`${e}\` but it's not supported yet.`],[Pr.NO_COMPONENT_FOR_TYPE]:(t,e)=>[`Type \`${t}\` found at path \`${e}\` can't be displayed in panel because no component supports it yet.`],[Pr.UNKNOWN_INPUT]:(t,e)=>[`input at path \`${t}\` is not recognized.`,e],[Pr.DUPLICATE_KEYS]:(t,e,n)=>[`Key \`${t}\` of path \`${e}\` already exists at path \`${n}\`. Even nested keys need to be unique. Rename one of the keys.`],[Pr.ALREADY_REGISTERED_TYPE]:t=>[`Type ${t} has already been registered. You can't register a component with the same type.`],[Pr.CLIPBOARD_ERROR]:t=>["Error copying the value",t],[Pr.THEME_ERROR]:(t,e)=>[`Error accessing the theme \`${t}.${e}\` value.`],[Pr.PATH_DOESNT_EXIST]:t=>[`Error getting the value at path \`${t}\`. There is probably an error in your \`render\` function.`],[Pr.PATH_DOESNT_EXIST]:t=>[`Error accessing the value at path \`${t}\``],[Pr.INPUT_TYPE_OVERRIDE]:(t,e,n)=>[`Input at path \`${t}\` already exists with type: \`${e}\`. Its type cannot be overridden with type \`${n}\`.`],[Pr.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function iZ(t,e,...n){const[r,...i]=CNe[e](...n);console[t]("LEVA: "+r,...i)}const ql=iZ.bind(null,"warn"),RNe=iZ.bind(null,"log"),INe=["value"],MNe=["schema"],NNe=["value"],aZ=[],xf={};function e8(t){let{value:e}=t,n=fr(t,INe);for(let r of aZ){const i=r(e,n);if(i)return i}}function _u(t,e){let{schema:n}=e,r=fr(e,MNe);if(t in xf){ql(Pr.ALREADY_REGISTERED_TYPE,t);return}aZ.push((i,a)=>n(i,a)&&t),xf[t]=r}function AR(t,e,n,r){const{normalize:i}=xf[t];if(i)return i(e,n,r);if(typeof e!="object"||!("value"in e))return{value:e};const{value:a}=e,s=fr(e,NNe);return{value:a,settings:s}}function ONe(t,e,n,r,i,a){const{sanitize:s}=xf[t];return s?s(e,n,r,i,a):e}function t8(t,e,n){const{format:r}=xf[t];return r?r(e,n):e}function DNe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function dn(t){for(var e=1;et>n?n:t{if(t===""||typeof t=="number")return t;try{const e=ju(t);if(!isNaN(e))return e}catch{}return parseFloat(t)},kNe=Math.log(10);function r8(t){let e=Math.abs(+String(t).replace(".",""));if(e===0)return .01;for(;e!==0&&e%10===0;)e/=10;const n=Math.floor(Math.log(e)/kNe)+1,r=Math.floor(Math.log10(Math.abs(t))),i=Math.pow(10,r-n);return Math.max(i,.001)}const DA=(t,e,n)=>n===e?0:(Nc(t,e,n)-e)/(n-e),LA=(t,e,n)=>t*(n-e)+e,PNe=()=>"_"+Math.random().toString(36).substr(2,9),i8=/\(([0-9+\-*/^ .]+)\)/,a8=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,s8=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,o8=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,l8=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,u8=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function ju(t){if(isNaN(Number(t)))if(i8.test(t)){const e=t.replace(i8,(n,r)=>String(ju(r)));return ju(e)}else if(a8.test(t)){const e=t.replace(a8,(n,r,i)=>String(Math.pow(Number(r),Number(i))));return ju(e)}else if(s8.test(t)){const e=t.replace(s8,(n,r,i)=>String(Number(r)*Number(i)));return ju(e)}else if(o8.test(t)){const e=t.replace(o8,(n,r,i)=>{if(i!=0)return String(Number(r)/Number(i));throw new Error("Division by zero")});return ju(e)}else if(l8.test(t)){const e=t.replace(l8,(n,r,i)=>String(Number(r)+Number(i)));return ju(e)}else if(u8.test(t)){const e=t.replace(u8,(n,r,i)=>String(Number(r)-Number(i)));return ju(e)}else return Number(t);return Number(t)}function BNe(t,e){return e.reduce((n,r)=>(t&&t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}function FNe(t,e){const n=dn({},t);return e.forEach(r=>r in t&&delete n[r]),n}function UNe(t,e){return t.reduce((n,r,i)=>Object.assign(n,{[e[i]]:r}),{})}function sZ(t){return Object.prototype.toString.call(t)==="[object Object]"}const zNe=t=>sZ(t)&&Object.keys(t).length===0;let xo;(function(t){t.BUTTON="BUTTON",t.BUTTON_GROUP="BUTTON_GROUP",t.MONITOR="MONITOR",t.FOLDER="FOLDER"})(xo||(xo={}));let Io;(function(t){t.SELECT="SELECT",t.IMAGE="IMAGE",t.NUMBER="NUMBER",t.COLOR="COLOR",t.STRING="STRING",t.BOOLEAN="BOOLEAN",t.INTERVAL="INTERVAL",t.VECTOR3D="VECTOR3D",t.VECTOR2D="VECTOR2D"})(Io||(Io={}));const HNe=["type","__customInput"],GNe=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],VNe=["type"];function oZ(t,e,n={},r){var i,a;if(typeof t!="object"||Array.isArray(t))return{type:r,input:t,options:dn({key:e,label:e,optional:!1,disabled:!1,order:0},n)};if("__customInput"in t){const{type:I,__customInput:T}=t,R=fr(t,HNe);return oZ(T,e,R,I)}const{render:s,label:o,optional:l,order:u=0,disabled:c,hint:d,onChange:f,onEditStart:m,onEditEnd:g,transient:y}=t,v=fr(t,GNe),b=dn({render:s,key:e,label:o??e,hint:d,transient:y??!!f,onEditStart:m,onEditEnd:g,disabled:c,optional:l,order:u},n);let{type:E}=v,S=fr(v,VNe);if(E=r??E,E in xo)return{type:E,input:S,options:b};let A;return r&&sZ(S)&&"value"in S?A=S.value:A=zNe(S)?void 0:S,{type:E,input:A,options:dn(dn({},b),{},{onChange:f,optional:(i=b.optional)!==null&&i!==void 0?i:!1,disabled:(a=b.disabled)!==null&&a!==void 0?a:!1})}}function $Ne(t,e,n,r){const i=oZ(t,e),{type:a,input:s,options:o}=i;if(a)return a in xo?i:{type:a,input:AR(a,s,n,r),options:o};let l=e8(s);return l?{type:l,input:AR(l,s,n,r),options:o}:(l=e8({value:s}),l?{type:l,input:AR(l,{value:s},n,r),options:o}:!1)}function c8(t,e,n,r,i){const{value:a,type:s,settings:o}=t;t.value=lZ({type:s,value:a,settings:o},e,n,r),t.fromPanel=i}const WNe=function(e,n,r){this.type="LEVA_ERROR",this.message="LEVA: "+e,this.previousValue=n,this.error=r};function lZ({type:t,value:e,settings:n},r,i,a){const s=t!=="SELECT"&&typeof r=="function"?r(e):r;let o;try{o=ONe(t,s,n,e,i,a)}catch(l){throw new WNe(`The value \`${r}\` did not result in a correct value.`,e,l)}return Ob(o,e)?e:o}const uZ=(t,e,n=!1)=>{let r=0;return function(){const i=arguments,a=n&&!r,s=()=>t.apply(this,i);window.clearTimeout(r),r=window.setTimeout(s,e),a&&s()}},cZ=t=>t.shiftKey?5:t.altKey?1/5:1;function jNe(t,e){const n=console.error;console.error=()=>{},DO.render(t,e),console.error=n}const YNe=["value"],qNe=["min","max"],XNe=t=>{if(typeof t=="number")return!0;if(typeof t=="string"){const e=parseFloat(t);return isNaN(e)?!1:t.substring((""+e).length).trim().length<4}return!1},dZ=(t,{min:e=-1/0,max:n=1/0,suffix:r})=>{const i=parseFloat(t);if(t===""||isNaN(i))throw Error("Invalid number");const a=Nc(i,e,n);return r?a+r:a},KNe=(t,{pad:e=0,suffix:n})=>{const r=parseFloat(t).toFixed(e);return n?r+n:r},fZ=t=>{let{value:e}=t,n=fr(t,YNe);const{min:r=-1/0,max:i=1/0}=n,a=fr(n,qNe);let s=parseFloat(e);const o=typeof e=="string"?e.substring((""+s).length):void 0;s=Nc(s,r,i);let l=n.step;l||(Number.isFinite(r)?Number.isFinite(i)?l=+(Math.abs(i-r)/100).toPrecision(1):l=+(Math.abs(s-r)/100).toPrecision(1):Number.isFinite(i)&&(l=+(Math.abs(i-s)/100).toPrecision(1)));const u=l?r8(l)*10:r8(s);l=l||u/10;const c=Math.round(Nc(Math.log10(1/u),0,2));return{value:o?s+o:s,settings:dn({initialValue:s,step:l,pad:c,min:r,max:i,suffix:o},a)}},pZ=(t,{step:e,initialValue:n})=>{const r=Math.round((t-n)/e);return n+r*e};var hZ=Object.freeze({__proto__:null,schema:XNe,sanitize:dZ,format:KNe,normalize:fZ,sanitizeStep:pZ});function Xr(){return Xr=Object.assign?Object.assign.bind():function(t){for(var e=1;e({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function tS(t,e){const[n,r]=t.split(" "),i={};return n!=="none"&&(i.boxShadow=`${e.inset?"inset ":""}0 0 0 $borderWidths${[e.key]} $colors${n!=="default"&&n||e.borderColor}`),r&&(i.backgroundColor=r),i}const Fg={$inputStyle:()=>t=>tS(t,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>t=>tS(t,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>t=>tS(t,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>t=>tS(t,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:ln,css:$ze,createTheme:QNe,globalCss:JNe,keyframes:Wze}=MIe({prefix:"leva",theme:yZ(),utils:dn(dn({},Fg),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:t=>({"&:focus":Fg.$focusStyle()(t)}),$focusWithin:t=>({"&:focus-within":Fg.$focusStyle()(t)}),$hover:t=>({"&:hover":Fg.$hoverStyle()(t)}),$active:t=>({"&:active":Fg.$activeStyle()(t)})})}),e2e=JNe({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function t2e(t){const e=yZ();if(!t)return{theme:e,className:""};Object.keys(t).forEach(r=>{Object.assign(e[r],t[r])});const n=QNe(e);return{theme:e,className:n.className}}function du(t,e){const{theme:n}=w.useContext(aL);if(!(t in n)||!(e in n[t]))return ql(Pr.THEME_ERROR,t,e),"";let r=e;for(;;){let i=n[t][r];if(typeof i=="string"&&i.charAt(0)==="$")r=i.substr(1);else return i}}const vZ=ln("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),EZ=ln("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${vZ}`]:{paddingLeft:0}}),n2e=ln(EZ,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),r2e=ln("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),i2e=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],a2e=["onUpdate"];function sL(t){let{innerLabel:e,value:n,onUpdate:r,onChange:i,onKeyDown:a,type:s,id:o,inputType:l="text",rows:u=0}=t,c=fr(t,i2e);const{id:d,emitOnEditStart:f,emitOnEditEnd:m,disabled:g}=va(),y=o||d,v=w.useRef(null),b=u>0,E=b?"textarea":"input",S=w.useCallback(T=>R=>{const O=R.currentTarget.value;T(O)},[]);pe.useEffect(()=>{const T=v.current,R=S(O=>{r(O),m()});return T==null||T.addEventListener("blur",R),()=>T==null?void 0:T.removeEventListener("blur",R)},[S,r,m]);const A=w.useCallback(T=>{T.key==="Enter"&&S(r)(T)},[S,r]),I=Object.assign({as:E},b?{rows:u}:{},c);return pe.createElement(r2e,{textArea:b},e&&typeof e=="string"?pe.createElement(EZ,null,e):e,pe.createElement(vZ,Xr({levaType:s,ref:v,id:y,type:l,autoComplete:"off",spellCheck:"false",value:n,onChange:S(i),onFocus:()=>f(),onKeyPress:A,onKeyDown:a,disabled:g},I)))}function s2e(t){let{onUpdate:e}=t,n=fr(t,a2e);const r=w.useCallback(a=>e(LNe(a)),[e]),i=w.useCallback(a=>{const s=a.key==="ArrowUp"?1:a.key==="ArrowDown"?-1:0;if(s){a.preventDefault();const o=a.altKey?.1:a.shiftKey?10:1;e(l=>parseFloat(l)+s*o)}},[e]);return pe.createElement(sL,Xr({},n,{onUpdate:r,onKeyDown:i,type:"number"}))}const kA=ln("div",{}),aN=ln("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),o2e=ln("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${aN}::after`]:{opacity:.6},[`${kA}:hover > & + ${aN}::after`]:{opacity:.6},[`${kA}:hover > & > svg`]:{opacity:1}}),SZ=ln("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${kA}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),_Z=ln("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${SZ} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),AZ=ln(_Z,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),l2e=ln("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),u2e=ln("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),sN=ln("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),c2e=ln("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${sN}`]:{pointerEvents:"auto"}}}}}),TZ=ln("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),d2e=ln("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),f2e=ln(xNe,{fill:"$toolTipBackground"});function oL({children:t}){const{className:e}=w.useContext(aL);return pe.createElement(QRe,{className:e},t)}const p2e=["align"];function h2e(){const{id:t,disable:e,disabled:n}=va();return pe.createElement(pe.Fragment,null,pe.createElement(u2e,{id:t+"__disable",type:"checkbox",checked:!n,onChange:()=>e(!n)}),pe.createElement("label",{htmlFor:t+"__disable"}))}function m2e(t){const{id:e,optional:n,hint:r}=va(),i=t.htmlFor||(e?{htmlFor:e}:null),a=!r&&typeof t.children=="string"?{title:t.children}:null;return pe.createElement(pe.Fragment,null,n&&pe.createElement(h2e,null),r!==void 0?pe.createElement(_Ne,null,pe.createElement(ANe,{asChild:!0},pe.createElement(sN,Xr({},i,t))),pe.createElement(TNe,{side:"top",sideOffset:2},pe.createElement(d2e,null,r,pe.createElement(f2e,null)))):pe.createElement(sN,Xr({},i,a,t)))}function Po(t){let{align:e}=t,n=fr(t,p2e);const{value:r,label:i,key:a,disabled:s}=va(),{hideCopyButton:o}=ZNe(),l=!o&&a!==void 0,[u,c]=w.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[a]:r??""})),c(!0)}catch{ql(Pr.CLIPBOARD_ERROR,{[a]:r})}};return pe.createElement(l2e,{align:e,onPointerLeave:()=>c(!1)},pe.createElement(m2e,n),l&&!s&&pe.createElement("div",{title:`Click to copy ${typeof i=="string"?i:a} value`},u?pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},pe.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),pe.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):pe.createElement("svg",{onClick:d,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},pe.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),pe.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const g2e=["toggled"],b2e=ln("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function lL(t){let{toggled:e}=t,n=fr(t,g2e);return pe.createElement(b2e,Xr({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${e?0:-90}deg)`}},n),pe.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const y2e=["input"];function ao(t){let{input:e}=t,n=fr(t,y2e);return e?pe.createElement(AZ,n):pe.createElement(_Z,n)}function xZ({value:t,type:e,settings:n,setValue:r}){const[i,a]=w.useState(t8(e,t,n)),s=w.useRef(t),o=w.useRef(n);o.current=n;const l=w.useCallback(c=>a(t8(e,c,o.current)),[e]),u=w.useCallback(c=>{try{r(c)}catch(d){const{type:f,previousValue:m}=d;if(f!=="LEVA_ERROR")throw d;l(m)}},[l,r]);return w.useEffect(()=>{Ob(t,s.current)||l(t),s.current=t},[t,l]),{displayValue:i,onChange:a,onUpdate:u}}function vy(t,e){const{emitOnEditStart:n,emitOnEditEnd:r}=va();return Fwe(i=>{i.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const a=t(i);return i.last&&(document.body.classList.remove("leva__panel__dragged"),r==null||r()),a},e)}function v2e(t){const e=w.useRef(null),n=w.useRef(null),r=w.useRef(!1);return w.useEffect(()=>{const i=uZ(()=>{e.current.width=e.current.offsetWidth*window.devicePixelRatio,e.current.height=e.current.offsetHeight*window.devicePixelRatio,t(e.current,n.current)},250);return window.addEventListener("resize",i),r.current||(i(),r.current=!0),()=>window.removeEventListener("resize",i)},[t]),w.useEffect(()=>{n.current=e.current.getContext("2d")},[]),[e,n]}function wZ(){const t=w.useRef(null),e=w.useRef({x:0,y:0}),n=w.useCallback(r=>{Object.assign(e.current,r),t.current&&(t.current.style.transform=`translate3d(${e.current.x}px, ${e.current.y}px, 0)`)},[]);return[t,n]}const E2e=["__refCount"],TR=(t,e)=>{if(!t[e])return null;const n=t[e];return fr(n,E2e)};function S2e(t){const e=yy(),[n,r]=w.useState(TR(e.getData(),t)),i=w.useCallback(u=>e.setValueAtPath(t,u,!0),[t,e]),a=w.useCallback(u=>e.setSettingsAtPath(t,u),[t,e]),s=w.useCallback(u=>e.disableInputAtPath(t,u),[t,e]),o=w.useCallback(()=>e.emitOnEditStart(t),[t,e]),l=w.useCallback(()=>e.emitOnEditEnd(t),[t,e]);return w.useEffect(()=>{r(TR(e.getData(),t));const u=e.useStore.subscribe(c=>TR(c.data,t),r,{equalityFn:_x});return()=>u()},[e,t]),[n,{set:i,setSettings:a,disable:s,storeId:e.storeId,emitOnEditStart:o,emitOnEditEnd:l}]}const _2e=ln("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),CZ=ln("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),oN=ln("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),RZ=ln("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),IZ=ln("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function A2e({value:t,min:e,max:n,onDrag:r,step:i,initialValue:a}){const s=w.useRef(null),o=w.useRef(null),l=w.useRef(0),u=du("sizes","scrubberWidth"),c=vy(({event:f,first:m,xy:[g],movement:[y],memo:v})=>{if(m){const{width:E,left:S}=s.current.getBoundingClientRect();l.current=E-parseFloat(u),v=(f==null?void 0:f.target)===o.current?t:LA((g-S)/E,e,n)}const b=v+LA(y/l.current,0,n-e);return r(pZ(b,{step:i,initialValue:a})),v}),d=DA(t,e,n);return pe.createElement(RZ,Xr({ref:s},c()),pe.createElement(CZ,null,pe.createElement(IZ,{style:{left:0,right:`${(1-d)*100}%`}})),pe.createElement(oN,{ref:o,style:{left:`calc(${d} * (100% - ${u}))`}}))}const T2e=pe.memo(({label:t,onUpdate:e,step:n,innerLabelTrim:r})=>{const[i,a]=w.useState(!1),s=vy(({active:o,delta:[l],event:u,memo:c=0})=>(a(o),c+=l/2,Math.abs(c)>=1&&(e(d=>parseFloat(d)+Math.floor(c)*n*cZ(u)),c=0),c));return pe.createElement(n2e,Xr({dragging:i,title:t.length>1?t:""},s()),t.slice(0,r))});function MZ({label:t,id:e,displayValue:n,onUpdate:r,onChange:i,settings:a,innerLabelTrim:s=1}){const o=s>0&&pe.createElement(T2e,{label:t,step:a.step,onUpdate:r,innerLabelTrim:s});return pe.createElement(s2e,{id:e,value:String(n),onUpdate:r,onChange:i,innerLabel:o})}function x2e(){const t=va(),{label:e,value:n,onUpdate:r,settings:i,id:a}=t,{min:s,max:o}=i,l=o!==1/0&&s!==-1/0;return pe.createElement(ao,{input:!0},pe.createElement(Po,null,e),pe.createElement(_2e,{hasRange:l},l&&pe.createElement(A2e,Xr({value:parseFloat(n),onDrag:r},i)),pe.createElement(MZ,Xr({},t,{id:a,label:"value",innerLabelTrim:l?0:1}))))}const{sanitizeStep:w2e}=hZ,C2e=fr(hZ,["sanitizeStep"]);var R2e=dn({component:x2e},C2e);const I2e=(t,e)=>Ja().schema({options:Ja().passesAnyOf(Ja().object(),Ja().array())}).test(e),M2e=(t,{values:e})=>{if(e.indexOf(t)<0)throw Error("Selected value doesn't match Select options");return t},N2e=(t,{values:e})=>e.indexOf(t),O2e=t=>{let{value:e,options:n}=t,r,i;return Array.isArray(n)?(i=n,r=n.map(a=>String(a))):(i=Object.values(n),r=Object.keys(n)),"value"in t?i.includes(e)||(r.unshift(String(e)),i.unshift(e)):e=i[0],Object.values(n).includes(e)||(n[String(e)]=e),{value:e,settings:{keys:r,values:i}}};var D2e=Object.freeze({__proto__:null,schema:I2e,sanitize:M2e,format:N2e,normalize:O2e});const L2e=ln("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),lN=ln("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),k2e=ln("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${lN}:focus + &`]:{$focusStyle:""},[`${lN}:hover + &`]:{$hoverStyle:""}});function P2e({displayValue:t,value:e,onUpdate:n,id:r,settings:i,disabled:a}){const{keys:s,values:o}=i,l=w.useRef();return e===o[t]&&(l.current=s[t]),pe.createElement(L2e,null,pe.createElement(lN,{id:r,value:t,onChange:u=>n(o[Number(u.currentTarget.value)]),disabled:a},s.map((u,c)=>pe.createElement("option",{key:u,value:c},u))),pe.createElement(k2e,null,l.current),pe.createElement(lL,{toggled:!0}))}function B2e(){const{label:t,value:e,displayValue:n,onUpdate:r,id:i,disabled:a,settings:s}=va();return pe.createElement(ao,{input:!0},pe.createElement(Po,null,t),pe.createElement(P2e,{id:i,value:e,displayValue:n,onUpdate:r,settings:s,disabled:a}))}var F2e=dn({component:B2e},D2e);const U2e=t=>Ja().string().test(t),z2e=t=>{if(typeof t!="string")throw Error("Invalid string");return t},H2e=({value:t,editable:e=!0,rows:n=!1})=>({value:t,settings:{editable:e,rows:typeof n=="number"?n:n?5:0}});var G2e=Object.freeze({__proto__:null,schema:U2e,sanitize:z2e,normalize:H2e});const V2e=["displayValue","onUpdate","onChange","editable"],$2e=ln("div",{whiteSpace:"pre-wrap"});function W2e(t){let{displayValue:e,onUpdate:n,onChange:r,editable:i=!0}=t,a=fr(t,V2e);return i?pe.createElement(sL,Xr({value:e,onUpdate:n,onChange:r},a)):pe.createElement($2e,null,e)}function j2e(){const{label:t,settings:e,displayValue:n,onUpdate:r,onChange:i}=va();return pe.createElement(ao,{input:!0},pe.createElement(Po,null,t),pe.createElement(W2e,Xr({displayValue:n,onUpdate:r,onChange:i},e)))}var Y2e=dn({component:j2e},G2e);const q2e=t=>Ja().boolean().test(t),X2e=t=>{if(typeof t!="boolean")throw Error("Invalid boolean");return t};var K2e=Object.freeze({__proto__:null,schema:q2e,sanitize:X2e});const Z2e=ln("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function Q2e({value:t,onUpdate:e,id:n,disabled:r}){return pe.createElement(Z2e,null,pe.createElement("input",{id:n,type:"checkbox",checked:t,onChange:i=>e(i.currentTarget.checked),disabled:r}),pe.createElement("label",{htmlFor:n},pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},pe.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function J2e(){const{label:t,value:e,onUpdate:n,disabled:r,id:i}=va();return pe.createElement(ao,{input:!0},pe.createElement(Po,null,t),pe.createElement(Q2e,{value:e,onUpdate:n,id:i,disabled:r}))}var eOe=dn({component:J2e},K2e);const tOe=["locked"];function nOe({value:t,id:e,valueKey:n,settings:r,onUpdate:i,innerLabelTrim:a}){const s=w.useRef(t[n]);s.current=t[n];const o=w.useCallback(u=>i({[n]:lZ({type:"NUMBER",value:s.current,settings:r},u)}),[i,r,n]),l=xZ({type:"NUMBER",value:t[n],settings:r,setValue:o});return pe.createElement(MZ,{id:e,label:n,value:t[n],displayValue:l.displayValue,onUpdate:l.onUpdate,onChange:l.onChange,settings:r,innerLabelTrim:a})}const rOe=ln("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function iOe(t){let{locked:e}=t,n=fr(t,tOe);return pe.createElement("svg",Xr({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),e?pe.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):pe.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function uL({value:t,onUpdate:e,settings:n,innerLabelTrim:r}){const{id:i,setSettings:a}=va(),{lock:s,locked:o}=n;return pe.createElement(rOe,{withLock:s},s&&pe.createElement(iOe,{locked:o,onClick:()=>a({locked:!o})}),Object.keys(t).map((l,u)=>pe.createElement(nOe,{id:u===0?i:`${i}.${l}`,key:l,valueKey:l,value:t,settings:n[l],onUpdate:e,innerLabelTrim:r})))}const NZ=(t,e)=>{const n={};let r=0,i=1/0;Object.entries(t).forEach(([a,s])=>{n[a]=fZ(dn({value:s},e[a])).settings,r=Math.max(r,n[a].step),i=Math.min(i,n[a].pad)});for(let a in n){const{step:s,min:o,max:l}=e[a]||{};!isFinite(s)&&(!isFinite(o)||!isFinite(l))&&(n[a].step=r,n[a].pad=i)}return n},aOe=["lock"],sOe=["value"];function oOe(t){const e=Ja().array().length(t).every.number(),n=r=>{if(!r||typeof r!="object")return!1;const i=Object.values(r);return i.length===t&&i.every(a=>isFinite(a))};return r=>e.test(r)||n(r)}function lOe(t){return Array.isArray(t)?"array":"object"}function L0(t,e,n){return lOe(t)===e?t:e==="array"?Object.values(t):UNe(t,n)}const uOe=(t,e,n)=>{const r=L0(t,"object",e.keys);for(let s in r)r[s]=dZ(r[s],e[s]);const i=Object.keys(r);let a={};if(i.length===e.keys.length)a=r;else{const s=L0(n,"object",e.keys);if(i.length===1&&e.locked){const o=i[0],l=r[o],u=s[o],c=u!==0?l/u:1;for(let d in s)d===o?a[o]=l:a[d]=s[d]*c}else a=dn(dn({},s),r)}return L0(a,e.format,e.keys)},cOe=(t,e)=>L0(t,"object",e.keys),dOe=t=>!!t&&("step"in t||"min"in t||"max"in t);function fOe(t,e,n=[]){const{lock:r=!1}=e,i=fr(e,aOe),a=Array.isArray(t)?"array":"object",s=a==="object"?Object.keys(t):n,o=L0(t,"object",s),l=dOe(i)?s.reduce((c,d)=>Object.assign(c,{[d]:i}),{}):i,u=NZ(o,l);return{value:a==="array"?t:o,settings:dn(dn({},u),{},{format:a,keys:s,lock:r,locked:!1})}}function OZ(t){return{schema:oOe(t.length),normalize:e=>{let{value:n}=e,r=fr(e,sOe);return fOe(n,r,t)},format:(e,n)=>cOe(e,n),sanitize:(e,n,r)=>uOe(e,n,r)}}var pOe={grad:.9,turn:360,rad:360/(2*Math.PI)},Bl=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},Ii=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n+0},eo=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t>e?t:e},DZ=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},d8=function(t){return{r:eo(t.r,0,255),g:eo(t.g,0,255),b:eo(t.b,0,255),a:eo(t.a)}},xR=function(t){return{r:Ii(t.r),g:Ii(t.g),b:Ii(t.b),a:Ii(t.a,3)}},hOe=/^#([0-9a-f]{3,8})$/i,nS=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},LZ=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=Math.max(e,n,r),s=a-Math.min(e,n,r),o=s?a===e?(n-r)/s:a===n?2+(r-e)/s:4+(e-n)/s:0;return{h:60*(o<0?o+6:o),s:a?s/a*100:0,v:a/255*100,a:i}},kZ=function(t){var e=t.h,n=t.s,r=t.v,i=t.a;e=e/360*6,n/=100,r/=100;var a=Math.floor(e),s=r*(1-n),o=r*(1-(e-a)*n),l=r*(1-(1-e+a)*n),u=a%6;return{r:255*[r,o,s,s,l,r][u],g:255*[l,r,r,o,s,s][u],b:255*[s,s,l,r,r,o][u],a:i}},f8=function(t){return{h:DZ(t.h),s:eo(t.s,0,100),l:eo(t.l,0,100),a:eo(t.a)}},p8=function(t){return{h:Ii(t.h),s:Ii(t.s),l:Ii(t.l),a:Ii(t.a,3)}},h8=function(t){return kZ((n=(e=t).s,{h:e.h,s:(n*=((r=e.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:e.a}));var e,n,r},k0=function(t){return{h:(e=LZ(t)).h,s:(i=(200-(n=e.s))*(r=e.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,n,r,i},mOe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gOe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bOe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,yOe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,uN={string:[[function(t){var e=hOe.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Ii(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?Ii(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=bOe.exec(t)||yOe.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:d8({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=mOe.exec(t)||gOe.exec(t);if(!e)return null;var n,r,i=f8({h:(n=e[1],r=e[2],r===void 0&&(r="deg"),Number(n)*(pOe[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return h8(i)},"hsl"]],object:[[function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=i===void 0?1:i;return Bl(e)&&Bl(n)&&Bl(r)?d8({r:Number(e),g:Number(n),b:Number(r),a:Number(a)}):null},"rgb"],[function(t){var e=t.h,n=t.s,r=t.l,i=t.a,a=i===void 0?1:i;if(!Bl(e)||!Bl(n)||!Bl(r))return null;var s=f8({h:Number(e),s:Number(n),l:Number(r),a:Number(a)});return h8(s)},"hsl"],[function(t){var e=t.h,n=t.s,r=t.v,i=t.a,a=i===void 0?1:i;if(!Bl(e)||!Bl(n)||!Bl(r))return null;var s=function(o){return{h:DZ(o.h),s:eo(o.s,0,100),v:eo(o.v,0,100),a:eo(o.a)}}({h:Number(e),s:Number(n),v:Number(r),a:Number(a)});return kZ(s)},"hsv"]]},m8=function(t,e){for(var n=0;n=.5},t.prototype.toHex=function(){return e=xR(this.rgba),n=e.r,r=e.g,i=e.b,s=(a=e.a)<1?nS(Ii(255*a)):"","#"+nS(n)+nS(r)+nS(i)+s;var e,n,r,i,a,s},t.prototype.toRgb=function(){return xR(this.rgba)},t.prototype.toRgbString=function(){return e=xR(this.rgba),n=e.r,r=e.g,i=e.b,(a=e.a)<1?"rgba("+n+", "+r+", "+i+", "+a+")":"rgb("+n+", "+r+", "+i+")";var e,n,r,i,a},t.prototype.toHsl=function(){return p8(k0(this.rgba))},t.prototype.toHslString=function(){return e=p8(k0(this.rgba)),n=e.h,r=e.s,i=e.l,(a=e.a)<1?"hsla("+n+", "+r+"%, "+i+"%, "+a+")":"hsl("+n+", "+r+"%, "+i+"%)";var e,n,r,i,a},t.prototype.toHsv=function(){return e=LZ(this.rgba),{h:Ii(e.h),s:Ii(e.s),v:Ii(e.v),a:Ii(e.a,3)};var e},t.prototype.invert=function(){return Ra({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),Ra(wR(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),Ra(wR(this.rgba,-e))},t.prototype.grayscale=function(){return Ra(wR(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),Ra(g8(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),Ra(g8(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?Ra({r:(n=this.rgba).r,g:n.g,b:n.b,a:e}):Ii(this.rgba.a,3);var n},t.prototype.hue=function(e){var n=k0(this.rgba);return typeof e=="number"?Ra({h:e,s:n.s,l:n.l,a:n.a}):Ii(n.h)},t.prototype.isEqual=function(e){return this.toHex()===Ra(e).toHex()},t}(),Ra=function(t){return t instanceof cN?t:new cN(t)},b8=[],EOe=function(t){t.forEach(function(e){b8.indexOf(e)<0&&(e(cN,uN),b8.push(e))})};function SOe(t,e){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var i in n)r[n[i]]=i;var a={};t.prototype.toName=function(s){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,l,u=r[this.toHex()];if(u)return u;if(s!=null&&s.closest){var c=this.toRgb(),d=1/0,f="black";if(!a.length)for(var m in n)a[m]=new t(n[m]).toRgb();for(var g in n){var y=(o=c,l=a[g],Math.pow(o.r-l.r,2)+Math.pow(o.g-l.g,2)+Math.pow(o.b-l.b,2));y=0||(i[n]=t[n]);return i}function dN(t){var e=w.useRef(t),n=w.useRef(function(r){e.current&&e.current(r)});return e.current=t,n.current}var am=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t0:v.buttons>0)&&i.current?a(y8(i.current,v,o.current)):y(!1)},g=function(){return y(!1)};function y(v){var b=l.current,E=fN(i.current),S=v?E.addEventListener:E.removeEventListener;S(b?"touchmove":"mousemove",m),S(b?"touchend":"mouseup",g)}return[function(v){var b=v.nativeEvent,E=i.current;if(E&&(v8(b),!function(A,I){return I&&!P0(A)}(b,l.current)&&E)){if(P0(b)){l.current=!0;var S=b.changedTouches||[];S.length&&(o.current=S[0].identifier)}E.focus(),a(y8(E,b,o.current)),y(!0)}},function(v){var b=v.which||v.keyCode;b<37||b>40||(v.preventDefault(),s({left:b===39?.05:b===37?-.05:0,top:b===40?.05:b===38?-.05:0}))},y]},[s,a]),c=u[0],d=u[1],f=u[2];return w.useEffect(function(){return f},[f]),pe.createElement("div",Cm({},r,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:i,onKeyDown:d,tabIndex:0,role:"slider"}))}),Ey=function(t){return t.filter(Boolean).join(" ")},fL=function(t){var e=t.color,n=t.left,r=t.top,i=r===void 0?.5:r,a=Ey(["react-colorful__pointer",t.className]);return pe.createElement("div",{className:a,style:{top:100*i+"%",left:100*n+"%"}},pe.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},Oa=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},BZ=function(t){var e=t.s,n=t.v,r=t.a,i=(200-e)*n/100;return{h:Oa(t.h),s:Oa(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:Oa(i/2),a:Oa(r,2)}},pN=function(t){var e=BZ(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},RR=function(t){var e=BZ(t);return"hsla("+e.h+", "+e.s+"%, "+e.l+"%, "+e.a+")"},FZ=function(t){var e=t.h,n=t.s,r=t.v,i=t.a;e=e/360*6,n/=100,r/=100;var a=Math.floor(e),s=r*(1-n),o=r*(1-(e-a)*n),l=r*(1-(1-e+a)*n),u=a%6;return{r:Oa(255*[r,o,s,s,l,r][u]),g:Oa(255*[l,r,r,o,s,s][u]),b:Oa(255*[s,s,l,r,r,o][u]),a:Oa(i,2)}},UZ=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=Math.max(e,n,r),s=a-Math.min(e,n,r),o=s?a===e?(n-r)/s:a===n?2+(r-e)/s:4+(e-n)/s:0;return{h:Oa(60*(o<0?o+6:o)),s:Oa(a?s/a*100:0),v:Oa(a/255*100),a:i}},zZ=pe.memo(function(t){var e=t.hue,n=t.onChange,r=Ey(["react-colorful__hue",t.className]);return pe.createElement("div",{className:r},pe.createElement(dL,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:am(e+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Oa(e),"aria-valuemax":"360","aria-valuemin":"0"},pe.createElement(fL,{className:"react-colorful__hue-pointer",left:e/360,color:pN({h:e,s:100,v:100,a:1})})))}),HZ=pe.memo(function(t){var e=t.hsva,n=t.onChange,r={backgroundColor:pN({h:e.h,s:100,v:100,a:1})};return pe.createElement("div",{className:"react-colorful__saturation",style:r},pe.createElement(dL,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:am(e.s+100*i.left,0,100),v:am(e.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Oa(e.s)+"%, Brightness "+Oa(e.v)+"%"},pe.createElement(fL,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:pN(e)})))}),pL=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0};function GZ(t,e,n){var r=dN(n),i=w.useState(function(){return t.toHsva(e)}),a=i[0],s=i[1],o=w.useRef({color:e,hsva:a});w.useEffect(function(){if(!t.equal(e,o.current.color)){var u=t.toHsva(e);o.current={hsva:u,color:e},s(u)}},[e,t]),w.useEffect(function(){var u;pL(a,o.current.hsva)||t.equal(u=t.fromHsva(a),o.current.color)||(o.current={hsva:a,color:u},r(u))},[a,t,r]);var l=w.useCallback(function(u){s(function(c){return Object.assign({},c,u)})},[]);return[a,l]}var _Oe=typeof window<"u"?w.useLayoutEffect:w.useEffect,AOe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},E8=new Map,VZ=function(t){_Oe(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!E8.has(e)){var n=e.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,E8.set(e,n);var r=AOe();r&&n.setAttribute("nonce",r),e.head.appendChild(n)}},[])},TOe=function(t){var e=t.className,n=t.colorModel,r=t.color,i=r===void 0?n.defaultColor:r,a=t.onChange,s=cL(t,["className","colorModel","color","onChange"]),o=w.useRef(null);VZ(o);var l=GZ(n,i,a),u=l[0],c=l[1],d=Ey(["react-colorful",e]);return pe.createElement("div",Cm({},s,{ref:o,className:d}),pe.createElement(HZ,{hsva:u,onChange:c}),pe.createElement(zZ,{hue:u.h,onChange:c,className:"react-colorful__last-control"}))},xOe=function(t){var e=t.className,n=t.hsva,r=t.onChange,i={backgroundImage:"linear-gradient(90deg, "+RR(Object.assign({},n,{a:0}))+", "+RR(Object.assign({},n,{a:1}))+")"},a=Ey(["react-colorful__alpha",e]),s=Oa(100*n.a);return pe.createElement("div",{className:a},pe.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),pe.createElement(dL,{onMove:function(o){r({a:o.left})},onKey:function(o){r({a:am(n.a+o.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},pe.createElement(fL,{className:"react-colorful__alpha-pointer",left:n.a,color:RR(n)})))},wOe=function(t){var e=t.className,n=t.colorModel,r=t.color,i=r===void 0?n.defaultColor:r,a=t.onChange,s=cL(t,["className","colorModel","color","onChange"]),o=w.useRef(null);VZ(o);var l=GZ(n,i,a),u=l[0],c=l[1],d=Ey(["react-colorful",e]);return pe.createElement("div",Cm({},s,{ref:o,className:d}),pe.createElement(HZ,{hsva:u,onChange:c}),pe.createElement(zZ,{hue:u.h,onChange:c}),pe.createElement(xOe,{hsva:u,onChange:c,className:"react-colorful__last-control"}))},COe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:UZ,fromHsva:FZ,equal:pL},ROe=function(t){return pe.createElement(wOe,Cm({},t,{colorModel:COe}))},IOe={defaultColor:{r:0,g:0,b:0},toHsva:function(t){return UZ({r:t.r,g:t.g,b:t.b,a:1})},fromHsva:function(t){return{r:(e=FZ(t)).r,g:e.g,b:e.b};var e},equal:pL},MOe=function(t){return pe.createElement(TOe,Cm({},t,{colorModel:IOe}))},NOe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Sy(t,e){var n=OOe(t);if(typeof n.path!="string"){var r=t.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof e=="string"?e:typeof r=="string"&&r.length>0?r:t.name,writable:!1,configurable:!1,enumerable:!0})}return n}function OOe(t){var e=t.name,n=e&&e.lastIndexOf(".")!==-1;if(n&&!t.type){var r=e.split(".").pop().toLowerCase(),i=NOe.get(r);i&&Object.defineProperty(t,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return t}var DOe=[".DS_Store","Thumbs.db"];function LOe(t){return hm(this,void 0,void 0,function(){return mm(this,function(e){return PA(t)&&kOe(t)?[2,UOe(t.dataTransfer,t.type)]:POe(t)?[2,BOe(t)]:Array.isArray(t)&&t.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,FOe(t)]:[2,[]]})})}function kOe(t){return PA(t.dataTransfer)}function POe(t){return PA(t)&&PA(t.target)}function PA(t){return typeof t=="object"&&t!==null}function BOe(t){return hN(t.target.files).map(function(e){return Sy(e)})}function FOe(t){return hm(this,void 0,void 0,function(){var e;return mm(this,function(n){switch(n.label){case 0:return[4,Promise.all(t.map(function(r){return r.getFile()}))];case 1:return e=n.sent(),[2,e.map(function(r){return Sy(r)})]}})})}function UOe(t,e){return hm(this,void 0,void 0,function(){var n,r;return mm(this,function(i){switch(i.label){case 0:return t===null?[2,[]]:t.items?(n=hN(t.items).filter(function(a){return a.kind==="file"}),e!=="drop"?[2,n]:[4,Promise.all(n.map(zOe))]):[3,2];case 1:return r=i.sent(),[2,S8($Z(r))];case 2:return[2,S8(hN(t.files).map(function(a){return Sy(a)}))]}})})}function S8(t){return t.filter(function(e){return DOe.indexOf(e.name)===-1})}function hN(t){if(t===null)return[];for(var e=[],n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nn)return[!1,C8(n)];if(t.sizen)return[!1,C8(n)]}return[!0,null]}function Ug(t){return t!=null}function eDe(t){var e=t.files,n=t.accept,r=t.minSize,i=t.maxSize,a=t.multiple,s=t.maxFiles;return!a&&e.length>1||a&&s>=1&&e.length>s?!1:e.every(function(o){var l=YZ(o,n),u=x8(l,1),c=u[0],d=qZ(o,r,i),f=x8(d,1),m=f[0];return c&&m})}function BA(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function rS(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function I8(t){t.preventDefault()}function tDe(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function nDe(t){return t.indexOf("Edge/")!==-1}function rDe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return tDe(t)||nDe(t)}function qo(){for(var t=arguments.length,e=new Array(t),n=0;n1?i-1:0),s=1;st.forEach(n=>WRe(n,e))}function Uf(...t){return w.useCallback(yK(...t),t)}var vK=w.forwardRef((t,e)=>{const{children:n,...r}=t,i=w.Children.toArray(n),a=i.find(jRe);if(a){const s=a.props.children,o=i.map(l=>l===a?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return $.jsx(XM,{...r,ref:e,children:w.isValidElement(s)?w.cloneElement(s,void 0,o):null})}return $.jsx(XM,{...r,ref:e,children:n})});vK.displayName="Slot";var XM=w.forwardRef((t,e)=>{const{children:n,...r}=t;if(w.isValidElement(n)){const i=qRe(n);return w.cloneElement(n,{...YRe(r,n.props),ref:e?yK(e,i):i})}return w.Children.count(n)>1?w.Children.only(null):null});XM.displayName="SlotClone";var EK=({children:t})=>$.jsx($.Fragment,{children:t});function jRe(t){return w.isValidElement(t)&&t.type===EK}function YRe(t,e){const n={...e};for(const r in e){const i=t[r],a=e[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{a(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...t,...n}}function qRe(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var XRe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],zc=XRe.reduce((t,e)=>{const n=w.forwardRef((r,i)=>{const{asChild:a,...s}=r,o=a?vK:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),$.jsx(o,{...s,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function KRe(t,e){t&&Mf.flushSync(()=>t.dispatchEvent(e))}var Af=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},ZRe="Portal",_K=w.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[i,a]=w.useState(!1);Af(()=>a(!0),[]);const s=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return s?DO.createPortal($.jsx(zc.div,{...r,ref:e}),s):null});_K.displayName=ZRe;var QRe=_K,kG=Object.prototype.hasOwnProperty;function Ob(t,e){var n,r;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&Ob(t[r],e[r]););return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(kG.call(t,n)&&++r&&!kG.call(e,n)||!(n in e)||!Ob(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}var CT=function(e,n,r,i){this.name=e,this.fn=n,this.args=r,this.modifiers=i};CT.prototype._test=function(e){var n=this.fn;try{Ih(this.modifiers.slice(),n,this)(e)}catch{n=function(){return!1}}try{return Ih(this.modifiers.slice(),n,this)(e)}catch{return!1}};CT.prototype._check=function(e){try{Ih(this.modifiers.slice(),this.fn,this)(e)}catch{if(Ih(this.modifiers.slice(),function(r){return r},this)(!1))return}if(!Ih(this.modifiers.slice(),this.fn,this)(e))throw null};CT.prototype._testAsync=function(e){var n=this;return new Promise(function(r,i){AK(n.modifiers.slice(),n.fn,n)(e).then(function(a){a?r(e):i(null)}).catch(function(a){return i(a)})})};function SK(t,e){return e===void 0&&(e="simple"),typeof t=="object"?t[e]:t}function Ih(t,e,n){if(t.length){var r=t.shift(),i=Ih(t,e,n);return r.perform(i,n)}else return SK(e)}function AK(t,e,n){if(t.length){var r=t.shift(),i=AK(t,e,n);return r.performAsync(i,n)}else return function(a){return Promise.resolve(SK(e,"async")(a))}}var JRe=function(e,n,r){this.name=e,this.perform=n,this.performAsync=r},YD=function(t){function e(n,r,i,a){for(var s=[],o=arguments.length-4;o-- >0;)s[o]=arguments[o+4];t.call(this,s),t.captureStackTrace&&t.captureStackTrace(this,e),this.rule=n,this.value=r,this.cause=i,this.target=a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),El=function(e,n){e===void 0&&(e=[]),n===void 0&&(n=[]),this.chain=e,this.nextRuleModifiers=n};El.prototype._applyRule=function(e,n){var r=this;return function(){for(var i=[],a=arguments.length;a--;)i[a]=arguments[a];return r.chain.push(new CT(n,e.apply(r,i),i,r.nextRuleModifiers)),r.nextRuleModifiers=[],r}};El.prototype._applyModifier=function(e,n){return this.nextRuleModifiers.push(new JRe(n,e.simple,e.async)),this};El.prototype._clone=function(){return new El(this.chain.slice(),this.nextRuleModifiers.slice())};El.prototype.test=function(e){return this.chain.every(function(n){return n._test(e)})};El.prototype.testAll=function(e){var n=[];return this.chain.forEach(function(r){try{r._check(e)}catch(i){n.push(new YD(r,e,i))}}),n};El.prototype.check=function(e){this.chain.forEach(function(n){try{n._check(e)}catch(r){throw new YD(n,e,r)}})};El.prototype.testAsync=function(e){var n=this;return new Promise(function(r,i){xK(e,n.chain.slice(),r,i)})};function xK(t,e,n,r){if(e.length){var i=e.shift();i._testAsync(t).then(function(){xK(t,e,n,r)},function(a){r(new YD(i,t,a))})}else n(t)}var PG=function(t,e){return e&&typeof t=="string"&&t.trim().length===0?!0:t==null};function eIe(t,e){return e===void 0&&(e=!1),{simple:function(n){return PG(n,e)||t.check(n)===void 0},async:function(n){return PG(n,e)||t.testAsync(n)}}}function Ja(){return typeof Proxy<"u"?TK(new El):KM(new El)}var Db={};Ja.extend=function(t){Object.assign(Db,t)};Ja.clearCustomRules=function(){Db={}};function TK(t){return new Proxy(t,{get:function(n,r){if(r in n)return n[r];var i=TK(t._clone());if(r in RA)return i._applyModifier(RA[r],r);if(r in Db)return i._applyRule(Db[r],r);if(r in ZM)return i._applyRule(ZM[r],r)}})}function KM(t){var e=function(i,a){return Object.keys(i).forEach(function(s){a[s]=function(){for(var o=[],l=arguments.length;l--;)o[l]=arguments[l];var u=KM(a._clone()),c=u._applyRule(i[s],s).apply(void 0,o);return c}}),a},n=e(ZM,t),r=e(Db,n);return Object.keys(RA).forEach(function(i){Object.defineProperty(r,i,{get:function(){var a=KM(r._clone());return a._applyModifier(RA[i],i)}})}),r}var RA={not:{simple:function(t){return function(e){return!t(e)}},async:function(t){return function(e){return Promise.resolve(t(e)).then(function(n){return!n}).catch(function(){return!0})}}},some:{simple:function(t){return function(e){return QE(e).some(function(n){try{return t(n)}catch{return!1}})}},async:function(t){return function(e){return Promise.all(QE(e).map(function(n){try{return t(n).catch(function(){return!1})}catch{return!1}})).then(function(n){return n.some(Boolean)})}}},every:{simple:function(t){return function(e){return e!==!1&&QE(e).every(t)}},async:function(t){return function(e){return Promise.all(QE(e).map(t)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(t,e){return function(n){return BG(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&t(n):t(n)}},async:function(t,e){return function(n){return Promise.resolve(t(n)).then(function(r){return BG(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&r:r}).catch(function(){return!1})}}}};function BG(t){return t&&t.name==="schema"&&t.args.length>0&&typeof t.args[0]=="object"}function QE(t){return typeof t=="string"?t.split(""):t}var ZM={equal:function(t){return function(e){return e==t}},exact:function(t){return function(e){return e===t}},number:function(t){return t===void 0&&(t=!0),function(e){return typeof e=="number"&&(t||isFinite(e))}},integer:function(){return function(t){var e=Number.isInteger||tIe;return e(t)}},numeric:function(){return function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},string:function(){return Lp("string")},boolean:function(){return Lp("boolean")},undefined:function(){return Lp("undefined")},null:function(){return Lp("null")},array:function(){return Lp("array")},object:function(){return Lp("object")},instanceOf:function(t){return function(e){return e instanceof t}},pattern:function(t){return function(e){return t.test(e)}},lowercase:function(){return function(t){return typeof t=="boolean"||t===t.toLowerCase()&&t.trim()!==""}},uppercase:function(){return function(t){return t===t.toUpperCase()&&t.trim()!==""}},vowel:function(){return function(t){return/^[aeiou]+$/i.test(t)}},consonant:function(){return function(t){return/^(?=[^aeiou])([a-z]+)$/i.test(t)}},first:function(t){return function(e){return e[0]==t}},last:function(t){return function(e){return e[e.length-1]==t}},empty:function(){return function(t){return t.length===0}},length:function(t,e){return function(n){return n.length>=t&&n.length<=(e||t)}},minLength:function(t){return function(e){return e.length>=t}},maxLength:function(t){return function(e){return e.length<=t}},negative:function(){return function(t){return t<0}},positive:function(){return function(t){return t>=0}},between:function(t,e){return function(n){return n>=t&&n<=e}},range:function(t,e){return function(n){return n>=t&&n<=e}},lessThan:function(t){return function(e){return et}},greaterThanOrEqual:function(t){return function(e){return e>=t}},even:function(){return function(t){return t%2===0}},odd:function(){return function(t){return t%2!==0}},includes:function(t){return function(e){return~e.indexOf(t)}},schema:function(t){return nIe(t)},passesAnyOf:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(n){return t.some(function(r){return r.test(n)})}},optional:eIe};function Lp(t){return function(e){return Array.isArray(e)&&t==="array"||e===null&&t==="null"||typeof e===t}}function tIe(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}function nIe(t){return{simple:function(e){var n=[];if(Object.keys(t).forEach(function(r){var i=t[r];try{i.check((e||{})[r])}catch(a){a.target=r,n.push(a)}}),n.length>0)throw n;return!0},async:function(e){var n=[],r=Object.keys(t).map(function(i){var a=t[i];return a.testAsync((e||{})[i]).catch(function(s){s.target=i,n.push(s)})});return Promise.all(r).then(function(){if(n.length>0)throw n;return!0})}}}var ur="colors",Ta="sizes",Yt="space",rIe={gap:Yt,gridGap:Yt,columnGap:Yt,gridColumnGap:Yt,rowGap:Yt,gridRowGap:Yt,inset:Yt,insetBlock:Yt,insetBlockEnd:Yt,insetBlockStart:Yt,insetInline:Yt,insetInlineEnd:Yt,insetInlineStart:Yt,margin:Yt,marginTop:Yt,marginRight:Yt,marginBottom:Yt,marginLeft:Yt,marginBlock:Yt,marginBlockEnd:Yt,marginBlockStart:Yt,marginInline:Yt,marginInlineEnd:Yt,marginInlineStart:Yt,padding:Yt,paddingTop:Yt,paddingRight:Yt,paddingBottom:Yt,paddingLeft:Yt,paddingBlock:Yt,paddingBlockEnd:Yt,paddingBlockStart:Yt,paddingInline:Yt,paddingInlineEnd:Yt,paddingInlineStart:Yt,top:Yt,right:Yt,bottom:Yt,left:Yt,scrollMargin:Yt,scrollMarginTop:Yt,scrollMarginRight:Yt,scrollMarginBottom:Yt,scrollMarginLeft:Yt,scrollMarginX:Yt,scrollMarginY:Yt,scrollMarginBlock:Yt,scrollMarginBlockEnd:Yt,scrollMarginBlockStart:Yt,scrollMarginInline:Yt,scrollMarginInlineEnd:Yt,scrollMarginInlineStart:Yt,scrollPadding:Yt,scrollPaddingTop:Yt,scrollPaddingRight:Yt,scrollPaddingBottom:Yt,scrollPaddingLeft:Yt,scrollPaddingX:Yt,scrollPaddingY:Yt,scrollPaddingBlock:Yt,scrollPaddingBlockEnd:Yt,scrollPaddingBlockStart:Yt,scrollPaddingInline:Yt,scrollPaddingInlineEnd:Yt,scrollPaddingInlineStart:Yt,fontSize:"fontSizes",background:ur,backgroundColor:ur,backgroundImage:ur,borderImage:ur,border:ur,borderBlock:ur,borderBlockEnd:ur,borderBlockStart:ur,borderBottom:ur,borderBottomColor:ur,borderColor:ur,borderInline:ur,borderInlineEnd:ur,borderInlineStart:ur,borderLeft:ur,borderLeftColor:ur,borderRight:ur,borderRightColor:ur,borderTop:ur,borderTopColor:ur,caretColor:ur,color:ur,columnRuleColor:ur,fill:ur,outline:ur,outlineColor:ur,stroke:ur,textDecorationColor:ur,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:Ta,minBlockSize:Ta,maxBlockSize:Ta,inlineSize:Ta,minInlineSize:Ta,maxInlineSize:Ta,width:Ta,minWidth:Ta,maxWidth:Ta,height:Ta,minHeight:Ta,maxHeight:Ta,flexBasis:Ta,gridTemplateColumns:Ta,gridTemplateRows:Ta,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},iIe=(t,e)=>typeof e=="function"?{"()":Function.prototype.toString.call(e)}:e,Am=()=>{const t=Object.create(null);return(e,n,...r)=>{const i=(a=>JSON.stringify(a,iIe))(e);return i in t?t[i]:t[i]=n(e,...r)}},nf=Symbol.for("sxs.internal"),qD=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),FG=t=>{for(const e in t)return!0;return!1},{hasOwnProperty:aIe}=Object.prototype,QM=t=>t.includes("-")?t:t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),sIe=/\s+(?![^()]*\))/,kp=t=>e=>t(...typeof e=="string"?String(e).split(sIe):[e]),UG={appearance:t=>({WebkitAppearance:t,appearance:t}),backfaceVisibility:t=>({WebkitBackfaceVisibility:t,backfaceVisibility:t}),backdropFilter:t=>({WebkitBackdropFilter:t,backdropFilter:t}),backgroundClip:t=>({WebkitBackgroundClip:t,backgroundClip:t}),boxDecorationBreak:t=>({WebkitBoxDecorationBreak:t,boxDecorationBreak:t}),clipPath:t=>({WebkitClipPath:t,clipPath:t}),content:t=>({content:t.includes('"')||t.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(t)?t:`"${t}"`}),hyphens:t=>({WebkitHyphens:t,hyphens:t}),maskImage:t=>({WebkitMaskImage:t,maskImage:t}),maskSize:t=>({WebkitMaskSize:t,maskSize:t}),tabSize:t=>({MozTabSize:t,tabSize:t}),textSizeAdjust:t=>({WebkitTextSizeAdjust:t,textSizeAdjust:t}),userSelect:t=>({WebkitUserSelect:t,userSelect:t}),marginBlock:kp((t,e)=>({marginBlockStart:t,marginBlockEnd:e||t})),marginInline:kp((t,e)=>({marginInlineStart:t,marginInlineEnd:e||t})),maxSize:kp((t,e)=>({maxBlockSize:t,maxInlineSize:e||t})),minSize:kp((t,e)=>({minBlockSize:t,minInlineSize:e||t})),paddingBlock:kp((t,e)=>({paddingBlockStart:t,paddingBlockEnd:e||t})),paddingInline:kp((t,e)=>({paddingInlineStart:t,paddingInlineEnd:e||t}))},ER=/([\d.]+)([^]*)/,oIe=(t,e)=>t.length?t.reduce((n,r)=>(n.push(...e.map(i=>i.includes("&")?i.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(i)?`:is(${r})`:r):r+" "+i)),n),[]):e,lIe=(t,e)=>t in uIe&&typeof e=="string"?e.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,r,i,a)=>r+(i==="stretch"?`-moz-available${a};${QM(t)}:${r}-webkit-fill-available`:`-moz-fit-content${a};${QM(t)}:${r}fit-content`)+a):String(e),uIe={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},bu=t=>t?t+"-":"",wK=(t,e,n)=>t.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(r,i,a,s,o)=>s=="$"==!!a?r:(i||s=="--"?"calc(":"")+"var(--"+(s==="$"?bu(e)+(o.includes("$")?"":bu(n))+o.replace(/\$/g,"-"):o)+")"+(i||s=="--"?"*"+(i||"")+(a||"1")+")":"")),cIe=/\s*,\s*(?![^()]*\))/,dIe=Object.prototype.toString,fh=(t,e,n,r,i)=>{let a,s,o;const l=(u,c,d)=>{let f,m;const g=y=>{for(f in y){const E=f.charCodeAt(0)===64,_=E&&Array.isArray(y[f])?y[f]:[y[f]];for(m of _){const A=/[A-Z]/.test(b=f)?b:b.replace(/-[^]/g,x=>x[1].toUpperCase()),I=typeof m=="object"&&m&&m.toString===dIe&&(!r.utils[A]||!c.length);if(A in r.utils&&!I){const x=r.utils[A];if(x!==s){s=x,g(x(m)),s=null;continue}}else if(A in UG){const x=UG[A];if(x!==o){o=x,g(x(m)),o=null;continue}}if(E&&(v=f.slice(1)in r.media?"@media "+r.media[f.slice(1)]:f,f=v.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(x,R,O,N,M,B)=>{const G=ER.test(R),W=.0625*(G?-1:1),[K,se]=G?[N,R]:[R,N];return"("+(O[0]==="="?"":O[0]===">"===G?"max-":"min-")+K+":"+(O[0]!=="="&&O.length===1?se.replace(ER,(ae,ee,F)=>Number(ee)+W*(O===">"?1:-1)+F):se)+(M?") and ("+(M[0]===">"?"min-":"max-")+K+":"+(M.length===1?B.replace(ER,(ae,ee,F)=>Number(ee)+W*(M===">"?-1:1)+F):B):"")+")"})),I){const x=E?d.concat(f):[...d],R=E?[...c]:oIe(c,f.split(cIe));a!==void 0&&i(zG(...a)),a=void 0,l(m,R,x)}else a===void 0&&(a=[[],c,d]),f=E||f.charCodeAt(0)!==36?f:`--${bu(r.prefix)}${f.slice(1).replace(/\$/g,"-")}`,m=I?m:typeof m=="number"?m&&A in fIe?String(m)+"px":String(m):wK(lIe(A,m??""),r.prefix,r.themeMap[A]),a[0].push(`${E?`${f} `:`${QM(f)}:`}${m}`)}}var v,b};g(u),a!==void 0&&i(zG(...a)),a=void 0};l(t,e,n)},zG=(t,e,n)=>`${n.map(r=>`${r}{`).join("")}${e.length?`${e.join(",")}{`:""}${t.join(";")}${e.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,fIe={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},HG=t=>String.fromCharCode(t+(t>25?39:97)),rf=t=>(e=>{let n,r="";for(n=Math.abs(e);n>52;n=n/52|0)r=HG(n%52)+r;return HG(n%52)+r})(((e,n)=>{let r=n.length;for(;r;)e=33*e^n.charCodeAt(--r);return e})(5381,JSON.stringify(t))>>>0),i0=["themed","global","styled","onevar","resonevar","allvar","inline"],pIe=t=>{if(t.href&&!t.href.startsWith(location.origin))return!1;try{return!!t.cssRules}catch{return!1}},hIe=t=>{let e;const n=()=>{const{cssRules:i}=e.sheet;return[].map.call(i,(a,s)=>{const{cssText:o}=a;let l="";if(o.startsWith("--sxs"))return"";if(i[s-1]&&(l=i[s-1].cssText).startsWith("--sxs")){if(!a.cssRules.length)return"";for(const u in e.rules)if(e.rules[u].group===a)return`--sxs{--sxs:${[...e.rules[u].cache].join(" ")}}${o}`;return a.cssRules.length?`${l}${o}`:""}return o}).join("")},r=()=>{if(e){const{rules:o,sheet:l}=e;if(!l.deleteRule){for(;Object(Object(l.cssRules)[0]).type===3;)l.cssRules.splice(0,1);l.cssRules=[]}for(const u in o)delete o[u]}const i=Object(t).styleSheets||[];for(const o of i)if(pIe(o)){for(let l=0,u=o.cssRules;u[l];++l){const c=Object(u[l]);if(c.type!==1)continue;const d=Object(u[l+1]);if(d.type!==4)continue;++l;const{cssText:f}=c;if(!f.startsWith("--sxs"))continue;const m=f.slice(14,-3).trim().split(/\s+/),g=i0[m[0]];g&&(e||(e={sheet:o,reset:r,rules:{},toString:n}),e.rules[g]={group:d,index:l,cache:new Set(m)})}if(e)break}if(!e){const o=(l,u)=>({type:u,cssRules:[],insertRule(c,d){this.cssRules.splice(d,0,o(c,{import:3,undefined:1}[(c.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return l==="@media{}"?`@media{${[].map.call(this.cssRules,c=>c.cssText).join("")}}`:l}});e={sheet:t?(t.head||t).appendChild(document.createElement("style")).sheet:o("","text/css"),rules:{},reset:r,toString:n}}const{sheet:a,rules:s}=e;for(let o=i0.length-1;o>=0;--o){const l=i0[o];if(!s[l]){const u=i0[o+1],c=s[u]?s[u].index:a.cssRules.length;a.insertRule("@media{}",c),a.insertRule(`--sxs{--sxs:${o}}`,c),s[l]={group:a.cssRules[c+1],index:c,cache:new Set([o])}}mIe(s[l])}};return r(),e},mIe=t=>{const e=t.group;let n=e.cssRules.length;t.apply=r=>{try{e.insertRule(r,n),++n}catch{}}},Bg=Symbol(),gIe=Am(),GG=(t,e)=>gIe(t,()=>(...n)=>{let r={type:null,composers:new Set};for(const i of n)if(i!=null)if(i[nf]){r.type==null&&(r.type=i[nf].type);for(const a of i[nf].composers)r.composers.add(a)}else i.constructor!==Object||i.$$typeof?r.type==null&&(r.type=i):r.composers.add(bIe(i,t));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),yIe(t,r,e)}),bIe=({variants:t,compoundVariants:e,defaultVariants:n,...r},i)=>{const a=`${bu(i.prefix)}c-${rf(r)}`,s=[],o=[],l=Object.create(null),u=[];for(const f in n)l[f]=String(n[f]);if(typeof t=="object"&&t)for(const f in t){c=l,d=f,aIe.call(c,d)||(l[f]="undefined");const m=t[f];for(const g in m){const y={[f]:String(g)};String(g)==="undefined"&&u.push(f);const v=m[g],b=[y,v,!FG(v)];s.push(b)}}var c,d;if(typeof e=="object"&&e)for(const f of e){let{css:m,...g}=f;m=typeof m=="object"&&m||{};for(const v in g)g[v]=String(g[v]);const y=[g,m,!FG(m)];o.push(y)}return[a,r,s,o,l,u]},yIe=(t,e,n)=>{const[r,i,a,s]=vIe(e.composers),o=typeof e.type=="function"||e.type.$$typeof?(d=>{function f(){for(let m=0;mf.rules[m]={apply:g=>f[Bg].push([m,g])}),f})(n):null,l=(o||n).rules,u=`.${r}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,c=d=>{d=typeof d=="object"&&d||EIe;const{css:f,...m}=d,g={};for(const b in a)if(delete m[b],b in d){let E=d[b];typeof E=="object"&&E?g[b]={"@initial":a[b],...E}:(E=String(E),g[b]=E!=="undefined"||s.has(b)?E:a[b])}else g[b]=a[b];const y=new Set([...i]);for(const[b,E,_,A]of e.composers){n.rules.styled.cache.has(b)||(n.rules.styled.cache.add(b),fh(E,[`.${b}`],[],t,R=>{l.styled.apply(R)}));const I=VG(_,g,t.media),x=VG(A,g,t.media,!0);for(const R of I)if(R!==void 0)for(const[O,N,M]of R){const B=`${b}-${rf(N)}-${O}`;y.add(B);const G=(M?n.rules.resonevar:n.rules.onevar).cache,W=M?l.resonevar:l.onevar;G.has(B)||(G.add(B),fh(N,[`.${B}`],[],t,K=>{W.apply(K)}))}for(const R of x)if(R!==void 0)for(const[O,N]of R){const M=`${b}-${rf(N)}-${O}`;y.add(M),n.rules.allvar.cache.has(M)||(n.rules.allvar.cache.add(M),fh(N,[`.${M}`],[],t,B=>{l.allvar.apply(B)}))}}if(typeof f=="object"&&f){const b=`${r}-i${rf(f)}-css`;y.add(b),n.rules.inline.cache.has(b)||(n.rules.inline.cache.add(b),fh(f,[`.${b}`],[],t,E=>{l.inline.apply(E)}))}for(const b of String(d.className||"").trim().split(/\s+/))b&&y.add(b);const v=m.className=[...y].join(" ");return{type:e.type,className:v,selector:u,props:m,toString:()=>v,deferredInjector:o}};return qD(c,{className:r,selector:u,[nf]:e,toString:()=>(n.rules.styled.cache.has(r)||c(),r)})},vIe=t=>{let e="";const n=[],r={},i=[];for(const[a,,,,s,o]of t){e===""&&(e=a),n.push(a),i.push(...o);for(const l in s){const u=s[l];(r[l]===void 0||u!=="undefined"||o.includes(u))&&(r[l]=u)}}return[e,n,r,new Set(i)]},VG=(t,e,n,r)=>{const i=[];e:for(let[a,s,o]of t){if(o)continue;let l,u=0,c=!1;for(l in a){const d=a[l];let f=e[l];if(f!==d){if(typeof f!="object"||!f)continue e;{let m,g,y=0;for(const v in f){if(d===String(f[v])){if(v!=="@initial"){const b=v.slice(1);(g=g||[]).push(b in n?n[b]:v.replace(/^@media ?/,"")),c=!0}u+=y,m=!0}++y}if(g&&g.length&&(s={["@media "+g.join(", ")]:s}),!m)continue e}}}(i[u]=i[u]||[]).push([r?"cv":`${l}-${a[l]}`,s,c])}return i},EIe={},_Ie=Am(),SIe=(t,e)=>_Ie(t,()=>(...n)=>{const r=()=>{for(let i of n){i=typeof i=="object"&&i||{};let a=rf(i);if(!e.rules.global.cache.has(a)){if(e.rules.global.cache.add(a),"@import"in i){let s=[].indexOf.call(e.sheet.cssRules,e.rules.themed.group)-1;for(let o of[].concat(i["@import"]))o=o.includes('"')||o.includes("'")?o:`"${o}"`,e.sheet.insertRule(`@import ${o};`,s++);delete i["@import"]}fh(i,[],[],t,s=>{e.rules.global.apply(s)})}}return""};return qD(r,{toString:r})}),AIe=Am(),xIe=(t,e)=>AIe(t,()=>n=>{const r=`${bu(t.prefix)}k-${rf(n)}`,i=()=>{if(!e.rules.global.cache.has(r)){e.rules.global.cache.add(r);const a=[];fh(n,[],[],t,o=>a.push(o));const s=`@keyframes ${r}{${a.join("")}}`;e.rules.global.apply(s)}return r};return qD(i,{get name(){return i()},toString:i})}),TIe=class{constructor(t,e,n,r){this.token=t==null?"":String(t),this.value=e==null?"":String(e),this.scale=n==null?"":String(n),this.prefix=r==null?"":String(r)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+bu(this.prefix)+bu(this.scale)+this.token}toString(){return this.computedValue}},wIe=Am(),CIe=(t,e)=>wIe(t,()=>(n,r)=>{r=typeof n=="object"&&n||Object(r);const i=`.${n=(n=typeof n=="string"?n:"")||`${bu(t.prefix)}t-${rf(r)}`}`,a={},s=[];for(const l in r){a[l]={};for(const u in r[l]){const c=`--${bu(t.prefix)}${l}-${u}`,d=wK(String(r[l][u]),t.prefix,l);a[l][u]=new TIe(u,d,l,t.prefix),s.push(`${c}:${d}`)}}const o=()=>{if(s.length&&!e.rules.themed.cache.has(n)){e.rules.themed.cache.add(n);const l=`${r===t.theme?":root,":""}.${n}{${s.join(";")}}`;e.rules.themed.apply(l)}return n};return{...a,get className(){return o()},selector:i,toString:o}}),RIe=Am(),IIe=Am(),MIe=t=>{const e=(n=>{let r=!1;const i=RIe(n,a=>{r=!0;const s="prefix"in(a=typeof a=="object"&&a||{})?String(a.prefix):"",o=typeof a.media=="object"&&a.media||{},l=typeof a.root=="object"?a.root||null:globalThis.document||null,u=typeof a.theme=="object"&&a.theme||{},c={prefix:s,media:o,theme:u,themeMap:typeof a.themeMap=="object"&&a.themeMap||{...rIe},utils:typeof a.utils=="object"&&a.utils||{}},d=hIe(l),f={css:GG(c,d),globalCss:SIe(c,d),keyframes:xIe(c,d),createTheme:CIe(c,d),reset(){d.reset(),f.theme.toString()},theme:{},sheet:d,config:c,prefix:s,getCssText:d.toString,toString:d.toString};return String(f.theme=f.createTheme(u)),f});return r||i.reset(),i})(t);return e.styled=(({config:n,sheet:r})=>IIe(n,()=>{const i=GG(n,r);return(...a)=>{const s=i(...a),o=s[nf].type,l=pe.forwardRef((u,c)=>{const d=u&&u.as||o,{props:f,deferredInjector:m}=s(u);return delete f.as,f.ref=c,m?pe.createElement(pe.Fragment,null,pe.createElement(d,f),pe.createElement(m,null)):pe.createElement(d,f)});return l.className=s.className,l.displayName=`Styled.${o.displayName||o.name||o}`,l.selector=s.selector,l.toString=()=>s.selector,l[nf]=s[nf],l}}))(e),e};function Gl(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function NIe(t,e=[]){let n=[];function r(a,s){const o=w.createContext(s),l=n.length;n=[...n,s];const u=d=>{var b;const{scope:f,children:m,...g}=d,y=((b=f==null?void 0:f[t])==null?void 0:b[l])||o,v=w.useMemo(()=>g,Object.values(g));return $.jsx(y.Provider,{value:v,children:m})};u.displayName=a+"Provider";function c(d,f){var y;const m=((y=f==null?void 0:f[t])==null?void 0:y[l])||o,g=w.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[u,c]}const i=()=>{const a=n.map(s=>w.createContext(s));return function(o){const l=(o==null?void 0:o[t])||a;return w.useMemo(()=>({[`__scope${t}`]:{...o,[t]:l}}),[o,l])}};return i.scopeName=t,[r,OIe(i,...e)]}function OIe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:l,scopeName:u})=>{const d=l(a)[`__scope${u}`];return{...o,...d}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}function xm(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function DIe(t,e=globalThis==null?void 0:globalThis.document){const n=xm(t);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var LIe="DismissableLayer",JM="dismissableLayer.update",kIe="dismissableLayer.pointerDownOutside",PIe="dismissableLayer.focusOutside",$G,CK=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),RK=w.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:o,...l}=t,u=w.useContext(CK),[c,d]=w.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=w.useState({}),g=Uf(e,R=>d(R)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),E=c?y.indexOf(c):-1,_=u.layersWithOutsidePointerEventsDisabled.size>0,A=E>=b,I=UIe(R=>{const O=R.target,N=[...u.branches].some(M=>M.contains(O));!A||N||(i==null||i(R),s==null||s(R),R.defaultPrevented||o==null||o())},f),x=zIe(R=>{const O=R.target;[...u.branches].some(M=>M.contains(O))||(a==null||a(R),s==null||s(R),R.defaultPrevented||o==null||o())},f);return DIe(R=>{E===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},f),w.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&($G=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),WG(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=$G)}},[c,f,n,u]),w.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),WG())},[c,u]),w.useEffect(()=>{const R=()=>m({});return document.addEventListener(JM,R),()=>document.removeEventListener(JM,R)},[]),$.jsx(zc.div,{...l,ref:g,style:{pointerEvents:_?A?"auto":"none":void 0,...t.style},onFocusCapture:Gl(t.onFocusCapture,x.onFocusCapture),onBlurCapture:Gl(t.onBlurCapture,x.onBlurCapture),onPointerDownCapture:Gl(t.onPointerDownCapture,I.onPointerDownCapture)})});RK.displayName=LIe;var BIe="DismissableLayerBranch",FIe=w.forwardRef((t,e)=>{const n=w.useContext(CK),r=w.useRef(null),i=Uf(e,r);return w.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),$.jsx(zc.div,{...t,ref:i})});FIe.displayName=BIe;function UIe(t,e=globalThis==null?void 0:globalThis.document){const n=xm(t),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const a=o=>{if(o.target&&!r.current){let l=function(){IK(kIe,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",a),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function zIe(t,e=globalThis==null?void 0:globalThis.document){const n=xm(t),r=w.useRef(!1);return w.useEffect(()=>{const i=a=>{a.target&&!r.current&&IK(PIe,n,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function WG(){const t=new CustomEvent(JM);document.dispatchEvent(t)}function IK(t,e,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?KRe(i,a):i.dispatchEvent(a)}var HIe=Q_.useId||(()=>{}),GIe=0;function VIe(t){const[e,n]=w.useState(HIe());return Af(()=>{n(r=>r??String(GIe++))},[t]),e?`radix-${e}`:""}const $Ie=["top","right","bottom","left"],Rc=Math.min,gs=Math.max,IA=Math.round,JE=Math.floor,ml=t=>({x:t,y:t}),WIe={left:"right",right:"left",bottom:"top",top:"bottom"},jIe={start:"end",end:"start"};function eN(t,e,n){return gs(t,Rc(e,n))}function yu(t,e){return typeof t=="function"?t(e):t}function vu(t){return t.split("-")[0]}function Tm(t){return t.split("-")[1]}function XD(t){return t==="x"?"y":"x"}function KD(t){return t==="y"?"height":"width"}function Ic(t){return["top","bottom"].includes(vu(t))?"y":"x"}function ZD(t){return XD(Ic(t))}function YIe(t,e,n){n===void 0&&(n=!1);const r=Tm(t),i=ZD(t),a=KD(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=MA(s)),[s,MA(s)]}function qIe(t){const e=MA(t);return[tN(t),e,tN(e)]}function tN(t){return t.replace(/start|end/g,e=>jIe[e])}function XIe(t,e,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?a:s;default:return[]}}function KIe(t,e,n,r){const i=Tm(t);let a=XIe(vu(t),n==="start",r);return i&&(a=a.map(s=>s+"-"+i),e&&(a=a.concat(a.map(tN)))),a}function MA(t){return t.replace(/left|right|bottom|top/g,e=>WIe[e])}function ZIe(t){return{top:0,right:0,bottom:0,left:0,...t}}function MK(t){return typeof t!="number"?ZIe(t):{top:t,right:t,bottom:t,left:t}}function NA(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function jG(t,e,n){let{reference:r,floating:i}=t;const a=Ic(e),s=ZD(e),o=KD(s),l=vu(e),u=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[o]/2-i[o]/2;let m;switch(l){case"top":m={x:c,y:r.y-i.height};break;case"bottom":m={x:c,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-i.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Tm(e)){case"start":m[s]-=f*(n&&u?-1:1);break;case"end":m[s]+=f*(n&&u?-1:1);break}return m}const QIe=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:s}=n,o=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let u=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:d}=jG(u,r,l),f=r,m={},g=0;for(let y=0;y({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:a,platform:s,elements:o,middlewareData:l}=e,{element:u,padding:c=0}=yu(t,e)||{};if(u==null)return{};const d=MK(c),f={x:n,y:r},m=ZD(i),g=KD(m),y=await s.getDimensions(u),v=m==="y",b=v?"top":"left",E=v?"bottom":"right",_=v?"clientHeight":"clientWidth",A=a.reference[g]+a.reference[m]-f[m]-a.floating[g],I=f[m]-a.reference[m],x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let R=x?x[_]:0;(!R||!await(s.isElement==null?void 0:s.isElement(x)))&&(R=o.floating[_]||a.floating[g]);const O=A/2-I/2,N=R/2-y[g]/2-1,M=Rc(d[b],N),B=Rc(d[E],N),G=M,W=R-y[g]-B,K=R/2-y[g]/2+O,se=eN(G,K,W),ae=!l.arrow&&Tm(i)!=null&&K!==se&&a.reference[g]/2-(KK<=0)){var B,G;const K=(((B=a.flip)==null?void 0:B.index)||0)+1,se=R[K];if(se)return{data:{index:K,overflows:M},reset:{placement:se}};let ae=(G=M.filter(ee=>ee.overflows[0]<=0).sort((ee,F)=>ee.overflows[1]-F.overflows[1])[0])==null?void 0:G.placement;if(!ae)switch(m){case"bestFit":{var W;const ee=(W=M.filter(F=>{if(x){const ie=Ic(F.placement);return ie===E||ie==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(ie=>ie>0).reduce((ie,J)=>ie+J,0)]).sort((F,ie)=>F[1]-ie[1])[0])==null?void 0:W[0];ee&&(ae=ee);break}case"initialPlacement":ae=o;break}if(i!==ae)return{reset:{placement:ae}}}return{}}}};function YG(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function qG(t){return $Ie.some(e=>t[e]>=0)}const tMe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=yu(t,e);switch(r){case"referenceHidden":{const a=await Lb(e,{...i,elementContext:"reference"}),s=YG(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:qG(s)}}}case"escaped":{const a=await Lb(e,{...i,altBoundary:!0}),s=YG(a,n.floating);return{data:{escapedOffsets:s,escaped:qG(s)}}}default:return{}}}}};async function nMe(t,e){const{placement:n,platform:r,elements:i}=t,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=vu(n),o=Tm(n),l=Ic(n)==="y",u=["left","top"].includes(s)?-1:1,c=a&&l?-1:1,d=yu(e,t);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof g=="number"&&(m=o==="end"?g*-1:g),l?{x:m*c,y:f*u}:{x:f*u,y:m*c}}const rMe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:a,placement:s,middlewareData:o}=e,l=await nMe(e,t);return s===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:s}}}}},iMe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:o={fn:v=>{let{x:b,y:E}=v;return{x:b,y:E}}},...l}=yu(t,e),u={x:n,y:r},c=await Lb(e,l),d=Ic(vu(i)),f=XD(d);let m=u[f],g=u[d];if(a){const v=f==="y"?"top":"left",b=f==="y"?"bottom":"right",E=m+c[v],_=m-c[b];m=eN(E,m,_)}if(s){const v=d==="y"?"top":"left",b=d==="y"?"bottom":"right",E=g+c[v],_=g-c[b];g=eN(E,g,_)}const y=o.fn({...e,[f]:m,[d]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:a,[d]:s}}}}}},aMe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:a,middlewareData:s}=e,{offset:o=0,mainAxis:l=!0,crossAxis:u=!0}=yu(t,e),c={x:n,y:r},d=Ic(i),f=XD(d);let m=c[f],g=c[d];const y=yu(o,e),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const _=f==="y"?"height":"width",A=a.reference[f]-a.floating[_]+v.mainAxis,I=a.reference[f]+a.reference[_]-v.mainAxis;mI&&(m=I)}if(u){var b,E;const _=f==="y"?"width":"height",A=["top","left"].includes(vu(i)),I=a.reference[d]-a.floating[_]+(A&&((b=s.offset)==null?void 0:b[d])||0)+(A?0:v.crossAxis),x=a.reference[d]+a.reference[_]+(A?0:((E=s.offset)==null?void 0:E[d])||0)-(A?v.crossAxis:0);gx&&(g=x)}return{[f]:m,[d]:g}}}},sMe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:a,platform:s,elements:o}=e,{apply:l=()=>{},...u}=yu(t,e),c=await Lb(e,u),d=vu(i),f=Tm(i),m=Ic(i)==="y",{width:g,height:y}=a.floating;let v,b;d==="top"||d==="bottom"?(v=d,b=f===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(b=d,v=f==="end"?"top":"bottom");const E=y-c.top-c.bottom,_=g-c.left-c.right,A=Rc(y-c[v],E),I=Rc(g-c[b],_),x=!e.middlewareData.shift;let R=A,O=I;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(O=_),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(R=E),x&&!f){const M=gs(c.left,0),B=gs(c.right,0),G=gs(c.top,0),W=gs(c.bottom,0);m?O=g-2*(M!==0||B!==0?M+B:gs(c.left,c.right)):R=y-2*(G!==0||W!==0?G+W:gs(c.top,c.bottom))}await l({...e,availableWidth:O,availableHeight:R});const N=await s.getDimensions(o.floating);return g!==N.width||y!==N.height?{reset:{rects:!0}}:{}}}};function RT(){return typeof window<"u"}function wm(t){return NK(t)?(t.nodeName||"").toLowerCase():"#document"}function Ss(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Al(t){var e;return(e=(NK(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function NK(t){return RT()?t instanceof Node||t instanceof Ss(t).Node:!1}function Co(t){return RT()?t instanceof Element||t instanceof Ss(t).Element:!1}function _l(t){return RT()?t instanceof HTMLElement||t instanceof Ss(t).HTMLElement:!1}function XG(t){return!RT()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ss(t).ShadowRoot}function by(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Ro(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function oMe(t){return["table","td","th"].includes(wm(t))}function IT(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function QD(t){const e=JD(),n=Co(t)?Ro(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function lMe(t){let e=Mc(t);for(;_l(e)&&!rm(e);){if(QD(e))return e;if(IT(e))return null;e=Mc(e)}return null}function JD(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function rm(t){return["html","body","#document"].includes(wm(t))}function Ro(t){return Ss(t).getComputedStyle(t)}function MT(t){return Co(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Mc(t){if(wm(t)==="html")return t;const e=t.assignedSlot||t.parentNode||XG(t)&&t.host||Al(t);return XG(e)?e.host:e}function OK(t){const e=Mc(t);return rm(e)?t.ownerDocument?t.ownerDocument.body:t.body:_l(e)&&by(e)?e:OK(e)}function kb(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=OK(t),a=i===((r=t.ownerDocument)==null?void 0:r.body),s=Ss(i);if(a){const o=nN(s);return e.concat(s,s.visualViewport||[],by(i)?i:[],o&&n?kb(o):[])}return e.concat(i,kb(i,[],n))}function nN(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function DK(t){const e=Ro(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=_l(t),a=i?t.offsetWidth:n,s=i?t.offsetHeight:r,o=IA(n)!==a||IA(r)!==s;return o&&(n=a,r=s),{width:n,height:r,$:o}}function eL(t){return Co(t)?t:t.contextElement}function Mh(t){const e=eL(t);if(!_l(e))return ml(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:a}=DK(e);let s=(a?IA(n.width):n.width)/r,o=(a?IA(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const uMe=ml(0);function LK(t){const e=Ss(t);return!JD()||!e.visualViewport?uMe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function cMe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ss(t)?!1:e}function xf(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),a=eL(t);let s=ml(1);e&&(r?Co(r)&&(s=Mh(r)):s=Mh(t));const o=cMe(a,n,r)?LK(a):ml(0);let l=(i.left+o.x)/s.x,u=(i.top+o.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(a){const f=Ss(a),m=r&&Co(r)?Ss(r):r;let g=f,y=nN(g);for(;y&&r&&m!==g;){const v=Mh(y),b=y.getBoundingClientRect(),E=Ro(y),_=b.left+(y.clientLeft+parseFloat(E.paddingLeft))*v.x,A=b.top+(y.clientTop+parseFloat(E.paddingTop))*v.y;l*=v.x,u*=v.y,c*=v.x,d*=v.y,l+=_,u+=A,g=Ss(y),y=nN(g)}}return NA({width:c,height:d,x:l,y:u})}function tL(t,e){const n=MT(t).scrollLeft;return e?e.left+n:xf(Al(t)).left+n}function kK(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:tL(t,r)),a=r.top+e.scrollTop;return{x:i,y:a}}function dMe(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const a=i==="fixed",s=Al(r),o=e?IT(e.floating):!1;if(r===s||o&&a)return n;let l={scrollLeft:0,scrollTop:0},u=ml(1);const c=ml(0),d=_l(r);if((d||!d&&!a)&&((wm(r)!=="body"||by(s))&&(l=MT(r)),_l(r))){const m=xf(r);u=Mh(r),c.x=m.x+r.clientLeft,c.y=m.y+r.clientTop}const f=s&&!d&&!a?kK(s,l,!0):ml(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function fMe(t){return Array.from(t.getClientRects())}function pMe(t){const e=Al(t),n=MT(t),r=t.ownerDocument.body,i=gs(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=gs(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+tL(t);const o=-n.scrollTop;return Ro(r).direction==="rtl"&&(s+=gs(e.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:o}}function hMe(t,e){const n=Ss(t),r=Al(t),i=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,o=0,l=0;if(i){a=i.width,s=i.height;const u=JD();(!u||u&&e==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:a,height:s,x:o,y:l}}function mMe(t,e){const n=xf(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,a=_l(t)?Mh(t):ml(1),s=t.clientWidth*a.x,o=t.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:s,height:o,x:l,y:u}}function KG(t,e,n){let r;if(e==="viewport")r=hMe(t,n);else if(e==="document")r=pMe(Al(t));else if(Co(e))r=mMe(e,n);else{const i=LK(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return NA(r)}function PK(t,e){const n=Mc(t);return n===e||!Co(n)||rm(n)?!1:Ro(n).position==="fixed"||PK(n,e)}function gMe(t,e){const n=e.get(t);if(n)return n;let r=kb(t,[],!1).filter(o=>Co(o)&&wm(o)!=="body"),i=null;const a=Ro(t).position==="fixed";let s=a?Mc(t):t;for(;Co(s)&&!rm(s);){const o=Ro(s),l=QD(s);!l&&o.position==="fixed"&&(i=null),(a?!l&&!i:!l&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||by(s)&&!l&&PK(t,s))?r=r.filter(c=>c!==s):i=o,s=Mc(s)}return e.set(t,r),r}function bMe(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?IT(e)?[]:gMe(e,this._c):[].concat(n),r],o=s[0],l=s.reduce((u,c)=>{const d=KG(e,c,i);return u.top=gs(d.top,u.top),u.right=Rc(d.right,u.right),u.bottom=Rc(d.bottom,u.bottom),u.left=gs(d.left,u.left),u},KG(e,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function yMe(t){const{width:e,height:n}=DK(t);return{width:e,height:n}}function vMe(t,e,n){const r=_l(e),i=Al(e),a=n==="fixed",s=xf(t,!0,a,e);let o={scrollLeft:0,scrollTop:0};const l=ml(0);if(r||!r&&!a)if((wm(e)!=="body"||by(i))&&(o=MT(e)),r){const f=xf(e,!0,a,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=tL(i));const u=i&&!r&&!a?kK(i,o):ml(0),c=s.left+o.scrollLeft-l.x-u.x,d=s.top+o.scrollTop-l.y-u.y;return{x:c,y:d,width:s.width,height:s.height}}function _R(t){return Ro(t).position==="static"}function ZG(t,e){if(!_l(t)||Ro(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Al(t)===n&&(n=n.ownerDocument.body),n}function BK(t,e){const n=Ss(t);if(IT(t))return n;if(!_l(t)){let i=Mc(t);for(;i&&!rm(i);){if(Co(i)&&!_R(i))return i;i=Mc(i)}return n}let r=ZG(t,e);for(;r&&oMe(r)&&_R(r);)r=ZG(r,e);return r&&rm(r)&&_R(r)&&!QD(r)?n:r||lMe(t)||n}const EMe=async function(t){const e=this.getOffsetParent||BK,n=this.getDimensions,r=await n(t.floating);return{reference:vMe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _Me(t){return Ro(t).direction==="rtl"}const SMe={convertOffsetParentRelativeRectToViewportRelativeRect:dMe,getDocumentElement:Al,getClippingRect:bMe,getOffsetParent:BK,getElementRects:EMe,getClientRects:fMe,getDimensions:yMe,getScale:Mh,isElement:Co,isRTL:_Me};function AMe(t,e){let n=null,r;const i=Al(t);function a(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function s(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),a();const{left:u,top:c,width:d,height:f}=t.getBoundingClientRect();if(o||e(),!d||!f)return;const m=JE(c),g=JE(i.clientWidth-(u+d)),y=JE(i.clientHeight-(c+f)),v=JE(u),E={rootMargin:-m+"px "+-g+"px "+-y+"px "+-v+"px",threshold:gs(0,Rc(1,l))||1};let _=!0;function A(I){const x=I[0].intersectionRatio;if(x!==l){if(!_)return s();x?s(!1,x):r=setTimeout(()=>{s(!1,1e-7)},1e3)}_=!1}try{n=new IntersectionObserver(A,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,E)}n.observe(t)}return s(!0),a}function xMe(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=eL(t),c=i||a?[...u?kb(u):[],...kb(e)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const d=u&&o?AMe(u,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(b=>{let[E]=b;E&&E.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(e)})),n()}),u&&!l&&m.observe(u),m.observe(e));let g,y=l?xf(t):null;l&&v();function v(){const b=xf(t);y&&(b.x!==y.x||b.y!==y.y||b.width!==y.width||b.height!==y.height)&&n(),y=b,g=requestAnimationFrame(v)}return n(),()=>{var b;c.forEach(E=>{i&&E.removeEventListener("scroll",n),a&&E.removeEventListener("resize",n)}),d==null||d(),(b=m)==null||b.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const TMe=rMe,wMe=iMe,CMe=eMe,RMe=sMe,IMe=tMe,QG=JIe,MMe=aMe,NMe=(t,e,n)=>{const r=new Map,i={platform:SMe,...n},a={...i.platform,_c:r};return QIe(t,e,{...i,platform:a})};var Y_=typeof document<"u"?w.useLayoutEffect:w.useEffect;function OA(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!OA(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&t.$$typeof)&&!OA(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function FK(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function JG(t,e){const n=FK(t);return Math.round(e*n)/n}function SR(t){const e=w.useRef(t);return Y_(()=>{e.current=t}),e}function OMe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:o=!0,whileElementsMounted:l,open:u}=t,[c,d]=w.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,m]=w.useState(r);OA(f,r)||m(r);const[g,y]=w.useState(null),[v,b]=w.useState(null),E=w.useCallback(F=>{F!==x.current&&(x.current=F,y(F))},[]),_=w.useCallback(F=>{F!==R.current&&(R.current=F,b(F))},[]),A=a||g,I=s||v,x=w.useRef(null),R=w.useRef(null),O=w.useRef(c),N=l!=null,M=SR(l),B=SR(i),G=SR(u),W=w.useCallback(()=>{if(!x.current||!R.current)return;const F={placement:e,strategy:n,middleware:f};B.current&&(F.platform=B.current),NMe(x.current,R.current,F).then(ie=>{const J={...ie,isPositioned:G.current!==!1};K.current&&!OA(O.current,J)&&(O.current=J,Mf.flushSync(()=>{d(J)}))})},[f,e,n,B,G]);Y_(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(F=>({...F,isPositioned:!1})))},[u]);const K=w.useRef(!1);Y_(()=>(K.current=!0,()=>{K.current=!1}),[]),Y_(()=>{if(A&&(x.current=A),I&&(R.current=I),A&&I){if(M.current)return M.current(A,I,W);W()}},[A,I,W,M,N]);const se=w.useMemo(()=>({reference:x,floating:R,setReference:E,setFloating:_}),[E,_]),ae=w.useMemo(()=>({reference:A,floating:I}),[A,I]),ee=w.useMemo(()=>{const F={position:n,left:0,top:0};if(!ae.floating)return F;const ie=JG(ae.floating,c.x),J=JG(ae.floating,c.y);return o?{...F,transform:"translate("+ie+"px, "+J+"px)",...FK(ae.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:J}},[n,o,ae.floating,c.x,c.y]);return w.useMemo(()=>({...c,update:W,refs:se,elements:ae,floatingStyles:ee}),[c,W,se,ae,ee])}const DMe=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?QG({element:r.current,padding:i}).fn(n):{}:r?QG({element:r,padding:i}).fn(n):{}}}},LMe=(t,e)=>({...TMe(t),options:[t,e]}),kMe=(t,e)=>({...wMe(t),options:[t,e]}),PMe=(t,e)=>({...MMe(t),options:[t,e]}),BMe=(t,e)=>({...CMe(t),options:[t,e]}),FMe=(t,e)=>({...RMe(t),options:[t,e]}),UMe=(t,e)=>({...IMe(t),options:[t,e]}),zMe=(t,e)=>({...DMe(t),options:[t,e]});var HMe="Arrow",UK=w.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...a}=t;return $.jsx(zc.svg,{...a,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:$.jsx("polygon",{points:"0,0 30,0 15,10"})})});UK.displayName=HMe;var GMe=UK;function VMe(t,e=[]){let n=[];function r(a,s){const o=w.createContext(s),l=n.length;n=[...n,s];function u(d){const{scope:f,children:m,...g}=d,y=(f==null?void 0:f[t][l])||o,v=w.useMemo(()=>g,Object.values(g));return $.jsx(y.Provider,{value:v,children:m})}function c(d,f){const m=(f==null?void 0:f[t][l])||o,g=w.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,c]}const i=()=>{const a=n.map(s=>w.createContext(s));return function(o){const l=(o==null?void 0:o[t])||a;return w.useMemo(()=>({[`__scope${t}`]:{...o,[t]:l}}),[o,l])}};return i.scopeName=t,[r,$Me(i,...e)]}function $Me(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:l,scopeName:u})=>{const d=l(a)[`__scope${u}`];return{...o,...d}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}function WMe(t){const[e,n]=w.useState(void 0);return Af(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,o;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,o=u.blockSize}else s=t.offsetWidth,o=t.offsetHeight;n({width:s,height:o})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var nL="Popper",[zK,HK]=VMe(nL),[jMe,GK]=zK(nL),VK=t=>{const{__scopePopper:e,children:n}=t,[r,i]=w.useState(null);return $.jsx(jMe,{scope:e,anchor:r,onAnchorChange:i,children:n})};VK.displayName=nL;var $K="PopperAnchor",WK=w.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,a=GK($K,n),s=w.useRef(null),o=Uf(e,s);return w.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:$.jsx(zc.div,{...i,ref:o})});WK.displayName=$K;var rL="PopperContent",[YMe,qMe]=zK(rL),jK=w.forwardRef((t,e)=>{var Ye,gt,Gt,Ut,Mt,$e;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:g,...y}=t,v=GK(rL,n),[b,E]=w.useState(null),_=Uf(e,qe=>E(qe)),[A,I]=w.useState(null),x=WMe(A),R=(x==null?void 0:x.width)??0,O=(x==null?void 0:x.height)??0,N=r+(a!=="center"?"-"+a:""),M=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},B=Array.isArray(u)?u:[u],G=B.length>0,W={padding:M,boundary:B.filter(KMe),altBoundary:G},{refs:K,floatingStyles:se,placement:ae,isPositioned:ee,middlewareData:F}=OMe({strategy:"fixed",placement:N,whileElementsMounted:(...qe)=>xMe(...qe,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[LMe({mainAxis:i+O,alignmentAxis:s}),l&&kMe({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?PMe():void 0,...W}),l&&BMe({...W}),FMe({...W,apply:({elements:qe,rects:re,availableWidth:At,availableHeight:Je})=>{const{width:xt,height:ot}=re.reference,Vt=qe.floating.style;Vt.setProperty("--radix-popper-available-width",`${At}px`),Vt.setProperty("--radix-popper-available-height",`${Je}px`),Vt.setProperty("--radix-popper-anchor-width",`${xt}px`),Vt.setProperty("--radix-popper-anchor-height",`${ot}px`)}}),A&&zMe({element:A,padding:o}),ZMe({arrowWidth:R,arrowHeight:O}),f&&UMe({strategy:"referenceHidden",...W})]}),[ie,J]=XK(ae),fe=xm(g);Af(()=>{ee&&(fe==null||fe())},[ee,fe]);const Ce=(Ye=F.arrow)==null?void 0:Ye.x,Le=(gt=F.arrow)==null?void 0:gt.y,j=((Gt=F.arrow)==null?void 0:Gt.centerOffset)!==0,[ke,Fe]=w.useState();return Af(()=>{b&&Fe(window.getComputedStyle(b).zIndex)},[b]),$.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:ee?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[(Ut=F.transformOrigin)==null?void 0:Ut.x,(Mt=F.transformOrigin)==null?void 0:Mt.y].join(" "),...(($e=F.hide)==null?void 0:$e.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:$.jsx(YMe,{scope:n,placedSide:ie,onArrowChange:I,arrowX:Ce,arrowY:Le,shouldHideArrow:j,children:$.jsx(zc.div,{"data-side":ie,"data-align":J,...y,ref:_,style:{...y.style,animation:ee?void 0:"none"}})})})});jK.displayName=rL;var YK="PopperArrow",XMe={top:"bottom",right:"left",bottom:"top",left:"right"},qK=w.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,a=qMe(YK,r),s=XMe[a.placedSide];return $.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:$.jsx(GMe,{...i,ref:n,style:{...i.style,display:"block"}})})});qK.displayName=YK;function KMe(t){return t!==null}var ZMe=t=>({name:"transformOrigin",options:t,fn(e){var v,b,E;const{placement:n,rects:r,middlewareData:i}=e,s=((v=i.arrow)==null?void 0:v.centerOffset)!==0,o=s?0:t.arrowWidth,l=s?0:t.arrowHeight,[u,c]=XK(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((b=i.arrow)==null?void 0:b.x)??0)+o/2,m=(((E=i.arrow)==null?void 0:E.y)??0)+l/2;let g="",y="";return u==="bottom"?(g=s?d:`${f}px`,y=`${-l}px`):u==="top"?(g=s?d:`${f}px`,y=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,y=s?d:`${m}px`):u==="left"&&(g=`${r.floating.width+l}px`,y=s?d:`${m}px`),{data:{x:g,y}}}});function XK(t){const[e,n="center"]=t.split("-");return[e,n]}var QMe=VK,JMe=WK,eNe=jK,tNe=qK;function nNe(t,e){return w.useReducer((n,r)=>e[n][r]??n,t)}var KK=t=>{const{present:e,children:n}=t,r=rNe(e),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),a=Uf(r.ref,iNe(i));return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:a}):null};KK.displayName="Presence";function rNe(t){const[e,n]=w.useState(),r=w.useRef({}),i=w.useRef(t),a=w.useRef("none"),s=t?"mounted":"unmounted",[o,l]=nNe(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=e_(r.current);a.current=o==="mounted"?u:"none"},[o]),Af(()=>{const u=r.current,c=i.current;if(c!==t){const f=a.current,m=e_(u);t?l("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Af(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,d=m=>{const y=e_(r.current).includes(m.animationName);if(m.target===e&&y&&(l("ANIMATION_END"),!i.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",u=c.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},f=m=>{m.target===e&&(a.current=e_(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{c.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:w.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function e_(t){return(t==null?void 0:t.animationName)||"none"}function iNe(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function aNe({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=sNe({defaultProp:e,onChange:n}),a=t!==void 0,s=a?t:r,o=xm(n),l=w.useCallback(u=>{if(a){const d=typeof u=="function"?u(t):u;d!==t&&o(d)}else i(u)},[a,t,i,o]);return[s,l]}function sNe({defaultProp:t,onChange:e}){const n=w.useState(t),[r]=n,i=w.useRef(r),a=xm(e);return w.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var oNe="VisuallyHidden",ZK=w.forwardRef((t,e)=>$.jsx(zc.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));ZK.displayName=oNe;var lNe=ZK,[NT,Hze]=NIe("Tooltip",[HK]),OT=HK(),uNe="TooltipProvider",rN="tooltip.open",[Gze,iL]=NT(uNe),DT="Tooltip",[cNe,LT]=NT(DT),QK=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:s,delayDuration:o}=t,l=iL(DT,t.__scopeTooltip),u=OT(e),[c,d]=w.useState(null),f=VIe(),m=w.useRef(0),g=s??l.disableHoverableContent,y=o??l.delayDuration,v=w.useRef(!1),[b=!1,E]=aNe({prop:r,defaultProp:i,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(rN))):l.onClose(),a==null||a(R)}}),_=w.useMemo(()=>b?v.current?"delayed-open":"instant-open":"closed",[b]),A=w.useCallback(()=>{window.clearTimeout(m.current),v.current=!1,E(!0)},[E]),I=w.useCallback(()=>{window.clearTimeout(m.current),E(!1)},[E]),x=w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,E(!0)},y)},[y,E]);return w.useEffect(()=>()=>window.clearTimeout(m.current),[]),$.jsx(QMe,{...u,children:$.jsx(cNe,{scope:e,contentId:f,open:b,stateAttribute:_,trigger:c,onTriggerChange:d,onTriggerEnter:w.useCallback(()=>{l.isOpenDelayed?x():A()},[l.isOpenDelayed,x,A]),onTriggerLeave:w.useCallback(()=>{g?I():window.clearTimeout(m.current)},[I,g]),onOpen:A,onClose:I,disableHoverableContent:g,children:n})})};QK.displayName=DT;var iN="TooltipTrigger",JK=w.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=LT(iN,n),a=iL(iN,n),s=OT(n),o=w.useRef(null),l=Uf(e,o,i.onTriggerChange),u=w.useRef(!1),c=w.useRef(!1),d=w.useCallback(()=>u.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),$.jsx(JMe,{asChild:!0,...s,children:$.jsx(zc.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Gl(t.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:Gl(t.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:Gl(t.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Gl(t.onFocus,()=>{u.current||i.onOpen()}),onBlur:Gl(t.onBlur,i.onClose),onClick:Gl(t.onClick,i.onClose)})})});JK.displayName=iN;var dNe="TooltipPortal",[Vze,fNe]=NT(dNe,{forceMount:void 0}),im="TooltipContent",eZ=w.forwardRef((t,e)=>{const n=fNe(im,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=t,s=LT(im,t.__scopeTooltip);return $.jsx(KK,{present:r||s.open,children:s.disableHoverableContent?$.jsx(tZ,{side:i,...a,ref:e}):$.jsx(pNe,{side:i,...a,ref:e})})}),pNe=w.forwardRef((t,e)=>{const n=LT(im,t.__scopeTooltip),r=iL(im,t.__scopeTooltip),i=w.useRef(null),a=Uf(e,i),[s,o]=w.useState(null),{trigger:l,onClose:u}=n,c=i.current,{onPointerInTransitChange:d}=r,f=w.useCallback(()=>{o(null),d(!1)},[d]),m=w.useCallback((g,y)=>{const v=g.currentTarget,b={x:g.clientX,y:g.clientY},E=gNe(b,v.getBoundingClientRect()),_=bNe(b,E),A=yNe(y.getBoundingClientRect()),I=ENe([..._,...A]);o(I),d(!0)},[d]);return w.useEffect(()=>()=>f(),[f]),w.useEffect(()=>{if(l&&c){const g=v=>m(v,c),y=v=>m(v,l);return l.addEventListener("pointerleave",g),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",g),c.removeEventListener("pointerleave",y)}}},[l,c,m,f]),w.useEffect(()=>{if(s){const g=y=>{const v=y.target,b={x:y.clientX,y:y.clientY},E=(l==null?void 0:l.contains(v))||(c==null?void 0:c.contains(v)),_=!vNe(b,s);E?f():_&&(f(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,c,s,u,f]),$.jsx(tZ,{...t,ref:a})}),[hNe,mNe]=NT(DT,{isInside:!1}),tZ=w.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...o}=t,l=LT(im,n),u=OT(n),{onClose:c}=l;return w.useEffect(()=>(document.addEventListener(rN,c),()=>document.removeEventListener(rN,c)),[c]),w.useEffect(()=>{if(l.trigger){const d=f=>{const m=f.target;m!=null&&m.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),$.jsx(RK,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:$.jsxs(eNe,{"data-state":l.stateAttribute,...u,...o,ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[$.jsx(EK,{children:r}),$.jsx(hNe,{scope:n,isInside:!0,children:$.jsx(lNe,{id:l.contentId,role:"tooltip",children:i||r})})]})})});eZ.displayName=im;var nZ="TooltipArrow",rZ=w.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=OT(n);return mNe(nZ,n).isInside?null:$.jsx(tNe,{...i,...r,ref:e})});rZ.displayName=nZ;function gNe(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),a=Math.abs(e.left-t.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function bNe(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function yNe(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function vNe(t,e){const{x:n,y:r}=t;let i=!1;for(let a=0,s=e.length-1;ar!=c>r&&n<(u-o)*(r-l)/(c-l)+o&&(i=!i)}return i}function ENe(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),_Ne(e)}function _Ne(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const a=e[e.length-1],s=e[e.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var SNe=QK,ANe=JK,xNe=eZ,TNe=rZ;function wNe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}function fr(t,e){if(t==null)return{};var n=wNe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}let Pr;(function(t){t[t.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",t[t.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",t[t.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",t[t.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",t[t.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",t[t.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",t[t.THEME_ERROR=6]="THEME_ERROR",t[t.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",t[t.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",t[t.EMPTY_KEY=9]="EMPTY_KEY"})(Pr||(Pr={}));const CNe={[Pr.UNSUPPORTED_INPUT]:(t,e)=>[`An input with type \`${t}\` input was found at path \`${e}\` but it's not supported yet.`],[Pr.NO_COMPONENT_FOR_TYPE]:(t,e)=>[`Type \`${t}\` found at path \`${e}\` can't be displayed in panel because no component supports it yet.`],[Pr.UNKNOWN_INPUT]:(t,e)=>[`input at path \`${t}\` is not recognized.`,e],[Pr.DUPLICATE_KEYS]:(t,e,n)=>[`Key \`${t}\` of path \`${e}\` already exists at path \`${n}\`. Even nested keys need to be unique. Rename one of the keys.`],[Pr.ALREADY_REGISTERED_TYPE]:t=>[`Type ${t} has already been registered. You can't register a component with the same type.`],[Pr.CLIPBOARD_ERROR]:t=>["Error copying the value",t],[Pr.THEME_ERROR]:(t,e)=>[`Error accessing the theme \`${t}.${e}\` value.`],[Pr.PATH_DOESNT_EXIST]:t=>[`Error getting the value at path \`${t}\`. There is probably an error in your \`render\` function.`],[Pr.PATH_DOESNT_EXIST]:t=>[`Error accessing the value at path \`${t}\``],[Pr.INPUT_TYPE_OVERRIDE]:(t,e,n)=>[`Input at path \`${t}\` already exists with type: \`${e}\`. Its type cannot be overridden with type \`${n}\`.`],[Pr.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function iZ(t,e,...n){const[r,...i]=CNe[e](...n);console[t]("LEVA: "+r,...i)}const ql=iZ.bind(null,"warn"),RNe=iZ.bind(null,"log"),INe=["value"],MNe=["schema"],NNe=["value"],aZ=[],Tf={};function e8(t){let{value:e}=t,n=fr(t,INe);for(let r of aZ){const i=r(e,n);if(i)return i}}function Su(t,e){let{schema:n}=e,r=fr(e,MNe);if(t in Tf){ql(Pr.ALREADY_REGISTERED_TYPE,t);return}aZ.push((i,a)=>n(i,a)&&t),Tf[t]=r}function AR(t,e,n,r){const{normalize:i}=Tf[t];if(i)return i(e,n,r);if(typeof e!="object"||!("value"in e))return{value:e};const{value:a}=e,s=fr(e,NNe);return{value:a,settings:s}}function ONe(t,e,n,r,i,a){const{sanitize:s}=Tf[t];return s?s(e,n,r,i,a):e}function t8(t,e,n){const{format:r}=Tf[t];return r?r(e,n):e}function DNe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function dn(t){for(var e=1;et>n?n:t{if(t===""||typeof t=="number")return t;try{const e=ju(t);if(!isNaN(e))return e}catch{}return parseFloat(t)},kNe=Math.log(10);function r8(t){let e=Math.abs(+String(t).replace(".",""));if(e===0)return .01;for(;e!==0&&e%10===0;)e/=10;const n=Math.floor(Math.log(e)/kNe)+1,r=Math.floor(Math.log10(Math.abs(t))),i=Math.pow(10,r-n);return Math.max(i,.001)}const DA=(t,e,n)=>n===e?0:(Nc(t,e,n)-e)/(n-e),LA=(t,e,n)=>t*(n-e)+e,PNe=()=>"_"+Math.random().toString(36).substr(2,9),i8=/\(([0-9+\-*/^ .]+)\)/,a8=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,s8=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,o8=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,l8=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,u8=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function ju(t){if(isNaN(Number(t)))if(i8.test(t)){const e=t.replace(i8,(n,r)=>String(ju(r)));return ju(e)}else if(a8.test(t)){const e=t.replace(a8,(n,r,i)=>String(Math.pow(Number(r),Number(i))));return ju(e)}else if(s8.test(t)){const e=t.replace(s8,(n,r,i)=>String(Number(r)*Number(i)));return ju(e)}else if(o8.test(t)){const e=t.replace(o8,(n,r,i)=>{if(i!=0)return String(Number(r)/Number(i));throw new Error("Division by zero")});return ju(e)}else if(l8.test(t)){const e=t.replace(l8,(n,r,i)=>String(Number(r)+Number(i)));return ju(e)}else if(u8.test(t)){const e=t.replace(u8,(n,r,i)=>String(Number(r)-Number(i)));return ju(e)}else return Number(t);return Number(t)}function BNe(t,e){return e.reduce((n,r)=>(t&&t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}function FNe(t,e){const n=dn({},t);return e.forEach(r=>r in t&&delete n[r]),n}function UNe(t,e){return t.reduce((n,r,i)=>Object.assign(n,{[e[i]]:r}),{})}function sZ(t){return Object.prototype.toString.call(t)==="[object Object]"}const zNe=t=>sZ(t)&&Object.keys(t).length===0;let To;(function(t){t.BUTTON="BUTTON",t.BUTTON_GROUP="BUTTON_GROUP",t.MONITOR="MONITOR",t.FOLDER="FOLDER"})(To||(To={}));let Io;(function(t){t.SELECT="SELECT",t.IMAGE="IMAGE",t.NUMBER="NUMBER",t.COLOR="COLOR",t.STRING="STRING",t.BOOLEAN="BOOLEAN",t.INTERVAL="INTERVAL",t.VECTOR3D="VECTOR3D",t.VECTOR2D="VECTOR2D"})(Io||(Io={}));const HNe=["type","__customInput"],GNe=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],VNe=["type"];function oZ(t,e,n={},r){var i,a;if(typeof t!="object"||Array.isArray(t))return{type:r,input:t,options:dn({key:e,label:e,optional:!1,disabled:!1,order:0},n)};if("__customInput"in t){const{type:I,__customInput:x}=t,R=fr(t,HNe);return oZ(x,e,R,I)}const{render:s,label:o,optional:l,order:u=0,disabled:c,hint:d,onChange:f,onEditStart:m,onEditEnd:g,transient:y}=t,v=fr(t,GNe),b=dn({render:s,key:e,label:o??e,hint:d,transient:y??!!f,onEditStart:m,onEditEnd:g,disabled:c,optional:l,order:u},n);let{type:E}=v,_=fr(v,VNe);if(E=r??E,E in To)return{type:E,input:_,options:b};let A;return r&&sZ(_)&&"value"in _?A=_.value:A=zNe(_)?void 0:_,{type:E,input:A,options:dn(dn({},b),{},{onChange:f,optional:(i=b.optional)!==null&&i!==void 0?i:!1,disabled:(a=b.disabled)!==null&&a!==void 0?a:!1})}}function $Ne(t,e,n,r){const i=oZ(t,e),{type:a,input:s,options:o}=i;if(a)return a in To?i:{type:a,input:AR(a,s,n,r),options:o};let l=e8(s);return l?{type:l,input:AR(l,s,n,r),options:o}:(l=e8({value:s}),l?{type:l,input:AR(l,{value:s},n,r),options:o}:!1)}function c8(t,e,n,r,i){const{value:a,type:s,settings:o}=t;t.value=lZ({type:s,value:a,settings:o},e,n,r),t.fromPanel=i}const WNe=function(e,n,r){this.type="LEVA_ERROR",this.message="LEVA: "+e,this.previousValue=n,this.error=r};function lZ({type:t,value:e,settings:n},r,i,a){const s=t!=="SELECT"&&typeof r=="function"?r(e):r;let o;try{o=ONe(t,s,n,e,i,a)}catch(l){throw new WNe(`The value \`${r}\` did not result in a correct value.`,e,l)}return Ob(o,e)?e:o}const uZ=(t,e,n=!1)=>{let r=0;return function(){const i=arguments,a=n&&!r,s=()=>t.apply(this,i);window.clearTimeout(r),r=window.setTimeout(s,e),a&&s()}},cZ=t=>t.shiftKey?5:t.altKey?1/5:1;function jNe(t,e){const n=console.error;console.error=()=>{},DO.render(t,e),console.error=n}const YNe=["value"],qNe=["min","max"],XNe=t=>{if(typeof t=="number")return!0;if(typeof t=="string"){const e=parseFloat(t);return isNaN(e)?!1:t.substring((""+e).length).trim().length<4}return!1},dZ=(t,{min:e=-1/0,max:n=1/0,suffix:r})=>{const i=parseFloat(t);if(t===""||isNaN(i))throw Error("Invalid number");const a=Nc(i,e,n);return r?a+r:a},KNe=(t,{pad:e=0,suffix:n})=>{const r=parseFloat(t).toFixed(e);return n?r+n:r},fZ=t=>{let{value:e}=t,n=fr(t,YNe);const{min:r=-1/0,max:i=1/0}=n,a=fr(n,qNe);let s=parseFloat(e);const o=typeof e=="string"?e.substring((""+s).length):void 0;s=Nc(s,r,i);let l=n.step;l||(Number.isFinite(r)?Number.isFinite(i)?l=+(Math.abs(i-r)/100).toPrecision(1):l=+(Math.abs(s-r)/100).toPrecision(1):Number.isFinite(i)&&(l=+(Math.abs(i-s)/100).toPrecision(1)));const u=l?r8(l)*10:r8(s);l=l||u/10;const c=Math.round(Nc(Math.log10(1/u),0,2));return{value:o?s+o:s,settings:dn({initialValue:s,step:l,pad:c,min:r,max:i,suffix:o},a)}},pZ=(t,{step:e,initialValue:n})=>{const r=Math.round((t-n)/e);return n+r*e};var hZ=Object.freeze({__proto__:null,schema:XNe,sanitize:dZ,format:KNe,normalize:fZ,sanitizeStep:pZ});function Xr(){return Xr=Object.assign?Object.assign.bind():function(t){for(var e=1;e({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function t_(t,e){const[n,r]=t.split(" "),i={};return n!=="none"&&(i.boxShadow=`${e.inset?"inset ":""}0 0 0 $borderWidths${[e.key]} $colors${n!=="default"&&n||e.borderColor}`),r&&(i.backgroundColor=r),i}const Fg={$inputStyle:()=>t=>t_(t,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>t=>t_(t,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>t=>t_(t,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>t=>t_(t,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:ln,css:$ze,createTheme:QNe,globalCss:JNe,keyframes:Wze}=MIe({prefix:"leva",theme:yZ(),utils:dn(dn({},Fg),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:t=>({"&:focus":Fg.$focusStyle()(t)}),$focusWithin:t=>({"&:focus-within":Fg.$focusStyle()(t)}),$hover:t=>({"&:hover":Fg.$hoverStyle()(t)}),$active:t=>({"&:active":Fg.$activeStyle()(t)})})}),e2e=JNe({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function t2e(t){const e=yZ();if(!t)return{theme:e,className:""};Object.keys(t).forEach(r=>{Object.assign(e[r],t[r])});const n=QNe(e);return{theme:e,className:n.className}}function du(t,e){const{theme:n}=w.useContext(aL);if(!(t in n)||!(e in n[t]))return ql(Pr.THEME_ERROR,t,e),"";let r=e;for(;;){let i=n[t][r];if(typeof i=="string"&&i.charAt(0)==="$")r=i.substr(1);else return i}}const vZ=ln("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),EZ=ln("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${vZ}`]:{paddingLeft:0}}),n2e=ln(EZ,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),r2e=ln("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),i2e=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],a2e=["onUpdate"];function sL(t){let{innerLabel:e,value:n,onUpdate:r,onChange:i,onKeyDown:a,type:s,id:o,inputType:l="text",rows:u=0}=t,c=fr(t,i2e);const{id:d,emitOnEditStart:f,emitOnEditEnd:m,disabled:g}=va(),y=o||d,v=w.useRef(null),b=u>0,E=b?"textarea":"input",_=w.useCallback(x=>R=>{const O=R.currentTarget.value;x(O)},[]);pe.useEffect(()=>{const x=v.current,R=_(O=>{r(O),m()});return x==null||x.addEventListener("blur",R),()=>x==null?void 0:x.removeEventListener("blur",R)},[_,r,m]);const A=w.useCallback(x=>{x.key==="Enter"&&_(r)(x)},[_,r]),I=Object.assign({as:E},b?{rows:u}:{},c);return pe.createElement(r2e,{textArea:b},e&&typeof e=="string"?pe.createElement(EZ,null,e):e,pe.createElement(vZ,Xr({levaType:s,ref:v,id:y,type:l,autoComplete:"off",spellCheck:"false",value:n,onChange:_(i),onFocus:()=>f(),onKeyPress:A,onKeyDown:a,disabled:g},I)))}function s2e(t){let{onUpdate:e}=t,n=fr(t,a2e);const r=w.useCallback(a=>e(LNe(a)),[e]),i=w.useCallback(a=>{const s=a.key==="ArrowUp"?1:a.key==="ArrowDown"?-1:0;if(s){a.preventDefault();const o=a.altKey?.1:a.shiftKey?10:1;e(l=>parseFloat(l)+s*o)}},[e]);return pe.createElement(sL,Xr({},n,{onUpdate:r,onKeyDown:i,type:"number"}))}const kA=ln("div",{}),aN=ln("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),o2e=ln("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${aN}::after`]:{opacity:.6},[`${kA}:hover > & + ${aN}::after`]:{opacity:.6},[`${kA}:hover > & > svg`]:{opacity:1}}),_Z=ln("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${kA}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),SZ=ln("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${_Z} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),AZ=ln(SZ,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),l2e=ln("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),u2e=ln("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),sN=ln("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),c2e=ln("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${sN}`]:{pointerEvents:"auto"}}}}}),xZ=ln("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),d2e=ln("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),f2e=ln(TNe,{fill:"$toolTipBackground"});function oL({children:t}){const{className:e}=w.useContext(aL);return pe.createElement(QRe,{className:e},t)}const p2e=["align"];function h2e(){const{id:t,disable:e,disabled:n}=va();return pe.createElement(pe.Fragment,null,pe.createElement(u2e,{id:t+"__disable",type:"checkbox",checked:!n,onChange:()=>e(!n)}),pe.createElement("label",{htmlFor:t+"__disable"}))}function m2e(t){const{id:e,optional:n,hint:r}=va(),i=t.htmlFor||(e?{htmlFor:e}:null),a=!r&&typeof t.children=="string"?{title:t.children}:null;return pe.createElement(pe.Fragment,null,n&&pe.createElement(h2e,null),r!==void 0?pe.createElement(SNe,null,pe.createElement(ANe,{asChild:!0},pe.createElement(sN,Xr({},i,t))),pe.createElement(xNe,{side:"top",sideOffset:2},pe.createElement(d2e,null,r,pe.createElement(f2e,null)))):pe.createElement(sN,Xr({},i,a,t)))}function Po(t){let{align:e}=t,n=fr(t,p2e);const{value:r,label:i,key:a,disabled:s}=va(),{hideCopyButton:o}=ZNe(),l=!o&&a!==void 0,[u,c]=w.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[a]:r??""})),c(!0)}catch{ql(Pr.CLIPBOARD_ERROR,{[a]:r})}};return pe.createElement(l2e,{align:e,onPointerLeave:()=>c(!1)},pe.createElement(m2e,n),l&&!s&&pe.createElement("div",{title:`Click to copy ${typeof i=="string"?i:a} value`},u?pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},pe.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),pe.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):pe.createElement("svg",{onClick:d,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},pe.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),pe.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const g2e=["toggled"],b2e=ln("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function lL(t){let{toggled:e}=t,n=fr(t,g2e);return pe.createElement(b2e,Xr({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${e?0:-90}deg)`}},n),pe.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const y2e=["input"];function ao(t){let{input:e}=t,n=fr(t,y2e);return e?pe.createElement(AZ,n):pe.createElement(SZ,n)}function TZ({value:t,type:e,settings:n,setValue:r}){const[i,a]=w.useState(t8(e,t,n)),s=w.useRef(t),o=w.useRef(n);o.current=n;const l=w.useCallback(c=>a(t8(e,c,o.current)),[e]),u=w.useCallback(c=>{try{r(c)}catch(d){const{type:f,previousValue:m}=d;if(f!=="LEVA_ERROR")throw d;l(m)}},[l,r]);return w.useEffect(()=>{Ob(t,s.current)||l(t),s.current=t},[t,l]),{displayValue:i,onChange:a,onUpdate:u}}function vy(t,e){const{emitOnEditStart:n,emitOnEditEnd:r}=va();return Fwe(i=>{i.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const a=t(i);return i.last&&(document.body.classList.remove("leva__panel__dragged"),r==null||r()),a},e)}function v2e(t){const e=w.useRef(null),n=w.useRef(null),r=w.useRef(!1);return w.useEffect(()=>{const i=uZ(()=>{e.current.width=e.current.offsetWidth*window.devicePixelRatio,e.current.height=e.current.offsetHeight*window.devicePixelRatio,t(e.current,n.current)},250);return window.addEventListener("resize",i),r.current||(i(),r.current=!0),()=>window.removeEventListener("resize",i)},[t]),w.useEffect(()=>{n.current=e.current.getContext("2d")},[]),[e,n]}function wZ(){const t=w.useRef(null),e=w.useRef({x:0,y:0}),n=w.useCallback(r=>{Object.assign(e.current,r),t.current&&(t.current.style.transform=`translate3d(${e.current.x}px, ${e.current.y}px, 0)`)},[]);return[t,n]}const E2e=["__refCount"],xR=(t,e)=>{if(!t[e])return null;const n=t[e];return fr(n,E2e)};function _2e(t){const e=yy(),[n,r]=w.useState(xR(e.getData(),t)),i=w.useCallback(u=>e.setValueAtPath(t,u,!0),[t,e]),a=w.useCallback(u=>e.setSettingsAtPath(t,u),[t,e]),s=w.useCallback(u=>e.disableInputAtPath(t,u),[t,e]),o=w.useCallback(()=>e.emitOnEditStart(t),[t,e]),l=w.useCallback(()=>e.emitOnEditEnd(t),[t,e]);return w.useEffect(()=>{r(xR(e.getData(),t));const u=e.useStore.subscribe(c=>xR(c.data,t),r,{equalityFn:ST});return()=>u()},[e,t]),[n,{set:i,setSettings:a,disable:s,storeId:e.storeId,emitOnEditStart:o,emitOnEditEnd:l}]}const S2e=ln("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),CZ=ln("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),oN=ln("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),RZ=ln("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),IZ=ln("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function A2e({value:t,min:e,max:n,onDrag:r,step:i,initialValue:a}){const s=w.useRef(null),o=w.useRef(null),l=w.useRef(0),u=du("sizes","scrubberWidth"),c=vy(({event:f,first:m,xy:[g],movement:[y],memo:v})=>{if(m){const{width:E,left:_}=s.current.getBoundingClientRect();l.current=E-parseFloat(u),v=(f==null?void 0:f.target)===o.current?t:LA((g-_)/E,e,n)}const b=v+LA(y/l.current,0,n-e);return r(pZ(b,{step:i,initialValue:a})),v}),d=DA(t,e,n);return pe.createElement(RZ,Xr({ref:s},c()),pe.createElement(CZ,null,pe.createElement(IZ,{style:{left:0,right:`${(1-d)*100}%`}})),pe.createElement(oN,{ref:o,style:{left:`calc(${d} * (100% - ${u}))`}}))}const x2e=pe.memo(({label:t,onUpdate:e,step:n,innerLabelTrim:r})=>{const[i,a]=w.useState(!1),s=vy(({active:o,delta:[l],event:u,memo:c=0})=>(a(o),c+=l/2,Math.abs(c)>=1&&(e(d=>parseFloat(d)+Math.floor(c)*n*cZ(u)),c=0),c));return pe.createElement(n2e,Xr({dragging:i,title:t.length>1?t:""},s()),t.slice(0,r))});function MZ({label:t,id:e,displayValue:n,onUpdate:r,onChange:i,settings:a,innerLabelTrim:s=1}){const o=s>0&&pe.createElement(x2e,{label:t,step:a.step,onUpdate:r,innerLabelTrim:s});return pe.createElement(s2e,{id:e,value:String(n),onUpdate:r,onChange:i,innerLabel:o})}function T2e(){const t=va(),{label:e,value:n,onUpdate:r,settings:i,id:a}=t,{min:s,max:o}=i,l=o!==1/0&&s!==-1/0;return pe.createElement(ao,{input:!0},pe.createElement(Po,null,e),pe.createElement(S2e,{hasRange:l},l&&pe.createElement(A2e,Xr({value:parseFloat(n),onDrag:r},i)),pe.createElement(MZ,Xr({},t,{id:a,label:"value",innerLabelTrim:l?0:1}))))}const{sanitizeStep:w2e}=hZ,C2e=fr(hZ,["sanitizeStep"]);var R2e=dn({component:T2e},C2e);const I2e=(t,e)=>Ja().schema({options:Ja().passesAnyOf(Ja().object(),Ja().array())}).test(e),M2e=(t,{values:e})=>{if(e.indexOf(t)<0)throw Error("Selected value doesn't match Select options");return t},N2e=(t,{values:e})=>e.indexOf(t),O2e=t=>{let{value:e,options:n}=t,r,i;return Array.isArray(n)?(i=n,r=n.map(a=>String(a))):(i=Object.values(n),r=Object.keys(n)),"value"in t?i.includes(e)||(r.unshift(String(e)),i.unshift(e)):e=i[0],Object.values(n).includes(e)||(n[String(e)]=e),{value:e,settings:{keys:r,values:i}}};var D2e=Object.freeze({__proto__:null,schema:I2e,sanitize:M2e,format:N2e,normalize:O2e});const L2e=ln("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),lN=ln("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),k2e=ln("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${lN}:focus + &`]:{$focusStyle:""},[`${lN}:hover + &`]:{$hoverStyle:""}});function P2e({displayValue:t,value:e,onUpdate:n,id:r,settings:i,disabled:a}){const{keys:s,values:o}=i,l=w.useRef();return e===o[t]&&(l.current=s[t]),pe.createElement(L2e,null,pe.createElement(lN,{id:r,value:t,onChange:u=>n(o[Number(u.currentTarget.value)]),disabled:a},s.map((u,c)=>pe.createElement("option",{key:u,value:c},u))),pe.createElement(k2e,null,l.current),pe.createElement(lL,{toggled:!0}))}function B2e(){const{label:t,value:e,displayValue:n,onUpdate:r,id:i,disabled:a,settings:s}=va();return pe.createElement(ao,{input:!0},pe.createElement(Po,null,t),pe.createElement(P2e,{id:i,value:e,displayValue:n,onUpdate:r,settings:s,disabled:a}))}var F2e=dn({component:B2e},D2e);const U2e=t=>Ja().string().test(t),z2e=t=>{if(typeof t!="string")throw Error("Invalid string");return t},H2e=({value:t,editable:e=!0,rows:n=!1})=>({value:t,settings:{editable:e,rows:typeof n=="number"?n:n?5:0}});var G2e=Object.freeze({__proto__:null,schema:U2e,sanitize:z2e,normalize:H2e});const V2e=["displayValue","onUpdate","onChange","editable"],$2e=ln("div",{whiteSpace:"pre-wrap"});function W2e(t){let{displayValue:e,onUpdate:n,onChange:r,editable:i=!0}=t,a=fr(t,V2e);return i?pe.createElement(sL,Xr({value:e,onUpdate:n,onChange:r},a)):pe.createElement($2e,null,e)}function j2e(){const{label:t,settings:e,displayValue:n,onUpdate:r,onChange:i}=va();return pe.createElement(ao,{input:!0},pe.createElement(Po,null,t),pe.createElement(W2e,Xr({displayValue:n,onUpdate:r,onChange:i},e)))}var Y2e=dn({component:j2e},G2e);const q2e=t=>Ja().boolean().test(t),X2e=t=>{if(typeof t!="boolean")throw Error("Invalid boolean");return t};var K2e=Object.freeze({__proto__:null,schema:q2e,sanitize:X2e});const Z2e=ln("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function Q2e({value:t,onUpdate:e,id:n,disabled:r}){return pe.createElement(Z2e,null,pe.createElement("input",{id:n,type:"checkbox",checked:t,onChange:i=>e(i.currentTarget.checked),disabled:r}),pe.createElement("label",{htmlFor:n},pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},pe.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function J2e(){const{label:t,value:e,onUpdate:n,disabled:r,id:i}=va();return pe.createElement(ao,{input:!0},pe.createElement(Po,null,t),pe.createElement(Q2e,{value:e,onUpdate:n,id:i,disabled:r}))}var eOe=dn({component:J2e},K2e);const tOe=["locked"];function nOe({value:t,id:e,valueKey:n,settings:r,onUpdate:i,innerLabelTrim:a}){const s=w.useRef(t[n]);s.current=t[n];const o=w.useCallback(u=>i({[n]:lZ({type:"NUMBER",value:s.current,settings:r},u)}),[i,r,n]),l=TZ({type:"NUMBER",value:t[n],settings:r,setValue:o});return pe.createElement(MZ,{id:e,label:n,value:t[n],displayValue:l.displayValue,onUpdate:l.onUpdate,onChange:l.onChange,settings:r,innerLabelTrim:a})}const rOe=ln("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function iOe(t){let{locked:e}=t,n=fr(t,tOe);return pe.createElement("svg",Xr({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),e?pe.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):pe.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function uL({value:t,onUpdate:e,settings:n,innerLabelTrim:r}){const{id:i,setSettings:a}=va(),{lock:s,locked:o}=n;return pe.createElement(rOe,{withLock:s},s&&pe.createElement(iOe,{locked:o,onClick:()=>a({locked:!o})}),Object.keys(t).map((l,u)=>pe.createElement(nOe,{id:u===0?i:`${i}.${l}`,key:l,valueKey:l,value:t,settings:n[l],onUpdate:e,innerLabelTrim:r})))}const NZ=(t,e)=>{const n={};let r=0,i=1/0;Object.entries(t).forEach(([a,s])=>{n[a]=fZ(dn({value:s},e[a])).settings,r=Math.max(r,n[a].step),i=Math.min(i,n[a].pad)});for(let a in n){const{step:s,min:o,max:l}=e[a]||{};!isFinite(s)&&(!isFinite(o)||!isFinite(l))&&(n[a].step=r,n[a].pad=i)}return n},aOe=["lock"],sOe=["value"];function oOe(t){const e=Ja().array().length(t).every.number(),n=r=>{if(!r||typeof r!="object")return!1;const i=Object.values(r);return i.length===t&&i.every(a=>isFinite(a))};return r=>e.test(r)||n(r)}function lOe(t){return Array.isArray(t)?"array":"object"}function L0(t,e,n){return lOe(t)===e?t:e==="array"?Object.values(t):UNe(t,n)}const uOe=(t,e,n)=>{const r=L0(t,"object",e.keys);for(let s in r)r[s]=dZ(r[s],e[s]);const i=Object.keys(r);let a={};if(i.length===e.keys.length)a=r;else{const s=L0(n,"object",e.keys);if(i.length===1&&e.locked){const o=i[0],l=r[o],u=s[o],c=u!==0?l/u:1;for(let d in s)d===o?a[o]=l:a[d]=s[d]*c}else a=dn(dn({},s),r)}return L0(a,e.format,e.keys)},cOe=(t,e)=>L0(t,"object",e.keys),dOe=t=>!!t&&("step"in t||"min"in t||"max"in t);function fOe(t,e,n=[]){const{lock:r=!1}=e,i=fr(e,aOe),a=Array.isArray(t)?"array":"object",s=a==="object"?Object.keys(t):n,o=L0(t,"object",s),l=dOe(i)?s.reduce((c,d)=>Object.assign(c,{[d]:i}),{}):i,u=NZ(o,l);return{value:a==="array"?t:o,settings:dn(dn({},u),{},{format:a,keys:s,lock:r,locked:!1})}}function OZ(t){return{schema:oOe(t.length),normalize:e=>{let{value:n}=e,r=fr(e,sOe);return fOe(n,r,t)},format:(e,n)=>cOe(e,n),sanitize:(e,n,r)=>uOe(e,n,r)}}var pOe={grad:.9,turn:360,rad:360/(2*Math.PI)},Bl=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},Ii=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n+0},eo=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t>e?t:e},DZ=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},d8=function(t){return{r:eo(t.r,0,255),g:eo(t.g,0,255),b:eo(t.b,0,255),a:eo(t.a)}},TR=function(t){return{r:Ii(t.r),g:Ii(t.g),b:Ii(t.b),a:Ii(t.a,3)}},hOe=/^#([0-9a-f]{3,8})$/i,n_=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},LZ=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=Math.max(e,n,r),s=a-Math.min(e,n,r),o=s?a===e?(n-r)/s:a===n?2+(r-e)/s:4+(e-n)/s:0;return{h:60*(o<0?o+6:o),s:a?s/a*100:0,v:a/255*100,a:i}},kZ=function(t){var e=t.h,n=t.s,r=t.v,i=t.a;e=e/360*6,n/=100,r/=100;var a=Math.floor(e),s=r*(1-n),o=r*(1-(e-a)*n),l=r*(1-(1-e+a)*n),u=a%6;return{r:255*[r,o,s,s,l,r][u],g:255*[l,r,r,o,s,s][u],b:255*[s,s,l,r,r,o][u],a:i}},f8=function(t){return{h:DZ(t.h),s:eo(t.s,0,100),l:eo(t.l,0,100),a:eo(t.a)}},p8=function(t){return{h:Ii(t.h),s:Ii(t.s),l:Ii(t.l),a:Ii(t.a,3)}},h8=function(t){return kZ((n=(e=t).s,{h:e.h,s:(n*=((r=e.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:e.a}));var e,n,r},k0=function(t){return{h:(e=LZ(t)).h,s:(i=(200-(n=e.s))*(r=e.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,n,r,i},mOe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gOe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bOe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,yOe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,uN={string:[[function(t){var e=hOe.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Ii(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?Ii(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=bOe.exec(t)||yOe.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:d8({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=mOe.exec(t)||gOe.exec(t);if(!e)return null;var n,r,i=f8({h:(n=e[1],r=e[2],r===void 0&&(r="deg"),Number(n)*(pOe[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return h8(i)},"hsl"]],object:[[function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=i===void 0?1:i;return Bl(e)&&Bl(n)&&Bl(r)?d8({r:Number(e),g:Number(n),b:Number(r),a:Number(a)}):null},"rgb"],[function(t){var e=t.h,n=t.s,r=t.l,i=t.a,a=i===void 0?1:i;if(!Bl(e)||!Bl(n)||!Bl(r))return null;var s=f8({h:Number(e),s:Number(n),l:Number(r),a:Number(a)});return h8(s)},"hsl"],[function(t){var e=t.h,n=t.s,r=t.v,i=t.a,a=i===void 0?1:i;if(!Bl(e)||!Bl(n)||!Bl(r))return null;var s=function(o){return{h:DZ(o.h),s:eo(o.s,0,100),v:eo(o.v,0,100),a:eo(o.a)}}({h:Number(e),s:Number(n),v:Number(r),a:Number(a)});return kZ(s)},"hsv"]]},m8=function(t,e){for(var n=0;n=.5},t.prototype.toHex=function(){return e=TR(this.rgba),n=e.r,r=e.g,i=e.b,s=(a=e.a)<1?n_(Ii(255*a)):"","#"+n_(n)+n_(r)+n_(i)+s;var e,n,r,i,a,s},t.prototype.toRgb=function(){return TR(this.rgba)},t.prototype.toRgbString=function(){return e=TR(this.rgba),n=e.r,r=e.g,i=e.b,(a=e.a)<1?"rgba("+n+", "+r+", "+i+", "+a+")":"rgb("+n+", "+r+", "+i+")";var e,n,r,i,a},t.prototype.toHsl=function(){return p8(k0(this.rgba))},t.prototype.toHslString=function(){return e=p8(k0(this.rgba)),n=e.h,r=e.s,i=e.l,(a=e.a)<1?"hsla("+n+", "+r+"%, "+i+"%, "+a+")":"hsl("+n+", "+r+"%, "+i+"%)";var e,n,r,i,a},t.prototype.toHsv=function(){return e=LZ(this.rgba),{h:Ii(e.h),s:Ii(e.s),v:Ii(e.v),a:Ii(e.a,3)};var e},t.prototype.invert=function(){return Ra({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),Ra(wR(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),Ra(wR(this.rgba,-e))},t.prototype.grayscale=function(){return Ra(wR(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),Ra(g8(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),Ra(g8(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?Ra({r:(n=this.rgba).r,g:n.g,b:n.b,a:e}):Ii(this.rgba.a,3);var n},t.prototype.hue=function(e){var n=k0(this.rgba);return typeof e=="number"?Ra({h:e,s:n.s,l:n.l,a:n.a}):Ii(n.h)},t.prototype.isEqual=function(e){return this.toHex()===Ra(e).toHex()},t}(),Ra=function(t){return t instanceof cN?t:new cN(t)},b8=[],EOe=function(t){t.forEach(function(e){b8.indexOf(e)<0&&(e(cN,uN),b8.push(e))})};function _Oe(t,e){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var i in n)r[n[i]]=i;var a={};t.prototype.toName=function(s){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,l,u=r[this.toHex()];if(u)return u;if(s!=null&&s.closest){var c=this.toRgb(),d=1/0,f="black";if(!a.length)for(var m in n)a[m]=new t(n[m]).toRgb();for(var g in n){var y=(o=c,l=a[g],Math.pow(o.r-l.r,2)+Math.pow(o.g-l.g,2)+Math.pow(o.b-l.b,2));y=0||(i[n]=t[n]);return i}function dN(t){var e=w.useRef(t),n=w.useRef(function(r){e.current&&e.current(r)});return e.current=t,n.current}var am=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t0:v.buttons>0)&&i.current?a(y8(i.current,v,o.current)):y(!1)},g=function(){return y(!1)};function y(v){var b=l.current,E=fN(i.current),_=v?E.addEventListener:E.removeEventListener;_(b?"touchmove":"mousemove",m),_(b?"touchend":"mouseup",g)}return[function(v){var b=v.nativeEvent,E=i.current;if(E&&(v8(b),!function(A,I){return I&&!P0(A)}(b,l.current)&&E)){if(P0(b)){l.current=!0;var _=b.changedTouches||[];_.length&&(o.current=_[0].identifier)}E.focus(),a(y8(E,b,o.current)),y(!0)}},function(v){var b=v.which||v.keyCode;b<37||b>40||(v.preventDefault(),s({left:b===39?.05:b===37?-.05:0,top:b===40?.05:b===38?-.05:0}))},y]},[s,a]),c=u[0],d=u[1],f=u[2];return w.useEffect(function(){return f},[f]),pe.createElement("div",Cm({},r,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:i,onKeyDown:d,tabIndex:0,role:"slider"}))}),Ey=function(t){return t.filter(Boolean).join(" ")},fL=function(t){var e=t.color,n=t.left,r=t.top,i=r===void 0?.5:r,a=Ey(["react-colorful__pointer",t.className]);return pe.createElement("div",{className:a,style:{top:100*i+"%",left:100*n+"%"}},pe.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},Oa=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},BZ=function(t){var e=t.s,n=t.v,r=t.a,i=(200-e)*n/100;return{h:Oa(t.h),s:Oa(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:Oa(i/2),a:Oa(r,2)}},pN=function(t){var e=BZ(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},RR=function(t){var e=BZ(t);return"hsla("+e.h+", "+e.s+"%, "+e.l+"%, "+e.a+")"},FZ=function(t){var e=t.h,n=t.s,r=t.v,i=t.a;e=e/360*6,n/=100,r/=100;var a=Math.floor(e),s=r*(1-n),o=r*(1-(e-a)*n),l=r*(1-(1-e+a)*n),u=a%6;return{r:Oa(255*[r,o,s,s,l,r][u]),g:Oa(255*[l,r,r,o,s,s][u]),b:Oa(255*[s,s,l,r,r,o][u]),a:Oa(i,2)}},UZ=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=Math.max(e,n,r),s=a-Math.min(e,n,r),o=s?a===e?(n-r)/s:a===n?2+(r-e)/s:4+(e-n)/s:0;return{h:Oa(60*(o<0?o+6:o)),s:Oa(a?s/a*100:0),v:Oa(a/255*100),a:i}},zZ=pe.memo(function(t){var e=t.hue,n=t.onChange,r=Ey(["react-colorful__hue",t.className]);return pe.createElement("div",{className:r},pe.createElement(dL,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:am(e+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Oa(e),"aria-valuemax":"360","aria-valuemin":"0"},pe.createElement(fL,{className:"react-colorful__hue-pointer",left:e/360,color:pN({h:e,s:100,v:100,a:1})})))}),HZ=pe.memo(function(t){var e=t.hsva,n=t.onChange,r={backgroundColor:pN({h:e.h,s:100,v:100,a:1})};return pe.createElement("div",{className:"react-colorful__saturation",style:r},pe.createElement(dL,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:am(e.s+100*i.left,0,100),v:am(e.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Oa(e.s)+"%, Brightness "+Oa(e.v)+"%"},pe.createElement(fL,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:pN(e)})))}),pL=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0};function GZ(t,e,n){var r=dN(n),i=w.useState(function(){return t.toHsva(e)}),a=i[0],s=i[1],o=w.useRef({color:e,hsva:a});w.useEffect(function(){if(!t.equal(e,o.current.color)){var u=t.toHsva(e);o.current={hsva:u,color:e},s(u)}},[e,t]),w.useEffect(function(){var u;pL(a,o.current.hsva)||t.equal(u=t.fromHsva(a),o.current.color)||(o.current={hsva:a,color:u},r(u))},[a,t,r]);var l=w.useCallback(function(u){s(function(c){return Object.assign({},c,u)})},[]);return[a,l]}var SOe=typeof window<"u"?w.useLayoutEffect:w.useEffect,AOe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},E8=new Map,VZ=function(t){SOe(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!E8.has(e)){var n=e.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,E8.set(e,n);var r=AOe();r&&n.setAttribute("nonce",r),e.head.appendChild(n)}},[])},xOe=function(t){var e=t.className,n=t.colorModel,r=t.color,i=r===void 0?n.defaultColor:r,a=t.onChange,s=cL(t,["className","colorModel","color","onChange"]),o=w.useRef(null);VZ(o);var l=GZ(n,i,a),u=l[0],c=l[1],d=Ey(["react-colorful",e]);return pe.createElement("div",Cm({},s,{ref:o,className:d}),pe.createElement(HZ,{hsva:u,onChange:c}),pe.createElement(zZ,{hue:u.h,onChange:c,className:"react-colorful__last-control"}))},TOe=function(t){var e=t.className,n=t.hsva,r=t.onChange,i={backgroundImage:"linear-gradient(90deg, "+RR(Object.assign({},n,{a:0}))+", "+RR(Object.assign({},n,{a:1}))+")"},a=Ey(["react-colorful__alpha",e]),s=Oa(100*n.a);return pe.createElement("div",{className:a},pe.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),pe.createElement(dL,{onMove:function(o){r({a:o.left})},onKey:function(o){r({a:am(n.a+o.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},pe.createElement(fL,{className:"react-colorful__alpha-pointer",left:n.a,color:RR(n)})))},wOe=function(t){var e=t.className,n=t.colorModel,r=t.color,i=r===void 0?n.defaultColor:r,a=t.onChange,s=cL(t,["className","colorModel","color","onChange"]),o=w.useRef(null);VZ(o);var l=GZ(n,i,a),u=l[0],c=l[1],d=Ey(["react-colorful",e]);return pe.createElement("div",Cm({},s,{ref:o,className:d}),pe.createElement(HZ,{hsva:u,onChange:c}),pe.createElement(zZ,{hue:u.h,onChange:c}),pe.createElement(TOe,{hsva:u,onChange:c,className:"react-colorful__last-control"}))},COe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:UZ,fromHsva:FZ,equal:pL},ROe=function(t){return pe.createElement(wOe,Cm({},t,{colorModel:COe}))},IOe={defaultColor:{r:0,g:0,b:0},toHsva:function(t){return UZ({r:t.r,g:t.g,b:t.b,a:1})},fromHsva:function(t){return{r:(e=FZ(t)).r,g:e.g,b:e.b};var e},equal:pL},MOe=function(t){return pe.createElement(xOe,Cm({},t,{colorModel:IOe}))},NOe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function _y(t,e){var n=OOe(t);if(typeof n.path!="string"){var r=t.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof e=="string"?e:typeof r=="string"&&r.length>0?r:t.name,writable:!1,configurable:!1,enumerable:!0})}return n}function OOe(t){var e=t.name,n=e&&e.lastIndexOf(".")!==-1;if(n&&!t.type){var r=e.split(".").pop().toLowerCase(),i=NOe.get(r);i&&Object.defineProperty(t,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return t}var DOe=[".DS_Store","Thumbs.db"];function LOe(t){return hm(this,void 0,void 0,function(){return mm(this,function(e){return PA(t)&&kOe(t)?[2,UOe(t.dataTransfer,t.type)]:POe(t)?[2,BOe(t)]:Array.isArray(t)&&t.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,FOe(t)]:[2,[]]})})}function kOe(t){return PA(t.dataTransfer)}function POe(t){return PA(t)&&PA(t.target)}function PA(t){return typeof t=="object"&&t!==null}function BOe(t){return hN(t.target.files).map(function(e){return _y(e)})}function FOe(t){return hm(this,void 0,void 0,function(){var e;return mm(this,function(n){switch(n.label){case 0:return[4,Promise.all(t.map(function(r){return r.getFile()}))];case 1:return e=n.sent(),[2,e.map(function(r){return _y(r)})]}})})}function UOe(t,e){return hm(this,void 0,void 0,function(){var n,r;return mm(this,function(i){switch(i.label){case 0:return t===null?[2,[]]:t.items?(n=hN(t.items).filter(function(a){return a.kind==="file"}),e!=="drop"?[2,n]:[4,Promise.all(n.map(zOe))]):[3,2];case 1:return r=i.sent(),[2,_8($Z(r))];case 2:return[2,_8(hN(t.files).map(function(a){return _y(a)}))]}})})}function _8(t){return t.filter(function(e){return DOe.indexOf(e.name)===-1})}function hN(t){if(t===null)return[];for(var e=[],n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nn)return[!1,C8(n)];if(t.sizen)return[!1,C8(n)]}return[!0,null]}function Ug(t){return t!=null}function eDe(t){var e=t.files,n=t.accept,r=t.minSize,i=t.maxSize,a=t.multiple,s=t.maxFiles;return!a&&e.length>1||a&&s>=1&&e.length>s?!1:e.every(function(o){var l=YZ(o,n),u=T8(l,1),c=u[0],d=qZ(o,r,i),f=T8(d,1),m=f[0];return c&&m})}function BA(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function r_(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function I8(t){t.preventDefault()}function tDe(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function nDe(t){return t.indexOf("Edge/")!==-1}function rDe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return tDe(t)||nDe(t)}function qo(){for(var t=arguments.length,e=new Array(t),n=0;n1?i-1:0),s=1;st.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function vDe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var hL=w.forwardRef(function(t,e){var n=t.children,r=FA(t,lDe),i=ZZ(r),a=i.open,s=FA(i,uDe);return w.useImperativeHandle(e,function(){return{open:a}},[a]),pe.createElement(w.Fragment,null,n(kr(kr({},s),{},{open:a})))});hL.displayName="Dropzone";var KZ={disabled:!1,getFilesFromEvent:LOe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};hL.defaultProps=KZ;hL.propTypes={children:yr.func,accept:yr.oneOfType([yr.string,yr.arrayOf(yr.string)]),multiple:yr.bool,preventDropOnDocument:yr.bool,noClick:yr.bool,noKeyboard:yr.bool,noDrag:yr.bool,noDragEventsBubbling:yr.bool,minSize:yr.number,maxSize:yr.number,maxFiles:yr.number,disabled:yr.bool,getFilesFromEvent:yr.func,onFileDialogCancel:yr.func,onFileDialogOpen:yr.func,useFsAccessApi:yr.bool,onDragEnter:yr.func,onDragLeave:yr.func,onDragOver:yr.func,onDrop:yr.func,onDropAccepted:yr.func,onDropRejected:yr.func,validator:yr.func};var bN={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function ZZ(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=kr(kr({},KZ),t),n=e.accept,r=e.disabled,i=e.getFilesFromEvent,a=e.maxSize,s=e.minSize,o=e.multiple,l=e.maxFiles,u=e.onDragEnter,c=e.onDragLeave,d=e.onDragOver,f=e.onDrop,m=e.onDropAccepted,g=e.onDropRejected,y=e.onFileDialogCancel,v=e.onFileDialogOpen,b=e.useFsAccessApi,E=e.preventDropOnDocument,S=e.noClick,A=e.noKeyboard,I=e.noDrag,T=e.noDragEventsBubbling,R=e.validator,O=w.useMemo(function(){return typeof v=="function"?v:N8},[v]),N=w.useMemo(function(){return typeof y=="function"?y:N8},[y]),M=w.useRef(null),B=w.useRef(null),G=w.useReducer(EDe,bN),W=IR(G,2),K=W[0],se=W[1],ae=K.isFocused,ee=K.isFileDialogActive,F=K.draggedFiles,ie=w.useRef(typeof window<"u"&&window.isSecureContext&&b&&iDe()),J=function(){!ie.current&&ee&&setTimeout(function(){if(B.current){var Se=B.current.files;Se.length||(se({type:"closeDialog"}),N())}},300)};w.useEffect(function(){return window.addEventListener("focus",J,!1),function(){window.removeEventListener("focus",J,!1)}},[B,ee,N,ie]);var fe=w.useRef([]),Ce=function(Se){M.current&&M.current.contains(Se.target)||(Se.preventDefault(),fe.current=[])};w.useEffect(function(){return E&&(document.addEventListener("dragover",I8,!1),document.addEventListener("drop",Ce,!1)),function(){E&&(document.removeEventListener("dragover",I8),document.removeEventListener("drop",Ce))}},[M,E]);var Le=w.useCallback(function(ue){ue.preventDefault(),ue.persist(),Je(ue),fe.current=[].concat(fDe(fe.current),[ue.target]),rS(ue)&&Promise.resolve(i(ue)).then(function(Se){BA(ue)&&!T||(se({draggedFiles:Se,isDragActive:!0,type:"setDraggedFiles"}),u&&u(ue))})},[i,u,T]),j=w.useCallback(function(ue){ue.preventDefault(),ue.persist(),Je(ue);var Se=rS(ue);if(Se&&ue.dataTransfer)try{ue.dataTransfer.dropEffect="copy"}catch{}return Se&&d&&d(ue),!1},[d,T]),ke=w.useCallback(function(ue){ue.preventDefault(),ue.persist(),Je(ue);var Se=fe.current.filter(function(Pe){return M.current&&M.current.contains(Pe)}),Ge=Se.indexOf(ue.target);Ge!==-1&&Se.splice(Ge,1),fe.current=Se,!(Se.length>0)&&(se({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),rS(ue)&&c&&c(ue))},[M,c,T]),Fe=w.useCallback(function(ue,Se){var Ge=[],Pe=[];ue.forEach(function(ft){var nt=YZ(ft,n),ht=IR(nt,2),tn=ht[0],tt=ht[1],Et=qZ(ft,s,a),zt=IR(Et,2),Dt=zt[0],bt=zt[1],me=R?R(ft):null;if(tn&&Dt&&!me)Ge.push(ft);else{var De=[tt,bt];me&&(De=De.concat(me)),Pe.push({file:ft,errors:De.filter(function(rt){return rt})})}}),(!o&&Ge.length>1||o&&l>=1&&Ge.length>l)&&(Ge.forEach(function(ft){Pe.push({file:ft,errors:[JOe]})}),Ge.splice(0)),se({acceptedFiles:Ge,fileRejections:Pe,type:"setFiles"}),f&&f(Ge,Pe,Se),Pe.length>0&&g&&g(Pe,Se),Ge.length>0&&m&&m(Ge,Se)},[se,o,n,s,a,l,f,m,g,R]),Ye=w.useCallback(function(ue){ue.preventDefault(),ue.persist(),Je(ue),fe.current=[],rS(ue)&&Promise.resolve(i(ue)).then(function(Se){BA(ue)&&!T||Fe(Se,ue)}),se({type:"reset"})},[i,Fe,T]),gt=w.useCallback(function(){if(ie.current){se({type:"openDialog"}),O();var ue={multiple:o,types:aDe(n)};window.showOpenFilePicker(ue).then(function(Se){return i(Se)}).then(function(Se){Fe(Se,null),se({type:"closeDialog"})}).catch(function(Se){sDe(Se)?(N(Se),se({type:"closeDialog"})):oDe(Se)&&(ie.current=!1,B.current&&(B.current.value=null,B.current.click()))});return}B.current&&(se({type:"openDialog"}),O(),B.current.value=null,B.current.click())},[se,O,N,b,Fe,n,o]),Gt=w.useCallback(function(ue){!M.current||!M.current.isEqualNode(ue.target)||(ue.key===" "||ue.key==="Enter"||ue.keyCode===32||ue.keyCode===13)&&(ue.preventDefault(),gt())},[M,gt]),Ut=w.useCallback(function(){se({type:"focus"})},[]),Mt=w.useCallback(function(){se({type:"blur"})},[]),$e=w.useCallback(function(){S||(rDe()?setTimeout(gt,0):gt())},[S,gt]),qe=function(Se){return r?null:Se},re=function(Se){return A?null:qe(Se)},At=function(Se){return I?null:qe(Se)},Je=function(Se){T&&Se.stopPropagation()},Tt=w.useMemo(function(){return function(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Se=ue.refKey,Ge=Se===void 0?"ref":Se,Pe=ue.role,ft=ue.onKeyDown,nt=ue.onFocus,ht=ue.onBlur,tn=ue.onClick,tt=ue.onDragEnter,Et=ue.onDragOver,zt=ue.onDragLeave,Dt=ue.onDrop,bt=FA(ue,cDe);return kr(kr(gN({onKeyDown:re(qo(ft,Gt)),onFocus:re(qo(nt,Ut)),onBlur:re(qo(ht,Mt)),onClick:qe(qo(tn,$e)),onDragEnter:At(qo(tt,Le)),onDragOver:At(qo(Et,j)),onDragLeave:At(qo(zt,ke)),onDrop:At(qo(Dt,Ye)),role:typeof Pe=="string"&&Pe!==""?Pe:"button"},Ge,M),!r&&!A?{tabIndex:0}:{}),bt)}},[M,Gt,Ut,Mt,$e,Le,j,ke,Ye,A,I,r]),ot=w.useCallback(function(ue){ue.stopPropagation()},[]),Vt=w.useMemo(function(){return function(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Se=ue.refKey,Ge=Se===void 0?"ref":Se,Pe=ue.onChange,ft=ue.onClick,nt=FA(ue,dDe),ht=gN({accept:n,multiple:o,type:"file",style:{display:"none"},onChange:qe(qo(Pe,Ye)),onClick:qe(qo(ft,ot)),tabIndex:-1},Ge,B);return kr(kr({},ht),nt)}},[B,n,o,Ye,r]),yt=F.length,q=yt>0&&eDe({files:F,accept:n,minSize:s,maxSize:a,multiple:o,maxFiles:l}),U=yt>0&&!q;return kr(kr({},K),{},{isDragAccept:q,isDragReject:U,isFocused:ae&&!r,getRootProps:Tt,getInputProps:Vt,rootRef:M,inputRef:B,open:qe(gt)})}function EDe(t,e){switch(e.type){case"focus":return kr(kr({},t),{},{isFocused:!0});case"blur":return kr(kr({},t),{},{isFocused:!1});case"openDialog":return kr(kr({},bN),{},{isFileDialogActive:!0});case"closeDialog":return kr(kr({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=e.isDragActive,r=e.draggedFiles;return kr(kr({},t),{},{draggedFiles:r,isDragActive:n});case"setFiles":return kr(kr({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return kr({},bN);default:return t}}function N8(){}/*! +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XZ(t,e){if(t){if(typeof t=="string")return mN(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mN(t,e)}}function mN(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function vDe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a=0)&&(n[i]=t[i]);return n}var hL=w.forwardRef(function(t,e){var n=t.children,r=FA(t,lDe),i=ZZ(r),a=i.open,s=FA(i,uDe);return w.useImperativeHandle(e,function(){return{open:a}},[a]),pe.createElement(w.Fragment,null,n(kr(kr({},s),{},{open:a})))});hL.displayName="Dropzone";var KZ={disabled:!1,getFilesFromEvent:LOe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};hL.defaultProps=KZ;hL.propTypes={children:yr.func,accept:yr.oneOfType([yr.string,yr.arrayOf(yr.string)]),multiple:yr.bool,preventDropOnDocument:yr.bool,noClick:yr.bool,noKeyboard:yr.bool,noDrag:yr.bool,noDragEventsBubbling:yr.bool,minSize:yr.number,maxSize:yr.number,maxFiles:yr.number,disabled:yr.bool,getFilesFromEvent:yr.func,onFileDialogCancel:yr.func,onFileDialogOpen:yr.func,useFsAccessApi:yr.bool,onDragEnter:yr.func,onDragLeave:yr.func,onDragOver:yr.func,onDrop:yr.func,onDropAccepted:yr.func,onDropRejected:yr.func,validator:yr.func};var bN={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function ZZ(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=kr(kr({},KZ),t),n=e.accept,r=e.disabled,i=e.getFilesFromEvent,a=e.maxSize,s=e.minSize,o=e.multiple,l=e.maxFiles,u=e.onDragEnter,c=e.onDragLeave,d=e.onDragOver,f=e.onDrop,m=e.onDropAccepted,g=e.onDropRejected,y=e.onFileDialogCancel,v=e.onFileDialogOpen,b=e.useFsAccessApi,E=e.preventDropOnDocument,_=e.noClick,A=e.noKeyboard,I=e.noDrag,x=e.noDragEventsBubbling,R=e.validator,O=w.useMemo(function(){return typeof v=="function"?v:N8},[v]),N=w.useMemo(function(){return typeof y=="function"?y:N8},[y]),M=w.useRef(null),B=w.useRef(null),G=w.useReducer(EDe,bN),W=IR(G,2),K=W[0],se=W[1],ae=K.isFocused,ee=K.isFileDialogActive,F=K.draggedFiles,ie=w.useRef(typeof window<"u"&&window.isSecureContext&&b&&iDe()),J=function(){!ie.current&&ee&&setTimeout(function(){if(B.current){var _e=B.current.files;_e.length||(se({type:"closeDialog"}),N())}},300)};w.useEffect(function(){return window.addEventListener("focus",J,!1),function(){window.removeEventListener("focus",J,!1)}},[B,ee,N,ie]);var fe=w.useRef([]),Ce=function(_e){M.current&&M.current.contains(_e.target)||(_e.preventDefault(),fe.current=[])};w.useEffect(function(){return E&&(document.addEventListener("dragover",I8,!1),document.addEventListener("drop",Ce,!1)),function(){E&&(document.removeEventListener("dragover",I8),document.removeEventListener("drop",Ce))}},[M,E]);var Le=w.useCallback(function(ue){ue.preventDefault(),ue.persist(),Je(ue),fe.current=[].concat(fDe(fe.current),[ue.target]),r_(ue)&&Promise.resolve(i(ue)).then(function(_e){BA(ue)&&!x||(se({draggedFiles:_e,isDragActive:!0,type:"setDraggedFiles"}),u&&u(ue))})},[i,u,x]),j=w.useCallback(function(ue){ue.preventDefault(),ue.persist(),Je(ue);var _e=r_(ue);if(_e&&ue.dataTransfer)try{ue.dataTransfer.dropEffect="copy"}catch{}return _e&&d&&d(ue),!1},[d,x]),ke=w.useCallback(function(ue){ue.preventDefault(),ue.persist(),Je(ue);var _e=fe.current.filter(function(Pe){return M.current&&M.current.contains(Pe)}),Ge=_e.indexOf(ue.target);Ge!==-1&&_e.splice(Ge,1),fe.current=_e,!(_e.length>0)&&(se({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),r_(ue)&&c&&c(ue))},[M,c,x]),Fe=w.useCallback(function(ue,_e){var Ge=[],Pe=[];ue.forEach(function(ft){var nt=YZ(ft,n),ht=IR(nt,2),tn=ht[0],tt=ht[1],Et=qZ(ft,s,a),zt=IR(Et,2),Dt=zt[0],bt=zt[1],me=R?R(ft):null;if(tn&&Dt&&!me)Ge.push(ft);else{var De=[tt,bt];me&&(De=De.concat(me)),Pe.push({file:ft,errors:De.filter(function(rt){return rt})})}}),(!o&&Ge.length>1||o&&l>=1&&Ge.length>l)&&(Ge.forEach(function(ft){Pe.push({file:ft,errors:[JOe]})}),Ge.splice(0)),se({acceptedFiles:Ge,fileRejections:Pe,type:"setFiles"}),f&&f(Ge,Pe,_e),Pe.length>0&&g&&g(Pe,_e),Ge.length>0&&m&&m(Ge,_e)},[se,o,n,s,a,l,f,m,g,R]),Ye=w.useCallback(function(ue){ue.preventDefault(),ue.persist(),Je(ue),fe.current=[],r_(ue)&&Promise.resolve(i(ue)).then(function(_e){BA(ue)&&!x||Fe(_e,ue)}),se({type:"reset"})},[i,Fe,x]),gt=w.useCallback(function(){if(ie.current){se({type:"openDialog"}),O();var ue={multiple:o,types:aDe(n)};window.showOpenFilePicker(ue).then(function(_e){return i(_e)}).then(function(_e){Fe(_e,null),se({type:"closeDialog"})}).catch(function(_e){sDe(_e)?(N(_e),se({type:"closeDialog"})):oDe(_e)&&(ie.current=!1,B.current&&(B.current.value=null,B.current.click()))});return}B.current&&(se({type:"openDialog"}),O(),B.current.value=null,B.current.click())},[se,O,N,b,Fe,n,o]),Gt=w.useCallback(function(ue){!M.current||!M.current.isEqualNode(ue.target)||(ue.key===" "||ue.key==="Enter"||ue.keyCode===32||ue.keyCode===13)&&(ue.preventDefault(),gt())},[M,gt]),Ut=w.useCallback(function(){se({type:"focus"})},[]),Mt=w.useCallback(function(){se({type:"blur"})},[]),$e=w.useCallback(function(){_||(rDe()?setTimeout(gt,0):gt())},[_,gt]),qe=function(_e){return r?null:_e},re=function(_e){return A?null:qe(_e)},At=function(_e){return I?null:qe(_e)},Je=function(_e){x&&_e.stopPropagation()},xt=w.useMemo(function(){return function(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_e=ue.refKey,Ge=_e===void 0?"ref":_e,Pe=ue.role,ft=ue.onKeyDown,nt=ue.onFocus,ht=ue.onBlur,tn=ue.onClick,tt=ue.onDragEnter,Et=ue.onDragOver,zt=ue.onDragLeave,Dt=ue.onDrop,bt=FA(ue,cDe);return kr(kr(gN({onKeyDown:re(qo(ft,Gt)),onFocus:re(qo(nt,Ut)),onBlur:re(qo(ht,Mt)),onClick:qe(qo(tn,$e)),onDragEnter:At(qo(tt,Le)),onDragOver:At(qo(Et,j)),onDragLeave:At(qo(zt,ke)),onDrop:At(qo(Dt,Ye)),role:typeof Pe=="string"&&Pe!==""?Pe:"button"},Ge,M),!r&&!A?{tabIndex:0}:{}),bt)}},[M,Gt,Ut,Mt,$e,Le,j,ke,Ye,A,I,r]),ot=w.useCallback(function(ue){ue.stopPropagation()},[]),Vt=w.useMemo(function(){return function(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_e=ue.refKey,Ge=_e===void 0?"ref":_e,Pe=ue.onChange,ft=ue.onClick,nt=FA(ue,dDe),ht=gN({accept:n,multiple:o,type:"file",style:{display:"none"},onChange:qe(qo(Pe,Ye)),onClick:qe(qo(ft,ot)),tabIndex:-1},Ge,B);return kr(kr({},ht),nt)}},[B,n,o,Ye,r]),yt=F.length,q=yt>0&&eDe({files:F,accept:n,minSize:s,maxSize:a,multiple:o,maxFiles:l}),U=yt>0&&!q;return kr(kr({},K),{},{isDragAccept:q,isDragReject:U,isFocused:ae&&!r,getRootProps:xt,getInputProps:Vt,rootRef:M,inputRef:B,open:qe(gt)})}function EDe(t,e){switch(e.type){case"focus":return kr(kr({},t),{},{isFocused:!0});case"blur":return kr(kr({},t),{},{isFocused:!1});case"openDialog":return kr(kr({},bN),{},{isFileDialogActive:!0});case"closeDialog":return kr(kr({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=e.isDragActive,r=e.draggedFiles;return kr(kr({},t),{},{draggedFiles:r,isDragActive:n});case"setFiles":return kr(kr({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return kr({},bN);default:return t}}function N8(){}/*! * isobject * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var SDe=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1};/*! + */var _De=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1};/*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var _De=SDe;function O8(t){return _De(t)===!0&&Object.prototype.toString.call(t)==="[object Object]"}var QZ=function(e){var n,r;return!(O8(e)===!1||(n=e.constructor,typeof n!="function")||(r=n.prototype,O8(r)===!1)||r.hasOwnProperty("isPrototypeOf")===!1)};/*! + */var SDe=_De;function O8(t){return SDe(t)===!0&&Object.prototype.toString.call(t)==="[object Object]"}var QZ=function(e){var n,r;return!(O8(e)===!1||(n=e.constructor,typeof n!="function")||(r=n.prototype,O8(r)===!1)||r.hasOwnProperty("isPrototypeOf")===!1)};/*! * is-extendable * * Copyright (c) 2015-2017, Jon Schlinkert. @@ -4720,12 +4720,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var TDe=function(e,n,r){for(var i in e)if(n.call(r,e[i],i,e)===!1)break},xDe=mL,wDe=TDe;function JZ(t,e){for(var n=arguments.length,r=0;++r * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. - */var MDe=function(t,e,n,r,i){if(!NDe(t)||!e)return t;if(e=iS(e),n&&(e+="."+iS(n)),r&&(e+="."+iS(r)),i&&(e+="."+iS(i)),e in t)return t[e];for(var a=e.split("."),s=a.length,o=-1;t&&++o * * Copyright (c) 2015, Jon Schlinkert. @@ -4735,7 +4735,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. - */var zDe=kDe,HDe=function(t,e,n){if(typeof t!="string")throw new TypeError("expected a string");typeof e=="function"&&(n=e,e=null),typeof e=="string"&&(e={sep:e});var r=zDe({sep:"."},e),i=r.quotes||['"',"'","`"],a;r.brackets===!0?a={"<":">","(":")","[":"]","{":"}"}:r.brackets&&(a=r.brackets);var s=[],o=[],l=[""],u=r.sep,c=t.length,d=-1,f;function m(){if(a&&o.length)return a[o[o.length-1]]}for(;++d","(":")","[":"]","{":"}"}:r.brackets&&(a=r.brackets);var s=[],o=[],l=[""],u=r.sep,c=t.length,d=-1,f;function m(){if(a&&o.length)return a[o[o.length-1]]}for(;++d * * Copyright (c) 2015, Jon Schlinkert. @@ -4750,8 +4750,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * Copyright (c) 2014-2015, 2017, Jon Schlinkert. * Released under the MIT License. - */var XDe=HDe,KDe=WDe,k8=QZ,P8=qDe,ZDe=function(t,e,n){if(!P8(t)||(Array.isArray(e)&&(e=[].concat.apply([],e).join(".")),typeof e!="string"))return t;for(var r=XDe(e,{sep:".",brackets:!0}).filter(QDe),i=r.length,a=-1,s=t;++at.filter(Boolean).join(".");function nLe(t){const e=t.split(".");return[e.pop(),e.join(".")||void 0]}function rLe(t,e){return Object.entries(BNe(t,e)).reduce((n,[,{value:r,disabled:i,key:a}])=>(n[a]=i?void 0:r,n),{})}function iLe(t,e){const n=w.useRef();return Ob(t,n.current)||(n.current=t),n.current}function eQ(t,e){return w.useMemo(t,iLe(e))}function aLe(t){const e=w.useRef(null),n=w.useRef(null),r=w.useRef(!0);return w.useLayoutEffect(()=>{t||(e.current.style.height="0px",e.current.style.overflow="hidden")},[]),w.useEffect(()=>{if(r.current){r.current=!1;return}let i;const a=e.current,s=()=>{t&&(a.style.removeProperty("height"),a.style.removeProperty("overflow"),n.current.scrollIntoView({behavior:"smooth",block:"nearest"}))};a.addEventListener("transitionend",s,{once:!0});const{height:o}=n.current.getBoundingClientRect();return a.style.height=o+"px",t||(a.style.overflow="hidden",i=window.setTimeout(()=>a.style.height="0px",50)),()=>{a.removeEventListener("transitionend",s),clearTimeout(i)}},[t]),{wrapperRef:e,contentRef:n}}const sLe=t=>{const[e,n]=w.useState(t.getVisiblePaths());return w.useEffect(()=>{n(t.getVisiblePaths());const r=t.useStore.subscribe(t.getVisiblePaths,n,{equalityFn:_x});return()=>r()},[t]),e};function oLe(t,e,n){return t.useStore(i=>{const a=dn(dn({},n),i.data);return rLe(a,e)},_x)}function tQ(t=3){const e=w.useRef(null),n=w.useRef(null),[r,i]=w.useState(!1),a=w.useCallback(()=>i(!0),[]),s=w.useCallback(()=>i(!1),[]);return w.useLayoutEffect(()=>{if(r){const{bottom:o,top:l,left:u}=e.current.getBoundingClientRect(),{height:c}=n.current.getBoundingClientRect(),d=o+c>window.innerHeight-40?"up":"down";n.current.style.position="fixed",n.current.style.zIndex="10000",n.current.style.left=u+"px",d==="down"?n.current.style.top=o+t+"px":n.current.style.bottom=window.innerHeight-l+t+"px"}},[t,r]),{popinRef:e,wrapperRef:n,shown:r,show:a,hide:s}}EOe([SOe]);const lLe={rgb:"toRgb",hsl:"toHsl",hsv:"toHsv",hex:"toHex"};Ja.extend({color:()=>t=>Ra(t).isValid()});const uLe=t=>Ja().color().test(t);function nQ(t,{format:e,hasAlpha:n,isString:r}){const i=lLe[e]+(r&&e!=="hex"?"String":""),a=t[i]();return typeof a=="object"&&!n?FNe(a,["a"]):a}const rQ=(t,e)=>{const n=Ra(t);if(!n.isValid())throw Error("Invalid color");return nQ(n,e)},cLe=(t,e)=>nQ(Ra(t),dn(dn({},e),{},{isString:!0,format:"hex"})),dLe=({value:t})=>{const e=vOe(t),n=e==="name"?"hex":e,r=typeof t=="object"?"a"in t:e==="hex"&&t.length===8||/^(rgba)|(hsla)|(hsva)/.test(t),i={format:n,hasAlpha:r,isString:typeof t=="string"};return{value:rQ(t,i),settings:i}};var fLe=Object.freeze({__proto__:null,schema:uLe,sanitize:rQ,format:cLe,normalize:dLe});const pLe=ln("div",{position:"relative",boxSizing:"border-box",borderRadius:"$sm",overflow:"hidden",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",backgroundColor:"#fff",backgroundImage:`url('data:image/svg+xml;charset=utf-8,')`,$inputStyle:"",$hover:"",zIndex:1,variants:{active:{true:{$inputStyle:"$accent1"}}},"&::before":{content:'""',position:"absolute",top:0,bottom:0,right:0,left:0,backgroundColor:"currentColor",zIndex:1}}),hLe=ln("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto",columnGap:"$colGap",alignItems:"center"}),mLe=ln("div",{width:"$colorPickerWidth",height:"$colorPickerHeight",".react-colorful":{width:"100%",height:"100%",boxShadow:"$level2",cursor:"crosshair"},".react-colorful__saturation":{borderRadius:"$sm $sm 0 0"},".react-colorful__alpha, .react-colorful__hue":{height:10},".react-colorful__last-control":{borderRadius:"0 0 $sm $sm"},".react-colorful__pointer":{height:12,width:12}});function U8(t,e){return e!=="rgb"?Ra(t).toRgb():t}function gLe({value:t,displayValue:e,settings:n,onUpdate:r}){const{emitOnEditStart:i,emitOnEditEnd:a}=va(),{format:s,hasAlpha:o}=n,{popinRef:l,wrapperRef:u,shown:c,show:d,hide:f}=tQ(),m=w.useRef(0),[g,y]=w.useState(()=>U8(t,s)),v=o?ROe:MOe,b=()=>{y(U8(t,s)),d(),i()},E=()=>{f(),a(),window.clearTimeout(m.current)},S=()=>{m.current=window.setTimeout(E,500)};return w.useEffect(()=>()=>window.clearTimeout(m.current),[]),pe.createElement(pe.Fragment,null,pe.createElement(pLe,{ref:l,active:c,onClick:()=>b(),style:{color:e}}),c&&pe.createElement(oL,null,pe.createElement(TZ,{onPointerUp:E}),pe.createElement(mLe,{ref:u,onMouseEnter:()=>window.clearTimeout(m.current),onMouseLeave:A=>A.buttons===0&&S()},pe.createElement(v,{color:g,onChange:r}))))}function bLe(){const{value:t,displayValue:e,label:n,onChange:r,onUpdate:i,settings:a}=va();return pe.createElement(ao,{input:!0},pe.createElement(Po,null,n),pe.createElement(hLe,null,pe.createElement(gLe,{value:t,displayValue:e,onChange:r,onUpdate:i,settings:a}),pe.createElement(sL,{value:e,onChange:r,onUpdate:i})))}var yLe=dn({component:bLe},fLe);function vLe(){const{label:t,displayValue:e,onUpdate:n,settings:r}=va();return pe.createElement(ao,{input:!0},pe.createElement(Po,null,t),pe.createElement(uL,{value:e,settings:r,onUpdate:n}))}var ELe=dn({component:vLe},OZ(["x","y","z"]));const SLe=ln("div",{$flexCenter:"",position:"relative",backgroundColor:"$elevation3",borderRadius:"$sm",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",touchAction:"none",$draggable:"",$hover:"","&:active":{cursor:"none"},"&::after":{content:'""',backgroundColor:"$accent2",height:4,width:4,borderRadius:2}}),_Le=ln("div",{$flexCenter:"",width:"$joystickWidth",height:"$joystickHeight",borderRadius:"$sm",boxShadow:"$level2",position:"fixed",zIndex:1e4,overflow:"hidden",$draggable:"",transform:"translate(-50%, -50%)",variants:{isOutOfBounds:{true:{backgroundColor:"$elevation1"},false:{backgroundColor:"$elevation3"}}},"> div":{position:"absolute",$flexCenter:"",borderStyle:"solid",borderWidth:1,borderColor:"$highlight1",backgroundColor:"$elevation3",width:"80%",height:"80%","&::after,&::before":{content:'""',position:"absolute",zindex:10,backgroundColor:"$highlight1"},"&::before":{width:"100%",height:1},"&::after":{height:"100%",width:1}},"> span":{position:"relative",zindex:100,width:10,height:10,backgroundColor:"$accent2",borderRadius:"50%"}});function ALe({value:t,settings:e,onUpdate:n}){const r=w.useRef(),i=w.useRef(0),a=w.useRef(0),s=w.useRef(1),[o,l]=w.useState(!1),[u,c]=w.useState(!1),[d,f]=wZ(),m=w.useRef(null),g=w.useRef(null);w.useLayoutEffect(()=>{if(o){const{top:G,left:W,width:K,height:se}=m.current.getBoundingClientRect();g.current.style.left=W+K/2+"px",g.current.style.top=G+se/2+"px"}},[o]);const{keys:[y,v],joystick:b}=e,E=b==="invertY"?1:-1,{[y]:{step:S},[v]:{step:A}}=e,I=du("sizes","joystickWidth"),T=du("sizes","joystickHeight"),R=parseFloat(I)*.8/2,O=parseFloat(T)*.8/2,N=w.useCallback(()=>{r.current||(c(!0),i.current&&f({x:i.current*R}),a.current&&f({y:a.current*-O}),r.current=window.setInterval(()=>{n(G=>{const W=S*i.current*s.current,K=E*A*a.current*s.current;return Array.isArray(G)?{[y]:G[0]+W,[v]:G[1]+K}:{[y]:G[y]+W,[v]:G[v]+K}})},16))},[R,O,n,f,S,A,y,v,E]),M=w.useCallback(()=>{window.clearTimeout(r.current),r.current=void 0,c(!1)},[]);w.useEffect(()=>{function G(W){s.current=cZ(W)}return window.addEventListener("keydown",G),window.addEventListener("keyup",G),()=>{window.clearTimeout(r.current),window.removeEventListener("keydown",G),window.removeEventListener("keyup",G)}},[]);const B=vy(({first:G,active:W,delta:[K,se],movement:[ae,ee]})=>{G&&l(!0);const F=Nc(ae,-R,R),ie=Nc(ee,-O,O);i.current=Math.abs(ae)>Math.abs(F)?Math.sign(ae-F):0,a.current=Math.abs(ee)>Math.abs(ie)?Math.sign(ie-ee):0;let J=t[y],fe=t[v];W?(i.current||(J+=K*S*s.current,f({x:F})),a.current||(fe-=E*se*A*s.current,f({y:ie})),i.current||a.current?N():M(),n({[y]:J,[v]:fe})):(l(!1),i.current=0,a.current=0,f({x:0,y:0}),M())});return pe.createElement(SLe,Xr({ref:m},B()),o&&pe.createElement(oL,null,pe.createElement(_Le,{ref:g,isOutOfBounds:u},pe.createElement("div",null),pe.createElement("span",{ref:d}))))}const TLe=ln("div",{display:"grid",columnGap:"$colGap",variants:{withJoystick:{true:{gridTemplateColumns:"$sizes$rowHeight auto"},false:{gridTemplateColumns:"auto"}}}});function xLe(){const{label:t,displayValue:e,onUpdate:n,settings:r}=va();return pe.createElement(ao,{input:!0},pe.createElement(Po,null,t),pe.createElement(TLe,{withJoystick:!!r.joystick},r.joystick&&pe.createElement(ALe,{value:e,settings:r,onUpdate:n}),pe.createElement(uL,{value:e,settings:r,onUpdate:n})))}const wLe=["joystick"],iQ=OZ(["x","y"]),CLe=t=>{let{joystick:e=!0}=t,n=fr(t,wLe);const{value:r,settings:i}=iQ.normalize(n);return{value:r,settings:dn(dn({},i),{},{joystick:e})}};var RLe=dn(dn({component:xLe},iQ),{},{normalize:CLe});const ILe=t=>{if(t!==void 0){if(t instanceof File)try{return URL.createObjectURL(t)}catch{return}if(typeof t=="string"&&t.indexOf("blob:")===0)return t;throw Error("Invalid image format [undefined | blob | File].")}},MLe=(t,e)=>typeof e=="object"&&"image"in e,NLe=({image:t})=>({value:t});var OLe=Object.freeze({__proto__:null,sanitize:ILe,schema:MLe,normalize:NLe});const DLe=ln("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto 20px",columnGap:"$colGap",alignItems:"center"}),LLe=ln("div",{$flexCenter:"",overflow:"hidden",height:"$rowHeight",background:"$elevation3",textAlign:"center",color:"inherit",borderRadius:"$sm",outline:"none",userSelect:"none",cursor:"pointer",$inputStyle:"",$hover:"",$focusWithin:"",$active:"$accent1 $elevation1",variants:{isDragAccept:{true:{$inputStyle:"$accent1",backgroundColor:"$elevation1"}}}}),kLe=ln("div",{boxSizing:"border-box",borderRadius:"$sm",height:"$rowHeight",width:"$rowHeight",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center",variants:{hasImage:{true:{cursor:"pointer",$hover:"",$active:""}}}}),PLe=ln("div",{$flexCenter:"",width:"$imagePreviewWidth",height:"$imagePreviewHeight",borderRadius:"$sm",boxShadow:"$level2",pointerEvents:"none",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center"}),BLe=ln("div",{fontSize:"0.8em",height:"100%",padding:"$rowGap $md"}),FLe=ln("div",{$flexCenter:"",top:"0",right:"0",marginRight:"$sm",height:"100%",cursor:"pointer",variants:{disabled:{true:{color:"$elevation3",cursor:"default"}}},"&::after,&::before":{content:'""',position:"absolute",height:2,width:10,borderRadius:1,backgroundColor:"currentColor"},"&::after":{transform:"rotate(45deg)"},"&::before":{transform:"rotate(-45deg)"}});function ULe(){const{label:t,value:e,onUpdate:n,disabled:r}=va(),{popinRef:i,wrapperRef:a,shown:s,show:o,hide:l}=tQ(),u=w.useCallback(g=>{g.length&&n(g[0])},[n]),c=w.useCallback(g=>{g.stopPropagation(),n(void 0)},[n]),{getRootProps:d,getInputProps:f,isDragAccept:m}=ZZ({maxFiles:1,accept:"image/*",onDrop:u,disabled:r});return pe.createElement(ao,{input:!0},pe.createElement(Po,null,t),pe.createElement(DLe,null,pe.createElement(kLe,{ref:i,hasImage:!!e,onPointerDown:()=>!!e&&o(),onPointerUp:l,style:{backgroundImage:e?`url(${e})`:"none"}}),s&&!!e&&pe.createElement(oL,null,pe.createElement(TZ,{onPointerUp:l,style:{cursor:"pointer"}}),pe.createElement(PLe,{ref:a,style:{backgroundImage:`url(${e})`}})),pe.createElement(LLe,d({isDragAccept:m}),pe.createElement("input",f()),pe.createElement(BLe,null,m?"drop image":"click or drop")),pe.createElement(FLe,{onClick:c,disabled:!e})))}var zLe=dn({component:ULe},OLe);const z8=Ja().number(),HLe=(t,e)=>Ja().array().length(2).every.number().test(t)&&Ja().schema({min:z8,max:z8}).test(e),UA=t=>({min:t[0],max:t[1]}),aQ=(t,{bounds:[e,n]},r)=>{const i=Array.isArray(t)?UA(t):t,a={min:r[0],max:r[1]},{min:s,max:o}=dn(dn({},a),i);return[Nc(Number(s),e,Math.max(e,o)),Nc(Number(o),Math.min(n,s),n)]},GLe=({value:t,min:e,max:n})=>{const r={min:e,max:n},i=NZ(UA(t),{min:r,max:r}),a=[e,n],s=dn(dn({},i),{},{bounds:a});return{value:aQ(UA(t),s,t),settings:s}};var VLe=Object.freeze({__proto__:null,schema:HLe,format:UA,sanitize:aQ,normalize:GLe});const $Le=["value","bounds","onDrag"],WLe=["bounds"],jLe=ln("div",{display:"grid",columnGap:"$colGap",gridTemplateColumns:"auto calc($sizes$numberInputMinWidth * 2 + $space$rowGap)"});function YLe(t){let{value:e,bounds:[n,r],onDrag:i}=t,a=fr(t,$Le);const s=w.useRef(null),o=w.useRef(null),l=w.useRef(null),u=w.useRef(0),c=du("sizes","scrubberWidth"),d=vy(({event:g,first:y,xy:[v],movement:[b],memo:E={}})=>{if(y){const{width:A,left:I}=s.current.getBoundingClientRect();u.current=A-parseFloat(c);const T=(g==null?void 0:g.target)===o.current||(g==null?void 0:g.target)===l.current;E.pos=LA((v-I)/A,n,r);const R=Math.abs(E.pos-e.min)-Math.abs(E.pos-e.max);E.key=R<0||R===0&&E.pos<=e.min?"min":"max",T&&(E.pos=e[E.key])}const S=E.pos+LA(b/u.current,0,r-n);return i({[E.key]:w2e(S,a[E.key])}),E}),f=`calc(${DA(e.min,n,r)} * (100% - ${c} - 8px) + 4px)`,m=`calc(${1-DA(e.max,n,r)} * (100% - ${c} - 8px) + 4px)`;return pe.createElement(RZ,Xr({ref:s},d()),pe.createElement(CZ,null,pe.createElement(IZ,{style:{left:f,right:m}})),pe.createElement(oN,{position:"left",ref:o,style:{left:f}}),pe.createElement(oN,{position:"right",ref:l,style:{right:m}}))}function qLe(){const{label:t,displayValue:e,onUpdate:n,settings:r}=va(),i=fr(r,WLe);return pe.createElement(pe.Fragment,null,pe.createElement(ao,{input:!0},pe.createElement(Po,null,t),pe.createElement(jLe,null,pe.createElement(YLe,Xr({value:e},r,{onDrag:n})),pe.createElement(uL,{value:e,settings:i,onUpdate:n,innerLabelTrim:0}))))}var XLe=dn({component:qLe},VLe);const KLe=()=>{const t=new Map;return{on:(e,n)=>{let r=t.get(e);r===void 0&&(r=new Set,t.set(e,r)),r.add(n)},off:(e,n)=>{const r=t.get(e);r!==void 0&&(r.delete(n),r.size===0&&t.delete(e))},emit:(e,...n)=>{const r=t.get(e);if(r!==void 0)for(const i of r)i(...n)}}},ZLe=["type","value"],QLe=["onChange","transient","onEditStart","onEditEnd"],JLe=function(){const e=OD(Uwe(()=>({data:{}}))),n=KLe();this.storeId=PNe(),this.useStore=e;const r={},i=new Set;this.getVisiblePaths=()=>{const s=this.getData(),o=Object.keys(s),l=[];Object.entries(r).forEach(([c,d])=>{d.render&&o.some(f=>f.indexOf(c)===0)&&!d.render(this.get)&&l.push(c+".")});const u=[];return i.forEach(c=>{c in s&&s[c].__refCount>0&&l.every(d=>c.indexOf(d)===-1)&&(!s[c].render||s[c].render(this.get))&&u.push(c)}),u},this.setOrderedPaths=s=>{s.forEach(o=>i.add(o))},this.orderPaths=s=>(this.setOrderedPaths(s),s),this.disposePaths=s=>{e.setState(o=>{const l=o.data;return s.forEach(u=>{if(u in l){const c=l[u];c.__refCount--,c.__refCount===0&&c.type in xo&&delete l[u]}}),{data:l}})},this.dispose=()=>{e.setState(()=>({data:{}}))},this.getFolderSettings=s=>r[s]||{},this.getData=()=>e.getState().data,this.addData=(s,o)=>{e.setState(l=>{const u=l.data;return Object.entries(s).forEach(([c,d])=>{let f=u[c];if(f){const{type:m,value:g}=d,y=fr(d,ZLe);m!==f.type?ql(Pr.INPUT_TYPE_OVERRIDE,m):((f.__refCount===0||o)&&Object.assign(f,y),f.__refCount++)}else u[c]=dn(dn({},d),{},{__refCount:1})}),{data:u}})},this.setValueAtPath=(s,o,l)=>{e.setState(u=>{const c=u.data;return c8(c[s],o,s,this,l),{data:c}})},this.setSettingsAtPath=(s,o)=>{e.setState(l=>{const u=l.data;return u[s].settings=dn(dn({},u[s].settings),o),{data:u}})},this.disableInputAtPath=(s,o)=>{e.setState(l=>{const u=l.data;return u[s].disabled=o,{data:u}})},this.set=(s,o)=>{e.setState(l=>{const u=l.data;return Object.entries(s).forEach(([c,d])=>{try{c8(u[c],d,void 0,void 0,o)}catch{}}),{data:u}})},this.getInput=s=>{try{return this.getData()[s]}catch{ql(Pr.PATH_DOESNT_EXIST,s)}},this.get=s=>{var o;return(o=this.getInput(s))===null||o===void 0?void 0:o.value},this.emitOnEditStart=s=>{n.emit(`onEditStart:${s}`,this.get(s),s,dn(dn({},this.getInput(s)),{},{get:this.get}))},this.emitOnEditEnd=s=>{n.emit(`onEditEnd:${s}`,this.get(s),s,dn(dn({},this.getInput(s)),{},{get:this.get}))},this.subscribeToEditStart=(s,o)=>{const l=`onEditStart:${s}`;return n.on(l,o),()=>n.off(l,o)},this.subscribeToEditEnd=(s,o)=>{const l=`onEditEnd:${s}`;return n.on(l,o),()=>n.off(l,o)};const a=(s,o,l)=>{const u={};return Object.entries(s).forEach(([c,d])=>{if(c==="")return ql(Pr.EMPTY_KEY);let f=gL(o,c);if(d.type===xo.FOLDER){const m=a(d.schema,f,l);Object.assign(u,m),f in r||(r[f]=d.settings)}else if(c in l)ql(Pr.DUPLICATE_KEYS,c,f,l[c].path);else{const m=$Ne(d,c,f,u);if(m){const{type:g,options:y,input:v}=m,{onChange:b,transient:E,onEditStart:S,onEditEnd:A}=y,I=fr(y,QLe);u[f]=dn(dn(dn({type:g},I),v),{},{fromPanel:!0}),l[c]={path:f,onChange:b,transient:E,onEditStart:S,onEditEnd:A}}else ql(Pr.UNKNOWN_INPUT,f,d)}}),u};this.getDataFromSchema=s=>{const o={};return[a(s,"",o),o]}},sQ=new JLe,eke={collapsed:!1};function tke(t,e){return{type:xo.FOLDER,schema:t,settings:dn(dn({},eke),e)}}const H8=t=>"__levaInput"in t,nke=(t,e)=>{const n={},r=e?e.toLowerCase():null;return t.forEach(i=>{const[a,s]=nLe(i);(!r||a.toLowerCase().indexOf(r)>-1)&&tLe(n,s,{[a]:{__levaInput:!0,path:i}})}),n},rke=["type","label","path","valueKey","value","settings","setValue","disabled"];function ike(t){let{type:e,label:n,path:r,valueKey:i,value:a,settings:s,setValue:o,disabled:l}=t,u=fr(t,rke);const{displayValue:c,onChange:d,onUpdate:f}=xZ({type:e,value:a,settings:s,setValue:o}),m=xf[e].component;return m?pe.createElement(mZ.Provider,{value:dn({key:i,path:r,id:""+r,label:n,displayValue:c,value:a,onChange:d,onUpdate:f,settings:s,setValue:o,disabled:l},u)},pe.createElement(c2e,{disabled:l},pe.createElement(m,null))):(ql(Pr.NO_COMPONENT_FOR_TYPE,e,r),null)}const ake=ln("button",{display:"block",$reset:"",fontWeight:"$button",height:"$rowHeight",borderStyle:"none",borderRadius:"$sm",backgroundColor:"$elevation1",color:"$highlight1","&:not(:disabled)":{color:"$highlight3",backgroundColor:"$accent2",cursor:"pointer",$hover:"$accent3",$active:"$accent3 $accent1",$focus:""}});function ske({onClick:t,settings:e,label:n}){const r=yy();return pe.createElement(ao,null,pe.createElement(ake,{disabled:e.disabled,onClick:()=>t(r.get)},n))}const oke=ln("div",{$flex:"",justifyContent:"flex-end",gap:"$colGap"}),lke=ln("button",{$reset:"",cursor:"pointer",borderRadius:"$xs","&:hover":{backgroundColor:"$elevation3"}}),uke=({label:t,opts:e})=>{let n=typeof t=="string"&&t.trim()===""?null:t,r=e;return typeof e.opts=="object"&&(r.label!==void 0&&(n=e.label),r=e.opts),{label:n,opts:r}};function cke(t){const{label:e,opts:n}=uke(t),r=yy();return pe.createElement(ao,{input:!!e},e&&pe.createElement(Po,null,e),pe.createElement(oke,null,Object.entries(n).map(([i,a])=>pe.createElement(lke,{key:i,onClick:()=>a(r.get)},i))))}const dke=ln("canvas",{height:"$monitorHeight",width:"100%",display:"block",borderRadius:"$sm"}),oQ=100;function fke(t,e){t.push(e),t.length>oQ&&t.shift()}const pke=w.forwardRef(function({initialValue:t},e){const n=du("colors","highlight3"),r=du("colors","elevation2"),i=du("colors","highlight1"),[a,s]=w.useMemo(()=>[Ra(i).alpha(.4).toRgbString(),Ra(i).alpha(.1).toRgbString()],[i]),o=w.useRef([t]),l=w.useRef(t),u=w.useRef(t),c=w.useRef(),d=w.useCallback((g,y)=>{if(!g)return;const{width:v,height:b}=g,E=new Path2D,S=v/oQ,A=b*.05;for(let R=0;R({frame:g=>{(l.current===void 0||gu.current)&&(u.current=g),fke(o.current,g),c.current=requestAnimationFrame(()=>d(f.current,m.current))}}),[f,m,d]),w.useEffect(()=>()=>cancelAnimationFrame(c.current),[]),pe.createElement(dke,{ref:f})}),G8=t=>Number.isFinite(t)?t.toPrecision(2):t.toString(),hke=w.forwardRef(function({initialValue:t},e){const[n,r]=w.useState(G8(t));return w.useImperativeHandle(e,()=>({frame:i=>r(G8(i))}),[]),pe.createElement("div",null,n)});function V8(t){return typeof t=="function"?t():t.current}function mke({label:t,objectOrFn:e,settings:n}){const r=w.useRef(),i=w.useRef(V8(e));return w.useEffect(()=>{const a=window.setInterval(()=>{var s;document.hidden||(s=r.current)===null||s===void 0||s.frame(V8(e))},n.interval);return()=>window.clearInterval(a)},[e,n.interval]),pe.createElement(ao,{input:!0},pe.createElement(Po,{align:"top"},t),n.graph?pe.createElement(pke,{ref:r,initialValue:i.current}):pe.createElement(hke,{ref:r,initialValue:i.current}))}const gke=["type","label","key"],bke={[xo.BUTTON]:ske,[xo.BUTTON_GROUP]:cke,[xo.MONITOR]:mke},yke=pe.memo(({path:t})=>{const[e,{set:n,setSettings:r,disable:i,storeId:a,emitOnEditStart:s,emitOnEditEnd:o}]=S2e(t);if(!e)return null;const{type:l,label:u,key:c}=e,d=fr(e,gke);if(l in xo){const f=bke[l];return pe.createElement(f,Xr({label:u,path:t},d))}return l in xf?pe.createElement(ike,Xr({key:a+t,type:l,label:u,storeId:a,path:t,valueKey:c,setValue:n,setSettings:r,disable:i,emitOnEditStart:s,emitOnEditEnd:o},d)):(RNe(Pr.UNSUPPORTED_INPUT,l,t),null)});function vke({toggle:t,toggled:e,name:n}){return pe.createElement(o2e,{onClick:()=>t()},pe.createElement(lL,{toggled:e}),pe.createElement("div",null,n))}const Eke=({name:t,path:e,tree:n})=>{const r=yy(),i=gL(e,t),{collapsed:a,color:s}=r.getFolderSettings(i),[o,l]=w.useState(!a),u=w.useRef(null),c=du("colors","folderWidgetColor"),d=du("colors","folderTextColor");return w.useLayoutEffect(()=>{u.current.style.setProperty("--leva-colors-folderWidgetColor",s||c),u.current.style.setProperty("--leva-colors-folderTextColor",s||d)},[s,c,d]),pe.createElement(kA,{ref:u},pe.createElement(vke,{name:t,toggled:o,toggle:()=>l(f=>!f)}),pe.createElement(lQ,{parent:i,tree:n,toggled:o}))},lQ=pe.memo(({isRoot:t=!1,fill:e=!1,flat:n=!1,parent:r,tree:i,toggled:a})=>{const{wrapperRef:s,contentRef:o}=aLe(a),l=yy(),u=([d,f])=>{var m;return(H8(f)?(m=l.getInput(f.path))===null||m===void 0?void 0:m.order:l.getFolderSettings(gL(r,d)).order)||0},c=Object.entries(i).sort((d,f)=>u(d)-u(f));return pe.createElement(aN,{ref:s,isRoot:t,fill:e,flat:n},pe.createElement(SZ,{ref:o,isRoot:t,toggled:a},c.map(([d,f])=>H8(f)?pe.createElement(yke,{key:f.path,valueKey:f.valueKey,path:f.path}):pe.createElement(Eke,{key:d,name:d,path:r,tree:f}))))}),Ske=ln("div",{position:"relative",fontFamily:"$mono",fontSize:"$root",color:"$rootText",backgroundColor:"$elevation1",variants:{fill:{false:{position:"fixed",top:"10px",right:"10px",zIndex:1e3,width:"$rootWidth"},true:{position:"relative",width:"100%"}},flat:{false:{borderRadius:"$lg",boxShadow:"$level1"}},oneLineLabels:{true:{[`${AZ}`]:{gridTemplateColumns:"auto",gridAutoColumns:"minmax(max-content, 1fr)",gridAutoRows:"minmax($sizes$rowHeight), auto)",rowGap:0,columnGap:0,marginTop:"$rowGap"}}},hideTitleBar:{true:{$$titleBarHeight:"0px"},false:{$$titleBarHeight:"$sizes$titleBarHeight"}}},"&,*,*:after,*:before":{boxSizing:"border-box"},"*::selection":{backgroundColor:"$accent2"}}),uQ=40,zA=ln("i",{$flexCenter:"",width:uQ,userSelect:"none",cursor:"pointer","> svg":{fill:"$highlight1",transition:"transform 350ms ease, fill 250ms ease"},"&:hover > svg":{fill:"$highlight3"},variants:{active:{true:{"> svg":{fill:"$highlight2"}}}}}),_ke=ln("div",{display:"flex",alignItems:"stretch",justifyContent:"space-between",height:"$titleBarHeight",variants:{mode:{drag:{cursor:"grab"}}}}),Ake=ln("div",{$flex:"",position:"relative",width:"100%",overflow:"hidden",transition:"height 250ms ease",color:"$highlight3",paddingLeft:"$md",[`> ${zA}`]:{height:30},variants:{toggled:{true:{height:30},false:{height:0}}}}),Tke=ln("input",{$reset:"",flex:1,position:"relative",height:30,width:"100%",backgroundColor:"transparent",fontSize:"10px",borderRadius:"$root","&:focus":{},"&::placeholder":{color:"$highlight2"}}),xke=ln("div",{touchAction:"none",$flexCenter:"",flex:1,"> svg":{fill:"$highlight1"},color:"$highlight1",variants:{drag:{true:{$draggable:"","> svg":{transition:"fill 250ms ease"},"&:hover":{color:"$highlight3"},"&:hover > svg":{fill:"$highlight3"}}},filterEnabled:{false:{paddingRight:uQ}}}}),wke=pe.forwardRef(({setFilter:t,toggle:e},n)=>{const[r,i]=w.useState(""),a=w.useMemo(()=>uZ(t,250),[t]),s=()=>{t(""),i("")},o=l=>{const u=l.currentTarget.value;e(!0),i(u)};return w.useEffect(()=>{a(r)},[r,a]),pe.createElement(pe.Fragment,null,pe.createElement(Tke,{ref:n,value:r,placeholder:"[Open filter with CMD+SHIFT+L]",onPointerDown:l=>l.stopPropagation(),onChange:o}),pe.createElement(zA,{onClick:()=>s(),style:{visibility:r?"visible":"hidden"}},pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"14",width:"14",viewBox:"0 0 20 20",fill:"currentColor"},pe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))))});function Cke({setFilter:t,onDrag:e,onDragStart:n,onDragEnd:r,toggle:i,toggled:a,title:s,drag:o,filterEnabled:l,from:u}){const[c,d]=w.useState(!1),f=w.useRef(null);w.useEffect(()=>{var g,y;c?(g=f.current)===null||g===void 0||g.focus():(y=f.current)===null||y===void 0||y.blur()},[c]);const m=vy(({offset:[g,y],first:v,last:b})=>{e({x:g,y}),v&&n({x:g,y}),b&&r({x:g,y})},{filterTaps:!0,from:({offset:[g,y]})=>[(u==null?void 0:u.x)||g,(u==null?void 0:u.y)||y]});return w.useEffect(()=>{const g=y=>{y.key==="L"&&y.shiftKey&&y.metaKey&&d(v=>!v)};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[]),pe.createElement(pe.Fragment,null,pe.createElement(_ke,{mode:o?"drag":void 0},pe.createElement(zA,{active:!a,onClick:()=>i()},pe.createElement(lL,{toggled:a,width:12,height:8})),pe.createElement(xke,Xr({},o?m():{},{drag:o,filterEnabled:l}),s===void 0&&o?pe.createElement("svg",{width:"20",height:"10",viewBox:"0 0 28 14",xmlns:"http://www.w3.org/2000/svg"},pe.createElement("circle",{cx:"2",cy:"2",r:"2"}),pe.createElement("circle",{cx:"14",cy:"2",r:"2"}),pe.createElement("circle",{cx:"26",cy:"2",r:"2"}),pe.createElement("circle",{cx:"2",cy:"12",r:"2"}),pe.createElement("circle",{cx:"14",cy:"12",r:"2"}),pe.createElement("circle",{cx:"26",cy:"12",r:"2"})):s),l&&pe.createElement(zA,{active:c,onClick:()=>d(g=>!g)},pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 20 20"},pe.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),pe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"})))),pe.createElement(Ake,{toggled:c},pe.createElement(wke,{ref:f,setFilter:t,toggle:i})))}const Rke=["store","hidden","theme","collapsed"];function Ike(t){let{store:e,hidden:n=!1,theme:r,collapsed:i=!1}=t,a=fr(t,Rke);const s=eQ(()=>t2e(r),[r]),[o,l]=w.useState(!i),u=typeof i=="object"?!i.collapsed:o,c=w.useMemo(()=>typeof i=="object"?d=>{typeof d=="function"?i.onChange(!d(!i.collapsed)):i.onChange(!d)}:l,[i]);return!e||n?null:pe.createElement(aL.Provider,{value:s},pe.createElement(Mke,Xr({store:e},a,{toggled:u,setToggle:c,rootClass:s.className})))}const Mke=pe.memo(({store:t,rootClass:e,fill:n=!1,flat:r=!1,neverHide:i=!1,oneLineLabels:a=!1,titleBar:s={title:void 0,drag:!0,filter:!0,position:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0},hideCopyButton:o=!1,toggled:l,setToggle:u})=>{var c,d;const f=sLe(t),[m,g]=w.useState(""),y=w.useMemo(()=>nke(f,m),[f,m]),[v,b]=wZ(),E=i||f.length>0,S=typeof s=="object"&&s.title||void 0,A=typeof s=="object"&&(c=s.drag)!==null&&c!==void 0?c:!0,I=typeof s=="object"&&(d=s.filter)!==null&&d!==void 0?d:!0,T=typeof s=="object"&&s.position||void 0,R=typeof s=="object"&&s.onDrag||void 0,O=typeof s=="object"&&s.onDragStart||void 0,N=typeof s=="object"&&s.onDragEnd||void 0;return pe.useEffect(()=>{b({x:T==null?void 0:T.x,y:T==null?void 0:T.y})},[T,b]),e2e(),pe.createElement(bZ.Provider,{value:{hideCopyButton:o}},pe.createElement(Ske,{ref:v,className:e,fill:n,flat:r,oneLineLabels:a,hideTitleBar:!s,style:{display:E?"block":"none"}},s&&pe.createElement(Cke,{onDrag:M=>{b(M),R==null||R(M)},onDragStart:M=>O==null?void 0:O(M),onDragEnd:M=>N==null?void 0:N(M),setFilter:g,toggle:M=>u(B=>M??!B),toggled:l,title:S,drag:A,filterEnabled:I,from:T}),E&&pe.createElement(gZ.Provider,{value:t},pe.createElement(lQ,{isRoot:!0,fill:n,flat:r,tree:y,toggled:l}))))}),Nke=["isRoot"];let HA=!1,$d=null;function Oke(t){let{isRoot:e=!1}=t,n=fr(t,Nke);return w.useEffect(()=>(HA=!0,!e&&$d&&($d.remove(),$d=null),()=>{e||(HA=!1)}),[e]),pe.createElement(Ike,Xr({store:sQ},n))}function Dke(t){w.useEffect(()=>{t&&!HA&&($d||($d=document.getElementById("leva__root")||Object.assign(document.createElement("div"),{id:"leva__root"}),document.body&&(document.body.appendChild($d),jNe(pe.createElement(Oke,{isRoot:!0}),$d))),HA=!0)},[t])}function Lke(t,e,n,r,i){let a,s,o,l,u;return typeof t=="string"?(s=t,a=e,Array.isArray(n)?u=n:n&&("store"in n?(l=n,u=r):(o=n,Array.isArray(r)?u=r:(l=r,u=i)))):(a=t,Array.isArray(e)?u=e:(l=e,u=n)),{schema:a,folderName:s,folderSettings:o,hookSettings:l,deps:u||[]}}function bL(t,e,n,r,i){const{folderName:a,schema:s,folderSettings:o,hookSettings:l,deps:u}=Lke(t,e,n,r,i),c=typeof s=="function",d=w.useRef(!1),f=w.useRef(!0),m=eQ(()=>{d.current=!0;const B=typeof s=="function"?s():s;return a?{[a]:tke(B,o)}:B},u),g=!(l!=null&&l.store);Dke(g);const[y]=w.useState(()=>(l==null?void 0:l.store)||sQ),[v,b]=w.useMemo(()=>y.getDataFromSchema(m),[y,m]),[E,S,A,I,T]=w.useMemo(()=>{const B=[],G=[],W={},K={},se={};return Object.values(b).forEach(({path:ae,onChange:ee,onEditStart:F,onEditEnd:ie,transient:J})=>{B.push(ae),ee?(W[ae]=ee,J||G.push(ae)):G.push(ae),F&&(K[ae]=F),ie&&(se[ae]=ie)}),[B,G,W,K,se]},[b]),R=w.useMemo(()=>y.orderPaths(E),[E,y]),O=oLe(y,S,v),N=w.useCallback(B=>{const G=Object.entries(B).reduce((W,[K,se])=>Object.assign(W,{[b[K].path]:se}),{});y.set(G,!1)},[y,b]),M=w.useCallback(B=>y.get(b[B].path),[y,b]);return w.useEffect(()=>{const B=!f.current&&d.current;return y.addData(v,B),f.current=!1,d.current=!1,()=>y.disposePaths(R)},[y,R,v]),w.useEffect(()=>{const B=[];return Object.entries(A).forEach(([G,W])=>{W(y.get(G),G,dn({initial:!0,get:y.get},y.getInput(G)));const K=y.useStore.subscribe(se=>{const ae=se.data[G];return[ae.disabled?void 0:ae.value,ae]},([se,ae])=>W(se,G,dn({initial:!1,get:y.get},ae)),{equalityFn:_x});B.push(K)}),()=>B.forEach(G=>G())},[y,A]),w.useEffect(()=>{const B=[];return Object.entries(I).forEach(([G,W])=>B.push(y.subscribeToEditStart(G,W))),Object.entries(T).forEach(([G,W])=>B.push(y.subscribeToEditEnd(G,W))),()=>B.forEach(G=>G())},[I,T,y]),c?[O,N,M]:O}_u(Io.SELECT,F2e);_u(Io.IMAGE,zLe);_u(Io.NUMBER,R2e);_u(Io.COLOR,yLe);_u(Io.STRING,Y2e);_u(Io.BOOLEAN,eOe);_u(Io.INTERVAL,XLe);_u(Io.VECTOR3D,ELe);_u(Io.VECTOR2D,RLe);class _y{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}}_y.prototype.property={};_y.prototype.normal={};_y.prototype.space=null;function cQ(t,e){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&Uke.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(W8,Gke);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!W8.test(a)){let s=a.replace(zke,Hke);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=yL}return new i(r,e)}function Hke(t){return"-"+t.toLowerCase()}function Gke(t){return t.charAt(1).toUpperCase()}const Ay=cQ([pQ,fQ,gQ,bQ,Bke],"html"),Ty=cQ([pQ,fQ,gQ,bQ,Fke],"svg");function GA(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(i,r).trim();(s||!a)&&e.push(s),i=r+1,r=n.indexOf(",",i)}return e}function Vke(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const j8=/[#.]/g;function $ke(t,e){const n=t||"",r={};let i=0,a,s;for(;i-1&&a<=e.length){let s=0;for(;;){let o=n[s];if(o===void 0){const l=q8(e,n[s-1]);o=l===-1?e.length+1:l+1,n[s]=o}if(o>a)return{line:s+1,column:a-(s>0?n[s-1]:0)+1,offset:a};s++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length1?n[a.line-2]:0)+a.column-1;if(s=55296&&t<=57343}function oPe(t){return t>=56320&&t<=57343}function lPe(t,e){return(t-55296)*1024+9216+e}function _Q(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function AQ(t){return t>=64976&&t<=65007||sPe.has(t)}var He;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(He||(He={}));const uPe=65536;class cPe{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=uPe,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:i,offset:a}=this,s=i+n,o=a+n;return{code:e,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(oPe(n))return this.pos++,this._addGap(),lPe(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Y.EOF;return this._err(He.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Y.EOF;const r=this.html.charCodeAt(n);return r===Y.CARRIAGE_RETURN?Y.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Y.EOF;let e=this.html.charCodeAt(this.pos);return e===Y.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Y.LINE_FEED):e===Y.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,SQ(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===Y.LINE_FEED||e===Y.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){_Q(e)?this._err(He.controlCharacterInInputStream):AQ(e)&&this._err(He.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const xQ=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),dPe=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var OR;const fPe=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),pPe=(OR=String.fromCodePoint)!==null&&OR!==void 0?OR:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function hPe(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=fPe.get(t))!==null&&e!==void 0?e:t}var Ni;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Ni||(Ni={}));const mPe=32;var lc;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(lc||(lc={}));function AN(t){return t>=Ni.ZERO&&t<=Ni.NINE}function gPe(t){return t>=Ni.UPPER_A&&t<=Ni.UPPER_F||t>=Ni.LOWER_A&&t<=Ni.LOWER_F}function bPe(t){return t>=Ni.UPPER_A&&t<=Ni.UPPER_Z||t>=Ni.LOWER_A&&t<=Ni.LOWER_Z||AN(t)}function yPe(t){return t===Ni.EQUALS||bPe(t)}var wi;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(wi||(wi={}));var Xl;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Xl||(Xl={}));class wQ{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=wi.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Xl.Strict}startEntity(e){this.decodeMode=e,this.state=wi.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case wi.EntityStart:return e.charCodeAt(n)===Ni.NUM?(this.state=wi.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=wi.NamedEntity,this.stateNamedEntity(e,n));case wi.NumericStart:return this.stateNumericStart(e,n);case wi.NumericDecimal:return this.stateNumericDecimal(e,n);case wi.NumericHex:return this.stateNumericHex(e,n);case wi.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|mPe)===Ni.LOWER_X?(this.state=wi.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=wi.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const a=r-n;this.result=this.result*Math.pow(i,a)+parseInt(e.substr(n,a),i),this.consumed+=a}}stateNumericHex(e,n){const r=n;for(;n>14;for(;n>14,a!==0){if(s===Ni.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==Xl.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&lc.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~lc.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case wi.NamedEntity:return this.result!==0&&(this.decodeMode!==Xl.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case wi.NumericDecimal:return this.emitNumericEntity(0,2);case wi.NumericHex:return this.emitNumericEntity(0,3);case wi.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case wi.EntityStart:return 0}}}function CQ(t){let e="";const n=new wQ(t,r=>e+=pPe(r));return function(i,a){let s=0,o=0;for(;(o=i.indexOf("&",o))>=0;){e+=i.slice(s,o),n.startEntity(a);const u=n.write(i,o+1);if(u<0){s=o+n.end();break}s=o+u,o=u===0?s+1:s}const l=e+i.slice(s);return e="",l}}function vPe(t,e,n,r){const i=(e&lc.BRANCH_LENGTH)>>7,a=e&lc.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){const l=r-a;return l<0||l>=i?-1:t[n+l]-1}let s=n,o=s+i-1;for(;s<=o;){const l=s+o>>>1,u=t[l];if(ur)o=l-1;else return t[l+i]}return-1}CQ(xQ);CQ(dPe);var it;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(it||(it={}));var af;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(af||(af={}));var Xs;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(Xs||(Xs={}));var Ie;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(Ie||(Ie={}));var C;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(C||(C={}));const EPe=new Map([[Ie.A,C.A],[Ie.ADDRESS,C.ADDRESS],[Ie.ANNOTATION_XML,C.ANNOTATION_XML],[Ie.APPLET,C.APPLET],[Ie.AREA,C.AREA],[Ie.ARTICLE,C.ARTICLE],[Ie.ASIDE,C.ASIDE],[Ie.B,C.B],[Ie.BASE,C.BASE],[Ie.BASEFONT,C.BASEFONT],[Ie.BGSOUND,C.BGSOUND],[Ie.BIG,C.BIG],[Ie.BLOCKQUOTE,C.BLOCKQUOTE],[Ie.BODY,C.BODY],[Ie.BR,C.BR],[Ie.BUTTON,C.BUTTON],[Ie.CAPTION,C.CAPTION],[Ie.CENTER,C.CENTER],[Ie.CODE,C.CODE],[Ie.COL,C.COL],[Ie.COLGROUP,C.COLGROUP],[Ie.DD,C.DD],[Ie.DESC,C.DESC],[Ie.DETAILS,C.DETAILS],[Ie.DIALOG,C.DIALOG],[Ie.DIR,C.DIR],[Ie.DIV,C.DIV],[Ie.DL,C.DL],[Ie.DT,C.DT],[Ie.EM,C.EM],[Ie.EMBED,C.EMBED],[Ie.FIELDSET,C.FIELDSET],[Ie.FIGCAPTION,C.FIGCAPTION],[Ie.FIGURE,C.FIGURE],[Ie.FONT,C.FONT],[Ie.FOOTER,C.FOOTER],[Ie.FOREIGN_OBJECT,C.FOREIGN_OBJECT],[Ie.FORM,C.FORM],[Ie.FRAME,C.FRAME],[Ie.FRAMESET,C.FRAMESET],[Ie.H1,C.H1],[Ie.H2,C.H2],[Ie.H3,C.H3],[Ie.H4,C.H4],[Ie.H5,C.H5],[Ie.H6,C.H6],[Ie.HEAD,C.HEAD],[Ie.HEADER,C.HEADER],[Ie.HGROUP,C.HGROUP],[Ie.HR,C.HR],[Ie.HTML,C.HTML],[Ie.I,C.I],[Ie.IMG,C.IMG],[Ie.IMAGE,C.IMAGE],[Ie.INPUT,C.INPUT],[Ie.IFRAME,C.IFRAME],[Ie.KEYGEN,C.KEYGEN],[Ie.LABEL,C.LABEL],[Ie.LI,C.LI],[Ie.LINK,C.LINK],[Ie.LISTING,C.LISTING],[Ie.MAIN,C.MAIN],[Ie.MALIGNMARK,C.MALIGNMARK],[Ie.MARQUEE,C.MARQUEE],[Ie.MATH,C.MATH],[Ie.MENU,C.MENU],[Ie.META,C.META],[Ie.MGLYPH,C.MGLYPH],[Ie.MI,C.MI],[Ie.MO,C.MO],[Ie.MN,C.MN],[Ie.MS,C.MS],[Ie.MTEXT,C.MTEXT],[Ie.NAV,C.NAV],[Ie.NOBR,C.NOBR],[Ie.NOFRAMES,C.NOFRAMES],[Ie.NOEMBED,C.NOEMBED],[Ie.NOSCRIPT,C.NOSCRIPT],[Ie.OBJECT,C.OBJECT],[Ie.OL,C.OL],[Ie.OPTGROUP,C.OPTGROUP],[Ie.OPTION,C.OPTION],[Ie.P,C.P],[Ie.PARAM,C.PARAM],[Ie.PLAINTEXT,C.PLAINTEXT],[Ie.PRE,C.PRE],[Ie.RB,C.RB],[Ie.RP,C.RP],[Ie.RT,C.RT],[Ie.RTC,C.RTC],[Ie.RUBY,C.RUBY],[Ie.S,C.S],[Ie.SCRIPT,C.SCRIPT],[Ie.SEARCH,C.SEARCH],[Ie.SECTION,C.SECTION],[Ie.SELECT,C.SELECT],[Ie.SOURCE,C.SOURCE],[Ie.SMALL,C.SMALL],[Ie.SPAN,C.SPAN],[Ie.STRIKE,C.STRIKE],[Ie.STRONG,C.STRONG],[Ie.STYLE,C.STYLE],[Ie.SUB,C.SUB],[Ie.SUMMARY,C.SUMMARY],[Ie.SUP,C.SUP],[Ie.TABLE,C.TABLE],[Ie.TBODY,C.TBODY],[Ie.TEMPLATE,C.TEMPLATE],[Ie.TEXTAREA,C.TEXTAREA],[Ie.TFOOT,C.TFOOT],[Ie.TD,C.TD],[Ie.TH,C.TH],[Ie.THEAD,C.THEAD],[Ie.TITLE,C.TITLE],[Ie.TR,C.TR],[Ie.TRACK,C.TRACK],[Ie.TT,C.TT],[Ie.U,C.U],[Ie.UL,C.UL],[Ie.SVG,C.SVG],[Ie.VAR,C.VAR],[Ie.WBR,C.WBR],[Ie.XMP,C.XMP]]);function Px(t){var e;return(e=EPe.get(t))!==null&&e!==void 0?e:C.UNKNOWN}const st=C,SPe={[it.HTML]:new Set([st.ADDRESS,st.APPLET,st.AREA,st.ARTICLE,st.ASIDE,st.BASE,st.BASEFONT,st.BGSOUND,st.BLOCKQUOTE,st.BODY,st.BR,st.BUTTON,st.CAPTION,st.CENTER,st.COL,st.COLGROUP,st.DD,st.DETAILS,st.DIR,st.DIV,st.DL,st.DT,st.EMBED,st.FIELDSET,st.FIGCAPTION,st.FIGURE,st.FOOTER,st.FORM,st.FRAME,st.FRAMESET,st.H1,st.H2,st.H3,st.H4,st.H5,st.H6,st.HEAD,st.HEADER,st.HGROUP,st.HR,st.HTML,st.IFRAME,st.IMG,st.INPUT,st.LI,st.LINK,st.LISTING,st.MAIN,st.MARQUEE,st.MENU,st.META,st.NAV,st.NOEMBED,st.NOFRAMES,st.NOSCRIPT,st.OBJECT,st.OL,st.P,st.PARAM,st.PLAINTEXT,st.PRE,st.SCRIPT,st.SECTION,st.SELECT,st.SOURCE,st.STYLE,st.SUMMARY,st.TABLE,st.TBODY,st.TD,st.TEMPLATE,st.TEXTAREA,st.TFOOT,st.TH,st.THEAD,st.TITLE,st.TR,st.TRACK,st.UL,st.WBR,st.XMP]),[it.MATHML]:new Set([st.MI,st.MO,st.MN,st.MS,st.MTEXT,st.ANNOTATION_XML]),[it.SVG]:new Set([st.TITLE,st.FOREIGN_OBJECT,st.DESC]),[it.XLINK]:new Set,[it.XML]:new Set,[it.XMLNS]:new Set},TN=new Set([st.H1,st.H2,st.H3,st.H4,st.H5,st.H6]);Ie.STYLE,Ie.SCRIPT,Ie.XMP,Ie.IFRAME,Ie.NOEMBED,Ie.NOFRAMES,Ie.PLAINTEXT;var te;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(te||(te={}));const Za={DATA:te.DATA,RCDATA:te.RCDATA,RAWTEXT:te.RAWTEXT,SCRIPT_DATA:te.SCRIPT_DATA,PLAINTEXT:te.PLAINTEXT,CDATA_SECTION:te.CDATA_SECTION};function _Pe(t){return t>=Y.DIGIT_0&&t<=Y.DIGIT_9}function a0(t){return t>=Y.LATIN_CAPITAL_A&&t<=Y.LATIN_CAPITAL_Z}function APe(t){return t>=Y.LATIN_SMALL_A&&t<=Y.LATIN_SMALL_Z}function Yu(t){return APe(t)||a0(t)}function K8(t){return Yu(t)||_Pe(t)}function aS(t){return t+32}function RQ(t){return t===Y.SPACE||t===Y.LINE_FEED||t===Y.TABULATION||t===Y.FORM_FEED}function Z8(t){return RQ(t)||t===Y.SOLIDUS||t===Y.GREATER_THAN_SIGN}function TPe(t){return t===Y.NULL?He.nullCharacterReference:t>1114111?He.characterReferenceOutsideUnicodeRange:SQ(t)?He.surrogateCharacterReference:AQ(t)?He.noncharacterCharacterReference:_Q(t)||t===Y.CARRIAGE_RETURN?He.controlCharacterReference:null}class xPe{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=te.DATA,this.returnState=te.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new cPe(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new wQ(xQ,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(He.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(He.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=TPe(r);i&&this._err(i,1)}}:void 0)}_err(e,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n0&&this._err(He.endTagWithAttributes),e.selfClosing&&this._err(He.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case jn.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case jn.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case jn.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:jn.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=RQ(e)?jn.WHITESPACE_CHARACTER:e===Y.NULL?jn.NULL_CHARACTER:jn.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(jn.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=te.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Xl.Attribute:Xl.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===te.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===te.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===te.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case te.DATA:{this._stateData(e);break}case te.RCDATA:{this._stateRcdata(e);break}case te.RAWTEXT:{this._stateRawtext(e);break}case te.SCRIPT_DATA:{this._stateScriptData(e);break}case te.PLAINTEXT:{this._statePlaintext(e);break}case te.TAG_OPEN:{this._stateTagOpen(e);break}case te.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case te.TAG_NAME:{this._stateTagName(e);break}case te.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case te.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case te.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case te.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case te.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case te.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case te.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case te.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case te.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case te.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case te.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case te.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case te.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case te.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case te.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case te.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case te.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case te.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case te.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case te.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case te.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case te.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case te.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case te.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case te.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case te.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case te.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case te.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case te.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case te.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case te.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case te.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case te.BOGUS_COMMENT:{this._stateBogusComment(e);break}case te.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case te.COMMENT_START:{this._stateCommentStart(e);break}case te.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case te.COMMENT:{this._stateComment(e);break}case te.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case te.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case te.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case te.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case te.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case te.COMMENT_END:{this._stateCommentEnd(e);break}case te.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case te.DOCTYPE:{this._stateDoctype(e);break}case te.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case te.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case te.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case te.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case te.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case te.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case te.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case te.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case te.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case te.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case te.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case te.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case te.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case te.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case te.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case te.CDATA_SECTION:{this._stateCdataSection(e);break}case te.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case te.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case te.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case te.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case Y.LESS_THAN_SIGN:{this.state=te.TAG_OPEN;break}case Y.AMPERSAND:{this._startCharacterReference();break}case Y.NULL:{this._err(He.unexpectedNullCharacter),this._emitCodePoint(e);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case Y.AMPERSAND:{this._startCharacterReference();break}case Y.LESS_THAN_SIGN:{this.state=te.RCDATA_LESS_THAN_SIGN;break}case Y.NULL:{this._err(He.unexpectedNullCharacter),this._emitChars(Ir);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case Y.LESS_THAN_SIGN:{this.state=te.RAWTEXT_LESS_THAN_SIGN;break}case Y.NULL:{this._err(He.unexpectedNullCharacter),this._emitChars(Ir);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case Y.LESS_THAN_SIGN:{this.state=te.SCRIPT_DATA_LESS_THAN_SIGN;break}case Y.NULL:{this._err(He.unexpectedNullCharacter),this._emitChars(Ir);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case Y.NULL:{this._err(He.unexpectedNullCharacter),this._emitChars(Ir);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Yu(e))this._createStartTagToken(),this.state=te.TAG_NAME,this._stateTagName(e);else switch(e){case Y.EXCLAMATION_MARK:{this.state=te.MARKUP_DECLARATION_OPEN;break}case Y.SOLIDUS:{this.state=te.END_TAG_OPEN;break}case Y.QUESTION_MARK:{this._err(He.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=te.BOGUS_COMMENT,this._stateBogusComment(e);break}case Y.EOF:{this._err(He.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(He.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=te.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Yu(e))this._createEndTagToken(),this.state=te.TAG_NAME,this._stateTagName(e);else switch(e){case Y.GREATER_THAN_SIGN:{this._err(He.missingEndTagName),this.state=te.DATA;break}case Y.EOF:{this._err(He.eofBeforeTagName),this._emitChars("");break}case Y.NULL:{this._err(He.unexpectedNullCharacter),this.state=te.SCRIPT_DATA_ESCAPED,this._emitChars(Ir);break}case Y.EOF:{this._err(He.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=te.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===Y.SOLIDUS?this.state=te.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Yu(e)?(this._emitChars("<"),this.state=te.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=te.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Yu(e)?(this.state=te.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("");break}case Y.NULL:{this._err(He.unexpectedNullCharacter),this.state=te.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ir);break}case Y.EOF:{this._err(He.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=te.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===Y.SOLIDUS?(this.state=te.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=te.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Va.SCRIPT,!1)&&Z8(this.preprocessor.peek(Va.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const i=this._indexOf(e)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==it.HTML);this.shortenToLength(n<0?0:n)}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(MPe,it.HTML)}clearBackToTableBodyContext(){this.clearBackTo(IPe,it.HTML)}clearBackToTableRowContext(){this.clearBackTo(RPe,it.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===C.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===C.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case it.HTML:{if(i===e)return!0;if(n.has(i))return!1;break}case it.SVG:{if(e9.has(i))return!1;break}case it.MATHML:{if(J8.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,$A)}hasInListItemScope(e){return this.hasInDynamicScope(e,wPe)}hasInButtonScope(e){return this.hasInDynamicScope(e,CPe)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case it.HTML:{if(TN.has(n))return!0;if($A.has(n))return!1;break}case it.SVG:{if(e9.has(n))return!1;break}case it.MATHML:{if(J8.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===it.HTML)switch(this.tagIDs[n]){case e:return!0;case C.TABLE:case C.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===it.HTML)switch(this.tagIDs[e]){case C.TBODY:case C.THEAD:case C.TFOOT:return!0;case C.TABLE:case C.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===it.HTML)switch(this.tagIDs[n]){case e:return!0;case C.OPTION:case C.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;IQ.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;Q8.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==e&&Q8.has(this.currentTagId);)this.pop()}}const DR=3;var el;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(el||(el={}));const t9={type:el.Marker};class DPe{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],i=n.length,a=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e);for(let o=0;o[s.name,s.value]));let a=0;for(let s=0;si.get(l.name)===l.value)&&(a+=1,a>=DR&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(t9)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:el.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:el.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n>=0&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(t9);e>=0?this.entries.splice(0,e+1):this.entries.length=0}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===el.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===el.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===el.Element&&n.element===e)}}const qu={createDocument(){return{nodeName:"#document",mode:Xs.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const i=t.childNodes.find(a=>a.nodeName==="#documentType");if(i)i.name=e,i.publicId=n,i.systemId=r;else{const a={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};qu.appendChild(t,a)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(qu.isTextNode(n)){n.value+=e;return}}qu.appendChild(t,qu.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&qu.isTextNode(r)?r.value+=e:qu.insertBefore(t,qu.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;rt.startsWith(n))}function UPe(t){return t.name===MQ&&t.publicId===null&&(t.systemId===null||t.systemId===LPe)}function zPe(t){if(t.name!==MQ)return Xs.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===kPe)return Xs.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),BPe.has(n))return Xs.QUIRKS;let r=e===null?PPe:NQ;if(n9(n,r))return Xs.QUIRKS;if(r=e===null?OQ:FPe,n9(n,r))return Xs.LIMITED_QUIRKS}return Xs.NO_QUIRKS}const r9={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},HPe="definitionurl",GPe="definitionURL",VPe=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),$Pe=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:it.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:it.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:it.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:it.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:it.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:it.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:it.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:it.XML}],["xml:space",{prefix:"xml",name:"space",namespace:it.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:it.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:it.XMLNS}]]),WPe=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),jPe=new Set([C.B,C.BIG,C.BLOCKQUOTE,C.BODY,C.BR,C.CENTER,C.CODE,C.DD,C.DIV,C.DL,C.DT,C.EM,C.EMBED,C.H1,C.H2,C.H3,C.H4,C.H5,C.H6,C.HEAD,C.HR,C.I,C.IMG,C.LI,C.LISTING,C.MENU,C.META,C.NOBR,C.OL,C.P,C.PRE,C.RUBY,C.S,C.SMALL,C.SPAN,C.STRONG,C.STRIKE,C.SUB,C.SUP,C.TABLE,C.TT,C.U,C.UL,C.VAR]);function YPe(t){const e=t.tagID;return e===C.FONT&&t.attrs.some(({name:r})=>r===af.COLOR||r===af.SIZE||r===af.FACE)||jPe.has(e)}function DQ(t){for(let e=0;e0&&this._setContextModes(e,n)}onItemPop(e,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,e,this.openElements.current),n){let a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(e,n){const r=e===this.document||this.treeAdapter.getNamespaceURI(e)===it.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,it.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=ce.TEXT}switchToPlaintextParsing(){this.insertionMode=ce.TEXT,this.originalInsertionMode=ce.IN_BODY,this.tokenizer.state=Za.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Ie.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==it.HTML))switch(this.fragmentContextID){case C.TITLE:case C.TEXTAREA:{this.tokenizer.state=Za.RCDATA;break}case C.STYLE:case C.XMP:case C.IFRAME:case C.NOEMBED:case C.NOFRAMES:case C.NOSCRIPT:{this.tokenizer.state=Za.RAWTEXT;break}case C.SCRIPT:{this.tokenizer.state=Za.SCRIPT_DATA;break}case C.PLAINTEXT:{this.tokenizer.state=Za.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",i=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),e.location){const s=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));s&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,it.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,it.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(Ie.HTML,it.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,C.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const i=this.treeAdapter.getChildNodes(n),a=r?i.lastIndexOf(r):i.length,s=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:l,endCol:u,endOffset:c}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:l,endCol:u,endOffset:c})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(e),a=n.type===jn.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===C.SVG&&this.treeAdapter.getTagName(n)===Ie.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===it.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===C.MGLYPH||e.tagID===C.MALIGNMARK)&&!this._isIntegrationPoint(r,n,it.HTML)}_processToken(e){switch(e.type){case jn.CHARACTER:{this.onCharacter(e);break}case jn.NULL_CHARACTER:{this.onNullCharacter(e);break}case jn.COMMENT:{this.onComment(e);break}case jn.DOCTYPE:{this.onDoctype(e);break}case jn.START_TAG:{this._processStartTag(e);break}case jn.END_TAG:{this.onEndTag(e);break}case jn.EOF:{this.onEof(e);break}case jn.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const i=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return ZPe(e,i,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===el.Marker||this.openElements.contains(i.element)),r=n<0?e-1:n-1;for(let i=r;i>=0;i--){const a=this.activeFormattingElements.entries[i];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=ce.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(C.P),this.openElements.popUntilTagNamePopped(C.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case C.TR:{this.insertionMode=ce.IN_ROW;return}case C.TBODY:case C.THEAD:case C.TFOOT:{this.insertionMode=ce.IN_TABLE_BODY;return}case C.CAPTION:{this.insertionMode=ce.IN_CAPTION;return}case C.COLGROUP:{this.insertionMode=ce.IN_COLUMN_GROUP;return}case C.TABLE:{this.insertionMode=ce.IN_TABLE;return}case C.BODY:{this.insertionMode=ce.IN_BODY;return}case C.FRAMESET:{this.insertionMode=ce.IN_FRAMESET;return}case C.SELECT:{this._resetInsertionModeForSelect(e);return}case C.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case C.HTML:{this.insertionMode=this.headElement?ce.AFTER_HEAD:ce.BEFORE_HEAD;return}case C.TD:case C.TH:{if(e>0){this.insertionMode=ce.IN_CELL;return}break}case C.HEAD:{if(e>0){this.insertionMode=ce.IN_HEAD;return}break}}this.insertionMode=ce.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===C.TEMPLATE)break;if(r===C.TABLE){this.insertionMode=ce.IN_SELECT_IN_TABLE;return}}this.insertionMode=ce.IN_SELECT}_isElementCausesFosterParenting(e){return kQ.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case C.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===it.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case C.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return SPe[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){N3e(this,e);return}switch(this.insertionMode){case ce.INITIAL:{zg(this,e);break}case ce.BEFORE_HTML:{B0(this,e);break}case ce.BEFORE_HEAD:{F0(this,e);break}case ce.IN_HEAD:{U0(this,e);break}case ce.IN_HEAD_NO_SCRIPT:{z0(this,e);break}case ce.AFTER_HEAD:{H0(this,e);break}case ce.IN_BODY:case ce.IN_CAPTION:case ce.IN_CELL:case ce.IN_TEMPLATE:{FQ(this,e);break}case ce.TEXT:case ce.IN_SELECT:case ce.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case ce.IN_TABLE:case ce.IN_TABLE_BODY:case ce.IN_ROW:{LR(this,e);break}case ce.IN_TABLE_TEXT:{$Q(this,e);break}case ce.IN_COLUMN_GROUP:{WA(this,e);break}case ce.AFTER_BODY:{jA(this,e);break}case ce.AFTER_AFTER_BODY:{XS(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){M3e(this,e);return}switch(this.insertionMode){case ce.INITIAL:{zg(this,e);break}case ce.BEFORE_HTML:{B0(this,e);break}case ce.BEFORE_HEAD:{F0(this,e);break}case ce.IN_HEAD:{U0(this,e);break}case ce.IN_HEAD_NO_SCRIPT:{z0(this,e);break}case ce.AFTER_HEAD:{H0(this,e);break}case ce.TEXT:{this._insertCharacters(e);break}case ce.IN_TABLE:case ce.IN_TABLE_BODY:case ce.IN_ROW:{LR(this,e);break}case ce.IN_COLUMN_GROUP:{WA(this,e);break}case ce.AFTER_BODY:{jA(this,e);break}case ce.AFTER_AFTER_BODY:{XS(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){xN(this,e);return}switch(this.insertionMode){case ce.INITIAL:case ce.BEFORE_HTML:case ce.BEFORE_HEAD:case ce.IN_HEAD:case ce.IN_HEAD_NO_SCRIPT:case ce.AFTER_HEAD:case ce.IN_BODY:case ce.IN_TABLE:case ce.IN_CAPTION:case ce.IN_COLUMN_GROUP:case ce.IN_TABLE_BODY:case ce.IN_ROW:case ce.IN_CELL:case ce.IN_SELECT:case ce.IN_SELECT_IN_TABLE:case ce.IN_TEMPLATE:case ce.IN_FRAMESET:case ce.AFTER_FRAMESET:{xN(this,e);break}case ce.IN_TABLE_TEXT:{Hg(this,e);break}case ce.AFTER_BODY:{lBe(this,e);break}case ce.AFTER_AFTER_BODY:case ce.AFTER_AFTER_FRAMESET:{uBe(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case ce.INITIAL:{cBe(this,e);break}case ce.BEFORE_HEAD:case ce.IN_HEAD:case ce.IN_HEAD_NO_SCRIPT:case ce.AFTER_HEAD:{this._err(e,He.misplacedDoctype);break}case ce.IN_TABLE_TEXT:{Hg(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,He.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?O3e(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case ce.INITIAL:{zg(this,e);break}case ce.BEFORE_HTML:{dBe(this,e);break}case ce.BEFORE_HEAD:{pBe(this,e);break}case ce.IN_HEAD:{Bo(this,e);break}case ce.IN_HEAD_NO_SCRIPT:{gBe(this,e);break}case ce.AFTER_HEAD:{yBe(this,e);break}case ce.IN_BODY:{Ea(this,e);break}case ce.IN_TABLE:{sm(this,e);break}case ce.IN_TABLE_TEXT:{Hg(this,e);break}case ce.IN_CAPTION:{h3e(this,e);break}case ce.IN_COLUMN_GROUP:{AL(this,e);break}case ce.IN_TABLE_BODY:{Ux(this,e);break}case ce.IN_ROW:{zx(this,e);break}case ce.IN_CELL:{b3e(this,e);break}case ce.IN_SELECT:{YQ(this,e);break}case ce.IN_SELECT_IN_TABLE:{v3e(this,e);break}case ce.IN_TEMPLATE:{S3e(this,e);break}case ce.AFTER_BODY:{A3e(this,e);break}case ce.IN_FRAMESET:{T3e(this,e);break}case ce.AFTER_FRAMESET:{w3e(this,e);break}case ce.AFTER_AFTER_BODY:{R3e(this,e);break}case ce.AFTER_AFTER_FRAMESET:{I3e(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?D3e(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case ce.INITIAL:{zg(this,e);break}case ce.BEFORE_HTML:{fBe(this,e);break}case ce.BEFORE_HEAD:{hBe(this,e);break}case ce.IN_HEAD:{mBe(this,e);break}case ce.IN_HEAD_NO_SCRIPT:{bBe(this,e);break}case ce.AFTER_HEAD:{vBe(this,e);break}case ce.IN_BODY:{Fx(this,e);break}case ce.TEXT:{i3e(this,e);break}case ce.IN_TABLE:{Pb(this,e);break}case ce.IN_TABLE_TEXT:{Hg(this,e);break}case ce.IN_CAPTION:{m3e(this,e);break}case ce.IN_COLUMN_GROUP:{g3e(this,e);break}case ce.IN_TABLE_BODY:{wN(this,e);break}case ce.IN_ROW:{jQ(this,e);break}case ce.IN_CELL:{y3e(this,e);break}case ce.IN_SELECT:{qQ(this,e);break}case ce.IN_SELECT_IN_TABLE:{E3e(this,e);break}case ce.IN_TEMPLATE:{_3e(this,e);break}case ce.AFTER_BODY:{KQ(this,e);break}case ce.IN_FRAMESET:{x3e(this,e);break}case ce.AFTER_FRAMESET:{C3e(this,e);break}case ce.AFTER_AFTER_BODY:{XS(this,e);break}}}onEof(e){switch(this.insertionMode){case ce.INITIAL:{zg(this,e);break}case ce.BEFORE_HTML:{B0(this,e);break}case ce.BEFORE_HEAD:{F0(this,e);break}case ce.IN_HEAD:{U0(this,e);break}case ce.IN_HEAD_NO_SCRIPT:{z0(this,e);break}case ce.AFTER_HEAD:{H0(this,e);break}case ce.IN_BODY:case ce.IN_TABLE:case ce.IN_CAPTION:case ce.IN_COLUMN_GROUP:case ce.IN_TABLE_BODY:case ce.IN_ROW:case ce.IN_CELL:case ce.IN_SELECT:case ce.IN_SELECT_IN_TABLE:{GQ(this,e);break}case ce.TEXT:{a3e(this,e);break}case ce.IN_TABLE_TEXT:{Hg(this,e);break}case ce.IN_TEMPLATE:{XQ(this,e);break}case ce.AFTER_BODY:case ce.IN_FRAMESET:case ce.AFTER_FRAMESET:case ce.AFTER_AFTER_BODY:case ce.AFTER_AFTER_FRAMESET:{_L(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===Y.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case ce.IN_HEAD:case ce.IN_HEAD_NO_SCRIPT:case ce.AFTER_HEAD:case ce.TEXT:case ce.IN_COLUMN_GROUP:case ce.IN_SELECT:case ce.IN_SELECT_IN_TABLE:case ce.IN_FRAMESET:case ce.AFTER_FRAMESET:{this._insertCharacters(e);break}case ce.IN_BODY:case ce.IN_CAPTION:case ce.IN_CELL:case ce.IN_TEMPLATE:case ce.AFTER_BODY:case ce.AFTER_AFTER_BODY:case ce.AFTER_AFTER_FRAMESET:{BQ(this,e);break}case ce.IN_TABLE:case ce.IN_TABLE_BODY:case ce.IN_ROW:{LR(this,e);break}case ce.IN_TABLE_TEXT:{VQ(this,e);break}}}}function nBe(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):HQ(t,e),n}function rBe(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const i=t.openElements.items[r];if(i===e.element)break;t._isSpecialElement(i,t.openElements.tagIDs[r])&&(n=i)}return n||(t.openElements.shortenToLength(r<0?0:r),t.activeFormattingElements.removeEntry(e)),n}function iBe(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let a=0,s=i;s!==n;a++,s=i){i=t.openElements.getCommonAncestor(s);const o=t.activeFormattingElements.getElementEntry(s),l=o&&a>=eBe;!o||l?(l&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(s)):(s=aBe(t,o),r===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(s,r),r=s)}return r}function aBe(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function sBe(t,e,n){const r=t.treeAdapter.getTagName(e),i=Px(r);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);i===C.TEMPLATE&&a===it.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function oBe(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=t.treeAdapter.createElement(i.tagName,r,i.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,a,i.tagID)}function SL(t,e){for(let n=0;n=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],i=t.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const a=t.openElements.items[1],s=t.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&t._setEndLocation(a,e)}}}}function cBe(t,e){t._setDocumentType(e);const n=e.forceQuirks?Xs.QUIRKS:zPe(e);UPe(e)||t._err(e,He.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=ce.BEFORE_HTML}function zg(t,e){t._err(e,He.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Xs.QUIRKS),t.insertionMode=ce.BEFORE_HTML,t._processToken(e)}function dBe(t,e){e.tagID===C.HTML?(t._insertElement(e,it.HTML),t.insertionMode=ce.BEFORE_HEAD):B0(t,e)}function fBe(t,e){const n=e.tagID;(n===C.HTML||n===C.HEAD||n===C.BODY||n===C.BR)&&B0(t,e)}function B0(t,e){t._insertFakeRootElement(),t.insertionMode=ce.BEFORE_HEAD,t._processToken(e)}function pBe(t,e){switch(e.tagID){case C.HTML:{Ea(t,e);break}case C.HEAD:{t._insertElement(e,it.HTML),t.headElement=t.openElements.current,t.insertionMode=ce.IN_HEAD;break}default:F0(t,e)}}function hBe(t,e){const n=e.tagID;n===C.HEAD||n===C.BODY||n===C.HTML||n===C.BR?F0(t,e):t._err(e,He.endTagWithoutMatchingOpenElement)}function F0(t,e){t._insertFakeElement(Ie.HEAD,C.HEAD),t.headElement=t.openElements.current,t.insertionMode=ce.IN_HEAD,t._processToken(e)}function Bo(t,e){switch(e.tagID){case C.HTML:{Ea(t,e);break}case C.BASE:case C.BASEFONT:case C.BGSOUND:case C.LINK:case C.META:{t._appendElement(e,it.HTML),e.ackSelfClosing=!0;break}case C.TITLE:{t._switchToTextParsing(e,Za.RCDATA);break}case C.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Za.RAWTEXT):(t._insertElement(e,it.HTML),t.insertionMode=ce.IN_HEAD_NO_SCRIPT);break}case C.NOFRAMES:case C.STYLE:{t._switchToTextParsing(e,Za.RAWTEXT);break}case C.SCRIPT:{t._switchToTextParsing(e,Za.SCRIPT_DATA);break}case C.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=ce.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(ce.IN_TEMPLATE);break}case C.HEAD:{t._err(e,He.misplacedStartTagForHeadElement);break}default:U0(t,e)}}function mBe(t,e){switch(e.tagID){case C.HEAD:{t.openElements.pop(),t.insertionMode=ce.AFTER_HEAD;break}case C.BODY:case C.BR:case C.HTML:{U0(t,e);break}case C.TEMPLATE:{Hf(t,e);break}default:t._err(e,He.endTagWithoutMatchingOpenElement)}}function Hf(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==C.TEMPLATE&&t._err(e,He.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(C.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,He.endTagWithoutMatchingOpenElement)}function U0(t,e){t.openElements.pop(),t.insertionMode=ce.AFTER_HEAD,t._processToken(e)}function gBe(t,e){switch(e.tagID){case C.HTML:{Ea(t,e);break}case C.BASEFONT:case C.BGSOUND:case C.HEAD:case C.LINK:case C.META:case C.NOFRAMES:case C.STYLE:{Bo(t,e);break}case C.NOSCRIPT:{t._err(e,He.nestedNoscriptInHead);break}default:z0(t,e)}}function bBe(t,e){switch(e.tagID){case C.NOSCRIPT:{t.openElements.pop(),t.insertionMode=ce.IN_HEAD;break}case C.BR:{z0(t,e);break}default:t._err(e,He.endTagWithoutMatchingOpenElement)}}function z0(t,e){const n=e.type===jn.EOF?He.openElementsLeftAfterEof:He.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=ce.IN_HEAD,t._processToken(e)}function yBe(t,e){switch(e.tagID){case C.HTML:{Ea(t,e);break}case C.BODY:{t._insertElement(e,it.HTML),t.framesetOk=!1,t.insertionMode=ce.IN_BODY;break}case C.FRAMESET:{t._insertElement(e,it.HTML),t.insertionMode=ce.IN_FRAMESET;break}case C.BASE:case C.BASEFONT:case C.BGSOUND:case C.LINK:case C.META:case C.NOFRAMES:case C.SCRIPT:case C.STYLE:case C.TEMPLATE:case C.TITLE:{t._err(e,He.abandonedHeadElementChild),t.openElements.push(t.headElement,C.HEAD),Bo(t,e),t.openElements.remove(t.headElement);break}case C.HEAD:{t._err(e,He.misplacedStartTagForHeadElement);break}default:H0(t,e)}}function vBe(t,e){switch(e.tagID){case C.BODY:case C.HTML:case C.BR:{H0(t,e);break}case C.TEMPLATE:{Hf(t,e);break}default:t._err(e,He.endTagWithoutMatchingOpenElement)}}function H0(t,e){t._insertFakeElement(Ie.BODY,C.BODY),t.insertionMode=ce.IN_BODY,Bx(t,e)}function Bx(t,e){switch(e.type){case jn.CHARACTER:{FQ(t,e);break}case jn.WHITESPACE_CHARACTER:{BQ(t,e);break}case jn.COMMENT:{xN(t,e);break}case jn.START_TAG:{Ea(t,e);break}case jn.END_TAG:{Fx(t,e);break}case jn.EOF:{GQ(t,e);break}}}function BQ(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function FQ(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function EBe(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function SBe(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function _Be(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,it.HTML),t.insertionMode=ce.IN_FRAMESET)}function ABe(t,e){t.openElements.hasInButtonScope(C.P)&&t._closePElement(),t._insertElement(e,it.HTML)}function TBe(t,e){t.openElements.hasInButtonScope(C.P)&&t._closePElement(),TN.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,it.HTML)}function xBe(t,e){t.openElements.hasInButtonScope(C.P)&&t._closePElement(),t._insertElement(e,it.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function wBe(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(C.P)&&t._closePElement(),t._insertElement(e,it.HTML),n||(t.formElement=t.openElements.current))}function CBe(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const i=t.openElements.tagIDs[r];if(n===C.LI&&i===C.LI||(n===C.DD||n===C.DT)&&(i===C.DD||i===C.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==C.ADDRESS&&i!==C.DIV&&i!==C.P&&t._isSpecialElement(t.openElements.items[r],i))break}t.openElements.hasInButtonScope(C.P)&&t._closePElement(),t._insertElement(e,it.HTML)}function RBe(t,e){t.openElements.hasInButtonScope(C.P)&&t._closePElement(),t._insertElement(e,it.HTML),t.tokenizer.state=Za.PLAINTEXT}function IBe(t,e){t.openElements.hasInScope(C.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(C.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,it.HTML),t.framesetOk=!1}function MBe(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(Ie.A);n&&(SL(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,it.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function NBe(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,it.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function OBe(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(C.NOBR)&&(SL(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,it.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function DBe(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,it.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function LBe(t,e){t.treeAdapter.getDocumentMode(t.document)!==Xs.QUIRKS&&t.openElements.hasInButtonScope(C.P)&&t._closePElement(),t._insertElement(e,it.HTML),t.framesetOk=!1,t.insertionMode=ce.IN_TABLE}function UQ(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,it.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function zQ(t){const e=TQ(t,af.TYPE);return e!=null&&e.toLowerCase()===QPe}function kBe(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,it.HTML),zQ(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function PBe(t,e){t._appendElement(e,it.HTML),e.ackSelfClosing=!0}function BBe(t,e){t.openElements.hasInButtonScope(C.P)&&t._closePElement(),t._appendElement(e,it.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function FBe(t,e){e.tagName=Ie.IMG,e.tagID=C.IMG,UQ(t,e)}function UBe(t,e){t._insertElement(e,it.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Za.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=ce.TEXT}function zBe(t,e){t.openElements.hasInButtonScope(C.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Za.RAWTEXT)}function HBe(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Za.RAWTEXT)}function a9(t,e){t._switchToTextParsing(e,Za.RAWTEXT)}function GBe(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,it.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===ce.IN_TABLE||t.insertionMode===ce.IN_CAPTION||t.insertionMode===ce.IN_TABLE_BODY||t.insertionMode===ce.IN_ROW||t.insertionMode===ce.IN_CELL?ce.IN_SELECT_IN_TABLE:ce.IN_SELECT}function VBe(t,e){t.openElements.currentTagId===C.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,it.HTML)}function $Be(t,e){t.openElements.hasInScope(C.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,it.HTML)}function WBe(t,e){t.openElements.hasInScope(C.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(C.RTC),t._insertElement(e,it.HTML)}function jBe(t,e){t._reconstructActiveFormattingElements(),DQ(e),EL(e),e.selfClosing?t._appendElement(e,it.MATHML):t._insertElement(e,it.MATHML),e.ackSelfClosing=!0}function YBe(t,e){t._reconstructActiveFormattingElements(),LQ(e),EL(e),e.selfClosing?t._appendElement(e,it.SVG):t._insertElement(e,it.SVG),e.ackSelfClosing=!0}function s9(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,it.HTML)}function Ea(t,e){switch(e.tagID){case C.I:case C.S:case C.B:case C.U:case C.EM:case C.TT:case C.BIG:case C.CODE:case C.FONT:case C.SMALL:case C.STRIKE:case C.STRONG:{NBe(t,e);break}case C.A:{MBe(t,e);break}case C.H1:case C.H2:case C.H3:case C.H4:case C.H5:case C.H6:{TBe(t,e);break}case C.P:case C.DL:case C.OL:case C.UL:case C.DIV:case C.DIR:case C.NAV:case C.MAIN:case C.MENU:case C.ASIDE:case C.CENTER:case C.FIGURE:case C.FOOTER:case C.HEADER:case C.HGROUP:case C.DIALOG:case C.DETAILS:case C.ADDRESS:case C.ARTICLE:case C.SEARCH:case C.SECTION:case C.SUMMARY:case C.FIELDSET:case C.BLOCKQUOTE:case C.FIGCAPTION:{ABe(t,e);break}case C.LI:case C.DD:case C.DT:{CBe(t,e);break}case C.BR:case C.IMG:case C.WBR:case C.AREA:case C.EMBED:case C.KEYGEN:{UQ(t,e);break}case C.HR:{BBe(t,e);break}case C.RB:case C.RTC:{$Be(t,e);break}case C.RT:case C.RP:{WBe(t,e);break}case C.PRE:case C.LISTING:{xBe(t,e);break}case C.XMP:{zBe(t,e);break}case C.SVG:{YBe(t,e);break}case C.HTML:{EBe(t,e);break}case C.BASE:case C.LINK:case C.META:case C.STYLE:case C.TITLE:case C.SCRIPT:case C.BGSOUND:case C.BASEFONT:case C.TEMPLATE:{Bo(t,e);break}case C.BODY:{SBe(t,e);break}case C.FORM:{wBe(t,e);break}case C.NOBR:{OBe(t,e);break}case C.MATH:{jBe(t,e);break}case C.TABLE:{LBe(t,e);break}case C.INPUT:{kBe(t,e);break}case C.PARAM:case C.TRACK:case C.SOURCE:{PBe(t,e);break}case C.IMAGE:{FBe(t,e);break}case C.BUTTON:{IBe(t,e);break}case C.APPLET:case C.OBJECT:case C.MARQUEE:{DBe(t,e);break}case C.IFRAME:{HBe(t,e);break}case C.SELECT:{GBe(t,e);break}case C.OPTION:case C.OPTGROUP:{VBe(t,e);break}case C.NOEMBED:case C.NOFRAMES:{a9(t,e);break}case C.FRAMESET:{_Be(t,e);break}case C.TEXTAREA:{UBe(t,e);break}case C.NOSCRIPT:{t.options.scriptingEnabled?a9(t,e):s9(t,e);break}case C.PLAINTEXT:{RBe(t,e);break}case C.COL:case C.TH:case C.TD:case C.TR:case C.HEAD:case C.FRAME:case C.TBODY:case C.TFOOT:case C.THEAD:case C.CAPTION:case C.COLGROUP:break;default:s9(t,e)}}function qBe(t,e){if(t.openElements.hasInScope(C.BODY)&&(t.insertionMode=ce.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function XBe(t,e){t.openElements.hasInScope(C.BODY)&&(t.insertionMode=ce.AFTER_BODY,KQ(t,e))}function KBe(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function ZBe(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(C.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(C.FORM):n&&t.openElements.remove(n))}function QBe(t){t.openElements.hasInButtonScope(C.P)||t._insertFakeElement(Ie.P,C.P),t._closePElement()}function JBe(t){t.openElements.hasInListItemScope(C.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(C.LI),t.openElements.popUntilTagNamePopped(C.LI))}function e3e(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function t3e(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function n3e(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function r3e(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(Ie.BR,C.BR),t.openElements.pop(),t.framesetOk=!1}function HQ(t,e){const n=e.tagName,r=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const a=t.openElements.items[i],s=t.openElements.tagIDs[i];if(r===s&&(r!==C.UNKNOWN||t.treeAdapter.getTagName(a)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(a,s))break}}function Fx(t,e){switch(e.tagID){case C.A:case C.B:case C.I:case C.S:case C.U:case C.EM:case C.TT:case C.BIG:case C.CODE:case C.FONT:case C.NOBR:case C.SMALL:case C.STRIKE:case C.STRONG:{SL(t,e);break}case C.P:{QBe(t);break}case C.DL:case C.UL:case C.OL:case C.DIR:case C.DIV:case C.NAV:case C.PRE:case C.MAIN:case C.MENU:case C.ASIDE:case C.BUTTON:case C.CENTER:case C.FIGURE:case C.FOOTER:case C.HEADER:case C.HGROUP:case C.DIALOG:case C.ADDRESS:case C.ARTICLE:case C.DETAILS:case C.SEARCH:case C.SECTION:case C.SUMMARY:case C.LISTING:case C.FIELDSET:case C.BLOCKQUOTE:case C.FIGCAPTION:{KBe(t,e);break}case C.LI:{JBe(t);break}case C.DD:case C.DT:{e3e(t,e);break}case C.H1:case C.H2:case C.H3:case C.H4:case C.H5:case C.H6:{t3e(t);break}case C.BR:{r3e(t);break}case C.BODY:{qBe(t,e);break}case C.HTML:{XBe(t,e);break}case C.FORM:{ZBe(t);break}case C.APPLET:case C.OBJECT:case C.MARQUEE:{n3e(t,e);break}case C.TEMPLATE:{Hf(t,e);break}default:HQ(t,e)}}function GQ(t,e){t.tmplInsertionModeStack.length>0?XQ(t,e):_L(t,e)}function i3e(t,e){var n;e.tagID===C.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function a3e(t,e){t._err(e,He.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function LR(t,e){if(kQ.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=ce.IN_TABLE_TEXT,e.type){case jn.CHARACTER:{$Q(t,e);break}case jn.WHITESPACE_CHARACTER:{VQ(t,e);break}}else xy(t,e)}function s3e(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,it.HTML),t.insertionMode=ce.IN_CAPTION}function o3e(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,it.HTML),t.insertionMode=ce.IN_COLUMN_GROUP}function l3e(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Ie.COLGROUP,C.COLGROUP),t.insertionMode=ce.IN_COLUMN_GROUP,AL(t,e)}function u3e(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,it.HTML),t.insertionMode=ce.IN_TABLE_BODY}function c3e(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Ie.TBODY,C.TBODY),t.insertionMode=ce.IN_TABLE_BODY,Ux(t,e)}function d3e(t,e){t.openElements.hasInTableScope(C.TABLE)&&(t.openElements.popUntilTagNamePopped(C.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function f3e(t,e){zQ(e)?t._appendElement(e,it.HTML):xy(t,e),e.ackSelfClosing=!0}function p3e(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,it.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function sm(t,e){switch(e.tagID){case C.TD:case C.TH:case C.TR:{c3e(t,e);break}case C.STYLE:case C.SCRIPT:case C.TEMPLATE:{Bo(t,e);break}case C.COL:{l3e(t,e);break}case C.FORM:{p3e(t,e);break}case C.TABLE:{d3e(t,e);break}case C.TBODY:case C.TFOOT:case C.THEAD:{u3e(t,e);break}case C.INPUT:{f3e(t,e);break}case C.CAPTION:{s3e(t,e);break}case C.COLGROUP:{o3e(t,e);break}default:xy(t,e)}}function Pb(t,e){switch(e.tagID){case C.TABLE:{t.openElements.hasInTableScope(C.TABLE)&&(t.openElements.popUntilTagNamePopped(C.TABLE),t._resetInsertionMode());break}case C.TEMPLATE:{Hf(t,e);break}case C.BODY:case C.CAPTION:case C.COL:case C.COLGROUP:case C.HTML:case C.TBODY:case C.TD:case C.TFOOT:case C.TH:case C.THEAD:case C.TR:break;default:xy(t,e)}}function xy(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Bx(t,e),t.fosterParentingEnabled=n}function VQ(t,e){t.pendingCharacterTokens.push(e)}function $Q(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function Hg(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n0&&t.openElements.currentTagId===C.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===C.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===C.OPTGROUP&&t.openElements.pop();break}case C.OPTION:{t.openElements.currentTagId===C.OPTION&&t.openElements.pop();break}case C.SELECT:{t.openElements.hasInSelectScope(C.SELECT)&&(t.openElements.popUntilTagNamePopped(C.SELECT),t._resetInsertionMode());break}case C.TEMPLATE:{Hf(t,e);break}}}function v3e(t,e){const n=e.tagID;n===C.CAPTION||n===C.TABLE||n===C.TBODY||n===C.TFOOT||n===C.THEAD||n===C.TR||n===C.TD||n===C.TH?(t.openElements.popUntilTagNamePopped(C.SELECT),t._resetInsertionMode(),t._processStartTag(e)):YQ(t,e)}function E3e(t,e){const n=e.tagID;n===C.CAPTION||n===C.TABLE||n===C.TBODY||n===C.TFOOT||n===C.THEAD||n===C.TR||n===C.TD||n===C.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(C.SELECT),t._resetInsertionMode(),t.onEndTag(e)):qQ(t,e)}function S3e(t,e){switch(e.tagID){case C.BASE:case C.BASEFONT:case C.BGSOUND:case C.LINK:case C.META:case C.NOFRAMES:case C.SCRIPT:case C.STYLE:case C.TEMPLATE:case C.TITLE:{Bo(t,e);break}case C.CAPTION:case C.COLGROUP:case C.TBODY:case C.TFOOT:case C.THEAD:{t.tmplInsertionModeStack[0]=ce.IN_TABLE,t.insertionMode=ce.IN_TABLE,sm(t,e);break}case C.COL:{t.tmplInsertionModeStack[0]=ce.IN_COLUMN_GROUP,t.insertionMode=ce.IN_COLUMN_GROUP,AL(t,e);break}case C.TR:{t.tmplInsertionModeStack[0]=ce.IN_TABLE_BODY,t.insertionMode=ce.IN_TABLE_BODY,Ux(t,e);break}case C.TD:case C.TH:{t.tmplInsertionModeStack[0]=ce.IN_ROW,t.insertionMode=ce.IN_ROW,zx(t,e);break}default:t.tmplInsertionModeStack[0]=ce.IN_BODY,t.insertionMode=ce.IN_BODY,Ea(t,e)}}function _3e(t,e){e.tagID===C.TEMPLATE&&Hf(t,e)}function XQ(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(C.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):_L(t,e)}function A3e(t,e){e.tagID===C.HTML?Ea(t,e):jA(t,e)}function KQ(t,e){var n;if(e.tagID===C.HTML){if(t.fragmentContext||(t.insertionMode=ce.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===C.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else jA(t,e)}function jA(t,e){t.insertionMode=ce.IN_BODY,Bx(t,e)}function T3e(t,e){switch(e.tagID){case C.HTML:{Ea(t,e);break}case C.FRAMESET:{t._insertElement(e,it.HTML);break}case C.FRAME:{t._appendElement(e,it.HTML),e.ackSelfClosing=!0;break}case C.NOFRAMES:{Bo(t,e);break}}}function x3e(t,e){e.tagID===C.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==C.FRAMESET&&(t.insertionMode=ce.AFTER_FRAMESET))}function w3e(t,e){switch(e.tagID){case C.HTML:{Ea(t,e);break}case C.NOFRAMES:{Bo(t,e);break}}}function C3e(t,e){e.tagID===C.HTML&&(t.insertionMode=ce.AFTER_AFTER_FRAMESET)}function R3e(t,e){e.tagID===C.HTML?Ea(t,e):XS(t,e)}function XS(t,e){t.insertionMode=ce.IN_BODY,Bx(t,e)}function I3e(t,e){switch(e.tagID){case C.HTML:{Ea(t,e);break}case C.NOFRAMES:{Bo(t,e);break}}}function M3e(t,e){e.chars=Ir,t._insertCharacters(e)}function N3e(t,e){t._insertCharacters(e),t.framesetOk=!1}function ZQ(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==it.HTML&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function O3e(t,e){if(YPe(e))ZQ(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===it.MATHML?DQ(e):r===it.SVG&&(qPe(e),LQ(e)),EL(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function D3e(t,e){if(e.tagID===C.P||e.tagID===C.BR){ZQ(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===it.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}Ie.AREA,Ie.BASE,Ie.BASEFONT,Ie.BGSOUND,Ie.BR,Ie.COL,Ie.EMBED,Ie.FRAME,Ie.HR,Ie.IMG,Ie.INPUT,Ie.KEYGEN,Ie.LINK,Ie.META,Ie.PARAM,Ie.SOURCE,Ie.TRACK,Ie.WBR;function L3e(t,e){return PQ.parse(t,e)}function k3e(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=PQ.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function P3e(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?o9(t.position):"start"in t||"end"in t?o9(t):"line"in t||"column"in t?CN(t):""}function CN(t){return l9(t&&t.line)+":"+l9(t&&t.column)}function o9(t){return CN(t&&t.start)+"-"+CN(t&&t.end)}function l9(t){return t&&typeof t=="number"?t:1}class Fa extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof e=="string"?i=e:!a.cause&&e&&(s=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?a.ruleId=r:(a.source=r.slice(0,l),a.ruleId=r.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){const l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=o?o.line:void 0,this.name=P3e(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}}Fa.prototype.file="";Fa.prototype.name="";Fa.prototype.reason="";Fa.prototype.message="";Fa.prototype.stack="";Fa.prototype.column=void 0;Fa.prototype.line=void 0;Fa.prototype.ancestors=void 0;Fa.prototype.cause=void 0;Fa.prototype.fatal=void 0;Fa.prototype.place=void 0;Fa.prototype.ruleId=void 0;Fa.prototype.source=void 0;const Ko={basename:B3e,dirname:F3e,extname:U3e,join:z3e,sep:"/"};function B3e(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');wy(t);let n=0,r=-1,i=t.length,a;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,o=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(t.codePointAt(i)===e.codePointAt(o--)?o<0&&(r=i):(o=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function F3e(t){if(wy(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function U3e(t){wy(t);let e=t.length,n=-1,r=0,i=-1,a=0,s;for(;e--;){const o=t.codePointAt(e);if(o===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),o===46?i<0?i=e:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function z3e(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function G3e(t,e){let n="",r=0,i=-1,a=0,s=-1,o,l;for(;++s<=t.length;){if(s2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return n}function wy(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const V3e={cwd:$3e};function $3e(){return"/"}function RN(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function W3e(t){if(typeof t=="string")t=new URL(t);else if(!RN(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return j3e(t)}function j3e(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n`",url:!1},abruptClosingOfEmptyComment:{reason:"Unexpected abruptly closed empty comment",description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:"Unexpected abruptly closed public identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:"Unexpected abruptly closed system identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:"Unexpected non-digit at start of numeric character reference",description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:"Unexpected CDATA section in HTML",description:"Unexpected `` in ``",description:"Unexpected text character `%c`. Only use text in `