@lucideproxy/svg 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @lucideproxy/svg might be problematic. Click here for more details.
- package/3xhqia.js +10 -0
- package/5ypec/3k2dyx.js +2 -0
- package/5ypec/qzatah.js +41 -0
- package/5ypec/zdmrcu.js +2 -0
- package/7cpa7/m20fhz.js +31 -0
- package/7cpa7/vpa1gg.wasm +0 -0
- package/assets/AccountPage-DgzsV3p_-eac502ad.js +1 -0
- package/assets/AccountPage-fg4fizGa-eac502ad.css +1 -0
- package/assets/AiPage-BYyoMN5L-eac502ad.css +1 -0
- package/assets/AiPage-C7vje5zO-eac502ad.js +1 -0
- package/assets/ChatPage-CgwrQNaj-eac502ad.js +1 -0
- package/assets/ChatPage-Hgs1zZvt-eac502ad.css +1 -0
- package/assets/DarkVeil-B3ov-j6T-eac502ad.js +1 -0
- package/assets/GamesPage-Btpg86D--eac502ad.css +1 -0
- package/assets/GamesPage-Cv8v7l5_-eac502ad.js +1 -0
- package/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/assets/SettingsModal-DLrzJ2lM-eac502ad.css +1 -0
- package/assets/SettingsPage-DKaqVxDa-eac502ad.js +1 -0
- package/assets/boot-DURONIBP-eac502ad.js +1 -0
- package/assets/emoji-BAJ2KL4a-eac502ad.js +3 -0
- package/assets/fingerprint-BEH1UDAC-eac502ad.js +1 -0
- package/assets/fingerprint-Y5nV5FVa-eac502ad.js +4 -0
- package/assets/index-C2iBobdE-eac502ad.css +1 -0
- package/assets/index-_E4fBqHJ-eac502ad.js +1 -0
- package/assets/livekit-DqpdvE-G-eac502ad.js +39 -0
- package/assets/markdown-dIRGbAJA-eac502ad.css +1 -0
- package/assets/markdown-rngvaYIh-eac502ad.js +291 -0
- package/assets/motion-ClYBgd9J-eac502ad.js +9 -0
- package/assets/ogl-BWe_HKY6-eac502ad.js +1 -0
- package/assets/proxy-runtime-1NyFshf9-eac502ad.js +13 -0
- package/assets/react-CKawGOZZ-eac502ad.js +49 -0
- package/branding/lucide.png +0 -0
- package/favicon.svg +8 -0
- package/index.html +26 -0
- package/index.svg +33 -0
- package/logo.svg +33 -0
- package/package.json +17 -0
- package/privacy.html +118 -0
- package/terms.html +97 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{r as w,j as z}from"./react-CKawGOZZ-eac502ad.js";const hn=w.createContext({});function yt(t){const e=w.useRef(null);return e.current===null&&(e.current=t()),e.current}const Xo=typeof window<"u",me=Xo?w.useLayoutEffect:w.useEffect,ge=w.createContext(null);function fn(t,e){t.indexOf(e)===-1&&t.push(e)}function oe(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function _o([...t],e,n){const s=e<0?t.length+e:e;if(s>=0&&s<t.length){const i=n<0?t.length+n:n,[r]=t.splice(e,1);t.splice(i,0,r)}return t}const tt=(t,e,n)=>n>e?e:n<t?t:n;let dn=()=>{};const at={},si=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ii=t=>typeof t=="object"&&t!==null,oi=t=>/^0[^.\s]+$/u.test(t);function ri(t){let e;return()=>(e===void 0&&(e=t()),e)}const G=t=>t,Ut=(...t)=>t.reduce((e,n)=>s=>n(e(s))),Ot=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class pn{constructor(){this.subscriptions=[]}add(e){return fn(this.subscriptions,e),()=>oe(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const U=t=>t*1e3,$=t=>t/1e3,ai=(t,e)=>e?t*(1e3/e):0,li=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Yo=1e-7,qo=12;function Zo(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=li(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Yo&&++a<qo);return o}function Kt(t,e,n,s){if(t===e&&n===s)return G;const i=r=>Zo(r,0,1,t,n);return r=>r===0||r===1?r:li(i(r),e,s)}const ci=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ui=t=>e=>1-t(1-e),hi=Kt(.33,1.53,.69,.99),mn=ui(hi),fi=ci(mn),di=t=>t>=1?1:(t*=2)<1?.5*mn(t):.5*(2-Math.pow(2,-10*(t-1))),gn=t=>1-Math.sin(Math.acos(t)),pi=ui(gn),mi=ci(gn),Jo=Kt(.42,0,1,1),Qo=Kt(0,0,.58,1),gi=Kt(.42,0,.58,1),tr=t=>Array.isArray(t)&&typeof t[0]!="number",yi=t=>Array.isArray(t)&&typeof t[0]=="number",er={linear:G,easeIn:Jo,easeInOut:gi,easeOut:Qo,circIn:gn,circInOut:mi,circOut:pi,backIn:mn,backInOut:fi,backOut:hi,anticipate:di},nr=t=>typeof t=="string",jn=t=>{if(yi(t)){dn(t.length===4);const[e,n,s,i]=t;return Kt(e,n,s,i)}else if(nr(t))return er[t];return t},Gt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function sr(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(c){r.has(c)&&(l.schedule(c),t()),c(o)}const l={schedule:(c,u=!1,h=!1)=>{const d=h&&s?e:n;return u&&r.add(c),d.add(c),c},cancel:c=>{n.delete(c),r.delete(c)},process:c=>{if(o=c,s){i=!0;return}s=!0;const u=e;e=n,n=u,e.forEach(a),e.clear(),s=!1,i&&(i=!1,l.process(c))}};return l}const ir=40;function vi(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Gt.reduce((v,T)=>(v[T]=sr(r),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:f,render:d,postRender:p}=o,y=()=>{const v=at.useManualTiming,T=v?i.timestamp:performance.now();n=!1,v||(i.delta=s?1e3/60:Math.max(Math.min(T-i.timestamp,ir),1)),i.timestamp=T,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(y))},m=()=>{n=!0,s=!0,i.isProcessing||t(y)};return{schedule:Gt.reduce((v,T)=>{const b=o[T];return v[T]=(M,V=!1,P=!1)=>(n||m(),b.schedule(M,V,P)),v},{}),cancel:v=>{for(let T=0;T<Gt.length;T++)o[Gt[T]].cancel(v)},state:i,steps:o}}const{schedule:E,cancel:it,state:j,steps:Se}=vi(typeof requestAnimationFrame<"u"?requestAnimationFrame:G,!0);let Zt;function or(){Zt=void 0}const N={now:()=>(Zt===void 0&&N.set(j.isProcessing||at.useManualTiming?j.timestamp:performance.now()),Zt),set:t=>{Zt=t,queueMicrotask(or)}},xi=t=>e=>typeof e=="string"&&e.startsWith(t),Ti=xi("--"),rr=xi("var(--"),yn=t=>rr(t)?ar.test(t.split("/*")[0].trim()):!1,ar=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Nn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const bt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},jt={...bt,transform:t=>tt(0,1,t)},Ht={...bt,default:1},Et=t=>Math.round(t*1e5)/1e5,vn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function lr(t){return t==null}const cr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xn=(t,e)=>n=>!!(typeof n=="string"&&cr.test(n)&&n.startsWith(t)||e&&!lr(n)&&Object.prototype.hasOwnProperty.call(n,e)),wi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(vn);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ur=t=>tt(0,255,t),Pe={...bt,transform:t=>Math.round(ur(t))},ft={test:xn("rgb","red"),parse:wi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Pe.transform(t)+", "+Pe.transform(e)+", "+Pe.transform(n)+", "+Et(jt.transform(s))+")"};function hr(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const je={test:xn("#"),parse:hr,transform:ft.transform},$t=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),st=$t("deg"),Q=$t("%"),S=$t("px"),fr=$t("vh"),dr=$t("vw"),Wn={...Q,parse:t=>Q.parse(t)/100,transform:t=>Q.transform(t*100)},Tt={test:xn("hsl","hue"),parse:wi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Q.transform(Et(e))+", "+Q.transform(Et(n))+", "+Et(jt.transform(s))+")"},k={test:t=>ft.test(t)||je.test(t)||Tt.test(t),parse:t=>ft.test(t)?ft.parse(t):Tt.test(t)?Tt.parse(t):je.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ft.transform(t):Tt.transform(t),getAnimatableNone:t=>{const e=k.parse(t);return e.alpha=0,k.transform(e)}},pr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function mr(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(vn))==null?void 0:e.length)||0)+(((n=t.match(pr))==null?void 0:n.length)||0)>0}const Si="number",Pi="color",gr="var",yr="var(",Un="${}",vr=/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 Pt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(vr,l=>(k.test(l)?(s.color.push(r),i.push(Pi),n.push(k.parse(l))):l.startsWith(yr)?(s.var.push(r),i.push(gr),n.push(l)):(s.number.push(r),i.push(Si),n.push(parseFloat(l))),++r,Un)).split(Un);return{values:n,split:a,indexes:s,types:i}}function xr(t){return Pt(t).values}function bi({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],s[r]!==void 0){const o=e[r];o===Si?i+=Et(s[r]):o===Pi?i+=k.transform(s[r]):i+=s[r]}return i}}function Tr(t){return bi(Pt(t))}const wr=t=>typeof t=="number"?0:k.test(t)?k.getAnimatableNone(t):t,Sr=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:wr(t);function Pr(t){const e=Pt(t);return bi(e)(e.values.map((s,i)=>Sr(s,e.split[i])))}const _={test:mr,parse:xr,createTransformer:Tr,getAnimatableNone:Pr};function be(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 br({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=be(l,a,t+1/3),r=be(l,a,t),o=be(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function re(t,e){return n=>n>0?e:t}const D=(t,e,n)=>t+(e-t)*n,Ae=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Ar=[je,ft,Tt],Vr=t=>Ar.find(e=>e.test(t));function Kn(t){const e=Vr(t);if(!e)return!1;let n=e.parse(t);return e===Tt&&(n=br(n)),n}const $n=(t,e)=>{const n=Kn(t),s=Kn(e);if(!n||!s)return re(t,e);const i={...n};return r=>(i.red=Ae(n.red,s.red,r),i.green=Ae(n.green,s.green,r),i.blue=Ae(n.blue,s.blue,r),i.alpha=D(n.alpha,s.alpha,r),ft.transform(i))},Ne=new Set(["none","hidden"]);function Cr(t,e){return Ne.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Mr(t,e){return n=>D(t,e,n)}function Tn(t){return typeof t=="number"?Mr:typeof t=="string"?yn(t)?re:k.test(t)?$n:Rr:Array.isArray(t)?Ai:typeof t=="object"?k.test(t)?$n:Dr:re}function Ai(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>Tn(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function Dr(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Tn(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Er(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const Rr=(t,e)=>{const n=_.createTransformer(e),s=Pt(t),i=Pt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Ne.has(t)&&!i.values.length||Ne.has(e)&&!s.values.length?Cr(t,e):Ut(Ai(Er(s,i),i.values),n):re(t,e)};function Vi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?D(t,e,n):Tn(t)(t,e)}const Lr=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>E.update(e,n),stop:()=>it(e),now:()=>j.isProcessing?j.timestamp:N.now()}},Ci=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},ae=2e4;function wn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<ae;)e+=n,s=t.next(e);return e>=ae?1/0:e}function kr(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(wn(s),ae);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:$(i)}}const L={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function We(t,e){return t*Math.sqrt(1-e*e)}const Ir=12;function Br(t,e,n){let s=n;for(let i=1;i<Ir;i++)s=s-t(s)/e(s);return s}const Ve=.001;function Fr({duration:t=L.duration,bounce:e=L.bounce,velocity:n=L.velocity,mass:s=L.mass}){let i,r,o=1-e;o=tt(L.minDamping,L.maxDamping,o),t=tt(L.minDuration,L.maxDuration,$(t)),o<1?(i=c=>{const u=c*o,h=u*t,f=u-n,d=We(c,o),p=Math.exp(-h);return Ve-f/d*p},r=c=>{const h=c*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(c,2)*t,p=Math.exp(-h),y=We(Math.pow(c,2),o);return(-i(c)+Ve>0?-1:1)*((f-d)*p)/y}):(i=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-Ve+u*h},r=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const a=5/t,l=Br(i,r,a);if(t=U(t),isNaN(l))return{stiffness:L.stiffness,damping:L.damping,duration:t};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:o*2*Math.sqrt(s*c),duration:t}}}const Or=["duration","bounce"],jr=["stiffness","damping","mass"];function zn(t,e){return e.some(n=>t[n]!==void 0)}function Nr(t){let e={velocity:L.velocity,stiffness:L.stiffness,damping:L.damping,mass:L.mass,isResolvedFromDuration:!1,...t};if(!zn(t,jr)&&zn(t,Or))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*tt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:L.mass,stiffness:i,damping:r}}else{const n=Fr({...t,velocity:0});e={...e,...n,mass:L.mass},e.isResolvedFromDuration=!0}return e}function le(t=L.visualDuration,e=L.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:f,isResolvedFromDuration:d}=Nr({...n,velocity:-$(n.velocity||0)}),p=f||0,y=c/(2*Math.sqrt(l*u)),m=o-r,g=$(Math.sqrt(l/u)),x=Math.abs(m)<5;s||(s=x?L.restSpeed.granular:L.restSpeed.default),i||(i=x?L.restDelta.granular:L.restDelta.default);let v,T,b,M,V,P;if(y<1)b=We(g,y),M=(p+y*g*m)/b,v=A=>{const R=Math.exp(-y*g*A);return o-R*(M*Math.sin(b*A)+m*Math.cos(b*A))},V=y*g*M+m*b,P=y*g*m-M*b,T=A=>Math.exp(-y*g*A)*(V*Math.sin(b*A)+P*Math.cos(b*A));else if(y===1){v=R=>o-Math.exp(-g*R)*(m+(p+g*m)*R);const A=p+g*m;T=R=>Math.exp(-g*R)*(g*A*R-p)}else{const A=g*Math.sqrt(y*y-1);v=Y=>{const nt=Math.exp(-y*g*Y),q=Math.min(A*Y,300);return o-nt*((p+y*g*m)*Math.sinh(q)+A*m*Math.cosh(q))/A};const R=(p+y*g*m)/A,F=y*g*R-m*A,et=y*g*m-R*A;T=Y=>{const nt=Math.exp(-y*g*Y),q=Math.min(A*Y,300);return nt*(F*Math.sinh(q)+et*Math.cosh(q))}}const C={calculatedDuration:d&&h||null,velocity:A=>U(T(A)),next:A=>{if(!d&&y<1){const F=Math.exp(-y*g*A),et=Math.sin(b*A),Y=Math.cos(b*A),nt=o-F*(M*et+m*Y),q=U(F*(V*et+P*Y));return a.done=Math.abs(q)<=s&&Math.abs(o-nt)<=i,a.value=a.done?o:nt,a}const R=v(A);if(d)a.done=A>=h;else{const F=U(T(A));a.done=Math.abs(F)<=s&&Math.abs(o-R)<=i}return a.value=a.done?o:R,a},toString:()=>{const A=Math.min(wn(C),ae),R=Ci(F=>C.next(A*F).value,A,30);return A+"ms "+R},toTransition:()=>{}};return C}le.applyToOptions=t=>{const e=kr(t,100,le);return t.ease=e.ease,t.duration=U(e.duration),t.type="keyframes",t};const Wr=5;function Mi(t,e,n){const s=Math.max(e-Wr,0);return ai(n-t(s),e-s)}function Ue({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],f={done:!1,value:h},d=P=>a!==void 0&&P<a||l!==void 0&&P>l,p=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let y=n*e;const m=h+y,g=o===void 0?m:o(m);g!==m&&(y=g-h);const x=P=>-y*Math.exp(-P/s),v=P=>g+x(P),T=P=>{const C=x(P),A=v(P);f.done=Math.abs(C)<=c,f.value=f.done?g:A};let b,M;const V=P=>{d(f.value)&&(b=P,M=le({keyframes:[f.value,p(f.value)],velocity:Mi(v,P,f.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return V(0),{calculatedDuration:null,next:P=>{let C=!1;return!M&&b===void 0&&(C=!0,T(P),V(P)),b!==void 0&&P>=b?M.next(P-b):(!C&&T(P),f)}}}function Ur(t,e,n){const s=[],i=n||at.mix||Vi,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||G:e;a=Ut(l,a)}s.push(a)}return s}function Di(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(dn(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Ur(e,s,i),l=a.length,c=u=>{if(o&&u<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const f=Ot(t[h],t[h+1],u);return a[h](f)};return n?u=>c(tt(t[0],t[r-1],u)):c}function Kr(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ot(0,e,s);t.push(D(n,1,i))}}function $r(t){const e=[0];return Kr(e,t.length-1),e}function zr(t,e){return t.map(n=>n*e)}function Gr(t,e){return t.map(()=>e||gi).splice(0,t.length-1)}function Rt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=tr(s)?s.map(jn):jn(s),r={done:!1,value:e[0]},o=zr(n&&n.length===e.length?n:$r(e),t),a=Di(o,e,{ease:Array.isArray(i)?i:Gr(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const Hr=t=>t!==null;function ye(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Hr),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Xr={decay:Ue,inertia:Ue,tween:Rt,keyframes:Rt,spring:le};function Ei(t){typeof t.type=="string"&&(t.type=Xr[t.type])}class Sn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const _r=t=>t/100;class ce extends Sn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==N.now()&&this.tick(N.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Ei(e);const{type:n=Rt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const l=n||Rt;l!==Rt&&typeof a[0]!="number"&&(this.mixKeyframes=Ut(_r,Vi(a[0],a[1])),a=[0,100]);const c=l({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=wn(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:y,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,T=s;if(h){const P=Math.min(this.currentTime,i)/a;let C=Math.floor(P),A=P%1;!A&&P>=1&&(A=1),A===1&&C--,C=Math.min(C,h+1),!!(C%2)&&(f==="reverse"?(A=1-A,d&&(A-=d/a)):f==="mirror"&&(T=o)),v=tt(0,1,A)*a}let b;x?(this.delayState.value=u[0],b=this.delayState):b=T.next(v),r&&!x&&(b.value=r(b.value));let{done:M}=b;!x&&l!==null&&(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return V&&p!==Ue&&(b.value=ye(u,this.options,m,this.speed)),y&&y(b.value),V&&this.finish(),b}then(e,n){return this.finished.then(e,n)}get duration(){return $(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+$(e)}get time(){return $(this.currentTime)}set time(e){e=U(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Mi(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(N.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=$(this.currentTime))}play(){var i,r;if(this.isStopped)return;const{driver:e=Lr,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(r=(i=this.options).onPlay)==null||r.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(N.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Yr(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const dt=t=>t*180/Math.PI,Ke=t=>{const e=dt(Math.atan2(t[1],t[0]));return $e(e)},qr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ke,rotateZ:Ke,skewX:t=>dt(Math.atan(t[1])),skewY:t=>dt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},$e=t=>(t=t%360,t<0&&(t+=360),t),Gn=Ke,Hn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Xn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Zr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Hn,scaleY:Xn,scale:t=>(Hn(t)+Xn(t))/2,rotateX:t=>$e(dt(Math.atan2(t[6],t[5]))),rotateY:t=>$e(dt(Math.atan2(-t[2],t[0]))),rotateZ:Gn,rotate:Gn,skewX:t=>dt(Math.atan(t[4])),skewY:t=>dt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ze(t){return t.includes("scale")?1:0}function Ge(t,e){if(!t||t==="none")return ze(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Zr,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=qr,i=a}if(!i)return ze(e);const r=s[e],o=i[1].split(",").map(Qr);return typeof r=="function"?r(o):o[r]}const Jr=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ge(n,e)};function Qr(t){return parseFloat(t.trim())}const At=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vt=new Set([...At,"pathRotation"]),_n=t=>t===bt||t===S,ta=new Set(["x","y","z"]),ea=At.filter(t=>!ta.has(t));function na(t){const e=[];return ea.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const rt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-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:(t,{transform:e})=>Ge(e,"x"),y:(t,{transform:e})=>Ge(e,"y")};rt.translateX=rt.x;rt.translateY=rt.y;const pt=new Set;let He=!1,Xe=!1,_e=!1;function Ri(){if(Xe){const t=Array.from(pt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=na(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))==null||a.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Xe=!1,He=!1,pt.forEach(t=>t.complete(_e)),pt.clear()}function Li(){pt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Xe=!0)})}function sa(){_e=!0,Li(),Ri(),_e=!1}class Pn{constructor(e,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(pt.add(this),He||(He=!0,E.read(Li),E.resolveKeyframes(Ri))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i==null?void 0:i.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}Yr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),pt.delete(this)}cancel(){this.state==="scheduled"&&(pt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ia=t=>t.startsWith("--");function ki(t,e,n){ia(e)?t.style.setProperty(e,n):t.style[e]=n}const oa={};function Ii(t,e){const n=ri(t);return()=>oa[e]??n()}const ra=Ii(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Bi=Ii(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Mt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Yn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mt([0,.65,.55,1]),circOut:Mt([.55,0,1,.45]),backIn:Mt([.31,.01,.66,-.59]),backOut:Mt([.33,1.53,.69,.99])};function Fi(t,e){if(t)return typeof t=="function"?Bi()?Ci(t,e):"ease-out":yi(t)?Mt(t):Array.isArray(t)?t.map(n=>Fi(n,e)||Yn.easeOut):Yn[t]}function aa(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Fi(a,i);Array.isArray(h)&&(u.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(u,f)}function Oi(t){return typeof t=="function"&&"applyToOptions"in t}function la({type:t,...e}){return Oi(t)&&Bi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class ji extends Sn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,dn(typeof e.type!="string");const c=la(e);this.animation=aa(n,s,i,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=ye(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),ki(n,s,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,s,i;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(s=this.animation).commitStyles)==null||i.call(s))}get duration(){var n,s;const e=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return $(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+$(e)}get time(){return $(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=U(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&ra()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),G):i(this)}}const Ni={anticipate:di,backInOut:fi,circInOut:mi};function ca(t){return t in Ni}function ua(t){typeof t.ease=="string"&&ca(t.ease)&&(t.ease=Ni[t.ease])}const Ce=10;class ha extends ji{constructor(e){ua(e),Ei(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new ce({...o,autoplay:!1}),l=Math.max(Ce,N.now()-this.startTime),c=tt(0,Ce,l-Ce),u=a.sample(l).value,{name:h}=this.options;r&&h&&ki(r,h,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const qn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(_.test(t)||t==="0")&&!t.startsWith("url("));function fa(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function da(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=qn(i,e),a=qn(r,e);return!o||!a?!1:fa(t)||(n==="spring"||Oi(n))&&s}function Ye(t){t.duration=0,t.type="keyframes"}const Wi=new Set(["opacity","clipPath","filter","transform"]),pa=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ma(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&pa.test(t[e]))return!0;return!1}const ga=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),ya=ri(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function va(t){var h;const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o,keyframes:a}=t;if(!(((h=e==null?void 0:e.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return ya()&&n&&(Wi.has(n)||ga.has(n)&&ma(a))&&(n!=="transform"||!u)&&!c&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const xa=40;class Ta extends Sn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...h}){var p;super(),this.stop=()=>{var y,m;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(m=this.keyframeResolver)==null||m.cancel()},this.createdAt=N.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:l,motionValue:c,element:u,...h},d=(u==null?void 0:u.KeyframeResolver)||Pn;this.keyframeResolver=new d(a,(y,m,g)=>this.onKeyframesResolved(y,m,f,!g),l,c,u),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(e,n,s,i){var g,x;this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=s;this.resolvedAt=N.now();let h=!0;da(e,r,o,a)||(h=!1,(at.instantAnimations||!l)&&(u==null||u(ye(e,s,n))),e[0]=e[e.length-1],Ye(s),s.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>xa?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},p=h&&!c&&va(d),y=(x=(g=d.motionValue)==null?void 0:g.owner)==null?void 0:x.current;let m;if(p)try{m=new ha({...d,element:y})}catch{m=new ce(d)}else m=new ce(d);m.finished.then(()=>{this.notifyFinished()}).catch(G),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),sa()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function Ui(t,e,n,s=0,i=1){const r=Array.from(t).sort((c,u)=>c.sortNodePosition(u)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const Zn=30,wa=t=>!isNaN(parseFloat(t)),Lt={current:void 0};class Sa{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var r;const i=N.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((r=this.events.change)==null||r.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=N.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wa(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 pn);const s=this.events[e].add(n);return e==="change"?()=>{s(),E.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Lt.current&&Lt.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=N.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Zn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Zn);return ai(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(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function gt(t,e){return new Sa(t,e)}function Ki(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function bn(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Ki(n,t):n}const Pa={type:"spring",stiffness:500,damping:25,restSpeed:10},ba=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Aa={type:"keyframes",duration:.8},Va={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ca=(t,{keyframes:e})=>e.length>2?Aa:Vt.has(t)?t.startsWith("scale")?ba(e[1]):Pa:Va,Ma=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Da(t){for(const e in t)if(!Ma.has(e))return!0;return!1}const An=(t,e,n,s={},i,r)=>o=>{const a=bn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-U(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};Da(a)||Object.assign(u,Ca(t,u)),u.duration&&(u.duration=U(u.duration)),u.repeatDelay&&(u.repeatDelay=U(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Ye(u),u.delay===0&&(h=!0)),(at.instantAnimations||at.skipAnimations||i!=null&&i.shouldSkipAnimations||a.skipAnimations)&&(h=!0,Ye(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=ye(u.keyframes,a);if(f!==void 0){E.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new ce(u):new Ta(u)},Ea=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ra(t){const e=Ea.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function $i(t,e,n=1){const[s,i]=Ra(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return si(o)?parseFloat(o):o}return yn(i)?$i(i,e,n+1):i}function Jn(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Vn(t,e,n,s){if(typeof e=="function"){const[i,r]=Jn(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=Jn(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function mt(t,e,n){const s=t.getProps();return Vn(s,e,n!==void 0?n:s.custom,t)}const zi=new Set(["width","height","top","left","right","bottom",...At]),qe=t=>Array.isArray(t);function La(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,gt(n))}function ka(t){return qe(t)?t[t.length-1]||0:t}function Ia(t,e){const n=mt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=ka(r[o]);La(t,o,a)}}const B=t=>!!(t&&t.getVelocity);function Ba(t){return!!(B(t)&&t.add)}function Ze(t,e){const n=t.getValue("willChange");if(Ba(n))return n.add(e);if(!n&&at.WillChange){const s=new at.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function Cn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Fa="framerAppearId",Gi="data-"+Cn(Fa);function Hi(t){return t.props[Gi]}function Oa({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Xi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const l=t.getDefaultTransition();r=r?Ki(r,l):l;const c=r==null?void 0:r.reduceMotion,u=r==null?void 0:r.skipAnimations;s&&(r=s);const h=[],f=i&&t.animationState&&t.animationState.getState()[i],d=r==null?void 0:r.path;d&&d.animateVisualElement(t,a,r,n,h);for(const p in a){const y=t.getValue(p,t.latestValues[p]??null),m=a[p];if(m===void 0||f&&Oa(f,p))continue;const g={delay:n,...bn(r||{},p)};u&&(g.skipAnimations=!0);const x=y.get();if(x!==void 0&&!y.isAnimating()&&!Array.isArray(m)&&m===x&&!g.velocity){E.update(()=>y.set(m));continue}let v=!1;if(window.MotionHandoffAnimation){const M=Hi(t);if(M){const V=window.MotionHandoffAnimation(M,p,E);V!==null&&(g.startTime=V,v=!0)}}Ze(t,p);const T=c??t.shouldReduceMotion;y.start(An(p,y,m,T&&zi.has(p)?{type:!1}:g,t,v));const b=y.animation;b&&h.push(b)}if(o){const p=()=>E.update(()=>{o&&Ia(t,o)});h.length?Promise.all(h).then(p):p()}return h}function Je(t,e,n={}){var l;const s=mt(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(Xi(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:f}=i;return ja(t,e,c,u,h,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[r,o]:[o,r];return c().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function ja(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Je(l,e,{...o,delay:n+(typeof s=="function"?0:s)+Ui(t.variantChildren,l,s,i,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function Na(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Je(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Je(t,e,n);else{const i=typeof e=="function"?mt(t,e,n.custom):e;s=Promise.all(Xi(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Wa={test:t=>t==="auto",parse:t=>t},_i=t=>e=>e.test(t),Yi=[bt,S,Q,st,dr,fr,Wa],Qn=t=>Yi.find(_i(t));function Ua(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||oi(t):!0}const Ka=new Set(["brightness","contrast","saturate","opacity"]);function $a(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(vn)||[];if(!s)return t;const i=n.replace(s,"");let r=Ka.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const za=/\b([a-z-]*)\(.*?\)/gu,Qe={..._,getAnimatableNone:t=>{const e=t.match(za);return e?e.map($a).join(" "):t}},tn={..._,getAnimatableNone:t=>{const e=_.parse(t);return _.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},ts={...bt,transform:Math.round},Ga={rotate:st,pathRotation:st,rotateX:st,rotateY:st,rotateZ:st,scale:Ht,scaleX:Ht,scaleY:Ht,scaleZ:Ht,skew:st,skewX:st,skewY:st,distance:S,translateX:S,translateY:S,translateZ:S,x:S,y:S,z:S,perspective:S,transformPerspective:S,opacity:jt,originX:Wn,originY:Wn,originZ:S},ue={borderWidth:S,borderTopWidth:S,borderRightWidth:S,borderBottomWidth:S,borderLeftWidth:S,borderRadius:S,borderTopLeftRadius:S,borderTopRightRadius:S,borderBottomRightRadius:S,borderBottomLeftRadius:S,width:S,maxWidth:S,height:S,maxHeight:S,top:S,right:S,bottom:S,left:S,inset:S,insetBlock:S,insetBlockStart:S,insetBlockEnd:S,insetInline:S,insetInlineStart:S,insetInlineEnd:S,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,paddingBlock:S,paddingBlockStart:S,paddingBlockEnd:S,paddingInline:S,paddingInlineStart:S,paddingInlineEnd:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,marginBlock:S,marginBlockStart:S,marginBlockEnd:S,marginInline:S,marginInlineStart:S,marginInlineEnd:S,fontSize:S,backgroundPositionX:S,backgroundPositionY:S,...Ga,zIndex:ts,fillOpacity:jt,strokeOpacity:jt,numOctaves:ts},Ha={...ue,color:k,backgroundColor:k,outlineColor:k,fill:k,stroke:k,borderColor:k,borderTopColor:k,borderRightColor:k,borderBottomColor:k,borderLeftColor:k,filter:Qe,WebkitFilter:Qe,mask:tn,WebkitMask:tn},qi=t=>Ha[t],Xa=new Set([Qe,tn]);function Zi(t,e){let n=qi(t);return Xa.has(n)||(n=_),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const _a=new Set(["auto","none","0"]);function Ya(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!_a.has(r)&&Pt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Zi(n,i)}class qa extends Pn{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),yn(h))){const f=$i(h,n.current);f!==void 0&&(e[u]=f),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!zi.has(s)||e.length!==2)return;const[i,r]=e,o=Qn(i),a=Qn(r),l=Nn(i),c=Nn(r);if(l!==c&&rt[s]){this.needsMeasurement=!0;return}if(o!==a)if(_n(o)&&_n(a))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else rt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Ua(e[i]))&&s.push(i);s.length&&Ya(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=rt[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=rt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function Ji(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=(n==null?void 0:n[t])??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const en=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Jt(t){return ii(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Mn}=vi(queueMicrotask,!1),X={x:!1,y:!1};function Qi(){return X.x||X.y}function Za(t){return t==="x"||t==="y"?X[t]?null:(X[t]=!0,()=>{X[t]=!1}):X.x||X.y?null:(X.x=X.y=!0,()=>{X.x=X.y=!1})}function to(t,e){const n=Ji(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Ja(t){return!(t.pointerType==="touch"||Qi())}function Qa(t,e,n={}){const[s,i,r]=to(t,n);return s.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",p)},h=m=>{c&&(c(m),c=void 0),u()},f=m=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,h(m))},d=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=m=>{if(m.pointerType!=="touch"){if(a){l=!0;return}h(m)}},y=m=>{if(!Ja(m))return;l=!1;const g=e(o,m);typeof g=="function"&&(c=g,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",y,i),o.addEventListener("pointerdown",d,i)}),r}const eo=(t,e)=>e?t===e?!0:eo(t,e.parentElement):!1,Dn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,tl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function el(t){return tl.has(t.tagName)||t.isContentEditable===!0}const nl=new Set(["INPUT","SELECT","TEXTAREA"]);function sl(t){return nl.has(t.tagName)||t.isContentEditable===!0}const Qt=new WeakSet;function es(t){return e=>{e.key==="Enter"&&t(e)}}function Me(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const il=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=es(()=>{if(Qt.has(n))return;Me(n,"down");const i=es(()=>{Me(n,"up")}),r=()=>Me(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function ns(t){return Dn(t)&&!Qi()}const ss=new WeakSet;function ol(t,e,n={}){const[s,i,r]=to(t,n),o=a=>{const l=a.currentTarget;if(!ns(a)||ss.has(a))return;Qt.add(l),n.stopPropagation&&ss.add(a);const c=e(l,a),u={...i,capture:!0},h=(p,y)=>{window.removeEventListener("pointerup",f,u),window.removeEventListener("pointercancel",d,u),Qt.has(l)&&Qt.delete(l),ns(p)&&typeof c=="function"&&c(p,{success:y})},f=p=>{h(p,l===window||l===document||n.useGlobalTarget||eo(l,p.target))},d=p=>{h(p,!1)};window.addEventListener("pointerup",f,u),window.addEventListener("pointercancel",d,u)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Jt(a)&&(a.addEventListener("focus",c=>il(c,i)),!el(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function En(t){return ii(t)&&"ownerSVGElement"in t}const te=new WeakMap;let ot;const no=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:En(s)&&"getBBox"in s?s.getBBox()[e]:s[n],rl=no("inline","width","offsetWidth"),al=no("block","height","offsetHeight");function ll({target:t,borderBoxSize:e}){var n;(n=te.get(t))==null||n.forEach(s=>{s(t,{get width(){return rl(t,e)},get height(){return al(t,e)}})})}function cl(t){t.forEach(ll)}function ul(){typeof ResizeObserver>"u"||(ot=new ResizeObserver(cl))}function hl(t,e){ot||ul();const n=Ji(t);return n.forEach(s=>{let i=te.get(s);i||(i=new Set,te.set(s,i)),i.add(e),ot==null||ot.observe(s)}),()=>{n.forEach(s=>{const i=te.get(s);i==null||i.delete(e),i!=null&&i.size||ot==null||ot.unobserve(s)})}}const ee=new Set;let wt;function fl(){wt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};ee.forEach(e=>e(t))},window.addEventListener("resize",wt)}function dl(t){return ee.add(t),wt||fl(),()=>{ee.delete(t),!ee.size&&typeof wt=="function"&&(window.removeEventListener("resize",wt),wt=void 0)}}function is(t,e){return typeof t=="function"?dl(t):hl(t,e)}function pl(t){return En(t)&&t.tagName==="svg"}function ml(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=Di(i,r,o);return e?a(s):a}const gl=[...Yi,k,_],yl=t=>gl.find(_i(t)),os=()=>({translate:0,scale:1,origin:0,originPoint:0}),St=()=>({x:os(),y:os()}),rs=()=>({min:0,max:0}),I=()=>({x:rs(),y:rs()}),vl=new WeakMap;function ve(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Nt(t){return typeof t=="string"||Array.isArray(t)}const Rn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ln=["initial",...Rn];function xe(t){return ve(t.animate)||Ln.some(e=>Nt(t[e]))}function so(t){return!!(xe(t)||t.variants)}function xl(t,e,n){for(const s in e){const i=e[s],r=n[s];if(B(i))t.addValue(s,i);else if(B(r))t.addValue(s,gt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,gt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const nn={current:null},io={current:!1},Tl=typeof window<"u";function wl(){if(io.current=!0,!!Tl)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>nn.current=t.matches;t.addEventListener("change",e),e()}else nn.current=!1}const as=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let he={};function oo(t){he=t}function Sl(){return he}class Pl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Pn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 d=N.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,E.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=xe(n),this.isVariantNode=so(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const p=f[d];c[d]!==void 0&&B(p)&&p.set(c[d])}}mount(e){var n,s;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,vl.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,r)=>this.bindToMotionValue(r,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(io.current||wl(),this.shouldReduceMotion=nn.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),it(this.notifyUpdate),it(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Wi.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,h=new ji({element:this.current,name:e,keyframes:a,times:l,ease:c,duration:U(u)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=Vt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&E.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r()})}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 he){const n=he[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):I()}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 s=0;s<as.length;s++){const i=as[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=xl(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&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 s=this.values.get(e);return s===void 0&&n!==void 0&&(s=gt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(si(s)||oi(s))?s=parseFloat(s):!yl(s)&&_.test(n)&&(s=Zi(e,n)),this.setBaseTarget(e,B(s)?s.get():s)),B(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var r;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=Vn(this.props,n,(r=this.presenceContext)==null?void 0:r.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!B(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new pn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Mn.render(this.render)}}class ro extends Pl{constructor(){super(...arguments),this.KeyframeResolver=qa}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;B(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class lt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function ao({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function bl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Al(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function De(t){return t===void 0||t===1}function sn({scale:t,scaleX:e,scaleY:n}){return!De(t)||!De(e)||!De(n)}function ht(t){return sn(t)||lo(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function lo(t){return ls(t.x)||ls(t.y)}function ls(t){return t&&t!=="0%"}function fe(t,e,n){const s=t-n,i=e*s;return n+i}function cs(t,e,n,s,i){return i!==void 0&&(t=fe(t,i,s)),fe(t,n,s)+e}function on(t,e=0,n=1,s,i){t.min=cs(t.min,e,n,s,i),t.max=cs(t.max,e,n,s,i)}function co(t,{x:e,y:n}){on(t.x,e.translate,e.scale,e.originPoint),on(t.y,n.translate,n.scale,n.originPoint)}const us=.999999999999,hs=1.0000000000001;function Vl(t,e,n,s=!1){var a;const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let l=0;l<i;l++){r=n[l],o=r.projectionDelta;const{visualElement:c}=r.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(J(t.x,-r.scroll.offset.x),J(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,co(t,o)),s&&ht(r.latestValues)&&ne(t,r.latestValues,(a=r.layout)==null?void 0:a.layoutBox))}e.x<hs&&e.x>us&&(e.x=1),e.y<hs&&e.y>us&&(e.y=1)}function J(t,e){t.min+=e,t.max+=e}function fs(t,e,n,s,i=.5){const r=D(t.min,t.max,i);on(t,e,n,r,s)}function ds(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function ne(t,e,n){const s=n??t;fs(t.x,ds(e.x,s.x),e.scaleX,e.scale,e.originX),fs(t.y,ds(e.y,s.y),e.scaleY,e.scale,e.originY)}function uo(t,e){return ao(Al(t.getBoundingClientRect(),e))}function Cl(t,e,n){const s=uo(t,n),{scroll:i}=e;return i&&(J(s.x,i.offset.x),J(s.y,i.offset.y)),s}const Ml={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Dl=At.length;function El(t,e,n){let s="",i=!0;for(let o=0;o<Dl;o++){const a=At[o],l=t[a];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(a.startsWith("scale")?1:0);else{const u=parseFloat(l);c=a.startsWith("scale")?u===1:u===0}if(!c||n){const u=en(l,ue[a]);if(!c){i=!1;const h=Ml[a]||a;s+=`${h}(${u}) `}n&&(e[a]=u)}}const r=t.pathRotation;return r&&(i=!1,s+=`rotate(${en(r,ue.pathRotation)}) `),s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function kn(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const c=e[l];if(Vt.has(l)){o=!0;continue}else if(Ti(l)){i[l]=c;continue}else{const u=en(c,ue[l]);l.startsWith("origin")?(a=!0,r[l]=u):s[l]=u}}if(e.transform||(o||n?s.transform=El(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=r;s.transformOrigin=`${l} ${c} ${u}`}}function ho(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i==null||i.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function ps(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ct={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(S.test(t))t=parseFloat(t);else return t;const n=ps(t,e.target.x),s=ps(t,e.target.y);return`${n}% ${s}%`}},Rl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=_.parse(t);if(i.length>5)return s;const r=_.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const c=D(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),r(i)}},rn={borderRadius:{...Ct,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ct,borderTopRightRadius:Ct,borderBottomLeftRadius:Ct,borderBottomRightRadius:Ct,boxShadow:Rl};function fo(t,{layout:e,layoutId:n}){return Vt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!rn[t]||t==="opacity")}function In(t,e,n){var o;const s=t.style,i=e==null?void 0:e.style,r={};if(!s)return r;for(const a in s)(B(s[a])||i&&B(i[a])||fo(a,t)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(r[a]=s[a]);return r}function Ll(t){return window.getComputedStyle(t)}class kl extends ro{constructor(){super(...arguments),this.type="html",this.renderInstance=ho}readValueFromInstance(e,n){var s;if(Vt.has(n))return(s=this.projection)!=null&&s.isProjecting?ze(n):Jr(e,n);{const i=Ll(e),r=(Ti(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return uo(e,n)}build(e,n,s){kn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return In(e,n,s)}}const Il={offset:"stroke-dashoffset",array:"stroke-dasharray"},Bl={offset:"strokeDashoffset",array:"strokeDasharray"};function Fl(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Il:Bl;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const Ol=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function po(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,c,u){if(kn(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete h.transformBox);for(const d of Ol)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Fl(h,i,r,o,!1)}const mo=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"]),go=t=>typeof t=="string"&&t.toLowerCase()==="svg";function jl(t,e,n,s){ho(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(mo.has(i)?i:Cn(i),e.attrs[i])}function yo(t,e,n){const s=In(t,e,n);for(const i in t)if(B(t[i])||B(e[i])){const r=At.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class Nl extends ro{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=I}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Vt.has(n)){const s=qi(n);return s&&s.default||0}return n=mo.has(n)?n:Cn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return yo(e,n,s)}build(e,n,s){po(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){jl(e,n,s,i)}mount(e){this.isSVGTag=go(e.tagName),super.mount(e)}}const Wl=Ln.length;function vo(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?vo(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Wl;n++){const s=Ln[n],i=t.props[s];(Nt(i)||i===!1)&&(e[s]=i)}return e}function xo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Ul=[...Rn].reverse(),Kl=Rn.length;function $l(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Na(t,n,s)))}function zl(t){let e=$l(t),n=ms(),s=!0,i=!1;const r=c=>(u,h)=>{var d;const f=mt(t,h,c==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:y,...m}=f;u={...u,...m,...y}}return u};function o(c){e=c(t)}function a(c){const{props:u}=t,h=vo(t.parent)||{},f=[],d=new Set;let p={},y=1/0;for(let g=0;g<Kl;g++){const x=Ul[g],v=n[x],T=u[x]!==void 0?u[x]:h[x],b=Nt(T),M=x===c?v.isActive:null;M===!1&&(y=g);let V=T===h[x]&&T!==u[x]&&b;if(V&&(s||i)&&t.manuallyAnimateOnMount&&(V=!1),v.protectedKeys={...p},!v.isActive&&M===null||!T&&!v.prevProp||ve(T)||typeof T=="boolean")continue;if(x==="exit"&&v.isActive&&M!==!0){v.prevResolvedValues&&(p={...p,...v.prevResolvedValues});continue}const P=Gl(v.prevProp,T);let C=P||x===c&&v.isActive&&!V&&b||g>y&&b,A=!1;const R=Array.isArray(T)?T:[T];let F=R.reduce(r(x),{});M===!1&&(F={});const{prevResolvedValues:et={}}=v,Y={...et,...F},nt=O=>{C=!0,d.has(O)&&(A=!0,d.delete(O)),v.needsAnimating[O]=!0;const K=t.getValue(O);K&&(K.liveStyle=!1)};for(const O in Y){const K=F[O],ct=et[O];if(p.hasOwnProperty(O))continue;let vt=!1;qe(K)&&qe(ct)?vt=!xo(K,ct)||P:vt=K!==ct,vt?K!=null?nt(O):d.add(O):K!==void 0&&d.has(O)?nt(O):v.protectedKeys[O]=!0}v.prevProp=T,v.prevResolvedValues=F,v.isActive&&(p={...p,...F}),(s||i)&&t.blockInitialAnimation&&(C=!1);const q=V&&P;C&&(!q||A)&&f.push(...R.map(O=>{const K={type:x};if(typeof O=="string"&&(s||i)&&!q&&t.manuallyAnimateOnMount&&t.parent){const{parent:ct}=t,vt=mt(ct,O);if(ct.enteringChildren&&vt){const{delayChildren:Ho}=vt.transition||{};K.delay=Ui(ct.enteringChildren,t,Ho)}}return{animation:O,options:K}}))}if(d.size){const g={};if(typeof u.initial!="boolean"){const x=mt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(g.transition=x.transition)}d.forEach(x=>{const v=t.getBaseTarget(x),T=t.getValue(x);T&&(T.liveStyle=!0),g[x]=v??null}),f.push({animation:g})}let m=!!f.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),s=!1,i=!1,m?e(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(d=>{var p;return(p=d.animationState)==null?void 0:p.setActive(c,u)}),n[c].isActive=u;const h=a(c);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=ms(),i=!0}}}function Gl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!xo(e,t):!1}function ut(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ms(){return{animate:ut(!0),whileInView:ut(),whileHover:ut(),whileTap:ut(),whileDrag:ut(),whileFocus:ut(),exit:ut()}}function an(t,e){t.min=e.min,t.max=e.max}function H(t,e){an(t.x,e.x),an(t.y,e.y)}function gs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const To=1e-4,Hl=1-To,Xl=1+To,wo=.01,_l=0-wo,Yl=0+wo;function W(t){return t.max-t.min}function ql(t,e,n){return Math.abs(t-e)<=n}function ys(t,e,n,s=.5){t.origin=s,t.originPoint=D(e.min,e.max,t.origin),t.scale=W(n)/W(e),t.translate=D(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Hl&&t.scale<=Xl||isNaN(t.scale))&&(t.scale=1),(t.translate>=_l&&t.translate<=Yl||isNaN(t.translate))&&(t.translate=0)}function kt(t,e,n,s){ys(t.x,e.x,n.x,s?s.originX:void 0),ys(t.y,e.y,n.y,s?s.originY:void 0)}function vs(t,e,n,s=0){const i=s?D(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+W(e)}function Zl(t,e,n,s){vs(t.x,e.x,n.x,s==null?void 0:s.x),vs(t.y,e.y,n.y,s==null?void 0:s.y)}function xs(t,e,n,s=0){const i=s?D(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+W(e)}function de(t,e,n,s){xs(t.x,e.x,n.x,s==null?void 0:s.x),xs(t.y,e.y,n.y,s==null?void 0:s.y)}function Ts(t,e,n,s,i){return t-=e,t=fe(t,1/n,s),i!==void 0&&(t=fe(t,1/i,s)),t}function Jl(t,e=0,n=1,s=.5,i,r=t,o=t){if(Q.test(e)&&(e=parseFloat(e),e=D(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=D(r.min,r.max,s);t===r&&(a-=e),t.min=Ts(t.min,e,n,a,i),t.max=Ts(t.max,e,n,a,i)}function ws(t,e,[n,s,i],r,o){Jl(t,e[n],e[s],e[i],e.scale,r,o)}const Ql=["x","scaleX","originX"],tc=["y","scaleY","originY"];function Ss(t,e,n,s){ws(t.x,e,Ql,n?n.x:void 0,s?s.x:void 0),ws(t.y,e,tc,n?n.y:void 0,s?s.y:void 0)}function Ps(t){return t.translate===0&&t.scale===1}function So(t){return Ps(t.x)&&Ps(t.y)}function bs(t,e){return t.min===e.min&&t.max===e.max}function ec(t,e){return bs(t.x,e.x)&&bs(t.y,e.y)}function As(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Po(t,e){return As(t.x,e.x)&&As(t.y,e.y)}function Vs(t){return W(t.x)/W(t.y)}function Cs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Z(t){return[t("x"),t("y")]}function nc(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,pathRotation:h,rotateX:f,rotateY:d,skewX:p,skewY:y}=n;c&&(s=`perspective(${c}px) ${s}`),u&&(s+=`rotate(${u}deg) `),h&&(s+=`rotate(${h}deg) `),f&&(s+=`rotateX(${f}deg) `),d&&(s+=`rotateY(${d}deg) `),p&&(s+=`skewX(${p}deg) `),y&&(s+=`skewY(${y}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const bo=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],sc=bo.length,Ms=t=>typeof t=="string"?parseFloat(t):t,Ds=t=>typeof t=="number"||S.test(t);function ic(t,e,n,s,i,r){i?(t.opacity=D(0,n.opacity??1,oc(s)),t.opacityExit=D(e.opacity??1,0,rc(s))):r&&(t.opacity=D(e.opacity??1,n.opacity??1,s));for(let o=0;o<sc;o++){const a=bo[o];let l=Es(e,a),c=Es(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Ds(l)===Ds(c)?(t[a]=Math.max(D(Ms(l),Ms(c),s),0),(Q.test(c)||Q.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=D(e.rotate||0,n.rotate||0,s))}function Es(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const oc=Ao(0,.5,pi),rc=Ao(.5,.95,G);function Ao(t,e,n){return s=>s<t?0:s>e?1:n(Ot(t,e,s))}function ac(t,e,n){const s=B(t)?t:gt(t);return s.start(An("",s,e,n)),s.animation}function Wt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n,s)}const lc=(t,e)=>t.depth-e.depth;class cc{constructor(){this.children=[],this.isDirty=!1}add(e){fn(this.children,e),this.isDirty=!0}remove(e){oe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(lc),this.isDirty=!1,this.children.forEach(e)}}function uc(t,e){const n=N.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(it(s),t(r-e))};return E.setup(s,!0),()=>it(s)}function se(t){return B(t)?t.get():t}class hc{constructor(){this.members=[]}add(e){fn(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(oe(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(oe(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){var n;for(let s=this.members.indexOf(e)-1;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,n){var i;const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=s.options,{layoutDependency:o}=e.options;(r===void 0||r!==o)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,s,i,r,o;(s=(n=e.options).onExitComplete)==null||s.call(n),(o=(i=e.resumingFrom)==null?void 0:(r=i.options).onExitComplete)==null||o.call(r)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const ie={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ee=["","X","Y","Z"],fc=1e3;let dc=0;function Re(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Vo(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Hi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",E,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Vo(s)}function Co({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=dc++,this.animationId=0,this.animationCommitId=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.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(gc),this.nodes.forEach(Sc),this.nodes.forEach(Pc),this.nodes.forEach(yc)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new cc)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new pn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=En(o)&&!pl(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let u,h=0;const f=()=>this.root.updateBlockedByResize=!1;E.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,u&&u(),u=uc(f,250),ie.hasAnimatedSinceResize&&(ie.hasAnimatedSinceResize=!1,this.nodes.forEach(ks)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||Mc,{onLayoutAnimationStart:y,onLayoutAnimationComplete:m}=c.getProps(),g=!this.targetLayout||!Po(this.targetLayout,d),x=!h&&f;if(this.options.layoutRoot||this.resumeFrom||x||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...bn(p,"layout"),onPlay:y,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,x,v.path)}else h||ks(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),it(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(bc),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Vo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(xc),this.nodes.forEach(Rs);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ls);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Tc),this.nodes.forEach(wc),this.nodes.forEach(pc),this.nodes.forEach(mc)):this.nodes.forEach(Ls),this.clearAllSnapshots();const a=N.now();j.delta=tt(0,1e3/60,a-j.timestamp),j.timestamp=a,j.isProcessing=!0,Se.update.process(j),Se.preRender.process(j),Se.render.process(j),j.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Mn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(vc),this.sharedNodes.forEach(Ac)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,E.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){E.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!W(this.snapshot.measuredBox.x)&&!W(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=I()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!So(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||ht(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Dc(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return I();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(Ec))){const{scroll:u}=this.root;u&&(J(a.x,u.offset.x),J(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=I();if(H(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:f}=u;u!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&H(a,o),J(a.x,h.offset.x),J(a.y,h.offset.y))}return a}applyTransform(o,a=!1,l){var u,h;const c=l||I();H(c,o);for(let f=0;f<this.path.length;f++){const d=this.path[f];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(J(c.x,-d.scroll.offset.x),J(c.y,-d.scroll.offset.y)),ht(d.latestValues)&&ne(c,d.latestValues,(u=d.layout)==null?void 0:u.layoutBox)}return ht(this.latestValues)&&ne(c,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),c}removeTransform(o){var l;const a=I();H(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!ht(u.latestValues))continue;let h;u.instance&&(sn(u.latestValues)&&u.updateSnapshot(),h=I(),H(h,u.measurePageBox())),Ss(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,h)}return ht(this.latestValues)&&Ss(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==j.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var d;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=j.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=I(),this.targetWithTransforms=I()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Zl(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):H(this.target,this.layout.layoutBox),co(this.target,this.targetDelta)):H(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||sn(this.parent.latestValues)||lo(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=I(),this.relativeTargetOrigin=I(),de(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),H(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===j.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;H(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Vl(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=I());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(gs(this.prevProjectionDelta.x,this.projectionDelta.x),gs(this.prevProjectionDelta.y,this.projectionDelta.y)),kt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Cs(this.projectionDelta.x,this.prevProjectionDelta.x)||!Cs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=St(),this.projectionDelta=St(),this.projectionDeltaWithTransform=St()}setAnimationOrigin(o,a=!1,l){const c=this.snapshot,u=c?c.latestValues:{},h={...this.latestValues},f=St();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=I(),p=c?c.source:void 0,y=this.layout?this.layout.source:void 0,m=p!==y,g=this.getStack(),x=!g||g.members.length<=1,v=!!(m&&!x&&this.options.crossfade===!0&&!this.path.some(Cc));this.animationProgress=0;let T;const b=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=M=>{const V=M/1e3,P=b==null?void 0:b(V);P?(f.x.translate=P.x,f.x.scale=D(o.x.scale,1,V),f.x.origin=o.x.origin,f.x.originPoint=o.x.originPoint,f.y.translate=P.y,f.y.scale=D(o.y.scale,1,V),f.y.origin=o.y.origin,f.y.originPoint=o.y.originPoint):(Is(f.x,o.x,V),Is(f.y,o.y,V)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(de(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Vc(this.relativeTarget,this.relativeTargetOrigin,d,V),T&&ec(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=I()),H(T,this.relativeTarget)),m&&(this.animationValues=h,ic(h,u,this.latestValues,V,v,x)),P&&P.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=V},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(it(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=E.update(()=>{ie.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=gt(0)),this.motionValue.jump(0,!1),this.currentAnimation=ac(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(fc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Mo(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||I();const h=W(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=W(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}H(a,l),ne(a,u),kt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new hc),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Re("z",o,c,this.animationValues);for(let u=0;u<Ee.length;u++)Re(`rotate${Ee[u]}`,o,c,this.animationValues),Re(`skew${Ee[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=se(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=se(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ht(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=nc(this.projectionDeltaWithTransform,this.treeScale,u);l&&(h=l(u,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const p in rn){if(u[p]===void 0)continue;const{correct:y,applyTo:m,isCSSVariable:g}=rn[p],x=h==="none"?u[p]:y(u[p],c);if(m){const v=m.length;for(let T=0;T<v;T++)o[m[T]]=x}else g?this.options.visualElement.renderState.vars[p]=x:o[p]=x}this.options.layoutId&&(o.pointerEvents=c===this?se(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Rs),this.root.sharedNodes.clear()}}}function pc(t){t.updateLayout()}function mc(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;if(r==="size")Z(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=W(f);f.min=s[h].min,f.max=f.min+d});else if(r==="x"||r==="y"){const h=r==="x"?"y":"x";an(o?e.measuredBox[h]:e.layoutBox[h],s[h])}else Mo(r,e.layoutBox,s)&&Z(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=W(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=St();kt(a,s,e.layoutBox);const l=St();o?kt(l,t.applyTransform(i,!0),e.measuredBox):kt(l,s,e.layoutBox);const c=!So(a);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const p=t.options.layoutAnchor||void 0,y=I();de(y,e.layoutBox,f.layoutBox,p);const m=I();de(m,s,d.layoutBox,p),Po(y,m)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=y,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function gc(t){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 yc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function vc(t){t.clearSnapshot()}function Rs(t){t.clearMeasurements()}function xc(t){t.isLayoutDirty=!0,t.updateLayout()}function Ls(t){t.isLayoutDirty=!1}function Tc(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function wc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ks(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Sc(t){t.resolveTargetDelta()}function Pc(t){t.calcProjection()}function bc(t){t.resetSkewAndRotation()}function Ac(t){t.removeLeadSnapshot()}function Is(t,e,n){t.translate=D(e.translate,0,n),t.scale=D(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Bs(t,e,n,s){t.min=D(e.min,n.min,s),t.max=D(e.max,n.max,s)}function Vc(t,e,n,s){Bs(t.x,e.x,n.x,s),Bs(t.y,e.y,n.y,s)}function Cc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Mc={duration:.45,ease:[.4,0,.1,1]},Fs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Os=Fs("applewebkit/")&&!Fs("chrome/")?Math.round:G;function js(t){t.min=Os(t.min),t.max=Os(t.max)}function Dc(t){js(t.x),js(t.y)}function Mo(t,e,n){return t==="position"||t==="preserve-aspect"&&!ql(Vs(e),Vs(n),.2)}function Ec(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Rc=Co({attachResizeListener:(t,e)=>Wt(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Le={current:void 0},Do=Co({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Le.current){const t=new Rc({});t.mount(window),t.setOptions({layoutScroll:!0}),Le.current=t}return Le.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Te=w.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ns(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Lc(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Ns(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():Ns(t[i],null)}}}}function kc(...t){return w.useCallback(Lc(...t),t)}class Ic extends w.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Jt(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=Jt(s)&&s.offsetWidth||0,r=Jt(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Bc({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){var f;const o=w.useId(),a=w.useRef(null),l=w.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=w.useContext(Te),u=((f=t.props)==null?void 0:f.ref)??(t==null?void 0:t.ref),h=kc(a,u);return w.useInsertionEffect(()=>{const{width:d,height:p,top:y,left:m,right:g,bottom:x,direction:v}=l.current;if(e||r===!1||!a.current||!d||!p)return;const T=v==="rtl",b=n==="left"?T?`right: ${g}`:`left: ${m}`:T?`left: ${m}`:`right: ${g}`,M=s==="bottom"?`bottom: ${x}`:`top: ${y}`;a.current.dataset.motionPopId=o;const V=document.createElement("style");c&&(V.nonce=c);const P=i??document.head;return P.appendChild(V),V.sheet&&V.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${o}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${d}px !important;
|
|
5
|
+
height: ${p}px !important;
|
|
6
|
+
${b}px !important;
|
|
7
|
+
${M}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{var C;(C=a.current)==null||C.removeAttribute("data-motion-pop-id"),P.contains(V)&&P.removeChild(V)}},[e]),z.jsx(Ic,{isPresent:e,childRef:a,sizeRef:l,pop:r,children:r===!1?t:w.cloneElement(t,{ref:h})})}const Fc=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=yt(Oc),h=w.useId(),f=w.useRef(n),d=w.useRef(s);me(()=>{f.current=n,d.current=s});let p=!0,y=w.useMemo(()=>(p=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:m=>{u.set(m,!0);for(const g of u.values())if(!g)return;s&&s()},register:m=>(u.set(m,!1),()=>{var g;u.delete(m),!f.current&&!u.size&&((g=d.current)==null||g.call(d))})}),[n,u,s]);return r&&p&&(y={...y}),w.useMemo(()=>{u.forEach((m,g)=>u.set(g,!1))},[n]),w.useEffect(()=>{!n&&!u.size&&s&&s()},[n]),t=z.jsx(Bc,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:t}),z.jsx(ge.Provider,{value:y,children:t})};function Oc(){return new Map}function Eo(t=!0){const e=w.useContext(ge);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=w.useId();w.useEffect(()=>{if(t)return i(r)},[t]);const o=w.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const Xt=t=>t.key||"";function Ws(t){const e=[];return w.Children.forEach(t,n=>{w.isValidElement(n)&&e.push(n)}),e}const oh=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:c})=>{const[u,h]=Eo(o),f=w.useMemo(()=>Ws(t),[t]),d=o&&!u?[]:f.map(Xt),p=w.useRef(!0),y=w.useRef(f),m=yt(()=>new Map),g=w.useRef(new Set),[x,v]=w.useState(f),[T,b]=w.useState(f);me(()=>{p.current=!1,y.current=f;for(let P=0;P<T.length;P++){const C=Xt(T[P]);d.includes(C)?(m.delete(C),g.current.delete(C)):m.get(C)!==!0&&m.set(C,!1)}},[T,d.length,d.join("-")]);const M=[];if(f!==x){let P=[...f];for(let C=0;C<T.length;C++){const A=T[C],R=Xt(A);d.includes(R)||(P.splice(C,0,A),M.push(A))}return r==="wait"&&M.length&&(P=M),b(Ws(P)),v(f),null}const{forceRender:V}=w.useContext(hn);return z.jsx(z.Fragment,{children:T.map(P=>{const C=Xt(P),A=o&&!u?!1:f===T||d.includes(C),R=()=>{if(g.current.has(C))return;if(m.has(C))g.current.add(C),m.set(C,!0);else return;let F=!0;m.forEach(et=>{et||(F=!1)}),F&&(V==null||V(),b(y.current),o&&(h==null||h()),s&&s())};return z.jsx(Fc,{isPresent:A,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:c,onExitComplete:A?void 0:R,anchorX:a,anchorY:l,children:P},C)})})},Ro=w.createContext({strict:!1}),Us={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"]};let Ks=!1;function jc(){if(Ks)return;const t={};for(const e in Us)t[e]={isEnabled:n=>Us[e].some(s=>!!n[s])};oo(t),Ks=!0}function Lo(){return jc(),Sl()}function Nc(t){const e=Lo();for(const n in t)e[n]={...e[n],...t[n]};oo(e)}const Wc=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","propagate","ignoreStrict","viewport"]);function pe(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Wc.has(t)}let ko=t=>!pe(t);function Uc(t){typeof t=="function"&&(ko=e=>e.startsWith("on")?!pe(e):t(e))}try{Uc(require("@emotion/is-prop-valid").default)}catch{}function Kc(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||B(t[i])||(ko(i)||n===!0&&pe(i)||!e&&!pe(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const we=w.createContext({});function $c(t,e){if(xe(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Nt(n)?n:void 0,animate:Nt(s)?s:void 0}}return t.inherit!==!1?e:{}}function zc(t){const{initial:e,animate:n}=$c(t,w.useContext(we));return w.useMemo(()=>({initial:e,animate:n}),[$s(e),$s(n)])}function $s(t){return Array.isArray(t)?t.join(" "):t}const Bn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Io(t,e,n){for(const s in e)!B(e[s])&&!fo(s,n)&&(t[s]=e[s])}function Gc({transformTemplate:t},e){return w.useMemo(()=>{const n=Bn();return kn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Hc(t,e){const n=t.style||{},s={};return Io(s,n,t),Object.assign(s,Gc(t,e)),s}function Xc(t,e){const n={},s=Hc(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.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=s,n}const Bo=()=>({...Bn(),attrs:{}});function _c(t,e,n,s){const i=w.useMemo(()=>{const r=Bo();return po(r,e,go(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Io(r,t.style,t),i.style={...r,...i.style}}return i}const Yc=["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 Fn(t){return typeof t!="string"||t.includes("-")?!1:!!(Yc.indexOf(t)>-1||/[A-Z]/u.test(t))}function qc(t,e,n,{latestValues:s},i,r=!1,o){const l=(o??Fn(t)?_c:Xc)(e,s,i,t),c=Kc(e,typeof t=="string",r),u=t!==w.Fragment?{...c,...l,ref:n}:{},{children:h}=e,f=w.useMemo(()=>B(h)?h.get():h,[h]);return w.createElement(t,{...u,children:f})}function Zc({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Jc(n,s,i,t),renderState:e()}}function Jc(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=se(r[f]);let{initial:o,animate:a}=t;const l=xe(t),c=so(t);e&&c&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const h=u?a:o;if(h&&typeof h!="boolean"&&!ve(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=Vn(t,f[d]);if(p){const{transitionEnd:y,transition:m,...g}=p;for(const x in g){let v=g[x];if(Array.isArray(v)){const T=u?v.length-1:0;v=v[T]}v!==null&&(i[x]=v)}for(const x in y)i[x]=y[x]}}}return i}const Fo=t=>(e,n)=>{const s=w.useContext(we),i=w.useContext(ge),r=()=>Zc(t,e,s,i);return n?r():yt(r)},Qc=Fo({scrapeMotionValuesFromProps:In,createRenderState:Bn}),tu=Fo({scrapeMotionValuesFromProps:yo,createRenderState:Bo}),eu=Symbol.for("motionComponentSymbol");function nu(t,e,n){const s=w.useRef(n);w.useInsertionEffect(()=>{s.current=n});const i=w.useRef(null);return w.useCallback(r=>{var a;r&&((a=t.onMount)==null||a.call(t,r)),e&&(r?e.mount(r):e.unmount());const o=s.current;if(typeof o=="function")if(r){const l=o(r);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r)},[e])}const Oo=w.createContext({});function xt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function su(t,e,n,s,i,r){var v,T;const{visualElement:o}=w.useContext(we),a=w.useContext(Ro),l=w.useContext(ge),c=w.useContext(Te),u=c.reducedMotion,h=c.skipAnimations,f=w.useRef(null),d=w.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,y=w.useContext(Oo);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&iu(f.current,n,i,y);const m=w.useRef(!1);w.useInsertionEffect(()=>{p&&m.current&&p.update(n,l)});const g=n[Gi],x=w.useRef(!!g&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,g))&&((T=window.MotionHasOptimisedAnimation)==null?void 0:T.call(window,g)));return me(()=>{d.current=!0,p&&(m.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),x.current&&p.animationState&&p.animationState.animateChanges())}),w.useEffect(()=>{p&&(!x.current&&p.animationState&&p.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)==null||b.call(window,g)}),x.current=!1),p.enteringChildren=void 0)}),p}function iu(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:jo(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&xt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function jo(t){if(t)return t.options.allowProjection!==!1?t.projection:jo(t.parent)}function ke(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Nc(s);const r=n?n==="svg":Fn(t),o=r?tu:Qc;function a(c,u){let h;const f={...w.useContext(Te),...c,layoutId:ou(c)},{isStatic:d}=f,p=zc(c),y=o(c,d);if(!d&&typeof window<"u"){ru();const m=au(f);h=m.MeasureLayout,p.visualElement=su(t,y,f,i,m.ProjectionNode,r)}return z.jsxs(we.Provider,{value:p,children:[h&&p.visualElement?z.jsx(h,{visualElement:p.visualElement,...f}):null,qc(t,c,nu(y,p.visualElement,u),y,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=w.forwardRef(a);return l[eu]=t,l}function ou({layoutId:t}){const e=w.useContext(hn).id;return e&&t!==void 0?e+"-"+t:t}function ru(t,e){w.useContext(Ro).strict}function au(t){const e=Lo(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(t)||s!=null&&s.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function lu(t,e){if(typeof Proxy>"u")return ke;const n=new Map,s=(r,o)=>ke(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,ke(o,void 0,t,e)),n.get(o))})}const cu=(t,e)=>e.isSVG??Fn(t)?new Nl(e):new kl(e,{allowProjection:t!==w.Fragment});class uu extends lt{constructor(e){super(e),e.animationState||(e.animationState=zl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ve(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.call(this)}}let hu=0;class fu extends lt{constructor(){super(...arguments),this.id=hu++,this.isExitComplete=!1}update(){var r;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;if(e&&s===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=mt(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...h}=l;for(const f in h)(r=this.node.getValue(f))==null||r.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const du={animation:{Feature:uu},exit:{Feature:fu}};function zt(t){return{point:{x:t.pageX,y:t.pageY}}}const pu=t=>e=>Dn(e)&&t(e,zt(e));function It(t,e,n,s){return Wt(t,e,pu(n),s)}const No=({current:t})=>t?t.ownerDocument.defaultView:null,zs=(t,e)=>Math.abs(t-e);function mu(t,e){const n=zs(t.x,e.x),s=zs(t.y,e.y);return Math.sqrt(n**2+s**2)}const Gs=new Set(["auto","scroll"]);class Wo{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=_t(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Ie(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,m=mu(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!m)return;const{point:g}=p,{timestamp:x}=j;this.history.push({...g,timestamp:x});const{onStart:v,onMove:T}=this.handlers;y||(v&&v(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,p)},this.handlePointerMove=(p,y)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=_t(y,this.transformPagePoint),E.update(this.updatePoint,!0)},this.handlePointerUp=(p,y)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Ie(p.type==="pointercancel"?this.lastMoveEventInfo:_t(y,this.transformPagePoint),this.history);this.startEvent&&m&&m(p,v),g&&g(p,v)},!Dn(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const l=zt(e),c=_t(l,this.transformPagePoint),{point:u}=c,{timestamp:h}=j;this.history=[{...u,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,Ie(c,this.history));const d={passive:!0,capture:!0};this.removeListeners=Ut(It(this.contextWindow,"pointermove",this.handlePointerMove,d),It(this.contextWindow,"pointerup",this.handlePointerUp,d),It(this.contextWindow,"pointercancel",this.handlePointerUp,d)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Gs.has(s.overflowX)||Gs.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),E.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),it(this.updatePoint)}}function _t(t,e){return e?{point:e(t.point)}:t}function Hs(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ie({point:t},e){return{point:t,delta:Hs(t,Uo(e)),offset:Hs(t,gu(e)),velocity:yu(e,.1)}}function gu(t){return t[0]}function Uo(t){return t[t.length-1]}function yu(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Uo(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>U(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>U(e)*2&&(s=t[1]);const r=$(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function vu(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?D(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?D(n,t,s.max):Math.min(t,n)),t}function Xs(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 xu(t,{top:e,left:n,bottom:s,right:i}){return{x:Xs(t.x,n,i),y:Xs(t.y,e,s)}}function _s(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Tu(t,e){return{x:_s(t.x,e.x),y:_s(t.y,e.y)}}function wu(t,e){let n=.5;const s=W(t),i=W(e);return i>s?n=Ot(e.min,e.max-s,t.min):s>i&&(n=Ot(t.min,t.max-i,e.min)),tt(0,1,n)}function Su(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 ln=.35;function Pu(t=ln){return t===!1?t=0:t===!0&&(t=ln),{x:Ys(t,"left","right"),y:Ys(t,"top","bottom")}}function Ys(t,e,n){return{min:qs(t,e),max:qs(t,n)}}function qs(t,e){return typeof t=="number"?t:t[e]||0}const bu=new WeakMap;class Au{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=I(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(zt(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:p,onDragStart:y}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Za(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Z(g=>{let x=this.getAxisMotionValue(g).get()||0;if(Q.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const T=v.layout.layoutBox[g];T&&(x=W(T)*(parseFloat(x)/100))}}this.originPoint[g]=x}),y&&E.update(()=>y(h,f),!1,!0),Ze(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:y,onDrag:m}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:g}=f;if(p&&this.currentDirection===null){this.currentDirection=Cu(g),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",f.point,g),this.updateAxis("y",f.point,g),this.visualElement.render(),m&&E.update(()=>m(h,f),!1,!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new Wo(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:s,contextWindow:No(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&E.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Yt(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=vu(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var r;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)==null?void 0:r.layout,i=this.constraints;e&&xt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=xu(s.layoutBox,e):this.constraints=!1,this.elastic=Pu(n),i!==this.constraints&&!xt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&Z(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Su(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!xt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const r=Cl(s,i.root,this.visualElement.getTransformPagePoint());let o=Tu(i.layout.layoutBox,r);if(n){const a=n(bl(o));this.hasMutatedConstraints=!!a,a&&(o=ao(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Z(u=>{if(!Yt(u,n,this.currentDirection))return;let h=l&&l[u]||{};(o===!0||o===u)&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Ze(this.visualElement,e),s.start(An(e,s,0,n,this.visualElement,!1))}stopAnimation(){Z(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Z(n=>{const{drag:s}=this.getProps();if(!Yt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],l=r.get()||0;r.set(e[n]-D(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!xt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Z(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=wu({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),Z(o=>{if(!Yt(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(D(l,c,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;bu.set(this.visualElement,this);const e=this.visualElement.current,n=It(e,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps(),f=c.target,d=f!==e&&sl(f);u&&h&&!d&&this.start(c)});let s;const i=()=>{const{dragConstraints:c}=this.getProps();xt(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),s||(s=Vu(e,c.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),E.read(i);const a=Wt(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Z(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=c[h].translate,f.set(f.get()+c[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),l&&l(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=ln,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Zs(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Vu(t,e,n){const s=is(t,Zs(n)),i=is(e,Zs(n));return()=>{s(),i()}}function Yt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Cu(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Mu extends lt{constructor(e){super(e),this.removeGroupControls=G,this.removeListeners=G,this.controls=new Au(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||G}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Be=t=>(e,n)=>{t&&E.update(()=>t(e,n),!1,!0)};class Du extends lt{constructor(){super(...arguments),this.removePointerDownListener=G}onPointerDown(e){this.session=new Wo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:No(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Be(e),onStart:Be(n),onMove:Be(s),onEnd:(r,o)=>{delete this.session,i&&E.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=It(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Fe=!1;class Eu extends w.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),Fe&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ie.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Fe=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||E.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:s}=e;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),Mn.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;Fe=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ko(t){const[e,n]=Eo(),s=w.useContext(hn);return z.jsx(Eu,{...t,layoutGroup:s,switchLayoutGroup:w.useContext(Oo),isPresent:e,safeToRemove:n})}const Ru={pan:{Feature:Du},drag:{Feature:Mu,ProjectionNode:Do,MeasureLayout:Ko}};function Js(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&E.postRender(()=>r(e,zt(e)))}class Lu extends lt{mount(){const{current:e}=this.node;e&&(this.unmount=Qa(e,(n,s)=>(Js(this.node,s,"Start"),i=>Js(this.node,i,"End"))))}unmount(){}}class ku extends lt{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=Ut(Wt(this.node.current,"focus",()=>this.onFocus()),Wt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Qs(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&E.postRender(()=>r(e,zt(e)))}class Iu extends lt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=ol(e,(i,r)=>(Qs(this.node,r,"Start"),(o,{success:a})=>Qs(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const cn=new WeakMap,Oe=new WeakMap,Bu=t=>{const e=cn.get(t.target);e&&e(t)},Fu=t=>{t.forEach(Bu)};function Ou({root:t,...e}){const n=t||document;Oe.has(n)||Oe.set(n,{});const s=Oe.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Fu,{root:t,...e})),s[i]}function ju(t,e,n){const s=Ou(e);return cn.set(t,n),s.observe(t),()=>{cn.delete(t),s.unobserve(t)}}const Nu={some:0,all:1};class Wu extends lt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Nu[i]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),d=u?h:f;d&&d(c)};this.stopObserver=ju(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Uu(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Uu({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Ku={inView:{Feature:Wu},tap:{Feature:Iu},focus:{Feature:ku},hover:{Feature:Lu}},$u={layout:{ProjectionNode:Do,MeasureLayout:Ko}},zu={...du,...Ku,...Ru,...$u},On=lu(zu,cu);function $o(t){const e=yt(()=>gt(t)),{isStatic:n}=w.useContext(Te);if(n){const[,s]=w.useState(t);w.useEffect(()=>e.on("change",s),[])}return e}function zo(t,e){const n=$o(e()),s=()=>n.set(e());return s(),me(()=>{const i=()=>E.preRender(s,!1,!0),r=t.map(o=>o.on("change",i));return()=>{r.forEach(o=>o()),it(s)}}),n}function Gu(t){Lt.current=[],t();const e=zo(Lt.current,t);return Lt.current=void 0,e}function Hu(t,e,n,s){if(typeof t=="function")return Gu(t);const r=typeof e=="function"?e:ml(e,n,s),o=Array.isArray(t)?ti(t,r):ti([t],([l])=>r(l)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&(s==null?void 0:s.clamp)!==!1&&(o.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),o}function ti(t,e){const n=yt(()=>[]);return zo(t,()=>{n.length=0;const s=t.length;for(let i=0;i<s;i++)n[i]=t[i].get();return e(n)})}const Go=w.createContext(null);function Xu(t,e,n,s){if(!s)return t;const i=t.findIndex(u=>u.value===e);if(i===-1)return t;const r=s>0?1:-1,o=t[i+r];if(!o)return t;const a=t[i],l=o.layout,c=D(l.min,l.max,.5);return r===1&&a.layout.max+n>c||r===-1&&a.layout.min+n<c?_o(t,i,i+r):t}function _u({children:t,as:e="ul",axis:n="y",onReorder:s,values:i,...r},o){const a=yt(()=>On[e]),l=[],c=w.useRef(!1),u=w.useRef(null),h={axis:n,groupRef:u,registerItem:(p,y)=>{const m=l.findIndex(g=>p===g.value);m!==-1?l[m].layout=y[n]:l.push({value:p,layout:y[n]}),l.sort(Yu)},updateOrder:(p,y,m)=>{if(c.current)return;const g=Xu(l,p,y,m);if(l!==g){c.current=!0;const x=[...i];for(let v=0;v<g.length;v++)if(l[v].value!==g[v].value){const T=i.indexOf(l[v].value),b=i.indexOf(g[v].value);T!==-1&&b!==-1&&([x[T],x[b]]=[x[b],x[T]]);break}s(x)}}};w.useEffect(()=>{c.current=!1});const f=p=>{u.current=p,typeof o=="function"?o(p):o&&(o.current=p)},d={overflowAnchor:"none",...r.style};return z.jsx(a,{...r,style:d,ref:f,ignoreStrict:!0,children:z.jsx(Go.Provider,{value:h,children:t})})}const rh=w.forwardRef(_u);function Yu(t,e){return t.layout.min-e.layout.min}const qt=50,ei=25,qu=new Set(["auto","scroll"]),Bt=new WeakMap,Ft=new WeakMap;let Dt=null;function Zu(){if(Dt){const t=un(Dt,"y");t&&(Ft.delete(t),Bt.delete(t));const e=un(Dt,"x");e&&e!==t&&(Ft.delete(e),Bt.delete(e)),Dt=null}}function Ju(t,e){const n=getComputedStyle(t),s=e==="x"?n.overflowX:n.overflowY,i=t===document.body||t===document.documentElement;return qu.has(s)||i}function un(t,e){let n=t==null?void 0:t.parentElement;for(;n;){if(Ju(n,e))return n;n=n.parentElement}return null}function Qu(t,e,n){const s=e.getBoundingClientRect(),i=n==="x"?Math.max(0,s.left):Math.max(0,s.top),r=n==="x"?Math.min(window.innerWidth,s.right):Math.min(window.innerHeight,s.bottom),o=t-i,a=r-t;if(o<qt){const l=1-o/qt;return{amount:-ei*l*l,edge:"start"}}else if(a<qt){const l=1-a/qt;return{amount:ei*l*l,edge:"end"}}return{amount:0,edge:null}}function th(t,e,n,s){if(!t)return;Dt=t;const i=un(t,n);if(!i)return;const r=e-(n==="x"?window.scrollX:window.scrollY),{amount:o,edge:a}=Qu(r,i,n);if(a===null){Ft.delete(i),Bt.delete(i);return}const l=Ft.get(i),c=i===document.body||i===document.documentElement;if(l!==a){if(!(a==="start"&&s<0||a==="end"&&s>0))return;Ft.set(i,a);const h=n==="x"?i.scrollWidth-(c?window.innerWidth:i.clientWidth):i.scrollHeight-(c?window.innerHeight:i.clientHeight);Bt.set(i,h)}if(o>0){const u=Bt.get(i);if((n==="x"?c?window.scrollX:i.scrollLeft:c?window.scrollY:i.scrollTop)>=u)return}n==="x"?c?window.scrollBy({left:o}):i.scrollLeft+=o:c?window.scrollBy({top:o}):i.scrollTop+=o}function ni(t,e=0){return B(t)?t:$o(e)}function eh({children:t,style:e={},value:n,as:s="li",onDrag:i,onDragEnd:r,layout:o=!0,...a},l){const c=yt(()=>On[s]),u=w.useContext(Go),h={x:ni(e.x),y:ni(e.y)},f=Hu([h.x,h.y],([g,x])=>g||x?1:"unset"),{axis:d,registerItem:p,updateOrder:y,groupRef:m}=u;return z.jsx(c,{drag:d,...a,dragSnapToOrigin:!0,style:{...e,x:h.x,y:h.y,zIndex:f},layout:o,onDrag:(g,x)=>{const{velocity:v,point:T}=x,b=h[d].get();y(n,b,v[d]),th(m.current,T[d],d,v[d]),i&&i(g,x)},onDragEnd:(g,x)=>{Zu(),r&&r(g,x)},onLayoutMeasure:g=>{p(n,g)},ref:l,ignoreStrict:!0,children:t})}const ah=w.forwardRef(eh),lh=On;export{oh as A,rh as R,ah as a,lh as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function $(e){let t=e[0],s=e[1],i=e[2];return Math.sqrt(t*t+s*s+i*i)}function P(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function dt(e,t,s,i){return e[0]=t,e[1]=s,e[2]=i,e}function U(e,t,s){return e[0]=t[0]+s[0],e[1]=t[1]+s[1],e[2]=t[2]+s[2],e}function X(e,t,s){return e[0]=t[0]-s[0],e[1]=t[1]-s[1],e[2]=t[2]-s[2],e}function gt(e,t,s){return e[0]=t[0]*s[0],e[1]=t[1]*s[1],e[2]=t[2]*s[2],e}function ut(e,t,s){return e[0]=t[0]/s[0],e[1]=t[1]/s[1],e[2]=t[2]/s[2],e}function B(e,t,s){return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e}function pt(e,t){let s=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(s*s+i*i+r*r)}function xt(e,t){let s=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return s*s+i*i+r*r}function k(e){let t=e[0],s=e[1],i=e[2];return t*t+s*s+i*i}function ot(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function yt(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function V(e,t){let s=t[0],i=t[1],r=t[2],n=s*s+i*i+r*r;return n>0&&(n=1/Math.sqrt(n)),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function ht(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function G(e,t,s){let i=t[0],r=t[1],n=t[2],h=s[0],l=s[1],a=s[2];return e[0]=r*a-n*l,e[1]=n*h-i*a,e[2]=i*l-r*h,e}function Mt(e,t,s,i){let r=t[0],n=t[1],h=t[2];return e[0]=r+i*(s[0]-r),e[1]=n+i*(s[1]-n),e[2]=h+i*(s[2]-h),e}function mt(e,t,s,i,r){const n=Math.exp(-i*r);let h=t[0],l=t[1],a=t[2];return e[0]=s[0]+(h-s[0])*n,e[1]=s[1]+(l-s[1])*n,e[2]=s[2]+(a-s[2])*n,e}function _t(e,t,s){let i=t[0],r=t[1],n=t[2],h=s[3]*i+s[7]*r+s[11]*n+s[15];return h=h||1,e[0]=(s[0]*i+s[4]*r+s[8]*n+s[12])/h,e[1]=(s[1]*i+s[5]*r+s[9]*n+s[13])/h,e[2]=(s[2]*i+s[6]*r+s[10]*n+s[14])/h,e}function Et(e,t,s){let i=t[0],r=t[1],n=t[2],h=s[3]*i+s[7]*r+s[11]*n+s[15];return h=h||1,e[0]=(s[0]*i+s[4]*r+s[8]*n)/h,e[1]=(s[1]*i+s[5]*r+s[9]*n)/h,e[2]=(s[2]*i+s[6]*r+s[10]*n)/h,e}function wt(e,t,s){let i=t[0],r=t[1],n=t[2];return e[0]=i*s[0]+r*s[3]+n*s[6],e[1]=i*s[1]+r*s[4]+n*s[7],e[2]=i*s[2]+r*s[5]+n*s[8],e}function At(e,t,s){let i=t[0],r=t[1],n=t[2],h=s[0],l=s[1],a=s[2],c=s[3],f=l*n-a*r,d=a*i-h*n,g=h*r-l*i,u=l*g-a*d,p=a*f-h*g,x=h*d-l*f,o=c*2;return f*=o,d*=o,g*=o,u*=2,p*=2,x*=2,e[0]=i+f+u,e[1]=r+d+p,e[2]=n+g+x,e}const bt=(function(){const e=[0,0,0],t=[0,0,0];return function(s,i){P(e,s),P(t,i),V(e,e),V(t,t);let r=ht(e,t);return r>1?0:r<-1?Math.PI:Math.acos(r)}})();function Ft(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}class T extends Array{constructor(t=0,s=t,i=t){return super(t,s,i),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}set(t,s=t,i=t){return t.length?this.copy(t):(dt(this,t,s,i),this)}copy(t){return P(this,t),this}add(t,s){return s?U(this,t,s):U(this,this,t),this}sub(t,s){return s?X(this,t,s):X(this,this,t),this}multiply(t){return t.length?gt(this,this,t):B(this,this,t),this}divide(t){return t.length?ut(this,this,t):B(this,this,1/t),this}inverse(t=this){return yt(this,t),this}len(){return $(this)}distance(t){return t?pt(this,t):$(this)}squaredLen(){return k(this)}squaredDistance(t){return t?xt(this,t):k(this)}negate(t=this){return ot(this,t),this}cross(t,s){return s?G(this,t,s):G(this,this,t),this}scale(t){return B(this,this,t),this}normalize(){return V(this,this),this}dot(t){return ht(this,t)}equals(t){return Ft(this,t)}applyMatrix3(t){return wt(this,this,t),this}applyMatrix4(t){return _t(this,this,t),this}scaleRotateMatrix4(t){return Et(this,this,t),this}applyQuaternion(t){return At(this,this,t),this}angle(t){return bt(this,t)}lerp(t,s){return Mt(this,this,t,s),this}smoothLerp(t,s,i){return mt(this,this,t,s,i),this}clone(){return new T(this[0],this[1],this[2])}fromArray(t,s=0){return this[0]=t[s],this[1]=t[s+1],this[2]=t[s+2],this}toArray(t=[],s=0){return t[s]=this[0],t[s+1]=this[1],t[s+2]=this[2],t}transformDirection(t){const s=this[0],i=this[1],r=this[2];return this[0]=t[0]*s+t[4]*i+t[8]*r,this[1]=t[1]*s+t[5]*i+t[9]*r,this[2]=t[2]*s+t[6]*i+t[10]*r,this.normalize()}}const W=new T;let zt=1,St=1,Y=!1;class Ct{constructor(t,s={}){t.canvas,this.gl=t,this.attributes=s,this.id=zt++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let i in s)this.addAttribute(i,s[i])}addAttribute(t,s){if(this.attributes[t]=s,s.id=St++,s.size=s.size||1,s.type=s.type||(s.data.constructor===Float32Array?this.gl.FLOAT:s.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),s.target=t==="index"?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,s.normalized=s.normalized||!1,s.stride=s.stride||0,s.offset=s.offset||0,s.count=s.count||(s.stride?s.data.byteLength/s.stride:s.data.length/s.size),s.divisor=s.instanced||0,s.needsUpdate=!1,s.usage=s.usage||this.gl.STATIC_DRAW,s.buffer||this.updateAttribute(s),s.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==s.count*s.divisor)return this.instancedCount=Math.min(this.instancedCount,s.count*s.divisor);this.instancedCount=s.count*s.divisor}else t==="index"?this.drawRange.count=s.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,s.count))}updateAttribute(t){const s=!t.buffer;s&&(t.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==t.buffer&&(this.gl.bindBuffer(t.target,t.buffer),this.glState.boundBuffer=t.buffer),s?this.gl.bufferData(t.target,t.data,t.usage):this.gl.bufferSubData(t.target,0,t.data),t.needsUpdate=!1}setIndex(t){this.addAttribute("index",t)}setDrawRange(t,s){this.drawRange.start=t,this.drawRange.count=s}setInstancedCount(t){this.instancedCount=t}createVAO(t){this.VAOs[t.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.bindAttributes(t)}bindAttributes(t){t.attributeLocations.forEach((s,{name:i,type:r})=>{if(!this.attributes[i])return;const n=this.attributes[i];this.gl.bindBuffer(n.target,n.buffer),this.glState.boundBuffer=n.buffer;let h=1;r===35674&&(h=2),r===35675&&(h=3),r===35676&&(h=4);const l=n.size/h,a=h===1?0:h*h*4,c=h===1?0:h*4;for(let f=0;f<h;f++)this.gl.vertexAttribPointer(s+f,l,n.type,n.normalized,n.stride+a,n.offset+f*c),this.gl.enableVertexAttribArray(s+f),this.gl.renderer.vertexAttribDivisor(s+f,n.divisor)}),this.attributes.index&&this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.attributes.index.buffer)}draw({program:t,mode:s=this.gl.TRIANGLES}){var r;this.gl.renderer.currentGeometry!==`${this.id}_${t.attributeOrder}`&&(this.VAOs[t.attributeOrder]||this.createVAO(t),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.gl.renderer.currentGeometry=`${this.id}_${t.attributeOrder}`),t.attributeLocations.forEach((n,{name:h})=>{const l=this.attributes[h];l.needsUpdate&&this.updateAttribute(l)});let i=2;((r=this.attributes.index)==null?void 0:r.type)===this.gl.UNSIGNED_INT&&(i=4),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(s,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*i,this.instancedCount):this.gl.renderer.drawArraysInstanced(s,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(s,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*i):this.gl.drawArrays(s,this.drawRange.start,this.drawRange.count)}getPosition(){const t=this.attributes.position;if(t.data)return t;if(!Y)return Y=!0}computeBoundingBox(t){t||(t=this.getPosition());const s=t.data,i=t.size;this.bounds||(this.bounds={min:new T,max:new T,center:new T,scale:new T,radius:1/0});const r=this.bounds.min,n=this.bounds.max,h=this.bounds.center,l=this.bounds.scale;r.set(1/0),n.set(-1/0);for(let a=0,c=s.length;a<c;a+=i){const f=s[a],d=s[a+1],g=s[a+2];r.x=Math.min(f,r.x),r.y=Math.min(d,r.y),r.z=Math.min(g,r.z),n.x=Math.max(f,n.x),n.y=Math.max(d,n.y),n.z=Math.max(g,n.z)}l.sub(n,r),h.add(r,n).divide(2)}computeBoundingSphere(t){t||(t=this.getPosition());const s=t.data,i=t.size;this.bounds||this.computeBoundingBox(t);let r=0;for(let n=0,h=s.length;n<h;n+=i)W.fromArray(s,n),r=Math.max(r,this.bounds.center.squaredDistance(W));this.bounds.radius=Math.sqrt(r)}remove(){for(let t in this.VAOs)this.gl.renderer.deleteVertexArray(this.VAOs[t]),delete this.VAOs[t];for(let t in this.attributes)this.gl.deleteBuffer(this.attributes[t].buffer),delete this.attributes[t]}}let Lt=1;const Z={};class Ye{constructor(t,{vertex:s,fragment:i,uniforms:r={},transparent:n=!1,cullFace:h=t.BACK,frontFace:l=t.CCW,depthTest:a=!0,depthWrite:c=!0,depthFunc:f=t.LEQUAL}={}){t.canvas,this.gl=t,this.uniforms=r,this.id=Lt++,this.transparent=n,this.cullFace=h,this.frontFace=l,this.depthTest=a,this.depthWrite=c,this.depthFunc=f,this.blendFunc={},this.blendEquation={},this.stencilFunc={},this.stencilOp={},this.transparent&&!this.blendFunc.src&&(this.gl.renderer.premultipliedAlpha?this.setBlendFunc(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.setBlendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA)),this.vertexShader=t.createShader(t.VERTEX_SHADER),this.fragmentShader=t.createShader(t.FRAGMENT_SHADER),this.program=t.createProgram(),t.attachShader(this.program,this.vertexShader),t.attachShader(this.program,this.fragmentShader),this.setShaders({vertex:s,fragment:i})}setShaders({vertex:t,fragment:s}){if(t&&(this.gl.shaderSource(this.vertexShader,t),this.gl.compileShader(this.vertexShader),this.gl.getShaderInfoLog(this.vertexShader)),s&&(this.gl.shaderSource(this.fragmentShader,s),this.gl.compileShader(this.fragmentShader),this.gl.getShaderInfoLog(this.fragmentShader)),this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))return;this.uniformLocations=new Map;let i=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_UNIFORMS);for(let h=0;h<i;h++){let l=this.gl.getActiveUniform(this.program,h);this.uniformLocations.set(l,this.gl.getUniformLocation(this.program,l.name));const a=l.name.match(/(\w+)/g);l.uniformName=a[0],l.nameComponents=a.slice(1)}this.attributeLocations=new Map;const r=[],n=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES);for(let h=0;h<n;h++){const l=this.gl.getActiveAttrib(this.program,h),a=this.gl.getAttribLocation(this.program,l.name);a!==-1&&(r[a]=l.name,this.attributeLocations.set(l,a))}this.attributeOrder=r.join("")}setBlendFunc(t,s,i,r){this.blendFunc.src=t,this.blendFunc.dst=s,this.blendFunc.srcAlpha=i,this.blendFunc.dstAlpha=r,t&&(this.transparent=!0)}setBlendEquation(t,s){this.blendEquation.modeRGB=t,this.blendEquation.modeAlpha=s}setStencilFunc(t,s,i){this.stencilRef=s,this.stencilFunc.func=t,this.stencilFunc.ref=s,this.stencilFunc.mask=i}setStencilOp(t,s,i){this.stencilOp.stencilFail=t,this.stencilOp.depthFail=s,this.stencilOp.depthPass=i}applyState(){this.depthTest?this.gl.renderer.enable(this.gl.DEPTH_TEST):this.gl.renderer.disable(this.gl.DEPTH_TEST),this.cullFace?this.gl.renderer.enable(this.gl.CULL_FACE):this.gl.renderer.disable(this.gl.CULL_FACE),this.blendFunc.src?this.gl.renderer.enable(this.gl.BLEND):this.gl.renderer.disable(this.gl.BLEND),this.cullFace&&this.gl.renderer.setCullFace(this.cullFace),this.gl.renderer.setFrontFace(this.frontFace),this.gl.renderer.setDepthMask(this.depthWrite),this.gl.renderer.setDepthFunc(this.depthFunc),this.blendFunc.src&&this.gl.renderer.setBlendFunc(this.blendFunc.src,this.blendFunc.dst,this.blendFunc.srcAlpha,this.blendFunc.dstAlpha),this.gl.renderer.setBlendEquation(this.blendEquation.modeRGB,this.blendEquation.modeAlpha),this.stencilFunc.func||this.stencilOp.stencilFail?this.gl.renderer.enable(this.gl.STENCIL_TEST):this.gl.renderer.disable(this.gl.STENCIL_TEST),this.gl.renderer.setStencilFunc(this.stencilFunc.func,this.stencilFunc.ref,this.stencilFunc.mask),this.gl.renderer.setStencilOp(this.stencilOp.stencilFail,this.stencilOp.depthFail,this.stencilOp.depthPass)}use({flipFaces:t=!1}={}){let s=-1;this.gl.renderer.state.currentProgram===this.id||(this.gl.useProgram(this.program),this.gl.renderer.state.currentProgram=this.id),this.uniformLocations.forEach((r,n)=>{let h=this.uniforms[n.uniformName];for(const l of n.nameComponents){if(!h)break;if(l in h)h=h[l];else{if(Array.isArray(h.value))break;h=void 0;break}}if(!h)return j(`Active uniform ${n.name} has not been supplied`);if(h&&h.value===void 0)return j(`${n.name} uniform is missing a value parameter`);if(h.value.texture)return s=s+1,h.value.update(s),D(this.gl,n.type,r,s);if(h.value.length&&h.value[0].texture){const l=[];return h.value.forEach(a=>{s=s+1,a.update(s),l.push(s)}),D(this.gl,n.type,r,l)}D(this.gl,n.type,r,h.value)}),this.applyState(),t&&this.gl.renderer.setFrontFace(this.frontFace===this.gl.CCW?this.gl.CW:this.gl.CCW)}remove(){this.gl.deleteProgram(this.program)}}function D(e,t,s,i){i=i.length?Ot(i):i;const r=e.renderer.state.uniformLocations.get(s);if(i.length)if(r===void 0||r.length!==i.length)e.renderer.state.uniformLocations.set(s,i.slice(0));else{if(Tt(r,i))return;r.set?r.set(i):Rt(r,i),e.renderer.state.uniformLocations.set(s,r)}else{if(r===i)return;e.renderer.state.uniformLocations.set(s,i)}switch(t){case 5126:return i.length?e.uniform1fv(s,i):e.uniform1f(s,i);case 35664:return e.uniform2fv(s,i);case 35665:return e.uniform3fv(s,i);case 35666:return e.uniform4fv(s,i);case 35670:case 5124:case 35678:case 36306:case 35680:case 36289:return i.length?e.uniform1iv(s,i):e.uniform1i(s,i);case 35671:case 35667:return e.uniform2iv(s,i);case 35672:case 35668:return e.uniform3iv(s,i);case 35673:case 35669:return e.uniform4iv(s,i);case 35674:return e.uniformMatrix2fv(s,!1,i);case 35675:return e.uniformMatrix3fv(s,!1,i);case 35676:return e.uniformMatrix4fv(s,!1,i)}}function Ot(e){const t=e.length,s=e[0].length;if(s===void 0)return e;const i=t*s;let r=Z[i];r||(Z[i]=r=new Float32Array(i));for(let n=0;n<t;n++)r.set(e[n],n*s);return r}function Tt(e,t){if(e.length!==t.length)return!1;for(let s=0,i=e.length;s<i;s++)if(e[s]!==t[s])return!1;return!0}function Rt(e,t){for(let s=0,i=e.length;s<i;s++)e[s]=t[s]}let q=0;function j(e){q>100||(q++,q>100)}const N=new T;let $t=1;class Ze{constructor({canvas:t=document.createElement("canvas"),width:s=300,height:i=150,dpr:r=1,alpha:n=!1,depth:h=!0,stencil:l=!1,antialias:a=!1,premultipliedAlpha:c=!1,preserveDrawingBuffer:f=!1,powerPreference:d="default",autoClear:g=!0,webgl:u=2}={}){const p={alpha:n,depth:h,stencil:l,antialias:a,premultipliedAlpha:c,preserveDrawingBuffer:f,powerPreference:d};this.dpr=r,this.alpha=n,this.color=!0,this.depth=h,this.stencil=l,this.premultipliedAlpha=c,this.autoClear=g,this.id=$t++,u===2&&(this.gl=t.getContext("webgl2",p)),this.isWebgl2=!!this.gl,this.gl||(this.gl=t.getContext("webgl",p)),this.gl,this.gl.renderer=this,this.setSize(s,i),this.state={},this.state.blendFunc={src:this.gl.ONE,dst:this.gl.ZERO},this.state.blendEquation={modeRGB:this.gl.FUNC_ADD},this.state.cullFace=!1,this.state.frontFace=this.gl.CCW,this.state.depthMask=!0,this.state.depthFunc=this.gl.LEQUAL,this.state.premultiplyAlpha=!1,this.state.flipY=!1,this.state.unpackAlignment=4,this.state.framebuffer=null,this.state.viewport={x:0,y:0,width:null,height:null},this.state.textureUnits=[],this.state.activeTextureUnit=0,this.state.boundBuffer=null,this.state.uniformLocations=new Map,this.state.currentProgram=null,this.extensions={},this.isWebgl2?(this.getExtension("EXT_color_buffer_float"),this.getExtension("OES_texture_float_linear")):(this.getExtension("OES_texture_float"),this.getExtension("OES_texture_float_linear"),this.getExtension("OES_texture_half_float"),this.getExtension("OES_texture_half_float_linear"),this.getExtension("OES_element_index_uint"),this.getExtension("OES_standard_derivatives"),this.getExtension("EXT_sRGB"),this.getExtension("WEBGL_depth_texture"),this.getExtension("WEBGL_draw_buffers")),this.getExtension("WEBGL_compressed_texture_astc"),this.getExtension("EXT_texture_compression_bptc"),this.getExtension("WEBGL_compressed_texture_s3tc"),this.getExtension("WEBGL_compressed_texture_etc1"),this.getExtension("WEBGL_compressed_texture_pvrtc"),this.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this.drawBuffers=this.getExtension("WEBGL_draw_buffers","drawBuffers","drawBuffersWEBGL"),this.parameters={},this.parameters.maxTextureUnits=this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.parameters.maxAnisotropy=this.getExtension("EXT_texture_filter_anisotropic")?this.gl.getParameter(this.getExtension("EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}setSize(t,s){this.width=t,this.height=s,this.gl.canvas.width=t*this.dpr,this.gl.canvas.height=s*this.dpr,this.gl.canvas.style&&Object.assign(this.gl.canvas.style,{width:t+"px",height:s+"px"})}setViewport(t,s,i=0,r=0){this.state.viewport.width===t&&this.state.viewport.height===s||(this.state.viewport.width=t,this.state.viewport.height=s,this.state.viewport.x=i,this.state.viewport.y=r,this.gl.viewport(i,r,t,s))}setScissor(t,s,i=0,r=0){this.gl.scissor(i,r,t,s)}enable(t){this.state[t]!==!0&&(this.gl.enable(t),this.state[t]=!0)}disable(t){this.state[t]!==!1&&(this.gl.disable(t),this.state[t]=!1)}setBlendFunc(t,s,i,r){this.state.blendFunc.src===t&&this.state.blendFunc.dst===s&&this.state.blendFunc.srcAlpha===i&&this.state.blendFunc.dstAlpha===r||(this.state.blendFunc.src=t,this.state.blendFunc.dst=s,this.state.blendFunc.srcAlpha=i,this.state.blendFunc.dstAlpha=r,i!==void 0?this.gl.blendFuncSeparate(t,s,i,r):this.gl.blendFunc(t,s))}setBlendEquation(t,s){t=t||this.gl.FUNC_ADD,!(this.state.blendEquation.modeRGB===t&&this.state.blendEquation.modeAlpha===s)&&(this.state.blendEquation.modeRGB=t,this.state.blendEquation.modeAlpha=s,s!==void 0?this.gl.blendEquationSeparate(t,s):this.gl.blendEquation(t))}setCullFace(t){this.state.cullFace!==t&&(this.state.cullFace=t,this.gl.cullFace(t))}setFrontFace(t){this.state.frontFace!==t&&(this.state.frontFace=t,this.gl.frontFace(t))}setDepthMask(t){this.state.depthMask!==t&&(this.state.depthMask=t,this.gl.depthMask(t))}setDepthFunc(t){this.state.depthFunc!==t&&(this.state.depthFunc=t,this.gl.depthFunc(t))}setStencilMask(t){this.state.stencilMask!==t&&(this.state.stencilMask=t,this.gl.stencilMask(t))}setStencilFunc(t,s,i){this.state.stencilFunc===t&&this.state.stencilRef===s&&this.state.stencilFuncMask===i||(this.state.stencilFunc=t||this.gl.ALWAYS,this.state.stencilRef=s||0,this.state.stencilFuncMask=i||0,this.gl.stencilFunc(t||this.gl.ALWAYS,s||0,i||0))}setStencilOp(t,s,i){this.state.stencilFail===t&&this.state.stencilDepthFail===s&&this.state.stencilDepthPass===i||(this.state.stencilFail=t,this.state.stencilDepthFail=s,this.state.stencilDepthPass=i,this.gl.stencilOp(t,s,i))}activeTexture(t){this.state.activeTextureUnit!==t&&(this.state.activeTextureUnit=t,this.gl.activeTexture(this.gl.TEXTURE0+t))}bindFramebuffer({target:t=this.gl.FRAMEBUFFER,buffer:s=null}={}){this.state.framebuffer!==s&&(this.state.framebuffer=s,this.gl.bindFramebuffer(t,s))}getExtension(t,s,i){return s&&this.gl[s]?this.gl[s].bind(this.gl):(this.extensions[t]||(this.extensions[t]=this.gl.getExtension(t)),s?this.extensions[t]?this.extensions[t][i].bind(this.extensions[t]):null:this.extensions[t])}sortOpaque(t,s){return t.renderOrder!==s.renderOrder?t.renderOrder-s.renderOrder:t.program.id!==s.program.id?t.program.id-s.program.id:t.zDepth!==s.zDepth?t.zDepth-s.zDepth:s.id-t.id}sortTransparent(t,s){return t.renderOrder!==s.renderOrder?t.renderOrder-s.renderOrder:t.zDepth!==s.zDepth?s.zDepth-t.zDepth:s.id-t.id}sortUI(t,s){return t.renderOrder!==s.renderOrder?t.renderOrder-s.renderOrder:t.program.id!==s.program.id?t.program.id-s.program.id:s.id-t.id}getRenderList({scene:t,camera:s,frustumCull:i,sort:r}){let n=[];if(s&&i&&s.updateFrustum(),t.traverse(h=>{if(!h.visible)return!0;h.draw&&(i&&h.frustumCulled&&s&&!s.frustumIntersectsMesh(h)||n.push(h))}),r){const h=[],l=[],a=[];n.forEach(c=>{c.program.transparent?c.program.depthTest?l.push(c):a.push(c):h.push(c),c.zDepth=0,!(c.renderOrder!==0||!c.program.depthTest||!s)&&(c.worldMatrix.getTranslation(N),N.applyMatrix4(s.projectionViewMatrix),c.zDepth=N.z)}),h.sort(this.sortOpaque),l.sort(this.sortTransparent),a.sort(this.sortUI),n=h.concat(l,a)}return n}render({scene:t,camera:s,target:i=null,update:r=!0,sort:n=!0,frustumCull:h=!0,clear:l}){i===null?(this.bindFramebuffer(),this.setViewport(this.width*this.dpr,this.height*this.dpr)):(this.bindFramebuffer(i),this.setViewport(i.width,i.height)),(l||this.autoClear&&l!==!1)&&(this.depth&&(!i||i.depth)&&(this.enable(this.gl.DEPTH_TEST),this.setDepthMask(!0)),(this.stencil||!i||i.stencil)&&(this.enable(this.gl.STENCIL_TEST),this.setStencilMask(255)),this.gl.clear((this.color?this.gl.COLOR_BUFFER_BIT:0)|(this.depth?this.gl.DEPTH_BUFFER_BIT:0)|(this.stencil?this.gl.STENCIL_BUFFER_BIT:0))),r&&t.updateMatrixWorld(),s&&s.updateMatrixWorld(),this.getRenderList({scene:t,camera:s,frustumCull:h,sort:n}).forEach(c=>{c.draw({camera:s})})}}function It(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function Bt(e,t,s,i,r){return e[0]=t,e[1]=s,e[2]=i,e[3]=r,e}function Dt(e,t){let s=t[0],i=t[1],r=t[2],n=t[3],h=s*s+i*i+r*r+n*n;return h>0&&(h=1/Math.sqrt(h)),e[0]=s*h,e[1]=i*h,e[2]=r*h,e[3]=n*h,e}function qt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Nt(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function vt(e,t,s){s=s*.5;let i=Math.sin(s);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(s),e}function Q(e,t,s){let i=t[0],r=t[1],n=t[2],h=t[3],l=s[0],a=s[1],c=s[2],f=s[3];return e[0]=i*f+h*l+r*c-n*a,e[1]=r*f+h*a+n*l-i*c,e[2]=n*f+h*c+i*a-r*l,e[3]=h*f-i*l-r*a-n*c,e}function Pt(e,t,s){s*=.5;let i=t[0],r=t[1],n=t[2],h=t[3],l=Math.sin(s),a=Math.cos(s);return e[0]=i*a+h*l,e[1]=r*a+n*l,e[2]=n*a-r*l,e[3]=h*a-i*l,e}function Vt(e,t,s){s*=.5;let i=t[0],r=t[1],n=t[2],h=t[3],l=Math.sin(s),a=Math.cos(s);return e[0]=i*a-n*l,e[1]=r*a+h*l,e[2]=n*a+i*l,e[3]=h*a-r*l,e}function Ut(e,t,s){s*=.5;let i=t[0],r=t[1],n=t[2],h=t[3],l=Math.sin(s),a=Math.cos(s);return e[0]=i*a+r*l,e[1]=r*a-i*l,e[2]=n*a+h*l,e[3]=h*a-n*l,e}function Xt(e,t,s,i){let r=t[0],n=t[1],h=t[2],l=t[3],a=s[0],c=s[1],f=s[2],d=s[3],g,u,p,x,o;return u=r*a+n*c+h*f+l*d,u<0&&(u=-u,a=-a,c=-c,f=-f,d=-d),1-u>1e-6?(g=Math.acos(u),p=Math.sin(g),x=Math.sin((1-i)*g)/p,o=Math.sin(i*g)/p):(x=1-i,o=i),e[0]=x*r+o*a,e[1]=x*n+o*c,e[2]=x*h+o*f,e[3]=x*l+o*d,e}function kt(e,t){let s=t[0],i=t[1],r=t[2],n=t[3],h=s*s+i*i+r*r+n*n,l=h?1/h:0;return e[0]=-s*l,e[1]=-i*l,e[2]=-r*l,e[3]=n*l,e}function Gt(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function Wt(e,t){let s=t[0]+t[4]+t[8],i;if(s>0)i=Math.sqrt(s+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let n=(r+1)%3,h=(r+2)%3;i=Math.sqrt(t[r*3+r]-t[n*3+n]-t[h*3+h]+1),e[r]=.5*i,i=.5/i,e[3]=(t[n*3+h]-t[h*3+n])*i,e[n]=(t[n*3+r]+t[r*3+n])*i,e[h]=(t[h*3+r]+t[r*3+h])*i}return e}function Yt(e,t,s="YXZ"){let i=Math.sin(t[0]*.5),r=Math.cos(t[0]*.5),n=Math.sin(t[1]*.5),h=Math.cos(t[1]*.5),l=Math.sin(t[2]*.5),a=Math.cos(t[2]*.5);return s==="XYZ"?(e[0]=i*h*a+r*n*l,e[1]=r*n*a-i*h*l,e[2]=r*h*l+i*n*a,e[3]=r*h*a-i*n*l):s==="YXZ"?(e[0]=i*h*a+r*n*l,e[1]=r*n*a-i*h*l,e[2]=r*h*l-i*n*a,e[3]=r*h*a+i*n*l):s==="ZXY"?(e[0]=i*h*a-r*n*l,e[1]=r*n*a+i*h*l,e[2]=r*h*l+i*n*a,e[3]=r*h*a-i*n*l):s==="ZYX"?(e[0]=i*h*a-r*n*l,e[1]=r*n*a+i*h*l,e[2]=r*h*l-i*n*a,e[3]=r*h*a+i*n*l):s==="YZX"?(e[0]=i*h*a+r*n*l,e[1]=r*n*a+i*h*l,e[2]=r*h*l-i*n*a,e[3]=r*h*a-i*n*l):s==="XZY"&&(e[0]=i*h*a-r*n*l,e[1]=r*n*a-i*h*l,e[2]=r*h*l+i*n*a,e[3]=r*h*a+i*n*l),e}const Zt=It,jt=Bt,Qt=qt,Ht=Dt;class Kt extends Array{constructor(t=0,s=0,i=0,r=1){super(t,s,i,r),this.onChange=()=>{},this._target=this;const n=["0","1","2","3"];return new Proxy(this,{set(h,l){const a=Reflect.set(...arguments);return a&&n.includes(l)&&h.onChange(),a}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set w(t){this._target[3]=t,this.onChange()}identity(){return Nt(this._target),this.onChange(),this}set(t,s,i,r){return t.length?this.copy(t):(jt(this._target,t,s,i,r),this.onChange(),this)}rotateX(t){return Pt(this._target,this._target,t),this.onChange(),this}rotateY(t){return Vt(this._target,this._target,t),this.onChange(),this}rotateZ(t){return Ut(this._target,this._target,t),this.onChange(),this}inverse(t=this._target){return kt(this._target,t),this.onChange(),this}conjugate(t=this._target){return Gt(this._target,t),this.onChange(),this}copy(t){return Zt(this._target,t),this.onChange(),this}normalize(t=this._target){return Ht(this._target,t),this.onChange(),this}multiply(t,s){return s?Q(this._target,t,s):Q(this._target,this._target,t),this.onChange(),this}dot(t){return Qt(this._target,t)}fromMatrix3(t){return Wt(this._target,t),this.onChange(),this}fromEuler(t,s){return Yt(this._target,t,t.order),s||this.onChange(),this}fromAxisAngle(t,s){return vt(this._target,t,s),this.onChange(),this}slerp(t,s){return Xt(this._target,this._target,t,s),this.onChange(),this}fromArray(t,s=0){return this._target[0]=t[s],this._target[1]=t[s+1],this._target[2]=t[s+2],this._target[3]=t[s+3],this.onChange(),this}toArray(t=[],s=0){return t[s]=this[0],t[s+1]=this[1],t[s+2]=this[2],t[s+3]=this[3],t}}const Jt=1e-6;function te(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ee(e,t,s,i,r,n,h,l,a,c,f,d,g,u,p,x,o){return e[0]=t,e[1]=s,e[2]=i,e[3]=r,e[4]=n,e[5]=h,e[6]=l,e[7]=a,e[8]=c,e[9]=f,e[10]=d,e[11]=g,e[12]=u,e[13]=p,e[14]=x,e[15]=o,e}function se(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ie(e,t){let s=t[0],i=t[1],r=t[2],n=t[3],h=t[4],l=t[5],a=t[6],c=t[7],f=t[8],d=t[9],g=t[10],u=t[11],p=t[12],x=t[13],o=t[14],y=t[15],A=s*l-i*h,m=s*a-r*h,M=s*c-n*h,E=i*a-r*l,_=i*c-n*l,b=r*c-n*a,S=f*x-d*p,C=f*o-g*p,F=f*y-u*p,L=d*o-g*x,z=d*y-u*x,O=g*y-u*o,w=A*O-m*z+M*L+E*F-_*C+b*S;return w?(w=1/w,e[0]=(l*O-a*z+c*L)*w,e[1]=(r*z-i*O-n*L)*w,e[2]=(x*b-o*_+y*E)*w,e[3]=(g*_-d*b-u*E)*w,e[4]=(a*F-h*O-c*C)*w,e[5]=(s*O-r*F+n*C)*w,e[6]=(o*M-p*b-y*m)*w,e[7]=(f*b-g*M+u*m)*w,e[8]=(h*z-l*F+c*S)*w,e[9]=(i*F-s*z-n*S)*w,e[10]=(p*_-x*M+y*A)*w,e[11]=(d*M-f*_-u*A)*w,e[12]=(l*C-h*L-a*S)*w,e[13]=(s*L-i*C+r*S)*w,e[14]=(x*m-p*E-o*A)*w,e[15]=(f*E-d*m+g*A)*w,e):null}function lt(e){let t=e[0],s=e[1],i=e[2],r=e[3],n=e[4],h=e[5],l=e[6],a=e[7],c=e[8],f=e[9],d=e[10],g=e[11],u=e[12],p=e[13],x=e[14],o=e[15],y=t*h-s*n,A=t*l-i*n,m=t*a-r*n,M=s*l-i*h,E=s*a-r*h,_=i*a-r*l,b=c*p-f*u,S=c*x-d*u,C=c*o-g*u,F=f*x-d*p,L=f*o-g*p,z=d*o-g*x;return y*z-A*L+m*F+M*C-E*S+_*b}function H(e,t,s){let i=t[0],r=t[1],n=t[2],h=t[3],l=t[4],a=t[5],c=t[6],f=t[7],d=t[8],g=t[9],u=t[10],p=t[11],x=t[12],o=t[13],y=t[14],A=t[15],m=s[0],M=s[1],E=s[2],_=s[3];return e[0]=m*i+M*l+E*d+_*x,e[1]=m*r+M*a+E*g+_*o,e[2]=m*n+M*c+E*u+_*y,e[3]=m*h+M*f+E*p+_*A,m=s[4],M=s[5],E=s[6],_=s[7],e[4]=m*i+M*l+E*d+_*x,e[5]=m*r+M*a+E*g+_*o,e[6]=m*n+M*c+E*u+_*y,e[7]=m*h+M*f+E*p+_*A,m=s[8],M=s[9],E=s[10],_=s[11],e[8]=m*i+M*l+E*d+_*x,e[9]=m*r+M*a+E*g+_*o,e[10]=m*n+M*c+E*u+_*y,e[11]=m*h+M*f+E*p+_*A,m=s[12],M=s[13],E=s[14],_=s[15],e[12]=m*i+M*l+E*d+_*x,e[13]=m*r+M*a+E*g+_*o,e[14]=m*n+M*c+E*u+_*y,e[15]=m*h+M*f+E*p+_*A,e}function re(e,t,s){let i=s[0],r=s[1],n=s[2],h,l,a,c,f,d,g,u,p,x,o,y;return t===e?(e[12]=t[0]*i+t[4]*r+t[8]*n+t[12],e[13]=t[1]*i+t[5]*r+t[9]*n+t[13],e[14]=t[2]*i+t[6]*r+t[10]*n+t[14],e[15]=t[3]*i+t[7]*r+t[11]*n+t[15]):(h=t[0],l=t[1],a=t[2],c=t[3],f=t[4],d=t[5],g=t[6],u=t[7],p=t[8],x=t[9],o=t[10],y=t[11],e[0]=h,e[1]=l,e[2]=a,e[3]=c,e[4]=f,e[5]=d,e[6]=g,e[7]=u,e[8]=p,e[9]=x,e[10]=o,e[11]=y,e[12]=h*i+f*r+p*n+t[12],e[13]=l*i+d*r+x*n+t[13],e[14]=a*i+g*r+o*n+t[14],e[15]=c*i+u*r+y*n+t[15]),e}function ne(e,t,s){let i=s[0],r=s[1],n=s[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function he(e,t,s,i){let r=i[0],n=i[1],h=i[2],l=Math.hypot(r,n,h),a,c,f,d,g,u,p,x,o,y,A,m,M,E,_,b,S,C,F,L,z,O,w,R;return Math.abs(l)<Jt?null:(l=1/l,r*=l,n*=l,h*=l,a=Math.sin(s),c=Math.cos(s),f=1-c,d=t[0],g=t[1],u=t[2],p=t[3],x=t[4],o=t[5],y=t[6],A=t[7],m=t[8],M=t[9],E=t[10],_=t[11],b=r*r*f+c,S=n*r*f+h*a,C=h*r*f-n*a,F=r*n*f-h*a,L=n*n*f+c,z=h*n*f+r*a,O=r*h*f+n*a,w=n*h*f-r*a,R=h*h*f+c,e[0]=d*b+x*S+m*C,e[1]=g*b+o*S+M*C,e[2]=u*b+y*S+E*C,e[3]=p*b+A*S+_*C,e[4]=d*F+x*L+m*z,e[5]=g*F+o*L+M*z,e[6]=u*F+y*L+E*z,e[7]=p*F+A*L+_*z,e[8]=d*O+x*w+m*R,e[9]=g*O+o*w+M*R,e[10]=u*O+y*w+E*R,e[11]=p*O+A*w+_*R,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function le(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function at(e,t){let s=t[0],i=t[1],r=t[2],n=t[4],h=t[5],l=t[6],a=t[8],c=t[9],f=t[10];return e[0]=Math.hypot(s,i,r),e[1]=Math.hypot(n,h,l),e[2]=Math.hypot(a,c,f),e}function ae(e){let t=e[0],s=e[1],i=e[2],r=e[4],n=e[5],h=e[6],l=e[8],a=e[9],c=e[10];const f=t*t+s*s+i*i,d=r*r+n*n+h*h,g=l*l+a*a+c*c;return Math.sqrt(Math.max(f,d,g))}const ct=(function(){const e=[1,1,1];return function(t,s){let i=e;at(i,s);let r=1/i[0],n=1/i[1],h=1/i[2],l=s[0]*r,a=s[1]*n,c=s[2]*h,f=s[4]*r,d=s[5]*n,g=s[6]*h,u=s[8]*r,p=s[9]*n,x=s[10]*h,o=l+d+x,y=0;return o>0?(y=Math.sqrt(o+1)*2,t[3]=.25*y,t[0]=(g-p)/y,t[1]=(u-c)/y,t[2]=(a-f)/y):l>d&&l>x?(y=Math.sqrt(1+l-d-x)*2,t[3]=(g-p)/y,t[0]=.25*y,t[1]=(a+f)/y,t[2]=(u+c)/y):d>x?(y=Math.sqrt(1+d-l-x)*2,t[3]=(u-c)/y,t[0]=(a+f)/y,t[1]=.25*y,t[2]=(g+p)/y):(y=Math.sqrt(1+x-l-d)*2,t[3]=(a-f)/y,t[0]=(u+c)/y,t[1]=(g+p)/y,t[2]=.25*y),t}})();function ce(e,t,s,i){let r=$([e[0],e[1],e[2]]);const n=$([e[4],e[5],e[6]]),h=$([e[8],e[9],e[10]]);lt(e)<0&&(r=-r),s[0]=e[12],s[1]=e[13],s[2]=e[14];const a=e.slice(),c=1/r,f=1/n,d=1/h;a[0]*=c,a[1]*=c,a[2]*=c,a[4]*=f,a[5]*=f,a[6]*=f,a[8]*=d,a[9]*=d,a[10]*=d,ct(t,a),i[0]=r,i[1]=n,i[2]=h}function fe(e,t,s,i){const r=e,n=t[0],h=t[1],l=t[2],a=t[3],c=n+n,f=h+h,d=l+l,g=n*c,u=n*f,p=n*d,x=h*f,o=h*d,y=l*d,A=a*c,m=a*f,M=a*d,E=i[0],_=i[1],b=i[2];return r[0]=(1-(x+y))*E,r[1]=(u+M)*E,r[2]=(p-m)*E,r[3]=0,r[4]=(u-M)*_,r[5]=(1-(g+y))*_,r[6]=(o+A)*_,r[7]=0,r[8]=(p+m)*b,r[9]=(o-A)*b,r[10]=(1-(g+x))*b,r[11]=0,r[12]=s[0],r[13]=s[1],r[14]=s[2],r[15]=1,r}function de(e,t){let s=t[0],i=t[1],r=t[2],n=t[3],h=s+s,l=i+i,a=r+r,c=s*h,f=i*h,d=i*l,g=r*h,u=r*l,p=r*a,x=n*h,o=n*l,y=n*a;return e[0]=1-d-p,e[1]=f+y,e[2]=g-o,e[3]=0,e[4]=f-y,e[5]=1-c-p,e[6]=u+x,e[7]=0,e[8]=g+o,e[9]=u-x,e[10]=1-c-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ge(e,t,s,i,r){let n=1/Math.tan(t/2),h=1/(i-r);return e[0]=n/s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(r+i)*h,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*r*i*h,e[15]=0,e}function ue(e,t,s,i,r,n,h){let l=1/(t-s),a=1/(i-r),c=1/(n-h);return e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+s)*l,e[13]=(r+i)*a,e[14]=(h+n)*c,e[15]=1,e}function pe(e,t,s,i){let r=t[0],n=t[1],h=t[2],l=i[0],a=i[1],c=i[2],f=r-s[0],d=n-s[1],g=h-s[2],u=f*f+d*d+g*g;u===0?g=1:(u=1/Math.sqrt(u),f*=u,d*=u,g*=u);let p=a*g-c*d,x=c*f-l*g,o=l*d-a*f;return u=p*p+x*x+o*o,u===0&&(c?l+=1e-6:a?c+=1e-6:a+=1e-6,p=a*g-c*d,x=c*f-l*g,o=l*d-a*f,u=p*p+x*x+o*o),u=1/Math.sqrt(u),p*=u,x*=u,o*=u,e[0]=p,e[1]=x,e[2]=o,e[3]=0,e[4]=d*o-g*x,e[5]=g*p-f*o,e[6]=f*x-d*p,e[7]=0,e[8]=f,e[9]=d,e[10]=g,e[11]=0,e[12]=r,e[13]=n,e[14]=h,e[15]=1,e}function K(e,t,s){return e[0]=t[0]+s[0],e[1]=t[1]+s[1],e[2]=t[2]+s[2],e[3]=t[3]+s[3],e[4]=t[4]+s[4],e[5]=t[5]+s[5],e[6]=t[6]+s[6],e[7]=t[7]+s[7],e[8]=t[8]+s[8],e[9]=t[9]+s[9],e[10]=t[10]+s[10],e[11]=t[11]+s[11],e[12]=t[12]+s[12],e[13]=t[13]+s[13],e[14]=t[14]+s[14],e[15]=t[15]+s[15],e}function J(e,t,s){return e[0]=t[0]-s[0],e[1]=t[1]-s[1],e[2]=t[2]-s[2],e[3]=t[3]-s[3],e[4]=t[4]-s[4],e[5]=t[5]-s[5],e[6]=t[6]-s[6],e[7]=t[7]-s[7],e[8]=t[8]-s[8],e[9]=t[9]-s[9],e[10]=t[10]-s[10],e[11]=t[11]-s[11],e[12]=t[12]-s[12],e[13]=t[13]-s[13],e[14]=t[14]-s[14],e[15]=t[15]-s[15],e}function xe(e,t,s){return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11]*s,e[12]=t[12]*s,e[13]=t[13]*s,e[14]=t[14]*s,e[15]=t[15]*s,e}class I extends Array{constructor(t=1,s=0,i=0,r=0,n=0,h=1,l=0,a=0,c=0,f=0,d=1,g=0,u=0,p=0,x=0,o=1){return super(t,s,i,r,n,h,l,a,c,f,d,g,u,p,x,o),this}get x(){return this[12]}get y(){return this[13]}get z(){return this[14]}get w(){return this[15]}set x(t){this[12]=t}set y(t){this[13]=t}set z(t){this[14]=t}set w(t){this[15]=t}set(t,s,i,r,n,h,l,a,c,f,d,g,u,p,x,o){return t.length?this.copy(t):(ee(this,t,s,i,r,n,h,l,a,c,f,d,g,u,p,x,o),this)}translate(t,s=this){return re(this,s,t),this}rotate(t,s,i=this){return he(this,i,t,s),this}scale(t,s=this){return ne(this,s,typeof t=="number"?[t,t,t]:t),this}add(t,s){return s?K(this,t,s):K(this,this,t),this}sub(t,s){return s?J(this,t,s):J(this,this,t),this}multiply(t,s){return t.length?s?H(this,t,s):H(this,this,t):xe(this,this,t),this}identity(){return se(this),this}copy(t){return te(this,t),this}fromPerspective({fov:t,aspect:s,near:i,far:r}={}){return ge(this,t,s,i,r),this}fromOrthogonal({left:t,right:s,bottom:i,top:r,near:n,far:h}){return ue(this,t,s,i,r,n,h),this}fromQuaternion(t){return de(this,t),this}setPosition(t){return this.x=t[0],this.y=t[1],this.z=t[2],this}inverse(t=this){return ie(this,t),this}compose(t,s,i){return fe(this,t,s,i),this}decompose(t,s,i){return ce(this,t,s,i),this}getRotation(t){return ct(t,this),this}getTranslation(t){return le(t,this),this}getScaling(t){return at(t,this),this}getMaxScaleOnAxis(){return ae(this)}lookAt(t,s,i){return pe(this,t,s,i),this}determinant(){return lt(this)}fromArray(t,s=0){return this[0]=t[s],this[1]=t[s+1],this[2]=t[s+2],this[3]=t[s+3],this[4]=t[s+4],this[5]=t[s+5],this[6]=t[s+6],this[7]=t[s+7],this[8]=t[s+8],this[9]=t[s+9],this[10]=t[s+10],this[11]=t[s+11],this[12]=t[s+12],this[13]=t[s+13],this[14]=t[s+14],this[15]=t[s+15],this}toArray(t=[],s=0){return t[s]=this[0],t[s+1]=this[1],t[s+2]=this[2],t[s+3]=this[3],t[s+4]=this[4],t[s+5]=this[5],t[s+6]=this[6],t[s+7]=this[7],t[s+8]=this[8],t[s+9]=this[9],t[s+10]=this[10],t[s+11]=this[11],t[s+12]=this[12],t[s+13]=this[13],t[s+14]=this[14],t[s+15]=this[15],t}}function oe(e,t,s="YXZ"){return s==="XYZ"?(e[1]=Math.asin(Math.min(Math.max(t[8],-1),1)),Math.abs(t[8])<.99999?(e[0]=Math.atan2(-t[9],t[10]),e[2]=Math.atan2(-t[4],t[0])):(e[0]=Math.atan2(t[6],t[5]),e[2]=0)):s==="YXZ"?(e[0]=Math.asin(-Math.min(Math.max(t[9],-1),1)),Math.abs(t[9])<.99999?(e[1]=Math.atan2(t[8],t[10]),e[2]=Math.atan2(t[1],t[5])):(e[1]=Math.atan2(-t[2],t[0]),e[2]=0)):s==="ZXY"?(e[0]=Math.asin(Math.min(Math.max(t[6],-1),1)),Math.abs(t[6])<.99999?(e[1]=Math.atan2(-t[2],t[10]),e[2]=Math.atan2(-t[4],t[5])):(e[1]=0,e[2]=Math.atan2(t[1],t[0]))):s==="ZYX"?(e[1]=Math.asin(-Math.min(Math.max(t[2],-1),1)),Math.abs(t[2])<.99999?(e[0]=Math.atan2(t[6],t[10]),e[2]=Math.atan2(t[1],t[0])):(e[0]=0,e[2]=Math.atan2(-t[4],t[5]))):s==="YZX"?(e[2]=Math.asin(Math.min(Math.max(t[1],-1),1)),Math.abs(t[1])<.99999?(e[0]=Math.atan2(-t[9],t[5]),e[1]=Math.atan2(-t[2],t[0])):(e[0]=0,e[1]=Math.atan2(t[8],t[10]))):s==="XZY"&&(e[2]=Math.asin(-Math.min(Math.max(t[4],-1),1)),Math.abs(t[4])<.99999?(e[0]=Math.atan2(t[6],t[5]),e[1]=Math.atan2(t[8],t[0])):(e[0]=Math.atan2(-t[9],t[10]),e[1]=0)),e}const tt=new I;class ye extends Array{constructor(t=0,s=t,i=t,r="YXZ"){super(t,s,i),this.order=r,this.onChange=()=>{},this._target=this;const n=["0","1","2"];return new Proxy(this,{set(h,l){const a=Reflect.set(...arguments);return a&&n.includes(l)&&h.onChange(),a}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set(t,s=t,i=t){return t.length?this.copy(t):(this._target[0]=t,this._target[1]=s,this._target[2]=i,this.onChange(),this)}copy(t){return this._target[0]=t[0],this._target[1]=t[1],this._target[2]=t[2],this.onChange(),this}reorder(t){return this._target.order=t,this.onChange(),this}fromRotationMatrix(t,s=this.order){return oe(this._target,t,s),this.onChange(),this}fromQuaternion(t,s=this.order,i){return tt.fromQuaternion(t),this._target.fromRotationMatrix(tt,s),i||this.onChange(),this}fromArray(t,s=0){return this._target[0]=t[s],this._target[1]=t[s+1],this._target[2]=t[s+2],this}toArray(t=[],s=0){return t[s]=this[0],t[s+1]=this[1],t[s+2]=this[2],t}}class Me{constructor(){this.parent=null,this.children=[],this.visible=!0,this.matrix=new I,this.worldMatrix=new I,this.matrixAutoUpdate=!0,this.worldMatrixNeedsUpdate=!1,this.position=new T,this.quaternion=new Kt,this.scale=new T(1),this.rotation=new ye,this.up=new T(0,1,0),this.rotation._target.onChange=()=>this.quaternion.fromEuler(this.rotation,!0),this.quaternion._target.onChange=()=>this.rotation.fromQuaternion(this.quaternion,void 0,!0)}setParent(t,s=!0){this.parent&&t!==this.parent&&this.parent.removeChild(this,!1),this.parent=t,s&&t&&t.addChild(this,!1)}addChild(t,s=!0){~this.children.indexOf(t)||this.children.push(t),s&&t.setParent(this,!1)}removeChild(t,s=!0){~this.children.indexOf(t)&&this.children.splice(this.children.indexOf(t),1),s&&t.setParent(null,!1)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.worldMatrixNeedsUpdate||t)&&(this.parent===null?this.worldMatrix.copy(this.matrix):this.worldMatrix.multiply(this.parent.worldMatrix,this.matrix),this.worldMatrixNeedsUpdate=!1,t=!0);for(let s=0,i=this.children.length;s<i;s++)this.children[s].updateMatrixWorld(t)}updateMatrix(){this.matrix.compose(this.quaternion,this.position,this.scale),this.worldMatrixNeedsUpdate=!0}traverse(t){if(!t(this))for(let s=0,i=this.children.length;s<i;s++)this.children[s].traverse(t)}decompose(){this.matrix.decompose(this.quaternion._target,this.position,this.scale),this.rotation.fromQuaternion(this.quaternion)}lookAt(t,s=!1){s?this.matrix.lookAt(this.position,t,this.up):this.matrix.lookAt(t,this.position,this.up),this.matrix.getRotation(this.quaternion._target),this.rotation.fromQuaternion(this.quaternion)}}function me(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function _e(e,t){let s=t[0],i=t[1],r=t[2],n=t[3],h=s+s,l=i+i,a=r+r,c=s*h,f=i*h,d=i*l,g=r*h,u=r*l,p=r*a,x=n*h,o=n*l,y=n*a;return e[0]=1-d-p,e[3]=f-y,e[6]=g+o,e[1]=f+y,e[4]=1-c-p,e[7]=u-x,e[2]=g-o,e[5]=u+x,e[8]=1-c-d,e}function Ee(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function we(e,t,s,i,r,n,h,l,a,c){return e[0]=t,e[1]=s,e[2]=i,e[3]=r,e[4]=n,e[5]=h,e[6]=l,e[7]=a,e[8]=c,e}function Ae(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function be(e,t){let s=t[0],i=t[1],r=t[2],n=t[3],h=t[4],l=t[5],a=t[6],c=t[7],f=t[8],d=f*h-l*c,g=-f*n+l*a,u=c*n-h*a,p=s*d+i*g+r*u;return p?(p=1/p,e[0]=d*p,e[1]=(-f*i+r*c)*p,e[2]=(l*i-r*h)*p,e[3]=g*p,e[4]=(f*s-r*a)*p,e[5]=(-l*s+r*n)*p,e[6]=u*p,e[7]=(-c*s+i*a)*p,e[8]=(h*s-i*n)*p,e):null}function et(e,t,s){let i=t[0],r=t[1],n=t[2],h=t[3],l=t[4],a=t[5],c=t[6],f=t[7],d=t[8],g=s[0],u=s[1],p=s[2],x=s[3],o=s[4],y=s[5],A=s[6],m=s[7],M=s[8];return e[0]=g*i+u*h+p*c,e[1]=g*r+u*l+p*f,e[2]=g*n+u*a+p*d,e[3]=x*i+o*h+y*c,e[4]=x*r+o*l+y*f,e[5]=x*n+o*a+y*d,e[6]=A*i+m*h+M*c,e[7]=A*r+m*l+M*f,e[8]=A*n+m*a+M*d,e}function Fe(e,t,s){let i=t[0],r=t[1],n=t[2],h=t[3],l=t[4],a=t[5],c=t[6],f=t[7],d=t[8],g=s[0],u=s[1];return e[0]=i,e[1]=r,e[2]=n,e[3]=h,e[4]=l,e[5]=a,e[6]=g*i+u*h+c,e[7]=g*r+u*l+f,e[8]=g*n+u*a+d,e}function ze(e,t,s){let i=t[0],r=t[1],n=t[2],h=t[3],l=t[4],a=t[5],c=t[6],f=t[7],d=t[8],g=Math.sin(s),u=Math.cos(s);return e[0]=u*i+g*h,e[1]=u*r+g*l,e[2]=u*n+g*a,e[3]=u*h-g*i,e[4]=u*l-g*r,e[5]=u*a-g*n,e[6]=c,e[7]=f,e[8]=d,e}function Se(e,t,s){let i=s[0],r=s[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Ce(e,t){let s=t[0],i=t[1],r=t[2],n=t[3],h=t[4],l=t[5],a=t[6],c=t[7],f=t[8],d=t[9],g=t[10],u=t[11],p=t[12],x=t[13],o=t[14],y=t[15],A=s*l-i*h,m=s*a-r*h,M=s*c-n*h,E=i*a-r*l,_=i*c-n*l,b=r*c-n*a,S=f*x-d*p,C=f*o-g*p,F=f*y-u*p,L=d*o-g*x,z=d*y-u*x,O=g*y-u*o,w=A*O-m*z+M*L+E*F-_*C+b*S;return w?(w=1/w,e[0]=(l*O-a*z+c*L)*w,e[1]=(a*F-h*O-c*C)*w,e[2]=(h*z-l*F+c*S)*w,e[3]=(r*z-i*O-n*L)*w,e[4]=(s*O-r*F+n*C)*w,e[5]=(i*F-s*z-n*S)*w,e[6]=(x*b-o*_+y*E)*w,e[7]=(o*M-p*b-y*m)*w,e[8]=(p*_-x*M+y*A)*w,e):null}class Le extends Array{constructor(t=1,s=0,i=0,r=0,n=1,h=0,l=0,a=0,c=1){return super(t,s,i,r,n,h,l,a,c),this}set(t,s,i,r,n,h,l,a,c){return t.length?this.copy(t):(we(this,t,s,i,r,n,h,l,a,c),this)}translate(t,s=this){return Fe(this,s,t),this}rotate(t,s=this){return ze(this,s,t),this}scale(t,s=this){return Se(this,s,t),this}multiply(t,s){return s?et(this,t,s):et(this,this,t),this}identity(){return Ae(this),this}copy(t){return Ee(this,t),this}fromMatrix4(t){return me(this,t),this}fromQuaternion(t){return _e(this,t),this}fromBasis(t,s,i){return this.set(t[0],t[1],t[2],s[0],s[1],s[2],i[0],i[1],i[2]),this}inverse(t=this){return be(this,t),this}getNormalMatrix(t){return Ce(this,t),this}}let Oe=0;class je extends Me{constructor(t,{geometry:s,program:i,mode:r=t.TRIANGLES,frustumCulled:n=!0,renderOrder:h=0}={}){super(),t.canvas,this.gl=t,this.id=Oe++,this.geometry=s,this.program=i,this.mode=r,this.frustumCulled=n,this.renderOrder=h,this.modelViewMatrix=new I,this.normalMatrix=new Le,this.beforeRenderCallbacks=[],this.afterRenderCallbacks=[]}onBeforeRender(t){return this.beforeRenderCallbacks.push(t),this}onAfterRender(t){return this.afterRenderCallbacks.push(t),this}draw({camera:t}={}){t&&(this.program.uniforms.modelMatrix||Object.assign(this.program.uniforms,{modelMatrix:{value:null},viewMatrix:{value:null},modelViewMatrix:{value:null},normalMatrix:{value:null},projectionMatrix:{value:null},cameraPosition:{value:null}}),this.program.uniforms.projectionMatrix.value=t.projectionMatrix,this.program.uniforms.cameraPosition.value=t.worldPosition,this.program.uniforms.viewMatrix.value=t.viewMatrix,this.modelViewMatrix.multiply(t.viewMatrix,this.worldMatrix),this.normalMatrix.getNormalMatrix(this.modelViewMatrix),this.program.uniforms.modelMatrix.value=this.worldMatrix,this.program.uniforms.modelViewMatrix.value=this.modelViewMatrix,this.program.uniforms.normalMatrix.value=this.normalMatrix),this.beforeRenderCallbacks.forEach(i=>i&&i({mesh:this,camera:t}));let s=this.program.cullFace&&this.worldMatrix.determinant()<0;this.program.use({flipFaces:s}),this.geometry.draw({mode:this.mode,program:this.program}),this.afterRenderCallbacks.forEach(i=>i&&i({mesh:this,camera:t}))}}function Te(e,t){return e[0]=t[0],e[1]=t[1],e}function Re(e,t,s){return e[0]=t,e[1]=s,e}function st(e,t,s){return e[0]=t[0]+s[0],e[1]=t[1]+s[1],e}function it(e,t,s){return e[0]=t[0]-s[0],e[1]=t[1]-s[1],e}function $e(e,t,s){return e[0]=t[0]*s[0],e[1]=t[1]*s[1],e}function Ie(e,t,s){return e[0]=t[0]/s[0],e[1]=t[1]/s[1],e}function v(e,t,s){return e[0]=t[0]*s,e[1]=t[1]*s,e}function Be(e,t){var s=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(s*s+i*i)}function De(e,t){var s=t[0]-e[0],i=t[1]-e[1];return s*s+i*i}function rt(e){var t=e[0],s=e[1];return Math.sqrt(t*t+s*s)}function qe(e){var t=e[0],s=e[1];return t*t+s*s}function Ne(e,t){return e[0]=-t[0],e[1]=-t[1],e}function ve(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function Pe(e,t){var s=t[0],i=t[1],r=s*s+i*i;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}function Ve(e,t){return e[0]*t[0]+e[1]*t[1]}function nt(e,t){return e[0]*t[1]-e[1]*t[0]}function Ue(e,t,s,i){var r=t[0],n=t[1];return e[0]=r+i*(s[0]-r),e[1]=n+i*(s[1]-n),e}function Xe(e,t,s,i,r){const n=Math.exp(-i*r);let h=t[0],l=t[1];return e[0]=s[0]+(h-s[0])*n,e[1]=s[1]+(l-s[1])*n,e}function ke(e,t,s){var i=t[0],r=t[1];return e[0]=s[0]*i+s[3]*r+s[6],e[1]=s[1]*i+s[4]*r+s[7],e}function Ge(e,t,s){let i=t[0],r=t[1];return e[0]=s[0]*i+s[4]*r+s[12],e[1]=s[1]*i+s[5]*r+s[13],e}function We(e,t){return e[0]===t[0]&&e[1]===t[1]}class ft extends Array{constructor(t=0,s=t){return super(t,s),this}get x(){return this[0]}get y(){return this[1]}set x(t){this[0]=t}set y(t){this[1]=t}set(t,s=t){return t.length?this.copy(t):(Re(this,t,s),this)}copy(t){return Te(this,t),this}add(t,s){return s?st(this,t,s):st(this,this,t),this}sub(t,s){return s?it(this,t,s):it(this,this,t),this}multiply(t){return t.length?$e(this,this,t):v(this,this,t),this}divide(t){return t.length?Ie(this,this,t):v(this,this,1/t),this}inverse(t=this){return ve(this,t),this}len(){return rt(this)}distance(t){return t?Be(this,t):rt(this)}squaredLen(){return this.squaredDistance()}squaredDistance(t){return t?De(this,t):qe(this)}negate(t=this){return Ne(this,t),this}cross(t,s){return s?nt(t,s):nt(this,t)}scale(t){return v(this,this,t),this}normalize(){return Pe(this,this),this}dot(t){return Ve(this,t)}equals(t){return We(this,t)}applyMatrix3(t){return ke(this,this,t),this}applyMatrix4(t){return Ge(this,this,t),this}lerp(t,s){return Ue(this,this,t,s),this}smoothLerp(t,s,i){return Xe(this,this,t,s,i),this}clone(){return new ft(this[0],this[1])}fromArray(t,s=0){return this[0]=t[s],this[1]=t[s+1],this}toArray(t=[],s=0){return t[s]=this[0],t[s+1]=this[1],t}}class Qe extends Ct{constructor(t,{attributes:s={}}={}){Object.assign(s,{position:{size:2,data:new Float32Array([-1,-1,3,-1,-1,3])},uv:{size:2,data:new Float32Array([0,0,2,0,0,2])}}),super(t,s)}}export{je as M,Ye as P,Ze as R,Qe as T,ft as V};
|