mp-darkmode 1.2.3-beta.7 → 1.2.3-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/darkmode.js +1652 -1499
- package/dist/darkmode.js.map +1 -1
- package/dist/darkmode.min.js +1 -1
- package/package.json +1 -1
package/dist/darkmode.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Darkmode",[],e):"object"==typeof exports?exports.Darkmode=e():t.Darkmode=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=67)}([function(t,e,r){"use strict";t.exports=TypeError},function(t,e,r){"use strict";var n=r(41);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},function(t,e,r){"use strict";var n=r(44);t.exports=Function.prototype.bind||n},function(t,e,r){"use strict";var n=r(5),o=r(14),a=o([n("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&a(t,".prototype.")>-1?o([r]):r}},function(t,e,r){"use strict";t.exports=Object},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(4),a=r(28),i=r(29),u=r(30),c=r(31),l=r(9),s=r(0),f=r(32),p=r(33),h=r(34),y=r(35),d=r(36),g=r(37),b=r(38),m=r(39),v=Function,w=function(t){try{return v('"use strict"; return ('+t+").constructor;")()}catch(t){}},M=r(1),S=r(6),k=function(){throw new s},O=M?function(){try{return k}catch(t){try{return M(arguments,"callee").get}catch(t){return k}}}():k,j=r(10)(),x=r(42),C=r(13),A=r(12),_=r(15),P=r(7),E={},B="undefined"!=typeof Uint8Array&&x?x(Uint8Array):void 0,R={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":j&&x?x([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":E,"%AsyncGenerator%":E,"%AsyncGeneratorFunction%":E,"%AsyncIteratorPrototype%":E,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?void 0:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":i,"%Float16Array%":"undefined"==typeof Float16Array?void 0:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":E,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":j&&x?x(x([][Symbol.iterator]())):void 0,"%JSON%":"object"===("undefined"==typeof JSON?"undefined":n(JSON))?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&j&&x?x((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":M,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":u,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&j&&x?x((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":j&&x?x(""[Symbol.iterator]()):void 0,"%Symbol%":j?Symbol:void 0,"%SyntaxError%":l,"%ThrowTypeError%":O,"%TypedArray%":B,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":f,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":_,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":C,"%Math.abs%":p,"%Math.floor%":h,"%Math.max%":y,"%Math.min%":d,"%Math.pow%":g,"%Math.round%":b,"%Math.sign%":m,"%Reflect.getPrototypeOf%":A};if(x)try{null.error}catch(t){var I=x(x(t));R["%Error.prototype%"]=I}var T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},N=r(2),D=r(8),L=N.call(P,Array.prototype.concat),F=N.call(_,Array.prototype.splice),z=N.call(P,String.prototype.replace),q=N.call(P,String.prototype.slice),$=N.call(P,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,U=function(t){var e=q(t,0,1),r=q(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return z(t,W,(function(t,e,r,o){n[n.length]=r?z(o,H,"$1"):e||t})),n},G=function(t,e){var r,n=t;if(D(T,n)&&(n="%"+(r=T[n])[0]+"%"),D(R,n)){var o=R[n];if(o===E&&(o=function t(e){var r;if("%AsyncFunction%"===e)r=w("async function () {}");else if("%GeneratorFunction%"===e)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=w("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&x&&(r=x(o.prototype))}return R[e]=r,r}(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new l("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===$(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=U(t),n=r.length>0?r[0]:"",o=G("%"+n+"%",e),a=o.name,i=o.value,u=!1,c=o.alias;c&&(n=c[0],F(r,L([0,1],c)));for(var f=1,p=!0;f<r.length;f+=1){var h=r[f],y=q(h,0,1),d=q(h,-1);if(('"'===y||"'"===y||"`"===y||'"'===d||"'"===d||"`"===d)&&y!==d)throw new l("property names with quotes must have matching quotes");if("constructor"!==h&&p||(u=!0),D(R,a="%"+(n+="."+h)+"%"))i=R[a];else if(null!=i){if(!(h in i)){if(!e)throw new s("base intrinsic for "+t+" exists, but the property is not available.");return}if(M&&f+1>=r.length){var g=M(i,h);i=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:i[h]}else p=D(i,h),i=i[h];p&&!u&&(R[a]=i)}}return i}},function(t,e,r){"use strict";var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}t.exports=n},function(t,e,r){"use strict";t.exports=Function.prototype.call},function(t,e,r){"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,a=r(2);t.exports=a.call(n,o)},function(t,e,r){"use strict";t.exports=SyntaxError},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o="undefined"!=typeof Symbol&&Symbol,a=r(11);t.exports=function(){return"function"==typeof o&&("function"==typeof Symbol&&("symbol"===n(o("foo"))&&("symbol"===n(Symbol("bar"))&&a())))}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"===n(Symbol.iterator))return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var o in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var a=Object.getOwnPropertySymbols(t);if(1!==a.length||a[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},function(t,e,r){"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},function(t,e,r){"use strict";var n=r(4);t.exports=n.getPrototypeOf||null},function(t,e,r){"use strict";var n=r(2),o=r(0),a=r(7),i=r(45);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new o("a function is required");return i(n,a,t)}},function(t,e,r){"use strict";t.exports=Function.prototype.apply},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o,a,i=Function.prototype.toString,u="object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&null!==Reflect&&Reflect.apply;if("function"==typeof u&&"function"==typeof Object.defineProperty)try{o=Object.defineProperty({},"length",{get:function(){throw a}}),a={},u((function(){throw 42}),null,o)}catch(t){t!==a&&(u=null)}else u=null;var c=/^\s*class\b/,l=function(t){try{var e=i.call(t);return c.test(e)}catch(t){return!1}},s=function(t){try{return!l(t)&&(i.call(t),!0)}catch(t){return!1}},f=Object.prototype.toString,p="function"==typeof Symbol&&!!Symbol.toStringTag,h=!(0 in[,]),y=function(){return!1};if("object"===("undefined"==typeof document?"undefined":n(document))){var d=document.all;f.call(d)===f.call(document.all)&&(y=function(t){if((h||!t)&&(void 0===t||"object"===n(t)))try{var e=f.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=u?function(t){if(y(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!==n(t))return!1;try{u(t,null,o)}catch(t){if(t!==a)return!1}return!l(t)&&s(t)}:function(t){if(y(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!==n(t))return!1;if(p)return s(t);if(l(t))return!1;var e=f.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},function(t,e,r){"use strict";var n=r(11);t.exports=function(){return n()&&!!Symbol.toStringTag}},function(t,e,r){(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o="function"==typeof Map&&Map.prototype,a=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=o&&a&&"function"==typeof a.get?a.get:null,u=o&&Map.prototype.forEach,c="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&c?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=c&&l&&"function"==typeof l.get?l.get:null,f=c&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,g=Object.prototype.toString,b=Function.prototype.toString,m=String.prototype.match,v=String.prototype.slice,w=String.prototype.replace,M=String.prototype.toUpperCase,S=String.prototype.toLowerCase,k=RegExp.prototype.test,O=Array.prototype.concat,j=Array.prototype.join,x=Array.prototype.slice,C=Math.floor,A="function"==typeof BigInt?BigInt.prototype.valueOf:null,_=Object.getOwnPropertySymbols,P="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?Symbol.prototype.toString:null,E="function"==typeof Symbol&&"object"===n(Symbol.iterator),B="function"==typeof Symbol&&Symbol.toStringTag&&(n(Symbol.toStringTag)===E||"symbol")?Symbol.toStringTag:null,R=Object.prototype.propertyIsEnumerable,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function T(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||k.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-C(-t):C(t);if(n!==t){var o=String(n),a=v.call(e,o.length+1);return w.call(o,r,"$&_")+"."+w.call(w.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return w.call(e,r,"$&_")}var N=r(56),D=N.custom,L=G(D)?D:null,F={__proto__:null,double:'"',single:"'"},z={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function q(t,e,r){var n=r.quoteStyle||e,o=F[n];return o+t+o}function $(t){return w.call(String(t),/"/g,""")}function W(t){return!B||!("object"===n(t)&&(B in t||void 0!==t[B]))}function H(t){return"[object Array]"===X(t)&&W(t)}function U(t){return"[object RegExp]"===X(t)&&W(t)}function G(t){if(E)return t&&"object"===n(t)&&t instanceof Symbol;if("symbol"===n(t))return!0;if(!t||"object"!==n(t)||!P)return!1;try{return P.call(t),!0}catch(t){}return!1}t.exports=function t(r,o,a,c){var l=o||{};if(V(l,"quoteStyle")&&!V(F,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var g=!V(l,"customInspect")||l.customInspect;if("boolean"!=typeof g&&"symbol"!==g)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var M=l.numericSeparator;if(void 0===r)return"undefined";if(null===r)return"null";if("boolean"==typeof r)return r?"true":"false";if("string"==typeof r)return function t(e,r){if(e.length>r.maxStringLength){var n=e.length-r.maxStringLength,o="... "+n+" more character"+(n>1?"s":"");return t(v.call(e,0,r.maxStringLength),r)+o}var a=z[r.quoteStyle||"single"];return a.lastIndex=0,q(w.call(w.call(e,a,"\\$1"),/[\x00-\x1f]/g,Y),"single",r)}(r,l);if("number"==typeof r){if(0===r)return 1/0/r>0?"0":"-0";var k=String(r);return M?T(r,k):k}if("bigint"==typeof r){var C=String(r)+"n";return M?T(r,C):C}var _=void 0===l.depth?5:l.depth;if(void 0===a&&(a=0),a>=_&&_>0&&"object"===n(r))return H(r)?"[Array]":"[Object]";var D=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=j.call(Array(t.indent+1)," ")}return{base:r,prev:j.call(Array(e+1),r)}}(l,a);if(void 0===c)c=[];else if(K(c,r)>=0)return"[Circular]";function J(e,r,n){if(r&&(c=x.call(c)).push(r),n){var o={depth:l.depth};return V(l,"quoteStyle")&&(o.quoteStyle=l.quoteStyle),t(e,o,a+1,c)}return t(e,l,a+1,c)}if("function"==typeof r&&!U(r)){var nt=function(t){if(t.name)return t.name;var e=m.call(b.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(r),ot=rt(r,J);return"[Function"+(nt?": "+nt:" (anonymous)")+"]"+(ot.length>0?" { "+j.call(ot,", ")+" }":"")}if(G(r)){var at=E?w.call(String(r),/^(Symbol\(.*\))_[^)]*$/,"$1"):P.call(r);return"object"!==n(r)||E?at:Z(at)}if(function(t){if(!t||"object"!==n(t))return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(r)){for(var it="<"+S.call(String(r.nodeName)),ut=r.attributes||[],ct=0;ct<ut.length;ct++)it+=" "+ut[ct].name+"="+q($(ut[ct].value),"double",l);return it+=">",r.childNodes&&r.childNodes.length&&(it+="..."),it+="</"+S.call(String(r.nodeName))+">"}if(H(r)){if(0===r.length)return"[]";var lt=rt(r,J);return D&&!function(t){for(var e=0;e<t.length;e++)if(K(t[e],"\n")>=0)return!1;return!0}(lt)?"["+et(lt,D)+"]":"[ "+j.call(lt,", ")+" ]"}if(function(t){return"[object Error]"===X(t)&&W(t)}(r)){var st=rt(r,J);return"cause"in Error.prototype||!("cause"in r)||R.call(r,"cause")?0===st.length?"["+String(r)+"]":"{ ["+String(r)+"] "+j.call(st,", ")+" }":"{ ["+String(r)+"] "+j.call(O.call("[cause]: "+J(r.cause),st),", ")+" }"}if("object"===n(r)&&g){if(L&&"function"==typeof r[L]&&N)return N(r,{depth:_-a});if("symbol"!==g&&"function"==typeof r.inspect)return r.inspect()}if(function(t){if(!i||!t||"object"!==n(t))return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(r)){var ft=[];return u&&u.call(r,(function(t,e){ft.push(J(e,r,!0)+" => "+J(t,r))})),tt("Map",i.call(r),ft,D)}if(function(t){if(!s||!t||"object"!==n(t))return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(r)){var pt=[];return f&&f.call(r,(function(t){pt.push(J(t,r))})),tt("Set",s.call(r),pt,D)}if(function(t){if(!p||!t||"object"!==n(t))return!1;try{p.call(t,p);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(r))return Q("WeakMap");if(function(t){if(!h||!t||"object"!==n(t))return!1;try{h.call(t,h);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(r))return Q("WeakSet");if(function(t){if(!y||!t||"object"!==n(t))return!1;try{return y.call(t),!0}catch(t){}return!1}(r))return Q("WeakRef");if(function(t){return"[object Number]"===X(t)&&W(t)}(r))return Z(J(Number(r)));if(function(t){if(!t||"object"!==n(t)||!A)return!1;try{return A.call(t),!0}catch(t){}return!1}(r))return Z(J(A.call(r)));if(function(t){return"[object Boolean]"===X(t)&&W(t)}(r))return Z(d.call(r));if(function(t){return"[object String]"===X(t)&&W(t)}(r))return Z(J(String(r)));if("undefined"!=typeof window&&r===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&r===globalThis||void 0!==e&&r===e)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===X(t)&&W(t)}(r)&&!U(r)){var ht=rt(r,J),yt=I?I(r)===Object.prototype:r instanceof Object||r.constructor===Object,dt=r instanceof Object?"":"null prototype",gt=!yt&&B&&Object(r)===r&&B in r?v.call(X(r),8,-1):dt?"Object":"",bt=(yt||"function"!=typeof r.constructor?"":r.constructor.name?r.constructor.name+" ":"")+(gt||dt?"["+j.call(O.call([],gt||[],dt||[]),": ")+"] ":"");return 0===ht.length?bt+"{}":D?bt+"{"+et(ht,D)+"}":bt+"{ "+j.call(ht,", ")+" }"}return String(r)};var J=Object.prototype.hasOwnProperty||function(t){return t in this};function V(t,e){return J.call(t,e)}function X(t){return g.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function Y(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+M.call(e.toString(16))}function Z(t){return"Object("+t+")"}function Q(t){return t+" { ? }"}function tt(t,e,r,n){return t+" ("+e+") {"+(n?et(r,n):j.call(r,", "))+"}"}function et(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+j.call(t,","+r)+"\n"+e.prev}function rt(t,e){var r=H(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=V(t,o)?e(t[o],t):""}var a,i="function"==typeof _?_(t):[];if(E){a={};for(var u=0;u<i.length;u++)a["$"+i[u]]=i[u]}for(var c in t)V(t,c)&&(r&&String(Number(c))===c&&c<t.length||E&&a["$"+c]instanceof Symbol||(k.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if("function"==typeof _)for(var l=0;l<i.length;l++)R.call(t,i[l])&&n.push("["+e(i[l])+"]: "+e(t[i[l]],t));return n}}).call(this,r(55))},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return"string"==typeof t||"symbol"===n(t)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=Object.prototype.toString;t.exports=function(t){var e=o.call(t),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==t&&"object"===n(t)&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===o.call(t.callee)),r}},function(t,e,r){"use strict";r(22)()},function(t,e,r){"use strict";var n=r(23),o=r(62);t.exports=function(){var t=n();return o(Object,{hasOwn:t},{hasOwn:function(){return Object.hasOwn!==t}}),t}},function(t,e,r){"use strict";var n=r(24);t.exports=function(){return Object.hasOwn||n}},function(t,e,r){"use strict";var n=r(25),o=r(27),a=r(59);t.exports=function(t,e){var r=n(t),i=o(e);return a(r,i)}},function(t,e,r){"use strict";var n=r(4),o=r(26);t.exports=function(t){return o(t),n(t)}},function(t,e,r){"use strict";var n=r(0);t.exports=function(t){if(null==t)throw new n(arguments.length>0&&arguments[1]||"Cannot call method on "+t);return t}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(5)("%String%"),a=r(47),i=r(58);t.exports=function(t){var e=a(t,o);return"symbol"===n(e)?e:i(e)}},function(t,e,r){"use strict";t.exports=Error},function(t,e,r){"use strict";t.exports=EvalError},function(t,e,r){"use strict";t.exports=RangeError},function(t,e,r){"use strict";t.exports=ReferenceError},function(t,e,r){"use strict";t.exports=URIError},function(t,e,r){"use strict";t.exports=Math.abs},function(t,e,r){"use strict";t.exports=Math.floor},function(t,e,r){"use strict";t.exports=Math.max},function(t,e,r){"use strict";t.exports=Math.min},function(t,e,r){"use strict";t.exports=Math.pow},function(t,e,r){"use strict";t.exports=Math.round},function(t,e,r){"use strict";var n=r(40);t.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},function(t,e,r){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},function(t,e,r){"use strict";t.exports=Object.getOwnPropertyDescriptor},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(12),a=r(13),i=r(43);t.exports=o?function(t){return o(t)}:a?function(t){if(!t||"object"!==n(t)&&"function"!=typeof t)throw new TypeError("getProto: not an object");return a(t)}:i?function(t){return i(t)}:null},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o,a=r(14),i=r(1);try{o=[].__proto__===Array.prototype}catch(t){if(!t||"object"!==n(t)||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var u=!!o&&i&&i(Object.prototype,"__proto__"),c=Object,l=c.getPrototypeOf;t.exports=u&&"function"==typeof u.get?a([u.get]):"function"==typeof l&&function(t){return l(null==t?t:c(t))}},function(t,e,r){"use strict";var n="Function.prototype.bind called on incompatible ",o=Object.prototype.toString,a=Math.max,i=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var o=0;o<e.length;o+=1)r[o+t.length]=e[o];return r},u=function(t,e){for(var r=[],n=e||0,o=0;n<t.length;n+=1,o+=1)r[o]=t[n];return r},c=function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r};t.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==o.apply(e))throw new TypeError(n+e);for(var r,l=u(arguments,1),s=function(){if(this instanceof r){var n=e.apply(this,i(l,arguments));return Object(n)===n?n:this}return e.apply(t,i(l,arguments))},f=a(0,e.length-l.length),p=[],h=0;h<f;h++)p[h]="$"+h;if(r=Function("binder","return function ("+c(p,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var y=function(){};y.prototype=e.prototype,r.prototype=new y,y.prototype=null}return r}},function(t,e,r){"use strict";var n=r(2),o=r(15),a=r(7),i=r(46);t.exports=i||n.call(a,o)},function(t,e,r){"use strict";t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},function(t,e,r){"use strict";var n=r(48);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator),a=r(16),i=r(49),u=r(50),c=r(0),l=r(53);function s(t,e){if(null==t)throw new c("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new c('hint must be "string" or "number"');var r,n,o,i="string"===e?["toString","valueOf"]:["valueOf","toString"];for(o=0;o<i.length;++o)if(r=t[i[o]],a(r)&&(n=r.call(t),l(n)))return n;throw new c("No default value")}var f=r(54);t.exports=function(t){if(l(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),o&&(Symbol.toPrimitive?e=f(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var n=e.call(t,r);if(l(n))return n;throw new c("unable to convert exotic object to primitive")}return"default"===r&&(i(t)||u(t))&&(r="string"),s(t,"default"===r?"number":r)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(3),a=o("Date.prototype.getDay"),i=o("Object.prototype.toString"),u=r(17)();t.exports=function(t){return"object"===n(t)&&null!==t&&(u?function(t){try{return a(t),!0}catch(t){return!1}}(t):"[object Date]"===i(t))}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(3),a=o("Object.prototype.toString"),i=r(10)(),u=r(51);if(i){var c=o("Symbol.prototype.toString"),l=u(/^Symbol\(.*\)$/);t.exports=function(t){if("symbol"===n(t))return!0;if(!t||"object"!==n(t)||"[object Symbol]"!==a(t))return!1;try{return function(t){return"symbol"===n(t.valueOf())&&l(c(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},function(t,e,r){"use strict";var n=r(3),o=r(52),a=n("RegExp.prototype.exec"),i=r(0);t.exports=function(t){if(!o(t))throw new i("`regex` must be a RegExp");return function(e){return null!==a(t,e)}}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o,a=r(3),i=r(17)(),u=r(8),c=r(1);if(i){var l=a("RegExp.prototype.exec"),s={},f=function(){throw s},p={toString:f,valueOf:f};"symbol"===n(Symbol.toPrimitive)&&(p[Symbol.toPrimitive]=f),o=function(t){if(!t||"object"!==n(t))return!1;var e=c(t,"lastIndex");if(!(e&&u(e,"value")))return!1;try{l(t,p)}catch(t){return t===s}}}else{var h=a("Object.prototype.toString");o=function(t){return!(!t||"object"!==n(t)&&"function"!=typeof t)&&"[object RegExp]"===h(t)}}t.exports=o},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return null===t||"function"!=typeof t&&"object"!==n(t)}},function(t,e,r){"use strict";var n=r(0),o=r(16),a=r(18),i=r(57),u=r(19);t.exports=function(t,e){if(!u(e))throw new n("Assertion failed: P is not a Property Key");var r=i(t,e);if(null!=r){if(!o(r))throw new n(a(e)+" is not a function: "+a(r));return r}}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(n=window)}t.exports=n},function(t,e){},function(t,e,r){"use strict";var n=r(0),o=r(18),a=r(19);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: P is not a Property Key, got "+o(e));return t[e]}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(5)("%String%"),a=r(0);t.exports=function(t){if("symbol"===n(t))throw new a("Cannot convert a Symbol value to a string");return o(t)}},function(t,e,r){"use strict";var n=r(0),o=r(8),a=r(60),i=r(61);t.exports=function(t,e){if(!a(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");return o(t,e)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return!!t&&("function"==typeof t||"object"===n(t))}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return"string"==typeof t||"symbol"===n(t)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(63),a="function"==typeof Symbol&&"symbol"===n(Symbol("foo")),i=Object.prototype.toString,u=Array.prototype.concat,c=r(65),l=r(66)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;l?c(t,e,r,!0):c(t,e,r)},f=function(t,e){var r=arguments.length>2?arguments[2]:{},n=o(e);a&&(n=u.call(n,Object.getOwnPropertySymbols(e)));for(var i=0;i<n.length;i+=1)s(t,n[i],e[n[i]],r[n[i]])};f.supportsDescriptors=!!l,t.exports=f},function(t,e,r){"use strict";var n=Array.prototype.slice,o=r(20),a=Object.keys,i=a?function(t){return a(t)}:r(64),u=Object.keys;i.shim=function(){Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)}):Object.keys=i;return Object.keys||i},t.exports=i},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o;if(!Object.keys){var a=Object.prototype.hasOwnProperty,i=Object.prototype.toString,u=r(20),c=Object.prototype.propertyIsEnumerable,l=!c.call({toString:null},"toString"),s=c.call((function(){}),"prototype"),f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&a.call(window,t)&&null!==window[t]&&"object"===n(window[t]))try{p(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();o=function(t){var e=null!==t&&"object"===n(t),r="[object Function]"===i.call(t),o=u(t),c=e&&"[object String]"===i.call(t),h=[];if(!e&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(c&&t.length>0&&!a.call(t,0))for(var g=0;g<t.length;++g)h.push(String(g));if(o&&t.length>0)for(var b=0;b<t.length;++b)h.push(String(b));else for(var m in t)d&&"prototype"===m||!a.call(t,m)||h.push(String(m));if(l)for(var v=function(t){if("undefined"==typeof window||!y)return p(t);try{return p(t)}catch(t){return!1}}(t),w=0;w<f.length;++w)v&&"constructor"===f[w]||!a.call(t,f[w])||h.push(f[w]);return h}}t.exports=o},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(6),a=r(9),i=r(0),u=r(1);t.exports=function(t,e,r){if(!t||"object"!==n(t)&&"function"!=typeof t)throw new i("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!==n(e))throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,f=arguments.length>6&&arguments[6],p=!!u&&u(t,e);if(o)o(t,e,{configurable:null===s&&p?p.configurable:!s,enumerable:null===c&&p?p.enumerable:!c,value:r,writable:null===l&&p?p.writable:!l});else{if(!f&&(c||l||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},function(t,e,r){"use strict";var n=r(6),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},function(t,e,r){"use strict";r.r(e),r.d(e,"run",(function(){return vu})),r.d(e,"init",(function(){return wu})),r.d(e,"convertBg",(function(){return Mu})),r.d(e,"updateStyle",(function(){return Su})),r.d(e,"getContrast",(function(){return ku})),r.d(e,"extend",(function(){return Ou}));var n={};r.r(n),r.d(n,"color",(function(){return Qe})),r.d(n,"colorBurn",(function(){return Ge})),r.d(n,"colorDodge",(function(){return Ue})),r.d(n,"darken",(function(){return We})),r.d(n,"difference",(function(){return Xe})),r.d(n,"exclusion",(function(){return Ke})),r.d(n,"hardLight",(function(){return Je})),r.d(n,"hue",(function(){return Ye})),r.d(n,"lighten",(function(){return He})),r.d(n,"luminosity",(function(){return tr})),r.d(n,"multiply",(function(){return ze})),r.d(n,"normal",(function(){return Fe})),r.d(n,"overlay",(function(){return $e})),r.d(n,"saturation",(function(){return Ze})),r.d(n,"screen",(function(){return qe})),r.d(n,"softLight",(function(){return Ve}));var o="(prefers-color-scheme: dark)",a=new RegExp("".concat("js_darkmode__","\\d+")),i="data_color_scheme_dark",u="".concat(1*new Date).concat(Math.round(10*Math.random())),c="data-darkmode-color-".concat(u),l="data-darkmode-bgcolor-".concat(u),s="data-darkmode-original-color-".concat(u),f="data-darkmode-original-bgcolor-".concat(u),p="data-darkmode-bgimage-".concat(u),h="data-darkmode-complementary-bgimagecolor-".concat(u),y=window.getInnerHeight&&window.getInnerHeight()||window.innerHeight||document.documentElement.clientHeight,d={BG_COLOR:["background-color","background-image","background"],TEXT_SHADOW:["text-shadow"],TEXT_COLOR:["-webkit-text-stroke","-webkit-text-stroke-color","text-decoration","text-decoration-color","text-emphasis-color","color","-webkit-text-fill-color"],BORDER_COLOR:["border-image","-webkit-border-image","border","border-top","border-right","border-bottom","border-left","border-color","border-top-color","border-right-color","border-bottom-color","border-left-color","border-block-color","border-block-start-color","border-block-end-color","border-inline-color","border-inline-start-color","border-inline-end-color","outline","outline-color","box-shadow","column-rule","column-rule-color"]},g=Object.keys(d).map((function(t){return d[t].join("|")})).join("|").split("|"),b=["TABLE","TR","TD","TH"],m=/ !important$/,v=/<\$#_SEMICOLON_#\$>/g,w="\\b((rgba?)|((ok)?lch)|((ok)?lab)|(color))\\([^)]+\\)",M=new RegExp(w,"i"),S=new RegExp(w,"ig"),k={hasInit:!1,begin:null,showFirstPage:null,error:null,mode:"",whitelist:{tagName:["MPCPS","IFRAME"],attribute:[]},needJudgeFirstPage:!0,delayBgJudge:!1,container:null,cssSelectorsPrefix:"",defaultLightTextColor:"#191919",defaultLightBgColor:"#fff",defaultDarkTextColor:"#a3a3a3",defaultDarkBgColor:"#191919",set:function(t,e,r){var n=e[r];switch(t){case"boolean":"boolean"==typeof n&&(this[r]=n);break;case"string":"string"==typeof n&&""!==n&&(this[r]=n);break;case"function":"function"==typeof n&&(this[r]=n);break;case"dom":n instanceof HTMLElement&&(this[r]=n)}}};function O(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function C(t,e,r){return e&&x(t.prototype,e),r&&x(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var A=[],_=[],P=function(){function t(){j(this,t)}return C(t,[{key:"loopTimes",get:function(){return cu.loopTimes}},{key:"isDarkmode",get:function(){return hu.isDarkmode}},{key:"addCss",value:function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];(r?A:_).push(fu.genCss(t,e.map((function(t){var e=t.key,r=t.value;return fu.genCssKV(e,r)})).join("")))}}]),t}(),E=function(){function t(){j(this,t),O(this,"_plugins",[]),O(this,"length",0),O(this,"loopTimes",0),O(this,"firstPageStyle",""),O(this,"otherPageStyle",""),O(this,"firstPageStyleNoMQ",""),O(this,"otherPageStyleNoMQ","")}return C(t,[{key:"extend",value:function(t){this._plugins.push(new(t(P))),this.length++}},{key:"emit",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];this._plugins.forEach((function(e){"function"==typeof e[t]&&e[t].apply(e,r)}))}},{key:"addCss",value:function(t){t?(this.firstPageStyle+=A.join(""),this.firstPageStyleNoMQ+=_.join("")):(this.otherPageStyle+=A.join(""),this.otherPageStyleNoMQ+=_.join(""))}},{key:"resetCss",value:function(){A=[],_=[]}}]),t}();function B(t){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function I(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var T=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),I(this,"_queue",[]),I(this,"_idx",0),this._prefix=e}var e,r,n;return e=t,(r=[{key:"length",get:function(){return this._queue.length}},{key:"push",value:function(t){var e="".concat(this._prefix).concat(this._idx++);t.classList.add(e),this._queue.push({el:t,className:e,updated:!k.delayBgJudge})}},{key:"forEach",value:function(t){var e=[];for(this._queue.forEach((function(r,n){r.updated&&(e.unshift(n),B(t)&&t(r.el))}));e.length;)this._queue.splice(e.shift(),1)}},{key:"update",value:function(t){this._queue.forEach((function(e){e.updated||Array.prototype.some.call(t,(function(t){return!(1!==t.nodeType||!t.classList.contains(e.className)||(e.el=t,e.updated=!0,0))}))}))}}])&&R(e.prototype,r),n&&R(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function N(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function D(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var L=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),D(this,"_stack",[]),D(this,"_idx",0),this._prefix=e,this.classNameReg=new RegExp("".concat(this._prefix,"\\d+"))}var e,r,n;return e=t,(r=[{key:"push",value:function(t,e,r){var n="".concat(this._prefix).concat(this._idx++);t.classList.add(n),this._stack.unshift({elOld:t,el:t,className:n,cssKV:e,updated:!k.delayBgJudge,cb:r})}},{key:"contains",value:function(t,e){var r=t.getBoundingClientRect(),n=[];for(this._stack.forEach((function(t,e){if(t.updated){t.rect||(t.rect=t.el.getBoundingClientRect());var o=t.rect;r.top>=o.bottom||r.bottom<=o.top||r.left>=o.right||r.right<=o.left||n.unshift(e)}}));n.length;){var o=n.shift(),a=this._stack.splice(o,1)[0];"function"==typeof e&&e(a)}}},{key:"update",value:function(t){this._stack.forEach((function(e){e.updated||Array.prototype.some.call(t,(function(t){return!(1!==t.nodeType||!t.classList.contains(e.className)||(e.el=t,e.updated=!0,0))}))}))}}])&&N(e.prototype,r),n&&N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function F(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return z(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function q(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var W=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),$(this,"_firstPageStyle",""),$(this,"_otherPageStyle",""),$(this,"_watcher",{}),$(this,"isFinish",!1)}var e,r,n;return e=t,(r=[{key:"genCssKV",value:function(t,e){var r,n;return null===(r=(n=this._watcher)[t])||void 0===r||r.call(n),"".concat(t,": ").concat(e," !important;")}},{key:"genCss",value:function(t,e){return"".concat("dark"===k.mode?"html.".concat(i," "):"").concat(k.cssSelectorsPrefix&&"".concat(k.cssSelectorsPrefix," "),".").concat(t,"{").concat(e,"}")}},{key:"addCss",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this[e?"_firstPageStyle":"_otherPageStyle"]+=t,cu.addCss(e)}},{key:"writeStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!t&&hu.isDarkmode&&(this.isFinish=!0);var e=(hu.isDarkmode?[{target:this,key:["_firstPageStyle","_otherPageStyle"],needMediaQuery:!0}]:[]).concat([{target:cu,key:["firstPageStyle","otherPageStyle"],needMediaQuery:!0},{target:cu,key:["firstPageStyleNoMQ","otherPageStyleNoMQ"],needMediaQuery:!1}]).map((function(e){var r=e.target,n=F(e.key,2),a=n[0],i=n[1],u=e.needMediaQuery,c="";t?c=a:(r[i]=r[a]+r[i],r[a]="",c=i);var l=r[c];return l?(r[c]="","dark"!==k.mode&&u?"@media ".concat(o," {").concat(l,"}"):l):""})).join("");e&&document.head.insertAdjacentHTML("beforeend",'<style type="text/css">'.concat(e,"</style>"))}},{key:"watch",value:function(t,e){this._watcher[t]=e}},{key:"unwatch",value:function(t){delete this._watcher[t]}}])&&q(e.prototype,r),n&&q(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function H(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function U(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G(t){return function(t){if(Array.isArray(t))return J(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return J(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return J(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function V(t){var e,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(e=r?[]:[t]).concat.apply(e,G(t.querySelectorAll("*")))}var X={"ue-table-interlace-color-single":"#fcfcfc","ue-table-interlace-color-double":"#f7faff"};var K=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),U(this,"_els",[]),U(this,"_firstPageEls",[]),U(this,"_delayEls",[]),U(this,"showFirstPage",!1)}var e,r,n;return e=t,(r=[{key:"length",get:function(){return this._els.length}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._els=t}},{key:"get",value:function(){var t=[];return this._els.length?(t=this._els,hu.isDarkmode&&(this._els=[])):this._delayEls.length?(t=this._delayEls,this._delayEls=[]):k.container&&(t=k.container.querySelectorAll("*")),t}},{key:"delay",value:function(){var t=this;Array.prototype.forEach.call(this._els,(function(e){return t._delayEls.push(e)})),this._els=[]}},{key:"hasDelay",value:function(){return!this._els.length&&(this._delayEls.length>0||null!==k.container)}},{key:"addFirstPageNode",value:function(t){this._firstPageEls.push(t)}},{key:"showFirstPageNodes",value:function(){this._firstPageEls.forEach((function(t){return!t.style.visibility&&(t.style.visibility="visible")})),this.showFirstPage=!0}},{key:"emptyFirstPageNodes",value:function(){this._firstPageEls=[]}}])&&H(e.prototype,r),n&&H(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Y={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]};for(var Z in Y)Object.freeze(Y[Z]);var Q=Object.freeze(Y),tt=Object.create(null);for(var et in Q)Object.hasOwn(Q,et)&&(tt[Q[et]]=et);var rt={to:{},get:{}};function nt(t,e,r){return Math.min(Math.max(e,t),r)}function ot(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}rt.get=function(t){var e,r;switch(t.slice(0,3).toLowerCase()){case"hsl":e=rt.get.hsl(t),r="hsl";break;case"hwb":e=rt.get.hwb(t),r="hwb";break;default:e=rt.get.rgb(t),r="rgb"}return e?{model:r,value:e}:null},rt.get.rgb=function(t){if(!t)return null;var e,r,n,o=[0,0,0,1];if(e=t.match(/^#([a-f\d]{6})([a-f\d]{2})?$/i)){for(n=e[2],e=e[1],r=0;r<3;r++){var a=2*r;o[r]=Number.parseInt(e.slice(a,a+2),16)}n&&(o[3]=Number.parseInt(n,16)/255)}else if(e=t.match(/^#([a-f\d]{3,4})$/i)){for(n=(e=e[1])[3],r=0;r<3;r++)o[r]=Number.parseInt(e[r]+e[r],16);n&&(o[3]=Number.parseInt(n+n,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i)){for(r=0;r<3;r++)o[r]=Number.parseFloat(e[r+1]);e[4]&&(o[3]=e[5]?.01*Number.parseFloat(e[4]):Number.parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i)))return(e=t.toLowerCase().match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:Object.hasOwn(Q,e[1])?((o=Q[e[1]].slice())[3]=1,o):null:null;for(r=0;r<3;r++)o[r]=Math.round(2.55*Number.parseFloat(e[r+1]));e[4]&&(o[3]=e[5]?.01*Number.parseFloat(e[4]):Number.parseFloat(e[4]))}for(r=0;r<3;r++)o[r]=nt(o[r],0,255);return o[3]=nt(o[3],0,1),o},rt.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(e){var r=Number.parseFloat(e[4]);return[(Number.parseFloat(e[1])%360+360)%360,nt(Number.parseFloat(e[2]),0,100),nt(Number.parseFloat(e[3]),0,100),nt(Number.isNaN(r)?1:r,0,1)]}return null},rt.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(e){var r=Number.parseFloat(e[4]);return[(Number.parseFloat(e[1])%360+360)%360,nt(Number.parseFloat(e[2]),0,100),nt(Number.parseFloat(e[3]),0,100),nt(Number.isNaN(r)?1:r,0,1)]}return null},rt.to.hex=function(){return"#"+ot(arguments.length<=0?void 0:arguments[0])+ot(arguments.length<=1?void 0:arguments[1])+ot(arguments.length<=2?void 0:arguments[2])+((arguments.length<=3?void 0:arguments[3])<1?ot(Math.round(255*(arguments.length<=3?void 0:arguments[3]))):"")},rt.to.rgb=function(){return arguments.length<4||1===(arguments.length<=3?void 0:arguments[3])?"rgb("+Math.round(arguments.length<=0?void 0:arguments[0])+", "+Math.round(arguments.length<=1?void 0:arguments[1])+", "+Math.round(arguments.length<=2?void 0:arguments[2])+")":"rgba("+Math.round(arguments.length<=0?void 0:arguments[0])+", "+Math.round(arguments.length<=1?void 0:arguments[1])+", "+Math.round(arguments.length<=2?void 0:arguments[2])+", "+(arguments.length<=3?void 0:arguments[3])+")"},rt.to.rgb.percent=function(){var t=Math.round((arguments.length<=0?void 0:arguments[0])/255*100),e=Math.round((arguments.length<=1?void 0:arguments[1])/255*100),r=Math.round((arguments.length<=2?void 0:arguments[2])/255*100);return arguments.length<4||1===(arguments.length<=3?void 0:arguments[3])?"rgb("+t+"%, "+e+"%, "+r+"%)":"rgba("+t+"%, "+e+"%, "+r+"%, "+(arguments.length<=3?void 0:arguments[3])+")"},rt.to.hsl=function(){return arguments.length<4||1===(arguments.length<=3?void 0:arguments[3])?"hsl("+(arguments.length<=0?void 0:arguments[0])+", "+(arguments.length<=1?void 0:arguments[1])+"%, "+(arguments.length<=2?void 0:arguments[2])+"%)":"hsla("+(arguments.length<=0?void 0:arguments[0])+", "+(arguments.length<=1?void 0:arguments[1])+"%, "+(arguments.length<=2?void 0:arguments[2])+"%, "+(arguments.length<=3?void 0:arguments[3])+")"},rt.to.hwb=function(){var t="";return arguments.length>=4&&1!==(arguments.length<=3?void 0:arguments[3])&&(t=", "+(arguments.length<=3?void 0:arguments[3])),"hwb("+(arguments.length<=0?void 0:arguments[0])+", "+(arguments.length<=1?void 0:arguments[1])+"%, "+(arguments.length<=2?void 0:arguments[2])+"%"+t+")"},rt.to.keyword=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return tt[e.slice(0,3)]};var at=rt;function it(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}(t,e)||ct(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ut(t){return function(t){if(Array.isArray(t))return lt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ct(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ct(t,e){if(t){if("string"==typeof t)return lt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?lt(t,e):void 0}}function lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}for(var st={},ft=0,pt=Object.keys(Q);ft<pt.length;ft++){var ht=pt[ft];st[Q[ht]]=ht}var yt={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"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},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"]}},dt=yt,gt=Math.pow(6/29,3);function bt(t){var e=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t;return Math.min(Math.max(0,e),1)}function mt(t){return t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92}for(var vt=0,wt=Object.keys(yt);vt<wt.length;vt++){var Mt=wt[vt];if(!("channels"in yt[Mt]))throw new Error("missing channels property: "+Mt);if(!("labels"in yt[Mt]))throw new Error("missing channel labels property: "+Mt);if(yt[Mt].labels.length!==yt[Mt].channels)throw new Error("channel and label counts mismatch: "+Mt);var St=yt[Mt],kt=St.channels,Ot=St.labels;delete yt[Mt].channels,delete yt[Mt].labels,Object.defineProperty(yt[Mt],"channels",{value:kt}),Object.defineProperty(yt[Mt],"labels",{value:Ot})}function jt(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}function xt(t){var e=function(){for(var t={},e=Object.keys(dt),r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}(),r=[t];for(e[t].distance=0;r.length>0;)for(var n=r.pop(),o=Object.keys(dt[n]),a=o.length,i=0;i<a;i++){var u=o[i],c=e[u];-1===c.distance&&(c.distance=e[n].distance+1,c.parent=n,r.unshift(u))}return e}function Ct(t,e){return function(r){return e(t(r))}}function At(t,e){for(var r=[e[t].parent,t],n=dt[e[t].parent][t],o=e[t].parent;e[o].parent;)r.unshift(e[o].parent),n=Ct(dt[e[o].parent][o],n),o=e[o].parent;return n.conversion=r,n}yt.rgb.hsl=function(t){var e,r=t[0]/255,n=t[1]/255,o=t[2]/255,a=Math.min(r,n,o),i=Math.max(r,n,o),u=i-a;switch(i){case a:e=0;break;case r:e=(n-o)/u;break;case n:e=2+(o-r)/u;break;case o:e=4+(r-n)/u}(e=Math.min(60*e,360))<0&&(e+=360);var c=(a+i)/2;return[e,100*(i===a?0:c<=.5?u/(i+a):u/(2-i-a)),100*c]},yt.rgb.hsv=function(t){var e,r,n,o,a,i=t[0]/255,u=t[1]/255,c=t[2]/255,l=Math.max(i,u,c),s=l-Math.min(i,u,c),f=function(t){return(l-t)/6/s+.5};if(0===s)o=0,a=0;else{switch(a=s/l,e=f(i),r=f(u),n=f(c),l){case i:o=n-r;break;case u:o=1/3+e-n;break;case c:o=2/3+r-e}o<0?o+=1:o>1&&(o-=1)}return[360*o,100*a,100*l]},yt.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[yt.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(r,n))),100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},yt.rgb.oklab=function(t){var e=mt(t[0]/255),r=mt(t[1]/255),n=mt(t[2]/255),o=Math.cbrt(.4122214708*e+.5363325363*r+.0514459929*n),a=Math.cbrt(.2119034982*e+.6806995451*r+.1073969566*n),i=Math.cbrt(.0883024619*e+.2817188376*r+.6299787005*n);return[100*(.2104542553*o+.793617785*a-.0040720468*i),100*(1.9779984951*o-2.428592205*a+.4505937099*i),100*(.0259040371*o+.7827717662*a-.808675766*i)]},yt.rgb.cmyk=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,o=Math.min(1-e,1-r,1-n);return[100*((1-e-o)/(1-o)||0),100*((1-r-o)/(1-o)||0),100*((1-n-o)/(1-o)||0),100*o]},yt.rgb.keyword=function(t){var e=st[t];if(e)return e;for(var r,n=Number.POSITIVE_INFINITY,o=0,a=Object.keys(Q);o<a.length;o++){var i=a[o],u=jt(t,Q[i]);u<n&&(n=u,r=i)}return r},yt.keyword.rgb=function(t){return ut(Q[t])},yt.rgb.xyz=function(t){var e=mt(t[0]/255),r=mt(t[1]/255),n=mt(t[2]/255);return[100*(.4124564*e+.3575761*r+.1804375*n),100*(.2126729*e+.7151522*r+.072175*n),100*(.0193339*e+.119192*r+.9503041*n)]},yt.rgb.lab=function(t){var e=yt.rgb.xyz(t),r=e[0],n=e[1],o=e[2];return n/=100,o/=108.883,r=(r/=95.047)>gt?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>gt?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>gt?Math.pow(o,1/3):7.787*o+16/116))]},yt.hsl.rgb=function(t){var e,r,n=t[0]/360,o=t[1]/100,a=t[2]/100;if(0===o)return[r=255*a,r,r];for(var i=a<.5?a*(1+o):a+o-a*o,u=2*a-i,c=[0,0,0],l=0;l<3;l++)(e=n+1/3*-(l-1))<0&&e++,e>1&&e--,r=6*e<1?u+6*(i-u)*e:2*e<1?i:3*e<2?u+(i-u)*(2/3-e)*6:u,c[l]=255*r;return c},yt.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,o=r,a=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=a<=1?a:2-a,[e,100*(0===n?2*o/(a+o):2*r/(n+r)),100*((n+r)/2)]},yt.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,o=Math.floor(e)%6,a=e-Math.floor(e),i=255*n*(1-r),u=255*n*(1-r*a),c=255*n*(1-r*(1-a));switch(n*=255,o){case 0:return[n,c,i];case 1:return[u,n,i];case 2:return[i,n,c];case 3:return[i,u,n];case 4:return[c,i,n];case 5:return[n,i,u]}},yt.hsv.hsl=function(t){var e,r,n=t[0],o=t[1]/100,a=t[2]/100,i=Math.max(a,.01);r=(2-o)*a;var u=(2-o)*i;return e=o*i,[n,100*(e=(e/=u<=1?u:2-u)||0),100*(r/=2)]},yt.hwb.rgb=function(t){var e,r=t[0]/360,n=t[1]/100,o=t[2]/100,a=n+o;a>1&&(n/=a,o/=a);var i=Math.floor(6*r),u=1-o;e=6*r-i,0!=(1&i)&&(e=1-e);var c,l,s,f=n+e*(u-n);switch(i){default:case 6:case 0:c=u,l=f,s=n;break;case 1:c=f,l=u,s=n;break;case 2:c=n,l=u,s=f;break;case 3:c=n,l=f,s=u;break;case 4:c=f,l=n,s=u;break;case 5:c=u,l=n,s=f}return[255*c,255*l,255*s]},yt.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,o=t[3]/100;return[255*(1-Math.min(1,e*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},yt.xyz.rgb=function(t){var e,r,n=t[0]/100,o=t[1]/100,a=t[2]/100;return e=-.969266*n+1.8760108*o+.041556*a,r=.0556434*n+-.2040259*o+1.0572252*a,[255*bt(3.2404542*n+-1.5371385*o+-.4985314*a),255*(e=bt(e)),255*(r=bt(r))]},yt.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return r/=100,n/=108.883,e=(e/=95.047)>gt?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>gt?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>gt?Math.pow(n,1/3):7.787*n+16/116))]},yt.xyz.oklab=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,o=Math.cbrt(.8189330101*e+.3618667424*r-.1288597137*n),a=Math.cbrt(.0329845436*e+.9293118715*r+.0361456387*n),i=Math.cbrt(.0482003018*e+.2643662691*r+.633851707*n);return[100*(.2104542553*o+.793617785*a-.0040720468*i),100*(1.9779984951*o-2.428592205*a+.4505937099*i),100*(.0259040371*o+.7827717662*a-.808675766*i)]},yt.oklab.oklch=function(t){return yt.lab.lch(t)},yt.oklab.xyz=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,o=Math.pow(.999999998*e+.396337792*r+.215803758*n,3),a=Math.pow(1.000000008*e-.105561342*r-.063854175*n,3),i=Math.pow(1.000000055*e-.089484182*r-1.291485538*n,3);return[100*(1.227013851*o-.55779998*a+.281256149*i),100*(-.040580178*o+1.11225687*a-.071676679*i),100*(-.076381285*o-.421481978*a+1.58616322*i)]},yt.oklab.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,o=Math.pow(e+.3963377774*r+.2158037573*n,3),a=Math.pow(e-.1055613458*r-.0638541728*n,3),i=Math.pow(e-.0894841775*r-1.291485548*n,3);return[255*bt(4.0767416621*o-3.3077115913*a+.2309699292*i),255*bt(-1.2684380046*o+2.6097574011*a-.3413193965*i),255*bt(-.0041960863*o-.7034186147*a+1.707614701*i)]},yt.oklch.oklab=function(t){return yt.lch.lab(t)},yt.lab.xyz=function(t){var e,r,n,o=t[0];e=t[1]/500+(r=(o+16)/116),n=r-t[2]/200;var a=Math.pow(r,3),i=Math.pow(e,3),u=Math.pow(n,3);return r=a>gt?a:(r-16/116)/7.787,e=i>gt?i:(e-16/116)/7.787,n=u>gt?u:(n-16/116)/7.787,[e*=95.047,r*=100,n*=108.883]},yt.lab.lch=function(t){var e,r=t[0],n=t[1],o=t[2];return(e=360*Math.atan2(o,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+o*o),e]},yt.lch.lab=function(t){var e=t[0],r=t[1],n=t[2]/360*2*Math.PI;return[e,r*Math.cos(n),r*Math.sin(n)]},yt.rgb.ansi16=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=it(t,3),n=r[0],o=r[1],a=r[2],i=null===e?yt.rgb.hsv(t)[2]:e;if(0===(i=Math.round(i/50)))return 30;var u=30+(Math.round(a/255)<<2|Math.round(o/255)<<1|Math.round(n/255));return 2===i&&(u+=60),u},yt.hsv.ansi16=function(t){return yt.rgb.ansi16(yt.hsv.rgb(t),t[2])},yt.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e>>4==r>>4&&r>>4==n>>4?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},yt.ansi16.rgb=function(t){var e=(t=t[0])%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=.5*(Math.trunc(t>50)+1);return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},yt.ansi256.rgb=function(t){if((t=t[0])>=232){var e=10*(t-232)+8;return[e,e,e]}var r;return t-=16,[Math.floor(t/36)/5*255,Math.floor((r=t%36)/6)/5*255,r%6/5*255]},yt.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".slice(e.length)+e},yt.hex.rgb=function(t){var e=t.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=ut(r).map((function(t){return t+t})).join(""));var n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},yt.rgb.hcg=function(t){var e,r=t[0]/255,n=t[1]/255,o=t[2]/255,a=Math.max(Math.max(r,n),o),i=Math.min(Math.min(r,n),o),u=a-i;return e=u<=0?0:a===r?(n-o)/u%6:a===n?2+(o-r)/u:4+(r-n)/u,e/=6,[360*(e%=1),100*u,100*(u<1?i/(1-u):0)]},yt.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),o=0;return n<1&&(o=(r-.5*n)/(1-n)),[t[0],100*n,100*o]},yt.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,o=0;return n<1&&(o=(r-n)/(1-n)),[t[0],100*n,100*o]},yt.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var o,a=[0,0,0],i=e%1*6,u=i%1,c=1-u;switch(Math.floor(i)){case 0:a[0]=1,a[1]=u,a[2]=0;break;case 1:a[0]=c,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=u;break;case 3:a[0]=0,a[1]=c,a[2]=1;break;case 4:a[0]=u,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=c}return o=(1-r)*n,[255*(r*a[0]+o),255*(r*a[1]+o),255*(r*a[2]+o)]},yt.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},yt.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},yt.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],100*(r-e),100*(1-r)]},yt.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,o=0;return n<1&&(o=(r-n)/(1-n)),[t[0],100*n,100*o]},yt.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},yt.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},yt.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},yt.gray.hsl=function(t){return[0,0,t[0]]},yt.gray.hsv=yt.gray.hsl,yt.gray.hwb=function(t){return[0,100,t[0]]},yt.gray.cmyk=function(t){return[0,0,0,t[0]]},yt.gray.lab=function(t){return[t[0],0,0]},yt.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".slice(r.length)+r},yt.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};var _t=function(t){for(var e=xt(t),r={},n=Object.keys(e),o=n.length,a=0;a<o;a++){var i=n[a];null!==e[i].parent&&(r[i]=At(i,e))}return r};function Pt(t){return(Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Et={};function Bt(t){var e=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var o=r[0];return null==o?o:(o.length>1&&(r=o),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function Rt(t){var e=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var o=r[0];if(null==o)return o;o.length>1&&(r=o);var a=t(r);if("object"===Pt(a))for(var i=a.length,u=0;u<i;u++)a[u]=Math.round(a[u]);return a};return"conversion"in t&&(e.conversion=t.conversion),e}for(var It=0,Tt=Object.keys(dt);It<Tt.length;It++){var Nt=Tt[It];Et[Nt]={},Object.defineProperty(Et[Nt],"channels",{value:dt[Nt].channels}),Object.defineProperty(Et[Nt],"labels",{value:dt[Nt].labels});for(var Dt=_t(Nt),Lt=0,Ft=Object.keys(Dt);Lt<Ft.length;Lt++){var zt=Ft[Lt],qt=Dt[zt];Et[Nt][zt]=Rt(qt),Et[Nt][zt].raw=Bt(qt)}}var $t=Et;function Wt(t){return(Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ht(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}(t,e)||Jt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ut(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Jt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function Gt(t){return function(t){if(Array.isArray(t))return Vt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Jt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jt(t,e){if(t){if("string"==typeof t)return Vt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Vt(t,e):void 0}}function Vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}for(var Xt=["keyword","gray","hex"],Kt={},Yt=0,Zt=Object.keys($t);Yt<Zt.length;Yt++){var Qt=Zt[Yt];Kt[Gt($t[Qt].labels).sort().join("")]=Qt}var te={};function ee(t,e){if(!(this instanceof ee))return new ee(t,e);if(e&&e in Xt&&(e=null),e&&!(e in $t))throw new Error("Unknown model: "+e);var r,n;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof ee)this.model=t.model,this.color=Gt(t.color),this.valpha=t.valpha;else if("string"==typeof t){var o=at.get(t);if(null===o)throw new Error("Unable to parse color from string: "+t);this.model=o.model,n=$t[this.model].channels,this.color=o.value.slice(0,n),this.valpha="number"==typeof o.value[n]?o.value[n]:1}else if(t.length>0){this.model=e||"rgb",n=$t[this.model].channels;var a=Array.prototype.slice.call(t,0,n);this.color=ce(a,n),this.valpha="number"==typeof t[n]?t[n]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var i=Object.keys(t);"alpha"in t&&(i.splice(i.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var u=i.sort().join("");if(!(u in Kt))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Kt[u];var c=$t[this.model].labels,l=[];for(r=0;r<c.length;r++)l.push(t[c[r]]);this.color=ce(l)}if(te[this.model])for(n=$t[this.model].channels,r=0;r<n;r++){var s=te[this.model][r];s&&(this.color[r]=s(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}ee.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e,r=this.model in at.to?this:this.rgb(),n=1===(r=r.round("number"==typeof t?t:1)).valpha?r.color:[].concat(Gt(r.color),[this.valpha]);return(e=at.to)[r.model].apply(e,Gt(n))},percentString:function(t){var e,r=this.rgb().round("number"==typeof t?t:1),n=1===r.valpha?r.color:[].concat(Gt(r.color),[this.valpha]);return(e=at.to.rgb).percent.apply(e,Gt(n))},array:function(){return 1===this.valpha?Gt(this.color):[].concat(Gt(this.color),[this.valpha])},object:function(){for(var t={},e=$t[this.model].channels,r=$t[this.model].labels,n=0;n<e;n++)t[r[n]]=this.color[n];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new ee([].concat(Gt(this.color.map(function(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}(t))),[this.valpha]),this.model)},alpha:function(t){return void 0!==t?new ee([].concat(Gt(this.color),[Math.max(0,Math.min(1,t))]),this.model):this.valpha},red:ae("rgb",0,ie(255)),green:ae("rgb",1,ie(255)),blue:ae("rgb",2,ie(255)),hue:ae(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:ae("hsl",1,ie(100)),lightness:ae("hsl",2,ie(100)),saturationv:ae("hsv",1,ie(100)),value:ae("hsv",2,ie(100)),chroma:ae("hcg",1,ie(100)),gray:ae("hcg",2,ie(100)),white:ae("hwb",1,ie(100)),wblack:ae("hwb",2,ie(100)),cyan:ae("cmyk",0,ie(100)),magenta:ae("cmyk",1,ie(100)),yellow:ae("cmyk",2,ie(100)),black:ae("cmyk",3,ie(100)),x:ae("xyz",0,ie(95.047)),y:ae("xyz",1,ie(100)),z:ae("xyz",2,ie(108.833)),l:ae("lab",0,ie(100)),a:ae("lab",1),b:ae("lab",2),keyword:function(t){return void 0!==t?new ee(t):$t[this.model].keyword(this.color)},hex:function(t){var e;return void 0!==t?new ee(t):(e=at.to).hex.apply(e,Gt(this.rgb().round().color))},hexa:function(t){var e;if(void 0!==t)return new ee(t);var r=this.rgb().round().color,n=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===n.length&&(n="0"+n),(e=at.to).hex.apply(e,Gt(r))+n},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){var t,e=[],r=Ut(this.rgb().color.entries());try{for(r.s();!(t=r.n()).done;){var n=Ht(t.value,2),o=n[0],a=n[1]/255;e[o]=a<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}}catch(t){r.e(t)}finally{r.f()}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),r=t.luminosity();return e>r?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(2126*t[0]+7152*t[1]+722*t[2])/1e4<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return ee.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),r=e.color[0];return r=(r=(r+t)%360)<0?360+r:r,e.color[0]=r,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+Wt(t));var r=t.rgb(),n=this.rgb(),o=void 0===e?.5:e,a=2*o-1,i=r.alpha()-n.alpha(),u=((a*i==-1?a:(a+i)/(1+a*i))+1)/2,c=1-u;return ee.rgb(u*r.red()+c*n.red(),u*r.green()+c*n.green(),u*r.blue()+c*n.blue(),r.alpha()*o+n.alpha()*(1-o))}};for(var re=function(){var t=oe[ne];if(Xt.includes(t))return"continue";var e=$t[t].channels;ee.prototype[t]=function(){if(this.model===t)return new ee(this);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.length>0?new ee(r,t):new ee([].concat(Gt(ue($t[this.model][t].raw(this.color))),[this.valpha]),t)},ee[t]=function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];var a=n[0];return"number"==typeof a&&(a=ce(n,e)),new ee(a,t)}},ne=0,oe=Object.keys($t);ne<oe.length;ne++)re();function ae(t,e,r){var n,o=Ut(t=Array.isArray(t)?t:[t]);try{for(o.s();!(n=o.n()).done;){var a=n.value;(te[a]||(te[a]=[]))[e]=r}}catch(t){o.e(t)}finally{o.f()}return t=t[0],function(n){var o;return void 0!==n?(r&&(n=r(n)),(o=this[t]()).color[e]=n,o):(o=this[t]().color[e],r&&(o=r(o)),o)}}function ie(t){return function(e){return Math.max(0,Math.min(t,e))}}function ue(t){return Array.isArray(t)?t:[t]}function ce(t,e){for(var r=0;r<e;r++)"number"!=typeof t[r]&&(t[r]=0);return t}var le=ee;r(21);function se(t,e,r){return{r:255*r(t.r/255,e.r/255),g:255*r(t.g/255,e.g/255),b:255*r(t.b/255,e.b/255)}}function fe(t,e){return e}function pe(t,e){return t*e}function he(t,e){return t+e-t*e}function ye(t,e){return ve(e,t)}function de(t,e){return Math.min(t,e)}function ge(t,e){return Math.min(Math.max(t,e),1)}function be(t,e){return 0===t?0:1===e?1:Math.min(1,t/(1-e))}function me(t,e){return 1===t?1:0===e?0:1-Math.min(1,(1-t)/e)}function ve(t,e){return e<=.5?pe(t,2*e):he(t,2*e-1)}function we(t,e){return e<=.5?t-(1-2*e)*t*(1-t):t+(2*e-1)*((t<=.25?((16*t-12)*t+4)*t:Math.sqrt(t))-t)}function Me(t,e){return Math.abs(t-e)}function Se(t,e){return t+e-2*t*e}function ke(t,e,r){return Math.min(Math.max(t||0,e),r)}function Oe(t){return{r:ke(t.r,0,255),g:ke(t.g,0,255),b:ke(t.b,0,255),a:ke(t.a,0,1)}}function je(t){return{r:255*t.r,g:255*t.g,b:255*t.b,a:t.a}}function xe(t){return{r:t.r/255,g:t.g/255,b:t.b/255,a:t.a}}function Ce(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return{r:Math.round(t.r*r)/r,g:Math.round(t.g*r)/r,b:Math.round(t.b*r)/r,a:t.a}}function Ae(t,e,r,n,o,a){return(1-e/r)*n+e/r*Math.round((1-t)*o+t*a)}function _e(t,e,r,n,o){void 0===o&&(o={unitInput:!1,unitOutput:!1,roundOutput:!0}),o.unitInput&&(t=je(t),e=je(e)),t=Oe(t);var a=(e=Oe(e)).a+t.a-e.a*t.a,i=r(t,e,n),u=Oe({r:Ae(t.a,e.a,a,t.r,e.r,i.r),g:Ae(t.a,e.a,a,t.g,e.g,i.g),b:Ae(t.a,e.a,a,t.b,e.b,i.b),a:a});return u=o.unitOutput?xe(u):o.roundOutput?Ce(u):function(t){return Ce(t,9)}(u)}function Pe(t,e,r){return je(r(xe(t),xe(e)))}function Ee(t){return.3*t.r+.59*t.g+.11*t.b}function Be(t,e){var r=e-Ee(t);return function(t){var e=Ee(t),r=t.r,n=t.g,o=t.b,a=Math.min(r,n,o),i=Math.max(r,n,o);function u(t){return e+(t-e)*e/(e-a)}function c(t){return e+(t-e)*(1-e)/(i-e)}return a<0&&(r=u(r),n=u(n),o=u(o)),i>1&&(r=c(r),n=c(n),o=c(o)),{r:r,g:n,b:o}}({r:t.r+r,g:t.g+r,b:t.b+r})}function Re(t){return Math.max(t.r,t.g,t.b)-Math.min(t.r,t.g,t.b)}function Ie(t,e){var r=["r","g","b"].sort((function(e,r){return t[e]-t[r]})),n=r[0],o=r[1],a=r[2],i={r:t.r,g:t.g,b:t.b};return i[a]>i[n]?(i[o]=(i[o]-i[n])*e/(i[a]-i[n]),i[a]=e):i[o]=i[a]=0,i[n]=0,i}function Te(t,e){return Be(Ie(e,Re(t)),Ee(t))}function Ne(t,e){return Be(Ie(t,Re(e)),Ee(t))}function De(t,e){return Be(e,Ee(t))}function Le(t,e){return Be(t,Ee(e))}function Fe(t,e){return _e(t,e,se,fe)}function ze(t,e){return _e(t,e,se,pe)}function qe(t,e){return _e(t,e,se,he)}function $e(t,e){return _e(t,e,se,ye)}function We(t,e){return _e(t,e,se,de)}function He(t,e){return _e(t,e,se,ge)}function Ue(t,e){return _e(t,e,se,be)}function Ge(t,e){return _e(t,e,se,me)}function Je(t,e){return _e(t,e,se,ve)}function Ve(t,e){return _e(t,e,se,we)}function Xe(t,e){return _e(t,e,se,Me)}function Ke(t,e){return _e(t,e,se,Se)}function Ye(t,e){return _e(t,e,Pe,Te)}function Ze(t,e){return _e(t,e,Pe,Ne)}function Qe(t,e){return _e(t,e,Pe,De)}function tr(t,e){return _e(t,e,Pe,Le)}var er,rr,nr,or=["cssProperty","element"],ar=["space"],ir=["algorithm"],ur=["method"],cr=["maxDeltaE","deltaEMethod","steps","maxSteps"];function lr(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function sr(t,e){if(e&&("object"===Mr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function fr(t){return(fr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function pr(t){return function(t){if(Array.isArray(t))return Ar(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Cr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function yr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?hr(Object(r),!0).forEach((function(e){Sr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function dr(t,e,r){return(dr=gr()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&wr(o,r.prototype),o}).apply(null,arguments)}function gr(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function br(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}(t,e)||Cr(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mr(){mr=function(t,e){return new r(t,void 0,e)};var t=RegExp.prototype,e=new WeakMap;function r(t,n,o){var a=new RegExp(t,n);return e.set(a,o||e.get(t)),wr(a,r.prototype)}function n(t,r){var n=e.get(r);return Object.keys(n).reduce((function(e,r){return e[r]=t[n[r]],e}),Object.create(null))}return vr(r,RegExp),r.prototype.exec=function(e){var r=t.exec.call(this,e);return r&&(r.groups=n(r,this)),r},r.prototype[Symbol.replace]=function(r,o){if("string"==typeof o){var a=e.get(this);return t[Symbol.replace].call(this,r,o.replace(/\$<([^>]+)>/g,(function(t,e){return"$"+a[e]})))}if("function"==typeof o){var i=this;return t[Symbol.replace].call(this,r,(function(){var t=arguments;return"object"!=Mr(t[t.length-1])&&(t=[].slice.call(t)).push(n(t,i)),o.apply(this,t)}))}return t[Symbol.replace].call(this,r,o)},mr.apply(this,arguments)}function vr(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wr(t,e)}function wr(t,e){return(wr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Mr(t){return(Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Or(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function jr(t,e,r){return e&&Or(t.prototype,e),r&&Or(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function xr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Cr(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function Cr(t,e){if(t){if("string"==typeof t)return Ar(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ar(t,e):void 0}}function Ar(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _r(t,e){var r,n,o=t.length,a=!1,i=!1;Array.isArray(t[0])?r=t:(o=(r=[t]).length,a=!0),Array.isArray(e[0])?n=e:(n=e.length>0?e.map((function(t){return[t]})):[[]],i=!0);var u=n[0].length,c=n[0].map((function(t,e){return n.map((function(t){return t[e]}))})),l=r.map((function(t){return c.map((function(e){var r=0;if(!Array.isArray(t)){var n,o=xr(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;r+=t*a}}catch(t){o.e(t)}finally{o.f()}return r}for(var i=0;i<t.length;i++)r+=t[i]*(e[i]||0);return r}))}));return 1===o&&a&&(l=l[0]),1===u&&i?1===o&&a?l[0]:l.map((function(t){return t[0]})):l}function Pr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Er(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0],n=Pr(t,e[0]),o=Pr(t,e[1]),a=Pr(t,e[2]);return r[0]=n,r[1]=o,r[2]=a,r}function Br(t){return"string"===Rr(t)}function Rr(t){return(Object.prototype.toString.call(t).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function Ir(t,e){var r=e.precision,n=void 0===r?16:r,o=e.unit;return Tr(t)?"none":(t=+Dr(t,n))+(null!=o?o:"")}function Tr(t){return null===t}function Nr(t){return Tr(t)?0:t}function Dr(t,e){if(0===t)return 0;var r=~~t,n=0;r&&e&&(n=1+~~Math.log10(Math.abs(r)));var o=Math.pow(10,e-n);return Math.floor(t*o+.5)/o}function Lr(t,e,r){return isNaN(t)?e:isNaN(e)?t:t+(e-t)*r}function Fr(t,e,r){return(r-t)/(e-t)}function zr(t,e,r){return!t||!e||t===e||t[0]===e[0]&&t[1]===e[1]||isNaN(r)||null===r?r:Lr(e[0],e[1],Fr(t[0],t[1],r))}function qr(t,e,r){return Math.max(Math.min(r,e),t)}function $r(t,e){return Math.sign(t)===Math.sign(e)?t:-t}function Wr(t,e){return $r(Math.pow(Math.abs(t),e),t)}function Hr(t,e){return 0===e?0:t/e}function Ur(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;r<n;){var o=r+n>>1;t[o]<e?r=o+1:n=o}return r}function Gr(t,e){if(t instanceof e)return!0;for(var r=e.name;t;){var n,o=Object.getPrototypeOf(t),a=null==o||null===(n=o.constructor)||void 0===n?void 0:n.name;if(a===r)return!0;if(!a||"Object"===a)return!1;t=o}return!1}var Jr=Object.freeze({__proto__:null,bisectLeft:Ur,clamp:qr,copySign:$r,interpolate:Lr,interpolateInv:Fr,isInstance:Gr,isNone:Tr,isString:Br,mapRange:zr,multiplyMatrices:_r,multiply_v3_m3x3:Er,serializeNumber:Ir,skipNone:Nr,spow:Wr,toPrecision:Dr,type:Rr,zdiv:Hr}),Vr=new(function(){function t(){kr(this,t)}return jr(t,[{key:"add",value:function(t,e,r){if("string"==typeof arguments[0])(Array.isArray(t)?t:[t]).forEach((function(t){this[t]=this[t]||[],e&&this[t][r?"unshift":"push"](e)}),this);else for(var t in arguments[0])this.add(t,arguments[0][t],arguments[1])}},{key:"run",value:function(t,e){this[t]=this[t]||[],this[t].forEach((function(t){t.call(e&&e.context?e.context:e,e)}))}}]),t}()),Xr={gamut_mapping:"css",precision:5,deltaE:"76",verbose:"test"!==(null===globalThis||void 0===globalThis||null===(er=globalThis.process)||void 0===er||null===(rr=er.env)||void 0===rr||null===(nr=rr.NODE_ENV)||void 0===nr?void 0:nr.toLowerCase()),warn:function(t){var e,r;this.verbose&&(null===globalThis||void 0===globalThis||null===(e=globalThis.console)||void 0===e||null===(r=e.warn)||void 0===r||r.call(e,t))}},Kr=function(){function t(e,r){var n;(kr(this,t),Sr(this,"type",void 0),Sr(this,"coordMeta",void 0),Sr(this,"coordRange",void 0),Sr(this,"range",void 0),"object"===Mr(e)&&(this.coordMeta=e),r)&&(this.coordMeta=r,this.coordRange=null!==(n=r.range)&&void 0!==n?n:r.refRange);if("string"==typeof e){var o=e.trim().match(mr(/^(<[a-z]+>)(\[(\x2D?[.\d]+),\s*(\x2D?[.\d]+)\])?$/,{type:1,min:3,max:4}));if(!o)throw new TypeError("Cannot parse ".concat(e," as a type definition."));this.type=o.groups.type;var a=o.groups,i=a.min,u=a.max;(i||u)&&(this.range=[+i,+u])}}return jr(t,[{key:"computedRange",get:function(){return this.range?this.range:"<percentage>"===this.type?this.percentageRange():"<angle>"===this.type?[0,360]:null}},{key:"unit",get:function(){return"<percentage>"===this.type?"%":"<angle>"===this.type?"deg":""}},{key:"resolve",value:function(t){if("<angle>"===this.type)return t;var e,r=this.computedRange,n=this.coordRange;"<percentage>"===this.type&&(null!==(e=n)&&void 0!==e||(n=this.percentageRange()));return zr(r,n,t)}},{key:"serialize",value:function(t,e){var r="<percentage>"===this.type?this.percentageRange(100):this.computedRange,n=this.unit;return Ir(t=zr(this.coordRange,r,t),{unit:n,precision:e})}},{key:"toString",value:function(){var t=this.type;if(this.range){var e=br(this.range,2),r=e[0],n=void 0===r?"":r,o=e[1],a=void 0===o?"":o;t+="[".concat(n,",").concat(a,"]")}return t}},{key:"percentageRange",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return[(t=this.coordMeta&&this.coordMeta.range||this.coordRange&&this.coordRange[0]>=0?[0,1]:[-1,1])[0]*e,t[1]*e]}}],[{key:"get",value:function(t,e){return Gr(t,this)?t:new this(t,e)}}]),t}(),Yr=Symbol("instance"),Zr=function(){function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.space;kr(this,t),Sr(this,"type",void 0),Sr(this,"name",void 0),Sr(this,"spaceCoords",void 0),Sr(this,"coords",void 0),Sr(this,"id",void 0),Sr(this,"alpha",void 0),e[Yr]=this,this.type="function",this.name="color",Object.assign(this,e),this.space=n,"custom"!==this.type&&(this.spaceCoords=Object.values(n.coords),this.coords||(this.coords=this.spaceCoords.map((function(t){var e=["<number>","<percentage>"];return"angle"===t.type&&e.push("<angle>"),e}))),this.coords=this.coords.map((function(t,e){var n=r.spaceCoords[e];return"string"==typeof t&&(t=t.trim().split(/\s*\|\s*/)),t.map((function(t){return Kr.get(t,n)}))})))}return jr(t,[{key:"serializeCoords",value:function(t,e,r){var n=this;return r=t.map((function(t,e){var o,a;return Kr.get(null!==(o=null===(a=r)||void 0===a?void 0:a[e])&&void 0!==o?o:n.coords[e][0],n.spaceCoords[e])})),t.map((function(t,n){return r[n].serialize(t,e)}))}},{key:"coerceCoords",value:function(t,e){var r=this;return Object.entries(this.space.coords).map((function(n,o){var a=br(n,2),i=a[0],u=a[1],c=t[o];if(Tr(c)||isNaN(c))return c;var l=e[o],s=r.coords[o].find((function(t){return t.type==l}));if(!s){var f,p,h=u.name||i;throw new TypeError("".concat(null!==(f=null!=l?l:null===(p=c)||void 0===p?void 0:p.raw)&&void 0!==f?f:c," not allowed for ").concat(h," in ").concat(r.name,"()"))}return c=s.resolve(c),s.range&&(e[o]=s.toString()),c}))}},{key:"canSerialize",value:function(){return"function"===this.type||this.serialize}},{key:"parse",value:function(t){return null}}],[{key:"get",value:function(e){if(!e||Gr(e,this))return e;if(e[Yr])return e[Yr];for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return dr(t,[e].concat(n))}}]),t}(),Qr={D50:[.3457/.3585,1,.2958/.3585],D65:[.3127/.329,1,.3583/.329]};function tn(t){return Array.isArray(t)?t:Qr[t]}function en(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(t=tn(t),e=tn(e),!t||!e)throw new TypeError("Missing white point to convert ".concat(t?"":"from").concat(t||e?"":"/").concat(e?"":"to"));if(t===e)return r;var o={W1:t,W2:e,XYZ:r,options:n};if(Vr.run("chromatic-adaptation-start",o),o.M||(o.W1===Qr.D65&&o.W2===Qr.D50?o.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:o.W1===Qr.D50&&o.W2===Qr.D65&&(o.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),Vr.run("chromatic-adaptation-end",o),o.M)return Er(o.XYZ,o.M);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}function rn(t,e){var r,n,o,a={str:null===(r=String(t))||void 0===r?void 0:r.trim(),options:e};if(Vr.run("parse-start",a),a.color)return a.color;a.parsed=function(t){if(!t)return;var e=(t=t.trim()).match(on.function);if(e){var r=[],n=[],o=!1,a=e[1].toLowerCase(),i=e[2].replace(on.singleArgument,(function(t,e){var i=function(t){var e,r={},n=null===(e=t.match(on.unitValue))||void 0===e?void 0:e[0],o=r.raw=t;n?(r.type="%"===n?"<percentage>":"<angle>",r.unit=n,r.unitless=Number(o.slice(0,-n.length)),o=r.unitless*nn[n]):on.number.test(o)?(o=Number(o),r.type="<number>"):"none"===o?o=null:"NaN"===o||"calc(NaN)"===o?(o=NaN,r.type="<number>"):r.type="<ident>";return{value:o,meta:r}}(e),u=i.value,c=i.meta;return(t.startsWith("/")||"color"!==a&&3===r.length)&&(o=!0),r.push(u),n.push(c),""}));return{name:a,args:r,argMeta:n,lastAlpha:o,commas:i.includes(","),rawName:e[1],rawArgs:e[2]}}}(a.str);var i=a.options?null!==(n=a.options.parseMeta)&&void 0!==n?n:a.options.meta:null;if(a.parsed){var u,c,l=a.parsed.name,s=a.parsed.args,f=s.map((function(t,e){var r;return null===(r=a.parsed.argMeta[e])||void 0===r?void 0:r.type}));if("color"===l){var p=s.shift();f.shift();var h=p.startsWith("--")?p.substring(2):"--".concat(p),y=[p,h];if(!(u=un.findFormat({name:l,id:y,type:"function"}))){var d,g,b=p in un.registry?p:h;if(b in un.registry){var m,v,w=null===(m=un.registry[b].formats)||void 0===m||null===(v=m.color)||void 0===v?void 0:v.id;if(w){var M=t.replace("color("+p,"color("+w);g="Did you mean ".concat(M,"?")}}throw new TypeError("Cannot parse ".concat(a.str,". ")+(null!==(d=g)&&void 0!==d?d:"Missing a plugin?"))}c=u.space,u.id.startsWith("--")&&!p.startsWith("--")&&Xr.warn("".concat(c.name," is a non-standard space and not currently supported in the CSS spec. ")+"Use prefixed color(".concat(u.id,") instead of color(").concat(p,").")),p.startsWith("--")&&!u.id.startsWith("--")&&Xr.warn("".concat(c.name," is a standard space and supported in the CSS spec. ")+"Use color(".concat(u.id,") instead of prefixed color(").concat(p,")."))}else c=(u=un.findFormat({name:l,type:"function"})).space;i&&Object.assign(i,{format:u,formatId:u.name,types:f,commas:a.parsed.commas});var S=1;a.parsed.lastAlpha&&(S=a.parsed.args.pop(),i&&(i.alphaType=f.pop()));var k=u.coords.length;if(s.length!==k)throw new TypeError("Expected ".concat(k," coordinates for ").concat(c.id," in ").concat(a.str,"), got ").concat(s.length));s=u.coerceCoords(s,f),o={spaceId:c.id,coords:s,alpha:S}}else{var O,j=xr(un.all);try{t:for(j.s();!(O=j.n()).done;){var x=O.value;for(var C in x.formats){var A=x.formats[C];if("custom"===A.type&&(!A.test||A.test(a.str))){var _=x.getFormat(A),P=_.parse(a.str);if(P){i&&Object.assign(i,{format:_,formatId:C}),o=P;break t}}}}}catch(t){j.e(t)}finally{j.f()}}if(!o)throw new TypeError("Could not parse ".concat(t," as a color. Missing a plugin?"));return o.alpha=Tr(o.alpha)?o.alpha:void 0===o.alpha?1:qr(0,o.alpha,1),o}var nn={"%":.01,deg:1,grad:.9,rad:180/Math.PI,turn:360},on={function:/^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i,number:/^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i,unitValue:RegExp("(".concat(Object.keys(nn).join("|"),")$")),singleArgument:/\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g};function an(t,e){if(Array.isArray(t))return t.map((function(t){return an(t,e)}));if(!t)throw new TypeError("Empty color reference");Br(t)&&(t=rn(t,e));var r=t.space||t.spaceId;return"string"==typeof r&&(t.space=un.get(r)),void 0===t.alpha&&(t.alpha=1),t}var un=function(){function t(e){var r,n,o,a,i;kr(this,t),this.id=e.id,this.name=e.name,this.base=e.base?t.get(e.base):null,this.aliases=e.aliases,this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);var u=null!==(r=e.coords)&&void 0!==r?r:this.base.coords;for(var c in u)"name"in u[c]||(u[c].name=c);this.coords=u;var l,s=null!==(n=null!==(o=e.white)&&void 0!==o?o:this.base.white)&&void 0!==n?n:"D65";for(var f in this.white=tn(s),this.formats=null!==(a=e.formats)&&void 0!==a?a:{},this.formats){var p=this.formats[f];p.type||(p.type="function"),p.name||(p.name=f)}null!==(i=this.formats.color)&&void 0!==i&&i.id||(this.formats.color=yr(yr({},null!==(l=this.formats.color)&&void 0!==l?l:{}),{},{id:e.cssId||this.id}));e.gamutSpace?this.gamutSpace="self"===e.gamutSpace?this:t.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=function(t,e){return!0}),this.referred=e.referred,Object.defineProperty(this,"path",{value:cn(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Vr.run("colorspace-init-end",this)}return jr(t,[{key:"inGamut",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.epsilon,n=void 0===r?75e-6:r;if(!this.equals(this.gamutSpace))return t=this.to(this.gamutSpace,t),this.gamutSpace.inGamut(t,{epsilon:n});var o=Object.values(this.coords);return t.every((function(t,e){var r=o[e];if("angle"!==r.type&&r.range){if(Tr(t))return!0;var a=br(r.range,2),i=a[0],u=a[1];return(void 0===i||t>=i-n)&&(void 0===u||t<=u+n)}return!0}))}},{key:"isUnbounded",get:function(){return Object.values(this.coords).every((function(t){return!("range"in t)}))}},{key:"cssId",get:function(){var t,e;return(null===(t=this.formats)||void 0===t||null===(e=t.color)||void 0===e?void 0:e.id)||this.id}},{key:"isPolar",get:function(){for(var t in this.coords)if("angle"===this.coords[t].type)return!0;return!1}},{key:"getFormat",value:function(t){if(!t)return null;"default"===t?t=Object.values(this.formats)[0]:"string"==typeof t&&(t=this.formats[t]);var e=Zr.get(t,this);return e!==t&&t.name in this.formats&&(this.formats[t.name]=e),e}},{key:"equals",value:function(t){return!!t&&(this===t||this.id===t||this.id===t.id)}},{key:"to",value:function(e,r){if(1===arguments.length){var n=an(e),o=[n.space,n.coords];e=o[0],r=o[1]}if(e=t.get(e),this.equals(e))return r;r=r.map((function(t){return Tr(t)?0:t}));for(var a,i,u=this.path,c=e.path,l=0;l<u.length&&u[l].equals(c[l]);l++)a=u[l],i=l;if(!a)throw new Error("Cannot convert between color spaces ".concat(this," and ").concat(e,": no connection space was found"));for(var s=u.length-1;s>i;s--)r=u[s].toBase(r);for(var f=i+1;f<c.length;f++)r=c[f].fromBase(r);return r}},{key:"from",value:function(e,r){if(1===arguments.length){var n=an(e),o=[n.space,n.coords];e=o[0],r=o[1]}return(e=t.get(e)).to(this,r)}},{key:"toString",value:function(){return"".concat(this.name," (").concat(this.id,")")}},{key:"getMinCoords",value:function(){var t=[];for(var e in this.coords){var r,n=this.coords[e],o=n.range||n.refRange;t.push(null!==(r=null==o?void 0:o.min)&&void 0!==r?r:0)}return t}}],[{key:"all",get:function(){return pr(new Set(Object.values(t.registry)))}},{key:"register",value:function(t,e){if(1===arguments.length&&(t=(e=arguments[0]).id),e=this.get(e),this.registry[t]&&this.registry[t]!==e)throw new Error("Duplicate color space registration: '".concat(t,"'"));if(this.registry[t]=e,1===arguments.length&&e.aliases){var r,n=xr(e.aliases);try{for(n.s();!(r=n.n()).done;){var o=r.value;this.register(o,e)}}catch(t){n.e(t)}finally{n.f()}}return e}},{key:"get",value:function(e){if(!e||Gr(e,this))return e;var r=Rr(e);if("string"===r){var n=t.registry[e.toLowerCase()];if(!n)throw new TypeError('No color space found with id = "'.concat(e,'"'));return n}for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];if(a.length)return t.get.apply(t,a);throw new TypeError("".concat(e," is not a valid color space"))}},{key:"findFormat",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.all;if(!e)return null;"string"==typeof e&&(e={name:e});var n,o=xr(r);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,i=0,u=Object.entries(a.formats);i<u.length;i++){var c,l,s=br(u[i],2),f=s[0],p=s[1];null!==(c=p.name)&&void 0!==c||(p.name=f),null!==(l=p.type)&&void 0!==l||(p.type="function");var h=!(e.name&&p.name!==e.name||e.type&&p.type!==e.type);if(e.id&&function(){var t=p.ids||[p.id],r=Array.isArray(e.id)?e.id:[e.id];h&&(h=r.some((function(e){return t.includes(e)})))}(),h){var y=Zr.get(p,a);return y!==p&&(a.formats[p.name]=y),y}}}catch(t){o.e(t)}finally{o.f()}return null}},{key:"resolveCoord",value:function(e,r){var n,o,a=Rr(e);if("string"===a)if(e.includes(".")){var i=br(e.split("."),2);n=i[0],o=i[1]}else n=void 0,o=e;else if(Array.isArray(e)){var u=br(e,2);n=u[0],o=u[1]}else n=e.space,o=e.coordId;if((n=t.get(n))||(n=r),!n)throw new TypeError("Cannot resolve coordinate reference ".concat(e,": No color space specified and relative references are not allowed here"));if("number"===(a=Rr(o))||"string"===a&&o>=0){var c=Object.entries(n.coords)[o];if(c)return yr({space:n,id:c[0],index:o},c[1])}n=t.get(n);var l=o.toLowerCase(),s=0;for(var f in n.coords){var p,h=n.coords[f];if(f.toLowerCase()===l||(null===(p=h.name)||void 0===p?void 0:p.toLowerCase())===l)return yr({space:n,id:f,index:s},h);s++}throw new TypeError('No "'.concat(o,'" coordinate found in ').concat(n.name,". Its coordinates are: ").concat(Object.keys(n.coords).join(", ")))}}]),t}();function cn(t){for(var e=[t],r=t;r=r.base;)e.push(r);return e}Sr(un,"registry",{}),Sr(un,"DEFAULT_FORMAT",{type:"functions",name:"color"});var ln=new un({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"]}),sn=function(t){vr(o,t);var e,r,n=(e=o,r=gr(),function(){var t,n=fr(e);if(r){var o=fr(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return sr(this,t)});function o(t){var e,r,a,i;(kr(this,o),t.coords||(t.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),t.base||(t.base=ln),t.toXYZ_M&&t.fromXYZ_M)&&(null!==(a=t.toBase)&&void 0!==a||(t.toBase=function(e){var n=Er(e,t.toXYZ_M);return r.white!==r.base.white&&(n=en(r.white,r.base.white,n)),n}),null!==(i=t.fromBase)&&void 0!==i||(t.fromBase=function(e){return Er(e=en(r.base.white,r.white,e),t.fromXYZ_M)}));return null!==(e=t.referred)&&void 0!==e||(t.referred="display"),r=n.call(this,t)}return jr(o)}(un);function fn(t,e){t=an(t);var r,n=un.get(e,null==e?void 0:e.space),o=null==e?void 0:e.precision;return r=!n||t.space.equals(n)?t.coords.slice():n.from(t),void 0===o?r:r.map((function(t){return Dr(t,o)}))}function pn(t,e){var r;if(t=an(t),"alpha"===e)return null!==(r=t.alpha)&&void 0!==r?r:1;var n=un.resolveCoord(e,t.space),o=n.space,a=n.index;return fn(t,o)[a]}function hn(t,e,r,n){if(t=an(t),Array.isArray(e)){var o=[t.space,e,r];e=o[0],r=o[1],n=o[2]}return e=un.get(e),t.coords=e===t.space?r.slice():e.to(t.space,r),void 0!==n&&(t.alpha=n),t}function yn(t,e,r){if(t=an(t),2===arguments.length&&"object"===Rr(arguments[1])){var n=arguments[1];for(var o in n)yn(t,o,n[o])}else if("function"==typeof r&&(r=r(pn(t,e))),"alpha"===e)t.alpha=r;else{var a=un.resolveCoord(e,t.space),i=a.space,u=a.index,c=fn(t,i);c[u]=r,hn(t,i,c)}return t}hn.returns="color",yn.returns="color";var dn=new un({id:"xyz-d50",name:"XYZ D50",white:"D50",base:ln,fromBase:function(t){return en(ln.white,"D50",t)},toBase:function(t){return en("D50",ln.white,t)}}),gn=24389/27,bn=Qr.D50,mn=new un({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:bn,base:dn,fromBase:function(t){var e=t.map((function(t,e){return t/bn[e]})).map((function(t){return t>216/24389?Math.cbrt(t):(gn*t+16)/116}));return[116*e[1]-16,500*(e[0]-e[1]),200*(e[1]-e[2])]},toBase:function(t){var e=br(t,3),r=e[0],n=e[1],o=e[2],a=[];return a[1]=(r+16)/116,a[0]=n/500+a[1],a[2]=a[1]-o/200,[a[0]>24/116?Math.pow(a[0],3):(116*a[0]-16)/gn,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/gn,a[2]>24/116?Math.pow(a[2],3):(116*a[2]-16)/gn].map((function(t,e){return t*bn[e]}))},formats:{lab:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function vn(t){return"number"!=typeof t?t:(t%360+360)%360}function wn(t,e){var r=br(e,2),n=r[0],o=r[1],a=Tr(n),i=Tr(o);if(a&&i)return[n,o];if(a?n=o:i&&(o=n),"raw"===t)return e;n=vn(n);var u=(o=vn(o))-n;return"increasing"===t?u<0&&(o+=360):"decreasing"===t?u>0&&(n+=360):"longer"===t?-180<u&&u<180&&(u>0?n+=360:o+=360):"shorter"===t&&(u>180?n+=360:u<-180&&(o+=360)),[n,o]}var Mn=new un({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:mn,fromBase:function(t){if(void 0===this.ε){var e=Object.values(this.base.coords)[1].refRange,r=e[1]-e[0];this.ε=r/1e5}var n=br(t,3),o=n[0],a=n[1],i=n[2],u=Math.abs(a)<this.ε&&Math.abs(i)<this.ε,c=u?null:vn(180*Math.atan2(i,a)/Math.PI);return[o,u?0:Math.sqrt(Math.pow(a,2)+Math.pow(i,2)),c]},toBase:function(t){var e=br(t,3),r=e[0],n=e[1],o=e[2],a=null,i=null;return Tr(o)||(a=(n=n<0?0:n)*Math.cos(o*Math.PI/180),i=n*Math.sin(o*Math.PI/180)),[r,a,i]},formats:{lch:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}}),Sn=Math.pow(25,7),kn=Math.PI,On=180/kn,jn=kn/180;function xn(t){var e=t*t;return e*e*e*t}function Cn(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.kL,o=void 0===n?1:n,a=r.kC,i=void 0===a?1:a,u=r.kH,c=void 0===u?1:u,l=an([t,e]),s=br(l,2);t=s[0],e=s[1];var f=mn.from(t),p=br(f,3),h=p[0],y=p[1],d=p[2],g=Mn.from(mn,[h,y,d])[1],b=mn.from(e),m=br(b,3),v=m[0],w=m[1],M=m[2],S=Mn.from(mn,[v,w,M])[1];g<0&&(g=0),S<0&&(S=0);var k=(g+S)/2,O=xn(k),j=.5*(1-Math.sqrt(O/(O+Sn))),x=(1+j)*y,C=(1+j)*w,A=Math.sqrt(Math.pow(x,2)+Math.pow(d,2)),_=Math.sqrt(Math.pow(C,2)+Math.pow(M,2)),P=0===x&&0===d?0:Math.atan2(d,x),E=0===C&&0===M?0:Math.atan2(M,C);P<0&&(P+=2*kn),E<0&&(E+=2*kn);var B,R=v-h,I=_-A,T=(E*=On)-(P*=On),N=P+E,D=Math.abs(T);A*_==0?B=0:D<=180?B=T:T>180?B=T-360:T<-180?B=T+360:Xr.warn("the unthinkable has happened");var L,F=2*Math.sqrt(_*A)*Math.sin(B*jn/2),z=(h+v)/2,q=(A+_)/2,$=xn(q);L=A*_==0?N:D<=180?N/2:N<360?(N+360)/2:(N-360)/2;var W=Math.pow(z-50,2),H=1+.015*W/Math.sqrt(20+W),U=1+.045*q,G=1;G-=.17*Math.cos((L-30)*jn),G+=.24*Math.cos(2*L*jn),G+=.32*Math.cos((3*L+6)*jn);var J=1+.015*q*(G-=.2*Math.cos((4*L-63)*jn)),V=30*Math.exp(-1*Math.pow((L-275)/25,2)),X=2*Math.sqrt($/($+Sn)),K=-1*Math.sin(2*V*jn)*X,Y=Math.pow(R/(o*H),2);return Y+=Math.pow(I/(i*U),2),Y+=Math.pow(F/(c*J),2),Y+=K*(I/(i*U))*(F/(c*J)),Math.sqrt(Y)}var An=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],_n=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],Pn=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],En=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Bn=new un({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:ln,fromBase:function(t){var e=Er(t,An);return e[0]=Math.cbrt(e[0]),e[1]=Math.cbrt(e[1]),e[2]=Math.cbrt(e[2]),Er(e,Pn,e)},toBase:function(t){var e=Er(t,En);return e[0]=Math.pow(e[0],3),e[1]=Math.pow(e[1],3),e[2]=Math.pow(e[2],3),Er(e,_n,e)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function Rn(t,e){var r=br(an([t,e]),2);t=r[0],e=r[1];var n=br(Bn.from(t),3),o=n[0],a=n[1],i=n[2],u=br(Bn.from(e),3),c=o-u[0],l=a-u[1],s=i-u[2];return Math.sqrt(Math.pow(c,2)+Math.pow(l,2)+Math.pow(s,2))}function In(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.epsilon,o=void 0===n?75e-6:n;t=an(t),e||(e=t.space),e=un.get(e);var a=t.coords;return e!==t.space&&(a=e.from(t)),e.inGamut(a,{epsilon:o})}function Tn(t){return{space:t.space,coords:t.coords.slice(),alpha:t.alpha}}function Nn(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"lab",n=(r=un.get(r)).from(t),o=r.from(e);return Math.sqrt(n.reduce((function(t,e,r){var n=o[r];return Tr(e)||Tr(n)?t:t+Math.pow(n-e,2)}),0))}var Dn=Math.PI/180;var Ln=new un({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:ln,fromBase:function(t){return t.map((function(t){return 203*t}))},toBase:function(t){return t.map((function(t){return t/203}))}}),Fn=2610/Math.pow(2,14),zn=Math.pow(2,14)/2610,qn=3424/Math.pow(2,12),$n=2413/Math.pow(2,7),Wn=2392/Math.pow(2,7),Hn=1.7*2523/Math.pow(2,5),Un=Math.pow(2,5)/(1.7*2523),Gn=16295499532821565e-27,Jn=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],Vn=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],Xn=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],Kn=[[1,.13860504327153927,.05804731615611883],[1,-.1386050432715393,-.058047316156118904],[1,-.09601924202631895,-.811891896056039]],Yn=new un({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.21,.21]},bz:{refRange:[-.21,.21]}},base:Ln,fromBase:function(t){var e=br(t,3),r=e[0],n=e[1],o=e[2],a=Er([1.15*r-(1.15-1)*o,.66*n-(.66-1)*r,o],Jn),i=br(Er(a.map((function(t){var e=qn+$n*Wr(t/1e4,Fn),r=1+Wn*Wr(t/1e4,Fn);return Wr(e/r,Hn)})),Xn),3),u=i[0],c=i[1],l=i[2];return[(1-.56)*u/(1+-.56*u)-Gn,c,l]},toBase:function(t){var e=br(t,3),r=e[0],n=e[1],o=e[2],a=Er([(r+Gn)/(1-.56- -.56*(r+Gn)),n,o],Kn),i=br(Er(a.map((function(t){var e=qn-Wr(t,Un),r=Wn*Wr(t,Un)-$n;return 1e4*Wr(e/r,zn)})),Vn),3),u=i[0],c=i[1],l=i[2],s=(u+(1.15-1)*l)/1.15;return[s,(c+(.66-1)*s)/.66,l]},formats:{jzazbz:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}}),Zn=new un({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,.26],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:Yn,fromBase:Mn.fromBase,toBase:Mn.toBase,formats:{jzczhz:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}});var Qn=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],to=[[.5,.5,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],eo=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],ro=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],no=new un({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:Ln,fromBase:function(t){return function(t){return Er(t.map((function(t){var e=.8359375+2413/128*Math.pow(t/1e4,2610/16384),r=1+18.6875*Math.pow(t/1e4,2610/16384);return Math.pow(e/r,2523/32)})),to)}(Er(t,Qn))},toBase:function(t){var e=function(t){return Er(t,eo).map((function(t){var e=Math.max(Math.pow(t,32/2523)-.8359375,0),r=2413/128-18.6875*Math.pow(t,32/2523);return 1e4*Math.pow(e/r,16384/2610)}))}(t);return Er(e,ro)},formats:{ictcp:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});var oo=Qr.D65,ao=2*Math.PI,io=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],uo=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],co=[[460,451,288],[460,-891,-261],[460,-220,-6300]],lo={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},so={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},fo=180/Math.PI,po=Math.PI/180;function ho(t,e){return t.map((function(t){var r=Wr(e*Math.abs(t)*.01,.42);return 400*$r(r,t)/(r+27.13)}))}function yo(t,e,r,n,o){var a={};a.discounting=o,a.refWhite=t,a.surround=n;var i=t.map((function(t){return 100*t}));a.la=e,a.yb=r;var u=i[1],c=Er(i,io),l=lo[a.surround],s=l[0];a.c=l[1],a.nc=l[2];var f=1/(5*a.la+1),p=Math.pow(f,4);a.fl=p*a.la+.1*(1-p)*(1-p)*Math.cbrt(5*a.la),a.flRoot=Math.pow(a.fl,.25),a.n=a.yb/u,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*Math.pow(a.n,-.2),a.ncb=a.nbb;var h=Math.max(Math.min(s*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=c.map((function(t){return Lr(1,u/t,h)})),a.dRgbInv=a.dRgb.map((function(t){return 1/t}));var y=ho(c.map((function(t,e){return t*a.dRgb[e]})),a.fl);return a.aW=a.nbb*(2*y[0]+y[1]+.05*y[2]),a}var go=yo(oo,64/Math.PI*.2,20,"average",!1);function bo(t,e){if(!(void 0!==t.J^void 0!==t.Q))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(void 0!==t.C^void 0!==t.M^void 0!==t.s))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(void 0!==t.h^void 0!==t.H))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(0===t.J||0===t.Q)return[0,0,0];var r=0;r=void 0!==t.h?vn(t.h)*po:function(t){var e=(t%400+400)%400,r=Math.floor(.01*e);e%=100;var n=br(so.h.slice(r,r+2),2),o=n[0],a=n[1],i=br(so.e.slice(r,r+2),2),u=i[0],c=i[1];return vn((e*(c*o-u*a)-100*o*c)/(e*(c-u)-100*c))}(t.H)*po;var n=Math.cos(r),o=Math.sin(r),a=0;void 0!==t.J?a=.1*Wr(t.J,.5):void 0!==t.Q&&(a=.25*e.c*t.Q/((e.aW+4)*e.flRoot));var i=0;void 0!==t.C?i=t.C/a:void 0!==t.M?i=t.M/e.flRoot/a:void 0!==t.s&&(i=4e-4*Math.pow(t.s,2)*(e.aW+4)/e.c);var u,c,l,s=Wr(i*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),f=.25*(Math.cos(r+2)+3.8),p=e.aW*Wr(a,2/e.c/e.z),h=5e4/13*e.nc*e.ncb*f,y=p/e.nbb,d=23*(y+.305)*Hr(s,23*h+s*(11*n+108*o)),g=(u=Er([y,d*n,d*o],co).map((function(t){return 1*t/1403})),c=e.fl,l=100/c*Math.pow(27.13,1/.42),u.map((function(t){var e=Math.abs(t);return $r(l*Wr(e/(400-e),1/.42),t)})));return Er(g.map((function(t,r){return t*e.dRgbInv[r]})),uo).map((function(t){return t/100}))}function mo(t,e){var r=ho(Er(t.map((function(t){return 100*t})),io).map((function(t,r){return t*e.dRgb[r]})),e.fl),n=r[0]+(-12*r[1]+r[2])/11,o=(r[0]+r[1]-2*r[2])/9,a=(Math.atan2(o,n)%ao+ao)%ao,i=.25*(Math.cos(a+2)+3.8),u=Wr(5e4/13*e.nc*e.ncb*Hr(i*Math.sqrt(Math.pow(n,2)+Math.pow(o,2)),r[0]+r[1]+1.05*r[2]+.305),.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),c=Wr(e.nbb*(2*r[0]+r[1]+.05*r[2])/e.aW,.5*e.c*e.z),l=100*Wr(c,2),s=4/e.c*c*(e.aW+4)*e.flRoot,f=u*c,p=f*e.flRoot,h=vn(a*fo),y=function(t){var e=vn(t);e<=so.h[0]&&(e+=360);var r=Ur(so.h,e)-1,n=br(so.h.slice(r,r+2),2),o=n[0],a=n[1],i=br(so.e.slice(r,r+2),2),u=i[0],c=i[1],l=(e-o)/u;return so.H[r]+100*l/(l+(a-e)/c)}(h);return{J:l,C:f,h:h,s:50*Wr(e.c*u/(e.aW+4),.5),Q:s,M:p,H:y}}var vo=new un({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:ln,fromBase:function(t){void 0===this.ε&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);var e=mo(t,go),r=Math.abs(e.M)<this.ε;return[e.J,r?0:e.M,r?null:e.h]},toBase:function(t){return bo({J:t[0],M:t[1],h:t[2]},go)}}),wo=Qr.D65;function Mo(t){return t>8?Math.pow((t+16)/116,3):t/(24389/27)}function So(t,e){var r=function(t){return 116*(t>216/24389?Math.cbrt(t):(24389/27*t+16)/116)-16}(t[1]);if(0===r)return[0,0,0];var n=mo(t,ko);return[vn(n.h),n.C,r]}var ko=yo(wo,200/Math.PI*Mo(50),100*Mo(50),"average",!1),Oo=new un({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:ln,fromBase:function(t){void 0===this.ε&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);var e=So(t);return e[1]<this.ε&&(e[1]=0,e[0]=null),e},toBase:function(t){return function(t,e){var r=br(t,3),n=r[0],o=r[1],a=r[2],i=[],u=0;if(0===a)return[0,0,0];var c=Mo(a);u=a>0?.00379058511492914*Math.pow(a,2)+.608983189401032*a+.9155088574762233:9514440756550361e-21*Math.pow(a,2)+.08693057439788597*a-21.928975842194614;for(var l=0,s=1/0;l<=15;){i=bo({J:u,C:o,h:n},e);var f=Math.abs(i[1]-c);if(f<s){if(f<=2e-12)return i;s=f}u-=(i[1]-c)*u/(2*i[1]),l+=1}return bo({J:u,C:o,h:n},e)}(t,ko)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),jo=Math.PI/180,xo=[1,.007,.0228];function Co(t){t[1]<0&&(t=Oo.fromBase(Oo.toBase(t)));var e=Math.log(Math.max(1+xo[2]*t[1]*ko.flRoot,1))/xo[2],r=t[0]*jo,n=e*Math.cos(r),o=e*Math.sin(r);return[t[2],n,o]}var Ao={deltaE76:function(t,e){return Nn(t,e,"lab")},deltaECMC:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.l,o=void 0===n?2:n,a=r.c,i=void 0===a?1:a,u=an([t,e]),c=br(u,2);t=c[0],e=c[1];var l=mn.from(t),s=br(l,3),f=s[0],p=s[1],h=s[2],y=Mn.from(mn,[f,p,h]),d=br(y,3),g=d[1],b=d[2],m=mn.from(e),v=br(m,3),w=v[0],M=v[1],S=v[2],k=Mn.from(mn,[w,M,S])[1];g<0&&(g=0),k<0&&(k=0);var O=f-w,j=g-k,x=p-M,C=h-S,A=Math.pow(x,2)+Math.pow(C,2)-Math.pow(j,2),_=.511;f>=16&&(_=.040975*f/(1+.01765*f));var P,E=.0638*g/(1+.0131*g)+.638;Tr(b)&&(b=0),P=b>=164&&b<=345?.56+Math.abs(.2*Math.cos((b+168)*Dn)):.36+Math.abs(.4*Math.cos((b+35)*Dn));var B=Math.pow(g,4),R=Math.sqrt(B/(B+1900)),I=E*(R*P+1-R),T=Math.pow(O/(o*_),2);return T+=Math.pow(j/(i*E),2),T+=A/Math.pow(I,2),Math.sqrt(T)},deltaE2000:Cn,deltaEJz:function(t,e){var r=br(an([t,e]),2);t=r[0],e=r[1];var n=br(Zn.from(t),3),o=n[0],a=n[1],i=n[2],u=br(Zn.from(e),3),c=u[0],l=u[1],s=u[2],f=o-c,p=a-l;Tr(i)&&Tr(s)?(i=0,s=0):Tr(i)?i=s:Tr(s)&&(s=i);var h=i-s,y=2*Math.sqrt(a*l)*Math.sin(h/2*(Math.PI/180));return Math.sqrt(Math.pow(f,2)+Math.pow(p,2)+Math.pow(y,2))},deltaEITP:function(t,e){var r=br(an([t,e]),2);t=r[0],e=r[1];var n=br(no.from(t),3),o=n[0],a=n[1],i=n[2],u=br(no.from(e),3),c=u[0],l=u[1],s=u[2];return 720*Math.sqrt(Math.pow(o-c,2)+.25*Math.pow(a-l,2)+Math.pow(i-s,2))},deltaEOK:Rn,deltaEOK2:function(t,e){var r=br(an([t,e]),2);t=r[0],e=r[1];var n=br(Bn.from(t),3),o=n[0],a=n[1],i=n[2],u=br(Bn.from(e),3),c=o-u[0],l=2*(a-u[1]),s=2*(i-u[2]);return Math.sqrt(Math.pow(c,2)+Math.pow(l,2)+Math.pow(s,2))},deltaEHCT:function(t,e){var r=br(an([t,e]),2);t=r[0],e=r[1];var n=br(Co(Oo.from(t)),3),o=n[0],a=n[1],i=n[2],u=br(Co(Oo.from(e)),3),c=u[0],l=u[1],s=u[2];return Math.sqrt(Math.pow(o-c,2)+Math.pow(a-l,2)+Math.pow(i-s,2))}};function _o(t){var e=t?Math.floor(Math.log10(Math.abs(t))):0;return Math.max(parseFloat("1e".concat(e-2)),1e-6)}var Po={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function Eo(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.method,o=void 0===n?Xr.gamut_mapping:n,a=r.space,i=void 0===a?void 0:a,u=r.deltaEMethod,c=void 0===u?"":u,l=r.jnd,s=void 0===l?2:l,f=r.blackWhiteClamp,p=void 0===f?void 0:f;if(t=an(t),Br(arguments[1])?i=arguments[1]:i||(i=t.space),In(t,i=un.get(i),{epsilon:0}))return t;if("css"===o)e=Ro(t,{space:i});else{if("clip"===o||In(t,i))e=Io(t,i);else{if(Object.prototype.hasOwnProperty.call(Po,o)){var h=Po[o];o=h.method,s=h.jnd,c=h.deltaEMethod,p=h.blackWhiteClamp}var y=Cn;if(""!==c)for(var d in Ao)if("deltae"+c.toLowerCase()===d.toLowerCase()){y=Ao[d];break}0===s&&(s=1e-16);var g=Eo(Io(t,i),{method:"clip",space:i});if(y(t,g)>s){if(p&&3===Object.keys(p).length){var b=un.resolveCoord(p.channel),m=pn(Io(t,b.space),b.id);if(Tr(m)&&(m=0),m>=p.max)return Io({space:"xyz-d65",coords:Qr.D65},t.space);if(m<=p.min)return Io({space:"xyz-d65",coords:[0,0,0]},t.space)}var v=un.resolveCoord(o),w=v.space,M=v.id,S=Io(t,w);S.coords.forEach((function(t,e){Tr(t)&&(S.coords[e]=0)}));for(var k=v.range||v.refRange,O=k[0],j=_o(s),x=O,C=pn(S,M);C-x>j;){var A=Tn(S);A=Eo(A,{space:i,method:"clip"});var _=y(S,A);_-s<j?x=pn(S,M):C=pn(S,M),yn(S,M,(x+C)/2)}e=Io(S,i)}else e=g}if("clip"===o||!In(e,i,{epsilon:0})){var P=Object.values(i.coords).map((function(t){return t.range||[]}));e.coords=e.coords.map((function(t,e){var r=br(P[e],2),n=r[0],o=r[1];return void 0!==n&&(t=Math.max(n,t)),void 0!==o&&(t=Math.min(t,o)),t}))}}return i!==t.space&&(e=Io(e,t.space)),t.coords=e.coords,t}Eo.returns="color";var Bo={WHITE:{space:Bn,coords:[1,0,0],alpha:1},BLACK:{space:Bn,coords:[0,0,0],alpha:1}};function Ro(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.space,n=.02,o=1e-4;t=an(t),r||(r=t.space),r=un.get(r);var a=un.get("oklch");if(r.isUnbounded)return Io(t,r);var i=Io(t,a),u=i.coords[0];if(u>=1){var c=Io(Bo.WHITE,r);return c.alpha=t.alpha,Io(c,r)}if(u<=0){var l=Io(Bo.BLACK,r);return l.alpha=t.alpha,Io(l,r)}if(In(i,r,{epsilon:0}))return Io(i,r);function s(t){var e=Io(t,r),n=Object.values(r.coords);return e.coords=e.coords.map((function(t,e){if("range"in n[e]){var r=br(n[e].range,2);return qr(r[0],t,r[1])}return t})),e}var f=0,p=i.coords[1],h=!0,y=Tn(i),d=s(y),g=Rn(d,y);if(g<n)return d;for(;p-f>o;){var b=(f+p)/2;if(y.coords[1]=b,h&&In(y,r,{epsilon:0}))f=b;else if((g=Rn(d=s(y),y))<n){if(n-g<o)break;h=!1,f=b}else p=b}return d}function Io(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.inGamut;t=an(t);var o=(e=un.get(e)).from(t),a={space:e,coords:o,alpha:t.alpha};return n&&(a=Eo(a,!0===n?void 0:n)),a}function To(t){var e,r,n,o,a,i,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=u.precision,l=void 0===c?Xr.precision:c,s=u.format,f=u.inGamut,p=void 0===f||f,h=u.coords,y=u.alpha,d=u.commas,g=an(t),b=s,m=g.parseMeta;m&&!s&&(m.format.canSerialize()&&(s=m.format,b=m.formatId),null!==(r=h)&&void 0!==r||(h=m.types),null!==(n=y)&&void 0!==n||(y=m.alphaType),null!==(o=d)&&void 0!==o||(d=m.commas));b&&(s=null!==(a=g.space.getFormat(s))&&void 0!==a?a:un.findFormat(b));s||(b=(s=null!==(i=g.space.getFormat("default"))&&void 0!==i?i:un.DEFAULT_FORMAT).name);s&&s.space&&s.space!==g.space&&(g=Io(g,s.space));var v=g.coords.slice();if(p||(p=s.toGamut),p&&!In(g)&&(v=Eo(Tn(g),!0===p?void 0:p).coords),"custom"===s.type){if(!s.serialize)throw new TypeError("format ".concat(b," can only be used to parse colors, not for serialization"));e=s.serialize(v,g.alpha,u)}else{var w,M,S,k,O,j=s.name||"color",x=s.serializeCoords(v,l,h);if("color"===j){var C,A=s.id||(null===(C=s.ids)||void 0===C?void 0:C[0])||g.space.cssId||g.space.id;x.unshift(A)}var _=g.alpha;void 0!==y&&"object"!==Mr(y)&&(y="string"==typeof y?{type:y}:{include:y});var P=null!==(w=null===(M=y)||void 0===M?void 0:M.type)&&void 0!==w?w:"<number>",E=!0===(null===(S=y)||void 0===S?void 0:S.include)||!0===s.alpha||!1!==(null===(k=y)||void 0===k?void 0:k.include)&&!1!==s.alpha&&_<1,B="";if(null!==(O=d)&&void 0!==O||(d=s.commas),E){var R;if(null!==l)"<percentage>"===P&&(R="%",_*=100),_=Ir(_,{precision:l,unit:R});B="".concat(d?",":" /"," ").concat(_)}e="".concat(j,"(").concat(x.join(d?", ":" ")).concat(B,")")}return e}Io.returns="color";var No,Do=new sn({id:"rec2020-linear",cssId:"--rec2020-linear",name:"Linear REC.2020",white:"D65",toXYZ_M:[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],fromXYZ_M:[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]]}),Lo=new sn({id:"rec2020",name:"REC.2020",base:Do,toBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return e*Math.pow(r,2.4)}))},fromBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return e*Math.pow(r,1/2.4)}))}}),Fo=new sn({id:"p3-linear",cssId:"display-p3-linear",name:"Linear P3",white:"D65",toXYZ_M:[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],fromXYZ_M:[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]]}),zo=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],qo=new sn({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],fromXYZ_M:zo}),$o={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[.6,50/255,.8],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,.6],lightslategrey:[119/255,136/255,.6],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[.4,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,.8],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[.4,.2,.6],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]},Wo=Array(3).fill("<percentage> | <number>[0, 255]"),Ho=Array(3).fill("<number>[0, 255]"),Uo=new sn({id:"srgb",name:"sRGB",base:qo,fromBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return r>.0031308?e*(1.055*Math.pow(r,1/2.4)-.055):12.92*t}))},toBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return r<=.04045?t/12.92:e*Math.pow((r+.055)/1.055,2.4)}))},formats:{rgb:{coords:Wo},rgb_number:{name:"rgb",commas:!0,coords:Ho,alpha:!1},color:{},rgba:{coords:Wo,commas:!0,alpha:!0},rgba_number:{name:"rgba",commas:!0,coords:Ho},hex:{type:"custom",toGamut:!0,test:function(t){return/^#(([a-f0-9]{2}){3,4}|[a-f0-9]{3,4})$/i.test(t)},parse:function(t){t.length<=5&&(t=t.replace(/[a-f0-9]/gi,"$&$&"));var e=[];return t.replace(/[a-f0-9]{2}/gi,(function(t){e.push(parseInt(t,16)/255)})),{spaceId:"srgb",coords:e.slice(0,3),alpha:e.slice(3)[0]}},serialize:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.collapse,o=void 0===n||n,a=r.alpha;(!1!==a&&e<1||!0===a)&&t.push(e),t=t.map((function(t){return Math.round(255*t)}));var i=o&&t.every((function(t){return t%17==0})),u=t.map((function(t){return i?(t/17).toString(16):t.toString(16).padStart(2,"0")})).join("");return"#"+u}},keyword:{type:"custom",test:function(t){return/^[a-z]+$/i.test(t)},parse:function(t){var e={spaceId:"srgb",coords:null,alpha:1};if("transparent"===(t=t.toLowerCase())?(e.coords=$o.black,e.alpha=0):e.coords=$o[t],e.coords)return e}}}}),Go=new sn({id:"p3",cssId:"display-p3",name:"P3",base:Fo,fromBase:Uo.fromBase,toBase:Uo.toBase});if(Xr.display_space=Uo,"undefined"!=typeof CSS&&CSS.supports)for(var Jo=0,Vo=[mn,Lo,Go];Jo<Vo.length;Jo++){var Xo=Vo[Jo],Ko=Xo.getMinCoords(),Yo=To({space:Xo,coords:Ko,alpha:1});if(CSS.supports("color",Yo)){Xr.display_space=Xo;break}}function Zo(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.space,n=void 0===r?Xr.display_space:r,o=lr(e,ar),a=To(t=an(t),o);if("undefined"==typeof CSS||CSS.supports("color",a)||!Xr.display_space)(a=new String(a)).color=t;else{var i,u=t,c=t.coords.some(Tr)||Tr(t.alpha);if(c)if(!(null!==(i=No)&&void 0!==i?i:No=CSS.supports("color","hsl(none 50% 50%)"))&&((u=Tn(t)).coords=u.coords.map(Nr),u.alpha=Nr(u.alpha),a=To(u,o),CSS.supports("color",a)))return(a=new String(a)).color=u,a;u=Io(u,n),(a=new String(To(u,o))).color=u}return a}function Qo(t,e){return Tr(t)||Tr(e)?t===e?null:0:t-e}function ta(t){return pn(t,[ln,"y"])}function ea(t,e){yn(t,[ln,"y"],e)}var ra=Object.freeze({__proto__:null,getLuminance:ta,register:function(t){Object.defineProperty(t.prototype,"luminance",{get:function(){return ta(this)},set:function(t){ea(this,t)}})},setLuminance:ea});function na(t){return t>=.022?t:t+Math.pow(.022-t,1.414)}function oa(t){var e=t<0?-1:1,r=Math.abs(t);return e*Math.pow(r,2.4)}var aa=24389/27,ia=Qr.D65,ua=new un({id:"lab-d65",name:"Lab D65",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:ia,base:ln,fromBase:function(t){var e=t.map((function(t,e){return t/ia[e]})).map((function(t){return t>216/24389?Math.cbrt(t):(aa*t+16)/116}));return[116*e[1]-16,500*(e[0]-e[1]),200*(e[1]-e[2])]},toBase:function(t){var e=[];return e[1]=(t[0]+16)/116,e[0]=t[1]/500+e[1],e[2]=e[1]-t[2]/200,[e[0]>24/116?Math.pow(e[0],3):(116*e[0]-16)/aa,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/aa,e[2]>24/116?Math.pow(e[2],3):(116*e[2]-16)/aa].map((function(t,e){return t*ia[e]}))},formats:{"lab-d65":{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <percentage>"]}}}),ca=.5*Math.pow(5,.5)+.5;var la=Object.freeze({__proto__:null,contrastAPCA:function(t,e){var r,n,o,a;e=an(e),t=an(t);var i=br((e=Io(e,"srgb")).coords.map((function(t){return Tr(t)?0:t})),3);n=i[0],o=i[1],a=i[2];var u=.2126729*oa(n)+.7151522*oa(o)+.072175*oa(a),c=br((t=Io(t,"srgb")).coords.map((function(t){return Tr(t)?0:t})),3);n=c[0],o=c[1],a=c[2];var l=.2126729*oa(n)+.7151522*oa(o)+.072175*oa(a),s=na(u),f=na(l),p=f>s;return r=Math.abs(f-s)<5e-4?0:p?1.14*(Math.pow(f,.56)-Math.pow(s,.57)):1.14*(Math.pow(f,.65)-Math.pow(s,.62)),100*(Math.abs(r)<.1?0:r>0?r-.027:r+.027)},contrastDeltaPhi:function(t,e){t=an(t),e=an(e);var r=pn(t,[ua,"l"]),n=pn(e,[ua,"l"]),o=Math.abs(Math.pow(r,ca)-Math.pow(n,ca)),a=Math.pow(o,1/ca)*Math.SQRT2-40;return a<7.5?0:a},contrastLstar:function(t,e){t=an(t),e=an(e);var r=pn(t,[mn,"l"]),n=pn(e,[mn,"l"]);return Math.abs(r-n)},contrastMichelson:function(t,e){t=an(t),e=an(e);var r=Math.max(ta(t),0),n=Math.max(ta(e),0);if(n>r){var o=[n,r];r=o[0],n=o[1]}var a=r+n;return 0===a?0:(r-n)/a},contrastWCAG21:function(t,e){t=an(t),e=an(e);var r=Math.max(ta(t),0),n=Math.max(ta(e),0);if(n>r){var o=[n,r];r=o[0],n=o[1]}return(r+.05)/(n+.05)},contrastWeber:function(t,e){t=an(t),e=an(e);var r=Math.max(ta(t),0),n=Math.max(ta(e),0);if(n>r){var o=[n,r];r=o[0],n=o[1]}return 0===n?5e4:(r-n)/n}});function sa(t){var e=br(fn(t,ln),3),r=e[0],n=e[1],o=r+15*n+3*e[2];return[4*r/o,9*n/o]}function fa(t){var e=br(fn(t,ln),3),r=e[0],n=e[1],o=r+n+e[2];return[r/o,n/o]}var pa=Object.freeze({__proto__:null,register:function(t){Object.defineProperty(t.prototype,"uv",{get:function(){return sa(this)}}),Object.defineProperty(t.prototype,"xy",{get:function(){return fa(this)}})},uv:sa,xy:fa});function ha(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Br(r)&&(r={method:r});var n=r,o=n.method,a=void 0===o?Xr.deltaE:o,i=lr(n,ur);for(var u in Ao)if("deltae"+a.toLowerCase()===u.toLowerCase())return Ao[u](t,e,i);throw new TypeError("Unknown deltaE method: ".concat(a))}function ya(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,r=un.get("oklch","lch"),n=[r,"l"];return yn(t,n,(function(t){return t*(1+e)}))}function da(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,r=un.get("oklch","lch"),n=[r,"l"];return yn(t,n,(function(t){return t*(1-e)}))}ya.returns="color",da.returns="color";var ga=Object.freeze({__proto__:null,darken:da,lighten:ya});function ba(t,e,r){var n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=[an(t),an(e)];if(t=a[0],e=a[1],"object"===Rr(r)){var i=[.5,r];r=i[0],o=i[1]}var u=va(t,e,o);return u(null!==(n=r)&&void 0!==n?n:.5)}function ma(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(wa(t)){n=e;var o=br((r=t).rangeArgs.colors,2);t=o[0],e=o[1]}var a=n,i=a.maxDeltaE,u=a.deltaEMethod,c=a.steps,l=void 0===c?2:c,s=a.maxSteps,f=void 0===s?1e3:s,p=lr(a,cr);if(!r){var h=[an(t),an(e)];t=h[0],e=h[1],r=va(t,e,p)}var y=ha(t,e),d=i>0?Math.max(l,Math.ceil(y/i)+1):l,g=[];if(void 0!==f&&(d=Math.min(d,f)),1===d)g=[{p:.5,color:r(.5)}];else{var b=1/(d-1);g=Array.from({length:d},(function(t,e){var n=e*b;return{p:n,color:r(n)}}))}if(i>0)for(var m=g.reduce((function(t,e,r){if(0===r)return 0;var n=ha(e.color,g[r-1].color,u);return Math.max(t,n)}),0);m>i;){m=0;for(var v=1;v<g.length&&g.length<f;v++){var w=g[v-1],M=g[v],S=(M.p+w.p)/2,k=r(S);m=Math.max(m,ha(k,w.color),ha(k,M.color)),g.splice(v,0,{p:S,color:r(S)}),v++}}return g=g.map((function(t){return t.color}))}function va(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(wa(t)){var n=t,o=e;return va.apply(void 0,pr(n.rangeArgs.colors).concat([yr(yr({},n.rangeArgs.options),o)]))}var a=r.space,i=r.outputSpace,u=r.progression,c=r.premultiplied;t=an(t),e=an(e),t=Tn(t),e=Tn(e);var l={colors:[t,e],options:r};if(a=a?un.get(a):un.registry[Xr.interpolationSpace]||t.space,i=i?un.get(i):a,t=Io(t,a),e=Io(e,a),t=Eo(t),e=Eo(e),a.coords.h&&"angle"===a.coords.h.type){var s=r.hue=r.hue||"shorter",f=[a,"h"],p=[pn(t,f),pn(e,f)],h=p[0],y=p[1];Tr(h)&&!Tr(y)?h=y:Tr(y)&&!Tr(h)&&(y=h);var d=wn(s,[h,y]),g=br(d,2);h=g[0],y=g[1],yn(t,f,h),yn(e,f,y)}return c&&(t.coords=t.coords.map((function(e){return e*t.alpha})),e.coords=e.coords.map((function(t){return t*e.alpha}))),Object.assign((function(r){r=u?u(r):r;var n=t.coords.map((function(t,n){return Lr(t,e.coords[n],r)})),o=Lr(t.alpha,e.alpha,r),l={space:a,coords:n,alpha:o};return c&&(l.coords=l.coords.map((function(t){return t/o}))),i!==a&&(l=Io(l,i)),l}),{rangeArgs:l})}function wa(t){return"function"===Rr(t)&&!!t.rangeArgs}Xr.interpolationSpace="lab";var Ma=Object.freeze({__proto__:null,isRange:wa,mix:ba,range:va,register:function(t){t.defineFunction("mix",ba,{returns:"color"}),t.defineFunction("range",va,{returns:"function<color>"}),t.defineFunction("steps",ma,{returns:"array<color>"})},steps:ma}),Sa=new un({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:Uo,fromBase:function(t){var e=Math.max.apply(Math,pr(t)),r=Math.min.apply(Math,pr(t)),n=br(t,3),o=n[0],a=n[1],i=n[2],u=null,c=0,l=(r+e)/2,s=e-r;if(0!==s){switch(c=0===l||1===l?0:(e-l)/Math.min(l,1-l),e){case o:u=(a-i)/s+(a<i?6:0);break;case a:u=(i-o)/s+2;break;case i:u=(o-a)/s+4}u*=60}return c<0&&(u+=180,c=Math.abs(c)),u>=360&&(u-=360),[u,100*c,100*l]},toBase:function(t){var e=br(t,3),r=e[0],n=e[1],o=e[2];function a(t){var e=(t+r/30)%12,a=n*Math.min(o,1-o);return o-a*Math.max(-1,Math.min(e-3,9-e,1))}return(r%=360)<0&&(r+=360),n/=100,o/=100,[a(0),a(8),a(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]},hsla:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"],commas:!0,alpha:!0}}}),ka=new un({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:Uo,fromBase:function(t){var e=Math.max.apply(Math,pr(t)),r=Math.min.apply(Math,pr(t)),n=br(t,3),o=n[0],a=n[1],i=n[2],u=null,c=0,l=e,s=e-r;if(0!==s){switch(e){case o:u=(a-i)/s+(a<i?6:0);break;case a:u=(i-o)/s+2;break;case i:u=(o-a)/s+4}u*=60}return l&&(c=s/l),u>=360&&(u-=360),[u,100*c,100*l]},toBase:function(t){var e=br(t,3),r=e[0],n=e[1],o=e[2];function a(t){var e=(t+r/60)%6;return o-o*n*Math.max(0,Math.min(e,4-e,1))}return(r%=360)<0&&(r+=360),n/=100,o/=100,[a(5),a(3),a(1)]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),Oa=new un({id:"hwb",name:"HWB",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},w:{range:[0,100],name:"Whiteness"},b:{range:[0,100],name:"Blackness"}},base:ka,fromBase:function(t){var e=br(t,3),r=e[0],n=e[1],o=e[2];return[r,o*(100-n)/100,100-o]},toBase:function(t){var e=br(t,3),r=e[0],n=e[1],o=e[2],a=(n/=100)+(o/=100);if(a>=1)return[r,0,100*(n/a)];var i=1-o;return[r,100*(0===i?0:1-n/i),100*i]},formats:{hwb:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),ja=new sn({id:"a98rgb-linear",cssId:"--a98-rgb-linear",name:"Linear Adobe® 98 RGB compatible",white:"D65",toXYZ_M:[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],fromXYZ_M:[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]]}),xa=new sn({id:"a98rgb",cssId:"a98-rgb",name:"Adobe® 98 RGB compatible",base:ja,toBase:function(t){return t.map((function(t){return Math.pow(Math.abs(t),563/256)*Math.sign(t)}))},fromBase:function(t){return t.map((function(t){return Math.pow(Math.abs(t),256/563)*Math.sign(t)}))}}),Ca=new sn({id:"prophoto-linear",cssId:"--prophoto-rgb-linear",name:"Linear ProPhoto",white:"D50",base:dn,toXYZ_M:[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],fromXYZ_M:[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]]}),Aa=new sn({id:"prophoto",cssId:"prophoto-rgb",name:"ProPhoto",base:Ca,toBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return r<16/512?t/16:e*Math.pow(r,1.8)}))},fromBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return r>=1/512?e*Math.pow(r,1/1.8):16*t}))}}),_a=1.09929682680944,Pa=.018053968510807,Ea=new sn({id:"--rec2020-oetf",name:"REC.2020_Scene_Referred",base:Do,referred:"scene",toBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return r<4.5*Pa?t/4.5:e*Math.pow((r+_a-1)/_a,1/.45)}))},fromBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return r>=Pa?e*(_a*Math.pow(r,.45)-(_a-1)):4.5*t}))}}),Ba=new un({id:"oklch",name:"OkLCh",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:Bn,fromBase:Mn.fromBase,toBase:Mn.toBase,formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}}),Ra=2*Math.PI,Ia=[[4.076741636075958,-3.307711539258063,.2309699031821043],[-1.2684379732850315,2.609757349287688,-.341319376002657],[-.0041960761386756,-.7034186179359362,1.7076146940746117]],Ta=[[[-1.8817031,-.80936501],[1.19086277,1.76576728,.59662641,.75515197,.56771245]],[[1.8144408,-1.19445267],[.73956515,-.45954404,.08285427,.12541073,-.14503204]],[[.13110758,1.81333971],[1.35733652,-.00915799,-1.1513021,-.50559606,.00692167]]],Na=Number.MAX_VALUE,Da=.206,La=(1+Da)/1.03;function Fa(t,e){var r=t.length;if(r!==e.length)throw new Error("Vectors of size ".concat(r," and ").concat(e.length," are not aligned"));var n=0;return t.forEach((function(t,r){n+=t*e[r]})),n}function za(t){return.5*(La*t-Da+Math.sqrt((La*t-Da)*(La*t-Da)+.12*La*t))}function qa(t){return(Math.pow(t,2)+Da*t)/(La*(t+.03))}function $a(t){var e=br(t,2),r=e[0],n=e[1];return[n/r,n/(1-r)]}function Wa(t,e){var r=Er(t,En);return r[0]=Math.pow(r[0],3),r[1]=Math.pow(r[1],3),r[2]=Math.pow(r[2],3),Er(r,e,r)}function Ha(t,e,r,n){var o=function(t,e,r,n){var o,a,i,u,c,l,s,f;if(Fa(n[0][0],[t,e])>1){var p=br(n[0][1],5);o=p[0],a=p[1],i=p[2],u=p[3],c=p[4];var h=br(r[0],3);l=h[0],s=h[1],f=h[2]}else if(Fa(n[1][0],[t,e])>1){var y=br(n[1][1],5);o=y[0],a=y[1],i=y[2],u=y[3],c=y[4];var d=br(r[1],3);l=d[0],s=d[1],f=d[2]}else{var g=br(n[2][1],5);o=g[0],a=g[1],i=g[2],u=g[3],c=g[4];var b=br(r[2],3);l=b[0],s=b[1],f=b[2]}var m=o+a*t+i*e+u*Math.pow(t,2)+c*t*e,v=Fa(En[0].slice(1),[t,e]),w=Fa(En[1].slice(1),[t,e]),M=Fa(En[2].slice(1),[t,e]),S=1+m*v,k=1+m*w,O=1+m*M,j=Math.pow(S,3),x=Math.pow(k,3),C=Math.pow(O,3),A=3*v*Math.pow(S,2),_=3*w*Math.pow(k,2),P=3*M*Math.pow(O,2),E=6*Math.pow(v,2)*S,B=6*Math.pow(w,2)*k,R=6*Math.pow(M,2)*O,I=l*j+s*x+f*C,T=l*A+s*_+f*P,N=l*E+s*B+f*R;return m-=I*T/(Math.pow(T,2)-.5*I*N)}(t,e,r,n),a=Wa([1,o*t,o*e],r),i=Wr(1/Math.max.apply(Math,pr(a)),1/3);return[i,i*o]}function Ua(t,e,r){var n=br(t,3),o=n[0],a=n[1],i=n[2],u=Ha(a,i,e,r),c=function(t,e,r,n,o,a,i,u){var c;if(void 0===u&&(u=Ha(t,e,a,i)),(r-o)*u[1]-(u[0]-o)*n<=0)c=u[1]*o/(n*u[0]+u[1]*(o-r));else{c=u[1]*(o-1)/(n*(u[0]-1)+u[1]*(o-r));var l=r-o,s=n,f=Fa(En[0].slice(1),[t,e]),p=Fa(En[1].slice(1),[t,e]),h=Fa(En[2].slice(1),[t,e]),y=l+s*f,d=l+s*p,g=l+s*h,b=o*(1-c)+c*r,m=c*n,v=b+m*f,w=b+m*p,M=b+m*h,S=Math.pow(v,3),k=Math.pow(w,3),O=Math.pow(M,3),j=3*y*Math.pow(v,2),x=3*d*Math.pow(w,2),C=3*g*Math.pow(M,2),A=6*Math.pow(y,2)*v,_=6*Math.pow(d,2)*w,P=6*Math.pow(g,2)*M,E=Fa(a[0],[S,k,O])-1,B=Fa(a[0],[j,x,C]),R=B/(B*B-.5*E*Fa(a[0],[A,_,P])),I=-E*R,T=Fa(a[1],[S,k,O])-1,N=Fa(a[1],[j,x,C]),D=N/(N*N-.5*T*Fa(a[1],[A,_,P])),L=-T*D,F=Fa(a[2],[S,k,O])-1,z=Fa(a[2],[j,x,C]),q=z/(z*z-.5*F*Fa(a[2],[A,_,P])),$=-F*q;I=R>=0?I:Na,L=D>=0?L:Na,$=q>=0?$:Na,c+=Math.min(I,Math.min(L,$))}return c}(a,i,o,1,o,e,r,u),l=$a(u),s=c/Math.min(o*l[0],(1-o)*l[1]),f=function(t,e){return[.11516993+1/(7.4477897+4.1590124*e+t*(1.75198401*e-2.19557347+t*(-2.13704948-10.02301043*e+t*(5.38770819*e-4.24894561+4.69891013*t)))),.11239642+1/(1.6132032-.68124379*e+t*(.40370612+.90148123*e+t*(.6122399*e-.27087943+t*(.00299215-.45399568*e-.14661872*t))))]}(a,i),p=o*f[0],h=(1-o)*f[1],y=.9*s*Math.sqrt(Math.sqrt(1/(1/Math.pow(p,4)+1/Math.pow(h,4))));return p=.4*o,h=.8*(1-o),[Math.sqrt(1/(1/Math.pow(p,2)+1/Math.pow(h,2))),y,c]}var Ga=new un({id:"okhsl",name:"Okhsl",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,1],name:"Saturation"},l:{range:[0,1],name:"Lightness"}},base:Bn,gamutSpace:"self",fromBase:function(t){return function(t,e,r){var n=t[0],o=0,a=za(n),i=Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),u=.5+Math.atan2(-t[2],-t[1])/Ra;if(0!==a&&1!==a&&0!==i){var c,l,s=br(Ua([n,t[1]/i,t[2]/i],e,r),3),f=s[0],p=s[1],h=s[2];o=i<p?.8*(i/((l=.8*f)+(1-l/p)*i)):.8+.2*((i-(c=p))/((l=.2*Math.pow(p,2)*Math.pow(1.25,2)/f)+(1-l/(h-p))*(i-c)))}var y=Math.abs(o)<1e-4;return y||0===a||Math.abs(1-a)<1e-7?(u=null,y||(o=0)):u=vn(360*u),[u,o,a]}(t,Ia,Ta)},toBase:function(t){return function(t,e,r){var n=br(t,3),o=n[0],a=n[1],i=qa(n[2]),u=null,c=null;if(o=vn(o)/360,0!==i&&1!==i&&0!==a){var l,s,f,p,h=Math.cos(Ra*o),y=Math.sin(Ra*o),d=br(Ua([i,h,y],e,r),3),g=d[0],b=d[1],m=d[2];a<.8?(l=1.25*a,s=0,p=1-(f=.8*g)/b):(l=5*(a-.8),s=b,p=1-(f=.2*Math.pow(b,2)*Math.pow(1.25,2)/g)/(m-b));var v=s+l*f/(1-p*l);u=v*h,c=v*y}return[i,u,c]}(t,Ia,Ta)},formats:{color:{id:"--okhsl",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),Ja=new un({id:"oklrab",name:"Oklrab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Bn,fromBase:function(t){return[za(t[0]),t[1],t[2]]},toBase:function(t){return[qa(t[0]),t[1],t[2]]},formats:{color:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),Va=new un({id:"oklrch",name:"Oklrch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:Ja,fromBase:Mn.fromBase,toBase:Mn.toBase,formats:{color:{coords:["<percentage> | <number>","<number> | <percentage>[0,1]","<number> | <angle>"]}}});var Xa=new un({id:"okhsv",name:"Okhsv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,1],name:"Saturation"},v:{range:[0,1],name:"Value"}},base:Bn,gamutSpace:"self",fromBase:function(t){return function(t,e,r){var n=t[0],o=0,a=za(n),i=Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),u=.5+Math.atan2(-t[2],-t[1])/Ra;if(0!==n&&1!==n&&0!==i){var c=t[1]/i,l=t[2]/i,s=br($a(Ha(c,l,e,r)),2),f=s[0],p=s[1],h=1-.5/f,y=p/(i+n*p),d=y*n,g=y*i,b=qa(d),m=g*b/d,v=br(Wa([b,c*m,l*m],e),3),w=v[0],M=v[1],S=v[2],k=Wr(1/Math.max(Math.max(w,M),Math.max(S,0)),1/3);i=(i/=k)*za(n/=k)/n,a=(n=za(n))/d,o=(.5+p)*g/(.5*p+p*h*g)}return[u=Math.abs(o)<1e-4||0===a?null:vn(360*u),o,a]}(t,Ia,Ta)},toBase:function(t){return function(t,e,r){var n=br(t,3),o=n[0],a=n[1],i=n[2];o=vn(o)/360;var u=qa(i),c=null,l=null;if(0!==u&&0!==a){var s=Math.cos(Ra*o),f=Math.sin(Ra*o),p=br($a(Ha(s,f,e,r)),2),h=p[0],y=p[1],d=1-.5/h,g=1-.5*a/(.5+y-y*d*a),b=a*y*.5/(.5+y-y*d*a);u=i*g;var m=i*b,v=qa(g),w=b*v/g,M=qa(u);m=m*M/u,u=M;var S=br(Wa([v,s*w,f*w],e),3),k=S[0],O=S[1],j=S[2],x=Wr(1/Math.max(Math.max(k,O),Math.max(j,0)),1/3);u*=x,c=(m*=x)*s,l=m*f}return[u,c,l]}(t,Ia,Ta)},formats:{color:{id:"--okhsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),Ka=Qr.D65,Ya=br(sa({space:ln,coords:Ka}),2),Za=Ya[0],Qa=Ya[1],ti=new un({id:"luv",name:"Luv",coords:{l:{refRange:[0,100],name:"Lightness"},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:Ka,base:ln,fromBase:function(t){var e=[Nr(t[0]),Nr(t[1]),Nr(t[2])],r=e[1],n=br(sa({space:ln,coords:e}),2),o=n[0],a=n[1];if(!Number.isFinite(o)||!Number.isFinite(a))return[0,0,0];var i=r<=216/24389?24389/27*r:116*Math.cbrt(r)-16;return[i,13*i*(o-Za),13*i*(a-Qa)]},toBase:function(t){var e=br(t,3),r=e[0],n=e[1],o=e[2];if(0===r||Tr(r))return[0,0,0];n=Nr(n),o=Nr(o);var a=n/(13*r)+Za,i=o/(13*r)+Qa,u=r<=8?r/(24389/27):Math.pow((r+16)/116,3);return[u*(9*a/(4*i)),u,u*((12-3*a-20*i)/(4*i))]},formats:{color:{id:"--luv",coords:["<number> | <percentage>","<number> | <percentage>","<number> | <percentage>"]}}}),ei=new un({id:"lchuv",name:"LChuv",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,220],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:ti,fromBase:Mn.fromBase,toBase:Mn.toBase,formats:{color:{id:"--lchuv",coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}}),ri=zo[0][0],ni=zo[0][1],oi=zo[0][2],ai=zo[1][0],ii=zo[1][1],ui=zo[1][2],ci=zo[2][0],li=zo[2][1],si=zo[2][2];function fi(t,e,r){var n=e/(Math.sin(r)-t*Math.cos(r));return n<0?1/0:n}function pi(t){var e=Math.pow(t+16,3)/1560896,r=e>216/24389?e:t/(24389/27),n=r*(284517*ri-94839*oi),o=r*(838422*oi+769860*ni+731718*ri),a=r*(632260*oi-126452*ni),i=r*(284517*ai-94839*ui),u=r*(838422*ui+769860*ii+731718*ai),c=r*(632260*ui-126452*ii),l=r*(284517*ci-94839*si),s=r*(838422*si+769860*li+731718*ci),f=r*(632260*si-126452*li);return{r0s:n/a,r0i:o*t/a,r1s:n/(a+126452),r1i:(o-769860)*t/(a+126452),g0s:i/c,g0i:u*t/c,g1s:i/(c+126452),g1i:(u-769860)*t/(c+126452),b0s:l/f,b0i:s*t/f,b1s:l/(f+126452),b1i:(s-769860)*t/(f+126452)}}function hi(t,e){var r=e/360*Math.PI*2,n=fi(t.r0s,t.r0i,r),o=fi(t.r1s,t.r1i,r),a=fi(t.g0s,t.g0i,r),i=fi(t.g1s,t.g1i,r),u=fi(t.b0s,t.b0i,r),c=fi(t.b1s,t.b1i,r);return Math.min(n,o,a,i,u,c)}var yi=new un({id:"hsluv",name:"HSLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:ei,gamutSpace:Uo,fromBase:function(t){var e,r=[Nr(t[0]),Nr(t[1]),Nr(t[2])],n=r[0],o=r[2];if(n>99.9999999)e=0,n=100;else if(n<1e-8)e=0,n=0;else{e=r[1]/hi(pi(n),o)*100}return[o,e,n]},toBase:function(t){var e,r=[Nr(t[0]),Nr(t[1]),Nr(t[2])],n=r[0],o=r[1],a=r[2];if(a>99.9999999)a=100,e=0;else if(a<1e-8)a=0,e=0;else{e=hi(pi(a),n)/100*o}return[a,e,n]},formats:{color:{id:"--hsluv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});function di(t,e){return Math.abs(e)/Math.sqrt(Math.pow(t,2)+1)}function gi(t){var e=di(t.r0s,t.r0i),r=di(t.r1s,t.r1i),n=di(t.g0s,t.g0i),o=di(t.g1s,t.g1i),a=di(t.b0s,t.b0i),i=di(t.b1s,t.b1i);return Math.min(e,r,n,o,a,i)}zo[0][0],zo[0][1],zo[0][2],zo[1][0],zo[1][1],zo[1][2],zo[2][0],zo[2][1],zo[2][2];var bi=new un({id:"hpluv",name:"HPLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:ei,gamutSpace:"self",fromBase:function(t){var e,r=[Nr(t[0]),Nr(t[1]),Nr(t[2])],n=r[0],o=r[2];if(n>99.9999999)e=0,n=100;else if(n<1e-8)e=0,n=0;else{e=r[1]/gi(pi(n))*100}return[o,e,n]},toBase:function(t){var e,r=[Nr(t[0]),Nr(t[1]),Nr(t[2])],n=r[0],o=r[1],a=r[2];if(a>99.9999999)a=100,e=0;else if(a<1e-8)a=0,e=0;else{e=gi(pi(a))/100*o}return[a,e,n]},formats:{color:{id:"--hpluv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),mi=new sn({id:"rec2100-linear",name:"Linear REC.2100",white:"D65",toBase:Do.toBase,fromBase:Do.fromBase}),vi=2610/Math.pow(2,14),wi=Math.pow(2,14)/2610,Mi=2523/Math.pow(2,5),Si=Math.pow(2,5)/2523,ki=3424/Math.pow(2,12),Oi=2413/Math.pow(2,7),ji=2392/Math.pow(2,7),xi=new sn({id:"rec2100pq",cssId:"rec2100-pq",name:"REC.2100-PQ",base:mi,toBase:function(t){return t.map((function(t){return 1e4*Math.pow(Math.max(Math.pow(t,Si)-ki,0)/(Oi-ji*Math.pow(t,Si)),wi)/203}))},fromBase:function(t){return t.map((function(t){var e=Math.max(203*t/1e4,0),r=ki+Oi*Math.pow(e,vi),n=1+ji*Math.pow(e,vi);return Math.pow(r/n,Mi)}))}}),Ci=new sn({id:"rec2100hlg",cssId:"rec2100-hlg",name:"REC.2100-HLG",referred:"scene",base:mi,toBase:function(t){return t.map((function(t){return t<=.5?Math.pow(t,2)/3*3.7743:(Math.exp((t-.55991073)/.17883277)+.28466892)/12*3.7743}))},fromBase:function(t){return t.map((function(t){return(t/=3.7743)<=1/12?Wr(3*t,.5):.17883277*Math.log(12*t-.28466892)+.55991073}))}}),Ai={};function _i(t){var e=t.id;t.toCone_M,t.fromCone_M;Ai[e]=arguments[0]}function Pi(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Bradford",n=Ai[r],o=_r(n.toCone_M,t),a=br(o,3),i=a[0],u=a[1],c=a[2],l=_r(n.toCone_M,e),s=br(l,3),f=s[0],p=s[1],h=s[2],y=[[f/i,0,0],[0,p/u,0],[0,0,h/c]],d=_r(y,n.toCone_M),g=_r(n.fromCone_M,d);return g}Vr.add("chromatic-adaptation-start",(function(t){t.options.method&&(t.M=Pi(t.W1,t.W2,t.options.method))})),Vr.add("chromatic-adaptation-end",(function(t){t.M||(t.M=Pi(t.W1,t.W2,t.options.method))})),_i({id:"von Kries",toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]}),_i({id:"Bradford",toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]}),_i({id:"CAT02",toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]}),_i({id:"CAT16",toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]}),Object.assign(Qr,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]}),Qr.ACES=[.32168/.33767,1,.34065/.33767];var Ei=new sn({id:"acescg",cssId:"--acescg",name:"ACEScg",coords:{r:{range:[0,65504],name:"Red"},g:{range:[0,65504],name:"Green"},b:{range:[0,65504],name:"Blue"}},referred:"scene",white:Qr.ACES,toXYZ_M:[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],fromXYZ_M:[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]]}),Bi=Math.pow(2,-16),Ri=(Math.log2(65504)+9.72)/17.52,Ii=new sn({id:"acescc",cssId:"--acescc",name:"ACEScc",coords:{r:{range:[-.35828683,Ri],name:"Red"},g:{range:[-.35828683,Ri],name:"Green"},b:{range:[-.35828683,Ri],name:"Blue"}},referred:"scene",base:Ei,toBase:function(t){return t.map((function(t){return t<=(9.72-15)/17.52?2*(Math.pow(2,17.52*t-9.72)-Bi):t<Ri?Math.pow(2,17.52*t-9.72):65504}))},fromBase:function(t){return t.map((function(t){return t<=0?(Math.log2(Bi)+9.72)/17.52:t<Bi?(Math.log2(Bi+.5*t)+9.72)/17.52:(Math.log2(t)+9.72)/17.52}))}}),Ti=Object.freeze({__proto__:null,A98RGB:xa,A98RGB_Linear:ja,ACEScc:Ii,ACEScg:Ei,CAM16_JMh:vo,HCT:Oo,HPLuv:bi,HSL:Sa,HSLuv:yi,HSV:ka,HWB:Oa,ICTCP:no,JzCzHz:Zn,Jzazbz:Yn,LCH:Mn,LCHuv:ei,Lab:mn,Lab_D65:ua,Luv:ti,OKLCH:Ba,OKLab:Bn,OKLrCH:Va,OKLrab:Ja,Okhsl:Ga,Okhsv:Xa,P3:Go,P3_Linear:Fo,ProPhoto:Aa,ProPhoto_Linear:Ca,REC_2020:Lo,REC_2020_Linear:Do,REC_2020_Scene_Referred:Ea,REC_2100_HLG:Ci,REC_2100_Linear:mi,REC_2100_PQ:xi,XYZ_ABS_D65:Ln,XYZ_D50:dn,XYZ_D65:ln,sRGB:Uo,sRGB_Linear:qo}),Ni=function(){function t(){var e,r,n,o,a=this;kr(this,t);for(var i=arguments.length,u=new Array(i),c=0;c<i;c++)u[c]=arguments[c];if(1===u.length){var l={};"object"===Mr(u[0])&&Object.getPrototypeOf(u[0]).constructor===Object&&(u[0]=yr({},u[0])),e=an(u[0],{parseMeta:l}),l.format&&(this.parseMeta=l)}e?(r=e.space||e.spaceId,n=e.coords,o=e.alpha):(r=u[0],n=u[1],o=u[2]),Object.defineProperty(this,"space",{value:un.get(r),writable:!1,enumerable:!0,configurable:!0}),this.coords=n?n.slice():[0,0,0],this.alpha=Tr(o)?o:void 0===o?1:qr(0,o,1);var s=function(t){Object.defineProperty(a,t,{get:function(){return a.get(t)},set:function(e){return a.set(t,e)}})};for(var f in this.space.coords)s(f)}return jr(t,[{key:"spaceId",get:function(){return this.space.id}},{key:"clone",value:function(){return new t(this.space,this.coords,this.alpha)}},{key:"toJSON",value:function(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}},{key:"display",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var o=Zo.apply(void 0,[this].concat(r));return o.color=new t(o.color),o}}],[{key:"get",value:function(e){if(Gr(e,this))return e;for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return dr(t,[e].concat(n))}},{key:"try",value:function(e,r){if(Gr(e,this))return e;var n=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(e))return e.map((function(e){return t(e,r)}));var n=r.cssProperty,o=void 0===n?"background-color":n,a=r.element,i=lr(r,or),u=null;try{return an(e,i)}catch(t){u=t}var c=globalThis.CSS,l=globalThis.getComputedStyle;if(Br(e)&&a&&c&&l&&c.supports(o,e)){var s=a.style[o];e!==s&&(a.style[o]=e);var f=l(a).getPropertyValue(o);if(e!==s&&(a.style[o]=s),f!==e)try{return an(f,i)}catch(t){u=t}else u={message:"Color value is a valid CSS color, but it could not be resolved :("}}return r.errorMeta&&(r.errorMeta.error=u),null}(e,r);return n?new t(n):null}},{key:"defineFunction",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r,o=n.instance,a=void 0===o||o,i=n.returns,u=function(){var e=r.apply(void 0,arguments);if("color"===i)e=t.get(e);else if("function<color>"===i){var n=e;e=function(){var e=n.apply(void 0,arguments);return t.get(e)},Object.assign(e,n)}else"array<color>"===i&&(e=e.map((function(e){return t.get(e)})));return e};e in t||(t[e]=u),a&&(t.prototype[e]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return u.apply(void 0,[this].concat(e))})}},{key:"defineFunctions",value:function(e){for(var r in e)t.defineFunction(r,e[r],e[r])}},{key:"extend",value:function(e){if(e.register)e.register(t);else for(var r in e)t.defineFunction(r,e[r])}}]),t}();Ni.defineFunctions({get:pn,getAll:fn,set:yn,setAll:hn,to:Io,equals:function(t,e){return t=an(t),e=an(e),t.space===e.space&&t.alpha===e.alpha&&t.coords.every((function(t,r){return t===e.coords[r]}))},inGamut:In,toGamut:Eo,distance:Nn,deltas:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.space,o=r.hue,a=void 0===o?"shorter":o;t=an(t),n||(n=t.space),n=un.get(n);var i=Object.values(n.coords),u=[t,e].map((function(t){return Io(t,n)})),c=br(u,2),l=[t=c[0],e=c[1]].map((function(t){return t.coords})),s=br(l,2),f=s[0],p=s[1],h=f.map((function(t,e){var r=i[e],n=p[e];if("angle"===r.type){var o=br(wn(a,[t,n]),2);t=o[0],n=o[1]}return Qo(t,n)})),y=Qo(t.alpha,e.alpha);return{space:n,coords:h,alpha:y}},toString:To}),Object.assign(Ni,{util:Jr,hooks:Vr,WHITES:Qr,Space:un,spaces:un.registry,parse:rn,defaults:Xr});for(var Di=0,Li=Object.keys(Ti);Di<Li.length;Di++){var Fi=Li[Di];un.register(Ti[Fi])}for(var zi in un.registry)qi(zi,un.registry[zi]);function qi(t,e){var r=t.replace(/-/g,"_");Object.defineProperty(Ni.prototype,r,{get:function(){var r=this,n=this.getAll(t);if("undefined"==typeof Proxy)return n;var o=new Proxy(n,{has:function(t,r){try{return un.resolveCoord([e,r]),!0}catch(t){}return Reflect.has(t,r)},get:function(t,r,n){if(r&&"symbol"!==Mr(r)&&!(r in t)&&r in o){var a=un.resolveCoord([e,r]).index;if(a>=0)return t[a]}return Reflect.get(t,r,n)},set:function(n,o,a,i){if(o&&"symbol"!==Mr(o)&&!(o in n)||Number(o)>=0){var u=un.resolveCoord([e,o]).index;if(u>=0)return n[u]=a,r.setAll(t,n),!0}return Reflect.set(n,o,a,i)}});return o},set:function(e){this.setAll(t,e)},configurable:!0,enumerable:!0})}function $i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Wi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$i(Object(r),!0).forEach((function(e){Hi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Hi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Vr.add("colorspace-init-end",(function(t){var e;qi(t.id,t),null===(e=t.aliases)||void 0===e||e.forEach((function(e){qi(e,t)}))})),Ni.extend(Ao),Ni.extend({deltaE:ha}),Object.assign(Ni,{deltaEMethods:Ao}),Ni.extend(ga),Ni.extend({contrast:function(t,e,r){Br(r)&&(r={algorithm:r});var n=r||{},o=n.algorithm,a=lr(n,ir);if(!o){var i=Object.keys(la).map((function(t){return t.replace(/^contrast/,"")})).join(", ");throw new TypeError("contrast() function needs a contrast algorithm. Please specify one of: ".concat(i))}for(var u in t=an(t),e=an(e),la)if("contrast"+o.toLowerCase()===u.toLowerCase())return la[u](t,e,a);throw new TypeError("Unknown contrast algorithm: ".concat(o))}}),Ni.extend(pa),Ni.extend(ra),Ni.extend(Ma),Ni.extend(la);var Ui=Wi(Wi({},Q),{},{windowtext:[0,0,0],transparent:[255,255,255,0]}),Gi=new RegExp(Object.keys(Ui).map((function(t){return"\\b".concat(t,"\\b")})).join("|"),"ig"),Ji=function(t){var e=t.object();return e.a=e.alpha||1,delete e.alpha,e},Vi=function(t){return t.alpha=t.a,delete t.a,Xi(t)},Xi=function t(e){var r=null;try{r=e instanceof le?e:le(e)}catch(n){try{r=t(new Ni(e).to("srgb").toString())}catch(t){console.log("ignore the invalid color: `".concat(e,"`"))}}return r},Ki=function(t,e){return t.replace(m,"").replace(Gi,(function(t){if(!e&&"transparent"===t)return t;var r=Ui[t.toLowerCase()];return"".concat(r.length>3?"rgba":"rgb","(").concat(r.toString(),")")}))},Yi=function(t){var e=Ki(t);return M.test(e)?e:""},Zi=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mix";if("[object Array]"!==Object.prototype.toString.call(t)||t.length<1)return null;if(1===t.length)return t[0];for(var r=Xi(t.shift()),o=Xi(t.shift());o;){if(!r&&o)r=o;else if(r||o)r&&o&&(r="mix"===e?r.mix(o,o.alpha()):Vi(n[e](Ji(r),Ji(o))));else{if(0===t.length)break;r=Xi(t.shift())}if(0===t.length)break;o=Xi(t.shift())}return r||null},Qi=function(t){return(299*t[0]+587*t[1]+114*t[2])/1e3},tu=function(t,e){var r=t/Qi(e),n=Math.min(255,e[0]*r),o=Math.min(255,e[1]*r),a=Math.min(255,e[2]*r);return 0===o||255===n||255===a?o=(1e3*t-299*n-114*a)/587:0===n?n=(1e3*t-587*o-114*a)/299:0!==a&&255!==o||(a=(1e3*t-299*n-587*o)/114),le.rgb(n,o,a)};function eu(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}(t,e)||nu(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ru(t){return function(t){if(Array.isArray(t))return ou(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||nu(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nu(t,e){if(t){if("string"==typeof t)return ou(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ou(t,e):void 0}}function ou(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function au(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function iu(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var uu=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),iu(this,"_idx",0),iu(this,"_defaultDarkTextColorRgb",null),iu(this,"_defaultDarkBgColorRgb",null),iu(this,"_defaultDarkBgColorHSL",null),iu(this,"_defaultDarkTextColorBrightness",null),iu(this,"_defaultDarkBgColorBrightness",null),iu(this,"_defaultDarkBgColorHslBrightness",null),iu(this,"_maxLimitOffsetBrightness",null),iu(this,"isDarkmode",!1)}var e,r,n;return e=t,(r=[{key:"_adjustBrightness",value:function(t,e,r,n,o){var a,i=t.alpha(),u="";if(r.isBgColor){if(i>=.05&&(e[p]&&delete e[p],e[h])){if(e[h]===t.toString()||this.getContrast(e[h],t.toString())<1.1)return{newColor:o?t.toString():"",extStyle:u};V(e).forEach((function(t){delete t[h]}))}if(a=this._adjustBackgroundBrightness(t),!r.hasInlineColor){var f=e[s]||k.defaultLightTextColor,y=Xi(f);if(y){var d=this._adjustBrightness(y,e,{isTextColor:!0,parentElementBgColorStr:a||t},n,o);u+=fu.genCssKV("color",d.newColor||y),V(e).forEach((function(t){t[c]=d.newColor||y,t[s]=y}))}}}else if(r.isTextColor||r.isBorderColor){var g=r.parentElementBgColorStr||r.isTextColor&&e[l]||k.defaultDarkBgColor,b=Xi(g);if(b&&!e[p]){a=this._adjustTextBrightness(t,b);var m="";n?m="ByUpdateStyle":o&&(m="ByReset"),cu.emit("afterConvertTextColor".concat(m),e,{fontColor:a,bgColor:b})}}else r.isTextShadow&&(e[p]||(a=this._adjustBackgroundBrightness(t)));return{newColor:a&&t.toString()!==a.toString()&&a.alpha(i).rgb(),extStyle:u}}},{key:"_adjustTextBrightness",value:function(t,e){var r=e.rgb().array(),n=e.alpha(),o=Qi(r)*n+this._defaultDarkBgColorBrightness*(1-n),a=t.rgb().array(),i=t.hsl().array(),u=t.alpha(),c=Qi(a),l=Math.abs(o-c);if(c>=250)return t;if(l>this._maxLimitOffsetBrightness&&o<=this._defaultDarkBgColorBrightness+2)return tu(this._maxLimitOffsetBrightness+o,a).alpha(u);if(l>=65)return t;if(o>=100){if(i[2]>50){i[2]=90-i[2];var s=le.hsl.apply(le,ru(i)).alpha(u);return this._adjustTextBrightness(s,e)}return tu(Math.min(this._maxLimitOffsetBrightness,o-65),a).alpha(u)}if(i[2]<=40){i[2]=90-i[2];var f=le.hsl.apply(le,ru(i)).alpha(u);return this._adjustTextBrightness(f,e)}return tu(Math.min(this._maxLimitOffsetBrightness,o+65),a).alpha(u)}},{key:"_adjustBackgroundBrightness",value:function(t){var e=t.rgb().array(),r=t.hsl().array(),n=t.alpha(),o=Qi(e),a=t;return 0===r[1]&&r[2]>40||o>250?a=le.hsl(0,0,Math.min(100,100+this._defaultDarkBgColorHslBrightness-r[2])):o>190?a=tu(190,e).alpha(n):r[2]<22&&(r[2]=22,a=le.hsl.apply(le,ru(r))),a.alpha(n).rgb()}},{key:"_updateBgWithGradient",value:function(t,e,r,n,o,a,i){var u=Zi([e[l]||k.defaultDarkBgColor,t],"normal"),c=(e[f]||k.defaultLightBgColor).split("|").concat(t.toString()).join("|");V(e).forEach((function(t){t[l]=u,t[f]=c}));var s=n.slice(-1)[0];if("color"===s[0]){var p=this._adjustBrightness(Xi(Ki(s[1])),e,{isBgColor:!1,isTextShadow:!1,isTextColor:!0,isBorderColor:!1,hasInlineColor:o},a,i);if(p.newColor)return fu.genCss(r,fu.genCssKV("color",p.newColor))}return""}},{key:"_try",value:function(t){try{return t()}catch(t){console.log("An error occurred when running the dark mode conversion algorithm\n",t),"function"==typeof k.error&&k.error(t)}}},{key:"init",value:function(){this._defaultDarkTextColorRgb=Xi(k.defaultDarkTextColor).rgb().array(),this._defaultDarkBgColorRgb=Xi(k.defaultDarkBgColor).rgb().array(),this._defaultDarkBgColorHSL=Xi(k.defaultDarkBgColor).hsl().array(),this._defaultDarkTextColorBrightness=Qi(this._defaultDarkTextColorRgb),this._defaultDarkBgColorBrightness=Qi(this._defaultDarkBgColorRgb),this._defaultDarkBgColorHslBrightness=this._defaultDarkBgColorHSL[2],this._maxLimitOffsetBrightness=this._defaultDarkTextColorBrightness-this._defaultDarkBgColorBrightness}},{key:"convert",value:function(t,e,r,n){var o=this;cu.resetCss();var i="";r?i="ByUpdateStyle":n&&(i="ByReset"),cu.emit("beforeConvertNode".concat(i),t);var u="",y="";if(this.isDarkmode||r||n){var w=t.nodeName;if(k.whitelist.tagName.indexOf(w)>-1)return"";if(k.whitelist.attribute.some((function(e){return t.hasAttribute(e)})))return"";var O=t.style;e||(e=(O.cssText&&O.cssText.replace(/("[^;]*);([^;]*")|('[^;]*);([^;]*')/g,"$1$3".concat("<$#_SEMICOLON_#$>","$2$4")).split(";")||[]).map((function(t){var e=t.indexOf(":");return[t.slice(0,e).toLowerCase(),t.slice(e+1).replace(v,";")].map((function(t){return(t||"").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}))})));var j=!1,x=!1,C=!1,A=null,_=null;e=e.filter((function(t){var e=eu(t,2),r=e[0],n=e[1];return"color"===r?j=!0:/background/i.test(r)&&(x=!0,"background-position"===r?A=n:"background-size"===r&&(_=n)),(/background/i.test(r)||/^(-webkit-)?border-image/.test(r))&&/url\([^)]*\)/i.test(n)&&(C=!0),g.indexOf(r)>-1})).sort((function(t,e){var r=eu(t,1)[0],n=eu(e,1)[0];return"color"===r||"background-image"===r&&"background-color"===n||0===n.indexOf("-webkit-text")?1:-1})),b.indexOf(w)>-1&&!x&&this._try((function(){var r=function(t){var e=null;return Array.prototype.some.call(t.classList,(function(t){return!!X[t]&&(e=X[t],!0)})),e}(t);if(r||(r=t.getAttribute("bgcolor")),r){var n=Xi(r);n&&(e.unshift(["background-color",n.toString()]),x=!0)}})),"FONT"!==w||j||this._try((function(){var r=t.getAttribute("color");if(r){var n=Xi(r);n&&(e.push(["color",n.toString()]),j=!0)}}));var P="",E="",B=0;e.some((function(t,e){var r=eu(t,2),n=r[0],a=r[1];return o._try((function(){if(0!==n.indexOf("-webkit-text"))return B=e,!0;switch(n){case"-webkit-text-fill-color":P=Yi(a);break;case"-webkit-text-stroke":var t=a.split(" ");2===t.length&&(E=Yi(t[1]));break;case"-webkit-text-stroke-color":E=Yi(a)}return!1}))})),P&&(j?e[e.length-1]=["-webkit-text-fill-color",P]:(e.push(["-webkit-text-fill-color",P]),j=!0)),B&&(e.splice(0,B),E&&e.unshift(["-webkit-text-stroke-color",E]));var R="",I="";if((r||n)&&t.className&&"string"==typeof t.className){var T=t.className.match(a);T&&(R=T[0]),(T=t.className.match(su.classNameReg))&&(I=T[0])}var N="",D=n;D&&fu.watch("color",(function(){D=!1,fu.unwatch("color")})),e.forEach((function(a){var i=eu(a,2),g=i[0],b=i[1];return o._try((function(){var a,i=b,v=!1,w=d.BG_COLOR.indexOf(g)>-1,P=d.TEXT_SHADOW.indexOf(g)>-1,E=d.TEXT_COLOR.indexOf(g),B=d.BORDER_COLOR.indexOf(g)>-1,R=/gradient/.test(b),T=[],L="";if(b=Ki(b,R),M.test(b)){if(R){for(var F=S.exec(b);F;)T.push(F[0]),F=S.exec(b);a=Zi(T)}var z=0;b=b.replace(S,(function(e){R&&(e=a,v=!0);var i=Xi(e);if((null==i?void 0:i.alpha())>=.05){var u=o._adjustBrightness(i,t,{isBgColor:w,isTextShadow:P,isTextColor:E>-1,isBorderColor:B,hasInlineColor:j},r,n),h=!C&&u.newColor;if(L+=u.extStyle,w||E>=5){var y=h?h.toString():e;0===z&&V(t).forEach((function(t){w?(t[l]=y,t[f]=(t[f]||k.defaultLightBgColor).split("|").concat(e).join("|")):(t[c]=y,t[s]=e);var r=Xi(y);w&&(null==r?void 0:r.alpha())>=.05&&t[p]&&delete t[p]}))}return h&&(v=!0),z++,h||e}return e})).replace(/\s?!\s?important/gi,"")}if(L&&(N+=L),!(t instanceof SVGElement)){var q=/^background/.test(g),$=/^(-webkit-)?border-image/.test(g);if((q||$)&&/url\([^)]*\)/i.test(b)){v=!0;var W=Zi((t[f]||k.defaultLightBgColor).split("|"),"normal").toString();if(b=b.replace(/^(.*?)url\(([^)]*)\)(.*)$/i,(function(e){var r=e,o="";return t[p]||V(t).forEach((function(t){t[p]=!0})),q?(o=fu.genCssKV(g,W?"".concat(r,",linear-gradient(").concat(W,", ").concat(W,")"):r),A&&(N+=fu.genCssKV("background-position",A),o+=fu.genCssKV("background-position",W?"".concat(A,",top left"):A)),_&&(N+=fu.genCssKV("background-size",_),o+=fu.genCssKV("background-size",W?"".concat(_,",100%"):_)),n||(I?(y+=fu.genCss(I,o),V(t).forEach((function(t){t[h]=W||r}))):su.push(t,o,(function(t){var e=[t.elOld];t.el!==t.elOld&&e.push(t.el),e.forEach((function(t){V(t).forEach((function(t){t[h]=W||r}))}))})))):!W||x||n||(o=fu.genCssKV("background-image","linear-gradient(".concat(W,", ").concat(W,")")),I?y+=fu.genCss(I,o):su.push(t,o)),r})),!j){var H=t[s]||k.defaultLightTextColor;N+=fu.genCssKV("color",H),V(t).forEach((function(t){t[c]=H}))}}}(v||n)&&(!r&&!n&&m.test(i)&&(O[g]=i.replace(m,"")),R?n||(I?(y+=fu.genCss(I,fu.genCssKV(g,b)),/^background/.test(g)&&!/url\([^)]*\)/i.test(b)&&(u+=o._updateBgWithGradient(a,t,I,e,j,r,n))):su.push(t,fu.genCssKV(g,b),(function(i){/^background/.test(g)&&!/url\([^)]*\)/i.test(b)&&(u+=o._updateBgWithGradient(a,t,i.className,e,j,r,n))}))):("color"===g&&(D=!1,fu.unwatch("color")),N+=fu.genCssKV(g,!v&&n?t.style[g]:b)))}))})),D&&(N+=fu.genCssKV("color",t.style.color||t[c]||k.defaultDarkTextColor),fu.unwatch("color")),N&&(R||(R="".concat("js_darkmode__").concat(this._idx++),t.classList.add(R)),u+=N?fu.genCss(R,N):""),u+=y,r||!function(t){return t.textContent.replace(/\s/g,"").length>0}(t)||n||(k.delayBgJudge?lu.push(t):su.contains(t,(function(t){u+=fu.genCss(t.className,t.cssKV),"function"==typeof t.cb&&t.cb(t)})))}return cu.emit("afterConvertNode".concat(i),t),u}},{key:"getContrast",value:function(t,e){var r=Xi(t),n=Xi(e);return r&&n?r.contrast(n):0}}])&&au(e.prototype,r),n&&au(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),cu=new E,lu=new T("".concat("js_darkmode__","text__")),su=new L("".concat("js_darkmode__","bg__")),fu=new W,pu=new K,hu=new uu;function yu(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return du(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return du(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function du(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var gu=new RegExp("".concat("js_darkmode__","[^ ]+"),"g"),bu=null,mu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{type:"dom"};if(e.force&&(fu.isFinish=!1),!fu.isFinish)try{hu.isDarkmode=k.mode?"dark"===k.mode:t.matches,"dom"===e.type?(hu.isDarkmode&&"function"==typeof k.begin&&k.begin(pu.hasDelay()),Array.prototype.forEach.call(pu.get(),(function(t){if(hu.isDarkmode&&t.className&&"string"==typeof t.className&&(t.className=t.className.replace(gu,"")),hu.isDarkmode||cu.length)if(k.needJudgeFirstPage){var e=t.getBoundingClientRect(),r=e.top,n=e.bottom;r<=0&&n<=0?fu.addCss(hu.convert(t)):r>0&&r<y||n>0&&n<y?(pu.addFirstPageNode(t),fu.addCss(hu.convert(t),!0)):(k.needJudgeFirstPage=!1,fu.writeStyle(!0),pu.showFirstPageNodes(),"function"==typeof k.showFirstPage&&k.showFirstPage(),fu.addCss(hu.convert(t)))}else fu.addCss(hu.convert(t))})),cu.loopTimes++):"bg"===e.type&&hu.isDarkmode&&lu.forEach((function(t){return su.contains(t,(function(t){fu.addCss(fu.genCss(t.className,t.cssKV)),"function"==typeof t.cb&&t.cb(t);var e=[t.elOld];t.elOld!==t.el&&e.push(t.el),e.forEach((function(t){var e,r,n,o,a,i,u=[[c,null!==(e=t[c])&&void 0!==e?e:null],[l,null!==(r=t[l])&&void 0!==r?r:null],[s,null!==(n=t[s])&&void 0!==n?n:null],[f,null!==(o=t[f])&&void 0!==o?o:null],[p,null!==(a=t[p])&&void 0!==a?a:null],[h,null!==(i=t[h])&&void 0!==i?i:null]],y=V(t,!0);y.forEach((function(t){u.forEach((function(e){var r=yu(e,2),n=r[0],o=r[1];null===o?delete t[n]:t[n]=o}))})),y.forEach((function(t){fu.addCss(hu.convert(t,void 0,!1,!0))}))}))}))})),(k.needJudgeFirstPage||!k.needJudgeFirstPage&&!pu.showFirstPage)&&"function"==typeof k.showFirstPage&&k.showFirstPage(),fu.writeStyle(),pu.emptyFirstPageNodes(),hu.isDarkmode||(k.needJudgeFirstPage=!1,k.delayBgJudge=!1,null===k.container&&"dom"===e.type&&pu.length&&pu.delay())}catch(t){console.log("An error occurred when running the dark mode conversion algorithm\n",t),"function"==typeof k.error&&k.error(t)}};function vu(t,e){wu(e),pu.set(t),mu(bu,{force:!0,type:"dom"})}function wu(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!k.hasInit){k.hasInit=!0;var e=k.whitelist.tagName,r=k.whitelist.attribute;t.whitelist&&(t.whitelist.tagName instanceof Array&&t.whitelist.tagName.forEach((function(t){t=t.toUpperCase(),-1===e.indexOf(t)&&e.push(t)})),t.whitelist.attribute instanceof Array&&t.whitelist.attribute.forEach((function(t){-1===r.indexOf(t)&&r.push(t)}))),["dark","light"].indexOf(t.mode)>-1&&(k.set("string",t,"mode"),"dark"===t.mode&&document.getElementsByTagName("html")[0].classList.add(i)),k.set("function",t,"begin"),k.set("function",t,"showFirstPage"),k.set("function",t,"error"),k.set("boolean",t,"needJudgeFirstPage"),k.set("boolean",t,"delayBgJudge"),k.set("dom",t,"container"),k.set("string",t,"cssSelectorsPrefix"),k.set("string",t,"defaultLightTextColor"),k.set("string",t,"defaultLightBgColor"),k.set("string",t,"defaultDarkTextColor"),k.set("string",t,"defaultDarkBgColor"),hu.init(),!k.mode&&null===bu&&window.matchMedia&&(bu=window.matchMedia(o)).addListener(mu)}}function Mu(t){pu.set(t),null!==k.container&&(su.update(t),lu.update(t)),mu(bu,{force:!0,type:"bg"})}function Su(t,e){fu.isFinish&&(fu.addCss(hu.convert(t,e?Object.keys(e).map((function(t){return[t,e[t]]})):void 0,!0),!1),fu.writeStyle())}function ku(t,e){return hu.getContrast(t,e)}function Ou(t){t.forEach((function(t){return cu.extend(t)}))}}])}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Darkmode",[],e):"object"==typeof exports?exports.Darkmode=e():t.Darkmode=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=67)}([function(t,e,r){"use strict";t.exports=TypeError},function(t,e,r){"use strict";var n=r(41);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},function(t,e,r){"use strict";var n=r(44);t.exports=Function.prototype.bind||n},function(t,e,r){"use strict";var n=r(5),o=r(14),a=o([n("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&a(t,".prototype.")>-1?o([r]):r}},function(t,e,r){"use strict";t.exports=Object},function(t,e,r){"use strict";var n=r(4),o=r(28),a=r(29),i=r(30),u=r(31),c=r(9),l=r(0),s=r(32),f=r(33),h=r(34),p=r(35),d=r(36),g=r(37),y=r(38),v=r(39),b=Function,m=function(t){try{return b('"use strict"; return ('+t+").constructor;")()}catch(t){}},w=r(1),M=r(6),k=function(){throw new l},S=w?function(){try{return k}catch(t){try{return w(arguments,"callee").get}catch(t){return k}}}():k,O=r(10)(),j=r(42),x=r(13),C=r(12),A=r(15),_=r(7),P={},E="undefined"!=typeof Uint8Array&&j?j(Uint8Array):void 0,B={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":O&&j?j([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?void 0:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?void 0:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":P,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":O&&j?j(j([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&O&&j?j((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":i,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&O&&j?j((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":O&&j?j(""[Symbol.iterator]()):void 0,"%Symbol%":O?Symbol:void 0,"%SyntaxError%":c,"%ThrowTypeError%":S,"%TypedArray%":E,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":s,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"%Function.prototype.call%":_,"%Function.prototype.apply%":A,"%Object.defineProperty%":M,"%Object.getPrototypeOf%":x,"%Math.abs%":f,"%Math.floor%":h,"%Math.max%":p,"%Math.min%":d,"%Math.pow%":g,"%Math.round%":y,"%Math.sign%":v,"%Reflect.getPrototypeOf%":C};if(j)try{null.error}catch(t){var R=j(j(t));B["%Error.prototype%"]=R}var I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},T=r(2),D=r(8),N=T.call(_,Array.prototype.concat),L=T.call(A,Array.prototype.splice),F=T.call(_,String.prototype.replace),z=T.call(_,String.prototype.slice),q=T.call(_,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,H=function(t){var e=z(t,0,1),r=z(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return F(t,$,(function(t,e,r,o){n[n.length]=r?F(o,W,"$1"):e||t})),n},U=function(t,e){var r,n=t;if(D(I,n)&&(n="%"+(r=I[n])[0]+"%"),D(B,n)){var o=B[n];if(o===P&&(o=function t(e){var r;if("%AsyncFunction%"===e)r=m("async function () {}");else if("%GeneratorFunction%"===e)r=m("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=m("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&j&&(r=j(o.prototype))}return B[e]=r,r}(n)),void 0===o&&!e)throw new l("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new l('"allowMissing" argument must be a boolean');if(null===q(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=H(t),n=r.length>0?r[0]:"",o=U("%"+n+"%",e),a=o.name,i=o.value,u=!1,s=o.alias;s&&(n=s[0],L(r,N([0,1],s)));for(var f=1,h=!0;f<r.length;f+=1){var p=r[f],d=z(p,0,1),g=z(p,-1);if(('"'===d||"'"===d||"`"===d||'"'===g||"'"===g||"`"===g)&&d!==g)throw new c("property names with quotes must have matching quotes");if("constructor"!==p&&h||(u=!0),D(B,a="%"+(n+="."+p)+"%"))i=B[a];else if(null!=i){if(!(p in i)){if(!e)throw new l("base intrinsic for "+t+" exists, but the property is not available.");return}if(w&&f+1>=r.length){var y=w(i,p);i=(h=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:i[p]}else h=D(i,p),i=i[p];h&&!u&&(B[a]=i)}}return i}},function(t,e,r){"use strict";var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}t.exports=n},function(t,e,r){"use strict";t.exports=Function.prototype.call},function(t,e,r){"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,a=r(2);t.exports=a.call(n,o)},function(t,e,r){"use strict";t.exports=SyntaxError},function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(11);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},function(t,e,r){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(t,e);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},function(t,e,r){"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},function(t,e,r){"use strict";var n=r(4);t.exports=n.getPrototypeOf||null},function(t,e,r){"use strict";var n=r(2),o=r(0),a=r(7),i=r(45);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new o("a function is required");return i(n,a,t)}},function(t,e,r){"use strict";t.exports=Function.prototype.apply},function(t,e,r){"use strict";var n,o,a=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{n=Object.defineProperty({},"length",{get:function(){throw o}}),o={},i((function(){throw 42}),null,n)}catch(t){t!==o&&(i=null)}else i=null;var u=/^\s*class\b/,c=function(t){try{var e=a.call(t);return u.test(e)}catch(t){return!1}},l=function(t){try{return!c(t)&&(a.call(t),!0)}catch(t){return!1}},s=Object.prototype.toString,f="function"==typeof Symbol&&!!Symbol.toStringTag,h=!(0 in[,]),p=function(){return!1};if("object"==typeof document){var d=document.all;s.call(d)===s.call(document.all)&&(p=function(t){if((h||!t)&&(void 0===t||"object"==typeof t))try{var e=s.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(p(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,n)}catch(t){if(t!==o)return!1}return!c(t)&&l(t)}:function(t){if(p(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(f)return l(t);if(c(t))return!1;var e=s.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&l(t)}},function(t,e,r){"use strict";var n=r(11);t.exports=function(){return n()&&!!Symbol.toStringTag}},function(t,e,r){(function(e){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=n&&o&&"function"==typeof o.get?o.get:null,i=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=u&&c&&"function"==typeof c.get?c.get:null,s=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,g=Object.prototype.toString,y=Function.prototype.toString,v=String.prototype.match,b=String.prototype.slice,m=String.prototype.replace,w=String.prototype.toUpperCase,M=String.prototype.toLowerCase,k=RegExp.prototype.test,S=Array.prototype.concat,O=Array.prototype.join,j=Array.prototype.slice,x=Math.floor,C="function"==typeof BigInt?BigInt.prototype.valueOf:null,A=Object.getOwnPropertySymbols,_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,P="function"==typeof Symbol&&"object"==typeof Symbol.iterator,E="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===P||"symbol")?Symbol.toStringTag:null,B=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function I(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||k.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-x(-t):x(t);if(n!==t){var o=String(n),a=b.call(e,o.length+1);return m.call(o,r,"$&_")+"."+m.call(m.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return m.call(e,r,"$&_")}var T=r(56),D=T.custom,N=U(D)?D:null,L={__proto__:null,double:'"',single:"'"},F={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function z(t,e,r){var n=r.quoteStyle||e,o=L[n];return o+t+o}function q(t){return m.call(String(t),/"/g,""")}function $(t){return!E||!("object"==typeof t&&(E in t||void 0!==t[E]))}function W(t){return"[object Array]"===V(t)&&$(t)}function H(t){return"[object RegExp]"===V(t)&&$(t)}function U(t){if(P)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!_)return!1;try{return _.call(t),!0}catch(t){}return!1}t.exports=function t(r,n,o,u){var c=n||{};if(J(c,"quoteStyle")&&!J(L,c.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(J(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var g=!J(c,"customInspect")||c.customInspect;if("boolean"!=typeof g&&"symbol"!==g)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(J(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(J(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===r)return"undefined";if(null===r)return"null";if("boolean"==typeof r)return r?"true":"false";if("string"==typeof r)return function t(e,r){if(e.length>r.maxStringLength){var n=e.length-r.maxStringLength,o="... "+n+" more character"+(n>1?"s":"");return t(b.call(e,0,r.maxStringLength),r)+o}var a=F[r.quoteStyle||"single"];return a.lastIndex=0,z(m.call(m.call(e,a,"\\$1"),/[\x00-\x1f]/g,K),"single",r)}(r,c);if("number"==typeof r){if(0===r)return 1/0/r>0?"0":"-0";var k=String(r);return w?I(r,k):k}if("bigint"==typeof r){var x=String(r)+"n";return w?I(r,x):x}var A=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=A&&A>0&&"object"==typeof r)return W(r)?"[Array]":"[Object]";var D=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=O.call(Array(t.indent+1)," ")}return{base:r,prev:O.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(X(u,r)>=0)return"[Circular]";function G(e,r,n){if(r&&(u=j.call(u)).push(r),n){var a={depth:c.depth};return J(c,"quoteStyle")&&(a.quoteStyle=c.quoteStyle),t(e,a,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof r&&!H(r)){var rt=function(t){if(t.name)return t.name;var e=v.call(y.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(r),nt=et(r,G);return"[Function"+(rt?": "+rt:" (anonymous)")+"]"+(nt.length>0?" { "+O.call(nt,", ")+" }":"")}if(U(r)){var ot=P?m.call(String(r),/^(Symbol\(.*\))_[^)]*$/,"$1"):_.call(r);return"object"!=typeof r||P?ot:Y(ot)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(r)){for(var at="<"+M.call(String(r.nodeName)),it=r.attributes||[],ut=0;ut<it.length;ut++)at+=" "+it[ut].name+"="+z(q(it[ut].value),"double",c);return at+=">",r.childNodes&&r.childNodes.length&&(at+="..."),at+="</"+M.call(String(r.nodeName))+">"}if(W(r)){if(0===r.length)return"[]";var ct=et(r,G);return D&&!function(t){for(var e=0;e<t.length;e++)if(X(t[e],"\n")>=0)return!1;return!0}(ct)?"["+tt(ct,D)+"]":"[ "+O.call(ct,", ")+" ]"}if(function(t){return"[object Error]"===V(t)&&$(t)}(r)){var lt=et(r,G);return"cause"in Error.prototype||!("cause"in r)||B.call(r,"cause")?0===lt.length?"["+String(r)+"]":"{ ["+String(r)+"] "+O.call(lt,", ")+" }":"{ ["+String(r)+"] "+O.call(S.call("[cause]: "+G(r.cause),lt),", ")+" }"}if("object"==typeof r&&g){if(N&&"function"==typeof r[N]&&T)return T(r,{depth:A-o});if("symbol"!==g&&"function"==typeof r.inspect)return r.inspect()}if(function(t){if(!a||!t||"object"!=typeof t)return!1;try{a.call(t);try{l.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(r)){var st=[];return i&&i.call(r,(function(t,e){st.push(G(e,r,!0)+" => "+G(t,r))})),Q("Map",a.call(r),st,D)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t);try{a.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(r)){var ft=[];return s&&s.call(r,(function(t){ft.push(G(t,r))})),Q("Set",l.call(r),ft,D)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(r))return Z("WeakMap");if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(r))return Z("WeakSet");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{return p.call(t),!0}catch(t){}return!1}(r))return Z("WeakRef");if(function(t){return"[object Number]"===V(t)&&$(t)}(r))return Y(G(Number(r)));if(function(t){if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}(r))return Y(G(C.call(r)));if(function(t){return"[object Boolean]"===V(t)&&$(t)}(r))return Y(d.call(r));if(function(t){return"[object String]"===V(t)&&$(t)}(r))return Y(G(String(r)));if("undefined"!=typeof window&&r===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&r===globalThis||void 0!==e&&r===e)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===V(t)&&$(t)}(r)&&!H(r)){var ht=et(r,G),pt=R?R(r)===Object.prototype:r instanceof Object||r.constructor===Object,dt=r instanceof Object?"":"null prototype",gt=!pt&&E&&Object(r)===r&&E in r?b.call(V(r),8,-1):dt?"Object":"",yt=(pt||"function"!=typeof r.constructor?"":r.constructor.name?r.constructor.name+" ":"")+(gt||dt?"["+O.call(S.call([],gt||[],dt||[]),": ")+"] ":"");return 0===ht.length?yt+"{}":D?yt+"{"+tt(ht,D)+"}":yt+"{ "+O.call(ht,", ")+" }"}return String(r)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function J(t,e){return G.call(t,e)}function V(t){return g.call(t)}function X(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function K(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function Y(t){return"Object("+t+")"}function Z(t){return t+" { ? }"}function Q(t,e,r,n){return t+" ("+e+") {"+(n?tt(r,n):O.call(r,", "))+"}"}function tt(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+O.call(t,","+r)+"\n"+e.prev}function et(t,e){var r=W(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=J(t,o)?e(t[o],t):""}var a,i="function"==typeof A?A(t):[];if(P){a={};for(var u=0;u<i.length;u++)a["$"+i[u]]=i[u]}for(var c in t)J(t,c)&&(r&&String(Number(c))===c&&c<t.length||P&&a["$"+c]instanceof Symbol||(k.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if("function"==typeof A)for(var l=0;l<i.length;l++)B.call(t,i[l])&&n.push("["+e(i[l])+"]: "+e(t[i[l]],t));return n}}).call(this,r(55))},function(t,e,r){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},function(t,e,r){"use strict";var n=Object.prototype.toString;t.exports=function(t){var e=n.call(t),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===n.call(t.callee)),r}},function(t,e,r){"use strict";r(22)()},function(t,e,r){"use strict";var n=r(23),o=r(62);t.exports=function(){var t=n();return o(Object,{hasOwn:t},{hasOwn:function(){return Object.hasOwn!==t}}),t}},function(t,e,r){"use strict";var n=r(24);t.exports=function(){return Object.hasOwn||n}},function(t,e,r){"use strict";var n=r(25),o=r(27),a=r(59);t.exports=function(t,e){var r=n(t),i=o(e);return a(r,i)}},function(t,e,r){"use strict";var n=r(4),o=r(26);t.exports=function(t){return o(t),n(t)}},function(t,e,r){"use strict";var n=r(0);t.exports=function(t){if(null==t)throw new n(arguments.length>0&&arguments[1]||"Cannot call method on "+t);return t}},function(t,e,r){"use strict";var n=r(5)("%String%"),o=r(47),a=r(58);t.exports=function(t){var e=o(t,n);return"symbol"==typeof e?e:a(e)}},function(t,e,r){"use strict";t.exports=Error},function(t,e,r){"use strict";t.exports=EvalError},function(t,e,r){"use strict";t.exports=RangeError},function(t,e,r){"use strict";t.exports=ReferenceError},function(t,e,r){"use strict";t.exports=URIError},function(t,e,r){"use strict";t.exports=Math.abs},function(t,e,r){"use strict";t.exports=Math.floor},function(t,e,r){"use strict";t.exports=Math.max},function(t,e,r){"use strict";t.exports=Math.min},function(t,e,r){"use strict";t.exports=Math.pow},function(t,e,r){"use strict";t.exports=Math.round},function(t,e,r){"use strict";var n=r(40);t.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},function(t,e,r){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},function(t,e,r){"use strict";t.exports=Object.getOwnPropertyDescriptor},function(t,e,r){"use strict";var n=r(12),o=r(13),a=r(43);t.exports=n?function(t){return n(t)}:o?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return o(t)}:a?function(t){return a(t)}:null},function(t,e,r){"use strict";var n,o=r(14),a=r(1);try{n=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var i=!!n&&a&&a(Object.prototype,"__proto__"),u=Object,c=u.getPrototypeOf;t.exports=i&&"function"==typeof i.get?o([i.get]):"function"==typeof c&&function(t){return c(null==t?t:u(t))}},function(t,e,r){"use strict";var n="Function.prototype.bind called on incompatible ",o=Object.prototype.toString,a=Math.max,i=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var o=0;o<e.length;o+=1)r[o+t.length]=e[o];return r},u=function(t,e){for(var r=[],n=e||0,o=0;n<t.length;n+=1,o+=1)r[o]=t[n];return r},c=function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r};t.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==o.apply(e))throw new TypeError(n+e);for(var r,l=u(arguments,1),s=function(){if(this instanceof r){var n=e.apply(this,i(l,arguments));return Object(n)===n?n:this}return e.apply(t,i(l,arguments))},f=a(0,e.length-l.length),h=[],p=0;p<f;p++)h[p]="$"+p;if(r=Function("binder","return function ("+c(h,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var d=function(){};d.prototype=e.prototype,r.prototype=new d,d.prototype=null}return r}},function(t,e,r){"use strict";var n=r(2),o=r(15),a=r(7),i=r(46);t.exports=i||n.call(a,o)},function(t,e,r){"use strict";t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},function(t,e,r){"use strict";var n=r(48);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(16),a=r(49),i=r(50),u=r(0),c=r(53);function l(t,e){if(null==t)throw new u("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new u('hint must be "string" or "number"');var r,n,a,i="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a<i.length;++a)if(r=t[i[a]],o(r)&&(n=r.call(t),c(n)))return n;throw new u("No default value")}var s=r(54);t.exports=function(t){if(c(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=s(t,Symbol.toPrimitive):i(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var o=e.call(t,r);if(c(o))return o;throw new u("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||i(t))&&(r="string"),l(t,"default"===r?"number":r)}},function(t,e,r){"use strict";var n=r(3),o=n("Date.prototype.getDay"),a=n("Object.prototype.toString"),i=r(17)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return o(t),!0}catch(t){return!1}}(t):"[object Date]"===a(t))}},function(t,e,r){"use strict";var n=r(3),o=n("Object.prototype.toString"),a=r(10)(),i=r(51);if(a){var u=n("Symbol.prototype.toString"),c=i(/^Symbol\(.*\)$/);t.exports=function(t){if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||"[object Symbol]"!==o(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&c(u(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},function(t,e,r){"use strict";var n=r(3),o=r(52),a=n("RegExp.prototype.exec"),i=r(0);t.exports=function(t){if(!o(t))throw new i("`regex` must be a RegExp");return function(e){return null!==a(t,e)}}},function(t,e,r){"use strict";var n,o=r(3),a=r(17)(),i=r(8),u=r(1);if(a){var c=o("RegExp.prototype.exec"),l={},s=function(){throw l},f={toString:s,valueOf:s};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=s),n=function(t){if(!t||"object"!=typeof t)return!1;var e=u(t,"lastIndex");if(!(e&&i(e,"value")))return!1;try{c(t,f)}catch(t){return t===l}}}else{var h=o("Object.prototype.toString");n=function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===h(t)}}t.exports=n},function(t,e,r){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},function(t,e,r){"use strict";var n=r(0),o=r(16),a=r(18),i=r(57),u=r(19);t.exports=function(t,e){if(!u(e))throw new n("Assertion failed: P is not a Property Key");var r=i(t,e);if(null!=r){if(!o(r))throw new n(a(e)+" is not a function: "+a(r));return r}}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){},function(t,e,r){"use strict";var n=r(0),o=r(18),a=r(19);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: P is not a Property Key, got "+o(e));return t[e]}},function(t,e,r){"use strict";var n=r(5)("%String%"),o=r(0);t.exports=function(t){if("symbol"==typeof t)throw new o("Cannot convert a Symbol value to a string");return n(t)}},function(t,e,r){"use strict";var n=r(0),o=r(8),a=r(60),i=r(61);t.exports=function(t,e){if(!a(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");return o(t,e)}},function(t,e,r){"use strict";t.exports=function(t){return!!t&&("function"==typeof t||"object"==typeof t)}},function(t,e,r){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},function(t,e,r){"use strict";var n=r(63),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),a=Object.prototype.toString,i=Array.prototype.concat,u=r(65),c=r(66)(),l=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==a.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},s=function(t,e){var r=arguments.length>2?arguments[2]:{},a=n(e);o&&(a=i.call(a,Object.getOwnPropertySymbols(e)));for(var u=0;u<a.length;u+=1)l(t,a[u],e[a[u]],r[a[u]])};s.supportsDescriptors=!!c,t.exports=s},function(t,e,r){"use strict";var n=Array.prototype.slice,o=r(20),a=Object.keys,i=a?function(t){return a(t)}:r(64),u=Object.keys;i.shim=function(){Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)}):Object.keys=i;return Object.keys||i},t.exports=i},function(t,e,r){"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,i=r(20),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),l=u.call((function(){}),"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===a.call(t),n=i(t),u=e&&"[object String]"===a.call(t),h=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=l&&r;if(u&&t.length>0&&!o.call(t,0))for(var g=0;g<t.length;++g)h.push(String(g));if(n&&t.length>0)for(var y=0;y<t.length;++y)h.push(String(y));else for(var v in t)d&&"prototype"===v||!o.call(t,v)||h.push(String(v));if(c)for(var b=function(t){if("undefined"==typeof window||!p)return f(t);try{return f(t)}catch(t){return!1}}(t),m=0;m<s.length;++m)b&&"constructor"===s[m]||!o.call(t,s[m])||h.push(s[m]);return h}}t.exports=n},function(t,e,r){"use strict";var n=r(6),o=r(9),a=r(0),i=r(1);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,s=arguments.length>6&&arguments[6],f=!!i&&i(t,e);if(n)n(t,e,{configurable:null===l&&f?f.configurable:!l,enumerable:null===u&&f?f.enumerable:!u,value:r,writable:null===c&&f?f.writable:!c});else{if(!s&&(u||c||l))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},function(t,e,r){"use strict";var n=r(6),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},function(t,e,r){"use strict";r.r(e),r.d(e,"run",(function(){return mu})),r.d(e,"init",(function(){return wu})),r.d(e,"convertBg",(function(){return Mu})),r.d(e,"updateStyle",(function(){return ku})),r.d(e,"getContrast",(function(){return Su})),r.d(e,"extend",(function(){return Ou}));var n={};r.r(n),r.d(n,"color",(function(){return Qe})),r.d(n,"colorBurn",(function(){return Ge})),r.d(n,"colorDodge",(function(){return Ue})),r.d(n,"darken",(function(){return We})),r.d(n,"difference",(function(){return Xe})),r.d(n,"exclusion",(function(){return Ke})),r.d(n,"hardLight",(function(){return Je})),r.d(n,"hue",(function(){return Ye})),r.d(n,"lighten",(function(){return He})),r.d(n,"luminosity",(function(){return tr})),r.d(n,"multiply",(function(){return ze})),r.d(n,"normal",(function(){return Fe})),r.d(n,"overlay",(function(){return $e})),r.d(n,"saturation",(function(){return Ze})),r.d(n,"screen",(function(){return qe})),r.d(n,"softLight",(function(){return Ve}));r(21);var o="(prefers-color-scheme: dark)",a=new RegExp("".concat("js_darkmode__","\\d+")),i="data_color_scheme_dark",u="".concat(1*new Date).concat(Math.round(10*Math.random())),c="data-darkmode-color-".concat(u),l="data-darkmode-bgcolor-".concat(u),s="data-darkmode-original-color-".concat(u),f="data-darkmode-original-bgcolor-".concat(u),h="data-darkmode-bgimage-".concat(u),p="data-darkmode-complementary-bgimagecolor-".concat(u),d=window.getInnerHeight&&window.getInnerHeight()||window.innerHeight||document.documentElement.clientHeight,g={BG_COLOR:["background-color","background-image","background"],TEXT_SHADOW:["text-shadow"],TEXT_COLOR:["-webkit-text-stroke","-webkit-text-stroke-color","text-decoration","text-decoration-color","text-emphasis-color","color","-webkit-text-fill-color"],BORDER_COLOR:["border-image","-webkit-border-image","border","border-top","border-right","border-bottom","border-left","border-color","border-top-color","border-right-color","border-bottom-color","border-left-color","border-block-color","border-block-start-color","border-block-end-color","border-inline-color","border-inline-start-color","border-inline-end-color","outline","outline-color","box-shadow","column-rule","column-rule-color"]},y=Object.keys(g).map((function(t){return g[t].join("|")})).join("|").split("|"),v=["TABLE","TR","TD","TH"],b=/ !important$/,m=/<\$#_SEMICOLON_#\$>/g,w="\\b((rgba?)|((ok)?lch)|((ok)?lab)|(color))\\([^)]+\\)",M=new RegExp(w,"i"),k=new RegExp(w,"ig"),S={hasInit:!1,begin:null,showFirstPage:null,error:null,mode:"",whitelist:{tagName:["MPCPS","IFRAME"],attribute:[]},needJudgeFirstPage:!0,delayBgJudge:!1,container:null,cssSelectorsPrefix:"",defaultLightTextColor:"#191919",defaultLightBgColor:"#fff",defaultDarkTextColor:"#a3a3a3",defaultDarkBgColor:"#191919",set:function(t,e,r){var n=e[r];switch(t){case"boolean":"boolean"==typeof n&&(this[r]=n);break;case"string":"string"==typeof n&&""!==n&&(this[r]=n);break;case"function":"function"==typeof n&&(this[r]=n);break;case"dom":n instanceof HTMLElement&&(this[r]=n)}}};function O(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function C(t,e,r){return e&&x(t.prototype,e),r&&x(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var A=[],_=[],P=function(){function t(){j(this,t)}return C(t,[{key:"loopTimes",get:function(){return cu.loopTimes}},{key:"isDarkmode",get:function(){return pu.isDarkmode}},{key:"addCss",value:function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];(r?A:_).push(fu.genCss(t,e.map((function(t){var e=t.key,r=t.value;return fu.genCssKV(e,r)})).join("")))}}]),t}(),E=function(){function t(){j(this,t),O(this,"_plugins",[]),O(this,"length",0),O(this,"loopTimes",0),O(this,"firstPageStyle",""),O(this,"otherPageStyle",""),O(this,"firstPageStyleNoMQ",""),O(this,"otherPageStyleNoMQ","")}return C(t,[{key:"extend",value:function(t){this._plugins.push(new(t(P))),this.length++}},{key:"emit",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];this._plugins.forEach((function(e){"function"==typeof e[t]&&e[t].apply(e,r)}))}},{key:"addCss",value:function(t){t?(this.firstPageStyle+=A.join(""),this.firstPageStyleNoMQ+=_.join("")):(this.otherPageStyle+=A.join(""),this.otherPageStyleNoMQ+=_.join(""))}},{key:"resetCss",value:function(){A=[],_=[]}}]),t}();function B(t){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function I(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var T=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),I(this,"_queue",[]),I(this,"_idx",0),this._prefix=e}var e,r,n;return e=t,(r=[{key:"length",get:function(){return this._queue.length}},{key:"push",value:function(t){var e="".concat(this._prefix).concat(this._idx++);t.classList.add(e),this._queue.push({el:t,className:e,updated:!S.delayBgJudge})}},{key:"forEach",value:function(t){var e=[];for(this._queue.forEach((function(r,n){r.updated&&(e.unshift(n),B(t)&&t(r.el))}));e.length;)this._queue.splice(e.shift(),1)}},{key:"update",value:function(t){this._queue.forEach((function(e){e.updated||Array.prototype.some.call(t,(function(t){return!(1!==t.nodeType||!t.classList.contains(e.className)||(e.el=t,e.updated=!0,0))}))}))}}])&&R(e.prototype,r),n&&R(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function D(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function N(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var L=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),N(this,"_stack",[]),N(this,"_idx",0),this._prefix=e,this.classNameReg=new RegExp("".concat(this._prefix,"\\d+"))}var e,r,n;return e=t,(r=[{key:"push",value:function(t,e,r){var n="".concat(this._prefix).concat(this._idx++);t.classList.add(n),this._stack.unshift({elOld:t,el:t,className:n,cssKV:e,updated:!S.delayBgJudge,cb:r})}},{key:"contains",value:function(t,e){var r=t.getBoundingClientRect(),n=[];for(this._stack.forEach((function(t,e){if(t.updated){t.rect||(t.rect=t.el.getBoundingClientRect());var o=t.rect;r.top>=o.bottom||r.bottom<=o.top||r.left>=o.right||r.right<=o.left||n.unshift(e)}}));n.length;){var o=n.shift(),a=this._stack.splice(o,1)[0];"function"==typeof e&&e(a)}}},{key:"update",value:function(t){this._stack.forEach((function(e){e.updated||Array.prototype.some.call(t,(function(t){return!(1!==t.nodeType||!t.classList.contains(e.className)||(e.el=t,e.updated=!0,0))}))}))}}])&&D(e.prototype,r),n&&D(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function F(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return z(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function q(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var W=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),$(this,"_firstPageStyle",""),$(this,"_otherPageStyle",""),$(this,"_watcher",{}),$(this,"isFinish",!1)}var e,r,n;return e=t,(r=[{key:"genCssKV",value:function(t,e){var r,n;return null===(r=(n=this._watcher)[t])||void 0===r||r.call(n),"".concat(t,": ").concat(e," !important;")}},{key:"genCss",value:function(t,e){return"".concat("dark"===S.mode?"html.".concat(i," "):"").concat(S.cssSelectorsPrefix&&"".concat(S.cssSelectorsPrefix," "),".").concat(t,"{").concat(e,"}")}},{key:"addCss",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this[e?"_firstPageStyle":"_otherPageStyle"]+=t,cu.addCss(e)}},{key:"writeStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!t&&pu.isDarkmode&&(this.isFinish=!0);var e=(pu.isDarkmode?[{target:this,key:["_firstPageStyle","_otherPageStyle"],needMediaQuery:!0}]:[]).concat([{target:cu,key:["firstPageStyle","otherPageStyle"],needMediaQuery:!0},{target:cu,key:["firstPageStyleNoMQ","otherPageStyleNoMQ"],needMediaQuery:!1}]).map((function(e){var r=e.target,n=F(e.key,2),a=n[0],i=n[1],u=e.needMediaQuery,c="";t?c=a:(r[i]=r[a]+r[i],r[a]="",c=i);var l=r[c];return l?(r[c]="","dark"!==S.mode&&u?"@media ".concat(o," {").concat(l,"}"):l):""})).join("");e&&document.head.insertAdjacentHTML("beforeend",'<style type="text/css">'.concat(e,"</style>"))}},{key:"watch",value:function(t,e){this._watcher[t]=e}},{key:"unwatch",value:function(t){delete this._watcher[t]}}])&&q(e.prototype,r),n&&q(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function H(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function U(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G(t){return function(t){if(Array.isArray(t))return J(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return J(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return J(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function V(t){var e,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(e=r?[]:[t]).concat.apply(e,G(t.querySelectorAll("*")))}var X={"ue-table-interlace-color-single":"#fcfcfc","ue-table-interlace-color-double":"#f7faff"};var K=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),U(this,"_els",[]),U(this,"_firstPageEls",[]),U(this,"_delayEls",[]),U(this,"showFirstPage",!1)}var e,r,n;return e=t,(r=[{key:"length",get:function(){return this._els.length}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._els=t}},{key:"get",value:function(){var t=[];return this._els.length?(t=this._els,pu.isDarkmode&&(this._els=[])):this._delayEls.length?(t=this._delayEls,this._delayEls=[]):S.container&&(t=S.container.querySelectorAll("*")),t}},{key:"delay",value:function(){var t=this;Array.prototype.forEach.call(this._els,(function(e){return t._delayEls.push(e)})),this._els=[]}},{key:"hasDelay",value:function(){return!this._els.length&&(this._delayEls.length>0||null!==S.container)}},{key:"addFirstPageNode",value:function(t){this._firstPageEls.push(t)}},{key:"showFirstPageNodes",value:function(){this._firstPageEls.forEach((function(t){return!t.style.visibility&&(t.style.visibility="visible")})),this.showFirstPage=!0}},{key:"emptyFirstPageNodes",value:function(){this._firstPageEls=[]}}])&&H(e.prototype,r),n&&H(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Y={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]};for(var Z in Y)Object.freeze(Y[Z]);var Q=Object.freeze(Y),tt=Object.create(null);for(var et in Q)Object.hasOwn(Q,et)&&(tt[Q[et]]=et);var rt={to:{},get:{}};function nt(t,e,r){return Math.min(Math.max(e,t),r)}function ot(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}rt.get=function(t){var e,r;switch(t.slice(0,3).toLowerCase()){case"hsl":e=rt.get.hsl(t),r="hsl";break;case"hwb":e=rt.get.hwb(t),r="hwb";break;default:e=rt.get.rgb(t),r="rgb"}return e?{model:r,value:e}:null},rt.get.rgb=function(t){if(!t)return null;var e,r,n,o=[0,0,0,1];if(e=t.match(/^#([a-f\d]{6})([a-f\d]{2})?$/i)){for(n=e[2],e=e[1],r=0;r<3;r++){var a=2*r;o[r]=Number.parseInt(e.slice(a,a+2),16)}n&&(o[3]=Number.parseInt(n,16)/255)}else if(e=t.match(/^#([a-f\d]{3,4})$/i)){for(n=(e=e[1])[3],r=0;r<3;r++)o[r]=Number.parseInt(e[r]+e[r],16);n&&(o[3]=Number.parseInt(n+n,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i)){for(r=0;r<3;r++)o[r]=Number.parseFloat(e[r+1]);e[4]&&(o[3]=e[5]?.01*Number.parseFloat(e[4]):Number.parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i)))return(e=t.toLowerCase().match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:Object.hasOwn(Q,e[1])?((o=Q[e[1]].slice())[3]=1,o):null:null;for(r=0;r<3;r++)o[r]=Math.round(2.55*Number.parseFloat(e[r+1]));e[4]&&(o[3]=e[5]?.01*Number.parseFloat(e[4]):Number.parseFloat(e[4]))}for(r=0;r<3;r++)o[r]=nt(o[r],0,255);return o[3]=nt(o[3],0,1),o},rt.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(e){var r=Number.parseFloat(e[4]);return[(Number.parseFloat(e[1])%360+360)%360,nt(Number.parseFloat(e[2]),0,100),nt(Number.parseFloat(e[3]),0,100),nt(Number.isNaN(r)?1:r,0,1)]}return null},rt.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(e){var r=Number.parseFloat(e[4]);return[(Number.parseFloat(e[1])%360+360)%360,nt(Number.parseFloat(e[2]),0,100),nt(Number.parseFloat(e[3]),0,100),nt(Number.isNaN(r)?1:r,0,1)]}return null},rt.to.hex=function(){return"#"+ot(arguments.length<=0?void 0:arguments[0])+ot(arguments.length<=1?void 0:arguments[1])+ot(arguments.length<=2?void 0:arguments[2])+((arguments.length<=3?void 0:arguments[3])<1?ot(Math.round(255*(arguments.length<=3?void 0:arguments[3]))):"")},rt.to.rgb=function(){return arguments.length<4||1===(arguments.length<=3?void 0:arguments[3])?"rgb("+Math.round(arguments.length<=0?void 0:arguments[0])+", "+Math.round(arguments.length<=1?void 0:arguments[1])+", "+Math.round(arguments.length<=2?void 0:arguments[2])+")":"rgba("+Math.round(arguments.length<=0?void 0:arguments[0])+", "+Math.round(arguments.length<=1?void 0:arguments[1])+", "+Math.round(arguments.length<=2?void 0:arguments[2])+", "+(arguments.length<=3?void 0:arguments[3])+")"},rt.to.rgb.percent=function(){var t=Math.round((arguments.length<=0?void 0:arguments[0])/255*100),e=Math.round((arguments.length<=1?void 0:arguments[1])/255*100),r=Math.round((arguments.length<=2?void 0:arguments[2])/255*100);return arguments.length<4||1===(arguments.length<=3?void 0:arguments[3])?"rgb("+t+"%, "+e+"%, "+r+"%)":"rgba("+t+"%, "+e+"%, "+r+"%, "+(arguments.length<=3?void 0:arguments[3])+")"},rt.to.hsl=function(){return arguments.length<4||1===(arguments.length<=3?void 0:arguments[3])?"hsl("+(arguments.length<=0?void 0:arguments[0])+", "+(arguments.length<=1?void 0:arguments[1])+"%, "+(arguments.length<=2?void 0:arguments[2])+"%)":"hsla("+(arguments.length<=0?void 0:arguments[0])+", "+(arguments.length<=1?void 0:arguments[1])+"%, "+(arguments.length<=2?void 0:arguments[2])+"%, "+(arguments.length<=3?void 0:arguments[3])+")"},rt.to.hwb=function(){var t="";return arguments.length>=4&&1!==(arguments.length<=3?void 0:arguments[3])&&(t=", "+(arguments.length<=3?void 0:arguments[3])),"hwb("+(arguments.length<=0?void 0:arguments[0])+", "+(arguments.length<=1?void 0:arguments[1])+"%, "+(arguments.length<=2?void 0:arguments[2])+"%"+t+")"},rt.to.keyword=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return tt[e.slice(0,3)]};var at=rt;function it(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}(t,e)||ct(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ut(t){return function(t){if(Array.isArray(t))return lt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ct(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ct(t,e){if(t){if("string"==typeof t)return lt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?lt(t,e):void 0}}function lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}for(var st={},ft=0,ht=Object.keys(Q);ft<ht.length;ft++){var pt=ht[ft];st[Q[pt]]=pt}var dt={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"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},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"]}},gt=dt,yt=Math.pow(6/29,3);function vt(t){var e=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t;return Math.min(Math.max(0,e),1)}function bt(t){return t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92}for(var mt=0,wt=Object.keys(dt);mt<wt.length;mt++){var Mt=wt[mt];if(!("channels"in dt[Mt]))throw new Error("missing channels property: "+Mt);if(!("labels"in dt[Mt]))throw new Error("missing channel labels property: "+Mt);if(dt[Mt].labels.length!==dt[Mt].channels)throw new Error("channel and label counts mismatch: "+Mt);var kt=dt[Mt],St=kt.channels,Ot=kt.labels;delete dt[Mt].channels,delete dt[Mt].labels,Object.defineProperty(dt[Mt],"channels",{value:St}),Object.defineProperty(dt[Mt],"labels",{value:Ot})}function jt(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}function xt(t){var e=function(){for(var t={},e=Object.keys(gt),r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}(),r=[t];for(e[t].distance=0;r.length>0;)for(var n=r.pop(),o=Object.keys(gt[n]),a=o.length,i=0;i<a;i++){var u=o[i],c=e[u];-1===c.distance&&(c.distance=e[n].distance+1,c.parent=n,r.unshift(u))}return e}function Ct(t,e){return function(r){return e(t(r))}}function At(t,e){for(var r=[e[t].parent,t],n=gt[e[t].parent][t],o=e[t].parent;e[o].parent;)r.unshift(e[o].parent),n=Ct(gt[e[o].parent][o],n),o=e[o].parent;return n.conversion=r,n}dt.rgb.hsl=function(t){var e,r=t[0]/255,n=t[1]/255,o=t[2]/255,a=Math.min(r,n,o),i=Math.max(r,n,o),u=i-a;switch(i){case a:e=0;break;case r:e=(n-o)/u;break;case n:e=2+(o-r)/u;break;case o:e=4+(r-n)/u}(e=Math.min(60*e,360))<0&&(e+=360);var c=(a+i)/2;return[e,100*(i===a?0:c<=.5?u/(i+a):u/(2-i-a)),100*c]},dt.rgb.hsv=function(t){var e,r,n,o,a,i=t[0]/255,u=t[1]/255,c=t[2]/255,l=Math.max(i,u,c),s=l-Math.min(i,u,c),f=function(t){return(l-t)/6/s+.5};if(0===s)o=0,a=0;else{switch(a=s/l,e=f(i),r=f(u),n=f(c),l){case i:o=n-r;break;case u:o=1/3+e-n;break;case c:o=2/3+r-e}o<0?o+=1:o>1&&(o-=1)}return[360*o,100*a,100*l]},dt.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[dt.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(r,n))),100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},dt.rgb.oklab=function(t){var e=bt(t[0]/255),r=bt(t[1]/255),n=bt(t[2]/255),o=Math.cbrt(.4122214708*e+.5363325363*r+.0514459929*n),a=Math.cbrt(.2119034982*e+.6806995451*r+.1073969566*n),i=Math.cbrt(.0883024619*e+.2817188376*r+.6299787005*n);return[100*(.2104542553*o+.793617785*a-.0040720468*i),100*(1.9779984951*o-2.428592205*a+.4505937099*i),100*(.0259040371*o+.7827717662*a-.808675766*i)]},dt.rgb.cmyk=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,o=Math.min(1-e,1-r,1-n);return[100*((1-e-o)/(1-o)||0),100*((1-r-o)/(1-o)||0),100*((1-n-o)/(1-o)||0),100*o]},dt.rgb.keyword=function(t){var e=st[t];if(e)return e;for(var r,n=Number.POSITIVE_INFINITY,o=0,a=Object.keys(Q);o<a.length;o++){var i=a[o],u=jt(t,Q[i]);u<n&&(n=u,r=i)}return r},dt.keyword.rgb=function(t){return ut(Q[t])},dt.rgb.xyz=function(t){var e=bt(t[0]/255),r=bt(t[1]/255),n=bt(t[2]/255);return[100*(.4124564*e+.3575761*r+.1804375*n),100*(.2126729*e+.7151522*r+.072175*n),100*(.0193339*e+.119192*r+.9503041*n)]},dt.rgb.lab=function(t){var e=dt.rgb.xyz(t),r=e[0],n=e[1],o=e[2];return n/=100,o/=108.883,r=(r/=95.047)>yt?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>yt?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>yt?Math.pow(o,1/3):7.787*o+16/116))]},dt.hsl.rgb=function(t){var e,r,n=t[0]/360,o=t[1]/100,a=t[2]/100;if(0===o)return[r=255*a,r,r];for(var i=a<.5?a*(1+o):a+o-a*o,u=2*a-i,c=[0,0,0],l=0;l<3;l++)(e=n+1/3*-(l-1))<0&&e++,e>1&&e--,r=6*e<1?u+6*(i-u)*e:2*e<1?i:3*e<2?u+(i-u)*(2/3-e)*6:u,c[l]=255*r;return c},dt.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,o=r,a=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=a<=1?a:2-a,[e,100*(0===n?2*o/(a+o):2*r/(n+r)),100*((n+r)/2)]},dt.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,o=Math.floor(e)%6,a=e-Math.floor(e),i=255*n*(1-r),u=255*n*(1-r*a),c=255*n*(1-r*(1-a));switch(n*=255,o){case 0:return[n,c,i];case 1:return[u,n,i];case 2:return[i,n,c];case 3:return[i,u,n];case 4:return[c,i,n];case 5:return[n,i,u]}},dt.hsv.hsl=function(t){var e,r,n=t[0],o=t[1]/100,a=t[2]/100,i=Math.max(a,.01);r=(2-o)*a;var u=(2-o)*i;return e=o*i,[n,100*(e=(e/=u<=1?u:2-u)||0),100*(r/=2)]},dt.hwb.rgb=function(t){var e,r=t[0]/360,n=t[1]/100,o=t[2]/100,a=n+o;a>1&&(n/=a,o/=a);var i=Math.floor(6*r),u=1-o;e=6*r-i,0!=(1&i)&&(e=1-e);var c,l,s,f=n+e*(u-n);switch(i){default:case 6:case 0:c=u,l=f,s=n;break;case 1:c=f,l=u,s=n;break;case 2:c=n,l=u,s=f;break;case 3:c=n,l=f,s=u;break;case 4:c=f,l=n,s=u;break;case 5:c=u,l=n,s=f}return[255*c,255*l,255*s]},dt.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,o=t[3]/100;return[255*(1-Math.min(1,e*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},dt.xyz.rgb=function(t){var e,r,n=t[0]/100,o=t[1]/100,a=t[2]/100;return e=-.969266*n+1.8760108*o+.041556*a,r=.0556434*n+-.2040259*o+1.0572252*a,[255*vt(3.2404542*n+-1.5371385*o+-.4985314*a),255*(e=vt(e)),255*(r=vt(r))]},dt.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return r/=100,n/=108.883,e=(e/=95.047)>yt?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>yt?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>yt?Math.pow(n,1/3):7.787*n+16/116))]},dt.xyz.oklab=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,o=Math.cbrt(.8189330101*e+.3618667424*r-.1288597137*n),a=Math.cbrt(.0329845436*e+.9293118715*r+.0361456387*n),i=Math.cbrt(.0482003018*e+.2643662691*r+.633851707*n);return[100*(.2104542553*o+.793617785*a-.0040720468*i),100*(1.9779984951*o-2.428592205*a+.4505937099*i),100*(.0259040371*o+.7827717662*a-.808675766*i)]},dt.oklab.oklch=function(t){return dt.lab.lch(t)},dt.oklab.xyz=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,o=Math.pow(.999999998*e+.396337792*r+.215803758*n,3),a=Math.pow(1.000000008*e-.105561342*r-.063854175*n,3),i=Math.pow(1.000000055*e-.089484182*r-1.291485538*n,3);return[100*(1.227013851*o-.55779998*a+.281256149*i),100*(-.040580178*o+1.11225687*a-.071676679*i),100*(-.076381285*o-.421481978*a+1.58616322*i)]},dt.oklab.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,o=Math.pow(e+.3963377774*r+.2158037573*n,3),a=Math.pow(e-.1055613458*r-.0638541728*n,3),i=Math.pow(e-.0894841775*r-1.291485548*n,3);return[255*vt(4.0767416621*o-3.3077115913*a+.2309699292*i),255*vt(-1.2684380046*o+2.6097574011*a-.3413193965*i),255*vt(-.0041960863*o-.7034186147*a+1.707614701*i)]},dt.oklch.oklab=function(t){return dt.lch.lab(t)},dt.lab.xyz=function(t){var e,r,n,o=t[0];e=t[1]/500+(r=(o+16)/116),n=r-t[2]/200;var a=Math.pow(r,3),i=Math.pow(e,3),u=Math.pow(n,3);return r=a>yt?a:(r-16/116)/7.787,e=i>yt?i:(e-16/116)/7.787,n=u>yt?u:(n-16/116)/7.787,[e*=95.047,r*=100,n*=108.883]},dt.lab.lch=function(t){var e,r=t[0],n=t[1],o=t[2];return(e=360*Math.atan2(o,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+o*o),e]},dt.lch.lab=function(t){var e=t[0],r=t[1],n=t[2]/360*2*Math.PI;return[e,r*Math.cos(n),r*Math.sin(n)]},dt.rgb.ansi16=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=it(t,3),n=r[0],o=r[1],a=r[2],i=null===e?dt.rgb.hsv(t)[2]:e;if(0===(i=Math.round(i/50)))return 30;var u=30+(Math.round(a/255)<<2|Math.round(o/255)<<1|Math.round(n/255));return 2===i&&(u+=60),u},dt.hsv.ansi16=function(t){return dt.rgb.ansi16(dt.hsv.rgb(t),t[2])},dt.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e>>4==r>>4&&r>>4==n>>4?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},dt.ansi16.rgb=function(t){var e=(t=t[0])%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=.5*(Math.trunc(t>50)+1);return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},dt.ansi256.rgb=function(t){if((t=t[0])>=232){var e=10*(t-232)+8;return[e,e,e]}var r;return t-=16,[Math.floor(t/36)/5*255,Math.floor((r=t%36)/6)/5*255,r%6/5*255]},dt.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".slice(e.length)+e},dt.hex.rgb=function(t){var e=t.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=ut(r).map((function(t){return t+t})).join(""));var n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},dt.rgb.hcg=function(t){var e,r=t[0]/255,n=t[1]/255,o=t[2]/255,a=Math.max(Math.max(r,n),o),i=Math.min(Math.min(r,n),o),u=a-i;return e=u<=0?0:a===r?(n-o)/u%6:a===n?2+(o-r)/u:4+(r-n)/u,e/=6,[360*(e%=1),100*u,100*(u<1?i/(1-u):0)]},dt.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),o=0;return n<1&&(o=(r-.5*n)/(1-n)),[t[0],100*n,100*o]},dt.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,o=0;return n<1&&(o=(r-n)/(1-n)),[t[0],100*n,100*o]},dt.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var o,a=[0,0,0],i=e%1*6,u=i%1,c=1-u;switch(Math.floor(i)){case 0:a[0]=1,a[1]=u,a[2]=0;break;case 1:a[0]=c,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=u;break;case 3:a[0]=0,a[1]=c,a[2]=1;break;case 4:a[0]=u,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=c}return o=(1-r)*n,[255*(r*a[0]+o),255*(r*a[1]+o),255*(r*a[2]+o)]},dt.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},dt.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},dt.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],100*(r-e),100*(1-r)]},dt.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,o=0;return n<1&&(o=(r-n)/(1-n)),[t[0],100*n,100*o]},dt.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},dt.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},dt.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},dt.gray.hsl=function(t){return[0,0,t[0]]},dt.gray.hsv=dt.gray.hsl,dt.gray.hwb=function(t){return[0,100,t[0]]},dt.gray.cmyk=function(t){return[0,0,0,t[0]]},dt.gray.lab=function(t){return[t[0],0,0]},dt.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".slice(r.length)+r},dt.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};var _t=function(t){for(var e=xt(t),r={},n=Object.keys(e),o=n.length,a=0;a<o;a++){var i=n[a];null!==e[i].parent&&(r[i]=At(i,e))}return r};function Pt(t){return(Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Et={};function Bt(t){var e=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var o=r[0];return null==o?o:(o.length>1&&(r=o),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function Rt(t){var e=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var o=r[0];if(null==o)return o;o.length>1&&(r=o);var a=t(r);if("object"===Pt(a))for(var i=a.length,u=0;u<i;u++)a[u]=Math.round(a[u]);return a};return"conversion"in t&&(e.conversion=t.conversion),e}for(var It=0,Tt=Object.keys(gt);It<Tt.length;It++){var Dt=Tt[It];Et[Dt]={},Object.defineProperty(Et[Dt],"channels",{value:gt[Dt].channels}),Object.defineProperty(Et[Dt],"labels",{value:gt[Dt].labels});for(var Nt=_t(Dt),Lt=0,Ft=Object.keys(Nt);Lt<Ft.length;Lt++){var zt=Ft[Lt],qt=Nt[zt];Et[Dt][zt]=Rt(qt),Et[Dt][zt].raw=Bt(qt)}}var $t=Et;function Wt(t){return(Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ht(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}(t,e)||Jt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ut(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Jt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function Gt(t){return function(t){if(Array.isArray(t))return Vt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Jt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jt(t,e){if(t){if("string"==typeof t)return Vt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Vt(t,e):void 0}}function Vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}for(var Xt=["keyword","gray","hex"],Kt={},Yt=0,Zt=Object.keys($t);Yt<Zt.length;Yt++){var Qt=Zt[Yt];Kt[Gt($t[Qt].labels).sort().join("")]=Qt}var te={};function ee(t,e){if(!(this instanceof ee))return new ee(t,e);if(e&&e in Xt&&(e=null),e&&!(e in $t))throw new Error("Unknown model: "+e);var r,n;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof ee)this.model=t.model,this.color=Gt(t.color),this.valpha=t.valpha;else if("string"==typeof t){var o=at.get(t);if(null===o)throw new Error("Unable to parse color from string: "+t);this.model=o.model,n=$t[this.model].channels,this.color=o.value.slice(0,n),this.valpha="number"==typeof o.value[n]?o.value[n]:1}else if(t.length>0){this.model=e||"rgb",n=$t[this.model].channels;var a=Array.prototype.slice.call(t,0,n);this.color=ce(a,n),this.valpha="number"==typeof t[n]?t[n]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var i=Object.keys(t);"alpha"in t&&(i.splice(i.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var u=i.sort().join("");if(!(u in Kt))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Kt[u];var c=$t[this.model].labels,l=[];for(r=0;r<c.length;r++)l.push(t[c[r]]);this.color=ce(l)}if(te[this.model])for(n=$t[this.model].channels,r=0;r<n;r++){var s=te[this.model][r];s&&(this.color[r]=s(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}ee.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e,r=this.model in at.to?this:this.rgb(),n=1===(r=r.round("number"==typeof t?t:1)).valpha?r.color:[].concat(Gt(r.color),[this.valpha]);return(e=at.to)[r.model].apply(e,Gt(n))},percentString:function(t){var e,r=this.rgb().round("number"==typeof t?t:1),n=1===r.valpha?r.color:[].concat(Gt(r.color),[this.valpha]);return(e=at.to.rgb).percent.apply(e,Gt(n))},array:function(){return 1===this.valpha?Gt(this.color):[].concat(Gt(this.color),[this.valpha])},object:function(){for(var t={},e=$t[this.model].channels,r=$t[this.model].labels,n=0;n<e;n++)t[r[n]]=this.color[n];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new ee([].concat(Gt(this.color.map(function(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}(t))),[this.valpha]),this.model)},alpha:function(t){return void 0!==t?new ee([].concat(Gt(this.color),[Math.max(0,Math.min(1,t))]),this.model):this.valpha},red:ae("rgb",0,ie(255)),green:ae("rgb",1,ie(255)),blue:ae("rgb",2,ie(255)),hue:ae(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:ae("hsl",1,ie(100)),lightness:ae("hsl",2,ie(100)),saturationv:ae("hsv",1,ie(100)),value:ae("hsv",2,ie(100)),chroma:ae("hcg",1,ie(100)),gray:ae("hcg",2,ie(100)),white:ae("hwb",1,ie(100)),wblack:ae("hwb",2,ie(100)),cyan:ae("cmyk",0,ie(100)),magenta:ae("cmyk",1,ie(100)),yellow:ae("cmyk",2,ie(100)),black:ae("cmyk",3,ie(100)),x:ae("xyz",0,ie(95.047)),y:ae("xyz",1,ie(100)),z:ae("xyz",2,ie(108.833)),l:ae("lab",0,ie(100)),a:ae("lab",1),b:ae("lab",2),keyword:function(t){return void 0!==t?new ee(t):$t[this.model].keyword(this.color)},hex:function(t){var e;return void 0!==t?new ee(t):(e=at.to).hex.apply(e,Gt(this.rgb().round().color))},hexa:function(t){var e;if(void 0!==t)return new ee(t);var r=this.rgb().round().color,n=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===n.length&&(n="0"+n),(e=at.to).hex.apply(e,Gt(r))+n},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){var t,e=[],r=Ut(this.rgb().color.entries());try{for(r.s();!(t=r.n()).done;){var n=Ht(t.value,2),o=n[0],a=n[1]/255;e[o]=a<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}}catch(t){r.e(t)}finally{r.f()}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),r=t.luminosity();return e>r?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(2126*t[0]+7152*t[1]+722*t[2])/1e4<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return ee.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),r=e.color[0];return r=(r=(r+t)%360)<0?360+r:r,e.color[0]=r,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+Wt(t));var r=t.rgb(),n=this.rgb(),o=void 0===e?.5:e,a=2*o-1,i=r.alpha()-n.alpha(),u=((a*i==-1?a:(a+i)/(1+a*i))+1)/2,c=1-u;return ee.rgb(u*r.red()+c*n.red(),u*r.green()+c*n.green(),u*r.blue()+c*n.blue(),r.alpha()*o+n.alpha()*(1-o))}};for(var re=function(){var t=oe[ne];if(Xt.includes(t))return"continue";var e=$t[t].channels;ee.prototype[t]=function(){if(this.model===t)return new ee(this);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.length>0?new ee(r,t):new ee([].concat(Gt(ue($t[this.model][t].raw(this.color))),[this.valpha]),t)},ee[t]=function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];var a=n[0];return"number"==typeof a&&(a=ce(n,e)),new ee(a,t)}},ne=0,oe=Object.keys($t);ne<oe.length;ne++)re();function ae(t,e,r){var n,o=Ut(t=Array.isArray(t)?t:[t]);try{for(o.s();!(n=o.n()).done;){var a=n.value;(te[a]||(te[a]=[]))[e]=r}}catch(t){o.e(t)}finally{o.f()}return t=t[0],function(n){var o;return void 0!==n?(r&&(n=r(n)),(o=this[t]()).color[e]=n,o):(o=this[t]().color[e],r&&(o=r(o)),o)}}function ie(t){return function(e){return Math.max(0,Math.min(t,e))}}function ue(t){return Array.isArray(t)?t:[t]}function ce(t,e){for(var r=0;r<e;r++)"number"!=typeof t[r]&&(t[r]=0);return t}var le=ee;function se(t,e,r){return{r:255*r(t.r/255,e.r/255),g:255*r(t.g/255,e.g/255),b:255*r(t.b/255,e.b/255)}}function fe(t,e){return e}function he(t,e){return t*e}function pe(t,e){return t+e-t*e}function de(t,e){return me(e,t)}function ge(t,e){return Math.min(t,e)}function ye(t,e){return Math.min(Math.max(t,e),1)}function ve(t,e){return 0===t?0:1===e?1:Math.min(1,t/(1-e))}function be(t,e){return 1===t?1:0===e?0:1-Math.min(1,(1-t)/e)}function me(t,e){return e<=.5?he(t,2*e):pe(t,2*e-1)}function we(t,e){return e<=.5?t-(1-2*e)*t*(1-t):t+(2*e-1)*((t<=.25?((16*t-12)*t+4)*t:Math.sqrt(t))-t)}function Me(t,e){return Math.abs(t-e)}function ke(t,e){return t+e-2*t*e}function Se(t,e,r){return Math.min(Math.max(t||0,e),r)}function Oe(t){return{r:Se(t.r,0,255),g:Se(t.g,0,255),b:Se(t.b,0,255),a:Se(t.a,0,1)}}function je(t){return{r:255*t.r,g:255*t.g,b:255*t.b,a:t.a}}function xe(t){return{r:t.r/255,g:t.g/255,b:t.b/255,a:t.a}}function Ce(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return{r:Math.round(t.r*r)/r,g:Math.round(t.g*r)/r,b:Math.round(t.b*r)/r,a:t.a}}function Ae(t,e,r,n,o,a){return(1-e/r)*n+e/r*Math.round((1-t)*o+t*a)}function _e(t,e,r,n,o){void 0===o&&(o={unitInput:!1,unitOutput:!1,roundOutput:!0}),o.unitInput&&(t=je(t),e=je(e)),t=Oe(t);var a=(e=Oe(e)).a+t.a-e.a*t.a,i=r(t,e,n),u=Oe({r:Ae(t.a,e.a,a,t.r,e.r,i.r),g:Ae(t.a,e.a,a,t.g,e.g,i.g),b:Ae(t.a,e.a,a,t.b,e.b,i.b),a:a});return u=o.unitOutput?xe(u):o.roundOutput?Ce(u):function(t){return Ce(t,9)}(u)}function Pe(t,e,r){return je(r(xe(t),xe(e)))}function Ee(t){return.3*t.r+.59*t.g+.11*t.b}function Be(t,e){var r=e-Ee(t);return function(t){var e=Ee(t),r=t.r,n=t.g,o=t.b,a=Math.min(r,n,o),i=Math.max(r,n,o);function u(t){return e+(t-e)*e/(e-a)}function c(t){return e+(t-e)*(1-e)/(i-e)}return a<0&&(r=u(r),n=u(n),o=u(o)),i>1&&(r=c(r),n=c(n),o=c(o)),{r:r,g:n,b:o}}({r:t.r+r,g:t.g+r,b:t.b+r})}function Re(t){return Math.max(t.r,t.g,t.b)-Math.min(t.r,t.g,t.b)}function Ie(t,e){var r=["r","g","b"].sort((function(e,r){return t[e]-t[r]})),n=r[0],o=r[1],a=r[2],i={r:t.r,g:t.g,b:t.b};return i[a]>i[n]?(i[o]=(i[o]-i[n])*e/(i[a]-i[n]),i[a]=e):i[o]=i[a]=0,i[n]=0,i}function Te(t,e){return Be(Ie(e,Re(t)),Ee(t))}function De(t,e){return Be(Ie(t,Re(e)),Ee(t))}function Ne(t,e){return Be(e,Ee(t))}function Le(t,e){return Be(t,Ee(e))}function Fe(t,e){return _e(t,e,se,fe)}function ze(t,e){return _e(t,e,se,he)}function qe(t,e){return _e(t,e,se,pe)}function $e(t,e){return _e(t,e,se,de)}function We(t,e){return _e(t,e,se,ge)}function He(t,e){return _e(t,e,se,ye)}function Ue(t,e){return _e(t,e,se,ve)}function Ge(t,e){return _e(t,e,se,be)}function Je(t,e){return _e(t,e,se,me)}function Ve(t,e){return _e(t,e,se,we)}function Xe(t,e){return _e(t,e,se,Me)}function Ke(t,e){return _e(t,e,se,ke)}function Ye(t,e){return _e(t,e,Pe,Te)}function Ze(t,e){return _e(t,e,Pe,De)}function Qe(t,e){return _e(t,e,Pe,Ne)}function tr(t,e){return _e(t,e,Pe,Le)}var er,rr,nr,or=["cssProperty","element"],ar=["space"],ir=["algorithm"],ur=["method"],cr=["maxDeltaE","deltaEMethod","steps","maxSteps"];function lr(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function sr(t,e){if(e&&("object"===Mr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function fr(t){return(fr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function hr(t){return function(t){if(Array.isArray(t))return Ar(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Cr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?pr(Object(r),!0).forEach((function(e){kr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function gr(t,e,r){return(gr=yr()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&wr(o,r.prototype),o}).apply(null,arguments)}function yr(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function vr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}(t,e)||Cr(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function br(){br=function(t,e){return new r(t,void 0,e)};var t=RegExp.prototype,e=new WeakMap;function r(t,n,o){var a=new RegExp(t,n);return e.set(a,o||e.get(t)),wr(a,r.prototype)}function n(t,r){var n=e.get(r);return Object.keys(n).reduce((function(e,r){return e[r]=t[n[r]],e}),Object.create(null))}return mr(r,RegExp),r.prototype.exec=function(e){var r=t.exec.call(this,e);return r&&(r.groups=n(r,this)),r},r.prototype[Symbol.replace]=function(r,o){if("string"==typeof o){var a=e.get(this);return t[Symbol.replace].call(this,r,o.replace(/\$<([^>]+)>/g,(function(t,e){return"$"+a[e]})))}if("function"==typeof o){var i=this;return t[Symbol.replace].call(this,r,(function(){var t=arguments;return"object"!=Mr(t[t.length-1])&&(t=[].slice.call(t)).push(n(t,i)),o.apply(this,t)}))}return t[Symbol.replace].call(this,r,o)},br.apply(this,arguments)}function mr(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wr(t,e)}function wr(t,e){return(wr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Mr(t){return(Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Or(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function jr(t,e,r){return e&&Or(t.prototype,e),r&&Or(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function xr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Cr(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function Cr(t,e){if(t){if("string"==typeof t)return Ar(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ar(t,e):void 0}}function Ar(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _r(t,e){var r,n,o=t.length,a=!1,i=!1;Array.isArray(t[0])?r=t:(o=(r=[t]).length,a=!0),Array.isArray(e[0])?n=e:(n=e.length>0?e.map((function(t){return[t]})):[[]],i=!0);var u=n[0].length,c=n[0].map((function(t,e){return n.map((function(t){return t[e]}))})),l=r.map((function(t){return c.map((function(e){var r=0;if(!Array.isArray(t)){var n,o=xr(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;r+=t*a}}catch(t){o.e(t)}finally{o.f()}return r}for(var i=0;i<t.length;i++)r+=t[i]*(e[i]||0);return r}))}));return 1===o&&a&&(l=l[0]),1===u&&i?1===o&&a?l[0]:l.map((function(t){return t[0]})):l}function Pr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Er(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0],n=Pr(t,e[0]),o=Pr(t,e[1]),a=Pr(t,e[2]);return r[0]=n,r[1]=o,r[2]=a,r}function Br(t){return"string"===Rr(t)}function Rr(t){return(Object.prototype.toString.call(t).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function Ir(t,e){var r=e.precision,n=void 0===r?16:r,o=e.unit;return Tr(t)?"none":(t=+Nr(t,n))+(null!=o?o:"")}function Tr(t){return null===t}function Dr(t){return Tr(t)?0:t}function Nr(t,e){if(0===t)return 0;var r=~~t,n=0;r&&e&&(n=1+~~Math.log10(Math.abs(r)));var o=Math.pow(10,e-n);return Math.floor(t*o+.5)/o}function Lr(t,e,r){return isNaN(t)?e:isNaN(e)?t:t+(e-t)*r}function Fr(t,e,r){return(r-t)/(e-t)}function zr(t,e,r){return!t||!e||t===e||t[0]===e[0]&&t[1]===e[1]||isNaN(r)||null===r?r:Lr(e[0],e[1],Fr(t[0],t[1],r))}function qr(t,e,r){return Math.max(Math.min(r,e),t)}function $r(t,e){return Math.sign(t)===Math.sign(e)?t:-t}function Wr(t,e){return $r(Math.pow(Math.abs(t),e),t)}function Hr(t,e){return 0===e?0:t/e}function Ur(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;r<n;){var o=r+n>>1;t[o]<e?r=o+1:n=o}return r}function Gr(t,e){if(t instanceof e)return!0;for(var r=e.name;t;){var n,o=Object.getPrototypeOf(t),a=null==o||null===(n=o.constructor)||void 0===n?void 0:n.name;if(a===r)return!0;if(!a||"Object"===a)return!1;t=o}return!1}var Jr=Object.freeze({__proto__:null,bisectLeft:Ur,clamp:qr,copySign:$r,interpolate:Lr,interpolateInv:Fr,isInstance:Gr,isNone:Tr,isString:Br,mapRange:zr,multiplyMatrices:_r,multiply_v3_m3x3:Er,serializeNumber:Ir,skipNone:Dr,spow:Wr,toPrecision:Nr,type:Rr,zdiv:Hr}),Vr=new(function(){function t(){Sr(this,t)}return jr(t,[{key:"add",value:function(t,e,r){if("string"==typeof arguments[0])(Array.isArray(t)?t:[t]).forEach((function(t){this[t]=this[t]||[],e&&this[t][r?"unshift":"push"](e)}),this);else for(var t in arguments[0])this.add(t,arguments[0][t],arguments[1])}},{key:"run",value:function(t,e){this[t]=this[t]||[],this[t].forEach((function(t){t.call(e&&e.context?e.context:e,e)}))}}]),t}()),Xr={gamut_mapping:"css",precision:5,deltaE:"76",verbose:"test"!==(null===globalThis||void 0===globalThis||null===(er=globalThis.process)||void 0===er||null===(rr=er.env)||void 0===rr||null===(nr=rr.NODE_ENV)||void 0===nr?void 0:nr.toLowerCase()),warn:function(t){var e,r;this.verbose&&(null===globalThis||void 0===globalThis||null===(e=globalThis.console)||void 0===e||null===(r=e.warn)||void 0===r||r.call(e,t))}},Kr=function(){function t(e,r){var n;(Sr(this,t),kr(this,"type",void 0),kr(this,"coordMeta",void 0),kr(this,"coordRange",void 0),kr(this,"range",void 0),"object"===Mr(e)&&(this.coordMeta=e),r)&&(this.coordMeta=r,this.coordRange=null!==(n=r.range)&&void 0!==n?n:r.refRange);if("string"==typeof e){var o=e.trim().match(br(/^(<[a-z]+>)(\[(\x2D?[.\d]+),\s*(\x2D?[.\d]+)\])?$/,{type:1,min:3,max:4}));if(!o)throw new TypeError("Cannot parse ".concat(e," as a type definition."));this.type=o.groups.type;var a=o.groups,i=a.min,u=a.max;(i||u)&&(this.range=[+i,+u])}}return jr(t,[{key:"computedRange",get:function(){return this.range?this.range:"<percentage>"===this.type?this.percentageRange():"<angle>"===this.type?[0,360]:null}},{key:"unit",get:function(){return"<percentage>"===this.type?"%":"<angle>"===this.type?"deg":""}},{key:"resolve",value:function(t){if("<angle>"===this.type)return t;var e,r=this.computedRange,n=this.coordRange;"<percentage>"===this.type&&(null!==(e=n)&&void 0!==e||(n=this.percentageRange()));return zr(r,n,t)}},{key:"serialize",value:function(t,e){var r="<percentage>"===this.type?this.percentageRange(100):this.computedRange,n=this.unit;return Ir(t=zr(this.coordRange,r,t),{unit:n,precision:e})}},{key:"toString",value:function(){var t=this.type;if(this.range){var e=vr(this.range,2),r=e[0],n=void 0===r?"":r,o=e[1],a=void 0===o?"":o;t+="[".concat(n,",").concat(a,"]")}return t}},{key:"percentageRange",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return[(t=this.coordMeta&&this.coordMeta.range||this.coordRange&&this.coordRange[0]>=0?[0,1]:[-1,1])[0]*e,t[1]*e]}}],[{key:"get",value:function(t,e){return Gr(t,this)?t:new this(t,e)}}]),t}(),Yr=Symbol("instance"),Zr=function(){function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.space;Sr(this,t),kr(this,"type",void 0),kr(this,"name",void 0),kr(this,"spaceCoords",void 0),kr(this,"coords",void 0),kr(this,"id",void 0),kr(this,"alpha",void 0),e[Yr]=this,this.type="function",this.name="color",Object.assign(this,e),this.space=n,"custom"!==this.type&&(this.spaceCoords=Object.values(n.coords),this.coords||(this.coords=this.spaceCoords.map((function(t){var e=["<number>","<percentage>"];return"angle"===t.type&&e.push("<angle>"),e}))),this.coords=this.coords.map((function(t,e){var n=r.spaceCoords[e];return"string"==typeof t&&(t=t.trim().split(/\s*\|\s*/)),t.map((function(t){return Kr.get(t,n)}))})))}return jr(t,[{key:"serializeCoords",value:function(t,e,r){var n=this;return r=t.map((function(t,e){var o,a;return Kr.get(null!==(o=null===(a=r)||void 0===a?void 0:a[e])&&void 0!==o?o:n.coords[e][0],n.spaceCoords[e])})),t.map((function(t,n){return r[n].serialize(t,e)}))}},{key:"coerceCoords",value:function(t,e){var r=this;return Object.entries(this.space.coords).map((function(n,o){var a=vr(n,2),i=a[0],u=a[1],c=t[o];if(Tr(c)||isNaN(c))return c;var l=e[o],s=r.coords[o].find((function(t){return t.type==l}));if(!s){var f,h,p=u.name||i;throw new TypeError("".concat(null!==(f=null!=l?l:null===(h=c)||void 0===h?void 0:h.raw)&&void 0!==f?f:c," not allowed for ").concat(p," in ").concat(r.name,"()"))}return c=s.resolve(c),s.range&&(e[o]=s.toString()),c}))}},{key:"canSerialize",value:function(){return"function"===this.type||this.serialize}},{key:"parse",value:function(t){return null}}],[{key:"get",value:function(e){if(!e||Gr(e,this))return e;if(e[Yr])return e[Yr];for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return gr(t,[e].concat(n))}}]),t}(),Qr={D50:[.3457/.3585,1,.2958/.3585],D65:[.3127/.329,1,.3583/.329]};function tn(t){return Array.isArray(t)?t:Qr[t]}function en(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(t=tn(t),e=tn(e),!t||!e)throw new TypeError("Missing white point to convert ".concat(t?"":"from").concat(t||e?"":"/").concat(e?"":"to"));if(t===e)return r;var o={W1:t,W2:e,XYZ:r,options:n};if(Vr.run("chromatic-adaptation-start",o),o.M||(o.W1===Qr.D65&&o.W2===Qr.D50?o.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:o.W1===Qr.D50&&o.W2===Qr.D65&&(o.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),Vr.run("chromatic-adaptation-end",o),o.M)return Er(o.XYZ,o.M);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}function rn(t,e){var r,n,o,a={str:null===(r=String(t))||void 0===r?void 0:r.trim(),options:e};if(Vr.run("parse-start",a),a.color)return a.color;a.parsed=function(t){if(!t)return;var e=(t=t.trim()).match(on.function);if(e){var r=[],n=[],o=!1,a=e[1].toLowerCase(),i=e[2].replace(on.singleArgument,(function(t,e){var i=function(t){var e,r={},n=null===(e=t.match(on.unitValue))||void 0===e?void 0:e[0],o=r.raw=t;n?(r.type="%"===n?"<percentage>":"<angle>",r.unit=n,r.unitless=Number(o.slice(0,-n.length)),o=r.unitless*nn[n]):on.number.test(o)?(o=Number(o),r.type="<number>"):"none"===o?o=null:"NaN"===o||"calc(NaN)"===o?(o=NaN,r.type="<number>"):r.type="<ident>";return{value:o,meta:r}}(e),u=i.value,c=i.meta;return(t.startsWith("/")||"color"!==a&&3===r.length)&&(o=!0),r.push(u),n.push(c),""}));return{name:a,args:r,argMeta:n,lastAlpha:o,commas:i.includes(","),rawName:e[1],rawArgs:e[2]}}}(a.str);var i=a.options?null!==(n=a.options.parseMeta)&&void 0!==n?n:a.options.meta:null;if(a.parsed){var u,c,l=a.parsed.name,s=a.parsed.args,f=s.map((function(t,e){var r;return null===(r=a.parsed.argMeta[e])||void 0===r?void 0:r.type}));if("color"===l){var h=s.shift();f.shift();var p=h.startsWith("--")?h.substring(2):"--".concat(h),d=[h,p];if(!(u=un.findFormat({name:l,id:d,type:"function"}))){var g,y,v=h in un.registry?h:p;if(v in un.registry){var b,m,w=null===(b=un.registry[v].formats)||void 0===b||null===(m=b.color)||void 0===m?void 0:m.id;if(w){var M=t.replace("color("+h,"color("+w);y="Did you mean ".concat(M,"?")}}throw new TypeError("Cannot parse ".concat(a.str,". ")+(null!==(g=y)&&void 0!==g?g:"Missing a plugin?"))}c=u.space,u.id.startsWith("--")&&!h.startsWith("--")&&Xr.warn("".concat(c.name," is a non-standard space and not currently supported in the CSS spec. ")+"Use prefixed color(".concat(u.id,") instead of color(").concat(h,").")),h.startsWith("--")&&!u.id.startsWith("--")&&Xr.warn("".concat(c.name," is a standard space and supported in the CSS spec. ")+"Use color(".concat(u.id,") instead of prefixed color(").concat(h,")."))}else c=(u=un.findFormat({name:l,type:"function"})).space;i&&Object.assign(i,{format:u,formatId:u.name,types:f,commas:a.parsed.commas});var k=1;a.parsed.lastAlpha&&(k=a.parsed.args.pop(),i&&(i.alphaType=f.pop()));var S=u.coords.length;if(s.length!==S)throw new TypeError("Expected ".concat(S," coordinates for ").concat(c.id," in ").concat(a.str,"), got ").concat(s.length));s=u.coerceCoords(s,f),o={spaceId:c.id,coords:s,alpha:k}}else{var O,j=xr(un.all);try{t:for(j.s();!(O=j.n()).done;){var x=O.value;for(var C in x.formats){var A=x.formats[C];if("custom"===A.type&&(!A.test||A.test(a.str))){var _=x.getFormat(A),P=_.parse(a.str);if(P){i&&Object.assign(i,{format:_,formatId:C}),o=P;break t}}}}}catch(t){j.e(t)}finally{j.f()}}if(!o)throw new TypeError("Could not parse ".concat(t," as a color. Missing a plugin?"));return o.alpha=Tr(o.alpha)?o.alpha:void 0===o.alpha?1:qr(0,o.alpha,1),o}var nn={"%":.01,deg:1,grad:.9,rad:180/Math.PI,turn:360},on={function:/^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i,number:/^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i,unitValue:RegExp("(".concat(Object.keys(nn).join("|"),")$")),singleArgument:/\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g};function an(t,e){if(Array.isArray(t))return t.map((function(t){return an(t,e)}));if(!t)throw new TypeError("Empty color reference");Br(t)&&(t=rn(t,e));var r=t.space||t.spaceId;return"string"==typeof r&&(t.space=un.get(r)),void 0===t.alpha&&(t.alpha=1),t}var un=function(){function t(e){var r,n,o,a,i;Sr(this,t),this.id=e.id,this.name=e.name,this.base=e.base?t.get(e.base):null,this.aliases=e.aliases,this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);var u=null!==(r=e.coords)&&void 0!==r?r:this.base.coords;for(var c in u)"name"in u[c]||(u[c].name=c);this.coords=u;var l,s=null!==(n=null!==(o=e.white)&&void 0!==o?o:this.base.white)&&void 0!==n?n:"D65";for(var f in this.white=tn(s),this.formats=null!==(a=e.formats)&&void 0!==a?a:{},this.formats){var h=this.formats[f];h.type||(h.type="function"),h.name||(h.name=f)}null!==(i=this.formats.color)&&void 0!==i&&i.id||(this.formats.color=dr(dr({},null!==(l=this.formats.color)&&void 0!==l?l:{}),{},{id:e.cssId||this.id}));e.gamutSpace?this.gamutSpace="self"===e.gamutSpace?this:t.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=function(t,e){return!0}),this.referred=e.referred,Object.defineProperty(this,"path",{value:cn(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Vr.run("colorspace-init-end",this)}return jr(t,[{key:"inGamut",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.epsilon,n=void 0===r?75e-6:r;if(!this.equals(this.gamutSpace))return t=this.to(this.gamutSpace,t),this.gamutSpace.inGamut(t,{epsilon:n});var o=Object.values(this.coords);return t.every((function(t,e){var r=o[e];if("angle"!==r.type&&r.range){if(Tr(t))return!0;var a=vr(r.range,2),i=a[0],u=a[1];return(void 0===i||t>=i-n)&&(void 0===u||t<=u+n)}return!0}))}},{key:"isUnbounded",get:function(){return Object.values(this.coords).every((function(t){return!("range"in t)}))}},{key:"cssId",get:function(){var t,e;return(null===(t=this.formats)||void 0===t||null===(e=t.color)||void 0===e?void 0:e.id)||this.id}},{key:"isPolar",get:function(){for(var t in this.coords)if("angle"===this.coords[t].type)return!0;return!1}},{key:"getFormat",value:function(t){if(!t)return null;"default"===t?t=Object.values(this.formats)[0]:"string"==typeof t&&(t=this.formats[t]);var e=Zr.get(t,this);return e!==t&&t.name in this.formats&&(this.formats[t.name]=e),e}},{key:"equals",value:function(t){return!!t&&(this===t||this.id===t||this.id===t.id)}},{key:"to",value:function(e,r){if(1===arguments.length){var n=an(e),o=[n.space,n.coords];e=o[0],r=o[1]}if(e=t.get(e),this.equals(e))return r;r=r.map((function(t){return Tr(t)?0:t}));for(var a,i,u=this.path,c=e.path,l=0;l<u.length&&u[l].equals(c[l]);l++)a=u[l],i=l;if(!a)throw new Error("Cannot convert between color spaces ".concat(this," and ").concat(e,": no connection space was found"));for(var s=u.length-1;s>i;s--)r=u[s].toBase(r);for(var f=i+1;f<c.length;f++)r=c[f].fromBase(r);return r}},{key:"from",value:function(e,r){if(1===arguments.length){var n=an(e),o=[n.space,n.coords];e=o[0],r=o[1]}return(e=t.get(e)).to(this,r)}},{key:"toString",value:function(){return"".concat(this.name," (").concat(this.id,")")}},{key:"getMinCoords",value:function(){var t=[];for(var e in this.coords){var r,n=this.coords[e],o=n.range||n.refRange;t.push(null!==(r=null==o?void 0:o.min)&&void 0!==r?r:0)}return t}}],[{key:"all",get:function(){return hr(new Set(Object.values(t.registry)))}},{key:"register",value:function(t,e){if(1===arguments.length&&(t=(e=arguments[0]).id),e=this.get(e),this.registry[t]&&this.registry[t]!==e)throw new Error("Duplicate color space registration: '".concat(t,"'"));if(this.registry[t]=e,1===arguments.length&&e.aliases){var r,n=xr(e.aliases);try{for(n.s();!(r=n.n()).done;){var o=r.value;this.register(o,e)}}catch(t){n.e(t)}finally{n.f()}}return e}},{key:"get",value:function(e){if(!e||Gr(e,this))return e;var r=Rr(e);if("string"===r){var n=t.registry[e.toLowerCase()];if(!n)throw new TypeError('No color space found with id = "'.concat(e,'"'));return n}for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];if(a.length)return t.get.apply(t,a);throw new TypeError("".concat(e," is not a valid color space"))}},{key:"findFormat",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.all;if(!e)return null;"string"==typeof e&&(e={name:e});var n,o=xr(r);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,i=0,u=Object.entries(a.formats);i<u.length;i++){var c,l,s=vr(u[i],2),f=s[0],h=s[1];null!==(c=h.name)&&void 0!==c||(h.name=f),null!==(l=h.type)&&void 0!==l||(h.type="function");var p=!(e.name&&h.name!==e.name||e.type&&h.type!==e.type);if(e.id&&function(){var t=h.ids||[h.id],r=Array.isArray(e.id)?e.id:[e.id];p&&(p=r.some((function(e){return t.includes(e)})))}(),p){var d=Zr.get(h,a);return d!==h&&(a.formats[h.name]=d),d}}}catch(t){o.e(t)}finally{o.f()}return null}},{key:"resolveCoord",value:function(e,r){var n,o,a=Rr(e);if("string"===a)if(e.includes(".")){var i=vr(e.split("."),2);n=i[0],o=i[1]}else n=void 0,o=e;else if(Array.isArray(e)){var u=vr(e,2);n=u[0],o=u[1]}else n=e.space,o=e.coordId;if((n=t.get(n))||(n=r),!n)throw new TypeError("Cannot resolve coordinate reference ".concat(e,": No color space specified and relative references are not allowed here"));if("number"===(a=Rr(o))||"string"===a&&o>=0){var c=Object.entries(n.coords)[o];if(c)return dr({space:n,id:c[0],index:o},c[1])}n=t.get(n);var l=o.toLowerCase(),s=0;for(var f in n.coords){var h,p=n.coords[f];if(f.toLowerCase()===l||(null===(h=p.name)||void 0===h?void 0:h.toLowerCase())===l)return dr({space:n,id:f,index:s},p);s++}throw new TypeError('No "'.concat(o,'" coordinate found in ').concat(n.name,". Its coordinates are: ").concat(Object.keys(n.coords).join(", ")))}}]),t}();function cn(t){for(var e=[t],r=t;r=r.base;)e.push(r);return e}kr(un,"registry",{}),kr(un,"DEFAULT_FORMAT",{type:"functions",name:"color"});var ln=new un({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"]}),sn=function(t){mr(o,t);var e,r,n=(e=o,r=yr(),function(){var t,n=fr(e);if(r){var o=fr(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return sr(this,t)});function o(t){var e,r,a,i;(Sr(this,o),t.coords||(t.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),t.base||(t.base=ln),t.toXYZ_M&&t.fromXYZ_M)&&(null!==(a=t.toBase)&&void 0!==a||(t.toBase=function(e){var n=Er(e,t.toXYZ_M);return r.white!==r.base.white&&(n=en(r.white,r.base.white,n)),n}),null!==(i=t.fromBase)&&void 0!==i||(t.fromBase=function(e){return Er(e=en(r.base.white,r.white,e),t.fromXYZ_M)}));return null!==(e=t.referred)&&void 0!==e||(t.referred="display"),r=n.call(this,t)}return jr(o)}(un);function fn(t,e){t=an(t);var r,n=un.get(e,null==e?void 0:e.space),o=null==e?void 0:e.precision;return r=!n||t.space.equals(n)?t.coords.slice():n.from(t),void 0===o?r:r.map((function(t){return Nr(t,o)}))}function hn(t,e){var r;if(t=an(t),"alpha"===e)return null!==(r=t.alpha)&&void 0!==r?r:1;var n=un.resolveCoord(e,t.space),o=n.space,a=n.index;return fn(t,o)[a]}function pn(t,e,r,n){if(t=an(t),Array.isArray(e)){var o=[t.space,e,r];e=o[0],r=o[1],n=o[2]}return e=un.get(e),t.coords=e===t.space?r.slice():e.to(t.space,r),void 0!==n&&(t.alpha=n),t}function dn(t,e,r){if(t=an(t),2===arguments.length&&"object"===Rr(arguments[1])){var n=arguments[1];for(var o in n)dn(t,o,n[o])}else if("function"==typeof r&&(r=r(hn(t,e))),"alpha"===e)t.alpha=r;else{var a=un.resolveCoord(e,t.space),i=a.space,u=a.index,c=fn(t,i);c[u]=r,pn(t,i,c)}return t}pn.returns="color",dn.returns="color";var gn=new un({id:"xyz-d50",name:"XYZ D50",white:"D50",base:ln,fromBase:function(t){return en(ln.white,"D50",t)},toBase:function(t){return en("D50",ln.white,t)}}),yn=24389/27,vn=Qr.D50,bn=new un({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:vn,base:gn,fromBase:function(t){var e=t.map((function(t,e){return t/vn[e]})).map((function(t){return t>216/24389?Math.cbrt(t):(yn*t+16)/116}));return[116*e[1]-16,500*(e[0]-e[1]),200*(e[1]-e[2])]},toBase:function(t){var e=vr(t,3),r=e[0],n=e[1],o=e[2],a=[];return a[1]=(r+16)/116,a[0]=n/500+a[1],a[2]=a[1]-o/200,[a[0]>24/116?Math.pow(a[0],3):(116*a[0]-16)/yn,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/yn,a[2]>24/116?Math.pow(a[2],3):(116*a[2]-16)/yn].map((function(t,e){return t*vn[e]}))},formats:{lab:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function mn(t){return"number"!=typeof t?t:(t%360+360)%360}function wn(t,e){var r=vr(e,2),n=r[0],o=r[1],a=Tr(n),i=Tr(o);if(a&&i)return[n,o];if(a?n=o:i&&(o=n),"raw"===t)return e;n=mn(n);var u=(o=mn(o))-n;return"increasing"===t?u<0&&(o+=360):"decreasing"===t?u>0&&(n+=360):"longer"===t?-180<u&&u<180&&(u>0?n+=360:o+=360):"shorter"===t&&(u>180?n+=360:u<-180&&(o+=360)),[n,o]}var Mn=new un({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:bn,fromBase:function(t){if(void 0===this.ε){var e=Object.values(this.base.coords)[1].refRange,r=e[1]-e[0];this.ε=r/1e5}var n=vr(t,3),o=n[0],a=n[1],i=n[2],u=Math.abs(a)<this.ε&&Math.abs(i)<this.ε,c=u?null:mn(180*Math.atan2(i,a)/Math.PI);return[o,u?0:Math.sqrt(Math.pow(a,2)+Math.pow(i,2)),c]},toBase:function(t){var e=vr(t,3),r=e[0],n=e[1],o=e[2],a=null,i=null;return Tr(o)||(a=(n=n<0?0:n)*Math.cos(o*Math.PI/180),i=n*Math.sin(o*Math.PI/180)),[r,a,i]},formats:{lch:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}}),kn=Math.pow(25,7),Sn=Math.PI,On=180/Sn,jn=Sn/180;function xn(t){var e=t*t;return e*e*e*t}function Cn(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.kL,o=void 0===n?1:n,a=r.kC,i=void 0===a?1:a,u=r.kH,c=void 0===u?1:u,l=an([t,e]),s=vr(l,2);t=s[0],e=s[1];var f=bn.from(t),h=vr(f,3),p=h[0],d=h[1],g=h[2],y=Mn.from(bn,[p,d,g])[1],v=bn.from(e),b=vr(v,3),m=b[0],w=b[1],M=b[2],k=Mn.from(bn,[m,w,M])[1];y<0&&(y=0),k<0&&(k=0);var S=(y+k)/2,O=xn(S),j=.5*(1-Math.sqrt(O/(O+kn))),x=(1+j)*d,C=(1+j)*w,A=Math.sqrt(Math.pow(x,2)+Math.pow(g,2)),_=Math.sqrt(Math.pow(C,2)+Math.pow(M,2)),P=0===x&&0===g?0:Math.atan2(g,x),E=0===C&&0===M?0:Math.atan2(M,C);P<0&&(P+=2*Sn),E<0&&(E+=2*Sn);var B,R=m-p,I=_-A,T=(E*=On)-(P*=On),D=P+E,N=Math.abs(T);A*_==0?B=0:N<=180?B=T:T>180?B=T-360:T<-180?B=T+360:Xr.warn("the unthinkable has happened");var L,F=2*Math.sqrt(_*A)*Math.sin(B*jn/2),z=(p+m)/2,q=(A+_)/2,$=xn(q);L=A*_==0?D:N<=180?D/2:D<360?(D+360)/2:(D-360)/2;var W=Math.pow(z-50,2),H=1+.015*W/Math.sqrt(20+W),U=1+.045*q,G=1;G-=.17*Math.cos((L-30)*jn),G+=.24*Math.cos(2*L*jn),G+=.32*Math.cos((3*L+6)*jn);var J=1+.015*q*(G-=.2*Math.cos((4*L-63)*jn)),V=30*Math.exp(-1*Math.pow((L-275)/25,2)),X=2*Math.sqrt($/($+kn)),K=-1*Math.sin(2*V*jn)*X,Y=Math.pow(R/(o*H),2);return Y+=Math.pow(I/(i*U),2),Y+=Math.pow(F/(c*J),2),Y+=K*(I/(i*U))*(F/(c*J)),Math.sqrt(Y)}var An=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],_n=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],Pn=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],En=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Bn=new un({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:ln,fromBase:function(t){var e=Er(t,An);return e[0]=Math.cbrt(e[0]),e[1]=Math.cbrt(e[1]),e[2]=Math.cbrt(e[2]),Er(e,Pn,e)},toBase:function(t){var e=Er(t,En);return e[0]=Math.pow(e[0],3),e[1]=Math.pow(e[1],3),e[2]=Math.pow(e[2],3),Er(e,_n,e)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function Rn(t,e){var r=vr(an([t,e]),2);t=r[0],e=r[1];var n=vr(Bn.from(t),3),o=n[0],a=n[1],i=n[2],u=vr(Bn.from(e),3),c=o-u[0],l=a-u[1],s=i-u[2];return Math.sqrt(Math.pow(c,2)+Math.pow(l,2)+Math.pow(s,2))}function In(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.epsilon,o=void 0===n?75e-6:n;t=an(t),e||(e=t.space),e=un.get(e);var a=t.coords;return e!==t.space&&(a=e.from(t)),e.inGamut(a,{epsilon:o})}function Tn(t){return{space:t.space,coords:t.coords.slice(),alpha:t.alpha}}function Dn(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"lab",n=(r=un.get(r)).from(t),o=r.from(e);return Math.sqrt(n.reduce((function(t,e,r){var n=o[r];return Tr(e)||Tr(n)?t:t+Math.pow(n-e,2)}),0))}var Nn=Math.PI/180;var Ln=new un({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:ln,fromBase:function(t){return t.map((function(t){return 203*t}))},toBase:function(t){return t.map((function(t){return t/203}))}}),Fn=2610/Math.pow(2,14),zn=Math.pow(2,14)/2610,qn=3424/Math.pow(2,12),$n=2413/Math.pow(2,7),Wn=2392/Math.pow(2,7),Hn=1.7*2523/Math.pow(2,5),Un=Math.pow(2,5)/(1.7*2523),Gn=16295499532821565e-27,Jn=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],Vn=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],Xn=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],Kn=[[1,.13860504327153927,.05804731615611883],[1,-.1386050432715393,-.058047316156118904],[1,-.09601924202631895,-.811891896056039]],Yn=new un({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.21,.21]},bz:{refRange:[-.21,.21]}},base:Ln,fromBase:function(t){var e=vr(t,3),r=e[0],n=e[1],o=e[2],a=Er([1.15*r-(1.15-1)*o,.66*n-(.66-1)*r,o],Jn),i=vr(Er(a.map((function(t){var e=qn+$n*Wr(t/1e4,Fn),r=1+Wn*Wr(t/1e4,Fn);return Wr(e/r,Hn)})),Xn),3),u=i[0],c=i[1],l=i[2];return[(1-.56)*u/(1+-.56*u)-Gn,c,l]},toBase:function(t){var e=vr(t,3),r=e[0],n=e[1],o=e[2],a=Er([(r+Gn)/(1-.56- -.56*(r+Gn)),n,o],Kn),i=vr(Er(a.map((function(t){var e=qn-Wr(t,Un),r=Wn*Wr(t,Un)-$n;return 1e4*Wr(e/r,zn)})),Vn),3),u=i[0],c=i[1],l=i[2],s=(u+(1.15-1)*l)/1.15;return[s,(c+(.66-1)*s)/.66,l]},formats:{jzazbz:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}}),Zn=new un({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,.26],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:Yn,fromBase:Mn.fromBase,toBase:Mn.toBase,formats:{jzczhz:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}});var Qn=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],to=[[.5,.5,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],eo=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],ro=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],no=new un({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:Ln,fromBase:function(t){return function(t){return Er(t.map((function(t){var e=.8359375+2413/128*Math.pow(t/1e4,2610/16384),r=1+18.6875*Math.pow(t/1e4,2610/16384);return Math.pow(e/r,2523/32)})),to)}(Er(t,Qn))},toBase:function(t){var e=function(t){return Er(t,eo).map((function(t){var e=Math.max(Math.pow(t,32/2523)-.8359375,0),r=2413/128-18.6875*Math.pow(t,32/2523);return 1e4*Math.pow(e/r,16384/2610)}))}(t);return Er(e,ro)},formats:{ictcp:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});var oo=Qr.D65,ao=2*Math.PI,io=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],uo=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],co=[[460,451,288],[460,-891,-261],[460,-220,-6300]],lo={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},so={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},fo=180/Math.PI,ho=Math.PI/180;function po(t,e){return t.map((function(t){var r=Wr(e*Math.abs(t)*.01,.42);return 400*$r(r,t)/(r+27.13)}))}function go(t,e,r,n,o){var a={};a.discounting=o,a.refWhite=t,a.surround=n;var i=t.map((function(t){return 100*t}));a.la=e,a.yb=r;var u=i[1],c=Er(i,io),l=lo[a.surround],s=l[0];a.c=l[1],a.nc=l[2];var f=1/(5*a.la+1),h=Math.pow(f,4);a.fl=h*a.la+.1*(1-h)*(1-h)*Math.cbrt(5*a.la),a.flRoot=Math.pow(a.fl,.25),a.n=a.yb/u,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*Math.pow(a.n,-.2),a.ncb=a.nbb;var p=Math.max(Math.min(s*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=c.map((function(t){return Lr(1,u/t,p)})),a.dRgbInv=a.dRgb.map((function(t){return 1/t}));var d=po(c.map((function(t,e){return t*a.dRgb[e]})),a.fl);return a.aW=a.nbb*(2*d[0]+d[1]+.05*d[2]),a}var yo=go(oo,64/Math.PI*.2,20,"average",!1);function vo(t,e){if(!(void 0!==t.J^void 0!==t.Q))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(void 0!==t.C^void 0!==t.M^void 0!==t.s))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(void 0!==t.h^void 0!==t.H))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(0===t.J||0===t.Q)return[0,0,0];var r=0;r=void 0!==t.h?mn(t.h)*ho:function(t){var e=(t%400+400)%400,r=Math.floor(.01*e);e%=100;var n=vr(so.h.slice(r,r+2),2),o=n[0],a=n[1],i=vr(so.e.slice(r,r+2),2),u=i[0],c=i[1];return mn((e*(c*o-u*a)-100*o*c)/(e*(c-u)-100*c))}(t.H)*ho;var n=Math.cos(r),o=Math.sin(r),a=0;void 0!==t.J?a=.1*Wr(t.J,.5):void 0!==t.Q&&(a=.25*e.c*t.Q/((e.aW+4)*e.flRoot));var i=0;void 0!==t.C?i=t.C/a:void 0!==t.M?i=t.M/e.flRoot/a:void 0!==t.s&&(i=4e-4*Math.pow(t.s,2)*(e.aW+4)/e.c);var u,c,l,s=Wr(i*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),f=.25*(Math.cos(r+2)+3.8),h=e.aW*Wr(a,2/e.c/e.z),p=5e4/13*e.nc*e.ncb*f,d=h/e.nbb,g=23*(d+.305)*Hr(s,23*p+s*(11*n+108*o)),y=(u=Er([d,g*n,g*o],co).map((function(t){return 1*t/1403})),c=e.fl,l=100/c*Math.pow(27.13,1/.42),u.map((function(t){var e=Math.abs(t);return $r(l*Wr(e/(400-e),1/.42),t)})));return Er(y.map((function(t,r){return t*e.dRgbInv[r]})),uo).map((function(t){return t/100}))}function bo(t,e){var r=po(Er(t.map((function(t){return 100*t})),io).map((function(t,r){return t*e.dRgb[r]})),e.fl),n=r[0]+(-12*r[1]+r[2])/11,o=(r[0]+r[1]-2*r[2])/9,a=(Math.atan2(o,n)%ao+ao)%ao,i=.25*(Math.cos(a+2)+3.8),u=Wr(5e4/13*e.nc*e.ncb*Hr(i*Math.sqrt(Math.pow(n,2)+Math.pow(o,2)),r[0]+r[1]+1.05*r[2]+.305),.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),c=Wr(e.nbb*(2*r[0]+r[1]+.05*r[2])/e.aW,.5*e.c*e.z),l=100*Wr(c,2),s=4/e.c*c*(e.aW+4)*e.flRoot,f=u*c,h=f*e.flRoot,p=mn(a*fo),d=function(t){var e=mn(t);e<=so.h[0]&&(e+=360);var r=Ur(so.h,e)-1,n=vr(so.h.slice(r,r+2),2),o=n[0],a=n[1],i=vr(so.e.slice(r,r+2),2),u=i[0],c=i[1],l=(e-o)/u;return so.H[r]+100*l/(l+(a-e)/c)}(p);return{J:l,C:f,h:p,s:50*Wr(e.c*u/(e.aW+4),.5),Q:s,M:h,H:d}}var mo=new un({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:ln,fromBase:function(t){void 0===this.ε&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);var e=bo(t,yo),r=Math.abs(e.M)<this.ε;return[e.J,r?0:e.M,r?null:e.h]},toBase:function(t){return vo({J:t[0],M:t[1],h:t[2]},yo)}}),wo=Qr.D65;function Mo(t){return t>8?Math.pow((t+16)/116,3):t/(24389/27)}function ko(t,e){var r=function(t){return 116*(t>216/24389?Math.cbrt(t):(24389/27*t+16)/116)-16}(t[1]);if(0===r)return[0,0,0];var n=bo(t,So);return[mn(n.h),n.C,r]}var So=go(wo,200/Math.PI*Mo(50),100*Mo(50),"average",!1),Oo=new un({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:ln,fromBase:function(t){void 0===this.ε&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);var e=ko(t);return e[1]<this.ε&&(e[1]=0,e[0]=null),e},toBase:function(t){return function(t,e){var r=vr(t,3),n=r[0],o=r[1],a=r[2],i=[],u=0;if(0===a)return[0,0,0];var c=Mo(a);u=a>0?.00379058511492914*Math.pow(a,2)+.608983189401032*a+.9155088574762233:9514440756550361e-21*Math.pow(a,2)+.08693057439788597*a-21.928975842194614;for(var l=0,s=1/0;l<=15;){i=vo({J:u,C:o,h:n},e);var f=Math.abs(i[1]-c);if(f<s){if(f<=2e-12)return i;s=f}u-=(i[1]-c)*u/(2*i[1]),l+=1}return vo({J:u,C:o,h:n},e)}(t,So)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),jo=Math.PI/180,xo=[1,.007,.0228];function Co(t){t[1]<0&&(t=Oo.fromBase(Oo.toBase(t)));var e=Math.log(Math.max(1+xo[2]*t[1]*So.flRoot,1))/xo[2],r=t[0]*jo,n=e*Math.cos(r),o=e*Math.sin(r);return[t[2],n,o]}var Ao={deltaE76:function(t,e){return Dn(t,e,"lab")},deltaECMC:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.l,o=void 0===n?2:n,a=r.c,i=void 0===a?1:a,u=an([t,e]),c=vr(u,2);t=c[0],e=c[1];var l=bn.from(t),s=vr(l,3),f=s[0],h=s[1],p=s[2],d=Mn.from(bn,[f,h,p]),g=vr(d,3),y=g[1],v=g[2],b=bn.from(e),m=vr(b,3),w=m[0],M=m[1],k=m[2],S=Mn.from(bn,[w,M,k])[1];y<0&&(y=0),S<0&&(S=0);var O=f-w,j=y-S,x=h-M,C=p-k,A=Math.pow(x,2)+Math.pow(C,2)-Math.pow(j,2),_=.511;f>=16&&(_=.040975*f/(1+.01765*f));var P,E=.0638*y/(1+.0131*y)+.638;Tr(v)&&(v=0),P=v>=164&&v<=345?.56+Math.abs(.2*Math.cos((v+168)*Nn)):.36+Math.abs(.4*Math.cos((v+35)*Nn));var B=Math.pow(y,4),R=Math.sqrt(B/(B+1900)),I=E*(R*P+1-R),T=Math.pow(O/(o*_),2);return T+=Math.pow(j/(i*E),2),T+=A/Math.pow(I,2),Math.sqrt(T)},deltaE2000:Cn,deltaEJz:function(t,e){var r=vr(an([t,e]),2);t=r[0],e=r[1];var n=vr(Zn.from(t),3),o=n[0],a=n[1],i=n[2],u=vr(Zn.from(e),3),c=u[0],l=u[1],s=u[2],f=o-c,h=a-l;Tr(i)&&Tr(s)?(i=0,s=0):Tr(i)?i=s:Tr(s)&&(s=i);var p=i-s,d=2*Math.sqrt(a*l)*Math.sin(p/2*(Math.PI/180));return Math.sqrt(Math.pow(f,2)+Math.pow(h,2)+Math.pow(d,2))},deltaEITP:function(t,e){var r=vr(an([t,e]),2);t=r[0],e=r[1];var n=vr(no.from(t),3),o=n[0],a=n[1],i=n[2],u=vr(no.from(e),3),c=u[0],l=u[1],s=u[2];return 720*Math.sqrt(Math.pow(o-c,2)+.25*Math.pow(a-l,2)+Math.pow(i-s,2))},deltaEOK:Rn,deltaEOK2:function(t,e){var r=vr(an([t,e]),2);t=r[0],e=r[1];var n=vr(Bn.from(t),3),o=n[0],a=n[1],i=n[2],u=vr(Bn.from(e),3),c=o-u[0],l=2*(a-u[1]),s=2*(i-u[2]);return Math.sqrt(Math.pow(c,2)+Math.pow(l,2)+Math.pow(s,2))},deltaEHCT:function(t,e){var r=vr(an([t,e]),2);t=r[0],e=r[1];var n=vr(Co(Oo.from(t)),3),o=n[0],a=n[1],i=n[2],u=vr(Co(Oo.from(e)),3),c=u[0],l=u[1],s=u[2];return Math.sqrt(Math.pow(o-c,2)+Math.pow(a-l,2)+Math.pow(i-s,2))}};function _o(t){var e=t?Math.floor(Math.log10(Math.abs(t))):0;return Math.max(parseFloat("1e".concat(e-2)),1e-6)}var Po={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function Eo(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.method,o=void 0===n?Xr.gamut_mapping:n,a=r.space,i=void 0===a?void 0:a,u=r.deltaEMethod,c=void 0===u?"":u,l=r.jnd,s=void 0===l?2:l,f=r.blackWhiteClamp,h=void 0===f?void 0:f;if(t=an(t),Br(arguments[1])?i=arguments[1]:i||(i=t.space),In(t,i=un.get(i),{epsilon:0}))return t;if("css"===o)e=Ro(t,{space:i});else{if("clip"===o||In(t,i))e=Io(t,i);else{if(Object.prototype.hasOwnProperty.call(Po,o)){var p=Po[o];o=p.method,s=p.jnd,c=p.deltaEMethod,h=p.blackWhiteClamp}var d=Cn;if(""!==c)for(var g in Ao)if("deltae"+c.toLowerCase()===g.toLowerCase()){d=Ao[g];break}0===s&&(s=1e-16);var y=Eo(Io(t,i),{method:"clip",space:i});if(d(t,y)>s){if(h&&3===Object.keys(h).length){var v=un.resolveCoord(h.channel),b=hn(Io(t,v.space),v.id);if(Tr(b)&&(b=0),b>=h.max)return Io({space:"xyz-d65",coords:Qr.D65},t.space);if(b<=h.min)return Io({space:"xyz-d65",coords:[0,0,0]},t.space)}var m=un.resolveCoord(o),w=m.space,M=m.id,k=Io(t,w);k.coords.forEach((function(t,e){Tr(t)&&(k.coords[e]=0)}));for(var S=m.range||m.refRange,O=S[0],j=_o(s),x=O,C=hn(k,M);C-x>j;){var A=Tn(k);A=Eo(A,{space:i,method:"clip"});var _=d(k,A);_-s<j?x=hn(k,M):C=hn(k,M),dn(k,M,(x+C)/2)}e=Io(k,i)}else e=y}if("clip"===o||!In(e,i,{epsilon:0})){var P=Object.values(i.coords).map((function(t){return t.range||[]}));e.coords=e.coords.map((function(t,e){var r=vr(P[e],2),n=r[0],o=r[1];return void 0!==n&&(t=Math.max(n,t)),void 0!==o&&(t=Math.min(t,o)),t}))}}return i!==t.space&&(e=Io(e,t.space)),t.coords=e.coords,t}Eo.returns="color";var Bo={WHITE:{space:Bn,coords:[1,0,0],alpha:1},BLACK:{space:Bn,coords:[0,0,0],alpha:1}};function Ro(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.space,n=.02,o=1e-4;t=an(t),r||(r=t.space),r=un.get(r);var a=un.get("oklch");if(r.isUnbounded)return Io(t,r);var i=Io(t,a),u=i.coords[0];if(u>=1){var c=Io(Bo.WHITE,r);return c.alpha=t.alpha,Io(c,r)}if(u<=0){var l=Io(Bo.BLACK,r);return l.alpha=t.alpha,Io(l,r)}if(In(i,r,{epsilon:0}))return Io(i,r);function s(t){var e=Io(t,r),n=Object.values(r.coords);return e.coords=e.coords.map((function(t,e){if("range"in n[e]){var r=vr(n[e].range,2);return qr(r[0],t,r[1])}return t})),e}var f=0,h=i.coords[1],p=!0,d=Tn(i),g=s(d),y=Rn(g,d);if(y<n)return g;for(;h-f>o;){var v=(f+h)/2;if(d.coords[1]=v,p&&In(d,r,{epsilon:0}))f=v;else if((y=Rn(g=s(d),d))<n){if(n-y<o)break;p=!1,f=v}else h=v}return g}function Io(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.inGamut;t=an(t);var o=(e=un.get(e)).from(t),a={space:e,coords:o,alpha:t.alpha};return n&&(a=Eo(a,!0===n?void 0:n)),a}function To(t){var e,r,n,o,a,i,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=u.precision,l=void 0===c?Xr.precision:c,s=u.format,f=u.inGamut,h=void 0===f||f,p=u.coords,d=u.alpha,g=u.commas,y=an(t),v=s,b=y.parseMeta;b&&!s&&(b.format.canSerialize()&&(s=b.format,v=b.formatId),null!==(r=p)&&void 0!==r||(p=b.types),null!==(n=d)&&void 0!==n||(d=b.alphaType),null!==(o=g)&&void 0!==o||(g=b.commas));v&&(s=null!==(a=y.space.getFormat(s))&&void 0!==a?a:un.findFormat(v));s||(v=(s=null!==(i=y.space.getFormat("default"))&&void 0!==i?i:un.DEFAULT_FORMAT).name);s&&s.space&&s.space!==y.space&&(y=Io(y,s.space));var m=y.coords.slice();if(h||(h=s.toGamut),h&&!In(y)&&(m=Eo(Tn(y),!0===h?void 0:h).coords),"custom"===s.type){if(!s.serialize)throw new TypeError("format ".concat(v," can only be used to parse colors, not for serialization"));e=s.serialize(m,y.alpha,u)}else{var w,M,k,S,O,j=s.name||"color",x=s.serializeCoords(m,l,p);if("color"===j){var C,A=s.id||(null===(C=s.ids)||void 0===C?void 0:C[0])||y.space.cssId||y.space.id;x.unshift(A)}var _=y.alpha;void 0!==d&&"object"!==Mr(d)&&(d="string"==typeof d?{type:d}:{include:d});var P=null!==(w=null===(M=d)||void 0===M?void 0:M.type)&&void 0!==w?w:"<number>",E=!0===(null===(k=d)||void 0===k?void 0:k.include)||!0===s.alpha||!1!==(null===(S=d)||void 0===S?void 0:S.include)&&!1!==s.alpha&&_<1,B="";if(null!==(O=g)&&void 0!==O||(g=s.commas),E){var R;if(null!==l)"<percentage>"===P&&(R="%",_*=100),_=Ir(_,{precision:l,unit:R});B="".concat(g?",":" /"," ").concat(_)}e="".concat(j,"(").concat(x.join(g?", ":" ")).concat(B,")")}return e}Io.returns="color";var Do,No=new sn({id:"rec2020-linear",cssId:"--rec2020-linear",name:"Linear REC.2020",white:"D65",toXYZ_M:[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],fromXYZ_M:[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]]}),Lo=new sn({id:"rec2020",name:"REC.2020",base:No,toBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return e*Math.pow(r,2.4)}))},fromBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return e*Math.pow(r,1/2.4)}))}}),Fo=new sn({id:"p3-linear",cssId:"display-p3-linear",name:"Linear P3",white:"D65",toXYZ_M:[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],fromXYZ_M:[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]]}),zo=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],qo=new sn({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],fromXYZ_M:zo}),$o={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[.6,50/255,.8],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,.6],lightslategrey:[119/255,136/255,.6],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[.4,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,.8],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[.4,.2,.6],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]},Wo=Array(3).fill("<percentage> | <number>[0, 255]"),Ho=Array(3).fill("<number>[0, 255]"),Uo=new sn({id:"srgb",name:"sRGB",base:qo,fromBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return r>.0031308?e*(1.055*Math.pow(r,1/2.4)-.055):12.92*t}))},toBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return r<=.04045?t/12.92:e*Math.pow((r+.055)/1.055,2.4)}))},formats:{rgb:{coords:Wo},rgb_number:{name:"rgb",commas:!0,coords:Ho,alpha:!1},color:{},rgba:{coords:Wo,commas:!0,alpha:!0},rgba_number:{name:"rgba",commas:!0,coords:Ho},hex:{type:"custom",toGamut:!0,test:function(t){return/^#(([a-f0-9]{2}){3,4}|[a-f0-9]{3,4})$/i.test(t)},parse:function(t){t.length<=5&&(t=t.replace(/[a-f0-9]/gi,"$&$&"));var e=[];return t.replace(/[a-f0-9]{2}/gi,(function(t){e.push(parseInt(t,16)/255)})),{spaceId:"srgb",coords:e.slice(0,3),alpha:e.slice(3)[0]}},serialize:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.collapse,o=void 0===n||n,a=r.alpha;(!1!==a&&e<1||!0===a)&&t.push(e),t=t.map((function(t){return Math.round(255*t)}));var i=o&&t.every((function(t){return t%17==0})),u=t.map((function(t){return i?(t/17).toString(16):t.toString(16).padStart(2,"0")})).join("");return"#"+u}},keyword:{type:"custom",test:function(t){return/^[a-z]+$/i.test(t)},parse:function(t){var e={spaceId:"srgb",coords:null,alpha:1};if("transparent"===(t=t.toLowerCase())?(e.coords=$o.black,e.alpha=0):e.coords=$o[t],e.coords)return e}}}}),Go=new sn({id:"p3",cssId:"display-p3",name:"P3",base:Fo,fromBase:Uo.fromBase,toBase:Uo.toBase});if(Xr.display_space=Uo,"undefined"!=typeof CSS&&CSS.supports)for(var Jo=0,Vo=[bn,Lo,Go];Jo<Vo.length;Jo++){var Xo=Vo[Jo],Ko=Xo.getMinCoords(),Yo=To({space:Xo,coords:Ko,alpha:1});if(CSS.supports("color",Yo)){Xr.display_space=Xo;break}}function Zo(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.space,n=void 0===r?Xr.display_space:r,o=lr(e,ar),a=To(t=an(t),o);if("undefined"==typeof CSS||CSS.supports("color",a)||!Xr.display_space)(a=new String(a)).color=t;else{var i,u=t,c=t.coords.some(Tr)||Tr(t.alpha);if(c)if(!(null!==(i=Do)&&void 0!==i?i:Do=CSS.supports("color","hsl(none 50% 50%)"))&&((u=Tn(t)).coords=u.coords.map(Dr),u.alpha=Dr(u.alpha),a=To(u,o),CSS.supports("color",a)))return(a=new String(a)).color=u,a;u=Io(u,n),(a=new String(To(u,o))).color=u}return a}function Qo(t,e){return Tr(t)||Tr(e)?t===e?null:0:t-e}function ta(t){return hn(t,[ln,"y"])}function ea(t,e){dn(t,[ln,"y"],e)}var ra=Object.freeze({__proto__:null,getLuminance:ta,register:function(t){Object.defineProperty(t.prototype,"luminance",{get:function(){return ta(this)},set:function(t){ea(this,t)}})},setLuminance:ea});function na(t){return t>=.022?t:t+Math.pow(.022-t,1.414)}function oa(t){var e=t<0?-1:1,r=Math.abs(t);return e*Math.pow(r,2.4)}var aa=24389/27,ia=Qr.D65,ua=new un({id:"lab-d65",name:"Lab D65",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:ia,base:ln,fromBase:function(t){var e=t.map((function(t,e){return t/ia[e]})).map((function(t){return t>216/24389?Math.cbrt(t):(aa*t+16)/116}));return[116*e[1]-16,500*(e[0]-e[1]),200*(e[1]-e[2])]},toBase:function(t){var e=[];return e[1]=(t[0]+16)/116,e[0]=t[1]/500+e[1],e[2]=e[1]-t[2]/200,[e[0]>24/116?Math.pow(e[0],3):(116*e[0]-16)/aa,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/aa,e[2]>24/116?Math.pow(e[2],3):(116*e[2]-16)/aa].map((function(t,e){return t*ia[e]}))},formats:{"lab-d65":{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <percentage>"]}}}),ca=.5*Math.pow(5,.5)+.5;var la=Object.freeze({__proto__:null,contrastAPCA:function(t,e){var r,n,o,a;e=an(e),t=an(t);var i=vr((e=Io(e,"srgb")).coords.map((function(t){return Tr(t)?0:t})),3);n=i[0],o=i[1],a=i[2];var u=.2126729*oa(n)+.7151522*oa(o)+.072175*oa(a),c=vr((t=Io(t,"srgb")).coords.map((function(t){return Tr(t)?0:t})),3);n=c[0],o=c[1],a=c[2];var l=.2126729*oa(n)+.7151522*oa(o)+.072175*oa(a),s=na(u),f=na(l),h=f>s;return r=Math.abs(f-s)<5e-4?0:h?1.14*(Math.pow(f,.56)-Math.pow(s,.57)):1.14*(Math.pow(f,.65)-Math.pow(s,.62)),100*(Math.abs(r)<.1?0:r>0?r-.027:r+.027)},contrastDeltaPhi:function(t,e){t=an(t),e=an(e);var r=hn(t,[ua,"l"]),n=hn(e,[ua,"l"]),o=Math.abs(Math.pow(r,ca)-Math.pow(n,ca)),a=Math.pow(o,1/ca)*Math.SQRT2-40;return a<7.5?0:a},contrastLstar:function(t,e){t=an(t),e=an(e);var r=hn(t,[bn,"l"]),n=hn(e,[bn,"l"]);return Math.abs(r-n)},contrastMichelson:function(t,e){t=an(t),e=an(e);var r=Math.max(ta(t),0),n=Math.max(ta(e),0);if(n>r){var o=[n,r];r=o[0],n=o[1]}var a=r+n;return 0===a?0:(r-n)/a},contrastWCAG21:function(t,e){t=an(t),e=an(e);var r=Math.max(ta(t),0),n=Math.max(ta(e),0);if(n>r){var o=[n,r];r=o[0],n=o[1]}return(r+.05)/(n+.05)},contrastWeber:function(t,e){t=an(t),e=an(e);var r=Math.max(ta(t),0),n=Math.max(ta(e),0);if(n>r){var o=[n,r];r=o[0],n=o[1]}return 0===n?5e4:(r-n)/n}});function sa(t){var e=vr(fn(t,ln),3),r=e[0],n=e[1],o=r+15*n+3*e[2];return[4*r/o,9*n/o]}function fa(t){var e=vr(fn(t,ln),3),r=e[0],n=e[1],o=r+n+e[2];return[r/o,n/o]}var ha=Object.freeze({__proto__:null,register:function(t){Object.defineProperty(t.prototype,"uv",{get:function(){return sa(this)}}),Object.defineProperty(t.prototype,"xy",{get:function(){return fa(this)}})},uv:sa,xy:fa});function pa(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Br(r)&&(r={method:r});var n=r,o=n.method,a=void 0===o?Xr.deltaE:o,i=lr(n,ur);for(var u in Ao)if("deltae"+a.toLowerCase()===u.toLowerCase())return Ao[u](t,e,i);throw new TypeError("Unknown deltaE method: ".concat(a))}function da(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,r=un.get("oklch","lch"),n=[r,"l"];return dn(t,n,(function(t){return t*(1+e)}))}function ga(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,r=un.get("oklch","lch"),n=[r,"l"];return dn(t,n,(function(t){return t*(1-e)}))}da.returns="color",ga.returns="color";var ya=Object.freeze({__proto__:null,darken:ga,lighten:da});function va(t,e,r){var n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=[an(t),an(e)];if(t=a[0],e=a[1],"object"===Rr(r)){var i=[.5,r];r=i[0],o=i[1]}var u=ma(t,e,o);return u(null!==(n=r)&&void 0!==n?n:.5)}function ba(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(wa(t)){n=e;var o=vr((r=t).rangeArgs.colors,2);t=o[0],e=o[1]}var a=n,i=a.maxDeltaE,u=a.deltaEMethod,c=a.steps,l=void 0===c?2:c,s=a.maxSteps,f=void 0===s?1e3:s,h=lr(a,cr);if(!r){var p=[an(t),an(e)];t=p[0],e=p[1],r=ma(t,e,h)}var d=pa(t,e),g=i>0?Math.max(l,Math.ceil(d/i)+1):l,y=[];if(void 0!==f&&(g=Math.min(g,f)),1===g)y=[{p:.5,color:r(.5)}];else{var v=1/(g-1);y=Array.from({length:g},(function(t,e){var n=e*v;return{p:n,color:r(n)}}))}if(i>0)for(var b=y.reduce((function(t,e,r){if(0===r)return 0;var n=pa(e.color,y[r-1].color,u);return Math.max(t,n)}),0);b>i;){b=0;for(var m=1;m<y.length&&y.length<f;m++){var w=y[m-1],M=y[m],k=(M.p+w.p)/2,S=r(k);b=Math.max(b,pa(S,w.color),pa(S,M.color)),y.splice(m,0,{p:k,color:r(k)}),m++}}return y=y.map((function(t){return t.color}))}function ma(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(wa(t)){var n=t,o=e;return ma.apply(void 0,hr(n.rangeArgs.colors).concat([dr(dr({},n.rangeArgs.options),o)]))}var a=r.space,i=r.outputSpace,u=r.progression,c=r.premultiplied;t=an(t),e=an(e),t=Tn(t),e=Tn(e);var l={colors:[t,e],options:r};if(a=a?un.get(a):un.registry[Xr.interpolationSpace]||t.space,i=i?un.get(i):a,t=Io(t,a),e=Io(e,a),t=Eo(t),e=Eo(e),a.coords.h&&"angle"===a.coords.h.type){var s=r.hue=r.hue||"shorter",f=[a,"h"],h=[hn(t,f),hn(e,f)],p=h[0],d=h[1];Tr(p)&&!Tr(d)?p=d:Tr(d)&&!Tr(p)&&(d=p);var g=wn(s,[p,d]),y=vr(g,2);p=y[0],d=y[1],dn(t,f,p),dn(e,f,d)}return c&&(t.coords=t.coords.map((function(e){return e*t.alpha})),e.coords=e.coords.map((function(t){return t*e.alpha}))),Object.assign((function(r){r=u?u(r):r;var n=t.coords.map((function(t,n){return Lr(t,e.coords[n],r)})),o=Lr(t.alpha,e.alpha,r),l={space:a,coords:n,alpha:o};return c&&(l.coords=l.coords.map((function(t){return t/o}))),i!==a&&(l=Io(l,i)),l}),{rangeArgs:l})}function wa(t){return"function"===Rr(t)&&!!t.rangeArgs}Xr.interpolationSpace="lab";var Ma=Object.freeze({__proto__:null,isRange:wa,mix:va,range:ma,register:function(t){t.defineFunction("mix",va,{returns:"color"}),t.defineFunction("range",ma,{returns:"function<color>"}),t.defineFunction("steps",ba,{returns:"array<color>"})},steps:ba}),ka=new un({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:Uo,fromBase:function(t){var e=Math.max.apply(Math,hr(t)),r=Math.min.apply(Math,hr(t)),n=vr(t,3),o=n[0],a=n[1],i=n[2],u=null,c=0,l=(r+e)/2,s=e-r;if(0!==s){switch(c=0===l||1===l?0:(e-l)/Math.min(l,1-l),e){case o:u=(a-i)/s+(a<i?6:0);break;case a:u=(i-o)/s+2;break;case i:u=(o-a)/s+4}u*=60}return c<0&&(u+=180,c=Math.abs(c)),u>=360&&(u-=360),[u,100*c,100*l]},toBase:function(t){var e=vr(t,3),r=e[0],n=e[1],o=e[2];function a(t){var e=(t+r/30)%12,a=n*Math.min(o,1-o);return o-a*Math.max(-1,Math.min(e-3,9-e,1))}return(r%=360)<0&&(r+=360),n/=100,o/=100,[a(0),a(8),a(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]},hsla:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"],commas:!0,alpha:!0}}}),Sa=new un({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:Uo,fromBase:function(t){var e=Math.max.apply(Math,hr(t)),r=Math.min.apply(Math,hr(t)),n=vr(t,3),o=n[0],a=n[1],i=n[2],u=null,c=0,l=e,s=e-r;if(0!==s){switch(e){case o:u=(a-i)/s+(a<i?6:0);break;case a:u=(i-o)/s+2;break;case i:u=(o-a)/s+4}u*=60}return l&&(c=s/l),u>=360&&(u-=360),[u,100*c,100*l]},toBase:function(t){var e=vr(t,3),r=e[0],n=e[1],o=e[2];function a(t){var e=(t+r/60)%6;return o-o*n*Math.max(0,Math.min(e,4-e,1))}return(r%=360)<0&&(r+=360),n/=100,o/=100,[a(5),a(3),a(1)]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),Oa=new un({id:"hwb",name:"HWB",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},w:{range:[0,100],name:"Whiteness"},b:{range:[0,100],name:"Blackness"}},base:Sa,fromBase:function(t){var e=vr(t,3),r=e[0],n=e[1],o=e[2];return[r,o*(100-n)/100,100-o]},toBase:function(t){var e=vr(t,3),r=e[0],n=e[1],o=e[2],a=(n/=100)+(o/=100);if(a>=1)return[r,0,100*(n/a)];var i=1-o;return[r,100*(0===i?0:1-n/i),100*i]},formats:{hwb:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),ja=new sn({id:"a98rgb-linear",cssId:"--a98-rgb-linear",name:"Linear Adobe® 98 RGB compatible",white:"D65",toXYZ_M:[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],fromXYZ_M:[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]]}),xa=new sn({id:"a98rgb",cssId:"a98-rgb",name:"Adobe® 98 RGB compatible",base:ja,toBase:function(t){return t.map((function(t){return Math.pow(Math.abs(t),563/256)*Math.sign(t)}))},fromBase:function(t){return t.map((function(t){return Math.pow(Math.abs(t),256/563)*Math.sign(t)}))}}),Ca=new sn({id:"prophoto-linear",cssId:"--prophoto-rgb-linear",name:"Linear ProPhoto",white:"D50",base:gn,toXYZ_M:[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],fromXYZ_M:[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]]}),Aa=new sn({id:"prophoto",cssId:"prophoto-rgb",name:"ProPhoto",base:Ca,toBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return r<16/512?t/16:e*Math.pow(r,1.8)}))},fromBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return r>=1/512?e*Math.pow(r,1/1.8):16*t}))}}),_a=1.09929682680944,Pa=.018053968510807,Ea=new sn({id:"--rec2020-oetf",name:"REC.2020_Scene_Referred",base:No,referred:"scene",toBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return r<4.5*Pa?t/4.5:e*Math.pow((r+_a-1)/_a,1/.45)}))},fromBase:function(t){return t.map((function(t){var e=t<0?-1:1,r=t*e;return r>=Pa?e*(_a*Math.pow(r,.45)-(_a-1)):4.5*t}))}}),Ba=new un({id:"oklch",name:"OkLCh",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:Bn,fromBase:Mn.fromBase,toBase:Mn.toBase,formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}}),Ra=2*Math.PI,Ia=[[4.076741636075958,-3.307711539258063,.2309699031821043],[-1.2684379732850315,2.609757349287688,-.341319376002657],[-.0041960761386756,-.7034186179359362,1.7076146940746117]],Ta=[[[-1.8817031,-.80936501],[1.19086277,1.76576728,.59662641,.75515197,.56771245]],[[1.8144408,-1.19445267],[.73956515,-.45954404,.08285427,.12541073,-.14503204]],[[.13110758,1.81333971],[1.35733652,-.00915799,-1.1513021,-.50559606,.00692167]]],Da=Number.MAX_VALUE,Na=.206,La=(1+Na)/1.03;function Fa(t,e){var r=t.length;if(r!==e.length)throw new Error("Vectors of size ".concat(r," and ").concat(e.length," are not aligned"));var n=0;return t.forEach((function(t,r){n+=t*e[r]})),n}function za(t){return.5*(La*t-Na+Math.sqrt((La*t-Na)*(La*t-Na)+.12*La*t))}function qa(t){return(Math.pow(t,2)+Na*t)/(La*(t+.03))}function $a(t){var e=vr(t,2),r=e[0],n=e[1];return[n/r,n/(1-r)]}function Wa(t,e){var r=Er(t,En);return r[0]=Math.pow(r[0],3),r[1]=Math.pow(r[1],3),r[2]=Math.pow(r[2],3),Er(r,e,r)}function Ha(t,e,r,n){var o=function(t,e,r,n){var o,a,i,u,c,l,s,f;if(Fa(n[0][0],[t,e])>1){var h=vr(n[0][1],5);o=h[0],a=h[1],i=h[2],u=h[3],c=h[4];var p=vr(r[0],3);l=p[0],s=p[1],f=p[2]}else if(Fa(n[1][0],[t,e])>1){var d=vr(n[1][1],5);o=d[0],a=d[1],i=d[2],u=d[3],c=d[4];var g=vr(r[1],3);l=g[0],s=g[1],f=g[2]}else{var y=vr(n[2][1],5);o=y[0],a=y[1],i=y[2],u=y[3],c=y[4];var v=vr(r[2],3);l=v[0],s=v[1],f=v[2]}var b=o+a*t+i*e+u*Math.pow(t,2)+c*t*e,m=Fa(En[0].slice(1),[t,e]),w=Fa(En[1].slice(1),[t,e]),M=Fa(En[2].slice(1),[t,e]),k=1+b*m,S=1+b*w,O=1+b*M,j=Math.pow(k,3),x=Math.pow(S,3),C=Math.pow(O,3),A=3*m*Math.pow(k,2),_=3*w*Math.pow(S,2),P=3*M*Math.pow(O,2),E=6*Math.pow(m,2)*k,B=6*Math.pow(w,2)*S,R=6*Math.pow(M,2)*O,I=l*j+s*x+f*C,T=l*A+s*_+f*P,D=l*E+s*B+f*R;return b-=I*T/(Math.pow(T,2)-.5*I*D)}(t,e,r,n),a=Wa([1,o*t,o*e],r),i=Wr(1/Math.max.apply(Math,hr(a)),1/3);return[i,i*o]}function Ua(t,e,r){var n=vr(t,3),o=n[0],a=n[1],i=n[2],u=Ha(a,i,e,r),c=function(t,e,r,n,o,a,i,u){var c;if(void 0===u&&(u=Ha(t,e,a,i)),(r-o)*u[1]-(u[0]-o)*n<=0)c=u[1]*o/(n*u[0]+u[1]*(o-r));else{c=u[1]*(o-1)/(n*(u[0]-1)+u[1]*(o-r));var l=r-o,s=n,f=Fa(En[0].slice(1),[t,e]),h=Fa(En[1].slice(1),[t,e]),p=Fa(En[2].slice(1),[t,e]),d=l+s*f,g=l+s*h,y=l+s*p,v=o*(1-c)+c*r,b=c*n,m=v+b*f,w=v+b*h,M=v+b*p,k=Math.pow(m,3),S=Math.pow(w,3),O=Math.pow(M,3),j=3*d*Math.pow(m,2),x=3*g*Math.pow(w,2),C=3*y*Math.pow(M,2),A=6*Math.pow(d,2)*m,_=6*Math.pow(g,2)*w,P=6*Math.pow(y,2)*M,E=Fa(a[0],[k,S,O])-1,B=Fa(a[0],[j,x,C]),R=B/(B*B-.5*E*Fa(a[0],[A,_,P])),I=-E*R,T=Fa(a[1],[k,S,O])-1,D=Fa(a[1],[j,x,C]),N=D/(D*D-.5*T*Fa(a[1],[A,_,P])),L=-T*N,F=Fa(a[2],[k,S,O])-1,z=Fa(a[2],[j,x,C]),q=z/(z*z-.5*F*Fa(a[2],[A,_,P])),$=-F*q;I=R>=0?I:Da,L=N>=0?L:Da,$=q>=0?$:Da,c+=Math.min(I,Math.min(L,$))}return c}(a,i,o,1,o,e,r,u),l=$a(u),s=c/Math.min(o*l[0],(1-o)*l[1]),f=function(t,e){return[.11516993+1/(7.4477897+4.1590124*e+t*(1.75198401*e-2.19557347+t*(-2.13704948-10.02301043*e+t*(5.38770819*e-4.24894561+4.69891013*t)))),.11239642+1/(1.6132032-.68124379*e+t*(.40370612+.90148123*e+t*(.6122399*e-.27087943+t*(.00299215-.45399568*e-.14661872*t))))]}(a,i),h=o*f[0],p=(1-o)*f[1],d=.9*s*Math.sqrt(Math.sqrt(1/(1/Math.pow(h,4)+1/Math.pow(p,4))));return h=.4*o,p=.8*(1-o),[Math.sqrt(1/(1/Math.pow(h,2)+1/Math.pow(p,2))),d,c]}var Ga=new un({id:"okhsl",name:"Okhsl",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,1],name:"Saturation"},l:{range:[0,1],name:"Lightness"}},base:Bn,gamutSpace:"self",fromBase:function(t){return function(t,e,r){var n=t[0],o=0,a=za(n),i=Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),u=.5+Math.atan2(-t[2],-t[1])/Ra;if(0!==a&&1!==a&&0!==i){var c,l,s=vr(Ua([n,t[1]/i,t[2]/i],e,r),3),f=s[0],h=s[1],p=s[2];o=i<h?.8*(i/((l=.8*f)+(1-l/h)*i)):.8+.2*((i-(c=h))/((l=.2*Math.pow(h,2)*Math.pow(1.25,2)/f)+(1-l/(p-h))*(i-c)))}var d=Math.abs(o)<1e-4;return d||0===a||Math.abs(1-a)<1e-7?(u=null,d||(o=0)):u=mn(360*u),[u,o,a]}(t,Ia,Ta)},toBase:function(t){return function(t,e,r){var n=vr(t,3),o=n[0],a=n[1],i=qa(n[2]),u=null,c=null;if(o=mn(o)/360,0!==i&&1!==i&&0!==a){var l,s,f,h,p=Math.cos(Ra*o),d=Math.sin(Ra*o),g=vr(Ua([i,p,d],e,r),3),y=g[0],v=g[1],b=g[2];a<.8?(l=1.25*a,s=0,h=1-(f=.8*y)/v):(l=5*(a-.8),s=v,h=1-(f=.2*Math.pow(v,2)*Math.pow(1.25,2)/y)/(b-v));var m=s+l*f/(1-h*l);u=m*p,c=m*d}return[i,u,c]}(t,Ia,Ta)},formats:{color:{id:"--okhsl",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),Ja=new un({id:"oklrab",name:"Oklrab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Bn,fromBase:function(t){return[za(t[0]),t[1],t[2]]},toBase:function(t){return[qa(t[0]),t[1],t[2]]},formats:{color:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),Va=new un({id:"oklrch",name:"Oklrch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:Ja,fromBase:Mn.fromBase,toBase:Mn.toBase,formats:{color:{coords:["<percentage> | <number>","<number> | <percentage>[0,1]","<number> | <angle>"]}}});var Xa=new un({id:"okhsv",name:"Okhsv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,1],name:"Saturation"},v:{range:[0,1],name:"Value"}},base:Bn,gamutSpace:"self",fromBase:function(t){return function(t,e,r){var n=t[0],o=0,a=za(n),i=Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),u=.5+Math.atan2(-t[2],-t[1])/Ra;if(0!==n&&1!==n&&0!==i){var c=t[1]/i,l=t[2]/i,s=vr($a(Ha(c,l,e,r)),2),f=s[0],h=s[1],p=1-.5/f,d=h/(i+n*h),g=d*n,y=d*i,v=qa(g),b=y*v/g,m=vr(Wa([v,c*b,l*b],e),3),w=m[0],M=m[1],k=m[2],S=Wr(1/Math.max(Math.max(w,M),Math.max(k,0)),1/3);i=(i/=S)*za(n/=S)/n,a=(n=za(n))/g,o=(.5+h)*y/(.5*h+h*p*y)}return[u=Math.abs(o)<1e-4||0===a?null:mn(360*u),o,a]}(t,Ia,Ta)},toBase:function(t){return function(t,e,r){var n=vr(t,3),o=n[0],a=n[1],i=n[2];o=mn(o)/360;var u=qa(i),c=null,l=null;if(0!==u&&0!==a){var s=Math.cos(Ra*o),f=Math.sin(Ra*o),h=vr($a(Ha(s,f,e,r)),2),p=h[0],d=h[1],g=1-.5/p,y=1-.5*a/(.5+d-d*g*a),v=a*d*.5/(.5+d-d*g*a);u=i*y;var b=i*v,m=qa(y),w=v*m/y,M=qa(u);b=b*M/u,u=M;var k=vr(Wa([m,s*w,f*w],e),3),S=k[0],O=k[1],j=k[2],x=Wr(1/Math.max(Math.max(S,O),Math.max(j,0)),1/3);u*=x,c=(b*=x)*s,l=b*f}return[u,c,l]}(t,Ia,Ta)},formats:{color:{id:"--okhsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),Ka=Qr.D65,Ya=vr(sa({space:ln,coords:Ka}),2),Za=Ya[0],Qa=Ya[1],ti=new un({id:"luv",name:"Luv",coords:{l:{refRange:[0,100],name:"Lightness"},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:Ka,base:ln,fromBase:function(t){var e=[Dr(t[0]),Dr(t[1]),Dr(t[2])],r=e[1],n=vr(sa({space:ln,coords:e}),2),o=n[0],a=n[1];if(!Number.isFinite(o)||!Number.isFinite(a))return[0,0,0];var i=r<=216/24389?24389/27*r:116*Math.cbrt(r)-16;return[i,13*i*(o-Za),13*i*(a-Qa)]},toBase:function(t){var e=vr(t,3),r=e[0],n=e[1],o=e[2];if(0===r||Tr(r))return[0,0,0];n=Dr(n),o=Dr(o);var a=n/(13*r)+Za,i=o/(13*r)+Qa,u=r<=8?r/(24389/27):Math.pow((r+16)/116,3);return[u*(9*a/(4*i)),u,u*((12-3*a-20*i)/(4*i))]},formats:{color:{id:"--luv",coords:["<number> | <percentage>","<number> | <percentage>","<number> | <percentage>"]}}}),ei=new un({id:"lchuv",name:"LChuv",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,220],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:ti,fromBase:Mn.fromBase,toBase:Mn.toBase,formats:{color:{id:"--lchuv",coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}}),ri=zo[0][0],ni=zo[0][1],oi=zo[0][2],ai=zo[1][0],ii=zo[1][1],ui=zo[1][2],ci=zo[2][0],li=zo[2][1],si=zo[2][2];function fi(t,e,r){var n=e/(Math.sin(r)-t*Math.cos(r));return n<0?1/0:n}function hi(t){var e=Math.pow(t+16,3)/1560896,r=e>216/24389?e:t/(24389/27),n=r*(284517*ri-94839*oi),o=r*(838422*oi+769860*ni+731718*ri),a=r*(632260*oi-126452*ni),i=r*(284517*ai-94839*ui),u=r*(838422*ui+769860*ii+731718*ai),c=r*(632260*ui-126452*ii),l=r*(284517*ci-94839*si),s=r*(838422*si+769860*li+731718*ci),f=r*(632260*si-126452*li);return{r0s:n/a,r0i:o*t/a,r1s:n/(a+126452),r1i:(o-769860)*t/(a+126452),g0s:i/c,g0i:u*t/c,g1s:i/(c+126452),g1i:(u-769860)*t/(c+126452),b0s:l/f,b0i:s*t/f,b1s:l/(f+126452),b1i:(s-769860)*t/(f+126452)}}function pi(t,e){var r=e/360*Math.PI*2,n=fi(t.r0s,t.r0i,r),o=fi(t.r1s,t.r1i,r),a=fi(t.g0s,t.g0i,r),i=fi(t.g1s,t.g1i,r),u=fi(t.b0s,t.b0i,r),c=fi(t.b1s,t.b1i,r);return Math.min(n,o,a,i,u,c)}var di=new un({id:"hsluv",name:"HSLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:ei,gamutSpace:Uo,fromBase:function(t){var e,r=[Dr(t[0]),Dr(t[1]),Dr(t[2])],n=r[0],o=r[2];if(n>99.9999999)e=0,n=100;else if(n<1e-8)e=0,n=0;else{e=r[1]/pi(hi(n),o)*100}return[o,e,n]},toBase:function(t){var e,r=[Dr(t[0]),Dr(t[1]),Dr(t[2])],n=r[0],o=r[1],a=r[2];if(a>99.9999999)a=100,e=0;else if(a<1e-8)a=0,e=0;else{e=pi(hi(a),n)/100*o}return[a,e,n]},formats:{color:{id:"--hsluv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});function gi(t,e){return Math.abs(e)/Math.sqrt(Math.pow(t,2)+1)}function yi(t){var e=gi(t.r0s,t.r0i),r=gi(t.r1s,t.r1i),n=gi(t.g0s,t.g0i),o=gi(t.g1s,t.g1i),a=gi(t.b0s,t.b0i),i=gi(t.b1s,t.b1i);return Math.min(e,r,n,o,a,i)}zo[0][0],zo[0][1],zo[0][2],zo[1][0],zo[1][1],zo[1][2],zo[2][0],zo[2][1],zo[2][2];var vi=new un({id:"hpluv",name:"HPLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:ei,gamutSpace:"self",fromBase:function(t){var e,r=[Dr(t[0]),Dr(t[1]),Dr(t[2])],n=r[0],o=r[2];if(n>99.9999999)e=0,n=100;else if(n<1e-8)e=0,n=0;else{e=r[1]/yi(hi(n))*100}return[o,e,n]},toBase:function(t){var e,r=[Dr(t[0]),Dr(t[1]),Dr(t[2])],n=r[0],o=r[1],a=r[2];if(a>99.9999999)a=100,e=0;else if(a<1e-8)a=0,e=0;else{e=yi(hi(a))/100*o}return[a,e,n]},formats:{color:{id:"--hpluv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),bi=new sn({id:"rec2100-linear",name:"Linear REC.2100",white:"D65",toBase:No.toBase,fromBase:No.fromBase}),mi=2610/Math.pow(2,14),wi=Math.pow(2,14)/2610,Mi=2523/Math.pow(2,5),ki=Math.pow(2,5)/2523,Si=3424/Math.pow(2,12),Oi=2413/Math.pow(2,7),ji=2392/Math.pow(2,7),xi=new sn({id:"rec2100pq",cssId:"rec2100-pq",name:"REC.2100-PQ",base:bi,toBase:function(t){return t.map((function(t){return 1e4*Math.pow(Math.max(Math.pow(t,ki)-Si,0)/(Oi-ji*Math.pow(t,ki)),wi)/203}))},fromBase:function(t){return t.map((function(t){var e=Math.max(203*t/1e4,0),r=Si+Oi*Math.pow(e,mi),n=1+ji*Math.pow(e,mi);return Math.pow(r/n,Mi)}))}}),Ci=new sn({id:"rec2100hlg",cssId:"rec2100-hlg",name:"REC.2100-HLG",referred:"scene",base:bi,toBase:function(t){return t.map((function(t){return t<=.5?Math.pow(t,2)/3*3.7743:(Math.exp((t-.55991073)/.17883277)+.28466892)/12*3.7743}))},fromBase:function(t){return t.map((function(t){return(t/=3.7743)<=1/12?Wr(3*t,.5):.17883277*Math.log(12*t-.28466892)+.55991073}))}}),Ai={};function _i(t){var e=t.id;t.toCone_M,t.fromCone_M;Ai[e]=arguments[0]}function Pi(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Bradford",n=Ai[r],o=_r(n.toCone_M,t),a=vr(o,3),i=a[0],u=a[1],c=a[2],l=_r(n.toCone_M,e),s=vr(l,3),f=s[0],h=s[1],p=s[2],d=[[f/i,0,0],[0,h/u,0],[0,0,p/c]],g=_r(d,n.toCone_M),y=_r(n.fromCone_M,g);return y}Vr.add("chromatic-adaptation-start",(function(t){t.options.method&&(t.M=Pi(t.W1,t.W2,t.options.method))})),Vr.add("chromatic-adaptation-end",(function(t){t.M||(t.M=Pi(t.W1,t.W2,t.options.method))})),_i({id:"von Kries",toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]}),_i({id:"Bradford",toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]}),_i({id:"CAT02",toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]}),_i({id:"CAT16",toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]}),Object.assign(Qr,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]}),Qr.ACES=[.32168/.33767,1,.34065/.33767];var Ei=new sn({id:"acescg",cssId:"--acescg",name:"ACEScg",coords:{r:{range:[0,65504],name:"Red"},g:{range:[0,65504],name:"Green"},b:{range:[0,65504],name:"Blue"}},referred:"scene",white:Qr.ACES,toXYZ_M:[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],fromXYZ_M:[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]]}),Bi=Math.pow(2,-16),Ri=(Math.log2(65504)+9.72)/17.52,Ii=new sn({id:"acescc",cssId:"--acescc",name:"ACEScc",coords:{r:{range:[-.35828683,Ri],name:"Red"},g:{range:[-.35828683,Ri],name:"Green"},b:{range:[-.35828683,Ri],name:"Blue"}},referred:"scene",base:Ei,toBase:function(t){return t.map((function(t){return t<=(9.72-15)/17.52?2*(Math.pow(2,17.52*t-9.72)-Bi):t<Ri?Math.pow(2,17.52*t-9.72):65504}))},fromBase:function(t){return t.map((function(t){return t<=0?(Math.log2(Bi)+9.72)/17.52:t<Bi?(Math.log2(Bi+.5*t)+9.72)/17.52:(Math.log2(t)+9.72)/17.52}))}}),Ti=Object.freeze({__proto__:null,A98RGB:xa,A98RGB_Linear:ja,ACEScc:Ii,ACEScg:Ei,CAM16_JMh:mo,HCT:Oo,HPLuv:vi,HSL:ka,HSLuv:di,HSV:Sa,HWB:Oa,ICTCP:no,JzCzHz:Zn,Jzazbz:Yn,LCH:Mn,LCHuv:ei,Lab:bn,Lab_D65:ua,Luv:ti,OKLCH:Ba,OKLab:Bn,OKLrCH:Va,OKLrab:Ja,Okhsl:Ga,Okhsv:Xa,P3:Go,P3_Linear:Fo,ProPhoto:Aa,ProPhoto_Linear:Ca,REC_2020:Lo,REC_2020_Linear:No,REC_2020_Scene_Referred:Ea,REC_2100_HLG:Ci,REC_2100_Linear:bi,REC_2100_PQ:xi,XYZ_ABS_D65:Ln,XYZ_D50:gn,XYZ_D65:ln,sRGB:Uo,sRGB_Linear:qo}),Di=function(){function t(){var e,r,n,o,a=this;Sr(this,t);for(var i=arguments.length,u=new Array(i),c=0;c<i;c++)u[c]=arguments[c];if(1===u.length){var l={};"object"===Mr(u[0])&&Object.getPrototypeOf(u[0]).constructor===Object&&(u[0]=dr({},u[0])),e=an(u[0],{parseMeta:l}),l.format&&(this.parseMeta=l)}e?(r=e.space||e.spaceId,n=e.coords,o=e.alpha):(r=u[0],n=u[1],o=u[2]),Object.defineProperty(this,"space",{value:un.get(r),writable:!1,enumerable:!0,configurable:!0}),this.coords=n?n.slice():[0,0,0],this.alpha=Tr(o)?o:void 0===o?1:qr(0,o,1);var s=function(t){Object.defineProperty(a,t,{get:function(){return a.get(t)},set:function(e){return a.set(t,e)}})};for(var f in this.space.coords)s(f)}return jr(t,[{key:"spaceId",get:function(){return this.space.id}},{key:"clone",value:function(){return new t(this.space,this.coords,this.alpha)}},{key:"toJSON",value:function(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}},{key:"display",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var o=Zo.apply(void 0,[this].concat(r));return o.color=new t(o.color),o}}],[{key:"get",value:function(e){if(Gr(e,this))return e;for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return gr(t,[e].concat(n))}},{key:"try",value:function(e,r){if(Gr(e,this))return e;var n=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(e))return e.map((function(e){return t(e,r)}));var n=r.cssProperty,o=void 0===n?"background-color":n,a=r.element,i=lr(r,or),u=null;try{return an(e,i)}catch(t){u=t}var c=globalThis.CSS,l=globalThis.getComputedStyle;if(Br(e)&&a&&c&&l&&c.supports(o,e)){var s=a.style[o];e!==s&&(a.style[o]=e);var f=l(a).getPropertyValue(o);if(e!==s&&(a.style[o]=s),f!==e)try{return an(f,i)}catch(t){u=t}else u={message:"Color value is a valid CSS color, but it could not be resolved :("}}return r.errorMeta&&(r.errorMeta.error=u),null}(e,r);return n?new t(n):null}},{key:"defineFunction",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r,o=n.instance,a=void 0===o||o,i=n.returns,u=function(){var e=r.apply(void 0,arguments);if("color"===i)e=t.get(e);else if("function<color>"===i){var n=e;e=function(){var e=n.apply(void 0,arguments);return t.get(e)},Object.assign(e,n)}else"array<color>"===i&&(e=e.map((function(e){return t.get(e)})));return e};e in t||(t[e]=u),a&&(t.prototype[e]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return u.apply(void 0,[this].concat(e))})}},{key:"defineFunctions",value:function(e){for(var r in e)t.defineFunction(r,e[r],e[r])}},{key:"extend",value:function(e){if(e.register)e.register(t);else for(var r in e)t.defineFunction(r,e[r])}}]),t}();Di.defineFunctions({get:hn,getAll:fn,set:dn,setAll:pn,to:Io,equals:function(t,e){return t=an(t),e=an(e),t.space===e.space&&t.alpha===e.alpha&&t.coords.every((function(t,r){return t===e.coords[r]}))},inGamut:In,toGamut:Eo,distance:Dn,deltas:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.space,o=r.hue,a=void 0===o?"shorter":o;t=an(t),n||(n=t.space),n=un.get(n);var i=Object.values(n.coords),u=[t,e].map((function(t){return Io(t,n)})),c=vr(u,2),l=[t=c[0],e=c[1]].map((function(t){return t.coords})),s=vr(l,2),f=s[0],h=s[1],p=f.map((function(t,e){var r=i[e],n=h[e];if("angle"===r.type){var o=vr(wn(a,[t,n]),2);t=o[0],n=o[1]}return Qo(t,n)})),d=Qo(t.alpha,e.alpha);return{space:n,coords:p,alpha:d}},toString:To}),Object.assign(Di,{util:Jr,hooks:Vr,WHITES:Qr,Space:un,spaces:un.registry,parse:rn,defaults:Xr});for(var Ni=0,Li=Object.keys(Ti);Ni<Li.length;Ni++){var Fi=Li[Ni];un.register(Ti[Fi])}for(var zi in un.registry)qi(zi,un.registry[zi]);function qi(t,e){var r=t.replace(/-/g,"_");Object.defineProperty(Di.prototype,r,{get:function(){var r=this,n=this.getAll(t);if("undefined"==typeof Proxy)return n;var o=new Proxy(n,{has:function(t,r){try{return un.resolveCoord([e,r]),!0}catch(t){}return Reflect.has(t,r)},get:function(t,r,n){if(r&&"symbol"!==Mr(r)&&!(r in t)&&r in o){var a=un.resolveCoord([e,r]).index;if(a>=0)return t[a]}return Reflect.get(t,r,n)},set:function(n,o,a,i){if(o&&"symbol"!==Mr(o)&&!(o in n)||Number(o)>=0){var u=un.resolveCoord([e,o]).index;if(u>=0)return n[u]=a,r.setAll(t,n),!0}return Reflect.set(n,o,a,i)}});return o},set:function(e){this.setAll(t,e)},configurable:!0,enumerable:!0})}function $i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Wi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$i(Object(r),!0).forEach((function(e){Hi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Hi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Vr.add("colorspace-init-end",(function(t){var e;qi(t.id,t),null===(e=t.aliases)||void 0===e||e.forEach((function(e){qi(e,t)}))})),Di.extend(Ao),Di.extend({deltaE:pa}),Object.assign(Di,{deltaEMethods:Ao}),Di.extend(ya),Di.extend({contrast:function(t,e,r){Br(r)&&(r={algorithm:r});var n=r||{},o=n.algorithm,a=lr(n,ir);if(!o){var i=Object.keys(la).map((function(t){return t.replace(/^contrast/,"")})).join(", ");throw new TypeError("contrast() function needs a contrast algorithm. Please specify one of: ".concat(i))}for(var u in t=an(t),e=an(e),la)if("contrast"+o.toLowerCase()===u.toLowerCase())return la[u](t,e,a);throw new TypeError("Unknown contrast algorithm: ".concat(o))}}),Di.extend(ha),Di.extend(ra),Di.extend(Ma),Di.extend(la);var Ui=Wi(Wi({},Q),{},{windowtext:[0,0,0],transparent:[255,255,255,0]}),Gi=new RegExp(Object.keys(Ui).map((function(t){return"\\b".concat(t,"\\b")})).join("|"),"ig"),Ji=function(t){var e=t.object();return e.a=e.alpha||1,delete e.alpha,e},Vi=function(t){return t.alpha=t.a,delete t.a,Xi(t)},Xi=function t(e){var r=null;try{r=e instanceof le?e:le(e)}catch(n){try{r=t(new Di(e).to("srgb").toString())}catch(t){console.log("ignore the invalid color: `".concat(e,"`"))}}return r},Ki=function(t,e){return t.replace(b,"").replace(Gi,(function(t){if(!e&&"transparent"===t)return t;var r=Ui[t.toLowerCase()];return"".concat(r.length>3?"rgba":"rgb","(").concat(r.toString(),")")}))},Yi=function(t){var e=Ki(t);return M.test(e)?e:""},Zi=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mix";if("[object Array]"!==Object.prototype.toString.call(t)||t.length<1)return null;if(1===t.length)return t[0];for(var r=Xi(t.shift()),o=Xi(t.shift());o;){if(!r&&o)r=o;else if(r||o)r&&o&&(r="mix"===e?r.mix(o,o.alpha()):Vi(n[e](Ji(r),Ji(o))));else{if(0===t.length)break;r=Xi(t.shift())}if(0===t.length)break;o=Xi(t.shift())}return r||null},Qi=function(t){return(299*t[0]+587*t[1]+114*t[2])/1e3},tu=function(t,e){var r=t/Qi(e),n=Math.min(255,e[0]*r),o=Math.min(255,e[1]*r),a=Math.min(255,e[2]*r);return 0===o||255===n||255===a?o=(1e3*t-299*n-114*a)/587:0===n?n=(1e3*t-587*o-114*a)/299:0!==a&&255!==o||(a=(1e3*t-299*n-587*o)/114),le.rgb(n,o,a)};function eu(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}(t,e)||nu(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ru(t){return function(t){if(Array.isArray(t))return ou(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||nu(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nu(t,e){if(t){if("string"==typeof t)return ou(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ou(t,e):void 0}}function ou(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function au(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function iu(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var uu=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),iu(this,"_idx",0),iu(this,"_defaultDarkTextColorRgb",null),iu(this,"_defaultDarkBgColorRgb",null),iu(this,"_defaultDarkBgColorHSL",null),iu(this,"_defaultDarkTextColorBrightness",null),iu(this,"_defaultDarkBgColorBrightness",null),iu(this,"_defaultDarkBgColorHslBrightness",null),iu(this,"_maxLimitOffsetBrightness",null),iu(this,"isDarkmode",!1)}var e,r,n;return e=t,(r=[{key:"_adjustBrightness",value:function(t,e,r,n,o){var a,i=t.alpha(),u="";if(r.isBgColor){if(i>=.05&&(e[h]&&delete e[h],e[p])){if(e[p]===t.toString()||this.getContrast(e[p],t.toString())<1.1)return{newColor:o?t.toString():"",extStyle:u};V(e).forEach((function(t){delete t[p]}))}if(a=this._adjustBackgroundBrightness(t),!r.hasInlineColor){var f=e[s]||S.defaultLightTextColor,d=Xi(f);if(d){var g=this._adjustBrightness(d,e,{isTextColor:!0,parentElementBgColorStr:a||t},n,o);u+=fu.genCssKV("color",g.newColor||d),V(e).forEach((function(t){t[c]=g.newColor||d,t[s]=d}))}}}else if(r.isTextColor||r.isBorderColor){var y=r.parentElementBgColorStr||r.isTextColor&&e[l]||S.defaultDarkBgColor,v=Xi(y);if(v&&!e[h]){a=this._adjustTextBrightness(t,v);var b="";n?b="ByUpdateStyle":o&&(b="ByReset"),cu.emit("afterConvertTextColor".concat(b),e,{fontColor:a,bgColor:v})}}else r.isTextShadow&&(e[h]||(a=this._adjustBackgroundBrightness(t)));return{newColor:a&&t.toString()!==a.toString()&&a.alpha(i).rgb(),extStyle:u}}},{key:"_adjustTextBrightness",value:function(t,e){var r=e.rgb().array(),n=e.alpha(),o=Qi(r)*n+this._defaultDarkBgColorBrightness*(1-n),a=t.rgb().array(),i=t.hsl().array(),u=t.alpha(),c=Qi(a),l=Math.abs(o-c);if(c>=250)return t;if(l>this._maxLimitOffsetBrightness&&o<=this._defaultDarkBgColorBrightness+2)return tu(this._maxLimitOffsetBrightness+o,a).alpha(u);if(l>=65)return t;if(o>=100){if(i[2]>50){i[2]=90-i[2];var s=le.hsl.apply(le,ru(i)).alpha(u);return this._adjustTextBrightness(s,e)}return tu(Math.min(this._maxLimitOffsetBrightness,o-65),a).alpha(u)}if(i[2]<=40){i[2]=90-i[2];var f=le.hsl.apply(le,ru(i)).alpha(u);return this._adjustTextBrightness(f,e)}return tu(Math.min(this._maxLimitOffsetBrightness,o+65),a).alpha(u)}},{key:"_adjustBackgroundBrightness",value:function(t){var e=t.rgb().array(),r=t.hsl().array(),n=t.alpha(),o=Qi(e),a=t;return 0===r[1]&&r[2]>40||o>250?a=le.hsl(0,0,Math.min(100,100+this._defaultDarkBgColorHslBrightness-r[2])):o>190?a=tu(190,e).alpha(n):r[2]<22&&(r[2]=22,a=le.hsl.apply(le,ru(r))),a.alpha(n).rgb()}},{key:"_updateBgWithGradient",value:function(t,e,r,n,o,a,i){var u=Zi([e[l]||S.defaultDarkBgColor,t],"normal"),c=(e[f]||S.defaultLightBgColor).split("|").concat(t.toString()).join("|");V(e).forEach((function(t){t[l]=u,t[f]=c}));var s=n.slice(-1)[0];if("color"===s[0]){var h=this._adjustBrightness(Xi(Ki(s[1])),e,{isBgColor:!1,isTextShadow:!1,isTextColor:!0,isBorderColor:!1,hasInlineColor:o},a,i);if(h.newColor)return fu.genCss(r,fu.genCssKV("color",h.newColor))}return""}},{key:"_try",value:function(t){try{return t()}catch(t){console.log("An error occurred when running the dark mode conversion algorithm\n",t),"function"==typeof S.error&&S.error(t)}}},{key:"init",value:function(){this._defaultDarkTextColorRgb=Xi(S.defaultDarkTextColor).rgb().array(),this._defaultDarkBgColorRgb=Xi(S.defaultDarkBgColor).rgb().array(),this._defaultDarkBgColorHSL=Xi(S.defaultDarkBgColor).hsl().array(),this._defaultDarkTextColorBrightness=Qi(this._defaultDarkTextColorRgb),this._defaultDarkBgColorBrightness=Qi(this._defaultDarkBgColorRgb),this._defaultDarkBgColorHslBrightness=this._defaultDarkBgColorHSL[2],this._maxLimitOffsetBrightness=this._defaultDarkTextColorBrightness-this._defaultDarkBgColorBrightness}},{key:"convert",value:function(t,e,r,n){var o=this;cu.resetCss();var i="";r?i="ByUpdateStyle":n&&(i="ByReset"),cu.emit("beforeConvertNode".concat(i),t);var u="",d="";if(this.isDarkmode||r||n){var w=t.nodeName;if(S.whitelist.tagName.indexOf(w)>-1)return"";if(S.whitelist.attribute.some((function(e){return t.hasAttribute(e)})))return"";var O=t.style;e||(e=(O.cssText&&O.cssText.replace(/("[^;]*);([^;]*")|('[^;]*);([^;]*')/g,"$1$3".concat("<$#_SEMICOLON_#$>","$2$4")).split(";")||[]).map((function(t){var e=t.indexOf(":");return[t.slice(0,e).toLowerCase(),t.slice(e+1).replace(m,";")].map((function(t){return(t||"").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}))})));var j=!1,x=!1,C=!1,A=null,_=null;e=e.filter((function(t){var e=eu(t,2),r=e[0],n=e[1];return"color"===r?j=!0:/background/i.test(r)&&(x=!0,"background-position"===r?A=n:"background-size"===r&&(_=n)),(/background/i.test(r)||/^(-webkit-)?border-image/.test(r))&&/url\([^)]*\)/i.test(n)&&(C=!0),y.indexOf(r)>-1})).sort((function(t,e){var r=eu(t,1)[0],n=eu(e,1)[0];return"color"===r||"background-image"===r&&"background-color"===n||0===n.indexOf("-webkit-text")?1:-1})),v.indexOf(w)>-1&&!x&&this._try((function(){var r=function(t){var e=null;return Array.prototype.some.call(t.classList,(function(t){return!!X[t]&&(e=X[t],!0)})),e}(t);if(r||(r=t.getAttribute("bgcolor")),r){var n=Xi(r);n&&(e.unshift(["background-color",n.toString()]),x=!0)}})),"FONT"!==w||j||this._try((function(){var r=t.getAttribute("color");if(r){var n=Xi(r);n&&(e.push(["color",n.toString()]),j=!0)}}));var P="",E="",B=0;e.some((function(t,e){var r=eu(t,2),n=r[0],a=r[1];return o._try((function(){if(0!==n.indexOf("-webkit-text"))return B=e,!0;switch(n){case"-webkit-text-fill-color":P=Yi(a);break;case"-webkit-text-stroke":var t=a.split(" ");2===t.length&&(E=Yi(t[1]));break;case"-webkit-text-stroke-color":E=Yi(a)}return!1}))})),P&&(j?e[e.length-1]=["-webkit-text-fill-color",P]:(e.push(["-webkit-text-fill-color",P]),j=!0)),B&&(e.splice(0,B),E&&e.unshift(["-webkit-text-stroke-color",E]));var R="",I="";if((r||n)&&t.className&&"string"==typeof t.className){var T=t.className.match(a);T&&(R=T[0]),(T=t.className.match(su.classNameReg))&&(I=T[0])}var D="",N=n;N&&fu.watch("color",(function(){N=!1,fu.unwatch("color")})),e.forEach((function(a){var i=eu(a,2),y=i[0],v=i[1];return o._try((function(){var a,i=v,m=!1,w=g.BG_COLOR.indexOf(y)>-1,P=g.TEXT_SHADOW.indexOf(y)>-1,E=g.TEXT_COLOR.indexOf(y),B=g.BORDER_COLOR.indexOf(y)>-1,R=/gradient/.test(v),T=[],L="";if(v=Ki(v,R),M.test(v)){if(R){for(var F=k.exec(v);F;)T.push(F[0]),F=k.exec(v);a=Zi(T)}var z=0;v=v.replace(k,(function(e){R&&(e=a,m=!0);var i=Xi(e);if((null==i?void 0:i.alpha())>=.05){var u=o._adjustBrightness(i,t,{isBgColor:w,isTextShadow:P,isTextColor:E>-1,isBorderColor:B,hasInlineColor:j},r,n),p=!C&&u.newColor;if(L+=u.extStyle,w||E>=5){var d=p?p.toString():e;0===z&&V(t).forEach((function(t){w?(t[l]=d,t[f]=(t[f]||S.defaultLightBgColor).split("|").concat(e).join("|")):(t[c]=d,t[s]=e);var r=Xi(d);w&&(null==r?void 0:r.alpha())>=.05&&t[h]&&delete t[h]}))}return p&&(m=!0),z++,p||e}return e})).replace(/\s?!\s?important/gi,"")}if(L&&(D+=L),!(t instanceof SVGElement)){var q=/^background/.test(y),$=/^(-webkit-)?border-image/.test(y);if((q||$)&&/url\([^)]*\)/i.test(v)){m=!0;var W=Zi((t[f]||S.defaultLightBgColor).split("|"),"normal").toString();if(v=v.replace(/^(.*?)url\(([^)]*)\)(.*)$/i,(function(e){var r=e,o="";return t[h]||V(t).forEach((function(t){t[h]=!0})),q?(o=fu.genCssKV(y,W?"".concat(r,",linear-gradient(").concat(W,", ").concat(W,")"):r),A&&(D+=fu.genCssKV("background-position",A),o+=fu.genCssKV("background-position",W?"".concat(A,",top left"):A)),_&&(D+=fu.genCssKV("background-size",_),o+=fu.genCssKV("background-size",W?"".concat(_,",100%"):_)),n||(I?(d+=fu.genCss(I,o),V(t).forEach((function(t){t[p]=W||r}))):su.push(t,o,(function(t){var e=[t.elOld];t.el!==t.elOld&&e.push(t.el),e.forEach((function(t){V(t).forEach((function(t){t[p]=W||r}))}))})))):!W||x||n||(o=fu.genCssKV("background-image","linear-gradient(".concat(W,", ").concat(W,")")),I?d+=fu.genCss(I,o):su.push(t,o)),r})),!j){var H=t[s]||S.defaultLightTextColor;D+=fu.genCssKV("color",H),V(t).forEach((function(t){t[c]=H}))}}}(m||n)&&(!r&&!n&&b.test(i)&&(O[y]=i.replace(b,"")),R?n||(I?(d+=fu.genCss(I,fu.genCssKV(y,v)),/^background/.test(y)&&!/url\([^)]*\)/i.test(v)&&(u+=o._updateBgWithGradient(a,t,I,e,j,r,n))):su.push(t,fu.genCssKV(y,v),(function(i){/^background/.test(y)&&!/url\([^)]*\)/i.test(v)&&(u+=o._updateBgWithGradient(a,t,i.className,e,j,r,n))}))):("color"===y&&(N=!1,fu.unwatch("color")),D+=fu.genCssKV(y,!m&&n?t.style[y]:v)))}))})),N&&(D+=fu.genCssKV("color",t.style.color||t[c]||S.defaultDarkTextColor),fu.unwatch("color")),D&&(R||(R="".concat("js_darkmode__").concat(this._idx++),t.classList.add(R)),u+=D?fu.genCss(R,D):""),u+=d,r||!function(t){return t.textContent.replace(/\s/g,"").length>0}(t)||n||(S.delayBgJudge?lu.push(t):su.contains(t,(function(t){u+=fu.genCss(t.className,t.cssKV),"function"==typeof t.cb&&t.cb(t)})))}return cu.emit("afterConvertNode".concat(i),t),u}},{key:"getContrast",value:function(t,e){var r=Xi(t),n=Xi(e);return r&&n?r.contrast(n):0}}])&&au(e.prototype,r),n&&au(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),cu=new E,lu=new T("".concat("js_darkmode__","text__")),su=new L("".concat("js_darkmode__","bg__")),fu=new W,hu=new K,pu=new uu;function du(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){u=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return gu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gu(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gu(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var yu=new RegExp("".concat("js_darkmode__","[^ ]+"),"g"),vu=null,bu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{type:"dom"};if(e.force&&(fu.isFinish=!1),!fu.isFinish)try{pu.isDarkmode=S.mode?"dark"===S.mode:t.matches,"dom"===e.type?(pu.isDarkmode&&"function"==typeof S.begin&&S.begin(hu.hasDelay()),Array.prototype.forEach.call(hu.get(),(function(t){if(pu.isDarkmode&&t.className&&"string"==typeof t.className&&(t.className=t.className.replace(yu,"")),pu.isDarkmode||cu.length)if(S.needJudgeFirstPage){var e=t.getBoundingClientRect(),r=e.top,n=e.bottom;r<=0&&n<=0?fu.addCss(pu.convert(t)):r>0&&r<d||n>0&&n<d?(hu.addFirstPageNode(t),fu.addCss(pu.convert(t),!0)):(S.needJudgeFirstPage=!1,fu.writeStyle(!0),hu.showFirstPageNodes(),"function"==typeof S.showFirstPage&&S.showFirstPage(),fu.addCss(pu.convert(t)))}else fu.addCss(pu.convert(t))})),cu.loopTimes++):"bg"===e.type&&pu.isDarkmode&&lu.forEach((function(t){return su.contains(t,(function(t){fu.addCss(fu.genCss(t.className,t.cssKV)),"function"==typeof t.cb&&t.cb(t);var e=[t.elOld];t.elOld!==t.el&&e.push(t.el),e.forEach((function(t){var e,r,n,o,a,i,u=[[c,null!==(e=t[c])&&void 0!==e?e:null],[l,null!==(r=t[l])&&void 0!==r?r:null],[s,null!==(n=t[s])&&void 0!==n?n:null],[f,null!==(o=t[f])&&void 0!==o?o:null],[h,null!==(a=t[h])&&void 0!==a?a:null],[p,null!==(i=t[p])&&void 0!==i?i:null]],d=V(t,!0);d.forEach((function(t){u.forEach((function(e){var r=du(e,2),n=r[0],o=r[1];null===o?delete t[n]:t[n]=o}))})),d.forEach((function(t){fu.addCss(pu.convert(t,void 0,!1,!0))}))}))}))})),(S.needJudgeFirstPage||!S.needJudgeFirstPage&&!hu.showFirstPage)&&"function"==typeof S.showFirstPage&&S.showFirstPage(),fu.writeStyle(),hu.emptyFirstPageNodes(),pu.isDarkmode||(S.needJudgeFirstPage=!1,S.delayBgJudge=!1,null===S.container&&"dom"===e.type&&hu.length&&hu.delay())}catch(t){console.log("An error occurred when running the dark mode conversion algorithm\n",t),"function"==typeof S.error&&S.error(t)}};function mu(t,e){wu(e),hu.set(t),bu(vu,{force:!0,type:"dom"})}function wu(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!S.hasInit){S.hasInit=!0;var e=S.whitelist.tagName,r=S.whitelist.attribute;t.whitelist&&(t.whitelist.tagName instanceof Array&&t.whitelist.tagName.forEach((function(t){t=t.toUpperCase(),-1===e.indexOf(t)&&e.push(t)})),t.whitelist.attribute instanceof Array&&t.whitelist.attribute.forEach((function(t){-1===r.indexOf(t)&&r.push(t)}))),["dark","light"].indexOf(t.mode)>-1&&(S.set("string",t,"mode"),"dark"===t.mode&&document.getElementsByTagName("html")[0].classList.add(i)),S.set("function",t,"begin"),S.set("function",t,"showFirstPage"),S.set("function",t,"error"),S.set("boolean",t,"needJudgeFirstPage"),S.set("boolean",t,"delayBgJudge"),S.set("dom",t,"container"),S.set("string",t,"cssSelectorsPrefix"),S.set("string",t,"defaultLightTextColor"),S.set("string",t,"defaultLightBgColor"),S.set("string",t,"defaultDarkTextColor"),S.set("string",t,"defaultDarkBgColor"),pu.init(),!S.mode&&null===vu&&window.matchMedia&&(vu=window.matchMedia(o)).addListener(bu)}}function Mu(t){hu.set(t),null!==S.container&&(su.update(t),lu.update(t)),bu(vu,{force:!0,type:"bg"})}function ku(t,e){fu.isFinish&&(fu.addCss(pu.convert(t,e?Object.keys(e).map((function(t){return[t,e[t]]})):void 0,!0),!1),fu.writeStyle())}function Su(t,e){return pu.getContrast(t,e)}function Ou(t){t.forEach((function(t){return cu.extend(t)}))}}])}));
|