@housekit/kit 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/dist/config.d.ts +2 -25
- package/dist/index.js +2520 -68
- package/dist/loader.d.ts +1 -1
- package/dist/ui.d.ts +3 -0
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -223,17 +223,1482 @@ var require_brace_expansion = __commonJS((exports, module) => {
|
|
|
223
223
|
}
|
|
224
224
|
});
|
|
225
225
|
|
|
226
|
+
// ../../node_modules/.bun/emoji-regex@10.6.0/node_modules/emoji-regex/index.js
|
|
227
|
+
var require_emoji_regex = __commonJS((exports, module) => {
|
|
228
|
+
module.exports = () => {
|
|
229
|
+
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
230
|
+
};
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
// ../../node_modules/.bun/cli-boxes@3.0.0/node_modules/cli-boxes/boxes.json
|
|
234
|
+
var require_boxes = __commonJS((exports, module) => {
|
|
235
|
+
module.exports = {
|
|
236
|
+
single: {
|
|
237
|
+
topLeft: "┌",
|
|
238
|
+
top: "─",
|
|
239
|
+
topRight: "┐",
|
|
240
|
+
right: "│",
|
|
241
|
+
bottomRight: "┘",
|
|
242
|
+
bottom: "─",
|
|
243
|
+
bottomLeft: "└",
|
|
244
|
+
left: "│"
|
|
245
|
+
},
|
|
246
|
+
double: {
|
|
247
|
+
topLeft: "╔",
|
|
248
|
+
top: "═",
|
|
249
|
+
topRight: "╗",
|
|
250
|
+
right: "║",
|
|
251
|
+
bottomRight: "╝",
|
|
252
|
+
bottom: "═",
|
|
253
|
+
bottomLeft: "╚",
|
|
254
|
+
left: "║"
|
|
255
|
+
},
|
|
256
|
+
round: {
|
|
257
|
+
topLeft: "╭",
|
|
258
|
+
top: "─",
|
|
259
|
+
topRight: "╮",
|
|
260
|
+
right: "│",
|
|
261
|
+
bottomRight: "╯",
|
|
262
|
+
bottom: "─",
|
|
263
|
+
bottomLeft: "╰",
|
|
264
|
+
left: "│"
|
|
265
|
+
},
|
|
266
|
+
bold: {
|
|
267
|
+
topLeft: "┏",
|
|
268
|
+
top: "━",
|
|
269
|
+
topRight: "┓",
|
|
270
|
+
right: "┃",
|
|
271
|
+
bottomRight: "┛",
|
|
272
|
+
bottom: "━",
|
|
273
|
+
bottomLeft: "┗",
|
|
274
|
+
left: "┃"
|
|
275
|
+
},
|
|
276
|
+
singleDouble: {
|
|
277
|
+
topLeft: "╓",
|
|
278
|
+
top: "─",
|
|
279
|
+
topRight: "╖",
|
|
280
|
+
right: "║",
|
|
281
|
+
bottomRight: "╜",
|
|
282
|
+
bottom: "─",
|
|
283
|
+
bottomLeft: "╙",
|
|
284
|
+
left: "║"
|
|
285
|
+
},
|
|
286
|
+
doubleSingle: {
|
|
287
|
+
topLeft: "╒",
|
|
288
|
+
top: "═",
|
|
289
|
+
topRight: "╕",
|
|
290
|
+
right: "│",
|
|
291
|
+
bottomRight: "╛",
|
|
292
|
+
bottom: "═",
|
|
293
|
+
bottomLeft: "╘",
|
|
294
|
+
left: "│"
|
|
295
|
+
},
|
|
296
|
+
classic: {
|
|
297
|
+
topLeft: "+",
|
|
298
|
+
top: "-",
|
|
299
|
+
topRight: "+",
|
|
300
|
+
right: "|",
|
|
301
|
+
bottomRight: "+",
|
|
302
|
+
bottom: "-",
|
|
303
|
+
bottomLeft: "+",
|
|
304
|
+
left: "|"
|
|
305
|
+
},
|
|
306
|
+
arrow: {
|
|
307
|
+
topLeft: "↘",
|
|
308
|
+
top: "↓",
|
|
309
|
+
topRight: "↙",
|
|
310
|
+
right: "←",
|
|
311
|
+
bottomRight: "↖",
|
|
312
|
+
bottom: "↑",
|
|
313
|
+
bottomLeft: "↗",
|
|
314
|
+
left: "→"
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
// ../../node_modules/.bun/cli-boxes@3.0.0/node_modules/cli-boxes/index.js
|
|
320
|
+
var require_cli_boxes = __commonJS((exports, module) => {
|
|
321
|
+
var cliBoxes = require_boxes();
|
|
322
|
+
module.exports = cliBoxes;
|
|
323
|
+
module.exports.default = cliBoxes;
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
// ../../node_modules/.bun/ansi-regex@5.0.1/node_modules/ansi-regex/index.js
|
|
327
|
+
var require_ansi_regex = __commonJS((exports, module) => {
|
|
328
|
+
module.exports = ({ onlyFirst = false } = {}) => {
|
|
329
|
+
const pattern = [
|
|
330
|
+
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
|
331
|
+
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
|
332
|
+
].join("|");
|
|
333
|
+
return new RegExp(pattern, onlyFirst ? undefined : "g");
|
|
334
|
+
};
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
// ../../node_modules/.bun/strip-ansi@6.0.1/node_modules/strip-ansi/index.js
|
|
338
|
+
var require_strip_ansi = __commonJS((exports, module) => {
|
|
339
|
+
var ansiRegex2 = require_ansi_regex();
|
|
340
|
+
module.exports = (string) => typeof string === "string" ? string.replace(ansiRegex2(), "") : string;
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
// ../../node_modules/.bun/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js
|
|
344
|
+
var require_is_fullwidth_code_point = __commonJS((exports, module) => {
|
|
345
|
+
var isFullwidthCodePoint = (codePoint) => {
|
|
346
|
+
if (Number.isNaN(codePoint)) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
if (codePoint >= 4352 && (codePoint <= 4447 || codePoint === 9001 || codePoint === 9002 || 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || 12880 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65131 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 262141)) {
|
|
350
|
+
return true;
|
|
351
|
+
}
|
|
352
|
+
return false;
|
|
353
|
+
};
|
|
354
|
+
module.exports = isFullwidthCodePoint;
|
|
355
|
+
module.exports.default = isFullwidthCodePoint;
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
// ../../node_modules/.bun/emoji-regex@8.0.0/node_modules/emoji-regex/index.js
|
|
359
|
+
var require_emoji_regex2 = __commonJS((exports, module) => {
|
|
360
|
+
module.exports = function() {
|
|
361
|
+
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
362
|
+
};
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
// ../../node_modules/.bun/string-width@4.2.3/node_modules/string-width/index.js
|
|
366
|
+
var require_string_width = __commonJS((exports, module) => {
|
|
367
|
+
var stripAnsi2 = require_strip_ansi();
|
|
368
|
+
var isFullwidthCodePoint = require_is_fullwidth_code_point();
|
|
369
|
+
var emojiRegex2 = require_emoji_regex2();
|
|
370
|
+
var stringWidth2 = (string) => {
|
|
371
|
+
if (typeof string !== "string" || string.length === 0) {
|
|
372
|
+
return 0;
|
|
373
|
+
}
|
|
374
|
+
string = stripAnsi2(string);
|
|
375
|
+
if (string.length === 0) {
|
|
376
|
+
return 0;
|
|
377
|
+
}
|
|
378
|
+
string = string.replace(emojiRegex2(), " ");
|
|
379
|
+
let width = 0;
|
|
380
|
+
for (let i = 0;i < string.length; i++) {
|
|
381
|
+
const code = string.codePointAt(i);
|
|
382
|
+
if (code <= 31 || code >= 127 && code <= 159) {
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
if (code >= 768 && code <= 879) {
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
if (code > 65535) {
|
|
389
|
+
i++;
|
|
390
|
+
}
|
|
391
|
+
width += isFullwidthCodePoint(code) ? 2 : 1;
|
|
392
|
+
}
|
|
393
|
+
return width;
|
|
394
|
+
};
|
|
395
|
+
module.exports = stringWidth2;
|
|
396
|
+
module.exports.default = stringWidth2;
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
// ../../node_modules/.bun/ansi-align@3.0.1/node_modules/ansi-align/index.js
|
|
400
|
+
var require_ansi_align = __commonJS((exports, module) => {
|
|
401
|
+
var stringWidth2 = require_string_width();
|
|
402
|
+
function ansiAlign(text, opts) {
|
|
403
|
+
if (!text)
|
|
404
|
+
return text;
|
|
405
|
+
opts = opts || {};
|
|
406
|
+
const align = opts.align || "center";
|
|
407
|
+
if (align === "left")
|
|
408
|
+
return text;
|
|
409
|
+
const split = opts.split || `
|
|
410
|
+
`;
|
|
411
|
+
const pad = opts.pad || " ";
|
|
412
|
+
const widthDiffFn = align !== "right" ? halfDiff : fullDiff;
|
|
413
|
+
let returnString = false;
|
|
414
|
+
if (!Array.isArray(text)) {
|
|
415
|
+
returnString = true;
|
|
416
|
+
text = String(text).split(split);
|
|
417
|
+
}
|
|
418
|
+
let width;
|
|
419
|
+
let maxWidth = 0;
|
|
420
|
+
text = text.map(function(str) {
|
|
421
|
+
str = String(str);
|
|
422
|
+
width = stringWidth2(str);
|
|
423
|
+
maxWidth = Math.max(width, maxWidth);
|
|
424
|
+
return {
|
|
425
|
+
str,
|
|
426
|
+
width
|
|
427
|
+
};
|
|
428
|
+
}).map(function(obj) {
|
|
429
|
+
return new Array(widthDiffFn(maxWidth, obj.width) + 1).join(pad) + obj.str;
|
|
430
|
+
});
|
|
431
|
+
return returnString ? text.join(split) : text;
|
|
432
|
+
}
|
|
433
|
+
ansiAlign.left = function left(text) {
|
|
434
|
+
return ansiAlign(text, { align: "left" });
|
|
435
|
+
};
|
|
436
|
+
ansiAlign.center = function center(text) {
|
|
437
|
+
return ansiAlign(text, { align: "center" });
|
|
438
|
+
};
|
|
439
|
+
ansiAlign.right = function right(text) {
|
|
440
|
+
return ansiAlign(text, { align: "right" });
|
|
441
|
+
};
|
|
442
|
+
module.exports = ansiAlign;
|
|
443
|
+
function halfDiff(maxWidth, curWidth) {
|
|
444
|
+
return Math.floor((maxWidth - curWidth) / 2);
|
|
445
|
+
}
|
|
446
|
+
function fullDiff(maxWidth, curWidth) {
|
|
447
|
+
return maxWidth - curWidth;
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
// ../../node_modules/.bun/tinycolor2@1.6.0/node_modules/tinycolor2/cjs/tinycolor.js
|
|
452
|
+
var require_tinycolor = __commonJS((exports, module) => {
|
|
453
|
+
(function(global, factory) {
|
|
454
|
+
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, global.tinycolor = factory());
|
|
455
|
+
})(exports, function() {
|
|
456
|
+
function _typeof(obj) {
|
|
457
|
+
"@babel/helpers - typeof";
|
|
458
|
+
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
459
|
+
return typeof obj2;
|
|
460
|
+
} : function(obj2) {
|
|
461
|
+
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
462
|
+
}, _typeof(obj);
|
|
463
|
+
}
|
|
464
|
+
var trimLeft = /^\s+/;
|
|
465
|
+
var trimRight = /\s+$/;
|
|
466
|
+
function tinycolor(color, opts) {
|
|
467
|
+
color = color ? color : "";
|
|
468
|
+
opts = opts || {};
|
|
469
|
+
if (color instanceof tinycolor) {
|
|
470
|
+
return color;
|
|
471
|
+
}
|
|
472
|
+
if (!(this instanceof tinycolor)) {
|
|
473
|
+
return new tinycolor(color, opts);
|
|
474
|
+
}
|
|
475
|
+
var rgb = inputToRGB(color);
|
|
476
|
+
this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;
|
|
477
|
+
this._gradientType = opts.gradientType;
|
|
478
|
+
if (this._r < 1)
|
|
479
|
+
this._r = Math.round(this._r);
|
|
480
|
+
if (this._g < 1)
|
|
481
|
+
this._g = Math.round(this._g);
|
|
482
|
+
if (this._b < 1)
|
|
483
|
+
this._b = Math.round(this._b);
|
|
484
|
+
this._ok = rgb.ok;
|
|
485
|
+
}
|
|
486
|
+
tinycolor.prototype = {
|
|
487
|
+
isDark: function isDark() {
|
|
488
|
+
return this.getBrightness() < 128;
|
|
489
|
+
},
|
|
490
|
+
isLight: function isLight() {
|
|
491
|
+
return !this.isDark();
|
|
492
|
+
},
|
|
493
|
+
isValid: function isValid() {
|
|
494
|
+
return this._ok;
|
|
495
|
+
},
|
|
496
|
+
getOriginalInput: function getOriginalInput() {
|
|
497
|
+
return this._originalInput;
|
|
498
|
+
},
|
|
499
|
+
getFormat: function getFormat() {
|
|
500
|
+
return this._format;
|
|
501
|
+
},
|
|
502
|
+
getAlpha: function getAlpha() {
|
|
503
|
+
return this._a;
|
|
504
|
+
},
|
|
505
|
+
getBrightness: function getBrightness() {
|
|
506
|
+
var rgb = this.toRgb();
|
|
507
|
+
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
|
|
508
|
+
},
|
|
509
|
+
getLuminance: function getLuminance() {
|
|
510
|
+
var rgb = this.toRgb();
|
|
511
|
+
var RsRGB, GsRGB, BsRGB, R, G, B;
|
|
512
|
+
RsRGB = rgb.r / 255;
|
|
513
|
+
GsRGB = rgb.g / 255;
|
|
514
|
+
BsRGB = rgb.b / 255;
|
|
515
|
+
if (RsRGB <= 0.03928)
|
|
516
|
+
R = RsRGB / 12.92;
|
|
517
|
+
else
|
|
518
|
+
R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
|
|
519
|
+
if (GsRGB <= 0.03928)
|
|
520
|
+
G = GsRGB / 12.92;
|
|
521
|
+
else
|
|
522
|
+
G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
|
|
523
|
+
if (BsRGB <= 0.03928)
|
|
524
|
+
B = BsRGB / 12.92;
|
|
525
|
+
else
|
|
526
|
+
B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
|
|
527
|
+
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
528
|
+
},
|
|
529
|
+
setAlpha: function setAlpha(value) {
|
|
530
|
+
this._a = boundAlpha(value);
|
|
531
|
+
this._roundA = Math.round(100 * this._a) / 100;
|
|
532
|
+
return this;
|
|
533
|
+
},
|
|
534
|
+
toHsv: function toHsv() {
|
|
535
|
+
var hsv = rgbToHsv(this._r, this._g, this._b);
|
|
536
|
+
return {
|
|
537
|
+
h: hsv.h * 360,
|
|
538
|
+
s: hsv.s,
|
|
539
|
+
v: hsv.v,
|
|
540
|
+
a: this._a
|
|
541
|
+
};
|
|
542
|
+
},
|
|
543
|
+
toHsvString: function toHsvString() {
|
|
544
|
+
var hsv = rgbToHsv(this._r, this._g, this._b);
|
|
545
|
+
var h = Math.round(hsv.h * 360), s = Math.round(hsv.s * 100), v = Math.round(hsv.v * 100);
|
|
546
|
+
return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
|
|
547
|
+
},
|
|
548
|
+
toHsl: function toHsl() {
|
|
549
|
+
var hsl = rgbToHsl(this._r, this._g, this._b);
|
|
550
|
+
return {
|
|
551
|
+
h: hsl.h * 360,
|
|
552
|
+
s: hsl.s,
|
|
553
|
+
l: hsl.l,
|
|
554
|
+
a: this._a
|
|
555
|
+
};
|
|
556
|
+
},
|
|
557
|
+
toHslString: function toHslString() {
|
|
558
|
+
var hsl = rgbToHsl(this._r, this._g, this._b);
|
|
559
|
+
var h = Math.round(hsl.h * 360), s = Math.round(hsl.s * 100), l = Math.round(hsl.l * 100);
|
|
560
|
+
return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
|
|
561
|
+
},
|
|
562
|
+
toHex: function toHex(allow3Char) {
|
|
563
|
+
return rgbToHex(this._r, this._g, this._b, allow3Char);
|
|
564
|
+
},
|
|
565
|
+
toHexString: function toHexString(allow3Char) {
|
|
566
|
+
return "#" + this.toHex(allow3Char);
|
|
567
|
+
},
|
|
568
|
+
toHex8: function toHex8(allow4Char) {
|
|
569
|
+
return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
|
|
570
|
+
},
|
|
571
|
+
toHex8String: function toHex8String(allow4Char) {
|
|
572
|
+
return "#" + this.toHex8(allow4Char);
|
|
573
|
+
},
|
|
574
|
+
toRgb: function toRgb() {
|
|
575
|
+
return {
|
|
576
|
+
r: Math.round(this._r),
|
|
577
|
+
g: Math.round(this._g),
|
|
578
|
+
b: Math.round(this._b),
|
|
579
|
+
a: this._a
|
|
580
|
+
};
|
|
581
|
+
},
|
|
582
|
+
toRgbString: function toRgbString() {
|
|
583
|
+
return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
|
|
584
|
+
},
|
|
585
|
+
toPercentageRgb: function toPercentageRgb() {
|
|
586
|
+
return {
|
|
587
|
+
r: Math.round(bound01(this._r, 255) * 100) + "%",
|
|
588
|
+
g: Math.round(bound01(this._g, 255) * 100) + "%",
|
|
589
|
+
b: Math.round(bound01(this._b, 255) * 100) + "%",
|
|
590
|
+
a: this._a
|
|
591
|
+
};
|
|
592
|
+
},
|
|
593
|
+
toPercentageRgbString: function toPercentageRgbString() {
|
|
594
|
+
return this._a == 1 ? "rgb(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
|
|
595
|
+
},
|
|
596
|
+
toName: function toName() {
|
|
597
|
+
if (this._a === 0) {
|
|
598
|
+
return "transparent";
|
|
599
|
+
}
|
|
600
|
+
if (this._a < 1) {
|
|
601
|
+
return false;
|
|
602
|
+
}
|
|
603
|
+
return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
|
|
604
|
+
},
|
|
605
|
+
toFilter: function toFilter(secondColor) {
|
|
606
|
+
var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
|
|
607
|
+
var secondHex8String = hex8String;
|
|
608
|
+
var gradientType = this._gradientType ? "GradientType = 1, " : "";
|
|
609
|
+
if (secondColor) {
|
|
610
|
+
var s = tinycolor(secondColor);
|
|
611
|
+
secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
|
|
612
|
+
}
|
|
613
|
+
return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
|
|
614
|
+
},
|
|
615
|
+
toString: function toString(format) {
|
|
616
|
+
var formatSet = !!format;
|
|
617
|
+
format = format || this._format;
|
|
618
|
+
var formattedString = false;
|
|
619
|
+
var hasAlpha = this._a < 1 && this._a >= 0;
|
|
620
|
+
var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
|
|
621
|
+
if (needsAlphaFormat) {
|
|
622
|
+
if (format === "name" && this._a === 0) {
|
|
623
|
+
return this.toName();
|
|
624
|
+
}
|
|
625
|
+
return this.toRgbString();
|
|
626
|
+
}
|
|
627
|
+
if (format === "rgb") {
|
|
628
|
+
formattedString = this.toRgbString();
|
|
629
|
+
}
|
|
630
|
+
if (format === "prgb") {
|
|
631
|
+
formattedString = this.toPercentageRgbString();
|
|
632
|
+
}
|
|
633
|
+
if (format === "hex" || format === "hex6") {
|
|
634
|
+
formattedString = this.toHexString();
|
|
635
|
+
}
|
|
636
|
+
if (format === "hex3") {
|
|
637
|
+
formattedString = this.toHexString(true);
|
|
638
|
+
}
|
|
639
|
+
if (format === "hex4") {
|
|
640
|
+
formattedString = this.toHex8String(true);
|
|
641
|
+
}
|
|
642
|
+
if (format === "hex8") {
|
|
643
|
+
formattedString = this.toHex8String();
|
|
644
|
+
}
|
|
645
|
+
if (format === "name") {
|
|
646
|
+
formattedString = this.toName();
|
|
647
|
+
}
|
|
648
|
+
if (format === "hsl") {
|
|
649
|
+
formattedString = this.toHslString();
|
|
650
|
+
}
|
|
651
|
+
if (format === "hsv") {
|
|
652
|
+
formattedString = this.toHsvString();
|
|
653
|
+
}
|
|
654
|
+
return formattedString || this.toHexString();
|
|
655
|
+
},
|
|
656
|
+
clone: function clone() {
|
|
657
|
+
return tinycolor(this.toString());
|
|
658
|
+
},
|
|
659
|
+
_applyModification: function _applyModification(fn, args) {
|
|
660
|
+
var color = fn.apply(null, [this].concat([].slice.call(args)));
|
|
661
|
+
this._r = color._r;
|
|
662
|
+
this._g = color._g;
|
|
663
|
+
this._b = color._b;
|
|
664
|
+
this.setAlpha(color._a);
|
|
665
|
+
return this;
|
|
666
|
+
},
|
|
667
|
+
lighten: function lighten() {
|
|
668
|
+
return this._applyModification(_lighten, arguments);
|
|
669
|
+
},
|
|
670
|
+
brighten: function brighten() {
|
|
671
|
+
return this._applyModification(_brighten, arguments);
|
|
672
|
+
},
|
|
673
|
+
darken: function darken() {
|
|
674
|
+
return this._applyModification(_darken, arguments);
|
|
675
|
+
},
|
|
676
|
+
desaturate: function desaturate() {
|
|
677
|
+
return this._applyModification(_desaturate, arguments);
|
|
678
|
+
},
|
|
679
|
+
saturate: function saturate() {
|
|
680
|
+
return this._applyModification(_saturate, arguments);
|
|
681
|
+
},
|
|
682
|
+
greyscale: function greyscale() {
|
|
683
|
+
return this._applyModification(_greyscale, arguments);
|
|
684
|
+
},
|
|
685
|
+
spin: function spin() {
|
|
686
|
+
return this._applyModification(_spin, arguments);
|
|
687
|
+
},
|
|
688
|
+
_applyCombination: function _applyCombination(fn, args) {
|
|
689
|
+
return fn.apply(null, [this].concat([].slice.call(args)));
|
|
690
|
+
},
|
|
691
|
+
analogous: function analogous() {
|
|
692
|
+
return this._applyCombination(_analogous, arguments);
|
|
693
|
+
},
|
|
694
|
+
complement: function complement() {
|
|
695
|
+
return this._applyCombination(_complement, arguments);
|
|
696
|
+
},
|
|
697
|
+
monochromatic: function monochromatic() {
|
|
698
|
+
return this._applyCombination(_monochromatic, arguments);
|
|
699
|
+
},
|
|
700
|
+
splitcomplement: function splitcomplement() {
|
|
701
|
+
return this._applyCombination(_splitcomplement, arguments);
|
|
702
|
+
},
|
|
703
|
+
triad: function triad() {
|
|
704
|
+
return this._applyCombination(polyad, [3]);
|
|
705
|
+
},
|
|
706
|
+
tetrad: function tetrad() {
|
|
707
|
+
return this._applyCombination(polyad, [4]);
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
tinycolor.fromRatio = function(color, opts) {
|
|
711
|
+
if (_typeof(color) == "object") {
|
|
712
|
+
var newColor = {};
|
|
713
|
+
for (var i in color) {
|
|
714
|
+
if (color.hasOwnProperty(i)) {
|
|
715
|
+
if (i === "a") {
|
|
716
|
+
newColor[i] = color[i];
|
|
717
|
+
} else {
|
|
718
|
+
newColor[i] = convertToPercentage(color[i]);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
color = newColor;
|
|
723
|
+
}
|
|
724
|
+
return tinycolor(color, opts);
|
|
725
|
+
};
|
|
726
|
+
function inputToRGB(color) {
|
|
727
|
+
var rgb = {
|
|
728
|
+
r: 0,
|
|
729
|
+
g: 0,
|
|
730
|
+
b: 0
|
|
731
|
+
};
|
|
732
|
+
var a = 1;
|
|
733
|
+
var s = null;
|
|
734
|
+
var v = null;
|
|
735
|
+
var l = null;
|
|
736
|
+
var ok = false;
|
|
737
|
+
var format = false;
|
|
738
|
+
if (typeof color == "string") {
|
|
739
|
+
color = stringInputToObject(color);
|
|
740
|
+
}
|
|
741
|
+
if (_typeof(color) == "object") {
|
|
742
|
+
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
|
743
|
+
rgb = rgbToRgb(color.r, color.g, color.b);
|
|
744
|
+
ok = true;
|
|
745
|
+
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
|
|
746
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
|
|
747
|
+
s = convertToPercentage(color.s);
|
|
748
|
+
v = convertToPercentage(color.v);
|
|
749
|
+
rgb = hsvToRgb(color.h, s, v);
|
|
750
|
+
ok = true;
|
|
751
|
+
format = "hsv";
|
|
752
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
|
|
753
|
+
s = convertToPercentage(color.s);
|
|
754
|
+
l = convertToPercentage(color.l);
|
|
755
|
+
rgb = hslToRgb(color.h, s, l);
|
|
756
|
+
ok = true;
|
|
757
|
+
format = "hsl";
|
|
758
|
+
}
|
|
759
|
+
if (color.hasOwnProperty("a")) {
|
|
760
|
+
a = color.a;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
a = boundAlpha(a);
|
|
764
|
+
return {
|
|
765
|
+
ok,
|
|
766
|
+
format: color.format || format,
|
|
767
|
+
r: Math.min(255, Math.max(rgb.r, 0)),
|
|
768
|
+
g: Math.min(255, Math.max(rgb.g, 0)),
|
|
769
|
+
b: Math.min(255, Math.max(rgb.b, 0)),
|
|
770
|
+
a
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
function rgbToRgb(r, g, b) {
|
|
774
|
+
return {
|
|
775
|
+
r: bound01(r, 255) * 255,
|
|
776
|
+
g: bound01(g, 255) * 255,
|
|
777
|
+
b: bound01(b, 255) * 255
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
function rgbToHsl(r, g, b) {
|
|
781
|
+
r = bound01(r, 255);
|
|
782
|
+
g = bound01(g, 255);
|
|
783
|
+
b = bound01(b, 255);
|
|
784
|
+
var max = Math.max(r, g, b), min = Math.min(r, g, b);
|
|
785
|
+
var h, s, l = (max + min) / 2;
|
|
786
|
+
if (max == min) {
|
|
787
|
+
h = s = 0;
|
|
788
|
+
} else {
|
|
789
|
+
var d = max - min;
|
|
790
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
791
|
+
switch (max) {
|
|
792
|
+
case r:
|
|
793
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
794
|
+
break;
|
|
795
|
+
case g:
|
|
796
|
+
h = (b - r) / d + 2;
|
|
797
|
+
break;
|
|
798
|
+
case b:
|
|
799
|
+
h = (r - g) / d + 4;
|
|
800
|
+
break;
|
|
801
|
+
}
|
|
802
|
+
h /= 6;
|
|
803
|
+
}
|
|
804
|
+
return {
|
|
805
|
+
h,
|
|
806
|
+
s,
|
|
807
|
+
l
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
function hslToRgb(h, s, l) {
|
|
811
|
+
var r, g, b;
|
|
812
|
+
h = bound01(h, 360);
|
|
813
|
+
s = bound01(s, 100);
|
|
814
|
+
l = bound01(l, 100);
|
|
815
|
+
function hue2rgb(p2, q2, t) {
|
|
816
|
+
if (t < 0)
|
|
817
|
+
t += 1;
|
|
818
|
+
if (t > 1)
|
|
819
|
+
t -= 1;
|
|
820
|
+
if (t < 1 / 6)
|
|
821
|
+
return p2 + (q2 - p2) * 6 * t;
|
|
822
|
+
if (t < 1 / 2)
|
|
823
|
+
return q2;
|
|
824
|
+
if (t < 2 / 3)
|
|
825
|
+
return p2 + (q2 - p2) * (2 / 3 - t) * 6;
|
|
826
|
+
return p2;
|
|
827
|
+
}
|
|
828
|
+
if (s === 0) {
|
|
829
|
+
r = g = b = l;
|
|
830
|
+
} else {
|
|
831
|
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
832
|
+
var p = 2 * l - q;
|
|
833
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
834
|
+
g = hue2rgb(p, q, h);
|
|
835
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
836
|
+
}
|
|
837
|
+
return {
|
|
838
|
+
r: r * 255,
|
|
839
|
+
g: g * 255,
|
|
840
|
+
b: b * 255
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
function rgbToHsv(r, g, b) {
|
|
844
|
+
r = bound01(r, 255);
|
|
845
|
+
g = bound01(g, 255);
|
|
846
|
+
b = bound01(b, 255);
|
|
847
|
+
var max = Math.max(r, g, b), min = Math.min(r, g, b);
|
|
848
|
+
var h, s, v = max;
|
|
849
|
+
var d = max - min;
|
|
850
|
+
s = max === 0 ? 0 : d / max;
|
|
851
|
+
if (max == min) {
|
|
852
|
+
h = 0;
|
|
853
|
+
} else {
|
|
854
|
+
switch (max) {
|
|
855
|
+
case r:
|
|
856
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
857
|
+
break;
|
|
858
|
+
case g:
|
|
859
|
+
h = (b - r) / d + 2;
|
|
860
|
+
break;
|
|
861
|
+
case b:
|
|
862
|
+
h = (r - g) / d + 4;
|
|
863
|
+
break;
|
|
864
|
+
}
|
|
865
|
+
h /= 6;
|
|
866
|
+
}
|
|
867
|
+
return {
|
|
868
|
+
h,
|
|
869
|
+
s,
|
|
870
|
+
v
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
function hsvToRgb(h, s, v) {
|
|
874
|
+
h = bound01(h, 360) * 6;
|
|
875
|
+
s = bound01(s, 100);
|
|
876
|
+
v = bound01(v, 100);
|
|
877
|
+
var i = Math.floor(h), f = h - i, p = v * (1 - s), q = v * (1 - f * s), t = v * (1 - (1 - f) * s), mod = i % 6, r = [v, q, p, p, t, v][mod], g = [t, v, v, q, p, p][mod], b = [p, p, t, v, v, q][mod];
|
|
878
|
+
return {
|
|
879
|
+
r: r * 255,
|
|
880
|
+
g: g * 255,
|
|
881
|
+
b: b * 255
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
function rgbToHex(r, g, b, allow3Char) {
|
|
885
|
+
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
|
|
886
|
+
if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
|
|
887
|
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
|
|
888
|
+
}
|
|
889
|
+
return hex.join("");
|
|
890
|
+
}
|
|
891
|
+
function rgbaToHex(r, g, b, a, allow4Char) {
|
|
892
|
+
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
|
|
893
|
+
if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
|
|
894
|
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
|
|
895
|
+
}
|
|
896
|
+
return hex.join("");
|
|
897
|
+
}
|
|
898
|
+
function rgbaToArgbHex(r, g, b, a) {
|
|
899
|
+
var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
|
|
900
|
+
return hex.join("");
|
|
901
|
+
}
|
|
902
|
+
tinycolor.equals = function(color1, color2) {
|
|
903
|
+
if (!color1 || !color2)
|
|
904
|
+
return false;
|
|
905
|
+
return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
|
|
906
|
+
};
|
|
907
|
+
tinycolor.random = function() {
|
|
908
|
+
return tinycolor.fromRatio({
|
|
909
|
+
r: Math.random(),
|
|
910
|
+
g: Math.random(),
|
|
911
|
+
b: Math.random()
|
|
912
|
+
});
|
|
913
|
+
};
|
|
914
|
+
function _desaturate(color, amount) {
|
|
915
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
916
|
+
var hsl = tinycolor(color).toHsl();
|
|
917
|
+
hsl.s -= amount / 100;
|
|
918
|
+
hsl.s = clamp01(hsl.s);
|
|
919
|
+
return tinycolor(hsl);
|
|
920
|
+
}
|
|
921
|
+
function _saturate(color, amount) {
|
|
922
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
923
|
+
var hsl = tinycolor(color).toHsl();
|
|
924
|
+
hsl.s += amount / 100;
|
|
925
|
+
hsl.s = clamp01(hsl.s);
|
|
926
|
+
return tinycolor(hsl);
|
|
927
|
+
}
|
|
928
|
+
function _greyscale(color) {
|
|
929
|
+
return tinycolor(color).desaturate(100);
|
|
930
|
+
}
|
|
931
|
+
function _lighten(color, amount) {
|
|
932
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
933
|
+
var hsl = tinycolor(color).toHsl();
|
|
934
|
+
hsl.l += amount / 100;
|
|
935
|
+
hsl.l = clamp01(hsl.l);
|
|
936
|
+
return tinycolor(hsl);
|
|
937
|
+
}
|
|
938
|
+
function _brighten(color, amount) {
|
|
939
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
940
|
+
var rgb = tinycolor(color).toRgb();
|
|
941
|
+
rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
|
|
942
|
+
rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
|
|
943
|
+
rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
|
|
944
|
+
return tinycolor(rgb);
|
|
945
|
+
}
|
|
946
|
+
function _darken(color, amount) {
|
|
947
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
948
|
+
var hsl = tinycolor(color).toHsl();
|
|
949
|
+
hsl.l -= amount / 100;
|
|
950
|
+
hsl.l = clamp01(hsl.l);
|
|
951
|
+
return tinycolor(hsl);
|
|
952
|
+
}
|
|
953
|
+
function _spin(color, amount) {
|
|
954
|
+
var hsl = tinycolor(color).toHsl();
|
|
955
|
+
var hue = (hsl.h + amount) % 360;
|
|
956
|
+
hsl.h = hue < 0 ? 360 + hue : hue;
|
|
957
|
+
return tinycolor(hsl);
|
|
958
|
+
}
|
|
959
|
+
function _complement(color) {
|
|
960
|
+
var hsl = tinycolor(color).toHsl();
|
|
961
|
+
hsl.h = (hsl.h + 180) % 360;
|
|
962
|
+
return tinycolor(hsl);
|
|
963
|
+
}
|
|
964
|
+
function polyad(color, number) {
|
|
965
|
+
if (isNaN(number) || number <= 0) {
|
|
966
|
+
throw new Error("Argument to polyad must be a positive number");
|
|
967
|
+
}
|
|
968
|
+
var hsl = tinycolor(color).toHsl();
|
|
969
|
+
var result = [tinycolor(color)];
|
|
970
|
+
var step = 360 / number;
|
|
971
|
+
for (var i = 1;i < number; i++) {
|
|
972
|
+
result.push(tinycolor({
|
|
973
|
+
h: (hsl.h + i * step) % 360,
|
|
974
|
+
s: hsl.s,
|
|
975
|
+
l: hsl.l
|
|
976
|
+
}));
|
|
977
|
+
}
|
|
978
|
+
return result;
|
|
979
|
+
}
|
|
980
|
+
function _splitcomplement(color) {
|
|
981
|
+
var hsl = tinycolor(color).toHsl();
|
|
982
|
+
var h = hsl.h;
|
|
983
|
+
return [tinycolor(color), tinycolor({
|
|
984
|
+
h: (h + 72) % 360,
|
|
985
|
+
s: hsl.s,
|
|
986
|
+
l: hsl.l
|
|
987
|
+
}), tinycolor({
|
|
988
|
+
h: (h + 216) % 360,
|
|
989
|
+
s: hsl.s,
|
|
990
|
+
l: hsl.l
|
|
991
|
+
})];
|
|
992
|
+
}
|
|
993
|
+
function _analogous(color, results, slices) {
|
|
994
|
+
results = results || 6;
|
|
995
|
+
slices = slices || 30;
|
|
996
|
+
var hsl = tinycolor(color).toHsl();
|
|
997
|
+
var part = 360 / slices;
|
|
998
|
+
var ret = [tinycolor(color)];
|
|
999
|
+
for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360;--results; ) {
|
|
1000
|
+
hsl.h = (hsl.h + part) % 360;
|
|
1001
|
+
ret.push(tinycolor(hsl));
|
|
1002
|
+
}
|
|
1003
|
+
return ret;
|
|
1004
|
+
}
|
|
1005
|
+
function _monochromatic(color, results) {
|
|
1006
|
+
results = results || 6;
|
|
1007
|
+
var hsv = tinycolor(color).toHsv();
|
|
1008
|
+
var { h, s, v } = hsv;
|
|
1009
|
+
var ret = [];
|
|
1010
|
+
var modification = 1 / results;
|
|
1011
|
+
while (results--) {
|
|
1012
|
+
ret.push(tinycolor({
|
|
1013
|
+
h,
|
|
1014
|
+
s,
|
|
1015
|
+
v
|
|
1016
|
+
}));
|
|
1017
|
+
v = (v + modification) % 1;
|
|
1018
|
+
}
|
|
1019
|
+
return ret;
|
|
1020
|
+
}
|
|
1021
|
+
tinycolor.mix = function(color1, color2, amount) {
|
|
1022
|
+
amount = amount === 0 ? 0 : amount || 50;
|
|
1023
|
+
var rgb1 = tinycolor(color1).toRgb();
|
|
1024
|
+
var rgb2 = tinycolor(color2).toRgb();
|
|
1025
|
+
var p = amount / 100;
|
|
1026
|
+
var rgba = {
|
|
1027
|
+
r: (rgb2.r - rgb1.r) * p + rgb1.r,
|
|
1028
|
+
g: (rgb2.g - rgb1.g) * p + rgb1.g,
|
|
1029
|
+
b: (rgb2.b - rgb1.b) * p + rgb1.b,
|
|
1030
|
+
a: (rgb2.a - rgb1.a) * p + rgb1.a
|
|
1031
|
+
};
|
|
1032
|
+
return tinycolor(rgba);
|
|
1033
|
+
};
|
|
1034
|
+
tinycolor.readability = function(color1, color2) {
|
|
1035
|
+
var c1 = tinycolor(color1);
|
|
1036
|
+
var c2 = tinycolor(color2);
|
|
1037
|
+
return (Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) / (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05);
|
|
1038
|
+
};
|
|
1039
|
+
tinycolor.isReadable = function(color1, color2, wcag2) {
|
|
1040
|
+
var readability = tinycolor.readability(color1, color2);
|
|
1041
|
+
var wcag2Parms, out;
|
|
1042
|
+
out = false;
|
|
1043
|
+
wcag2Parms = validateWCAG2Parms(wcag2);
|
|
1044
|
+
switch (wcag2Parms.level + wcag2Parms.size) {
|
|
1045
|
+
case "AAsmall":
|
|
1046
|
+
case "AAAlarge":
|
|
1047
|
+
out = readability >= 4.5;
|
|
1048
|
+
break;
|
|
1049
|
+
case "AAlarge":
|
|
1050
|
+
out = readability >= 3;
|
|
1051
|
+
break;
|
|
1052
|
+
case "AAAsmall":
|
|
1053
|
+
out = readability >= 7;
|
|
1054
|
+
break;
|
|
1055
|
+
}
|
|
1056
|
+
return out;
|
|
1057
|
+
};
|
|
1058
|
+
tinycolor.mostReadable = function(baseColor, colorList, args) {
|
|
1059
|
+
var bestColor = null;
|
|
1060
|
+
var bestScore = 0;
|
|
1061
|
+
var readability;
|
|
1062
|
+
var includeFallbackColors, level, size;
|
|
1063
|
+
args = args || {};
|
|
1064
|
+
includeFallbackColors = args.includeFallbackColors;
|
|
1065
|
+
level = args.level;
|
|
1066
|
+
size = args.size;
|
|
1067
|
+
for (var i = 0;i < colorList.length; i++) {
|
|
1068
|
+
readability = tinycolor.readability(baseColor, colorList[i]);
|
|
1069
|
+
if (readability > bestScore) {
|
|
1070
|
+
bestScore = readability;
|
|
1071
|
+
bestColor = tinycolor(colorList[i]);
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
if (tinycolor.isReadable(baseColor, bestColor, {
|
|
1075
|
+
level,
|
|
1076
|
+
size
|
|
1077
|
+
}) || !includeFallbackColors) {
|
|
1078
|
+
return bestColor;
|
|
1079
|
+
} else {
|
|
1080
|
+
args.includeFallbackColors = false;
|
|
1081
|
+
return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
1084
|
+
var names = tinycolor.names = {
|
|
1085
|
+
aliceblue: "f0f8ff",
|
|
1086
|
+
antiquewhite: "faebd7",
|
|
1087
|
+
aqua: "0ff",
|
|
1088
|
+
aquamarine: "7fffd4",
|
|
1089
|
+
azure: "f0ffff",
|
|
1090
|
+
beige: "f5f5dc",
|
|
1091
|
+
bisque: "ffe4c4",
|
|
1092
|
+
black: "000",
|
|
1093
|
+
blanchedalmond: "ffebcd",
|
|
1094
|
+
blue: "00f",
|
|
1095
|
+
blueviolet: "8a2be2",
|
|
1096
|
+
brown: "a52a2a",
|
|
1097
|
+
burlywood: "deb887",
|
|
1098
|
+
burntsienna: "ea7e5d",
|
|
1099
|
+
cadetblue: "5f9ea0",
|
|
1100
|
+
chartreuse: "7fff00",
|
|
1101
|
+
chocolate: "d2691e",
|
|
1102
|
+
coral: "ff7f50",
|
|
1103
|
+
cornflowerblue: "6495ed",
|
|
1104
|
+
cornsilk: "fff8dc",
|
|
1105
|
+
crimson: "dc143c",
|
|
1106
|
+
cyan: "0ff",
|
|
1107
|
+
darkblue: "00008b",
|
|
1108
|
+
darkcyan: "008b8b",
|
|
1109
|
+
darkgoldenrod: "b8860b",
|
|
1110
|
+
darkgray: "a9a9a9",
|
|
1111
|
+
darkgreen: "006400",
|
|
1112
|
+
darkgrey: "a9a9a9",
|
|
1113
|
+
darkkhaki: "bdb76b",
|
|
1114
|
+
darkmagenta: "8b008b",
|
|
1115
|
+
darkolivegreen: "556b2f",
|
|
1116
|
+
darkorange: "ff8c00",
|
|
1117
|
+
darkorchid: "9932cc",
|
|
1118
|
+
darkred: "8b0000",
|
|
1119
|
+
darksalmon: "e9967a",
|
|
1120
|
+
darkseagreen: "8fbc8f",
|
|
1121
|
+
darkslateblue: "483d8b",
|
|
1122
|
+
darkslategray: "2f4f4f",
|
|
1123
|
+
darkslategrey: "2f4f4f",
|
|
1124
|
+
darkturquoise: "00ced1",
|
|
1125
|
+
darkviolet: "9400d3",
|
|
1126
|
+
deeppink: "ff1493",
|
|
1127
|
+
deepskyblue: "00bfff",
|
|
1128
|
+
dimgray: "696969",
|
|
1129
|
+
dimgrey: "696969",
|
|
1130
|
+
dodgerblue: "1e90ff",
|
|
1131
|
+
firebrick: "b22222",
|
|
1132
|
+
floralwhite: "fffaf0",
|
|
1133
|
+
forestgreen: "228b22",
|
|
1134
|
+
fuchsia: "f0f",
|
|
1135
|
+
gainsboro: "dcdcdc",
|
|
1136
|
+
ghostwhite: "f8f8ff",
|
|
1137
|
+
gold: "ffd700",
|
|
1138
|
+
goldenrod: "daa520",
|
|
1139
|
+
gray: "808080",
|
|
1140
|
+
green: "008000",
|
|
1141
|
+
greenyellow: "adff2f",
|
|
1142
|
+
grey: "808080",
|
|
1143
|
+
honeydew: "f0fff0",
|
|
1144
|
+
hotpink: "ff69b4",
|
|
1145
|
+
indianred: "cd5c5c",
|
|
1146
|
+
indigo: "4b0082",
|
|
1147
|
+
ivory: "fffff0",
|
|
1148
|
+
khaki: "f0e68c",
|
|
1149
|
+
lavender: "e6e6fa",
|
|
1150
|
+
lavenderblush: "fff0f5",
|
|
1151
|
+
lawngreen: "7cfc00",
|
|
1152
|
+
lemonchiffon: "fffacd",
|
|
1153
|
+
lightblue: "add8e6",
|
|
1154
|
+
lightcoral: "f08080",
|
|
1155
|
+
lightcyan: "e0ffff",
|
|
1156
|
+
lightgoldenrodyellow: "fafad2",
|
|
1157
|
+
lightgray: "d3d3d3",
|
|
1158
|
+
lightgreen: "90ee90",
|
|
1159
|
+
lightgrey: "d3d3d3",
|
|
1160
|
+
lightpink: "ffb6c1",
|
|
1161
|
+
lightsalmon: "ffa07a",
|
|
1162
|
+
lightseagreen: "20b2aa",
|
|
1163
|
+
lightskyblue: "87cefa",
|
|
1164
|
+
lightslategray: "789",
|
|
1165
|
+
lightslategrey: "789",
|
|
1166
|
+
lightsteelblue: "b0c4de",
|
|
1167
|
+
lightyellow: "ffffe0",
|
|
1168
|
+
lime: "0f0",
|
|
1169
|
+
limegreen: "32cd32",
|
|
1170
|
+
linen: "faf0e6",
|
|
1171
|
+
magenta: "f0f",
|
|
1172
|
+
maroon: "800000",
|
|
1173
|
+
mediumaquamarine: "66cdaa",
|
|
1174
|
+
mediumblue: "0000cd",
|
|
1175
|
+
mediumorchid: "ba55d3",
|
|
1176
|
+
mediumpurple: "9370db",
|
|
1177
|
+
mediumseagreen: "3cb371",
|
|
1178
|
+
mediumslateblue: "7b68ee",
|
|
1179
|
+
mediumspringgreen: "00fa9a",
|
|
1180
|
+
mediumturquoise: "48d1cc",
|
|
1181
|
+
mediumvioletred: "c71585",
|
|
1182
|
+
midnightblue: "191970",
|
|
1183
|
+
mintcream: "f5fffa",
|
|
1184
|
+
mistyrose: "ffe4e1",
|
|
1185
|
+
moccasin: "ffe4b5",
|
|
1186
|
+
navajowhite: "ffdead",
|
|
1187
|
+
navy: "000080",
|
|
1188
|
+
oldlace: "fdf5e6",
|
|
1189
|
+
olive: "808000",
|
|
1190
|
+
olivedrab: "6b8e23",
|
|
1191
|
+
orange: "ffa500",
|
|
1192
|
+
orangered: "ff4500",
|
|
1193
|
+
orchid: "da70d6",
|
|
1194
|
+
palegoldenrod: "eee8aa",
|
|
1195
|
+
palegreen: "98fb98",
|
|
1196
|
+
paleturquoise: "afeeee",
|
|
1197
|
+
palevioletred: "db7093",
|
|
1198
|
+
papayawhip: "ffefd5",
|
|
1199
|
+
peachpuff: "ffdab9",
|
|
1200
|
+
peru: "cd853f",
|
|
1201
|
+
pink: "ffc0cb",
|
|
1202
|
+
plum: "dda0dd",
|
|
1203
|
+
powderblue: "b0e0e6",
|
|
1204
|
+
purple: "800080",
|
|
1205
|
+
rebeccapurple: "663399",
|
|
1206
|
+
red: "f00",
|
|
1207
|
+
rosybrown: "bc8f8f",
|
|
1208
|
+
royalblue: "4169e1",
|
|
1209
|
+
saddlebrown: "8b4513",
|
|
1210
|
+
salmon: "fa8072",
|
|
1211
|
+
sandybrown: "f4a460",
|
|
1212
|
+
seagreen: "2e8b57",
|
|
1213
|
+
seashell: "fff5ee",
|
|
1214
|
+
sienna: "a0522d",
|
|
1215
|
+
silver: "c0c0c0",
|
|
1216
|
+
skyblue: "87ceeb",
|
|
1217
|
+
slateblue: "6a5acd",
|
|
1218
|
+
slategray: "708090",
|
|
1219
|
+
slategrey: "708090",
|
|
1220
|
+
snow: "fffafa",
|
|
1221
|
+
springgreen: "00ff7f",
|
|
1222
|
+
steelblue: "4682b4",
|
|
1223
|
+
tan: "d2b48c",
|
|
1224
|
+
teal: "008080",
|
|
1225
|
+
thistle: "d8bfd8",
|
|
1226
|
+
tomato: "ff6347",
|
|
1227
|
+
turquoise: "40e0d0",
|
|
1228
|
+
violet: "ee82ee",
|
|
1229
|
+
wheat: "f5deb3",
|
|
1230
|
+
white: "fff",
|
|
1231
|
+
whitesmoke: "f5f5f5",
|
|
1232
|
+
yellow: "ff0",
|
|
1233
|
+
yellowgreen: "9acd32"
|
|
1234
|
+
};
|
|
1235
|
+
var hexNames = tinycolor.hexNames = flip(names);
|
|
1236
|
+
function flip(o) {
|
|
1237
|
+
var flipped = {};
|
|
1238
|
+
for (var i in o) {
|
|
1239
|
+
if (o.hasOwnProperty(i)) {
|
|
1240
|
+
flipped[o[i]] = i;
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
return flipped;
|
|
1244
|
+
}
|
|
1245
|
+
function boundAlpha(a) {
|
|
1246
|
+
a = parseFloat(a);
|
|
1247
|
+
if (isNaN(a) || a < 0 || a > 1) {
|
|
1248
|
+
a = 1;
|
|
1249
|
+
}
|
|
1250
|
+
return a;
|
|
1251
|
+
}
|
|
1252
|
+
function bound01(n, max) {
|
|
1253
|
+
if (isOnePointZero(n))
|
|
1254
|
+
n = "100%";
|
|
1255
|
+
var processPercent = isPercentage(n);
|
|
1256
|
+
n = Math.min(max, Math.max(0, parseFloat(n)));
|
|
1257
|
+
if (processPercent) {
|
|
1258
|
+
n = parseInt(n * max, 10) / 100;
|
|
1259
|
+
}
|
|
1260
|
+
if (Math.abs(n - max) < 0.000001) {
|
|
1261
|
+
return 1;
|
|
1262
|
+
}
|
|
1263
|
+
return n % max / parseFloat(max);
|
|
1264
|
+
}
|
|
1265
|
+
function clamp01(val) {
|
|
1266
|
+
return Math.min(1, Math.max(0, val));
|
|
1267
|
+
}
|
|
1268
|
+
function parseIntFromHex(val) {
|
|
1269
|
+
return parseInt(val, 16);
|
|
1270
|
+
}
|
|
1271
|
+
function isOnePointZero(n) {
|
|
1272
|
+
return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
|
|
1273
|
+
}
|
|
1274
|
+
function isPercentage(n) {
|
|
1275
|
+
return typeof n === "string" && n.indexOf("%") != -1;
|
|
1276
|
+
}
|
|
1277
|
+
function pad2(c) {
|
|
1278
|
+
return c.length == 1 ? "0" + c : "" + c;
|
|
1279
|
+
}
|
|
1280
|
+
function convertToPercentage(n) {
|
|
1281
|
+
if (n <= 1) {
|
|
1282
|
+
n = n * 100 + "%";
|
|
1283
|
+
}
|
|
1284
|
+
return n;
|
|
1285
|
+
}
|
|
1286
|
+
function convertDecimalToHex(d) {
|
|
1287
|
+
return Math.round(parseFloat(d) * 255).toString(16);
|
|
1288
|
+
}
|
|
1289
|
+
function convertHexToDecimal(h) {
|
|
1290
|
+
return parseIntFromHex(h) / 255;
|
|
1291
|
+
}
|
|
1292
|
+
var matchers = function() {
|
|
1293
|
+
var CSS_INTEGER = "[-\\+]?\\d+%?";
|
|
1294
|
+
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
|
|
1295
|
+
var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
|
|
1296
|
+
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
|
1297
|
+
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
|
1298
|
+
return {
|
|
1299
|
+
CSS_UNIT: new RegExp(CSS_UNIT),
|
|
1300
|
+
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
|
|
1301
|
+
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
|
|
1302
|
+
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
|
|
1303
|
+
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
|
|
1304
|
+
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
|
|
1305
|
+
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
|
|
1306
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
1307
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
1308
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
1309
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
1310
|
+
};
|
|
1311
|
+
}();
|
|
1312
|
+
function isValidCSSUnit(color) {
|
|
1313
|
+
return !!matchers.CSS_UNIT.exec(color);
|
|
1314
|
+
}
|
|
1315
|
+
function stringInputToObject(color) {
|
|
1316
|
+
color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
|
|
1317
|
+
var named = false;
|
|
1318
|
+
if (names[color]) {
|
|
1319
|
+
color = names[color];
|
|
1320
|
+
named = true;
|
|
1321
|
+
} else if (color == "transparent") {
|
|
1322
|
+
return {
|
|
1323
|
+
r: 0,
|
|
1324
|
+
g: 0,
|
|
1325
|
+
b: 0,
|
|
1326
|
+
a: 0,
|
|
1327
|
+
format: "name"
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
var match2;
|
|
1331
|
+
if (match2 = matchers.rgb.exec(color)) {
|
|
1332
|
+
return {
|
|
1333
|
+
r: match2[1],
|
|
1334
|
+
g: match2[2],
|
|
1335
|
+
b: match2[3]
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
if (match2 = matchers.rgba.exec(color)) {
|
|
1339
|
+
return {
|
|
1340
|
+
r: match2[1],
|
|
1341
|
+
g: match2[2],
|
|
1342
|
+
b: match2[3],
|
|
1343
|
+
a: match2[4]
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1346
|
+
if (match2 = matchers.hsl.exec(color)) {
|
|
1347
|
+
return {
|
|
1348
|
+
h: match2[1],
|
|
1349
|
+
s: match2[2],
|
|
1350
|
+
l: match2[3]
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
if (match2 = matchers.hsla.exec(color)) {
|
|
1354
|
+
return {
|
|
1355
|
+
h: match2[1],
|
|
1356
|
+
s: match2[2],
|
|
1357
|
+
l: match2[3],
|
|
1358
|
+
a: match2[4]
|
|
1359
|
+
};
|
|
1360
|
+
}
|
|
1361
|
+
if (match2 = matchers.hsv.exec(color)) {
|
|
1362
|
+
return {
|
|
1363
|
+
h: match2[1],
|
|
1364
|
+
s: match2[2],
|
|
1365
|
+
v: match2[3]
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
if (match2 = matchers.hsva.exec(color)) {
|
|
1369
|
+
return {
|
|
1370
|
+
h: match2[1],
|
|
1371
|
+
s: match2[2],
|
|
1372
|
+
v: match2[3],
|
|
1373
|
+
a: match2[4]
|
|
1374
|
+
};
|
|
1375
|
+
}
|
|
1376
|
+
if (match2 = matchers.hex8.exec(color)) {
|
|
1377
|
+
return {
|
|
1378
|
+
r: parseIntFromHex(match2[1]),
|
|
1379
|
+
g: parseIntFromHex(match2[2]),
|
|
1380
|
+
b: parseIntFromHex(match2[3]),
|
|
1381
|
+
a: convertHexToDecimal(match2[4]),
|
|
1382
|
+
format: named ? "name" : "hex8"
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
if (match2 = matchers.hex6.exec(color)) {
|
|
1386
|
+
return {
|
|
1387
|
+
r: parseIntFromHex(match2[1]),
|
|
1388
|
+
g: parseIntFromHex(match2[2]),
|
|
1389
|
+
b: parseIntFromHex(match2[3]),
|
|
1390
|
+
format: named ? "name" : "hex"
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
if (match2 = matchers.hex4.exec(color)) {
|
|
1394
|
+
return {
|
|
1395
|
+
r: parseIntFromHex(match2[1] + "" + match2[1]),
|
|
1396
|
+
g: parseIntFromHex(match2[2] + "" + match2[2]),
|
|
1397
|
+
b: parseIntFromHex(match2[3] + "" + match2[3]),
|
|
1398
|
+
a: convertHexToDecimal(match2[4] + "" + match2[4]),
|
|
1399
|
+
format: named ? "name" : "hex8"
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
if (match2 = matchers.hex3.exec(color)) {
|
|
1403
|
+
return {
|
|
1404
|
+
r: parseIntFromHex(match2[1] + "" + match2[1]),
|
|
1405
|
+
g: parseIntFromHex(match2[2] + "" + match2[2]),
|
|
1406
|
+
b: parseIntFromHex(match2[3] + "" + match2[3]),
|
|
1407
|
+
format: named ? "name" : "hex"
|
|
1408
|
+
};
|
|
1409
|
+
}
|
|
1410
|
+
return false;
|
|
1411
|
+
}
|
|
1412
|
+
function validateWCAG2Parms(parms) {
|
|
1413
|
+
var level, size;
|
|
1414
|
+
parms = parms || {
|
|
1415
|
+
level: "AA",
|
|
1416
|
+
size: "small"
|
|
1417
|
+
};
|
|
1418
|
+
level = (parms.level || "AA").toUpperCase();
|
|
1419
|
+
size = (parms.size || "small").toLowerCase();
|
|
1420
|
+
if (level !== "AA" && level !== "AAA") {
|
|
1421
|
+
level = "AA";
|
|
1422
|
+
}
|
|
1423
|
+
if (size !== "small" && size !== "large") {
|
|
1424
|
+
size = "small";
|
|
1425
|
+
}
|
|
1426
|
+
return {
|
|
1427
|
+
level,
|
|
1428
|
+
size
|
|
1429
|
+
};
|
|
1430
|
+
}
|
|
1431
|
+
return tinycolor;
|
|
1432
|
+
});
|
|
1433
|
+
});
|
|
1434
|
+
|
|
1435
|
+
// ../../node_modules/.bun/tinygradient@1.1.5/node_modules/tinygradient/index.js
|
|
1436
|
+
var require_tinygradient = __commonJS((exports, module) => {
|
|
1437
|
+
var tinycolor = require_tinycolor();
|
|
1438
|
+
var RGBA_MAX = { r: 256, g: 256, b: 256, a: 1 };
|
|
1439
|
+
var HSVA_MAX = { h: 360, s: 1, v: 1, a: 1 };
|
|
1440
|
+
function stepize(start, end, steps) {
|
|
1441
|
+
let step = {};
|
|
1442
|
+
for (let k in start) {
|
|
1443
|
+
if (start.hasOwnProperty(k)) {
|
|
1444
|
+
step[k] = steps === 0 ? 0 : (end[k] - start[k]) / steps;
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
return step;
|
|
1448
|
+
}
|
|
1449
|
+
function interpolate(step, start, i, max) {
|
|
1450
|
+
let color = {};
|
|
1451
|
+
for (let k in start) {
|
|
1452
|
+
if (start.hasOwnProperty(k)) {
|
|
1453
|
+
color[k] = step[k] * i + start[k];
|
|
1454
|
+
color[k] = color[k] < 0 ? color[k] + max[k] : max[k] !== 1 ? color[k] % max[k] : color[k];
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
return color;
|
|
1458
|
+
}
|
|
1459
|
+
function interpolateRgb(stop1, stop2, steps) {
|
|
1460
|
+
const start = stop1.color.toRgb();
|
|
1461
|
+
const end = stop2.color.toRgb();
|
|
1462
|
+
const step = stepize(start, end, steps);
|
|
1463
|
+
let gradient = [stop1.color];
|
|
1464
|
+
for (let i = 1;i < steps; i++) {
|
|
1465
|
+
const color = interpolate(step, start, i, RGBA_MAX);
|
|
1466
|
+
gradient.push(tinycolor(color));
|
|
1467
|
+
}
|
|
1468
|
+
return gradient;
|
|
1469
|
+
}
|
|
1470
|
+
function interpolateHsv(stop1, stop2, steps, mode) {
|
|
1471
|
+
const start = stop1.color.toHsv();
|
|
1472
|
+
const end = stop2.color.toHsv();
|
|
1473
|
+
if (start.s === 0 || end.s === 0) {
|
|
1474
|
+
return interpolateRgb(stop1, stop2, steps);
|
|
1475
|
+
}
|
|
1476
|
+
let trigonometric;
|
|
1477
|
+
if (typeof mode === "boolean") {
|
|
1478
|
+
trigonometric = mode;
|
|
1479
|
+
} else {
|
|
1480
|
+
const trigShortest = start.h < end.h && end.h - start.h < 180 || start.h > end.h && start.h - end.h > 180;
|
|
1481
|
+
trigonometric = mode === "long" && trigShortest || mode === "short" && !trigShortest;
|
|
1482
|
+
}
|
|
1483
|
+
const step = stepize(start, end, steps);
|
|
1484
|
+
let gradient = [stop1.color];
|
|
1485
|
+
let diff;
|
|
1486
|
+
if (start.h <= end.h && !trigonometric || start.h >= end.h && trigonometric) {
|
|
1487
|
+
diff = end.h - start.h;
|
|
1488
|
+
} else if (trigonometric) {
|
|
1489
|
+
diff = 360 - end.h + start.h;
|
|
1490
|
+
} else {
|
|
1491
|
+
diff = 360 - start.h + end.h;
|
|
1492
|
+
}
|
|
1493
|
+
step.h = Math.pow(-1, trigonometric ? 1 : 0) * Math.abs(diff) / steps;
|
|
1494
|
+
for (let i = 1;i < steps; i++) {
|
|
1495
|
+
const color = interpolate(step, start, i, HSVA_MAX);
|
|
1496
|
+
gradient.push(tinycolor(color));
|
|
1497
|
+
}
|
|
1498
|
+
return gradient;
|
|
1499
|
+
}
|
|
1500
|
+
function computeSubsteps(stops, steps) {
|
|
1501
|
+
const l = stops.length;
|
|
1502
|
+
steps = parseInt(steps, 10);
|
|
1503
|
+
if (isNaN(steps) || steps < 2) {
|
|
1504
|
+
throw new Error("Invalid number of steps (< 2)");
|
|
1505
|
+
}
|
|
1506
|
+
if (steps < l) {
|
|
1507
|
+
throw new Error("Number of steps cannot be inferior to number of stops");
|
|
1508
|
+
}
|
|
1509
|
+
let substeps = [];
|
|
1510
|
+
for (let i = 1;i < l; i++) {
|
|
1511
|
+
const step = (steps - 1) * (stops[i].pos - stops[i - 1].pos);
|
|
1512
|
+
substeps.push(Math.max(1, Math.round(step)));
|
|
1513
|
+
}
|
|
1514
|
+
let totalSubsteps = 1;
|
|
1515
|
+
for (let n = l - 1;n--; )
|
|
1516
|
+
totalSubsteps += substeps[n];
|
|
1517
|
+
while (totalSubsteps !== steps) {
|
|
1518
|
+
if (totalSubsteps < steps) {
|
|
1519
|
+
const min = Math.min.apply(null, substeps);
|
|
1520
|
+
substeps[substeps.indexOf(min)]++;
|
|
1521
|
+
totalSubsteps++;
|
|
1522
|
+
} else {
|
|
1523
|
+
const max = Math.max.apply(null, substeps);
|
|
1524
|
+
substeps[substeps.indexOf(max)]--;
|
|
1525
|
+
totalSubsteps--;
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
return substeps;
|
|
1529
|
+
}
|
|
1530
|
+
function computeAt(stops, pos, method, max) {
|
|
1531
|
+
if (pos < 0 || pos > 1) {
|
|
1532
|
+
throw new Error("Position must be between 0 and 1");
|
|
1533
|
+
}
|
|
1534
|
+
let start, end;
|
|
1535
|
+
for (let i = 0, l = stops.length;i < l - 1; i++) {
|
|
1536
|
+
if (pos >= stops[i].pos && pos < stops[i + 1].pos) {
|
|
1537
|
+
start = stops[i];
|
|
1538
|
+
end = stops[i + 1];
|
|
1539
|
+
break;
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
if (!start) {
|
|
1543
|
+
start = end = stops[stops.length - 1];
|
|
1544
|
+
}
|
|
1545
|
+
const step = stepize(start.color[method](), end.color[method](), (end.pos - start.pos) * 100);
|
|
1546
|
+
const color = interpolate(step, start.color[method](), (pos - start.pos) * 100, max);
|
|
1547
|
+
return tinycolor(color);
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
class TinyGradient {
|
|
1551
|
+
constructor(stops) {
|
|
1552
|
+
if (stops.length < 2) {
|
|
1553
|
+
throw new Error("Invalid number of stops (< 2)");
|
|
1554
|
+
}
|
|
1555
|
+
const havingPositions = stops[0].pos !== undefined;
|
|
1556
|
+
let l = stops.length;
|
|
1557
|
+
let p = -1;
|
|
1558
|
+
let lastColorLess = false;
|
|
1559
|
+
this.stops = stops.map((stop, i) => {
|
|
1560
|
+
const hasPosition = stop.pos !== undefined;
|
|
1561
|
+
if (havingPositions ^ hasPosition) {
|
|
1562
|
+
throw new Error("Cannot mix positionned and not posionned color stops");
|
|
1563
|
+
}
|
|
1564
|
+
if (hasPosition) {
|
|
1565
|
+
const hasColor = stop.color !== undefined;
|
|
1566
|
+
if (!hasColor && (lastColorLess || i === 0 || i === l - 1)) {
|
|
1567
|
+
throw new Error("Cannot define two consecutive position-only stops");
|
|
1568
|
+
}
|
|
1569
|
+
lastColorLess = !hasColor;
|
|
1570
|
+
stop = {
|
|
1571
|
+
color: hasColor ? tinycolor(stop.color) : null,
|
|
1572
|
+
colorLess: !hasColor,
|
|
1573
|
+
pos: stop.pos
|
|
1574
|
+
};
|
|
1575
|
+
if (stop.pos < 0 || stop.pos > 1) {
|
|
1576
|
+
throw new Error("Color stops positions must be between 0 and 1");
|
|
1577
|
+
} else if (stop.pos < p) {
|
|
1578
|
+
throw new Error("Color stops positions are not ordered");
|
|
1579
|
+
}
|
|
1580
|
+
p = stop.pos;
|
|
1581
|
+
} else {
|
|
1582
|
+
stop = {
|
|
1583
|
+
color: tinycolor(stop.color !== undefined ? stop.color : stop),
|
|
1584
|
+
pos: i / (l - 1)
|
|
1585
|
+
};
|
|
1586
|
+
}
|
|
1587
|
+
return stop;
|
|
1588
|
+
});
|
|
1589
|
+
if (this.stops[0].pos !== 0) {
|
|
1590
|
+
this.stops.unshift({
|
|
1591
|
+
color: this.stops[0].color,
|
|
1592
|
+
pos: 0
|
|
1593
|
+
});
|
|
1594
|
+
l++;
|
|
1595
|
+
}
|
|
1596
|
+
if (this.stops[l - 1].pos !== 1) {
|
|
1597
|
+
this.stops.push({
|
|
1598
|
+
color: this.stops[l - 1].color,
|
|
1599
|
+
pos: 1
|
|
1600
|
+
});
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
reverse() {
|
|
1604
|
+
let stops = [];
|
|
1605
|
+
this.stops.forEach(function(stop) {
|
|
1606
|
+
stops.push({
|
|
1607
|
+
color: stop.color,
|
|
1608
|
+
pos: 1 - stop.pos
|
|
1609
|
+
});
|
|
1610
|
+
});
|
|
1611
|
+
return new TinyGradient(stops.reverse());
|
|
1612
|
+
}
|
|
1613
|
+
loop() {
|
|
1614
|
+
let stops1 = [];
|
|
1615
|
+
let stops2 = [];
|
|
1616
|
+
this.stops.forEach((stop) => {
|
|
1617
|
+
stops1.push({
|
|
1618
|
+
color: stop.color,
|
|
1619
|
+
pos: stop.pos / 2
|
|
1620
|
+
});
|
|
1621
|
+
});
|
|
1622
|
+
this.stops.slice(0, -1).forEach((stop) => {
|
|
1623
|
+
stops2.push({
|
|
1624
|
+
color: stop.color,
|
|
1625
|
+
pos: 1 - stop.pos / 2
|
|
1626
|
+
});
|
|
1627
|
+
});
|
|
1628
|
+
return new TinyGradient(stops1.concat(stops2.reverse()));
|
|
1629
|
+
}
|
|
1630
|
+
rgb(steps) {
|
|
1631
|
+
const substeps = computeSubsteps(this.stops, steps);
|
|
1632
|
+
let gradient = [];
|
|
1633
|
+
this.stops.forEach((stop, i) => {
|
|
1634
|
+
if (stop.colorLess) {
|
|
1635
|
+
stop.color = interpolateRgb(this.stops[i - 1], this.stops[i + 1], 2)[1];
|
|
1636
|
+
}
|
|
1637
|
+
});
|
|
1638
|
+
for (let i = 0, l = this.stops.length;i < l - 1; i++) {
|
|
1639
|
+
const rgb = interpolateRgb(this.stops[i], this.stops[i + 1], substeps[i]);
|
|
1640
|
+
gradient.splice(gradient.length, 0, ...rgb);
|
|
1641
|
+
}
|
|
1642
|
+
gradient.push(this.stops[this.stops.length - 1].color);
|
|
1643
|
+
return gradient;
|
|
1644
|
+
}
|
|
1645
|
+
hsv(steps, mode) {
|
|
1646
|
+
const substeps = computeSubsteps(this.stops, steps);
|
|
1647
|
+
let gradient = [];
|
|
1648
|
+
this.stops.forEach((stop, i) => {
|
|
1649
|
+
if (stop.colorLess) {
|
|
1650
|
+
stop.color = interpolateHsv(this.stops[i - 1], this.stops[i + 1], 2, mode)[1];
|
|
1651
|
+
}
|
|
1652
|
+
});
|
|
1653
|
+
for (let i = 0, l = this.stops.length;i < l - 1; i++) {
|
|
1654
|
+
const hsv = interpolateHsv(this.stops[i], this.stops[i + 1], substeps[i], mode);
|
|
1655
|
+
gradient.splice(gradient.length, 0, ...hsv);
|
|
1656
|
+
}
|
|
1657
|
+
gradient.push(this.stops[this.stops.length - 1].color);
|
|
1658
|
+
return gradient;
|
|
1659
|
+
}
|
|
1660
|
+
css(mode, direction) {
|
|
1661
|
+
mode = mode || "linear";
|
|
1662
|
+
direction = direction || (mode === "linear" ? "to right" : "ellipse at center");
|
|
1663
|
+
let css = mode + "-gradient(" + direction;
|
|
1664
|
+
this.stops.forEach(function(stop) {
|
|
1665
|
+
css += ", " + (stop.colorLess ? "" : stop.color.toRgbString() + " ") + stop.pos * 100 + "%";
|
|
1666
|
+
});
|
|
1667
|
+
css += ")";
|
|
1668
|
+
return css;
|
|
1669
|
+
}
|
|
1670
|
+
rgbAt(pos) {
|
|
1671
|
+
return computeAt(this.stops, pos, "toRgb", RGBA_MAX);
|
|
1672
|
+
}
|
|
1673
|
+
hsvAt(pos) {
|
|
1674
|
+
return computeAt(this.stops, pos, "toHsv", HSVA_MAX);
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
module.exports = function(stops) {
|
|
1678
|
+
if (arguments.length === 1) {
|
|
1679
|
+
if (!Array.isArray(arguments[0])) {
|
|
1680
|
+
throw new Error('"stops" is not an array');
|
|
1681
|
+
}
|
|
1682
|
+
stops = arguments[0];
|
|
1683
|
+
} else {
|
|
1684
|
+
stops = Array.prototype.slice.call(arguments);
|
|
1685
|
+
}
|
|
1686
|
+
return new TinyGradient(stops);
|
|
1687
|
+
};
|
|
1688
|
+
});
|
|
1689
|
+
|
|
226
1690
|
// src/index.ts
|
|
227
1691
|
import { Command } from "commander";
|
|
228
|
-
import
|
|
1692
|
+
import chalk5 from "chalk";
|
|
229
1693
|
import { createRequire } from "module";
|
|
230
1694
|
|
|
231
1695
|
// src/commands/generate.ts
|
|
232
|
-
import { existsSync as
|
|
1696
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync, writeFileSync } from "fs";
|
|
233
1697
|
import { join } from "path";
|
|
234
1698
|
|
|
235
1699
|
// src/loader.ts
|
|
236
1700
|
import { resolve as resolve2 } from "path";
|
|
1701
|
+
import { existsSync as existsSync2, statSync, mkdirSync } from "fs";
|
|
237
1702
|
|
|
238
1703
|
// ../../node_modules/.bun/minimatch@9.0.5/node_modules/minimatch/dist/esm/index.js
|
|
239
1704
|
var import_brace_expansion = __toESM(require_brace_expansion(), 1);
|
|
@@ -5513,24 +6978,966 @@ var glob = Object.assign(glob_, {
|
|
|
5513
6978
|
glob.glob = glob;
|
|
5514
6979
|
|
|
5515
6980
|
// src/ui.ts
|
|
5516
|
-
import
|
|
6981
|
+
import chalk3 from "chalk";
|
|
5517
6982
|
import ora from "ora";
|
|
5518
6983
|
import inquirer from "inquirer";
|
|
5519
|
-
|
|
6984
|
+
|
|
6985
|
+
// ../../node_modules/.bun/boxen@8.0.1/node_modules/boxen/index.js
|
|
6986
|
+
import process2 from "node:process";
|
|
6987
|
+
|
|
6988
|
+
// ../../node_modules/.bun/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
|
|
6989
|
+
function ansiRegex({ onlyFirst = false } = {}) {
|
|
6990
|
+
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
6991
|
+
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
6992
|
+
const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
6993
|
+
const pattern = `${osc}|${csi}`;
|
|
6994
|
+
return new RegExp(pattern, onlyFirst ? undefined : "g");
|
|
6995
|
+
}
|
|
6996
|
+
|
|
6997
|
+
// ../../node_modules/.bun/strip-ansi@7.1.2/node_modules/strip-ansi/index.js
|
|
6998
|
+
var regex = ansiRegex();
|
|
6999
|
+
function stripAnsi(string) {
|
|
7000
|
+
if (typeof string !== "string") {
|
|
7001
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
7002
|
+
}
|
|
7003
|
+
return string.replace(regex, "");
|
|
7004
|
+
}
|
|
7005
|
+
|
|
7006
|
+
// ../../node_modules/.bun/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/lookup.js
|
|
7007
|
+
function isAmbiguous(x) {
|
|
7008
|
+
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
7009
|
+
}
|
|
7010
|
+
function isFullWidth(x) {
|
|
7011
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
7012
|
+
}
|
|
7013
|
+
function isWide(x) {
|
|
7014
|
+
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x >= 94192 && x <= 94198 || x >= 94208 && x <= 101589 || x >= 101631 && x <= 101662 || x >= 101760 && x <= 101874 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128728 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129674 || x >= 129678 && x <= 129734 || x === 129736 || x >= 129741 && x <= 129756 || x >= 129759 && x <= 129770 || x >= 129775 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
7015
|
+
}
|
|
7016
|
+
|
|
7017
|
+
// ../../node_modules/.bun/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/index.js
|
|
7018
|
+
function validate(codePoint) {
|
|
7019
|
+
if (!Number.isSafeInteger(codePoint)) {
|
|
7020
|
+
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
7021
|
+
}
|
|
7022
|
+
}
|
|
7023
|
+
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
7024
|
+
validate(codePoint);
|
|
7025
|
+
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
|
|
7026
|
+
return 2;
|
|
7027
|
+
}
|
|
7028
|
+
return 1;
|
|
7029
|
+
}
|
|
7030
|
+
|
|
7031
|
+
// ../../node_modules/.bun/string-width@7.2.0/node_modules/string-width/index.js
|
|
7032
|
+
var import_emoji_regex = __toESM(require_emoji_regex(), 1);
|
|
7033
|
+
var segmenter = new Intl.Segmenter;
|
|
7034
|
+
var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
7035
|
+
function stringWidth(string, options = {}) {
|
|
7036
|
+
if (typeof string !== "string" || string.length === 0) {
|
|
7037
|
+
return 0;
|
|
7038
|
+
}
|
|
7039
|
+
const {
|
|
7040
|
+
ambiguousIsNarrow = true,
|
|
7041
|
+
countAnsiEscapeCodes = false
|
|
7042
|
+
} = options;
|
|
7043
|
+
if (!countAnsiEscapeCodes) {
|
|
7044
|
+
string = stripAnsi(string);
|
|
7045
|
+
}
|
|
7046
|
+
if (string.length === 0) {
|
|
7047
|
+
return 0;
|
|
7048
|
+
}
|
|
7049
|
+
let width = 0;
|
|
7050
|
+
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
7051
|
+
for (const { segment: character } of segmenter.segment(string)) {
|
|
7052
|
+
const codePoint = character.codePointAt(0);
|
|
7053
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
7054
|
+
continue;
|
|
7055
|
+
}
|
|
7056
|
+
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
|
|
7057
|
+
continue;
|
|
7058
|
+
}
|
|
7059
|
+
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
|
|
7060
|
+
continue;
|
|
7061
|
+
}
|
|
7062
|
+
if (codePoint >= 55296 && codePoint <= 57343) {
|
|
7063
|
+
continue;
|
|
7064
|
+
}
|
|
7065
|
+
if (codePoint >= 65024 && codePoint <= 65039) {
|
|
7066
|
+
continue;
|
|
7067
|
+
}
|
|
7068
|
+
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
7069
|
+
continue;
|
|
7070
|
+
}
|
|
7071
|
+
if (import_emoji_regex.default().test(character)) {
|
|
7072
|
+
width += 2;
|
|
7073
|
+
continue;
|
|
7074
|
+
}
|
|
7075
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
7076
|
+
}
|
|
7077
|
+
return width;
|
|
7078
|
+
}
|
|
7079
|
+
|
|
7080
|
+
// ../../node_modules/.bun/boxen@8.0.1/node_modules/boxen/index.js
|
|
7081
|
+
import chalk from "chalk";
|
|
7082
|
+
|
|
7083
|
+
// ../../node_modules/.bun/widest-line@5.0.0/node_modules/widest-line/index.js
|
|
7084
|
+
function widestLine(string) {
|
|
7085
|
+
let lineWidth = 0;
|
|
7086
|
+
for (const line of string.split(`
|
|
7087
|
+
`)) {
|
|
7088
|
+
lineWidth = Math.max(lineWidth, stringWidth(line));
|
|
7089
|
+
}
|
|
7090
|
+
return lineWidth;
|
|
7091
|
+
}
|
|
7092
|
+
|
|
7093
|
+
// ../../node_modules/.bun/boxen@8.0.1/node_modules/boxen/index.js
|
|
7094
|
+
var import_cli_boxes = __toESM(require_cli_boxes(), 1);
|
|
7095
|
+
|
|
7096
|
+
// ../../node_modules/.bun/camelcase@8.0.0/node_modules/camelcase/index.js
|
|
7097
|
+
var UPPERCASE = /[\p{Lu}]/u;
|
|
7098
|
+
var LOWERCASE = /[\p{Ll}]/u;
|
|
7099
|
+
var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
|
|
7100
|
+
var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
|
|
7101
|
+
var SEPARATORS = /[_.\- ]+/;
|
|
7102
|
+
var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
|
|
7103
|
+
var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
|
|
7104
|
+
var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
|
|
7105
|
+
var preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase) => {
|
|
7106
|
+
let isLastCharLower = false;
|
|
7107
|
+
let isLastCharUpper = false;
|
|
7108
|
+
let isLastLastCharUpper = false;
|
|
7109
|
+
let isLastLastCharPreserved = false;
|
|
7110
|
+
for (let index = 0;index < string.length; index++) {
|
|
7111
|
+
const character = string[index];
|
|
7112
|
+
isLastLastCharPreserved = index > 2 ? string[index - 3] === "-" : true;
|
|
7113
|
+
if (isLastCharLower && UPPERCASE.test(character)) {
|
|
7114
|
+
string = string.slice(0, index) + "-" + string.slice(index);
|
|
7115
|
+
isLastCharLower = false;
|
|
7116
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
7117
|
+
isLastCharUpper = true;
|
|
7118
|
+
index++;
|
|
7119
|
+
} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase)) {
|
|
7120
|
+
string = string.slice(0, index - 1) + "-" + string.slice(index - 1);
|
|
7121
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
7122
|
+
isLastCharUpper = false;
|
|
7123
|
+
isLastCharLower = true;
|
|
7124
|
+
} else {
|
|
7125
|
+
isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
|
|
7126
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
7127
|
+
isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
|
|
7128
|
+
}
|
|
7129
|
+
}
|
|
7130
|
+
return string;
|
|
7131
|
+
};
|
|
7132
|
+
var preserveConsecutiveUppercase = (input, toLowerCase) => {
|
|
7133
|
+
LEADING_CAPITAL.lastIndex = 0;
|
|
7134
|
+
return input.replaceAll(LEADING_CAPITAL, (match2) => toLowerCase(match2));
|
|
7135
|
+
};
|
|
7136
|
+
var postProcess = (input, toUpperCase) => {
|
|
7137
|
+
SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
|
|
7138
|
+
NUMBERS_AND_IDENTIFIER.lastIndex = 0;
|
|
7139
|
+
return input.replaceAll(NUMBERS_AND_IDENTIFIER, (match2, pattern, offset) => ["_", "-"].includes(input.charAt(offset + match2.length)) ? match2 : toUpperCase(match2)).replaceAll(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier));
|
|
7140
|
+
};
|
|
7141
|
+
function camelCase(input, options) {
|
|
7142
|
+
if (!(typeof input === "string" || Array.isArray(input))) {
|
|
7143
|
+
throw new TypeError("Expected the input to be `string | string[]`");
|
|
7144
|
+
}
|
|
7145
|
+
options = {
|
|
7146
|
+
pascalCase: false,
|
|
7147
|
+
preserveConsecutiveUppercase: false,
|
|
7148
|
+
...options
|
|
7149
|
+
};
|
|
7150
|
+
if (Array.isArray(input)) {
|
|
7151
|
+
input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
|
|
7152
|
+
} else {
|
|
7153
|
+
input = input.trim();
|
|
7154
|
+
}
|
|
7155
|
+
if (input.length === 0) {
|
|
7156
|
+
return "";
|
|
7157
|
+
}
|
|
7158
|
+
const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
|
|
7159
|
+
const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
|
|
7160
|
+
if (input.length === 1) {
|
|
7161
|
+
if (SEPARATORS.test(input)) {
|
|
7162
|
+
return "";
|
|
7163
|
+
}
|
|
7164
|
+
return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
|
|
7165
|
+
}
|
|
7166
|
+
const hasUpperCase = input !== toLowerCase(input);
|
|
7167
|
+
if (hasUpperCase) {
|
|
7168
|
+
input = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);
|
|
7169
|
+
}
|
|
7170
|
+
input = input.replace(LEADING_SEPARATORS, "");
|
|
7171
|
+
input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
|
|
7172
|
+
if (options.pascalCase) {
|
|
7173
|
+
input = toUpperCase(input.charAt(0)) + input.slice(1);
|
|
7174
|
+
}
|
|
7175
|
+
return postProcess(input, toUpperCase);
|
|
7176
|
+
}
|
|
7177
|
+
|
|
7178
|
+
// ../../node_modules/.bun/boxen@8.0.1/node_modules/boxen/index.js
|
|
7179
|
+
var import_ansi_align = __toESM(require_ansi_align(), 1);
|
|
7180
|
+
|
|
7181
|
+
// ../../node_modules/.bun/ansi-styles@6.2.3/node_modules/ansi-styles/index.js
|
|
7182
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
7183
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
7184
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
7185
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
7186
|
+
var styles = {
|
|
7187
|
+
modifier: {
|
|
7188
|
+
reset: [0, 0],
|
|
7189
|
+
bold: [1, 22],
|
|
7190
|
+
dim: [2, 22],
|
|
7191
|
+
italic: [3, 23],
|
|
7192
|
+
underline: [4, 24],
|
|
7193
|
+
overline: [53, 55],
|
|
7194
|
+
inverse: [7, 27],
|
|
7195
|
+
hidden: [8, 28],
|
|
7196
|
+
strikethrough: [9, 29]
|
|
7197
|
+
},
|
|
7198
|
+
color: {
|
|
7199
|
+
black: [30, 39],
|
|
7200
|
+
red: [31, 39],
|
|
7201
|
+
green: [32, 39],
|
|
7202
|
+
yellow: [33, 39],
|
|
7203
|
+
blue: [34, 39],
|
|
7204
|
+
magenta: [35, 39],
|
|
7205
|
+
cyan: [36, 39],
|
|
7206
|
+
white: [37, 39],
|
|
7207
|
+
blackBright: [90, 39],
|
|
7208
|
+
gray: [90, 39],
|
|
7209
|
+
grey: [90, 39],
|
|
7210
|
+
redBright: [91, 39],
|
|
7211
|
+
greenBright: [92, 39],
|
|
7212
|
+
yellowBright: [93, 39],
|
|
7213
|
+
blueBright: [94, 39],
|
|
7214
|
+
magentaBright: [95, 39],
|
|
7215
|
+
cyanBright: [96, 39],
|
|
7216
|
+
whiteBright: [97, 39]
|
|
7217
|
+
},
|
|
7218
|
+
bgColor: {
|
|
7219
|
+
bgBlack: [40, 49],
|
|
7220
|
+
bgRed: [41, 49],
|
|
7221
|
+
bgGreen: [42, 49],
|
|
7222
|
+
bgYellow: [43, 49],
|
|
7223
|
+
bgBlue: [44, 49],
|
|
7224
|
+
bgMagenta: [45, 49],
|
|
7225
|
+
bgCyan: [46, 49],
|
|
7226
|
+
bgWhite: [47, 49],
|
|
7227
|
+
bgBlackBright: [100, 49],
|
|
7228
|
+
bgGray: [100, 49],
|
|
7229
|
+
bgGrey: [100, 49],
|
|
7230
|
+
bgRedBright: [101, 49],
|
|
7231
|
+
bgGreenBright: [102, 49],
|
|
7232
|
+
bgYellowBright: [103, 49],
|
|
7233
|
+
bgBlueBright: [104, 49],
|
|
7234
|
+
bgMagentaBright: [105, 49],
|
|
7235
|
+
bgCyanBright: [106, 49],
|
|
7236
|
+
bgWhiteBright: [107, 49]
|
|
7237
|
+
}
|
|
7238
|
+
};
|
|
7239
|
+
var modifierNames = Object.keys(styles.modifier);
|
|
7240
|
+
var foregroundColorNames = Object.keys(styles.color);
|
|
7241
|
+
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
7242
|
+
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
7243
|
+
function assembleStyles() {
|
|
7244
|
+
const codes = new Map;
|
|
7245
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
7246
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
7247
|
+
styles[styleName] = {
|
|
7248
|
+
open: `\x1B[${style[0]}m`,
|
|
7249
|
+
close: `\x1B[${style[1]}m`
|
|
7250
|
+
};
|
|
7251
|
+
group[styleName] = styles[styleName];
|
|
7252
|
+
codes.set(style[0], style[1]);
|
|
7253
|
+
}
|
|
7254
|
+
Object.defineProperty(styles, groupName, {
|
|
7255
|
+
value: group,
|
|
7256
|
+
enumerable: false
|
|
7257
|
+
});
|
|
7258
|
+
}
|
|
7259
|
+
Object.defineProperty(styles, "codes", {
|
|
7260
|
+
value: codes,
|
|
7261
|
+
enumerable: false
|
|
7262
|
+
});
|
|
7263
|
+
styles.color.close = "\x1B[39m";
|
|
7264
|
+
styles.bgColor.close = "\x1B[49m";
|
|
7265
|
+
styles.color.ansi = wrapAnsi16();
|
|
7266
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
7267
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
7268
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
7269
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
7270
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
7271
|
+
Object.defineProperties(styles, {
|
|
7272
|
+
rgbToAnsi256: {
|
|
7273
|
+
value(red, green, blue) {
|
|
7274
|
+
if (red === green && green === blue) {
|
|
7275
|
+
if (red < 8) {
|
|
7276
|
+
return 16;
|
|
7277
|
+
}
|
|
7278
|
+
if (red > 248) {
|
|
7279
|
+
return 231;
|
|
7280
|
+
}
|
|
7281
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
7282
|
+
}
|
|
7283
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
7284
|
+
},
|
|
7285
|
+
enumerable: false
|
|
7286
|
+
},
|
|
7287
|
+
hexToRgb: {
|
|
7288
|
+
value(hex) {
|
|
7289
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
7290
|
+
if (!matches) {
|
|
7291
|
+
return [0, 0, 0];
|
|
7292
|
+
}
|
|
7293
|
+
let [colorString] = matches;
|
|
7294
|
+
if (colorString.length === 3) {
|
|
7295
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
7296
|
+
}
|
|
7297
|
+
const integer = Number.parseInt(colorString, 16);
|
|
7298
|
+
return [
|
|
7299
|
+
integer >> 16 & 255,
|
|
7300
|
+
integer >> 8 & 255,
|
|
7301
|
+
integer & 255
|
|
7302
|
+
];
|
|
7303
|
+
},
|
|
7304
|
+
enumerable: false
|
|
7305
|
+
},
|
|
7306
|
+
hexToAnsi256: {
|
|
7307
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
7308
|
+
enumerable: false
|
|
7309
|
+
},
|
|
7310
|
+
ansi256ToAnsi: {
|
|
7311
|
+
value(code) {
|
|
7312
|
+
if (code < 8) {
|
|
7313
|
+
return 30 + code;
|
|
7314
|
+
}
|
|
7315
|
+
if (code < 16) {
|
|
7316
|
+
return 90 + (code - 8);
|
|
7317
|
+
}
|
|
7318
|
+
let red;
|
|
7319
|
+
let green;
|
|
7320
|
+
let blue;
|
|
7321
|
+
if (code >= 232) {
|
|
7322
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
7323
|
+
green = red;
|
|
7324
|
+
blue = red;
|
|
7325
|
+
} else {
|
|
7326
|
+
code -= 16;
|
|
7327
|
+
const remainder = code % 36;
|
|
7328
|
+
red = Math.floor(code / 36) / 5;
|
|
7329
|
+
green = Math.floor(remainder / 6) / 5;
|
|
7330
|
+
blue = remainder % 6 / 5;
|
|
7331
|
+
}
|
|
7332
|
+
const value = Math.max(red, green, blue) * 2;
|
|
7333
|
+
if (value === 0) {
|
|
7334
|
+
return 30;
|
|
7335
|
+
}
|
|
7336
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
7337
|
+
if (value === 2) {
|
|
7338
|
+
result += 60;
|
|
7339
|
+
}
|
|
7340
|
+
return result;
|
|
7341
|
+
},
|
|
7342
|
+
enumerable: false
|
|
7343
|
+
},
|
|
7344
|
+
rgbToAnsi: {
|
|
7345
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
7346
|
+
enumerable: false
|
|
7347
|
+
},
|
|
7348
|
+
hexToAnsi: {
|
|
7349
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
7350
|
+
enumerable: false
|
|
7351
|
+
}
|
|
7352
|
+
});
|
|
7353
|
+
return styles;
|
|
7354
|
+
}
|
|
7355
|
+
var ansiStyles = assembleStyles();
|
|
7356
|
+
var ansi_styles_default = ansiStyles;
|
|
7357
|
+
|
|
7358
|
+
// ../../node_modules/.bun/wrap-ansi@9.0.2/node_modules/wrap-ansi/index.js
|
|
7359
|
+
var ESCAPES = new Set([
|
|
7360
|
+
"\x1B",
|
|
7361
|
+
""
|
|
7362
|
+
]);
|
|
7363
|
+
var END_CODE = 39;
|
|
7364
|
+
var ANSI_ESCAPE_BELL = "\x07";
|
|
7365
|
+
var ANSI_CSI = "[";
|
|
7366
|
+
var ANSI_OSC = "]";
|
|
7367
|
+
var ANSI_SGR_TERMINATOR = "m";
|
|
7368
|
+
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
7369
|
+
var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
7370
|
+
var wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
7371
|
+
var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
|
|
7372
|
+
var wrapWord = (rows, word, columns) => {
|
|
7373
|
+
const characters = [...word];
|
|
7374
|
+
let isInsideEscape = false;
|
|
7375
|
+
let isInsideLinkEscape = false;
|
|
7376
|
+
let visible = stringWidth(stripAnsi(rows.at(-1)));
|
|
7377
|
+
for (const [index, character] of characters.entries()) {
|
|
7378
|
+
const characterLength = stringWidth(character);
|
|
7379
|
+
if (visible + characterLength <= columns) {
|
|
7380
|
+
rows[rows.length - 1] += character;
|
|
7381
|
+
} else {
|
|
7382
|
+
rows.push(character);
|
|
7383
|
+
visible = 0;
|
|
7384
|
+
}
|
|
7385
|
+
if (ESCAPES.has(character)) {
|
|
7386
|
+
isInsideEscape = true;
|
|
7387
|
+
const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("");
|
|
7388
|
+
isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
|
|
7389
|
+
}
|
|
7390
|
+
if (isInsideEscape) {
|
|
7391
|
+
if (isInsideLinkEscape) {
|
|
7392
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
7393
|
+
isInsideEscape = false;
|
|
7394
|
+
isInsideLinkEscape = false;
|
|
7395
|
+
}
|
|
7396
|
+
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
7397
|
+
isInsideEscape = false;
|
|
7398
|
+
}
|
|
7399
|
+
continue;
|
|
7400
|
+
}
|
|
7401
|
+
visible += characterLength;
|
|
7402
|
+
if (visible === columns && index < characters.length - 1) {
|
|
7403
|
+
rows.push("");
|
|
7404
|
+
visible = 0;
|
|
7405
|
+
}
|
|
7406
|
+
}
|
|
7407
|
+
if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
|
|
7408
|
+
rows[rows.length - 2] += rows.pop();
|
|
7409
|
+
}
|
|
7410
|
+
};
|
|
7411
|
+
var stringVisibleTrimSpacesRight = (string) => {
|
|
7412
|
+
const words = string.split(" ");
|
|
7413
|
+
let last = words.length;
|
|
7414
|
+
while (last > 0) {
|
|
7415
|
+
if (stringWidth(words[last - 1]) > 0) {
|
|
7416
|
+
break;
|
|
7417
|
+
}
|
|
7418
|
+
last--;
|
|
7419
|
+
}
|
|
7420
|
+
if (last === words.length) {
|
|
7421
|
+
return string;
|
|
7422
|
+
}
|
|
7423
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
7424
|
+
};
|
|
7425
|
+
var exec = (string, columns, options = {}) => {
|
|
7426
|
+
if (options.trim !== false && string.trim() === "") {
|
|
7427
|
+
return "";
|
|
7428
|
+
}
|
|
7429
|
+
let returnValue = "";
|
|
7430
|
+
let escapeCode;
|
|
7431
|
+
let escapeUrl;
|
|
7432
|
+
const lengths = wordLengths(string);
|
|
7433
|
+
let rows = [""];
|
|
7434
|
+
for (const [index, word] of string.split(" ").entries()) {
|
|
7435
|
+
if (options.trim !== false) {
|
|
7436
|
+
rows[rows.length - 1] = rows.at(-1).trimStart();
|
|
7437
|
+
}
|
|
7438
|
+
let rowLength = stringWidth(rows.at(-1));
|
|
7439
|
+
if (index !== 0) {
|
|
7440
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
7441
|
+
rows.push("");
|
|
7442
|
+
rowLength = 0;
|
|
7443
|
+
}
|
|
7444
|
+
if (rowLength > 0 || options.trim === false) {
|
|
7445
|
+
rows[rows.length - 1] += " ";
|
|
7446
|
+
rowLength++;
|
|
7447
|
+
}
|
|
7448
|
+
}
|
|
7449
|
+
if (options.hard && lengths[index] > columns) {
|
|
7450
|
+
const remainingColumns = columns - rowLength;
|
|
7451
|
+
const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
7452
|
+
const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
|
|
7453
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
7454
|
+
rows.push("");
|
|
7455
|
+
}
|
|
7456
|
+
wrapWord(rows, word, columns);
|
|
7457
|
+
continue;
|
|
7458
|
+
}
|
|
7459
|
+
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
|
7460
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
7461
|
+
wrapWord(rows, word, columns);
|
|
7462
|
+
continue;
|
|
7463
|
+
}
|
|
7464
|
+
rows.push("");
|
|
7465
|
+
}
|
|
7466
|
+
if (rowLength + lengths[index] > columns && options.wordWrap === false) {
|
|
7467
|
+
wrapWord(rows, word, columns);
|
|
7468
|
+
continue;
|
|
7469
|
+
}
|
|
7470
|
+
rows[rows.length - 1] += word;
|
|
7471
|
+
}
|
|
7472
|
+
if (options.trim !== false) {
|
|
7473
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
7474
|
+
}
|
|
7475
|
+
const preString = rows.join(`
|
|
7476
|
+
`);
|
|
7477
|
+
const pre = [...preString];
|
|
7478
|
+
let preStringIndex = 0;
|
|
7479
|
+
for (const [index, character] of pre.entries()) {
|
|
7480
|
+
returnValue += character;
|
|
7481
|
+
if (ESCAPES.has(character)) {
|
|
7482
|
+
const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} };
|
|
7483
|
+
if (groups.code !== undefined) {
|
|
7484
|
+
const code2 = Number.parseFloat(groups.code);
|
|
7485
|
+
escapeCode = code2 === END_CODE ? undefined : code2;
|
|
7486
|
+
} else if (groups.uri !== undefined) {
|
|
7487
|
+
escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
|
|
7488
|
+
}
|
|
7489
|
+
}
|
|
7490
|
+
const code = ansi_styles_default.codes.get(Number(escapeCode));
|
|
7491
|
+
if (pre[index + 1] === `
|
|
7492
|
+
`) {
|
|
7493
|
+
if (escapeUrl) {
|
|
7494
|
+
returnValue += wrapAnsiHyperlink("");
|
|
7495
|
+
}
|
|
7496
|
+
if (escapeCode && code) {
|
|
7497
|
+
returnValue += wrapAnsiCode(code);
|
|
7498
|
+
}
|
|
7499
|
+
} else if (character === `
|
|
7500
|
+
`) {
|
|
7501
|
+
if (escapeCode && code) {
|
|
7502
|
+
returnValue += wrapAnsiCode(escapeCode);
|
|
7503
|
+
}
|
|
7504
|
+
if (escapeUrl) {
|
|
7505
|
+
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
7506
|
+
}
|
|
7507
|
+
}
|
|
7508
|
+
preStringIndex += character.length;
|
|
7509
|
+
}
|
|
7510
|
+
return returnValue;
|
|
7511
|
+
};
|
|
7512
|
+
function wrapAnsi(string, columns, options) {
|
|
7513
|
+
return String(string).normalize().replaceAll(`\r
|
|
7514
|
+
`, `
|
|
7515
|
+
`).split(`
|
|
7516
|
+
`).map((line) => exec(line, columns, options)).join(`
|
|
7517
|
+
`);
|
|
7518
|
+
}
|
|
7519
|
+
|
|
7520
|
+
// ../../node_modules/.bun/boxen@8.0.1/node_modules/boxen/index.js
|
|
7521
|
+
var import_cli_boxes2 = __toESM(require_cli_boxes(), 1);
|
|
7522
|
+
var NEWLINE = `
|
|
7523
|
+
`;
|
|
7524
|
+
var PAD = " ";
|
|
7525
|
+
var NONE = "none";
|
|
7526
|
+
var terminalColumns = () => {
|
|
7527
|
+
const { env, stdout, stderr } = process2;
|
|
7528
|
+
if (stdout?.columns) {
|
|
7529
|
+
return stdout.columns;
|
|
7530
|
+
}
|
|
7531
|
+
if (stderr?.columns) {
|
|
7532
|
+
return stderr.columns;
|
|
7533
|
+
}
|
|
7534
|
+
if (env.COLUMNS) {
|
|
7535
|
+
return Number.parseInt(env.COLUMNS, 10);
|
|
7536
|
+
}
|
|
7537
|
+
return 80;
|
|
7538
|
+
};
|
|
7539
|
+
var getObject = (detail) => typeof detail === "number" ? {
|
|
7540
|
+
top: detail,
|
|
7541
|
+
right: detail * 3,
|
|
7542
|
+
bottom: detail,
|
|
7543
|
+
left: detail * 3
|
|
7544
|
+
} : {
|
|
7545
|
+
top: 0,
|
|
7546
|
+
right: 0,
|
|
7547
|
+
bottom: 0,
|
|
7548
|
+
left: 0,
|
|
7549
|
+
...detail
|
|
7550
|
+
};
|
|
7551
|
+
var getBorderWidth = (borderStyle) => borderStyle === NONE ? 0 : 2;
|
|
7552
|
+
var getBorderChars = (borderStyle) => {
|
|
7553
|
+
const sides = [
|
|
7554
|
+
"topLeft",
|
|
7555
|
+
"topRight",
|
|
7556
|
+
"bottomRight",
|
|
7557
|
+
"bottomLeft",
|
|
7558
|
+
"left",
|
|
7559
|
+
"right",
|
|
7560
|
+
"top",
|
|
7561
|
+
"bottom"
|
|
7562
|
+
];
|
|
7563
|
+
let characters;
|
|
7564
|
+
if (borderStyle === NONE) {
|
|
7565
|
+
borderStyle = {};
|
|
7566
|
+
for (const side of sides) {
|
|
7567
|
+
borderStyle[side] = "";
|
|
7568
|
+
}
|
|
7569
|
+
}
|
|
7570
|
+
if (typeof borderStyle === "string") {
|
|
7571
|
+
characters = import_cli_boxes.default[borderStyle];
|
|
7572
|
+
if (!characters) {
|
|
7573
|
+
throw new TypeError(`Invalid border style: ${borderStyle}`);
|
|
7574
|
+
}
|
|
7575
|
+
} else {
|
|
7576
|
+
if (typeof borderStyle?.vertical === "string") {
|
|
7577
|
+
borderStyle.left = borderStyle.vertical;
|
|
7578
|
+
borderStyle.right = borderStyle.vertical;
|
|
7579
|
+
}
|
|
7580
|
+
if (typeof borderStyle?.horizontal === "string") {
|
|
7581
|
+
borderStyle.top = borderStyle.horizontal;
|
|
7582
|
+
borderStyle.bottom = borderStyle.horizontal;
|
|
7583
|
+
}
|
|
7584
|
+
for (const side of sides) {
|
|
7585
|
+
if (borderStyle[side] === null || typeof borderStyle[side] !== "string") {
|
|
7586
|
+
throw new TypeError(`Invalid border style: ${side}`);
|
|
7587
|
+
}
|
|
7588
|
+
}
|
|
7589
|
+
characters = borderStyle;
|
|
7590
|
+
}
|
|
7591
|
+
return characters;
|
|
7592
|
+
};
|
|
7593
|
+
var makeTitle = (text, horizontal, alignment) => {
|
|
7594
|
+
let title = "";
|
|
7595
|
+
const textWidth = stringWidth(text);
|
|
7596
|
+
switch (alignment) {
|
|
7597
|
+
case "left": {
|
|
7598
|
+
title = text + horizontal.slice(textWidth);
|
|
7599
|
+
break;
|
|
7600
|
+
}
|
|
7601
|
+
case "right": {
|
|
7602
|
+
title = horizontal.slice(textWidth) + text;
|
|
7603
|
+
break;
|
|
7604
|
+
}
|
|
7605
|
+
default: {
|
|
7606
|
+
horizontal = horizontal.slice(textWidth);
|
|
7607
|
+
if (horizontal.length % 2 === 1) {
|
|
7608
|
+
horizontal = horizontal.slice(Math.floor(horizontal.length / 2));
|
|
7609
|
+
title = horizontal.slice(1) + text + horizontal;
|
|
7610
|
+
} else {
|
|
7611
|
+
horizontal = horizontal.slice(horizontal.length / 2);
|
|
7612
|
+
title = horizontal + text + horizontal;
|
|
7613
|
+
}
|
|
7614
|
+
break;
|
|
7615
|
+
}
|
|
7616
|
+
}
|
|
7617
|
+
return title;
|
|
7618
|
+
};
|
|
7619
|
+
var makeContentText = (text, { padding, width, textAlignment, height }) => {
|
|
7620
|
+
text = import_ansi_align.default(text, { align: textAlignment });
|
|
7621
|
+
let lines = text.split(NEWLINE);
|
|
7622
|
+
const textWidth = widestLine(text);
|
|
7623
|
+
const max = width - padding.left - padding.right;
|
|
7624
|
+
if (textWidth > max) {
|
|
7625
|
+
const newLines = [];
|
|
7626
|
+
for (const line of lines) {
|
|
7627
|
+
const createdLines = wrapAnsi(line, max, { hard: true });
|
|
7628
|
+
const alignedLines = import_ansi_align.default(createdLines, { align: textAlignment });
|
|
7629
|
+
const alignedLinesArray = alignedLines.split(`
|
|
7630
|
+
`);
|
|
7631
|
+
const longestLength = Math.max(...alignedLinesArray.map((s) => stringWidth(s)));
|
|
7632
|
+
for (const alignedLine of alignedLinesArray) {
|
|
7633
|
+
let paddedLine;
|
|
7634
|
+
switch (textAlignment) {
|
|
7635
|
+
case "center": {
|
|
7636
|
+
paddedLine = PAD.repeat((max - longestLength) / 2) + alignedLine;
|
|
7637
|
+
break;
|
|
7638
|
+
}
|
|
7639
|
+
case "right": {
|
|
7640
|
+
paddedLine = PAD.repeat(max - longestLength) + alignedLine;
|
|
7641
|
+
break;
|
|
7642
|
+
}
|
|
7643
|
+
default: {
|
|
7644
|
+
paddedLine = alignedLine;
|
|
7645
|
+
break;
|
|
7646
|
+
}
|
|
7647
|
+
}
|
|
7648
|
+
newLines.push(paddedLine);
|
|
7649
|
+
}
|
|
7650
|
+
}
|
|
7651
|
+
lines = newLines;
|
|
7652
|
+
}
|
|
7653
|
+
if (textAlignment === "center" && textWidth < max) {
|
|
7654
|
+
lines = lines.map((line) => PAD.repeat((max - textWidth) / 2) + line);
|
|
7655
|
+
} else if (textAlignment === "right" && textWidth < max) {
|
|
7656
|
+
lines = lines.map((line) => PAD.repeat(max - textWidth) + line);
|
|
7657
|
+
}
|
|
7658
|
+
const paddingLeft = PAD.repeat(padding.left);
|
|
7659
|
+
const paddingRight = PAD.repeat(padding.right);
|
|
7660
|
+
lines = lines.map((line) => {
|
|
7661
|
+
const newLine = paddingLeft + line + paddingRight;
|
|
7662
|
+
return newLine + PAD.repeat(width - stringWidth(newLine));
|
|
7663
|
+
});
|
|
7664
|
+
if (padding.top > 0) {
|
|
7665
|
+
lines = [...Array.from({ length: padding.top }).fill(PAD.repeat(width)), ...lines];
|
|
7666
|
+
}
|
|
7667
|
+
if (padding.bottom > 0) {
|
|
7668
|
+
lines = [...lines, ...Array.from({ length: padding.bottom }).fill(PAD.repeat(width))];
|
|
7669
|
+
}
|
|
7670
|
+
if (height && lines.length > height) {
|
|
7671
|
+
lines = lines.slice(0, height);
|
|
7672
|
+
} else if (height && lines.length < height) {
|
|
7673
|
+
lines = [...lines, ...Array.from({ length: height - lines.length }).fill(PAD.repeat(width))];
|
|
7674
|
+
}
|
|
7675
|
+
return lines.join(NEWLINE);
|
|
7676
|
+
};
|
|
7677
|
+
var boxContent = (content, contentWidth, options) => {
|
|
7678
|
+
const colorizeBorder = (border) => {
|
|
7679
|
+
const newBorder = options.borderColor ? getColorFunction(options.borderColor)(border) : border;
|
|
7680
|
+
return options.dimBorder ? chalk.dim(newBorder) : newBorder;
|
|
7681
|
+
};
|
|
7682
|
+
const colorizeContent = (content2) => options.backgroundColor ? getBGColorFunction(options.backgroundColor)(content2) : content2;
|
|
7683
|
+
const chars = getBorderChars(options.borderStyle);
|
|
7684
|
+
const columns = terminalColumns();
|
|
7685
|
+
let marginLeft = PAD.repeat(options.margin.left);
|
|
7686
|
+
if (options.float === "center") {
|
|
7687
|
+
const marginWidth = Math.max((columns - contentWidth - getBorderWidth(options.borderStyle)) / 2, 0);
|
|
7688
|
+
marginLeft = PAD.repeat(marginWidth);
|
|
7689
|
+
} else if (options.float === "right") {
|
|
7690
|
+
const marginWidth = Math.max(columns - contentWidth - options.margin.right - getBorderWidth(options.borderStyle), 0);
|
|
7691
|
+
marginLeft = PAD.repeat(marginWidth);
|
|
7692
|
+
}
|
|
7693
|
+
let result = "";
|
|
7694
|
+
if (options.margin.top) {
|
|
7695
|
+
result += NEWLINE.repeat(options.margin.top);
|
|
7696
|
+
}
|
|
7697
|
+
if (options.borderStyle !== NONE || options.title) {
|
|
7698
|
+
result += colorizeBorder(marginLeft + chars.topLeft + (options.title ? makeTitle(options.title, chars.top.repeat(contentWidth), options.titleAlignment) : chars.top.repeat(contentWidth)) + chars.topRight) + NEWLINE;
|
|
7699
|
+
}
|
|
7700
|
+
const lines = content.split(NEWLINE);
|
|
7701
|
+
result += lines.map((line) => marginLeft + colorizeBorder(chars.left) + colorizeContent(line) + colorizeBorder(chars.right)).join(NEWLINE);
|
|
7702
|
+
if (options.borderStyle !== NONE) {
|
|
7703
|
+
result += NEWLINE + colorizeBorder(marginLeft + chars.bottomLeft + chars.bottom.repeat(contentWidth) + chars.bottomRight);
|
|
7704
|
+
}
|
|
7705
|
+
if (options.margin.bottom) {
|
|
7706
|
+
result += NEWLINE.repeat(options.margin.bottom);
|
|
7707
|
+
}
|
|
7708
|
+
return result;
|
|
7709
|
+
};
|
|
7710
|
+
var sanitizeOptions = (options) => {
|
|
7711
|
+
if (options.fullscreen && process2?.stdout) {
|
|
7712
|
+
let newDimensions = [process2.stdout.columns, process2.stdout.rows];
|
|
7713
|
+
if (typeof options.fullscreen === "function") {
|
|
7714
|
+
newDimensions = options.fullscreen(...newDimensions);
|
|
7715
|
+
}
|
|
7716
|
+
options.width ||= newDimensions[0];
|
|
7717
|
+
options.height ||= newDimensions[1];
|
|
7718
|
+
}
|
|
7719
|
+
options.width &&= Math.max(1, options.width - getBorderWidth(options.borderStyle));
|
|
7720
|
+
options.height &&= Math.max(1, options.height - getBorderWidth(options.borderStyle));
|
|
7721
|
+
return options;
|
|
7722
|
+
};
|
|
7723
|
+
var formatTitle = (title, borderStyle) => borderStyle === NONE ? title : ` ${title} `;
|
|
7724
|
+
var determineDimensions = (text, options) => {
|
|
7725
|
+
options = sanitizeOptions(options);
|
|
7726
|
+
const widthOverride = options.width !== undefined;
|
|
7727
|
+
const columns = terminalColumns();
|
|
7728
|
+
const borderWidth = getBorderWidth(options.borderStyle);
|
|
7729
|
+
const maxWidth = columns - options.margin.left - options.margin.right - borderWidth;
|
|
7730
|
+
const widest = widestLine(wrapAnsi(text, columns - borderWidth, { hard: true, trim: false })) + options.padding.left + options.padding.right;
|
|
7731
|
+
if (options.title && widthOverride) {
|
|
7732
|
+
options.title = options.title.slice(0, Math.max(0, options.width - 2));
|
|
7733
|
+
options.title &&= formatTitle(options.title, options.borderStyle);
|
|
7734
|
+
} else if (options.title) {
|
|
7735
|
+
options.title = options.title.slice(0, Math.max(0, maxWidth - 2));
|
|
7736
|
+
if (options.title) {
|
|
7737
|
+
options.title = formatTitle(options.title, options.borderStyle);
|
|
7738
|
+
if (stringWidth(options.title) > widest) {
|
|
7739
|
+
options.width = stringWidth(options.title);
|
|
7740
|
+
}
|
|
7741
|
+
}
|
|
7742
|
+
}
|
|
7743
|
+
options.width ||= widest;
|
|
7744
|
+
if (!widthOverride) {
|
|
7745
|
+
if (options.margin.left && options.margin.right && options.width > maxWidth) {
|
|
7746
|
+
const spaceForMargins = columns - options.width - borderWidth;
|
|
7747
|
+
const multiplier = spaceForMargins / (options.margin.left + options.margin.right);
|
|
7748
|
+
options.margin.left = Math.max(0, Math.floor(options.margin.left * multiplier));
|
|
7749
|
+
options.margin.right = Math.max(0, Math.floor(options.margin.right * multiplier));
|
|
7750
|
+
}
|
|
7751
|
+
options.width = Math.min(options.width, columns - borderWidth - options.margin.left - options.margin.right);
|
|
7752
|
+
}
|
|
7753
|
+
if (options.width - (options.padding.left + options.padding.right) <= 0) {
|
|
7754
|
+
options.padding.left = 0;
|
|
7755
|
+
options.padding.right = 0;
|
|
7756
|
+
}
|
|
7757
|
+
if (options.height && options.height - (options.padding.top + options.padding.bottom) <= 0) {
|
|
7758
|
+
options.padding.top = 0;
|
|
7759
|
+
options.padding.bottom = 0;
|
|
7760
|
+
}
|
|
7761
|
+
return options;
|
|
7762
|
+
};
|
|
7763
|
+
var isHex = (color) => color.match(/^#(?:[0-f]{3}){1,2}$/i);
|
|
7764
|
+
var isColorValid = (color) => typeof color === "string" && (chalk[color] ?? isHex(color));
|
|
7765
|
+
var getColorFunction = (color) => isHex(color) ? chalk.hex(color) : chalk[color];
|
|
7766
|
+
var getBGColorFunction = (color) => isHex(color) ? chalk.bgHex(color) : chalk[camelCase(["bg", color])];
|
|
7767
|
+
function boxen(text, options) {
|
|
7768
|
+
options = {
|
|
7769
|
+
padding: 0,
|
|
7770
|
+
borderStyle: "single",
|
|
7771
|
+
dimBorder: false,
|
|
7772
|
+
textAlignment: "left",
|
|
7773
|
+
float: "left",
|
|
7774
|
+
titleAlignment: "left",
|
|
7775
|
+
...options
|
|
7776
|
+
};
|
|
7777
|
+
if (options.align) {
|
|
7778
|
+
options.textAlignment = options.align;
|
|
7779
|
+
}
|
|
7780
|
+
if (options.borderColor && !isColorValid(options.borderColor)) {
|
|
7781
|
+
throw new Error(`${options.borderColor} is not a valid borderColor`);
|
|
7782
|
+
}
|
|
7783
|
+
if (options.backgroundColor && !isColorValid(options.backgroundColor)) {
|
|
7784
|
+
throw new Error(`${options.backgroundColor} is not a valid backgroundColor`);
|
|
7785
|
+
}
|
|
7786
|
+
options.padding = getObject(options.padding);
|
|
7787
|
+
options.margin = getObject(options.margin);
|
|
7788
|
+
options = determineDimensions(text, options);
|
|
7789
|
+
text = makeContentText(text, options);
|
|
7790
|
+
return boxContent(text, options.width, options);
|
|
7791
|
+
}
|
|
7792
|
+
|
|
7793
|
+
// ../../node_modules/.bun/gradient-string@3.0.0/node_modules/gradient-string/dist/index.js
|
|
7794
|
+
var import_tinygradient = __toESM(require_tinygradient(), 1);
|
|
7795
|
+
import chalk2 from "chalk";
|
|
7796
|
+
var gradient = (...colors) => {
|
|
7797
|
+
let gradient2;
|
|
7798
|
+
let options;
|
|
7799
|
+
if (colors.length === 0) {
|
|
7800
|
+
throw new Error("Missing gradient colors");
|
|
7801
|
+
}
|
|
7802
|
+
if (!Array.isArray(colors[0])) {
|
|
7803
|
+
if (colors.length === 1) {
|
|
7804
|
+
throw new Error(`Expected an array of colors, received ${JSON.stringify(colors[0])}`);
|
|
7805
|
+
}
|
|
7806
|
+
gradient2 = import_tinygradient.default(...colors);
|
|
7807
|
+
} else {
|
|
7808
|
+
gradient2 = import_tinygradient.default(colors[0]);
|
|
7809
|
+
options = validateOptions(colors[1]);
|
|
7810
|
+
}
|
|
7811
|
+
const fn = (str, deprecatedOptions) => {
|
|
7812
|
+
return applyGradient(str ? str.toString() : "", gradient2, deprecatedOptions ?? options);
|
|
7813
|
+
};
|
|
7814
|
+
fn.multiline = (str, deprecatedOptions) => multiline(str ? str.toString() : "", gradient2, deprecatedOptions ?? options);
|
|
7815
|
+
return fn;
|
|
7816
|
+
};
|
|
7817
|
+
var getColors = (gradient2, options, count) => {
|
|
7818
|
+
return options.interpolation?.toLowerCase() === "hsv" ? gradient2.hsv(count, options.hsvSpin?.toLowerCase() || false) : gradient2.rgb(count);
|
|
7819
|
+
};
|
|
7820
|
+
function applyGradient(str, gradient2, opts) {
|
|
7821
|
+
const options = validateOptions(opts);
|
|
7822
|
+
const colorsCount = Math.max(str.replace(/\s/g, "").length, gradient2.stops.length);
|
|
7823
|
+
const colors = getColors(gradient2, options, colorsCount);
|
|
7824
|
+
let result = "";
|
|
7825
|
+
for (const s of str) {
|
|
7826
|
+
result += s.match(/\s/g) ? s : chalk2.hex(colors.shift()?.toHex() || "#000")(s);
|
|
7827
|
+
}
|
|
7828
|
+
return result;
|
|
7829
|
+
}
|
|
7830
|
+
function multiline(str, gradient2, opts) {
|
|
7831
|
+
const options = validateOptions(opts);
|
|
7832
|
+
const lines = str.split(`
|
|
7833
|
+
`);
|
|
7834
|
+
const maxLength = Math.max(...lines.map((l) => l.length), gradient2.stops.length);
|
|
7835
|
+
const colors = getColors(gradient2, options, maxLength);
|
|
7836
|
+
const results = [];
|
|
7837
|
+
for (const line of lines) {
|
|
7838
|
+
const lineColors = colors.slice(0);
|
|
7839
|
+
let lineResult = "";
|
|
7840
|
+
for (const l of line) {
|
|
7841
|
+
lineResult += chalk2.hex(lineColors.shift()?.toHex() || "#000")(l);
|
|
7842
|
+
}
|
|
7843
|
+
results.push(lineResult);
|
|
7844
|
+
}
|
|
7845
|
+
return results.join(`
|
|
7846
|
+
`);
|
|
7847
|
+
}
|
|
7848
|
+
function validateOptions(opts) {
|
|
7849
|
+
const options = { interpolation: "rgb", hsvSpin: "short", ...opts };
|
|
7850
|
+
if (opts !== undefined && typeof opts !== "object") {
|
|
7851
|
+
throw new TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof opts}\``);
|
|
7852
|
+
}
|
|
7853
|
+
if (typeof options.interpolation !== "string") {
|
|
7854
|
+
throw new TypeError(`Expected \`options.interpolation\` to be \`rgb\` or \`hsv\`, got \`${typeof options.interpolation}\``);
|
|
7855
|
+
}
|
|
7856
|
+
if (options.interpolation.toLowerCase() === "hsv" && typeof options.hsvSpin !== "string") {
|
|
7857
|
+
throw new TypeError(`Expected \`options.hsvSpin\` to be a \`short\` or \`long\`, got \`${typeof options.hsvSpin}\``);
|
|
7858
|
+
}
|
|
7859
|
+
return options;
|
|
7860
|
+
}
|
|
7861
|
+
var aliases = {
|
|
7862
|
+
atlas: { colors: ["#feac5e", "#c779d0", "#4bc0c8"], options: {} },
|
|
7863
|
+
cristal: { colors: ["#bdfff3", "#4ac29a"], options: {} },
|
|
7864
|
+
teen: { colors: ["#77a1d3", "#79cbca", "#e684ae"], options: {} },
|
|
7865
|
+
mind: { colors: ["#473b7b", "#3584a7", "#30d2be"], options: {} },
|
|
7866
|
+
morning: { colors: ["#ff5f6d", "#ffc371"], options: { interpolation: "hsv" } },
|
|
7867
|
+
vice: { colors: ["#5ee7df", "#b490ca"], options: { interpolation: "hsv" } },
|
|
7868
|
+
passion: { colors: ["#f43b47", "#453a94"], options: {} },
|
|
7869
|
+
fruit: { colors: ["#ff4e50", "#f9d423"], options: {} },
|
|
7870
|
+
instagram: { colors: ["#833ab4", "#fd1d1d", "#fcb045"], options: {} },
|
|
7871
|
+
retro: {
|
|
7872
|
+
colors: ["#3f51b1", "#5a55ae", "#7b5fac", "#8f6aae", "#a86aa4", "#cc6b8e", "#f18271", "#f3a469", "#f7c978"],
|
|
7873
|
+
options: {}
|
|
7874
|
+
},
|
|
7875
|
+
summer: { colors: ["#fdbb2d", "#22c1c3"], options: {} },
|
|
7876
|
+
rainbow: { colors: ["#ff0000", "#ff0100"], options: { interpolation: "hsv", hsvSpin: "long" } },
|
|
7877
|
+
pastel: { colors: ["#74ebd5", "#74ecd5"], options: { interpolation: "hsv", hsvSpin: "long" } }
|
|
7878
|
+
};
|
|
7879
|
+
function gradientAlias(alias) {
|
|
7880
|
+
const result = (str) => gradient(...alias.colors)(str, alias.options);
|
|
7881
|
+
result.multiline = (str = "") => gradient(...alias.colors).multiline(str, alias.options);
|
|
7882
|
+
return result;
|
|
7883
|
+
}
|
|
7884
|
+
var dist_default = gradient;
|
|
7885
|
+
var atlas = gradientAlias(aliases.atlas);
|
|
7886
|
+
var cristal = gradientAlias(aliases.cristal);
|
|
7887
|
+
var teen = gradientAlias(aliases.teen);
|
|
7888
|
+
var mind = gradientAlias(aliases.mind);
|
|
7889
|
+
var morning = gradientAlias(aliases.morning);
|
|
7890
|
+
var vice = gradientAlias(aliases.vice);
|
|
7891
|
+
var passion = gradientAlias(aliases.passion);
|
|
7892
|
+
var fruit = gradientAlias(aliases.fruit);
|
|
7893
|
+
var instagram = gradientAlias(aliases.instagram);
|
|
7894
|
+
var retro = gradientAlias(aliases.retro);
|
|
7895
|
+
var summer = gradientAlias(aliases.summer);
|
|
7896
|
+
var rainbow = gradientAlias(aliases.rainbow);
|
|
7897
|
+
var pastel = gradientAlias(aliases.pastel);
|
|
7898
|
+
gradient.atlas = atlas;
|
|
7899
|
+
gradient.cristal = cristal;
|
|
7900
|
+
gradient.teen = teen;
|
|
7901
|
+
gradient.mind = mind;
|
|
7902
|
+
gradient.morning = morning;
|
|
7903
|
+
gradient.vice = vice;
|
|
7904
|
+
gradient.passion = passion;
|
|
7905
|
+
gradient.fruit = fruit;
|
|
7906
|
+
gradient.instagram = instagram;
|
|
7907
|
+
gradient.retro = retro;
|
|
7908
|
+
gradient.summer = summer;
|
|
7909
|
+
gradient.rainbow = rainbow;
|
|
7910
|
+
gradient.pastel = pastel;
|
|
7911
|
+
|
|
7912
|
+
// src/ui.ts
|
|
7913
|
+
var prefix = chalk3.gray("[housekit]");
|
|
5520
7914
|
function format(message) {
|
|
5521
7915
|
return `${prefix} ${message}`;
|
|
5522
7916
|
}
|
|
5523
7917
|
function info(message) {
|
|
5524
|
-
console.log(format(
|
|
7918
|
+
console.log(format(chalk3.cyan(message)));
|
|
5525
7919
|
}
|
|
5526
7920
|
function warn(message) {
|
|
5527
|
-
console.warn(format(
|
|
7921
|
+
console.warn(format(chalk3.yellow(message)));
|
|
5528
7922
|
}
|
|
5529
7923
|
function success(message) {
|
|
5530
|
-
console.log(format(
|
|
7924
|
+
console.log(format(chalk3.green(message)));
|
|
5531
7925
|
}
|
|
5532
7926
|
function error(message) {
|
|
5533
|
-
console.error(format(
|
|
7927
|
+
console.error(format(chalk3.red(message)));
|
|
7928
|
+
}
|
|
7929
|
+
function box(message, options = {}) {
|
|
7930
|
+
console.log(boxen(message, {
|
|
7931
|
+
padding: 1,
|
|
7932
|
+
margin: 1,
|
|
7933
|
+
borderStyle: "round",
|
|
7934
|
+
borderColor: "cyan",
|
|
7935
|
+
...options
|
|
7936
|
+
}));
|
|
7937
|
+
}
|
|
7938
|
+
function title(message) {
|
|
7939
|
+
console.log(`
|
|
7940
|
+
` + chalk3.bold(dist_default(["cyan", "blue"])(message)));
|
|
5534
7941
|
}
|
|
5535
7942
|
function createSpinner(message) {
|
|
5536
7943
|
return ora({
|
|
@@ -5579,7 +7986,7 @@ async function listPrompt(message, choices, defaultValue) {
|
|
|
5579
7986
|
}
|
|
5580
7987
|
return finalValue;
|
|
5581
7988
|
}
|
|
5582
|
-
async function inputPrompt(message, defaultValue,
|
|
7989
|
+
async function inputPrompt(message, defaultValue, validate2) {
|
|
5583
7990
|
if (globalYes && defaultValue !== undefined) {
|
|
5584
7991
|
return defaultValue;
|
|
5585
7992
|
}
|
|
@@ -5588,8 +7995,8 @@ async function inputPrompt(message, defaultValue, validate) {
|
|
|
5588
7995
|
name: "value",
|
|
5589
7996
|
message: format(message),
|
|
5590
7997
|
default: defaultValue,
|
|
5591
|
-
validate:
|
|
5592
|
-
const result =
|
|
7998
|
+
validate: validate2 ? (input) => {
|
|
7999
|
+
const result = validate2(input);
|
|
5593
8000
|
return result === true ? true : result;
|
|
5594
8001
|
} : undefined
|
|
5595
8002
|
}]);
|
|
@@ -5657,7 +8064,7 @@ function validateConfig(config, options = {}) {
|
|
|
5657
8064
|
validateRequiredFields(config, errors);
|
|
5658
8065
|
if (!options.skipPathValidation) {
|
|
5659
8066
|
validateSchemaPath(config, rootDir, errors, warnings);
|
|
5660
|
-
validateOutPath(config, rootDir, errors);
|
|
8067
|
+
validateOutPath(config, rootDir, errors, warnings);
|
|
5661
8068
|
}
|
|
5662
8069
|
validateDatabases(config, errors, warnings);
|
|
5663
8070
|
validateSchemaMapping(config, errors, warnings);
|
|
@@ -5703,13 +8110,13 @@ function validateSchemaPath(config, rootDir, errors, warnings) {
|
|
|
5703
8110
|
});
|
|
5704
8111
|
}
|
|
5705
8112
|
}
|
|
5706
|
-
function validateOutPath(config, rootDir, errors) {
|
|
8113
|
+
function validateOutPath(config, rootDir, errors, warnings) {
|
|
5707
8114
|
const fullPath = resolve(rootDir, config.out);
|
|
5708
8115
|
if (!existsSync(fullPath)) {
|
|
5709
|
-
|
|
8116
|
+
warnings.push({
|
|
5710
8117
|
field: "out",
|
|
5711
8118
|
message: `Output directory does not exist: ${config.out}`,
|
|
5712
|
-
severity: "
|
|
8119
|
+
severity: "warning"
|
|
5713
8120
|
});
|
|
5714
8121
|
}
|
|
5715
8122
|
}
|
|
@@ -5781,9 +8188,13 @@ async function loadSchema(schemaPath, options) {
|
|
|
5781
8188
|
const extensions = [".ts", ".js", ".mjs", ".cjs"];
|
|
5782
8189
|
const patterns = extensions.map((ext2) => `${schemaPath}/**/*${ext2}`);
|
|
5783
8190
|
let allFiles = [];
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
8191
|
+
if (existsSync2(schemaPath) && statSync(schemaPath).isFile()) {
|
|
8192
|
+
allFiles = [schemaPath];
|
|
8193
|
+
} else {
|
|
8194
|
+
for (const pattern of patterns) {
|
|
8195
|
+
const files = globSync(pattern);
|
|
8196
|
+
allFiles = allFiles.concat(files);
|
|
8197
|
+
}
|
|
5787
8198
|
}
|
|
5788
8199
|
const foundTables = [];
|
|
5789
8200
|
for (const file of allFiles) {
|
|
@@ -5865,6 +8276,11 @@ async function loadConfig() {
|
|
|
5865
8276
|
}
|
|
5866
8277
|
throw new Error("Configuration validation failed");
|
|
5867
8278
|
}
|
|
8279
|
+
const outDir = resolve2(process.cwd(), config.out);
|
|
8280
|
+
if (!existsSync2(outDir)) {
|
|
8281
|
+
mkdirSync(outDir, { recursive: true });
|
|
8282
|
+
info(`Created output directory: ${config.out}`);
|
|
8283
|
+
}
|
|
5868
8284
|
return config;
|
|
5869
8285
|
}
|
|
5870
8286
|
|
|
@@ -5889,8 +8305,8 @@ async function generateCommand() {
|
|
|
5889
8305
|
const databases = getDatabaseConfigs(config);
|
|
5890
8306
|
const schemaMapping = getSchemaMapping(config);
|
|
5891
8307
|
const outDir = config.out || "./housekit";
|
|
5892
|
-
if (!
|
|
5893
|
-
|
|
8308
|
+
if (!existsSync3(outDir))
|
|
8309
|
+
mkdirSync2(outDir, { recursive: true });
|
|
5894
8310
|
let hasChanges = false;
|
|
5895
8311
|
for (const [dbName, dbConfig] of Object.entries(databases)) {
|
|
5896
8312
|
const schemaPath = schemaMapping[dbName];
|
|
@@ -5904,11 +8320,11 @@ async function generateCommand() {
|
|
|
5904
8320
|
continue;
|
|
5905
8321
|
}
|
|
5906
8322
|
const dbOutDir = join(outDir, dbName);
|
|
5907
|
-
if (!
|
|
5908
|
-
|
|
8323
|
+
if (!existsSync3(dbOutDir))
|
|
8324
|
+
mkdirSync2(dbOutDir, { recursive: true });
|
|
5909
8325
|
const snapshotPath = join(dbOutDir, "snapshot.json");
|
|
5910
8326
|
let previousTables = {};
|
|
5911
|
-
if (
|
|
8327
|
+
if (existsSync3(snapshotPath)) {
|
|
5912
8328
|
previousTables = JSON.parse(readFileSync(snapshotPath, "utf-8"));
|
|
5913
8329
|
}
|
|
5914
8330
|
const sqlStatements = [];
|
|
@@ -5964,7 +8380,7 @@ async function generateCommand() {
|
|
|
5964
8380
|
}
|
|
5965
8381
|
|
|
5966
8382
|
// src/commands/push.ts
|
|
5967
|
-
import { existsSync as
|
|
8383
|
+
import { existsSync as existsSync4, writeFileSync as writeFileSync2, mkdirSync as mkdirSync3 } from "fs";
|
|
5968
8384
|
import { join as join2 } from "path";
|
|
5969
8385
|
|
|
5970
8386
|
// src/db.ts
|
|
@@ -6186,6 +8602,19 @@ function extractHousekitMetadata(comment) {
|
|
|
6186
8602
|
}
|
|
6187
8603
|
return null;
|
|
6188
8604
|
}
|
|
8605
|
+
function mapColumnRefs(val, localCols) {
|
|
8606
|
+
if (!val)
|
|
8607
|
+
return val;
|
|
8608
|
+
if (Array.isArray(val)) {
|
|
8609
|
+
return val.map((v) => localCols[v]?.name || v);
|
|
8610
|
+
}
|
|
8611
|
+
if (typeof val === "string") {
|
|
8612
|
+
const parts = val.split(",").map((p) => p.trim());
|
|
8613
|
+
const mapped = parts.map((p) => localCols[p]?.name || p);
|
|
8614
|
+
return mapped.length === 1 ? mapped[0] : mapped;
|
|
8615
|
+
}
|
|
8616
|
+
return val;
|
|
8617
|
+
}
|
|
6189
8618
|
function diffTable(table, localCols, remote, opts) {
|
|
6190
8619
|
const plan = [];
|
|
6191
8620
|
const destructiveReasons = [];
|
|
@@ -6304,21 +8733,24 @@ function diffTable(table, localCols, remote, opts) {
|
|
|
6304
8733
|
destructiveReasons.push(`engine change (local="${localEngineSQL}", remote="${remoteOpts.engine}") (requires shadow swap)`);
|
|
6305
8734
|
warnings.push("Engine mismatch requires full table recreation");
|
|
6306
8735
|
}
|
|
6307
|
-
|
|
8736
|
+
const mappedOrderBy = mapColumnRefs(localOpts.orderBy, localCols);
|
|
8737
|
+
compare("orderBy", mappedOrderBy, remoteOpts.orderBy, () => {
|
|
6308
8738
|
destructiveReasons.push("order by change");
|
|
6309
|
-
plan.push(`ALTER TABLE \`${tableName}\` MODIFY ORDER BY (${normalizeClause(
|
|
8739
|
+
plan.push(`ALTER TABLE \`${tableName}\` MODIFY ORDER BY (${normalizeClause(mappedOrderBy)})`);
|
|
6310
8740
|
});
|
|
6311
|
-
|
|
8741
|
+
const mappedPartitionBy = mapColumnRefs(localOpts.partitionBy, localCols);
|
|
8742
|
+
compare("partitionBy", mappedPartitionBy, remoteOpts.partitionBy, () => {
|
|
6312
8743
|
destructiveReasons.push("partition change");
|
|
6313
|
-
plan.push(`ALTER TABLE \`${tableName}\` MODIFY PARTITION BY (${normalizeClause(
|
|
8744
|
+
plan.push(`ALTER TABLE \`${tableName}\` MODIFY PARTITION BY (${normalizeClause(mappedPartitionBy)})`);
|
|
6314
8745
|
});
|
|
6315
8746
|
compare("ttl", localOpts.ttl, remoteOpts.ttl, () => {
|
|
6316
8747
|
destructiveReasons.push("ttl change");
|
|
6317
8748
|
plan.push(`ALTER TABLE \`${tableName}\` MODIFY TTL ${normalizeClause(localOpts.ttl)}`);
|
|
6318
8749
|
});
|
|
6319
|
-
|
|
8750
|
+
const mappedPrimaryKey = mapColumnRefs(localOpts.primaryKey, localCols);
|
|
8751
|
+
compare("primaryKey", mappedPrimaryKey, remoteOpts.primaryKey, () => {
|
|
6320
8752
|
destructiveReasons.push("primary key change");
|
|
6321
|
-
plan.push(`ALTER TABLE \`${tableName}\` MODIFY PRIMARY KEY (${normalizeClause(
|
|
8753
|
+
plan.push(`ALTER TABLE \`${tableName}\` MODIFY PRIMARY KEY (${normalizeClause(mappedPrimaryKey)})`);
|
|
6322
8754
|
});
|
|
6323
8755
|
const localIndexDefs = localOpts.indices ?? [];
|
|
6324
8756
|
const remoteIndexDefs = remoteOpts.indices ?? [];
|
|
@@ -6867,6 +9299,7 @@ async function countRows(client, tableName) {
|
|
|
6867
9299
|
}
|
|
6868
9300
|
|
|
6869
9301
|
// src/commands/push.ts
|
|
9302
|
+
import chalk4 from "chalk";
|
|
6870
9303
|
async function pushCommand(options) {
|
|
6871
9304
|
const shouldDumpExplain = Boolean(options.logExplain);
|
|
6872
9305
|
const config = await loadConfig();
|
|
@@ -6881,6 +9314,10 @@ async function pushCommand(options) {
|
|
|
6881
9314
|
await dumpExplain(client, statements, tableName, shadow);
|
|
6882
9315
|
};
|
|
6883
9316
|
try {
|
|
9317
|
+
title("HouseKit Push — Data Synchronizer");
|
|
9318
|
+
info(`Schema: ${chalk4.white.bold(schemaPath)}`);
|
|
9319
|
+
info(`Target: ${chalk4.white.bold(dbName)}
|
|
9320
|
+
`);
|
|
6884
9321
|
const tables = await loadSchema(schemaPath, { quiet: true });
|
|
6885
9322
|
const analyses = await detectSchemaDrift(client, tables, {
|
|
6886
9323
|
autoUpgradeMetadata: options.autoUpgradeMetadata,
|
|
@@ -6914,30 +9351,45 @@ async function pushCommand(options) {
|
|
|
6914
9351
|
anyWarnings = true;
|
|
6915
9352
|
continue;
|
|
6916
9353
|
}
|
|
9354
|
+
const changeDescriptions = [];
|
|
6917
9355
|
if (adds.length || modifies.length || drops.length || optionChanges.length) {
|
|
6918
9356
|
if (adds.length) {
|
|
6919
|
-
|
|
6920
|
-
adds.forEach((col) =>
|
|
9357
|
+
changeDescriptions.push(chalk4.green(` + ${adds.length} addition(s)`));
|
|
9358
|
+
adds.forEach((col) => changeDescriptions.push(` ${chalk4.gray("•")} ${quoteName(col)}`));
|
|
6921
9359
|
}
|
|
6922
9360
|
if (modifies.length) {
|
|
6923
|
-
|
|
6924
|
-
modifies.forEach((col) =>
|
|
9361
|
+
changeDescriptions.push(chalk4.blue(` ~ ${modifies.length} modification(s)`));
|
|
9362
|
+
modifies.forEach((col) => changeDescriptions.push(` ${chalk4.gray("•")} ${quoteName(col)}`));
|
|
6925
9363
|
}
|
|
6926
9364
|
if (drops.length) {
|
|
6927
|
-
|
|
6928
|
-
drops.forEach((col) =>
|
|
9365
|
+
changeDescriptions.push(chalk4.red(` - ${drops.length} drop(s)`));
|
|
9366
|
+
drops.forEach((col) => changeDescriptions.push(` ${chalk4.gray("•")} ${quoteName(col)}`));
|
|
6929
9367
|
}
|
|
6930
9368
|
if (optionChanges.length) {
|
|
6931
|
-
|
|
9369
|
+
changeDescriptions.push(chalk4.magenta(` * ${optionChanges.length} option change(s): ${optionChanges.join(", ")}`));
|
|
6932
9370
|
}
|
|
6933
9371
|
}
|
|
6934
|
-
warnings.
|
|
9372
|
+
if (warnings.length > 0) {
|
|
9373
|
+
warnings.forEach((w) => changeDescriptions.push(chalk4.yellow(` ! ${w}`)));
|
|
9374
|
+
anyWarnings = true;
|
|
9375
|
+
}
|
|
6935
9376
|
if (destructiveReasons.length > 0) {
|
|
6936
|
-
|
|
6937
|
-
|
|
9377
|
+
const header = destructiveReasons[0].includes("type change") ? "Type Changes Required" : "Schema Changes Detected";
|
|
9378
|
+
changeDescriptions.push(chalk4.yellow.bold(`
|
|
9379
|
+
⚠ ${header}:`));
|
|
9380
|
+
destructiveReasons.forEach((reason) => changeDescriptions.push(` ${chalk4.yellow("-")} ${reason}`));
|
|
9381
|
+
}
|
|
9382
|
+
if (changeDescriptions.length > 0) {
|
|
9383
|
+
box([
|
|
9384
|
+
chalk4.bold.white(`Table: ${quoteName(name)}`),
|
|
9385
|
+
"",
|
|
9386
|
+
...changeDescriptions
|
|
9387
|
+
].join(`
|
|
9388
|
+
`), {
|
|
9389
|
+
borderColor: destructiveReasons.length > 0 ? "yellow" : "cyan",
|
|
9390
|
+
padding: 0
|
|
9391
|
+
});
|
|
6938
9392
|
}
|
|
6939
|
-
if (warnings.length > 0)
|
|
6940
|
-
anyWarnings = true;
|
|
6941
9393
|
await dumpIfEnabled(plan, name);
|
|
6942
9394
|
if (shadowPlan) {
|
|
6943
9395
|
const proceedShadow = await confirmPrompt(`Apply shadow swap (Blue-Green) to ${quoteName(name)}?`, true);
|
|
@@ -6983,8 +9435,8 @@ async function dumpExplain(client, statements, tableName, shadow = false) {
|
|
|
6983
9435
|
return;
|
|
6984
9436
|
try {
|
|
6985
9437
|
const outDir = join2(process.cwd(), ".housekit");
|
|
6986
|
-
if (!
|
|
6987
|
-
|
|
9438
|
+
if (!existsSync4(outDir))
|
|
9439
|
+
mkdirSync3(outDir, { recursive: true });
|
|
6988
9440
|
const explains = [];
|
|
6989
9441
|
for (const stmt of statements) {
|
|
6990
9442
|
if (stmt.trim().toUpperCase().startsWith("SELECT")) {
|
|
@@ -7164,7 +9616,7 @@ async function migrateCommand(options) {
|
|
|
7164
9616
|
}
|
|
7165
9617
|
|
|
7166
9618
|
// src/commands/pull.ts
|
|
7167
|
-
import { existsSync as
|
|
9619
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync4, writeFileSync as writeFileSync3, readFileSync as readFileSync3 } from "fs";
|
|
7168
9620
|
import { join as join4 } from "path";
|
|
7169
9621
|
function sanitizeName(name) {
|
|
7170
9622
|
const cleaned = name.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
@@ -7454,8 +9906,8 @@ async function pullCommand(options) {
|
|
|
7454
9906
|
return true;
|
|
7455
9907
|
});
|
|
7456
9908
|
const migrationDir = join4(process.cwd(), outDir, migrationFolderName);
|
|
7457
|
-
if (!
|
|
7458
|
-
|
|
9909
|
+
if (!existsSync5(migrationDir))
|
|
9910
|
+
mkdirSync4(migrationDir, { recursive: true });
|
|
7459
9911
|
const downloadMode2 = await listPrompt("How would you like to download the tables?", [
|
|
7460
9912
|
{ name: "Download all tables", value: "all" },
|
|
7461
9913
|
{ name: "Confirm each table individually", value: "one-by-one" }
|
|
@@ -7538,8 +9990,8 @@ async function pullCommand(options) {
|
|
|
7538
9990
|
if (useSubdirectory && subdirectoryName) {
|
|
7539
9991
|
targetDir = join4(targetDir, subdirectoryName);
|
|
7540
9992
|
}
|
|
7541
|
-
if (!
|
|
7542
|
-
|
|
9993
|
+
if (!existsSync5(targetDir))
|
|
9994
|
+
mkdirSync4(targetDir, { recursive: true });
|
|
7543
9995
|
let downloadedCount = 0;
|
|
7544
9996
|
const fileExtension = fileFormat;
|
|
7545
9997
|
for (const tableName of tables) {
|
|
@@ -8012,7 +10464,7 @@ async function schemaCommand(options) {
|
|
|
8012
10464
|
}
|
|
8013
10465
|
|
|
8014
10466
|
// src/commands/check.ts
|
|
8015
|
-
import { existsSync as
|
|
10467
|
+
import { existsSync as existsSync6, readFileSync as readFileSync4, readdirSync as readdirSync3 } from "fs";
|
|
8016
10468
|
import { join as join5 } from "path";
|
|
8017
10469
|
function validateMigrationFile(file, content, previousTimestamp) {
|
|
8018
10470
|
const issues = [];
|
|
@@ -8095,7 +10547,7 @@ async function checkCommand() {
|
|
|
8095
10547
|
let totalWarnings = 0;
|
|
8096
10548
|
for (const dbName of Object.keys(databases)) {
|
|
8097
10549
|
const dbOutDir = join5(outDir, dbName);
|
|
8098
|
-
if (!
|
|
10550
|
+
if (!existsSync6(dbOutDir)) {
|
|
8099
10551
|
warn(`Migration directory not found for ${quoteName(dbName)}: ${dbOutDir}`);
|
|
8100
10552
|
continue;
|
|
8101
10553
|
}
|
|
@@ -8136,7 +10588,7 @@ async function checkCommand() {
|
|
|
8136
10588
|
}
|
|
8137
10589
|
}
|
|
8138
10590
|
const snapshotPath = join5(dbOutDir, "snapshot.json");
|
|
8139
|
-
if (
|
|
10591
|
+
if (existsSync6(snapshotPath)) {
|
|
8140
10592
|
try {
|
|
8141
10593
|
const snapshot = JSON.parse(readFileSync4(snapshotPath, "utf-8"));
|
|
8142
10594
|
const snapshotTables = Object.keys(snapshot);
|
|
@@ -8560,7 +11012,7 @@ async function dryRunCommand(options) {
|
|
|
8560
11012
|
}
|
|
8561
11013
|
|
|
8562
11014
|
// src/commands/status.ts
|
|
8563
|
-
import { readFileSync as readFileSync5, readdirSync as readdirSync4, existsSync as
|
|
11015
|
+
import { readFileSync as readFileSync5, readdirSync as readdirSync4, existsSync as existsSync7 } from "fs";
|
|
8564
11016
|
import { join as join6 } from "path";
|
|
8565
11017
|
import Table2 from "cli-table3";
|
|
8566
11018
|
async function isStatementAlreadyApplied2(client, parsed) {
|
|
@@ -8607,7 +11059,7 @@ async function statusCommand(options) {
|
|
|
8607
11059
|
const { client, name: dbName } = resolveDatabase(config, options.database);
|
|
8608
11060
|
const outDir = config.out || "./housekit";
|
|
8609
11061
|
const dbOutDir = join6(outDir, dbName);
|
|
8610
|
-
if (!
|
|
11062
|
+
if (!existsSync7(dbOutDir)) {
|
|
8611
11063
|
spinner.warn("No migration directory found");
|
|
8612
11064
|
info(`Migration directory: ${dbOutDir}`);
|
|
8613
11065
|
info('Run "housekit generate" to create migrations.');
|
|
@@ -8717,12 +11169,12 @@ async function statusCommand(options) {
|
|
|
8717
11169
|
}
|
|
8718
11170
|
|
|
8719
11171
|
// src/commands/init.ts
|
|
8720
|
-
import { existsSync as
|
|
11172
|
+
import { existsSync as existsSync8, writeFileSync as writeFileSync4, mkdirSync as mkdirSync5 } from "fs";
|
|
8721
11173
|
import { join as join7 } from "path";
|
|
8722
11174
|
async function initCommand() {
|
|
8723
11175
|
const schemaDir = "./src/schema";
|
|
8724
11176
|
const migrationsDir = "./housekit";
|
|
8725
|
-
if (
|
|
11177
|
+
if (existsSync8("housekit.config.js") || existsSync8("housekit.config.ts") || existsSync8("housekit.config.mjs") || existsSync8("housekit.config.cjs")) {
|
|
8726
11178
|
const overwrite = await confirmPrompt("Configuration file already exists. Overwrite?", false);
|
|
8727
11179
|
if (!overwrite) {
|
|
8728
11180
|
info("Initialization cancelled.");
|
|
@@ -8781,8 +11233,8 @@ export default {
|
|
|
8781
11233
|
`;
|
|
8782
11234
|
writeFileSync4(configPath, configContent);
|
|
8783
11235
|
success(`Created ${quoteName(configPath)}`);
|
|
8784
|
-
if (!
|
|
8785
|
-
|
|
11236
|
+
if (!existsSync8(schemaPath)) {
|
|
11237
|
+
mkdirSync5(schemaPath, { recursive: true });
|
|
8786
11238
|
success(`Created schema directory: ${quoteName(schemaPath)}`);
|
|
8787
11239
|
const exampleSchemaPath = join7(schemaPath, `logs.${fileType}`);
|
|
8788
11240
|
const importLine = `import { t, defineTable, Engine } from '@housekit/orm';`;
|
|
@@ -8809,8 +11261,8 @@ ${typeAliasLine}`;
|
|
|
8809
11261
|
} else {
|
|
8810
11262
|
info(`Schema directory already exists: ${quoteName(schemaPath)}`);
|
|
8811
11263
|
}
|
|
8812
|
-
if (!
|
|
8813
|
-
|
|
11264
|
+
if (!existsSync8(migrationsPath)) {
|
|
11265
|
+
mkdirSync5(migrationsPath, { recursive: true });
|
|
8814
11266
|
success(`Created migrations directory: ${quoteName(migrationsPath)}`);
|
|
8815
11267
|
} else {
|
|
8816
11268
|
info(`Migrations directory already exists: ${quoteName(migrationsPath)}`);
|
|
@@ -9088,7 +11540,7 @@ function withErrorHandling(fn) {
|
|
|
9088
11540
|
try {
|
|
9089
11541
|
await fn(...args);
|
|
9090
11542
|
} catch (error3) {
|
|
9091
|
-
console.error(
|
|
11543
|
+
console.error(chalk5.red(`
|
|
9092
11544
|
✖ Error: ` + (error3.message || String(error3))));
|
|
9093
11545
|
if (process.env.DEBUG) {
|
|
9094
11546
|
console.error(error3);
|
|
@@ -9104,18 +11556,18 @@ var asciiLogo = [
|
|
|
9104
11556
|
].join(`
|
|
9105
11557
|
`);
|
|
9106
11558
|
program.addHelpText("before", () => [
|
|
9107
|
-
|
|
11559
|
+
chalk5.white(asciiLogo),
|
|
9108
11560
|
"",
|
|
9109
|
-
|
|
9110
|
-
|
|
11561
|
+
chalk5.bold("Housekit — The Modern ORM for ClickHouse"),
|
|
11562
|
+
chalk5.gray("Build, migrate, introspect, and query ClickHouse schemas with type-safe, ergonomic tooling. Zero friction. Maximum speed.")
|
|
9111
11563
|
].join(`
|
|
9112
11564
|
`));
|
|
9113
11565
|
program.addHelpText("after", () => [
|
|
9114
11566
|
"",
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
11567
|
+
chalk5.gray("Tips:"),
|
|
11568
|
+
chalk5.gray(" - Configure your databases in housekit.config.{ts,js}."),
|
|
11569
|
+
chalk5.gray(" - Use --database to target a specific DB."),
|
|
11570
|
+
chalk5.gray(' - Try "housekit schema --tables=foo,bar" to inspect specific tables.')
|
|
9119
11571
|
].join(`
|
|
9120
11572
|
`));
|
|
9121
11573
|
program.command("generate").description("Generate SQL migration files based on schema changes").action(withErrorHandling(generateCommand));
|