vendor: 36,182 bytes, lines 1-14
1import{l as Dr,r as v,j as P,R as ne,S as Qs,m as nt,D as Rr,V as gt}from"./index-D6TocMku.js";import{G as se}from"./gift-Of5ZHeul.js";import{T as Er}from"./trash-2-dG0psV43.js";/** 2 * @license lucide-react v0.344.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const kr=Dr("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),Ze=v.createContext({});function Qe(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const he=v.createContext(null),Je=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class jr extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ir({children:t,isPresent:e}){const n=v.useId(),s=v.useRef(null),i=v.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=v.useContext(Je);return v.useInsertionEffect(()=>{const{width:r,height:a,top:l,left:c}=i.current;if(e||!s.current||!r||!a)return;s.current.dataset.motionPopId=n;const u=document.createElement("style");return o&&(u.nonce=o),document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` 7 [data-motion-pop-id="${n}"] { 8 position: absolute !important; 9 width: ${r}px !important; 10 height: ${a}px !important; 11 top: ${l}px !important; 12 left: ${c}px !important; 13 } 14 `),()=>{document.head.removeChild(u)}},[e]),P.jsx(jr,{isPresent:e,childRef:s,sizeRef:i,children:v.cloneElement(t,{ref:s})})}const Lr=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r})=>{const a=Qe(Fr),l=v.useId(),c=v.useCallback(h=>{a.set(h,!0);for(const d of a.values())if(!d)return;s&&s()},[a,s]),u=v.useMemo(()=>({id:l,initial:e,isPresent:n,custom:i,onExitComplete:c,register:h=>(a.set(h,!1),()=>a.delete(h))}),o?[Math.random(),c]:[n,c]);return v.useMemo(()=>{a.forEach((h,d)=>a.set(d,!1))},[n]),v.useEffect(()=>{!n&&!a.size&&s&&s()},[n]),r==="popLayout"&&(t=P.jsx(Ir,{isPresent:n,children:t})),P.jsx(he.Provider,{value:u,children:t})};function Fr(){return new Map}function Js(t=!0){const e=v.useContext(he);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=v.useId();v.useEffect(()=>{t&&i(o)},[t]);const r=v.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Ht=t=>t.key||"";function Fn(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const tn=typeof window<"u",ti=tn?v.useLayoutEffect:v.useEffect,Or=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1})=>{const[a,l]=Js(r),c=v.useMemo(()=>Fn(t),[t]),u=r&&!a?[]:c.map(Ht),h=v.useRef(!0),d=v.useRef(c),f=Qe(()=>new Map),[p,g]=v.useState(c),[y,m]=v.useState(c);ti(()=>{h.current=!1,d.current=c;for(let A=0;A<y.length;A++){const T=Ht(y[A]);u.includes(T)?f.delete(T):f.get(T)!==!0&&f.set(T,!1)}},[y,u.length,u.join("-")]);const x=[];if(c!==p){let A=[...c];for(let T=0;T<y.length;T++){const M=y[T],E=Ht(M);u.includes(E)||(A.splice(T,0,M),x.push(M))}o==="wait"&&x.length&&(A=x),m(Fn(A)),g(c);return}const{forceRender:w}=v.useContext(Ze);return P.jsx(P.Fragment,{children:y.map(A=>{const T=Ht(A),M=r&&!a?!1:c===y||u.includes(T),E=()=>{if(f.has(T))f.set(T,!0);else return;let C=!0;f.forEach(L=>{L||(C=!1)}),C&&(w==null||w(),m(d.current),r&&(l==null||l()),s&&s())};return P.jsx(Lr,{isPresent:M,initial:!h.current||n?void 0:!1,custom:M?void 0:e,presenceAffectsLayout:i,mode:o,onExitComplete:M?void 0:E,children:A},T)})})},K=t=>t;let Ie=K;function en(t){let e;return()=>(e===void 0&&(e=t()),e)}const Tt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},Q=t=>t*1e3,J=t=>t/1e3,Br={skipAnimations:!1,useManualTiming:!1};function Nr(t){let e=new Set,n=new Set,s=!1,i=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(c){o.has(c)&&(l.schedule(c),t()),c(r)}const l={schedule:(c,u=!1,h=!1)=>{const f=h&&s?e:n;return u&&o.add(c),f.has(c)||f.add(c),c},cancel:c=>{n.delete(c),o.delete(c)},process:c=>{if(r=c,s){i=!0;return}s=!0,[e,n]=[n,e],e.forEach(a),e.clear(),s=!1,i&&(i=!1,l.process(c))}};return l}const qt=["read","resolveKeyframes","update","preRender","render","postRender"],_r=40;function ei(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=qt.reduce((m,x)=>(m[x]=Nr(o),m),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:h,postRender:d}=r,f=()=>{const m=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(m-i.timestamp,_r),1),i.timestamp=m,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(f))},p=()=>{n=!0,s=!0,i.isProcessing||t(f)};return{schedule:qt.reduce((m,x)=>{const w=r[x];return m[x]=(A,T=!1,M=!1)=>(n||p(),w.schedule(A,T,M)),m},{}),cancel:m=>{for(let x=0;x<qt.length;x++)r[qt[x]].cancel(m)},state:i,steps:r}}const{schedule:D,cancel:ot,state:O,steps:xe}=ei(typeof requestAnimationFrame<"u"?requestAnimationFrame:K,!0),ni=v.createContext({strict:!1}),On={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"]},bt={};for(const t in On)bt[t]={isEnabled:e=>On[t].some(n=>!!e[n])};function Ur(t){for(const e in t)bt[e]={...bt[e],...t[e]}}const $r=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ie(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||$r.has(t)}let si=t=>!ie(t);function Kr(t){t&&(si=e=>e.startsWith("on")?!ie(e):t(e))}try{Kr(require("@emotion/is-prop-valid").default)}catch{}function Wr(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(si(i)||n===!0&&ie(i)||!e&&!ie(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function Gr(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...s)=>t(...s);return new Proxy(n,{get:(s,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const de=v.createContext({});function Ot(t){return typeof t=="string"||Array.isArray(t)}function fe(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const nn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],sn=["initial",...nn];function me(t){return fe(t.animate)||sn.some(e=>Ot(t[e]))}function ii(t){return!!(me(t)||t.variants)}function zr(t,e){if(me(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Ot(n)?n:void 0,animate:Ot(s)?s:void 0}}return t.inherit!==!1?e:{}}function Hr(t){const{initial:e,animate:n}=zr(t,v.useContext(de));return v.useMemo(()=>({initial:e,animate:n}),[Bn(e),Bn(n)])}function Bn(t){return Array.isArray(t)?t.join(" "):t}const qr=Symbol.for("motionComponentSymbol");function yt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Yr(t,e,n){return v.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):yt(n)&&(n.current=s))},[e])}const rn=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xr="framerAppearId",ri="data-"+rn(Xr),{schedule:on,cancel:Mu}=ei(queueMicrotask,!1),oi=v.createContext({});function Zr(t,e,n,s,i){var o,r;const{visualElement:a}=v.useContext(de),l=v.useContext(ni),c=v.useContext(he),u=v.useContext(Je).reducedMotion,h=v.useRef(null);s=s||l.renderer,!h.current&&s&&(h.current=s(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const d=h.current,f=v.useContext(oi);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&Qr(h.current,n,i,f);const p=v.useRef(!1);v.useInsertionEffect(()=>{d&&p.current&&d.update(n,c)});const g=n[ri],y=v.useRef(!!g&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,g))&&((r=window.MotionHasOptimisedAnimation)===null||r===void 0?void 0:r.call(window,g)));return ti(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),on.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),v.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)===null||m===void 0||m.call(window,g)}),y.current=!1))}),d}function Qr(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ai(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&yt(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:c})}function ai(t){if(t)return t.options.allowProjection!==!1?t.projection:ai(t.parent)}function Jr({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){var o,r;t&&Ur(t);function a(c,u){let h;const d={...v.useContext(Je),...c,layoutId:to(c)},{isStatic:f}=d,p=Hr(c),g=s(c,f);if(!f&&tn){eo();const y=no(d);h=y.MeasureLayout,p.visualElement=Zr(i,g,d,e,y.ProjectionNode)}return P.jsxs(de.Provider,{value:p,children:[h&&p.visualElement?P.jsx(h,{visualElement:p.visualElement,...d}):null,n(i,c,Yr(g,p.visualElement,u),g,f,p.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(r=(o=i.displayName)!==null&&o!==void 0?o:i.name)!==null&&r!==void 0?r:""})`}`;const l=v.forwardRef(a);return l[qr]=i,l}function to({layoutId:t}){const e=v.useContext(Ze).id;return e&&t!==void 0?e+"-"+t:t}function eo(t,e){v.useContext(ni).strict}function no(t){const{drag:e,layout:n}=bt;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const so=["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 an(t){return typeof t!="string"||t.includes("-")?!1:!!(so.indexOf(t)>-1||/[A-Z]/u.test(t))}function Nn(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function ln(t,e,n,s){if(typeof e=="function"){const[i,o]=Nn(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=Nn(s);e=e(n!==void 0?n:t.custom,i,o)}return e}const Le=t=>Array.isArray(t),io=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),ro=t=>Le(t)?t[t.length-1]||0:t,_=t=>!!(t&&t.getVelocity);function Qt(t){const e=_(t)?t.get():t;return io(e)?e.toValue():e}function oo({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},s,i,o){const r={latestValues:ao(s,i,o,t),renderState:e()};return n&&(r.onMount=a=>n({props:s,current:a,...r}),r.onUpdate=a=>n(a)),r}const li=t=>(e,n)=>{const s=v.useContext(de),i=v.useContext(he),o=()=>oo(t,e,s,i);return n?o():Qe(o)};function ao(t,e,n,s){const i={},o=s(t,{});for(const d in o)i[d]=Qt(o[d]);let{initial:r,animate:a}=t;const l=me(t),c=ii(t);e&&c&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||r===!1;const h=u?a:r;if(h&&typeof h!="boolean"&&!fe(h)){const d=Array.isArray(h)?h:[h];for(let f=0;f<d.length;f++){const p=ln(t,d[f]);if(p){const{transitionEnd:g,transition:y,...m}=p;for(const x in m){let w=m[x];if(Array.isArray(w)){const A=u?w.length-1:0;w=w[A]}w!==null&&(i[x]=w)}for(const x in g)i[x]=g[x]}}}return i}const Ct=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mt=new Set(Ct),ci=t=>e=>typeof e=="string"&&e.startsWith(t),ui=ci("--"),lo=ci("var(--"),cn=t=>lo(t)?co.test(t.split("/*")[0].trim()):!1,co=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,hi=(t,e)=>e&&typeof t=="number"?e.transform(t):t,tt=(t,e,n)=>n>e?e:n<t?t:n,At={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Bt={...At,transform:t=>tt(0,1,t)},Yt={...At,default:1},$t=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),it=$t("deg"),X=$t("%"),S=$t("px"),uo=$t("vh"),ho=$t("vw"),_n={...X,parse:t=>X.parse(t)/100,transform:t=>X.transform(t*100)},fo={borderWidth:S,borderTopWidth:S,borderRightWidth:S,borderBottomWidth:S,borderLeftWidth:S,borderRadius:S,radius: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,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,backgroundPositionX:S,backgroundPositionY:S},mo={rotate:it,rotateX:it,rotateY:it,rotateZ:it,scale:Yt,scaleX:Yt,scaleY:Yt,scaleZ:Yt,skew:it,skewX:it,skewY:it,distance:S,translateX:S,translateY:S,translateZ:S,x:S,y:S,z:S,perspective:S,transformPerspective:S,opacity:Bt,originX:_n,originY:_n,originZ:S},Un={...At,transform:Math.round},un={...fo,...mo,zIndex:Un,size:S,fillOpacity:Bt,strokeOpacity:Bt,numOctaves:Un},po={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},go=Ct.length;function yo(t,e,n){let s="",i=!0;for(let o=0;o<go;o++){const r=Ct[o],a=t[r];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(r.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=hi(a,un[r]);if(!l){i=!1;const u=po[r]||r;s+=`${u}(${c}) `}n&&(e[r]=c)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function hn(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const c=e[l];if(mt.has(l)){r=!0;continue}else if(ui(l)){i[l]=c;continue}else{const u=hi(c,un[l]);l.startsWith("origin")?(a=!0,o[l]=u):s[l]=u}}if(e.transform||(r||n?s.transform=yo(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;s.transformOrigin=`${l} ${c} ${u}`}}const vo={offset:"stroke-dashoffset",array:"stroke-dasharray"},xo={offset:"strokeDashoffset",array:"strokeDasharray"};function wo(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?vo:xo;t[o.offset]=S.transform(-s);const r=S.transform(e),a=S.transform(n);t[o.array]=`${r} ${a}`}function $n(t,e,n){return typeof t=="string"?t:S.transform(e+n*t)}function Po(t,e,n){const s=$n(e,t.x,t.width),i=$n(n,t.y,t.height);return`${s} ${i}`}function dn(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...c},u,h){if(hn(t,c,h),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:f,dimensions:p}=t;d.transform&&(p&&(f.transform=d.transform),delete d.transform),p&&(i!==void 0||o!==void 0||f.transform)&&(f.transformOrigin=Po(p,i!==void 0?i:.5,o!==void 0?o:.5)),e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&wo(d,r,a,l,!1)}const fn=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),di=()=>({...fn(),attrs:{}}),mn=t=>typeof t=="string"&&t.toLowerCase()==="svg";function fi(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const o in n)t.style.setProperty(o,n[o])}const mi=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function pi(t,e,n,s){fi(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(mi.has(i)?i:rn(i),e.attrs[i])}const re={};function To(t){Object.assign(re,t)}function gi(t,{layout:e,layoutId:n}){return mt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!re[t]||t==="opacity")}function pn(t,e,n){var s;const{style:i}=t,o={};for(const r in i)(_(i[r])||e.style&&_(e.style[r])||gi(r,t)||((s=n==null?void 0:n.getValue(r))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(o[r]=i[r]);return o}function yi(t,e,n){const s=pn(t,e,n);for(const i in t)if(_(t[i])||_(e[i])){const o=Ct.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}function bo(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const Kn=["x","y","width","height","cx","cy","r"],So={useVisualState:li({scrapeMotionValuesFromProps:yi,createRenderState:di,onUpdate:({props:t,prevProps:e,current:n,renderState:s,latestValues:i})=>{if(!n)return;let o=!!t.drag;if(!o){for(const a in i)if(mt.has(a)){o=!0;break}}if(!o)return;let r=!e;if(e)for(let a=0;a<Kn.length;a++){const l=Kn[a];t[l]!==e[l]&&(r=!0)}r&&D.read(()=>{bo(n,s),D.render(()=>{dn(s,i,mn(n.tagName),t.transformTemplate),pi(n,s)})})}})},Co={useVisualState:li({scrapeMotionValuesFromProps:pn,createRenderState:fn})};function vi(t,e,n){for(const s in e)!_(e[s])&&!gi(s,n)&&(t[s]=e[s])}function Ao({transformTemplate:t},e){return v.useMemo(()=>{const n=fn();return hn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Mo(t,e){const n=t.style||{},s={};return vi(s,n,t),Object.assign(s,Ao(t,e)),s}function Vo(t,e){const n={},s=Mo(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}function Do(t,e,n,s){const i=v.useMemo(()=>{const o=di();return dn(o,e,mn(s),t.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};vi(o,t.style,t),i.style={...o,...i.style}}return i}function Ro(t=!1){return(n,s,i,{latestValues:o},r)=>{const l=(an(n)?Do:Vo)(s,o,r,n),c=Wr(s,typeof n=="string",t),u=n!==v.Fragment?{...c,...l,ref:i}:{},{children:h}=s,d=v.useMemo(()=>_(h)?h.get():h,[h]);return v.createElement(n,{...u,children:d})}}function Eo(t,e){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const r={...an(s)?So:Co,preloadedFeatures:t,useRender:Ro(i),createVisualElement:e,Component:s};return Jr(r)}}function xi(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}function pe(t,e,n){const s=t.getProps();return ln(s,e,n!==void 0?n:s.custom,t)}const ko=en(()=>window.ScrollTimeline!==void 0);class jo{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let s=0;s<this.animations.length;s++)this.animations[s][e]=n}attachTimeline(e,n){const s=this.animations.map(i=>{if(ko()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Io extends jo{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}function gn(t,e){return t?t[e]||t.default||t:void 0}const Fe=2e4;function wi(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Fe;)e+=n,s=t.next(e);return e>=Fe?1/0:e}function yn(t){return typeof t=="function"}function Wn(t,e){t.timeline=e,t.onfinish=null}const vn=t=>Array.isArray(t)&&typeof t[0]=="number",Lo={linearEasing:void 0};function Fo(t,e){const n=en(t);return()=>{var s;return(s=Lo[e])!==null&&s!==void 0?s:n()}}const oe=Fo(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pi=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=t(Tt(0,i-1,o))+", ";return`linear(${s.substring(0,s.length-2)})`};function Ti(t){return!!(typeof t=="function"&&oe()||!t||typeof t=="string"&&(t in Oe||oe())||vn(t)||Array.isArray(t)&&t.every(Ti))}const Dt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Oe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Dt([0,.65,.55,1]),circOut:Dt([.55,0,1,.45]),backIn:Dt([.31,.01,.66,-.59]),backOut:Dt([.33,1.53,.69,.99])};function bi(t,e){if(t)return typeof t=="function"&&oe()?Pi(t,e):vn(t)?Dt(t):Array.isArray(t)?t.map(n=>bi(n,e)||Oe.easeOut):Oe[t]}const q={x:!1,y:!1};function Si(){return q.x||q.y}function Oo(t,e,n){var s;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const o=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t)}function Ci(t,e){const n=Oo(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Gn(t){return e=>{e.pointerType==="touch"||Si()||t(e)}}function Bo(t,e,n={}){const[s,i,o]=Ci(t,n),r=Gn(a=>{const{target:l}=a,c=e(a);if(typeof c!="function"||!l)return;const u=Gn(h=>{c(h),l.removeEventListener("pointerleave",u)});l.addEventListener("pointerleave",u,i)});return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const Ai=(t,e)=>e?t===e?!0:Ai(t,e.parentElement):!1,xn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,No=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function _o(t){return No.has(t.tagName)||t.tabIndex!==-1}const Rt=new WeakSet;function zn(t){return e=>{e.key==="Enter"&&t(e)}}function we(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Uo=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=zn(()=>{if(Rt.has(n))return;we(n,"down");const i=zn(()=>{we(n,"up")}),o=()=>we(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Hn(t){return xn(t)&&!Si()}function $o(t,e,n={}){const[s,i,o]=Ci(t,n),r=a=>{const l=a.currentTarget;if(!Hn(a)||Rt.has(l))return;Rt.add(l);const c=e(a),u=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),!(!Hn(f)||!Rt.has(l))&&(Rt.delete(l),typeof c=="function"&&c(f,{success:p}))},h=f=>{u(f,n.useGlobalTarget||Ai(l,f.target))},d=f=>{u(f,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",d,i)};return s.forEach(a=>{!_o(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),a.addEventListener("focus",c=>Uo(c,i),i)}),o}function Ko(t){return t==="x"||t==="y"?q[t]?null:(q[t]=!0,()=>{q[t]=!1}):q.x||q.y?null:(q.x=q.y=!0,()=>{q.x=q.y=!1})}const Mi=new Set(["width","height","top","left","right","bottom",...Ct]);let Jt;function Wo(){Jt=void 0}const Z={now:()=>(Jt===void 0&&Z.set(O.isProcessing||Br.useManualTiming?O.timestamp:performance.now()),Jt),set:t=>{Jt=t,queueMicrotask(Wo)}};function wn(t,e){t.indexOf(e)===-1&&t.push(e)}function Pn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Tn{constructor(){this.subscriptions=[]}add(e){return wn(this.subscriptions,e),()=>Pn(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 o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Vi(t,e){return e?t*(1e3/e):0}const qn=30,Go=t=>!isNaN(parseFloat(t));class zo{constructor(e,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const o=Z.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Z.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Go(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 Tn);const s=this.events[e].add(n);return e==="change"?()=>{s(),D.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,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}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()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Z.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>qn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,qn);return Vi(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Nt(t,e){return new zo(t,e)}function Ho(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Nt(n))}function qo(t,e){const n=pe(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=ro(o[r]);Ho(t,r,a)}}function Yo(t){return!!(_(t)&&t.add)}function Be(t,e){const n=t.getValue("willChange");if(Yo(n))return n.add(e)}function Di(t){return t.props[ri]}const Ri=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Xo=1e-7,Zo=12;function Qo(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=Ri(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Xo&&++a<Zo);return r}function Kt(t,e,n,s){if(t===e&&n===s)return K;const i=o=>Qo(o,0,1,t,n);return o=>o===0||o===1?o:Ri(i(o),e,s)}const Ei=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ki=t=>e=>1-t(1-e),ji=Kt(.33,1.53,.69,.99),bn=ki(ji),Ii=Ei(bn),Li=t=>(t*=2)<1?.5*bn(t):.5*(2-Math.pow(2,-10*(t-1))),Sn=t=>1-Math.sin(Math.acos(t)),Fi=ki(Sn),Oi=Ei(Sn),Bi=t=>/^0[^.\s]+$/u.test(t);function Jo(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Bi(t):!0}const kt=t=>Math.round(t*1e5)/1e5,Cn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ta(t){return t==null}const ea=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,An=(t,e)=>n=>!!(typeof n=="string"&&ea.test(n)&&n.startsWith(t)||e&&!ta(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ni=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(Cn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},na=t=>tt(0,255,t),Pe={...At,transform:t=>Math.round(na(t))},dt={test:An("rgb","red"),parse:Ni("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Pe.transform(t)+", "+Pe.transform(e)+", "+Pe.transform(n)+", "+kt(Bt.transform(s))+")"};function sa(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 Ne={test:An("#"),parse:sa,transform:dt.transform},vt={test:An("hsl","hue"),parse:Ni("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+X.transform(kt(e))+", "+X.transform(kt(n))+", "+kt(Bt.transform(s))+")"},N={test:t=>dt.test(t)||Ne.test(t)||vt.test(t),parse:t=>dt.test(t)?dt.parse(t):vt.test(t)?vt.parse(t):Ne.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?dt.transform(t):vt.transform(t)},ia=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ra(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Cn))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(ia))===null||n===void 0?void 0:n.length)||0)>0}const _i="number",Ui="color",oa="var",aa="var(",Yn="${}",la=/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 _t(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(la,l=>(N.test(l)?(s.color.push(o),i.push(Ui),n.push(N.parse(l))):l.startsWith(aa)?(s.var.push(o),i.push(oa),n.push(l)):(s.number.push(o),i.push(_i),n.push(parseFloat(l))),++o,Yn)).split(Yn);return{values:n,split:a,indexes:s,types:i}}function $i(t){return _t(t).values}function Ki(t){const{split:e,types:n}=_t(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===_i?o+=kt(i[r]):a===Ui?o+=N.transform(i[r]):o+=i[r]}return o}}const ca=t=>typeof t=="number"?0:t;function ua(t){const e=$i(t);return Ki(t)(e.map(ca))}const at={test:ra,parse:$i,createTransformer:Ki,getAnimatableNone:ua},ha=new Set(["brightness","contrast","saturate","opacity"]);function da(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Cn)||[];if(!s)return t;const i=n.replace(s,"");let o=ha.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const fa=/\b([a-z-]*)\(.*?\)/gu,_e={...at,getAnimatableNone:t=>{const e=t.match(fa);return e?e.map(da).join(" "):t}},ma={...un,color:N,backgroundColor:N,outlineColor:N,fill:N,stroke:N,borderColor:N,borderTopColor:N,borderRightColor:N,borderBottomColor:N,borderLeftColor:N,filter:_e,WebkitFilter:_e},Mn=t=>ma[t];function Wi(t,e){let n=Mn(t);return n!==_e&&(n=at),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const pa=new Set(["auto","none","0"]);function ga(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!pa.has(o)&&_t(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=Wi(n,i)}const Xn=t=>t===At||t===S,Zn=(t,e)=>parseFloat(t.split(", ")[e]),Qn=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return Zn(i[1],e);{const o=s.match(/^matrix\((.+)\)$/u);return o?Zn(o[1],t):0}},ya=new Set(["x","y","z"]),va=Ct.filter(t=>!ya.has(t));function xa(t){const e=[];return va.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const St={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Qn(4,13),y:Qn(5,14)};St.translateX=St.x;St.translateY=St.y;const ft=new Set;let Ue=!1,$e=!1;function Gi(){if($e){const t=Array.from(ft).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=xa(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(([o,r])=>{var a;(a=s.getValue(o))===null||a===void 0||a.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}$e=!1,Ue=!1,ft.forEach(t=>t.complete()),ft.clear()}function zi(){ft.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&($e=!0)})}function wa(){zi(),Gi()}class Vn{constructor(e,n,s,i,o,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ft.add(this),Ue||(Ue=!0,D.read(zi),D.resolveKeyframes(Gi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let o=0;o<e.length;o++)if(e[o]===null)if(o===0){const r=i==null?void 0:i.get(),a=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&r===void 0&&i.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ft.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ft.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Hi=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Pa=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ta(t){const e=Pa.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function qi(t,e,n=1){const[s,i]=Ta(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return Hi(r)?parseFloat(r):r}return cn(i)?qi(i,e,n+1):i}const Yi=t=>e=>e.test(t),ba={test:t=>t==="auto",parse:t=>t},Xi=[At,S,X,it,ho,uo,ba],Jn=t=>Xi.find(Yi(t));class Zi extends Vn{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"&&(c=c.trim(),cn(c))){const u=qi(c,n.current);u!==void 0&&(e[l]=u),l===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Mi.has(s)||e.length!==2)return;const[i,o]=e,r=Jn(i),a=Jn(o);if(r!==a)if(Xn(r)&&Xn(a))for(let l=0;l<e.length;l++){const c=e[l];typeof c=="string"&&(e[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)Jo(e[i])&&s.push(i);s.length&&ga(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=St[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 e;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const o=n.getValue(s);o&&o.jump(this.measuredOrigin,!1);const r=i.length-1,a=i[r];i[r]=St[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEac
vendor: 10,680 bytes, line 14
14h(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const ts=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(at.test(t)||t==="0")&&!t.startsWith("url("));function Sa(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 Ca(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=ts(i,e),a=ts(o,e);return!r||!a?!1:Sa(t)||(n==="spring"||yn(n))&&s}const Aa=t=>t!==null;function ge(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Aa),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return!o||s===void 0?i[o]:s}const Ma=40;class Qi{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Z.now(),this.options={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Ma?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&wa(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=Z.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:o,delay:r,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!Ca(e,s,i,o))if(r)this.options.duration=0;else{l&&l(ge(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(e,n);u!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const k=(t,e,n)=>t+(e-t)*n;function Te(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 Va({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=Te(l,a,t+1/3),o=Te(l,a,t),r=Te(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function ae(t,e){return n=>n>0?e:t}const be=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Da=[Ne,dt,vt],Ra=t=>Da.find(e=>e.test(t));function es(t){const e=Ra(t);if(!e)return!1;let n=e.parse(t);return e===vt&&(n=Va(n)),n}const ns=(t,e)=>{const n=es(t),s=es(e);if(!n||!s)return ae(t,e);const i={...n};return o=>(i.red=be(n.red,s.red,o),i.green=be(n.green,s.green,o),i.blue=be(n.blue,s.blue,o),i.alpha=k(n.alpha,s.alpha,o),dt.transform(i))},Ea=(t,e)=>n=>e(t(n)),Wt=(...t)=>t.reduce(Ea),Ke=new Set(["none","hidden"]);function ka(t,e){return Ke.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ja(t,e){return n=>k(t,e,n)}function Dn(t){return typeof t=="number"?ja:typeof t=="string"?cn(t)?ae:N.test(t)?ns:Fa:Array.isArray(t)?Ji:typeof t=="object"?N.test(t)?ns:Ia:ae}function Ji(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>Dn(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function Ia(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Dn(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function La(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][i[r]],l=(n=t.values[a])!==null&&n!==void 0?n:0;s[o]=l,i[r]++}return s}const Fa=(t,e)=>{const n=at.createTransformer(e),s=_t(t),i=_t(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?Ke.has(t)&&!i.values.length||Ke.has(e)&&!s.values.length?ka(t,e):Wt(Ji(La(s,i),i.values),n):ae(t,e)};function tr(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?k(t,e,n):Dn(t)(t,e)}const Oa=5;function er(t,e,n){const s=Math.max(e-Oa,0);return Vi(n-t(s),e-s)}const j={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},Se=.001;function Ba({duration:t=j.duration,bounce:e=j.bounce,velocity:n=j.velocity,mass:s=j.mass}){let i,o,r=1-e;r=tt(j.minDamping,j.maxDamping,r),t=tt(j.minDuration,j.maxDuration,J(t)),r<1?(i=c=>{const u=c*r,h=u*t,d=u-n,f=We(c,r),p=Math.exp(-h);return Se-d/f*p},o=c=>{const h=c*r*t,d=h*n+n,f=Math.pow(r,2)*Math.pow(c,2)*t,p=Math.exp(-h),g=We(Math.pow(c,2),r);return(-i(c)+Se>0?-1:1)*((d-f)*p)/g}):(i=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-Se+u*h},o=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const a=5/t,l=_a(i,o,a);if(t=Q(t),isNaN(l))return{stiffness:j.stiffness,damping:j.damping,duration:t};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:r*2*Math.sqrt(s*c),duration:t}}}const Na=12;function _a(t,e,n){let s=n;for(let i=1;i<Na;i++)s=s-t(s)/e(s);return s}function We(t,e){return t*Math.sqrt(1-e*e)}const Ua=["duration","bounce"],$a=["stiffness","damping","mass"];function ss(t,e){return e.some(n=>t[n]!==void 0)}function Ka(t){let e={velocity:j.velocity,stiffness:j.stiffness,damping:j.damping,mass:j.mass,isResolvedFromDuration:!1,...t};if(!ss(t,$a)&&ss(t,Ua))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*tt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:j.mass,stiffness:i,damping:o}}else{const n=Ba(t);e={...e,...n,mass:j.mass},e.isResolvedFromDuration=!0}return e}function nr(t=j.visualDuration,e=j.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:f}=Ka({...n,velocity:-J(n.velocity||0)}),p=d||0,g=c/(2*Math.sqrt(l*u)),y=r-o,m=J(Math.sqrt(l/u)),x=Math.abs(y)<5;s||(s=x?j.restSpeed.granular:j.restSpeed.default),i||(i=x?j.restDelta.granular:j.restDelta.default);let w;if(g<1){const T=We(m,g);w=M=>{const E=Math.exp(-g*m*M);return r-E*((p+g*m*y)/T*Math.sin(T*M)+y*Math.cos(T*M))}}else if(g===1)w=T=>r-Math.exp(-m*T)*(y+(p+m*y)*T);else{const T=m*Math.sqrt(g*g-1);w=M=>{const E=Math.exp(-g*m*M),C=Math.min(T*M,300);return r-E*((p+g*m*y)*Math.sinh(C)+T*y*Math.cosh(C))/T}}const A={calculatedDuration:f&&h||null,next:T=>{const M=w(T);if(f)a.done=T>=h;else{let E=0;g<1&&(E=T===0?Q(p):er(w,T,M));const C=Math.abs(E)<=s,L=Math.abs(r-M)<=i;a.done=C&&L}return a.value=a.done?r:M,a},toString:()=>{const T=Math.min(wi(A),Fe),M=Pi(E=>A.next(T*E).value,T,30);return T+"ms "+M}};return A}function is({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},f=C=>a!==void 0&&C<a||l!==void 0&&C>l,p=C=>a===void 0?l:l===void 0||Math.abs(a-C)<Math.abs(l-C)?a:l;let g=n*e;const y=h+g,m=r===void 0?y:r(y);m!==y&&(g=m-h);const x=C=>-g*Math.exp(-C/s),w=C=>m+x(C),A=C=>{const L=x(C),U=w(C);d.done=Math.abs(L)<=c,d.value=d.done?m:U};let T,M;const E=C=>{f(d.value)&&(T=C,M=nr({keyframes:[d.value,p(d.value)],velocity:er(w,C,d.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:C=>{let L=!1;return!M&&T===void 0&&(L=!0,A(C),E(C)),T!==void 0&&C>=T?M.next(C-T):(!L&&A(C),d)}}}const Wa=Kt(.42,0,1,1),Ga=Kt(0,0,.58,1),sr=Kt(.42,0,.58,1),za=t=>Array.isArray(t)&&typeof t[0]!="number",rs={linear:K,easeIn:Wa,easeInOut:sr,easeOut:Ga,circIn:Sn,circInOut:Oi,circOut:Fi,backIn:bn,backInOut:Ii,backOut:ji,anticipate:Li},os=t=>{if(vn(t)){Ie(t.length===4);const[e,n,s,i]=t;return Kt(e,n,s,i)}else if(typeof t=="string")return Ie(rs[t]!==void 0),rs[t];return t};function Ha(t,e,n){const s=[],i=n||tr,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||K:e;a=Wt(l,a)}s.push(a)}return s}function qa(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(Ie(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Ha(e,s,i),l=a.length,c=u=>{if(r&&u<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const d=Tt(t[h],t[h+1],u);return a[h](d)};return n?u=>c(tt(t[0],t[o-1],u)):c}function Ya(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Tt(0,e,s);t.push(k(n,1,i))}}function Xa(t){const e=[0];return Ya(e,t.length-1),e}function Za(t,e){return t.map(n=>n*e)}function Qa(t,e){return t.map(()=>e||sr).splice(0,t.length-1)}function le({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=za(s)?s.map(os):os(s),o={done:!1,value:e[0]},r=Za(n&&n.length===e.length?n:Xa(e),t),a=qa(r,e,{ease:Array.isArray(i)?i:Qa(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const Ja=t=>{const e=({timestamp:n})=>t(n);return{start:()=>D.update(e,!0),stop:()=>ot(e),now:()=>O.isProcessing?O.timestamp:Z.now()}},tl={decay:is,inertia:is,tween:le,keyframes:le,spring:nr},el=t=>t/100;class Rn extends Qi{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:s,element:i,keyframes:o}=this.options,r=(i==null?void 0:i.KeyframeResolver)||Vn,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new r(o,a,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=this.options,a=yn(n)?n:tl[n]||le;let l,c;a!==le&&typeof e[0]!="number"&&(l=Wt(el,tr(e[0],e[1])),e=[0,100]);const u=a({...this.options,keyframes:e});o==="mirror"&&(c=a({...this.options,keyframes:[...e].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=wi(u));const{calculatedDuration:h}=u,d=h+i,f=d*(s+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:d,totalDuration:f}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:C}=this.options;return{done:!0,value:C[C.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:r,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:h}=s;
vendor: 59,862 bytes, line 14
14if(this.startTime===null)return o.next(0);const{delay:d,repeat:f,repeatType:p,repeatDelay:g,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const m=this.currentTime-d*(this.speed>=0?1:-1),x=this.speed>=0?m<0:m>u;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let w=this.currentTime,A=o;if(f){const C=Math.min(this.currentTime,u)/h;let L=Math.floor(C),U=C%1;!U&&C>=1&&(U=1),U===1&&L--,L=Math.min(L,f+1),!!(L%2)&&(p==="reverse"?(U=1-U,g&&(U-=g/h)):p==="mirror"&&(A=r)),w=tt(0,1,U)*h}const T=x?{done:!1,value:l[0]}:A.next(w);a&&(T.value=a(T.value));let{done:M}=T;!x&&c!==null&&(M=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return E&&i!==void 0&&(T.value=ge(l,this.options,i)),y&&y(T.value),E&&this.finish(),T}get duration(){const{resolved:e}=this;return e?J(e.calculatedDuration):0}get time(){return J(this.currentTime)}set time(e){e=Q(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=J(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Ja,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const nl=new Set(["opacity","clipPath","filter","transform"]);function sl(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const c={[e]:n};l&&(c.offset=l);const u=bi(a,i);return Array.isArray(u)&&(c.easing=u),t.animate(c,{delay:s,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"})}const il=en(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ce=10,rl=2e4;function ol(t){return yn(t.type)||t.type==="spring"||!Ti(t.ease)}function al(t,e){const n=new Rn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let o=0;for(;!s.done&&o<rl;)s=n.sample(o),i.push(s.value),o+=ce;return{times:void 0,keyframes:i,duration:o-ce,ease:"linear"}}const ir={anticipate:Li,backInOut:Ii,circInOut:Oi};function ll(t){return t in ir}class as extends Qi{constructor(e){super(e);const{name:n,motionValue:s,element:i,keyframes:o}=this.options;this.resolver=new Zi(o,(r,a)=>this.onKeyframesResolved(r,a),n,s,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:s=300,times:i,ease:o,type:r,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof o=="string"&&oe()&&ll(o)&&(o=ir[o]),ol(this.options)){const{onComplete:h,onUpdate:d,motionValue:f,element:p,...g}=this.options,y=al(e,g);e=y.keyframes,e.length===1&&(e[1]=e[0]),s=y.duration,i=y.times,o=y.ease,r="keyframes"}const u=sl(a.owner.current,l,e,{...this.options,duration:s,times:i,ease:o});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(Wn(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:h}=this.options;a.set(ge(e,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:s,times:i,type:r,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return J(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return J(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=Q(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return K;const{animation:s}=n;Wn(s,e)}return K}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:i,type:o,ease:r,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:h,element:d,...f}=this.options,p=new Rn({...f,keyframes:s,duration:i,type:o,ease:r,times:a,isGenerator:!0}),g=Q(this.time);c.setWithVelocity(p.sample(g-ce).value,p.sample(g).value,ce)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:i,repeatType:o,damping:r,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return il()&&s&&nl.has(s)&&!l&&!c&&!i&&o!=="mirror"&&r!==0&&a!=="inertia"}}const cl={type:"spring",stiffness:500,damping:25,restSpeed:10},ul=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),hl={type:"keyframes",duration:.8},dl={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fl=(t,{keyframes:e})=>e.length>2?hl:mt.has(t)?t.startsWith("scale")?ul(e[1]):cl:dl;function ml({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const En=(t,e,n,s={},i,o)=>r=>{const a=gn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-Q(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};ml(a)||(u={...u,...fl(t,u)}),u.duration&&(u.duration=Q(u.duration)),u.repeatDelay&&(u.repeatDelay=Q(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(h=!0)),h&&!o&&e.get()!==void 0){const d=ge(u.keyframes,a);if(d!==void 0)return D.update(()=>{u.onUpdate(d),u.onComplete()}),new Io([])}return!o&&as.supports(u)?new as(u):new Rn(u)};function pl({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function rr(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(r=s);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const h in l){const d=t.getValue(h,(o=t.latestValues[h])!==null&&o!==void 0?o:null),f=l[h];if(f===void 0||u&&pl(u,h))continue;const p={delay:n,...gn(r||{},h)};let g=!1;if(window.MotionHandoffAnimation){const m=Di(t);if(m){const x=window.MotionHandoffAnimation(m,h,D);x!==null&&(p.startTime=x,g=!0)}}Be(t,h),d.start(En(h,d,f,t.shouldReduceMotion&&Mi.has(h)?{type:!1}:p,t,g));const y=d.animation;y&&c.push(y)}return a&&Promise.all(c).then(()=>{D.update(()=>{a&&qo(t,a)})}),c}function Ge(t,e,n={}){var s;const i=pe(t,e,n.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const r=i?()=>Promise.all(rr(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:d}=o;return gl(t,e,u+c,h,d,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[c,u]=l==="beforeChildren"?[r,a]:[a,r];return c().then(()=>u())}else return Promise.all([r(),a(n.delay)])}function gl(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=i===1?(c=0)=>c*s:(c=0)=>a-c*s;return Array.from(t.variantChildren).sort(yl).forEach((c,u)=>{c.notify("AnimationStart",e),r.push(Ge(c,e,{...o,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(r)}function yl(t,e){return t.sortNodePosition(e)}function vl(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>Ge(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=Ge(t,e,n);else{const i=typeof e=="function"?pe(t,e,n.custom):e;s=Promise.all(rr(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const xl=sn.length;function or(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?or(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<xl;n++){const s=sn[n],i=t.props[s];(Ot(i)||i===!1)&&(e[s]=i)}return e}const wl=[...nn].reverse(),Pl=nn.length;function Tl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>vl(t,n,s)))}function bl(t){let e=Tl(t),n=ls(),s=!0;const i=l=>(c,u)=>{var h;const d=pe(t,u,l==="exit"?(h=t.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(d){const{transition:f,transitionEnd:p,...g}=d;c={...c,...g,...p}}return c};function o(l){e=l(t)}function r(l){const{props:c}=t,u=or(t.parent)||{},h=[],d=new Set;let f={},p=1/0;for(let y=0;y<Pl;y++){const m=wl[y],x=n[m],w=c[m]!==void 0?c[m]:u[m],A=Ot(w),T=m===l?x.isActive:null;T===!1&&(p=y);let M=w===u[m]&&w!==c[m]&&A;if(M&&s&&t.manuallyAnimateOnMount&&(M=!1),x.protectedKeys={...f},!x.isActive&&T===null||!w&&!x.prevProp||fe(w)||typeof w=="boolean")continue;const E=Sl(x.prevProp,w);let C=E||m===l&&x.isActive&&!M&&A||y>p&&A,L=!1;const U=Array.isArray(w)?w:[w];let et=U.reduce(i(m),{});T===!1&&(et={});const{prevResolvedValues:Mt={}}=x,b={...Mt,...et},V=R=>{C=!0,d.has(R)&&(L=!0,d.delete(R)),x.needsAnimating[R]=!0;const F=t.getValue(R);F&&(F.liveStyle=!1)};for(const R in b){const F=et[R],pt=Mt[R];if(f.hasOwnProperty(R))continue;let G=!1;Le(F)&&Le(pt)?G=!xi(F,pt):G=F!==pt,G?F!=null?V(R):d.add(R):F!==void 0&&d.has(R)?V(R):x.protectedKeys[R]=!0}x.prevProp=w,x.prevResolvedValues=et,x.isActive&&(f={...f,...et}),s&&t.blockInitialAnimation&&(C=!1),C&&(!(M&&E)||L)&&h.push(...U.map(R=>({animation:R,options:{type:m}})))}if(d.size){const y={};d.forEach(m=>{const x=t.getBaseTarget(m),w=t.getValue(m);w&&(w.liveStyle=!0),y[m]=x??null}),h.push({animation:y})}let g=!!h.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,g?e(h):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=t.variantChildren)===null||u===void 0||u.forEach(d=>{var f;return(f=d.animationState)===null||f===void 0?void 0:f.setActive(l,c)}),n[l].isActive=c;const h=r(l);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=ls(),s=!0}}}function Sl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!xi(e,t):!1}function ct(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ls(){return{animate:ct(!0),whileInView:ct(),whileHover:ct(),whileTap:ct(),whileDrag:ct(),whileFocus:ct(),exit:ct()}}class lt{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Cl extends lt{constructor(e){super(e),e.animationState||(e.animationState=bl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();fe(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let Al=0;class Ml extends lt{constructor(){super(...arguments),this.id=Al++}update(){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;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Vl={animation:{Feature:Cl},exit:{Feature:Ml}};function Ut(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Gt(t){return{point:{x:t.pageX,y:t.pageY}}}const Dl=t=>e=>xn(e)&&t(e,Gt(e));function jt(t,e,n,s){return Ut(t,e,Dl(n),s)}const cs=(t,e)=>Math.abs(t-e);function Rl(t,e){const n=cs(t.x,e.x),s=cs(t.y,e.y);return Math.sqrt(n**2+s**2)}class ar{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=Ae(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,f=Rl(h.offset,{x:0,y:0})>=3;if(!d&&!f)return;const{point:p}=h,{timestamp:g}=O;this.history.push({...p,timestamp:g});const{onStart:y,onMove:m}=this.handlers;d||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,h)},this.handlePointerMove=(h,d)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Ce(d,this.transformPagePoint),D.update(this.updatePoint,!0)},this.handlePointerUp=(h,d)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=Ae(h.type==="pointercancel"?this.lastMoveEventInfo:Ce(d,this.transformPagePoint),this.history);this.startEvent&&f&&f(h,y),p&&p(h,y)},!xn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const r=Gt(e),a=Ce(r,this.transformPagePoint),{point:l}=a,{timestamp:c}=O;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(e,Ae(a,this.history)),this.removeListeners=Wt(jt(this.contextWindow,"pointermove",this.handlePointerMove),jt(this.contextWindow,"pointerup",this.handlePointerUp),jt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ot(this.updatePoint)}}function Ce(t,e){return e?{point:e(t.point)}:t}function us(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ae({point:t},e){return{point:t,delta:us(t,lr(e)),offset:us(t,El(e)),velocity:kl(e,.1)}}function El(t){return t[0]}function lr(t){return t[t.length-1]}function kl(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=lr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>Q(e)));)n--;if(!s)return{x:0,y:0};const o=J(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}const cr=1e-4,jl=1-cr,Il=1+cr,ur=.01,Ll=0-ur,Fl=0+ur;function W(t){return t.max-t.min}function Ol(t,e,n){return Math.abs(t-e)<=n}function hs(t,e,n,s=.5){t.origin=s,t.originPoint=k(e.min,e.max,t.origin),t.scale=W(n)/W(e),t.translate=k(n.min,n.max,t.origin)-t.originPoint,(t.scale>=jl&&t.scale<=Il||isNaN(t.scale))&&(t.scale=1),(t.translate>=Ll&&t.translate<=Fl||isNaN(t.translate))&&(t.translate=0)}function It(t,e,n,s){hs(t.x,e.x,n.x,s?s.originX:void 0),hs(t.y,e.y,n.y,s?s.originY:void 0)}function ds(t,e,n){t.min=n.min+e.min,t.max=t.min+W(e)}function Bl(t,e,n){ds(t.x,e.x,n.x),ds(t.y,e.y,n.y)}function fs(t,e,n){t.min=e.min-n.min,t.max=t.min+W(e)}function Lt(t,e,n){fs(t.x,e.x,n.x),fs(t.y,e.y,n.y)}function Nl(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?k(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?k(n,t,s.max):Math.min(t,n)),t}function ms(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 _l(t,{top:e,left:n,bottom:s,right:i}){return{x:ms(t.x,n,i),y:ms(t.y,e,s)}}function ps(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 Ul(t,e){return{x:ps(t.x,e.x),y:ps(t.y,e.y)}}function $l(t,e){let n=.5;const s=W(t),i=W(e);return i>s?n=Tt(e.min,e.max-s,t.min):s>i&&(n=Tt(t.min,t.max-i,e.min)),tt(0,1,n)}function Kl(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 ze=.35;function Wl(t=ze){return t===!1?t=0:t===!0&&(t=ze),{x:gs(t,"left","right"),y:gs(t,"top","bottom")}}function gs(t,e,n){return{min:ys(t,e),max:ys(t,n)}}function ys(t,e){return typeof t=="number"?t:t[e]||0}const vs=()=>({translate:0,scale:1,origin:0,originPoint:0}),xt=()=>({x:vs(),y:vs()}),xs=()=>({min:0,max:0}),I=()=>({x:xs(),y:xs()});function H(t){return[t("x"),t("y")]}function hr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Gl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function zl(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 Me(t){return t===void 0||t===1}function He({scale:t,scaleX:e,scaleY:n}){return!Me(t)||!Me(e)||!Me(n)}function ut(t){return He(t)||dr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function dr(t){return ws(t.x)||ws(t.y)}function ws(t){return t&&t!=="0%"}function ue(t,e,n){const s=t-n,i=e*s;return n+i}function Ps(t,e,n,s,i){return i!==void 0&&(t=ue(t,i,s)),ue(t,n,s)+e}function qe(t,e=0,n=1,s,i){t.min=Ps(t.min,e,n,s,i),t.max=Ps(t.max,e,n,s,i)}function fr(t,{x:e,y:n}){qe(t.x,e.translate,e.scale,e.originPoint),qe(t.y,n.translate,n.scale,n.originPoint)}const Ts=.999999999999,bs=1.0000000000001;function Hl(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Pt(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,fr(t,r)),s&&ut(o.latestValues)&&Pt(t,o.latestValues))}e.x<bs&&e.x>Ts&&(e.x=1),e.y<bs&&e.y>Ts&&(e.y=1)}function wt(t,e){t.min=t.min+e,t.max=t.max+e}function Ss(t,e,n,s,i=.5){const o=k(t.min,t.max,i);qe(t,e,n,o,s)}function Pt(t,e){Ss(t.x,e.x,e.scaleX,e.scale,e.originX),Ss(t.y,e.y,e.scaleY,e.scale,e.originY)}function mr(t,e){return hr(zl(t.getBoundingClientRect(),e))}function ql(t,e,n){const s=mr(t,n),{scroll:i}=e;return i&&(wt(s.x,i.offset.x),wt(s.y,i.offset.y)),s}const pr=({current:t})=>t?t.ownerDocument.defaultView:null,Yl=new WeakMap;class Xl{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.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Gt(u).point)},o=(u,h)=>{const{drag:d,dragPropagation:f,onDragStart:p}=this.getProps();if(d&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ko(d),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),H(y=>{let m=this.getAxisMotionValue(y).get()||0;if(X.test(m)){const{projection:x}=this.visualElement;if(x&&x.layout){const w=x.layout.layoutBox[y];w&&(m=W(w)*(parseFloat(m)/100))}}this.originPoint[y]=m}),p&&D.postRender(()=>p(u,h)),Be(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},r=(u,h)=>{const{dragPropagation:d,dragDirectionLock:f,onDirectionLock:p,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=h;if(f&&this.currentDirection===null){this.currentDirection=Zl(y),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),g&&g(u,h)},a=(u,h)=>this.stop(u,h),l=()=>H(u=>{var h;return this.getAnimationState(u)==="paused"&&((h=this.getAxisMotionValue(u).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new ar(e,{onSessionStart:i,onStart:o,onMove:r,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:pr(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&D.postRender(()=>o(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Xt(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=Nl(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,o=this.constraints;n&&yt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=_l(i.layoutBox,n):this.constraints=!1,this.elastic=Wl(s),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&H(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Kl(i.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!yt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=ql(s,i.root,this.visualElement.getTransformPagePoint());let r=Ul(i.layout.layoutBox,o);if(n){const a=n(Gl(r));this.hasMutatedConstraints=!!a,a&&(r=hr(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=H(u=>{if(!Xt(u,n,this.currentDirection))return;let h=l&&l[u]||{};r&&(h={min:0,max:0});const d=i?200:1e6,f=i?40:1e7,p={type:"inertia",velocity:s?e[u]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Be(this.visualElement,e),s.start(En(e,s,0,n,this.visualElement,!1))}stopAnimation(){H(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){H(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){H(n=>{const{drag:s}=this.getProps();if(!Xt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n];o.set(e[n]-k(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!yt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};H(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=$l({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),H(r=>{if(!Xt(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:c}=this.constraints[r];a.set(k(l,c,i[r]))})}addListeners(){if(!this.visualElement.current)return;Yl.set(this.visualElement,this);const e=this.visualElement.current,n=jt(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();yt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),D.read(s);const r=Ut(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(H(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=l[u].translate,h.set(h.get()+l[u].translate))}),this.visualElement.render())});return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=ze,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Xt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Zl(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Ql extends lt{constructor(e){super(e),this.removeGroupControls=K,this.removeListeners=K,this.controls=new Xl(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||K}unmount(){this.removeGroupControls(),this.removeListeners()}}const Cs=t=>(e,n)=>{t&&D.postRender(()=>t(e,n))};class Jl extends lt{constructor(){super(...arguments),this.removePointerDownListener=K}onPointerDown(e){this.session=new ar(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:pr(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Cs(e),onStart:Cs(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&D.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=jt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const te={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function As(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Vt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(S.test(t))t=parseFloat(t);else return t;const n=As(t,e.target.x),s=As(t,e.target.y);return`${n}% ${s}%`}},tc={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=at.parse(t);if(i.length>5)return s;const o=at.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const c=k(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=c),typeof i[3+r]=="number"&&(i[3+r]/=c),o(i)}};class ec extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;To(nc),o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),te.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,r=s.projection;return r&&(r.isPresent=o,i||e.layoutDependency!==n||n===void 0?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||D.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),on.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;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 gr(t){const[e,n]=Js(),s=v.useContext(Ze);return P.jsx(ec,{...t,layoutGroup:s,switchLayoutGroup:v.useContext(oi),isPresent:e,safeToRemove:n})}const nc={borderRadius:{...Vt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vt,borderTopRightRadius:Vt,borderBottomLeftRadius:Vt,borderBottomRightRadius:Vt,boxShadow:tc};function sc(t,e,n){const s=_(t)?t:Nt(t);return s.start(En("",s,e,n)),s.animation}function ic(t){return t instanceof SVGElement&&t.tagName!=="svg"}const rc=(t,e)=>t.depth-e.depth;class oc{constructor(){this.children=[],this.isDirty=!1}add(e){wn(this.children,e),this.isDirty=!0}remove(e){Pn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(rc),this.isDirty=!1,this.children.forEach(e)}}function ac(t,e){const n=Z.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(ot(s),t(o-e))};return D.read(s,!0),()=>ot(s)}const yr=["TopLeft","TopRight","BottomLeft","BottomRight"],lc=yr.length,Ms=t=>typeof t=="string"?parseFloat(t):t,Vs=t=>typeof t=="number"||S.test(t);function cc(t,e,n,s,i,o){i?(t.opacity=k(0,n.opacity!==void 0?n.opacity:1,uc(s)),t.opacityExit=k(e.opacity!==void 0?e.opacity:1,0,hc(s))):o&&(t.opacity=k(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let r=0;r<lc;r++){const a=`border${yr[r]}Radius`;let l=Ds(e,a),c=Ds(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Vs(l)===Vs(c)?(t[a]=Math.max(k(Ms(l),Ms(c),s),0),(X.test(c)||X.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=k(e.rotate||0,n.rotate||0,s))}function Ds(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const uc=vr(0,.5,Fi),hc=vr(.5,.95,K);function vr(t,e,n){return s=>s<t?0:s>e?1:n(Tt(t,e,s))}function Rs(t,e){t.min=e.min,t.max=e.max}function z(t,e){Rs(t.x,e.x),Rs(t.y,e.y)}function Es(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function ks(t,e,n,s,i){return t-=e,t=ue(t,1/n,s),i!==void 0&&(t=ue(t,1/i,s)),t}function dc(t,e=0,n=1,s=.5,i,o=t,r=t){if(X.test(e)&&(e=parseFloat(e),e=k(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=k(o.min,o.max,s);t===o&&(a-=e),t.min=ks(t.min,e,n,a,i),t.max=ks(t.max,e,n,a,i)}function js(t,e,[n,s,i],o,r){dc(t,e[n],e[s],e[i],e.scale,o,r)}const fc=["x","scaleX","originX"],mc=["y","scaleY","originY"];function Is(t,e,n,s){js(t.x,e,fc,n?n.x:void 0,s?s.x:void 0),js(t.y,e,mc,n?n.y:void 0,s?s.y:void 0)}function Ls(t){return t.translate===0&&t.scale===1}function xr(t){return Ls(t.x)&&Ls(t.y)}function Fs(t,e){return t.min===e.min&&t.max===e.max}function pc(t,e){return Fs(t.x,e.x)&&Fs(t.y,e.y)}function Os(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function wr(t,e){return Os(t.x,e.x)&&Os(t.y,e.y)}function Bs(t){return W(t.x)/W(t.y)}function Ns(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class gc{constructor(){this.members=[]}add(e){wn(this.members,e),e.scheduleRender()}remove(e){if(Pn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function yc(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=(n==null?void 0:n.z)||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:d,skewX:f,skewY:p}=n;c&&(s=`perspective(${c}px) ${s}`),u&&(s+=`rotate(${u}deg) `),h&&(s+=`rotateX(${h}deg) `),d&&(s+=`rotateY(${d}deg) `),f&&(s+=`skewX(${f}deg) `),p&&(s+=`skewY(${p}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 ht={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Et=typeof window<"u"&&window.MotionDebug!==void 0,Ve=["","X","Y","Z"],vc={visibility:"hidden"},_s=1e3;let xc=0;function De(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Pr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Di(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",D,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Pr(s)}function Tr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=xc++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Et&&(ht.totalNodes=ht.resolvedTargetDeltas=ht.recalculatedProjection=0),this.nodes.forEach(Tc),this.nodes.forEach(Mc),this.nodes.forEach(Vc),this.nodes.forEach(bc),Et&&window.MotionDebug.record(ht)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,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 oc)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new Tn),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=ic(r),this.instance=r;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),t){let h;const d=()=>this.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=ac(d,250),te.hasAnimatedSinceResize&&(te.hasAnimatedSinceResize=!1,this.nodes.forEach($s))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:d,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||jc,{onLayoutAnimationStart:y,onLayoutAnimationComplete:m}=u.getProps(),x=!this.targetLayout||!wr(this.targetLayout,p)||f,w=!d&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||d&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,w);const A={...gn(g,"layout"),onPlay:y,onComplete:m};(u.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else d||$s(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ot(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(Dc),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Pr(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,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(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Us);return}this.isUpdating||this.nodes.forEach(Cc),this.isUpdating=!1,this.nodes.forEach(Ac),this.nodes.forEach(wc),this.nodes.forEach(Pc),this.clearAllSnapshots();const a=Z.now();O.delta=tt(0,1e3/60,a-O.timestamp),O.timestamp=a,O.isProcessing=!0,xe.update.process(O),xe.preRender.process(O),xe.render.process(O),O.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,on.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Sc),this.sharedNodes.forEach(Rc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,D.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){D.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),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,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!xr(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;r&&(a||ut(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),Ic(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var r;const{visualElement:a}=this.options;if(!a)return I();const l=a.measureViewportBox();if(!(((r=this.scroll)===null||r===void 0?void 0:r.wasRoot)||this.path.some(Lc))){const{scroll:u}=this.root;u&&(wt(l.x,u.offset.x),wt(l.y,u.offset.y))}return l}removeElementScroll(r){var a;const l=I();if(z(l,r),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:d}=u;u!==this.root&&h&&d.layoutScroll&&(h.wasRoot&&z(l,r),wt(l.x,h.offset.x),wt(l.y,h.offset.y))}return l}applyTransform(r,a=!1){const l=I();z(l,r);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Pt(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),ut(u.latestValues)&&Pt(l,u.latestValues)}return ut(this.latestValues)&&Pt(l,this.latestValues),l}removeTransform(r){const a=I();z(a,r);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!ut(c.latestValues))continue;He(c.latestValues)&&c.updateSnapshot();const u=I(),h=c.measurePageBox();z(u,h),Is(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return ut(this.latestValues)&&Is(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.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!==O.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(r||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:d}=this.options;if(!(!this.layout||!(h||d))){if(this.resolvedRelativeTargetAt=O.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=I(),this.relativeTargetOrigin=I(),Lt(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),z(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=I(),this.targetWithTransforms=I()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Bl(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):z(this.target,this.layout.layoutBox),fr(this.target,this.targetDelta)):z(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=I(),this.relativeTargetOrigin=I(),Lt(this.relativeTargetOrigin,this.target,f.target),z(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Et&&ht.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||He(this.parent.latestValues)||dr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var r;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((r=this.parent)===null||r===void 0)&&r.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===O.timestamp&&(c=!1),c)return;const{layout:u,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||h))return;z(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;Hl(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=I());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Es(this.prevProjectionDelta.x,this.projectionDelta.x),Es(this.prevProjectionDelta.y,this.projectionDelta.y)),It(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!Ns(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ns(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Et&&ht.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),r){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=xt(),this.projectionDelta=xt(),this.projectionDeltaWithTransform=xt()}setAnimationOrigin(r,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},h=xt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=I(),f=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=f!==p,y=this.getStack(),m=!y||y.members.length<=1,x=!!(g&&!m&&this.options.crossfade===!0&&!this.path.some(kc));this.animationProgress=0;let w;this.mixTargetDelta=A=>{const T=A/1e3;Ks(h.x,r.x,T),Ks(h.y,r.y,T),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Lt(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ec(this.relativeTarget,this.relativeTargetOrigin,d,T),w&&pc(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=I()),z(w,this.relativeTarget)),g&&(this.animationValues=u,cc(u,c,this.latestValues,T,x,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ot(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=D.update(()=>{te.hasAnimatedSinceResize=!0,this.currentAnimation=sc(0,_s,{...r,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onComplete:()=>{r.onComplete&&r.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 r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(_s),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=r;if(!(!a||!l||!c)){if(this!==r&&this.layout&&c&&br(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||I();const h=W(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const d=W(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+d}z(a,l),Pt(a,u),It(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new gc),this.sharedNodes.get(r).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 r=this.getStack();return r?r.lead===this:!0}getLead(){var r;const{layoutId:a}=this.options;return a?((r=this.getStack())===null||r===void 0?void 0:r.lead)||this:this}getPrevLead(){var r;const{layoutId:a}=this.options;return a?(r=this.getStack())===null||r===void 0?void 0:r.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&De("z",r,c,this.animationValues);for(let u=0;u<Ve.length;u++)De(`rotate${Ve[u]}`,r,c,this.animationValues),De(`skew${Ve[u]}`,r,c,this.animationValues);r.render();for(const u in c)r.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);r.scheduleRender()}getProjectionStyles(r){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return vc;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Qt(r==null?void 0:r.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Qt(r==null?void 0:r.pointerEvents)||""),this.hasProjected&&!ut(this.latestValues)&&(g.transform=u?u({},""):"none",this.hasProjected=!1),g}const d=h.animationValues||h.latestValues;this.applyTransformsToTarget(),c.transform=yc(this.projectionDeltaWithTransform,this.treeScale,d),u&&(c.transform=u(d,c.transform));const{x:f,y:p}=this.projectionDelta;c.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,h.animationValues?c.opacity=h===this?(l=(a=d.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:c.opacity=h===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const g in re){if(d[g]===void 0)continue;const{correct:y,applyTo:m}=re[g],x=c.transform==="none"?d[g]:y(d[g],h);if(m){const w=m.length;for(let A=0;A<w;A++)c[m[A]]=x}else c[g]=x}return this.options.layoutId&&(c.pointerEvents=h===this?Qt(r==null?void 0:r.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var a;return(a=r.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(Us),this.root.sharedNodes.clear()}}}function wc(t){t.updateLayout()}function Pc(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:o}=t.options,r=n.source!==t.layout.source;o==="size"?H(h=>{const d=r?n.measuredBox[h]:n.layoutBox[h],f=W(d);d.min=s[h].min,d.max=d.min+f}):br(o,n.layoutBox,s)&&H(h=>{const d=r?n.measuredBox[h]:n.layoutBox[h],f=W(s[h]);d.max=d.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+f)});const a=xt();It(a,s,n.layoutBox);const l=xt();r?It(l,t.applyTransform(i,!0),n.measuredBox):It(l,s,n.layoutBox);const c=!xr(a);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:f}=h;if(d&&f){const p=I();Lt(p,n.layoutBox,d.layoutBox);const g=I();Lt(g,s,f.layoutBox),wr(p,g)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=p,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function Tc(t){Et&&ht.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function bc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Sc(t){t.clearSnapshot()}function Us(t){t.clearMeasurements()}function Cc(t){t.isLayoutDirty=!1}function Ac(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function $s(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Mc(t){t.resolveTargetDelta()}function Vc(t){t.calcProjection()}function Dc(t){t.resetSkewAndRotation()}function Rc(t){t.removeLeadSnapshot()}function Ks(t,e,n){t.translate=k(e.translate,0,n),t.scale=k(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ws(t,e,n,s){t.min=k(e.min,n.min,s),t.max=k(e.max,n.max,s)}function Ec(t,e,n,s){Ws(t.x,e.x,n.x,s),Ws(t.y,e.y,n.y,s)}function kc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const jc={duration:.45,ease:[.4,0,.1,1]},Gs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),zs=Gs("applewebkit/")&&!Gs("chrome/")?Math.round:K;function Hs(t){t.min=zs(t.min),t.max=zs(t.max)}function Ic(t){Hs(t.x),Hs(t.y)}function br(t,e,n){return t==="position"||t==="preserve-aspect"&&!Ol(Bs(e),Bs(n),.2)}function Lc(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const Fc=Tr({attachResizeListener:(t,e)=>Ut(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Re={current:void 0},Sr=Tr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Re.current){const t=new Fc({});t.mount(window),t.setOptions({layoutScroll:!0}),Re.current=t}return Re.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Oc={pan:{Feature:Jl},drag:{Feature:Ql,ProjectionNode:Sr,MeasureLayout:gr}};function qs(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&D.postRender(()=>o(e,Gt(e)))}class Bc extends lt{mount(){const{current:e}=this.node;e&&(this.unmount=Bo(e,n=>(qs(this.node,n,"Start"),s=>qs(this.node,s,"End"))))}unmount(){}}class Nc 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=Wt(Ut(this.node.current,"focus",()=>this.onFocus()),Ut(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ys(t,e,n){const{props:s}=t;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&D.postRender(()=>o(e,Gt(e)))}class _c extends lt{mount(){const{current:e}=this.node;e&&(this.unmount=$o(e,n=>(Ys(this.node,n,"Start"),(s,{success:i})=>Ys(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ye=new WeakMap,Ee=new WeakMap,Uc=t=>{const e=Ye.get(t.target);e&&e(t)},$c=t=>{t.forEach(Uc)};function Kc({root:t,...e}){const n=t||document;Ee.has(n)||Ee.set(n,{});const s=Ee.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver($c,{root:t,...e})),s[i]}function Wc(t,e,n){const s=Kc(e);return Ye.set(t,n),s.observe(t),()=>{Ye.delete(t),s.unobserve(t)}}const Gc={some:0,all:1};class zc extends lt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Gc[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),d=c?u:h;d&&d(l)};return Wc(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Hc(e,n))&&this.startObserver()}unmount(){}}function Hc({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const qc={inView:{Feature:zc},tap:{Feature:_c},focus:{Feature:Nc},hover:{Feature:Bc}},Yc={layout:{ProjectionNode:Sr,MeasureLayout:gr}},Xe={current:null},Cr={current:!1};function Xc(){if(Cr.current=!0,!!tn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Xe.current=t.matches;t.addListener(e),e()}else Xe.current=!1}const Zc=[...Xi,N,at],Qc=t=>Zc.find(Yi(t)),Xs=new WeakMap;
vendor: 4,948 bytes, line 14
14function Jc(t,e,n){for(const s in e){const i=e[s],o=n[s];if(_(i))t.addValue(s,i);else if(_(o))t.addValue(s,Nt(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,Nt(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Zs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class tu{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Vn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Z.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,D.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=r;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=me(n),this.isVariantNode=ii(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];l[f]!==void 0&&_(p)&&p.set(l[f],!1)}}mount(e){this.current=e,Xs.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((n,s)=>this.bindToMotionValue(s,n)),Cr.current||Xc(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Xe.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Xs.delete(this.current),this.projection&&this.projection.unmount(),ot(this.notifyUpdate),ot(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=mt.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&D.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in bt){const n=bt[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 o=this.features[e];o.isMounted?o.update():(o.mount(),o.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<Zs.length;s++){const i=Zs[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=Jc(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}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}
14addVariantChild(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=Nt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){var s;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(s=this.getBaseTargetFromProps(this.props,e))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Hi(i)||Bi(i))?i=parseFloat(i):!Qc(i)&&at.test(n)&&(i=Wi(e,n)),this.setBaseTarget(e,_(i)?i.get():i)),_(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const r=ln(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);r&&(i=r[e])}if(s&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!_(o)?o:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Tn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Ar extends tu{constructor(){super(...arguments),this.KeyframeResolver=Zi}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;_(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function eu(t){return window.getComputedStyle(t)}class nu extends Ar{constructor(){super(...arguments),this.type="html",this.renderInstance=fi}readValueFromInstance(e,n){if(mt.has(n)){const s=Mn(n);return s&&s.default||0}else{const s=eu(e),i=(ui(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return mr(e,n)}build(e,n,s){hn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return pn(e,n,s)}}class su extends Ar{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=I}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(mt.has(n)){const s=Mn(n);return s&&s.default||0}return n=mi.has(n)?n:rn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return yi(e,n,s)}build(e,n,s){dn(e,n,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,s,i){pi(e,n,s,i)}mount(e){this.isSVGTag=mn(e.tagName),super.mount(e)}}const iu=(t,e)=>an(t)?new su(e):new nu(e,{allowProjection:t!==v.Fragment}),ru=Eo({...Vl,...qc,...Oc,...Yc},iu),Zt=Gr(ru);var ee={linear:function(t,e,n,s){var i=n-e;return i*t/s+e},easeInQuad:function(t,e,n,s){var i=n-e;return i*(t/=s)*t+e},easeOutQuad:function(t,e,n,s){var i=n-e;return-i*(t/=s)*(t-2)+e},easeInOutQuad:function(t,e,n,s){var i=n-e;return(t/=s/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,n,s){var i=n-e;return i*(t/=s)*t*t+e},easeOutCubic:function(t,e,n,s){var i=n-e;return i*((t=t/s-1)*t*t+1)+e},easeInOutCubic:function(t,e,n,s){var i=n-e;return(t/=s/2)<1?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,n,s){var i=n-e;return i*(t/=s)*t*t*t+e},easeOutQuart:function(t,e,n,s){var i=n-e;return-i*((t=t/s-1)*t*t*t-1)+e},easeInOutQuart:function(t,e,n,s){var i=n-e;return(t/=s/2)<1?i/2*t*t*t*t+e:-i/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,n,s){var i=n-e;return i*(t/=s)*t*t*t*t+e},easeOutQuint:function(t,e,n,s){var i=n-e;return i*((t=t/s-1)*t*t*t*t+1)+e},easeInOutQuint:function(t,e,n,s){var i=n-e;return(t/=s/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,n,s){var i=n-e;return-i*Math.cos(t/s*(Math.PI/2))+i+e},easeOutSine:function(t,e,n,s){var i=n-e;return i*Math.sin(t/s*(Math.PI/2))+e},easeInOutSine:function(t,e,n,s){var i=n-e;return-i/2*(Math.cos(Math.PI*t/s)-1)+e},easeInExpo:function(t,e,n,s){var i=n-e;return t==0?e:i*Math.pow(2,10*(t/s-1))+e},easeOutExpo:function(t,e,n,s){var i=n-e;return t==s?e+i:i*(-Math.pow(2,-10*t/s)+1)+e},easeInOutExpo:function(t,e,n,s){var i=n-e;return t===0?e:t===s?e+i:(t/=s/2)<1?i/2*Math.pow(2,10*(t-1))+e:i/2*(-Math.pow(2,-10*--t)+2)+e},easeInCirc:function(t,e,n,s){var i=n-e;return-i*(Math.sqrt(1-(t/=s)*t)-1)+e},easeOutCirc:function(t,e,n,s){var i=n-e;return i*Math.sqrt(1-(t=t/s-1)*t)+e},easeInOutCirc:function(t,e,n,s){var i=n-e;return(t/=s/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+e:i/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(t,e,n,s){var i=n-e,o,r,a;return a=1.70158,r=0,o=i,t===0?e:(t/=s)===1?e+i:(r||(r=s*.3),o<Math.abs(i)?(o=i,a=r/4):a=r/(2*Math.PI)*Math.asin(i/o),-(o*Math.pow(2,10*(t-=1))*Math.sin((t*s-a)*(2*Math.PI)/r))+e)},easeOutElastic:function(t,e,n,s){var i=n-e,o,r,a;return a=1.70158,r=0,o=i,t===0?e:(t/=s)===1?e+i:(r||(r=s*.3),o<Math.abs(i)?(o=i,a=r/4):a=r/(2*Math.PI)*Math.asin(i/o),o*Math.pow(2,-10*t)*Math.sin((t*s-a)*(2*Math.PI)/r)+i+e)},easeInOutElastic:function(t,e,n,s){var i=n-e,o,r,a;return a=1.70158,r=0,o=i,t===0?e:(t/=s/2)===2?e+i:(r||(r=s*(.3*1.5)),o<Math.abs(i)?(o=i,a=r/4):a=r/(2*Math.PI)*Math.asin(i/o),t<1?-.5*(o*Math.pow(2,10*(t-=1))*Math.sin((t*s-a)*(2*Math.PI)/r))+e:o*Math.pow(2,-10*(t-=1))*Math.sin((t*s-a)*(2*Math.PI)/r)*.5+i+e)},easeInBack:function(t,e,n,s,i){var o=n-e;return i===void 0&&(i=1.70158),o*(t/=s)*t*((i+1)*t-i)+e},easeOutBack:function(t,e,n,s,i){var o=n-e;return i===void 0&&(i=1.70158),o*((t=t/s-1)*t*((i+1)*t+i)+1)+e},easeInOutBack:function(t,e,n,s,i){var o=n-e;return i===void 0&&(i=1.70158),(t/=s/2)<1?o/2*(t*t*(((i*=1.525)+1)*t-i))+e:o/2*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)+e},easeInBounce:function(t,e,n,s){var i=n-e,o;return o=ee.easeOutBounce(s-t,0,i,s),i-o+e},easeOutBounce:function(t,e,n,s){var i=n-e;return(t/=s)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easeInOutBounce:function(t,e,n,s){var i=n-e,o;return t<s/2?(o=ee.easeInBounce(t*2,0,i,s),o*.5+e):(o=ee.easeOutBounce(t*2-s,0,i,s),o*.5+i*.5+e)}},ou=ee;function au(t){return t*Math.PI/180}function $(t,e){return t+Math.random()*(e-t)}
14function lu(t,e){return Math.floor(t+Math.random()*(e-t+1))}var Ft;(function(t){t[t.Circle=0]="Circle",t[t.Square=1]="Square",t[t.Strip=2]="Strip"})(Ft||(Ft={}));var rt;(function(t){t[t.Positive=1]="Positive",t[t.Negative=-1]="Negative"})(rt||(rt={}));const cu=1e3/60;class uu{constructor(e,n,s,i){this.getOptions=n;const{colors:o,initialVelocityX:r,initialVelocityY:a}=this.getOptions();this.context=e,this.x=s,this.y=i,this.w=$(5,20),this.h=$(5,20),this.radius=$(5,10),this.vx=typeof r=="number"?$(-r,r):$(r.min,r.max),this.vy=typeof a=="number"?$(-a,0):$(a.min,a.max),this.shape=lu(0,2),this.angle=au($(0,360)),this.angularSpin=$(-.2,.2),this.color=o[Math.floor(Math.random()*o.length)],this.rotateY=$(0,1),this.rotationDirection=$(0,1)?rt.Positive:rt.Negative}update(e){const{gravity:n,wind:s,friction:i,opacity:o,drawShape:r}=this.getOptions(),a=e/cu;this.x+=this.vx*a,this.y+=this.vy*a,this.vy+=n*a,this.vx+=s*a,this.vx*=i**a,this.vy*=i**a,this.rotateY>=1&&this.rotationDirection===rt.Positive?this.rotationDirection=rt.Negative:this.rotateY<=-1&&this.rotationDirection===rt.Negative&&(this.rotationDirection=rt.Positive);const l=.1*this.rotationDirection*a;if(this.rotateY+=l,this.angle+=this.angularSpin,this.context.save(),this.context.translate(this.x,this.y),this.context.rotate(this.angle),this.context.scale(1,this.rotateY),this.context.rotate(this.angle),this.context.beginPath(),this.context.fillStyle=this.color,this.context.strokeStyle=this.color,this.context.globalAlpha=o,this.context.lineCap="round",this.context.lineWidth=2,r&&typeof r=="function")r.call(this,this.context);else switch(this.shape){case Ft.Circle:{this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break}case Ft.Square:{this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break}case Ft.Strip:{this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h);break}}this.context.closePath(),this.context.restore()}}class hu{constructor(e,n){this.x=0,this.y=0,this.w=0,this.h=0,this.lastNumberOfPieces=0,this.tweenProgress=0,this.tweenFrom=0,this.particles=[],this.particlesGenerated=0,this.removeParticleAt=i=>{this.particles.splice(i,1)},this.getParticle=()=>{const i=$(this.x,this.w+this.x),o=$(this.y,this.h+this.y);return new uu(this.context,this.getOptions,i,o)},this.animate=i=>{const{canvas:o,context:r,particlesGenerated:a,lastNumberOfPieces:l}=this,{run:c,recycle:u,numberOfPieces:h,debug:d,tweenFunction:f,tweenDuration:p}=this.getOptions();if(!c)return!1;const g=this.particles.length,y=u?g:a;if(y<h){l!==h&&(this.tweenProgress=0,this.tweenFrom=y,this.lastNumberOfPieces=h),this.tweenProgress=Math.min(p,Math.max(0,this.tweenProgress+i));const m=f(this.tweenProgress,this.tweenFrom,h,p),x=Math.round(m-y);for(let w=0;w<x;w++)this.particles.push(this.getParticle());this.particlesGenerated+=x}d&&(r.font="12px sans-serif",r.fillStyle="#333",r.textAlign="right",r.fillText(`Particles: ${g}`,o.width-10,o.height-20));for(let m=this.particles.length-1;m>=0;m--){const x=this.particles[m];x.update(i),(x.y>o.height||x.y<-100||x.x>o.width+100||x.x<-100)&&(u&&y<=h?this.particles[m]=this.getParticle():this.removeParticleAt(m))}return g>0||y<h},this.canvas=e;const s=this.canvas.getContext("2d");if(!s)throw new Error("Could not get canvas context");this.context=s,this.getOptions=n}}const kn={width:typeof window<"u"?window.innerWidth:300,height:typeof window<"u"?window.innerHeight:200,numberOfPieces:200,friction:.99,wind:0,gravity:.1,initialVelocityX:4,initialVelocityY:10,colors:["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548"],opacity:1,debug:!1,tweenFunction:ou.easeInOutQuad,tweenDuration:5e3,recycle:!0,run:!0};class du{constructor(e,n){this.lastFrameTime=0,this.setOptionsWithDefaults=i=>{const o={confettiSource:{x:0,y:0,w:this.canvas.width,h:0}};this._options={...o,...kn,...i},Object.assign(this,i.confettiSource)},this.update=(i=0)=>{const{options:{run:o,onConfettiComplete:r,frameRate:a},canvas:l,context:c}=this,u=Math.min(i-this.lastFrameTime,50);if(a&&u<1e3/a){this.rafId=requestAnimationFrame(this.update);return}this.lastFrameTime=i-(a?u%a:0),o&&(c.fillStyle="white",c.clearRect(0,0,l.width,l.height)),this.generator.animate(u)?this.rafId=requestAnimationFrame(this.update):(r&&typeof r=="function"&&this.generator.particlesGenerated>0&&r.call(this,this),this._options.run=!1)},this.reset=()=>{this.generator&&this.generator.particlesGenerated>0&&(this.generator.particlesGenerated=0,this.generator.particles=[],this.generator.lastNumberOfPieces=0)},this.stop=()=>{this.options={run:!1},this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0)},this.canvas=e;const s=this.canvas.getContext("2d");if(!s)throw new Error("Could not get canvas context");this.context=s,this.generator=new hu(this.canvas,()=>this.options),this.options=n,this.update()}get options(){return this._options}set options(e){var i,o;const n=(i=this._options)==null?void 0:i.run,s=(o=this._options)==null?void 0:o.recycle;this.setOptionsWithDefaults(e),this.generator&&(Object.assign(this.generator,this.options.confettiSource),typeof e.recycle=="boolean"&&e.recycle&&s===!1&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),typeof e.run=="boolean"&&e.run&&n===!1&&this.update()}}const fu=ne.createRef();
14class jn extends ne.Component{constructor(e){super(e),this.canvas=ne.createRef(),this.canvas=e.canvasRef||fu}componentDidMount(){if(this.canvas.current){const e=ke(this.props)[0];this.confetti=new du(this.canvas.current,e)}}componentDidUpdate(){const e=ke(this.props)[0];this.confetti&&(this.confetti.options=e)}componentWillUnmount(){this.confetti&&this.confetti.stop(),this.confetti=void 0}render(){const[e,n]=ke(this.props),s={zIndex:2,position:"absolute",pointerEvents:"none",top:0,left:0,bottom:0,right:0,...n.style};return P.jsx("canvas",{width:e.width,height:e.height,ref:this.canvas,...n,style:s})}}jn.defaultProps={...kn};jn.displayName="ReactConfetti";function ke(t){const e={},n={},s={},i=[...Object.keys(kn),"confettiSource","drawShape","onConfettiComplete","frameRate"],o=["canvasRef"];for(const r in t){const a=t[r];i.includes(r)?e[r]=a:o.includes(r)?o[r]=a:s[r]=a}return[e,s,n]}const mu=ne.forwardRef((t,e)=>P.jsx(jn,{canvasRef:e,...t}));function pu(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t&&t.addEventListener&&t.addEventListener.apply(t,e)}function gu(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t&&t.removeEventListener&&t.removeEventListener.apply(t,e)}var je=typeof window<"u",yu=function(t){v.useEffect(t,[])},vu=function(t){var e=v.useRef(t);e.current=t,yu(function(){return function(){return e.current()}})},xu=function(t){var e=v.useRef(0),n=v.useState(t),s=n[0],i=n[1],o=v.useCallback(function(r){cancelAnimationFrame(e.current),e.current=requestAnimationFrame(function(){i(r)})},[]);return vu(function(){cancelAnimationFrame(e.current)}),[s,o]},wu=function(t){var e={},n=e.initialWidth,s=n===void 0?1/0:n,i=e.initialHeight,o=i===void 0?1/0:i,r=e.onChange,a=xu({width:je?window.innerWidth:s,height:je?window.innerHeight:o}),l=a[0],c=a[1];return v.useEffect(function(){if(je){var u=function(){var h=window.innerWidth,d=window.innerHeight;c({width:h,height:d}),r&&r(h,d)};return pu(window,"resize",u),function(){gu(window,"resize",u)}}},[]),l};const Pu={common:{gradient:"from-gray-100 to-gray-200"},rare:{gradient:"from-blue-100 to-blue-200"},ultra_rare:{gradient:"from-purple-300/90 to-purple-400/90"},secret_rare:{gradient:"from-red-300/90 to-red-400/90"},mythic:{gradient:"from-yellow-100 to-yellow-200"},special:{gradient:"from-emerald-100 to-emerald-200",maxNumber:25}};function Tu({isOpen:t,onClose:e,cards:n,packType:s}){var x;const[i,o]=v.useState(-1),[r,a]=v.useState(!1),{width:l,height:c}=wu(),[u,h]=v.useState(!1),[d,f]=v.useState(!1);v.useEffect(()=>{t&&(o(-1),h(!1),f(!1),setTimeout(()=>{o(0)},1e3))},[t]);const p=()=>{i<n.length-1?(h(!1),setTimeout(()=>{o(i+1)},300)):(f(!0),setTimeout(e,500))},g=()=>{if(!d)if(u)p();else{h(!0);const w=n[i];w&&(w.rarity==="ultra_rare"||w.rarity==="secret_rare"||w.rarity==="mythic"||w.rarity==="special")&&(a(!0),setTimeout(()=>a(!1),3e3))}};if(!t)return null;const y=()=>{switch(s){case"daily":return"from-blue-500 to-sky-500";case"leaderboard":return"from-purple-500 to-indigo-500";case"special":return"from-yellow-500 to-amber-500";default:return"from-red-500 to-rose-500"}},m=n[i];return P.jsxs(Zt.div,{className:"fixed inset-0 bg-black/90 z-50 flex items-center justify-center",initial:{opacity:0}
14,animate:{opacity:1},exit:{opacity:0},children:[r&&P.jsx(mu,{width:l,height:c,numberOfPieces:200,recycle:!1,colors:["#EF4444","#3B82F6","#F59E0B","#10B981"]}),P.jsx(Or,{mode:"wait",children:i===-1?P.jsx(Zt.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},exit:{scale:0,rotate:180},className:`w-64 h-96 rounded-xl bg-gradient-to-br ${y()} shadow-xl flex items-center justify-center cursor-pointer`,onClick:()=>o(0),children:P.jsx(se,{className:"w-24 h-24 text-white"})},"pack"):m?P.jsx(Zt.div,{initial:{scale:0},animate:{scale:d?0:1},exit:{scale:0},className:"perspective-1000",onClick:g,children:P.jsxs(Zt.div,{className:"w-64 h-96 rounded-xl shadow-xl cursor-pointer transform-style-3d relative",animate:{rotateY:u?180:0},transition:{duration:.6},children:[P.jsx("div",{className:`absolute inset-0 backface-hidden rounded-xl bg-gradient-to-br ${y()} flex items-center justify-center`,children:P.jsx(se,{className:"w-24 h-24 text-white"})}),P.jsxs("div",{className:`absolute inset-0 backface-hidden rounded-xl rotate-y-180 ${m.rarity==="special"?"bg-black":`bg-gradient-to-br ${((x=Pu[m.rarity])==null?void 0:x.gradient)||""}`} p-4 flex flex-col items-center justify-center`,style:m.special_background_url?{backgroundImage:`linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url(${m.special_background_url})`,backgroundSize:"cover",backgroundPosition:"center"}:void 0,children:[P.jsxs("div",{className:"relative",children:[P.jsx("img",{src:m.is_shiny?`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/shiny/${m.pokemon_id}.png`:`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/${m.pokemon_id}.png`,alt:`Pokemon #${m.pokemon_id}`,className:"w-48 h-48 object-contain"}),m.is_shiny&&P.jsx(Qs,{className:"absolute top-0 right-0 text-yellow-400 w-6 h-6"})]}),m.card_number&&P.jsx("div",{className:"mt-4 text-lg font-bold text-white",children:m.card_number}),P.jsxs("div",{className:"mt-4 text-center",children:[P.jsx("div",{className:"text-lg font-bold text-white",children:m.rarity.split("_").map(w=>w.charAt(0).toUpperCase()+w.slice(1)).join(" ")}),m.is_shiny&&P.jsx("div",{className:"text-yellow-400 font-medium mt-1",children:"⨠Shiny"})]})]})]})},`card-${m.id}`):null}),P.jsx("div",{className:"absolute bottom-8 left-0 right-0 text-center text-white text-lg",children:i===-1?"Click to open pack":u?i<n.length-1?"Click for next card":"Click to finish":"Click to reveal card"})]})}const st={special:{name:"Special",color:"text-emerald-600",gradient:"from-emerald-100 to-emerald-200",chance:.01,order:1},mythic:{name:"Mythic",color:"text-yellow-600",gradient:"from-yellow-100 to-yellow-200",chance:.004,order:2},secret_rare:{name:"Secret Rare",color:"text-red-600",gradient:"from-red-100 to-red-200",chance:.006,order:3},ultra_rare:{name:"Ultra Rare",color:"text-purple-600",gradient:"from-purple-100 to-purple-200",chance:.02,order:4},rare:{name:"Rare",color:"text-blue-600",gradient:"from-blue-100 to-blue-200",chance:.26,order:5},common:{name:"Common",color:"text-gray-600",gradient:"from-gray-100 to-gray-200",chance:.7,order:6}},bu=1017;function Du({user:t}){const[e,n]=v.useState([]),[s,i]=v.useState([]),[o,r]=v.useState(!0),[a,l]=v.useState(!1),[c,u]=v.useState(null),[h,d]=v.useState([]),[f,p]=v.useState("recent"),[g,y]=v.useState(!1);v.useEffect(()=>{t?(m(),x()):r(!1)},[t]),v.useEffect(()=>{r(!1)},[]);const m=async()=>{try{const{data:b,error:V}=await nt.from("trainer_cards").select("*").eq("user_id",t.id).order("obtained_at",{ascending:!1});if(V)throw V;n(b||[])}catch{}},x=async()=>{try{const{data:b,error:V}=await nt.from("card_packs").select("*").eq("user_id",t.id).eq("is_opened",!1).order("created_at",{ascending:!1});if(V)throw V;i(b||[])}catch{i([])}},w=b=>{const V=Math.random();let B=0;const Y=b==="special"?2:1;for(const[R,{chance:F}]of Object.entries(st))if(B+=F*Y,V<=B)return R;return"common"},A=async b=>{const V=b.pack_type==="special"?5:3,B=[];for(let pt=0;pt<V;pt++){const G=w(b.pack_type),Mr=Math.random()<.1,ye=Math.floor(Math.random()*bu)+1,ve={user_id:t.id,pokemon_id:ye,is_shiny:Mr,rarity:G,pack_id:b.id};if(G==="special"||G==="mythic"||G==="ultra_rare"||G==="secret_rare"){const zt
14=Math.random(),Vr=G==="special"?zt<.005?1:zt<.015?25:zt<.03?50:zt<.05?75:100:void 0,{data:In}=await nt.rpc("generate_card_number",{pokemon_id:ye,card_rarity:G,max_number:Vr});if(In&&(ve.card_number=In),G==="special"){const{data:Ln}=await nt.rpc("get_special_background_url",{pokemon_name:`Pokemon ${ye}`});Ln&&(ve.special_background_url=Ln)}}B.push(ve)}const{data:Y,error:R}=await nt.from("trainer_cards").insert(B).select();if(R)throw R;const{error:F}=await nt.from("card_packs").update({is_opened:!0,opened_at:new Date().toISOString()}).eq("id",b.id);if(F)throw F;return Y},T=async b=>{try{u(b);const V=await A(b);d(V),l(!0)}catch{gt.error("Failed to open pack"),u(null)}},M=()=>{l(!1),u(null),d([]),m(),x()},E=b=>{const V=[...b];switch(f){case"rarity-desc":return V.sort((B,Y)=>{const R=B.rarity?st[B.rarity].order:999,F=Y.rarity?st[Y.rarity].order:999;return R-F});case"rarity-asc":return V.sort((B,Y)=>{const R=B.rarity?st[B.rarity].order:999;return(Y.rarity?st[Y.rarity].order:999)-R});case"oldest":return V.reverse();default:return V}},C=()=>{const b=["recent","oldest","rarity-desc","rarity-asc"],B=(b.indexOf(f)+1)%b.length;p(b[B])},L=()=>{switch(f){case"rarity-desc":return"Rarity (Highest)";case"rarity-asc":return"Rarity (Lowest)";case"oldest":return"Oldest First";default:return"Recent First"}},U=async b=>{try{const{error:V}=await nt.from("trainer_cards").delete().eq("id",b);if(V)throw V;n(e.filter(B=>B.id!==b)),gt.success("Card deleted successfully")}catch{gt.error("Failed to delete card")}},et=async()=>{if(t)try{y(!0);const{error:b}=await nt.rpc("claim_daily_pack",{user_id:t.id});if(b){if(b.message==="Daily pack already claimed"){gt.error("You have already claimed your daily pack today. Come back tomorrow!");return}throw b}gt.success("Daily pack claimed!"),x()}catch{gt.error("Failed to claim daily pack")}finally{y(!1)}};if(o)return P.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:P.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500"})});const Mt=E(e);return P.jsxs("div",{className:"space-y-8",children:[P.jsxs("div",{className:"flex items-center justify-between",children:[P.jsxs("h2",{className:"text-xl sm:text-2xl font-bold flex items-center gap-2",children:[P.jsx(se,{className:"text-purple-500"}),P.jsx("span",{className:"hidden sm:inline",children:"Card Packs"}),P.jsx("span",{className:"sm:hidden",children:"Packs"})]}),P.jsxs("button",{onClick:et,disabled:g,className:`flex items-center gap-2 px-3 sm:px-4 py-2 bg-green-500 text-white rounded-lg transition-colors text-sm sm:text-base ${g?"opacity-50 cursor-not-allowed":"hover:bg-green-600"}`,children:[P.jsx(Rr,{className:"w-4 h-4"}),P.jsx("span",{className:"hidden sm:inline",children:"Claim Daily Pack"}),P.jsx("span",{className:"sm:hidden",children:"Daily Pack"})]})]}),s.length>0&&P.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 gap-2 sm:gap-4",children:s.map(b=>P.jsx("button",{onClick:()=>T(b),className:"aspect-[3/4] bg-gradient-to-br from-purple-500 to-indigo-600 rounded-lg sm:rounded-xl shadow-lg hover:shadow-xl transition-all hover:-translate-y-1 flex items-center justify-center",children:P.jsx(se,{className:"w-8 h-8 sm:w-12 md:w-16 sm:h-12 md:h-16 text-white"})},b.id))}),P.jsxs("div",{children:[P.jsxs("div",{className:"flex items-center justify-between mb-4",children:[P.jsx("h2",{className:"text-xl sm:text-2xl font-bold",children:"Your Collection"}),P.jsxs("button",{onClick:C,className:"flex items-center gap-2 px-3 sm:px-4 py-2 bg-white border rounded-lg hover:bg-gray-50 transition-colors text-sm sm:text-base",children:[P.jsx(kr,{className:"w-4 h-4"}),P.jsx("span",{className:"hidden sm:inline",children:L()}),P.jsx("span",{className:"sm:hidden",children:"Sort"})]})]}),Mt.length>0?P.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 gap-2 sm:gap-4",children:Mt.map(b=>P.jsxs("div",{className:`group relative aspect-[3/4] rounded-lg sm:rounded-xl shadow-lg overflow-hidden bg-gradient-to-br ${b.special_background_url?"bg-black":b.rarity?st[b.rarity].gradient:"from-gray-100 to-gray-200"}`,style:b.special_background_url?{backgroundImage:`linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url(${b.special_background_url})`,backgroundSize:"cover",backgroundPosition:"center"}:void 0,children:[P.jsx("button",{onClick:()=>U(b.id),className:"absolute top-1 right-1 sm:top-2 sm:right-2 p-1 sm:p-2 bg-red-500/0 hover:bg-red-500 text-white/0 hover:text-white rounded-lg transition-all opacity-0 group-hover:opacity-100 z-10",children:P.jsx(Er,{className:"w-3 h-3 sm:w-4 sm:h-4"})}),P.jsxs("div",{className:"p-2 sm:p-4 flex flex-col items-center h-full",children:[P.jsxs("div",{className:"relative flex-1 flex items-center justify-center",children:[P.jsx("img",{src:b.is_shiny?`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artw
14ork/shiny/${b.pokemon_id}.png`:`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/${b.pokemon_id}.png`,alt:`Pokemon #${b.pokemon_id}`,className:"w-16 h-16 sm:w-24 md:w-32 sm:h-24 md:h-32 object-contain"}),b.is_shiny&&P.jsx(Qs,{className:"absolute top-0 right-0 text-yellow-400 w-4 h-4 sm:w-6 sm:h-6"})]}),b.rarity&&P.jsxs("div",{className:"mt-1 sm:mt-2 space-y-1 text-center",children:[P.jsx("div",{className:`text-xs sm:text-sm font-bold ${b.special_background_url?"text-white":st[b.rarity].color}`,children:st[b.rarity].name}),b.card_number&&P.jsx("div",{className:`text-xs sm:text-sm font-bold ${b.special_background_url?"text-white":"text-black"}`,children:b.card_number})]})]})]},b.id))}):P.jsx("div",{className:"text-center py-8 sm:py-12 text-gray-500 text-sm sm:text-base",children:s.length>0?"Open your packs to start your collection!":"No cards in your collection yet. Check back later for opportunities to earn packs!"})]}),a&&c&&P.jsx(Tu,{isOpen:a,onClose:M,cards:h,packType:c.pack_type})]})}export{Du as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.