@likec4/mcp 1.58.0 → 1.59.1

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.
Files changed (41) hide show
  1. package/dist/chunks/libs/@chevrotain/cst-dts-gen.mjs +1 -0
  2. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +1 -1
  3. package/dist/chunks/libs/@hono/mcp.mjs +6 -6
  4. package/dist/chunks/libs/@hono/node-server.mjs +3 -1
  5. package/dist/chunks/libs/@logtape/logtape.mjs +4 -4
  6. package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +4 -11
  7. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
  8. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
  9. package/dist/chunks/libs/chevrotain.mjs +33 -33
  10. package/dist/chunks/libs/chokidar.mjs +2 -2
  11. package/dist/chunks/libs/chroma-js.mjs +2 -2
  12. package/dist/chunks/libs/eventemitter3.mjs +1 -1
  13. package/dist/chunks/libs/graphology-dag.mjs +1 -1
  14. package/dist/chunks/libs/graphology.mjs +1 -1
  15. package/dist/chunks/libs/hast-util-sanitize.mjs +1 -1
  16. package/dist/chunks/libs/hast-util-to-html.mjs +2 -2
  17. package/dist/chunks/libs/hono.mjs +1 -1
  18. package/dist/chunks/libs/immer.mjs +1 -1
  19. package/dist/chunks/libs/langium.mjs +9 -22
  20. package/dist/chunks/libs/markdown-table.mjs +1 -1
  21. package/dist/chunks/libs/mdast-util-from-markdown.mjs +2 -2
  22. package/dist/chunks/libs/mdast-util-gfm.mjs +1 -1
  23. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  24. package/dist/chunks/libs/micromark-extension-gfm.mjs +1 -1
  25. package/dist/chunks/libs/mnemonist.mjs +1 -1
  26. package/dist/chunks/libs/nano-spawn.mjs +1 -1
  27. package/dist/chunks/libs/p-queue.mjs +1 -1
  28. package/dist/chunks/libs/picomatch.mjs +1 -0
  29. package/dist/chunks/libs/remark-github-blockquote-alert.mjs +1 -1
  30. package/dist/chunks/libs/remeda.mjs +1 -1
  31. package/dist/chunks/libs/ufo.mjs +1 -1
  32. package/dist/chunks/libs/unified.mjs +1 -1
  33. package/dist/chunks/rolldown-runtime.mjs +1 -1
  34. package/dist/chunks/src.mjs +102 -101
  35. package/dist/cli.mjs +3 -3
  36. package/package.json +18 -18
  37. package/dist/chunks/libs/@chevrotain/gast.mjs +0 -1
  38. package/dist/chunks/libs/@lume/kiwi.mjs +0 -1
  39. package/dist/chunks/libs/fdir.mjs +0 -1
  40. package/dist/chunks/libs/json5.mjs +0 -14
  41. package/dist/chunks/libs/which.mjs +0 -1
