UNPKG

colorjs.io

Version:

Let’s get serious about color

1 lines 111 kB
var e,r,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n={};function o(){if(r)return e;r=1;var n=function(e){return e&&e.Math===Math&&e};return e=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}var a,i,u,s,c,l,f,h,p={};function d(){return i?a:(i=1,a=function(e){try{return!!e()}catch(e){return!0}})}function m(){if(s)return u;s=1;var e=d();return u=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function g(){if(l)return c;l=1;var e=d();return c=!e((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))}function v(){if(h)return f;h=1;var e=g(),r=Function.prototype.call;return f=e?r.bind(r):function(){return r.apply(r,arguments)},f}var b,y,w,M,R,S,C,E,B,O,_,j,k,I,x,P,L,T,A,z,H,D,G,$,q,W,N,F,X,Y,Z,J,U,K,V,Q,ee,re,te,ne,oe,ae={};function ie(){return w?y:(w=1,y=function(e,r){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:r}})}function ue(){if(R)return M;R=1;var e=g(),r=Function.prototype,t=r.call,n=e&&r.bind.bind(t,t);return M=e?n:function(e){return function(){return t.apply(e,arguments)}},M}function se(){if(C)return S;C=1;var e=ue(),r=e({}.toString),t=e("".slice);return S=function(e){return t(r(e),8,-1)}}function ce(){return _?O:(_=1,O=function(e){return null==e})}function le(){if(k)return j;k=1;var e=ce(),r=TypeError;return j=function(t){if(e(t))throw new r("Can't call method on "+t);return t}}function fe(){if(x)return I;x=1;var e=function(){if(B)return E;B=1;var e=ue(),r=d(),t=se(),n=Object,o=e("".split);return E=r((function(){return!n("z").propertyIsEnumerable(0)}))?function(e){return"String"===t(e)?o(e,""):n(e)}:n}(),r=le();return I=function(t){return e(r(t))}}function he(){if(L)return P;L=1;var e="object"==typeof document&&document.all;return P=void 0===e&&void 0!==e?function(r){return"function"==typeof r||r===e}:function(e){return"function"==typeof e}}function pe(){if(A)return T;A=1;var e=he();return T=function(r){return"object"==typeof r?null!==r:e(r)}}function de(){if(H)return z;H=1;var e=o(),r=he();return z=function(t,n){return arguments.length<2?(o=e[t],r(o)?o:void 0):e[t]&&e[t][n];var o},z}function me(){if(G)return D;G=1;var e=ue();return D=e({}.isPrototypeOf)}function ge(){if(N)return W;N=1;var e,r,t=o(),n=function(){if(q)return $;q=1;var e=o().navigator,r=e&&e.userAgent;return $=r?String(r):""}(),a=t.process,i=t.Deno,u=a&&a.versions||i&&i.version,s=u&&u.v8;return s&&(r=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!r&&n&&(!(e=n.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=n.match(/Chrome\/(\d+)/))&&(r=+e[1]),W=r}function ve(){if(X)return F;X=1;var e=ge(),r=d(),t=o().String;return F=!!Object.getOwnPropertySymbols&&!r((function(){var r=Symbol("symbol detection");return!t(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&e&&e<41}))}function be(){if(Z)return Y;Z=1;var e=ve();return Y=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function ye(){if(U)return J;U=1;var e=de(),r=he(),t=me(),n=be(),o=Object;return J=n?function(e){return"symbol"==typeof e}:function(n){var a=e("Symbol");return r(a)&&t(a.prototype,o(n))}}function we(){if(V)return K;V=1;var e=String;return K=function(r){try{return e(r)}catch(e){return"Object"}}}function Me(){if(ee)return Q;ee=1;var e=he(),r=we(),t=TypeError;return Q=function(n){if(e(n))return n;throw new t(r(n)+" is not a function")}}function Re(){if(te)return re;te=1;var e=Me(),r=ce();return re=function(t,n){var o=t[n];return r(o)?void 0:e(o)}}function Se(){if(oe)return ne;oe=1;var e=v(),r=he(),t=pe(),n=TypeError;return ne=function(o,a){var i,u;if("string"===a&&r(i=o.toString)&&!t(u=e(i,o)))return u;if(r(i=o.valueOf)&&!t(u=e(i,o)))return u;if("string"!==a&&r(i=o.toString)&&!t(u=e(i,o)))return u;throw new n("Can't convert object to primitive value")}}var Ce,Ee,Be,Oe,_e,je,ke,Ie,xe,Pe,Le,Te,Ae,ze,He,De,Ge,$e,qe,We,Ne,Fe,Xe,Ye,Ze={exports:{}};function Je(){return Ee?Ce:(Ee=1,Ce=!1)}function Ue(){if(Oe)return Be;Oe=1;var e=o(),r=Object.defineProperty;return Be=function(t,n){try{r(e,t,{value:n,configurable:!0,writable:!0})}catch(r){e[t]=n}return n}}function Ke(){if(_e)return Ze.exports;_e=1;var e=Je(),r=o(),t=Ue(),n="__core-js_shared__",a=Ze.exports=r[n]||t(n,{});return(a.versions||(a.versions=[])).push({version:"3.39.0",mode:e?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"}),Ze.exports}function Ve(){if(ke)return je;ke=1;var e=Ke();return je=function(r,t){return e[r]||(e[r]=t||{})}}function Qe(){if(xe)return Ie;xe=1;var e=le(),r=Object;return Ie=function(t){return r(e(t))}}function er(){if(Le)return Pe;Le=1;var e=ue(),r=Qe(),t=e({}.hasOwnProperty);return Pe=Object.hasOwn||function(e,n){return t(r(e),n)}}function rr(){if(Ae)return Te;Ae=1;var e=ue(),r=0,t=Math.random(),n=e(1..toString);return Te=function(e){return"Symbol("+(void 0===e?"":e)+")_"+n(++r+t,36)}}function tr(){if(He)return ze;He=1;var e=o(),r=Ve(),t=er(),n=rr(),a=ve(),i=be(),u=e.Symbol,s=r("wks"),c=i?u.for||u:u&&u.withoutSetter||n;return ze=function(e){return t(s,e)||(s[e]=a&&t(u,e)?u[e]:c("Symbol."+e)),s[e]}}function nr(){if(Ge)return De;Ge=1;var e=v(),r=pe(),t=ye(),n=Re(),o=Se(),a=tr(),i=TypeError,u=a("toPrimitive");return De=function(a,s){if(!r(a)||t(a))return a;var c,l=n(a,u);if(l){if(void 0===s&&(s="default"),c=e(l,a,s),!r(c)||t(c))return c;throw new i("Can't convert object to primitive value")}return void 0===s&&(s="number"),o(a,s)}}function or(){if(qe)return $e;qe=1;var e=nr(),r=ye();return $e=function(t){var n=e(t,"string");return r(n)?n:n+""}}function ar(){if(Ne)return We;Ne=1;var e=o(),r=pe(),t=e.document,n=r(t)&&r(t.createElement);return We=function(e){return n?t.createElement(e):{}}}function ir(){if(Xe)return Fe;Xe=1;var e=m(),r=d(),t=ar();return Fe=!e&&!r((function(){return 7!==Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a}))}function ur(){if(Ye)return p;Ye=1;var e=m(),r=v(),t=function(){if(b)return ae;b=1;var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,t=r&&!e.call({1:2},1);return ae.f=t?function(e){var t=r(this,e);return!!t&&t.enumerable}:e,ae}(),n=ie(),o=fe(),a=or(),i=er(),u=ir(),s=Object.getOwnPropertyDescriptor;return p.f=e?s:function(e,c){if(e=o(e),c=a(c),u)try{return s(e,c)}catch(e){}if(i(e,c))return n(!r(t.f,e,c),e[c])},p}var sr,cr,lr,fr,hr,pr,dr,mr={};function gr(){if(cr)return sr;cr=1;var e=m(),r=d();return sr=e&&r((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}function vr(){if(fr)return lr;fr=1;var e=pe(),r=String,t=TypeError;return lr=function(n){if(e(n))return n;throw new t(r(n)+" is not an object")}}function br(){if(hr)return mr;hr=1;var e=m(),r=ir(),t=gr(),n=vr(),o=or(),a=TypeError,i=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s="enumerable",c="configurable",l="writable";return mr.f=e?t?function(e,r,t){if(n(e),r=o(r),n(t),"function"==typeof e&&"prototype"===r&&"value"in t&&l in t&&!t[l]){var a=u(e,r);a&&a[l]&&(e[r]=t.value,t={configurable:c in t?t[c]:a[c],enumerable:s in t?t[s]:a[s],writable:!1})}return i(e,r,t)}:i:function(e,t,u){if(n(e),t=o(t),n(u),r)try{return i(e,t,u)}catch(e){}if("get"in u||"set"in u)throw new a("Accessors not supported");return"value"in u&&(e[t]=u.value),e},mr}function yr(){if(dr)return pr;dr=1;var e=m(),r=br(),t=ie();return pr=e?function(e,n,o){return r.f(e,n,t(1,o))}:function(e,r,t){return e[r]=t,e}}var wr,Mr,Rr,Sr,Cr,Er,Br,Or,_r,jr,kr,Ir,xr,Pr,Lr,Tr={exports:{}};function Ar(){if(Sr)return Rr;Sr=1;var e=ue(),r=he(),t=Ke(),n=e(Function.toString);return r(t.inspectSource)||(t.inspectSource=function(e){return n(e)}),Rr=t.inspectSource}function zr(){if(Or)return Br;Or=1;var e=Ve(),r=rr(),t=e("keys");return Br=function(e){return t[e]||(t[e]=r(e))}}function Hr(){return jr?_r:(jr=1,_r={})}function Dr(){if(Ir)return kr;Ir=1;var e,r,t,n=function(){if(Er)return Cr;Er=1;var e=o(),r=he(),t=e.WeakMap;return Cr=r(t)&&/native code/.test(String(t))}(),a=o(),i=pe(),u=yr(),s=er(),c=Ke(),l=zr(),f=Hr(),h="Object already initialized",p=a.TypeError,d=a.WeakMap;if(n||c.state){var m=c.state||(c.state=new d);m.get=m.get,m.has=m.has,m.set=m.set,e=function(e,r){if(m.has(e))throw new p(h);return r.facade=e,m.set(e,r),r},r=function(e){return m.get(e)||{}},t=function(e){return m.has(e)}}else{var g=l("state");f[g]=!0,e=function(e,r){if(s(e,g))throw new p(h);return r.facade=e,u(e,g,r),r},r=function(e){return s(e,g)?e[g]:{}},t=function(e){return s(e,g)}}return kr={set:e,get:r,has:t,enforce:function(n){return t(n)?r(n):e(n,{})},getterFor:function(e){return function(t){var n;if(!i(t)||(n=r(t)).type!==e)throw new p("Incompatible receiver, "+e+" required");return n}}}}function Gr(){if(xr)return Tr.exports;xr=1;var e=ue(),r=d(),t=he(),n=er(),o=m(),a=function(){if(Mr)return wr;Mr=1;var e=m(),r=er(),t=Function.prototype,n=e&&Object.getOwnPropertyDescriptor,o=r(t,"name"),a=o&&"something"===function(){}.name,i=o&&(!e||e&&n(t,"name").configurable);return wr={EXISTS:o,PROPER:a,CONFIGURABLE:i}}().CONFIGURABLE,i=Ar(),u=Dr(),s=u.enforce,c=u.get,l=String,f=Object.defineProperty,h=e("".slice),p=e("".replace),g=e([].join),v=o&&!r((function(){return 8!==f((function(){}),"length",{value:8}).length})),b=String(String).split("String"),y=Tr.exports=function(e,r,t){"Symbol("===h(l(r),0,7)&&(r="["+p(l(r),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(r="get "+r),t&&t.setter&&(r="set "+r),(!n(e,"name")||a&&e.name!==r)&&(o?f(e,"name",{value:r,configurable:!0}):e.name=r),v&&t&&n(t,"arity")&&e.length!==t.arity&&f(e,"length",{value:t.arity});try{t&&n(t,"constructor")&&t.constructor?o&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=s(e);return n(i,"source")||(i.source=g(b,"string"==typeof r?r:"")),e};return Function.prototype.toString=y((function(){return t(this)&&c(this).source||i(this)}),"toString"),Tr.exports}function $r(){if(Lr)return Pr;Lr=1;var e=he(),r=br(),t=Gr(),n=Ue();return Pr=function(o,a,i,u){u||(u={});var s=u.enumerable,c=void 0!==u.name?u.name:a;if(e(i)&&t(i,c,u),u.global)s?o[a]=i:n(a,i);else{try{u.unsafe?o[a]&&(s=!0):delete o[a]}catch(e){}s?o[a]=i:r.f(o,a,{value:i,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return o}}var qr,Wr,Nr,Fr,Xr,Yr,Zr,Jr,Ur,Kr,Vr,Qr,et,rt,tt,nt,ot,at={};function it(){if(Fr)return Nr;Fr=1;var e=function(){if(Wr)return qr;Wr=1;var e=Math.ceil,r=Math.floor;return qr=Math.trunc||function(t){var n=+t;return(n>0?r:e)(n)},qr}();return Nr=function(r){var t=+r;return t!=t||0===t?0:e(t)}}function ut(){if(Yr)return Xr;Yr=1;var e=it(),r=Math.max,t=Math.min;return Xr=function(n,o){var a=e(n);return a<0?r(a+o,0):t(a,o)}}function st(){if(Jr)return Zr;Jr=1;var e=it(),r=Math.min;return Zr=function(t){var n=e(t);return n>0?r(n,9007199254740991):0}}function ct(){if(Kr)return Ur;Kr=1;var e=st();return Ur=function(r){return e(r.length)}}function lt(){if(rt)return et;rt=1;var e=ue(),r=er(),t=fe(),n=function(){if(Qr)return Vr;Qr=1;var e=fe(),r=ut(),t=ct(),n=function(n){return function(o,a,i){var u=e(o),s=t(u);if(0===s)return!n&&-1;var c,l=r(i,s);if(n&&a!=a){for(;s>l;)if((c=u[l++])!=c)return!0}else for(;s>l;l++)if((n||l in u)&&u[l]===a)return n||l||0;return!n&&-1}};return Vr={includes:n(!0),indexOf:n(!1)}}().indexOf,o=Hr(),a=e([].push);return et=function(e,i){var u,s=t(e),c=0,l=[];for(u in s)!r(o,u)&&r(s,u)&&a(l,u);for(;i.length>c;)r(s,u=i[c++])&&(~n(l,u)||a(l,u));return l}}function ft(){return nt?tt:(nt=1,tt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var ht,pt,dt,mt,gt,vt,bt,yt,wt,Mt,Rt,St,Ct,Et,Bt,Ot,_t,jt,kt,It,xt,Pt,Lt,Tt,At,zt,Ht,Dt,Gt,$t,qt,Wt,Nt,Ft,Xt,Yt,Zt,Jt,Ut,Kt,Vt,Qt,en={};function rn(){if(dt)return pt;dt=1;var e=de(),r=ue(),t=function(){if(ot)return at;ot=1;var e=lt(),r=ft().concat("length","prototype");return at.f=Object.getOwnPropertyNames||function(t){return e(t,r)},at}(),n=(ht||(ht=1,en.f=Object.getOwnPropertySymbols),en),o=vr(),a=r([].concat);return pt=e("Reflect","ownKeys")||function(e){var r=t.f(o(e)),i=n.f;return i?a(r,i(e)):r}}function tn(){if(gt)return mt;gt=1;var e=er(),r=rn(),t=ur(),n=br();return mt=function(o,a,i){for(var u=r(a),s=n.f,c=t.f,l=0;l<u.length;l++){var f=u[l];e(o,f)||i&&e(i,f)||s(o,f,c(a,f))}}}function nn(){if(wt)return yt;wt=1;var e=o(),r=ur().f,t=yr(),n=$r(),a=Ue(),i=tn(),u=function(){if(bt)return vt;bt=1;var e=d(),r=he(),t=/#|\.prototype\./,n=function(t,n){var s=a[o(t)];return s===u||s!==i&&(r(n)?e(n):!!n)},o=n.normalize=function(e){return String(e).replace(t,".").toLowerCase()},a=n.data={},i=n.NATIVE="N",u=n.POLYFILL="P";return vt=n}();return yt=function(o,s){var c,l,f,h,p,d=o.target,m=o.global,g=o.stat;if(c=m?e:g?e[d]||a(d,{}):e[d]&&e[d].prototype)for(l in s){if(h=s[l],f=o.dontCallGetSet?(p=r(c,l))&&p.value:c[l],!u(m?l:d+(g?".":"#")+l,o.forced)&&void 0!==f){if(typeof h==typeof f)continue;i(h,f)}(o.sham||f&&f.sham)&&t(h,"sham",!0),n(c,l,h,o)}}}function on(){if(Ct)return St;Ct=1;var e=ue(),r=Me();return St=function(t,n,o){try{return e(r(Object.getOwnPropertyDescriptor(t,n)[o]))}catch(e){}}}function an(){if(Bt)return Et;Bt=1;var e=pe();return Et=function(r){return e(r)||null===r}}function un(){if(_t)return Ot;_t=1;var e=an(),r=String,t=TypeError;return Ot=function(n){if(e(n))return n;throw new t("Can't set "+r(n)+" as a prototype")}}function sn(){if(kt)return jt;kt=1;var e=on(),r=pe(),t=le(),n=un();return jt=Object.setPrototypeOf||("__proto__"in{}?function(){var o,a=!1,i={};try{(o=e(Object.prototype,"__proto__","set"))(i,[]),a=i instanceof Array}catch(e){}return function(e,i){return t(e),n(i),r(e)?(a?o(e,i):e.__proto__=i,e):e}}():void 0)}function cn(){if(xt)return It;xt=1;var e=br().f;return It=function(r,t,n){n in r||e(r,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})}}function ln(){if(Lt)return Pt;Lt=1;var e=he(),r=pe(),t=sn();return Pt=function(n,o,a){var i,u;return t&&e(i=o.constructor)&&i!==a&&r(u=i.prototype)&&u!==a.prototype&&t(n,u),n}}function fn(){if(Ht)return zt;Ht=1;var e=function(){if(At)return Tt;At=1;var e={};return e[tr()("toStringTag")]="z",Tt="[object z]"===String(e)}(),r=he(),t=se(),n=tr()("toStringTag"),o=Object,a="Arguments"===t(function(){return arguments}());return zt=e?t:function(e){var i,u,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(u=function(e,r){try{return e[r]}catch(e){}}(i=o(e),n))?u:a?t(i):"Object"===(s=t(i))&&r(i.callee)?"Arguments":s}}function hn(){if(Gt)return Dt;Gt=1;var e=fn(),r=String;return Dt=function(t){if("Symbol"===e(t))throw new TypeError("Cannot convert a Symbol value to a string");return r(t)}}function pn(){if(qt)return $t;qt=1;var e=hn();return $t=function(r,t){return void 0===r?arguments.length<2?"":t:e(r)},$t}function dn(){if(Nt)return Wt;Nt=1;var e=pe(),r=yr();return Wt=function(t,n){e(n)&&"cause"in n&&r(t,"cause",n.cause)}}function mn(){if(Ut)return Jt;Ut=1;var e=yr(),r=function(){if(Xt)return Ft;Xt=1;var e=ue(),r=Error,t=e("".replace),n=String(new r("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,a=o.test(n);return Ft=function(e,n){if(a&&"string"==typeof e&&!r.prepareStackTrace)for(;n--;)e=t(e,o,"");return e}}(),t=function(){if(Zt)return Yt;Zt=1;var e=d(),r=ie();return Yt=!e((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)}))}(),n=Error.captureStackTrace;return Jt=function(o,a,i,u){t&&(n?n(o,a):e(o,"stack",r(i,u)))}}function gn(){if(Vt)return Kt;Vt=1;var e=de(),r=er(),t=yr(),n=me(),o=sn(),a=tn(),i=cn(),u=ln(),s=pn(),c=dn(),l=mn(),f=m(),h=Je();return Kt=function(p,d,m,g){var v="stackTraceLimit",b=g?2:1,y=p.split("."),w=y[y.length-1],M=e.apply(null,y);if(M){var R=M.prototype;if(!h&&r(R,"cause")&&delete R.cause,!m)return M;var S=e("Error"),C=d((function(e,r){var o=s(g?r:e,void 0),a=g?new M(e):new M;return void 0!==o&&t(a,"message",o),l(a,C,a.stack,2),this&&n(R,this)&&u(a,this,C),arguments.length>b&&c(a,arguments[b]),a}));if(C.prototype=R,"Error"!==w?o?o(C,S):a(C,S,{name:!0}):f&&v in M&&(i(C,M,v),i(C,M,"prepareStackTrace")),a(C,M),!h)try{R.name!==w&&t(R,"name",w),R.constructor=C}catch(e){}return C}},Kt}!function(){if(Qt)return n;Qt=1;var e=nn(),r=o(),t=function(){if(Rt)return Mt;Rt=1;var e=g(),r=Function.prototype,t=r.apply,n=r.call;return Mt="object"==typeof Reflect&&Reflect.apply||(e?n.bind(t):function(){return n.apply(t,arguments)}),Mt}(),a=gn(),i="WebAssembly",u=r[i],s=7!==new Error("e",{cause:7}).cause,c=function(r,t){var n={};n[r]=a(r,t,s),e({global:!0,constructor:!0,arity:1,forced:s},n)},l=function(r,t){if(u&&u[r]){var n={};n[r]=a(i+"."+r,t,s),e({target:i,stat:!0,constructor:!0,arity:1,forced:s},n)}};c("Error",(function(e){return function(r){return t(e,this,arguments)}})),c("EvalError",(function(e){return function(r){return t(e,this,arguments)}})),c("RangeError",(function(e){return function(r){return t(e,this,arguments)}})),c("ReferenceError",(function(e){return function(r){return t(e,this,arguments)}})),c("SyntaxError",(function(e){return function(r){return t(e,this,arguments)}})),c("TypeError",(function(e){return function(r){return t(e,this,arguments)}})),c("URIError",(function(e){return function(r){return t(e,this,arguments)}})),l("CompileError",(function(e){return function(r){return t(e,this,arguments)}})),l("LinkError",(function(e){return function(r){return t(e,this,arguments)}})),l("RuntimeError",(function(e){return function(r){return t(e,this,arguments)}}))}();var vn,bn,yn,wn,Mn,Rn,Sn,Cn={};function En(){if(bn)return vn;bn=1;var e=se();return vn=Array.isArray||function(r){return"Array"===e(r)}}function Bn(){if(Rn)return Mn;Rn=1;var e=TypeError;return Mn=function(r){if(r>9007199254740991)throw e("Maximum allowed index exceeded");return r}}!function(){if(Sn)return Cn;Sn=1;var e=nn(),r=Qe(),t=ct(),n=function(){if(wn)return yn;wn=1;var e=m(),r=En(),t=TypeError,n=Object.getOwnPropertyDescriptor,o=e&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();return yn=o?function(e,o){if(r(e)&&!n(e,"length").writable)throw new t("Cannot set read only .length");return e.length=o}:function(e,r){return e.length=r}}(),o=Bn();e({target:"Array",proto:!0,arity:1,forced:d()((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var a=r(this),i=t(a),u=arguments.length;o(i+u);for(var s=0;s<u;s++)a[i]=arguments[s],i++;return n(a,i),i}})}();var On,_n,jn,kn,In,xn,Pn,Ln,Tn,An,zn={};function Hn(){if(_n)return On;_n=1;var e=me(),r=TypeError;return On=function(t,n){if(e(n,t))return t;throw new r("Incorrect invocation")}}function Dn(){if(xn)return In;xn=1;var e=er(),r=he(),t=Qe(),n=zr(),o=function(){if(kn)return jn;kn=1;var e=d();return jn=!e((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))}(),a=n("IE_PROTO"),i=Object,u=i.prototype;return In=o?i.getPrototypeOf:function(n){var o=t(n);if(e(o,a))return o[a];var s=o.constructor;return r(s)&&o instanceof s?s.prototype:o instanceof i?u:null}}function Gn(){if(Ln)return Pn;Ln=1;var e=Gr(),r=br();return Pn=function(t,n,o){return o.get&&e(o.get,n,{getter:!0}),o.set&&e(o.set,n,{setter:!0}),r.f(t,n,o)}}function $n(){if(An)return Tn;An=1;var e=m(),r=br(),t=ie();return Tn=function(n,o,a){e?r.f(n,o,t(0,a)):n[o]=a}}var qn,Wn,Nn,Fn,Xn,Yn,Zn,Jn,Un,Kn,Vn,Qn={};function eo(){if(Wn)return qn;Wn=1;var e=lt(),r=ft();return qn=Object.keys||function(t){return e(t,r)}}function ro(){if(Xn)return Fn;Xn=1;var e=de();return Fn=e("document","documentElement")}function to(){if(Zn)return Yn;Zn=1;var e,r=vr(),t=function(){if(Nn)return Qn;Nn=1;var e=m(),r=gr(),t=br(),n=vr(),o=fe(),a=eo();return Qn.f=e&&!r?Object.defineProperties:function(e,r){n(e);for(var i,u=o(r),s=a(r),c=s.length,l=0;c>l;)t.f(e,i=s[l++],u[i]);return e},Qn}(),n=ft(),o=Hr(),a=ro(),i=ar(),u=zr(),s="prototype",c="script",l=u("IE_PROTO"),f=function(){},h=function(e){return"<"+c+">"+e+"</"+c+">"},p=function(e){e.write(h("")),e.close();var r=e.parentWindow.Object;return e=null,r},d=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var r,t,o;d="undefined"!=typeof document?document.domain&&e?p(e):(t=i("iframe"),o="java"+c+":",t.style.display="none",a.appendChild(t),t.src=String(o),(r=t.contentWindow.document).open(),r.write(h("document.F=Object")),r.close(),r.F):p(e);for(var u=n.length;u--;)delete d[s][n[u]];return d()};return o[l]=!0,Yn=Object.create||function(e,n){var o;return null!==e?(f[s]=r(e),o=new f,f[s]=null,o[l]=e):o=d(),void 0===n?o:t.f(o,n)}}function no(){if(Un)return Jn;Un=1;var e,r,t,n=d(),o=he(),a=pe(),i=to(),u=Dn(),s=$r(),c=tr(),l=Je(),f=c("iterator"),h=!1;return[].keys&&("next"in(t=[].keys())?(r=u(u(t)))!==Object.prototype&&(e=r):h=!0),!a(e)||n((function(){var r={};return e[f].call(r)!==r}))?e={}:l&&(e=i(e)),o(e[f])||s(e,f,(function(){return this})),Jn={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:h}}Vn||(Vn=1,function(){if(Kn)return zn;Kn=1;var e=nn(),r=o(),t=Hn(),n=vr(),a=he(),i=Dn(),u=Gn(),s=$n(),c=d(),l=er(),f=tr(),h=no().IteratorPrototype,p=m(),g=Je(),v="constructor",b="Iterator",y=f("toStringTag"),w=TypeError,M=r[b],R=g||!a(M)||M.prototype!==h||!c((function(){M({})})),S=function(){if(t(this,h),i(this)===h)throw new w("Abstract class Iterator not directly constructable")},C=function(e,r){p?u(h,e,{configurable:!0,get:function(){return r},set:function(r){if(n(this),this===h)throw new w("You can't redefine this property");l(this,e)?this[e]=r:s(this,e,r)}}):h[e]=r};l(h,y)||C(y,b),!R&&l(h,v)&&h[v]!==Object||C(v,S),S.prototype=h,e({global:!0,constructor:!0,forced:R},{Iterator:S})}());var oo,ao,io,uo,so,co,lo,fo,ho,po,mo,go,vo,bo,yo,wo,Mo,Ro,So,Co,Eo={};function Bo(){if(uo)return io;uo=1;var e=function(){if(ao)return oo;ao=1;var e=se(),r=ue();return oo=function(t){if("Function"===e(t))return r(t)}}(),r=Me(),t=g(),n=e(e.bind);return io=function(e,o){return r(e),void 0===o?e:t?n(e,o):function(){return e.apply(o,arguments)}},io}function Oo(){return co?so:(co=1,so={})}function _o(){if(fo)return lo;fo=1;var e=tr(),r=Oo(),t=e("iterator"),n=Array.prototype;return lo=function(e){return void 0!==e&&(r.Array===e||n[t]===e)}}function jo(){if(po)return ho;po=1;var e=fn(),r=Re(),t=ce(),n=Oo(),o=tr()("iterator");return ho=function(a){if(!t(a))return r(a,o)||r(a,"@@iterator")||n[e(a)]}}function ko(){if(go)return mo;go=1;var e=v(),r=Me(),t=vr(),n=we(),o=jo(),a=TypeError;return mo=function(i,u){var s=arguments.length<2?o(i):u;if(r(s))return t(e(s,i));throw new a(n(i)+" is not iterable")},mo}function Io(){if(bo)return vo;bo=1;var e=v(),r=vr(),t=Re();return vo=function(n,o,a){var i,u;r(n);try{if(!(i=t(n,"return"))){if("throw"===o)throw a;return a}i=e(i,n)}catch(e){u=!0,i=e}if("throw"===o)throw a;if(u)throw i;return r(i),a}}function xo(){if(wo)return yo;wo=1;var e=Bo(),r=v(),t=vr(),n=we(),o=_o(),a=ct(),i=me(),u=ko(),s=jo(),c=Io(),l=TypeError,f=function(e,r){this.stopped=e,this.result=r},h=f.prototype;return yo=function(p,d,m){var g,v,b,y,w,M,R,S=m&&m.that,C=!(!m||!m.AS_ENTRIES),E=!(!m||!m.IS_RECORD),B=!(!m||!m.IS_ITERATOR),O=!(!m||!m.INTERRUPTED),_=e(d,S),j=function(e){return g&&c(g,"normal",e),new f(!0,e)},k=function(e){return C?(t(e),O?_(e[0],e[1],j):_(e[0],e[1])):O?_(e,j):_(e)};if(E)g=p.iterator;else if(B)g=p;else{if(!(v=s(p)))throw new l(n(p)+" is not iterable");if(o(v)){for(b=0,y=a(p);y>b;b++)if((w=k(p[b]))&&i(h,w))return w;return new f(!1)}g=u(p,v)}for(M=E?p.next:g.next;!(R=r(M,g)).done;){try{w=k(R.value)}catch(e){c(g,"throw",e)}if("object"==typeof w&&w&&i(h,w))return w}return new f(!1)}}function Po(){return Ro?Mo:(Ro=1,Mo=function(e){return{iterator:e,next:e.next,done:!1}})}Co||(Co=1,function(){if(So)return Eo;So=1;var e=nn(),r=xo(),t=Me(),n=vr(),o=Po();e({target:"Iterator",proto:!0,real:!0},{every:function(e){n(this),t(e);var a=o(this),i=0;return!r(a,(function(r,t){if(!e(r,i++))return t()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}());var Lo,To,Ao,zo,Ho,Do,Go,$o,qo,Wo,No,Fo,Xo={};function Yo(){if(To)return Lo;To=1;var e=$r();return Lo=function(r,t,n){for(var o in t)e(r,o,t[o],n);return r}}function Zo(){return zo?Ao:(zo=1,Ao=function(e,r){return{value:e,done:r}})}function Jo(){if(Do)return Ho;Do=1;var e=v(),r=to(),t=yr(),n=Yo(),o=tr(),a=Dr(),i=Re(),u=no().IteratorPrototype,s=Zo(),c=Io(),l=o("toStringTag"),f="IteratorHelper",h="WrapForValidIterator",p=a.set,d=function(t){var o=a.getterFor(t?h:f);return n(r(u),{next:function(){var e=o(this);if(t)return e.nextHandler();try{var r=e.done?void 0:e.nextHandler();return s(r,e.done)}catch(r){throw e.done=!0,r}},return:function(){var r=o(this),n=r.iterator;if(r.done=!0,t){var a=i(n,"return");return a?e(a,n):s(void 0,!0)}if(r.inner)try{c(r.inner.iterator,"normal")}catch(e){return c(n,"throw",e)}return n&&c(n,"normal"),s(void 0,!0)}})},m=d(!0),g=d(!1);return t(g,l,"Iterator Helper"),Ho=function(e,r){var t=function(t,n){n?(n.iterator=t.iterator,n.next=t.next):n=t,n.type=r?h:f,n.nextHandler=e,n.counter=0,n.done=!1,p(this,n)};return t.prototype=r?m:g,t}}function Uo(){if($o)return Go;$o=1;var e=vr(),r=Io();return Go=function(t,n,o,a){try{return a?n(e(o)[0],o[1]):n(o)}catch(e){r(t,"throw",e)}}}function Ko(){if(No)return Xo;No=1;var e=nn(),r=function(){if(Wo)return qo;Wo=1;var e=v(),r=Me(),t=vr(),n=Po(),o=Jo(),a=Uo(),i=o((function(){var r=this.iterator,n=t(e(this.next,r));if(!(this.done=!!n.done))return a(r,this.mapper,[n.value,this.counter++],!0)}));return qo=function(e){return t(this),r(e),new i(n(this),{mapper:e})}}();return e({target:"Iterator",proto:!0,real:!0,forced:Je()},{map:r}),Xo}Fo||(Fo=1,Ko());var Vo,Qo,ea={};Qo||(Qo=1,function(){if(Vo)return ea;Vo=1;var e=nn(),r=xo(),t=Me(),n=vr(),o=Po();e({target:"Iterator",proto:!0,real:!0},{some:function(e){n(this),t(e);var a=o(this),i=0;return r(a,(function(r,t){if(e(r,i++))return t()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}());var ra,ta,na,oa,aa,ia,ua,sa,ca,la,fa,ha,pa,da,ma,ga,va,ba,ya,wa,Ma={};function Ra(){if(ta)return ra;ta=1;var e=ue(),r=Set.prototype;return ra={Set:Set,add:e(r.add),has:e(r.has),remove:e(r.delete),proto:r}}function Sa(){if(oa)return na;oa=1;var e=Ra().has;return na=function(r){return e(r),r}}function Ca(){if(ia)return aa;ia=1;var e=v();return aa=function(r,t,n){for(var o,a,i=n?r:r.iterator,u=r.next;!(o=e(u,i)).done;)if(void 0!==(a=t(o.value)))return a}}function Ea(){if(sa)return ua;sa=1;var e=ue(),r=Ca(),t=Ra(),n=t.Set,o=t.proto,a=e(o.forEach),i=e(o.keys),u=i(new n).next;return ua=function(e,t,n){return n?r({iterator:i(e),next:u},t):a(e,t)},ua}function Ba(){if(la)return ca;la=1;var e=Ra(),r=Ea(),t=e.Set,n=e.add;return ca=function(e){var o=new t;return r(e,(function(e){n(o,e)})),o},ca}function Oa(){if(ha)return fa;ha=1;var e=on(),r=Ra();return fa=e(r.proto,"size","get")||function(e){return e.size},fa}function _a(){if(da)return pa;da=1;var e=Me(),r=vr(),t=v(),n=it(),o=Po(),a="Invalid size",i=RangeError,u=TypeError,s=Math.max,c=function(r,t){this.set=r,this.size=s(t,0),this.has=e(r.has),this.keys=e(r.keys)};return c.prototype={getIterator:function(){return o(r(t(this.keys,this.set)))},includes:function(e){return t(this.has,this.set,e)}},pa=function(e){r(e);var t=+e.size;if(t!=t)throw new u(a);var o=n(t);if(o<0)throw new i(a);return new c(e,o)}}function ja(){if(ba)return va;ba=1;var e=de(),r=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};return va=function(t){var n=e("Set");try{(new n)[t](r(0));try{return(new n)[t](r(-1)),!1}catch(e){return!0}}catch(e){return!1}}}function ka(){if(ya)return Ma;ya=1;var e=nn(),r=function(){if(ga)return ma;ga=1;var e=Sa(),r=Ra(),t=Ba(),n=Oa(),o=_a(),a=Ea(),i=Ca(),u=r.has,s=r.remove;return ma=function(r){var c=e(this),l=o(r),f=t(c);return n(c)<=l.size?a(c,(function(e){l.includes(e)&&s(f,e)})):i(l.getIterator(),(function(e){u(c,e)&&s(f,e)})),f}}();return e({target:"Set",proto:!0,real:!0,forced:!ja()("difference")},{difference:r}),Ma}wa||(wa=1,ka());var Ia,xa,Pa,La,Ta={};function Aa(){if(Pa)return Ta;Pa=1;var e=nn(),r=d(),t=function(){if(xa)return Ia;xa=1;var e=Sa(),r=Ra(),t=Oa(),n=_a(),o=Ea(),a=Ca(),i=r.Set,u=r.add,s=r.has;return Ia=function(r){var c=e(this),l=n(r),f=new i;return t(c)>l.size?a(l.getIterator(),(function(e){s(c,e)&&u(f,e)})):o(c,(function(e){l.includes(e)&&u(f,e)})),f}}();return e({target:"Set",proto:!0,real:!0,forced:!ja()("intersection")||r((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:t}),Ta}La||(La=1,Aa());var za,Ha,Da,Ga,$a={};function qa(){if(Da)return $a;Da=1;var e=nn(),r=function(){if(Ha)return za;Ha=1;var e=Sa(),r=Ra().has,t=Oa(),n=_a(),o=Ea(),a=Ca(),i=Io();return za=function(u){var s=e(this),c=n(u);if(t(s)<=c.size)return!1!==o(s,(function(e){if(c.includes(e))return!1}),!0);var l=c.getIterator();return!1!==a(l,(function(e){if(r(s,e))return i(l,"normal",!1)}))}}();return e({target:"Set",proto:!0,real:!0,forced:!ja()("isDisjointFrom")},{isDisjointFrom:r}),$a}Ga||(Ga=1,qa());var Wa,Na,Fa,Xa,Ya={};function Za(){if(Fa)return Ya;Fa=1;var e=nn(),r=function(){if(Na)return Wa;Na=1;var e=Sa(),r=Oa(),t=Ea(),n=_a();return Wa=function(o){var a=e(this),i=n(o);return!(r(a)>i.size)&&!1!==t(a,(function(e){if(!i.includes(e))return!1}),!0)}}();return e({target:"Set",proto:!0,real:!0,forced:!ja()("isSubsetOf")},{isSubsetOf:r}),Ya}Xa||(Xa=1,Za());var Ja,Ua,Ka,Va,Qa={};function ei(){if(Ka)return Qa;Ka=1;var e=nn(),r=function(){if(Ua)return Ja;Ua=1;var e=Sa(),r=Ra().has,t=Oa(),n=_a(),o=Ca(),a=Io();return Ja=function(i){var u=e(this),s=n(i);if(t(u)<s.size)return!1;var c=s.getIterator();return!1!==o(c,(function(e){if(!r(u,e))return a(c,"normal",!1)}))}}();return e({target:"Set",proto:!0,real:!0,forced:!ja()("isSupersetOf")},{isSupersetOf:r}),Qa}Va||(Va=1,ei());var ri,ti,ni,oi,ai={};function ii(){if(ni)return ai;ni=1;var e=nn(),r=function(){if(ti)return ri;ti=1;var e=Sa(),r=Ra(),t=Ba(),n=_a(),o=Ca(),a=r.add,i=r.has,u=r.remove;return ri=function(r){var s=e(this),c=n(r).getIterator(),l=t(s);return o(c,(function(e){i(s,e)?u(l,e):a(l,e)})),l}}();return e({target:"Set",proto:!0,real:!0,forced:!ja()("symmetricDifference")},{symmetricDifference:r}),ai}oi||(oi=1,ii());var ui,si,ci,li,fi={};function hi(){if(ci)return fi;ci=1;var e=nn(),r=function(){if(si)return ui;si=1;var e=Sa(),r=Ra().add,t=Ba(),n=_a(),o=Ca();return ui=function(a){var i=e(this),u=n(a).getIterator(),s=t(i);return o(u,(function(e){r(s,e)})),s}}();return e({target:"Set",proto:!0,real:!0,forced:!ja()("union")},{union:r}),fi}function pi(e,r){let t,n,o=e.length,a=!1,i=!1;Array.isArray(e[0])?t=e:(t=[e],o=t.length,a=!0),Array.isArray(r[0])?n=r:(n=r.length>0?r.map((e=>[e])):[[]],i=!0);let u=n[0].length,s=n[0].map(((e,r)=>n.map((e=>e[r])))),c=t.map((e=>s.map((r=>{let t=0;if(!Array.isArray(e)){for(let n of r)t+=e*n;return t}for(let n=0;n<e.length;n++)t+=e[n]*(r[n]||0);return t}))));return 1===o&&a&&(c=c[0]),1===u&&i?1===o&&a?c[0]:c.map((e=>e[0])):c}function di(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function mi(e,r,t=[0,0,0]){const n=di(e,r[0]),o=di(e,r[1]),a=di(e,r[2]);return t[0]=n,t[1]=o,t[2]=a,t}function gi(e){return"string"===vi(e)}function vi(e){return(Object.prototype.toString.call(e).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function bi(e,{precision:r=16,unit:t}){return yi(e)?"none":(e=+Mi(e,r))+(null!=t?t:"")}function yi(e){return null===e}function wi(e){return yi(e)?0:e}function Mi(e,r){if(0===e)return 0;let t=~~e,n=0;t&&r&&(n=1+~~Math.log10(Math.abs(t)));const o=10**(r-n);return Math.floor(e*o+.5)/o}function Ri(e,r,t){return isNaN(e)?r:isNaN(r)?e:e+(r-e)*t}function Si(e,r,t){return!e||!r||e===r||e[0]===r[0]&&e[1]===r[1]||isNaN(t)||null===t?t:Ri(r[0],r[1],function(e,r,t){return(t-e)/(r-e)}(e[0],e[1],t))}function Ci(e,r,t){return Math.max(Math.min(t,r),e)}function Ei(e,r){return Math.sign(e)===Math.sign(r)?e:-e}function Bi(e,r){return Ei(Math.abs(e)**r,e)}function Oi(e,r){return 0===r?0:e/r}function _i(e,r){if(e instanceof r)return!0;const t=r.name;for(;e;){var n;const r=Object.getPrototypeOf(e),o=null==r||null===(n=r.constructor)||void 0===n?void 0:n.name;if(o===t)return!0;if(!o||"Object"===o)return!1;e=r}return!1}li||(li=1,hi());var ji,ki,Ii={};ki||(ki=1,function(){if(ji)return Ii;ji=1;var e=nn(),r=xo(),t=Me(),n=vr(),o=Po();e({target:"Iterator",proto:!0,real:!0},{find:function(e){n(this),t(e);var a=o(this),i=0;return r(a,(function(r,t){if(e(r,i++))return t(r)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})}());class xi{type;coordMeta;coordRange;range;constructor(e,r){var t;("object"==typeof e&&(this.coordMeta=e),r)&&(this.coordMeta=r,this.coordRange=null!==(t=r.range)&&void 0!==t?t:r.refRange);if("string"==typeof e){let r=e.trim().match(/^(?<type><[a-z]+>)(\[(?<min>-?[.\d]+),\s*(?<max>-?[.\d]+)\])?$/);if(!r)throw new TypeError(`Cannot parse ${e} as a type definition.`);this.type=r.groups.type;let{min:t,max:n}=r.groups;(t||n)&&(this.range=[+t,+n])}}get computedRange(){return this.range?this.range:"<percentage>"===this.type?this.percentageRange():"<angle>"===this.type?[0,360]:null}get unit(){return"<percentage>"===this.type?"%":"<angle>"===this.type?"deg":""}resolve(e){if("<angle>"===this.type)return e;let r=this.computedRange,t=this.coordRange;var n;"<percentage>"===this.type&&(null!==(n=t)&&void 0!==n||(t=this.percentageRange()));return Si(r,t,e)}serialize(e,r){let t="<percentage>"===this.type?this.percentageRange(100):this.computedRange,n=this.unit;return bi(e=Si(this.coordRange,t,e),{unit:n,precision:r})}toString(){let e=this.type;if(this.range){let[r="",t=""]=this.range;e+=`[${r},${t}]`}return e}percentageRange(e=1){let r;return r=this.coordMeta&&this.coordMeta.range||this.coordRange&&this.coordRange[0]>=0?[0,1]:[-1,1],[r[0]*e,r[1]*e]}static get(e,r){return _i(e,this)?e:new this(e,r)}}const Pi=Symbol("instance");class Li{type;name;spaceCoords;coords;id;alpha;constructor(e,r=e.space){e[Pi]=this,this.type="function",this.name="color",Object.assign(this,e),this.space=r,"custom"!==this.type&&(this.spaceCoords=Object.values(r.coords),this.coords||(this.coords=this.spaceCoords.map((e=>{let r=["<number>","<percentage>"];return"angle"===e.type&&r.push("<angle>"),r}))),this.coords=this.coords.map(((e,r)=>{let t=this.spaceCoords[r];return"string"==typeof e&&(e=e.trim().split(/\s*\|\s*/)),e.map((e=>xi.get(e,t)))})))}serializeCoords(e,r,t){return t=e.map(((e,r)=>{var n,o;return xi.get(null!==(n=null===(o=t)||void 0===o?void 0:o[r])&&void 0!==n?n:this.coords[r][0],this.spaceCoords[r])})),e.map(((e,n)=>t[n].serialize(e,r)))}coerceCoords(e,r){return Object.entries(this.space.coords).map((([t,n],o)=>{let a=e[o];if(yi(a)||isNaN(a))return a;let i=r[o],u=this.coords[o].find((e=>e.type==i));if(!u){var s,c;let e=n.name||t;throw new TypeError(`${null!==(s=null!=i?i:null===(c=a)||void 0===c?void 0:c.raw)&&void 0!==s?s:a} not allowed for ${e} in ${this.name}()`)}return a=u.resolve(a),u.range&&(r[o]=u.toString()),a}))}canSerialize(){return"function"===this.type||this.serialize}parse(e){return null}static get(e,...r){return!e||_i(e,this)?e:e[Pi]?e[Pi]:new Li(e,...r)}}var Ti,Ai,zi={};Ai||(Ai=1,function(){if(Ti)return zi;Ti=1;var e=nn(),r=xo(),t=Me(),n=vr(),o=Po();e({target:"Iterator",proto:!0,real:!0},{forEach:function(e){n(this),t(e);var a=o(this),i=0;r(a,(function(r){e(r,i++)}),{IS_RECORD:!0})}})}());class Hi{add(e,r,t){if("string"==typeof arguments[0])(Array.isArray(e)?e:[e]).forEach((function(e){this[e]=this[e]||[],r&&this[e][t?"unshift":"push"](r)}),this);else for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1])}run(e,r){this[e]=this[e]||[],this[e].forEach((function(e){e.call(r&&r.context?r.context:r,r)}))}}const Di=new Hi,Gi={D50:[.3457/.3585,1,.2958/.3585],D65:[.3127/.329,1,.3583/.329]};function $i(e){return Array.isArray(e)?e:Gi[e]}function qi(e,r,t,n={}){if(e=$i(e),r=$i(r),!e||!r)throw new TypeError(`Missing white point to convert ${e?"":"from"}${e||r?"":"/"}${r?"":"to"}`);if(e===r)return t;let o={W1:e,W2:r,XYZ:t,options:n};if(Di.run("chromatic-adaptation-start",o),o.M||(o.W1===Gi.D65&&o.W2===Gi.D50?o.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:o.W1===Gi.D50&&o.W2===Gi.D65&&(o.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),Di.run("chromatic-adaptation-end",o),o.M)return mi(o.XYZ,o.M);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}var Wi,Ni={gamut_mapping:"css",precision:5,deltaE:"76",verbose:"test"!==(null===globalThis||void 0===globalThis||null===(Wi=globalThis.process)||void 0===Wi||null===(Wi=Wi.env)||void 0===Wi||null===(Wi=Wi.NODE_ENV)||void 0===Wi?void 0:Wi.toLowerCase()),warn:function(e){var r,t;this.verbose&&(null===globalThis||void 0===globalThis||null===(r=globalThis.console)||void 0===r||null===(t=r.warn)||void 0===t||t.call(r,e))}};function Fi(e,r){var t,n;let o,a={str:null===(t=String(e))||void 0===t?void 0:t.trim(),options:r};if(Di.run("parse-start",a),a.color)return a.color;a.parsed=function(e){if(!e)return;e=e.trim();let r=e.match(Yi.function);if(r){let e=[],t=[],n=!1,o=r[1].toLowerCase(),a=r[2].replace(Yi.singleArgument,((r,a)=>{let{value:i,meta:u}=function(e){var r;let t={},n=null===(r=e.match(Yi.unitValue))||void 0===r?void 0:r[0],o=t.raw=e;n?(t.type="%"===n?"<percentage>":"<angle>",t.unit=n,t.unitless=Number(o.slice(0,-n.length)),o=t.unitless*Xi[n]):Yi.number.test(o)?(o=Number(o),t.type="<number>"):"none"===o?o=null:"NaN"===o||"calc(NaN)"===o?(o=NaN,t.type="<number>"):t.type="<ident>";return{value:o,meta:t}}(a);return(r.startsWith("/")||"color"!==o&&3===e.length)&&(n=!0),e.push(i),t.push(u),""}));return{name:o,args:e,argMeta:t,lastAlpha:n,commas:a.includes(","),rawName:r[1],rawArgs:r[2]}}}(a.str);let i=a.options?null!==(n=a.options.parseMeta)&&void 0!==n?n:a.options.meta:null;if(a.parsed){let r,t,n=a.parsed.name,c=a.parsed.args,l=c.map(((e,r)=>{var t;return null===(t=a.parsed.argMeta[r])||void 0===t?void 0:t.type}));if("color"===n){let o=c.shift();l.shift();let i=o.startsWith("--")?o.substring(2):`--${o}`,f=[o,i];if(r=Ji.findFormat({name:n,id:f,type:"function"}),!r){var u;let r,t=o in Ji.registry?o:i;if(t in Ji.registry){var s;let n=null===(s=Ji.registry[t].formats)||void 0===s||null===(s=s.color)||void 0===s?void 0:s.id;if(n){r=`Did you mean ${e.replace("color("+o,"color("+n)}?`}}throw new TypeError(`Cannot parse ${a.str}. `+(null!==(u=r)&&void 0!==u?u:"Missing a plugin?"))}t=r.space,r.id.startsWith("--")&&!o.startsWith("--")&&Ni.warn(`${t.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${r.id}) instead of color(${o}).`),o.startsWith("--")&&!r.id.startsWith("--")&&Ni.warn(`${t.name} is a standard space and supported in the CSS spec. Use color(${r.id}) instead of prefixed color(${o}).`)}else r=Ji.findFormat({name:n,type:"function"}),t=r.space;i&&Object.assign(i,{format:r,formatId:r.name,types:l,commas:a.parsed.commas});let f=1;a.parsed.lastAlpha&&(f=a.parsed.args.pop(),i&&(i.alphaType=l.pop()));let h=r.coords.length;if(c.length!==h)throw new TypeError(`Expected ${h} coordinates for ${t.id} in ${a.str}), got ${c.length}`);c=r.coerceCoords(c,l),o={spaceId:t.id,coords:c,alpha:f}}else e:for(let e of Ji.all)for(let r in e.formats){let t=e.formats[r];if("custom"!==t.type)continue;if(t.test&&!t.test(a.str))continue;let n=e.getFormat(t),u=n.parse(a.str);if(u){i&&Object.assign(i,{format:n,formatId:r}),o=u;break e}}if(!o)throw new TypeError(`Could not parse ${e} as a color. Missing a plugin?`);return o.alpha=yi(o.alpha)?o.alpha:void 0===o.alpha?1:Ci(0,o.alpha,1),o}const Xi={"%":.01,deg:1,grad:.9,rad:180/Math.PI,turn:360},Yi={function:/^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i,number:/^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i,unitValue:RegExp(`(${Object.keys(Xi).join("|")})$`),singleArgument:/\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g};function Zi(e,r){if(Array.isArray(e))return e.map((e=>Zi(e,r)));if(!e)throw new TypeError("Empty color reference");gi(e)&&(e=Fi(e,r));let t=e.space||e.spaceId;return"string"==typeof t&&(e.space=Ji.get(t)),void 0===e.alpha&&(e.alpha=1),e}class Ji{constructor(e){var r,t,n,o,a,i;this.id=e.id,this.name=e.name,this.base=e.base?Ji.get(e.base):null,this.aliases=e.aliases,this.displaySpaces=null===(r=e.displaySpaces)||void 0===r?void 0:r.map((e=>Ji.get(e))),this.bases=[];for(let e=this.base;e;e=e.base)this.bases.push(e);e.rgbGamut&&(this.rgbGamut=e.rgbGamut),e.linearGamut&&(this.linearGamut=e.linearGamut),this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);let u=null!==(t=e.coords)&&void 0!==t?t:this.base.coords;for(let e in u)"name"in u[e]||(u[e].name=e);this.coords=u;let s=null!==(n=null!==(o=e.white)&&void 0!==o?o:this.base.white)&&void 0!==n?n:"D65";this.white=$i(s),this.formats=null!==(a=e.formats)&&void 0!==a?a:{};for(let e in this.formats){let r=this.formats[e];r.type||(r.type="function"),r.name||(r.name=e)}var c;null!==(i=this.formats.color)&&void 0!==i&&i.id||(this.formats.color={...null!==(c=this.formats.color)&&void 0!==c?c:{},id:e.cssId||this.id});e.gamutSpace?this.gamutSpace="self"===e.gamutSpace?this:Ji.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(e,r)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:Ui(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Di.run("colorspace-init-end",this)}inGamut(e,{epsilon:r=75e-6}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:r});let t=Object.values(this.coords);return e.every(((e,n)=>{let o=t[n];if("angle"!==o.type&&o.range){if(yi(e))return!0;let[t,n]=o.range;return(void 0===t||e>=t-r)&&(void 0===n||e<=n+r)}return!0}))}get isUnbounded(){return Object.values(this.coords).every((e=>!("range"in e)))}get cssId(){var e;return(null===(e=this.formats)||void 0===e||null===(e=e.color)||void 0===e?void 0:e.id)||this.id}get isPolar(){for(let e in this.coords)if("angle"===this.coords[e].type)return!0;return!1}getFormat(e){if(!e)return null;"default"===e?e=Object.values(this.formats)[0]:"string"==typeof e&&(e=this.formats[e]);let r=Li.get(e,this);return r!==e&&e.name in this.formats&&(this.formats[e.name]=r),r}equals(e){return!!e&&(this===e||this.id===e||this.id===e.id)}to(e,r){if(1===arguments.length){const t=Zi(e);[e,r]=[t.space,t.coords]}if(e=Ji.get(e),this.equals(e))return r;r=r.map((e=>yi(e)?0:e));let t,n,o=this.path,a=e.path;for(let e=0;e<o.length&&o[e].equals(a[e]);e++)t=o[e],n=e;if(!t)throw new Error(`Cannot convert between color spaces ${this} and ${e}: no connection space was found`);for(let e=o.length-1;e>n;e--)r=o[e].toBase(r);for(let e=n+1;e<a.length;e++)r=a[e].fromBase(r);return r}from(e,r){if(1===arguments.length){const t=Zi(e);[e,r]=[t.space,t.coords]}return(e=Ji.get(e)).to(this,r)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let t in this.coords){var r;let n=this.coords[t],o=n.range||n.refRange;e.push(null!==(r=null==o?void 0:o.min)&&void 0!==r?r:0)}return e}static registry={};static get all(){return[...new Set(Object.values(Ji.registry))]}static register(e,r){if(1===arguments.length&&(e=(r=arguments[0]).id),r=this.get(r),this.registry[e]&&this.registry[e]!==r)throw new Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=r,1===arguments.length&&r.aliases)for(let e of r.aliases)this.register(e,r);return r}static get(e,...r){if(!e||_i(e,this))return e;if("string"===vi(e)){let r=Ji.registry[e.toLowerCase()];if(!r)throw new TypeError(`No color space found with id = "${e}"`);return r}if(r.length)return Ji.get(...r);throw new TypeError(`${e} is not a valid color space`)}static findFormat(e,r=Ji.all){if(!e)return null;"string"==typeof e&&(e={name:e});for(let o of r)for(let[r,a]of Object.entries(o.formats)){var t,n;null!==(t=a.name)&&void 0!==t||(a.name=r),null!==(n=a.type)&&void 0!==n||(a.type="function");let i=!(e.name&&a.name!==e.name||e.type&&a.type!==e.type);if(e.id){let r=a.ids||[a.id],t=Array.isArray(e.id)?e.id:[e.id];i&&(i=t.some((e=>r.includes(e))))}if(i){let e=Li.get(a,o);return e!==a&&(o.formats[a.name]=e),e}}return null}static resolveCoord(e,r){let t,n,o=vi(e);if("string"===o?e.includes(".")?[t,n]=e.split("."):[t,n]=[,e]:Array.isArray(e)?[t,n]=e:(t=e.space,n=e.coordId),t=Ji.get(t),t||(t=r),!t)throw new TypeError(`Cannot resolve coordinate reference ${e}: No color space specified and relative references are not allowed here`);if(o=vi(n),"number"===o||"string"===o&&n>=0){let e=Object.entries(t.coords)[n];if(e)return{space:t,id:e[0],index:n,...e[1]}}t=Ji.get(t);let a=n.toLowerCase(),i=0;for(let e in t.coords){var u;let r=t.coords[e];if(e.toLowerCase()===a||(null===(u=r.name)||void 0===u?void 0:u.toLowerCase())===a)return{space:t,id:e,index:i,...r};i++}throw new TypeError(`No "${n}" coordinate found in ${t.name}. Its coordinates are: ${Object.keys(t.coords).join(", ")}`)}static DEFAULT_FORMAT={type:"functions",name:"color"}}function Ui(e){let r=[e];for(let t=e;t=t.base;)r.push(t);return r}var Ki=new Ji({id:"xyz-d65",name:"XYZ D65",coords:{x:{refRange:[0,1],name:"X"},y:{refRange:[0,1],name:"Y"},z:{refRange:[0,1],name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});class Vi extends Ji{constructor(e){var r,t,n;(e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=Ki),e.toXYZ_M&&e.fromXYZ_M)&&(null!==(t=e.toBase)&&void 0!==t||(e.toBase=r=>{let t=mi(r,e.toXYZ_M);return this.white!==this.base.white&&(t=qi(this.white,this.base.white,t)),t}),null!==(n=e.fromBase)&&void 0!==n||(e.fromBase=r=>mi(r=qi(this.base.white,this.white,r),e.fromXYZ_M)));null!==(r=e.referred)&&void 0!==r||(e.referred="display"),super(e)}}function Qi(e,r={}){if(Array.isArray(e))return e.map((e=>Qi(e,r)));let{cssProperty:t="background-color",element:n,...o}=r,a=null;try{return Zi(e,o)}catch(e){a=e}let{CSS:i,getComputedStyle:u}=globalThis;if(gi(e)&&n&&i&&u&&i.supports(t,e)){let r=n.style[t];e!==r&&(n.style[t]=e);let i=u(n).getPropertyValue(t);if(e!==r&&(n.style[t]=r),i!==e)try{return Zi(i,o)}catch(e){a=e}else a={message:"Color value is a valid CSS color, but it could not be resolved :("}}return r.errorMeta&&(r.errorMeta.error=a),null}function eu(e,r){e=Zi(e);let t,n=Ji.get(r,null==r?void 0:r.space),o=null==r?void 0:r.precision;return t=!n||e.space.equals(n)?e.coords.slice():n.from(e),void 0===o?t:t.map((e=>Mi(e,o)))}function ru(e,r){var t;if(e=Zi(e),"alpha"===r)return null!==(t=e.alpha)&&void 0!==t?t:1;let{space:n,index:o}=Ji.resolveCoord(r,e.space);return eu(e,n)[o]}function tu(e,r,t,n){return e=Zi(e),Array.isArray(r)&&([r,t,n]=[e.space,r,t]),r=Ji.get(r),e.coords=r===e.space?t.slice():r.to(e.space,t),void 0!==n&&(e.alpha=n),e}function nu(e,r,t){if(e=Zi(e),2===arguments.length&&"object"===vi(arguments[1])){let r=arguments[1];for(let t in r)nu(e,t,r[t])}else if("function"==typeof t&&(t=t(ru(e,r))),"alpha"===r)e.alpha=t;else{let{space:n,index:o}=Ji.resolveCoord(r,e.space),a=eu(e,n);a[o]=t,tu(e,n,a)}return e}tu.returns="color",nu.returns="color";var ou=new Ji({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Ki,fromBase:e=>qi(Ki.white,"D50",e),toBase:e=>qi("D50",Ki.white,e)});const au=216/24389,iu=24/116,uu=24389/27;let su=Gi.D50;var cu=new Ji({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:su,base:ou,fromBase(e){let r=e.map(((e,r)=>e/su[r])).map((e=>e>au?Math.cbrt(e):(uu*e+16)/116));return[116*r[1]-16,500*(r[0]-r[1]),200*(r[1]-r[2])]},toBase(e){let[r,t,n]=e,o=[];return o[1]=(r+16)/116,o[0]=t/500+o[1],o[2]=o[1]-n/200,[o[0]>iu?Math.pow(o[0],3):(116*o[0]-16)/uu,e[0]>8?Math.pow((e[0]+16)/116,3):e[0]/uu,o[2]>iu?Math.pow(o[2],3):(116*o[2]-16)/uu].map(((e,r)=>e*su[r]))},formats:{lab:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function lu(e){return"number"!=typeof e?e:(e%360+360)%360}function fu(e,r){let[t,n]=r,o=yi(t),a=yi(n);if(o&&a)return[t,n];if(o?t=n:a&&(n=t),"raw"===e)return r;t=lu(t),n=lu(n);let i=n-t;return"increasing"===e?i<0&&(n+=360):"decreasing"===e?i>0&&(t+=360):"longer"===e?-180<i&&i<180&&(i>0?t+=360:n+=360):"shorter"===e&&(i>180?t+=360:i<-180&&(n+=360)),[t,n]}var hu=new Ji({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:cu,fromBase(e){if(void 0===this.ε){let e=Object.values(this.base.coords)[1].refRange,r=e[1]-e[0];this.ε=r/1e5}let[r,t,n]=e,o=Math.abs(t)<this.ε&&Math.abs(n)<this.ε,a=o?null:lu(180*Math.atan2(n,t)/Math.PI);return[r,o?0:Math.sqrt(t**2+n**2),a]},toBase(e){let[r,t,n]=e,o=null,a=null;return yi(n)||(t=t<0?0:t,o=t*Math.cos(n*Math.PI/180),a=t*Math.sin(n*Math.PI/180)),[r,o,a]},formats:{lch:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}});const pu=25**7,du=Math.PI,mu=180/du,gu=du/180;function vu(e){const r=e*e;return r*r*r*e}function bu(e,r,{kL:t=1,kC:n=1,kH:o=1}={}){[e,r]=Zi([e,r]);let[a,i,u]=cu.from(e),s=hu.from(cu,[a,i,u])[1],[c,l,f]=cu.from(r),h=hu.from(cu,[c,l,f])[1];s<0&&(s=0),h<0&&(h=0);let p=vu((s+h)/2),d=.5*(1-Math.sqrt(p/(p+pu))),m=(1+d)*i,g=(1+d)*l,v=Math.sqrt(m**2+u**2),b=Math.sqrt(g**2+f**2),y=0===m&&0===u?0:Math.atan2(u,m),w=0===g&&0===f?0:Math.atan2(f,g);y<0&&(y+=2*du),w<0&&(w+=2*du),y*=mu,w*=mu;let M,R=c-a,S=b-v,C=w-y,E=y+w,B=Math.abs(C);v*b==0?M=0:B<=180?M=C:C>180?M=C-360:C<-180?M=C+360:Ni.warn("the unthinkable has happened");let O,_=2*Math.sqrt(b*v)*Math.sin(M*gu/2),j=(a+c)/2,k=(v+b)/2,I=vu(k);O=v*b==0?E:B<=180?E/2:E<360?(E+360)/2:(E-360)/2;let x=(j-50)**2,P=1+.015*x/Math.sqrt(20+x),L=1+.045*k,T=1;T-=.17*Math.cos((O-30