@fractal-components/random-gif
Advanced tools
Comparing version 1.0.7 to 1.1.0
@@ -1,1 +0,2 @@ | ||
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("redux-saga/effects"),require("react"),require("prop-types"),require("fractal-component"),require("jss"),require("jss-preset-default")):"function"==typeof define&&define.amd?define(["exports","redux-saga/effects","react","prop-types","fractal-component","jss","jss-preset-default"],t):t(r.RandomGif={},r.ReduxSaga.effects,r.React,r.PropTypes,r.FractalComponent,r.jss,r.jssPreset)}(this,function(r,a,n,t,o,i,l){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n,t=t&&t.hasOwnProperty("default")?t.default:t,i=i&&i.hasOwnProperty("default")?i.default:i,l=l&&l.hasOwnProperty("default")?l.default:l;var u=function(r,t){r.prototype=Object.create(t.prototype),(r.prototype.constructor=r).__proto__=t};var s=function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r},e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(r,t){return r(t={exports:{}},t.exports),t.exports}var h=c(function(r){function t(){return r.exports=t=Object.assign||function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},t.apply(this,arguments)}r.exports=t}),f=Symbol("REQUEST_NEW_GIF"),p=Symbol("RECEIVE_NEW_GIF"),d=Symbol("REQUEST_NEW_GIF_ERROR"),g=Symbol("NEW_GIF"),v=Symbol("LOADING_START"),y=Symbol("LOADING_COMPLETE"),b=Object.freeze({REQUEST_NEW_GIF:f,RECEIVE_NEW_GIF:p,REQUEST_NEW_GIF_ERROR:d,NEW_GIF:g,LOADING_START:v,LOADING_COMPLETE:y}),m=function(r,t){switch(t.type){case f:return h({},r,{isLoading:!0,error:null});case p:return h({},r,{isLoading:!1,error:null,imageUrl:t.payload});case d:return h({},r,{isLoading:!1,error:t.payload});default:return r}},w=c(function(S){!function(r){var u,t=Object.prototype,s=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},a=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag",i=r.regeneratorRuntime;if(i)S.exports=i;else{(i=r.regeneratorRuntime=S.exports).wrap=b;var c="suspendedStart",h="suspendedYield",f="executing",p="completed",d={},l={};l[a]=function(){return this};var g=Object.getPrototypeOf,v=g&&g(g(A([])));v&&v!==t&&s.call(v,a)&&(l=v);var y=k.prototype=w.prototype=Object.create(l);_.prototype=y.constructor=k,k.constructor=_,k[o]=_.displayName="GeneratorFunction",i.isGeneratorFunction=function(r){var t="function"==typeof r&&r.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,k):(r.__proto__=k,o in r||(r[o]="GeneratorFunction")),r.prototype=Object.create(y),r},i.awrap=function(r){return{__await:r}},x(M.prototype),M.prototype[n]=function(){return this},i.AsyncIterator=M,i.async=function(r,t,e,n){var a=new M(b(r,t,e,n));return i.isGeneratorFunction(t)?a:a.next().then(function(r){return r.done?r.value:a.next()})},x(y),y[o]="Generator",y[a]=function(){return this},y.toString=function(){return"[object Generator]"},i.keys=function(e){var n=[];for(var r in e)n.push(r);return n.reverse(),function r(){for(;n.length;){var t=n.pop();if(t in e)return r.value=t,r.done=!1,r}return r.done=!0,r}},i.values=A,L.prototype={constructor:L,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(j),!r)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=u)},stop:function(){this.done=!0;var r=this.tryEntries[0].completion;if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,t){return o.type="throw",o.arg=e,n.next=r,t&&(n.method="next",n.arg=u),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var a=this.tryEntries[t],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var i=s.call(a,"catchLoc"),l=s.call(a,"finallyLoc");if(i&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(i){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(r,t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}!a||"break"!==r&&"continue"!==r||t<a.tryLoc||a.finallyLoc<t||(a=null);var o=a?a.completion:{};return o.type=r,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(o)},complete:function(r,t){if("throw"===r.type)throw r.arg;return"break"===r.type||"continue"===r.type?this.next=r.arg:"return"===r.type?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):"normal"===r.type&&t&&(this.next=t),d},finish:function(r){for(var t=this.tryEntries.length-1;0<=t;--t){var e=this.tryEntries[t];if(e.finallyLoc===r)return this.complete(e.completion,e.afterLoc),j(e),d}},catch:function(r){for(var t=this.tryEntries.length-1;0<=t;--t){var e=this.tryEntries[t];if(e.tryLoc===r){var n=e.completion;if("throw"===n.type){var a=n.arg;j(e)}return a}}throw Error("illegal catch attempt")},delegateYield:function(r,t,e){return this.delegate={iterator:A(r),resultName:t,nextLoc:e},"next"===this.method&&(this.arg=u),d}}}function b(r,t,e,n){var o,i,l,u,a=Object.create((t&&t.prototype instanceof w?t:w).prototype),s=new L(n||[]);return a._invoke=(o=r,i=e,l=s,u=c,function(r,t){if(u===f)throw Error("Generator is already running");if(u===p){if("throw"===r)throw t;return N()}for(l.method=r,l.arg=t;;){var e=l.delegate;if(e){var n=O(e,l);if(n){if(n===d)continue;return n}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if(u===c)throw u=p,l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);u=f;var a=m(o,i,l);if("normal"===a.type){if(u=l.done?p:h,a.arg===d)continue;return{value:a.arg,done:l.done}}"throw"===a.type&&(u=p,l.method="throw",l.arg=a.arg)}}),a}function m(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(r){return{type:"throw",arg:r}}}function w(){}function _(){}function k(){}function x(r){["next","throw","return"].forEach(function(t){r[t]=function(r){return this._invoke(t,r)}})}function M(u){var t;this._invoke=function(e,n){function r(){return new Promise(function(r,t){!function t(r,e,n,a){var o=m(u[r],u,e);if("throw"!==o.type){var i=o.arg,l=i.value;return l&&"object"==typeof l&&s.call(l,"__await")?Promise.resolve(l.__await).then(function(r){t("next",r,n,a)},function(r){t("throw",r,n,a)}):Promise.resolve(l).then(function(r){i.value=r,n(i)},function(r){return t("throw",r,n,a)})}a(o.arg)}(e,n,r,t)})}return t=t?t.then(r,r):r()}}function O(r,t){var e=r.iterator[t.method];if(e===u){if(t.delegate=null,"throw"===t.method){if(r.iterator.return&&(t.method="return",t.arg=u,O(r,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var n=m(e,r.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var a=n.arg;return a?a.done?(t[r.resultName]=a.value,t.next=r.nextLoc,"return"!==t.method&&(t.method="next",t.arg=u),t.delegate=null,d):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function j(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function L(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(E,this),this.reset(!0)}function A(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,n=function r(){for(;++e<t.length;)if(s.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=u,r.done=!0,r};return n.next=n}}return{next:N}}function N(){return{value:u,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())}),_=function(){return this||"object"==typeof self&&self}()||Function("return this")(),k=_.regeneratorRuntime&&0<=Object.getOwnPropertyNames(_).indexOf("regeneratorRuntime"),x=k&&_.regeneratorRuntime;_.regeneratorRuntime=void 0;var M=w;if(k)_.regeneratorRuntime=x;else try{delete _.regeneratorRuntime}catch(r){_.regeneratorRuntime=void 0}var O=M;function E(){return{type:f}}function j(r){return void 0===r&&(r=null),{type:y,payload:{isSuccess:!r,error:r}}}function L(r){return fetch("https://api.giphy.com/v1/gifs/random?api_key="+r).then(function(r){return r.json()}).catch(function(r){throw Error("Giphy API key is invalid or exceeded its daily / hourly limit.")})}var A=O.mark(function r(e,n){return O.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.takeLeading(f,O.mark(function r(){var t;return O.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,e.put({type:v},"../../../*");case 3:return r.next=5,a.call(L,n);case 5:return t=r.sent.data.fixed_width_small_url,r.next=9,e.put({type:p,payload:t});case 9:return r.next=11,e.put({type:g},"../../../*");case 11:return r.next=13,e.put(j(),"../../../*");case 13:r.next=21;break;case 15:return r.prev=15,r.t0=r.catch(0),r.next=19,e.put({type:d,payload:r.t0});case 19:return r.next=21,e.put(j(r.t0),"../../../*");case 21:case"end":return r.stop()}},r,this,[[0,15]])}));case 2:case"end":return r.stop()}},r,this)});var N=function(r){return r};var S=function(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)},P=Math.max;var F=function(o,i,l){return i=P(void 0===i?o.length-1:i,0),function(){for(var r=arguments,t=-1,e=P(r.length-i,0),n=Array(e);++t<e;)n[t]=r[i+t];t=-1;for(var a=Array(i+1);++t<i;)a[t]=r[t];return a[i]=l(n),S(o,this,a)}};var I=function(r){return function(){return r}},R="object"==typeof self&&self&&self.Object===Object&&self,G="object"==typeof e&&e&&e.Object===Object&&e||R||Function("return this")(),q=G.Symbol,T=Object.prototype,C=T.hasOwnProperty,U=T.toString,z=q?q.toStringTag:void 0;var $=function(r){var t=C.call(r,z),e=r[z];try{r[z]=void 0}catch(r){}var n=U.call(r);return t?r[z]=e:delete r[z],n},D=Object.prototype.toString;var W=function(r){return D.call(r)},B=q?q.toStringTag:void 0;var Q=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":B&&B in Object(r)?$(r):W(r)};var J=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)};var K,V=function(r){if(!J(r))return!1;var t=Q(r);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Y=G["__core-js_shared__"],H=(K=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"";var X=function(r){return!!H&&H in r},Z=Function.prototype.toString;var rr=function(r){if(null!=r){try{return Z.call(r)}catch(r){}try{return r+""}catch(r){}}return""},tr=/^\[object .+?Constructor\]$/,er=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var nr=function(r){return!(!J(r)||X(r))&&(V(r)?er:tr).test(rr(r))};var ar=function(r,t){return null==r?void 0:r[t]};var or=function(r,t){var e=ar(r,t);return nr(e)?e:void 0},ir=function(){try{var r=or(Object,"defineProperty");return r({},"",{}),r}catch(r){}}(),lr=Date.now;var ur=function(e){var n=0,a=0;return function(){var r=lr(),t=16-(r-a);if(a=r,0<t){if(800<=++n)return arguments[0]}else n=0;return e.apply(void 0,arguments)}},sr=ur(ir?function(r,t){return ir(r,"toString",{configurable:!0,enumerable:!1,value:I(t),writable:!0})}:N);var cr=function(r,t){return sr(F(r,t,N),r+"")},hr=or(G,"WeakMap"),fr=hr&&new hr,pr=fr?function(r,t){return fr.set(r,t),r}:N,dr=Object.create,gr=function(){function e(){}return function(r){if(!J(r))return{};if(dr)return dr(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();var vr=function(n){return function(){var r=arguments;switch(r.length){case 0:return new n;case 1:return new n(r[0]);case 2:return new n(r[0],r[1]);case 3:return new n(r[0],r[1],r[2]);case 4:return new n(r[0],r[1],r[2],r[3]);case 5:return new n(r[0],r[1],r[2],r[3],r[4]);case 6:return new n(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new n(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var t=gr(n.prototype),e=n.apply(t,r);return J(e)?e:t}};var yr=function(t,r,e){var n=1&r,a=vr(t);return function r(){return(this&&this!==G&&this instanceof r?a:t).apply(n?e:this,arguments)}},br=Math.max;var mr=function(r,t,e,n){for(var a=-1,o=r.length,i=e.length,l=-1,u=t.length,s=br(o-i,0),c=Array(u+s),h=!n;++l<u;)c[l]=t[l];for(;++a<i;)(h||a<o)&&(c[e[a]]=r[a]);for(;s--;)c[l++]=r[a++];return c},wr=Math.max;var _r=function(r,t,e,n){for(var a=-1,o=r.length,i=-1,l=e.length,u=-1,s=t.length,c=wr(o-l,0),h=Array(c+s),f=!n;++a<c;)h[a]=r[a];for(var p=a;++u<s;)h[p+u]=t[u];for(;++i<l;)(f||a<o)&&(h[p+e[i]]=r[a++]);return h};var kr=function(r,t){for(var e=r.length,n=0;e--;)r[e]===t&&++n;return n};var xr=function(){};function Mr(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}var Or=(Mr.prototype=gr(xr.prototype)).constructor=Mr;var Er=fr?function(r){return fr.get(r)}:function(){},jr={},Lr=Object.prototype.hasOwnProperty;var Ar=function(r){for(var t=r.name+"",e=jr[t],n=Lr.call(jr,t)?e.length:0;n--;){var a=e[n],o=a.func;if(null==o||o==r)return a.name}return t};function Nr(r,t){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}var Sr=(Nr.prototype=gr(xr.prototype)).constructor=Nr,Pr=Array.isArray;var Fr=function(r){return null!=r&&"object"==typeof r};var Ir=function(r,t){var e=-1,n=r.length;for(t||(t=Array(n));++e<n;)t[e]=r[e];return t};var Rr=function(r){if(r instanceof Or)return r.clone();var t=new Sr(r.__wrapped__,r.__chain__);return t.__actions__=Ir(r.__actions__),t.__index__=r.__index__,t.__values__=r.__values__,t},Gr=Object.prototype.hasOwnProperty;function qr(r){if(Fr(r)&&!Pr(r)&&!(r instanceof Or)){if(r instanceof Sr)return r;if(Gr.call(r,"__wrapped__"))return Rr(r)}return new Sr(r)}var Tr=(qr.prototype=xr.prototype).constructor=qr;var Cr=function(r){var t=Ar(r),e=Tr[t];if("function"!=typeof e||!(t in Or.prototype))return!1;if(r===e)return!0;var n=Er(e);return!!n&&r===n[0]},Ur=ur(pr),zr=/\{\n\/\* \[wrapped with (.+)\] \*/,$r=/,? & /;var Dr=function(r){var t=r.match(zr);return t?t[1].split($r):[]},Wr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;var Br=function(r,t){var e=t.length;if(!e)return r;var n=e-1;return t[n]=(1<e?"& ":"")+t[n],t=t.join(2<e?", ":" "),r.replace(Wr,"{\n/* [wrapped with "+t+"] */\n")};var Qr=function(r,t){for(var e=-1,n=null==r?0:r.length;++e<n&&!1!==t(r[e],e,r););return r};var Jr=function(r,t,e,n){for(var a=r.length,o=e+(n?1:-1);n?o--:++o<a;)if(t(r[o],o,r))return o;return-1};var Kr=function(r){return r!=r};var Vr=function(r,t,e){for(var n=e-1,a=r.length;++n<a;)if(r[n]===t)return n;return-1};var Yr=function(r,t,e){return t==t?Vr(r,t,e):Jr(r,Kr,e)};var Hr=function(r,t){return!(null==r||!r.length)&&-1<Yr(r,t,0)},Xr=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];var Zr=function(e,n){return Qr(Xr,function(r){var t="_."+r[0];n&r[1]&&!Hr(e,t)&&e.push(t)}),e.sort()};var rt=function(r,t,e){var n=t+"";return sr(r,Br(n,Zr(Dr(n),e)))};var tt=function(r,t,e,n,a,o,i,l,u,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var h=[r,t,a,c?o:void 0,c?i:void 0,c?void 0:o,c?void 0:i,l,u,s],f=e.apply(void 0,h);return Cr(r)&&Ur(f,h),f.placeholder=n,rt(f,r,t)};var et=function(r){return r.placeholder},nt=/^(?:0|[1-9]\d*)$/;var at=function(r,t){var e=typeof r;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&nt.test(r))&&-1<r&&r%1==0&&r<t},ot=Math.min;var it=function(r,t){for(var e=r.length,n=ot(t.length,e),a=Ir(r);n--;){var o=t[n];r[n]=at(o,e)?a[o]:void 0}return r},lt="__lodash_placeholder__";var ut=function(r,t){for(var e=-1,n=r.length,a=0,o=[];++e<n;){var i=r[e];i!==t&&i!==lt||(r[e]=lt,o[a++]=e)}return o},st=1,ct=2,ht=8,ft=16,pt=128,dt=512;var gt=function s(c,h,f,p,d,g,v,y,b,m){var w=h&pt,_=h&st,k=h&ct,x=h&(ht|ft),M=h&dt,O=k?void 0:vr(c);return function r(){for(var t=arguments.length,e=Array(t),n=t;n--;)e[n]=arguments[n];if(x)var a=et(r),o=kr(e,a);if(p&&(e=mr(e,p,d,x)),g&&(e=_r(e,g,v,x)),t-=o,x&&t<m){var i=ut(e,a);return tt(c,h,s,r.placeholder,f,e,i,y,b,m-t)}var l=_?f:this,u=k?l[c]:c;return t=e.length,y?e=it(e,y):M&&1<t&&e.reverse(),w&&b<t&&(e.length=b),this&&this!==G&&this instanceof r&&(u=O||vr(u)),u.apply(l,e)}};var vt=function(i,l,u){var s=vr(i);return function r(){for(var t=arguments.length,e=Array(t),n=t,a=et(r);n--;)e[n]=arguments[n];var o=t<3&&e[0]!==a&&e[t-1]!==a?[]:ut(e,a);return(t-=o.length)<u?tt(i,l,gt,r.placeholder,void 0,e,o,void 0,void 0,u-t):S(this&&this!==G&&this instanceof r?s:i,this,e)}};var yt=function(l,r,u,s){var c=1&r,h=vr(l);return function r(){for(var t=-1,e=arguments.length,n=-1,a=s.length,o=Array(a+e),i=this&&this!==G&&this instanceof r?h:l;++n<a;)o[n]=s[n];for(;e--;)o[n++]=arguments[++t];return S(i,c?u:this,o)}},bt="__lodash_placeholder__",mt=Math.min;var wt=function(r,t){var e=r[1],n=t[1],a=e|n;if(a>=131&&!(128==n&&8==e||128==n&&256==e&&r[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==e))return r;1&n&&(r[2]=t[2],a|=1&e?0:4);var o=t[3];if(o){var i=r[3];r[3]=i?mr(i,o,t[4]):o,r[4]=i?ut(r[3],bt):t[4]}return(o=t[5])&&(r[5]=(i=r[5])?_r(i,o,t[6]):o,r[6]=i?ut(r[5],bt):t[6]),(o=t[7])&&(r[7]=o),128&n&&(r[8]=null==r[8]?t[8]:mt(r[8],t[8])),null==r[9]&&(r[9]=t[9]),r[0]=t[0],r[1]=a,r};var _t=function(r){return"symbol"==typeof r||Fr(r)&&"[object Symbol]"==Q(r)},kt=/^\s+|\s+$/g,xt=/^[-+]0x[0-9a-f]+$/i,Mt=/^0b[01]+$/i,Ot=/^0o[0-7]+$/i,Et=parseInt;var jt=function(r){if("number"==typeof r)return r;if(_t(r))return NaN;if(J(r)){var t="function"==typeof r.valueOf?r.valueOf():r;r=J(t)?t+"":t}if("string"!=typeof r)return 0===r?r:+r;r=r.replace(kt,"");var e=Mt.test(r);return e||Ot.test(r)?Et(r.slice(2),e?2:8):xt.test(r)?NaN:+r};var Lt=function(r){return r?(r=jt(r))!==1/0&&r!==-1/0?r==r?r:0:17976931348623157e292*(r<0?-1:1):0===r?r:0};var At=function(r){var t=Lt(r),e=t%1;return t==t?e?t-e:t:0},Nt=Math.max;var St=function(r,t,e,n,a,o,i,l){var u=2&t;if(!u&&"function"!=typeof r)throw new TypeError("Expected a function");var s=n?n.length:0;if(s||(t&=-97,n=a=void 0),i=void 0===i?i:Nt(At(i),0),l=void 0===l?l:At(l),s-=a?a.length:0,64&t){var c=n,h=a;n=a=void 0}var f=u?void 0:Er(r),p=[r,t,e,n,a,c,h,o,i,l];if(f&&wt(p,f),r=p[0],t=p[1],e=p[2],n=p[3],a=p[4],!(l=p[9]=void 0===p[9]?u?0:r.length:Nt(p[9]-s,0))&&24&t&&(t&=-25),t&&1!=t)d=8==t||16==t?vt(r,t,l):32!=t&&33!=t||a.length?gt.apply(void 0,p):yt(r,t,e,n);else var d=yr(r,t,e);return rt((f?pr:Ur)(d,p),r,t)},Pt=cr(function(r,t){var e=ut(t,et(Pt));return St(r,64,void 0,t,e)});Pt.placeholder={};var Ft=Pt,It={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Rt=c(function(r){var i=Array.prototype.concat,l=Array.prototype.slice,t=r.exports=function(r){for(var t,e=[],n=0,a=r.length;n<a;n++){var o=r[n];(t=o)&&"string"!=typeof t&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))?e=i.call(e,l.call(o)):e.push(o)}return e};t.wrap=function(r){return function(){return r(t(arguments))}}}),Gt=c(function(r){var t={};for(var e in It)It.hasOwnProperty(e)&&(t[It[e]]=e);var n=r.exports={to:{},get:{}};function i(r,t,e){return Math.min(Math.max(t,r),e)}function a(r){var t=r.toString(16).toUpperCase();return t.length<2?"0"+t:t}n.get=function(r){var t,e;switch(r.substring(0,3).toLowerCase()){case"hsl":t=n.get.hsl(r),e="hsl";break;case"hwb":t=n.get.hwb(r),e="hwb";break;default:t=n.get.rgb(r),e="rgb"}return t?{model:e,value:t}:null},n.get.rgb=function(r){if(!r)return null;var t,e,n,a=[0,0,0,1];if(t=r.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(n=t[2],t=t[1],e=0;e<3;e++){var o=2*e;a[e]=parseInt(t.slice(o,o+2),16)}n&&(a[3]=Math.round(parseInt(n,16)/255*100)/100)}else if(t=r.match(/^#([a-f0-9]{3,4})$/i)){for(n=(t=t[1])[3],e=0;e<3;e++)a[e]=parseInt(t[e]+t[e],16);n&&(a[3]=Math.round(parseInt(n+n,16)/255*100)/100)}else if(t=r.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)){for(e=0;e<3;e++)a[e]=parseInt(t[e+1],0);t[4]&&(a[3]=parseFloat(t[4]))}else{if(!(t=r.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)))return(t=r.match(/(\D+)/))?"transparent"===t[1]?[0,0,0,0]:(a=It[t[1]])?(a[3]=1,a):null:null;for(e=0;e<3;e++)a[e]=Math.round(2.55*parseFloat(t[e+1]));t[4]&&(a[3]=parseFloat(t[4]))}for(e=0;e<3;e++)a[e]=i(a[e],0,255);return a[3]=i(a[3],0,1),a},n.get.hsl=function(r){if(!r)return null;var t=r.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(t){var e=parseFloat(t[4]);return[(parseFloat(t[1])+360)%360,i(parseFloat(t[2]),0,100),i(parseFloat(t[3]),0,100),i(isNaN(e)?1:e,0,1)]}return null},n.get.hwb=function(r){if(!r)return null;var t=r.match(/^hwb\(\s*([+-]?\d*[\.]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(t){var e=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,i(parseFloat(t[2]),0,100),i(parseFloat(t[3]),0,100),i(isNaN(e)?1:e,0,1)]}return null},n.to.hex=function(){var r=Rt(arguments);return"#"+a(r[0])+a(r[1])+a(r[2])+(r[3]<1?a(Math.round(255*r[3])):"")},n.to.rgb=function(){var r=Rt(arguments);return r.length<4||1===r[3]?"rgb("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+")":"rgba("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+", "+r[3]+")"},n.to.rgb.percent=function(){var r=Rt(arguments),t=Math.round(r[0]/255*100),e=Math.round(r[1]/255*100),n=Math.round(r[2]/255*100);return r.length<4||1===r[3]?"rgb("+t+"%, "+e+"%, "+n+"%)":"rgba("+t+"%, "+e+"%, "+n+"%, "+r[3]+")"},n.to.hsl=function(){var r=Rt(arguments);return r.length<4||1===r[3]?"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)":"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+r[3]+")"},n.to.hwb=function(){var r=Rt(arguments),t="";return r.length<4||1===r[3]||(t=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+t+")"},n.to.keyword=function(r){return t[r.slice(0,3)]}}),qt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Tt=c(function(r){var u={};for(var t in qt)qt.hasOwnProperty(t)&&(u[qt[t]]=t);var i=r.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var e in i)if(i.hasOwnProperty(e)){if(!("channels"in i[e]))throw Error("missing channels property: "+e);if(!("labels"in i[e]))throw Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw Error("channel and label counts mismatch: "+e);var n=i[e].channels,a=i[e].labels;delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:n}),Object.defineProperty(i[e],"labels",{value:a})}i.rgb.hsl=function(r){var t,e,n=r[0]/255,a=r[1]/255,o=r[2]/255,i=Math.min(n,a,o),l=Math.max(n,a,o),u=l-i;return l===i?t=0:n===l?t=(a-o)/u:a===l?t=2+(o-n)/u:o===l&&(t=4+(n-a)/u),(t=Math.min(60*t,360))<0&&(t+=360),e=(i+l)/2,[t,100*(l===i?0:.5<e?u/(2-l-i):u/(l+i)),100*e]},i.rgb.hsv=function(r){var t,e,n,a,o,i=r[0]/255,l=r[1]/255,u=r[2]/255,s=Math.max(i,l,u),c=s-Math.min(i,l,u),h=function(r){return(s-r)/6/c+.5};return 0===c?a=o=0:(o=c/s,t=h(i),e=h(l),n=h(u),i===s?a=n-e:l===s?a=1/3+t-n:u===s&&(a=2/3+e-t),a<0?a+=1:1<a&&(a-=1)),[360*a,100*o,100*s]},i.rgb.hwb=function(r){var t=r[0],e=r[1],n=r[2];return[i.rgb.hsl(r)[0],100*(1/255*Math.min(t,Math.min(e,n))),100*(n=1-1/255*Math.max(t,Math.max(e,n)))]},i.rgb.cmyk=function(r){var t,e=r[0]/255,n=r[1]/255,a=r[2]/255;return[100*((1-e-(t=Math.min(1-e,1-n,1-a)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-a-t)/(1-t)||0),100*t]},i.rgb.keyword=function(r){var t=u[r];if(t)return t;var e,n,a,o=1/0;for(var i in qt)if(qt.hasOwnProperty(i)){var l=Math.pow((n=r)[0]-(a=qt[i])[0],2)+Math.pow(n[1]-a[1],2)+Math.pow(n[2]-a[2],2);l<o&&(o=l,e=i)}return e},i.keyword.rgb=function(r){return qt[r]},i.rgb.xyz=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255;return[100*(.4124*(t=.04045<t?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(e=.04045<e?Math.pow((e+.055)/1.055,2.4):e/12.92)+.1805*(n=.04045<n?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*e+.0722*n),100*(.0193*t+.1192*e+.9505*n)]},i.rgb.lab=function(r){var t=i.rgb.xyz(r),e=t[0],n=t[1],a=t[2];return n/=100,a/=108.883,e=.008856<(e/=95.047)?Math.pow(e,1/3):7.787*e+16/116,[116*(n=.008856<n?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(a=.008856<a?Math.pow(a,1/3):7.787*a+16/116))]},i.hsl.rgb=function(r){var t,e,n,a,o,i=r[0]/360,l=r[1]/100,u=r[2]/100;if(0===l)return[o=255*u,o,o];t=2*u-(e=u<.5?u*(1+l):u+l-u*l),a=[0,0,0];for(var s=0;s<3;s++)(n=i+1/3*-(s-1))<0&&n++,1<n&&n--,a[s]=255*(o=6*n<1?t+6*(e-t)*n:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t);return a},i.hsl.hsv=function(r){var t=r[0],e=r[1]/100,n=r[2]/100,a=e,o=Math.max(n,.01);return e*=1<(n*=2)?2-n:n,a*=1<o?2-o:o,[t,100*(0===n?2*a/(o+a):2*e/(n+e)),100*((n+e)/2)]},i.hsv.rgb=function(r){var t=r[0]/60,e=r[1]/100,n=r[2]/100,a=Math.floor(t)%6,o=t-Math.floor(t),i=255*n*(1-e),l=255*n*(1-e*o),u=255*n*(1-e*(1-o));switch(n*=255,a){case 0:return[n,u,i];case 1:return[l,n,i];case 2:return[i,n,u];case 3:return[i,l,n];case 4:return[u,i,n];case 5:return[n,i,l]}},i.hsv.hsl=function(r){var t,e,n,a=r[0],o=r[1]/100,i=r[2]/100,l=Math.max(i,.01);return n=(2-o)*i,e=o*l,[a,100*(e=(e/=1<(t=(2-o)*l)?2-t:t)||0),100*(n/=2)]},i.hwb.rgb=function(r){var t,e,n,a,o,i,l,u=r[0]/360,s=r[1]/100,c=r[2]/100,h=s+c;switch(1<h&&(s/=h,c/=h),n=6*u-(t=Math.floor(6*u)),0!=(1&t)&&(n=1-n),a=s+n*((e=1-c)-s),t){default:case 6:case 0:o=e,i=a,l=s;break;case 1:o=a,i=e,l=s;break;case 2:o=s,i=e,l=a;break;case 3:o=s,i=a,l=e;break;case 4:o=a,i=s,l=e;break;case 5:o=e,i=s,l=a}return[255*o,255*i,255*l]},i.cmyk.rgb=function(r){var t=r[1]/100,e=r[2]/100,n=r[3]/100;return[255*(1-Math.min(1,r[0]/100*(1-n)+n)),255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,e*(1-n)+n))]},i.xyz.rgb=function(r){var t,e,n,a=r[0]/100,o=r[1]/100,i=r[2]/100;return e=-.9689*a+1.8758*o+.0415*i,n=.0557*a+-.204*o+1.057*i,t=.0031308<(t=3.2406*a+-1.5372*o+-.4986*i)?1.055*Math.pow(t,1/2.4)-.055:12.92*t,e=.0031308<e?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=.0031308<n?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1))]},i.xyz.lab=function(r){var t=r[0],e=r[1],n=r[2];return e/=100,n/=108.883,t=.008856<(t/=95.047)?Math.pow(t,1/3):7.787*t+16/116,[116*(e=.008856<e?Math.pow(e,1/3):7.787*e+16/116)-16,500*(t-e),200*(e-(n=.008856<n?Math.pow(n,1/3):7.787*n+16/116))]},i.lab.xyz=function(r){var t,e,n;t=r[1]/500+(e=(r[0]+16)/116),n=e-r[2]/200;var a=Math.pow(e,3),o=Math.pow(t,3),i=Math.pow(n,3);return e=.008856<a?a:(e-16/116)/7.787,t=.008856<o?o:(t-16/116)/7.787,n=.008856<i?i:(n-16/116)/7.787,[t*=95.047,e*=100,n*=108.883]},i.lab.lch=function(r){var t,e=r[0],n=r[1],a=r[2];return(t=360*Math.atan2(a,n)/2/Math.PI)<0&&(t+=360),[e,Math.sqrt(n*n+a*a),t]},i.lch.lab=function(r){var t,e=r[1];return[r[0],e*Math.cos(t=r[2]/360*2*Math.PI),e*Math.sin(t)]},i.rgb.ansi16=function(r){var t=r[0],e=r[1],n=r[2],a=1 in arguments?arguments[1]:i.rgb.hsv(r)[2];if(0===(a=Math.round(a/50)))return 30;var o=30+(Math.round(n/255)<<2|Math.round(e/255)<<1|Math.round(t/255));return 2===a&&(o+=60),o},i.hsv.ansi16=function(r){return i.rgb.ansi16(i.hsv.rgb(r),r[2])},i.rgb.ansi256=function(r){var t=r[0],e=r[1],n=r[2];return t===e&&e===n?t<8?16:248<t?231:232+Math.round((t-8)/247*24):16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(n/255*5)},i.ansi16.rgb=function(r){var t=r%10;if(0===t||7===t)return 50<r&&(t+=3.5),[t=t/10.5*255,t,t];var e=.5*(1+~~(50<r));return[(1&t)*e*255,(t>>1&1)*e*255,(t>>2&1)*e*255]},i.ansi256.rgb=function(r){if(r<232)return[Math.floor((r-=16)/36)/5*255,Math.floor((t=r%36)/6)/5*255,t%6/5*255];var t,e=10*(r-232)+8;return[e,e,e]},i.rgb.hex=function(r){var t=(((255&Math.round(r[0]))<<16)+((255&Math.round(r[1]))<<8)+(255&Math.round(r[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},i.hex.rgb=function(r){var t=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var e=t[0];3===t[0].length&&(e=e.split("").map(function(r){return r+r}).join(""));var n=parseInt(e,16);return[n>>16&255,n>>8&255,255&n]},i.rgb.hcg=function(r){var t,e=r[0]/255,n=r[1]/255,a=r[2]/255,o=Math.max(Math.max(e,n),a),i=Math.min(Math.min(e,n),a),l=o-i;return t=0<l?o===e?(n-a)/l%6:o===n?2+(a-e)/l:4+(e-n)/l+4:0,t/=6,[360*(t%=1),100*l,100*(l<1?i/(1-l):0)]},i.hsl.hcg=function(r){var t=r[1]/100,e=r[2]/100,n=1,a=0;return(n=e<.5?2*t*e:2*t*(1-e))<1&&(a=(e-.5*n)/(1-n)),[r[0],100*n,100*a]},i.hsv.hcg=function(r){var t=r[2]/100,e=r[1]/100*t,n=0;return e<1&&(n=(t-e)/(1-e)),[r[0],100*e,100*n]},i.hcg.rgb=function(r){var t=r[1]/100,e=r[2]/100;if(0===t)return[255*e,255*e,255*e];var n,a=[0,0,0],o=r[0]/360%1*6,i=o%1,l=1-i;switch(Math.floor(o)){case 0:a[0]=1,a[1]=i,a[2]=0;break;case 1:a[0]=l,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=i;break;case 3:a[0]=0,a[1]=l,a[2]=1;break;case 4:a[0]=i,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=l}return[255*(t*a[0]+(n=(1-t)*e)),255*(t*a[1]+n),255*(t*a[2]+n)]},i.hcg.hsv=function(r){var t=r[1]/100,e=t+r[2]/100*(1-t),n=0;return 0<e&&(n=t/e),[r[0],100*n,100*e]},i.hcg.hsl=function(r){var t=r[1]/100,e=r[2]/100*(1-t)+.5*t,n=0;return 0<e&&e<.5?n=t/(2*e):.5<=e&&e<1&&(n=t/(2*(1-e))),[r[0],100*n,100*e]},i.hcg.hwb=function(r){var t=r[1]/100,e=t+r[2]/100*(1-t);return[r[0],100*(e-t),100*(1-e)]},i.hwb.hcg=function(r){var t=1-r[2]/100,e=t-r[1]/100,n=0;return e<1&&(n=(t-e)/(1-e)),[r[0],100*e,100*n]},i.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]},i.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]},i.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]},i.gray.hsl=i.gray.hsv=function(r){return[0,0,r[0]]},i.gray.hwb=function(r){return[0,100,r[0]]},i.gray.cmyk=function(r){return[0,0,0,r[0]]},i.gray.lab=function(r){return[r[0],0,0]},i.gray.hex=function(r){var t=255&Math.round(r[0]/100*255),e=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(e.length)+e},i.rgb.gray=function(r){return[(r[0]+r[1]+r[2])/3/255*100]}});function Ct(r){var t=function(){for(var r={},t=Object.keys(Tt),e=t.length,n=0;n<e;n++)r[t[n]]={distance:-1,parent:null};return r}(),e=[r];for(t[r].distance=0;e.length;)for(var n=e.pop(),a=Object.keys(Tt[n]),o=a.length,i=0;i<o;i++){var l=a[i],u=t[l];-1===u.distance&&(u.distance=t[n].distance+1,u.parent=n,e.unshift(l))}return t}function Ut(t,e){return function(r){return e(t(r))}}function zt(r,t){for(var e=[t[r].parent,r],n=Tt[t[r].parent][r],a=t[r].parent;t[a].parent;)e.unshift(t[a].parent),n=Ut(Tt[t[a].parent][a],n),a=t[a].parent;return n.conversion=e,n}var $t={};Object.keys(Tt).forEach(function(i){$t[i]={},Object.defineProperty($t[i],"channels",{value:Tt[i].channels}),Object.defineProperty($t[i],"labels",{value:Tt[i].labels});var l=function(r){for(var t=Ct(r),e={},n=Object.keys(t),a=n.length,o=0;o<a;o++){var i=n[o];null!==t[i].parent&&(e[i]=zt(i,t))}return e}(i);Object.keys(l).forEach(function(r){var a,t,e,n,o=l[r];$t[i][r]=(t=function(r){if(null==r)return r;1<arguments.length&&(r=Array.prototype.slice.call(arguments));var t=a(r);if("object"==typeof t)for(var e=t.length,n=0;n<e;n++)t[n]=Math.round(t[n]);return t},"conversion"in(a=o)&&(t.conversion=a.conversion),t),$t[i][r].raw=(n=function(r){return null==r?r:(1<arguments.length&&(r=Array.prototype.slice.call(arguments)),e(r))},"conversion"in(e=o)&&(n.conversion=e.conversion),n)})});var Dt=$t,Wt=[].slice,Bt=["keyword","gray","hex"],Qt={};Object.keys(Dt).forEach(function(r){Qt[Wt.call(Dt[r].labels).sort().join("")]=r});var Jt={};function Kt(r,t){if(!(this instanceof Kt))return new Kt(r,t);if(t&&t in Bt&&(t=null),t&&!(t in Dt))throw Error("Unknown model: "+t);var e,n;if(r)if(r instanceof Kt)this.model=r.model,this.color=r.color.slice(),this.valpha=r.valpha;else if("string"==typeof r){var a=Gt.get(r);if(null===a)throw Error("Unable to parse color from string: "+r);this.model=a.model,this.color=a.value.slice(0,n=Dt[this.model].channels),this.valpha="number"==typeof a.value[n]?a.value[n]:1}else if(r.length){this.model=t||"rgb";var o=Wt.call(r,0,n=Dt[this.model].channels);this.color=Ht(o,n),this.valpha="number"==typeof r[n]?r[n]:1}else if("number"==typeof r)r&=16777215,this.model="rgb",this.color=[r>>16&255,r>>8&255,255&r],this.valpha=1;else{this.valpha=1;var i=Object.keys(r);"alpha"in r&&(i.splice(i.indexOf("alpha"),1),this.valpha="number"==typeof r.alpha?r.alpha:0);var l=i.sort().join("");if(!(l in Qt))throw Error("Unable to parse color from object: "+JSON.stringify(r));this.model=Qt[l];var u=Dt[this.model].labels,s=[];for(e=0;e<u.length;e++)s.push(r[u[e]]);this.color=Ht(s)}else this.model="rgb",this.color=[0,0,0],this.valpha=1;if(Jt[this.model])for(n=Dt[this.model].channels,e=0;e<n;e++){var c=Jt[this.model][e];c&&(this.color[e]=c(this.color[e]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function Vt(e,n,a){return(e=Array.isArray(e)?e:[e]).forEach(function(r){(Jt[r]||(Jt[r]=[]))[n]=a}),e=e[0],function(r){var t;return arguments.length?(a&&(r=a(r)),(t=this[e]()).color[n]=r):(t=this[e]().color[n],a&&(t=a(t))),t}}function Yt(t){return function(r){return Math.max(0,Math.min(t,r))}}function Ht(r,t){for(var e=0;e<t;e++)"number"!=typeof r[e]&&(r[e]=0);return r}Kt.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(r){var t=this.model in Gt.to?this:this.rgb(),e=1===(t=t.round("number"==typeof r?r:1)).valpha?t.color:t.color.concat(this.valpha);return Gt.to[t.model](e)},percentString:function(r){var t=this.rgb().round("number"==typeof r?r:1),e=1===t.valpha?t.color:t.color.concat(this.valpha);return Gt.to.rgb.percent(e)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var r={},t=Dt[this.model].channels,e=Dt[this.model].labels,n=0;n<t;n++)r[e[n]]=this.color[n];return 1!==this.valpha&&(r.alpha=this.valpha),r},unitArray:function(){var r=this.rgb().color;return r[0]/=255,r[1]/=255,r[2]/=255,1!==this.valpha&&r.push(this.valpha),r},unitObject:function(){var r=this.rgb().object();return r.r/=255,r.g/=255,r.b/=255,1!==this.valpha&&(r.alpha=this.valpha),r},round:function(r){return new Kt(this.color.map((t=r=Math.max(r||0,0),function(r){return+r.toFixed(t)})).concat(this.valpha),this.model);var t},alpha:function(r){return arguments.length?new Kt(this.color.concat(Math.max(0,Math.min(1,r))),this.model):this.valpha},red:Vt("rgb",0,Yt(255)),green:Vt("rgb",1,Yt(255)),blue:Vt("rgb",2,Yt(255)),hue:Vt(["hsl","hsv","hsl","hwb","hcg"],0,function(r){return(r%360+360)%360}),saturationl:Vt("hsl",1,Yt(100)),lightness:Vt("hsl",2,Yt(100)),saturationv:Vt("hsv",1,Yt(100)),value:Vt("hsv",2,Yt(100)),chroma:Vt("hcg",1,Yt(100)),gray:Vt("hcg",2,Yt(100)),white:Vt("hwb",1,Yt(100)),wblack:Vt("hwb",2,Yt(100)),cyan:Vt("cmyk",0,Yt(100)),magenta:Vt("cmyk",1,Yt(100)),yellow:Vt("cmyk",2,Yt(100)),black:Vt("cmyk",3,Yt(100)),x:Vt("xyz",0,Yt(100)),y:Vt("xyz",1,Yt(100)),z:Vt("xyz",2,Yt(100)),l:Vt("lab",0,Yt(100)),a:Vt("lab",1),b:Vt("lab",2),keyword:function(r){return arguments.length?new Kt(r):Dt[this.model].keyword(this.color)},hex:function(r){return arguments.length?new Kt(r):Gt.to.hex(this.rgb().round().color)},rgbNumber:function(){var r=this.rgb().color;return(255&r[0])<<16|(255&r[1])<<8|255&r[2]},luminosity:function(){for(var r=this.rgb().color,t=[],e=0;e<r.length;e++){var n=r[e]/255;t[e]=.03928<n?Math.pow((n+.055)/1.055,2.4):n/12.92}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(r){var t=this.luminosity(),e=r.luminosity();return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)},level:function(r){var t=this.contrast(r);return t<7.1?t<4.5?"":"AA":"AAA"},isDark:function(){var r=this.rgb().color;return(299*r[0]+587*r[1]+114*r[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var r=this.rgb(),t=0;t<3;t++)r.color[t]=255-r.color[t];return r},lighten:function(r){var t=this.hsl();return t.color[2]+=t.color[2]*r,t},darken:function(r){var t=this.hsl();return t.color[2]-=t.color[2]*r,t},saturate:function(r){var t=this.hsl();return t.color[1]+=t.color[1]*r,t},desaturate:function(r){var t=this.hsl();return t.color[1]-=t.color[1]*r,t},whiten:function(r){var t=this.hwb();return t.color[1]+=t.color[1]*r,t},blacken:function(r){var t=this.hwb();return t.color[2]+=t.color[2]*r,t},grayscale:function(){var r=this.rgb().color,t=.3*r[0]+.59*r[1]+.11*r[2];return Kt.rgb(t,t,t)},fade:function(r){return this.alpha(this.valpha-this.valpha*r)},opaquer:function(r){return this.alpha(this.valpha+this.valpha*r)},rotate:function(r){var t=this.hsl(),e=t.color[0];return t.color[0]=e=(e=(e+r)%360)<0?360+e:e,t},mix:function(r,t){var e=r.rgb(),n=this.rgb(),a=void 0===t?.5:t,o=2*a-1,i=e.alpha()-n.alpha(),l=((o*i==-1?o:(o+i)/(1+o*i))+1)/2,u=1-l;return Kt.rgb(l*e.red()+u*n.red(),l*e.green()+u*n.green(),l*e.blue()+u*n.blue(),e.alpha()*a+n.alpha()*(1-a))}},Object.keys(Dt).forEach(function(e){if(-1==Bt.indexOf(e)){var n=Dt[e].channels;Kt.prototype[e]=function(){if(this.model===e)return new Kt(this);if(arguments.length)return new Kt(arguments,e);var r,t="number"==typeof arguments[n]?n:this.valpha;return new Kt((r=Dt[this.model][e].raw(this.color),Array.isArray(r)?r:[r]).concat(t),e)},Kt[e]=function(r){return"number"==typeof r&&(r=Ht(Wt.call(arguments),n)),new Kt(r,e)}}});var Xt=Kt,Zt={table:{display:"flex","flex-wrap":"wrap",margin:"0.2em 0.2em 0.2em 0.2em",padding:0,"flex-direction":"column",width:"20em"},cell:{"box-sizing":"border-box","flex-grow":1,width:"100%",overflow:"hidden",padding:"0.2em 0.2em",border:"solid 2px "+Xt("slategrey").fade(.5),"border-bottom":"none","background-color":"#f7f7f7",display:"flex","align-items":"center","justify-content":"center","&:last-child":{"border-bottom":"solid 2px "+Xt("slategrey").fade(.5)+" !important"}},"image-container":{height:"15em"},image:{width:"100%",height:"100%"}},re=function(e){function r(t){var r;return(r=e.call(this,t)||this).state={isLoading:!1,imageUrl:null,error:null},r.componentManager=o.AppContainerUtils.registerComponent(s(s(r)),{namespace:"io.github.t83714/RandomGif",reducer:m,saga:Ft(A,t.apiKey),actionTypes:b,allowedIncomingMulticastActionTypes:[f],namespaceInitCallback:function(r){return{styleSheet:(t.styles?i:i.setup(l())).createStyleSheet(t.styles?t.styles:Zt,{generateClassName:r.createClassNameGenerator()}).attach()}},namespaceDestroyCallback:function(r){r.styleSheet.detach()}}),r}return u(r,e),r.prototype.render=function(){var r=this,t=this.componentManager.getNamespaceData().styleSheet.classes;return n.createElement("div",{className:t.table},n.createElement("div",{className:t.cell},"RandomGif"),n.createElement("div",{className:t.cell+" "+t["image-container"]},this.state.imageUrl&&!this.state.isLoading&&!this.state.error&&n.createElement("img",{alt:"Gif",src:this.state.imageUrl,className:""+t.image}),(!this.state.imageUrl||this.state.isLoading)&&!this.state.error&&n.createElement("p",null,this.state.isLoading?"Requesting API...":"No GIF loaded yet!"),this.state.error&&n.createElement("p",null,"Failed to request API: "+this.state.error)),this.props.showButton&&n.createElement("div",{className:t.cell+" "},n.createElement("button",{onClick:function(){r.componentManager.dispatch(E())},disabled:this.state.isLoading},this.state.isLoading?"Requesting API...":"Get Gif")))},r}(n.Component);re.propTypes={showButton:t.bool,apiKey:t.string,styles:t.object,appContainer:t.instanceOf(o.AppContainer)},re.defaultProps={showButton:!0,apiKey:"Y4P38sTJAgEBOHP1B3sVs0Jtk01tb6fA"};var te={NEW_GIF:g,LOADING_START:v,LOADING_COMPLETE:y,REQUEST_NEW_GIF:f},ee={requestNewGif:E};r.default=re,r.actionTypes=te,r.actions=ee,Object.defineProperty(r,"__esModule",{value:!0})}); | ||
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("fractal-component"),require("jss"),require("jss-preset-default")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","fractal-component","jss","jss-preset-default"],t):t((r=r||self).RandomGif={},r.React,r.PropTypes,r.FractalComponent,r.jss,r.jssPreset)}(this,function(r,n,t,a,o,i){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n,t=t&&t.hasOwnProperty("default")?t.default:t,o=o&&o.hasOwnProperty("default")?o.default:o,i=i&&i.hasOwnProperty("default")?i.default:i;var l=function(r,t){r.prototype=Object.create(t.prototype),(r.prototype.constructor=r).__proto__=t};var u=function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r},e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(r,t){return r(t={exports:{}},t.exports),t.exports}var c=s(function(r){function t(){return r.exports=t=Object.assign||function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},t.apply(this,arguments)}r.exports=t}),h=Symbol("REQUEST_NEW_GIF"),f=Symbol("RECEIVE_NEW_GIF"),p=Symbol("REQUEST_NEW_GIF_ERROR"),d=Symbol("NEW_GIF"),v=Symbol("LOADING_START"),g=Symbol("LOADING_COMPLETE"),y=Object.freeze({REQUEST_NEW_GIF:h,RECEIVE_NEW_GIF:f,REQUEST_NEW_GIF_ERROR:p,NEW_GIF:d,LOADING_START:v,LOADING_COMPLETE:g}),b=function(r,t){switch(t.type){case h:return c({},r,{isLoading:!0,error:null});case f:return c({},r,{isLoading:!1,error:null,imageUrl:t.payload});case p:return c({},r,{isLoading:!1,error:t.payload});default:return r}},m=s(function(P){!function(r){var u,t=Object.prototype,s=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},a=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag",i=r.regeneratorRuntime;if(i)P.exports=i;else{(i=r.regeneratorRuntime=P.exports).wrap=b;var c="suspendedStart",h="suspendedYield",f="executing",p="completed",d={},l={};l[a]=function(){return this};var v=Object.getPrototypeOf,g=v&&v(v(A([])));g&&g!==t&&s.call(g,a)&&(l=g);var y=k.prototype=w.prototype=Object.create(l);_.prototype=y.constructor=k,k.constructor=_,k[o]=_.displayName="GeneratorFunction",i.isGeneratorFunction=function(r){var t="function"==typeof r&&r.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,k):(r.__proto__=k,o in r||(r[o]="GeneratorFunction")),r.prototype=Object.create(y),r},i.awrap=function(r){return{__await:r}},x(M.prototype),M.prototype[n]=function(){return this},i.AsyncIterator=M,i.async=function(r,t,e,n){var a=new M(b(r,t,e,n));return i.isGeneratorFunction(t)?a:a.next().then(function(r){return r.done?r.value:a.next()})},x(y),y[o]="Generator",y[a]=function(){return this},y.toString=function(){return"[object Generator]"},i.keys=function(e){var n=[];for(var r in e)n.push(r);return n.reverse(),function r(){for(;n.length;){var t=n.pop();if(t in e)return r.value=t,r.done=!1,r}return r.done=!0,r}},i.values=A,L.prototype={constructor:L,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(j),!r)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=u)},stop:function(){this.done=!0;var r=this.tryEntries[0].completion;if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,t){return o.type="throw",o.arg=e,n.next=r,t&&(n.method="next",n.arg=u),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var a=this.tryEntries[t],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var i=s.call(a,"catchLoc"),l=s.call(a,"finallyLoc");if(i&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(i){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(r,t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}!a||"break"!==r&&"continue"!==r||t<a.tryLoc||a.finallyLoc<t||(a=null);var o=a?a.completion:{};return o.type=r,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(o)},complete:function(r,t){if("throw"===r.type)throw r.arg;return"break"===r.type||"continue"===r.type?this.next=r.arg:"return"===r.type?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):"normal"===r.type&&t&&(this.next=t),d},finish:function(r){for(var t=this.tryEntries.length-1;0<=t;--t){var e=this.tryEntries[t];if(e.finallyLoc===r)return this.complete(e.completion,e.afterLoc),j(e),d}},catch:function(r){for(var t=this.tryEntries.length-1;0<=t;--t){var e=this.tryEntries[t];if(e.tryLoc===r){var n=e.completion;if("throw"===n.type){var a=n.arg;j(e)}return a}}throw Error("illegal catch attempt")},delegateYield:function(r,t,e){return this.delegate={iterator:A(r),resultName:t,nextLoc:e},"next"===this.method&&(this.arg=u),d}}}function b(r,t,e,n){var o,i,l,u,a=Object.create((t&&t.prototype instanceof w?t:w).prototype),s=new L(n||[]);return a._invoke=(o=r,i=e,l=s,u=c,function(r,t){if(u===f)throw Error("Generator is already running");if(u===p){if("throw"===r)throw t;return N()}for(l.method=r,l.arg=t;;){var e=l.delegate;if(e){var n=O(e,l);if(n){if(n===d)continue;return n}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if(u===c)throw u=p,l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);u=f;var a=m(o,i,l);if("normal"===a.type){if(u=l.done?p:h,a.arg===d)continue;return{value:a.arg,done:l.done}}"throw"===a.type&&(u=p,l.method="throw",l.arg=a.arg)}}),a}function m(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(r){return{type:"throw",arg:r}}}function w(){}function _(){}function k(){}function x(r){["next","throw","return"].forEach(function(t){r[t]=function(r){return this._invoke(t,r)}})}function M(u){var t;this._invoke=function(e,n){function r(){return new Promise(function(r,t){!function t(r,e,n,a){var o=m(u[r],u,e);if("throw"!==o.type){var i=o.arg,l=i.value;return l&&"object"==typeof l&&s.call(l,"__await")?Promise.resolve(l.__await).then(function(r){t("next",r,n,a)},function(r){t("throw",r,n,a)}):Promise.resolve(l).then(function(r){i.value=r,n(i)},function(r){return t("throw",r,n,a)})}a(o.arg)}(e,n,r,t)})}return t=t?t.then(r,r):r()}}function O(r,t){var e=r.iterator[t.method];if(e===u){if(t.delegate=null,"throw"===t.method){if(r.iterator.return&&(t.method="return",t.arg=u,O(r,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var n=m(e,r.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var a=n.arg;return a?a.done?(t[r.resultName]=a.value,t.next=r.nextLoc,"return"!==t.method&&(t.method="next",t.arg=u),t.delegate=null,d):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function j(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function L(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(E,this),this.reset(!0)}function A(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,n=function r(){for(;++e<t.length;)if(s.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=u,r.done=!0,r};return n.next=n}}return{next:N}}function N(){return{value:u,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())}),w=function(){return this||"object"==typeof self&&self}()||Function("return this")(),_=w.regeneratorRuntime&&0<=Object.getOwnPropertyNames(w).indexOf("regeneratorRuntime"),k=_&&w.regeneratorRuntime;w.regeneratorRuntime=void 0;var x=m;if(_)w.regeneratorRuntime=k;else try{delete w.regeneratorRuntime}catch(r){w.regeneratorRuntime=void 0}var M=x;function O(){return{type:h}}function E(r){return void 0===r&&(r=null),{type:g,payload:{isSuccess:!r,error:r}}}function j(r){return fetch("https://api.giphy.com/v1/gifs/random?api_key="+r).then(function(r){return r.json()}).catch(function(){throw Error("Giphy API key is invalid or exceeded its daily / hourly limit.")})}var L=M.mark(function r(e,n){return M.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.takeLeading(h,M.mark(function r(){var t;return M.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,e.put({type:v},"../../../*");case 3:return r.next=5,e.call(j,n);case 5:return t=r.sent.data.fixed_width_small_url,r.next=9,e.put({type:f,payload:t});case 9:return r.next=11,e.put({type:d},"../../../*");case 11:return r.next=13,e.put(E(),"../../../*");case 13:r.next=21;break;case 15:return r.prev=15,r.t0=r.catch(0),r.next=19,e.put({type:p,payload:r.t0});case 19:return r.next=21,e.put(E(r.t0),"../../../*");case 21:case"end":return r.stop()}},r,this,[[0,15]])}));case 2:case"end":return r.stop()}},r,this)});var A=function(r){return r};var N=function(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)},P=Math.max;var S=function(o,i,l){return i=P(void 0===i?o.length-1:i,0),function(){for(var r=arguments,t=-1,e=P(r.length-i,0),n=Array(e);++t<e;)n[t]=r[i+t];t=-1;for(var a=Array(i+1);++t<i;)a[t]=r[t];return a[i]=l(n),N(o,this,a)}};var F=function(r){return function(){return r}},I="object"==typeof self&&self&&self.Object===Object&&self,R="object"==typeof e&&e&&e.Object===Object&&e||I||Function("return this")(),G=R.Symbol,T=Object.prototype,q=T.hasOwnProperty,C=T.toString,z=G?G.toStringTag:void 0;var U=function(r){var t=q.call(r,z),e=r[z];try{var n=!(r[z]=void 0)}catch(r){}var a=C.call(r);return n&&(t?r[z]=e:delete r[z]),a},$=Object.prototype.toString;var D=function(r){return $.call(r)},W=G?G.toStringTag:void 0;var B=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":W&&W in Object(r)?U(r):D(r)};var Q=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)};var J,K=function(r){if(!Q(r))return!1;var t=B(r);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},V=R["__core-js_shared__"],Y=(J=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+J:"";var H=function(r){return!!Y&&Y in r},X=Function.prototype.toString;var Z=function(r){if(null!=r){try{return X.call(r)}catch(r){}try{return r+""}catch(r){}}return""},rr=/^\[object .+?Constructor\]$/,tr=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var er=function(r){return!(!Q(r)||H(r))&&(K(r)?tr:rr).test(Z(r))};var nr=function(r,t){return null==r?void 0:r[t]};var ar=function(r,t){var e=nr(r,t);return er(e)?e:void 0},or=function(){try{var r=ar(Object,"defineProperty");return r({},"",{}),r}catch(r){}}(),ir=Date.now;var lr=function(e){var n=0,a=0;return function(){var r=ir(),t=16-(r-a);if(a=r,0<t){if(800<=++n)return arguments[0]}else n=0;return e.apply(void 0,arguments)}},ur=lr(or?function(r,t){return or(r,"toString",{configurable:!0,enumerable:!1,value:F(t),writable:!0})}:A);var sr=function(r,t){return ur(S(r,t,A),r+"")},cr=ar(R,"WeakMap"),hr=cr&&new cr,fr=hr?function(r,t){return hr.set(r,t),r}:A,pr=Object.create,dr=function(){function e(){}return function(r){if(!Q(r))return{};if(pr)return pr(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();var vr=function(n){return function(){var r=arguments;switch(r.length){case 0:return new n;case 1:return new n(r[0]);case 2:return new n(r[0],r[1]);case 3:return new n(r[0],r[1],r[2]);case 4:return new n(r[0],r[1],r[2],r[3]);case 5:return new n(r[0],r[1],r[2],r[3],r[4]);case 6:return new n(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new n(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var t=dr(n.prototype),e=n.apply(t,r);return Q(e)?e:t}};var gr=function(t,r,e){var n=1&r,a=vr(t);return function r(){return(this&&this!==R&&this instanceof r?a:t).apply(n?e:this,arguments)}},yr=Math.max;var br=function(r,t,e,n){for(var a=-1,o=r.length,i=e.length,l=-1,u=t.length,s=yr(o-i,0),c=Array(u+s),h=!n;++l<u;)c[l]=t[l];for(;++a<i;)(h||a<o)&&(c[e[a]]=r[a]);for(;s--;)c[l++]=r[a++];return c},mr=Math.max;var wr=function(r,t,e,n){for(var a=-1,o=r.length,i=-1,l=e.length,u=-1,s=t.length,c=mr(o-l,0),h=Array(c+s),f=!n;++a<c;)h[a]=r[a];for(var p=a;++u<s;)h[p+u]=t[u];for(;++i<l;)(f||a<o)&&(h[p+e[i]]=r[a++]);return h};var _r=function(r,t){for(var e=r.length,n=0;e--;)r[e]===t&&++n;return n};var kr=function(){};function xr(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}var Mr=(xr.prototype=dr(kr.prototype)).constructor=xr;var Or=hr?function(r){return hr.get(r)}:function(){},Er={},jr=Object.prototype.hasOwnProperty;var Lr=function(r){for(var t=r.name+"",e=Er[t],n=jr.call(Er,t)?e.length:0;n--;){var a=e[n],o=a.func;if(null==o||o==r)return a.name}return t};function Ar(r,t){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}var Nr=(Ar.prototype=dr(kr.prototype)).constructor=Ar,Pr=Array.isArray;var Sr=function(r){return null!=r&&"object"==typeof r};var Fr=function(r,t){var e=-1,n=r.length;for(t||(t=Array(n));++e<n;)t[e]=r[e];return t};var Ir=function(r){if(r instanceof Mr)return r.clone();var t=new Nr(r.__wrapped__,r.__chain__);return t.__actions__=Fr(r.__actions__),t.__index__=r.__index__,t.__values__=r.__values__,t},Rr=Object.prototype.hasOwnProperty;function Gr(r){if(Sr(r)&&!Pr(r)&&!(r instanceof Mr)){if(r instanceof Nr)return r;if(Rr.call(r,"__wrapped__"))return Ir(r)}return new Nr(r)}var Tr=(Gr.prototype=kr.prototype).constructor=Gr;var qr=function(r){var t=Lr(r),e=Tr[t];if("function"!=typeof e||!(t in Mr.prototype))return!1;if(r===e)return!0;var n=Or(e);return!!n&&r===n[0]},Cr=lr(fr),zr=/\{\n\/\* \[wrapped with (.+)\] \*/,Ur=/,? & /;var $r=function(r){var t=r.match(zr);return t?t[1].split(Ur):[]},Dr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;var Wr=function(r,t){var e=t.length;if(!e)return r;var n=e-1;return t[n]=(1<e?"& ":"")+t[n],t=t.join(2<e?", ":" "),r.replace(Dr,"{\n/* [wrapped with "+t+"] */\n")};var Br=function(r,t){for(var e=-1,n=null==r?0:r.length;++e<n&&!1!==t(r[e],e,r););return r};var Qr=function(r,t,e,n){for(var a=r.length,o=e+(n?1:-1);n?o--:++o<a;)if(t(r[o],o,r))return o;return-1};var Jr=function(r){return r!=r};var Kr=function(r,t,e){for(var n=e-1,a=r.length;++n<a;)if(r[n]===t)return n;return-1};var Vr=function(r,t,e){return t==t?Kr(r,t,e):Qr(r,Jr,e)};var Yr=function(r,t){return!(null==r||!r.length)&&-1<Vr(r,t,0)},Hr=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];var Xr=function(e,n){return Br(Hr,function(r){var t="_."+r[0];n&r[1]&&!Yr(e,t)&&e.push(t)}),e.sort()};var Zr=function(r,t,e){var n=t+"";return ur(r,Wr(n,Xr($r(n),e)))};var rt=function(r,t,e,n,a,o,i,l,u,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var h=[r,t,a,c?o:void 0,c?i:void 0,c?void 0:o,c?void 0:i,l,u,s],f=e.apply(void 0,h);return qr(r)&&Cr(f,h),f.placeholder=n,Zr(f,r,t)};var tt=function(r){return r.placeholder},et=/^(?:0|[1-9]\d*)$/;var nt=function(r,t){var e=typeof r;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&et.test(r))&&-1<r&&r%1==0&&r<t},at=Math.min;var ot=function(r,t){for(var e=r.length,n=at(t.length,e),a=Fr(r);n--;){var o=t[n];r[n]=nt(o,e)?a[o]:void 0}return r},it="__lodash_placeholder__";var lt=function(r,t){for(var e=-1,n=r.length,a=0,o=[];++e<n;){var i=r[e];i!==t&&i!==it||(r[e]=it,o[a++]=e)}return o},ut=1,st=2,ct=8,ht=16,ft=128,pt=512;function dt(s,c,h,f,p,d,v,g,y,b){var m=c&ft,w=c&ut,_=c&st,k=c&(ct|ht),x=c&pt,M=_?void 0:vr(s);return function r(){for(var t=arguments.length,e=Array(t),n=t;n--;)e[n]=arguments[n];if(k)var a=tt(r),o=_r(e,a);if(f&&(e=br(e,f,p,k)),d&&(e=wr(e,d,v,k)),t-=o,k&&t<b){var i=lt(e,a);return rt(s,c,dt,r.placeholder,h,e,i,g,y,b-t)}var l=w?h:this,u=_?l[s]:s;return t=e.length,g?e=ot(e,g):x&&1<t&&e.reverse(),m&&y<t&&(e.length=y),this&&this!==R&&this instanceof r&&(u=M||vr(u)),u.apply(l,e)}}var vt=dt;var gt=function(i,l,u){var s=vr(i);return function r(){for(var t=arguments.length,e=Array(t),n=t,a=tt(r);n--;)e[n]=arguments[n];var o=t<3&&e[0]!==a&&e[t-1]!==a?[]:lt(e,a);return(t-=o.length)<u?rt(i,l,vt,r.placeholder,void 0,e,o,void 0,void 0,u-t):N(this&&this!==R&&this instanceof r?s:i,this,e)}};var yt=function(l,r,u,s){var c=1&r,h=vr(l);return function r(){for(var t=-1,e=arguments.length,n=-1,a=s.length,o=Array(a+e),i=this&&this!==R&&this instanceof r?h:l;++n<a;)o[n]=s[n];for(;e--;)o[n++]=arguments[++t];return N(i,c?u:this,o)}},bt="__lodash_placeholder__",mt=Math.min;var wt=function(r,t){var e=r[1],n=t[1],a=e|n;if(a>=131&&!(128==n&&8==e||128==n&&256==e&&r[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==e))return r;1&n&&(r[2]=t[2],a|=1&e?0:4);var o=t[3];if(o){var i=r[3];r[3]=i?br(i,o,t[4]):o,r[4]=i?lt(r[3],bt):t[4]}return(o=t[5])&&(r[5]=(i=r[5])?wr(i,o,t[6]):o,r[6]=i?lt(r[5],bt):t[6]),(o=t[7])&&(r[7]=o),128&n&&(r[8]=null==r[8]?t[8]:mt(r[8],t[8])),null==r[9]&&(r[9]=t[9]),r[0]=t[0],r[1]=a,r};var _t=function(r){return"symbol"==typeof r||Sr(r)&&"[object Symbol]"==B(r)},kt=/^\s+|\s+$/g,xt=/^[-+]0x[0-9a-f]+$/i,Mt=/^0b[01]+$/i,Ot=/^0o[0-7]+$/i,Et=parseInt;var jt=function(r){if("number"==typeof r)return r;if(_t(r))return NaN;if(Q(r)){var t="function"==typeof r.valueOf?r.valueOf():r;r=Q(t)?t+"":t}if("string"!=typeof r)return 0===r?r:+r;r=r.replace(kt,"");var e=Mt.test(r);return e||Ot.test(r)?Et(r.slice(2),e?2:8):xt.test(r)?NaN:+r};var Lt=function(r){return r?(r=jt(r))!==1/0&&r!==-1/0?r==r?r:0:17976931348623157e292*(r<0?-1:1):0===r?r:0};var At=function(r){var t=Lt(r),e=t%1;return t==t?e?t-e:t:0},Nt=Math.max;var Pt=function(r,t,e,n,a,o,i,l){var u=2&t;if(!u&&"function"!=typeof r)throw new TypeError("Expected a function");var s=n?n.length:0;if(s||(t&=-97,n=a=void 0),i=void 0===i?i:Nt(At(i),0),l=void 0===l?l:At(l),s-=a?a.length:0,64&t){var c=n,h=a;n=a=void 0}var f=u?void 0:Or(r),p=[r,t,e,n,a,c,h,o,i,l];if(f&&wt(p,f),r=p[0],t=p[1],e=p[2],n=p[3],a=p[4],!(l=p[9]=void 0===p[9]?u?0:r.length:Nt(p[9]-s,0))&&24&t&&(t&=-25),t&&1!=t)d=8==t||16==t?gt(r,t,l):32!=t&&33!=t||a.length?vt.apply(void 0,p):yt(r,t,e,n);else var d=gr(r,t,e);return Zr((f?fr:Cr)(d,p),r,t)},St=sr(function(r,t){var e=lt(t,tt(St));return Pt(r,64,void 0,t,e)});St.placeholder={};var Ft=St,It={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Rt=s(function(r){var i=Array.prototype.concat,l=Array.prototype.slice,t=r.exports=function(r){for(var t,e=[],n=0,a=r.length;n<a;n++){var o=r[n];(t=o)&&"string"!=typeof t&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))?e=i.call(e,l.call(o)):e.push(o)}return e};t.wrap=function(r){return function(){return r(t(arguments))}}}),Gt=s(function(r){var t={};for(var e in It)It.hasOwnProperty(e)&&(t[It[e]]=e);var n=r.exports={to:{},get:{}};function i(r,t,e){return Math.min(Math.max(t,r),e)}function a(r){var t=r.toString(16).toUpperCase();return t.length<2?"0"+t:t}n.get=function(r){var t,e;switch(r.substring(0,3).toLowerCase()){case"hsl":t=n.get.hsl(r),e="hsl";break;case"hwb":t=n.get.hwb(r),e="hwb";break;default:t=n.get.rgb(r),e="rgb"}return t?{model:e,value:t}:null},n.get.rgb=function(r){if(!r)return null;var t,e,n,a=[0,0,0,1];if(t=r.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(n=t[2],t=t[1],e=0;e<3;e++){var o=2*e;a[e]=parseInt(t.slice(o,o+2),16)}n&&(a[3]=Math.round(parseInt(n,16)/255*100)/100)}else if(t=r.match(/^#([a-f0-9]{3,4})$/i)){for(n=(t=t[1])[3],e=0;e<3;e++)a[e]=parseInt(t[e]+t[e],16);n&&(a[3]=Math.round(parseInt(n+n,16)/255*100)/100)}else if(t=r.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)){for(e=0;e<3;e++)a[e]=parseInt(t[e+1],0);t[4]&&(a[3]=parseFloat(t[4]))}else{if(!(t=r.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)))return(t=r.match(/(\D+)/))?"transparent"===t[1]?[0,0,0,0]:(a=It[t[1]])?(a[3]=1,a):null:null;for(e=0;e<3;e++)a[e]=Math.round(2.55*parseFloat(t[e+1]));t[4]&&(a[3]=parseFloat(t[4]))}for(e=0;e<3;e++)a[e]=i(a[e],0,255);return a[3]=i(a[3],0,1),a},n.get.hsl=function(r){if(!r)return null;var t=r.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(t){var e=parseFloat(t[4]);return[(parseFloat(t[1])+360)%360,i(parseFloat(t[2]),0,100),i(parseFloat(t[3]),0,100),i(isNaN(e)?1:e,0,1)]}return null},n.get.hwb=function(r){if(!r)return null;var t=r.match(/^hwb\(\s*([+-]?\d*[\.]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(t){var e=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,i(parseFloat(t[2]),0,100),i(parseFloat(t[3]),0,100),i(isNaN(e)?1:e,0,1)]}return null},n.to.hex=function(){var r=Rt(arguments);return"#"+a(r[0])+a(r[1])+a(r[2])+(r[3]<1?a(Math.round(255*r[3])):"")},n.to.rgb=function(){var r=Rt(arguments);return r.length<4||1===r[3]?"rgb("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+")":"rgba("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+", "+r[3]+")"},n.to.rgb.percent=function(){var r=Rt(arguments),t=Math.round(r[0]/255*100),e=Math.round(r[1]/255*100),n=Math.round(r[2]/255*100);return r.length<4||1===r[3]?"rgb("+t+"%, "+e+"%, "+n+"%)":"rgba("+t+"%, "+e+"%, "+n+"%, "+r[3]+")"},n.to.hsl=function(){var r=Rt(arguments);return r.length<4||1===r[3]?"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)":"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+r[3]+")"},n.to.hwb=function(){var r=Rt(arguments),t="";return r.length<4||1===r[3]||(t=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+t+")"},n.to.keyword=function(r){return t[r.slice(0,3)]}}),Tt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},qt=s(function(r){var u={};for(var t in Tt)Tt.hasOwnProperty(t)&&(u[Tt[t]]=t);var i=r.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var e in i)if(i.hasOwnProperty(e)){if(!("channels"in i[e]))throw Error("missing channels property: "+e);if(!("labels"in i[e]))throw Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw Error("channel and label counts mismatch: "+e);var n=i[e].channels,a=i[e].labels;delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:n}),Object.defineProperty(i[e],"labels",{value:a})}i.rgb.hsl=function(r){var t,e,n=r[0]/255,a=r[1]/255,o=r[2]/255,i=Math.min(n,a,o),l=Math.max(n,a,o),u=l-i;return l===i?t=0:n===l?t=(a-o)/u:a===l?t=2+(o-n)/u:o===l&&(t=4+(n-a)/u),(t=Math.min(60*t,360))<0&&(t+=360),e=(i+l)/2,[t,100*(l===i?0:.5<e?u/(2-l-i):u/(l+i)),100*e]},i.rgb.hsv=function(r){var t,e,n,a,o,i=r[0]/255,l=r[1]/255,u=r[2]/255,s=Math.max(i,l,u),c=s-Math.min(i,l,u),h=function(r){return(s-r)/6/c+.5};return 0===c?a=o=0:(o=c/s,t=h(i),e=h(l),n=h(u),i===s?a=n-e:l===s?a=1/3+t-n:u===s&&(a=2/3+e-t),a<0?a+=1:1<a&&(a-=1)),[360*a,100*o,100*s]},i.rgb.hwb=function(r){var t=r[0],e=r[1],n=r[2];return[i.rgb.hsl(r)[0],100*(1/255*Math.min(t,Math.min(e,n))),100*(n=1-1/255*Math.max(t,Math.max(e,n)))]},i.rgb.cmyk=function(r){var t,e=r[0]/255,n=r[1]/255,a=r[2]/255;return[100*((1-e-(t=Math.min(1-e,1-n,1-a)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-a-t)/(1-t)||0),100*t]},i.rgb.keyword=function(r){var t=u[r];if(t)return t;var e,n,a,o=1/0;for(var i in Tt)if(Tt.hasOwnProperty(i)){var l=Math.pow((n=r)[0]-(a=Tt[i])[0],2)+Math.pow(n[1]-a[1],2)+Math.pow(n[2]-a[2],2);l<o&&(o=l,e=i)}return e},i.keyword.rgb=function(r){return Tt[r]},i.rgb.xyz=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255;return[100*(.4124*(t=.04045<t?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(e=.04045<e?Math.pow((e+.055)/1.055,2.4):e/12.92)+.1805*(n=.04045<n?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*e+.0722*n),100*(.0193*t+.1192*e+.9505*n)]},i.rgb.lab=function(r){var t=i.rgb.xyz(r),e=t[0],n=t[1],a=t[2];return n/=100,a/=108.883,e=.008856<(e/=95.047)?Math.pow(e,1/3):7.787*e+16/116,[116*(n=.008856<n?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(a=.008856<a?Math.pow(a,1/3):7.787*a+16/116))]},i.hsl.rgb=function(r){var t,e,n,a,o,i=r[0]/360,l=r[1]/100,u=r[2]/100;if(0===l)return[o=255*u,o,o];t=2*u-(e=u<.5?u*(1+l):u+l-u*l),a=[0,0,0];for(var s=0;s<3;s++)(n=i+1/3*-(s-1))<0&&n++,1<n&&n--,a[s]=255*(o=6*n<1?t+6*(e-t)*n:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t);return a},i.hsl.hsv=function(r){var t=r[0],e=r[1]/100,n=r[2]/100,a=e,o=Math.max(n,.01);return e*=1<(n*=2)?2-n:n,a*=1<o?2-o:o,[t,100*(0===n?2*a/(o+a):2*e/(n+e)),100*((n+e)/2)]},i.hsv.rgb=function(r){var t=r[0]/60,e=r[1]/100,n=r[2]/100,a=Math.floor(t)%6,o=t-Math.floor(t),i=255*n*(1-e),l=255*n*(1-e*o),u=255*n*(1-e*(1-o));switch(n*=255,a){case 0:return[n,u,i];case 1:return[l,n,i];case 2:return[i,n,u];case 3:return[i,l,n];case 4:return[u,i,n];case 5:return[n,i,l]}},i.hsv.hsl=function(r){var t,e,n,a=r[0],o=r[1]/100,i=r[2]/100,l=Math.max(i,.01);return n=(2-o)*i,e=o*l,[a,100*(e=(e/=1<(t=(2-o)*l)?2-t:t)||0),100*(n/=2)]},i.hwb.rgb=function(r){var t,e,n,a,o,i,l,u=r[0]/360,s=r[1]/100,c=r[2]/100,h=s+c;switch(1<h&&(s/=h,c/=h),n=6*u-(t=Math.floor(6*u)),0!=(1&t)&&(n=1-n),a=s+n*((e=1-c)-s),t){default:case 6:case 0:o=e,i=a,l=s;break;case 1:o=a,i=e,l=s;break;case 2:o=s,i=e,l=a;break;case 3:o=s,i=a,l=e;break;case 4:o=a,i=s,l=e;break;case 5:o=e,i=s,l=a}return[255*o,255*i,255*l]},i.cmyk.rgb=function(r){var t=r[1]/100,e=r[2]/100,n=r[3]/100;return[255*(1-Math.min(1,r[0]/100*(1-n)+n)),255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,e*(1-n)+n))]},i.xyz.rgb=function(r){var t,e,n,a=r[0]/100,o=r[1]/100,i=r[2]/100;return e=-.9689*a+1.8758*o+.0415*i,n=.0557*a+-.204*o+1.057*i,t=.0031308<(t=3.2406*a+-1.5372*o+-.4986*i)?1.055*Math.pow(t,1/2.4)-.055:12.92*t,e=.0031308<e?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=.0031308<n?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1))]},i.xyz.lab=function(r){var t=r[0],e=r[1],n=r[2];return e/=100,n/=108.883,t=.008856<(t/=95.047)?Math.pow(t,1/3):7.787*t+16/116,[116*(e=.008856<e?Math.pow(e,1/3):7.787*e+16/116)-16,500*(t-e),200*(e-(n=.008856<n?Math.pow(n,1/3):7.787*n+16/116))]},i.lab.xyz=function(r){var t,e,n;t=r[1]/500+(e=(r[0]+16)/116),n=e-r[2]/200;var a=Math.pow(e,3),o=Math.pow(t,3),i=Math.pow(n,3);return e=.008856<a?a:(e-16/116)/7.787,t=.008856<o?o:(t-16/116)/7.787,n=.008856<i?i:(n-16/116)/7.787,[t*=95.047,e*=100,n*=108.883]},i.lab.lch=function(r){var t,e=r[0],n=r[1],a=r[2];return(t=360*Math.atan2(a,n)/2/Math.PI)<0&&(t+=360),[e,Math.sqrt(n*n+a*a),t]},i.lch.lab=function(r){var t,e=r[1];return[r[0],e*Math.cos(t=r[2]/360*2*Math.PI),e*Math.sin(t)]},i.rgb.ansi16=function(r){var t=r[0],e=r[1],n=r[2],a=1 in arguments?arguments[1]:i.rgb.hsv(r)[2];if(0===(a=Math.round(a/50)))return 30;var o=30+(Math.round(n/255)<<2|Math.round(e/255)<<1|Math.round(t/255));return 2===a&&(o+=60),o},i.hsv.ansi16=function(r){return i.rgb.ansi16(i.hsv.rgb(r),r[2])},i.rgb.ansi256=function(r){var t=r[0],e=r[1],n=r[2];return t===e&&e===n?t<8?16:248<t?231:232+Math.round((t-8)/247*24):16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(n/255*5)},i.ansi16.rgb=function(r){var t=r%10;if(0===t||7===t)return 50<r&&(t+=3.5),[t=t/10.5*255,t,t];var e=.5*(1+~~(50<r));return[(1&t)*e*255,(t>>1&1)*e*255,(t>>2&1)*e*255]},i.ansi256.rgb=function(r){if(r<232)return[Math.floor((r-=16)/36)/5*255,Math.floor((t=r%36)/6)/5*255,t%6/5*255];var t,e=10*(r-232)+8;return[e,e,e]},i.rgb.hex=function(r){var t=(((255&Math.round(r[0]))<<16)+((255&Math.round(r[1]))<<8)+(255&Math.round(r[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},i.hex.rgb=function(r){var t=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var e=t[0];3===t[0].length&&(e=e.split("").map(function(r){return r+r}).join(""));var n=parseInt(e,16);return[n>>16&255,n>>8&255,255&n]},i.rgb.hcg=function(r){var t,e=r[0]/255,n=r[1]/255,a=r[2]/255,o=Math.max(Math.max(e,n),a),i=Math.min(Math.min(e,n),a),l=o-i;return t=0<l?o===e?(n-a)/l%6:o===n?2+(a-e)/l:4+(e-n)/l+4:0,t/=6,[360*(t%=1),100*l,100*(l<1?i/(1-l):0)]},i.hsl.hcg=function(r){var t=r[1]/100,e=r[2]/100,n=1,a=0;return(n=e<.5?2*t*e:2*t*(1-e))<1&&(a=(e-.5*n)/(1-n)),[r[0],100*n,100*a]},i.hsv.hcg=function(r){var t=r[2]/100,e=r[1]/100*t,n=0;return e<1&&(n=(t-e)/(1-e)),[r[0],100*e,100*n]},i.hcg.rgb=function(r){var t=r[1]/100,e=r[2]/100;if(0===t)return[255*e,255*e,255*e];var n,a=[0,0,0],o=r[0]/360%1*6,i=o%1,l=1-i;switch(Math.floor(o)){case 0:a[0]=1,a[1]=i,a[2]=0;break;case 1:a[0]=l,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=i;break;case 3:a[0]=0,a[1]=l,a[2]=1;break;case 4:a[0]=i,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=l}return[255*(t*a[0]+(n=(1-t)*e)),255*(t*a[1]+n),255*(t*a[2]+n)]},i.hcg.hsv=function(r){var t=r[1]/100,e=t+r[2]/100*(1-t),n=0;return 0<e&&(n=t/e),[r[0],100*n,100*e]},i.hcg.hsl=function(r){var t=r[1]/100,e=r[2]/100*(1-t)+.5*t,n=0;return 0<e&&e<.5?n=t/(2*e):.5<=e&&e<1&&(n=t/(2*(1-e))),[r[0],100*n,100*e]},i.hcg.hwb=function(r){var t=r[1]/100,e=t+r[2]/100*(1-t);return[r[0],100*(e-t),100*(1-e)]},i.hwb.hcg=function(r){var t=1-r[2]/100,e=t-r[1]/100,n=0;return e<1&&(n=(t-e)/(1-e)),[r[0],100*e,100*n]},i.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]},i.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]},i.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]},i.gray.hsl=i.gray.hsv=function(r){return[0,0,r[0]]},i.gray.hwb=function(r){return[0,100,r[0]]},i.gray.cmyk=function(r){return[0,0,0,r[0]]},i.gray.lab=function(r){return[r[0],0,0]},i.gray.hex=function(r){var t=255&Math.round(r[0]/100*255),e=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(e.length)+e},i.rgb.gray=function(r){return[(r[0]+r[1]+r[2])/3/255*100]}});function Ct(r){var t=function(){for(var r={},t=Object.keys(qt),e=t.length,n=0;n<e;n++)r[t[n]]={distance:-1,parent:null};return r}(),e=[r];for(t[r].distance=0;e.length;)for(var n=e.pop(),a=Object.keys(qt[n]),o=a.length,i=0;i<o;i++){var l=a[i],u=t[l];-1===u.distance&&(u.distance=t[n].distance+1,u.parent=n,e.unshift(l))}return t}function zt(t,e){return function(r){return e(t(r))}}function Ut(r,t){for(var e=[t[r].parent,r],n=qt[t[r].parent][r],a=t[r].parent;t[a].parent;)e.unshift(t[a].parent),n=zt(qt[t[a].parent][a],n),a=t[a].parent;return n.conversion=e,n}var $t={};Object.keys(qt).forEach(function(i){$t[i]={},Object.defineProperty($t[i],"channels",{value:qt[i].channels}),Object.defineProperty($t[i],"labels",{value:qt[i].labels});var l=function(r){for(var t=Ct(r),e={},n=Object.keys(t),a=n.length,o=0;o<a;o++){var i=n[o];null!==t[i].parent&&(e[i]=Ut(i,t))}return e}(i);Object.keys(l).forEach(function(r){var a,t,e,n,o=l[r];$t[i][r]=(t=function(r){if(null==r)return r;1<arguments.length&&(r=Array.prototype.slice.call(arguments));var t=a(r);if("object"==typeof t)for(var e=t.length,n=0;n<e;n++)t[n]=Math.round(t[n]);return t},"conversion"in(a=o)&&(t.conversion=a.conversion),t),$t[i][r].raw=(n=function(r){return null==r?r:(1<arguments.length&&(r=Array.prototype.slice.call(arguments)),e(r))},"conversion"in(e=o)&&(n.conversion=e.conversion),n)})});var Dt=$t,Wt=[].slice,Bt=["keyword","gray","hex"],Qt={};Object.keys(Dt).forEach(function(r){Qt[Wt.call(Dt[r].labels).sort().join("")]=r});var Jt={};function Kt(r,t){if(!(this instanceof Kt))return new Kt(r,t);if(t&&t in Bt&&(t=null),t&&!(t in Dt))throw Error("Unknown model: "+t);var e,n;if(r)if(r instanceof Kt)this.model=r.model,this.color=r.color.slice(),this.valpha=r.valpha;else if("string"==typeof r){var a=Gt.get(r);if(null===a)throw Error("Unable to parse color from string: "+r);this.model=a.model,this.color=a.value.slice(0,n=Dt[this.model].channels),this.valpha="number"==typeof a.value[n]?a.value[n]:1}else if(r.length){this.model=t||"rgb";var o=Wt.call(r,0,n=Dt[this.model].channels);this.color=Ht(o,n),this.valpha="number"==typeof r[n]?r[n]:1}else if("number"==typeof r)r&=16777215,this.model="rgb",this.color=[r>>16&255,r>>8&255,255&r],this.valpha=1;else{this.valpha=1;var i=Object.keys(r);"alpha"in r&&(i.splice(i.indexOf("alpha"),1),this.valpha="number"==typeof r.alpha?r.alpha:0);var l=i.sort().join("");if(!(l in Qt))throw Error("Unable to parse color from object: "+JSON.stringify(r));this.model=Qt[l];var u=Dt[this.model].labels,s=[];for(e=0;e<u.length;e++)s.push(r[u[e]]);this.color=Ht(s)}else this.model="rgb",this.color=[0,0,0],this.valpha=1;if(Jt[this.model])for(n=Dt[this.model].channels,e=0;e<n;e++){var c=Jt[this.model][e];c&&(this.color[e]=c(this.color[e]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function Vt(e,n,a){return(e=Array.isArray(e)?e:[e]).forEach(function(r){(Jt[r]||(Jt[r]=[]))[n]=a}),e=e[0],function(r){var t;return arguments.length?(a&&(r=a(r)),(t=this[e]()).color[n]=r):(t=this[e]().color[n],a&&(t=a(t))),t}}function Yt(t){return function(r){return Math.max(0,Math.min(t,r))}}function Ht(r,t){for(var e=0;e<t;e++)"number"!=typeof r[e]&&(r[e]=0);return r}Kt.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(r){var t=this.model in Gt.to?this:this.rgb(),e=1===(t=t.round("number"==typeof r?r:1)).valpha?t.color:t.color.concat(this.valpha);return Gt.to[t.model](e)},percentString:function(r){var t=this.rgb().round("number"==typeof r?r:1),e=1===t.valpha?t.color:t.color.concat(this.valpha);return Gt.to.rgb.percent(e)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var r={},t=Dt[this.model].channels,e=Dt[this.model].labels,n=0;n<t;n++)r[e[n]]=this.color[n];return 1!==this.valpha&&(r.alpha=this.valpha),r},unitArray:function(){var r=this.rgb().color;return r[0]/=255,r[1]/=255,r[2]/=255,1!==this.valpha&&r.push(this.valpha),r},unitObject:function(){var r=this.rgb().object();return r.r/=255,r.g/=255,r.b/=255,1!==this.valpha&&(r.alpha=this.valpha),r},round:function(r){return new Kt(this.color.map((t=r=Math.max(r||0,0),function(r){return+r.toFixed(t)})).concat(this.valpha),this.model);var t},alpha:function(r){return arguments.length?new Kt(this.color.concat(Math.max(0,Math.min(1,r))),this.model):this.valpha},red:Vt("rgb",0,Yt(255)),green:Vt("rgb",1,Yt(255)),blue:Vt("rgb",2,Yt(255)),hue:Vt(["hsl","hsv","hsl","hwb","hcg"],0,function(r){return(r%360+360)%360}),saturationl:Vt("hsl",1,Yt(100)),lightness:Vt("hsl",2,Yt(100)),saturationv:Vt("hsv",1,Yt(100)),value:Vt("hsv",2,Yt(100)),chroma:Vt("hcg",1,Yt(100)),gray:Vt("hcg",2,Yt(100)),white:Vt("hwb",1,Yt(100)),wblack:Vt("hwb",2,Yt(100)),cyan:Vt("cmyk",0,Yt(100)),magenta:Vt("cmyk",1,Yt(100)),yellow:Vt("cmyk",2,Yt(100)),black:Vt("cmyk",3,Yt(100)),x:Vt("xyz",0,Yt(100)),y:Vt("xyz",1,Yt(100)),z:Vt("xyz",2,Yt(100)),l:Vt("lab",0,Yt(100)),a:Vt("lab",1),b:Vt("lab",2),keyword:function(r){return arguments.length?new Kt(r):Dt[this.model].keyword(this.color)},hex:function(r){return arguments.length?new Kt(r):Gt.to.hex(this.rgb().round().color)},rgbNumber:function(){var r=this.rgb().color;return(255&r[0])<<16|(255&r[1])<<8|255&r[2]},luminosity:function(){for(var r=this.rgb().color,t=[],e=0;e<r.length;e++){var n=r[e]/255;t[e]=.03928<n?Math.pow((n+.055)/1.055,2.4):n/12.92}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(r){var t=this.luminosity(),e=r.luminosity();return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)},level:function(r){var t=this.contrast(r);return t<7.1?t<4.5?"":"AA":"AAA"},isDark:function(){var r=this.rgb().color;return(299*r[0]+587*r[1]+114*r[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var r=this.rgb(),t=0;t<3;t++)r.color[t]=255-r.color[t];return r},lighten:function(r){var t=this.hsl();return t.color[2]+=t.color[2]*r,t},darken:function(r){var t=this.hsl();return t.color[2]-=t.color[2]*r,t},saturate:function(r){var t=this.hsl();return t.color[1]+=t.color[1]*r,t},desaturate:function(r){var t=this.hsl();return t.color[1]-=t.color[1]*r,t},whiten:function(r){var t=this.hwb();return t.color[1]+=t.color[1]*r,t},blacken:function(r){var t=this.hwb();return t.color[2]+=t.color[2]*r,t},grayscale:function(){var r=this.rgb().color,t=.3*r[0]+.59*r[1]+.11*r[2];return Kt.rgb(t,t,t)},fade:function(r){return this.alpha(this.valpha-this.valpha*r)},opaquer:function(r){return this.alpha(this.valpha+this.valpha*r)},rotate:function(r){var t=this.hsl(),e=t.color[0];return t.color[0]=e=(e=(e+r)%360)<0?360+e:e,t},mix:function(r,t){var e=r.rgb(),n=this.rgb(),a=void 0===t?.5:t,o=2*a-1,i=e.alpha()-n.alpha(),l=((o*i==-1?o:(o+i)/(1+o*i))+1)/2,u=1-l;return Kt.rgb(l*e.red()+u*n.red(),l*e.green()+u*n.green(),l*e.blue()+u*n.blue(),e.alpha()*a+n.alpha()*(1-a))}},Object.keys(Dt).forEach(function(e){if(-1==Bt.indexOf(e)){var n=Dt[e].channels;Kt.prototype[e]=function(){if(this.model===e)return new Kt(this);if(arguments.length)return new Kt(arguments,e);var r,t="number"==typeof arguments[n]?n:this.valpha;return new Kt((r=Dt[this.model][e].raw(this.color),Array.isArray(r)?r:[r]).concat(t),e)},Kt[e]=function(r){return"number"==typeof r&&(r=Ht(Wt.call(arguments),n)),new Kt(r,e)}}});var Xt=Kt,Zt={table:{display:"flex","flex-wrap":"wrap",margin:"0.2em 0.2em 0.2em 0.2em",padding:0,"flex-direction":"column",width:"20em"},cell:{"box-sizing":"border-box","flex-grow":1,width:"100%",overflow:"hidden",padding:"0.2em 0.2em",border:"solid 2px "+Xt("slategrey").fade(.5),"border-bottom":"none","background-color":"#f7f7f7",display:"flex","align-items":"center","justify-content":"center","&:last-child":{"border-bottom":"solid 2px "+Xt("slategrey").fade(.5)+" !important"}},"image-container":{height:"15em"},image:{width:"100%",height:"100%"}},re=function(e){function r(t){var r;return(r=e.call(this,t)||this).state={isLoading:!1,imageUrl:null,error:null},r.componentManager=new a.ComponentManager(u(u(r)),{namespace:"io.github.t83714/RandomGif",reducer:b,saga:Ft(L,t.apiKey),actionTypes:y,allowedIncomingMulticastActionTypes:[h],namespaceInitCallback:function(r){return{styleSheet:(t.styles?o:o.setup(i())).createStyleSheet(t.styles?t.styles:Zt,{generateClassName:r.createClassNameGenerator()}).attach()}},namespaceDestroyCallback:function(r){r.styleSheet.detach()}}),r}return l(r,e),r.prototype.render=function(){var r=this,t=this.componentManager.getNamespaceData().styleSheet.classes;return n.createElement("div",{className:t.table},n.createElement("div",{className:t.cell},"RandomGif"),n.createElement("div",{className:t.cell+" "+t["image-container"]},this.state.imageUrl&&!this.state.isLoading&&!this.state.error&&n.createElement("img",{alt:"Gif",src:this.state.imageUrl,className:""+t.image}),(!this.state.imageUrl||this.state.isLoading)&&!this.state.error&&n.createElement("p",null,this.state.isLoading?"Requesting API...":"No GIF loaded yet!"),this.state.error&&n.createElement("p",null,"Failed to request API: "+this.state.error)),this.props.showButton&&n.createElement("div",{className:t.cell+" "},n.createElement("button",{onClick:function(){r.componentManager.dispatch(O())},disabled:this.state.isLoading},this.state.isLoading?"Requesting API...":"Get Gif")))},r}(n.Component);re.propTypes={showButton:t.bool,apiKey:t.string,styles:t.object,appContainer:t.instanceOf(a.AppContainer)},re.defaultProps={showButton:!0,apiKey:"Y4P38sTJAgEBOHP1B3sVs0Jtk01tb6fA"},re.contextType=a.AppContainerContext;var te={NEW_GIF:d,LOADING_START:v,LOADING_COMPLETE:g,REQUEST_NEW_GIF:h},ee={requestNewGif:O};r.default=re,r.actionTypes=te,r.actions=ee,Object.defineProperty(r,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=random-gif.min.umd.js.map |
{ | ||
"name": "@fractal-components/random-gif", | ||
"version": "1.0.7", | ||
"version": "1.1.0", | ||
"private": false, | ||
@@ -15,6 +15,7 @@ "description": "A sample UI component built using `fractal-component`", | ||
"prettier": "prettier --write 'src/*.js' 'src/*.ts'", | ||
"eslint": "eslint 'src/*.js'", | ||
"eslint": "eslint src/", | ||
"dtslint": "dtslint src --onlyTestTsNext", | ||
"clean": "rimraf dist", | ||
"prebuild": "npm run clean", | ||
"build": "rollup -c", | ||
"build": "rollup -c -m", | ||
"prepare": "npm run build", | ||
@@ -47,46 +48,44 @@ "release:patch": "npm version patch && npm publish && git push --follow-tags", | ||
"dependencies": { | ||
"@babel/runtime": "^7.0.0-rc.3", | ||
"@babel/runtime": "^7.0.0", | ||
"color": "^3.0.0", | ||
"fractal-component": ">=3.2.2", | ||
"fractal-component": "^4.0.0", | ||
"jss": "^9.8.7", | ||
"jss-preset-default": "^4.5.0", | ||
"prop-types": ">= 15.5.7", | ||
"react": ">= 15.0.0", | ||
"redux-saga": "^1.0.0-beta.2" | ||
"prop-types": "~15.6.0", | ||
"react": "~16.8.0", | ||
"redux-saga": "~1.0.0" | ||
}, | ||
"peerDependencies": { | ||
"fractal-component": ">=3.2.2", | ||
"fractal-component": "^4.0.0", | ||
"jss": "^9.8.7", | ||
"jss-preset-default": "^4.5.0", | ||
"prop-types": ">= 15.5.7", | ||
"react": ">= 15.0.0", | ||
"redux-saga": "^1.0.0-beta.2" | ||
"prop-types": "~15.6.0", | ||
"react": "~16.8.0", | ||
"redux-saga": "~1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0-rc.3", | ||
"@babel/core": "^7.0.0-rc.3", | ||
"@babel/node": "^7.0.0-rc.3", | ||
"@babel/plugin-transform-runtime": "^7.0.0-rc.3", | ||
"@babel/polyfill": "^7.0.0-rc.3", | ||
"@babel/preset-env": "^7.0.0-rc.3", | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.0.0", | ||
"@babel/node": "^7.0.0", | ||
"@babel/plugin-transform-runtime": "^7.0.0", | ||
"@babel/polyfill": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"@babel/preset-stage-2": "^7.0.0-rc.3", | ||
"babel-core": "^7.0.0-0", | ||
"babel-eslint": "^8.2.6", | ||
"babel-jest": "^23.4.2", | ||
"babel-plugin-annotate-pure-calls": "babel7", | ||
"eslint": "^5.2.0", | ||
"eslint-plugin-jest": "^21.22.0", | ||
"eslint-plugin-react": "^7.11.1", | ||
"jest": "^23.5.0", | ||
"prettier": "^1.13.7", | ||
"@babel/preset-stage-2": "^7.0.0", | ||
"babel-eslint": "^10.0.0", | ||
"babel-plugin-annotate-pure-calls": "^0.4.0", | ||
"eslint": "^5.13.0", | ||
"eslint-plugin-jest": "^22.2.0", | ||
"eslint-plugin-react": "^7.12.0", | ||
"jest": "^24.0.0", | ||
"prettier": "^1.16.0", | ||
"rimraf": "^2.6.2", | ||
"rollup": "^0.64.1", | ||
"rollup-plugin-babel": "4.0.0-beta.1", | ||
"rollup-plugin-commonjs": "^9.1.5", | ||
"rollup-plugin-json": "^3.0.0", | ||
"rollup": "^1.1.2", | ||
"rollup-plugin-babel": "^4.3.0", | ||
"rollup-plugin-commonjs": "^9.2.0", | ||
"rollup-plugin-json": "^3.1.0", | ||
"rollup-plugin-node-builtins": "^2.1.2", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"rollup-plugin-replace": "^2.0.0", | ||
"rollup-plugin-uglify": "^4.0.0" | ||
"rollup-plugin-node-resolve": "^4.0.0", | ||
"rollup-plugin-replace": "^2.1.0", | ||
"rollup-plugin-uglify": "^6.0.0" | ||
}, | ||
@@ -93,0 +92,0 @@ "typings": "./src/index.d.ts", |
@@ -15,32 +15,37 @@ # A Sample RandomGif UI Component | ||
```html | ||
<!doctype html> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>RandomGif Demo</title> | ||
<!-- | ||
Load `babel-standalone` to support JSX in script tag | ||
--> | ||
<script src="https://unpkg.com/babel-standalone@7.0.0-beta.3/babel.min.js"></script> | ||
<script src="https://unpkg.com/react@16.5.0/umd/react.production.min.js"></script> | ||
<script src="https://unpkg.com/prop-types@15.6.2/prop-types.min.js"></script> | ||
<script src="https://unpkg.com/react-dom@16.5.0/umd/react-dom.production.min.js"></script> | ||
<script src="https://unpkg.com/redux-saga@1.0.0-beta.2/dist/redux-saga.min.umd.js"></script> | ||
<script src="https://unpkg.com/fractal-component@latest/dist/fractal-component.min.umd.js"></script> | ||
<script src="https://unpkg.com/jss@9.8.7/dist/jss.min.js"></script> | ||
<script src="https://unpkg.com/jss-preset-default@4.5.0/dist/jss-preset-default.min.js"></script> | ||
<script src="https://unpkg.com/@fractal-components/random-gif@latest/dist/@fractal-components/random-gif.umd.js"></script> | ||
</head> | ||
<body> | ||
<div id="app_root"></div> | ||
<script type="text/babel"> | ||
FractalComponent.AppContainerUtils.createAppContainer({ | ||
//--- make dev tool always available | ||
reduxDevToolsDevOnly: false | ||
}); | ||
ReactDOM.render(<RandomGif.default />, document.getElementById("app_root")); | ||
</script> | ||
</body> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Counter Demo</title> | ||
<!-- | ||
Load `babel-standalone` to support JSX in script tag | ||
--> | ||
<script src="https://unpkg.com/babel-standalone@^7.0.0/babel.min.js"></script> | ||
<script src="https://unpkg.com/react@~16.8.0/umd/react.production.min.js"></script> | ||
<script src="https://unpkg.com/prop-types@~15.6.2/prop-types.min.js"></script> | ||
<script src="https://unpkg.com/react-dom@~16.8.0/umd/react-dom.production.min.js"></script> | ||
<script src="https://unpkg.com/redux-saga@~1.0.0/dist/redux-saga.min.umd.js"></script> | ||
<script src="https://unpkg.com/fractal-component@latest/dist/fractal-component.min.umd.js"></script> | ||
<script src="https://unpkg.com/jss@9.8.7/dist/jss.min.js"></script> | ||
<script src="https://unpkg.com/jss-preset-default@4.5.0/dist/jss-preset-default.min.js"></script> | ||
<script src="https://unpkg.com/@fractal-components/random-gif@latest/dist/@fractal-components/random-gif.umd.js"></script> | ||
</head> | ||
<body> | ||
<div id="app_root"></div> | ||
<script type="text/babel"> | ||
const appContainer = new FractalComponent.AppContainer({ | ||
reduxDevToolsDevOnly: false | ||
}); | ||
ReactDOM.render( | ||
<FractalComponent.AppContainerContext.Provider | ||
value={appContainer} | ||
> | ||
<RandomGif.default /> | ||
</FractalComponent.AppContainerContext.Provider>, | ||
document.getElementById("app_root") | ||
); | ||
</script> | ||
</body> | ||
</html> | ||
@@ -56,10 +61,15 @@ ``` | ||
import { AppContainerUtils } from "fractal-component"; | ||
import RandomGif, { actions, actionTypes} from "@fractal-components/random-gif"; | ||
import { AppContainer, AppContainerContext } from "fractal-component"; | ||
import RandomGif, { actions, actionTypes } from "@fractal-components/random-gif"; | ||
AppContainerUtils.createAppContainer({ | ||
const appContainer = new AppContainer({ | ||
reduxDevToolsDevOnly: false | ||
}); | ||
ReactDOM.render(<RandomGif />, document.getElementById("root")); | ||
ReactDOM.render( | ||
<AppContainerContext.Provider value={appContainer}> | ||
<RandomGif /> | ||
</AppContainerContext.Provider>, | ||
document.getElementById("root") | ||
); | ||
``` | ||
@@ -66,0 +76,0 @@ |
@@ -1,13 +0,13 @@ | ||
import React from "react"; | ||
import * as React from "react"; | ||
import { Action } from "redux"; | ||
declare class RandomGif extends React.Component {} | ||
export default RandomGif; | ||
export declare interface actionTypes { | ||
NEW_GIF: Symbol; | ||
LOADING_START: Symbol; | ||
LOADING_COMPLETE: Symbol; | ||
REQUEST_NEW_GIF: Symbol; | ||
export interface actionTypes { | ||
NEW_GIF: symbol; | ||
LOADING_START: symbol; | ||
LOADING_COMPLETE: symbol; | ||
REQUEST_NEW_GIF: symbol; | ||
} | ||
export declare interface actions { | ||
export interface actions { | ||
requestNewGif: () => Action; | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1129290
24
11
9032
100
- Removedprop-types@15.8.1(transitive)
- Removedreact@18.3.1(transitive)
- Removedreact-is@16.13.1(transitive)
Updated@babel/runtime@^7.0.0
Updatedfractal-component@^4.0.0
Updatedprop-types@~15.6.0
Updatedreact@~16.8.0
Updatedredux-saga@~1.0.0