Module 54482

2,803 characters · in 514.d733764d42c2ab66.js
Dependencies
Required by (2)
Lazily required by (0)none
Requires (3)
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.r(t),n.d(t,{createStringInterpolator:()=>A});var r,i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},a=n(85402),o=n(929849),s="[-+]?\\d*\\.?\\d+",l=s+"%";function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var c=RegExp("rgb"+u(s,s,s)),d=RegExp("rgba"+u(s,s,s,s)),f=RegExp("hsl"+u(s,l,l)),p=RegExp("hsla"+u(s,l,l,s)),h=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,m=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,g=/^#([0-9a-fA-F]{6})$/,v=/^#([0-9a-fA-F]{8})$/,y=n(672722);function b(e,t,n){var r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,o=e<60?[r,i,0]:e<120?[i,r,0]:e<180?[0,r,i]:e<240?[0,i,r]:e<300?[i,0,r]:[r,0,i];return Math.round((o[0]+a)*255)<<24|Math.round((o[1]+a)*255)<<16|Math.round((o[2]+a)*255)<<8}function _(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function w(e){return(parseFloat(e)%360+360)%360/360}function x(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function E(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function S(e){var t,n="number"==typeof e?e>>>0===e&&e>=0&&e<=0xffffffff?e:null:(t=g.exec(e))?parseInt(t[1]+"ff",16)>>>0:y.colorNames&&void 0!==y.colorNames[e]?y.colorNames[e]:(t=c.exec(e))?(_(t[1])<<24|_(t[2])<<16|_(t[3])<<8|255)>>>0:(t=d.exec(e))?(_(t[1])<<24|_(t[2])<<16|_(t[3])<<8|x(t[4]))>>>0:(t=h.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=v.exec(e))?parseInt(t[1],16)>>>0:(t=m.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=f.exec(e))?(255|b(w(t[1]),E(t[2]),E(t[3])))>>>0:(t=p.exec(e))?(b(w(t[1]),E(t[2]),E(t[3]))|x(t[4]))>>>0:null;return null===n?e:"rgba("+((0xff000000&(n=n||0))>>>24)+", "+((0xff0000&n)>>>16)+", "+((65280&n)>>>8)+", "+(255&n)/255+")"}var k=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,T=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,C=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,P=function(e,t,n,r,i){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+i+")"},A=function(e){r||(r=y.colorNames?RegExp("("+Object.keys(y.colorNames).join("|")+")","g"):/^\b$/);var t=e.output.map(function(e){return(0,a.oq)(e).replace(T,S).replace(r,S)}),n=t.map(function(e){return e.match(k).map(Number)}),s=n[0].map(function(e,t){return n.map(function(e){if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})}).map(function(t){return(0,o.k)(i(i({},e),{output:t}))});return function(e){var n=0;return t[0].replace(k,function(){return String(s[n++](e))}).replace(C,P)}}}