2 lines
30 KiB
JavaScript
2 lines
30 KiB
JavaScript
const t=(t,e,s)=>s>e?e:s<t?t:s;function e(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let s=()=>{},n=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,s,n)=>{t||"undefined"==typeof console||console.warn(e(s,n))},n=(t,s,n)=>{if(!t)throw new Error(e(s,n))});const i={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>/^0[^.\s]+$/u.test(t);function o(t){let e;return()=>(void 0===e&&(e=t()),e)}const h=t=>t;class l{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(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 u=t=>1e3*t,c=t=>t/1e3;function d(t,e){return e?t*(1e3/e):0}const p=t=>Array.isArray(t)&&"number"==typeof t[0],f=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function m(t,e){let s=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=f.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}(a),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:m,postRender:g}=o,v=()=>{const a=i.useManualTiming,o=a?r.timestamp:performance.now();s=!1,a||(r.delta=n?1e3/60:Math.max(Math.min(o-r.timestamp,40),1)),r.timestamp=o,r.isProcessing=!0,h.process(r),l.process(r),u.process(r),c.process(r),d.process(r),p.process(r),m.process(r),g.process(r),r.isProcessing=!1,s&&e&&(n=!1,t(v))};return{schedule:f.reduce((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(s||(s=!0,n=!0,r.isProcessing||t(v)),a.schedule(e,i,o)),e},{}),cancel:t=>{for(let e=0;e<f.length;e++)o[f[e]].cancel(t)},state:r,steps:o}}const{schedule:g,cancel:v,state:y}=m("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:h,!0);let b;function w(){b=void 0}const V={now:()=>(void 0===b&&V.set(y.isProcessing||i.useManualTiming?y.timestamp:performance.now()),b),set:t=>{b=t,queueMicrotask(w)}},S=t=>e=>"string"==typeof e&&e.startsWith(t),M=S("--"),T=S("var(--"),A=t=>!!T(t)&&x.test(t.split("/*")[0].trim()),x=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function C(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const k={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},F={...k,transform:e=>t(0,1,e)},E={...k,default:1},B=t=>Math.round(1e5*t)/1e5,P=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const R=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,I=(t,e)=>s=>Boolean("string"==typeof s&&R.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),N=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,r,a,o]=n.match(P);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},O={...k,transform:e=>Math.round((e=>t(0,255,e))(e))},$={test:I("rgb","red"),parse:N("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+O.transform(t)+", "+O.transform(e)+", "+O.transform(s)+", "+B(F.transform(n))+")"};const L={test:I("#"),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:$.transform},Y=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),W=Y("deg"),X=Y("%"),j=Y("px"),z=Y("vh"),K=Y("vw"),U=(()=>({...X,parse:t=>X.parse(t)/100,transform:t=>X.transform(100*t)}))(),Z={test:I("hsl","hue"),parse:N("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+X.transform(B(e))+", "+X.transform(B(s))+", "+B(F.transform(n))+")"},D={test:t=>$.test(t)||L.test(t)||Z.test(t),parse:t=>$.test(t)?$.parse(t):Z.test(t)?Z.parse(t):L.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?$.transform(t):Z.transform(t),getAnimatableNone:t=>{const e=D.parse(t);return e.alpha=0,D.transform(e)}},q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const H="number",_="color",G=/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 J(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(G,t=>(D.test(t)?(n.color.push(r),i.push(_),s.push(D.parse(t))):t.startsWith("var(")?(n.var.push(r),i.push("var"),s.push(t)):(n.number.push(r),i.push(H),s.push(parseFloat(t))),++r,"${}")).split("${}");return{values:s,split:a,indexes:n,types:i}}function Q({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===H?B(n[r]):t===_?D.transform(n[r]):n[r]}return i}}const tt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:D.test(s)?D.getAnimatableNone(s):s;var s};const et={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(P)?.length||0)+(t.match(q)?.length||0)>0},parse:function(t){return J(t).values},createTransformer:function(t){return Q(J(t))},getAnimatableNone:function(t){const e=J(t);return Q(e)(e.values.map((t,s)=>tt(t,e.split[s])))}},st=(t,e,s)=>t+(e-t)*s,nt=(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)})`},it=t=>null!==t;function rt(t,{repeat:e,repeatType:s="loop"},n,i=1){const r=t.filter(it),a=i<0||e&&"loop"!==s&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class at{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 ot=t=>180*t/Math.PI,ht=t=>{const e=ot(Math.atan2(t[1],t[0]));return ut(e)},lt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ht,rotateZ:ht,skewX:t=>ot(Math.atan(t[1])),skewY:t=>ot(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ut=t=>((t%=360)<0&&(t+=360),t),ct=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),dt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),pt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ct,scaleY:dt,scale:t=>(ct(t)+dt(t))/2,rotateX:t=>ut(ot(Math.atan2(t[6],t[5]))),rotateY:t=>ut(ot(Math.atan2(-t[2],t[0]))),rotateZ:ht,rotate:ht,skewX:t=>ot(Math.atan(t[4])),skewY:t=>ot(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ft(t){return t.includes("scale")?1:0}function mt(t,e){if(!t||"none"===t)return ft(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=pt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=lt,i=e}if(!i)return ft(e);const r=n[e],a=i[1].split(",").map(vt);return"function"==typeof r?r(a):a[r]}const gt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return mt(s,e)};function vt(t){return parseFloat(t.trim())}const yt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bt=(()=>new Set(yt))(),wt=t=>t===k||t===j,Vt=new Set(["x","y","z"]),St=yt.filter(t=>!Vt.has(t));const Mt={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})=>mt(e,"x"),y:(t,{transform:e})=>mt(e,"y")};Mt.translateX=Mt.x,Mt.translateY=Mt.y;const Tt=new Set;let At=!1,xt=!1,Ct=!1;function kt(){if(xt){const t=Array.from(Tt).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 St.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)})}xt=!1,At=!1,Tt.forEach(t=>t.complete(Ct)),Tt.clear()}function Ft(){Tt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xt=!0)})}function Et(){Ct=!0,Ft(),kt(),Ct=!1}class Bt{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?(Tt.add(this),At||(At=!0,g.read(Ft),g.resolveKeyframes(kt))):(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),Tt.delete(this)}cancel(){"scheduled"===this.state&&(Tt.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function Pt(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const Rt={};function It(t,e){const s=o(t);return()=>Rt[e]??s()}const Nt=It(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ot=It(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),$t=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Lt={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 Yt(t,e){return t?"function"==typeof t?Ot()?nt(t,e):"ease-out":p(t)?$t(t):Array.isArray(t)?t.map(t=>Yt(t,e)||Lt.easeOut):Lt[t]:void 0}function Wt(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=Yt(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 Xt(t){return"function"==typeof t&&"applyToOptions"in t}class jt extends at{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Xt(t)&&Ot()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Wt(e,s,i,l,r),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=rt(i,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Pt(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 c(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+c(t)}get time(){return c(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=u(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&&Nt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),h):n(this)}}function zt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Kt(t,e,s,n){if("function"==typeof e){const[i,r]=zt(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]=zt(n);e=e(void 0!==s?s:t.custom,i,r)}return e}class Ut{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=V.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=V.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 l);const s=this.events[t].add(e);return"change"===t?()=>{s(),g.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=V.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return d(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 Zt(t,e){return new Ut(t,e)}const Dt=t=>Boolean(t&&t.getVelocity);function qt(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Ht="data-"+qt("framerAppearId"),_t=t=>e=>e.test(t),Gt=[k,j,X,W,K,z,{test:t=>"auto"===t,parse:t=>t}],Jt=t=>Gt.find(_t(t)),Qt=new Set(["brightness","contrast","saturate","opacity"]);function te(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match(P)||[];if(!n)return t;const i=s.replace(n,"");let r=Qt.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const ee=/\b([a-z-]*)\(.*?\)/gu,se={...et,getAnimatableNone:t=>{const e=t.match(ee);return e?e.map(te).join(" "):t}},ne={...et,getAnimatableNone:t=>{const e=et.parse(t);return et.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ie={...k,transform:Math.round},re={borderWidth:j,borderTopWidth:j,borderRightWidth:j,borderBottomWidth:j,borderLeftWidth:j,borderRadius:j,borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,width:j,maxWidth:j,height:j,maxHeight:j,top:j,right:j,bottom:j,left:j,inset:j,insetBlock:j,insetBlockStart:j,insetBlockEnd:j,insetInline:j,insetInlineStart:j,insetInlineEnd:j,padding:j,paddingTop:j,paddingRight:j,paddingBottom:j,paddingLeft:j,paddingBlock:j,paddingBlockStart:j,paddingBlockEnd:j,paddingInline:j,paddingInlineStart:j,paddingInlineEnd:j,margin:j,marginTop:j,marginRight:j,marginBottom:j,marginLeft:j,marginBlock:j,marginBlockStart:j,marginBlockEnd:j,marginInline:j,marginInlineStart:j,marginInlineEnd:j,fontSize:j,backgroundPositionX:j,backgroundPositionY:j,...{rotate:W,rotateX:W,rotateY:W,rotateZ:W,scale:E,scaleX:E,scaleY:E,scaleZ:E,skew:W,skewX:W,skewY:W,distance:j,translateX:j,translateY:j,translateZ:j,x:j,y:j,z:j,perspective:j,transformPerspective:j,opacity:F,originX:U,originY:U,originZ:j},zIndex:ie,fillOpacity:F,strokeOpacity:F,numOctaves:ie},ae={...re,color:D,backgroundColor:D,outlineColor:D,fill:D,stroke:D,borderColor:D,borderTopColor:D,borderRightColor:D,borderBottomColor:D,borderLeftColor:D,filter:se,WebkitFilter:se,mask:ne,WebkitMask:ne},oe=t=>ae[t],he=new Set([se,ne]);function le(t,e){let s=oe(t);return he.has(s)||(s=et),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const ue=new Set(["opacity","clipPath","filter","transform"]),ce=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:de}=m(queueMicrotask,!1),pe=[...Gt,D,et],fe=()=>({x:{min:0,max:0},y:{min:0,max:0}}),me=new WeakMap;function ge(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ve(t){return"string"==typeof t||Array.isArray(t)}const ye=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],be=["initial",...ye];function we(t){return ge(t.animate)||be.some(e=>ve(t[e]))}function Ve(t){return Boolean(we(t)||t.variants)}const Se={current:null},Me={current:!1},Te="undefined"!=typeof window;const Ae=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let xe={};function Ce(t){xe=t}function ke(){return xe}class Fe{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=Bt,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=V.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,g.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=we(e),this.isVariantNode=Ve(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]&&Dt(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,me.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:(Me.current||function(){if(Me.current=!0,Te)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Se.current=t.matches;t.addEventListener("change",e),e()}else Se.current=!1}(),this.shouldReduceMotion=Se.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&&ue.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:r,duration:a}=e.accelerate,o=new jt({element:this.current,name:t,keyframes:n,times:i,ease:r,duration:u(a)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=bt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&g.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 xe){const e=xe[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<Ae.length;e++){const s=Ae[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(Dt(i))t.addValue(n,i);else if(Dt(r))t.addValue(n,Zt(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,Zt(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=Zt(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&&(r(s)||a(s))?s=parseFloat(s):(n=s,!pe.find(_t(n))&&et.test(e)&&(s=le(t,e))),this.setBaseTarget(t,Dt(s)?s.get():s)),Dt(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=Kt(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||Dt(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 l),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){de.render(this.render)}}const Ee={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Be=yt.length;function Pe(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(bt.has(t))a=!0;else if(M(t))i[t]=s;else{const e=ce(s,re[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<Be;r++){const a=yt[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=ce(o,re[a]);h||(i=!1,n+=`${Ee[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 Re(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ie={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!j.test(t))return t;t=parseFloat(t)}return`${Re(t,e.target.x)}% ${Re(t,e.target.y)}%`}},Ne={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=et.parse(t);if(i.length>5)return n;const r=et.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=st(o,h,.5);return"number"==typeof i[2+a]&&(i[2+a]/=l),"number"==typeof i[3+a]&&(i[3+a]/=l),r(i)}},Oe={borderRadius:{...Ie,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie,boxShadow:Ne};function $e(t,{layout:e,layoutId:s}){return bt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!Oe[t]||"opacity"===t)}function Le(t,e,s){const n=t.style,i=e?.style,r={};if(!n)return r;for(const e in n)(Dt(n[e])||i&&Dt(i[e])||$e(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(r[e]=n[e]);return r}const Ye={offset:"stroke-dashoffset",array:"stroke-dasharray"},We={offset:"strokeDashoffset",array:"strokeDasharray"};const Xe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function je(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},h,l,u){if(Pe(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 Xe)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?Ye:We;t[r.offset]=""+-n,t[r.array]=`${e} ${s}`}(c,i,r,a,!1)}const ze=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ke(t,e,s){const n=Le(t,e,s);for(const s in t)if(Dt(t[s])||Dt(e[s])){n[-1!==yt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}const Ue=["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 Ze(t){return"string"==typeof t&&!t.includes("-")&&!!(Ue.indexOf(t)>-1||/[A-Z]/u.test(t))}export{C as $,et as A,J as B,y as C,V as D,v as E,g as F,c as G,t as H,nt as I,u as J,d as K,rt as L,i as M,jt as N,Pt as O,Xt as P,o as Q,Bt as R,Et as S,r as T,bt as U,yt as V,at as W,Zt as X,a as Y,le as Z,Jt as _,we as a,Mt as a0,wt as a1,Fe as a2,ft as a3,gt as a4,M as a5,qt as a6,fe as a7,oe as a8,be as a9,ye as aa,ve as b,$e as c,Pe as d,je as e,ze as f,Ze as g,Ve as h,Dt as i,ge as j,Ke as k,ke as l,Ce as m,h as n,Ht as o,p,n as q,Kt as r,Le as s,st as t,$ as u,Z as v,L as w,s as x,A as y,D as z};
|