Files

3 lines
121 KiB
JavaScript
Raw Permalink Normal View History

import{jsxs as t,jsx as e}from"react/jsx-runtime";import{createContext as n,useContext as i,useMemo as s,Fragment as o,createElement as r,useRef as a,useInsertionEffect as l,useCallback as h,useLayoutEffect as u,useEffect as c,forwardRef as d,useId as p,Component as m}from"react";function f(t,e){-1===t.indexOf(e)&&t.push(e)}function y(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const g=(t,e,n)=>n>e?e:n<t?t:n;function v(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let x=()=>{},w=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(x=(t,e,n)=>{t||"undefined"==typeof console||console.warn(v(e,n))},w=(t,e,n)=>{if(!t)throw new Error(v(e,n))});const T={},S=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),P=t=>"object"==typeof t&&null!==t,b=t=>/^0[^.\s]+$/u.test(t);function E(t){let e;return()=>(void 0===e&&(e=t()),e)}const A=t=>t,M=(...t)=>t.reduce((t,e)=>n=>e(t(n))),V=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class C{constructor(){this.subscriptions=[]}add(t){return f(this.subscriptions,t),()=>y(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const k=t=>1e3*t,D=t=>t/1e3,R=(t,e)=>e?t*(1e3/e):0,L=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function B(t,e,n,i){if(t===e&&n===i)return A;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=L(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:L(s(t),e,i)}const j=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,F=t=>e=>1-t(1-e),I=B(.33,1.53,.69,.99),O=F(I),U=j(O),W=t=>t>=1?1:(t*=2)<1?.5*O(t):.5*(2-Math.pow(2,-10*(t-1))),N=t=>1-Math.sin(Math.acos(t)),$=F(N),z=j(N),Y=B(.42,0,1,1),X=B(0,0,.58,1),H=B(.42,0,.58,1),K=t=>Array.isArray(t)&&"number"==typeof t[0],G={linear:A,easeIn:Y,easeInOut:H,easeOut:X,circIn:N,circInOut:z,circOut:$,backIn:O,backInOut:U,backOut:I,anticipate:W},q=t=>{if(K(t)){w(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,s]=t;return B(e,n,i,s)}return"string"==typeof t?(w(void 0!==G[t],`Invalid easing type '${t}'`,"invalid-easing-type"),G[t]):t},Z=n({}),_=n({strict:!1}),J=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Q=n({}),tt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function et(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=tt.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(o),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:u,update:c,preRender:d,render:p,postRender:m}=r,f=()=>{const o=T.useManualTiming,r=o?s.timestamp:performance.now();n=!1,o||(s.delta=i?1e3/60:Math.max(Math.min(r-s.timestamp,40),1)),s.timestamp=r,s.isProcessing=!0,a.process(s),l.process(s),h.process(s),u.process(s),c.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:tt.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<tt.length;e++)r[tt[e]].cancel(t)},state:s,steps:r}}const{schedule:nt,cancel:it,state:st,steps:ot}=et("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:A,!0);let rt;function at(){rt=void 0}const lt={now:()=>(void 0===rt&&lt.set(st.isProcessing||T.useManualTiming?st.timestamp:performance.now()),rt),set:t=>{rt=t,queueMicrotask(at)}},ht=t=>e=>"string"==typeof e&&e.startsWith(t),ut=ht("--"),ct=ht("var(--"),dt=t=>!!ct(t)&&pt.test(t.split("/*")[0].trim()),pt=/var\(--(?:[\w-]
//# sourceMappingURL=size-rollup-motion.js.map