2 lines
31 KiB
JavaScript
2 lines
31 KiB
JavaScript
import{createContext as t}from"react";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function s(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const n=(t,e,s)=>s>e?e:s<t?t:s;function i(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let r=()=>{},a=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(r=(t,e,s)=>{t||"undefined"==typeof console||console.warn(i(e,s))},a=(t,e,s)=>{if(!t)throw new Error(i(e,s))});const o={},h=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),l=t=>/^0[^.\s]+$/u.test(t);function u(t){let e;return()=>(void 0===e&&(e=t()),e)}const c=t=>t;class d{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>s(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const p=t=>1e3*t,f=t=>t/1e3;function m(t,e){return e?t*(1e3/e):0}const g=t=>Array.isArray(t)&&"number"==typeof t[0],v=t({}),y=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function b(t,e){let s=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>s=!0,a=y.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(h.schedule(e),t()),e(a)}const h={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,n)return void(i=!0);n=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t))}};return h}(r),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:f,postRender:m}=a,g=()=>{const r=o.useManualTiming,a=r?i.timestamp:performance.now();s=!1,r||(i.delta=n?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,h.process(i),l.process(i),u.process(i),c.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,s&&e&&(n=!1,t(g))};return{schedule:y.reduce((e,r)=>{const o=a[r];return e[r]=(e,r=!1,a=!1)=>(s||(s=!0,n=!0,i.isProcessing||t(g)),o.schedule(e,r,a)),e},{}),cancel:t=>{for(let e=0;e<y.length;e++)a[y[e]].cancel(t)},state:i,steps:a}}const{schedule:w,cancel:V,state:S,steps:M}=b("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:c,!0);let T;function x(){T=void 0}const A={now:()=>(void 0===T&&A.set(S.isProcessing||o.useManualTiming?S.timestamp:performance.now()),T),set:t=>{T=t,queueMicrotask(x)}},C=t=>e=>"string"==typeof e&&e.startsWith(t),k=C("--"),F=C("var(--"),E=t=>!!F(t)&&P.test(t.split("/*")[0].trim()),P=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function B(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const R={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},I={...R,transform:t=>n(0,1,t)},N={...R,default:1},O=t=>Math.round(1e5*t)/1e5,$=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const L=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Y=(t,e)=>s=>Boolean("string"==typeof s&&L.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),W=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,r,a,o]=n.match($);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},X={...R,transform:t=>Math.round((t=>n(0,255,t))(t))},j={test:Y("rgb","red"),parse:W("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+X.transform(t)+", "+X.transform(e)+", "+X.transform(s)+", "+O(I.transform(n))+")"};const z={test:Y("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:j.transform},K=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),U=K("deg"),Z=K("%"),D=K("px"),q=K("vh"),H=K("vw"),_=(()=>({...Z,parse:t=>Z.parse(t)/100,transform:t=>Z.transform(100*t)}))(),G={test:Y("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+Z.transform(O(e))+", "+Z.transform(O(s))+", "+O(I.transform(n))+")"},J={test:t=>j.test(t)||z.test(t)||G.test(t),parse:t=>j.test(t)?j.parse(t):G.test(t)?G.parse(t):z.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?j.transform(t):G.transform(t),getAnimatableNone:t=>{const e=J.parse(t);return e.alpha=0,J.transform(e)}},Q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const tt="number",et="color",st=/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 nt(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(st,t=>(J.test(t)?(n.color.push(r),i.push(et),s.push(J.parse(t))):t.startsWith("var(")?(n.var.push(r),i.push("var"),s.push(t)):(n.number.push(r),i.push(tt),s.push(parseFloat(t))),++r,"${}")).split("${}");return{values:s,split:a,indexes:n,types:i}}function it({split:t,types:e}){const s=t.length;return n=>{let i="";for(let r=0;r<s;r++)if(i+=t[r],void 0!==n[r]){const t=e[r];i+=t===tt?O(n[r]):t===et?J.transform(n[r]):n[r]}return i}}const rt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:J.test(s)?J.getAnimatableNone(s):s;var s};const at={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match($)?.length||0)+(t.match(Q)?.length||0)>0},parse:function(t){return nt(t).values},createTransformer:function(t){return it(nt(t))},getAnimatableNone:function(t){const e=nt(t);return it(e)(e.values.map((t,s)=>rt(t,e.split[s])))}},ot=(t,e,s)=>t+(e-t)*s,ht=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;e<i;e++)n+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},lt=t=>null!==t;function ut(t,{repeat:e,repeatType:s="loop"},n,i=1){const r=t.filter(lt),a=i<0||e&&"loop"!==s&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class ct{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const dt=t=>180*t/Math.PI,pt=t=>{const e=dt(Math.atan2(t[1],t[0]));return mt(e)},ft={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:pt,rotateZ:pt,skewX:t=>dt(Math.atan(t[1])),skewY:t=>dt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},mt=t=>((t%=360)<0&&(t+=360),t),gt=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),vt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),yt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:gt,scaleY:vt,scale:t=>(gt(t)+vt(t))/2,rotateX:t=>mt(dt(Math.atan2(t[6],t[5]))),rotateY:t=>mt(dt(Math.atan2(-t[2],t[0]))),rotateZ:pt,rotate:pt,skewX:t=>dt(Math.atan(t[4])),skewY:t=>dt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function bt(t){return t.includes("scale")?1:0}function wt(t,e){if(!t||"none"===t)return bt(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=yt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=ft,i=e}if(!i)return bt(e);const r=n[e],a=i[1].split(",").map(St);return"function"==typeof r?r(a):a[r]}const Vt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return wt(s,e)};function St(t){return parseFloat(t.trim())}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Tt=(()=>new Set(Mt))(),xt=t=>t===R||t===D,At=new Set(["x","y","z"]),Ct=Mt.filter(t=>!At.has(t));const kt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},height:({y:t},{paddingTop:e="0",paddingBottom:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},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})=>wt(e,"x"),y:(t,{transform:e})=>wt(e,"y")};kt.translateX=kt.x,kt.translateY=kt.y;const Ft=new Set;let Et=!1,Pt=!1,Bt=!1;function Rt(){if(Pt){const t=Array.from(Ft).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return Ct.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Pt=!1,Et=!1,Ft.forEach(t=>t.complete(Bt)),Ft.clear()}function It(){Ft.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Pt=!0)})}function Nt(){Bt=!0,It(),Rt(),Bt=!1}class Ot{constructor(t,e,s,n,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Ft.add(this),Et||(Et=!0,w.read(It),w.resolveKeyframes(Rt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ft.delete(this)}cancel(){"scheduled"===this.state&&(Ft.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function $t(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const Lt={};function Yt(t,e){const s=u(t);return()=>Lt[e]??s()}const Wt=Yt(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Xt=Yt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),jt=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,zt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function Kt(t,e){return t?"function"==typeof t?Xt()?ht(t,e):"ease-out":g(t)?jt(t):Array.isArray(t)?t.map(t=>Kt(t,e)||zt.easeOut):zt[t]:void 0}function Ut(t,e,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Kt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(u,d)}function Zt(t){return"function"==typeof t&&"applyToOptions"in t}class Dt extends ct{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:n,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,a("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Zt(t)&&Xt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Ut(e,s,n,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=ut(n,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),$t(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=p(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Wt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),c):n(this)}}function qt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Ht(t,e,s,n){if("function"==typeof e){const[i,r]=qt(n);e=e(void 0!==s?s:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=qt(n);e=e(void 0!==s?s:t.custom,i,r)}return e}class _t{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=A.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=A.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new d);const s=this.events[t].add(e);return"change"===t?()=>{s(),w.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=A.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return m(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Gt(t,e){return new _t(t,e)}const Jt=t=>Boolean(t&&t.getVelocity);function Qt(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const te="data-"+Qt("framerAppearId"),ee=t=>e=>e.test(t),se=[R,D,Z,U,H,q,{test:t=>"auto"===t,parse:t=>t}],ne=t=>se.find(ee(t)),ie=new Set(["brightness","contrast","saturate","opacity"]);function re(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match($)||[];if(!n)return t;const i=s.replace(n,"");let r=ie.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const ae=/\b([a-z-]*)\(.*?\)/gu,oe={...at,getAnimatableNone:t=>{const e=t.match(ae);return e?e.map(re).join(" "):t}},he={...at,getAnimatableNone:t=>{const e=at.parse(t);return at.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},le={...R,transform:Math.round},ue={borderWidth:D,borderTopWidth:D,borderRightWidth:D,borderBottomWidth:D,borderLeftWidth:D,borderRadius:D,borderTopLeftRadius:D,borderTopRightRadius:D,borderBottomRightRadius:D,borderBottomLeftRadius:D,width:D,maxWidth:D,height:D,maxHeight:D,top:D,right:D,bottom:D,left:D,inset:D,insetBlock:D,insetBlockStart:D,insetBlockEnd:D,insetInline:D,insetInlineStart:D,insetInlineEnd:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,paddingBlock:D,paddingBlockStart:D,paddingBlockEnd:D,paddingInline:D,paddingInlineStart:D,paddingInlineEnd:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,marginBlock:D,marginBlockStart:D,marginBlockEnd:D,marginInline:D,marginInlineStart:D,marginInlineEnd:D,fontSize:D,backgroundPositionX:D,backgroundPositionY:D,...{rotate:U,rotateX:U,rotateY:U,rotateZ:U,scale:N,scaleX:N,scaleY:N,scaleZ:N,skew:U,skewX:U,skewY:U,distance:D,translateX:D,translateY:D,translateZ:D,x:D,y:D,z:D,perspective:D,transformPerspective:D,opacity:I,originX:_,originY:_,originZ:D},zIndex:le,fillOpacity:I,strokeOpacity:I,numOctaves:le},ce={...ue,color:J,backgroundColor:J,outlineColor:J,fill:J,stroke:J,borderColor:J,borderTopColor:J,borderRightColor:J,borderBottomColor:J,borderLeftColor:J,filter:oe,WebkitFilter:oe,mask:he,WebkitMask:he},de=t=>ce[t],pe=new Set([oe,he]);function fe(t,e){let s=de(t);return pe.has(s)||(s=at),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const me=new Set(["opacity","clipPath","filter","transform"]),ge=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:ve}=b(queueMicrotask,!1),ye=[...se,J,at],be=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),we=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ve=new WeakMap;function Se(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Me(t){return"string"==typeof t||Array.isArray(t)}const Te=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],xe=["initial",...Te];function Ae(t){return Se(t.animate)||xe.some(e=>Me(t[e]))}function Ce(t){return Boolean(Ae(t)||t.variants)}const ke={current:null},Fe={current:!1},Ee="undefined"!=typeof window;const Pe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Be={};function Re(t){Be=t}function Ie(){return Be}class Ne{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ot,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=A.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,w.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=a;this.latestValues=h,this.baseTarget={...h},this.initialValues=e.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=i,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=Ae(e),this.isVariantNode=Ce(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==h[t]&&Jt(e)&&e.set(h[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Ve.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Fe.current||function(){if(Fe.current=!0,Ee)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ke.current=t.matches;t.addEventListener("change",e),e()}else ke.current=!1}(),this.shouldReduceMotion=ke.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),V(this.notifyUpdate),V(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&me.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:r,duration:a}=e.accelerate,o=new Dt({element:this.current,name:t,keyframes:n,times:i,ease:r,duration:p(a)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=Tt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&w.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Be){const e=Be[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Pe.length;e++){const s=Pe[e];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const n=t["on"+s];n&&(this.propEventSubscriptions[s]=this.on(s,n))}this.prevMotionValues=function(t,e,s){for(const n in e){const i=e[n],r=s[n];if(Jt(i))t.addValue(n,i);else if(Jt(r))t.addValue(n,Gt(i,{owner:t}));else if(r!==i)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(n);t.addValue(n,Gt(void 0!==e?e:i,{owner:t}))}}for(const n in s)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=Gt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(h(s)||l(s))?s=parseFloat(s):(n=s,!ye.find(ee(n))&&at.test(e)&&(s=fe(t,e))),this.setBaseTarget(t,Jt(s)?s.get():s)),Jt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Ht(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Jt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new d),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ve.render(this.render)}}const Oe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$e=Mt.length;function Le(t,e,s){const{style:n,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const s=e[t];if(Tt.has(t))a=!0;else if(k(t))i[t]=s;else{const e=ge(s,ue[t]);t.startsWith("origin")?(o=!0,r[t]=e):n[t]=e}}if(e.transform||(a||s?n.transform=function(t,e,s){let n="",i=!0;for(let r=0;r<$e;r++){const a=Mt[r],o=t[a];if(void 0===o)continue;let h=!0;if("number"==typeof o)h=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);h=a.startsWith("scale")?1===t:0===t}if(!h||s){const t=ge(o,ue[a]);h||(i=!1,n+=`${Oe[a]||a}(${t}) `),s&&(e[a]=t)}}return n=n.trim(),s?n=s(e,i?"":n):i&&(n="none"),n}(e,t.transform,s):n.transform&&(n.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:s=0}=r;n.transformOrigin=`${t} ${e} ${s}`}}function Ye(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const We={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!D.test(t))return t;t=parseFloat(t)}return`${Ye(t,e.target.x)}% ${Ye(t,e.target.y)}%`}},Xe={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=at.parse(t);if(i.length>5)return n;const r=at.createTransformer(t),a="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+a]/=o,i[1+a]/=h;const l=ot(o,h,.5);return"number"==typeof i[2+a]&&(i[2+a]/=l),"number"==typeof i[3+a]&&(i[3+a]/=l),r(i)}},je={borderRadius:{...We,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:We,borderTopRightRadius:We,borderBottomLeftRadius:We,borderBottomRightRadius:We,boxShadow:Xe};function ze(t,{layout:e,layoutId:s}){return Tt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!je[t]||"opacity"===t)}function Ke(t,e,s){const n=t.style,i=e?.style,r={};if(!n)return r;for(const e in n)(Jt(n[e])||i&&Jt(i[e])||ze(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(r[e]=n[e]);return r}const Ue={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ze={offset:"strokeDashoffset",array:"strokeDasharray"};const De=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qe(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},h,l,u){if(Le(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of De)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const r=i?Ue:Ze;t[r.offset]=""+-n,t[r.array]=`${e} ${s}`}(c,i,r,a,!1)}const He=t=>"string"==typeof t&&"svg"===t.toLowerCase();function _e(t,e,s){const n=Ke(t,e,s);for(const s in t)if(Jt(t[s])||Jt(e[s])){n[-1!==Mt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}function Ge(t){return Jt(t)?t.get():t}const Je=["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 Qe(t){return"string"==typeof t&&!t.includes("-")&&!!(Je.indexOf(t)>-1||/[A-Z]/u.test(t))}const ts=t(null),es=t({});function ss(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}export{Mt as $,E as A,J as B,at as C,nt as D,S as E,A as F,V as G,w as H,f as I,n as J,ht as K,v as L,p as M,m as N,o as O,ts as P,ut as Q,Dt as R,es as S,$t as T,Zt as U,u as V,ct as W,Ot as X,Nt as Y,h as Z,Tt as _,Me as a,Gt as a0,l as a1,fe as a2,ne as a3,B as a4,kt as a5,xt as a6,Ne as a7,bt as a8,Vt as a9,k as aa,Qt as ab,we as ac,de as ad,xe as ae,Te as af,Z as ag,D as ah,e as ai,s as aj,d as ak,M as al,ve as am,be as an,je as ao,Jt as b,ze as c,Le as d,qe as e,He as f,Qe as g,Ce as h,Ae as i,Se as j,Ht as k,_e as l,Ie as m,Re as n,te as o,ss as p,c as q,Ge as r,Ke as s,g as t,a as u,ot as v,j as w,G as x,z as y,r as z};
|