@@ -1,3 +1,3 @@
1
- import{i as e}from"../rolldown-runtime.mjs";import*as t from"node:path";import{join as n,relative as r,resolve as i,sep as a}from"node:path";import{EventEmitter as o}from"node:events";import{lstat as s,open as c,readdir as l,realpath as u,stat as d}from"node:fs/promises";import{type as f}from"node:os";import{stat as p,unwatchFile as m,watch as h,watchFile as g}from"node:fs";import{Readable as _}from"node:stream";const v={FILE_TYPE:`files`,DIR_TYPE:`directories`,FILE_DIR_TYPE:`files_directories`,EVERYTHING_TYPE:`all`},y={root:`.`,fileFilter:e=>!0,directoryFilter:e=>!0,type:v.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(y);const b=`READDIRP_RECURSIVE_ERROR`,x=new Set([`ENOENT`,`EPERM`,`EACCES`,`ELOOP`,b]),S=[v.DIR_TYPE,v.EVERYTHING_TYPE,v.FILE_DIR_TYPE,v.FILE_TYPE],C=new Set([v.DIR_TYPE,v.EVERYTHING_TYPE,v.FILE_DIR_TYPE]),w=new Set([v.EVERYTHING_TYPE,v.FILE_DIR_TYPE,v.FILE_TYPE]),isNormalFlowError=e=>x.has(e.code),T=process.platform===`win32`,emptyFn=e=>!0,normalizeFilter=e=>{if(e===void 0)return emptyFn;if(typeof e==`function`)return e;if(typeof e==`string`){let t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){let t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return emptyFn};var ReaddirpStream=class extends _{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let t={...y,...e},{root:n,type:r}=t;this._fileFilter=normalizeFilter(t.fileFilter),this._directoryFilter=normalizeFilter(t.directoryFilter);let a=t.lstat?s:d;T?this._stat=e=>a(e,{bigint:!0}):this._stat=a,this._maxDepth=t.depth!=null&&Number.isSafeInteger(t.depth)?t.depth:y.depth,this._wantsDir=r?C.has(r):!1,this._wantsFile=r?w.has(r):!1,this._wantsEverything=r===v.EVERYTHING_TYPE,this._root=i(n),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?`dirent`:`stats`,this._rdOptions={encoding:`utf8`,withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,n=t&&t.files;if(n&&n.length>0){let{path:r,depth:i}=t,a=n.splice(0,e).map(e=>this._formatEntry(e,r)),o=await Promise.all(a);for(let t of o){if(!t)continue;if(this.destroyed)return;let n=await this._getEntryType(t);n===`directory`&&this._directoryFilter(t)?(i<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,i+1)),this._wantsDir&&(this.push(t),e--)):(n===`file`||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{let e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await l(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let a,o=this._isDirent?e.name:e;try{let s=i(n(t,o));a={path:r(this._root,s),fullPath:s,basename:o},a[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(e){this._onError(e);return}return a}_onError(e){isNormalFlowError(e)&&!this.destroyed?this.emit(`warn`,e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return``;let t=e[this._statsProp];if(t.isFile())return`file`;if(t.isDirectory())return`directory`;if(t&&t.isSymbolicLink()){let t=e.fullPath;try{let e=await u(t),n=await s(e);if(n.isFile())return`file`;if(n.isDirectory()){let n=e.length;if(t.startsWith(e)&&t.substr(n,1)===a){let n=Error(`Circular symlink detected: "${t}" points to "${e}"`);return n.code=b,this._onError(n)}return`directory`}}catch(e){return this._onError(e),``}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}};function readdirp(e,t={}){let n=t.entryType||t.type;if(n===`both`&&(n=v.FILE_DIR_TYPE),n&&(t.type=n),!e)throw Error(`readdirp: root argument is required. Usage: readdirp(root, options)`);if(typeof e!=`string`)throw TypeError(`readdirp: root argument must be a string. Usage: readdirp(root, options)`);if(n&&!S.includes(n))throw Error(`readdirp: Invalid type passed. Use one of ${S.join(`, `)}`);return t.root=e,new ReaddirpStream(t)}const EMPTY_FN=()=>{},E=process.platform,D=E===`win32`,O=E===`darwin`,k=E===`linux`,A=E===`freebsd`,j=f()===`OS400`,M={ALL:`all`,READY:`ready`,ADD:`add`,CHANGE:`change`,ADD_DIR:`addDir`,UNLINK:`unlink`,UNLINK_DIR:`unlinkDir`,RAW:`raw`,ERROR:`error`},N=M,P={lstat:s,stat:d},F=`listeners`,I=`errHandlers`,L=`rawEmitters`,R=[F,I,L],z=new Set(`3dm.3ds.3g2.3gp.7z.a.aac.adp.afdesign.afphoto.afpub.ai.aif.aiff.alz.ape.apk.appimage.ar.arj.asf.au.avi.bak.baml.bh.bin.bk.bmp.btif.bz2.bzip2.cab.caf.cgm.class.cmx.cpio.cr2.cur.dat.dcm.deb.dex.djvu.dll.dmg.dng.doc.docm.docx.dot.dotm.dra.DS_Store.dsk.dts.dtshd.dvb.dwg.dxf.ecelp4800.ecelp7470.ecelp9600.egg.eol.eot.epub.exe.f4v.fbs.fh.fla.flac.flatpak.fli.flv.fpx.fst.fvt.g3.gh.gif.graffle.gz.gzip.h261.h263.h264.icns.ico.ief.img.ipa.iso.jar.jpeg.jpg.jpgv.jpm.jxr.key.ktx.lha.lib.lvp.lz.lzh.lzma.lzo.m3u.m4a.m4v.mar.mdi.mht.mid.midi.mj2.mka.mkv.mmr.mng.mobi.mov.movie.mp3.mp4.mp4a.mpeg.mpg.mpga.mxu.nef.npx.numbers.nupkg.o.odp.ods.odt.oga.ogg.ogv.otf.ott.pages.pbm.pcx.pdb.pdf.pea.pgm.pic.png.pnm.pot.potm.potx.ppa.ppam.ppm.pps.ppsm.ppsx.ppt.pptm.pptx.psd.pya.pyc.pyo.pyv.qt.rar.ras.raw.resources.rgb.rip.rlc.rmf.rmvb.rpm.rtf.rz.s3m.s7z.scpt.sgi.shar.snap.sil.sketch.slk.smv.snk.so.stl.suo.sub.swf.tar.tbz.tbz2.tga.tgz.thmx.tif.tiff.tlz.ttc.ttf.txz.udf.uvh.uvi.uvm.uvp.uvs.uvu.viv.vob.war.wav.wax.wbmp.wdp.weba.webm.webp.whl.wim.wm.wma.wmv.wmx.woff.woff2.wrm.wvx.xbm.xif.xla.xlam.xls.xlsb.xlsm.xlsx.xlt.xltm.xltx.xm.xmind.xpi.xpm.xwd.xz.z.zip.zipx`.split(`.`)),isBinaryPath=e=>z.has(t.extname(e).slice(1).toLowerCase()),foreach=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},addAndConvert=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},clearItem=e=>t=>{let n=e[t];n instanceof Set?n.clear():delete e[t]},delFromSet=(e,t,n)=>{let r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},isEmptySet=e=>e instanceof Set?e.size===0:!e,B=new Map;function createFsWatchInstance(e,n,r,i,a){let handleEvent=(n,i)=>{r(e),a(n,i,{watchedPath:e}),i&&e!==i&&fsWatchBroadcast(t.resolve(e,i),F,t.join(e,i))};try{return h(e,{persistent:n.persistent},handleEvent)}catch(e){i(e);return}}const fsWatchBroadcast=(e,t,n,r,i)=>{let a=B.get(e);a&&foreach(a[t],e=>{e(n,r,i)})},setFsWatchListener=(e,t,n,r)=>{let{listener:i,errHandler:a,rawEmitter:o}=r,s=B.get(t),l;if(!n.persistent)return l=createFsWatchInstance(e,n,i,a,o),l?l.close.bind(l):void 0;if(s)addAndConvert(s,F,i),addAndConvert(s,I,a),addAndConvert(s,L,o);else{if(l=createFsWatchInstance(e,n,fsWatchBroadcast.bind(null,t,F),a,fsWatchBroadcast.bind(null,t,L)),!l)return;l.on(N.ERROR,async n=>{let r=fsWatchBroadcast.bind(null,t,I);if(s&&(s.watcherUnusable=!0),D&&n.code===`EPERM`)try{await(await c(e,`r`)).close(),r(n)}catch{}else r(n)}),s={listeners:i,errHandlers:a,rawEmitters:o,watcher:l},B.set(t,s)}return()=>{delFromSet(s,F,i),delFromSet(s,I,a),delFromSet(s,L,o),isEmptySet(s.listeners)&&(s.watcher.close(),B.delete(t),R.forEach(clearItem(s)),s.watcher=void 0,Object.freeze(s))}},V=new Map,setFsWatchFileListener=(e,t,n,r)=>{let{listener:i,rawEmitter:a}=r,o=V.get(t),s=o&&o.options;return s&&(s.persistent<n.persistent||s.interval>n.interval)&&(m(t),o=void 0),o?(addAndConvert(o,F,i),addAndConvert(o,L,a)):(o={listeners:i,rawEmitters:a,options:n,watcher:g(t,n,(n,r)=>{foreach(o.rawEmitters,e=>{e(N.CHANGE,t,{curr:n,prev:r})});let i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||i===0)&&foreach(o.listeners,t=>t(e,n))})},V.set(t,o)),()=>{delFromSet(o,F,i),delFromSet(o,L,a),isEmptySet(o.listeners)&&(V.delete(t),m(t),o.options=o.watcher=void 0,Object.freeze(o))}};var NodeFsHandler=class{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,n){let r=this.fsw.options,i=t.dirname(e),a=t.basename(e);this.fsw._getWatchedDir(i).add(a);let o=t.resolve(e),s={persistent:r.persistent};n||=EMPTY_FN;let c;return r.usePolling?(s.interval=r.interval!==r.binaryInterval&&isBinaryPath(a)?r.binaryInterval:r.interval,c=setFsWatchFileListener(e,o,s,{listener:n,rawEmitter:this.fsw._emitRaw})):c=setFsWatchListener(e,o,s,{listener:n,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),c}_handleFile(e,n,r){if(this.fsw.closed)return;let i=t.dirname(e),a=t.basename(e),o=this.fsw._getWatchedDir(i),s=n;if(o.has(a))return;let listener=async(t,n)=>{if(this.fsw._throttle(`watch`,e,5)){if(!n||n.mtimeMs===0)try{let n=await d(e);if(this.fsw.closed)return;let r=n.atimeMs,i=n.mtimeMs;if((!r||r<=i||i!==s.mtimeMs)&&this.fsw._emit(N.CHANGE,e,n),(O||k||A)&&s.ino!==n.ino){this.fsw._closeFile(t),s=n;let r=this._watchWithNodeFs(e,listener);r&&this.fsw._addPathCloser(t,r)}else s=n}catch{this.fsw._remove(i,a)}else if(o.has(a)){let t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==s.mtimeMs)&&this.fsw._emit(N.CHANGE,e,n),s=n}}},c=this._watchWithNodeFs(e,listener);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(N.ADD,e,0))return;this.fsw._emit(N.ADD,e,n)}return c}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;let i=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let t;try{t=await u(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(N.CHANGE,n,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(N.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,n,r,i,a,o,s){e=t.join(e,``);let c=i?`${e}:${i}`:e;if(s=this.fsw._throttle(`readdir`,c,1e3),!s)return;let l=this.fsw._getWatchedDir(r.path),u=new Set,d=this.fsw._readdirp(e,{fileFilter:e=>r.filterPath(e),directoryFilter:e=>r.filterDir(e)});if(d)return d.on(`data`,async s=>{if(this.fsw.closed){d=void 0;return}let c=s.path,f=t.join(e,c);if(u.add(c),!(s.stats.isSymbolicLink()&&await this._handleSymlink(s,e,f,c))){if(this.fsw.closed){d=void 0;return}(c===i||!i&&!l.has(c))&&(this.fsw._incrReadyCount(),f=t.join(a,t.relative(a,f)),this._addToNodeFs(f,n,r,o+1))}}).on(N.ERROR,this._boundHandleError),new Promise((t,n)=>{if(!d)return n();d.once(`end`,()=>{if(this.fsw.closed){d=void 0;return}let n=s?s.clear():!1;t(void 0),l.getChildren().filter(t=>t!==e&&!u.has(t)).forEach(t=>{this.fsw._remove(e,t)}),d=void 0,n&&this._handleRead(e,!1,r,i,a,o,s)})})}async _handleDir(e,n,r,i,a,o,s){let c=this.fsw._getWatchedDir(t.dirname(e)),l=c.has(t.basename(e));!(r&&this.fsw.options.ignoreInitial)&&!a&&!l&&this.fsw._emit(N.ADD_DIR,e,n),c.add(t.basename(e)),this.fsw._getWatchedDir(e);let u,d=this.fsw.options.depth;if((d==null||i<=d)&&!this.fsw._symlinkPaths.has(s)){if(!a&&(await this._handleRead(e,r,o,a,e,i,void 0),this.fsw.closed))return;u=this._watchWithNodeFs(e,(t,n)=>{n&&n.mtimeMs===0||this._handleRead(t,!1,o,a,e,i,void 0)})}return u}async _addToNodeFs(e,n,r,i,a){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let s=this.fsw._getWatchHelpers(e);r&&(s.filterPath=e=>r.filterPath(e),s.filterDir=e=>r.filterDir(e));try{let r=await P[s.statMethod](s.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(s.watchPath,r))return o(),!1;let c=this.fsw.options.followSymlinks,l;if(r.isDirectory()){let o=t.resolve(e),d=c?await u(e):e;if(this.fsw.closed||(l=await this._handleDir(s.watchPath,r,n,i,a,s,d),this.fsw.closed))return;o!==d&&d!==void 0&&this.fsw._symlinkPaths.set(o,d)}else if(r.isSymbolicLink()){let a=c?await u(e):e;if(this.fsw.closed)return;let o=t.dirname(s.watchPath);if(this.fsw._getWatchedDir(o).add(s.watchPath),this.fsw._emit(N.ADD,s.watchPath,r),l=await this._handleDir(o,r,n,i,e,s,a),this.fsw.closed)return;a!==void 0&&this.fsw._symlinkPaths.set(t.resolve(e),a)}else l=this._handleFile(s.watchPath,r,n);return o(),l&&this.fsw._addPathCloser(e,l),!1}catch(t){if(this.fsw._handleError(t))return o(),e}}};
1
+ import{r as e}from"../rolldown-runtime.mjs";import*as t from"node:path";import{join as n,relative as r,resolve as i,sep as a}from"node:path";import{EventEmitter as o}from"node:events";import{lstat as s,open as c,readdir as l,realpath as u,stat as d}from"node:fs/promises";import{type as f}from"node:os";import{stat as p,unwatchFile as m,watch as h,watchFile as g}from"node:fs";import{Readable as _}from"node:stream";const v={FILE_TYPE:`files`,DIR_TYPE:`directories`,FILE_DIR_TYPE:`files_directories`,EVERYTHING_TYPE:`all`},y={root:`.`,fileFilter:e=>!0,directoryFilter:e=>!0,type:v.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(y);const b=`READDIRP_RECURSIVE_ERROR`,x=new Set([`ENOENT`,`EPERM`,`EACCES`,`ELOOP`,b]),S=[v.DIR_TYPE,v.EVERYTHING_TYPE,v.FILE_DIR_TYPE,v.FILE_TYPE],C=new Set([v.DIR_TYPE,v.EVERYTHING_TYPE,v.FILE_DIR_TYPE]),w=new Set([v.EVERYTHING_TYPE,v.FILE_DIR_TYPE,v.FILE_TYPE]),isNormalFlowError=e=>x.has(e.code),T=process.platform===`win32`,emptyFn=e=>!0,normalizeFilter=e=>{if(e===void 0)return emptyFn;if(typeof e==`function`)return e;if(typeof e==`string`){let t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){let t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return emptyFn};var ReaddirpStream=class extends _{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let t={...y,...e},{root:n,type:r}=t;this._fileFilter=normalizeFilter(t.fileFilter),this._directoryFilter=normalizeFilter(t.directoryFilter);let a=t.lstat?s:d;T?this._stat=e=>a(e,{bigint:!0}):this._stat=a,this._maxDepth=t.depth!=null&&Number.isSafeInteger(t.depth)?t.depth:y.depth,this._wantsDir=r?C.has(r):!1,this._wantsFile=r?w.has(r):!1,this._wantsEverything=r===v.EVERYTHING_TYPE,this._root=i(n),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?`dirent`:`stats`,this._rdOptions={encoding:`utf8`,withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,n=t&&t.files;if(n&&n.length>0){let{path:r,depth:i}=t,a=n.splice(0,e).map(e=>this._formatEntry(e,r)),o=await Promise.all(a);for(let t of o){if(!t)continue;if(this.destroyed)return;let n=await this._getEntryType(t);n===`directory`&&this._directoryFilter(t)?(i<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,i+1)),this._wantsDir&&(this.push(t),e--)):(n===`file`||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{let e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await l(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let a,o=this._isDirent?e.name:e;try{let s=i(n(t,o));a={path:r(this._root,s),fullPath:s,basename:o},a[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(e){this._onError(e);return}return a}_onError(e){isNormalFlowError(e)&&!this.destroyed?this.emit(`warn`,e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return``;let t=e[this._statsProp];if(t.isFile())return`file`;if(t.isDirectory())return`directory`;if(t&&t.isSymbolicLink()){let t=e.fullPath;try{let e=await u(t),n=await s(e);if(n.isFile())return`file`;if(n.isDirectory()){let n=e.length;if(t.startsWith(e)&&t.substr(n,1)===a){let n=Error(`Circular symlink detected: "${t}" points to "${e}"`);return n.code=b,this._onError(n)}return`directory`}}catch(e){return this._onError(e),``}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}};function readdirp(e,t={}){let n=t.entryType||t.type;if(n===`both`&&(n=v.FILE_DIR_TYPE),n&&(t.type=n),!e)throw Error(`readdirp: root argument is required. Usage: readdirp(root, options)`);if(typeof e!=`string`)throw TypeError(`readdirp: root argument must be a string. Usage: readdirp(root, options)`);if(n&&!S.includes(n))throw Error(`readdirp: Invalid type passed. Use one of ${S.join(`, `)}`);return t.root=e,new ReaddirpStream(t)}const EMPTY_FN=()=>{},E=process.platform,D=E===`win32`,O=E===`darwin`,k=E===`linux`,A=E===`freebsd`,j=f()===`OS400`,M={ALL:`all`,READY:`ready`,ADD:`add`,CHANGE:`change`,ADD_DIR:`addDir`,UNLINK:`unlink`,UNLINK_DIR:`unlinkDir`,RAW:`raw`,ERROR:`error`},N=M,P={lstat:s,stat:d},F=`listeners`,I=`errHandlers`,L=`rawEmitters`,R=[F,I,L],z=new Set(`3dm.3ds.3g2.3gp.7z.a.aac.adp.afdesign.afphoto.afpub.ai.aif.aiff.alz.ape.apk.appimage.ar.arj.asf.au.avi.bak.baml.bh.bin.bk.bmp.btif.bz2.bzip2.cab.caf.cgm.class.cmx.cpio.cr2.cur.dat.dcm.deb.dex.djvu.dll.dmg.dng.doc.docm.docx.dot.dotm.dra.DS_Store.dsk.dts.dtshd.dvb.dwg.dxf.ecelp4800.ecelp7470.ecelp9600.egg.eol.eot.epub.exe.f4v.fbs.fh.fla.flac.flatpak.fli.flv.fpx.fst.fvt.g3.gh.gif.graffle.gz.gzip.h261.h263.h264.icns.ico.ief.img.ipa.iso.jar.jpeg.jpg.jpgv.jpm.jxr.key.ktx.lha.lib.lvp.lz.lzh.lzma.lzo.m3u.m4a.m4v.mar.mdi.mht.mid.midi.mj2.mka.mkv.mmr.mng.mobi.mov.movie.mp3.mp4.mp4a.mpeg.mpg.mpga.mxu.nef.npx.numbers.nupkg.o.odp.ods.odt.oga.ogg.ogv.otf.ott.pages.pbm.pcx.pdb.pdf.pea.pgm.pic.png.pnm.pot.potm.potx.ppa.ppam.ppm.pps.ppsm.ppsx.ppt.pptm.pptx.psd.pya.pyc.pyo.pyv.qt.rar.ras.raw.resources.rgb.rip.rlc.rmf.rmvb.rpm.rtf.rz.s3m.s7z.scpt.sgi.shar.snap.sil.sketch.slk.smv.snk.so.stl.suo.sub.swf.tar.tbz.tbz2.tga.tgz.thmx.tif.tiff.tlz.ttc.ttf.txz.udf.uvh.uvi.uvm.uvp.uvs.uvu.viv.vob.war.wav.wax.wbmp.wdp.weba.webm.webp.whl.wim.wm.wma.wmv.wmx.woff.woff2.wrm.wvx.xbm.xif.xla.xlam.xls.xlsb.xlsm.xlsx.xlt.xltm.xltx.xm.xmind.xpi.xpm.xwd.xz.z.zip.zipx`.split(`.`)),isBinaryPath=e=>z.has(t.extname(e).slice(1).toLowerCase()),foreach=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},addAndConvert=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},clearItem=e=>t=>{let n=e[t];n instanceof Set?n.clear():delete e[t]},delFromSet=(e,t,n)=>{let r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},isEmptySet=e=>e instanceof Set?e.size===0:!e,B=new Map;function createFsWatchInstance(e,n,r,i,a){let handleEvent=(n,i)=>{r(e),a(n,i,{watchedPath:e}),i&&e!==i&&fsWatchBroadcast(t.resolve(e,i),F,t.join(e,i))};try{return h(e,{persistent:n.persistent},handleEvent)}catch(e){i(e);return}}const fsWatchBroadcast=(e,t,n,r,i)=>{let a=B.get(e);a&&foreach(a[t],e=>{e(n,r,i)})},setFsWatchListener=(e,t,n,r)=>{let{listener:i,errHandler:a,rawEmitter:o}=r,s=B.get(t),l;if(!n.persistent)return l=createFsWatchInstance(e,n,i,a,o),l?l.close.bind(l):void 0;if(s)addAndConvert(s,F,i),addAndConvert(s,I,a),addAndConvert(s,L,o);else{if(l=createFsWatchInstance(e,n,fsWatchBroadcast.bind(null,t,F),a,fsWatchBroadcast.bind(null,t,L)),!l)return;l.on(N.ERROR,async n=>{let r=fsWatchBroadcast.bind(null,t,I);if(s&&(s.watcherUnusable=!0),D&&n.code===`EPERM`)try{await(await c(e,`r`)).close(),r(n)}catch{}else r(n)}),s={listeners:i,errHandlers:a,rawEmitters:o,watcher:l},B.set(t,s)}return()=>{delFromSet(s,F,i),delFromSet(s,I,a),delFromSet(s,L,o),isEmptySet(s.listeners)&&(s.watcher.close(),B.delete(t),R.forEach(clearItem(s)),s.watcher=void 0,Object.freeze(s))}},V=new Map,setFsWatchFileListener=(e,t,n,r)=>{let{listener:i,rawEmitter:a}=r,o=V.get(t),s=o&&o.options;return s&&(s.persistent<n.persistent||s.interval>n.interval)&&(m(t),o=void 0),o?(addAndConvert(o,F,i),addAndConvert(o,L,a)):(o={listeners:i,rawEmitters:a,options:n,watcher:g(t,n,(n,r)=>{foreach(o.rawEmitters,e=>{e(N.CHANGE,t,{curr:n,prev:r})});let i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||i===0)&&foreach(o.listeners,t=>t(e,n))})},V.set(t,o)),()=>{delFromSet(o,F,i),delFromSet(o,L,a),isEmptySet(o.listeners)&&(V.delete(t),m(t),o.options=o.watcher=void 0,Object.freeze(o))}};var NodeFsHandler=class{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,n){let r=this.fsw.options,i=t.dirname(e),a=t.basename(e);this.fsw._getWatchedDir(i).add(a);let o=t.resolve(e),s={persistent:r.persistent};n||=EMPTY_FN;let c;return r.usePolling?(s.interval=r.interval!==r.binaryInterval&&isBinaryPath(a)?r.binaryInterval:r.interval,c=setFsWatchFileListener(e,o,s,{listener:n,rawEmitter:this.fsw._emitRaw})):c=setFsWatchListener(e,o,s,{listener:n,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),c}_handleFile(e,n,r){if(this.fsw.closed)return;let i=t.dirname(e),a=t.basename(e),o=this.fsw._getWatchedDir(i),s=n;if(o.has(a))return;let listener=async(t,n)=>{if(this.fsw._throttle(`watch`,e,5)){if(!n||n.mtimeMs===0)try{let n=await d(e);if(this.fsw.closed)return;let r=n.atimeMs,i=n.mtimeMs;if((!r||r<=i||i!==s.mtimeMs)&&this.fsw._emit(N.CHANGE,e,n),(O||k||A)&&s.ino!==n.ino){this.fsw._closeFile(t),s=n;let r=this._watchWithNodeFs(e,listener);r&&this.fsw._addPathCloser(t,r)}else s=n}catch{this.fsw._remove(i,a)}else if(o.has(a)){let t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==s.mtimeMs)&&this.fsw._emit(N.CHANGE,e,n),s=n}}},c=this._watchWithNodeFs(e,listener);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(N.ADD,e,0))return;this.fsw._emit(N.ADD,e,n)}return c}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;let i=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let t;try{t=await u(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(N.CHANGE,n,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(N.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,n,r,i,a,o,s){e=t.join(e,``);let c=i?`${e}:${i}`:e;if(s=this.fsw._throttle(`readdir`,c,1e3),!s)return;let l=this.fsw._getWatchedDir(r.path),u=new Set,d=this.fsw._readdirp(e,{fileFilter:e=>r.filterPath(e),directoryFilter:e=>r.filterDir(e)});if(d)return d.on(`data`,async s=>{if(this.fsw.closed){d=void 0;return}let c=s.path,f=t.join(e,c);if(u.add(c),!(s.stats.isSymbolicLink()&&await this._handleSymlink(s,e,f,c))){if(this.fsw.closed){d=void 0;return}(c===i||!i&&!l.has(c))&&(this.fsw._incrReadyCount(),f=t.join(a,t.relative(a,f)),this._addToNodeFs(f,n,r,o+1))}}).on(N.ERROR,this._boundHandleError),new Promise((t,n)=>{if(!d)return n();d.once(`end`,()=>{if(this.fsw.closed){d=void 0;return}let n=s?s.clear():!1;t(void 0),l.getChildren().filter(t=>t!==e&&!u.has(t)).forEach(t=>{this.fsw._remove(e,t)}),d=void 0,n&&this._handleRead(e,!1,r,i,a,o,s)})})}async _handleDir(e,n,r,i,a,o,s){let c=this.fsw._getWatchedDir(t.dirname(e)),l=c.has(t.basename(e));!(r&&this.fsw.options.ignoreInitial)&&!a&&!l&&this.fsw._emit(N.ADD_DIR,e,n),c.add(t.basename(e)),this.fsw._getWatchedDir(e);let u,d,f=this.fsw.options.depth;if((f==null||i<=f)&&!this.fsw._symlinkPaths.has(s)){if(!a&&(await this._handleRead(e,r,o,a,e,i,u),this.fsw.closed))return;d=this._watchWithNodeFs(e,(t,n)=>{n&&n.mtimeMs===0||this._handleRead(t,!1,o,a,e,i,u)})}return d}async _addToNodeFs(e,n,r,i,a){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let s=this.fsw._getWatchHelpers(e);r&&(s.filterPath=e=>r.filterPath(e),s.filterDir=e=>r.filterDir(e));try{let r=await P[s.statMethod](s.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(s.watchPath,r))return o(),!1;let c=this.fsw.options.followSymlinks,l;if(r.isDirectory()){let o=t.resolve(e),d=c?await u(e):e;if(this.fsw.closed||(l=await this._handleDir(s.watchPath,r,n,i,a,s,d),this.fsw.closed))return;o!==d&&d!==void 0&&this.fsw._symlinkPaths.set(o,d)}else if(r.isSymbolicLink()){let a=c?await u(e):e;if(this.fsw.closed)return;let o=t.dirname(s.watchPath);if(this.fsw._getWatchedDir(o).add(s.watchPath),this.fsw._emit(N.ADD,s.watchPath,r),l=await this._handleDir(o,r,n,i,e,s,a),this.fsw.closed)return;a!==void 0&&this.fsw._symlinkPaths.set(t.resolve(e),a)}else l=this._handleFile(s.watchPath,r,n);return o(),l&&this.fsw._addPathCloser(e,l),!1}catch(t){if(this.fsw._handleError(t))return o(),e}}};
2
2
  /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
3
- const H=/\\/g,U=/\/\//g,W=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,G=/^\.[/\\]/;function arrify(e){return Array.isArray(e)?e:[e]}const isMatcherObject=e=>typeof e==`object`&&!!e&&!(e instanceof RegExp);function createPattern(e){return typeof e==`function`?e:typeof e==`string`?t=>e===t:e instanceof RegExp?t=>e.test(t):typeof e==`object`&&e?n=>{if(e.path===n)return!0;if(e.recursive){let r=t.relative(e.path,n);return r?!r.startsWith(`..`)&&!t.isAbsolute(r):!1}return!1}:()=>!1}function normalizePath(e){if(typeof e!=`string`)throw Error(`string expected`);e=t.normalize(e),e=e.replace(/\\/g,`/`);let n=!1;return e.startsWith(`//`)&&(n=!0),e=e.replace(U,`/`),n&&(e=`/`+e),e}function matchPatterns(e,t,n){let r=normalizePath(t);for(let t=0;t<e.length;t++){let i=e[t];if(i(r,n))return!0}return!1}function anymatch(e,t){if(e==null)throw TypeError(`anymatch: specify first argument`);let n=arrify(e).map(e=>createPattern(e));return t==null?(e,t)=>matchPatterns(n,e,t):matchPatterns(n,t)}const unifyPaths=e=>{let t=arrify(e).flat();if(!t.every(e=>typeof e==`string`))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map(normalizePathToUnix)},toUnix=e=>{let t=e.replace(H,`/`),n=!1;return t.startsWith(`//`)&&(n=!0),t=t.replace(U,`/`),n&&(t=`/`+t),t},normalizePathToUnix=e=>toUnix(t.normalize(toUnix(e))),normalizeIgnored=(e=``)=>n=>typeof n==`string`?normalizePathToUnix(t.isAbsolute(n)?n:t.join(e,n)):n,getAbsolutePath=(e,n)=>t.isAbsolute(e)?e:t.join(n,e),K=Object.freeze(new Set);var DirEntry=class{path;_removeWatcher;items;constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==`.`&&e!==`..`&&t.add(e)}async remove(e){let{items:n}=this;if(!n||(n.delete(e),n.size>0))return;let r=this.path;try{await l(r)}catch{this._removeWatcher&&this._removeWatcher(t.dirname(r),t.basename(r))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path=``,this._removeWatcher=EMPTY_FN,this.items=K,Object.freeze(this)}},WatchHelper=class{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,n,r){this.fsw=r;let i=e;this.path=e=e.replace(G,``),this.watchPath=i,this.fullWatchPath=t.resolve(i),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=n,this.statMethod=n?`stat`:`lstat`}entryPath(e){return t.join(this.watchPath,t.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},FSWatcher=class extends o{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?arrify(e.ignored):arrify([]),awaitWriteFinish:t===!0?n:typeof t==`object`?{...n,...t}:!1};j&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let e=i.toLowerCase();e===`false`||e===`0`?r.usePolling=!1:e===`true`||e===`1`?r.usePolling=!0:r.usePolling=!!e}let a=process.env.CHOKIDAR_INTERVAL;a&&(r.interval=Number.parseInt(a,10));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=EMPTY_FN,this._readyEmitted=!0,process.nextTick(()=>this.emit(M.READY)))},this._emitRaw=(...e)=>this.emit(M.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new NodeFsHandler(this),Object.freeze(r)}_addIgnoredPath(e){if(isMatcherObject(e)){for(let t of this._ignoredPaths)if(isMatcherObject(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e==`string`)for(let t of this._ignoredPaths)isMatcherObject(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,n,r){let{cwd:i}=this.options;this.closed=!1,this._closePromise=void 0;let a=unifyPaths(e);return i&&(a=a.map(e=>getAbsolutePath(e,i))),a.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||=0,this._readyCount+=a.length,Promise.all(a.map(async e=>{let t=await this._nodeFsHandler._addToNodeFs(e,!r,void 0,0,n);return t&&this._emitReady(),t})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(t.dirname(e),t.basename(n||e))})}),this}unwatch(e){if(this.closed)return this;let n=unifyPaths(e),{cwd:r}=this.options;return n.forEach(e=>{!t.isAbsolute(e)&&!this._closers.has(e)&&(r&&(e=t.join(r,e)),e=t.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(t=>{let n=t();n instanceof Promise&&e.push(n)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>void 0):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((n,r)=>{let i=(this.options.cwd?t.relative(this.options.cwd,r):r)||`.`;e[i]=n.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==M.ERROR&&this.emit(M.ALL,e,...t)}async _emit(e,n,r){if(this.closed)return;let i=this.options;D&&(n=t.normalize(n)),i.cwd&&(n=t.relative(i.cwd,n));let a=[n];r!=null&&a.push(r);let o=i.awaitWriteFinish,s;if(o&&(s=this._pendingWrites.get(n)))return s.lastChange=new Date,this;if(i.atomic){if(e===M.UNLINK)return this._pendingUnlinks.set(n,[e,...a]),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(M.ALL,...e),this._pendingUnlinks.delete(t)})},typeof i.atomic==`number`?i.atomic:100),this;e===M.ADD&&this._pendingUnlinks.has(n)&&(e=M.CHANGE,this._pendingUnlinks.delete(n))}if(o&&(e===M.ADD||e===M.CHANGE)&&this._readyEmitted){let awfEmit=(t,n)=>{t?(e=M.ERROR,a[0]=t,this.emitWithAll(e,a)):n&&(a.length>1?a[1]=n:a.push(n),this.emitWithAll(e,a))};return this._awaitWriteFinish(n,o.stabilityThreshold,e,awfEmit),this}if(e===M.CHANGE&&!this._throttle(M.CHANGE,n,50))return this;if(i.alwaysStat&&r===void 0&&(e===M.ADD||e===M.ADD_DIR||e===M.CHANGE)){let e=i.cwd?t.join(i.cwd,n):n,r;try{r=await d(e)}catch{}if(!r||this.closed)return;a.push(r)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!==`ENOENT`&&t!==`ENOTDIR`&&(!this.options.ignorePermissionErrors||t!==`EPERM`&&t!==`EACCES`)&&this.emit(M.ERROR,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw Error(`invalid throttle`);let i=r.get(t);if(i)return i.count++,!1;let a,clear=()=>{let e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(a),e&&clearTimeout(e.timeoutObject),n};a=setTimeout(clear,n);let o={timeoutObject:a,clear,count:0};return r.set(t,o),o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,n,r,i){let a=this.options.awaitWriteFinish;if(typeof a!=`object`)return;let o=a.pollInterval,s,c=e;this.options.cwd&&!t.isAbsolute(e)&&(c=t.join(this.options.cwd,e));let l=new Date,u=this._pendingWrites;function awaitWriteFinishFn(t){p(c,(r,a)=>{if(r||!u.has(e)){r&&r.code!==`ENOENT`&&i(r);return}let c=Number(new Date);t&&a.size!==t.size&&(u.get(e).lastChange=c),c-u.get(e).lastChange>=n?(u.delete(e),i(void 0,a)):s=setTimeout(awaitWriteFinishFn,o,a)})}u.has(e)||(u.set(e,{lastChange:l,cancelWait:()=>(u.delete(e),clearTimeout(s),r)}),s=setTimeout(awaitWriteFinishFn,o))}_isIgnored(e,t){if(this.options.atomic&&W.test(e))return!0;if(!this._userIgnored){let{cwd:e}=this.options,t=(this.options.ignored||[]).map(normalizeIgnored(e)),n=[...[...this._ignoredPaths].map(normalizeIgnored(e)),...t];this._userIgnored=anymatch(n,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new WatchHelper(e,this.options.followSymlinks,this)}_getWatchedDir(e){let n=t.resolve(e);return this._watched.has(n)||this._watched.set(n,new DirEntry(n,this._boundRemove)),this._watched.get(n)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,n,r){let i=t.join(e,n),a=t.resolve(i);if(r??=this._watched.has(i)||this._watched.has(a),!this._throttle(`remove`,i,100))return;!r&&this._watched.size===1&&this.add(e,n,!0),this._getWatchedDir(i).getChildren().forEach(e=>this._remove(i,e));let o=this._getWatchedDir(e),s=o.has(n);o.remove(n),this._symlinkPaths.has(a)&&this._symlinkPaths.delete(a);let c=i;if(this.options.cwd&&(c=t.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(c)&&this._pendingWrites.get(c).cancelWait()===M.ADD)return;this._watched.delete(i),this._watched.delete(a);let l=r?M.UNLINK_DIR:M.UNLINK;s&&!this._isIgnored(i)&&this._emit(l,i),this._closePath(i)}_closePath(e){this._closeFile(e);let n=t.dirname(e);this._getWatchedDir(n).remove(t.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n=readdirp(e,{type:M.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(n),n.once(`close`,()=>{n=void 0}),n.once(`end`,()=>{n&&=(this._streams.delete(n),void 0)}),n}};function watch$1(e,t={}){let n=new FSWatcher(t);return n.add(e),n}e(watch$1,`watch`);var q={watch:watch$1,FSWatcher};export{q as t};
3
+ const H=/\\/g,U=/\/\//g,W=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,G=/^\.[/\\]/;function arrify(e){return Array.isArray(e)?e:[e]}const isMatcherObject=e=>typeof e==`object`&&!!e&&!(e instanceof RegExp);function createPattern(e){return typeof e==`function`?e:typeof e==`string`?t=>e===t:e instanceof RegExp?t=>e.test(t):typeof e==`object`&&e?n=>{if(e.path===n)return!0;if(e.recursive){let r=t.relative(e.path,n);return r?!r.startsWith(`..`)&&!t.isAbsolute(r):!1}return!1}:()=>!1}function normalizePath(e){if(typeof e!=`string`)throw Error(`string expected`);e=t.normalize(e),e=e.replace(/\\/g,`/`);let n=!1;return e.startsWith(`//`)&&(n=!0),e=e.replace(U,`/`),n&&(e=`/`+e),e}function matchPatterns(e,t,n){let r=normalizePath(t);for(let t=0;t<e.length;t++){let i=e[t];if(i(r,n))return!0}return!1}function anymatch(e,t){if(e==null)throw TypeError(`anymatch: specify first argument`);let n=arrify(e).map(e=>createPattern(e));return t==null?(e,t)=>matchPatterns(n,e,t):matchPatterns(n,t)}const unifyPaths=e=>{let t=arrify(e).flat();if(!t.every(e=>typeof e==`string`))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map(normalizePathToUnix)},toUnix=e=>{let t=e.replace(H,`/`),n=!1;return t.startsWith(`//`)&&(n=!0),t=t.replace(U,`/`),n&&(t=`/`+t),t},normalizePathToUnix=e=>toUnix(t.normalize(toUnix(e))),normalizeIgnored=(e=``)=>n=>typeof n==`string`?normalizePathToUnix(t.isAbsolute(n)?n:t.join(e,n)):n,getAbsolutePath=(e,n)=>t.isAbsolute(e)?e:t.join(n,e),K=Object.freeze(new Set);var DirEntry=class{path;_removeWatcher;items;constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==`.`&&e!==`..`&&t.add(e)}async remove(e){let{items:n}=this;if(!n||(n.delete(e),n.size>0))return;let r=this.path;try{await l(r)}catch{this._removeWatcher&&this._removeWatcher(t.dirname(r),t.basename(r))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path=``,this._removeWatcher=EMPTY_FN,this.items=K,Object.freeze(this)}},WatchHelper=class{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,n,r){this.fsw=r;let i=e;this.path=e=e.replace(G,``),this.watchPath=i,this.fullWatchPath=t.resolve(i),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=n,this.statMethod=n?`stat`:`lstat`}entryPath(e){return t.join(this.watchPath,t.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},FSWatcher=class extends o{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?arrify(e.ignored):arrify([]),awaitWriteFinish:t===!0?n:typeof t==`object`&&{...n,...t}};j&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let e=i.toLowerCase();e===`false`||e===`0`?r.usePolling=!1:e===`true`||e===`1`?r.usePolling=!0:r.usePolling=!!e}let a=process.env.CHOKIDAR_INTERVAL;a&&(r.interval=Number.parseInt(a,10));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=EMPTY_FN,this._readyEmitted=!0,process.nextTick(()=>this.emit(M.READY)))},this._emitRaw=(...e)=>this.emit(M.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new NodeFsHandler(this),Object.freeze(r)}_addIgnoredPath(e){if(isMatcherObject(e)){for(let t of this._ignoredPaths)if(isMatcherObject(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e==`string`)for(let t of this._ignoredPaths)isMatcherObject(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,n,r){let{cwd:i}=this.options;this.closed=!1,this._closePromise=void 0;let a=unifyPaths(e);return i&&(a=a.map(e=>getAbsolutePath(e,i))),a.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||=0,this._readyCount+=a.length,Promise.all(a.map(async e=>{let t=await this._nodeFsHandler._addToNodeFs(e,!r,void 0,0,n);return t&&this._emitReady(),t})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(t.dirname(e),t.basename(n||e))})}),this}unwatch(e){if(this.closed)return this;let n=unifyPaths(e),{cwd:r}=this.options;return n.forEach(e=>{!t.isAbsolute(e)&&!this._closers.has(e)&&(r&&(e=t.join(r,e)),e=t.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(t=>{let n=t();n instanceof Promise&&e.push(n)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>void 0):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((n,r)=>{let i=(this.options.cwd?t.relative(this.options.cwd,r):r)||`.`;e[i]=n.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==M.ERROR&&this.emit(M.ALL,e,...t)}async _emit(e,n,r){if(this.closed)return;let i=this.options;D&&(n=t.normalize(n)),i.cwd&&(n=t.relative(i.cwd,n));let a=[n];r!=null&&a.push(r);let o=i.awaitWriteFinish,s;if(o&&(s=this._pendingWrites.get(n)))return s.lastChange=new Date,this;if(i.atomic){if(e===M.UNLINK)return this._pendingUnlinks.set(n,[e,...a]),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(M.ALL,...e),this._pendingUnlinks.delete(t)})},typeof i.atomic==`number`?i.atomic:100),this;e===M.ADD&&this._pendingUnlinks.has(n)&&(e=M.CHANGE,this._pendingUnlinks.delete(n))}if(o&&(e===M.ADD||e===M.CHANGE)&&this._readyEmitted){let awfEmit=(t,n)=>{t?(e=M.ERROR,a[0]=t,this.emitWithAll(e,a)):n&&(a.length>1?a[1]=n:a.push(n),this.emitWithAll(e,a))};return this._awaitWriteFinish(n,o.stabilityThreshold,e,awfEmit),this}if(e===M.CHANGE&&!this._throttle(M.CHANGE,n,50))return this;if(i.alwaysStat&&r===void 0&&(e===M.ADD||e===M.ADD_DIR||e===M.CHANGE)){let e=i.cwd?t.join(i.cwd,n):n,r;try{r=await d(e)}catch{}if(!r||this.closed)return;a.push(r)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!==`ENOENT`&&t!==`ENOTDIR`&&(!this.options.ignorePermissionErrors||t!==`EPERM`&&t!==`EACCES`)&&this.emit(M.ERROR,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw Error(`invalid throttle`);let i=r.get(t);if(i)return i.count++,!1;let a,clear=()=>{let e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(a),e&&clearTimeout(e.timeoutObject),n};a=setTimeout(clear,n);let o={timeoutObject:a,clear,count:0};return r.set(t,o),o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,n,r,i){let a=this.options.awaitWriteFinish;if(typeof a!=`object`)return;let o=a.pollInterval,s,c=e;this.options.cwd&&!t.isAbsolute(e)&&(c=t.join(this.options.cwd,e));let l=new Date,u=this._pendingWrites;function awaitWriteFinishFn(t){p(c,(r,a)=>{if(r||!u.has(e)){r&&r.code!==`ENOENT`&&i(r);return}let c=Number(new Date);t&&a.size!==t.size&&(u.get(e).lastChange=c),c-u.get(e).lastChange>=n?(u.delete(e),i(void 0,a)):s=setTimeout(awaitWriteFinishFn,o,a)})}u.has(e)||(u.set(e,{lastChange:l,cancelWait:()=>(u.delete(e),clearTimeout(s),r)}),s=setTimeout(awaitWriteFinishFn,o))}_isIgnored(e,t){if(this.options.atomic&&W.test(e))return!0;if(!this._userIgnored){let{cwd:e}=this.options,t=(this.options.ignored||[]).map(normalizeIgnored(e)),n=[...[...this._ignoredPaths].map(normalizeIgnored(e)),...t];this._userIgnored=anymatch(n,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new WatchHelper(e,this.options.followSymlinks,this)}_getWatchedDir(e){let n=t.resolve(e);return this._watched.has(n)||this._watched.set(n,new DirEntry(n,this._boundRemove)),this._watched.get(n)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,n,r){let i=t.join(e,n),a=t.resolve(i);if(r??=this._watched.has(i)||this._watched.has(a),!this._throttle(`remove`,i,100))return;!r&&this._watched.size===1&&this.add(e,n,!0),this._getWatchedDir(i).getChildren().forEach(e=>this._remove(i,e));let o=this._getWatchedDir(e),s=o.has(n);o.remove(n),this._symlinkPaths.has(a)&&this._symlinkPaths.delete(a);let c=i;if(this.options.cwd&&(c=t.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(c)&&this._pendingWrites.get(c).cancelWait()===M.ADD)return;this._watched.delete(i),this._watched.delete(a);let l=r?M.UNLINK_DIR:M.UNLINK;s&&!this._isIgnored(i)&&this._emit(l,i),this._closePath(i)}_closePath(e){this._closeFile(e);let n=t.dirname(e);this._getWatchedDir(n).remove(t.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n=readdirp(e,{type:M.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(n),n.once(`close`,()=>{n=void 0}),n.once(`end`,()=>{n&&=(this._streams.delete(n),void 0)}),n}};function watch$1(e,t={}){let n=new FSWatcher(t);return n.add(e),n}e(watch$1,`watch`);var q={watch:watch$1,FSWatcher};export{q as t};
@@ -1,4 +1,4 @@
1
- import{i as e}from"../rolldown-runtime.mjs";const{min:t,max:n}=Math;var r=e((e,r=0,i=1)=>t(n(r,e),i),`default`),i=e(e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=r(e[t],0,255)):t===3&&(e[t]=r(e[t],0,1));return e},`default`);const a={};for(let e of[`Boolean`,`Number`,`String`,`Function`,`Array`,`Date`,`RegExp`,`Undefined`,`Null`])a[`[object ${e}]`]=e.toLowerCase();function type_default(e){return a[Object.prototype.toString.call(e)]||`object`}e(type_default,`default`);var o=e((e,t=null)=>e.length>=3?Array.prototype.slice.call(e):type_default(e[0])==`object`&&t?t.split(``).filter(t=>e[0][t]!==void 0).map(t=>e[0][t]):e[0].slice(0),`default`),s=e(e=>{if(e.length<2)return null;let t=e.length-1;return type_default(e[t])==`string`?e[t].toLowerCase():null},`default`);const{PI:c,min:l,max:u}=Math,rnd2=e=>Math.round(e*100)/100,rnd3=e=>Math.round(e*100)/100,d=c*2,p=c/3,m=c/180,h=180/c;function reverse3(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}var g={format:{},autodetect:[]},Color=class{constructor(...e){let t=this;if(type_default(e[0])===`object`&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let n=s(e),r=!1;if(!n){r=!0,g.sorted||=(g.autodetect=g.autodetect.sort((e,t)=>t.p-e.p),!0);for(let t of g.autodetect)if(n=t.test(...e),n)break}if(g.format[n])t._rgb=i(g.format[n].apply(null,r?e:e.slice(0,-1)));else throw Error(`unknown format: `+e);t._rgb.length===3&&t._rgb.push(1)}toString(){return type_default(this.hex)==`function`?this.hex():`[${this._rgb.join(`,`)}]`}};const chroma=(...e)=>new Color(...e);chroma.version=`3.2.0`;const _={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,laserlemon:`#ffff54`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrod:`#fafad2`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,maroon2:`#7f0000`,maroon3:`#b03060`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,purple2:`#7f007f`,purple3:`#a020f0`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`},v=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,y=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,hex2rgb=e=>{if(e.match(v)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(``),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let t=parseInt(e,16);return[t>>16,t>>8&255,t&255,1]}if(e.match(y)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(``),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);let t=parseInt(e,16);return[t>>24&255,t>>16&255,t>>8&255,Math.round((t&255)/255*100)/100]}throw Error(`unknown hex color: ${e}`)},{round:b}=Math,rgb2hex=(...e)=>{let[t,n,r,i]=o(e,`rgba`),a=s(e)||`auto`;i===void 0&&(i=1),a===`auto`&&(a=i<1?`rgba`:`rgb`),t=b(t),n=b(n),r=b(r);let c=`000000`+(t<<16|n<<8|r).toString(16);c=c.substr(c.length-6);let l=`0`+b(i*255).toString(16);switch(l=l.substr(l.length-2),a.toLowerCase()){case`rgba`:return`#${c}${l}`;case`argb`:return`#${l}${c}`;default:return`#${c}`}};Color.prototype.name=function(){let e=rgb2hex(this._rgb,`rgb`);for(let t of Object.keys(_))if(_[t]===e)return t.toLowerCase();return e},g.format.named=e=>{if(e=e.toLowerCase(),_[e])return hex2rgb(_[e]);throw Error(`unknown color name: `+e)},g.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&type_default(e)===`string`&&_[e.toLowerCase()])return`named`}}),Color.prototype.alpha=function(e,t=!1){return e!==void 0&&type_default(e)===`number`?t?(this._rgb[3]=e,this):new Color([this._rgb[0],this._rgb[1],this._rgb[2],e],`rgb`):this._rgb[3]},Color.prototype.clipped=function(){return this._rgb._clipped||!1};const x={Kn:18,labWhitePoint:`d65`,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},S=new Map([[`a`,[1.0985,.35585]],[`b`,[1.0985,.35585]],[`c`,[.98074,1.18232]],[`d50`,[.96422,.82521]],[`d55`,[.95682,.92149]],[`d65`,[.95047,1.08883]],[`e`,[1,1,1]],[`f2`,[.99186,.67393]],[`f7`,[.95041,1.08747]],[`f11`,[1.00962,.6435]],[`icc`,[.96422,.82521]]]);function setLabWhitePoint(e){let t=S.get(String(e).toLowerCase());if(!t)throw Error(`unknown Lab illuminant `+e);x.labWhitePoint=e,x.Xn=t[0],x.Zn=t[1]}function getLabWhitePoint(){return x.labWhitePoint}const lab2rgb=(...e)=>{e=o(e,`lab`);let[t,n,r]=e,[i,a,s]=lab2xyz(t,n,r),[c,l,u]=xyz2rgb(i,a,s);return[c,l,u,e.length>3?e[3]:1]},lab2xyz=(e,t,n)=>{let{kE:r,kK:i,kKE:a,Xn:o,Yn:s,Zn:c}=x,l=(e+16)/116,u=.002*t+l,d=l-.005*n,p=u*u*u,m=d*d*d,h=p>r?p:(116*u-16)/i,g=e>a?((e+16)/116)**3:e/i,_=m>r?m:(116*d-16)/i;return[h*o,g*s,_*c]},compand=e=>{let t=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055)*t},xyz2rgb=(e,t,n)=>{let{MtxAdaptMa:r,MtxAdaptMaI:i,MtxXYZ2RGB:a,RefWhiteRGB:o,Xn:s,Yn:c,Zn:l}=x,u=s*r.m00+c*r.m10+l*r.m20,d=s*r.m01+c*r.m11+l*r.m21,p=s*r.m02+c*r.m12+l*r.m22,m=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,h=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,g=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,_=(e*r.m00+t*r.m10+n*r.m20)*(m/u),v=(e*r.m01+t*r.m11+n*r.m21)*(h/d),y=(e*r.m02+t*r.m12+n*r.m22)*(g/p),b=_*i.m00+v*i.m10+y*i.m20,S=_*i.m01+v*i.m11+y*i.m21,C=_*i.m02+v*i.m12+y*i.m22,w=compand(b*a.m00+S*a.m10+C*a.m20),T=compand(b*a.m01+S*a.m11+C*a.m21),E=compand(b*a.m02+S*a.m12+C*a.m22);return[w*255,T*255,E*255]},rgb2lab=(...e)=>{let[t,n,r,...i]=o(e,`rgb`),[a,s,c]=rgb2xyz(t,n,r),[l,u,d]=xyz2lab(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]};function xyz2lab(e,t,n){let{Xn:r,Yn:i,Zn:a,kE:o,kK:s}=x,c=e/r,l=t/i,u=n/a,d=c>o?c**(1/3):(s*c+16)/116,p=l>o?l**(1/3):(s*l+16)/116,m=u>o?u**(1/3):(s*u+16)/116;return[116*p-16,500*(d-p),200*(p-m)]}function gammaAdjustSRGB(e){let t=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:((e+.055)/1.055)**2.4)*t}const rgb2xyz=(e,t,n)=>{e=gammaAdjustSRGB(e/255),t=gammaAdjustSRGB(t/255),n=gammaAdjustSRGB(n/255);let{MtxRGB2XYZ:r,MtxAdaptMa:i,MtxAdaptMaI:a,Xn:o,Yn:s,Zn:c,As:l,Bs:u,Cs:d}=x,p=e*r.m00+t*r.m10+n*r.m20,m=e*r.m01+t*r.m11+n*r.m21,h=e*r.m02+t*r.m12+n*r.m22,g=o*i.m00+s*i.m10+c*i.m20,_=o*i.m01+s*i.m11+c*i.m21,v=o*i.m02+s*i.m12+c*i.m22,y=p*i.m00+m*i.m10+h*i.m20,b=p*i.m01+m*i.m11+h*i.m21,S=p*i.m02+m*i.m12+h*i.m22;return y*=g/l,b*=_/u,S*=v/d,p=y*a.m00+b*a.m10+S*a.m20,m=y*a.m01+b*a.m11+S*a.m21,h=y*a.m02+b*a.m12+S*a.m22,[p,m,h]};Color.prototype.lab=function(){return rgb2lab(this._rgb)},Object.assign(chroma,{lab:e((...e)=>new Color(...e,`lab`),`lab`),getLabWhitePoint,setLabWhitePoint}),g.format.lab=lab2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`lab`),type_default(e)===`array`&&e.length===3)return`lab`}}),Color.prototype.darken=function(e=1){let t=this,n=t.lab();return n[0]-=x.Kn*e,new Color(n,`lab`).alpha(t.alpha(),!0)},Color.prototype.brighten=function(e=1){return this.darken(-e)},Color.prototype.darker=Color.prototype.darken,Color.prototype.brighter=Color.prototype.brighten,Color.prototype.get=function(e){let[t,n]=e.split(`.`),r=this[t]();if(n){let e=t.indexOf(n)-(t.substr(0,2)===`ok`?2:0);if(e>-1)return r[e];throw Error(`unknown channel ${n} in mode ${t}`)}else return r};const{pow:C}=Math;Color.prototype.luminance=function(e,t=`rgb`){if(e!==void 0&&type_default(e)===`number`){if(e===0)return new Color([0,0,0,this._rgb[3]],`rgb`);if(e===1)return new Color([255,255,255,this._rgb[3]],`rgb`);let n=this.luminance(),r=20,test=(n,i)=>{let a=n.interpolate(i,.5,t),o=a.luminance();return Math.abs(e-o)<1e-7||!r--?a:o>e?test(n,a):test(a,i)};return new Color([...(n>e?test(new Color([0,0,0]),this):test(this,new Color([255,255,255]))).rgb(),this._rgb[3]])}return rgb2luminance(...this._rgb.slice(0,3))};const rgb2luminance=(e,t,n)=>(e=luminance_x(e),t=luminance_x(t),n=luminance_x(n),.2126*e+.7152*t+.0722*n),luminance_x=e=>(e/=255,e<=.03928?e/12.92:C((e+.055)/1.055,2.4));var w={},T=e((e,t,n=.5,...r)=>{let i=r[0]||`lrgb`;if(!w[i]&&!r.length&&(i=Object.keys(w)[0]),!w[i])throw Error(`interpolation mode ${i} is not defined`);return type_default(e)!==`object`&&(e=new Color(e)),type_default(t)!==`object`&&(t=new Color(t)),w[i](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))},`default`);Color.prototype.mix=Color.prototype.interpolate=function(e,t=.5,...n){return T(this,e,t,...n)},Color.prototype.premultiply=function(e=!1){let t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new Color([t[0]*n,t[1]*n,t[2]*n,n],`rgb`)};const{sin:E,cos:ee}=Math,lch2lab=(...e)=>{let[t,n,r]=o(e,`lch`);return isNaN(r)&&(r=0),r*=m,[t,ee(r)*n,E(r)*n]},lch2rgb=(...e)=>{e=o(e,`lch`);let[t,n,r]=e,[i,a,s]=lch2lab(t,n,r),[c,l,u]=lab2rgb(i,a,s);return[c,l,u,e.length>3?e[3]:1]},hcl2rgb=(...e)=>lch2rgb(...reverse3(o(e,`hcl`))),{sqrt:D,atan2:te,round:O}=Math,lab2lch=(...e)=>{let[t,n,r]=o(e,`lab`),i=D(n*n+r*r),a=(te(r,n)*h+360)%360;return O(i*1e4)===0&&(a=NaN),[t,i,a]},rgb2lch=(...e)=>{let[t,n,r,...i]=o(e,`rgb`),[a,s,c]=rgb2lab(t,n,r),[l,u,d]=lab2lch(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]};Color.prototype.lch=function(){return rgb2lch(this._rgb)},Color.prototype.hcl=function(){return reverse3(rgb2lch(this._rgb))};const k=e((...e)=>new Color(...e,`lch`),`lch`),hcl=(...e)=>new Color(...e,`hcl`);Object.assign(chroma,{lch:k,hcl}),g.format.lch=lch2rgb,g.format.hcl=hcl2rgb,[`lch`,`hcl`].forEach(e=>g.autodetect.push({p:2,test:(...t)=>{if(t=o(t,e),type_default(t)===`array`&&t.length===3)return e}})),Color.prototype.saturate=function(e=1){let t=this,n=t.lch();return n[1]+=x.Kn*e,n[1]<0&&(n[1]=0),new Color(n,`lch`).alpha(t.alpha(),!0)},Color.prototype.desaturate=function(e=1){return this.saturate(-e)},Color.prototype.set=function(e,t,n=!1){let[r,i]=e.split(`.`),a=this[r]();if(i){let e=r.indexOf(i)-(r.substr(0,2)===`ok`?2:0);if(e>-1){if(type_default(t)==`string`)switch(t.charAt(0)){case`+`:a[e]+=+t;break;case`-`:a[e]+=+t;break;case`*`:a[e]*=+t.substr(1);break;case`/`:a[e]/=+t.substr(1);break;default:a[e]=+t}else if(type_default(t)===`number`)a[e]=t;else throw Error(`unsupported value for Color.set`);let i=new Color(a,r);return n?(this._rgb=i._rgb,this):i}throw Error(`unknown channel ${i} in mode ${r}`)}else return a},Color.prototype.tint=function(e=.5,...t){return T(this,`white`,e,...t)},Color.prototype.shade=function(e=.5,...t){return T(this,`black`,e,...t)},w.rgb=e((e,t,n)=>{let r=e._rgb,i=t._rgb;return new Color(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`rgb`)},`rgb`);const{sqrt:A,pow:j}=Math,lrgb=(e,t,n)=>{let[r,i,a]=e._rgb,[o,s,c]=t._rgb;return new Color(A(j(r,2)*(1-n)+j(o,2)*n),A(j(i,2)*(1-n)+j(s,2)*n),A(j(a,2)*(1-n)+j(c,2)*n),`rgb`)};w.lrgb=lrgb;const lab=(e,t,n)=>{let r=e.lab(),i=t.lab();return new Color(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`lab`)};w.lab=lab;var M=e((e,t,n,r)=>{let i,a;r===`hsl`?(i=e.hsl(),a=t.hsl()):r===`hsv`?(i=e.hsv(),a=t.hsv()):r===`hcg`?(i=e.hcg(),a=t.hcg()):r===`hsi`?(i=e.hsi(),a=t.hsi()):r===`lch`||r===`hcl`?(r=`hcl`,i=e.hcl(),a=t.hcl()):r===`oklch`&&(i=e.oklch().reverse(),a=t.oklch().reverse());let o,s,c,l,u,d;(r.substr(0,1)===`h`||r===`oklch`)&&([o,c,u]=i,[s,l,d]=a);let p,m,h,g;return!isNaN(o)&&!isNaN(s)?(g=s>o&&s-o>180?s-(o+360):s<o&&o-s>180?s+360-o:s-o,m=o+n*g):isNaN(o)?isNaN(s)?m=NaN:(m=s,(u==1||u==0)&&r!=`hsv`&&(p=l)):(m=o,(d==1||d==0)&&r!=`hsv`&&(p=c)),p===void 0&&(p=c+n*(l-c)),h=u+n*(d-u),r===`oklch`?new Color([h,p,m],r):new Color([m,p,h],r)},`default`);const lch=(e,t,n)=>M(e,t,n,`lch`);w.lch=lch,w.hcl=lch;const num2rgb=e=>{if(type_default(e)==`number`&&e>=0&&e<=16777215)return[e>>16,e>>8&255,e&255,1];throw Error(`unknown num color: `+e)},rgb2num=(...e)=>{let[t,n,r]=o(e,`rgb`);return(t<<16)+(n<<8)+r};Color.prototype.num=function(){return rgb2num(this._rgb)},Object.assign(chroma,{num:e((...e)=>new Color(...e,`num`),`num`)}),g.format.num=num2rgb,g.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&type_default(e[0])===`number`&&e[0]>=0&&e[0]<=16777215)return`num`}});const num=(e,t,n)=>{let r=e.num();return new Color(r+n*(t.num()-r),`num`)};w.num=num;const{floor:ne}=Math,hcg2rgb=(...e)=>{e=o(e,`hcg`);let[t,n,r]=e,i,a,s;r*=255;let c=n*255;if(n===0)i=a=s=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let e=ne(t),o=t-e,l=r*(1-n),u=l+c*(1-o),d=l+c*o,p=l+c;switch(e){case 0:[i,a,s]=[p,d,l];break;case 1:[i,a,s]=[u,p,l];break;case 2:[i,a,s]=[l,p,d];break;case 3:[i,a,s]=[l,u,p];break;case 4:[i,a,s]=[d,l,p];break;case 5:[i,a,s]=[p,l,u];break}}return[i,a,s,e.length>3?e[3]:1]},rgb2hcg=(...e)=>{let[t,n,r]=o(e,`rgb`),i=l(t,n,r),a=u(t,n,r),s=a-i,c=s*100/255,d=i/(255-s)*100,p;return s===0?p=NaN:(t===a&&(p=(n-r)/s),n===a&&(p=2+(r-t)/s),r===a&&(p=4+(t-n)/s),p*=60,p<0&&(p+=360)),[p,c,d]};Color.prototype.hcg=function(){return rgb2hcg(this._rgb)},chroma.hcg=e((...e)=>new Color(...e,`hcg`),`hcg`),g.format.hcg=hcg2rgb,g.autodetect.push({p:1,test:(...e)=>{if(e=o(e,`hcg`),type_default(e)===`array`&&e.length===3)return`hcg`}});const hcg=(e,t,n)=>M(e,t,n,`hcg`);w.hcg=hcg;const{cos:N}=Math,hsi2rgb=(...e)=>{e=o(e,`hsi`);let[t,n,i]=e,a,s,c;return isNaN(t)&&(t=0),isNaN(n)&&(n=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(c=(1-n)/3,a=(1+n*N(d*t)/N(p-d*t))/3,s=1-(c+a)):t<2/3?(t-=1/3,a=(1-n)/3,s=(1+n*N(d*t)/N(p-d*t))/3,c=1-(a+s)):(t-=2/3,s=(1-n)/3,c=(1+n*N(d*t)/N(p-d*t))/3,a=1-(s+c)),a=r(i*a*3),s=r(i*s*3),c=r(i*c*3),[a*255,s*255,c*255,e.length>3?e[3]:1]},{min:re,sqrt:ie,acos:ae}=Math,rgb2hsi=(...e)=>{let[t,n,r]=o(e,`rgb`);t/=255,n/=255,r/=255;let i,a=re(t,n,r),s=(t+n+r)/3,c=s>0?1-a/s:0;return c===0?i=NaN:(i=(t-n+(t-r))/2,i/=ie((t-n)*(t-n)+(t-r)*(n-r)),i=ae(i),r>n&&(i=d-i),i/=d),[i*360,c,s]};Color.prototype.hsi=function(){return rgb2hsi(this._rgb)},chroma.hsi=e((...e)=>new Color(...e,`hsi`),`hsi`),g.format.hsi=hsi2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`hsi`),type_default(e)===`array`&&e.length===3)return`hsi`}});const hsi=(e,t,n)=>M(e,t,n,`hsi`);w.hsi=hsi;const hsl2rgb=(...e)=>{e=o(e,`hsl`);let[t,n,r]=e,i,a,s;if(n===0)i=a=s=r*255;else{let e=[0,0,0],o=[0,0,0],c=r<.5?r*(1+n):r+n-r*n,l=2*r-c,u=t/360;e[0]=u+1/3,e[1]=u,e[2]=u-1/3;for(let t=0;t<3;t++)e[t]<0&&(e[t]+=1),e[t]>1&&--e[t],6*e[t]<1?o[t]=l+(c-l)*6*e[t]:2*e[t]<1?o[t]=c:3*e[t]<2?o[t]=l+(c-l)*(2/3-e[t])*6:o[t]=l;[i,a,s]=[o[0]*255,o[1]*255,o[2]*255]}return e.length>3?[i,a,s,e[3]]:[i,a,s,1]},oe=e((...e)=>{e=o(e,`rgba`);let[t,n,r]=e;t/=255,n/=255,r/=255;let i=l(t,n,r),a=u(t,n,r),s=(a+i)/2,c,d;return a===i?(c=0,d=NaN):c=s<.5?(a-i)/(a+i):(a-i)/(2-a-i),t==a?d=(n-r)/(a-i):n==a?d=2+(r-t)/(a-i):r==a&&(d=4+(t-n)/(a-i)),d*=60,d<0&&(d+=360),e.length>3&&e[3]!==void 0?[d,c,s,e[3]]:[d,c,s]},`rgb2hsl`);Color.prototype.hsl=function(){return oe(this._rgb)},chroma.hsl=e((...e)=>new Color(...e,`hsl`),`hsl`),g.format.hsl=hsl2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`hsl`),type_default(e)===`array`&&e.length===3)return`hsl`}});const hsl=(e,t,n)=>M(e,t,n,`hsl`);w.hsl=hsl;const{floor:se}=Math,hsv2rgb=(...e)=>{e=o(e,`hsv`);let[t,n,r]=e,i,a,s;if(r*=255,n===0)i=a=s=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let e=se(t),o=t-e,c=r*(1-n),l=r*(1-n*o),u=r*(1-n*(1-o));switch(e){case 0:[i,a,s]=[r,u,c];break;case 1:[i,a,s]=[l,r,c];break;case 2:[i,a,s]=[c,r,u];break;case 3:[i,a,s]=[c,l,r];break;case 4:[i,a,s]=[u,c,r];break;case 5:[i,a,s]=[r,c,l];break}}return[i,a,s,e.length>3?e[3]:1]},{min:ce,max:le}=Math,rgb2hsl=(...e)=>{e=o(e,`rgb`);let[t,n,r]=e,i=ce(t,n,r),a=le(t,n,r),s=a-i,c,l,u;return u=a/255,a===0?(c=NaN,l=0):(l=s/a,t===a&&(c=(n-r)/s),n===a&&(c=2+(r-t)/s),r===a&&(c=4+(t-n)/s),c*=60,c<0&&(c+=360)),[c,l,u]};Color.prototype.hsv=function(){return rgb2hsl(this._rgb)},chroma.hsv=e((...e)=>new Color(...e,`hsv`),`hsv`),g.format.hsv=hsv2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`hsv`),type_default(e)===`array`&&e.length===3)return`hsv`}});const hsv=(e,t,n)=>M(e,t,n,`hsv`);w.hsv=hsv;function multiplyMatrices(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(e=>[e]));let r=t[0].length,i=t[0].map((e,n)=>t.map(e=>e[n])),a=e.map(e=>i.map(t=>Array.isArray(e)?e.reduce((e,n,r)=>e+n*(t[r]||0),0):t.reduce((t,n)=>t+n*e,0)));return n===1&&(a=a[0]),r===1?a.map(e=>e[0]):a}const oklab2rgb=(...e)=>{e=o(e,`lab`);let[t,n,r,...i]=e,[a,s,c]=OKLab_to_XYZ([t,n,r]),[l,u,d]=xyz2rgb(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]};function OKLab_to_XYZ(e){return multiplyMatrices([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],multiplyMatrices([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],e).map(e=>e**3))}const rgb2oklab=(...e)=>{let[t,n,r,...i]=o(e,`rgb`);return[...XYZ_to_OKLab(rgb2xyz(t,n,r)),...i.length>0&&i[0]<1?[i[0]]:[]]};function XYZ_to_OKLab(e){return multiplyMatrices([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],multiplyMatrices([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],e).map(e=>Math.cbrt(e)))}Color.prototype.oklab=function(){return rgb2oklab(this._rgb)},Object.assign(chroma,{oklab:e((...e)=>new Color(...e,`oklab`),`oklab`)}),g.format.oklab=oklab2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`oklab`),type_default(e)===`array`&&e.length===3)return`oklab`}});const oklab=(e,t,n)=>{let r=e.oklab(),i=t.oklab();return new Color(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`oklab`)};w.oklab=oklab,w.oklch=e((e,t,n)=>M(e,t,n,`oklch`),`oklch`);const{pow:P,sqrt:F,PI:L,cos:ue,sin:de,atan2:fe}=Math;var pe=e((e,t=`lrgb`,n=null)=>{let r=e.length;n||=Array.from(Array(r)).map(()=>1);let i=r/n.reduce(function(e,t){return e+t});if(n.forEach((e,t)=>{n[t]*=i}),e=e.map(e=>new Color(e)),t===`lrgb`)return _average_lrgb(e,n);let a=e.shift(),o=a.get(t),s=[],c=0,l=0;for(let e=0;e<o.length;e++)if(o[e]=(o[e]||0)*n[0],s.push(isNaN(o[e])?0:n[0]),t.charAt(e)===`h`&&!isNaN(o[e])){let t=o[e]/180*L;c+=ue(t)*n[0],l+=de(t)*n[0]}let u=a.alpha()*n[0];e.forEach((e,r)=>{let i=e.get(t);u+=e.alpha()*n[r+1];for(let e=0;e<o.length;e++)if(!isNaN(i[e]))if(s[e]+=n[r+1],t.charAt(e)===`h`){let t=i[e]/180*L;c+=ue(t)*n[r+1],l+=de(t)*n[r+1]}else o[e]+=i[e]*n[r+1]});for(let e=0;e<o.length;e++)if(t.charAt(e)===`h`){let t=fe(l/s[e],c/s[e])/L*180;for(;t<0;)t+=360;for(;t>=360;)t-=360;o[e]=t}else o[e]=o[e]/s[e];return u/=r,new Color(o,t).alpha(u>.99999?1:u,!0)},`default`);const _average_lrgb=(e,t)=>{let n=e.length,r=[0,0,0,0];for(let i=0;i<e.length;i++){let a=e[i],o=t[i]/n,s=a._rgb;r[0]+=P(s[0],2)*o,r[1]+=P(s[1],2)*o,r[2]+=P(s[2],2)*o,r[3]+=s[3]*o}return r[0]=F(r[0]),r[1]=F(r[1]),r[2]=F(r[2]),r[3]>.9999999&&(r[3]=1),new Color(i(r))},{pow:me}=Math;function scale_default(e){let t=`rgb`,n=chroma(`#ccc`),i=0,a=[0,1],o=[0,1],s=[],c=[0,0],l=!1,u=[],d=!1,p=0,m=1,h=!1,g={},_=!0,v=1,setColors=function(e){if(e||=[`#fff`,`#000`],e&&type_default(e)===`string`&&chroma.brewer&&chroma.brewer[e.toLowerCase()]&&(e=chroma.brewer[e.toLowerCase()]),type_default(e)===`array`){e.length===1&&(e=[e[0],e[0]]),e=e.slice(0);for(let t=0;t<e.length;t++)e[t]=chroma(e[t]);s.length=0;for(let t=0;t<e.length;t++)s.push(t/(e.length-1))}return resetCache(),u=e},getClass=function(e){if(l!=null){let t=l.length-1,n=0;for(;n<t&&e>=l[n];)n++;return n-1}return 0},tMapLightness=e=>e,tMapDomain=e=>e,getColor=function(e,i){let a,o;if(i??=!1,isNaN(e)||e===null)return n;o=i?e:l&&l.length>2?getClass(e)/(l.length-2):m===p?1:(e-p)/(m-p),o=tMapDomain(o),i||(o=tMapLightness(o)),v!==1&&(o=me(o,v)),o=c[0]+o*(1-c[0]-c[1]),o=r(o,0,1);let d=Math.floor(o*1e4);if(_&&g[d])a=g[d];else{if(type_default(u)===`array`)for(let e=0;e<s.length;e++){let n=s[e];if(o<=n){a=u[e];break}if(o>=n&&e===s.length-1){a=u[e];break}if(o>n&&o<s[e+1]){o=(o-n)/(s[e+1]-n),a=chroma.interpolate(u[e],u[e+1],o,t);break}}else type_default(u)===`function`&&(a=u(o));_&&(g[d]=a)}return a};var resetCache=()=>g={};setColors(e);let f=function(e){let t=chroma(getColor(e));return d&&t[d]?t[d]():t};return f.classes=function(e){if(e!=null){if(type_default(e)===`array`)l=e,a=[e[0],e[e.length-1]];else{let t=chroma.analyze(a);l=e===0?[t.min,t.max]:chroma.limits(t,`e`,e)}return f}return l},f.domain=function(e){if(!arguments.length)return o;o=e.slice(0),p=e[0],m=e[e.length-1],s=[];let t=u.length;if(e.length===t&&p!==m)for(let t of Array.from(e))s.push((t-p)/(m-p));else{for(let e=0;e<t;e++)s.push(e/(t-1));if(e.length>2){let t=e.map((t,n)=>n/(e.length-1)),n=e.map(e=>(e-p)/(m-p));n.every((e,n)=>t[n]===e)||(tMapDomain=e=>{if(e<=0||e>=1)return e;let r=0;for(;e>=n[r+1];)r++;let i=(e-n[r])/(n[r+1]-n[r]);return t[r]+i*(t[r+1]-t[r])})}}return a=[p,m],f},f.mode=function(e){return arguments.length?(t=e,resetCache(),f):t},f.range=function(e,t){return setColors(e,t),f},f.out=function(e){return d=e,f},f.spread=function(e){return arguments.length?(i=e,f):i},f.correctLightness=function(e){return e??=!0,h=e,resetCache(),tMapLightness=h?function(e){let t=getColor(0,!0).lab()[0],n=getColor(1,!0).lab()[0],r=t>n,i=getColor(e,!0).lab()[0],a=t+(n-t)*e,o=i-a,s=0,c=1,l=20;for(;Math.abs(o)>.01&&l-- >0;)(function(){return r&&(o*=-1),o<0?(s=e,e+=(c-e)*.5):(c=e,e+=(s-e)*.5),i=getColor(e,!0).lab()[0],o=i-a})();return e}:e=>e,f},f.padding=function(e){return e==null?c:(type_default(e)===`number`&&(e=[e,e]),c=e,f)},f.colors=function(t,n){arguments.length<2&&(n=`hex`);let r=[];if(arguments.length===0)r=u.slice(0);else if(t===1)r=[f(.5)];else if(t>1){let e=a[0],n=a[1]-e;r=__range__(0,t,!1).map(r=>f(e+r/(t-1)*n))}else{e=[];let t=[];if(l&&l.length>2)for(let e=1,n=l.length,r=1<=n;r?e<n:e>n;r?e++:e--)t.push((l[e-1]+l[e])*.5);else t=a;r=t.map(e=>f(e))}return chroma[n]&&(r=r.map(e=>e[n]())),r},f.cache=function(e){return e==null?_:(_=e,f)},f.gamma=function(e){return e==null?v:(v=e,f)},f.nodata=function(e){return e==null?n:(n=chroma(e),f)},f}e(scale_default,`default`);function __range__(e,t,n){let r=[],i=e<t,a=n?i?t+1:t-1:t;for(let t=e;i?t<a:t>a;i?t++:t--)r.push(t);return r}const binom_row=function(e){let t=[1,1];for(let n=1;n<e;n++){let e=[1];for(let n=1;n<=t.length;n++)e[n]=(t[n]||0)+t[n-1];t=e}return t},bezier=function(e){let I,t,n,r;if(e=e.map(e=>new Color(e)),e.length===2)[t,n]=e.map(e=>e.lab()),I=function(e){return new Color([0,1,2].map(r=>t[r]+e*(n[r]-t[r])),`lab`)};else if(e.length===3)[t,n,r]=e.map(e=>e.lab()),I=function(e){return new Color([0,1,2].map(i=>(1-e)*(1-e)*t[i]+2*(1-e)*e*n[i]+e*e*r[i]),`lab`)};else if(e.length===4){let i;[t,n,r,i]=e.map(e=>e.lab()),I=function(e){return new Color([0,1,2].map(a=>(1-e)*(1-e)*(1-e)*t[a]+3*(1-e)*(1-e)*e*n[a]+3*(1-e)*e*e*r[a]+e*e*e*i[a]),`lab`)}}else if(e.length>=5){let t,n,r;t=e.map(e=>e.lab()),r=e.length-1,n=binom_row(r),I=function(e){let i=1-e;return new Color([0,1,2].map(a=>t.reduce((t,o,s)=>t+n[s]*i**(r-s)*e**s*o[a],0)),`lab`)}}else throw RangeError(`No point in running bezier with only one color.`);return I};var he=e(e=>{let t=bezier(e);return t.scale=()=>scale_default(t),t},`default`);const{round:R}=Math;Color.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(R)},Color.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:R(t):t)};const rgb=(...e)=>new Color(...e,`rgb`);Object.assign(chroma,{rgb}),g.format.rgb=(...e)=>{let t=o(e,`rgba`);return t[3]===void 0&&(t[3]=1),t},g.autodetect.push({p:3,test:(...e)=>{if(e=o(e,`rgba`),type_default(e)===`array`&&(e.length===3||e.length===4&&type_default(e[3])==`number`&&e[3]>=0&&e[3]<=1))return`rgb`}});const blend=(e,t,n)=>{if(!blend[n])throw Error(`unknown blend mode `+n);return blend[n](e,t)},blend_f=e=>(t,n)=>{let r=chroma(n).rgb(),i=chroma(t).rgb();return chroma.rgb(e(r,i))},each=e=>(t,n)=>{let r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r},normal=e=>e,multiply=(e,t)=>e*t/255,darken=(e,t)=>e>t?t:e,lighten=(e,t)=>e>t?e:t,screen=(e,t)=>255*(1-(1-e/255)*(1-t/255)),overlay=(e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),burn=(e,t)=>255*(1-(1-t/255)/(e/255)),dodge=(e,t)=>e===255?255:(e=t/255*255/(1-e/255),e>255?255:e);blend.normal=blend_f(each(normal)),blend.multiply=blend_f(each(multiply)),blend.screen=blend_f(each(screen)),blend.overlay=blend_f(each(overlay)),blend.darken=blend_f(each(darken)),blend.lighten=blend_f(each(lighten)),blend.dodge=blend_f(each(dodge)),blend.burn=blend_f(each(burn));const{pow:ge,sin:_e,cos:ve}=Math;function cubehelix_default(e=300,t=-1.5,n=1,r=1,a=[0,1]){let o=0,s;type_default(a)===`array`?s=a[1]-a[0]:(s=0,a=[a,a]);let f=function(c){let l=d*((e+120)/360+t*c),u=ge(a[0]+s*c,r),p=(o===0?n:n[0]+c*o)*u*(1-u)/2,m=ve(l),h=_e(l),g=u+p*(-.14861*m+1.78277*h),_=u+p*(-.29227*m-.90649*h),v=u+1.97294*m*p;return chroma(i([g*255,_*255,v*255,1]))};return f.start=function(t){return t==null?e:(e=t,f)},f.rotations=function(e){return e==null?t:(t=e,f)},f.gamma=function(e){return e==null?r:(r=e,f)},f.hue=function(e){return e==null?n:(n=e,type_default(n)===`array`?(o=n[1]-n[0],o===0&&(n=n[1])):o=0,f)},f.lightness=function(e){return e==null?a:(type_default(e)===`array`?(a=e,s=e[1]-e[0]):(a=[e,e],s=0),f)},f.scale=()=>chroma.scale(f),f.hue(n),f}e(cubehelix_default,`default`);const{floor:ye,random:be}=Math;var xe=e((e=be)=>{let t=`#`;for(let n=0;n<6;n++)t+=`0123456789abcdef`.charAt(ye(e()*16));return new Color(t,`hex`)},`default`);const{log:z,pow:Se,floor:Ce,abs:we}=Math;function analyze(e,t=null){let n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return type_default(e)===`object`&&(e=Object.values(e)),e.forEach(e=>{t&&type_default(e)===`object`&&(e=e[t]),e!=null&&!isNaN(e)&&(n.values.push(e),n.sum+=e,e<n.min&&(n.min=e),e>n.max&&(n.max=e),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(e,t)=>limits(n,e,t),n}function limits(e,t=`equal`,n=7){type_default(e)==`array`&&(e=analyze(e));let{min:r,max:i}=e,a=e.values.sort((e,t)=>e-t);if(n===1)return[r,i];let o=[];if(t.substr(0,1)===`c`&&(o.push(r),o.push(i)),t.substr(0,1)===`e`){o.push(r);for(let e=1;e<n;e++)o.push(r+e/n*(i-r));o.push(i)}else if(t.substr(0,1)===`l`){if(r<=0)throw Error(`Logarithmic scales are only possible for values > 0`);let e=Math.LOG10E*z(r),t=Math.LOG10E*z(i);o.push(r);for(let r=1;r<n;r++)o.push(Se(10,e+r/n*(t-e)));o.push(i)}else if(t.substr(0,1)===`q`){o.push(r);for(let e=1;e<n;e++){let t=(a.length-1)*e/n,r=Ce(t);if(r===t)o.push(a[r]);else{let e=t-r;o.push(a[r]*(1-e)+a[r+1]*e)}}o.push(i)}else if(t.substr(0,1)===`k`){let e,t=a.length,s=Array(t),c=Array(n),l=!0,u=0,d=null;d=[],d.push(r);for(let e=1;e<n;e++)d.push(r+e/n*(i-r));for(d.push(i);l;){for(let e=0;e<n;e++)c[e]=0;for(let e=0;e<t;e++){let t=a[e],r=Number.MAX_VALUE,i;for(let a=0;a<n;a++){let n=we(d[a]-t);n<r&&(r=n,i=a),c[i]++,s[e]=i}}let r=Array(n);for(let e=0;e<n;e++)r[e]=null;for(let n=0;n<t;n++)e=s[n],r[e]===null?r[e]=a[n]:r[e]+=a[n];for(let e=0;e<n;e++)r[e]*=1/c[e];l=!1;for(let e=0;e<n;e++)if(r[e]!==d[e]){l=!0;break}d=r,u++,u>200&&(l=!1)}let p={};for(let e=0;e<n;e++)p[e]=[];for(let n=0;n<t;n++)e=s[n],p[e].push(a[n]);let m=[];for(let e=0;e<n;e++)m.push(p[e][0]),m.push(p[e][p[e].length-1]);m=m.sort((e,t)=>e-t),o.push(m[0]);for(let e=1;e<m.length;e+=2){let t=m[e];!isNaN(t)&&o.indexOf(t)===-1&&o.push(t)}}return o}var Te=e((e,t)=>{e=new Color(e),t=new Color(t);let n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},`default`);
1
+ import{r as e}from"../rolldown-runtime.mjs";const{min:t,max:n}=Math;var r=e((e,r=0,i=1)=>t(n(r,e),i),`default`),i=e(e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=r(e[t],0,255)):t===3&&(e[t]=r(e[t],0,1));return e},`default`);const a={};for(let e of[`Boolean`,`Number`,`String`,`Function`,`Array`,`Date`,`RegExp`,`Undefined`,`Null`])a[`[object ${e}]`]=e.toLowerCase();function type_default(e){return a[Object.prototype.toString.call(e)]||`object`}e(type_default,`default`);var o=e((e,t=null)=>e.length>=3?Array.prototype.slice.call(e):type_default(e[0])==`object`&&t?t.split(``).filter(t=>e[0][t]!==void 0).map(t=>e[0][t]):e[0].slice(0),`default`),s=e(e=>{if(e.length<2)return null;let t=e.length-1;return type_default(e[t])==`string`?e[t].toLowerCase():null},`default`);const{PI:c,min:l,max:u}=Math,rnd2=e=>Math.round(e*100)/100,rnd3=e=>Math.round(e*100)/100,d=c*2,p=c/3,m=c/180,h=180/c;function reverse3(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}var g={format:{},autodetect:[]},Color=class{constructor(...e){let t=this;if(type_default(e[0])===`object`&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let n=s(e),r=!1;if(!n){r=!0,g.sorted||=(g.autodetect=g.autodetect.sort((e,t)=>t.p-e.p),!0);for(let t of g.autodetect)if(n=t.test(...e),n)break}if(g.format[n])t._rgb=i(g.format[n].apply(null,r?e:e.slice(0,-1)));else throw Error(`unknown format: `+e);t._rgb.length===3&&t._rgb.push(1)}toString(){return type_default(this.hex)==`function`?this.hex():`[${this._rgb.join(`,`)}]`}};const chroma=(...e)=>new Color(...e);chroma.version=`3.2.0`;const _={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,laserlemon:`#ffff54`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrod:`#fafad2`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,maroon2:`#7f0000`,maroon3:`#b03060`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,purple2:`#7f007f`,purple3:`#a020f0`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`},v=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,y=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,hex2rgb=e=>{if(e.match(v)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(``),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let t=parseInt(e,16);return[t>>16,t>>8&255,t&255,1]}if(e.match(y)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(``),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);let t=parseInt(e,16);return[t>>24&255,t>>16&255,t>>8&255,Math.round((t&255)/255*100)/100]}throw Error(`unknown hex color: ${e}`)},{round:b}=Math,rgb2hex=(...e)=>{let[t,n,r,i]=o(e,`rgba`),a=s(e)||`auto`;i===void 0&&(i=1),a===`auto`&&(a=i<1?`rgba`:`rgb`),t=b(t),n=b(n),r=b(r);let c=`000000`+(t<<16|n<<8|r).toString(16);c=c.substr(c.length-6);let l=`0`+b(i*255).toString(16);switch(l=l.substr(l.length-2),a.toLowerCase()){case`rgba`:return`#${c}${l}`;case`argb`:return`#${l}${c}`;default:return`#${c}`}};Color.prototype.name=function(){let e=rgb2hex(this._rgb,`rgb`);for(let t of Object.keys(_))if(_[t]===e)return t.toLowerCase();return e},g.format.named=e=>{if(e=e.toLowerCase(),_[e])return hex2rgb(_[e]);throw Error(`unknown color name: `+e)},g.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&type_default(e)===`string`&&_[e.toLowerCase()])return`named`}}),Color.prototype.alpha=function(e,t=!1){return e!==void 0&&type_default(e)===`number`?t?(this._rgb[3]=e,this):new Color([this._rgb[0],this._rgb[1],this._rgb[2],e],`rgb`):this._rgb[3]},Color.prototype.clipped=function(){return this._rgb._clipped||!1};const x={Kn:18,labWhitePoint:`d65`,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},S=new Map([[`a`,[1.0985,.35585]],[`b`,[1.0985,.35585]],[`c`,[.98074,1.18232]],[`d50`,[.96422,.82521]],[`d55`,[.95682,.92149]],[`d65`,[.95047,1.08883]],[`e`,[1,1,1]],[`f2`,[.99186,.67393]],[`f7`,[.95041,1.08747]],[`f11`,[1.00962,.6435]],[`icc`,[.96422,.82521]]]);function setLabWhitePoint(e){let t=S.get(String(e).toLowerCase());if(!t)throw Error(`unknown Lab illuminant `+e);x.labWhitePoint=e,x.Xn=t[0],x.Zn=t[1]}function getLabWhitePoint(){return x.labWhitePoint}const lab2rgb=(...e)=>{e=o(e,`lab`);let[t,n,r]=e,[i,a,s]=lab2xyz(t,n,r),[c,l,u]=xyz2rgb(i,a,s);return[c,l,u,e.length>3?e[3]:1]},lab2xyz=(e,t,n)=>{let{kE:r,kK:i,kKE:a,Xn:o,Yn:s,Zn:c}=x,l=(e+16)/116,u=.002*t+l,d=l-.005*n,p=u*u*u,m=d*d*d,h=p>r?p:(116*u-16)/i,g=e>a?((e+16)/116)**3:e/i,_=m>r?m:(116*d-16)/i;return[h*o,g*s,_*c]},compand=e=>{let t=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055)*t},xyz2rgb=(e,t,n)=>{let{MtxAdaptMa:r,MtxAdaptMaI:i,MtxXYZ2RGB:a,RefWhiteRGB:o,Xn:s,Yn:c,Zn:l}=x,u=s*r.m00+c*r.m10+l*r.m20,d=s*r.m01+c*r.m11+l*r.m21,p=s*r.m02+c*r.m12+l*r.m22,m=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,h=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,g=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,_=(e*r.m00+t*r.m10+n*r.m20)*(m/u),v=(e*r.m01+t*r.m11+n*r.m21)*(h/d),y=(e*r.m02+t*r.m12+n*r.m22)*(g/p),b=_*i.m00+v*i.m10+y*i.m20,S=_*i.m01+v*i.m11+y*i.m21,C=_*i.m02+v*i.m12+y*i.m22,w=compand(b*a.m00+S*a.m10+C*a.m20),T=compand(b*a.m01+S*a.m11+C*a.m21),E=compand(b*a.m02+S*a.m12+C*a.m22);return[w*255,T*255,E*255]},rgb2lab=(...e)=>{let[t,n,r,...i]=o(e,`rgb`),[a,s,c]=rgb2xyz(t,n,r),[l,u,d]=xyz2lab(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]};function xyz2lab(e,t,n){let{Xn:r,Yn:i,Zn:a,kE:o,kK:s}=x,c=e/r,l=t/i,u=n/a,d=c>o?c**(1/3):(s*c+16)/116,p=l>o?l**(1/3):(s*l+16)/116,m=u>o?u**(1/3):(s*u+16)/116;return[116*p-16,500*(d-p),200*(p-m)]}function gammaAdjustSRGB(e){let t=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:((e+.055)/1.055)**2.4)*t}const rgb2xyz=(e,t,n)=>{e=gammaAdjustSRGB(e/255),t=gammaAdjustSRGB(t/255),n=gammaAdjustSRGB(n/255);let{MtxRGB2XYZ:r,MtxAdaptMa:i,MtxAdaptMaI:a,Xn:o,Yn:s,Zn:c,As:l,Bs:u,Cs:d}=x,p=e*r.m00+t*r.m10+n*r.m20,m=e*r.m01+t*r.m11+n*r.m21,h=e*r.m02+t*r.m12+n*r.m22,g=o*i.m00+s*i.m10+c*i.m20,_=o*i.m01+s*i.m11+c*i.m21,v=o*i.m02+s*i.m12+c*i.m22,y=p*i.m00+m*i.m10+h*i.m20,b=p*i.m01+m*i.m11+h*i.m21,S=p*i.m02+m*i.m12+h*i.m22;return y*=g/l,b*=_/u,S*=v/d,p=y*a.m00+b*a.m10+S*a.m20,m=y*a.m01+b*a.m11+S*a.m21,h=y*a.m02+b*a.m12+S*a.m22,[p,m,h]};Color.prototype.lab=function(){return rgb2lab(this._rgb)},Object.assign(chroma,{lab:e((...e)=>new Color(...e,`lab`),`lab`),getLabWhitePoint,setLabWhitePoint}),g.format.lab=lab2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`lab`),type_default(e)===`array`&&e.length===3)return`lab`}}),Color.prototype.darken=function(e=1){let t=this,n=t.lab();return n[0]-=x.Kn*e,new Color(n,`lab`).alpha(t.alpha(),!0)},Color.prototype.brighten=function(e=1){return this.darken(-e)},Color.prototype.darker=Color.prototype.darken,Color.prototype.brighter=Color.prototype.brighten,Color.prototype.get=function(e){let[t,n]=e.split(`.`),r=this[t]();if(n){let e=t.indexOf(n)-(t.substr(0,2)===`ok`?2:0);if(e>-1)return r[e];throw Error(`unknown channel ${n} in mode ${t}`)}else return r};const{pow:C}=Math;Color.prototype.luminance=function(e,t=`rgb`){if(e!==void 0&&type_default(e)===`number`){if(e===0)return new Color([0,0,0,this._rgb[3]],`rgb`);if(e===1)return new Color([255,255,255,this._rgb[3]],`rgb`);let n=this.luminance(),r=20,test=(n,i)=>{let a=n.interpolate(i,.5,t),o=a.luminance();return Math.abs(e-o)<1e-7||!r--?a:o>e?test(n,a):test(a,i)};return new Color([...(n>e?test(new Color([0,0,0]),this):test(this,new Color([255,255,255]))).rgb(),this._rgb[3]])}return rgb2luminance(...this._rgb.slice(0,3))};const rgb2luminance=(e,t,n)=>(e=luminance_x(e),t=luminance_x(t),n=luminance_x(n),.2126*e+.7152*t+.0722*n),luminance_x=e=>(e/=255,e<=.03928?e/12.92:C((e+.055)/1.055,2.4));var w={},T=e((e,t,n=.5,...r)=>{let i=r[0]||`lrgb`;if(!w[i]&&!r.length&&(i=Object.keys(w)[0]),!w[i])throw Error(`interpolation mode ${i} is not defined`);return type_default(e)!==`object`&&(e=new Color(e)),type_default(t)!==`object`&&(t=new Color(t)),w[i](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))},`default`);Color.prototype.mix=Color.prototype.interpolate=function(e,t=.5,...n){return T(this,e,t,...n)},Color.prototype.premultiply=function(e=!1){let t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new Color([t[0]*n,t[1]*n,t[2]*n,n],`rgb`)};const{sin:E,cos:ee}=Math,lch2lab=(...e)=>{let[t,n,r]=o(e,`lch`);return isNaN(r)&&(r=0),r*=m,[t,ee(r)*n,E(r)*n]},lch2rgb=(...e)=>{e=o(e,`lch`);let[t,n,r]=e,[i,a,s]=lch2lab(t,n,r),[c,l,u]=lab2rgb(i,a,s);return[c,l,u,e.length>3?e[3]:1]},hcl2rgb=(...e)=>lch2rgb(...reverse3(o(e,`hcl`))),{sqrt:D,atan2:te,round:O}=Math,lab2lch=(...e)=>{let[t,n,r]=o(e,`lab`),i=D(n*n+r*r),a=(te(r,n)*h+360)%360;return O(i*1e4)===0&&(a=NaN),[t,i,a]},rgb2lch=(...e)=>{let[t,n,r,...i]=o(e,`rgb`),[a,s,c]=rgb2lab(t,n,r),[l,u,d]=lab2lch(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]};Color.prototype.lch=function(){return rgb2lch(this._rgb)},Color.prototype.hcl=function(){return reverse3(rgb2lch(this._rgb))};const k=e((...e)=>new Color(...e,`lch`),`lch`),hcl=(...e)=>new Color(...e,`hcl`);Object.assign(chroma,{lch:k,hcl}),g.format.lch=lch2rgb,g.format.hcl=hcl2rgb,[`lch`,`hcl`].forEach(e=>g.autodetect.push({p:2,test:(...t)=>{if(t=o(t,e),type_default(t)===`array`&&t.length===3)return e}})),Color.prototype.saturate=function(e=1){let t=this,n=t.lch();return n[1]+=x.Kn*e,n[1]<0&&(n[1]=0),new Color(n,`lch`).alpha(t.alpha(),!0)},Color.prototype.desaturate=function(e=1){return this.saturate(-e)},Color.prototype.set=function(e,t,n=!1){let[r,i]=e.split(`.`),a=this[r]();if(i){let e=r.indexOf(i)-(r.substr(0,2)===`ok`?2:0);if(e>-1){if(type_default(t)==`string`)switch(t.charAt(0)){case`+`:a[e]+=+t;break;case`-`:a[e]+=+t;break;case`*`:a[e]*=+t.substr(1);break;case`/`:a[e]/=+t.substr(1);break;default:a[e]=+t}else if(type_default(t)===`number`)a[e]=t;else throw Error(`unsupported value for Color.set`);let i=new Color(a,r);return n?(this._rgb=i._rgb,this):i}throw Error(`unknown channel ${i} in mode ${r}`)}else return a},Color.prototype.tint=function(e=.5,...t){return T(this,`white`,e,...t)},Color.prototype.shade=function(e=.5,...t){return T(this,`black`,e,...t)},w.rgb=e((e,t,n)=>{let r=e._rgb,i=t._rgb;return new Color(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`rgb`)},`rgb`);const{sqrt:A,pow:j}=Math,lrgb=(e,t,n)=>{let[r,i,a]=e._rgb,[o,s,c]=t._rgb;return new Color(A(j(r,2)*(1-n)+j(o,2)*n),A(j(i,2)*(1-n)+j(s,2)*n),A(j(a,2)*(1-n)+j(c,2)*n),`rgb`)};w.lrgb=lrgb;const lab=(e,t,n)=>{let r=e.lab(),i=t.lab();return new Color(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`lab`)};w.lab=lab;var M=e((e,t,n,r)=>{let i,a;r===`hsl`?(i=e.hsl(),a=t.hsl()):r===`hsv`?(i=e.hsv(),a=t.hsv()):r===`hcg`?(i=e.hcg(),a=t.hcg()):r===`hsi`?(i=e.hsi(),a=t.hsi()):r===`lch`||r===`hcl`?(r=`hcl`,i=e.hcl(),a=t.hcl()):r===`oklch`&&(i=e.oklch().reverse(),a=t.oklch().reverse());let o,s,c,l,u,d;(r.substr(0,1)===`h`||r===`oklch`)&&([o,c,u]=i,[s,l,d]=a);let p,m,h,g;return!isNaN(o)&&!isNaN(s)?(g=s>o&&s-o>180?s-(o+360):s<o&&o-s>180?s+360-o:s-o,m=o+n*g):isNaN(o)?isNaN(s)?m=NaN:(m=s,(u==1||u==0)&&r!=`hsv`&&(p=l)):(m=o,(d==1||d==0)&&r!=`hsv`&&(p=c)),p===void 0&&(p=c+n*(l-c)),h=u+n*(d-u),r===`oklch`?new Color([h,p,m],r):new Color([m,p,h],r)},`default`);const lch=(e,t,n)=>M(e,t,n,`lch`);w.lch=lch,w.hcl=lch;const num2rgb=e=>{if(type_default(e)==`number`&&e>=0&&e<=16777215)return[e>>16,e>>8&255,e&255,1];throw Error(`unknown num color: `+e)},rgb2num=(...e)=>{let[t,n,r]=o(e,`rgb`);return(t<<16)+(n<<8)+r};Color.prototype.num=function(){return rgb2num(this._rgb)},Object.assign(chroma,{num:e((...e)=>new Color(...e,`num`),`num`)}),g.format.num=num2rgb,g.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&type_default(e[0])===`number`&&e[0]>=0&&e[0]<=16777215)return`num`}});const num=(e,t,n)=>{let r=e.num();return new Color(r+n*(t.num()-r),`num`)};w.num=num;const{floor:ne}=Math,hcg2rgb=(...e)=>{e=o(e,`hcg`);let[t,n,r]=e,i,a,s;r*=255;let c=n*255;if(n===0)i=a=s=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let e=ne(t),o=t-e,l=r*(1-n),u=l+c*(1-o),d=l+c*o,p=l+c;switch(e){case 0:[i,a,s]=[p,d,l];break;case 1:[i,a,s]=[u,p,l];break;case 2:[i,a,s]=[l,p,d];break;case 3:[i,a,s]=[l,u,p];break;case 4:[i,a,s]=[d,l,p];break;case 5:[i,a,s]=[p,l,u];break}}return[i,a,s,e.length>3?e[3]:1]},rgb2hcg=(...e)=>{let[t,n,r]=o(e,`rgb`),i=l(t,n,r),a=u(t,n,r),s=a-i,c=s*100/255,d=i/(255-s)*100,p;return s===0?p=NaN:(t===a&&(p=(n-r)/s),n===a&&(p=2+(r-t)/s),r===a&&(p=4+(t-n)/s),p*=60,p<0&&(p+=360)),[p,c,d]};Color.prototype.hcg=function(){return rgb2hcg(this._rgb)},chroma.hcg=e((...e)=>new Color(...e,`hcg`),`hcg`),g.format.hcg=hcg2rgb,g.autodetect.push({p:1,test:(...e)=>{if(e=o(e,`hcg`),type_default(e)===`array`&&e.length===3)return`hcg`}});const hcg=(e,t,n)=>M(e,t,n,`hcg`);w.hcg=hcg;const{cos:N}=Math,hsi2rgb=(...e)=>{e=o(e,`hsi`);let[t,n,i]=e,a,s,c;return isNaN(t)&&(t=0),isNaN(n)&&(n=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(c=(1-n)/3,a=(1+n*N(d*t)/N(p-d*t))/3,s=1-(c+a)):t<2/3?(t-=1/3,a=(1-n)/3,s=(1+n*N(d*t)/N(p-d*t))/3,c=1-(a+s)):(t-=2/3,s=(1-n)/3,c=(1+n*N(d*t)/N(p-d*t))/3,a=1-(s+c)),a=r(i*a*3),s=r(i*s*3),c=r(i*c*3),[a*255,s*255,c*255,e.length>3?e[3]:1]},{min:re,sqrt:ie,acos:ae}=Math,rgb2hsi=(...e)=>{let[t,n,r]=o(e,`rgb`);t/=255,n/=255,r/=255;let i,a=re(t,n,r),s=(t+n+r)/3,c=s>0?1-a/s:0;return c===0?i=NaN:(i=(t-n+(t-r))/2,i/=ie((t-n)*(t-n)+(t-r)*(n-r)),i=ae(i),r>n&&(i=d-i),i/=d),[i*360,c,s]};Color.prototype.hsi=function(){return rgb2hsi(this._rgb)},chroma.hsi=e((...e)=>new Color(...e,`hsi`),`hsi`),g.format.hsi=hsi2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`hsi`),type_default(e)===`array`&&e.length===3)return`hsi`}});const hsi=(e,t,n)=>M(e,t,n,`hsi`);w.hsi=hsi;const hsl2rgb=(...e)=>{e=o(e,`hsl`);let[t,n,r]=e,i,a,s;if(n===0)i=a=s=r*255;else{let e=[0,0,0],o=[0,0,0],c=r<.5?r*(1+n):r+n-r*n,l=2*r-c,u=t/360;e[0]=u+1/3,e[1]=u,e[2]=u-1/3;for(let t=0;t<3;t++)e[t]<0&&(e[t]+=1),e[t]>1&&--e[t],6*e[t]<1?o[t]=l+(c-l)*6*e[t]:2*e[t]<1?o[t]=c:3*e[t]<2?o[t]=l+(c-l)*(2/3-e[t])*6:o[t]=l;[i,a,s]=[o[0]*255,o[1]*255,o[2]*255]}return e.length>3?[i,a,s,e[3]]:[i,a,s,1]},oe=e((...e)=>{e=o(e,`rgba`);let[t,n,r]=e;t/=255,n/=255,r/=255;let i=l(t,n,r),a=u(t,n,r),s=(a+i)/2,c,d;return a===i?(c=0,d=NaN):c=s<.5?(a-i)/(a+i):(a-i)/(2-a-i),t==a?d=(n-r)/(a-i):n==a?d=2+(r-t)/(a-i):r==a&&(d=4+(t-n)/(a-i)),d*=60,d<0&&(d+=360),e.length>3&&e[3]!==void 0?[d,c,s,e[3]]:[d,c,s]},`rgb2hsl`);Color.prototype.hsl=function(){return oe(this._rgb)},chroma.hsl=e((...e)=>new Color(...e,`hsl`),`hsl`),g.format.hsl=hsl2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`hsl`),type_default(e)===`array`&&e.length===3)return`hsl`}});const hsl=(e,t,n)=>M(e,t,n,`hsl`);w.hsl=hsl;const{floor:se}=Math,hsv2rgb=(...e)=>{e=o(e,`hsv`);let[t,n,r]=e,i,a,s;if(r*=255,n===0)i=a=s=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let e=se(t),o=t-e,c=r*(1-n),l=r*(1-n*o),u=r*(1-n*(1-o));switch(e){case 0:[i,a,s]=[r,u,c];break;case 1:[i,a,s]=[l,r,c];break;case 2:[i,a,s]=[c,r,u];break;case 3:[i,a,s]=[c,l,r];break;case 4:[i,a,s]=[u,c,r];break;case 5:[i,a,s]=[r,c,l];break}}return[i,a,s,e.length>3?e[3]:1]},{min:ce,max:le}=Math,rgb2hsl=(...e)=>{e=o(e,`rgb`);let[t,n,r]=e,i=ce(t,n,r),a=le(t,n,r),s=a-i,c,l,u;return u=a/255,a===0?(c=NaN,l=0):(l=s/a,t===a&&(c=(n-r)/s),n===a&&(c=2+(r-t)/s),r===a&&(c=4+(t-n)/s),c*=60,c<0&&(c+=360)),[c,l,u]};Color.prototype.hsv=function(){return rgb2hsl(this._rgb)},chroma.hsv=e((...e)=>new Color(...e,`hsv`),`hsv`),g.format.hsv=hsv2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`hsv`),type_default(e)===`array`&&e.length===3)return`hsv`}});const hsv=(e,t,n)=>M(e,t,n,`hsv`);w.hsv=hsv;function multiplyMatrices(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(e=>[e]));let r=t[0].length,i=t[0].map((e,n)=>t.map(e=>e[n])),a=e.map(e=>i.map(t=>Array.isArray(e)?e.reduce((e,n,r)=>e+n*(t[r]||0),0):t.reduce((t,n)=>t+n*e,0)));return n===1&&(a=a[0]),r===1?a.map(e=>e[0]):a}const oklab2rgb=(...e)=>{e=o(e,`lab`);let[t,n,r,...i]=e,[a,s,c]=OKLab_to_XYZ([t,n,r]),[l,u,d]=xyz2rgb(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]};function OKLab_to_XYZ(e){return multiplyMatrices([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],multiplyMatrices([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],e).map(e=>e**3))}const rgb2oklab=(...e)=>{let[t,n,r,...i]=o(e,`rgb`);return[...XYZ_to_OKLab(rgb2xyz(t,n,r)),...i.length>0&&i[0]<1?[i[0]]:[]]};function XYZ_to_OKLab(e){return multiplyMatrices([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],multiplyMatrices([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],e).map(e=>Math.cbrt(e)))}Color.prototype.oklab=function(){return rgb2oklab(this._rgb)},Object.assign(chroma,{oklab:e((...e)=>new Color(...e,`oklab`),`oklab`)}),g.format.oklab=oklab2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`oklab`),type_default(e)===`array`&&e.length===3)return`oklab`}});const oklab=(e,t,n)=>{let r=e.oklab(),i=t.oklab();return new Color(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`oklab`)};w.oklab=oklab,w.oklch=e((e,t,n)=>M(e,t,n,`oklch`),`oklch`);const{pow:P,sqrt:F,PI:L,cos:ue,sin:de,atan2:fe}=Math;var pe=e((e,t=`lrgb`,n=null)=>{let r=e.length;n||=Array.from(Array(r)).map(()=>1);let i=r/n.reduce(function(e,t){return e+t});if(n.forEach((e,t)=>{n[t]*=i}),e=e.map(e=>new Color(e)),t===`lrgb`)return _average_lrgb(e,n);let a=e.shift(),o=a.get(t),s=[],c=0,l=0;for(let e=0;e<o.length;e++)if(o[e]=(o[e]||0)*n[0],s.push(isNaN(o[e])?0:n[0]),t.charAt(e)===`h`&&!isNaN(o[e])){let t=o[e]/180*L;c+=ue(t)*n[0],l+=de(t)*n[0]}let u=a.alpha()*n[0];e.forEach((e,r)=>{let i=e.get(t);u+=e.alpha()*n[r+1];for(let e=0;e<o.length;e++)if(!isNaN(i[e]))if(s[e]+=n[r+1],t.charAt(e)===`h`){let t=i[e]/180*L;c+=ue(t)*n[r+1],l+=de(t)*n[r+1]}else o[e]+=i[e]*n[r+1]});for(let e=0;e<o.length;e++)if(t.charAt(e)===`h`){let t=fe(l/s[e],c/s[e])/L*180;for(;t<0;)t+=360;for(;t>=360;)t-=360;o[e]=t}else o[e]=o[e]/s[e];return u/=r,new Color(o,t).alpha(u>.99999?1:u,!0)},`default`);const _average_lrgb=(e,t)=>{let n=e.length,r=[0,0,0,0];for(let i=0;i<e.length;i++){let a=e[i],o=t[i]/n,s=a._rgb;r[0]+=P(s[0],2)*o,r[1]+=P(s[1],2)*o,r[2]+=P(s[2],2)*o,r[3]+=s[3]*o}return r[0]=F(r[0]),r[1]=F(r[1]),r[2]=F(r[2]),r[3]>.9999999&&(r[3]=1),new Color(i(r))},{pow:me}=Math;function scale_default(e){let t=`rgb`,n=chroma(`#ccc`),i=0,a=[0,1],o=[0,1],s=[],c=[0,0],l=!1,u=[],d=!1,p=0,m=1,h=!1,g={},_=!0,v=1,setColors=function(e){if(e||=[`#fff`,`#000`],e&&type_default(e)===`string`&&chroma.brewer&&chroma.brewer[e.toLowerCase()]&&(e=chroma.brewer[e.toLowerCase()]),type_default(e)===`array`){e.length===1&&(e=[e[0],e[0]]),e=e.slice(0);for(let t=0;t<e.length;t++)e[t]=chroma(e[t]);s.length=0;for(let t=0;t<e.length;t++)s.push(t/(e.length-1))}return resetCache(),u=e},getClass=function(e){if(l!=null){let t=l.length-1,n=0;for(;n<t&&e>=l[n];)n++;return n-1}return 0},tMapLightness=e=>e,tMapDomain=e=>e,getColor=function(e,i){let a,o;if(i??=!1,isNaN(e)||e===null)return n;o=i?e:l&&l.length>2?getClass(e)/(l.length-2):m===p?1:(e-p)/(m-p),o=tMapDomain(o),i||(o=tMapLightness(o)),v!==1&&(o=me(o,v)),o=c[0]+o*(1-c[0]-c[1]),o=r(o,0,1);let d=Math.floor(o*1e4);if(_&&g[d])a=g[d];else{if(type_default(u)===`array`)for(let e=0;e<s.length;e++){let n=s[e];if(o<=n){a=u[e];break}if(o>=n&&e===s.length-1){a=u[e];break}if(o>n&&o<s[e+1]){o=(o-n)/(s[e+1]-n),a=chroma.interpolate(u[e],u[e+1],o,t);break}}else type_default(u)===`function`&&(a=u(o));_&&(g[d]=a)}return a};var resetCache=()=>g={};setColors(e);let f=function(e){let t=chroma(getColor(e));return d&&t[d]?t[d]():t};return f.classes=function(e){if(e!=null){if(type_default(e)===`array`)l=e,a=[e[0],e[e.length-1]];else{let t=chroma.analyze(a);l=e===0?[t.min,t.max]:chroma.limits(t,`e`,e)}return f}return l},f.domain=function(e){if(!arguments.length)return o;o=e.slice(0),p=e[0],m=e[e.length-1],s=[];let t=u.length;if(e.length===t&&p!==m)for(let t of Array.from(e))s.push((t-p)/(m-p));else{for(let e=0;e<t;e++)s.push(e/(t-1));if(e.length>2){let t=e.map((t,n)=>n/(e.length-1)),n=e.map(e=>(e-p)/(m-p));n.every((e,n)=>t[n]===e)||(tMapDomain=e=>{if(e<=0||e>=1)return e;let r=0;for(;e>=n[r+1];)r++;let i=(e-n[r])/(n[r+1]-n[r]);return t[r]+i*(t[r+1]-t[r])})}}return a=[p,m],f},f.mode=function(e){return arguments.length?(t=e,resetCache(),f):t},f.range=function(e,t){return setColors(e,t),f},f.out=function(e){return d=e,f},f.spread=function(e){return arguments.length?(i=e,f):i},f.correctLightness=function(e){return e??=!0,h=e,resetCache(),tMapLightness=h?function(e){let t=getColor(0,!0).lab()[0],n=getColor(1,!0).lab()[0],r=t>n,i=getColor(e,!0).lab()[0],a=t+(n-t)*e,o=i-a,s=0,c=1,l=20;for(;Math.abs(o)>.01&&l-->0;)(function(){return r&&(o*=-1),o<0?(s=e,e+=(c-e)*.5):(c=e,e+=(s-e)*.5),i=getColor(e,!0).lab()[0],o=i-a})();return e}:e=>e,f},f.padding=function(e){return e==null?c:(type_default(e)===`number`&&(e=[e,e]),c=e,f)},f.colors=function(t,n){arguments.length<2&&(n=`hex`);let r=[];if(arguments.length===0)r=u.slice(0);else if(t===1)r=[f(.5)];else if(t>1){let e=a[0],n=a[1]-e;r=__range__(0,t,!1).map(r=>f(e+r/(t-1)*n))}else{e=[];let t=[];if(l&&l.length>2)for(let e=1,n=l.length,r=1<=n;r?e<n:e>n;r?e++:e--)t.push((l[e-1]+l[e])*.5);else t=a;r=t.map(e=>f(e))}return chroma[n]&&(r=r.map(e=>e[n]())),r},f.cache=function(e){return e==null?_:(_=e,f)},f.gamma=function(e){return e==null?v:(v=e,f)},f.nodata=function(e){return e==null?n:(n=chroma(e),f)},f}e(scale_default,`default`);function __range__(e,t,n){let r=[],i=e<t,a=n?i?t+1:t-1:t;for(let t=e;i?t<a:t>a;i?t++:t--)r.push(t);return r}const binom_row=function(e){let t=[1,1];for(let n=1;n<e;n++){let e=[1];for(let n=1;n<=t.length;n++)e[n]=(t[n]||0)+t[n-1];t=e}return t},bezier=function(e){let I,t,n,r;if(e=e.map(e=>new Color(e)),e.length===2)[t,n]=e.map(e=>e.lab()),I=function(e){return new Color([0,1,2].map(r=>t[r]+e*(n[r]-t[r])),`lab`)};else if(e.length===3)[t,n,r]=e.map(e=>e.lab()),I=function(e){return new Color([0,1,2].map(i=>(1-e)*(1-e)*t[i]+2*(1-e)*e*n[i]+e*e*r[i]),`lab`)};else if(e.length===4){let i;[t,n,r,i]=e.map(e=>e.lab()),I=function(e){return new Color([0,1,2].map(a=>(1-e)*(1-e)*(1-e)*t[a]+3*(1-e)*(1-e)*e*n[a]+3*(1-e)*e*e*r[a]+e*e*e*i[a]),`lab`)}}else if(e.length>=5){let t,n,r;t=e.map(e=>e.lab()),r=e.length-1,n=binom_row(r),I=function(e){let i=1-e;return new Color([0,1,2].map(a=>t.reduce((t,o,s)=>t+n[s]*i**(r-s)*e**s*o[a],0)),`lab`)}}else throw RangeError(`No point in running bezier with only one color.`);return I};var he=e(e=>{let t=bezier(e);return t.scale=()=>scale_default(t),t},`default`);const{round:R}=Math;Color.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(R)},Color.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:R(t):t)};const rgb=(...e)=>new Color(...e,`rgb`);Object.assign(chroma,{rgb}),g.format.rgb=(...e)=>{let t=o(e,`rgba`);return t[3]===void 0&&(t[3]=1),t},g.autodetect.push({p:3,test:(...e)=>{if(e=o(e,`rgba`),type_default(e)===`array`&&(e.length===3||e.length===4&&type_default(e[3])==`number`&&e[3]>=0&&e[3]<=1))return`rgb`}});const blend=(e,t,n)=>{if(!blend[n])throw Error(`unknown blend mode `+n);return blend[n](e,t)},blend_f=e=>(t,n)=>{let r=chroma(n).rgb(),i=chroma(t).rgb();return chroma.rgb(e(r,i))},each=e=>(t,n)=>{let r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r},normal=e=>e,multiply=(e,t)=>e*t/255,darken=(e,t)=>e>t?t:e,lighten=(e,t)=>e>t?e:t,screen=(e,t)=>255*(1-(1-e/255)*(1-t/255)),overlay=(e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),burn=(e,t)=>255*(1-(1-t/255)/(e/255)),dodge=(e,t)=>e===255?255:(e=t/255*255/(1-e/255),e>255?255:e);blend.normal=blend_f(each(normal)),blend.multiply=blend_f(each(multiply)),blend.screen=blend_f(each(screen)),blend.overlay=blend_f(each(overlay)),blend.darken=blend_f(each(darken)),blend.lighten=blend_f(each(lighten)),blend.dodge=blend_f(each(dodge)),blend.burn=blend_f(each(burn));const{pow:ge,sin:_e,cos:ve}=Math;function cubehelix_default(e=300,t=-1.5,n=1,r=1,a=[0,1]){let o=0,s;type_default(a)===`array`?s=a[1]-a[0]:(s=0,a=[a,a]);let f=function(c){let l=d*((e+120)/360+t*c),u=ge(a[0]+s*c,r),p=(o===0?n:n[0]+c*o)*u*(1-u)/2,m=ve(l),h=_e(l),g=u+p*(-.14861*m+1.78277*h),_=u+p*(-.29227*m-.90649*h),v=u+1.97294*m*p;return chroma(i([g*255,_*255,v*255,1]))};return f.start=function(t){return t==null?e:(e=t,f)},f.rotations=function(e){return e==null?t:(t=e,f)},f.gamma=function(e){return e==null?r:(r=e,f)},f.hue=function(e){return e==null?n:(n=e,type_default(n)===`array`?(o=n[1]-n[0],o===0&&(n=n[1])):o=0,f)},f.lightness=function(e){return e==null?a:(type_default(e)===`array`?(a=e,s=e[1]-e[0]):(a=[e,e],s=0),f)},f.scale=()=>chroma.scale(f),f.hue(n),f}e(cubehelix_default,`default`);const{floor:ye,random:be}=Math;var xe=e((e=be)=>{let t=`#`;for(let n=0;n<6;n++)t+=`0123456789abcdef`.charAt(ye(e()*16));return new Color(t,`hex`)},`default`);const{log:z,pow:Se,floor:Ce,abs:we}=Math;function analyze(e,t=null){let n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return type_default(e)===`object`&&(e=Object.values(e)),e.forEach(e=>{t&&type_default(e)===`object`&&(e=e[t]),e!=null&&!isNaN(e)&&(n.values.push(e),n.sum+=e,e<n.min&&(n.min=e),e>n.max&&(n.max=e),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(e,t)=>limits(n,e,t),n}function limits(e,t=`equal`,n=7){type_default(e)==`array`&&(e=analyze(e));let{min:r,max:i}=e,a=e.values.sort((e,t)=>e-t);if(n===1)return[r,i];let o=[];if(t.substr(0,1)===`c`&&(o.push(r),o.push(i)),t.substr(0,1)===`e`){o.push(r);for(let e=1;e<n;e++)o.push(r+e/n*(i-r));o.push(i)}else if(t.substr(0,1)===`l`){if(r<=0)throw Error(`Logarithmic scales are only possible for values > 0`);let e=Math.LOG10E*z(r),t=Math.LOG10E*z(i);o.push(r);for(let r=1;r<n;r++)o.push(Se(10,e+r/n*(t-e)));o.push(i)}else if(t.substr(0,1)===`q`){o.push(r);for(let e=1;e<n;e++){let t=(a.length-1)*e/n,r=Ce(t);if(r===t)o.push(a[r]);else{let e=t-r;o.push(a[r]*(1-e)+a[r+1]*e)}}o.push(i)}else if(t.substr(0,1)===`k`){let e,t=a.length,s=Array(t),c=Array(n),l=!0,u=0,d=null;d=[],d.push(r);for(let e=1;e<n;e++)d.push(r+e/n*(i-r));for(d.push(i);l;){for(let e=0;e<n;e++)c[e]=0;for(let e=0;e<t;e++){let t=a[e],r=Number.MAX_VALUE,i;for(let a=0;a<n;a++){let n=we(d[a]-t);n<r&&(r=n,i=a),c[i]++,s[e]=i}}let r=Array(n);for(let e=0;e<n;e++)r[e]=null;for(let n=0;n<t;n++)e=s[n],r[e]===null?r[e]=a[n]:r[e]+=a[n];for(let e=0;e<n;e++)r[e]*=1/c[e];l=!1;for(let e=0;e<n;e++)if(r[e]!==d[e]){l=!0;break}d=r,u++,u>200&&(l=!1)}let p={};for(let e=0;e<n;e++)p[e]=[];for(let n=0;n<t;n++)e=s[n],p[e].push(a[n]);let m=[];for(let e=0;e<n;e++)m.push(p[e][0]),m.push(p[e][p[e].length-1]);m=m.sort((e,t)=>e-t),o.push(m[0]);for(let e=1;e<m.length;e+=2){let t=m[e];!isNaN(t)&&o.indexOf(t)===-1&&o.push(t)}}return o}var Te=e((e,t)=>{e=new Color(e),t=new Color(t);let n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},`default`);
2
2
  /**
3
3
  * @license
4
4
  *
@@ -12,4 +12,4 @@ import{i as e}from"../rolldown-runtime.mjs";const{min:t,max:n}=Math;var r=e((e,r
12
12
  * You can read more about the APCA Readability Criterion at
13
13
  * https://readtech.org/ARC/
14
14
  */
15
- const Ee=.027,De=1.14,B=.022,Oe=1.414;var ke=e((e,t)=>{e=new Color(e),t=new Color(t),e.alpha()<1&&(e=T(t,e,e.alpha(),`rgb`));let n=lum(...e.rgb()),r=lum(...t.rgb()),i=n>=B?n:n+(B-n)**Oe,a=r>=B?r:r+(B-r)**Oe,o=a**.56-i**.57,s=a**.65-i**.62,c=Math.abs(a-i)<5e-4?0:i<a?o*De:s*De;return(Math.abs(c)<.1?0:c>0?c-Ee:c+Ee)*100},`default`);function lum(e,t,n){return .2126729*(e/255)**2.4+.7151522*(t/255)**2.4+.072175*(n/255)**2.4}const{sqrt:V,pow:H,min:Ae,max:je,atan2:Me,abs:Ne,cos:U,sin:Pe,exp:Fe,PI:Ie}=Math;function delta_e_default(e,t,n=1,r=1,i=1){var rad2deg=function(e){return 360*e/(2*Ie)},deg2rad=function(e){return 2*Ie*e/360};e=new Color(e),t=new Color(t);let[a,o,s]=Array.from(e.lab()),[c,l,u]=Array.from(t.lab()),d=(a+c)/2,p=(V(H(o,2)+H(s,2))+V(H(l,2)+H(u,2)))/2,m=.5*(1-V(H(p,7)/(H(p,7)+H(25,7)))),h=o*(1+m),g=l*(1+m),_=V(H(h,2)+H(s,2)),v=V(H(g,2)+H(u,2)),y=(_+v)/2,b=rad2deg(Me(s,h)),x=rad2deg(Me(u,g)),S=b>=0?b:b+360,C=x>=0?x:x+360,w=Ne(S-C)>180?(S+C+360)/2:(S+C)/2,T=1-.17*U(deg2rad(w-30))+.24*U(deg2rad(2*w))+.32*U(deg2rad(3*w+6))-.2*U(deg2rad(4*w-63)),E=C-S;E=Ne(E)<=180?E:C<=S?E+360:E-360,E=2*V(_*v)*Pe(deg2rad(E)/2);let ee=c-a,D=v-_,te=1+.015*H(d-50,2)/V(20+H(d-50,2)),O=1+.045*y,k=1+.015*y*T,A=30*Fe(-H((w-275)/25,2)),j=-(2*V(H(y,7)/(H(y,7)+H(25,7))))*Pe(2*deg2rad(A));return je(0,Ae(100,V(H(ee/(n*te),2)+H(D/(r*O),2)+H(E/(i*k),2)+j*(D/(r*O))*(E/(i*k)))))}e(delta_e_default,`default`);function distance_default(e,t,n=`lab`){e=new Color(e),t=new Color(t);let r=e.get(n),i=t.get(n),a=0;for(let e in r){let t=(r[e]||0)-(i[e]||0);a+=t*t}return Math.sqrt(a)}e(distance_default,`default`);var Le=e((...e)=>{try{return new Color(...e),!0}catch{return!1}},`default`),Re={cool(){return scale_default([chroma.hsl(180,1,.9),chroma.hsl(250,.7,.4)])},hot(){return scale_default([`#000`,`#f00`,`#ff0`,`#fff`],[0,.25,.75,1]).mode(`rgb`)}};const W={OrRd:[`#fff7ec`,`#fee8c8`,`#fdd49e`,`#fdbb84`,`#fc8d59`,`#ef6548`,`#d7301f`,`#b30000`,`#7f0000`],PuBu:[`#fff7fb`,`#ece7f2`,`#d0d1e6`,`#a6bddb`,`#74a9cf`,`#3690c0`,`#0570b0`,`#045a8d`,`#023858`],BuPu:[`#f7fcfd`,`#e0ecf4`,`#bfd3e6`,`#9ebcda`,`#8c96c6`,`#8c6bb1`,`#88419d`,`#810f7c`,`#4d004b`],Oranges:[`#fff5eb`,`#fee6ce`,`#fdd0a2`,`#fdae6b`,`#fd8d3c`,`#f16913`,`#d94801`,`#a63603`,`#7f2704`],BuGn:[`#f7fcfd`,`#e5f5f9`,`#ccece6`,`#99d8c9`,`#66c2a4`,`#41ae76`,`#238b45`,`#006d2c`,`#00441b`],YlOrBr:[`#ffffe5`,`#fff7bc`,`#fee391`,`#fec44f`,`#fe9929`,`#ec7014`,`#cc4c02`,`#993404`,`#662506`],YlGn:[`#ffffe5`,`#f7fcb9`,`#d9f0a3`,`#addd8e`,`#78c679`,`#41ab5d`,`#238443`,`#006837`,`#004529`],Reds:[`#fff5f0`,`#fee0d2`,`#fcbba1`,`#fc9272`,`#fb6a4a`,`#ef3b2c`,`#cb181d`,`#a50f15`,`#67000d`],RdPu:[`#fff7f3`,`#fde0dd`,`#fcc5c0`,`#fa9fb5`,`#f768a1`,`#dd3497`,`#ae017e`,`#7a0177`,`#49006a`],Greens:[`#f7fcf5`,`#e5f5e0`,`#c7e9c0`,`#a1d99b`,`#74c476`,`#41ab5d`,`#238b45`,`#006d2c`,`#00441b`],YlGnBu:[`#ffffd9`,`#edf8b1`,`#c7e9b4`,`#7fcdbb`,`#41b6c4`,`#1d91c0`,`#225ea8`,`#253494`,`#081d58`],Purples:[`#fcfbfd`,`#efedf5`,`#dadaeb`,`#bcbddc`,`#9e9ac8`,`#807dba`,`#6a51a3`,`#54278f`,`#3f007d`],GnBu:[`#f7fcf0`,`#e0f3db`,`#ccebc5`,`#a8ddb5`,`#7bccc4`,`#4eb3d3`,`#2b8cbe`,`#0868ac`,`#084081`],Greys:[`#ffffff`,`#f0f0f0`,`#d9d9d9`,`#bdbdbd`,`#969696`,`#737373`,`#525252`,`#252525`,`#000000`],YlOrRd:[`#ffffcc`,`#ffeda0`,`#fed976`,`#feb24c`,`#fd8d3c`,`#fc4e2a`,`#e31a1c`,`#bd0026`,`#800026`],PuRd:[`#f7f4f9`,`#e7e1ef`,`#d4b9da`,`#c994c7`,`#df65b0`,`#e7298a`,`#ce1256`,`#980043`,`#67001f`],Blues:[`#f7fbff`,`#deebf7`,`#c6dbef`,`#9ecae1`,`#6baed6`,`#4292c6`,`#2171b5`,`#08519c`,`#08306b`],PuBuGn:[`#fff7fb`,`#ece2f0`,`#d0d1e6`,`#a6bddb`,`#67a9cf`,`#3690c0`,`#02818a`,`#016c59`,`#014636`],Viridis:[`#440154`,`#482777`,`#3f4a8a`,`#31678e`,`#26838f`,`#1f9d8a`,`#6cce5a`,`#b6de2b`,`#fee825`],Spectral:[`#9e0142`,`#d53e4f`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#e6f598`,`#abdda4`,`#66c2a5`,`#3288bd`,`#5e4fa2`],RdYlGn:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#d9ef8b`,`#a6d96a`,`#66bd63`,`#1a9850`,`#006837`],RdBu:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#f7f7f7`,`#d1e5f0`,`#92c5de`,`#4393c3`,`#2166ac`,`#053061`],PiYG:[`#8e0152`,`#c51b7d`,`#de77ae`,`#f1b6da`,`#fde0ef`,`#f7f7f7`,`#e6f5d0`,`#b8e186`,`#7fbc41`,`#4d9221`,`#276419`],PRGn:[`#40004b`,`#762a83`,`#9970ab`,`#c2a5cf`,`#e7d4e8`,`#f7f7f7`,`#d9f0d3`,`#a6dba0`,`#5aae61`,`#1b7837`,`#00441b`],RdYlBu:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee090`,`#ffffbf`,`#e0f3f8`,`#abd9e9`,`#74add1`,`#4575b4`,`#313695`],BrBG:[`#543005`,`#8c510a`,`#bf812d`,`#dfc27d`,`#f6e8c3`,`#f5f5f5`,`#c7eae5`,`#80cdc1`,`#35978f`,`#01665e`,`#003c30`],RdGy:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#ffffff`,`#e0e0e0`,`#bababa`,`#878787`,`#4d4d4d`,`#1a1a1a`],PuOr:[`#7f3b08`,`#b35806`,`#e08214`,`#fdb863`,`#fee0b6`,`#f7f7f7`,`#d8daeb`,`#b2abd2`,`#8073ac`,`#542788`,`#2d004b`],Set2:[`#66c2a5`,`#fc8d62`,`#8da0cb`,`#e78ac3`,`#a6d854`,`#ffd92f`,`#e5c494`,`#b3b3b3`],Accent:[`#7fc97f`,`#beaed4`,`#fdc086`,`#ffff99`,`#386cb0`,`#f0027f`,`#bf5b17`,`#666666`],Set1:[`#e41a1c`,`#377eb8`,`#4daf4a`,`#984ea3`,`#ff7f00`,`#ffff33`,`#a65628`,`#f781bf`,`#999999`],Set3:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`,`#b3de69`,`#fccde5`,`#d9d9d9`,`#bc80bd`,`#ccebc5`,`#ffed6f`],Dark2:[`#1b9e77`,`#d95f02`,`#7570b3`,`#e7298a`,`#66a61e`,`#e6ab02`,`#a6761d`,`#666666`],Paired:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`,`#fdbf6f`,`#ff7f00`,`#cab2d6`,`#6a3d9a`,`#ffff99`,`#b15928`],Pastel2:[`#b3e2cd`,`#fdcdac`,`#cbd5e8`,`#f4cae4`,`#e6f5c9`,`#fff2ae`,`#f1e2cc`,`#cccccc`],Pastel1:[`#fbb4ae`,`#b3cde3`,`#ccebc5`,`#decbe4`,`#fed9a6`,`#ffffcc`,`#e5d8bd`,`#fddaec`,`#f2f2f2`]},ze=Object.keys(W),Be=new Map(ze.map(e=>[e.toLowerCase(),e])),Ve=typeof Proxy==`function`?new Proxy(W,{get(e,t){let n=t.toLowerCase();if(Be.has(n))return e[Be.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(ze)}}):W,cmyk2rgb=(...e)=>{e=o(e,`cmyk`);let[t,n,r,i]=e,a=e.length>4?e[4]:1;return i===1?[0,0,0,a]:[t>=1?0:255*(1-t)*(1-i),n>=1?0:255*(1-n)*(1-i),r>=1?0:255*(1-r)*(1-i),a]},{max:He}=Math,rgb2cmyk=(...e)=>{let[t,n,r]=o(e,`rgb`);t/=255,n/=255,r/=255;let i=1-He(t,He(n,r)),a=i<1?1/(1-i):0;return[(1-t-i)*a,(1-n-i)*a,(1-r-i)*a,i]};Color.prototype.cmyk=function(){return rgb2cmyk(this._rgb)};const cmyk=(...e)=>new Color(...e,`cmyk`);Object.assign(chroma,{cmyk}),g.format.cmyk=cmyk2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`cmyk`),type_default(e)===`array`&&e.length===4)return`cmyk`}});const hsl2css=(...e)=>{let t=o(e,`hsla`),n=s(e)||`lsa`;return t[0]=rnd2(t[0]||0)+`deg`,t[1]=rnd2(t[1]*100)+`%`,t[2]=rnd2(t[2]*100)+`%`,n===`hsla`||t.length>3&&t[3]<1?(t[3]=`/ `+(t.length>3?t[3]:1),n=`hsla`):t.length=3,`${n.substr(0,3)}(${t.join(` `)})`},lab2css=(...e)=>{let t=o(e,`lab`),n=s(e)||`lab`;return t[0]=rnd2(t[0])+`%`,t[1]=rnd2(t[1]),t[2]=rnd2(t[2]),n===`laba`||t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(` `)})`},lch2css=(...e)=>{let t=o(e,`lch`),n=s(e)||`lab`;return t[0]=rnd2(t[0])+`%`,t[1]=rnd2(t[1]),t[2]=isNaN(t[2])?`none`:rnd2(t[2])+`deg`,n===`lcha`||t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(` `)})`},oklab2css=(...e)=>{let t=o(e,`lab`);return t[0]=rnd2(t[0]*100)+`%`,t[1]=rnd3(t[1]),t[2]=rnd3(t[2]),t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(` `)})`},rgb2oklch=(...e)=>{let[t,n,r,...i]=o(e,`rgb`),[a,s,c]=rgb2oklab(t,n,r),[l,u,d]=lab2lch(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]},oklch2css=(...e)=>{let t=o(e,`lch`);return t[0]=rnd2(t[0]*100)+`%`,t[1]=rnd3(t[1]),t[2]=isNaN(t[2])?`none`:rnd2(t[2])+`deg`,t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(` `)})`},{round:G}=Math,rgb2css=(...e)=>{let t=o(e,`rgba`),n=s(e)||`rgb`;if(n.substr(0,3)===`hsl`)return hsl2css(oe(t),n);if(n.substr(0,3)===`lab`){let e=getLabWhitePoint();setLabWhitePoint(`d50`);let r=lab2css(rgb2lab(t),n);return setLabWhitePoint(e),r}if(n.substr(0,3)===`lch`){let e=getLabWhitePoint();setLabWhitePoint(`d50`);let r=lch2css(rgb2lch(t),n);return setLabWhitePoint(e),r}return n.substr(0,5)===`oklab`?oklab2css(rgb2oklab(t)):n.substr(0,5)===`oklch`?oklch2css(rgb2oklch(t)):(t[0]=G(t[0]),t[1]=G(t[1]),t[2]=G(t[2]),(n===`rgba`||t.length>3&&t[3]<1)&&(t[3]=`/ `+(t.length>3?t[3]:1),n=`rgba`),`${n.substr(0,3)}(${t.slice(0,n===`rgb`?3:4).join(` `)})`)},oklch2rgb=(...e)=>{e=o(e,`lch`);let[t,n,r,...i]=e,[a,s,c]=lch2lab(t,n,r),[l,u,d]=oklab2rgb(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]},K=`((?:-?\\d+)|(?:-?\\d+(?:\\.\\d+)?)%|none)`,q=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%?)|none)`,J=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%)|none)`,Y=`\\s*,\\s*`,X=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:deg)?)|none)`,Ue=RegExp(`^rgba?\\(\\s*`+[K,K,K].join(`\\s+`)+`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?\\)$`),We=RegExp(`^rgb\\(\\s*`+[K,K,K].join(Y)+`\\s*\\)$`),Ge=RegExp(`^rgba\\(\\s*`+[K,K,K,q].join(Y)+`\\s*\\)$`),Ke=RegExp(`^hsla?\\(\\s*`+[X,J,J].join(`\\s+`)+`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?\\)$`),qe=RegExp(`^hsl?\\(\\s*`+[X,J,J].join(Y)+`\\s*\\)$`),Je=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Z=RegExp(`^lab\\(\\s*`+[q,q,q].join(`\\s+`)+`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?\\)$`),Ye=RegExp(`^lch\\(\\s*`+[q,q,X].join(`\\s+`)+`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?\\)$`),Xe=RegExp(`^oklab\\(\\s*`+[q,q,q].join(`\\s+`)+`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?\\)$`),Ze=RegExp(`^oklch\\(\\s*`+[q,q,X].join(`\\s+`)+`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?\\)$`),{round:Q}=Math,roundRGB=e=>e.map((e,t)=>t<=2?r(Q(e),0,255):e),percentToAbsolute=(e,t=0,n=100,r=!1)=>(typeof e==`string`&&e.endsWith(`%`)&&(e=parseFloat(e.substring(0,e.length-1))/100,e=r?t+(e+1)*.5*(n-t):t+e*(n-t)),+e),noneToValue=(e,t)=>e===`none`?t:e,css2rgb=e=>{if(e=e.toLowerCase().trim(),e===`transparent`)return[0,0,0,0];let t;if(g.format.named)try{return g.format.named(e)}catch{}if((t=e.match(Ue))||(t=e.match(We))){let e=t.slice(1,4);for(let t=0;t<3;t++)e[t]=+percentToAbsolute(noneToValue(e[t],0),0,255);e=roundRGB(e);let n=t[4]===void 0?1:+percentToAbsolute(t[4],0,1);return e[3]=n,e}if(t=e.match(Ge)){let e=t.slice(1,5);for(let t=0;t<4;t++)e[t]=+percentToAbsolute(e[t],0,255);return e}if((t=e.match(Ke))||(t=e.match(qe))){let e=t.slice(1,4);e[0]=+noneToValue(e[0].replace(`deg`,``),0),e[1]=percentToAbsolute(noneToValue(e[1],0),0,100)*.01,e[2]=percentToAbsolute(noneToValue(e[2],0),0,100)*.01;let n=roundRGB(hsl2rgb(e));return n[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),n}if(t=e.match(Je)){let e=t.slice(1,4);e[1]*=.01,e[2]*=.01;let n=hsl2rgb(e);for(let e=0;e<3;e++)n[e]=Q(n[e]);return n[3]=+t[4],n}if(t=e.match(Z)){let e=t.slice(1,4);e[0]=percentToAbsolute(noneToValue(e[0],0),0,100),e[1]=percentToAbsolute(noneToValue(e[1],0),-125,125,!0),e[2]=percentToAbsolute(noneToValue(e[2],0),-125,125,!0);let n=getLabWhitePoint();setLabWhitePoint(`d50`);let r=roundRGB(lab2rgb(e));return setLabWhitePoint(n),r[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),r}if(t=e.match(Ye)){let e=t.slice(1,4);e[0]=percentToAbsolute(e[0],0,100),e[1]=percentToAbsolute(noneToValue(e[1],0),0,150,!1),e[2]=+noneToValue(e[2].replace(`deg`,``),0);let n=getLabWhitePoint();setLabWhitePoint(`d50`);let r=roundRGB(lch2rgb(e));return setLabWhitePoint(n),r[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),r}if(t=e.match(Xe)){let e=t.slice(1,4);e[0]=percentToAbsolute(noneToValue(e[0],0),0,1),e[1]=percentToAbsolute(noneToValue(e[1],0),-.4,.4,!0),e[2]=percentToAbsolute(noneToValue(e[2],0),-.4,.4,!0);let n=roundRGB(oklab2rgb(e));return n[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),n}if(t=e.match(Ze)){let e=t.slice(1,4);e[0]=percentToAbsolute(noneToValue(e[0],0),0,1),e[1]=percentToAbsolute(noneToValue(e[1],0),0,.4,!1),e[2]=+noneToValue(e[2].replace(`deg`,``),0);let n=roundRGB(oklch2rgb(e));return n[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),n}};css2rgb.test=e=>Ue.test(e)||Ke.test(e)||Z.test(e)||Ye.test(e)||Xe.test(e)||Ze.test(e)||We.test(e)||Ge.test(e)||qe.test(e)||Je.test(e)||e===`transparent`,Color.prototype.css=function(e){return rgb2css(this._rgb,e)};const css=(...e)=>new Color(...e,`css`);chroma.css=css,g.format.css=css2rgb,g.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&type_default(e)===`string`&&css2rgb.test(e))return`css`}}),g.format.gl=(...e)=>{let t=o(e,`rgba`);return t[0]*=255,t[1]*=255,t[2]*=255,t};const gl=(...e)=>new Color(...e,`gl`);chroma.gl=gl,Color.prototype.gl=function(){let e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},Color.prototype.hex=function(e){return rgb2hex(this._rgb,e)};const hex=(...e)=>new Color(...e,`hex`);chroma.hex=hex,g.format.hex=hex2rgb,g.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&type_default(e)===`string`&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return`hex`}});const{log:$}=Math,temperature2rgb=e=>{let t=e/100,n,r,i;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*$(r),i=t<20?0:-254.76935184120902+.8274096064007395*(i=t-10)+115.67994401066147*$(i)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*$(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*$(r),i=255),[n,r,i,1]},{round:Qe}=Math,rgb2temperature=(...e)=>{let t=o(e,`rgb`),n=t[0],r=t[2],i=1e3,a=4e4,s;for(;a-i>.4;){s=(a+i)*.5;let e=temperature2rgb(s);e[2]/e[0]>=r/n?a=s:i=s}return Qe(s)};Color.prototype.temp=Color.prototype.kelvin=Color.prototype.temperature=function(){return rgb2temperature(this._rgb)};const temp=(...e)=>new Color(...e,`temp`);Object.assign(chroma,{temp,kelvin:temp,temperature:temp}),g.format.temp=g.format.kelvin=g.format.temperature=temperature2rgb,Color.prototype.oklch=function(){return rgb2oklch(this._rgb)};const oklch=(...e)=>new Color(...e,`oklch`);Object.assign(chroma,{oklch}),g.format.oklch=oklch2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`oklch`),type_default(e)===`array`&&e.length===3)return`oklch`}}),Object.assign(chroma,{analyze,average:pe,bezier:he,blend,brewer:Ve,Color,colors:_,contrast:Te,contrastAPCA:ke,cubehelix:cubehelix_default,deltaE:delta_e_default,distance:distance_default,input:g,interpolate:T,limits,mix:T,random:xe,scale:scale_default,scales:Re,valid:Le});var $e=chroma;export{$e as t};
15
+ const Ee=.027,De=1.14,B=.022,Oe=1.414;var ke=e((e,t)=>{e=new Color(e),t=new Color(t),e.alpha()<1&&(e=T(t,e,e.alpha(),`rgb`));let n=lum(...e.rgb()),r=lum(...t.rgb()),i=n>=B?n:n+(B-n)**Oe,a=r>=B?r:r+(B-r)**Oe,o=a**.56-i**.57,s=a**.65-i**.62,c=Math.abs(a-i)<5e-4?0:i<a?o*De:s*De;return(Math.abs(c)<.1?0:c>0?c-Ee:c+Ee)*100},`default`);function lum(e,t,n){return .2126729*(e/255)**2.4+.7151522*(t/255)**2.4+.072175*(n/255)**2.4}const{sqrt:V,pow:H,min:Ae,max:je,atan2:Me,abs:Ne,cos:U,sin:Pe,exp:Fe,PI:Ie}=Math;function delta_e_default(e,t,n=1,r=1,i=1){var rad2deg=function(e){return 360*e/(2*Ie)},deg2rad=function(e){return 2*Ie*e/360};e=new Color(e),t=new Color(t);let[a,o,s]=Array.from(e.lab()),[c,l,u]=Array.from(t.lab()),d=(a+c)/2,p=(V(H(o,2)+H(s,2))+V(H(l,2)+H(u,2)))/2,m=.5*(1-V(H(p,7)/(H(p,7)+H(25,7)))),h=o*(1+m),g=l*(1+m),_=V(H(h,2)+H(s,2)),v=V(H(g,2)+H(u,2)),y=(_+v)/2,b=rad2deg(Me(s,h)),x=rad2deg(Me(u,g)),S=b>=0?b:b+360,C=x>=0?x:x+360,w=Ne(S-C)>180?(S+C+360)/2:(S+C)/2,T=1-.17*U(deg2rad(w-30))+.24*U(deg2rad(2*w))+.32*U(deg2rad(3*w+6))-.2*U(deg2rad(4*w-63)),E=C-S;E=Ne(E)<=180?E:C<=S?E+360:E-360,E=2*V(_*v)*Pe(deg2rad(E)/2);let ee=c-a,D=v-_,te=1+.015*H(d-50,2)/V(20+H(d-50,2)),O=1+.045*y,k=1+.015*y*T,A=30*Fe(-H((w-275)/25,2)),j=-(2*V(H(y,7)/(H(y,7)+H(25,7))))*Pe(2*deg2rad(A)),M=V(H(ee/(n*te),2)+H(D/(r*O),2)+H(E/(i*k),2)+j*(D/(r*O))*(E/(i*k)));return je(0,Ae(100,M))}e(delta_e_default,`default`);function distance_default(e,t,n=`lab`){e=new Color(e),t=new Color(t);let r=e.get(n),i=t.get(n),a=0;for(let e in r){let t=(r[e]||0)-(i[e]||0);a+=t*t}return Math.sqrt(a)}e(distance_default,`default`);var Le=e((...e)=>{try{return new Color(...e),!0}catch{return!1}},`default`),Re={cool(){return scale_default([chroma.hsl(180,1,.9),chroma.hsl(250,.7,.4)])},hot(){return scale_default([`#000`,`#f00`,`#ff0`,`#fff`],[0,.25,.75,1]).mode(`rgb`)}};const W={OrRd:[`#fff7ec`,`#fee8c8`,`#fdd49e`,`#fdbb84`,`#fc8d59`,`#ef6548`,`#d7301f`,`#b30000`,`#7f0000`],PuBu:[`#fff7fb`,`#ece7f2`,`#d0d1e6`,`#a6bddb`,`#74a9cf`,`#3690c0`,`#0570b0`,`#045a8d`,`#023858`],BuPu:[`#f7fcfd`,`#e0ecf4`,`#bfd3e6`,`#9ebcda`,`#8c96c6`,`#8c6bb1`,`#88419d`,`#810f7c`,`#4d004b`],Oranges:[`#fff5eb`,`#fee6ce`,`#fdd0a2`,`#fdae6b`,`#fd8d3c`,`#f16913`,`#d94801`,`#a63603`,`#7f2704`],BuGn:[`#f7fcfd`,`#e5f5f9`,`#ccece6`,`#99d8c9`,`#66c2a4`,`#41ae76`,`#238b45`,`#006d2c`,`#00441b`],YlOrBr:[`#ffffe5`,`#fff7bc`,`#fee391`,`#fec44f`,`#fe9929`,`#ec7014`,`#cc4c02`,`#993404`,`#662506`],YlGn:[`#ffffe5`,`#f7fcb9`,`#d9f0a3`,`#addd8e`,`#78c679`,`#41ab5d`,`#238443`,`#006837`,`#004529`],Reds:[`#fff5f0`,`#fee0d2`,`#fcbba1`,`#fc9272`,`#fb6a4a`,`#ef3b2c`,`#cb181d`,`#a50f15`,`#67000d`],RdPu:[`#fff7f3`,`#fde0dd`,`#fcc5c0`,`#fa9fb5`,`#f768a1`,`#dd3497`,`#ae017e`,`#7a0177`,`#49006a`],Greens:[`#f7fcf5`,`#e5f5e0`,`#c7e9c0`,`#a1d99b`,`#74c476`,`#41ab5d`,`#238b45`,`#006d2c`,`#00441b`],YlGnBu:[`#ffffd9`,`#edf8b1`,`#c7e9b4`,`#7fcdbb`,`#41b6c4`,`#1d91c0`,`#225ea8`,`#253494`,`#081d58`],Purples:[`#fcfbfd`,`#efedf5`,`#dadaeb`,`#bcbddc`,`#9e9ac8`,`#807dba`,`#6a51a3`,`#54278f`,`#3f007d`],GnBu:[`#f7fcf0`,`#e0f3db`,`#ccebc5`,`#a8ddb5`,`#7bccc4`,`#4eb3d3`,`#2b8cbe`,`#0868ac`,`#084081`],Greys:[`#ffffff`,`#f0f0f0`,`#d9d9d9`,`#bdbdbd`,`#969696`,`#737373`,`#525252`,`#252525`,`#000000`],YlOrRd:[`#ffffcc`,`#ffeda0`,`#fed976`,`#feb24c`,`#fd8d3c`,`#fc4e2a`,`#e31a1c`,`#bd0026`,`#800026`],PuRd:[`#f7f4f9`,`#e7e1ef`,`#d4b9da`,`#c994c7`,`#df65b0`,`#e7298a`,`#ce1256`,`#980043`,`#67001f`],Blues:[`#f7fbff`,`#deebf7`,`#c6dbef`,`#9ecae1`,`#6baed6`,`#4292c6`,`#2171b5`,`#08519c`,`#08306b`],PuBuGn:[`#fff7fb`,`#ece2f0`,`#d0d1e6`,`#a6bddb`,`#67a9cf`,`#3690c0`,`#02818a`,`#016c59`,`#014636`],Viridis:[`#440154`,`#482777`,`#3f4a8a`,`#31678e`,`#26838f`,`#1f9d8a`,`#6cce5a`,`#b6de2b`,`#fee825`],Spectral:[`#9e0142`,`#d53e4f`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#e6f598`,`#abdda4`,`#66c2a5`,`#3288bd`,`#5e4fa2`],RdYlGn:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#d9ef8b`,`#a6d96a`,`#66bd63`,`#1a9850`,`#006837`],RdBu:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#f7f7f7`,`#d1e5f0`,`#92c5de`,`#4393c3`,`#2166ac`,`#053061`],PiYG:[`#8e0152`,`#c51b7d`,`#de77ae`,`#f1b6da`,`#fde0ef`,`#f7f7f7`,`#e6f5d0`,`#b8e186`,`#7fbc41`,`#4d9221`,`#276419`],PRGn:[`#40004b`,`#762a83`,`#9970ab`,`#c2a5cf`,`#e7d4e8`,`#f7f7f7`,`#d9f0d3`,`#a6dba0`,`#5aae61`,`#1b7837`,`#00441b`],RdYlBu:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee090`,`#ffffbf`,`#e0f3f8`,`#abd9e9`,`#74add1`,`#4575b4`,`#313695`],BrBG:[`#543005`,`#8c510a`,`#bf812d`,`#dfc27d`,`#f6e8c3`,`#f5f5f5`,`#c7eae5`,`#80cdc1`,`#35978f`,`#01665e`,`#003c30`],RdGy:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#ffffff`,`#e0e0e0`,`#bababa`,`#878787`,`#4d4d4d`,`#1a1a1a`],PuOr:[`#7f3b08`,`#b35806`,`#e08214`,`#fdb863`,`#fee0b6`,`#f7f7f7`,`#d8daeb`,`#b2abd2`,`#8073ac`,`#542788`,`#2d004b`],Set2:[`#66c2a5`,`#fc8d62`,`#8da0cb`,`#e78ac3`,`#a6d854`,`#ffd92f`,`#e5c494`,`#b3b3b3`],Accent:[`#7fc97f`,`#beaed4`,`#fdc086`,`#ffff99`,`#386cb0`,`#f0027f`,`#bf5b17`,`#666666`],Set1:[`#e41a1c`,`#377eb8`,`#4daf4a`,`#984ea3`,`#ff7f00`,`#ffff33`,`#a65628`,`#f781bf`,`#999999`],Set3:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`,`#b3de69`,`#fccde5`,`#d9d9d9`,`#bc80bd`,`#ccebc5`,`#ffed6f`],Dark2:[`#1b9e77`,`#d95f02`,`#7570b3`,`#e7298a`,`#66a61e`,`#e6ab02`,`#a6761d`,`#666666`],Paired:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`,`#fdbf6f`,`#ff7f00`,`#cab2d6`,`#6a3d9a`,`#ffff99`,`#b15928`],Pastel2:[`#b3e2cd`,`#fdcdac`,`#cbd5e8`,`#f4cae4`,`#e6f5c9`,`#fff2ae`,`#f1e2cc`,`#cccccc`],Pastel1:[`#fbb4ae`,`#b3cde3`,`#ccebc5`,`#decbe4`,`#fed9a6`,`#ffffcc`,`#e5d8bd`,`#fddaec`,`#f2f2f2`]},ze=Object.keys(W),Be=new Map(ze.map(e=>[e.toLowerCase(),e])),Ve=typeof Proxy==`function`?new Proxy(W,{get(e,t){let n=t.toLowerCase();if(Be.has(n))return e[Be.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(ze)}}):W,cmyk2rgb=(...e)=>{e=o(e,`cmyk`);let[t,n,r,i]=e,a=e.length>4?e[4]:1;return i===1?[0,0,0,a]:[t>=1?0:255*(1-t)*(1-i),n>=1?0:255*(1-n)*(1-i),r>=1?0:255*(1-r)*(1-i),a]},{max:He}=Math,rgb2cmyk=(...e)=>{let[t,n,r]=o(e,`rgb`);t/=255,n/=255,r/=255;let i=1-He(t,He(n,r)),a=i<1?1/(1-i):0;return[(1-t-i)*a,(1-n-i)*a,(1-r-i)*a,i]};Color.prototype.cmyk=function(){return rgb2cmyk(this._rgb)};const cmyk=(...e)=>new Color(...e,`cmyk`);Object.assign(chroma,{cmyk}),g.format.cmyk=cmyk2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`cmyk`),type_default(e)===`array`&&e.length===4)return`cmyk`}});const hsl2css=(...e)=>{let t=o(e,`hsla`),n=s(e)||`lsa`;return t[0]=rnd2(t[0]||0)+`deg`,t[1]=rnd2(t[1]*100)+`%`,t[2]=rnd2(t[2]*100)+`%`,n===`hsla`||t.length>3&&t[3]<1?(t[3]=`/ `+(t.length>3?t[3]:1),n=`hsla`):t.length=3,`${n.substr(0,3)}(${t.join(` `)})`},lab2css=(...e)=>{let t=o(e,`lab`),n=s(e)||`lab`;return t[0]=rnd2(t[0])+`%`,t[1]=rnd2(t[1]),t[2]=rnd2(t[2]),n===`laba`||t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(` `)})`},lch2css=(...e)=>{let t=o(e,`lch`),n=s(e)||`lab`;return t[0]=rnd2(t[0])+`%`,t[1]=rnd2(t[1]),t[2]=isNaN(t[2])?`none`:rnd2(t[2])+`deg`,n===`lcha`||t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(` `)})`},oklab2css=(...e)=>{let t=o(e,`lab`);return t[0]=rnd2(t[0]*100)+`%`,t[1]=rnd3(t[1]),t[2]=rnd3(t[2]),t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(` `)})`},rgb2oklch=(...e)=>{let[t,n,r,...i]=o(e,`rgb`),[a,s,c]=rgb2oklab(t,n,r),[l,u,d]=lab2lch(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]},oklch2css=(...e)=>{let t=o(e,`lch`);return t[0]=rnd2(t[0]*100)+`%`,t[1]=rnd3(t[1]),t[2]=isNaN(t[2])?`none`:rnd2(t[2])+`deg`,t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(` `)})`},{round:G}=Math,rgb2css=(...e)=>{let t=o(e,`rgba`),n=s(e)||`rgb`;if(n.substr(0,3)===`hsl`)return hsl2css(oe(t),n);if(n.substr(0,3)===`lab`){let e=getLabWhitePoint();setLabWhitePoint(`d50`);let r=lab2css(rgb2lab(t),n);return setLabWhitePoint(e),r}if(n.substr(0,3)===`lch`){let e=getLabWhitePoint();setLabWhitePoint(`d50`);let r=lch2css(rgb2lch(t),n);return setLabWhitePoint(e),r}return n.substr(0,5)===`oklab`?oklab2css(rgb2oklab(t)):n.substr(0,5)===`oklch`?oklch2css(rgb2oklch(t)):(t[0]=G(t[0]),t[1]=G(t[1]),t[2]=G(t[2]),(n===`rgba`||t.length>3&&t[3]<1)&&(t[3]=`/ `+(t.length>3?t[3]:1),n=`rgba`),`${n.substr(0,3)}(${t.slice(0,n===`rgb`?3:4).join(` `)})`)},oklch2rgb=(...e)=>{e=o(e,`lch`);let[t,n,r,...i]=e,[a,s,c]=lch2lab(t,n,r),[l,u,d]=oklab2rgb(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]},K=`((?:-?\\d+)|(?:-?\\d+(?:\\.\\d+)?)%|none)`,q=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%?)|none)`,J=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%)|none)`,Y=`\\s*,\\s*`,X=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:deg)?)|none)`,Ue=RegExp(`^rgba?\\(\\s*`+[K,K,K].join(`\\s+`)+`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?\\)$`),We=RegExp(`^rgb\\(\\s*`+[K,K,K].join(Y)+`\\s*\\)$`),Ge=RegExp(`^rgba\\(\\s*`+[K,K,K,q].join(Y)+`\\s*\\)$`),Ke=RegExp(`^hsla?\\(\\s*`+[X,J,J].join(`\\s+`)+`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?\\)$`),qe=RegExp(`^hsl?\\(\\s*`+[X,J,J].join(Y)+`\\s*\\)$`),Je=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Z=RegExp(`^lab\\(\\s*`+[q,q,q].join(`\\s+`)+`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?\\)$`),Ye=RegExp(`^lch\\(\\s*`+[q,q,X].join(`\\s+`)+`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?\\)$`),Xe=RegExp(`^oklab\\(\\s*`+[q,q,q].join(`\\s+`)+`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?\\)$`),Ze=RegExp(`^oklch\\(\\s*`+[q,q,X].join(`\\s+`)+`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?\\)$`),{round:Q}=Math,roundRGB=e=>e.map((e,t)=>t<=2?r(Q(e),0,255):e),percentToAbsolute=(e,t=0,n=100,r=!1)=>(typeof e==`string`&&e.endsWith(`%`)&&(e=parseFloat(e.substring(0,e.length-1))/100,e=r?t+(e+1)*.5*(n-t):t+e*(n-t)),+e),noneToValue=(e,t)=>e===`none`?t:e,css2rgb=e=>{if(e=e.toLowerCase().trim(),e===`transparent`)return[0,0,0,0];let t;if(g.format.named)try{return g.format.named(e)}catch{}if((t=e.match(Ue))||(t=e.match(We))){let e=t.slice(1,4);for(let t=0;t<3;t++)e[t]=+percentToAbsolute(noneToValue(e[t],0),0,255);e=roundRGB(e);let n=t[4]===void 0?1:+percentToAbsolute(t[4],0,1);return e[3]=n,e}if(t=e.match(Ge)){let e=t.slice(1,5);for(let t=0;t<4;t++)e[t]=+percentToAbsolute(e[t],0,255);return e}if((t=e.match(Ke))||(t=e.match(qe))){let e=t.slice(1,4);e[0]=+noneToValue(e[0].replace(`deg`,``),0),e[1]=percentToAbsolute(noneToValue(e[1],0),0,100)*.01,e[2]=percentToAbsolute(noneToValue(e[2],0),0,100)*.01;let n=roundRGB(hsl2rgb(e));return n[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),n}if(t=e.match(Je)){let e=t.slice(1,4);e[1]*=.01,e[2]*=.01;let n=hsl2rgb(e);for(let e=0;e<3;e++)n[e]=Q(n[e]);return n[3]=+t[4],n}if(t=e.match(Z)){let e=t.slice(1,4);e[0]=percentToAbsolute(noneToValue(e[0],0),0,100),e[1]=percentToAbsolute(noneToValue(e[1],0),-125,125,!0),e[2]=percentToAbsolute(noneToValue(e[2],0),-125,125,!0);let n=getLabWhitePoint();setLabWhitePoint(`d50`);let r=roundRGB(lab2rgb(e));return setLabWhitePoint(n),r[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),r}if(t=e.match(Ye)){let e=t.slice(1,4);e[0]=percentToAbsolute(e[0],0,100),e[1]=percentToAbsolute(noneToValue(e[1],0),0,150,!1),e[2]=+noneToValue(e[2].replace(`deg`,``),0);let n=getLabWhitePoint();setLabWhitePoint(`d50`);let r=roundRGB(lch2rgb(e));return setLabWhitePoint(n),r[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),r}if(t=e.match(Xe)){let e=t.slice(1,4);e[0]=percentToAbsolute(noneToValue(e[0],0),0,1),e[1]=percentToAbsolute(noneToValue(e[1],0),-.4,.4,!0),e[2]=percentToAbsolute(noneToValue(e[2],0),-.4,.4,!0);let n=roundRGB(oklab2rgb(e));return n[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),n}if(t=e.match(Ze)){let e=t.slice(1,4);e[0]=percentToAbsolute(noneToValue(e[0],0),0,1),e[1]=percentToAbsolute(noneToValue(e[1],0),0,.4,!1),e[2]=+noneToValue(e[2].replace(`deg`,``),0);let n=roundRGB(oklch2rgb(e));return n[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),n}};css2rgb.test=e=>Ue.test(e)||Ke.test(e)||Z.test(e)||Ye.test(e)||Xe.test(e)||Ze.test(e)||We.test(e)||Ge.test(e)||qe.test(e)||Je.test(e)||e===`transparent`,Color.prototype.css=function(e){return rgb2css(this._rgb,e)};const css=(...e)=>new Color(...e,`css`);chroma.css=css,g.format.css=css2rgb,g.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&type_default(e)===`string`&&css2rgb.test(e))return`css`}}),g.format.gl=(...e)=>{let t=o(e,`rgba`);return t[0]*=255,t[1]*=255,t[2]*=255,t};const gl=(...e)=>new Color(...e,`gl`);chroma.gl=gl,Color.prototype.gl=function(){let e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},Color.prototype.hex=function(e){return rgb2hex(this._rgb,e)};const hex=(...e)=>new Color(...e,`hex`);chroma.hex=hex,g.format.hex=hex2rgb,g.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&type_default(e)===`string`&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return`hex`}});const{log:$}=Math,temperature2rgb=e=>{let t=e/100,n,r,i;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*$(r),i=t<20?0:-254.76935184120902+.8274096064007395*(i=t-10)+115.67994401066147*$(i)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*$(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*$(r),i=255),[n,r,i,1]},{round:Qe}=Math,rgb2temperature=(...e)=>{let t=o(e,`rgb`),n=t[0],r=t[2],i=1e3,a=4e4,s;for(;a-i>.4;){s=(a+i)*.5;let e=temperature2rgb(s);e[2]/e[0]>=r/n?a=s:i=s}return Qe(s)};Color.prototype.temp=Color.prototype.kelvin=Color.prototype.temperature=function(){return rgb2temperature(this._rgb)};const temp=(...e)=>new Color(...e,`temp`);Object.assign(chroma,{temp,kelvin:temp,temperature:temp}),g.format.temp=g.format.kelvin=g.format.temperature=temperature2rgb,Color.prototype.oklch=function(){return rgb2oklch(this._rgb)};const oklch=(...e)=>new Color(...e,`oklch`);Object.assign(chroma,{oklch}),g.format.oklch=oklch2rgb,g.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`oklch`),type_default(e)===`array`&&e.length===3)return`oklch`}}),Object.assign(chroma,{analyze,average:pe,bezier:he,blend,brewer:Ve,Color,colors:_,contrast:Te,contrastAPCA:ke,cubehelix:cubehelix_default,deltaE:delta_e_default,distance:distance_default,input:g,interpolate:T,limits,mix:T,random:xe,scale:scale_default,scales:Re,valid:Le});var $e=chroma;export{$e as t};
@@ -1 +1 @@
1
- import{c as e,t}from"../rolldown-runtime.mjs";var n=e(t(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function Events(){}Object.create&&(Events.prototype=Object.create(null),new Events().__proto__||(r=!1));function EE(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function addListener(e,t,n,i,a){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var o=new EE(n,i||e,a),s=r?r+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function clearEvent(e,t){--e._eventsCount===0?e._events=new Events:delete e._events[t]}function EventEmitter(){this._events=new Events,this._eventsCount=0}EventEmitter.prototype.eventNames=function eventNames(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},EventEmitter.prototype.listeners=function listeners(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},EventEmitter.prototype.listenerCount=function listenerCount(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},EventEmitter.prototype.emit=function emit(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},EventEmitter.prototype.on=function on(e,t,n){return addListener(this,e,t,n,!1)},EventEmitter.prototype.once=function once(e,t,n){return addListener(this,e,t,n,!0)},EventEmitter.prototype.removeListener=function removeListener(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return clearEvent(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&clearEvent(this,a);else{for(var s=0,c=[],l=o.length;s<l;s++)(o[s].fn!==t||i&&!o[s].once||n&&o[s].context!==n)&&c.push(o[s]);c.length?this._events[a]=c.length===1?c[0]:c:clearEvent(this,a)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t;return e?(t=r?r+e:e,this._events[t]&&clearEvent(this,t)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=r,EventEmitter.EventEmitter=EventEmitter,t!==void 0&&(t.exports=EventEmitter)}))(),1);export{n as t};
1
+ import{a as e,t}from"../rolldown-runtime.mjs";var n=e(t(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function Events(){}Object.create&&(Events.prototype=Object.create(null),new Events().__proto__||(r=!1));function EE(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function addListener(e,t,n,i,a){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var o=new EE(n,i||e,a),s=r?r+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function clearEvent(e,t){--e._eventsCount===0?e._events=new Events:delete e._events[t]}function EventEmitter(){this._events=new Events,this._eventsCount=0}EventEmitter.prototype.eventNames=function eventNames(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},EventEmitter.prototype.listeners=function listeners(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},EventEmitter.prototype.listenerCount=function listenerCount(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},EventEmitter.prototype.emit=function emit(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},EventEmitter.prototype.on=function on(e,t,n){return addListener(this,e,t,n,!1)},EventEmitter.prototype.once=function once(e,t,n){return addListener(this,e,t,n,!0)},EventEmitter.prototype.removeListener=function removeListener(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return clearEvent(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&clearEvent(this,a);else{for(var s=0,c=[],l=o.length;s<l;s++)(o[s].fn!==t||i&&!o[s].once||n&&o[s].context!==n)&&c.push(o[s]);c.length?this._events[a]=c.length===1?c[0]:c:clearEvent(this,a)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t;return e?(t=r?r+e:e,this._events[t]&&clearEvent(this,t)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=r,EventEmitter.EventEmitter=EventEmitter,t!==void 0&&(t.exports=EventEmitter)}))(),1);export{n as t};
@@ -1 +1 @@
1
- import{t as e}from"../rolldown-runtime.mjs";var t=e((e=>{e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<`u`,e.SYMBOL_SUPPORT=typeof Symbol<`u`})),n=e(((e,n)=>{var r=t(),i=r.ARRAY_BUFFER_SUPPORT,a=r.SYMBOL_SUPPORT;n.exports=function forEach(e,t){var n,r,o,s,c;if(!e)throw Error(`obliterator/forEach: invalid iterable.`);if(typeof t!=`function`)throw Error(`obliterator/forEach: expecting a callback.`);if(Array.isArray(e)||i&&ArrayBuffer.isView(e)||typeof e==`string`||e.toString()===`[object Arguments]`){for(o=0,s=e.length;o<s;o++)t(e[o],o);return}if(typeof e.forEach==`function`){e.forEach(t);return}if(a&&Symbol.iterator in e&&typeof e.next!=`function`&&(e=e[Symbol.iterator]()),typeof e.next==`function`){for(n=e,o=0;c=n.next(),c.done!==!0;)t(c.value,o),o++;return}for(r in e)e.hasOwnProperty(r)&&t(e[r],r)}})),r=e(((e,t)=>{function Iterator(e){if(typeof e!=`function`)throw Error(`obliterator/iterator: expecting a function!`);this.next=e}typeof Symbol<`u`&&(Iterator.prototype[Symbol.iterator]=function(){return this}),Iterator.of=function(){var e=arguments,t=e.length,n=0;return new Iterator(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},Iterator.empty=function(){return new Iterator(function(){return{done:!0}})},Iterator.fromSequence=function(e){var t=0,n=e.length;return new Iterator(function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}})},Iterator.is=function(e){return e instanceof Iterator?!0:typeof e==`object`&&!!e&&typeof e.next==`function`},t.exports=Iterator})),i=e(((e,t)=>{t.exports=function isGraph(e){return typeof e==`object`&&!!e&&typeof e.addUndirectedEdgeWithKey==`function`&&typeof e.dropNode==`function`&&typeof e.multi==`boolean`}})),a=e((e=>{var t=2**8-1,n=2**16-1,r=2**32-1,i=2**7-1,a=2**15-1,o=2**31-1;e.getPointerArray=function(e){var i=e-1;if(i<=t)return Uint8Array;if(i<=n)return Uint16Array;if(i<=r)return Uint32Array;throw Error(`mnemonist: Pointer Array of size > 4294967295 is not supported.`)},e.getSignedPointerArray=function(e){var t=e-1;return t<=i?Int8Array:t<=a?Int16Array:t<=o?Int32Array:Float64Array},e.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var s={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(t,n){var r=null,i=0,a,o,c,l,u;for(l=0,u=t.length;l<u;l++)c=n?n(t[l]):t[l],o=e.getNumberType(c),a=s[o.name],a>i&&(i=a,r=o);return r},e.isTypedArray=function(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)},e.concat=function(){var e=0,t,n,r;for(t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=new arguments[0].constructor(e);for(t=0,n=0;t<r;t++)i.set(arguments[t],n),n+=arguments[t].length;return i},e.indices=function(t){for(var n=new(e.getPointerArray(t))(t),r=0;r<t;r++)n[r]=r;return n}})),o=e((e=>{var t=n(),r=a();function isArrayLike(e){return Array.isArray(e)||r.isTypedArray(e)}function guessLength(e){if(typeof e.length==`number`)return e.length;if(typeof e.size==`number`)return e.size}function toArray(e){var n=guessLength(e),r=typeof n==`number`?Array(n):[],i=0;return t(e,function(e){r[i++]=e}),r}function toArrayWithIndices(e){var n=guessLength(e),i=typeof n==`number`?r.getPointerArray(n):Array,a=typeof n==`number`?Array(n):[],o=typeof n==`number`?new i(n):[],s=0;return t(e,function(e){a[s]=e,o[s]=s++}),[a,o]}e.isArrayLike=isArrayLike,e.guessLength=guessLength,e.toArray=toArray,e.toArrayWithIndices=toArrayWithIndices})),s=e(((e,t)=>{var n=o(),i=r();function FixedDeque(e,t){if(arguments.length<2)throw Error(`mnemonist/fixed-deque: expecting an Array class and a capacity.`);if(typeof t!=`number`||t<=0)throw Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=e,this.capacity=t,this.items=new e(this.capacity),this.clear()}FixedDeque.prototype.clear=function(){this.start=0,this.size=0},FixedDeque.prototype.push=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.push: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start+this.size;return t>=this.capacity&&(t-=this.capacity),this.items[t]=e,++this.size},FixedDeque.prototype.unshift=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.unshift: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start-1;return this.start===0&&(t=this.capacity-1),this.items[t]=e,this.start=t,++this.size},FixedDeque.prototype.pop=function(){if(this.size!==0){this.size--;var e=this.start+this.size;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},FixedDeque.prototype.shift=function(){if(this.size!==0){var e=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[e]}},FixedDeque.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},FixedDeque.prototype.peekLast=function(){if(this.size!==0){var e=this.start+this.size-1;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},FixedDeque.prototype.get=function(e){if(!(this.size===0||e>=this.capacity))return e=this.start+e,e>=this.capacity&&(e-=this.capacity),this.items[e]},FixedDeque.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.capacity,r=this.size,i=this.start,a=0;a<r;)e.call(t,this.items[i],a,this),i++,a++,i===n&&(i=0)},FixedDeque.prototype.toArray=function(){var e=this.start+this.size;if(e<this.capacity)return this.items.slice(this.start,e);for(var t=new this.ArrayClass(this.size),n=this.capacity,r=this.size,i=this.start,a=0;a<r;)t[a]=this.items[i],i++,a++,i===n&&(i=0);return t},FixedDeque.prototype.values=function(){var e=this.items,t=this.capacity,n=this.size,r=this.start,a=0;return new i(function(){if(a>=n)return{done:!0};var i=e[r];return r++,a++,r===t&&(r=0),{value:i,done:!1}})},FixedDeque.prototype.entries=function(){var e=this.items,t=this.capacity,n=this.size,r=this.start,a=0;return new i(function(){if(a>=n)return{done:!0};var i=e[r];return r++,r===t&&(r=0),{value:[a++,i],done:!1}})},typeof Symbol<`u`&&(FixedDeque.prototype[Symbol.iterator]=FixedDeque.prototype.values),FixedDeque.prototype.inspect=function(){var e=this.toArray();return e.type=this.ArrayClass.name,e.capacity=this.capacity,Object.defineProperty(e,"constructor",{value:FixedDeque,enumerable:!1}),e},typeof Symbol<`u`&&(FixedDeque.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=FixedDeque.prototype.inspect),FixedDeque.from=function(e,t,r){if(arguments.length<3&&(r=n.guessLength(e),typeof r!=`number`))throw Error(`mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.`);var i=new FixedDeque(t,r);if(n.isArrayLike(e)){var a,o;for(a=0,o=e.length;a<o;a++)i.items[a]=e[a];return i.size=o,i}return n.forEach(e,function(e){i.push(e)}),i},t.exports=FixedDeque})),c=e((e=>{let t=i(),n=s();function simpleInDegree(e,t){let n=0;return e.forEachInNeighbor(t,()=>{n++}),n}function forEachNodeInTopologicalOrder(e,r){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);if(e.type===`undirected`||e.undirectedSize!==0)throw Error(`graphology-dag/topological-sort: cannot work if graph is not directed.`);if(e.order===0)return;let i=new n(Array,e.order),a={},o=0;e.forEachNode((t,n)=>{let r=e.multi?simpleInDegree(e,t):e.inDegree(t);r===0?i.push([t,n,0]):(a[t]=r,o+=r)});let s=0;function neighborCallback(e,t){let n=--a[e];o--,n===0&&i.push([e,t,s+1]),a[e]=n}for(;i.size!==0;){let[t,n,a]=i.shift();s=a,r(t,n,a),e.forEachOutNeighbor(t,neighborCallback)}if(o!==0)throw Error(`graphology-dag/topological-sort: given graph is not acyclic.`)}function topologicalSort(e){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);let n=Array(e.order),r=0;return forEachNodeInTopologicalOrder(e,e=>{n[r++]=e}),n}e.topologicalSort=topologicalSort})),l=e(((e,t)=>{let n=i();t.exports=function willCreateCycle(e,t,r){if(!n(e))throw Error(`graphology-dag/will-create-cycle: the given graph is not a valid graphology instance.`);if(t=``+t,r=``+r,t===r)return!0;if(!e.hasNode(t)||!e.hasNode(r)||e.hasDirectedEdge(t,r))return!1;if(e.hasDirectedEdge(r,t))return!0;let i=e.outNeighbors(r);function push(e){i.push(e)}for(;i.length!==0;){let n=i.pop();if(n===t)return!0;e.forEachOutNeighbor(n,push)}return!1}}));export{n as i,c as n,r,l as t};
1
+ import{t as e}from"../rolldown-runtime.mjs";var t=e((e=>{e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<`u`,e.SYMBOL_SUPPORT=typeof Symbol<`u`})),n=e(((e,n)=>{var r=t(),i=r.ARRAY_BUFFER_SUPPORT,a=r.SYMBOL_SUPPORT;n.exports=function forEach(e,t){var n,r,o,s,c;if(!e)throw Error(`obliterator/forEach: invalid iterable.`);if(typeof t!=`function`)throw Error(`obliterator/forEach: expecting a callback.`);if(Array.isArray(e)||i&&ArrayBuffer.isView(e)||typeof e==`string`||e.toString()===`[object Arguments]`){for(o=0,s=e.length;o<s;o++)t(e[o],o);return}if(typeof e.forEach==`function`){e.forEach(t);return}if(a&&Symbol.iterator in e&&typeof e.next!=`function`&&(e=e[Symbol.iterator]()),typeof e.next==`function`){for(n=e,o=0;c=n.next(),c.done!==!0;)t(c.value,o),o++;return}for(r in e)e.hasOwnProperty(r)&&t(e[r],r)}})),r=e(((e,t)=>{function Iterator(e){if(typeof e!=`function`)throw Error(`obliterator/iterator: expecting a function!`);this.next=e}typeof Symbol<`u`&&(Iterator.prototype[Symbol.iterator]=function(){return this}),Iterator.of=function(){var e=arguments,t=e.length,n=0;return new Iterator(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},Iterator.empty=function(){return new Iterator(function(){return{done:!0}})},Iterator.fromSequence=function(e){var t=0,n=e.length;return new Iterator(function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}})},Iterator.is=function(e){return e instanceof Iterator||typeof e==`object`&&!!e&&typeof e.next==`function`},t.exports=Iterator})),i=e(((e,t)=>{t.exports=function isGraph(e){return typeof e==`object`&&!!e&&typeof e.addUndirectedEdgeWithKey==`function`&&typeof e.dropNode==`function`&&typeof e.multi==`boolean`}})),a=e((e=>{var t=2**16-1,n=2**32-1,r=2**7-1,i=2**15-1,a=2**31-1;e.getPointerArray=function(e){var r=e-1;if(r<=255)return Uint8Array;if(r<=t)return Uint16Array;if(r<=n)return Uint32Array;throw Error(`mnemonist: Pointer Array of size > 4294967295 is not supported.`)},e.getSignedPointerArray=function(e){var t=e-1;return t<=r?Int8Array:t<=i?Int16Array:t<=a?Int32Array:Float64Array},e.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var o={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(t,n){var r=null,i=0,a,s,c,l,u;for(l=0,u=t.length;l<u;l++)c=n?n(t[l]):t[l],s=e.getNumberType(c),a=o[s.name],a>i&&(i=a,r=s);return r},e.isTypedArray=function(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)},e.concat=function(){var e=0,t,n,r;for(t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=new arguments[0].constructor(e);for(t=0,n=0;t<r;t++)i.set(arguments[t],n),n+=arguments[t].length;return i},e.indices=function(t){for(var n=new(e.getPointerArray(t))(t),r=0;r<t;r++)n[r]=r;return n}})),o=e((e=>{var t=n(),r=a();function isArrayLike(e){return Array.isArray(e)||r.isTypedArray(e)}function guessLength(e){if(typeof e.length==`number`)return e.length;if(typeof e.size==`number`)return e.size}function toArray(e){var n=guessLength(e),r=typeof n==`number`?Array(n):[],i=0;return t(e,function(e){r[i++]=e}),r}function toArrayWithIndices(e){var n=guessLength(e),i=typeof n==`number`?r.getPointerArray(n):Array,a=typeof n==`number`?Array(n):[],o=typeof n==`number`?new i(n):[],s=0;return t(e,function(e){a[s]=e,o[s]=s++}),[a,o]}e.isArrayLike=isArrayLike,e.guessLength=guessLength,e.toArray=toArray,e.toArrayWithIndices=toArrayWithIndices})),s=e(((e,t)=>{var n=o(),i=r();function FixedDeque(e,t){if(arguments.length<2)throw Error(`mnemonist/fixed-deque: expecting an Array class and a capacity.`);if(typeof t!=`number`||t<=0)throw Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=e,this.capacity=t,this.items=new e(this.capacity),this.clear()}FixedDeque.prototype.clear=function(){this.start=0,this.size=0},FixedDeque.prototype.push=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.push: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start+this.size;return t>=this.capacity&&(t-=this.capacity),this.items[t]=e,++this.size},FixedDeque.prototype.unshift=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.unshift: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start-1;return this.start===0&&(t=this.capacity-1),this.items[t]=e,this.start=t,++this.size},FixedDeque.prototype.pop=function(){if(this.size!==0){this.size--;var e=this.start+this.size;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},FixedDeque.prototype.shift=function(){if(this.size!==0){var e=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[e]}},FixedDeque.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},FixedDeque.prototype.peekLast=function(){if(this.size!==0){var e=this.start+this.size-1;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},FixedDeque.prototype.get=function(e){if(!(this.size===0||e>=this.capacity))return e=this.start+e,e>=this.capacity&&(e-=this.capacity),this.items[e]},FixedDeque.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.capacity,r=this.size,i=this.start,a=0;a<r;)e.call(t,this.items[i],a,this),i++,a++,i===n&&(i=0)},FixedDeque.prototype.toArray=function(){var e=this.start+this.size;if(e<this.capacity)return this.items.slice(this.start,e);for(var t=new this.ArrayClass(this.size),n=this.capacity,r=this.size,i=this.start,a=0;a<r;)t[a]=this.items[i],i++,a++,i===n&&(i=0);return t},FixedDeque.prototype.values=function(){var e=this.items,t=this.capacity,n=this.size,r=this.start,a=0;return new i(function(){if(a>=n)return{done:!0};var i=e[r];return r++,a++,r===t&&(r=0),{value:i,done:!1}})},FixedDeque.prototype.entries=function(){var e=this.items,t=this.capacity,n=this.size,r=this.start,a=0;return new i(function(){if(a>=n)return{done:!0};var i=e[r];return r++,r===t&&(r=0),{value:[a++,i],done:!1}})},typeof Symbol<`u`&&(FixedDeque.prototype[Symbol.iterator]=FixedDeque.prototype.values),FixedDeque.prototype.inspect=function(){var e=this.toArray();return e.type=this.ArrayClass.name,e.capacity=this.capacity,Object.defineProperty(e,"constructor",{value:FixedDeque,enumerable:!1}),e},typeof Symbol<`u`&&(FixedDeque.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=FixedDeque.prototype.inspect),FixedDeque.from=function(e,t,r){if(arguments.length<3&&(r=n.guessLength(e),typeof r!=`number`))throw Error(`mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.`);var i=new FixedDeque(t,r);if(n.isArrayLike(e)){var a,o;for(a=0,o=e.length;a<o;a++)i.items[a]=e[a];return i.size=o,i}return n.forEach(e,function(e){i.push(e)}),i},t.exports=FixedDeque})),c=e((e=>{let t=i(),n=s();function simpleInDegree(e,t){let n=0;return e.forEachInNeighbor(t,()=>{n++}),n}function forEachNodeInTopologicalOrder(e,r){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);if(e.type===`undirected`||e.undirectedSize!==0)throw Error(`graphology-dag/topological-sort: cannot work if graph is not directed.`);if(e.order===0)return;let i=new n(Array,e.order),a={},o=0;e.forEachNode((t,n)=>{let r=e.multi?simpleInDegree(e,t):e.inDegree(t);r===0?i.push([t,n,0]):(a[t]=r,o+=r)});let s=0;function neighborCallback(e,t){let n=--a[e];o--,n===0&&i.push([e,t,s+1]),a[e]=n}for(;i.size!==0;){let[t,n,a]=i.shift();s=a,r(t,n,a),e.forEachOutNeighbor(t,neighborCallback)}if(o!==0)throw Error(`graphology-dag/topological-sort: given graph is not acyclic.`)}function topologicalSort(e){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);let n=Array(e.order),r=0;return forEachNodeInTopologicalOrder(e,e=>{n[r++]=e}),n}e.topologicalSort=topologicalSort})),l=e(((e,t)=>{let n=i();t.exports=function willCreateCycle(e,t,r){if(!n(e))throw Error(`graphology-dag/will-create-cycle: the given graph is not a valid graphology instance.`);if(t=``+t,r=``+r,t===r)return!0;if(!e.hasNode(t)||!e.hasNode(r)||e.hasDirectedEdge(t,r))return!1;if(e.hasDirectedEdge(r,t))return!0;let i=e.outNeighbors(r);function push(e){i.push(e)}for(;i.length!==0;){let n=i.pop();if(n===t)return!0;e.forEachOutNeighbor(n,push)}return!1}}));export{n as i,c as n,r,l as t};