Files

3 lines
16 KiB
JavaScript
Raw Permalink Normal View History

const e=(e,t,n)=>n>t?t:n<e?e:n;function t(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let n=()=>{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n=(e,n,r)=>{e||"undefined"==typeof console||console.warn(t(n,r))},r=(e,n,r)=>{if(!e)throw new Error(t(n,r))});const s={},o=e=>"object"==typeof e&&null!==e;const i=e=>e,a=(...e)=>e.reduce((e,t)=>n=>t(e(n))),c=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1},l=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function u(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=l.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,s=!1;const o=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function a(t){o.has(t)&&(c.schedule(t),e()),t(i)}const c={schedule:(e,s=!1,i=!1)=>{const a=i&&r?t:n;return s&&o.add(e),a.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(i=e,r)return void(s=!0);r=!0;const o=t;t=n,n=o,t.forEach(a),t.clear(),r=!1,s&&(s=!1,c.process(e))}};return c}(i),e),{}),{setup:c,read:u,resolveKeyframes:f,preUpdate:d,update:g,preRender:h,render:p,postRender:m}=a,v=()=>{const i=s.useManualTiming,a=i?o.timestamp:performance.now();n=!1,i||(o.delta=r?1e3/60:Math.max(Math.min(a-o.timestamp,40),1)),o.timestamp=a,o.isProcessing=!0,c.process(o),u.process(o),f.process(o),d.process(o),g.process(o),h.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(v))};return{schedule:l.reduce((t,s)=>{const i=a[s];return t[s]=(t,s=!1,a=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(v)),i.schedule(t,s,a)),t},{}),cancel:e=>{for(let t=0;t<l.length;t++)a[l[t]].cancel(e)},state:o,steps:a}}const{schedule:f,cancel:d,state:g}=u("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:i,!0),h=(e=>t=>"string"==typeof t&&t.startsWith(e))("var(--"),p=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,m={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},v={...m,transform:t=>e(0,1,t)},y=e=>Math.round(1e5*e)/1e5,w=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const b=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,x=(e,t)=>n=>Boolean("string"==typeof n&&b.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),E=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[s,o,i,a]=r.match(w);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:void 0!==a?parseFloat(a):1}},W={...m,transform:t=>Math.round((t=>e(0,255,t))(t))},L={test:x("rgb","red"),parse:E("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+W.transform(e)+", "+W.transform(t)+", "+W.transform(n)+", "+y(v.transform(r))+")"};const A={test:x("#"),parse:function(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:L.transform},S=(e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}))("%"),M={test:x("hsl","hue"),parse:E("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+S.transform(y(t))+", "+S.transform(y(n))+", "+y(v.transform(r))+")"},B={test:e=>L.test(e)||A.test(e)||M.test(e),parse:e=>L.test(e)?L.parse(e):M.test(e)?M.parse(e):A.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?L.transform(e):M.transform(e),getAnimatableNone:e=>{const t=B.parse(e);return t.alpha=0,B.transform(t)}},T=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $="number",O="color",H=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/
//# sourceMappingURL=size-rollup-scroll.js.map