UNPKG

ios-notification-stack

Version:

iOS-style notification stack system for React applications with bundled dependencies

39 lines (37 loc) 139 kB
(function(_,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(_=typeof globalThis<"u"?globalThis:_||self,x(_["ios-notification-stack"]={},_.React,_.ReactDOM))})(this,function(_,x,ur){"use strict";function cr(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const De=cr(x);var le={exports:{}},Bt={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Xn;function fr(){if(Xn)return Bt;Xn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(s,i,r){var o=null;if(r!==void 0&&(o=""+r),i.key!==void 0&&(o=""+i.key),"key"in i){r={};for(var a in i)a!=="key"&&(r[a]=i[a])}else r=i;return i=r.ref,{$$typeof:t,type:s,key:o,ref:i!==void 0?i:null,props:r}}return Bt.Fragment=e,Bt.jsx=n,Bt.jsxs=n,Bt}var Ft={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var qn;function hr(){return qn||(qn=1,process.env.NODE_ENV!=="production"&&function(){function t(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===J?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case b:return"Fragment";case y:return"Portal";case E:return"Profiler";case D:return"StrictMode";case Nt:return"Suspense";case oe:return"SuspenseList"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case $:return(h.displayName||"Context")+".Provider";case B:return(h._context.displayName||"Context")+".Consumer";case st:var P=h.render;return h=h.displayName,h||(h=P.displayName||P.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case jt:return P=h.displayName||null,P!==null?P:t(h.type)||"Memo";case Ve:P=h._payload,h=h._init;try{return t(h(P))}catch{}}return null}function e(h){return""+h}function n(h){try{e(h);var P=!1}catch{P=!0}if(P){P=console;var A=P.error,k=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return A.call(P,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",k),e(h)}}function s(){}function i(){if(re===0){Zo=console.log,Jo=console.info,Qo=console.warn,tr=console.error,er=console.group,nr=console.groupCollapsed,sr=console.groupEnd;var h={configurable:!0,enumerable:!0,value:s,writable:!0};Object.defineProperties(console,{info:h,log:h,warn:h,error:h,group:h,groupCollapsed:h,groupEnd:h})}re++}function r(){if(re--,re===0){var h={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:bt({},h,{value:Zo}),info:bt({},h,{value:Jo}),warn:bt({},h,{value:Qo}),error:bt({},h,{value:tr}),group:bt({},h,{value:er}),groupCollapsed:bt({},h,{value:nr}),groupEnd:bt({},h,{value:sr})})}0>re&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function o(h){if(Gn===void 0)try{throw Error()}catch(A){var P=A.stack.trim().match(/\n( *(at )?)/);Gn=P&&P[1]||"",ir=-1<A.stack.indexOf(` at`)?" (<anonymous>)":-1<A.stack.indexOf("@")?"@unknown:0:0":""}return` `+Gn+h+ir}function a(h,P){if(!h||Hn)return"";var A=Yn.get(h);if(A!==void 0)return A;Hn=!0,A=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var k=null;k=Q.H,Q.H=null,i();try{var z={DetermineComponentFrameRoot:function(){try{if(P){var pt=function(){throw Error()};if(Object.defineProperty(pt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pt,[])}catch(at){var Me=at}Reflect.construct(h,[],pt)}else{try{pt.call()}catch(at){Me=at}h.call(pt.prototype)}}else{try{throw Error()}catch(at){Me=at}(pt=h())&&typeof pt.catch=="function"&&pt.catch(function(){})}}catch(at){if(at&&Me&&typeof at.stack=="string")return[at.stack,Me.stack]}return[null,null]}};z.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var L=Object.getOwnPropertyDescriptor(z.DetermineComponentFrameRoot,"name");L&&L.configurable&&Object.defineProperty(z.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var V=z.DetermineComponentFrameRoot(),rt=V[0],It=V[1];if(rt&&It){var H=rt.split(` `),wt=It.split(` `);for(V=L=0;L<H.length&&!H[L].includes("DetermineComponentFrameRoot");)L++;for(;V<wt.length&&!wt[V].includes("DetermineComponentFrameRoot");)V++;if(L===H.length||V===wt.length)for(L=H.length-1,V=wt.length-1;1<=L&&0<=V&&H[L]!==wt[V];)V--;for(;1<=L&&0<=V;L--,V--)if(H[L]!==wt[V]){if(L!==1||V!==1)do if(L--,V--,0>V||H[L]!==wt[V]){var ae=` `+H[L].replace(" at new "," at ");return h.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",h.displayName)),typeof h=="function"&&Yn.set(h,ae),ae}while(1<=L&&0<=V);break}}}finally{Hn=!1,Q.H=k,r(),Error.prepareStackTrace=A}return H=(H=h?h.displayName||h.name:"")?o(H):"",typeof h=="function"&&Yn.set(h,H),H}function l(h){if(h==null)return"";if(typeof h=="function"){var P=h.prototype;return a(h,!(!P||!P.isReactComponent))}if(typeof h=="string")return o(h);switch(h){case Nt:return o("Suspense");case oe:return o("SuspenseList")}if(typeof h=="object")switch(h.$$typeof){case st:return h=a(h.render,!1),h;case jt:return l(h.type);case Ve:P=h._payload,h=h._init;try{return l(h(P))}catch{}}return""}function u(){var h=Q.A;return h===null?null:h.getOwner()}function c(h){if(Lt.call(h,"key")){var P=Object.getOwnPropertyDescriptor(h,"key").get;if(P&&P.isReactWarning)return!1}return h.key!==void 0}function f(h,P){function A(){or||(or=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",P))}A.isReactWarning=!0,Object.defineProperty(h,"key",{get:A,configurable:!0})}function d(){var h=t(this.type);return rr[h]||(rr[h]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),h=this.props.ref,h!==void 0?h:null}function p(h,P,A,k,z,L){return A=L.ref,h={$$typeof:M,type:h,key:P,props:L,_owner:z},(A!==void 0?A:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:d}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function m(h,P,A,k,z,L){if(typeof h=="string"||typeof h=="function"||h===b||h===E||h===D||h===Nt||h===oe||h===qo||typeof h=="object"&&h!==null&&(h.$$typeof===Ve||h.$$typeof===jt||h.$$typeof===$||h.$$typeof===B||h.$$typeof===st||h.$$typeof===tf||h.getModuleId!==void 0)){var V=P.children;if(V!==void 0)if(k)if(zn(V)){for(k=0;k<V.length;k++)g(V[k],h);Object.freeze&&Object.freeze(V)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(V,h)}else V="",(h===void 0||typeof h=="object"&&h!==null&&Object.keys(h).length===0)&&(V+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),h===null?k="null":zn(h)?k="array":h!==void 0&&h.$$typeof===M?(k="<"+(t(h.type)||"Unknown")+" />",V=" Did you accidentally export a JSX literal instead of a component?"):k=typeof h,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",k,V);if(Lt.call(P,"key")){V=t(h);var rt=Object.keys(P).filter(function(H){return H!=="key"});k=0<rt.length?"{key: someKey, "+rt.join(": ..., ")+": ...}":"{key: someKey}",ar[V+k]||(rt=0<rt.length?"{"+rt.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,k,V,rt,V),ar[V+k]=!0)}if(V=null,A!==void 0&&(n(A),V=""+A),c(P)&&(n(P.key),V=""+P.key),"key"in P){A={};for(var It in P)It!=="key"&&(A[It]=P[It])}else A=P;return V&&f(A,typeof h=="function"?h.displayName||h.name||"Unknown":h),p(h,V,L,z,u(),A)}function g(h,P){if(typeof h=="object"&&h&&h.$$typeof!==ef){if(zn(h))for(var A=0;A<h.length;A++){var k=h[A];T(k)&&v(k,P)}else if(T(h))h._store&&(h._store.validated=1);else if(h===null||typeof h!="object"?A=null:(A=F&&h[F]||h["@@iterator"],A=typeof A=="function"?A:null),typeof A=="function"&&A!==h.entries&&(A=A.call(h),A!==h))for(;!(h=A.next()).done;)T(h.value)&&v(h.value,P)}}function T(h){return typeof h=="object"&&h!==null&&h.$$typeof===M}function v(h,P){if(h._store&&!h._store.validated&&h.key==null&&(h._store.validated=1,P=w(P),!lr[P])){lr[P]=!0;var A="";h&&h._owner!=null&&h._owner!==u()&&(A=null,typeof h._owner.tag=="number"?A=t(h._owner.type):typeof h._owner.name=="string"&&(A=h._owner.name),A=" It was passed a child from "+A+".");var k=Q.getCurrentStack;Q.getCurrentStack=function(){var z=l(h.type);return k&&(z+=k()||""),z},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',P,A),Q.getCurrentStack=k}}function w(h){var P="",A=u();return A&&(A=t(A.type))&&(P=` Check the render method of \``+A+"`."),P||(h=t(h))&&(P=` Check the top-level render call using <`+h+">."),P}var S=x,M=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),$=Symbol.for("react.context"),st=Symbol.for("react.forward_ref"),Nt=Symbol.for("react.suspense"),oe=Symbol.for("react.suspense_list"),jt=Symbol.for("react.memo"),Ve=Symbol.for("react.lazy"),qo=Symbol.for("react.offscreen"),F=Symbol.iterator,J=Symbol.for("react.client.reference"),Q=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Lt=Object.prototype.hasOwnProperty,bt=Object.assign,tf=Symbol.for("react.client.reference"),zn=Array.isArray,re=0,Zo,Jo,Qo,tr,er,nr,sr;s.__reactDisabledLog=!0;var Gn,ir,Hn=!1,Yn=new(typeof WeakMap=="function"?WeakMap:Map),ef=Symbol.for("react.client.reference"),or,rr={},ar={},lr={};Ft.Fragment=b,Ft.jsx=function(h,P,A,k,z){return m(h,P,A,!1,k,z)},Ft.jsxs=function(h,P,A,k,z){return m(h,P,A,!0,k,z)}}()),Ft}var Zn;function dr(){return Zn||(Zn=1,process.env.NODE_ENV==="production"?le.exports=fr():le.exports=hr()),le.exports}var R=dr();const Re=x.createContext({});function ke(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const Oe=typeof window<"u",Jn=Oe?x.useLayoutEffect:x.useEffect,ue=x.createContext(null),Ne=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class pr extends De.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=n.offsetParent,i=s instanceof HTMLElement&&s.offsetWidth||0,r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft,r.right=i-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function mr({children:t,isPresent:e,anchorX:n}){const s=x.useId(),i=x.useRef(null),r=x.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=x.useContext(Ne);return x.useInsertionEffect(()=>{const{width:a,height:l,top:u,left:c,right:f}=r.current;if(e||!i.current||!a||!l)return;const d=n==="left"?`left: ${c}`:`right: ${f}`;i.current.dataset.motionPopId=s;const p=document.createElement("style");return o&&(p.nonce=o),document.head.appendChild(p),p.sheet&&p.sheet.insertRule(` [data-motion-pop-id="${s}"] { position: absolute !important; width: ${a}px !important; height: ${l}px !important; ${d}px !important; top: ${u}px !important; } `),()=>{document.head.removeChild(p)}},[e]),R.jsx(pr,{isPresent:e,childRef:i,sizeRef:r,children:De.cloneElement(t,{ref:i})})}const gr=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a})=>{const l=ke(yr),u=x.useId(),c=x.useCallback(d=>{l.set(d,!0);for(const p of l.values())if(!p)return;s&&s()},[l,s]),f=x.useMemo(()=>({id:u,initial:e,isPresent:n,custom:i,onExitComplete:c,register:d=>(l.set(d,!1),()=>l.delete(d))}),r?[Math.random(),c]:[n,c]);return x.useMemo(()=>{l.forEach((d,p)=>l.set(p,!1))},[n]),De.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),o==="popLayout"&&(t=R.jsx(mr,{isPresent:n,anchorX:a,children:t})),R.jsx(ue.Provider,{value:f,children:t})};function yr(){return new Map}function Qn(t=!0){const e=x.useContext(ue);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=x.useId();x.useEffect(()=>{if(t)return i(r)},[t]);const o=x.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const ce=t=>t.key||"";function ts(t){const e=[];return x.Children.forEach(t,n=>{x.isValidElement(n)&&e.push(n)}),e}const es=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,u]=Qn(o),c=x.useMemo(()=>ts(t),[t]),f=o&&!l?[]:c.map(ce),d=x.useRef(!0),p=x.useRef(c),m=ke(()=>new Map),[g,T]=x.useState(c),[v,w]=x.useState(c);Jn(()=>{d.current=!1,p.current=c;for(let y=0;y<v.length;y++){const b=ce(v[y]);f.includes(b)?m.delete(b):m.get(b)!==!0&&m.set(b,!1)}},[v,f.length,f.join("-")]);const S=[];if(c!==g){let y=[...c];for(let b=0;b<v.length;b++){const D=v[b],E=ce(D);f.includes(E)||(y.splice(b,0,D),S.push(D))}return r==="wait"&&S.length&&(y=S),w(ts(y)),T(c),null}process.env.NODE_ENV!=="production"&&r==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:M}=x.useContext(Re);return R.jsx(R.Fragment,{children:v.map(y=>{const b=ce(y),D=o&&!l?!1:c===v||f.includes(b),E=()=>{if(m.has(b))m.set(b,!0);else return;let B=!0;m.forEach($=>{$||(B=!1)}),B&&(M==null||M(),w(p.current),o&&(u==null||u()),s&&s())};return R.jsx(gr,{isPresent:D,initial:!d.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,onExitComplete:D?void 0:E,anchorX:a,children:y},b)})})};function je(t,e){t.indexOf(e)===-1&&t.push(e)}function Le(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Y=t=>t;let St=Y,lt=Y;process.env.NODE_ENV!=="production"&&(St=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},lt=(t,e)=>{if(!t)throw new Error(e)});const vr={useManualTiming:!1};function Ie(t){let e;return()=>(e===void 0&&(e=t()),e)}const Pt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class Be{constructor(){this.subscriptions=[]}add(e){return je(this.subscriptions,e),()=>Le(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const tt=t=>t*1e3,it=t=>t/1e3;function ns(t,e){return e?t*(1e3/e):0}const ss=new Set;function fe(t,e,n){t||ss.has(e)||(console.warn(e),ss.add(e))}const xr=Ie(()=>window.ScrollTimeline!==void 0);class Tr{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(xr()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,r)=>{i&&i(),this.animations[r].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 br extends Tr{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}function Fe(t,e){return t?t[e]||t.default||t:void 0}const _e=2e4;function is(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<_e;)e+=n,s=t.next(e);return e>=_e?1/0:e}function Ue(t){return typeof t=="function"}function os(t,e){t.timeline=e,t.onfinish=null}const $e=t=>Array.isArray(t)&&typeof t[0]=="number",wr={linearEasing:void 0};function Sr(t,e){const n=Ie(t);return()=>{var s;return(s=wr[e])!==null&&s!==void 0?s:n()}}const he=Sr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),rs=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=t(Pt(0,i-1,r))+", ";return`linear(${s.substring(0,s.length-2)})`};function as(t){return!!(typeof t=="function"&&he()||!t||typeof t=="string"&&(t in We||he())||$e(t)||Array.isArray(t)&&t.every(as))}const _t=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,We={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_t([0,.65,.55,1]),circOut:_t([.55,0,1,.45]),backIn:_t([.31,.01,.66,-.59]),backOut:_t([.33,1.53,.69,.99])};function ls(t,e){if(t)return typeof t=="function"&&he()?rs(t,e):$e(t)?_t(t):Array.isArray(t)?t.map(n=>ls(n,e)||We.easeOut):We[t]}const de=["read","resolveKeyframes","update","preRender","render","postRender"],us={value:null};function Pr(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(f){o.has(f)&&(c.schedule(f),t()),l++,f(a)}const c={schedule:(f,d=!1,p=!1)=>{const g=p&&i?n:s;return d&&o.add(f),g.has(f)||g.add(f),f},cancel:f=>{s.delete(f),o.delete(f)},process:f=>{if(a=f,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(u),e&&us.value&&us.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,c.process(f))}};return c}const Ar=40;function cs(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=de.reduce((v,w)=>(v[w]=Pr(r,e?w:void 0),v),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:f,postRender:d}=o,p=()=>{const v=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(v-i.timestamp,Ar),1),i.timestamp=v,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),f.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))},m=()=>{n=!0,s=!0,i.isProcessing||t(p)};return{schedule:de.reduce((v,w)=>{const S=o[w];return v[w]=(M,y=!1,b=!1)=>(n||m(),S.schedule(M,y,b)),v},{}),cancel:v=>{for(let w=0;w<de.length;w++)o[de[w]].cancel(v)},state:i,steps:o}}const{schedule:O,cancel:ut,state:U,steps:Ke}=cs(typeof requestAnimationFrame<"u"?requestAnimationFrame:Y,!0),{schedule:ze}=cs(queueMicrotask,!1);let pe;function Cr(){pe=void 0}const et={now:()=>(pe===void 0&&et.set(U.isProcessing||vr.useManualTiming?U.timestamp:performance.now()),pe),set:t=>{pe=t,queueMicrotask(Cr)}},Z={x:!1,y:!1};function fs(){return Z.x||Z.y}function Er(t){return t==="x"||t==="y"?Z[t]?null:(Z[t]=!0,()=>{Z[t]=!1}):Z.x||Z.y?null:(Z.x=Z.y=!0,()=>{Z.x=Z.y=!1})}function Vr(t,e,n){var s;if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;const r=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function hs(t,e){const n=Vr(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function ds(t){return!(t.pointerType==="touch"||fs())}function Mr(t,e,n={}){const[s,i,r]=hs(t,n),o=a=>{if(!ds(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const c=f=>{ds(f)&&(u(f),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,i)};return s.forEach(a=>{a.addEventListener("pointerenter",o,i)}),r}const ps=(t,e)=>e?t===e?!0:ps(t,e.parentElement):!1,Ge=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Dr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Rr(t){return Dr.has(t.tagName)||t.tabIndex!==-1}const Ut=new WeakSet;function ms(t){return e=>{e.key==="Enter"&&t(e)}}function He(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const kr=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=ms(()=>{if(Ut.has(n))return;He(n,"down");const i=ms(()=>{He(n,"up")}),r=()=>He(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function gs(t){return Ge(t)&&!fs()}function Or(t,e,n={}){const[s,i,r]=hs(t,n),o=a=>{const l=a.currentTarget;if(!gs(a)||Ut.has(l))return;Ut.add(l);const u=e(l,a),c=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),!(!gs(p)||!Ut.has(l))&&(Ut.delete(l),typeof u=="function"&&u(p,{success:m}))},f=p=>{c(p,l===window||l===document||n.useGlobalTarget||ps(l,p.target))},d=p=>{c(p,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",d,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a instanceof HTMLElement&&(a.addEventListener("focus",u=>kr(u,i)),!Rr(a)&&a.tabIndex===null&&(a.tabIndex=0))}),r}const ys=30,Nr=t=>!isNaN(parseFloat(t));class jr{constructor(e,n={}){this.version="12.6.1",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=et.now();this.updatedAt!==r&&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=et.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Nr(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&fe(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Be);const s=this.events[e].add(n);return e==="change"?()=>{s(),O.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=et.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ys)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ys);return ns(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 $t(t,e){return new jr(t,e)}const vs=x.createContext({strict:!1}),xs={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"]},At={};for(const t in xs)At[t]={isEnabled:e=>xs[t].some(n=>!!e[n])};function Lr(t){for(const e in t)At[e]={...At[e],...t[e]}}const Ir=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 me(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ir.has(t)}let Ts=t=>!me(t);function Br(t){t&&(Ts=e=>e.startsWith("on")?!me(e):t(e))}try{Br(require("@emotion/is-prop-valid").default)}catch{}function Fr(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Ts(i)||n===!0&&me(i)||!e&&!me(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function _r(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...s)=>(process.env.NODE_ENV!=="production"&&fe(!1,"motion() is deprecated. Use motion.create() instead."),t(...s));return new Proxy(n,{get:(s,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const ge=x.createContext({});function ye(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Wt(t){return typeof t=="string"||Array.isArray(t)}const Ye=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Xe=["initial",...Ye];function ve(t){return ye(t.animate)||Xe.some(e=>Wt(t[e]))}function bs(t){return!!(ve(t)||t.variants)}function Ur(t,e){if(ve(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Wt(n)?n:void 0,animate:Wt(s)?s:void 0}}return t.inherit!==!1?e:{}}function $r(t){const{initial:e,animate:n}=Ur(t,x.useContext(ge));return x.useMemo(()=>({initial:e,animate:n}),[ws(e),ws(n)])}function ws(t){return Array.isArray(t)?t.join(" "):t}const Wr=Symbol.for("motionComponentSymbol");function Ct(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Kr(t,e,n){return x.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):Ct(n)&&(n.current=s))},[e])}const qe=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ss="data-"+qe("framerAppearId"),Ps=x.createContext({});function zr(t,e,n,s,i){var r,o;const{visualElement:a}=x.useContext(ge),l=x.useContext(vs),u=x.useContext(ue),c=x.useContext(Ne).reducedMotion,f=x.useRef(null);s=s||l.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const d=f.current,p=x.useContext(Ps);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&Gr(f.current,n,i,p);const m=x.useRef(!1);x.useInsertionEffect(()=>{d&&m.current&&d.update(n,u)});const g=n[Ss],T=x.useRef(!!g&&!(!((r=window.MotionHandoffIsComplete)===null||r===void 0)&&r.call(window,g))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,g)));return Jn(()=>{d&&(m.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),ze.render(d.render),T.current&&d.animationState&&d.animationState.animateChanges())}),x.useEffect(()=>{d&&(!T.current&&d.animationState&&d.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{var v;(v=window.MotionHandoffMarkAsComplete)===null||v===void 0||v.call(window,g)}),T.current=!1))}),d}function Gr(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:As(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&Ct(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:u})}function As(t){if(t)return t.options.allowProjection!==!1?t.projection:As(t.parent)}function Hr({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){var r,o;t&&Lr(t);function a(u,c){let f;const d={...x.useContext(Ne),...u,layoutId:Yr(u)},{isStatic:p}=d,m=$r(u),g=s(u,p);if(!p&&Oe){Xr(d,t);const T=qr(d);f=T.MeasureLayout,m.visualElement=zr(i,g,d,e,T.ProjectionNode)}return R.jsxs(ge.Provider,{value:m,children:[f&&m.visualElement?R.jsx(f,{visualElement:m.visualElement,...d}):null,n(i,u,Kr(g,m.visualElement,c),g,p,m.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(r=i.displayName)!==null&&r!==void 0?r:i.name)!==null&&o!==void 0?o:""})`}`;const l=x.forwardRef(a);return l[Wr]=i,l}function Yr({layoutId:t}){const e=x.useContext(Re).id;return e&&t!==void 0?e+"-"+t:t}function Xr(t,e){const n=x.useContext(vs).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?St(!1,s):lt(!1,s)}}function qr(t){const{drag:e,layout:n}=At;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 Cs=t=>e=>typeof e=="string"&&e.startsWith(t),Ze=Cs("--"),Zr=Cs("var(--"),Je=t=>Zr(t)?Jr.test(t.split("/*")[0].trim()):!1,Jr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Kt={};function Qr(t){for(const e in t)Kt[e]=t[e],Ze(e)&&(Kt[e].isCSSVariable=!0)}const Et=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mt=new Set(Et);function Es(t,{layout:e,layoutId:n}){return mt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Kt[t]||t==="opacity")}const W=t=>!!(t&&t.getVelocity),Vs=(t,e)=>e&&typeof t=="number"?e.transform(t):t,ot=(t,e,n)=>n>e?e:n<t?t:n,Vt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},zt={...Vt,transform:t=>ot(0,1,t)},xe={...Vt,default:1},Gt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ct=Gt("deg"),nt=Gt("%"),C=Gt("px"),ta=Gt("vh"),ea=Gt("vw"),Ms={...nt,parse:t=>nt.parse(t)/100,transform:t=>nt.transform(t*100)},na={borderWidth:C,borderTopWidth:C,borderRightWidth:C,borderBottomWidth:C,borderLeftWidth:C,borderRadius:C,radius:C,borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomRightRadius:C,borderBottomLeftRadius:C,width:C,maxWidth:C,height:C,maxHeight:C,top:C,right:C,bottom:C,left:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,backgroundPositionX:C,backgroundPositionY:C},sa={rotate:ct,rotateX:ct,rotateY:ct,rotateZ:ct,scale:xe,scaleX:xe,scaleY:xe,scaleZ:xe,skew:ct,skewX:ct,skewY:ct,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:zt,originX:Ms,originY:Ms,originZ:C},Ds={...Vt,transform:Math.round},Qe={...na,...sa,zIndex:Ds,size:C,fillOpacity:zt,strokeOpacity:zt,numOctaves:Ds},ia={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},oa=Et.length;function ra(t,e,n){let s="",i=!0;for(let r=0;r<oa;r++){const o=Et[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Vs(a,Qe[o]);if(!l){i=!1;const c=ia[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function tn(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if(mt.has(l)){o=!0;continue}else if(Ze(l)){i[l]=u;continue}else{const c=Vs(u,Qe[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=ra(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}const en=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Rs(t,e,n){for(const s in e)!W(e[s])&&!Es(s,n)&&(t[s]=e[s])}function aa({transformTemplate:t},e){return x.useMemo(()=>{const n=en();return tn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function la(t,e){const n=t.style||{},s={};return Rs(s,n,t),Object.assign(s,aa(t,e)),s}function ua(t,e){const n={},s=la(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const ca=["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 nn(t){return typeof t!="string"||t.includes("-")?!1:!!(ca.indexOf(t)>-1||/[A-Z]/u.test(t))}const fa={offset:"stroke-dashoffset",array:"stroke-dasharray"},ha={offset:"strokeDashoffset",array:"strokeDasharray"};function da(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?fa:ha;t[r.offset]=C.transform(-s);const o=C.transform(e),a=C.transform(n);t[r.array]=`${o} ${a}`}function ks(t,e,n){return typeof t=="string"?t:C.transform(e+n*t)}function pa(t,e,n){const s=ks(e,t.x,t.width),i=ks(n,t.y,t.height);return`${s} ${i}`}function sn(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f){if(tn(t,u,f),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(i!==void 0||r!==void 0||p.transform)&&(p.transformOrigin=pa(m,i!==void 0?i:.5,r!==void 0?r:.5)),e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),o!==void 0&&da(d,o,a,l,!1)}const Os=()=>({...en(),attrs:{}}),on=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ma(t,e,n,s){const i=x.useMemo(()=>{const r=Os();return sn(r,e,on(s),t.transformTemplate),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Rs(r,t.style,t),i.style={...r,...i.style}}return i}function ga(t=!1){return(n,s,i,{latestValues:r},o)=>{const l=(nn(n)?ma:ua)(s,r,o,n),u=Fr(s,typeof n=="string",t),c=n!==x.Fragment?{...u,...l,ref:i}:{},{children:f}=s,d=x.useMemo(()=>W(f)?f.get():f,[f]);return x.createElement(n,{...c,children:d})}}function Ns(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function rn(t,e,n,s){if(typeof e=="function"){const[i,r]=Ns(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=Ns(s);e=e(n!==void 0?n:t.custom,i,r)}return e}const an=t=>Array.isArray(t),ya=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),va=t=>an(t)?t[t.length-1]||0:t;function Te(t){const e=W(t)?t.get():t;return ya(e)?e.toValue():e}function xa({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},s,i,r){const o={latestValues:Ta(s,i,r,t),renderState:e()};return n&&(o.onMount=a=>n({props:s,current:a,...o}),o.onUpdate=a=>n(a)),o}const js=t=>(e,n)=>{const s=x.useContext(ge),i=x.useContext(ue),r=()=>xa(t,e,s,i);return n?r():ke(r)};function Ta(t,e,n,s){const i={},r=s(t,{});for(const d in r)i[d]=Te(r[d]);let{initial:o,animate:a}=t;const l=ve(t),u=bs(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const f=c?a:o;if(f&&typeof f!="boolean"&&!ye(f)){const d=Array.isArray(f)?f:[f];for(let p=0;p<d.length;p++){const m=rn(t,d[p]);if(m){const{transitionEnd:g,transition:T,...v}=m;for(const w in v){let S=v[w];if(Array.isArray(S)){const M=c?S.length-1:0;S=S[M]}S!==null&&(i[w]=S)}for(const w in g)i[w]=g[w]}}}return i}function ln(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(W(i[o])||e.style&&W(e.style[o])||Es(o,t)||((s=n==null?void 0:n.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(r[o]=i[o]);return r}const ba={useVisualState:js({scrapeMotionValuesFromProps:ln,createRenderState:en})};function Ls(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}function Is(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const r in n)t.style.setProperty(r,n[r])}const Bs=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 Fs(t,e,n,s){Is(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Bs.has(i)?i:qe(i),e.attrs[i])}function _s(t,e,n){const s=ln(t,e,n);for(const i in t)if(W(t[i])||W(e[i])){const r=Et.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}const Us=["x","y","width","height","cx","cy","r"],wa={useVisualState:js({scrapeMotionValuesFromProps:_s,createRenderState:Os,onUpdate:({props:t,prevProps:e,current:n,renderState:s,latestValues:i})=>{if(!n)return;let r=!!t.drag;if(!r){for(const a in i)if(mt.has(a)){r=!0;break}}if(!r)return;let o=!e;if(e)for(let a=0;a<Us.length;a++){const l=Us[a];t[l]!==e[l]&&(o=!0)}o&&O.read(()=>{Ls(n,s),O.render(()=>{sn(s,i,on(n.tagName),t.transformTemplate),Fs(n,s)})})}})};function Sa(t,e){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...nn(s)?wa:ba,preloadedFeatures:t,useRender:ga(i),createVisualElement:e,Component:s};return Hr(o)}}function Ht(t,e,n){const s=t.getProps();return rn(s,e,n!==void 0?n:s.custom,t)}const $s=new Set(["width","height","top","left","right","bottom",...Et]);function Pa(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,$t(n))}function Aa(t,e){const n=Ht(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=va(r[o]);Pa(t,o,a)}}function Ca(t){return!!(W(t)&&t.add)}function un(t,e){const n=t.getValue("willChange");if(Ca(n))return n.add(e)}function Ws(t){return t.props[Ss]}const Ks=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Ea=1e-7,Va=12;function Ma(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=Ks(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Ea&&++a<Va);return o}function Yt(t,e,n,s){if(t===e&&n===s)return Y;const i=r=>Ma(r,0,1,t,n);return r=>r===0||r===1?r:Ks(i(r),e,s)}const zs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Gs=t=>e=>1-t(1-e),Hs=Yt(.33,1.53,.69,.99),cn=Gs(Hs),Ys=zs(cn),Xs=t=>(t*=2)<1?.5*cn(t):.5*(2-Math.pow(2,-10*(t-1))),fn=t=>1-Math.sin(Math.acos(t)),qs=Gs(fn),Zs=zs(fn),Js=t=>/^0[^.\s]+$/u.test(t);function Da(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Js(t):!0}const Xt=t=>Math.round(t*1e5)/1e5,hn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ra(t){return t==null}const ka=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,dn=(t,e)=>n=>!!(typeof n=="string"&&ka.test(n)&&n.startsWith(t)||e&&!Ra(n)&&Object.prototype.hasOwnProperty.call(n,e)),Qs=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(hn);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Oa=t=>ot(0,255,t),pn={...Vt,transform:t=>Math.round(Oa(t))},gt={test:dn("rgb","red"),parse:Qs("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+pn.transform(t)+", "+pn.transform(e)+", "+pn.transform(n)+", "+Xt(zt.transform(s))+")"};function Na(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 mn={test:dn("#"),parse:Na,transform:gt.transform},Mt={test:dn("hsl","hue"),parse:Qs("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+nt.transform(Xt(e))+", "+nt.transform(Xt(n))+", "+Xt(zt.transform(s))+")"},K={test:t=>gt.test(t)||mn.test(t)||Mt.test(t),parse:t=>gt.test(t)?gt.parse(t):Mt.test(t)?Mt.parse(t):mn.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?gt.transform(t):Mt.transform(t)},ja=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function La(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(hn))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(ja))===null||n===void 0?void 0:n.length)||0)>0}const ti="number",ei="color",Ia="var",Ba="var(",ni="${}",Fa=/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 qt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Fa,l=>(K.test(l)?(s.color.push(r),i.push(ei),n.push(K.parse(l))):l.startsWith(Ba)?(s.var.push(r),i.push(Ia),n.push(l)):(s.number.push(r),i.push(ti),n.push(parseFloat(l))),++r,ni)).split(ni);return{values:n,split:a,indexes:s,types:i}}function si(t){return qt(t).values}function ii(t){const{split:e,types:n}=qt(t),s=e.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=e[o],i[o]!==void 0){const a=n[o];a===ti?r+=Xt(i[o]):a===ei?r+=K.transform(i[o]):r+=i[o]}return r}}const _a=t=>typeof t=="number"?0:t;function Ua(t){const e=si(t);return ii(t)(e.map(_a))}const ft={test:La,parse:si,createTransformer:ii,getAnimatableNone:Ua},$a=new Set(["brightness","contrast","saturate","opacity"]);function Wa(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(hn)||[];if(!s)return t;const i=n.replace(s,"");let r=$a.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Ka=/\b([a-z-]*)\(.*?\)/gu,gn={...ft,getAnimatableNone:t=>{const e=t.match(Ka);return e?e.map(Wa).join(" "):t}},za={...Qe,color:K,backgroundColor:K,outlineColor:K,fill:K,stroke:K,borderColor:K,borderTopColor:K,borderRightColor:K,borderBottomColor:K,borderLeftColor:K,filter:gn,WebkitFilter:gn},oi=t=>za[t];function ri(t,e){let n=oi(t);return n!==gn&&(n=ft),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ga=new Set(["auto","none","0"]);function Ha(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Ga.has(r)&&qt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=ri(n,i)}const yt=t=>t*180/Math.PI,yn=t=>{const e=yt(Math.atan2(t[1],t[0]));return vn(e)},Ya={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:yn,rotateZ:yn,skewX:t=>yt(Math.atan(t[1])),skewY:t=>yt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},vn=t=>(t=t%360,t<0&&(t+=360),t),ai=yn,li=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ui=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Xa={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:li,scaleY:ui,scale:t=>(li(t)+ui(t))/2,rotateX:t=>vn(yt(Math.atan2(t[6],t[5]))),rotateY:t=>vn(yt(Math.atan2(-t[2],t[0]))),rotateZ:ai,rotate:ai,skewX:t=>yt(Math.atan(t[4])),skewY:t=>yt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ci(t){return t.includes("scale")?1:0}function xn(t,e){if(!t||t==="none")return ci(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Xa,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ya,i=a}if(!i)return ci(e);const r=s[e],o=i[1].split(",").map(Za);return typeof r=="function"?r(o):o[r]}const qa=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return xn(n,e)};function Za(t){return parseFloat(t.trim())}const fi=t=>t===Vt||t===C,Ja=new Set(["x","y","z"]),Qa=Et.filter(t=>!Ja.has(t));function tl(t){const e=[];return Qa.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const Dt={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:(t,{transform:e})=>xn(e,"x"),y:(t,{transform:e})=>xn(e,"y")};Dt.translateX=Dt.x,Dt.translateY=Dt.y;const vt=new Set;let Tn=!1,bn=!1;function hi(){if(bn){const t=Array.from(vt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=tl(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))===null||a===void 0||a.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}bn=!1,Tn=!1,vt.forEach(t=>t.complete()),vt.clear()}function di(){vt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(bn=!0)})}function el(){di(),hi()}class wn{constructor(e,n,s,i,r,o=!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=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(vt.add(this),Tn||(Tn=!0,O.read(di),O.resolveKeyframes(hi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let r=0;r<e.length;r++)if(e[r]===null)if(r===0){const o=i==null?void 0:i.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&o===void 0&&i.set(e[0])}else e[r]=e[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),vt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,vt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const pi=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),nl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function sl(t){const e=nl.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}const il=4;function mi(t,e,n=1){lt(n<=il,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[s,i]=sl(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return pi(o)?parseFloat(o):o}return Je(i)?mi(i,e,n+1):i}const gi=t=>e=>e.test(t),yi=[Vt,C,nt,ct,ea,ta,{test:t=>t==="auto",parse:t=>t}],vi=t=>yi.find(gi(t));class xi extends wn{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),Je(u))){const c=mi(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!$s.has(s)||e.length!==2)return;const[i,r]=e,o=vi(i),a=vi(r);if(o!==a)if(fi(o)&&fi(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)Da(e[i])&&s.push(i);s.length&&Ha(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=Dt[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 r=n.getValue(s);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=Dt[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.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Ti=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ft.test(t)||t==="0")&&!t.startsWith("url("));function ol(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 rl(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=Ti(i,e),a=Ti(r,e);return St(o===a,`You are trying to animate ${e} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`),!o||!a?!1:ol(t)||(n==="spring"||Ue(n))&&s}const al=t=>t!==null;function be(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(al),r=e&&n!=="loop"&&e%2=