@libp2p/daemon 6.0.12 → 6.0.13-3bb95f95b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,21 +1,21 @@
1
1
  #! /usr/bin/env node
2
2
  (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PDaemon = factory()}(typeof self !== 'undefined' ? self : this, function () {
3
- "use strict";var Libp2PDaemon=(()=>{var oo=Object.create;var Gt=Object.defineProperty;var uo=Object.getOwnPropertyDescriptor;var ao=Object.getOwnPropertyNames;var co=Object.getPrototypeOf,lo=Object.prototype.hasOwnProperty;var J=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var xn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ce=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Hr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ao(t))!lo.call(e,i)&&i!==n&&Gt(e,i,{get:()=>t[i],enumerable:!(r=uo(t,i))||r.enumerable});return e};var mt=(e,t,n)=>(n=e!=null?oo(co(e)):{},Hr(t||!e||!e.__esModule?Gt(n,"default",{value:e,enumerable:!0}):n,e)),fo=e=>Hr(Gt({},"__esModule",{value:!0}),e);var zi=xn((pf,Ui)=>{Ui.exports=()=>/[#*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});var hs=xn((Kf,Ds)=>{"use strict";Ds.exports=function(t){if(t===void 0&&(t=2),t>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+t+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var n=Error.prepareStackTrace;Error.prepareStackTrace=function(i,s){return s};var r=new Error().stack;if(Error.prepareStackTrace=n,r!==null&&typeof r=="object")return r[t]?r[t].getFileName():void 0}});var no=xn((ih,to)=>{var Wr=class{constructor(t,n){this.ctx=n||{},this.yargs=t,this.parse=this.parse.bind(this),this.command=this.yargs.command,this.commandDir=this.yargs.commandDir}parse(t){let n=this.yargs,r;return new Promise((i,s)=>{let o=Object.assign({},this.ctx,{resolve:i,reject:s});n.parse(t,o,function(a,f,F){return r=f,a?f.reject(a):f.resolve(F)})}).then(i=>Promise.resolve(i)).then(i=>i&&i.argv?i:{data:i,argv:r}).catch(i=>Promise.resolve(i).then(s=>s&&s.argv?Promise.reject(s):Promise.reject({error:s,argv:r})))}};to.exports=Wr});var mc={};Ce(mc,{createLibp2pServer:()=>so,default:()=>Vr});function qr(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}var Gr=J("node:buffer");function Ft(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function wn(e=0){return Ft(Gr.Buffer.allocUnsafe(e))}var Do=Math.pow(2,7),ho=Math.pow(2,14),po=Math.pow(2,21),Bn=Math.pow(2,28),On=Math.pow(2,35),_n=Math.pow(2,42),Sn=Math.pow(2,49),ee=128,pe=127;function gt(e){if(e<Do)return 1;if(e<ho)return 2;if(e<po)return 3;if(e<Bn)return 4;if(e<On)return 5;if(e<_n)return 6;if(e<Sn)return 7;if(Number.MAX_SAFE_INTEGER!=null&&e>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Pn(e,t,n=0){switch(gt(e)){case 8:t[n++]=e&255|ee,e/=128;case 7:t[n++]=e&255|ee,e/=128;case 6:t[n++]=e&255|ee,e/=128;case 5:t[n++]=e&255|ee,e/=128;case 4:t[n++]=e&255|ee,e>>>=7;case 3:t[n++]=e&255|ee,e>>>=7;case 2:t[n++]=e&255|ee,e>>>=7;case 1:{t[n++]=e&255,e>>>=7;break}default:throw new Error("unreachable")}return t}function mo(e,t){let n=e[t],r=0;if(r+=n&pe,n<ee||(n=e[t+1],r+=(n&pe)<<7,n<ee)||(n=e[t+2],r+=(n&pe)<<14,n<ee)||(n=e[t+3],r+=(n&pe)<<21,n<ee)||(n=e[t+4],r+=(n&pe)*Bn,n<ee)||(n=e[t+5],r+=(n&pe)*On,n<ee)||(n=e[t+6],r+=(n&pe)*_n,n<ee)||(n=e[t+7],r+=(n&pe)*Sn,n<ee))return r;throw new RangeError("Could not decode varint")}function Fo(e,t){let n=e.get(t),r=0;if(r+=n&pe,n<ee||(n=e.get(t+1),r+=(n&pe)<<7,n<ee)||(n=e.get(t+2),r+=(n&pe)<<14,n<ee)||(n=e.get(t+3),r+=(n&pe)<<21,n<ee)||(n=e.get(t+4),r+=(n&pe)*Bn,n<ee)||(n=e.get(t+5),r+=(n&pe)*On,n<ee)||(n=e.get(t+6),r+=(n&pe)*_n,n<ee)||(n=e.get(t+7),r+=(n&pe)*Sn,n<ee))return r;throw new RangeError("Could not decode varint")}function vn(e,t=0){return e instanceof Uint8Array?mo(e,t):Fo(e,t)}var Yr=J("node:buffer");function It(e,t){return Ft(Yr.Buffer.concat(e,t))}var pi=J("node:buffer");var $n={};Ce($n,{base10:()=>wo});var Bc=new Uint8Array(0);function Kr(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}function we(e){if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")}function Jr(e){return new TextEncoder().encode(e)}function Qr(e){return new TextDecoder().decode(e)}function Co(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(n[o]!==255)throw new TypeError(s+" is ambiguous");n[o]=i}var a=e.length,f=e.charAt(0),F=Math.log(a)/Math.log(256),p=Math.log(256)/Math.log(a);function l(C){if(C instanceof Uint8Array||(ArrayBuffer.isView(C)?C=new Uint8Array(C.buffer,C.byteOffset,C.byteLength):Array.isArray(C)&&(C=Uint8Array.from(C))),!(C instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(C.length===0)return"";for(var b=0,d=0,I=0,z=C.length;I!==z&&C[I]===0;)I++,b++;for(var L=(z-I)*p+1>>>0,U=new Uint8Array(L);I!==z;){for(var W=C[I],R=0,H=L-1;(W!==0||R<d)&&H!==-1;H--,R++)W+=256*U[H]>>>0,U[H]=W%a>>>0,W=W/a>>>0;if(W!==0)throw new Error("Non-zero carry");d=R,I++}for(var K=L-d;K!==L&&U[K]===0;)K++;for(var de=f.repeat(b);K<L;++K)de+=e.charAt(U[K]);return de}function m(C){if(typeof C!="string")throw new TypeError("Expected String");if(C.length===0)return new Uint8Array;var b=0;if(C[b]!==" "){for(var d=0,I=0;C[b]===f;)d++,b++;for(var z=(C.length-b)*F+1>>>0,L=new Uint8Array(z);C[b];){var U=n[C.charCodeAt(b)];if(U===255)return;for(var W=0,R=z-1;(U!==0||W<I)&&R!==-1;R--,W++)U+=a*L[R]>>>0,L[R]=U%256>>>0,U=U/256>>>0;if(U!==0)throw new Error("Non-zero carry");I=W,b++}if(C[b]!==" "){for(var H=z-I;H!==z&&L[H]===0;)H++;for(var K=new Uint8Array(d+(z-H)),de=d;H!==z;)K[de++]=L[H++];return K}}}function E(C){var b=m(C);if(b)return b;throw new Error(`Non-${t} character`)}return{encode:l,decodeUnsafe:m,decode:E}}var Eo=Co,bo=Eo,Xr=bo;var In=class{name;prefix;baseEncode;constructor(t,n,r){this.name=t,this.prefix=n,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},jn=class{name;prefix;baseDecode;prefixCodePoint;constructor(t,n,r){this.name=t,this.prefix=n;let i=n.codePointAt(0);if(i===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=i,this.baseDecode=r}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return kr(this,t)}},Mn=class{decoders;constructor(t){this.decoders=t}or(t){return kr(this,t)}decode(t){let n=t[0],r=this.decoders[n];if(r!=null)return r.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function kr(e,t){return new Mn({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var Tn=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(t,n,r,i){this.name=t,this.prefix=n,this.baseEncode=r,this.baseDecode=i,this.encoder=new In(t,n,r),this.decoder=new jn(t,n,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};function Ct({name:e,prefix:t,encode:n,decode:r}){return new Tn(e,t,n,r)}function Ve({name:e,prefix:t,alphabet:n}){let{encode:r,decode:i}=Xr(n,e);return Ct({prefix:t,name:e,encode:r,decode:s=>we(i(s))})}function yo(e,t,n,r){let i=e.length;for(;e[i-1]==="=";)--i;let s=new Uint8Array(i*n/8|0),o=0,a=0,f=0;for(let F=0;F<i;++F){let p=t[e[F]];if(p===void 0)throw new SyntaxError(`Non-${r} character`);a=a<<n|p,o+=n,o>=8&&(o-=8,s[f++]=255&a>>o)}if(o>=n||(255&a<<8-o)!==0)throw new SyntaxError("Unexpected end of data");return s}function Ao(e,t,n){let r=t[t.length-1]==="=",i=(1<<n)-1,s="",o=0,a=0;for(let f=0;f<e.length;++f)for(a=a<<8|e[f],o+=8;o>n;)o-=n,s+=t[i&a>>o];if(o!==0&&(s+=t[i&a<<n-o]),r)for(;(s.length*n&7)!==0;)s+="=";return s}function xo(e){let t={};for(let n=0;n<e.length;++n)t[e[n]]=n;return t}function re({name:e,prefix:t,bitsPerChar:n,alphabet:r}){let i=xo(r);return Ct({prefix:t,name:e,encode(s){return Ao(s,r,n)},decode(s){return yo(s,i,n,e)}})}var wo=Ve({prefix:"9",name:"base10",alphabet:"0123456789"});var Nn={};Ce(Nn,{base16:()=>Bo,base16upper:()=>Oo});var Bo=re({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Oo=re({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Ln={};Ce(Ln,{base2:()=>_o});var _o=re({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Un={};Ce(Un,{base256emoji:()=>jo});var ei=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),So=ei.reduce((e,t,n)=>(e[n]=t,e),[]),Po=ei.reduce((e,t,n)=>{let r=t.codePointAt(0);if(r==null)throw new Error(`Invalid character: ${t}`);return e[r]=n,e},[]);function vo(e){return e.reduce((t,n)=>(t+=So[n],t),"")}function Io(e){let t=[];for(let n of e){let r=n.codePointAt(0);if(r==null)throw new Error(`Invalid character: ${n}`);let i=Po[r];if(i==null)throw new Error(`Non-base256emoji character: ${n}`);t.push(i)}return new Uint8Array(t)}var jo=Ct({prefix:"\u{1F680}",name:"base256emoji",encode:vo,decode:Io});var zn={};Ce(zn,{base32:()=>He,base32hex:()=>No,base32hexpad:()=>Uo,base32hexpadupper:()=>zo,base32hexupper:()=>Lo,base32pad:()=>To,base32padupper:()=>$o,base32upper:()=>Mo,base32z:()=>Wo});var He=re({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Mo=re({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),To=re({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),$o=re({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),No=re({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Lo=re({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Uo=re({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),zo=re({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Wo=re({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Wn={};Ce(Wn,{base36:()=>jt,base36upper:()=>Ro});var jt=Ve({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ro=Ve({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Rn={};Ce(Rn,{base58btc:()=>Me,base58flickr:()=>Vo});var Me=Ve({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Vo=Ve({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Hn={};Ce(Hn,{base64:()=>Ho,base64pad:()=>qo,base64url:()=>Vn,base64urlpad:()=>Go});var Ho=re({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),qo=re({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Vn=re({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Go=re({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var qn={};Ce(qn,{base8:()=>Yo});var Yo=re({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Gn={};Ce(Gn,{identity:()=>Ko});var Ko=Ct({prefix:"\0",name:"identity",encode:e=>Qr(e),decode:e=>Jr(e)});var Rc=new TextEncoder,Vc=new TextDecoder;var Kn={};Ce(Kn,{identity:()=>Fu});var Zo=ri,ti=128,Xo=127,ko=~Xo,eu=Math.pow(2,31);function ri(e,t,n){t=t||[],n=n||0;for(var r=n;e>=eu;)t[n++]=e&255|ti,e/=128;for(;e&ko;)t[n++]=e&255|ti,e>>>=7;return t[n]=e|0,ri.bytes=n-r+1,t}var tu=Yn,nu=128,ni=127;function Yn(e,r){var n=0,r=r||0,i=0,s=r,o,a=e.length;do{if(s>=a)throw Yn.bytes=0,new RangeError("Could not decode varint");o=e[s++],n+=i<28?(o&ni)<<i:(o&ni)*Math.pow(2,i),i+=7}while(o>=nu);return Yn.bytes=s-r,n}var ru=Math.pow(2,7),iu=Math.pow(2,14),su=Math.pow(2,21),ou=Math.pow(2,28),uu=Math.pow(2,35),au=Math.pow(2,42),cu=Math.pow(2,49),lu=Math.pow(2,56),fu=Math.pow(2,63),Du=function(e){return e<ru?1:e<iu?2:e<su?3:e<ou?4:e<uu?5:e<au?6:e<cu?7:e<lu?8:e<fu?9:10},hu={encode:Zo,decode:tu,encodingLength:Du},du=hu,Mt=du;function Tt(e,t=0){return[Mt.decode(e,t),Mt.decode.bytes]}function Et(e,t,n=0){return Mt.encode(e,t,n),t}function bt(e){return Mt.encodingLength(e)}function At(e,t){let n=t.byteLength,r=bt(e),i=r+bt(n),s=new Uint8Array(i+n);return Et(e,s,0),Et(n,s,r),s.set(t,i),new yt(e,n,t,s)}function ii(e){let t=we(e),[n,r]=Tt(t),[i,s]=Tt(t.subarray(r)),o=t.subarray(r+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new yt(n,i,o,t)}function si(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&Kr(e.bytes,n.bytes)}}var yt=class{code;size;digest;bytes;constructor(t,n,r,i){this.code=t,this.size=n,this.digest=r,this.bytes=i}};var oi=0,pu="identity",ui=we;function mu(e,t){if(t?.truncate!=null&&t.truncate!==e.byteLength){if(t.truncate<0||t.truncate>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,t.truncate)}return At(oi,ui(e))}var Fu={code:oi,name:pu,encode:ui,digest:mu};var Xn={};Ce(Xn,{sha256:()=>Cu,sha512:()=>Eu});var Zn=mt(J("crypto"),1);var gu=20;function Qn({name:e,code:t,encode:n,minDigestLength:r,maxDigestLength:i}){return new Jn(e,t,n,r,i)}var Jn=class{name;code;encode;minDigestLength;maxDigestLength;constructor(t,n,r,i,s){this.name=t,this.code=n,this.encode=r,this.minDigestLength=i??gu,this.maxDigestLength=s}digest(t,n){if(n?.truncate!=null){if(n.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&n.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?ai(r,this.code,n?.truncate):r.then(i=>ai(i,this.code,n?.truncate))}else throw Error("Unknown type, must be binary type")}};function ai(e,t,n){if(n!=null&&n!==e.byteLength){if(n>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,n)}return At(t,e)}var Cu=Qn({name:"sha2-256",code:18,encode:e=>we(Zn.default.createHash("sha256").update(e).digest())}),Eu=Qn({name:"sha2-512",code:19,encode:e=>we(Zn.default.createHash("sha512").update(e).digest())});function li(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return yu(n,kn(e),t??Me.encoder);default:return Au(n,kn(e),t??He.encoder)}}var fi=new WeakMap;function kn(e){let t=fi.get(e);if(t==null){let n=new Map;return fi.set(e,n),n}return t}var xt=class e{code;version;multihash;bytes;"/";constructor(t,n,r,i){this.code=n,this.version=t,this.multihash=r,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:n}=this;if(t!==Nt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(n.code!==xu)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.createV0(n)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:n}=this.multihash,r=At(t,n);return e.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return e.equals(this,t)}static equals(t,n){let r=n;return r!=null&&t.code===r.code&&t.version===r.version&&si(t.multihash,r.multihash)}toString(t){return li(this,t)}toJSON(){return{"/":li(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let n=t;if(n instanceof e)return n;if(n["/"]!=null&&n["/"]===n.bytes||n.asCID===n){let{version:r,code:i,multihash:s,bytes:o}=n;return new e(r,i,s,o??Di(r,i,s.bytes))}else if(n[wu]===!0){let{version:r,multihash:i,code:s}=n,o=ii(i);return e.create(r,s,o)}else return null}static create(t,n,r){if(typeof n!="number")throw new Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(n!==Nt)throw new Error(`Version 0 CID must use dag-pb (code: ${Nt}) block encoding`);return new e(t,n,r,r.bytes)}case 1:{let i=Di(t,n,r.bytes);return new e(t,n,r,i)}default:throw new Error("Invalid version")}}static createV0(t){return e.create(0,Nt,t)}static createV1(t,n){return e.create(1,t,n)}static decode(t){let[n,r]=e.decodeFirst(t);if(r.length!==0)throw new Error("Incorrect length");return n}static decodeFirst(t){let n=e.inspectBytes(t),r=n.size-n.multihashSize,i=we(t.subarray(r,r+n.multihashSize));if(i.byteLength!==n.multihashSize)throw new Error("Incorrect length");let s=i.subarray(n.multihashSize-n.digestSize),o=new yt(n.multihashCode,n.digestSize,s,i);return[n.version===0?e.createV0(o):e.createV1(n.codec,o),t.subarray(n.size)]}static inspectBytes(t){let n=0,r=()=>{let[l,m]=Tt(t.subarray(n));return n+=m,l},i=r(),s=Nt;if(i===18?(i=0,n=0):s=r(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=n,a=r(),f=r(),F=n+f,p=F-o;return{version:i,codec:s,multihashCode:a,digestSize:f,multihashSize:p,size:F}}static parse(t,n){let[r,i]=bu(t,n),s=e.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return kn(s).set(r,t),s}};function bu(e,t){switch(e[0]){case"Q":{let n=t??Me;return[Me.prefix,n.decode(`${Me.prefix}${e}`)]}case Me.prefix:{let n=t??Me;return[Me.prefix,n.decode(e)]}case He.prefix:{let n=t??He;return[He.prefix,n.decode(e)]}case jt.prefix:{let n=t??jt;return[jt.prefix,n.decode(e)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}}function yu(e,t,n){let{prefix:r}=n;if(r!==Me.prefix)throw Error(`Cannot string encode V0 in ${n.name} encoding`);let i=t.get(r);if(i==null){let s=n.encode(e).slice(1);return t.set(r,s),s}else return i}function Au(e,t,n){let{prefix:r}=n,i=t.get(r);if(i==null){let s=n.encode(e);return t.set(r,s),s}else return i}var Nt=112,xu=18;function Di(e,t,n){let r=bt(e),i=r+bt(t),s=new Uint8Array(i+n.byteLength);return Et(e,s,0),Et(t,s,r),s.set(n,i),s}var wu=Symbol.for("@ipld/js-cid/CID");var Lt={...Gn,...Ln,...qn,...$n,...Nn,...zn,...Wn,...Rn,...Hn,...Un},Dl={...Xn,...Kn};function di(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}var hi=di("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),er=di("ascii","a",e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},e=>{e=e.substring(1);let t=wn(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),Bu={utf8:hi,"utf-8":hi,hex:Lt.base16,latin1:er,ascii:er,binary:er,...Lt},Kt=Bu;function Ut(e,t="utf8"){let n=Kt[t];if(n==null)throw new Error(`Unsupported encoding "${t}"`);return t==="utf8"||t==="utf-8"?Ft(pi.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}var mi=J("node:buffer");function ke(e,t="utf8"){let n=Kt[t];if(n==null)throw new Error(`Unsupported encoding "${t}"`);return t==="utf8"||t==="utf-8"?mi.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}var he=class extends Error{static name="InvalidMultiaddrError";name="InvalidMultiaddrError"},Ue=class extends Error{static name="ValidationError";name="ValidationError"},Jt=class extends Error{static name="InvalidParametersError";name="InvalidParametersError"},Qt=class extends Error{static name="UnknownProtocolError";name="UnknownProtocolError"};var ze=J("node:net");function nr(e){return t=>ke(t,e)}function rr(e){return t=>Ut(t,e)}function wt(e){return new DataView(e.buffer).getUint16(e.byteOffset).toString()}function et(e){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,typeof e=="string"?parseInt(e):e),new Uint8Array(t)}function Fi(e){let t=e.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let n=Ut(t[0],"base32"),r=parseInt(t[1],10);if(r<1||r>65536)throw new Error("Port number is not in range(1, 65536)");let i=et(r);return It([n,i],n.length+i.length)}function gi(e){let t=e.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let n=He.decode(`b${t[0]}`),r=parseInt(t[1],10);if(r<1||r>65536)throw new Error("Port number is not in range(1, 65536)");let i=et(r);return It([n,i],n.length+i.length)}function ir(e){let t=e.subarray(0,e.length-2),n=e.subarray(e.length-2),r=ke(t,"base32"),i=wt(n);return`${r}:${i}`}var sr=function(e){e=e.toString().trim();let t=new Uint8Array(4);return e.split(/\./g).forEach((n,r)=>{let i=parseInt(n,10);if(isNaN(i)||i<0||i>255)throw new he("Invalid byte value in IP address");t[r]=i}),t},Ci=function(e){let t=0;e=e.toString().trim();let n=e.split(":",8),r;for(r=0;r<n.length;r++){let s=(0,ze.isIPv4)(n[r]),o;s&&(o=sr(n[r]),n[r]=ke(o.subarray(0,2),"base16")),o!=null&&++r<8&&n.splice(r,0,ke(o.subarray(2,4),"base16"))}if(n[0]==="")for(;n.length<8;)n.unshift("0");else if(n[n.length-1]==="")for(;n.length<8;)n.push("0");else if(n.length<8){for(r=0;r<n.length&&n[r]!=="";r++);let s=[r,1];for(r=9-n.length;r>0;r--)s.push("0");n.splice.apply(n,s)}let i=new Uint8Array(t+16);for(r=0;r<n.length;r++){n[r]===""&&(n[r]="0");let s=parseInt(n[r],16);if(isNaN(s)||s<0||s>65535)throw new he("Invalid byte value in IP address");i[t++]=s>>8&255,i[t++]=s&255}return i},Ei=function(e){if(e.byteLength!==4)throw new he("IPv4 address was incorrect length");let t=[];for(let n=0;n<e.byteLength;n++)t.push(e[n]);return t.join(".")},bi=function(e){if(e.byteLength!==16)throw new he("IPv6 address was incorrect length");let t=[];for(let r=0;r<e.byteLength;r+=2){let i=e[r],s=e[r+1],o=`${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`;t.push(o)}let n=t.join(":");try{let r=new URL(`http://[${n}]`);return r.hostname.substring(1,r.hostname.length-1)}catch{throw new he(`Invalid IPv6 address "${n}"`)}};function yi(e){try{let t=new URL(`http://[${e}]`);return t.hostname.substring(1,t.hostname.length-1)}catch{throw new he(`Invalid IPv6 address "${e}"`)}}var tr=Object.values(Lt).map(e=>e.decoder),Ou=(function(){let e=tr[0].or(tr[1]);return tr.slice(2).forEach(t=>e=e.or(t)),e})();function Ai(e){return Ou.decode(e)}function xi(e){return t=>e.encoder.encode(t)}function _u(e){if(parseInt(e).toString()!==e)throw new Ue("Value must be an integer")}function Su(e){if(e<0)throw new Ue("Value must be a positive integer, or zero")}function Pu(e){return t=>{if(t>e)throw new Ue(`Value must be smaller than or equal to ${e}`)}}function vu(...e){return t=>{for(let n of e)n(t)}}var zt=vu(_u,Su,Pu(65535));var fe=-1,or=class{protocolsByCode=new Map;protocolsByName=new Map;getProtocol(t){let n;if(typeof t=="string"?n=this.protocolsByName.get(t):n=this.protocolsByCode.get(t),n==null)throw new Qt(`Protocol ${t} was unknown`);return n}addProtocol(t){this.protocolsByCode.set(t.code,t),this.protocolsByName.set(t.name,t),t.aliases?.forEach(n=>{this.protocolsByName.set(n,t)})}removeProtocol(t){let n=this.protocolsByCode.get(t);n!=null&&(this.protocolsByCode.delete(n.code),this.protocolsByName.delete(n.name),n.aliases?.forEach(r=>{this.protocolsByName.delete(r)}))}},We=new or,ga=[{code:4,name:"ip4",size:32,valueToBytes:sr,bytesToValue:Ei,validate:e=>{if(!(0,ze.isIPv4)(e))throw new Ue(`Invalid IPv4 address "${e}"`)}},{code:6,name:"tcp",size:16,valueToBytes:et,bytesToValue:wt,validate:zt},{code:273,name:"udp",size:16,valueToBytes:et,bytesToValue:wt,validate:zt},{code:33,name:"dccp",size:16,valueToBytes:et,bytesToValue:wt,validate:zt},{code:41,name:"ip6",size:128,valueToBytes:Ci,bytesToValue:bi,stringToValue:yi,validate:e=>{if(!(0,ze.isIPv6)(e))throw new Ue(`Invalid IPv6 address "${e}"`)}},{code:42,name:"ip6zone",size:fe},{code:43,name:"ipcidr",size:8,bytesToValue:nr("base10"),valueToBytes:rr("base10")},{code:53,name:"dns",size:fe},{code:54,name:"dns4",size:fe},{code:55,name:"dns6",size:fe},{code:56,name:"dnsaddr",size:fe},{code:132,name:"sctp",size:16,valueToBytes:et,bytesToValue:wt,validate:zt},{code:301,name:"udt"},{code:302,name:"utp"},{code:400,name:"unix",size:fe,stringToValue:e=>decodeURIComponent(e),valueToString:e=>encodeURIComponent(e)},{code:421,name:"p2p",aliases:["ipfs"],size:fe,bytesToValue:nr("base58btc"),valueToBytes:e=>e.startsWith("Q")||e.startsWith("1")?rr("base58btc")(e):xt.parse(e).multihash.bytes},{code:444,name:"onion",size:96,bytesToValue:ir,valueToBytes:Fi},{code:445,name:"onion3",size:296,bytesToValue:ir,valueToBytes:gi},{code:446,name:"garlic64",size:fe},{code:447,name:"garlic32",size:fe},{code:448,name:"tls"},{code:449,name:"sni",size:fe},{code:454,name:"noise"},{code:460,name:"quic"},{code:461,name:"quic-v1"},{code:465,name:"webtransport"},{code:466,name:"certhash",size:fe,bytesToValue:xi(Vn),valueToBytes:Ai},{code:480,name:"http"},{code:481,name:"http-path",size:fe,stringToValue:e=>`/${decodeURIComponent(e)}`,valueToString:e=>encodeURIComponent(e.substring(1))},{code:443,name:"https"},{code:477,name:"ws"},{code:478,name:"wss"},{code:479,name:"p2p-websocket-star"},{code:277,name:"p2p-stardust"},{code:275,name:"p2p-webrtc-star"},{code:276,name:"p2p-webrtc-direct"},{code:280,name:"webrtc-direct"},{code:281,name:"webrtc"},{code:290,name:"p2p-circuit"},{code:777,name:"memory",size:fe}];ga.forEach(e=>{We.addProtocol(e)});function wi(e){let t=[],n=0;for(;n<e.length;){let r=vn(e,n),i=We.getProtocol(r),s=gt(r),o=Ca(i,e,n+s),a=0;o>0&&i.size===fe&&(a=gt(o));let f=s+a+o,F={code:r,name:i.name,bytes:e.subarray(n,n+f)};if(o>0){let p=n+s+a,l=e.subarray(p,p+o);F.value=i.bytesToValue?.(l)??ke(l)}t.push(F),n+=f}return t}function Bi(e){let t=0,n=[];for(let r of e){if(r.bytes==null){let i=We.getProtocol(r.code),s=gt(r.code),o,a=0,f=0;r.value!=null&&(o=i.valueToBytes?.(r.value)??Ut(r.value),a=o.byteLength,i.size===fe&&(f=gt(a)));let F=new Uint8Array(s+f+a),p=0;Pn(r.code,F,p),p+=s,o!=null&&(i.size===fe&&(Pn(a,F,p),p+=f),F.set(o,p)),r.bytes=F}n.push(r.bytes),t+=r.bytes.byteLength}return It(n,t)}function Oi(e){if(e.charAt(0)!=="/")throw new he('String multiaddr must start with "/"');let t=[],n="protocol",r="",i="";for(let s=1;s<e.length;s++){let o=e.charAt(s);o!=="/"&&(n==="protocol"?i+=e.charAt(s):r+=e.charAt(s));let a=s===e.length-1;if(o==="/"||a){let f=We.getProtocol(i);if(n==="protocol"){if(f.size==null||f.size===0){t.push({code:f.code,name:f.name}),r="",i="",n="protocol";continue}else if(a)throw new he(`Component ${i} was missing value`);n="value"}else if(n==="value"){let F={code:f.code,name:f.name};if(f.size!=null&&f.size!==0){if(r==="")throw new he(`Component ${i} was missing value`);F.value=f.stringToValue?.(r)??r}t.push(F),r="",i="",n="protocol"}}}if(i!==""&&r!=="")throw new he("Incomplete multiaddr");return t}function _i(e){return`/${e.flatMap(t=>{if(t.value==null)return t.name;let n=We.getProtocol(t.code);if(n==null)throw new he(`Unknown protocol code ${t.code}`);return[t.name,n.valueToString?.(t.value)??t.value]}).join("/")}`}function Ca(e,t,n){return e.size==null||e.size===0?0:e.size>0?e.size/8:vn(t,n)}var Ea=Symbol.for("nodejs.util.inspect.custom"),ur=Symbol.for("@multiformats/multiaddr");function ba(e){if(e==null&&(e="/"),Si(e))return e.getComponents();if(e instanceof Uint8Array)return wi(e);if(typeof e=="string")return e=e.replace(/\/(\/)+/,"/").replace(/(\/)+$/,""),e===""&&(e="/"),Oi(e);if(Array.isArray(e))return e;throw new he("Must be a string, Uint8Array, Component[], or another Multiaddr")}var Zt=class e{[ur]=!0;#e;#t;#n;constructor(t="/",n={}){this.#e=ba(t),n.validate!==!1&&ya(this)}get bytes(){return this.#n==null&&(this.#n=Bi(this.#e)),this.#n}toString(){return this.#t==null&&(this.#t=_i(this.#e)),this.#t}toJSON(){return this.toString()}getComponents(){return[...this.#e.map(t=>({...t}))]}encapsulate(t){let n=new e(t);return new e([...this.#e,...n.getComponents()],{validate:!1})}decapsulate(t){let n=t.toString(),r=this.toString(),i=r.lastIndexOf(n);if(i<0)throw new Jt(`Address ${this.toString()} does not contain subaddress: ${n}`);return new e(r.slice(0,i),{validate:!1})}decapsulateCode(t){let n;for(let r=this.#e.length-1;r>-1;r--)if(this.#e[r].code===t){n=r;break}return new e(this.#e.slice(0,n),{validate:!1})}equals(t){return qr(this.bytes,t.bytes)}[Ea](){return`Multiaddr(${this.toString()})`}};function ya(e){e.getComponents().forEach(t=>{let n=We.getProtocol(t.code);t.value!=null&&n.validate?.(t.value)})}function Si(e){return!!e?.[ur]}function Pi(e){return new Zt(e)}var vi=J("module"),cr=mt(J("path"),1),ar=mt(J("process"),1),Ii=J("url");function Aa(e){let t=cr.default.extname(e);return t?e.slice(0,-t.length):e}function lr(e){if(!e)return!1;if("main"in e)return!!e.main;if(!ar.default.argv[1])return!1;let n=(0,vi.createRequire)(e.url).resolve(ar.default.argv[1]),r=(0,Ii.fileURLToPath)(e.url);return cr.default.extname(n)?r===n:Aa(r)===n}var an=J("assert");var xa={right:Sa,center:Pa},wa=0,Xt=1,Ba=2,kt=3,fr=class{constructor(t){var n;this.width=t.width,this.wrap=(n=t.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...t){let n=this.div(...t);n.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let n=t.map(r=>typeof r=="string"?this.colFromString(r):r);return this.rows.push(n),n}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let n=t.split(`
4
- `).map(i=>i.split(" ")),r=0;return n.forEach(i=>{i.length>1&&Ee.stringWidth(i[0])>r&&(r=Math.min(Math.floor(this.width*.5),Ee.stringWidth(i[0])))}),n.forEach(i=>{this.div(...i.map((s,o)=>({text:s.trim(),padding:this.measurePadding(s),width:o===0&&i.length>1?r:void 0})))}),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){let n=Ee.stripAnsi(t);return[0,n.match(/\s*$/)[0].length,0,n.match(/^\s*/)[0].length]}toString(){let t=[];return this.rows.forEach(n=>{this.rowToString(n,t)}),t.filter(n=>!n.hidden).map(n=>n.text).join(`
5
- `)}rowToString(t,n){return this.rasterize(t).forEach((r,i)=>{let s="";r.forEach((o,a)=>{let{width:f}=t[a],F=this.negatePadding(t[a]),p=o;if(F>Ee.stringWidth(o)&&(p+=" ".repeat(F-Ee.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap){let m=xa[t[a].align];p=m(p,F),Ee.stringWidth(p)<F&&(p+=" ".repeat((f||0)-Ee.stringWidth(p)-1))}let l=t[a].padding||[0,0,0,0];l[kt]&&(s+=" ".repeat(l[kt])),s+=ji(t[a],p,"| "),s+=p,s+=ji(t[a],p," |"),l[Xt]&&(s+=" ".repeat(l[Xt])),i===0&&n.length>0&&(s=this.renderInline(s,n[n.length-1]))}),n.push({text:s.replace(/ +$/,""),span:t.span})}),n}renderInline(t,n){let r=t.match(/^ */),i=r?r[0].length:0,s=n.text,o=Ee.stringWidth(s.trimRight());return n.span?this.wrap?i<o?t:(n.hidden=!0,s.trimRight()+" ".repeat(i-o)+t.trimLeft()):(n.hidden=!0,s+t):t}rasterize(t){let n=[],r=this.columnWidths(t),i;return t.forEach((s,o)=>{s.width=r[o],this.wrap?i=Ee.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
3
+ "use strict";var Libp2PDaemon=(()=>{var ho=Object.create;var Ye=Object.defineProperty;var po=Object.getOwnPropertyDescriptor;var mo=Object.getOwnPropertyNames;var go=Object.getPrototypeOf,Fo=Object.prototype.hasOwnProperty;var J=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var _n=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Ct=(n,t)=>{for(var e in t)Ye(n,e,{get:t[e],enumerable:!0})},Qr=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of mo(t))!Fo.call(n,i)&&i!==e&&Ye(n,i,{get:()=>t[i],enumerable:!(r=po(t,i))||r.enumerable});return n};var me=(n,t,e)=>(e=n!=null?ho(go(n)):{},Qr(t||!n||!n.__esModule?Ye(e,"default",{value:n,enumerable:!0}):e,n)),Co=n=>Qr(Ye({},"__esModule",{value:!0}),n);var Yi=_n((Uf,Gi)=>{Gi.exports=()=>/[#*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});var Es=_n((FD,Cs)=>{"use strict";Cs.exports=function(t){if(t===void 0&&(t=2),t>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+t+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var e=Error.prepareStackTrace;Error.prepareStackTrace=function(i,s){return s};var r=new Error().stack;if(Error.prepareStackTrace=e,r!==null&&typeof r=="object")return r[t]?r[t].getFileName():void 0}});var co=_n((_h,ao)=>{var Yr=class{constructor(t,e){this.ctx=e||{},this.yargs=t,this.parse=this.parse.bind(this),this.command=this.yargs.command,this.commandDir=this.yargs.commandDir}parse(t){let e=this.yargs,r;return new Promise((i,s)=>{let o=Object.assign({},this.ctx,{resolve:i,reject:s});e.parse(t,o,function(a,f,g){return r=f,a?f.reject(a):f.resolve(g)})}).then(i=>Promise.resolve(i)).then(i=>i&&i.argv?i:{data:i,argv:r}).catch(i=>Promise.resolve(i).then(s=>s&&s.argv?Promise.reject(s):Promise.reject({error:s,argv:r})))}};ao.exports=Yr});var vc={};Ct(vc,{createLibp2pServer:()=>Do,default:()=>Jr});function Zr(n,t){if(n===t)return!0;if(n.byteLength!==t.byteLength)return!1;for(let e=0;e<n.byteLength;e++)if(n[e]!==t[e])return!1;return!0}var Xr=J("node:buffer");function ge(n){return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}function Sn(n=0){return ge(Xr.Buffer.allocUnsafe(n))}var Eo=Math.pow(2,7),bo=Math.pow(2,14),xo=Math.pow(2,21),Pn=Math.pow(2,28),In=Math.pow(2,35),vn=Math.pow(2,42),jn=Math.pow(2,49),tt=128,pt=127;function Fe(n){if(n<Eo)return 1;if(n<bo)return 2;if(n<xo)return 3;if(n<Pn)return 4;if(n<In)return 5;if(n<vn)return 6;if(n<jn)return 7;if(Number.MAX_SAFE_INTEGER!=null&&n>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Mn(n,t,e=0){switch(Fe(n)){case 8:t[e++]=n&255|tt,n/=128;case 7:t[e++]=n&255|tt,n/=128;case 6:t[e++]=n&255|tt,n/=128;case 5:t[e++]=n&255|tt,n/=128;case 4:t[e++]=n&255|tt,n>>>=7;case 3:t[e++]=n&255|tt,n>>>=7;case 2:t[e++]=n&255|tt,n>>>=7;case 1:{t[e++]=n&255,n>>>=7;break}default:throw new Error("unreachable")}return t}function wo(n,t){let e=n[t],r=0;if(r+=e&pt,e<tt||(e=n[t+1],r+=(e&pt)<<7,e<tt)||(e=n[t+2],r+=(e&pt)<<14,e<tt)||(e=n[t+3],r+=(e&pt)<<21,e<tt)||(e=n[t+4],r+=(e&pt)*Pn,e<tt)||(e=n[t+5],r+=(e&pt)*In,e<tt)||(e=n[t+6],r+=(e&pt)*vn,e<tt)||(e=n[t+7],r+=(e&pt)*jn,e<tt))return r;throw new RangeError("Could not decode varint")}function yo(n,t){let e=n.get(t),r=0;if(r+=e&pt,e<tt||(e=n.get(t+1),r+=(e&pt)<<7,e<tt)||(e=n.get(t+2),r+=(e&pt)<<14,e<tt)||(e=n.get(t+3),r+=(e&pt)<<21,e<tt)||(e=n.get(t+4),r+=(e&pt)*Pn,e<tt)||(e=n.get(t+5),r+=(e&pt)*In,e<tt)||(e=n.get(t+6),r+=(e&pt)*vn,e<tt)||(e=n.get(t+7),r+=(e&pt)*jn,e<tt))return r;throw new RangeError("Could not decode varint")}function Tn(n,t=0){return n instanceof Uint8Array?wo(n,t):yo(n,t)}var kr=J("node:buffer");function ve(n,t){return ge(kr.Buffer.concat(n,t))}var bi=J("node:buffer");var zn={};Ct(zn,{base10:()=>vo});var Wc=new Uint8Array(0);function ti(n,t){if(n===t)return!0;if(n.byteLength!==t.byteLength)return!1;for(let e=0;e<n.byteLength;e++)if(n[e]!==t[e])return!1;return!0}function At(n){if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("Unknown type, must be binary type")}function ei(n){return new TextEncoder().encode(n)}function ni(n){return new TextDecoder().decode(n)}function Oo(n,t){if(n.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<n.length;i++){var s=n.charAt(i),o=s.charCodeAt(0);if(e[o]!==255)throw new TypeError(s+" is ambiguous");e[o]=i}var a=n.length,f=n.charAt(0),g=Math.log(a)/Math.log(256),p=Math.log(256)/Math.log(a);function l(C){if(C instanceof Uint8Array||(ArrayBuffer.isView(C)?C=new Uint8Array(C.buffer,C.byteOffset,C.byteLength):Array.isArray(C)&&(C=Uint8Array.from(C))),!(C instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(C.length===0)return"";for(var b=0,d=0,v=0,z=C.length;v!==z&&C[v]===0;)v++,b++;for(var L=(z-v)*p+1>>>0,U=new Uint8Array(L);v!==z;){for(var R=C[v],W=0,H=L-1;(R!==0||W<d)&&H!==-1;H--,W++)R+=256*U[H]>>>0,U[H]=R%a>>>0,R=R/a>>>0;if(R!==0)throw new Error("Non-zero carry");d=W,v++}for(var K=L-d;K!==L&&U[K]===0;)K++;for(var dt=f.repeat(b);K<L;++K)dt+=n.charAt(U[K]);return dt}function m(C){if(typeof C!="string")throw new TypeError("Expected String");if(C.length===0)return new Uint8Array;var b=0;if(C[b]!==" "){for(var d=0,v=0;C[b]===f;)d++,b++;for(var z=(C.length-b)*g+1>>>0,L=new Uint8Array(z);C[b];){var U=e[C.charCodeAt(b)];if(U===255)return;for(var R=0,W=z-1;(U!==0||R<v)&&W!==-1;W--,R++)U+=a*L[W]>>>0,L[W]=U%256>>>0,U=U/256>>>0;if(U!==0)throw new Error("Non-zero carry");v=R,b++}if(C[b]!==" "){for(var H=z-v;H!==z&&L[H]===0;)H++;for(var K=new Uint8Array(d+(z-H)),dt=d;H!==z;)K[dt++]=L[H++];return K}}}function E(C){var b=m(C);if(b)return b;throw new Error(`Non-${t} character`)}return{encode:l,decodeUnsafe:m,decode:E}}var Bo=Oo,_o=Bo,ii=_o;var $n=class{name;prefix;baseEncode;constructor(t,e,r){this.name=t,this.prefix=e,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},Nn=class{name;prefix;baseDecode;prefixCodePoint;constructor(t,e,r){this.name=t,this.prefix=e;let i=e.codePointAt(0);if(i===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=i,this.baseDecode=r}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return si(this,t)}},Ln=class{decoders;constructor(t){this.decoders=t}or(t){return si(this,t)}decode(t){let e=t[0],r=this.decoders[e];if(r!=null)return r.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function si(n,t){return new Ln({...n.decoders??{[n.prefix]:n},...t.decoders??{[t.prefix]:t}})}var Un=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(t,e,r,i){this.name=t,this.prefix=e,this.baseEncode=r,this.baseDecode=i,this.encoder=new $n(t,e,r),this.decoder=new Nn(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};function Ce({name:n,prefix:t,encode:e,decode:r}){return new Un(n,t,e,r)}function Vt({name:n,prefix:t,alphabet:e}){let{encode:r,decode:i}=ii(e,n);return Ce({prefix:t,name:n,encode:r,decode:s=>At(i(s))})}function So(n,t,e,r){let i=n.length;for(;n[i-1]==="=";)--i;let s=new Uint8Array(i*e/8|0),o=0,a=0,f=0;for(let g=0;g<i;++g){let p=t[n[g]];if(p===void 0)throw new SyntaxError(`Non-${r} character`);a=a<<e|p,o+=e,o>=8&&(o-=8,s[f++]=255&a>>o)}if(o>=e||(255&a<<8-o)!==0)throw new SyntaxError("Unexpected end of data");return s}function Po(n,t,e){let r=t[t.length-1]==="=",i=(1<<e)-1,s="",o=0,a=0;for(let f=0;f<n.length;++f)for(a=a<<8|n[f],o+=8;o>e;)o-=e,s+=t[i&a>>o];if(o!==0&&(s+=t[i&a<<e-o]),r)for(;(s.length*e&7)!==0;)s+="=";return s}function Io(n){let t={};for(let e=0;e<n.length;++e)t[n[e]]=e;return t}function rt({name:n,prefix:t,bitsPerChar:e,alphabet:r}){let i=Io(r);return Ce({prefix:t,name:n,encode(s){return Po(s,r,e)},decode(s){return So(s,i,e,n)}})}var vo=Vt({prefix:"9",name:"base10",alphabet:"0123456789"});var Rn={};Ct(Rn,{base16:()=>jo,base16upper:()=>Mo});var jo=rt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Mo=rt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Wn={};Ct(Wn,{base2:()=>To});var To=rt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Vn={};Ct(Vn,{base256emoji:()=>zo});var oi=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),$o=oi.reduce((n,t,e)=>(n[e]=t,n),[]),No=oi.reduce((n,t,e)=>{let r=t.codePointAt(0);if(r==null)throw new Error(`Invalid character: ${t}`);return n[r]=e,n},[]);function Lo(n){return n.reduce((t,e)=>(t+=$o[e],t),"")}function Uo(n){let t=[];for(let e of n){let r=e.codePointAt(0);if(r==null)throw new Error(`Invalid character: ${e}`);let i=No[r];if(i==null)throw new Error(`Non-base256emoji character: ${e}`);t.push(i)}return new Uint8Array(t)}var zo=Ce({prefix:"\u{1F680}",name:"base256emoji",encode:Lo,decode:Uo});var Hn={};Ct(Hn,{base32:()=>Ht,base32hex:()=>Ho,base32hexpad:()=>Go,base32hexpadupper:()=>Yo,base32hexupper:()=>qo,base32pad:()=>Wo,base32padupper:()=>Vo,base32upper:()=>Ro,base32z:()=>Ko});var Ht=rt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ro=rt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Wo=rt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Vo=rt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ho=rt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),qo=rt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Go=rt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Yo=rt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Ko=rt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var qn={};Ct(qn,{base36:()=>je,base36upper:()=>Jo});var je=Vt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Jo=Vt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Gn={};Ct(Gn,{base58btc:()=>Mt,base58flickr:()=>Qo});var Mt=Vt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Qo=Vt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Kn={};Ct(Kn,{base64:()=>Zo,base64pad:()=>Xo,base64url:()=>Yn,base64urlpad:()=>ko});var Zo=rt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Xo=rt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Yn=rt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ko=rt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Jn={};Ct(Jn,{base8:()=>tu});var tu=rt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Qn={};Ct(Qn,{identity:()=>eu});var eu=Ce({prefix:"\0",name:"identity",encode:n=>ni(n),decode:n=>ei(n)});var il=new TextEncoder,sl=new TextDecoder;var Xn={};Ct(Xn,{identity:()=>yu});var iu=ci,ui=128,su=127,ou=~su,uu=Math.pow(2,31);function ci(n,t,e){t=t||[],e=e||0;for(var r=e;n>=uu;)t[e++]=n&255|ui,n/=128;for(;n&ou;)t[e++]=n&255|ui,n>>>=7;return t[e]=n|0,ci.bytes=e-r+1,t}var au=Zn,cu=128,ai=127;function Zn(n,r){var e=0,r=r||0,i=0,s=r,o,a=n.length;do{if(s>=a)throw Zn.bytes=0,new RangeError("Could not decode varint");o=n[s++],e+=i<28?(o&ai)<<i:(o&ai)*Math.pow(2,i),i+=7}while(o>=cu);return Zn.bytes=s-r,e}var lu=Math.pow(2,7),fu=Math.pow(2,14),Du=Math.pow(2,21),hu=Math.pow(2,28),du=Math.pow(2,35),pu=Math.pow(2,42),mu=Math.pow(2,49),gu=Math.pow(2,56),Fu=Math.pow(2,63),Cu=function(n){return n<lu?1:n<fu?2:n<Du?3:n<hu?4:n<du?5:n<pu?6:n<mu?7:n<gu?8:n<Fu?9:10},Eu={encode:iu,decode:au,encodingLength:Cu},bu=Eu,Me=bu;function Te(n,t=0){return[Me.decode(n,t),Me.decode.bytes]}function Ee(n,t,e=0){return Me.encode(n,t,e),t}function be(n){return Me.encodingLength(n)}function we(n,t){let e=t.byteLength,r=be(n),i=r+be(e),s=new Uint8Array(i+e);return Ee(n,s,0),Ee(e,s,r),s.set(t,i),new xe(n,e,t,s)}function li(n){let t=At(n),[e,r]=Te(t),[i,s]=Te(t.subarray(r)),o=t.subarray(r+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new xe(e,i,o,t)}function fi(n,t){if(n===t)return!0;{let e=t;return n.code===e.code&&n.size===e.size&&e.bytes instanceof Uint8Array&&ti(n.bytes,e.bytes)}}var xe=class{code;size;digest;bytes;constructor(t,e,r,i){this.code=t,this.size=e,this.digest=r,this.bytes=i}};var Di=0,xu="identity",hi=At;function wu(n,t){if(t?.truncate!=null&&t.truncate!==n.byteLength){if(t.truncate<0||t.truncate>n.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${n.byteLength}`);n=n.subarray(0,t.truncate)}return we(Di,hi(n))}var yu={code:Di,name:xu,encode:hi,digest:wu};var nr={};Ct(nr,{sha256:()=>Ou,sha512:()=>Bu});var er=me(J("crypto"),1);var Au=20;function tr({name:n,code:t,encode:e,minDigestLength:r,maxDigestLength:i}){return new kn(n,t,e,r,i)}var kn=class{name;code;encode;minDigestLength;maxDigestLength;constructor(t,e,r,i,s){this.name=t,this.code=e,this.encode=r,this.minDigestLength=i??Au,this.maxDigestLength=s}digest(t,e){if(e?.truncate!=null){if(e.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&e.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?di(r,this.code,e?.truncate):r.then(i=>di(i,this.code,e?.truncate))}else throw Error("Unknown type, must be binary type")}};function di(n,t,e){if(e!=null&&e!==n.byteLength){if(e>n.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${n.byteLength}`);n=n.subarray(0,e)}return we(t,n)}var Ou=tr({name:"sha2-256",code:18,encode:n=>At(er.default.createHash("sha256").update(n).digest())}),Bu=tr({name:"sha2-512",code:19,encode:n=>At(er.default.createHash("sha512").update(n).digest())});function mi(n,t){let{bytes:e,version:r}=n;switch(r){case 0:return Su(e,rr(n),t??Mt.encoder);default:return Pu(e,rr(n),t??Ht.encoder)}}var gi=new WeakMap;function rr(n){let t=gi.get(n);if(t==null){let e=new Map;return gi.set(n,e),e}return t}var ye=class n{code;version;multihash;bytes;"/";constructor(t,e,r,i){this.code=e,this.version=t,this.multihash=r,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:e}=this;if(t!==Ne)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==Iu)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return n.createV0(e)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:e}=this.multihash,r=we(t,e);return n.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return n.equals(this,t)}static equals(t,e){let r=e;return r!=null&&t.code===r.code&&t.version===r.version&&fi(t.multihash,r.multihash)}toString(t){return mi(this,t)}toJSON(){return{"/":mi(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let e=t;if(e instanceof n)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:r,code:i,multihash:s,bytes:o}=e;return new n(r,i,s,o??Fi(r,i,s.bytes))}else if(e[vu]===!0){let{version:r,multihash:i,code:s}=e,o=li(i);return n.create(r,s,o)}else return null}static create(t,e,r){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==Ne)throw new Error(`Version 0 CID must use dag-pb (code: ${Ne}) block encoding`);return new n(t,e,r,r.bytes)}case 1:{let i=Fi(t,e,r.bytes);return new n(t,e,r,i)}default:throw new Error("Invalid version")}}static createV0(t){return n.create(0,Ne,t)}static createV1(t,e){return n.create(1,t,e)}static decode(t){let[e,r]=n.decodeFirst(t);if(r.length!==0)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=n.inspectBytes(t),r=e.size-e.multihashSize,i=At(t.subarray(r,r+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");let s=i.subarray(e.multihashSize-e.digestSize),o=new xe(e.multihashCode,e.digestSize,s,i);return[e.version===0?n.createV0(o):n.createV1(e.codec,o),t.subarray(e.size)]}static inspectBytes(t){let e=0,r=()=>{let[l,m]=Te(t.subarray(e));return e+=m,l},i=r(),s=Ne;if(i===18?(i=0,e=0):s=r(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=e,a=r(),f=r(),g=e+f,p=g-o;return{version:i,codec:s,multihashCode:a,digestSize:f,multihashSize:p,size:g}}static parse(t,e){let[r,i]=_u(t,e),s=n.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return rr(s).set(r,t),s}};function _u(n,t){switch(n[0]){case"Q":{let e=t??Mt;return[Mt.prefix,e.decode(`${Mt.prefix}${n}`)]}case Mt.prefix:{let e=t??Mt;return[Mt.prefix,e.decode(n)]}case Ht.prefix:{let e=t??Ht;return[Ht.prefix,e.decode(n)]}case je.prefix:{let e=t??je;return[je.prefix,e.decode(n)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[n[0],t.decode(n)]}}}function Su(n,t,e){let{prefix:r}=e;if(r!==Mt.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let i=t.get(r);if(i==null){let s=e.encode(n).slice(1);return t.set(r,s),s}else return i}function Pu(n,t,e){let{prefix:r}=e,i=t.get(r);if(i==null){let s=e.encode(n);return t.set(r,s),s}else return i}var Ne=112,Iu=18;function Fi(n,t,e){let r=be(n),i=r+be(t),s=new Uint8Array(i+e.byteLength);return Ee(n,s,0),Ee(t,s,r),s.set(e,i),s}var vu=Symbol.for("@ipld/js-cid/CID");var Le={...Qn,...Wn,...Jn,...zn,...Rn,...Hn,...qn,...Gn,...Kn,...Vn},_l={...nr,...Xn};function Ei(n,t,e,r){return{name:n,prefix:t,encoder:{name:n,prefix:t,encode:e},decoder:{decode:r}}}var Ci=Ei("utf8","u",n=>"u"+new TextDecoder("utf8").decode(n),n=>new TextEncoder().encode(n.substring(1))),ir=Ei("ascii","a",n=>{let t="a";for(let e=0;e<n.length;e++)t+=String.fromCharCode(n[e]);return t},n=>{n=n.substring(1);let t=Sn(n.length);for(let e=0;e<n.length;e++)t[e]=n.charCodeAt(e);return t}),ju={utf8:Ci,"utf-8":Ci,hex:Le.base16,latin1:ir,ascii:ir,binary:ir,...Le},Je=ju;function Ue(n,t="utf8"){let e=Je[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return t==="utf8"||t==="utf-8"?ge(bi.Buffer.from(n,"utf-8")):e.decoder.decode(`${e.prefix}${n}`)}var xi=J("node:buffer");function kt(n,t="utf8"){let e=Je[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return t==="utf8"||t==="utf-8"?xi.Buffer.from(n.buffer,n.byteOffset,n.byteLength).toString("utf8"):e.encoder.encode(n).substring(1)}var ht=class extends Error{static name="InvalidMultiaddrError";name="InvalidMultiaddrError"},Ut=class extends Error{static name="ValidationError";name="ValidationError"},Qe=class extends Error{static name="InvalidParametersError";name="InvalidParametersError"},Ze=class extends Error{static name="UnknownProtocolError";name="UnknownProtocolError"};var zt=J("node:net");function or(n){return t=>kt(t,n)}function ur(n){return t=>Ue(t,n)}function Ae(n){return new DataView(n.buffer).getUint16(n.byteOffset).toString()}function te(n){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,typeof n=="string"?parseInt(n):n),new Uint8Array(t)}function wi(n){let t=n.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let e=Ue(t[0],"base32"),r=parseInt(t[1],10);if(r<1||r>65536)throw new Error("Port number is not in range(1, 65536)");let i=te(r);return ve([e,i],e.length+i.length)}function yi(n){let t=n.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let e=Ht.decode(`b${t[0]}`),r=parseInt(t[1],10);if(r<1||r>65536)throw new Error("Port number is not in range(1, 65536)");let i=te(r);return ve([e,i],e.length+i.length)}function ar(n){let t=n.subarray(0,n.length-2),e=n.subarray(n.length-2),r=kt(t,"base32"),i=Ae(e);return`${r}:${i}`}var cr=function(n){n=n.toString().trim();let t=new Uint8Array(4);return n.split(/\./g).forEach((e,r)=>{let i=parseInt(e,10);if(isNaN(i)||i<0||i>255)throw new ht("Invalid byte value in IP address");t[r]=i}),t},Ai=function(n){let t=0;n=n.toString().trim();let e=n.split(":",8),r;for(r=0;r<e.length;r++){let s=(0,zt.isIPv4)(e[r]),o;s&&(o=cr(e[r]),e[r]=kt(o.subarray(0,2),"base16")),o!=null&&++r<8&&e.splice(r,0,kt(o.subarray(2,4),"base16"))}if(e[0]==="")for(;e.length<8;)e.unshift("0");else if(e[e.length-1]==="")for(;e.length<8;)e.push("0");else if(e.length<8){for(r=0;r<e.length&&e[r]!=="";r++);let s=[r,1];for(r=9-e.length;r>0;r--)s.push("0");e.splice.apply(e,s)}let i=new Uint8Array(t+16);for(r=0;r<e.length;r++){e[r]===""&&(e[r]="0");let s=parseInt(e[r],16);if(isNaN(s)||s<0||s>65535)throw new ht("Invalid byte value in IP address");i[t++]=s>>8&255,i[t++]=s&255}return i},Oi=function(n){if(n.byteLength!==4)throw new ht("IPv4 address was incorrect length");let t=[];for(let e=0;e<n.byteLength;e++)t.push(n[e]);return t.join(".")},Bi=function(n){if(n.byteLength!==16)throw new ht("IPv6 address was incorrect length");let t=[];for(let r=0;r<n.byteLength;r+=2){let i=n[r],s=n[r+1],o=`${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`;t.push(o)}let e=t.join(":");try{let r=new URL(`http://[${e}]`);return r.hostname.substring(1,r.hostname.length-1)}catch{throw new ht(`Invalid IPv6 address "${e}"`)}};function _i(n){try{let t=new URL(`http://[${n}]`);return t.hostname.substring(1,t.hostname.length-1)}catch{throw new ht(`Invalid IPv6 address "${n}"`)}}var sr=Object.values(Le).map(n=>n.decoder),Mu=(function(){let n=sr[0].or(sr[1]);return sr.slice(2).forEach(t=>n=n.or(t)),n})();function Si(n){return Mu.decode(n)}function Pi(n){return t=>n.encoder.encode(t)}function Tu(n){if(parseInt(n).toString()!==n)throw new Ut("Value must be an integer")}function $u(n){if(n<0)throw new Ut("Value must be a positive integer, or zero")}function Nu(n){return t=>{if(t>n)throw new Ut(`Value must be smaller than or equal to ${n}`)}}function Lu(...n){return t=>{for(let e of n)e(t)}}var ze=Lu(Tu,$u,Nu(65535));var ft=-1,lr=class{protocolsByCode=new Map;protocolsByName=new Map;getProtocol(t){let e;if(typeof t=="string"?e=this.protocolsByName.get(t):e=this.protocolsByCode.get(t),e==null)throw new Ze(`Protocol ${t} was unknown`);return e}addProtocol(t){this.protocolsByCode.set(t.code,t),this.protocolsByName.set(t.name,t),t.aliases?.forEach(e=>{this.protocolsByName.set(e,t)})}removeProtocol(t){let e=this.protocolsByCode.get(t);e!=null&&(this.protocolsByCode.delete(e.code),this.protocolsByName.delete(e.name),e.aliases?.forEach(r=>{this.protocolsByName.delete(r)}))}},Rt=new lr,Aa=[{code:4,name:"ip4",size:32,valueToBytes:cr,bytesToValue:Oi,validate:n=>{if(!(0,zt.isIPv4)(n))throw new Ut(`Invalid IPv4 address "${n}"`)}},{code:6,name:"tcp",size:16,valueToBytes:te,bytesToValue:Ae,validate:ze},{code:273,name:"udp",size:16,valueToBytes:te,bytesToValue:Ae,validate:ze},{code:33,name:"dccp",size:16,valueToBytes:te,bytesToValue:Ae,validate:ze},{code:41,name:"ip6",size:128,valueToBytes:Ai,bytesToValue:Bi,stringToValue:_i,validate:n=>{if(!(0,zt.isIPv6)(n))throw new Ut(`Invalid IPv6 address "${n}"`)}},{code:42,name:"ip6zone",size:ft},{code:43,name:"ipcidr",size:8,bytesToValue:or("base10"),valueToBytes:ur("base10")},{code:53,name:"dns",size:ft},{code:54,name:"dns4",size:ft},{code:55,name:"dns6",size:ft},{code:56,name:"dnsaddr",size:ft},{code:132,name:"sctp",size:16,valueToBytes:te,bytesToValue:Ae,validate:ze},{code:301,name:"udt"},{code:302,name:"utp"},{code:400,name:"unix",size:ft,stringToValue:n=>decodeURIComponent(n),valueToString:n=>encodeURIComponent(n)},{code:421,name:"p2p",aliases:["ipfs"],size:ft,bytesToValue:or("base58btc"),valueToBytes:n=>n.startsWith("Q")||n.startsWith("1")?ur("base58btc")(n):ye.parse(n).multihash.bytes},{code:444,name:"onion",size:96,bytesToValue:ar,valueToBytes:wi},{code:445,name:"onion3",size:296,bytesToValue:ar,valueToBytes:yi},{code:446,name:"garlic64",size:ft},{code:447,name:"garlic32",size:ft},{code:448,name:"tls"},{code:449,name:"sni",size:ft},{code:454,name:"noise"},{code:460,name:"quic"},{code:461,name:"quic-v1"},{code:465,name:"webtransport"},{code:466,name:"certhash",size:ft,bytesToValue:Pi(Yn),valueToBytes:Si},{code:480,name:"http"},{code:481,name:"http-path",size:ft,stringToValue:n=>`/${decodeURIComponent(n)}`,valueToString:n=>encodeURIComponent(n.substring(1))},{code:443,name:"https"},{code:477,name:"ws"},{code:478,name:"wss"},{code:479,name:"p2p-websocket-star"},{code:277,name:"p2p-stardust"},{code:275,name:"p2p-webrtc-star"},{code:276,name:"p2p-webrtc-direct"},{code:280,name:"webrtc-direct"},{code:281,name:"webrtc"},{code:290,name:"p2p-circuit"},{code:777,name:"memory",size:ft}];Aa.forEach(n=>{Rt.addProtocol(n)});function Ii(n){let t=[],e=0;for(;e<n.length;){let r=Tn(n,e),i=Rt.getProtocol(r),s=Fe(r),o=Oa(i,n,e+s),a=0;o>0&&i.size===ft&&(a=Fe(o));let f=s+a+o,g={code:r,name:i.name,bytes:n.subarray(e,e+f)};if(o>0){let p=e+s+a,l=n.subarray(p,p+o);g.value=i.bytesToValue?.(l)??kt(l)}t.push(g),e+=f}return t}function vi(n){let t=0,e=[];for(let r of n){if(r.bytes==null){let i=Rt.getProtocol(r.code),s=Fe(r.code),o,a=0,f=0;r.value!=null&&(o=i.valueToBytes?.(r.value)??Ue(r.value),a=o.byteLength,i.size===ft&&(f=Fe(a)));let g=new Uint8Array(s+f+a),p=0;Mn(r.code,g,p),p+=s,o!=null&&(i.size===ft&&(Mn(a,g,p),p+=f),g.set(o,p)),r.bytes=g}e.push(r.bytes),t+=r.bytes.byteLength}return ve(e,t)}function ji(n){if(n.charAt(0)!=="/")throw new ht('String multiaddr must start with "/"');let t=[],e="protocol",r="",i="";for(let s=1;s<n.length;s++){let o=n.charAt(s);o!=="/"&&(e==="protocol"?i+=n.charAt(s):r+=n.charAt(s));let a=s===n.length-1;if(o==="/"||a){let f=Rt.getProtocol(i);if(e==="protocol"){if(f.size==null||f.size===0){t.push({code:f.code,name:f.name}),r="",i="",e="protocol";continue}else if(a)throw new ht(`Component ${i} was missing value`);e="value"}else if(e==="value"){let g={code:f.code,name:f.name};if(f.size!=null&&f.size!==0){if(r==="")throw new ht(`Component ${i} was missing value`);g.value=f.stringToValue?.(r)??r}t.push(g),r="",i="",e="protocol"}}}if(i!==""&&r!=="")throw new ht("Incomplete multiaddr");return t}function Mi(n){return`/${n.flatMap(t=>{if(t.value==null)return t.name;let e=Rt.getProtocol(t.code);if(e==null)throw new ht(`Unknown protocol code ${t.code}`);return[t.name,e.valueToString?.(t.value)??t.value]}).join("/")}`}function Oa(n,t,e){return n.size==null||n.size===0?0:n.size>0?n.size/8:Tn(t,e)}var Ba=Symbol.for("nodejs.util.inspect.custom"),fr=Symbol.for("@multiformats/multiaddr");function _a(n){if(n==null&&(n="/"),Ti(n))return n.getComponents();if(n instanceof Uint8Array)return Ii(n);if(typeof n=="string")return n=n.replace(/\/(\/)+/,"/").replace(/(\/)+$/,""),n===""&&(n="/"),ji(n);if(Array.isArray(n))return n;throw new ht("Must be a string, Uint8Array, Component[], or another Multiaddr")}var Xe=class n{[fr]=!0;#t;#e;#n;constructor(t="/",e={}){this.#t=_a(t),e.validate!==!1&&Sa(this)}get bytes(){return this.#n==null&&(this.#n=vi(this.#t)),this.#n}toString(){return this.#e==null&&(this.#e=Mi(this.#t)),this.#e}toJSON(){return this.toString()}getComponents(){return[...this.#t.map(t=>({...t}))]}encapsulate(t){let e=new n(t);return new n([...this.#t,...e.getComponents()],{validate:!1})}decapsulate(t){let e=t.toString(),r=this.toString(),i=r.lastIndexOf(e);if(i<0)throw new Qe(`Address ${this.toString()} does not contain subaddress: ${e}`);return new n(r.slice(0,i),{validate:!1})}decapsulateCode(t){let e;for(let r=this.#t.length-1;r>-1;r--)if(this.#t[r].code===t){e=r;break}return new n(this.#t.slice(0,e),{validate:!1})}equals(t){return Zr(this.bytes,t.bytes)}[Ba](){return`Multiaddr(${this.toString()})`}};function Sa(n){n.getComponents().forEach(t=>{let e=Rt.getProtocol(t.code);t.value!=null&&e.validate?.(t.value)})}function Ti(n){return!!n?.[fr]}function $i(n){return new Xe(n)}var Ni=J("module"),hr=me(J("path"),1),Dr=me(J("process"),1),Li=J("url");function Pa(n){let t=hr.default.extname(n);return t?n.slice(0,-t.length):n}function dr(n){if(!n)return!1;if("main"in n)return!!n.main;if(!Dr.default.argv[1])return!1;let e=(0,Ni.createRequire)(n.url).resolve(Dr.default.argv[1]),r=(0,Li.fileURLToPath)(n.url);return hr.default.extname(e)?r===e:Pa(r)===e}var Dn=J("assert");var Ia={right:$a,center:Na},va=0,ke=1,ja=2,tn=3,pr=class{constructor(t){var e;this.width=t.width,this.wrap=(e=t.wrap)!==null&&e!==void 0?e:!0,this.rows=[]}span(...t){let e=this.div(...t);e.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let e=t.map(r=>typeof r=="string"?this.colFromString(r):r);return this.rows.push(e),e}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let e=t.split(`
4
+ `).map(i=>i.split(" ")),r=0;return e.forEach(i=>{i.length>1&&Et.stringWidth(i[0])>r&&(r=Math.min(Math.floor(this.width*.5),Et.stringWidth(i[0])))}),e.forEach(i=>{this.div(...i.map((s,o)=>({text:s.trim(),padding:this.measurePadding(s),width:o===0&&i.length>1?r:void 0})))}),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){let e=Et.stripAnsi(t);return[0,e.match(/\s*$/)[0].length,0,e.match(/^\s*/)[0].length]}toString(){let t=[];return this.rows.forEach(e=>{this.rowToString(e,t)}),t.filter(e=>!e.hidden).map(e=>e.text).join(`
5
+ `)}rowToString(t,e){return this.rasterize(t).forEach((r,i)=>{let s="";r.forEach((o,a)=>{let{width:f}=t[a],g=this.negatePadding(t[a]),p=o;if(g>Et.stringWidth(o)&&(p+=" ".repeat(g-Et.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap){let m=Ia[t[a].align];p=m(p,g),Et.stringWidth(p)<g&&(p+=" ".repeat((f||0)-Et.stringWidth(p)-1))}let l=t[a].padding||[0,0,0,0];l[tn]&&(s+=" ".repeat(l[tn])),s+=Ui(t[a],p,"| "),s+=p,s+=Ui(t[a],p," |"),l[ke]&&(s+=" ".repeat(l[ke])),i===0&&e.length>0&&(s=this.renderInline(s,e[e.length-1]))}),e.push({text:s.replace(/ +$/,""),span:t.span})}),e}renderInline(t,e){let r=t.match(/^ */),i=r?r[0].length:0,s=e.text,o=Et.stringWidth(s.trimRight());return e.span?this.wrap?i<o?t:(e.hidden=!0,s.trimRight()+" ".repeat(i-o)+t.trimLeft()):(e.hidden=!0,s+t):t}rasterize(t){let e=[],r=this.columnWidths(t),i;return t.forEach((s,o)=>{s.width=r[o],this.wrap?i=Et.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
6
6
  `):i=s.text.split(`
7
- `),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[wa]||0).fill("")),i.push(...new Array(s.padding[Ba]||0).fill(""))),i.forEach((a,f)=>{n[f]||n.push([]);let F=n[f];for(let p=0;p<o;p++)F[p]===void 0&&F.push("");F.push(a)})}),n}negatePadding(t){let n=t.width||0;return t.padding&&(n-=(t.padding[kt]||0)+(t.padding[Xt]||0)),t.border&&(n-=4),n}columnWidths(t){if(!this.wrap)return t.map(o=>o.width||Ee.stringWidth(o.text));let n=t.length,r=this.width,i=t.map(o=>{if(o.width)return n--,r-=o.width,o.width}),s=n?Math.floor(r/n):0;return i.map((o,a)=>o===void 0?Math.max(s,Oa(t[a])):o)}};function ji(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function Oa(e){let t=e.padding||[],n=1+(t[kt]||0)+(t[Xt]||0);return e.border?n+4:n}function _a(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Sa(e,t){e=e.trim();let n=Ee.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function Pa(e,t){e=e.trim();let n=Ee.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var Ee;function Mi(e,t){return Ee=t,new fr({width:e?.width||_a(),wrap:e?.wrap})}function Dr({onlyFirst:e=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,e?void 0:"g")}var va=Dr();function tt(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(va,"")}function Ti(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function $i(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Ni(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function Ia(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Li(e,{ambiguousAsWide:t=!1}={}){return Ia(e),$i(e)||Ni(e)||t&&Ti(e)?2:1}var Wi=mt(zi(),1),ja=new Intl.Segmenter,Ma=/^\p{Default_Ignorable_Code_Point}$/u;function Ie(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=tt(e)),e.length===0)return 0;let i=0,s={ambiguousAsWide:!n};for(let{segment:o}of ja.segment(e)){let a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!Ma.test(o)){if((0,Wi.default)().test(o)){i+=2;continue}i+=Li(a,s)}}return i}var Ri=(e=0)=>t=>`\x1B[${t+e}m`,Vi=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Hi=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,X={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Cf=Object.keys(X.modifier),Ta=Object.keys(X.color),$a=Object.keys(X.bgColor),Ef=[...Ta,...$a];function Na(){let e=new Map;for(let[t,n]of Object.entries(X)){for(let[r,i]of Object.entries(n))X[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[r]=X[r],e.set(i[0],i[1]);Object.defineProperty(X,t,{value:n,enumerable:!1})}return Object.defineProperty(X,"codes",{value:e,enumerable:!1}),X.color.close="\x1B[39m",X.bgColor.close="\x1B[49m",X.color.ansi=Ri(),X.color.ansi256=Vi(),X.color.ansi16m=Hi(),X.bgColor.ansi=Ri(10),X.bgColor.ansi256=Vi(10),X.bgColor.ansi16m=Hi(10),Object.defineProperties(X,{rgbToAnsi256:{value(t,n,r){return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(s=>s+s).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>X.rgbToAnsi256(...X.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,r,i;if(t>=232)n=((t-232)*10+8)/255,r=n,i=n;else{t-=16;let a=t%36;n=Math.floor(t/36)/5,r=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(n,r,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(n));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>X.ansi256ToAnsi(X.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>X.ansi256ToAnsi(X.hexToAnsi256(t)),enumerable:!1}}),X}var La=Na(),qi=La;var tn=new Set(["\x1B","\x9B"]),Ua=39,dr="\x07",Ki="[",za="]",Ji="m",en=`${za}8;;`,Gi=e=>`${tn.values().next().value}${Ki}${e}${Ji}`,Yi=e=>`${tn.values().next().value}${en}${e}${dr}`,Wa=e=>e.split(" ").map(t=>Ie(t)),hr=(e,t,n)=>{let r=[...t],i=!1,s=!1,o=Ie(tt(e.at(-1)));for(let[a,f]of r.entries()){let F=Ie(f);if(o+F<=n?e[e.length-1]+=f:(e.push(f),o=0),tn.has(f)&&(i=!0,s=r.slice(a+1,a+1+en.length).join("")===en),i){s?f===dr&&(i=!1,s=!1):f===Ji&&(i=!1);continue}o+=F,o===n&&a<r.length-1&&(e.push(""),o=0)}!o&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Ra=e=>{let t=e.split(" "),n=t.length;for(;n>0&&!(Ie(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},Va=(e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",i,s,o=Wa(e),a=[""];for(let[l,m]of e.split(" ").entries()){n.trim!==!1&&(a[a.length-1]=a.at(-1).trimStart());let E=Ie(a.at(-1));if(l!==0&&(E>=t&&(n.wordWrap===!1||n.trim===!1)&&(a.push(""),E=0),(E>0||n.trim===!1)&&(a[a.length-1]+=" ",E++)),n.hard&&o[l]>t){let C=t-E,b=1+Math.floor((o[l]-C-1)/t);Math.floor((o[l]-1)/t)<b&&a.push(""),hr(a,m,t);continue}if(E+o[l]>t&&E>0&&o[l]>0){if(n.wordWrap===!1&&E<t){hr(a,m,t);continue}a.push("")}if(E+o[l]>t&&n.wordWrap===!1){hr(a,m,t);continue}a[a.length-1]+=m}n.trim!==!1&&(a=a.map(l=>Ra(l)));let f=a.join(`
8
- `),F=[...f],p=0;for(let[l,m]of F.entries()){if(r+=m,tn.has(m)){let{groups:C}=new RegExp(`(?:\\${Ki}(?<code>\\d+)m|\\${en}(?<uri>.*)${dr})`).exec(f.slice(p))||{groups:{}};if(C.code!==void 0){let b=Number.parseFloat(C.code);i=b===Ua?void 0:b}else C.uri!==void 0&&(s=C.uri.length===0?void 0:C.uri)}let E=qi.codes.get(Number(i));F[l+1]===`
9
- `?(s&&(r+=Yi("")),i&&E&&(r+=Gi(E))):m===`
10
- `&&(i&&E&&(r+=Gi(i)),s&&(r+=Yi(s))),p+=m.length}return r};function pr(e,t,n){return String(e).normalize().replaceAll(`\r
7
+ `),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[va]||0).fill("")),i.push(...new Array(s.padding[ja]||0).fill(""))),i.forEach((a,f)=>{e[f]||e.push([]);let g=e[f];for(let p=0;p<o;p++)g[p]===void 0&&g.push("");g.push(a)})}),e}negatePadding(t){let e=t.width||0;return t.padding&&(e-=(t.padding[tn]||0)+(t.padding[ke]||0)),t.border&&(e-=4),e}columnWidths(t){if(!this.wrap)return t.map(o=>o.width||Et.stringWidth(o.text));let e=t.length,r=this.width,i=t.map(o=>{if(o.width)return e--,r-=o.width,o.width}),s=e?Math.floor(r/e):0;return i.map((o,a)=>o===void 0?Math.max(s,Ma(t[a])):o)}};function Ui(n,t,e){return n.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?e:" ":""}function Ma(n){let t=n.padding||[],e=1+(t[tn]||0)+(t[ke]||0);return n.border?e+4:e}function Ta(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function $a(n,t){n=n.trim();let e=Et.stringWidth(n);return e<t?" ".repeat(t-e)+n:n}function Na(n,t){n=n.trim();let e=Et.stringWidth(n);return e>=t?n:" ".repeat(t-e>>1)+n}var Et;function zi(n,t){return Et=t,new pr({width:n?.width||Ta(),wrap:n?.wrap})}function mr({onlyFirst:n=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,n?void 0:"g")}var La=mr();function ee(n){if(typeof n!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof n}\``);return!n.includes("\x1B")&&!n.includes("\x9B")?n:n.replace(La,"")}var en=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],nn=[12288,12288,65281,65376,65504,65510],gr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Fr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Re=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var rn=(n,t)=>{let e=0,r=Math.floor(n.length/2)-1;for(;e<=r;){let i=Math.floor((e+r)/2),s=i*2;if(t<n[s])r=i-1;else if(t>n[s+1])e=i+1;else return!0}return!1};var Ua=en[0],za=en.at(-1),Ra=nn[0],Wa=nn.at(-1),If=gr[0],vf=gr.at(-1),jf=Fr[0],Mf=Fr.at(-1),Va=Re[0],Ha=Re.at(-1),Ri=19968,[qa,Ga]=Ya(Re);function Ya(n){let t=n[0],e=n[1];for(let r=0;r<n.length;r+=2){let i=n[r],s=n[r+1];if(Ri>=i&&Ri<=s)return[i,s];s-i>e-t&&(t=i,e=s)}return[t,e]}var Wi=n=>n<Ua||n>za?!1:rn(en,n),Vi=n=>n<Ra||n>Wa?!1:rn(nn,n);var Hi=n=>n>=qa&&n<=Ga?!0:n<Va||n>Ha?!1:rn(Re,n);function Ka(n){if(!Number.isSafeInteger(n))throw new TypeError(`Expected a code point, got \`${typeof n}\`.`)}function qi(n,{ambiguousAsWide:t=!1}={}){return Ka(n),Vi(n)||Hi(n)||t&&Wi(n)?2:1}var Ki=me(Yi(),1),Ja=new Intl.Segmenter,Qa=/^\p{Default_Ignorable_Code_Point}$/u;function vt(n,t={}){if(typeof n!="string"||n.length===0)return 0;let{ambiguousIsNarrow:e=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(n=ee(n)),n.length===0)return 0;let i=0,s={ambiguousAsWide:!e};for(let{segment:o}of Ja.segment(n)){let a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!Qa.test(o)){if((0,Ki.default)().test(o)){i+=2;continue}i+=qi(a,s)}}return i}var Ji=(n=0)=>t=>`\x1B[${t+n}m`,Qi=(n=0)=>t=>`\x1B[${38+n};5;${t}m`,Zi=(n=0)=>(t,e,r)=>`\x1B[${38+n};2;${t};${e};${r}m`,X={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Vf=Object.keys(X.modifier),Za=Object.keys(X.color),Xa=Object.keys(X.bgColor),Hf=[...Za,...Xa];function ka(){let n=new Map;for(let[t,e]of Object.entries(X)){for(let[r,i]of Object.entries(e))X[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},e[r]=X[r],n.set(i[0],i[1]);Object.defineProperty(X,t,{value:e,enumerable:!1})}return Object.defineProperty(X,"codes",{value:n,enumerable:!1}),X.color.close="\x1B[39m",X.bgColor.close="\x1B[49m",X.color.ansi=Ji(),X.color.ansi256=Qi(),X.color.ansi16m=Zi(),X.bgColor.ansi=Ji(10),X.bgColor.ansi256=Qi(10),X.bgColor.ansi16m=Zi(10),Object.defineProperties(X,{rgbToAnsi256:{value(t,e,r){return t===e&&e===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!e)return[0,0,0];let[r]=e;r.length===3&&(r=[...r].map(s=>s+s).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>X.rgbToAnsi256(...X.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let e,r,i;if(t>=232)e=((t-232)*10+8)/255,r=e,i=e;else{t-=16;let a=t%36;e=Math.floor(t/36)/5,r=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(e,r,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(e));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,e,r)=>X.ansi256ToAnsi(X.rgbToAnsi256(t,e,r)),enumerable:!1},hexToAnsi:{value:t=>X.ansi256ToAnsi(X.hexToAnsi256(t)),enumerable:!1}}),X}var tc=ka(),Xi=tc;var on=new Set(["\x1B","\x9B"]),ec=39,Er="\x07",es="[",nc="]",ns="m",sn=`${nc}8;;`,ki=n=>`${on.values().next().value}${es}${n}${ns}`,ts=n=>`${on.values().next().value}${sn}${n}${Er}`,rc=n=>n.split(" ").map(t=>vt(t)),Cr=(n,t,e)=>{let r=[...t],i=!1,s=!1,o=vt(ee(n.at(-1)));for(let[a,f]of r.entries()){let g=vt(f);if(o+g<=e?n[n.length-1]+=f:(n.push(f),o=0),on.has(f)&&(i=!0,s=r.slice(a+1,a+1+sn.length).join("")===sn),i){s?f===Er&&(i=!1,s=!1):f===ns&&(i=!1);continue}o+=g,o===e&&a<r.length-1&&(n.push(""),o=0)}!o&&n.at(-1).length>0&&n.length>1&&(n[n.length-2]+=n.pop())},ic=n=>{let t=n.split(" "),e=t.length;for(;e>0&&!(vt(t[e-1])>0);)e--;return e===t.length?n:t.slice(0,e).join(" ")+t.slice(e).join("")},sc=(n,t,e={})=>{if(e.trim!==!1&&n.trim()==="")return"";let r="",i,s,o=rc(n),a=[""];for(let[l,m]of n.split(" ").entries()){e.trim!==!1&&(a[a.length-1]=a.at(-1).trimStart());let E=vt(a.at(-1));if(l!==0&&(E>=t&&(e.wordWrap===!1||e.trim===!1)&&(a.push(""),E=0),(E>0||e.trim===!1)&&(a[a.length-1]+=" ",E++)),e.hard&&o[l]>t){let C=t-E,b=1+Math.floor((o[l]-C-1)/t);Math.floor((o[l]-1)/t)<b&&a.push(""),Cr(a,m,t);continue}if(E+o[l]>t&&E>0&&o[l]>0){if(e.wordWrap===!1&&E<t){Cr(a,m,t);continue}a.push("")}if(E+o[l]>t&&e.wordWrap===!1){Cr(a,m,t);continue}a[a.length-1]+=m}e.trim!==!1&&(a=a.map(l=>ic(l)));let f=a.join(`
8
+ `),g=[...f],p=0;for(let[l,m]of g.entries()){if(r+=m,on.has(m)){let{groups:C}=new RegExp(`(?:\\${es}(?<code>\\d+)m|\\${sn}(?<uri>.*)${Er})`).exec(f.slice(p))||{groups:{}};if(C.code!==void 0){let b=Number.parseFloat(C.code);i=b===ec?void 0:b}else C.uri!==void 0&&(s=C.uri.length===0?void 0:C.uri)}let E=Xi.codes.get(Number(i));g[l+1]===`
9
+ `?(s&&(r+=ts("")),i&&E&&(r+=ki(E))):m===`
10
+ `&&(i&&E&&(r+=ki(i)),s&&(r+=ts(s))),p+=m.length}return r};function br(n,t,e){return String(n).normalize().replaceAll(`\r
11
11
  `,`
12
12
  `).split(`
13
- `).map(r=>Va(r,t,n)).join(`
14
- `)}function mr(e){return Mi(e,{stringWidth:Ie,stripAnsi:tt,wrap:pr})}var Bt=J("path"),nn=J("fs");function Qi(e,t){let n=(0,Bt.resolve)(".",e),r;for((0,nn.statSync)(n).isDirectory()||(n=(0,Bt.dirname)(n));;){if(r=t(n,(0,nn.readdirSync)(n)),r)return(0,Bt.resolve)(n,r);if(n=(0,Bt.dirname)(r=n),r===n)break}}var ds=J("util"),xr=J("url");var ns=J("util"),un=J("path");function nt(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let n="",r=!1,i=e.match(/^-+/);for(let s=i?i[0].length:0;s<e.length;s++){let o=e.charAt(s);r&&(r=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?r=!0:o!=="-"&&o!=="_"&&(n+=o)}return n}}function rn(e,t){let n=e.toLowerCase();t=t||"-";let r="";for(let i=0;i<e.length;i++){let s=n.charAt(i),o=e.charAt(i);s!==o&&i>0?r+=`${t}${n.charAt(i)}`:r+=o}return r}function sn(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function Zi(e){if(Array.isArray(e))return e.map(o=>typeof o!="string"?o+"":o);e=e.trim();let t=0,n=null,r=null,i=null,s=[];for(let o=0;o<e.length;o++){if(n=r,r=e.charAt(o),r===" "&&!i){n!==" "&&t++;continue}r===i?i=null:(r==="'"||r==='"')&&!i&&(i=r),s[t]||(s[t]=""),s[t]+=r}return s}var Be;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(Be||(Be={}));var Re,on=class{constructor(t){Re=t}parse(t,n){let r=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},n),i=Zi(t),s=typeof t=="string",o=Ha(Object.assign(Object.create(null),r.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},r.configuration),f=Object.assign(Object.create(null),r.default),F=r.configObjects||[],p=r.envPrefix,l=a["populate--"],m=l?"--":"_",E=Object.create(null),C=Object.create(null),b=r.__||Re.format,d={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},I=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,z=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach(function(c){let h=typeof c=="object"?c.key:c,y=Object.keys(c).map(function(g){return{boolean:"bools",string:"strings",number:"numbers"}[g]}).filter(Boolean).pop();y&&(d[y][h]=!0),d.arrays[h]=!0,d.keys.push(h)}),[].concat(r.boolean||[]).filter(Boolean).forEach(function(c){d.bools[c]=!0,d.keys.push(c)}),[].concat(r.string||[]).filter(Boolean).forEach(function(c){d.strings[c]=!0,d.keys.push(c)}),[].concat(r.number||[]).filter(Boolean).forEach(function(c){d.numbers[c]=!0,d.keys.push(c)}),[].concat(r.count||[]).filter(Boolean).forEach(function(c){d.counts[c]=!0,d.keys.push(c)}),[].concat(r.normalize||[]).filter(Boolean).forEach(function(c){d.normalize[c]=!0,d.keys.push(c)}),typeof r.narg=="object"&&Object.entries(r.narg).forEach(([c,h])=>{typeof h=="number"&&(d.nargs[c]=h,d.keys.push(c))}),typeof r.coerce=="object"&&Object.entries(r.coerce).forEach(([c,h])=>{typeof h=="function"&&(d.coercions[c]=h,d.keys.push(c))}),typeof r.config<"u"&&(Array.isArray(r.config)||typeof r.config=="string"?[].concat(r.config).filter(Boolean).forEach(function(c){d.configs[c]=!0}):typeof r.config=="object"&&Object.entries(r.config).forEach(([c,h])=>{(typeof h=="boolean"||typeof h=="function")&&(d.configs[c]=h)})),Xe(r.key,o,r.default,d.arrays),Object.keys(f).forEach(function(c){(d.aliases[c]||[]).forEach(function(h){f[h]=f[c]})});let L=null;qt();let U=[],W=Object.assign(Object.create(null),{_:[]}),R={};for(let c=0;c<i.length;c++){let h=i[c],y=h.replace(/^-{3,}/,"---"),g,D,_,x,v,le;if(h!=="--"&&/^-/.test(h)&&te(h))H(h);else if(y.match(/^---+(=|$)/)){H(h);continue}else if(h.match(/^--.+=/)||!a["short-option-groups"]&&h.match(/^-.+=/))x=h.match(/^--?([^=]+)=([\s\S]*)$/),x!==null&&Array.isArray(x)&&x.length>=3&&(T(x[1],d.arrays)?c=de(c,x[1],i,x[2]):T(x[1],d.nargs)!==!1?c=K(c,x[1],i,x[2]):Y(x[1],x[2],!0));else if(h.match(z)&&a["boolean-negation"])x=h.match(z),x!==null&&Array.isArray(x)&&x.length>=2&&(D=x[1],Y(D,T(D,d.arrays)?[!1]:!1));else if(h.match(/^--.+/)||!a["short-option-groups"]&&h.match(/^-[^-]+/))x=h.match(/^--?(.+)/),x!==null&&Array.isArray(x)&&x.length>=2&&(D=x[1],T(D,d.arrays)?c=de(c,D,i):T(D,d.nargs)!==!1?c=K(c,D,i):(v=i[c+1],v!==void 0&&(!v.match(/^-/)||v.match(I))&&!T(D,d.bools)&&!T(D,d.counts)||/^(true|false)$/.test(v)?(Y(D,v),c++):Y(D,ne(D))));else if(h.match(/^-.\..+=/))x=h.match(/^-([^=]+)=([\s\S]*)$/),x!==null&&Array.isArray(x)&&x.length>=3&&Y(x[1],x[2]);else if(h.match(/^-.\..+/)&&!h.match(I))v=i[c+1],x=h.match(/^-(.\..+)/),x!==null&&Array.isArray(x)&&x.length>=2&&(D=x[1],v!==void 0&&!v.match(/^-/)&&!T(D,d.bools)&&!T(D,d.counts)?(Y(D,v),c++):Y(D,ne(D)));else if(h.match(/^-[^-]+/)&&!h.match(I)){_=h.slice(1,-1).split(""),g=!1;for(let me=0;me<_.length;me++){if(v=h.slice(me+2),_[me+1]&&_[me+1]==="="){le=h.slice(me+3),D=_[me],T(D,d.arrays)?c=de(c,D,i,le):T(D,d.nargs)!==!1?c=K(c,D,i,le):Y(D,le),g=!0;break}if(v==="-"){Y(_[me],v);continue}if(/[A-Za-z]/.test(_[me])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(v)&&T(v,d.bools)===!1){Y(_[me],v),g=!0;break}if(_[me+1]&&_[me+1].match(/\W/)){Y(_[me],v),g=!0;break}else Y(_[me],ne(_[me]))}D=h.slice(-1)[0],!g&&D!=="-"&&(T(D,d.arrays)?c=de(c,D,i):T(D,d.nargs)!==!1?c=K(c,D,i):(v=i[c+1],v!==void 0&&(!/^(-|--)[^-]/.test(v)||v.match(I))&&!T(D,d.bools)&&!T(D,d.counts)||/^(true|false)$/.test(v)?(Y(D,v),c++):Y(D,ne(D))))}else if(h.match(/^-[0-9]$/)&&h.match(I)&&T(h.slice(1),d.bools))D=h.slice(1),Y(D,ne(D));else if(h==="--"){U=i.slice(c+1);break}else if(a["halt-at-non-option"]){U=i.slice(c);break}else H(h)}q(W,!0),q(W,!1),N(W),ae(),k(W,d.aliases,f,!0),ce(W),a["set-placeholder-key"]&&Ze(W),Object.keys(d.counts).forEach(function(c){Ne(W,c.split("."))||Y(c,0)}),l&&U.length&&(W[m]=[]),U.forEach(function(c){W[m].push(c)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(W).filter(c=>c!=="--"&&c.includes("-")).forEach(c=>{delete W[c]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(c=>o[c])).forEach(c=>{a["camel-case-expansion"]&&c.includes("-")&&delete W[c.split(".").map(h=>nt(h)).join(".")],delete W[c]});function H(c){let h=O("_",c);(typeof h=="string"||typeof h=="number")&&W._.push(h)}function K(c,h,y,g){let D,_=T(h,d.nargs);if(_=typeof _!="number"||isNaN(_)?1:_,_===0)return ve(g)||(L=Error(b("Argument unexpected for: %s",h))),Y(h,ne(h)),c;let x=ve(g)?0:1;if(a["nargs-eats-options"])y.length-(c+1)+x<_&&(L=Error(b("Not enough arguments following: %s",h))),x=_;else{for(D=c+1;D<y.length&&(!y[D].match(/^-[^0-9]/)||y[D].match(I)||te(y[D]));D++)x++;x<_&&(L=Error(b("Not enough arguments following: %s",h)))}let v=Math.min(x,_);for(!ve(g)&&v>0&&(Y(h,g),v--),D=c+1;D<v+c+1;D++)Y(h,y[D]);return c+v}function de(c,h,y,g){let D=[],_=g||y[c+1],x=T(h,d.nargs);if(T(h,d.bools)&&!/^(true|false)$/.test(_))D.push(!0);else if(ve(_)||ve(g)&&/^-/.test(_)&&!I.test(_)&&!te(_)){if(f[h]!==void 0){let v=f[h];D=Array.isArray(v)?v:[v]}}else{ve(g)||D.push(A(h,g,!0));for(let v=c+1;v<y.length&&!(!a["greedy-arrays"]&&D.length>0||x&&typeof x=="number"&&D.length>=x||(_=y[v],/^-/.test(_)&&!I.test(_)&&!te(_)));v++)c=v,D.push(A(h,_,s))}return typeof x=="number"&&(x&&D.length<x||isNaN(x)&&D.length===0)&&(L=Error(b("Not enough arguments following: %s",h))),Y(h,D),c}function Y(c,h,y=s){if(/-/.test(c)&&a["camel-case-expansion"]){let _=c.split(".").map(function(x){return nt(x)}).join(".");S(c,_)}let g=A(c,h,y),D=c.split(".");Le(W,D,g),d.aliases[c]&&d.aliases[c].forEach(function(_){let x=_.split(".");Le(W,x,g)}),D.length>1&&a["dot-notation"]&&(d.aliases[D[0]]||[]).forEach(function(_){let x=_.split("."),v=[].concat(D);v.shift(),x=x.concat(v),(d.aliases[c]||[]).includes(x.join("."))||Le(W,x,g)}),T(c,d.normalize)&&!T(c,d.arrays)&&[c].concat(d.aliases[c]||[]).forEach(function(x){Object.defineProperty(R,x,{enumerable:!0,get(){return h},set(v){h=typeof v=="string"?Re.normalize(v):v}})})}function S(c,h){d.aliases[c]&&d.aliases[c].length||(d.aliases[c]=[h],E[h]=!0),d.aliases[h]&&d.aliases[h].length||S(h,c)}function A(c,h,y){y&&(h=qa(h)),(T(c,d.bools)||T(c,d.counts))&&typeof h=="string"&&(h=h==="true");let g=Array.isArray(h)?h.map(function(D){return O(c,D)}):O(c,h);return T(c,d.counts)&&(ve(g)||typeof g=="boolean")&&(g=Fr()),T(c,d.normalize)&&T(c,d.arrays)&&(Array.isArray(h)?g=h.map(D=>Re.normalize(D)):g=Re.normalize(h)),g}function O(c,h){return!a["parse-positional-numbers"]&&c==="_"||!T(c,d.strings)&&!T(c,d.bools)&&!Array.isArray(h)&&(sn(h)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${h}`)))||!ve(h)&&T(c,d.numbers))&&(h=Number(h)),h}function N(c){let h=Object.create(null);k(h,d.aliases,f),Object.keys(d.configs).forEach(function(y){let g=c[y]||h[y];if(g)try{let D=null,_=Re.resolve(Re.cwd(),g),x=d.configs[y];if(typeof x=="function"){try{D=x(_)}catch(v){D=v}if(D instanceof Error){L=D;return}}else D=Re.require(_);G(D)}catch(D){D.name==="PermissionDenied"?L=D:c[y]&&(L=Error(b("Invalid JSON config file: %s",g)))}})}function G(c,h){Object.keys(c).forEach(function(y){let g=c[y],D=h?h+"."+y:y;typeof g=="object"&&g!==null&&!Array.isArray(g)&&a["dot-notation"]?G(g,D):(!Ne(W,D.split("."))||T(D,d.arrays)&&a["combine-arrays"])&&Y(D,g)})}function ae(){typeof F<"u"&&F.forEach(function(c){G(c)})}function q(c,h){if(typeof p>"u")return;let y=typeof p=="string"?p:"",g=Re.env();Object.keys(g).forEach(function(D){if(y===""||D.lastIndexOf(y,0)===0){let _=D.split("__").map(function(x,v){return v===0&&(x=x.substring(y.length)),nt(x)});(h&&d.configs[_.join(".")]||!h)&&!Ne(c,_)&&Y(_.join("."),g[D])}})}function ce(c){let h,y=new Set;Object.keys(c).forEach(function(g){if(!y.has(g)&&(h=T(g,d.coercions),typeof h=="function"))try{let D=O(g,h(c[g]));[].concat(d.aliases[g]||[],g).forEach(_=>{y.add(_),c[_]=D})}catch(D){L=D}})}function Ze(c){return d.keys.forEach(h=>{~h.indexOf(".")||typeof c[h]>"u"&&(c[h]=void 0)}),c}function k(c,h,y,g=!1){Object.keys(y).forEach(function(D){Ne(c,D.split("."))||(Le(c,D.split("."),y[D]),g&&(C[D]=!0),(h[D]||[]).forEach(function(_){Ne(c,_.split("."))||Le(c,_.split("."),y[D])}))})}function Ne(c,h){let y=c;a["dot-notation"]||(h=[h.join(".")]),h.slice(0,-1).forEach(function(D){y=y[D]||{}});let g=h[h.length-1];return typeof y!="object"?!1:g in y}function Le(c,h,y){let g=c;a["dot-notation"]||(h=[h.join(".")]),h.slice(0,-1).forEach(function(le){le=Xi(le),typeof g=="object"&&g[le]===void 0&&(g[le]={}),typeof g[le]!="object"||Array.isArray(g[le])?(Array.isArray(g[le])?g[le].push({}):g[le]=[g[le],{}],g=g[le][g[le].length-1]):g=g[le]});let D=Xi(h[h.length-1]),_=T(h.join("."),d.arrays),x=Array.isArray(y),v=a["duplicate-arguments-array"];!v&&T(D,d.nargs)&&(v=!0,(!ve(g[D])&&d.nargs[D]===1||Array.isArray(g[D])&&g[D].length===d.nargs[D])&&(g[D]=void 0)),y===Fr()?g[D]=Fr(g[D]):Array.isArray(g[D])?v&&_&&x?g[D]=a["flatten-duplicate-arrays"]?g[D].concat(y):(Array.isArray(g[D][0])?g[D]:[g[D]]).concat([y]):!v&&!!_==!!x?g[D]=y:g[D]=g[D].concat([y]):g[D]===void 0&&_?g[D]=x?y:[y]:v&&!(g[D]===void 0||T(D,d.counts)||T(D,d.bools))?g[D]=[g[D],y]:g[D]=y}function Xe(...c){c.forEach(function(h){Object.keys(h||{}).forEach(function(y){d.aliases[y]||(d.aliases[y]=[].concat(o[y]||[]),d.aliases[y].concat(y).forEach(function(g){if(/-/.test(g)&&a["camel-case-expansion"]){let D=nt(g);D!==y&&d.aliases[y].indexOf(D)===-1&&(d.aliases[y].push(D),E[D]=!0)}}),d.aliases[y].concat(y).forEach(function(g){if(g.length>1&&/[A-Z]/.test(g)&&a["camel-case-expansion"]){let D=rn(g,"-");D!==y&&d.aliases[y].indexOf(D)===-1&&(d.aliases[y].push(D),E[D]=!0)}}),d.aliases[y].forEach(function(g){d.aliases[g]=[y].concat(d.aliases[y].filter(function(D){return g!==D}))}))})})}function T(c,h){let y=[].concat(d.aliases[c]||[],c),g=Object.keys(h),D=y.find(_=>g.includes(_));return D?h[D]:!1}function An(c){let h=Object.keys(d);return[].concat(h.map(g=>d[g])).some(function(g){return Array.isArray(g)?g.includes(c):g[c]})}function j(c,...h){return[].concat(...h).some(function(g){let D=c.match(g);return D&&An(D[1])})}function Z(c){if(c.match(I)||!c.match(/^-[^-]+/))return!1;let h=!0,y,g=c.slice(1).split("");for(let D=0;D<g.length;D++){if(y=c.slice(D+2),!An(g[D])){h=!1;break}if(g[D+1]&&g[D+1]==="="||y==="-"||/[A-Za-z]/.test(g[D])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(y)||g[D+1]&&g[D+1].match(/\W/))break}return h}function te(c){return a["unknown-options-as-args"]&&V(c)}function V(c){return c=c.replace(/^-{3,}/,"--"),c.match(I)||Z(c)?!1:!j(c,/^-+([^=]+?)=[\s\S]*$/,z,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function ne(c){return!T(c,d.bools)&&!T(c,d.counts)&&`${c}`in f?f[c]:se(Pe(c))}function se(c){return{[Be.BOOLEAN]:!0,[Be.STRING]:"",[Be.NUMBER]:void 0,[Be.ARRAY]:[]}[c]}function Pe(c){let h=Be.BOOLEAN;return T(c,d.strings)?h=Be.STRING:T(c,d.numbers)?h=Be.NUMBER:T(c,d.bools)?h=Be.BOOLEAN:T(c,d.arrays)&&(h=Be.ARRAY),h}function ve(c){return c===void 0}function qt(){Object.keys(d.counts).find(c=>T(c,d.arrays)?(L=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",c)),!0):T(c,d.nargs)?(L=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",c)),!0):!1)}return{aliases:Object.assign({},d.aliases),argv:Object.assign(R,W),configuration:a,defaulted:Object.assign({},C),error:L,newAliases:Object.assign({},E)}}};function Ha(e){let t=[],n=Object.create(null),r=!0;for(Object.keys(e).forEach(function(i){t.push([].concat(e[i],i))});r;){r=!1;for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++)if(t[i].filter(function(a){return t[s].indexOf(a)!==-1}).length){t[i]=t[i].concat(t[s]),t.splice(s,1),r=!0;break}}return t.forEach(function(i){i=i.filter(function(o,a,f){return f.indexOf(o)===a});let s=i.pop();s!==void 0&&typeof s=="string"&&(n[s]=i)}),n}function Fr(e){return e!==void 0?e+1:1}function Xi(e){return e==="__proto__"?"___proto___":e}function qa(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}var rs=J("fs"),br=J("node:module"),Ya={};var gr,Cr,Er,ki=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20,es=(Cr=(gr=process==null?void 0:process.versions)===null||gr===void 0?void 0:gr.node)!==null&&Cr!==void 0?Cr:(Er=process==null?void 0:process.version)===null||Er===void 0?void 0:Er.slice(1);if(es&&Number(es.match(/^([^.]+)/)[1])<ki)throw Error(`yargs parser supports a minimum Node.js version of ${ki}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Ga=process?process.env:{},ts=br.createRequire?(0,br.createRequire)(Ya.url):void 0,is=new on({cwd:process.cwd,env:()=>Ga,format:ns.format,normalize:un.normalize,resolve:un.resolve,require:e=>{if(typeof ts<"u")return ts(e);if(e.match(/\.json$/))return JSON.parse((0,rs.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),Wt=function(t,n){return is.parse(t.slice(),n).argv};Wt.detailed=function(e,t){return is.parse(e.slice(),t)};Wt.camelCase=nt;Wt.decamelize=rn;Wt.looksLikeNumber=sn;var ss=Wt;var be=J("path");function Ka(){return Ja()?0:1}function Ja(){return Qa()&&!process.defaultApp}function Qa(){return!!process.versions.electron}function os(){return process.argv[Ka()]}var Ot=J("fs"),us=J("util"),as=J("path"),cs={fs:{readFileSync:Ot.readFileSync,writeFile:Ot.writeFile},format:us.format,resolve:as.resolve,exists:e=>{try{return(0,Ot.statSync)(e).isFile()}catch{return!1}}};var je,yr=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=t.shift(),r=function(){};return typeof t[t.length-1]=="function"&&(r=t.pop()),r=r||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r(),je.format.apply(je.format,[this.cache[this.locale][n]||n].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),n=t.shift(),r=t.shift(),i=t.shift(),s=function(){};typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?n:r;this.cache[this.locale][n]&&(o=this.cache[this.locale][n][i===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:r},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[o];return~o.indexOf("%d")&&a.push(i),je.format.apply(je.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this.cache[this.locale][n]=t[n])}_taggedLiteral(t,...n){let r="";return t.forEach(function(i,s){let o=n[s+1];r+=i,typeof o<"u"&&(r+="%s")}),this.__.apply(this,[r].concat([].slice.call(n,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,n=this.writeQueue[0],r=n.directory,i=n.locale,s=n.cb,o=this._resolveLocaleFile(r,i),a=JSON.stringify(this.cache[i],null,2);je.fs.writeFile(o,a,"utf-8",function(f){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(f)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{je.fs.readFileSync&&(t=JSON.parse(je.fs.readFileSync(n,"utf-8")))}catch(r){if(r instanceof SyntaxError&&(r.message="syntax error in "+n),r.code==="ENOENT")t={};else throw r}this.cache[this.locale]=t}_resolveLocaleFile(t,n){let r=je.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~n.lastIndexOf("_")){let i=je.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(i)&&(r=i)}return r}_fileExistsSync(t){return je.exists(t)}};function ls(e,t){je=t;let n=new yr(e);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var Za=e=>ls(e,cs),fs=Za;var ps=J("node:module"),ms=mt(hs(),1),cn=J("node:fs"),gs={},Ar=(0,xr.fileURLToPath)(gs.url),Xa=Ar.substring(0,Ar.lastIndexOf("node_modules")),ka=(0,ps.createRequire)(gs.url),Fs={assert:{notStrictEqual:an.notStrictEqual,strictEqual:an.strictEqual},cliui:mr,findUp:Qi,getEnv:e=>process.env[e],inspect:ds.inspect,getProcessArgvBin:os,mainFilename:Xa||process.cwd(),Parser:ss,path:{basename:be.basename,dirname:be.dirname,extname:be.extname,relative:be.relative,resolve:be.resolve,join:be.join},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:e=>{process.exit(e)},nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:cn.readFileSync,readdirSync:cn.readdirSync,require:ka,getCallerFile:()=>{let e=(0,ms.default)(3);return e.match(/^file:\/\//)?(0,xr.fileURLToPath)(e):e},stringWidth:Ie,y18n:fs({directory:(0,be.resolve)(Ar,"../../../locales"),updateFiles:!1})};function Fe(e,t,n,r){n.assert.notStrictEqual(e,t,r)}function wr(e,t){t.assert.strictEqual(typeof e,"string")}function _t(e){return Object.keys(e)}function Q(e){return!!e&&!!e.then&&typeof e.then=="function"}var oe=class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}};function qe(e){let n=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),r=/\.*[\][<>]/g,i=n.shift();if(!i)throw new Error(`No command found in: ${e}`);let s={cmd:i.replace(r,""),demanded:[],optional:[]};return n.forEach((o,a)=>{let f=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===n.length-1&&(f=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(r,"").split("|"),variadic:f}):s.demanded.push({cmd:o.replace(r,"").split("|"),variadic:f})}),s}var ec=["first","second","third","fourth","fifth","sixth"];function w(e,t,n){function r(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[qe(`cmd ${e}`),t,n]}try{let i=0,[s,o,a]=r(),f=[].slice.call(o);for(;f.length&&f[f.length-1]===void 0;)f.pop();let F=a||f.length;if(F<s.demanded.length)throw new oe(`Not enough arguments provided. Expected ${s.demanded.length} but received ${f.length}.`);let p=s.demanded.length+s.optional.length;if(F>p)throw new oe(`Too many arguments provided. Expected max ${p} but received ${F}.`);s.demanded.forEach(l=>{let m=f.shift(),E=Cs(m);l.cmd.filter(b=>b===E||b==="*").length===0&&Es(E,l.cmd,i),i+=1}),s.optional.forEach(l=>{if(f.length===0)return;let m=f.shift(),E=Cs(m);l.cmd.filter(b=>b===E||b==="*").length===0&&Es(E,l.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function Cs(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function Es(e,t,n){throw new oe(`Invalid ${ec[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var ln=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,r=!0,i=!1){if(w("<array|function> [boolean] [boolean] [boolean]",[t,n,r],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let o=t[s];o.applyBeforeValidation=n,o.global=r}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=n,s.global=r,s.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,n){let r=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...r[n]||[],n];return i.option?!s.includes(i.option):!0}),t.option=n,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function bs(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function rt(e,t,n,r){return n.reduce((i,s)=>{if(s.applyBeforeValidation!==r)return i;if(s.mutates){if(s.applied)return i;s.applied=!0}if(Q(i))return i.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(i,t);return Q(o)?o.then(a=>Object.assign(i,a)):Object.assign(i,o)}},e)}function it(e,t,n=r=>{throw r}){try{let r=tc(e)?e():e;return Q(r)?r.then(i=>t(i)):t(r)}catch(r){return n(r)}}function tc(e){return typeof e=="function"}var St=/(^\*)|(^\$0)/,Br=class{constructor(t,n,r,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=r,this.validation=n}addDirectory(t,n,r,i){i=i||{},this.requireCache.add(r);let s=this.shim.path.resolve(this.shim.path.dirname(r),t),o=this.shim.readdirSync(s,{recursive:!!i.recurse});Array.isArray(i.extensions)||(i.extensions=["js"]);let a=typeof i.visit=="function"?i.visit:f=>f;for(let f of o){let F=f.toString();if(i.exclude){let l=!1;if(typeof i.exclude=="function"?l=i.exclude(F):l=i.exclude.test(F),l)continue}if(i.include){let l=!1;if(typeof i.include=="function"?l=i.include(F):l=i.include.test(F),!l)continue}let p=!1;for(let l of i.extensions)F.endsWith(l)&&(p=!0);if(p){let l=this.shim.path.join(s,F),m=n(l),E=Object.create(null,Object.getOwnPropertyDescriptors({...m}));if(a(E,l,F)){if(this.requireCache.has(l))continue;this.requireCache.add(l),E.command||(E.command=this.shim.path.basename(l,this.shim.path.extname(l))),this.addHandler(E)}}}}addHandler(t,n,r,i,s,o){let a=[],f=bs(s);if(i=i||(()=>{}),Array.isArray(t))if(nc(t))[t,...a]=t;else for(let F of t)this.addHandler(F);else if(ic(t)){let F=Array.isArray(t.command)||typeof t.command=="string"?t.command:null;if(F===null)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);t.aliases&&(F=[].concat(F).concat(t.aliases)),this.addHandler(F,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(ys(r)){this.addHandler([t].concat(a),n,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof t=="string"){let F=qe(t);a=a.map(m=>qe(m).cmd);let p=!1,l=[F.cmd].concat(a).filter(m=>St.test(m)?(p=!0,!1):!0);l.length===0&&p&&l.push("$0"),p&&(F.cmd=l[0],a=l.slice(1),t=t.replace(St,F.cmd)),a.forEach(m=>{this.aliasMap[m]=F.cmd}),n!==!1&&this.usage.command(t,n,p,a,o),this.handlers[F.cmd]={original:t,description:n,handler:i,builder:r||{},middlewares:f,deprecated:o,demanded:F.demanded,optional:F.optional},p&&(this.defaultCommand=this.handlers[F.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,n,r,i,s,o){let a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,f=n.getInternalMethods().getContext(),F=f.commands.slice(),p=!t;t&&(f.commands.push(t),f.fullCommands.push(a.original));let l=this.applyBuilderUpdateUsageAndParse(p,a,n,r.aliases,F,i,s,o);return Q(l)?l.then(m=>this.applyMiddlewareAndGetResult(p,a,m.innerArgv,f,s,m.aliases,n)):this.applyMiddlewareAndGetResult(p,a,l.innerArgv,f,s,l.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,r,i,s,o,a,f){let F=n.builder,p=r;if(fn(F)){r.getInternalMethods().getUsageInstance().freeze();let l=F(r.getInternalMethods().reset(i),f);if(Q(l))return l.then(m=>(p=xs(m)?m:r,this.parseAndUpdateUsage(t,n,p,s,o,a)))}else rc(F)&&(r.getInternalMethods().getUsageInstance().freeze(),p=r.getInternalMethods().reset(i),Object.keys(n.builder).forEach(l=>{p.option(l,F[l])}));return this.parseAndUpdateUsage(t,n,p,s,o,a)}parseAndUpdateUsage(t,n,r,i,s,o){t&&r.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(r)&&r.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,n),n.description);let a=r.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return Q(a)?a.then(f=>({aliases:r.parsed.aliases,innerArgv:f})):{aliases:r.parsed.aliases,innerArgv:a}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,n){let r=St.test(n.original)?n.original.replace(St,"").trim():n.original,i=t.filter(s=>!St.test(s));return i.push(r),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,n,r,i,s,o,a,f){if(!o.getInternalMethods().getHasOutput()){let F=o.getInternalMethods().runValidation(s,f,o.parsed.error,t);r=it(r,p=>(F(p),p))}if(n.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();let F=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(r,F,!1,!1),r=rt(r,o,a,!1),r=it(r,p=>{let l=n.handler(p);return Q(l)?l.then(()=>p):p}),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),Q(r)&&!o.getInternalMethods().hasParseCallback()&&r.catch(p=>{try{o.getInternalMethods().getUsageInstance().fail(null,p)}catch{}})}return t||(i.commands.pop(),i.fullCommands.pop()),r}applyMiddlewareAndGetResult(t,n,r,i,s,o,a){let f={};if(s)return r;a.getInternalMethods().getHasOutput()||(f=this.populatePositionals(n,r,i,a));let F=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares),p=rt(r,a,F,!0);return Q(p)?p.then(l=>this.handleValidationAndGetResult(t,n,l,i,o,a,F,f)):this.handleValidationAndGetResult(t,n,p,i,o,a,F,f)}populatePositionals(t,n,r,i){n._=n._.slice(r.commands.length);let s=t.demanded.slice(0),o=t.optional.slice(0),a={};for(this.validation.positionalCount(s.length,n._.length);s.length;){let f=s.shift();this.populatePositional(f,n,a)}for(;o.length;){let f=o.shift();this.populatePositional(f,n,a)}return n._=r.commands.concat(n._.map(f=>""+f)),this.postProcessPositionals(n,a,this.cmdToParseOptions(t.original),i),a}populatePositional(t,n,r){let i=t.cmd[0];t.variadic?r[i]=n._.splice(0).map(String):n._.length&&(r[i]=[String(n._.shift())])}cmdToParseOptions(t){let n={array:[],default:{},alias:{},demand:{}},r=qe(t);return r.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o,n.demand[s]=!0}),r.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o}),n}postProcessPositionals(t,n,r,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(r.default,s.default);for(let F of Object.keys(r.alias))s.alias[F]=(s.alias[F]||[]).concat(r.alias[F]);s.array=s.array.concat(r.array),s.config={};let o=[];if(Object.keys(n).forEach(F=>{n[F].map(p=>{s.configuration["unknown-options-as-args"]&&(s.key[F]=!0),o.push(`--${F}`),o.push(p)})}),!o.length)return;let a=Object.assign({},s.configuration,{"populate--":!1}),f=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:a}));if(f.error)i.getInternalMethods().getUsageInstance().fail(f.error.message,f.error);else{let F=Object.keys(n);Object.keys(n).forEach(p=>{F.push(...f.aliases[p])}),Object.keys(f.argv).forEach(p=>{F.includes(p)&&(n[p]||(n[p]=f.argv[p]),!this.isInConfigs(i,p)&&!this.isDefaulted(i,p)&&Object.prototype.hasOwnProperty.call(t,p)&&Object.prototype.hasOwnProperty.call(f.argv,p)&&(Array.isArray(t[p])||Array.isArray(f.argv[p]))?t[p]=[].concat(t[p],f.argv[p]):t[p]=f.argv[p])})}}isDefaulted(t,n){let{default:r}=t.getOptions();return Object.prototype.hasOwnProperty.call(r,n)||Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(n))}isInConfigs(t,n){let{configObjects:r}=t.getOptions();return r.some(i=>Object.prototype.hasOwnProperty.call(i,n))||r.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(n)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let r=St.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(r,this.defaultCommand.description)}let n=this.defaultCommand.builder;if(fn(n))return n(t,!0);ys(n)||Object.keys(n).forEach(r=>{t.option(r,n[r])})}extractDesc({describe:t,description:n,desc:r}){for(let i of[t,n,r]){if(typeof i=="string"||i===!1)return i;Fe(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();Fe(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function As(e,t,n,r){return new Br(e,t,n,r)}function ys(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function nc(e){return e.every(t=>typeof t=="string")}function fn(e){return typeof e=="function"}function rc(e){return typeof e=="object"}function ic(e){return typeof e=="object"&&!Array.isArray(e)}function Ge(e={},t=()=>!0){let n={};return _t(e).forEach(r=>{t(r,e[r])&&(n[r]=e[r])}),n}function Ye(e){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(e)})}function sc(e){return typeof e=="boolean"}function Bs(e,t){let n=t.y18n.__,r={},i=[];r.failFn=function(A){i.push(A)};let s=null,o=null,a=!0;r.showHelpOnFail=function(A=!0,O){let[N,G]=typeof A=="string"?[!0,A]:[A,O];return e.getInternalMethods().isGlobalContext()&&(o=G),s=G,a=N,r};let f=!1;r.fail=function(A,O){let N=e.getInternalMethods().getLoggerInstance();if(i.length)for(let G=i.length-1;G>=0;--G){let ae=i[G];if(sc(ae)){if(O)throw O;if(A)throw Error(A)}else ae(A,O,r)}else{if(e.getExitProcess()&&Ye(!0),!f){f=!0,a&&(e.showHelp("error"),N.error()),(A||O)&&N.error(A||O);let G=s||o;G&&((A||O)&&N.error(""),N.error(G))}if(O=O||new oe(A),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,O);throw O}};let F=[],p=!1;r.usage=(S,A)=>S===null?(p=!0,F=[],r):(p=!1,F.push([S,A||""]),r),r.getUsage=()=>F,r.getUsageDisabled=()=>p,r.getPositionalGroupName=()=>n("Positionals:");let l=[];r.example=(S,A)=>{l.push([S,A||""])};let m=[];r.command=function(A,O,N,G,ae=!1){N&&(m=m.map(q=>(q[2]=!1,q))),m.push([A,O||"",N,G,ae])},r.getCommands=()=>m;let E={};r.describe=function(A,O){Array.isArray(A)?A.forEach(N=>{r.describe(N,O)}):typeof A=="object"?Object.keys(A).forEach(N=>{r.describe(N,A[N])}):E[A]=O},r.getDescriptions=()=>E;let C=[];r.epilog=S=>{C.push(S)};let b=!1,d;r.wrap=S=>{b=!0,d=S},r.getWrap=()=>t.getEnv("YARGS_DISABLE_WRAP")?null:(b||(d=K(),b=!0),d);let I="__yargsString__:";r.deferY18nLookup=S=>I+S,r.help=function(){if(U)return U;L();let A=e.customScriptName?e.$0:t.path.basename(e.$0),O=e.getDemandedOptions(),N=e.getDemandedCommands(),G=e.getDeprecatedOptions(),ae=e.getGroups(),q=e.getOptions(),ce=[];ce=ce.concat(Object.keys(E)),ce=ce.concat(Object.keys(O)),ce=ce.concat(Object.keys(N)),ce=ce.concat(Object.keys(q.default)),ce=ce.filter(R),ce=Object.keys(ce.reduce((j,Z)=>(Z!=="_"&&(j[Z]=!0),j),{}));let Ze=r.getWrap(),k=t.cliui({width:Ze,wrap:!!Ze});if(!p){if(F.length)F.forEach(j=>{k.div({text:`${j[0].replace(/\$0/g,A)}`}),j[1]&&k.div({text:`${j[1]}`,padding:[1,0,0,0]})}),k.div();else if(m.length){let j=null;N._?j=`${A} <${n("command")}>
15
- `:j=`${A} [${n("command")}]
16
- `,k.div(`${j}`)}}if(m.length>1||m.length===1&&!m[0][2]){k.div(n("Commands:"));let j=e.getInternalMethods().getContext(),Z=j.commands.length?`${j.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((V,ne)=>V[0].localeCompare(ne[0])));let te=A?`${A} `:"";m.forEach(V=>{let ne=`${te}${Z}${V[0].replace(/^\$0 ?/,"")}`;k.span({text:ne,padding:[0,2,0,2],width:z(m,Ze,`${A}${Z}`)+4},{text:V[1]});let se=[];V[2]&&se.push(`[${n("default")}]`),V[3]&&V[3].length&&se.push(`[${n("aliases:")} ${V[3].join(", ")}]`),V[4]&&(typeof V[4]=="string"?se.push(`[${n("deprecated: %s",V[4])}]`):se.push(`[${n("deprecated")}]`)),se.length?k.div({text:se.join(" "),padding:[0,0,0,2],align:"right"}):k.div()}),k.div()}let Ne=(Object.keys(q.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);ce=ce.filter(j=>!e.parsed.newAliases[j]&&Ne.every(Z=>(q.alias[Z]||[]).indexOf(j)===-1));let Le=n("Options:");ae[Le]||(ae[Le]=[]),W(ce,q.alias,ae,Le);let Xe=j=>/^--/.test(Dn(j)),T=Object.keys(ae).filter(j=>ae[j].length>0).map(j=>{let Z=ae[j].filter(R).map(te=>{if(Ne.includes(te))return te;for(let V=0,ne;(ne=Ne[V])!==void 0;V++)if((q.alias[ne]||[]).includes(te))return ne;return te});return{groupName:j,normalizedKeys:Z}}).filter(({normalizedKeys:j})=>j.length>0).map(({groupName:j,normalizedKeys:Z})=>{let te=Z.reduce((V,ne)=>(V[ne]=[ne].concat(q.alias[ne]||[]).map(se=>j===r.getPositionalGroupName()?se:(/^[0-9]$/.test(se)?q.boolean.includes(ne)?"-":"--":se.length>1?"--":"-")+se).sort((se,Pe)=>Xe(se)===Xe(Pe)?0:Xe(se)?1:-1).join(", "),V),{});return{groupName:j,normalizedKeys:Z,switches:te}});if(T.filter(({groupName:j})=>j!==r.getPositionalGroupName()).some(({normalizedKeys:j,switches:Z})=>!j.every(te=>Xe(Z[te])))&&T.filter(({groupName:j})=>j!==r.getPositionalGroupName()).forEach(({normalizedKeys:j,switches:Z})=>{j.forEach(te=>{Xe(Z[te])&&(Z[te]=oc(Z[te],4))})}),T.forEach(({groupName:j,normalizedKeys:Z,switches:te})=>{k.div(j),Z.forEach(V=>{let ne=te[V],se=E[V]||"",Pe=null;se.includes(I)&&(se=n(se.substring(I.length))),q.boolean.includes(V)&&(Pe=`[${n("boolean")}]`),q.count.includes(V)&&(Pe=`[${n("count")}]`),q.string.includes(V)&&(Pe=`[${n("string")}]`),q.normalize.includes(V)&&(Pe=`[${n("string")}]`),q.array.includes(V)&&(Pe=`[${n("array")}]`),q.number.includes(V)&&(Pe=`[${n("number")}]`);let ve=h=>typeof h=="string"?`[${n("deprecated: %s",h)}]`:`[${n("deprecated")}]`,qt=[V in G?ve(G[V]):null,Pe,V in O?`[${n("required")}]`:null,q.choices&&q.choices[V]?`[${n("choices:")} ${r.stringifiedValues(q.choices[V])}]`:null,H(q.default[V],q.defaultDescription[V])].filter(Boolean).join(" ");k.span({text:Dn(ne),padding:[0,2,0,2+ws(ne)],width:z(te,Ze)+4},se);let c=e.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;qt&&!c?k.div({text:qt,padding:[0,0,0,2],align:"right"}):k.div()}),k.div()}),l.length&&(k.div(n("Examples:")),l.forEach(j=>{j[0]=j[0].replace(/\$0/g,A)}),l.forEach(j=>{j[1]===""?k.div({text:j[0],padding:[0,2,0,2]}):k.div({text:j[0],padding:[0,2,0,2],width:z(l,Ze)+4},{text:j[1]})}),k.div()),C.length>0){let j=C.map(Z=>Z.replace(/\$0/g,A)).join(`
13
+ `).map(r=>sc(r,t,e)).join(`
14
+ `)}function xr(n){return zi(n,{stringWidth:vt,stripAnsi:ee,wrap:br})}var Oe=J("path"),un=J("fs");function rs(n,t){let e=(0,Oe.resolve)(".",n),r;for((0,un.statSync)(e).isDirectory()||(e=(0,Oe.dirname)(e));;){if(r=t(e,(0,un.readdirSync)(e)),r)return(0,Oe.resolve)(e,r);if(e=(0,Oe.dirname)(r=e),r===e)break}}var bs=J("util"),Pr=J("url");var cs=J("util"),fn=J("path");function ne(n){if(n!==n.toLowerCase()&&n!==n.toUpperCase()||(n=n.toLowerCase()),n.indexOf("-")===-1&&n.indexOf("_")===-1)return n;{let e="",r=!1,i=n.match(/^-+/);for(let s=i?i[0].length:0;s<n.length;s++){let o=n.charAt(s);r&&(r=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?r=!0:o!=="-"&&o!=="_"&&(e+=o)}return e}}function an(n,t){let e=n.toLowerCase();t=t||"-";let r="";for(let i=0;i<n.length;i++){let s=e.charAt(i),o=n.charAt(i);s!==o&&i>0?r+=`${t}${e.charAt(i)}`:r+=o}return r}function cn(n){return n==null?!1:typeof n=="number"||/^0x[0-9a-f]+$/i.test(n)?!0:/^0[^.]/.test(n)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(n)}function is(n){if(Array.isArray(n))return n.map(o=>typeof o!="string"?o+"":o);n=n.trim();let t=0,e=null,r=null,i=null,s=[];for(let o=0;o<n.length;o++){if(e=r,r=n.charAt(o),r===" "&&!i){e!==" "&&t++;continue}r===i?i=null:(r==="'"||r==='"')&&!i&&(i=r),s[t]||(s[t]=""),s[t]+=r}return s}var Ot;(function(n){n.BOOLEAN="boolean",n.STRING="string",n.NUMBER="number",n.ARRAY="array"})(Ot||(Ot={}));var Wt,ln=class{constructor(t){Wt=t}parse(t,e){let r=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},e),i=is(t),s=typeof t=="string",o=oc(Object.assign(Object.create(null),r.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},r.configuration),f=Object.assign(Object.create(null),r.default),g=r.configObjects||[],p=r.envPrefix,l=a["populate--"],m=l?"--":"_",E=Object.create(null),C=Object.create(null),b=r.__||Wt.format,d={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},v=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,z=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach(function(c){let h=typeof c=="object"?c.key:c,x=Object.keys(c).map(function(F){return{boolean:"bools",string:"strings",number:"numbers"}[F]}).filter(Boolean).pop();x&&(d[x][h]=!0),d.arrays[h]=!0,d.keys.push(h)}),[].concat(r.boolean||[]).filter(Boolean).forEach(function(c){d.bools[c]=!0,d.keys.push(c)}),[].concat(r.string||[]).filter(Boolean).forEach(function(c){d.strings[c]=!0,d.keys.push(c)}),[].concat(r.number||[]).filter(Boolean).forEach(function(c){d.numbers[c]=!0,d.keys.push(c)}),[].concat(r.count||[]).filter(Boolean).forEach(function(c){d.counts[c]=!0,d.keys.push(c)}),[].concat(r.normalize||[]).filter(Boolean).forEach(function(c){d.normalize[c]=!0,d.keys.push(c)}),typeof r.narg=="object"&&Object.entries(r.narg).forEach(([c,h])=>{typeof h=="number"&&(d.nargs[c]=h,d.keys.push(c))}),typeof r.coerce=="object"&&Object.entries(r.coerce).forEach(([c,h])=>{typeof h=="function"&&(d.coercions[c]=h,d.keys.push(c))}),typeof r.config<"u"&&(Array.isArray(r.config)||typeof r.config=="string"?[].concat(r.config).filter(Boolean).forEach(function(c){d.configs[c]=!0}):typeof r.config=="object"&&Object.entries(r.config).forEach(([c,h])=>{(typeof h=="boolean"||typeof h=="function")&&(d.configs[c]=h)})),Xt(r.key,o,r.default,d.arrays),Object.keys(f).forEach(function(c){(d.aliases[c]||[]).forEach(function(h){f[h]=f[c]})});let L=null;Ge();let U=[],R=Object.assign(Object.create(null),{_:[]}),W={};for(let c=0;c<i.length;c++){let h=i[c],x=h.replace(/^-{3,}/,"---"),F,D,_,y,I,lt;if(h!=="--"&&/^-/.test(h)&&et(h))H(h);else if(x.match(/^---+(=|$)/)){H(h);continue}else if(h.match(/^--.+=/)||!a["short-option-groups"]&&h.match(/^-.+=/))y=h.match(/^--?([^=]+)=([\s\S]*)$/),y!==null&&Array.isArray(y)&&y.length>=3&&(T(y[1],d.arrays)?c=dt(c,y[1],i,y[2]):T(y[1],d.nargs)!==!1?c=K(c,y[1],i,y[2]):Y(y[1],y[2],!0));else if(h.match(z)&&a["boolean-negation"])y=h.match(z),y!==null&&Array.isArray(y)&&y.length>=2&&(D=y[1],Y(D,T(D,d.arrays)?[!1]:!1));else if(h.match(/^--.+/)||!a["short-option-groups"]&&h.match(/^-[^-]+/))y=h.match(/^--?(.+)/),y!==null&&Array.isArray(y)&&y.length>=2&&(D=y[1],T(D,d.arrays)?c=dt(c,D,i):T(D,d.nargs)!==!1?c=K(c,D,i):(I=i[c+1],I!==void 0&&(!I.match(/^-/)||I.match(v))&&!T(D,d.bools)&&!T(D,d.counts)||/^(true|false)$/.test(I)?(Y(D,I),c++):Y(D,nt(D))));else if(h.match(/^-.\..+=/))y=h.match(/^-([^=]+)=([\s\S]*)$/),y!==null&&Array.isArray(y)&&y.length>=3&&Y(y[1],y[2]);else if(h.match(/^-.\..+/)&&!h.match(v))I=i[c+1],y=h.match(/^-(.\..+)/),y!==null&&Array.isArray(y)&&y.length>=2&&(D=y[1],I!==void 0&&!I.match(/^-/)&&!T(D,d.bools)&&!T(D,d.counts)?(Y(D,I),c++):Y(D,nt(D)));else if(h.match(/^-[^-]+/)&&!h.match(v)){_=h.slice(1,-1).split(""),F=!1;for(let mt=0;mt<_.length;mt++){if(I=h.slice(mt+2),_[mt+1]&&_[mt+1]==="="){lt=h.slice(mt+3),D=_[mt],T(D,d.arrays)?c=dt(c,D,i,lt):T(D,d.nargs)!==!1?c=K(c,D,i,lt):Y(D,lt),F=!0;break}if(I==="-"){Y(_[mt],I);continue}if(/[A-Za-z]/.test(_[mt])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(I)&&T(I,d.bools)===!1){Y(_[mt],I),F=!0;break}if(_[mt+1]&&_[mt+1].match(/\W/)){Y(_[mt],I),F=!0;break}else Y(_[mt],nt(_[mt]))}D=h.slice(-1)[0],!F&&D!=="-"&&(T(D,d.arrays)?c=dt(c,D,i):T(D,d.nargs)!==!1?c=K(c,D,i):(I=i[c+1],I!==void 0&&(!/^(-|--)[^-]/.test(I)||I.match(v))&&!T(D,d.bools)&&!T(D,d.counts)||/^(true|false)$/.test(I)?(Y(D,I),c++):Y(D,nt(D))))}else if(h.match(/^-[0-9]$/)&&h.match(v)&&T(h.slice(1),d.bools))D=h.slice(1),Y(D,nt(D));else if(h==="--"){U=i.slice(c+1);break}else if(a["halt-at-non-option"]){U=i.slice(c);break}else H(h)}q(R,!0),q(R,!1),N(R),at(),k(R,d.aliases,f,!0),ct(R),a["set-placeholder-key"]&&Zt(R),Object.keys(d.counts).forEach(function(c){Nt(R,c.split("."))||Y(c,0)}),l&&U.length&&(R[m]=[]),U.forEach(function(c){R[m].push(c)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(R).filter(c=>c!=="--"&&c.includes("-")).forEach(c=>{delete R[c]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(c=>o[c])).forEach(c=>{a["camel-case-expansion"]&&c.includes("-")&&delete R[c.split(".").map(h=>ne(h)).join(".")],delete R[c]});function H(c){let h=B("_",c);(typeof h=="string"||typeof h=="number")&&R._.push(h)}function K(c,h,x,F){let D,_=T(h,d.nargs);if(_=typeof _!="number"||isNaN(_)?1:_,_===0)return It(F)||(L=Error(b("Argument unexpected for: %s",h))),Y(h,nt(h)),c;let y=It(F)?0:1;if(a["nargs-eats-options"])x.length-(c+1)+y<_&&(L=Error(b("Not enough arguments following: %s",h))),y=_;else{for(D=c+1;D<x.length&&(!x[D].match(/^-[^0-9]/)||x[D].match(v)||et(x[D]));D++)y++;y<_&&(L=Error(b("Not enough arguments following: %s",h)))}let I=Math.min(y,_);for(!It(F)&&I>0&&(Y(h,F),I--),D=c+1;D<I+c+1;D++)Y(h,x[D]);return c+I}function dt(c,h,x,F){let D=[],_=F||x[c+1],y=T(h,d.nargs);if(T(h,d.bools)&&!/^(true|false)$/.test(_))D.push(!0);else if(It(_)||It(F)&&/^-/.test(_)&&!v.test(_)&&!et(_)){if(f[h]!==void 0){let I=f[h];D=Array.isArray(I)?I:[I]}}else{It(F)||D.push(w(h,F,!0));for(let I=c+1;I<x.length&&!(!a["greedy-arrays"]&&D.length>0||y&&typeof y=="number"&&D.length>=y||(_=x[I],/^-/.test(_)&&!v.test(_)&&!et(_)));I++)c=I,D.push(w(h,_,s))}return typeof y=="number"&&(y&&D.length<y||isNaN(y)&&D.length===0)&&(L=Error(b("Not enough arguments following: %s",h))),Y(h,D),c}function Y(c,h,x=s){if(/-/.test(c)&&a["camel-case-expansion"]){let _=c.split(".").map(function(y){return ne(y)}).join(".");S(c,_)}let F=w(c,h,x),D=c.split(".");Lt(R,D,F),d.aliases[c]&&d.aliases[c].forEach(function(_){let y=_.split(".");Lt(R,y,F)}),D.length>1&&a["dot-notation"]&&(d.aliases[D[0]]||[]).forEach(function(_){let y=_.split("."),I=[].concat(D);I.shift(),y=y.concat(I),(d.aliases[c]||[]).includes(y.join("."))||Lt(R,y,F)}),T(c,d.normalize)&&!T(c,d.arrays)&&[c].concat(d.aliases[c]||[]).forEach(function(y){Object.defineProperty(W,y,{enumerable:!0,get(){return h},set(I){h=typeof I=="string"?Wt.normalize(I):I}})})}function S(c,h){d.aliases[c]&&d.aliases[c].length||(d.aliases[c]=[h],E[h]=!0),d.aliases[h]&&d.aliases[h].length||S(h,c)}function w(c,h,x){x&&(h=uc(h)),(T(c,d.bools)||T(c,d.counts))&&typeof h=="string"&&(h=h==="true");let F=Array.isArray(h)?h.map(function(D){return B(c,D)}):B(c,h);return T(c,d.counts)&&(It(F)||typeof F=="boolean")&&(F=wr()),T(c,d.normalize)&&T(c,d.arrays)&&(Array.isArray(h)?F=h.map(D=>Wt.normalize(D)):F=Wt.normalize(h)),F}function B(c,h){return!a["parse-positional-numbers"]&&c==="_"||!T(c,d.strings)&&!T(c,d.bools)&&!Array.isArray(h)&&(cn(h)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${h}`)))||!It(h)&&T(c,d.numbers))&&(h=Number(h)),h}function N(c){let h=Object.create(null);k(h,d.aliases,f),Object.keys(d.configs).forEach(function(x){let F=c[x]||h[x];if(F)try{let D=null,_=Wt.resolve(Wt.cwd(),F),y=d.configs[x];if(typeof y=="function"){try{D=y(_)}catch(I){D=I}if(D instanceof Error){L=D;return}}else D=Wt.require(_);G(D)}catch(D){D.name==="PermissionDenied"?L=D:c[x]&&(L=Error(b("Invalid JSON config file: %s",F)))}})}function G(c,h){Object.keys(c).forEach(function(x){let F=c[x],D=h?h+"."+x:x;typeof F=="object"&&F!==null&&!Array.isArray(F)&&a["dot-notation"]?G(F,D):(!Nt(R,D.split("."))||T(D,d.arrays)&&a["combine-arrays"])&&Y(D,F)})}function at(){typeof g<"u"&&g.forEach(function(c){G(c)})}function q(c,h){if(typeof p>"u")return;let x=typeof p=="string"?p:"",F=Wt.env();Object.keys(F).forEach(function(D){if(x===""||D.lastIndexOf(x,0)===0){let _=D.split("__").map(function(y,I){return I===0&&(y=y.substring(x.length)),ne(y)});(h&&d.configs[_.join(".")]||!h)&&!Nt(c,_)&&Y(_.join("."),F[D])}})}function ct(c){let h,x=new Set;Object.keys(c).forEach(function(F){if(!x.has(F)&&(h=T(F,d.coercions),typeof h=="function"))try{let D=B(F,h(c[F]));[].concat(d.aliases[F]||[],F).forEach(_=>{x.add(_),c[_]=D})}catch(D){L=D}})}function Zt(c){return d.keys.forEach(h=>{~h.indexOf(".")||typeof c[h]>"u"&&(c[h]=void 0)}),c}function k(c,h,x,F=!1){Object.keys(x).forEach(function(D){Nt(c,D.split("."))||(Lt(c,D.split("."),x[D]),F&&(C[D]=!0),(h[D]||[]).forEach(function(_){Nt(c,_.split("."))||Lt(c,_.split("."),x[D])}))})}function Nt(c,h){let x=c;a["dot-notation"]||(h=[h.join(".")]),h.slice(0,-1).forEach(function(D){x=x[D]||{}});let F=h[h.length-1];return typeof x!="object"?!1:F in x}function Lt(c,h,x){let F=c;a["dot-notation"]||(h=[h.join(".")]),h.slice(0,-1).forEach(function(lt){lt=ss(lt),typeof F=="object"&&F[lt]===void 0&&(F[lt]={}),typeof F[lt]!="object"||Array.isArray(F[lt])?(Array.isArray(F[lt])?F[lt].push({}):F[lt]=[F[lt],{}],F=F[lt][F[lt].length-1]):F=F[lt]});let D=ss(h[h.length-1]),_=T(h.join("."),d.arrays),y=Array.isArray(x),I=a["duplicate-arguments-array"];!I&&T(D,d.nargs)&&(I=!0,(!It(F[D])&&d.nargs[D]===1||Array.isArray(F[D])&&F[D].length===d.nargs[D])&&(F[D]=void 0)),x===wr()?F[D]=wr(F[D]):Array.isArray(F[D])?I&&_&&y?F[D]=a["flatten-duplicate-arrays"]?F[D].concat(x):(Array.isArray(F[D][0])?F[D]:[F[D]]).concat([x]):!I&&!!_==!!y?F[D]=x:F[D]=F[D].concat([x]):F[D]===void 0&&_?F[D]=y?x:[x]:I&&!(F[D]===void 0||T(D,d.counts)||T(D,d.bools))?F[D]=[F[D],x]:F[D]=x}function Xt(...c){c.forEach(function(h){Object.keys(h||{}).forEach(function(x){d.aliases[x]||(d.aliases[x]=[].concat(o[x]||[]),d.aliases[x].concat(x).forEach(function(F){if(/-/.test(F)&&a["camel-case-expansion"]){let D=ne(F);D!==x&&d.aliases[x].indexOf(D)===-1&&(d.aliases[x].push(D),E[D]=!0)}}),d.aliases[x].concat(x).forEach(function(F){if(F.length>1&&/[A-Z]/.test(F)&&a["camel-case-expansion"]){let D=an(F,"-");D!==x&&d.aliases[x].indexOf(D)===-1&&(d.aliases[x].push(D),E[D]=!0)}}),d.aliases[x].forEach(function(F){d.aliases[F]=[x].concat(d.aliases[x].filter(function(D){return F!==D}))}))})})}function T(c,h){let x=[].concat(d.aliases[c]||[],c),F=Object.keys(h),D=x.find(_=>F.includes(_));return D?h[D]:!1}function Bn(c){let h=Object.keys(d);return[].concat(h.map(F=>d[F])).some(function(F){return Array.isArray(F)?F.includes(c):F[c]})}function j(c,...h){return[].concat(...h).some(function(F){let D=c.match(F);return D&&Bn(D[1])})}function Z(c){if(c.match(v)||!c.match(/^-[^-]+/))return!1;let h=!0,x,F=c.slice(1).split("");for(let D=0;D<F.length;D++){if(x=c.slice(D+2),!Bn(F[D])){h=!1;break}if(F[D+1]&&F[D+1]==="="||x==="-"||/[A-Za-z]/.test(F[D])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(x)||F[D+1]&&F[D+1].match(/\W/))break}return h}function et(c){return a["unknown-options-as-args"]&&V(c)}function V(c){return c=c.replace(/^-{3,}/,"--"),c.match(v)||Z(c)?!1:!j(c,/^-+([^=]+?)=[\s\S]*$/,z,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function nt(c){return!T(c,d.bools)&&!T(c,d.counts)&&`${c}`in f?f[c]:st(Pt(c))}function st(c){return{[Ot.BOOLEAN]:!0,[Ot.STRING]:"",[Ot.NUMBER]:void 0,[Ot.ARRAY]:[]}[c]}function Pt(c){let h=Ot.BOOLEAN;return T(c,d.strings)?h=Ot.STRING:T(c,d.numbers)?h=Ot.NUMBER:T(c,d.bools)?h=Ot.BOOLEAN:T(c,d.arrays)&&(h=Ot.ARRAY),h}function It(c){return c===void 0}function Ge(){Object.keys(d.counts).find(c=>T(c,d.arrays)?(L=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",c)),!0):T(c,d.nargs)?(L=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",c)),!0):!1)}return{aliases:Object.assign({},d.aliases),argv:Object.assign(W,R),configuration:a,defaulted:Object.assign({},C),error:L,newAliases:Object.assign({},E)}}};function oc(n){let t=[],e=Object.create(null),r=!0;for(Object.keys(n).forEach(function(i){t.push([].concat(n[i],i))});r;){r=!1;for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++)if(t[i].filter(function(a){return t[s].indexOf(a)!==-1}).length){t[i]=t[i].concat(t[s]),t.splice(s,1),r=!0;break}}return t.forEach(function(i){i=i.filter(function(o,a,f){return f.indexOf(o)===a});let s=i.pop();s!==void 0&&typeof s=="string"&&(e[s]=i)}),e}function wr(n){return n!==void 0?n+1:1}function ss(n){return n==="__proto__"?"___proto___":n}function uc(n){return typeof n=="string"&&(n[0]==="'"||n[0]==='"')&&n[n.length-1]===n[0]?n.substring(1,n.length-1):n}var ls=J("fs"),Br=J("node:module"),cc={};var yr,Ar,Or,os=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20,us=(Ar=(yr=process==null?void 0:process.versions)===null||yr===void 0?void 0:yr.node)!==null&&Ar!==void 0?Ar:(Or=process==null?void 0:process.version)===null||Or===void 0?void 0:Or.slice(1);if(us&&Number(us.match(/^([^.]+)/)[1])<os)throw Error(`yargs parser supports a minimum Node.js version of ${os}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var ac=process?process.env:{},as=Br.createRequire?(0,Br.createRequire)(cc.url):void 0,fs=new ln({cwd:process.cwd,env:()=>ac,format:cs.format,normalize:fn.normalize,resolve:fn.resolve,require:n=>{if(typeof as<"u")return as(n);if(n.match(/\.json$/))return JSON.parse((0,ls.readFileSync)(n,"utf8"));throw Error("only .json config files are supported in ESM")}}),We=function(t,e){return fs.parse(t.slice(),e).argv};We.detailed=function(n,t){return fs.parse(n.slice(),t)};We.camelCase=ne;We.decamelize=an;We.looksLikeNumber=cn;var Ds=We;var bt=J("path");function lc(){return fc()?0:1}function fc(){return Dc()&&!process.defaultApp}function Dc(){return!!process.versions.electron}function hs(){return process.argv[lc()]}var Be=J("fs"),ds=J("util"),ps=J("path"),ms={fs:{readFileSync:Be.readFileSync,writeFile:Be.writeFile},format:ds.format,resolve:ps.resolve,exists:n=>{try{return(0,Be.statSync)(n).isFile()}catch{return!1}}};var jt,_r=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let e=t.shift(),r=function(){};return typeof t[t.length-1]=="function"&&(r=t.pop()),r=r||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r(),jt.format.apply(jt.format,[this.cache[this.locale][e]||e].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),e=t.shift(),r=t.shift(),i=t.shift(),s=function(){};typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?e:r;this.cache[this.locale][e]&&(o=this.cache[this.locale][e][i===1?"one":"other"]),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:r},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[o];return~o.indexOf("%d")&&a.push(i),jt.format.apply(jt.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let r="";return t.forEach(function(i,s){let o=e[s+1];r+=i,typeof o<"u"&&(r+="%s")}),this.__.apply(this,[r].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,e=this.writeQueue[0],r=e.directory,i=e.locale,s=e.cb,o=this._resolveLocaleFile(r,i),a=JSON.stringify(this.cache[i],null,2);jt.fs.writeFile(o,a,"utf-8",function(f){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(f)})}_readLocaleFile(){let t={},e=this._resolveLocaleFile(this.directory,this.locale);try{jt.fs.readFileSync&&(t=JSON.parse(jt.fs.readFileSync(e,"utf-8")))}catch(r){if(r instanceof SyntaxError&&(r.message="syntax error in "+e),r.code==="ENOENT")t={};else throw r}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let r=jt.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~e.lastIndexOf("_")){let i=jt.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(i)&&(r=i)}return r}_fileExistsSync(t){return jt.exists(t)}};function gs(n,t){jt=t;let e=new _r(n);return{__:e.__.bind(e),__n:e.__n.bind(e),setLocale:e.setLocale.bind(e),getLocale:e.getLocale.bind(e),updateLocale:e.updateLocale.bind(e),locale:e.locale}}var hc=n=>gs(n,ms),Fs=hc;var xs=J("node:module"),ws=me(Es(),1),hn=J("node:fs"),As={},Sr=(0,Pr.fileURLToPath)(As.url),dc=Sr.substring(0,Sr.lastIndexOf("node_modules")),pc=(0,xs.createRequire)(As.url),ys={assert:{notStrictEqual:Dn.notStrictEqual,strictEqual:Dn.strictEqual},cliui:xr,findUp:rs,getEnv:n=>process.env[n],inspect:bs.inspect,getProcessArgvBin:hs,mainFilename:dc||process.cwd(),Parser:Ds,path:{basename:bt.basename,dirname:bt.dirname,extname:bt.extname,relative:bt.relative,resolve:bt.resolve,join:bt.join},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(n,t)=>process.emitWarning(n,t),execPath:()=>process.execPath,exit:n=>{process.exit(n)},nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:hn.readFileSync,readdirSync:hn.readdirSync,require:pc,getCallerFile:()=>{let n=(0,ws.default)(3);return n.match(/^file:\/\//)?(0,Pr.fileURLToPath)(n):n},stringWidth:vt,y18n:Fs({directory:(0,bt.resolve)(Sr,"../../../locales"),updateFiles:!1})};function gt(n,t,e,r){e.assert.notStrictEqual(n,t,r)}function Ir(n,t){t.assert.strictEqual(typeof n,"string")}function _e(n){return Object.keys(n)}function Q(n){return!!n&&!!n.then&&typeof n.then=="function"}var ot=class n extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,n)}};function qt(n){let e=n.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),r=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${n}`);let s={cmd:i.replace(r,""),demanded:[],optional:[]};return e.forEach((o,a)=>{let f=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===e.length-1&&(f=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(r,"").split("|"),variadic:f}):s.demanded.push({cmd:o.replace(r,"").split("|"),variadic:f})}),s}var mc=["first","second","third","fourth","fifth","sixth"];function A(n,t,e){function r(){return typeof n=="object"?[{demanded:[],optional:[]},n,t]:[qt(`cmd ${n}`),t,e]}try{let i=0,[s,o,a]=r(),f=[].slice.call(o);for(;f.length&&f[f.length-1]===void 0;)f.pop();let g=a||f.length;if(g<s.demanded.length)throw new ot(`Not enough arguments provided. Expected ${s.demanded.length} but received ${f.length}.`);let p=s.demanded.length+s.optional.length;if(g>p)throw new ot(`Too many arguments provided. Expected max ${p} but received ${g}.`);s.demanded.forEach(l=>{let m=f.shift(),E=Os(m);l.cmd.filter(b=>b===E||b==="*").length===0&&Bs(E,l.cmd,i),i+=1}),s.optional.forEach(l=>{if(f.length===0)return;let m=f.shift(),E=Os(m);l.cmd.filter(b=>b===E||b==="*").length===0&&Bs(E,l.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function Os(n){return Array.isArray(n)?"array":n===null?"null":typeof n}function Bs(n,t,e){throw new ot(`Invalid ${mc[e]||"manyith"} argument. Expected ${t.join(" or ")} but received ${n}.`)}var dn=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,r=!0,i=!1){if(A("<array|function> [boolean] [boolean] [boolean]",[t,e,r],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let o=t[s];o.applyBeforeValidation=e,o.global=r}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=e,s.global=r,s.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){let r=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...r[e]||[],e];return i.option?!s.includes(i.option):!0}),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function _s(n){return n?n.map(t=>(t.applyBeforeValidation=!1,t)):[]}function re(n,t,e,r){return e.reduce((i,s)=>{if(s.applyBeforeValidation!==r)return i;if(s.mutates){if(s.applied)return i;s.applied=!0}if(Q(i))return i.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(i,t);return Q(o)?o.then(a=>Object.assign(i,a)):Object.assign(i,o)}},n)}function ie(n,t,e=r=>{throw r}){try{let r=gc(n)?n():n;return Q(r)?r.then(i=>t(i)):t(r)}catch(r){return e(r)}}function gc(n){return typeof n=="function"}var Se=/(^\*)|(^\$0)/,vr=class{constructor(t,e,r,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=r,this.validation=e}addDirectory(t,e,r,i){i=i||{},this.requireCache.add(r);let s=this.shim.path.resolve(this.shim.path.dirname(r),t),o=this.shim.readdirSync(s,{recursive:!!i.recurse});Array.isArray(i.extensions)||(i.extensions=["js"]);let a=typeof i.visit=="function"?i.visit:f=>f;for(let f of o){let g=f.toString();if(i.exclude){let l=!1;if(typeof i.exclude=="function"?l=i.exclude(g):l=i.exclude.test(g),l)continue}if(i.include){let l=!1;if(typeof i.include=="function"?l=i.include(g):l=i.include.test(g),!l)continue}let p=!1;for(let l of i.extensions)g.endsWith(l)&&(p=!0);if(p){let l=this.shim.path.join(s,g),m=e(l),E=Object.create(null,Object.getOwnPropertyDescriptors({...m}));if(a(E,l,g)){if(this.requireCache.has(l))continue;this.requireCache.add(l),E.command||(E.command=this.shim.path.basename(l,this.shim.path.extname(l))),this.addHandler(E)}}}}addHandler(t,e,r,i,s,o){let a=[],f=_s(s);if(i=i||(()=>{}),Array.isArray(t))if(Fc(t))[t,...a]=t;else for(let g of t)this.addHandler(g);else if(Ec(t)){let g=Array.isArray(t.command)||typeof t.command=="string"?t.command:null;if(g===null)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);t.aliases&&(g=[].concat(g).concat(t.aliases)),this.addHandler(g,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(Ss(r)){this.addHandler([t].concat(a),e,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof t=="string"){let g=qt(t);a=a.map(m=>qt(m).cmd);let p=!1,l=[g.cmd].concat(a).filter(m=>Se.test(m)?(p=!0,!1):!0);l.length===0&&p&&l.push("$0"),p&&(g.cmd=l[0],a=l.slice(1),t=t.replace(Se,g.cmd)),a.forEach(m=>{this.aliasMap[m]=g.cmd}),e!==!1&&this.usage.command(t,e,p,a,o),this.handlers[g.cmd]={original:t,description:e,handler:i,builder:r||{},middlewares:f,deprecated:o,demanded:g.demanded,optional:g.optional},p&&(this.defaultCommand=this.handlers[g.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,r,i,s,o){let a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,f=e.getInternalMethods().getContext(),g=f.commands.slice(),p=!t;t&&(f.commands.push(t),f.fullCommands.push(a.original));let l=this.applyBuilderUpdateUsageAndParse(p,a,e,r.aliases,g,i,s,o);return Q(l)?l.then(m=>this.applyMiddlewareAndGetResult(p,a,m.innerArgv,f,s,m.aliases,e)):this.applyMiddlewareAndGetResult(p,a,l.innerArgv,f,s,l.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,r,i,s,o,a,f){let g=e.builder,p=r;if(pn(g)){r.getInternalMethods().getUsageInstance().freeze();let l=g(r.getInternalMethods().reset(i),f);if(Q(l))return l.then(m=>(p=Is(m)?m:r,this.parseAndUpdateUsage(t,e,p,s,o,a)))}else Cc(g)&&(r.getInternalMethods().getUsageInstance().freeze(),p=r.getInternalMethods().reset(i),Object.keys(e.builder).forEach(l=>{p.option(l,g[l])}));return this.parseAndUpdateUsage(t,e,p,s,o,a)}parseAndUpdateUsage(t,e,r,i,s,o){t&&r.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(r)&&r.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);let a=r.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return Q(a)?a.then(f=>({aliases:r.parsed.aliases,innerArgv:f})):{aliases:r.parsed.aliases,innerArgv:a}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,e){let r=Se.test(e.original)?e.original.replace(Se,"").trim():e.original,i=t.filter(s=>!Se.test(s));return i.push(r),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,e,r,i,s,o,a,f){if(!o.getInternalMethods().getHasOutput()){let g=o.getInternalMethods().runValidation(s,f,o.parsed.error,t);r=ie(r,p=>(g(p),p))}if(e.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();let g=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(r,g,!1,!1),r=re(r,o,a,!1),r=ie(r,p=>{let l=e.handler(p);return Q(l)?l.then(()=>p):p}),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),Q(r)&&!o.getInternalMethods().hasParseCallback()&&r.catch(p=>{try{o.getInternalMethods().getUsageInstance().fail(null,p)}catch{}})}return t||(i.commands.pop(),i.fullCommands.pop()),r}applyMiddlewareAndGetResult(t,e,r,i,s,o,a){let f={};if(s)return r;a.getInternalMethods().getHasOutput()||(f=this.populatePositionals(e,r,i,a));let g=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),p=re(r,a,g,!0);return Q(p)?p.then(l=>this.handleValidationAndGetResult(t,e,l,i,o,a,g,f)):this.handleValidationAndGetResult(t,e,p,i,o,a,g,f)}populatePositionals(t,e,r,i){e._=e._.slice(r.commands.length);let s=t.demanded.slice(0),o=t.optional.slice(0),a={};for(this.validation.positionalCount(s.length,e._.length);s.length;){let f=s.shift();this.populatePositional(f,e,a)}for(;o.length;){let f=o.shift();this.populatePositional(f,e,a)}return e._=r.commands.concat(e._.map(f=>""+f)),this.postProcessPositionals(e,a,this.cmdToParseOptions(t.original),i),a}populatePositional(t,e,r){let i=t.cmd[0];t.variadic?r[i]=e._.splice(0).map(String):e._.length&&(r[i]=[String(e._.shift())])}cmdToParseOptions(t){let e={array:[],default:{},alias:{},demand:{}},r=qt(t);return r.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=o,e.demand[s]=!0}),r.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=o}),e}postProcessPositionals(t,e,r,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(r.default,s.default);for(let g of Object.keys(r.alias))s.alias[g]=(s.alias[g]||[]).concat(r.alias[g]);s.array=s.array.concat(r.array),s.config={};let o=[];if(Object.keys(e).forEach(g=>{e[g].map(p=>{s.configuration["unknown-options-as-args"]&&(s.key[g]=!0),o.push(`--${g}`),o.push(p)})}),!o.length)return;let a=Object.assign({},s.configuration,{"populate--":!1}),f=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:a}));if(f.error)i.getInternalMethods().getUsageInstance().fail(f.error.message,f.error);else{let g=Object.keys(e);Object.keys(e).forEach(p=>{g.push(...f.aliases[p])}),Object.keys(f.argv).forEach(p=>{g.includes(p)&&(e[p]||(e[p]=f.argv[p]),!this.isInConfigs(i,p)&&!this.isDefaulted(i,p)&&Object.prototype.hasOwnProperty.call(t,p)&&Object.prototype.hasOwnProperty.call(f.argv,p)&&(Array.isArray(t[p])||Array.isArray(f.argv[p]))?t[p]=[].concat(t[p],f.argv[p]):t[p]=f.argv[p])})}}isDefaulted(t,e){let{default:r}=t.getOptions();return Object.prototype.hasOwnProperty.call(r,e)||Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(e))}isInConfigs(t,e){let{configObjects:r}=t.getOptions();return r.some(i=>Object.prototype.hasOwnProperty.call(i,e))||r.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(e)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let r=Se.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(r,this.defaultCommand.description)}let e=this.defaultCommand.builder;if(pn(e))return e(t,!0);Ss(e)||Object.keys(e).forEach(r=>{t.option(r,e[r])})}extractDesc({describe:t,description:e,desc:r}){for(let i of[t,e,r]){if(typeof i=="string"||i===!1)return i;gt(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();gt(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function Ps(n,t,e,r){return new vr(n,t,e,r)}function Ss(n){return typeof n=="object"&&!!n.builder&&typeof n.handler=="function"}function Fc(n){return n.every(t=>typeof t=="string")}function pn(n){return typeof n=="function"}function Cc(n){return typeof n=="object"}function Ec(n){return typeof n=="object"&&!Array.isArray(n)}function Gt(n={},t=()=>!0){let e={};return _e(n).forEach(r=>{t(r,n[r])&&(e[r]=n[r])}),e}function Yt(n){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{let e=t;e._handle&&e.isTTY&&typeof e._handle.setBlocking=="function"&&e._handle.setBlocking(n)})}function bc(n){return typeof n=="boolean"}function js(n,t){let e=t.y18n.__,r={},i=[];r.failFn=function(w){i.push(w)};let s=null,o=null,a=!0;r.showHelpOnFail=function(w=!0,B){let[N,G]=typeof w=="string"?[!0,w]:[w,B];return n.getInternalMethods().isGlobalContext()&&(o=G),s=G,a=N,r};let f=!1;r.fail=function(w,B){let N=n.getInternalMethods().getLoggerInstance();if(i.length)for(let G=i.length-1;G>=0;--G){let at=i[G];if(bc(at)){if(B)throw B;if(w)throw Error(w)}else at(w,B,r)}else{if(n.getExitProcess()&&Yt(!0),!f){f=!0,a&&(n.showHelp("error"),N.error()),(w||B)&&N.error(w||B);let G=s||o;G&&((w||B)&&N.error(""),N.error(G))}if(B=B||new ot(w),n.getExitProcess())return n.exit(1);if(n.getInternalMethods().hasParseCallback())return n.exit(1,B);throw B}};let g=[],p=!1;r.usage=(S,w)=>S===null?(p=!0,g=[],r):(p=!1,g.push([S,w||""]),r),r.getUsage=()=>g,r.getUsageDisabled=()=>p,r.getPositionalGroupName=()=>e("Positionals:");let l=[];r.example=(S,w)=>{l.push([S,w||""])};let m=[];r.command=function(w,B,N,G,at=!1){N&&(m=m.map(q=>(q[2]=!1,q))),m.push([w,B||"",N,G,at])},r.getCommands=()=>m;let E={};r.describe=function(w,B){Array.isArray(w)?w.forEach(N=>{r.describe(N,B)}):typeof w=="object"?Object.keys(w).forEach(N=>{r.describe(N,w[N])}):E[w]=B},r.getDescriptions=()=>E;let C=[];r.epilog=S=>{C.push(S)};let b=!1,d;r.wrap=S=>{b=!0,d=S},r.getWrap=()=>t.getEnv("YARGS_DISABLE_WRAP")?null:(b||(d=K(),b=!0),d);let v="__yargsString__:";r.deferY18nLookup=S=>v+S,r.help=function(){if(U)return U;L();let w=n.customScriptName?n.$0:t.path.basename(n.$0),B=n.getDemandedOptions(),N=n.getDemandedCommands(),G=n.getDeprecatedOptions(),at=n.getGroups(),q=n.getOptions(),ct=[];ct=ct.concat(Object.keys(E)),ct=ct.concat(Object.keys(B)),ct=ct.concat(Object.keys(N)),ct=ct.concat(Object.keys(q.default)),ct=ct.filter(W),ct=Object.keys(ct.reduce((j,Z)=>(Z!=="_"&&(j[Z]=!0),j),{}));let Zt=r.getWrap(),k=t.cliui({width:Zt,wrap:!!Zt});if(!p){if(g.length)g.forEach(j=>{k.div({text:`${j[0].replace(/\$0/g,w)}`}),j[1]&&k.div({text:`${j[1]}`,padding:[1,0,0,0]})}),k.div();else if(m.length){let j=null;N._?j=`${w} <${e("command")}>
15
+ `:j=`${w} [${e("command")}]
16
+ `,k.div(`${j}`)}}if(m.length>1||m.length===1&&!m[0][2]){k.div(e("Commands:"));let j=n.getInternalMethods().getContext(),Z=j.commands.length?`${j.commands.join(" ")} `:"";n.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((V,nt)=>V[0].localeCompare(nt[0])));let et=w?`${w} `:"";m.forEach(V=>{let nt=`${et}${Z}${V[0].replace(/^\$0 ?/,"")}`;k.span({text:nt,padding:[0,2,0,2],width:z(m,Zt,`${w}${Z}`)+4},{text:V[1]});let st=[];V[2]&&st.push(`[${e("default")}]`),V[3]&&V[3].length&&st.push(`[${e("aliases:")} ${V[3].join(", ")}]`),V[4]&&(typeof V[4]=="string"?st.push(`[${e("deprecated: %s",V[4])}]`):st.push(`[${e("deprecated")}]`)),st.length?k.div({text:st.join(" "),padding:[0,0,0,2],align:"right"}):k.div()}),k.div()}let Nt=(Object.keys(q.alias)||[]).concat(Object.keys(n.parsed.newAliases)||[]);ct=ct.filter(j=>!n.parsed.newAliases[j]&&Nt.every(Z=>(q.alias[Z]||[]).indexOf(j)===-1));let Lt=e("Options:");at[Lt]||(at[Lt]=[]),R(ct,q.alias,at,Lt);let Xt=j=>/^--/.test(mn(j)),T=Object.keys(at).filter(j=>at[j].length>0).map(j=>{let Z=at[j].filter(W).map(et=>{if(Nt.includes(et))return et;for(let V=0,nt;(nt=Nt[V])!==void 0;V++)if((q.alias[nt]||[]).includes(et))return nt;return et});return{groupName:j,normalizedKeys:Z}}).filter(({normalizedKeys:j})=>j.length>0).map(({groupName:j,normalizedKeys:Z})=>{let et=Z.reduce((V,nt)=>(V[nt]=[nt].concat(q.alias[nt]||[]).map(st=>j===r.getPositionalGroupName()?st:(/^[0-9]$/.test(st)?q.boolean.includes(nt)?"-":"--":st.length>1?"--":"-")+st).sort((st,Pt)=>Xt(st)===Xt(Pt)?0:Xt(st)?1:-1).join(", "),V),{});return{groupName:j,normalizedKeys:Z,switches:et}});if(T.filter(({groupName:j})=>j!==r.getPositionalGroupName()).some(({normalizedKeys:j,switches:Z})=>!j.every(et=>Xt(Z[et])))&&T.filter(({groupName:j})=>j!==r.getPositionalGroupName()).forEach(({normalizedKeys:j,switches:Z})=>{j.forEach(et=>{Xt(Z[et])&&(Z[et]=xc(Z[et],4))})}),T.forEach(({groupName:j,normalizedKeys:Z,switches:et})=>{k.div(j),Z.forEach(V=>{let nt=et[V],st=E[V]||"",Pt=null;st.includes(v)&&(st=e(st.substring(v.length))),q.boolean.includes(V)&&(Pt=`[${e("boolean")}]`),q.count.includes(V)&&(Pt=`[${e("count")}]`),q.string.includes(V)&&(Pt=`[${e("string")}]`),q.normalize.includes(V)&&(Pt=`[${e("string")}]`),q.array.includes(V)&&(Pt=`[${e("array")}]`),q.number.includes(V)&&(Pt=`[${e("number")}]`);let It=h=>typeof h=="string"?`[${e("deprecated: %s",h)}]`:`[${e("deprecated")}]`,Ge=[V in G?It(G[V]):null,Pt,V in B?`[${e("required")}]`:null,q.choices&&q.choices[V]?`[${e("choices:")} ${r.stringifiedValues(q.choices[V])}]`:null,H(q.default[V],q.defaultDescription[V])].filter(Boolean).join(" ");k.span({text:mn(nt),padding:[0,2,0,2+vs(nt)],width:z(et,Zt)+4},st);let c=n.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;Ge&&!c?k.div({text:Ge,padding:[0,0,0,2],align:"right"}):k.div()}),k.div()}),l.length&&(k.div(e("Examples:")),l.forEach(j=>{j[0]=j[0].replace(/\$0/g,w)}),l.forEach(j=>{j[1]===""?k.div({text:j[0],padding:[0,2,0,2]}):k.div({text:j[0],padding:[0,2,0,2],width:z(l,Zt)+4},{text:j[1]})}),k.div()),C.length>0){let j=C.map(Z=>Z.replace(/\$0/g,w)).join(`
17
17
  `);k.div(`${j}
18
- `)}return k.toString().replace(/\s*$/,"")};function z(S,A,O){let N=0;return Array.isArray(S)||(S=Object.values(S).map(G=>[G])),S.forEach(G=>{N=Math.max(t.stringWidth(O?`${O} ${Dn(G[0])}`:Dn(G[0]))+ws(G[0]),N)}),A&&(N=Math.min(N,parseInt((A*.5).toString(),10))),N}function L(){let S=e.getDemandedOptions(),A=e.getOptions();(Object.keys(A.alias)||[]).forEach(O=>{A.alias[O].forEach(N=>{E[N]&&r.describe(O,E[N]),N in S&&e.demandOption(O,S[N]),A.boolean.includes(N)&&e.boolean(O),A.count.includes(N)&&e.count(O),A.string.includes(N)&&e.string(O),A.normalize.includes(N)&&e.normalize(O),A.array.includes(N)&&e.array(O),A.number.includes(N)&&e.number(O)})})}let U;r.cacheHelpMessage=function(){U=this.help()},r.clearCachedHelpMessage=function(){U=void 0},r.hasCachedHelpMessage=function(){return!!U};function W(S,A,O,N){let G=[],ae=null;return Object.keys(O).forEach(q=>{G=G.concat(O[q])}),S.forEach(q=>{ae=[q].concat(A[q]),ae.some(ce=>G.indexOf(ce)!==-1)||O[N].push(q)}),G}function R(S){return e.getOptions().hiddenOptions.indexOf(S)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}r.showHelp=S=>{let A=e.getInternalMethods().getLoggerInstance();S||(S="error"),(typeof S=="function"?S:A[S])(r.help())},r.functionDescription=S=>["(",S.name?t.Parser.decamelize(S.name,"-"):n("generated-value"),")"].join(""),r.stringifiedValues=function(A,O){let N="",G=O||", ",ae=[].concat(A);return!A||!ae.length||ae.forEach(q=>{N.length&&(N+=G),N+=JSON.stringify(q)}),N};function H(S,A){let O=`[${n("default:")} `;if(S===void 0&&!A)return null;if(A)O+=A;else switch(typeof S){case"string":O+=`"${S}"`;break;case"object":O+=JSON.stringify(S);break;default:O+=S}return`${O}]`}function K(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let de=null;r.version=S=>{de=S},r.showVersion=S=>{let A=e.getInternalMethods().getLoggerInstance();S||(S="error"),(typeof S=="function"?S:A[S])(de)},r.reset=function(A){return s=null,f=!1,F=[],p=!1,C=[],l=[],m=[],E=Ge(E,O=>!A[O]),r};let Y=[];return r.freeze=function(){Y.push({failMessage:s,failureOutput:f,usages:F,usageDisabled:p,epilogs:C,examples:l,commands:m,descriptions:E})},r.unfreeze=function(A=!1){let O=Y.pop();O&&(A?(E={...O.descriptions,...E},m=[...O.commands,...m],F=[...O.usages,...F],l=[...O.examples,...l],C=[...O.epilogs,...C]):{failMessage:s,failureOutput:f,usages:F,usageDisabled:p,epilogs:C,examples:l,commands:m,descriptions:E}=O)},r}function Or(e){return typeof e=="object"}function oc(e,t){return Or(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function ws(e){return Or(e)?e.indentation:0}function Dn(e){return Or(e)?e.text:e}var Os=`###-begin-{{app_name}}-completions-###
18
+ `)}return k.toString().replace(/\s*$/,"")};function z(S,w,B){let N=0;return Array.isArray(S)||(S=Object.values(S).map(G=>[G])),S.forEach(G=>{N=Math.max(t.stringWidth(B?`${B} ${mn(G[0])}`:mn(G[0]))+vs(G[0]),N)}),w&&(N=Math.min(N,parseInt((w*.5).toString(),10))),N}function L(){let S=n.getDemandedOptions(),w=n.getOptions();(Object.keys(w.alias)||[]).forEach(B=>{w.alias[B].forEach(N=>{E[N]&&r.describe(B,E[N]),N in S&&n.demandOption(B,S[N]),w.boolean.includes(N)&&n.boolean(B),w.count.includes(N)&&n.count(B),w.string.includes(N)&&n.string(B),w.normalize.includes(N)&&n.normalize(B),w.array.includes(N)&&n.array(B),w.number.includes(N)&&n.number(B)})})}let U;r.cacheHelpMessage=function(){U=this.help()},r.clearCachedHelpMessage=function(){U=void 0},r.hasCachedHelpMessage=function(){return!!U};function R(S,w,B,N){let G=[],at=null;return Object.keys(B).forEach(q=>{G=G.concat(B[q])}),S.forEach(q=>{at=[q].concat(w[q]),at.some(ct=>G.indexOf(ct)!==-1)||B[N].push(q)}),G}function W(S){return n.getOptions().hiddenOptions.indexOf(S)<0||n.parsed.argv[n.getOptions().showHiddenOpt]}r.showHelp=S=>{let w=n.getInternalMethods().getLoggerInstance();S||(S="error"),(typeof S=="function"?S:w[S])(r.help())},r.functionDescription=S=>["(",S.name?t.Parser.decamelize(S.name,"-"):e("generated-value"),")"].join(""),r.stringifiedValues=function(w,B){let N="",G=B||", ",at=[].concat(w);return!w||!at.length||at.forEach(q=>{N.length&&(N+=G),N+=JSON.stringify(q)}),N};function H(S,w){let B=`[${e("default:")} `;if(S===void 0&&!w)return null;if(w)B+=w;else switch(typeof S){case"string":B+=`"${S}"`;break;case"object":B+=JSON.stringify(S);break;default:B+=S}return`${B}]`}function K(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let dt=null;r.version=S=>{dt=S},r.showVersion=S=>{let w=n.getInternalMethods().getLoggerInstance();S||(S="error"),(typeof S=="function"?S:w[S])(dt)},r.reset=function(w){return s=null,f=!1,g=[],p=!1,C=[],l=[],m=[],E=Gt(E,B=>!w[B]),r};let Y=[];return r.freeze=function(){Y.push({failMessage:s,failureOutput:f,usages:g,usageDisabled:p,epilogs:C,examples:l,commands:m,descriptions:E})},r.unfreeze=function(w=!1){let B=Y.pop();B&&(w?(E={...B.descriptions,...E},m=[...B.commands,...m],g=[...B.usages,...g],l=[...B.examples,...l],C=[...B.epilogs,...C]):{failMessage:s,failureOutput:f,usages:g,usageDisabled:p,epilogs:C,examples:l,commands:m,descriptions:E}=B)},r}function jr(n){return typeof n=="object"}function xc(n,t){return jr(n)?{text:n.text,indentation:n.indentation+t}:{text:n,indentation:t}}function vs(n){return jr(n)?n.indentation:0}function mn(n){return jr(n)?n.text:n}var Ms=`###-begin-{{app_name}}-completions-###
19
19
  #
20
20
  # yargs command completion script
21
21
  #
@@ -44,7 +44,7 @@ _{{app_name}}_yargs_completions()
44
44
  }
45
45
  complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
46
46
  ###-end-{{app_name}}-completions-###
47
- `,_s=`#compdef {{app_name}}
47
+ `,Ts=`#compdef {{app_name}}
48
48
  ###-begin-{{app_name}}-completions-###
49
49
  #
50
50
  # yargs command completion script
@@ -71,14 +71,14 @@ else
71
71
  compdef _{{app_name}}_yargs_completions {{app_name}}
72
72
  fi
73
73
  ###-end-{{app_name}}-completions-###
74
- `;var _r=class{constructor(t,n,r,i){var s,o,a;this.yargs=t,this.usage=n,this.command=r,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(t,n,r,i){let s=this.command.getCommandHandlers();for(let a=0,f=t.length;a<f;++a)if(s[t[a]]&&s[t[a]].builder){let F=s[t[a]].builder;if(fn(F)){this.indexAfterLastReset=a+1;let p=this.yargs.getInternalMethods().reset();return F(p,!0),p.argv}}let o=[];this.commandCompletions(o,t,r),this.optionCompletions(o,t,n,r),this.choicesFromOptionsCompletions(o,t,n,r),this.choicesFromPositionalsCompletions(o,t,n,r),i(null,o)}commandCompletions(t,n,r){let i=this.yargs.getInternalMethods().getContext().commands;!r.match(/^-/)&&i[i.length-1]!==r&&!this.previousArgHasChoices(n)&&this.usage.getCommands().forEach(s=>{let o=qe(s[0]).cmd;if(n.indexOf(o)===-1)if(!this.zshShell)t.push(o);else{let a=s[1]||"";t.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(t,n,r,i){if((i.match(/^-/)||i===""&&t.length===0)&&!this.previousArgHasChoices(n)){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{let f=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!s.hiddenOptions.includes(a)&&!this.argsContainKey(n,a,f)&&this.completeOptionKey(a,t,i,f&&!!s.default[a])})}}choicesFromOptionsCompletions(t,n,r,i){if(this.previousArgHasChoices(n)){let s=this.getPreviousArgChoices(n);s&&s.length>0&&t.push(...s.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(t,n,r,i){if(i===""&&t.length>0&&this.previousArgHasChoices(n))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=s[r._.length-o-1];if(!a)return;let f=this.yargs.getOptions().choices[a]||[];for(let F of f)F.startsWith(i)&&t.push(F.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let n=t[t.length-1],r="";if(!n.startsWith("-")&&t.length>1&&(r=n,n=t[t.length-2]),!n.startsWith("-"))return;let i=n.replace(/^-+/,""),s=this.yargs.getOptions(),o=[i,...this.yargs.getAliases()[i]||[]],a;for(let f of o)if(Object.prototype.hasOwnProperty.call(s.key,f)&&Array.isArray(s.choices[f])){a=s.choices[f];break}if(a)return a.filter(f=>!r||f.startsWith(r))}previousArgHasChoices(t){let n=this.getPreviousArgChoices(t);return n!==void 0&&n.length>0}argsContainKey(t,n,r){let i=s=>t.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(i(n)||r&&i(`no-${n}`))return!0;if(this.aliases){for(let s of this.aliases[n])if(i(s))return!0}return!1}completeOptionKey(t,n,r,i){var s,o,a,f;let F=t;if(this.zshShell){let E=this.usage.getDescriptions(),C=(o=(s=this===null||this===void 0?void 0:this.aliases)===null||s===void 0?void 0:s[t])===null||o===void 0?void 0:o.find(I=>{let z=E[I];return typeof z=="string"&&z.length>0}),b=C?E[C]:void 0,d=(f=(a=E[t])!==null&&a!==void 0?a:b)!==null&&f!==void 0?f:"";F=`${t.replace(/:/g,"\\:")}:${d.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let p=E=>/^--/.test(E),l=E=>/^[^0-9]$/.test(E),m=!p(r)&&l(t)?"-":"--";n.push(m+F),i&&n.push(m+"no-"+F)}customCompletion(t,n,r,i){if(Fe(this.customCompletionFunction,null,this.shim),ac(this.customCompletionFunction)){let s=this.customCompletionFunction(r,n);return Q(s)?s.then(o=>{this.shim.process.nextTick(()=>{i(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{i(o,void 0)})}):i(null,s)}else return cc(this.customCompletionFunction)?this.customCompletionFunction(r,n,(s=i)=>this.defaultCompletion(t,n,r,s),s=>{i(null,s)}):this.customCompletionFunction(r,n,s=>{i(null,s)})}getCompletion(t,n){let r=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),s=this.customCompletionFunction?o=>this.customCompletion(t,o,r,n):o=>this.defaultCompletion(t,o,r,n);return Q(i)?i.then(s):s(i)}generateCompletionScript(t,n){let r=this.zshShell?_s:Os,i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),r=r.replace(/{{app_name}}/g,i),r=r.replace(/{{completion_command}}/g,n),r.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}};function Ss(e,t,n,r){return new _r(e,t,n,r)}function ac(e){return e.length<3}function cc(e){return e.length>3}function Ps(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[],r;for(r=0;r<=t.length;r++)n[r]=[r];let i;for(i=0;i<=e.length;i++)n[0][i]=i;for(r=1;r<=t.length;r++)for(i=1;i<=e.length;i++)t.charAt(r-1)===e.charAt(i-1)?n[r][i]=n[r-1][i-1]:r>1&&i>1&&t.charAt(r-2)===e.charAt(i-1)&&t.charAt(r-1)===e.charAt(i-2)?n[r][i]=n[r-2][i-2]+1:n[r][i]=Math.min(n[r-1][i-1]+1,Math.min(n[r][i-1]+1,n[r-1][i]+1));return n[t.length][e.length]}var vs=["$0","--","_"];function Is(e,t,n){let r=n.y18n.__,i=n.y18n.__n,s={};s.nonOptionCount=function(l){let m=e.getDemandedCommands(),C=l._.length+(l["--"]?l["--"].length:0)-e.getInternalMethods().getContext().commands.length;m._&&(C<m._.min||C>m._.max)&&(C<m._.min?m._.minMsg!==void 0?t.fail(m._.minMsg?m._.minMsg.replace(/\$0/g,C.toString()).replace(/\$1/,m._.min.toString()):null):t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",C,C.toString(),m._.min.toString())):C>m._.max&&(m._.maxMsg!==void 0?t.fail(m._.maxMsg?m._.maxMsg.replace(/\$0/g,C.toString()).replace(/\$1/,m._.max.toString()):null):t.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",C,C.toString(),m._.max.toString()))))},s.positionalCount=function(l,m){m<l&&t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",m,m+"",l+""))},s.requiredArguments=function(l,m){let E=null;for(let C of Object.keys(m))(!Object.prototype.hasOwnProperty.call(l,C)||typeof l[C]>"u")&&(E=E||{},E[C]=m[C]);if(E){let C=[];for(let d of Object.keys(E)){let I=E[d];I&&C.indexOf(I)<0&&C.push(I)}let b=C.length?`
74
+ `;var Mr=class{constructor(t,e,r,i){var s,o,a;this.yargs=t,this.usage=e,this.command=r,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(t,e,r,i){let s=this.command.getCommandHandlers();for(let a=0,f=t.length;a<f;++a)if(s[t[a]]&&s[t[a]].builder){let g=s[t[a]].builder;if(pn(g)){this.indexAfterLastReset=a+1;let p=this.yargs.getInternalMethods().reset();return g(p,!0),p.argv}}let o=[];this.commandCompletions(o,t,r),this.optionCompletions(o,t,e,r),this.choicesFromOptionsCompletions(o,t,e,r),this.choicesFromPositionalsCompletions(o,t,e,r),i(null,o)}commandCompletions(t,e,r){let i=this.yargs.getInternalMethods().getContext().commands;!r.match(/^-/)&&i[i.length-1]!==r&&!this.previousArgHasChoices(e)&&this.usage.getCommands().forEach(s=>{let o=qt(s[0]).cmd;if(e.indexOf(o)===-1)if(!this.zshShell)t.push(o);else{let a=s[1]||"";t.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(t,e,r,i){if((i.match(/^-/)||i===""&&t.length===0)&&!this.previousArgHasChoices(e)){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{let f=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!s.hiddenOptions.includes(a)&&!this.argsContainKey(e,a,f)&&this.completeOptionKey(a,t,i,f&&!!s.default[a])})}}choicesFromOptionsCompletions(t,e,r,i){if(this.previousArgHasChoices(e)){let s=this.getPreviousArgChoices(e);s&&s.length>0&&t.push(...s.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(t,e,r,i){if(i===""&&t.length>0&&this.previousArgHasChoices(e))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=s[r._.length-o-1];if(!a)return;let f=this.yargs.getOptions().choices[a]||[];for(let g of f)g.startsWith(i)&&t.push(g.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],r="";if(!e.startsWith("-")&&t.length>1&&(r=e,e=t[t.length-2]),!e.startsWith("-"))return;let i=e.replace(/^-+/,""),s=this.yargs.getOptions(),o=[i,...this.yargs.getAliases()[i]||[]],a;for(let f of o)if(Object.prototype.hasOwnProperty.call(s.key,f)&&Array.isArray(s.choices[f])){a=s.choices[f];break}if(a)return a.filter(f=>!r||f.startsWith(r))}previousArgHasChoices(t){let e=this.getPreviousArgChoices(t);return e!==void 0&&e.length>0}argsContainKey(t,e,r){let i=s=>t.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(i(e)||r&&i(`no-${e}`))return!0;if(this.aliases){for(let s of this.aliases[e])if(i(s))return!0}return!1}completeOptionKey(t,e,r,i){var s,o,a,f;let g=t;if(this.zshShell){let E=this.usage.getDescriptions(),C=(o=(s=this===null||this===void 0?void 0:this.aliases)===null||s===void 0?void 0:s[t])===null||o===void 0?void 0:o.find(v=>{let z=E[v];return typeof z=="string"&&z.length>0}),b=C?E[C]:void 0,d=(f=(a=E[t])!==null&&a!==void 0?a:b)!==null&&f!==void 0?f:"";g=`${t.replace(/:/g,"\\:")}:${d.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let p=E=>/^--/.test(E),l=E=>/^[^0-9]$/.test(E),m=!p(r)&&l(t)?"-":"--";e.push(m+g),i&&e.push(m+"no-"+g)}customCompletion(t,e,r,i){if(gt(this.customCompletionFunction,null,this.shim),yc(this.customCompletionFunction)){let s=this.customCompletionFunction(r,e);return Q(s)?s.then(o=>{this.shim.process.nextTick(()=>{i(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{i(o,void 0)})}):i(null,s)}else return Ac(this.customCompletionFunction)?this.customCompletionFunction(r,e,(s=i)=>this.defaultCompletion(t,e,r,s),s=>{i(null,s)}):this.customCompletionFunction(r,e,s=>{i(null,s)})}getCompletion(t,e){let r=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),s=this.customCompletionFunction?o=>this.customCompletion(t,o,r,e):o=>this.defaultCompletion(t,o,r,e);return Q(i)?i.then(s):s(i)}generateCompletionScript(t,e){let r=this.zshShell?Ts:Ms,i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),r=r.replace(/{{app_name}}/g,i),r=r.replace(/{{completion_command}}/g,e),r.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}};function $s(n,t,e,r){return new Mr(n,t,e,r)}function yc(n){return n.length<3}function Ac(n){return n.length>3}function Ns(n,t){if(n.length===0)return t.length;if(t.length===0)return n.length;let e=[],r;for(r=0;r<=t.length;r++)e[r]=[r];let i;for(i=0;i<=n.length;i++)e[0][i]=i;for(r=1;r<=t.length;r++)for(i=1;i<=n.length;i++)t.charAt(r-1)===n.charAt(i-1)?e[r][i]=e[r-1][i-1]:r>1&&i>1&&t.charAt(r-2)===n.charAt(i-1)&&t.charAt(r-1)===n.charAt(i-2)?e[r][i]=e[r-2][i-2]+1:e[r][i]=Math.min(e[r-1][i-1]+1,Math.min(e[r][i-1]+1,e[r-1][i]+1));return e[t.length][n.length]}var Ls=["$0","--","_"];function Us(n,t,e){let r=e.y18n.__,i=e.y18n.__n,s={};s.nonOptionCount=function(l){let m=n.getDemandedCommands(),C=l._.length+(l["--"]?l["--"].length:0)-n.getInternalMethods().getContext().commands.length;m._&&(C<m._.min||C>m._.max)&&(C<m._.min?m._.minMsg!==void 0?t.fail(m._.minMsg?m._.minMsg.replace(/\$0/g,C.toString()).replace(/\$1/,m._.min.toString()):null):t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",C,C.toString(),m._.min.toString())):C>m._.max&&(m._.maxMsg!==void 0?t.fail(m._.maxMsg?m._.maxMsg.replace(/\$0/g,C.toString()).replace(/\$1/,m._.max.toString()):null):t.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",C,C.toString(),m._.max.toString()))))},s.positionalCount=function(l,m){m<l&&t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",m,m+"",l+""))},s.requiredArguments=function(l,m){let E=null;for(let C of Object.keys(m))(!Object.prototype.hasOwnProperty.call(l,C)||typeof l[C]>"u")&&(E=E||{},E[C]=m[C]);if(E){let C=[];for(let d of Object.keys(E)){let v=E[d];v&&C.indexOf(v)<0&&C.push(v)}let b=C.length?`
75
75
  ${C.join(`
76
- `)}`:"";t.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(E).length,Object.keys(E).join(", ")+b))}},s.unknownArguments=function(l,m,E,C,b=!0){var d;let I=e.getInternalMethods().getCommandInstance().getCommands(),z=[],L=e.getInternalMethods().getContext();if(Object.keys(l).forEach(U=>{!vs.includes(U)&&!Object.prototype.hasOwnProperty.call(E,U)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),U)&&!s.isValidAndSomeAliasIsNotNew(U,m)&&z.push(U)}),b&&(L.commands.length>0||I.length>0||C)&&l._.slice(L.commands.length).forEach(U=>{I.includes(""+U)||z.push(""+U)}),b){let W=((d=e.getDemandedCommands()._)===null||d===void 0?void 0:d.max)||0,R=L.commands.length+W;R<l._.length&&l._.slice(R).forEach(H=>{H=String(H),!L.commands.includes(H)&&!z.includes(H)&&z.push(H)})}z.length&&t.fail(i("Unknown argument: %s","Unknown arguments: %s",z.length,z.map(U=>U.trim()?U:`"${U}"`).join(", ")))},s.unknownCommands=function(l){let m=e.getInternalMethods().getCommandInstance().getCommands(),E=[],C=e.getInternalMethods().getContext();return(C.commands.length>0||m.length>0)&&l._.slice(C.commands.length).forEach(b=>{m.includes(""+b)||E.push(""+b)}),E.length>0?(t.fail(i("Unknown command: %s","Unknown commands: %s",E.length,E.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(l,m){if(!Object.prototype.hasOwnProperty.call(m,l))return!1;let E=e.parsed.newAliases;return[l,...m[l]].some(C=>!Object.prototype.hasOwnProperty.call(E,C)||!E[l])},s.limitedChoices=function(l){let m=e.getOptions(),E={};if(!Object.keys(m.choices).length)return;Object.keys(l).forEach(d=>{vs.indexOf(d)===-1&&Object.prototype.hasOwnProperty.call(m.choices,d)&&[].concat(l[d]).forEach(I=>{m.choices[d].indexOf(I)===-1&&I!==void 0&&(E[d]=(E[d]||[]).concat(I))})});let C=Object.keys(E);if(!C.length)return;let b=r("Invalid values:");C.forEach(d=>{b+=`
77
- ${r("Argument: %s, Given: %s, Choices: %s",d,t.stringifiedValues(E[d]),t.stringifiedValues(m.choices[d]))}`}),t.fail(b)};let o={};s.implies=function(l,m){w("<string|object> [array|number|string]",[l,m],arguments.length),typeof l=="object"?Object.keys(l).forEach(E=>{s.implies(E,l[E])}):(e.global(l),o[l]||(o[l]=[]),Array.isArray(m)?m.forEach(E=>s.implies(l,E)):(Fe(m,void 0,n),o[l].push(m)))},s.getImplied=function(){return o};function a(p,l){let m=Number(l);return l=isNaN(m)?l:m,typeof l=="number"?l=p._.length>=l:l.match(/^--no-.+/)?(l=l.match(/^--no-(.+)/)[1],l=!Object.prototype.hasOwnProperty.call(p,l)):l=Object.prototype.hasOwnProperty.call(p,l),l}s.implications=function(l){let m=[];if(Object.keys(o).forEach(E=>{let C=E;(o[E]||[]).forEach(b=>{let d=C,I=b;d=a(l,d),b=a(l,b),d&&!b&&m.push(` ${C} -> ${I}`)})}),m.length){let E=`${r("Implications failed:")}
78
- `;m.forEach(C=>{E+=C}),t.fail(E)}};let f={};s.conflicts=function(l,m){w("<string|object> [array|string]",[l,m],arguments.length),typeof l=="object"?Object.keys(l).forEach(E=>{s.conflicts(E,l[E])}):(e.global(l),f[l]||(f[l]=[]),Array.isArray(m)?m.forEach(E=>s.conflicts(l,E)):f[l].push(m))},s.getConflicting=()=>f,s.conflicting=function(l){Object.keys(l).forEach(m=>{f[m]&&f[m].forEach(E=>{E&&l[m]!==void 0&&l[E]!==void 0&&t.fail(r("Arguments %s and %s are mutually exclusive",m,E))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(f).forEach(m=>{f[m].forEach(E=>{E&&l[n.Parser.camelCase(m)]!==void 0&&l[n.Parser.camelCase(E)]!==void 0&&t.fail(r("Arguments %s and %s are mutually exclusive",m,E))})})},s.recommendCommands=function(l,m){m=m.sort((d,I)=>I.length-d.length);let C=null,b=1/0;for(let d=0,I;(I=m[d])!==void 0;d++){let z=Ps(l,I);z<=3&&z<b&&(b=z,C=I)}C&&t.fail(r("Did you mean %s?",C))},s.reset=function(l){return o=Ge(o,m=>!l[m]),f=Ge(f,m=>!l[m]),s};let F=[];return s.freeze=function(){F.push({implied:o,conflicting:f})},s.unfreeze=function(){let l=F.pop();Fe(l,void 0,n),{implied:o,conflicting:f}=l},s}var Dc={},Sr=[],Rt;function hn(e,t,n,r){Rt=r;let i={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return i;let s=/\.json|\..*rc$/.test(e.extends),o=null;if(s)o=fc(t,e.extends);else try{o=Dc.resolve(e.extends)}catch{return e}lc(o),Sr.push(o),i=s?JSON.parse(Rt.readFileSync(o,"utf8")):r.require(e.extends),delete e.extends,i=hn(i,Rt.path.dirname(o),n,Rt)}return Sr=[],n?js(i,e):Object.assign({},i,e)}function lc(e){if(Sr.indexOf(e)>-1)throw new oe(`Circular extended configurations: '${e}'.`)}function fc(e,t){return Rt.path.resolve(e,t)}function js(e,t){let n={};function r(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(n,e);for(let i of Object.keys(t))r(t[i])&&r(n[i])?n[i]=js(e[i],t[i]):n[i]=t[i];return n}var B=function(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},u=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},ue,st,Vt,ge,ye,dn,Ke,ot,pn,Oe,mn,_e,Te,Ae,Se,Fn,ut,De,P,gn,Cn,xe,at,Pt,ct,Je,En,M,lt,ft,Dt,$,bn,$e,ie;function ks(e){return(t=[],n=e.process.cwd(),r)=>{let i=new zr(t,n,r,e);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Ms=Symbol("copyDoubleDash"),Ts=Symbol("copyDoubleDash"),Pr=Symbol("deleteFromParserHintObject"),$s=Symbol("emitWarning"),Ns=Symbol("freeze"),Ls=Symbol("getDollarZero"),ht=Symbol("getParserConfiguration"),Us=Symbol("getUsageConfiguration"),vr=Symbol("guessLocale"),zs=Symbol("guessVersion"),Ws=Symbol("parsePositionalNumbers"),Ir=Symbol("pkgUp"),Qe=Symbol("populateParserHintArray"),vt=Symbol("populateParserHintSingleValueDictionary"),jr=Symbol("populateParserHintArrayDictionary"),Mr=Symbol("populateParserHintDictionary"),Tr=Symbol("sanitizeKey"),$r=Symbol("setKey"),Nr=Symbol("unfreeze"),Rs=Symbol("validateAsync"),Vs=Symbol("getCommandInstance"),Hs=Symbol("getContext"),qs=Symbol("getHasOutput"),Gs=Symbol("getLoggerInstance"),Ys=Symbol("getParseContext"),Ks=Symbol("getUsageInstance"),Js=Symbol("getValidationInstance"),yn=Symbol("hasParseCallback"),Qs=Symbol("isGlobalContext"),dt=Symbol("postProcess"),Zs=Symbol("rebase"),Lr=Symbol("reset"),Ht=Symbol("runYargsParserAndExecuteCommands"),Ur=Symbol("runValidation"),Xs=Symbol("setHasOutput"),pt=Symbol("kTrackManuallySetKeys"),hc="en_US",zr=class{constructor(t=[],n,r,i){this.customScriptName=!1,this.parsed=!1,ue.set(this,void 0),st.set(this,void 0),Vt.set(this,{commands:[],fullCommands:[]}),ge.set(this,null),ye.set(this,null),dn.set(this,"show-hidden"),Ke.set(this,null),ot.set(this,!0),pn.set(this,{}),Oe.set(this,!0),mn.set(this,[]),_e.set(this,void 0),Te.set(this,{}),Ae.set(this,!1),Se.set(this,null),Fn.set(this,!0),ut.set(this,void 0),De.set(this,""),P.set(this,void 0),gn.set(this,void 0),Cn.set(this,{}),xe.set(this,null),at.set(this,null),Pt.set(this,{}),ct.set(this,{}),Je.set(this,void 0),En.set(this,!1),M.set(this,void 0),lt.set(this,!1),ft.set(this,!1),Dt.set(this,!1),$.set(this,void 0),bn.set(this,{}),$e.set(this,null),ie.set(this,void 0),B(this,M,i,"f"),B(this,Je,t,"f"),B(this,st,n,"f"),B(this,gn,r,"f"),B(this,_e,new ln(this),"f"),this.$0=this[Ls](),this[Lr](),B(this,ue,u(this,ue,"f"),"f"),B(this,$,u(this,$,"f"),"f"),B(this,ie,u(this,ie,"f"),"f"),B(this,P,u(this,P,"f"),"f"),u(this,P,"f").showHiddenOpt=u(this,dn,"f"),B(this,ut,this[Ts](),"f"),u(this,M,"f").y18n.setLocale(hc)}addHelpOpt(t,n){let r="help";return w("[string|boolean] [string]",[t,n],arguments.length),u(this,Se,"f")&&(this[Pr](u(this,Se,"f")),B(this,Se,null,"f")),t===!1&&n===void 0?this:(B(this,Se,typeof t=="string"?t:r,"f"),this.boolean(u(this,Se,"f")),this.describe(u(this,Se,"f"),n||u(this,$,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(w("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let r=typeof t=="string"?t:u(this,dn,"f");return this.boolean(r),this.describe(r,n||u(this,$,"f").deferY18nLookup("Show hidden options")),u(this,P,"f").showHiddenOpt=r,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return w("<object|string|array> [string|array]",[t,n],arguments.length),this[jr](this.alias.bind(this),"alias",t,n),this}array(t){return w("<array|string>",[t],arguments.length),this[Qe]("array",t),this[pt](t),this}boolean(t){return w("<array|string>",[t],arguments.length),this[Qe]("boolean",t),this[pt](t),this}check(t,n){return w("<function> [boolean]",[t,n],arguments.length),this.middleware((r,i)=>it(()=>t(r,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&u(this,$,"f").fail(s.toString(),s):u(this,$,"f").fail(u(this,M,"f").y18n.__("Argument check failed: %s",t.toString())),r),s=>(u(this,$,"f").fail(s.message?s.message:s.toString(),s),r)),!1,n),this}choices(t,n){return w("<object|string|array> [string|array]",[t,n],arguments.length),this[jr](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(w("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new oe("coerce callback must be provided");for(let i of t)this.coerce(i,n);return this}else if(typeof t=="object"){for(let i of Object.keys(t))this.coerce(i,t[i]);return this}if(!n)throw new oe("coerce callback must be provided");let r=t;return u(this,P,"f").key[r]=!0,u(this,_e,"f").addCoerceMiddleware((i,s)=>{var o;let a=(o=s.getAliases()[r])!==null&&o!==void 0?o:[],f=[r,...a].filter(F=>Object.prototype.hasOwnProperty.call(i,F));return f.length===0?i:it(()=>n(i[f[0]]),F=>(f.forEach(p=>{i[p]=F}),i),F=>{throw new oe(F.message)})},r),this}conflicts(t,n){return w("<string|object> [string|array]",[t,n],arguments.length),u(this,ie,"f").conflicts(t,n),this}config(t="config",n,r){return w("[object|string] [string|function] [function]",[t,n,r],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=hn(t,u(this,st,"f"),this[ht]()["deep-merge-config"]||!1,u(this,M,"f")),u(this,P,"f").configObjects=(u(this,P,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(r=n,n=void 0),this.describe(t,n||u(this,$,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{u(this,P,"f").config[i]=r||!0}),this)}completion(t,n,r){return w("[string] [string|boolean|function] [function]",[t,n,r],arguments.length),typeof n=="function"&&(r=n,n=void 0),B(this,ye,t||u(this,ye,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(u(this,ye,"f"),n),r&&u(this,ge,"f").registerFunction(r),this}command(t,n,r,i,s,o){return w("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,r,i,s,o],arguments.length),u(this,ue,"f").addHandler(t,n,r,i,s,o),this}commands(t,n,r,i,s,o){return this.command(t,n,r,i,s,o)}commandDir(t,n){w("<string> [object]",[t,n],arguments.length);let r=u(this,gn,"f")||u(this,M,"f").require;return u(this,ue,"f").addDirectory(t,r,u(this,M,"f").getCallerFile(),n),this}count(t){return w("<array|string>",[t],arguments.length),this[Qe]("count",t),this[pt](t),this}default(t,n,r){return w("<object|string|array> [*] [string]",[t,n,r],arguments.length),r&&(wr(t,u(this,M,"f")),u(this,P,"f").defaultDescription[t]=r),typeof n=="function"&&(wr(t,u(this,M,"f")),u(this,P,"f").defaultDescription[t]||(u(this,P,"f").defaultDescription[t]=u(this,$,"f").functionDescription(n)),n=n.call()),this[vt](this.default.bind(this),"default",t,n),this}defaults(t,n,r){return this.default(t,n,r)}demandCommand(t=1,n,r,i){return w("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,r,i],arguments.length),typeof n!="number"&&(r=n,n=1/0),this.global("_",!1),u(this,P,"f").demandedCommands._={min:t,max:n,minMsg:r,maxMsg:i},this}demand(t,n,r){return Array.isArray(n)?(n.forEach(i=>{Fe(r,!0,u(this,M,"f")),this.demandOption(i,r)}),n=1/0):typeof n!="number"&&(r=n,n=1/0),typeof t=="number"?(Fe(r,!0,u(this,M,"f")),this.demandCommand(t,n,r,r)):Array.isArray(t)?t.forEach(i=>{Fe(r,!0,u(this,M,"f")),this.demandOption(i,r)}):typeof r=="string"?this.demandOption(t,r):(r===!0||typeof r>"u")&&this.demandOption(t),this}demandOption(t,n){return w("<object|string|array> [string]",[t,n],arguments.length),this[vt](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return w("<string> [string|boolean]",[t,n],arguments.length),u(this,P,"f").deprecatedOptions[t]=n,this}describe(t,n){return w("<object|string|array> [string]",[t,n],arguments.length),this[$r](t,!0),u(this,$,"f").describe(t,n),this}detectLocale(t){return w("<boolean>",[t],arguments.length),B(this,ot,t,"f"),this}env(t){return w("[string|boolean]",[t],arguments.length),t===!1?delete u(this,P,"f").envPrefix:u(this,P,"f").envPrefix=t||"",this}epilogue(t){return w("<string>",[t],arguments.length),u(this,$,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return w("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(r=>this.example(...r)):u(this,$,"f").example(t,n),this}exit(t,n){B(this,Ae,!0,"f"),B(this,Ke,n,"f"),u(this,Oe,"f")&&u(this,M,"f").process.exit(t)}exitProcess(t=!0){return w("[boolean]",[t],arguments.length),B(this,Oe,t,"f"),this}fail(t){if(w("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new oe("Invalid first argument. Expected function or boolean 'false'");return u(this,$,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return w("<array> [function]",[t,n],arguments.length),n?u(this,ge,"f").getCompletion(t,n):new Promise((r,i)=>{u(this,ge,"f").getCompletion(t,(s,o)=>{s?i(s):r(o)})})}getDemandedOptions(){return w([],0),u(this,P,"f").demandedOptions}getDemandedCommands(){return w([],0),u(this,P,"f").demandedCommands}getDeprecatedOptions(){return w([],0),u(this,P,"f").deprecatedOptions}getDetectLocale(){return u(this,ot,"f")}getExitProcess(){return u(this,Oe,"f")}getGroups(){return Object.assign({},u(this,Te,"f"),u(this,ct,"f"))}getHelp(){if(B(this,Ae,!0,"f"),!u(this,$,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[Ht](u(this,Je,"f"),void 0,void 0,0,!0);if(Q(n))return n.then(()=>u(this,$,"f").help())}let t=u(this,ue,"f").runDefaultBuilderOn(this);if(Q(t))return t.then(()=>u(this,$,"f").help())}return Promise.resolve(u(this,$,"f").help())}getOptions(){return u(this,P,"f")}getStrict(){return u(this,lt,"f")}getStrictCommands(){return u(this,ft,"f")}getStrictOptions(){return u(this,Dt,"f")}global(t,n){return w("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?u(this,P,"f").local=u(this,P,"f").local.filter(r=>t.indexOf(r)===-1):t.forEach(r=>{u(this,P,"f").local.includes(r)||u(this,P,"f").local.push(r)}),this}group(t,n){w("<string|array> <string>",[t,n],arguments.length);let r=u(this,ct,"f")[n]||u(this,Te,"f")[n];u(this,ct,"f")[n]&&delete u(this,ct,"f")[n];let i={};return u(this,Te,"f")[n]=(r||[]).concat(t).filter(s=>i[s]?!1:i[s]=!0),this}hide(t){return w("<string>",[t],arguments.length),u(this,P,"f").hiddenOptions.push(t),this}implies(t,n){return w("<string|object> [number|string|array]",[t,n],arguments.length),u(this,ie,"f").implies(t,n),this}locale(t){return w("[string]",[t],arguments.length),t===void 0?(this[vr](),u(this,M,"f").y18n.getLocale()):(B(this,ot,!1,"f"),u(this,M,"f").y18n.setLocale(t),this)}middleware(t,n,r){return u(this,_e,"f").addMiddleware(t,!!n,r)}nargs(t,n){return w("<string|object|array> [number]",[t,n],arguments.length),this[vt](this.nargs.bind(this),"narg",t,n),this}normalize(t){return w("<array|string>",[t],arguments.length),this[Qe]("normalize",t),this}number(t){return w("<array|string>",[t],arguments.length),this[Qe]("number",t),this[pt](t),this}option(t,n){if(w("<string|object> [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(r=>{this.options(r,t[r])});else{typeof n!="object"&&(n={}),this[pt](t),u(this,$e,"f")&&(t==="version"||n?.alias==="version")&&this[$s](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
79
- `),void 0,"versionWarning"),u(this,P,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let r=n.deprecate||n.deprecated;r&&this.deprecateOption(t,r);let i=n.demand||n.required||n.require;i&&this.demand(t,i),n.demandOption&&this.demandOption(t,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),"default"in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(t),typeof n.global=="boolean"&&this.global(t,n.global),n.defaultDescription&&(u(this,P,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let s=n.describe||n.description||n.desc,o=u(this,$,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(o,t)||typeof s=="string")&&this.describe(t,s),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,r){w("[string|array] [function|boolean|object] [function]",[t,n,r],arguments.length),this[Ns](),typeof t>"u"&&(t=u(this,Je,"f")),typeof n=="object"&&(B(this,at,n,"f"),n=r),typeof n=="function"&&(B(this,xe,n,"f"),n=!1),n||B(this,Je,t,"f"),u(this,xe,"f")&&B(this,Oe,!1,"f");let i=this[Ht](t,!!n),s=this.parsed;return u(this,ge,"f").setParsed(this.parsed),Q(i)?i.then(o=>(u(this,xe,"f")&&u(this,xe,"f").call(this,u(this,Ke,"f"),o,u(this,De,"f")),o)).catch(o=>{throw u(this,xe,"f")&&u(this,xe,"f")(o,this.parsed.argv,u(this,De,"f")),o}).finally(()=>{this[Nr](),this.parsed=s}):(u(this,xe,"f")&&u(this,xe,"f").call(this,u(this,Ke,"f"),i,u(this,De,"f")),this[Nr](),this.parsed=s,i)}parseAsync(t,n,r){let i=this.parse(t,n,r);return Q(i)?i:Promise.resolve(i)}parseSync(t,n,r){let i=this.parse(t,n,r);if(Q(i))throw new oe(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return w("<object>",[t],arguments.length),B(this,Cn,t,"f"),this}pkgConf(t,n){w("<string> [string]",[t,n],arguments.length);let r=null,i=this[Ir](n||u(this,st,"f"));return i[t]&&typeof i[t]=="object"&&(r=hn(i[t],n||u(this,st,"f"),this[ht]()["deep-merge-config"]||!1,u(this,M,"f")),u(this,P,"f").configObjects=(u(this,P,"f").configObjects||[]).concat(r)),this}positional(t,n){w("<string> <object>",[t,n],arguments.length);let r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=Ge(n,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:r.includes(o));let i=u(this,Vt,"f").fullCommands[u(this,Vt,"f").fullCommands.length-1],s=i?u(this,ue,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return _t(s).forEach(o=>{let a=s[o];Array.isArray(a)?a.indexOf(t)!==-1&&(n[o]=!0):a[t]&&!(o in n)&&(n[o]=a[t])}),this.group(t,u(this,$,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return w("[boolean]",[t],arguments.length),B(this,En,t,"f"),this}required(t,n,r){return this.demand(t,n,r)}require(t,n,r){return this.demand(t,n,r)}requiresArg(t){return w("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&u(this,P,"f").narg[t]?this:(this[vt](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return w("[string] [string]",[t,n],arguments.length),t=t||this.$0,u(this,ut,"f").log(u(this,ge,"f").generateCompletionScript(t,n||u(this,ye,"f")||"completion")),this}showHelp(t){if(w("[string|function]",[t],arguments.length),B(this,Ae,!0,"f"),!u(this,$,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[Ht](u(this,Je,"f"),void 0,void 0,0,!0);if(Q(r))return r.then(()=>{u(this,$,"f").showHelp(t)}),this}let n=u(this,ue,"f").runDefaultBuilderOn(this);if(Q(n))return n.then(()=>{u(this,$,"f").showHelp(t)}),this}return u(this,$,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return w("[boolean|string] [string]",[t,n],arguments.length),u(this,$,"f").showHelpOnFail(t,n),this}showVersion(t){return w("[string|function]",[t],arguments.length),u(this,$,"f").showVersion(t),this}skipValidation(t){return w("<array|string>",[t],arguments.length),this[Qe]("skipValidation",t),this}strict(t){return w("[boolean]",[t],arguments.length),B(this,lt,t!==!1,"f"),this}strictCommands(t){return w("[boolean]",[t],arguments.length),B(this,ft,t!==!1,"f"),this}strictOptions(t){return w("[boolean]",[t],arguments.length),B(this,Dt,t!==!1,"f"),this}string(t){return w("<array|string>",[t],arguments.length),this[Qe]("string",t),this[pt](t),this}terminalWidth(){return w([],0),u(this,M,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return w("<object>",[t],arguments.length),B(this,ot,!1,"f"),u(this,M,"f").y18n.updateLocale(t),this}usage(t,n,r,i){if(w("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,r,i],arguments.length),n!==void 0){if(Fe(t,null,u(this,M,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,r,i);throw new oe(".usage() description must start with $0 if being used as alias for .command()")}else return u(this,$,"f").usage(t),this}usageConfiguration(t){return w("<object>",[t],arguments.length),B(this,bn,t,"f"),this}version(t,n,r){let i="version";if(w("[boolean|string] [string] [string]",[t,n,r],arguments.length),u(this,$e,"f")&&(this[Pr](u(this,$e,"f")),u(this,$,"f").version(void 0),B(this,$e,null,"f")),arguments.length===0)r=this[zs](),t=i;else if(arguments.length===1){if(t===!1)return this;r=t,t=i}else arguments.length===2&&(r=n,n=void 0);return B(this,$e,typeof t=="string"?t:i,"f"),n=n||u(this,$,"f").deferY18nLookup("Show version number"),u(this,$,"f").version(r||void 0),this.boolean(u(this,$e,"f")),this.describe(u(this,$e,"f"),n),this}wrap(t){return w("<number|null|undefined>",[t],arguments.length),u(this,$,"f").wrap(t),this}[(ue=new WeakMap,st=new WeakMap,Vt=new WeakMap,ge=new WeakMap,ye=new WeakMap,dn=new WeakMap,Ke=new WeakMap,ot=new WeakMap,pn=new WeakMap,Oe=new WeakMap,mn=new WeakMap,_e=new WeakMap,Te=new WeakMap,Ae=new WeakMap,Se=new WeakMap,Fn=new WeakMap,ut=new WeakMap,De=new WeakMap,P=new WeakMap,gn=new WeakMap,Cn=new WeakMap,xe=new WeakMap,at=new WeakMap,Pt=new WeakMap,ct=new WeakMap,Je=new WeakMap,En=new WeakMap,M=new WeakMap,lt=new WeakMap,ft=new WeakMap,Dt=new WeakMap,$=new WeakMap,bn=new WeakMap,$e=new WeakMap,ie=new WeakMap,Ms)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[Ts](){return{log:(...t)=>{this[yn]()||console.log(...t),B(this,Ae,!0,"f"),u(this,De,"f").length&&B(this,De,u(this,De,"f")+`
80
- `,"f"),B(this,De,u(this,De,"f")+t.join(" "),"f")},error:(...t)=>{this[yn]()||console.error(...t),B(this,Ae,!0,"f"),u(this,De,"f").length&&B(this,De,u(this,De,"f")+`
81
- `,"f"),B(this,De,u(this,De,"f")+t.join(" "),"f")}}}[Pr](t){_t(u(this,P,"f")).forEach(n=>{if((i=>i==="configObjects")(n))return;let r=u(this,P,"f")[n];Array.isArray(r)?r.includes(t)&&r.splice(r.indexOf(t),1):typeof r=="object"&&delete r[t]}),delete u(this,$,"f").getDescriptions()[t]}[$s](t,n,r){u(this,pn,"f")[r]||(u(this,M,"f").process.emitWarning(t,n),u(this,pn,"f")[r]=!0)}[Ns](){u(this,mn,"f").push({options:u(this,P,"f"),configObjects:u(this,P,"f").configObjects.slice(0),exitProcess:u(this,Oe,"f"),groups:u(this,Te,"f"),strict:u(this,lt,"f"),strictCommands:u(this,ft,"f"),strictOptions:u(this,Dt,"f"),completionCommand:u(this,ye,"f"),output:u(this,De,"f"),exitError:u(this,Ke,"f"),hasOutput:u(this,Ae,"f"),parsed:this.parsed,parseFn:u(this,xe,"f"),parseContext:u(this,at,"f")}),u(this,$,"f").freeze(),u(this,ie,"f").freeze(),u(this,ue,"f").freeze(),u(this,_e,"f").freeze()}[Ls](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(u(this,M,"f").process.argv()[0])?n=u(this,M,"f").process.argv().slice(1,2):n=u(this,M,"f").process.argv().slice(0,1),t=n.map(r=>{let i=this[Zs](u(this,st,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<r.length?i:r}).join(" ").trim(),u(this,M,"f").getEnv("_")&&u(this,M,"f").getProcessArgvBin()===u(this,M,"f").getEnv("_")&&(t=u(this,M,"f").getEnv("_").replace(`${u(this,M,"f").path.dirname(u(this,M,"f").process.execPath())}/`,"")),t}[ht](){return u(this,Cn,"f")}[Us](){return u(this,bn,"f")}[vr](){if(!u(this,ot,"f"))return;let t=u(this,M,"f").getEnv("LC_ALL")||u(this,M,"f").getEnv("LC_MESSAGES")||u(this,M,"f").getEnv("LANG")||u(this,M,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[zs](){return this[Ir]().version||"unknown"}[Ws](t){let n=t["--"]?t["--"]:t._;for(let r=0,i;(i=n[r])!==void 0;r++)u(this,M,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(n[r]=Number(i));return t}[Ir](t){let n=t||"*";if(u(this,Pt,"f")[n])return u(this,Pt,"f")[n];let r={};try{let i=t||u(this,M,"f").mainFilename;u(this,M,"f").path.extname(i)&&(i=u(this,M,"f").path.dirname(i));let s=u(this,M,"f").findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});Fe(s,void 0,u(this,M,"f")),r=JSON.parse(u(this,M,"f").readFileSync(s,"utf8"))}catch{}return u(this,Pt,"f")[n]=r||{},u(this,Pt,"f")[n]}[Qe](t,n){n=[].concat(n),n.forEach(r=>{r=this[Tr](r),u(this,P,"f")[t].push(r)})}[vt](t,n,r,i){this[Mr](t,n,r,i,(s,o,a)=>{u(this,P,"f")[s][o]=a})}[jr](t,n,r,i){this[Mr](t,n,r,i,(s,o,a)=>{u(this,P,"f")[s][o]=(u(this,P,"f")[s][o]||[]).concat(a)})}[Mr](t,n,r,i,s){if(Array.isArray(r))r.forEach(o=>{t(o,i)});else if((o=>typeof o=="object")(r))for(let o of _t(r))t(o,r[o]);else s(n,this[Tr](r),i)}[Tr](t){return t==="__proto__"?"___proto___":t}[$r](t,n){return this[vt](this[$r].bind(this),"key",t,n),this}[Nr](){var t,n,r,i,s,o,a,f,F,p,l,m;let E=u(this,mn,"f").pop();Fe(E,void 0,u(this,M,"f"));let C;t=this,n=this,r=this,i=this,s=this,o=this,a=this,f=this,F=this,p=this,l=this,m=this,{options:{set value(b){B(t,P,b,"f")}}.value,configObjects:C,exitProcess:{set value(b){B(n,Oe,b,"f")}}.value,groups:{set value(b){B(r,Te,b,"f")}}.value,output:{set value(b){B(i,De,b,"f")}}.value,exitError:{set value(b){B(s,Ke,b,"f")}}.value,hasOutput:{set value(b){B(o,Ae,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){B(a,lt,b,"f")}}.value,strictCommands:{set value(b){B(f,ft,b,"f")}}.value,strictOptions:{set value(b){B(F,Dt,b,"f")}}.value,completionCommand:{set value(b){B(p,ye,b,"f")}}.value,parseFn:{set value(b){B(l,xe,b,"f")}}.value,parseContext:{set value(b){B(m,at,b,"f")}}.value}=E,u(this,P,"f").configObjects=C,u(this,$,"f").unfreeze(),u(this,ie,"f").unfreeze(),u(this,ue,"f").unfreeze(),u(this,_e,"f").unfreeze()}[Rs](t,n){return it(n,r=>(t(r),r))}getInternalMethods(){return{getCommandInstance:this[Vs].bind(this),getContext:this[Hs].bind(this),getHasOutput:this[qs].bind(this),getLoggerInstance:this[Gs].bind(this),getParseContext:this[Ys].bind(this),getParserConfiguration:this[ht].bind(this),getUsageConfiguration:this[Us].bind(this),getUsageInstance:this[Ks].bind(this),getValidationInstance:this[Js].bind(this),hasParseCallback:this[yn].bind(this),isGlobalContext:this[Qs].bind(this),postProcess:this[dt].bind(this),reset:this[Lr].bind(this),runValidation:this[Ur].bind(this),runYargsParserAndExecuteCommands:this[Ht].bind(this),setHasOutput:this[Xs].bind(this)}}[Vs](){return u(this,ue,"f")}[Hs](){return u(this,Vt,"f")}[qs](){return u(this,Ae,"f")}[Gs](){return u(this,ut,"f")}[Ys](){return u(this,at,"f")||{}}[Ks](){return u(this,$,"f")}[Js](){return u(this,ie,"f")}[yn](){return!!u(this,xe,"f")}[Qs](){return u(this,Fn,"f")}[dt](t,n,r,i){return r||Q(t)||(n||(t=this[Ms](t)),(this[ht]()["parse-positional-numbers"]||this[ht]()["parse-positional-numbers"]===void 0)&&(t=this[Ws](t)),i&&(t=rt(t,this,u(this,_e,"f").getMiddleware(),!1))),t}[Lr](t={}){B(this,P,u(this,P,"f")||{},"f");let n={};n.local=u(this,P,"f").local||[],n.configObjects=u(this,P,"f").configObjects||[];let r={};n.local.forEach(o=>{r[o]=!0,(t[o]||[]).forEach(a=>{r[a]=!0})}),Object.assign(u(this,ct,"f"),Object.keys(u(this,Te,"f")).reduce((o,a)=>{let f=u(this,Te,"f")[a].filter(F=>!(F in r));return f.length>0&&(o[a]=f),o},{})),B(this,Te,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{n[o]=(u(this,P,"f")[o]||[]).filter(a=>!r[a])}),s.forEach(o=>{n[o]=Ge(u(this,P,"f")[o],a=>!r[a])}),n.envPrefix=u(this,P,"f").envPrefix,B(this,P,n,"f"),B(this,$,u(this,$,"f")?u(this,$,"f").reset(r):Bs(this,u(this,M,"f")),"f"),B(this,ie,u(this,ie,"f")?u(this,ie,"f").reset(r):Is(this,u(this,$,"f"),u(this,M,"f")),"f"),B(this,ue,u(this,ue,"f")?u(this,ue,"f").reset():As(u(this,$,"f"),u(this,ie,"f"),u(this,_e,"f"),u(this,M,"f")),"f"),u(this,ge,"f")||B(this,ge,Ss(this,u(this,$,"f"),u(this,ue,"f"),u(this,M,"f")),"f"),u(this,_e,"f").reset(),B(this,ye,null,"f"),B(this,De,"","f"),B(this,Ke,null,"f"),B(this,Ae,!1,"f"),this.parsed=!1,this}[Zs](t,n){return u(this,M,"f").path.relative(t,n)}[Ht](t,n,r,i=0,s=!1){var o,a,f,F;let p=!!r||s;t=t||u(this,Je,"f"),u(this,P,"f").__=u(this,M,"f").y18n.__,u(this,P,"f").configuration=this[ht]();let l=!!u(this,P,"f").configuration["populate--"],m=Object.assign({},u(this,P,"f").configuration,{"populate--":!0}),E=u(this,M,"f").Parser.detailed(t,Object.assign({},u(this,P,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),C=Object.assign(E.argv,u(this,at,"f")),b,d=E.aliases,I=!1,z=!1;Object.keys(C).forEach(L=>{L===u(this,Se,"f")&&C[L]?I=!0:L===u(this,$e,"f")&&C[L]&&(z=!0)}),C.$0=this.$0,this.parsed=E,i===0&&u(this,$,"f").clearCachedHelpMessage();try{if(this[vr](),n)return this[dt](C,l,!!r,!1);u(this,Se,"f")&&[u(this,Se,"f")].concat(d[u(this,Se,"f")]||[]).filter(H=>H.length>1).includes(""+C._[C._.length-1])&&(C._.pop(),I=!0),B(this,Fn,!1,"f");let L=u(this,ue,"f").getCommands(),U=!((o=u(this,ge,"f"))===null||o===void 0)&&o.completionKey?[(a=u(this,ge,"f"))===null||a===void 0?void 0:a.completionKey,...(F=this.getAliases()[(f=u(this,ge,"f"))===null||f===void 0?void 0:f.completionKey])!==null&&F!==void 0?F:[]].some(R=>Object.prototype.hasOwnProperty.call(C,R)):!1,W=I||U||s;if(C._.length){if(L.length){let R;for(let H=i||0,K;C._[H]!==void 0;H++)if(K=String(C._[H]),L.includes(K)&&K!==u(this,ye,"f")){let de=u(this,ue,"f").runCommand(K,this,E,H+1,s,I||z||s);return this[dt](de,l,!!r,!1)}else if(!R&&K!==u(this,ye,"f")){R=K;break}!u(this,ue,"f").hasDefaultCommand()&&u(this,En,"f")&&R&&!W&&u(this,ie,"f").recommendCommands(R,L)}u(this,ye,"f")&&C._.includes(u(this,ye,"f"))&&!U&&(u(this,Oe,"f")&&Ye(!0),this.showCompletionScript(),this.exit(0))}if(u(this,ue,"f").hasDefaultCommand()&&!W){let R=u(this,ue,"f").runCommand(null,this,E,0,s,I||z||s);return this[dt](R,l,!!r,!1)}if(U){u(this,Oe,"f")&&Ye(!0),t=[].concat(t);let R=t.slice(t.indexOf(`--${u(this,ge,"f").completionKey}`)+1);return u(this,ge,"f").getCompletion(R,(H,K)=>{if(H)throw new oe(H.message);(K||[]).forEach(de=>{u(this,ut,"f").log(de)}),this.exit(0)}),this[dt](C,!l,!!r,!1)}if(u(this,Ae,"f")||(I?(u(this,Oe,"f")&&Ye(!0),p=!0,this.showHelp(R=>{u(this,ut,"f").log(R),this.exit(0)})):z&&(u(this,Oe,"f")&&Ye(!0),p=!0,u(this,$,"f").showVersion("log"),this.exit(0))),!p&&u(this,P,"f").skipValidation.length>0&&(p=Object.keys(C).some(R=>u(this,P,"f").skipValidation.indexOf(R)>=0&&C[R]===!0)),!p){if(E.error)throw new oe(E.error.message);if(!U){let R=this[Ur](d,{},E.error);r||(b=rt(C,this,u(this,_e,"f").getMiddleware(),!0)),b=this[Rs](R,b??C),Q(b)&&!r&&(b=b.then(()=>rt(C,this,u(this,_e,"f").getMiddleware(),!1)))}}}catch(L){if(L instanceof oe)u(this,$,"f").fail(L.message,L);else throw L}return this[dt](b??C,l,!!r,!0)}[Ur](t,n,r,i){let s={...this.getDemandedOptions()};return o=>{if(r)throw new oe(r.message);u(this,ie,"f").nonOptionCount(o),u(this,ie,"f").requiredArguments(o,s);let a=!1;u(this,ft,"f")&&(a=u(this,ie,"f").unknownCommands(o)),u(this,lt,"f")&&!a?u(this,ie,"f").unknownArguments(o,t,n,!!i):u(this,Dt,"f")&&u(this,ie,"f").unknownArguments(o,t,{},!1,!1),u(this,ie,"f").limitedChoices(o),u(this,ie,"f").implications(o),u(this,ie,"f").conflicting(o)}}[Xs](){B(this,Ae,!0,"f")}[pt](t){if(typeof t=="string")u(this,P,"f").key[t]=!0;else for(let n of t)u(this,P,"f").key[n]=!0}};function xs(e){return!!e&&typeof e.getInternalMethods=="function"}var dc=ks(Fs),eo=dc;var io=mt(no(),1),Fc={},pc=process.argv.slice(2),ro=new io.default(eo),Rr=console.log;async function Vr(e){ro.yargs.option("listen",{desc:"daemon control listen multiaddr",type:"string",default:"/unix/tmp/p2pd.sock"}).option("quiet",{alias:"q",desc:"be quiet",type:"boolean",default:!1}).option("id",{desc:"peer identity; private key file",type:"string",default:""}).option("hostAddrs",{desc:"Comma separated list of multiaddrs the host should listen on",type:"string",default:""}).option("announceAddrs",{desc:"Comma separated list of multiaddrs the host should announce to the network",type:"string",default:""}).option("bootstrap",{alias:"b",desc:"Connects to bootstrap peers and bootstraps the dht if enabled",type:"boolean",default:!1}).option("bootstrapPeers",{desc:"Comma separated list of bootstrap peers; defaults to the IPFS DHT peers",type:"string",default:""}).option("dht",{desc:"Enables the DHT in full node mode",type:"boolean",default:!1}).option("dhtClient",{desc:"(Not yet supported) Enables the DHT in client mode",type:"boolean",default:!1}).option("nat",{desc:"Enables UPnP NAT hole punching",type:"boolean",default:!1}).option("connMgr",{desc:"(Not yet supported) Enables the Connection Manager",type:"boolean",default:!1}).option("connMgrLo",{desc:"Number identifying the number of peers below which this node will not activate preemptive disconnections",type:"number"}).option("connMgrHi",{desc:"Number identifying the maximum number of peers the current peer is willing to be connected to before is starts disconnecting",type:"number"}).option("pubsub",{desc:"Enables pubsub",type:"boolean",default:!1}).option("pubsubRouter",{desc:"Specifies the pubsub router implementation",type:"string",default:"gossipsub"}).fail((i,s,o)=>{if(s!=null)throw s;pc.length>0&&Rr(i),o.showHelp()});let{data:t,argv:n}=await ro.parse(e);t!=null&&(Rr(t),process.exit(0)),await(await so(Pi(n.listen),n)).start(),n.quiet!==!0&&Rr("daemon has started")}async function so(e,t){throw new Error("Not implemented yet")}lr(Fc)&&Vr(process.argv).catch(e=>{console.error(e),process.exit(1)});return fo(mc);})();
76
+ `)}`:"";t.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(E).length,Object.keys(E).join(", ")+b))}},s.unknownArguments=function(l,m,E,C,b=!0){var d;let v=n.getInternalMethods().getCommandInstance().getCommands(),z=[],L=n.getInternalMethods().getContext();if(Object.keys(l).forEach(U=>{!Ls.includes(U)&&!Object.prototype.hasOwnProperty.call(E,U)&&!Object.prototype.hasOwnProperty.call(n.getInternalMethods().getParseContext(),U)&&!s.isValidAndSomeAliasIsNotNew(U,m)&&z.push(U)}),b&&(L.commands.length>0||v.length>0||C)&&l._.slice(L.commands.length).forEach(U=>{v.includes(""+U)||z.push(""+U)}),b){let R=((d=n.getDemandedCommands()._)===null||d===void 0?void 0:d.max)||0,W=L.commands.length+R;W<l._.length&&l._.slice(W).forEach(H=>{H=String(H),!L.commands.includes(H)&&!z.includes(H)&&z.push(H)})}z.length&&t.fail(i("Unknown argument: %s","Unknown arguments: %s",z.length,z.map(U=>U.trim()?U:`"${U}"`).join(", ")))},s.unknownCommands=function(l){let m=n.getInternalMethods().getCommandInstance().getCommands(),E=[],C=n.getInternalMethods().getContext();return(C.commands.length>0||m.length>0)&&l._.slice(C.commands.length).forEach(b=>{m.includes(""+b)||E.push(""+b)}),E.length>0?(t.fail(i("Unknown command: %s","Unknown commands: %s",E.length,E.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(l,m){if(!Object.prototype.hasOwnProperty.call(m,l))return!1;let E=n.parsed.newAliases;return[l,...m[l]].some(C=>!Object.prototype.hasOwnProperty.call(E,C)||!E[l])},s.limitedChoices=function(l){let m=n.getOptions(),E={};if(!Object.keys(m.choices).length)return;Object.keys(l).forEach(d=>{Ls.indexOf(d)===-1&&Object.prototype.hasOwnProperty.call(m.choices,d)&&[].concat(l[d]).forEach(v=>{m.choices[d].indexOf(v)===-1&&v!==void 0&&(E[d]=(E[d]||[]).concat(v))})});let C=Object.keys(E);if(!C.length)return;let b=r("Invalid values:");C.forEach(d=>{b+=`
77
+ ${r("Argument: %s, Given: %s, Choices: %s",d,t.stringifiedValues(E[d]),t.stringifiedValues(m.choices[d]))}`}),t.fail(b)};let o={};s.implies=function(l,m){A("<string|object> [array|number|string]",[l,m],arguments.length),typeof l=="object"?Object.keys(l).forEach(E=>{s.implies(E,l[E])}):(n.global(l),o[l]||(o[l]=[]),Array.isArray(m)?m.forEach(E=>s.implies(l,E)):(gt(m,void 0,e),o[l].push(m)))},s.getImplied=function(){return o};function a(p,l){let m=Number(l);return l=isNaN(m)?l:m,typeof l=="number"?l=p._.length>=l:l.match(/^--no-.+/)?(l=l.match(/^--no-(.+)/)[1],l=!Object.prototype.hasOwnProperty.call(p,l)):l=Object.prototype.hasOwnProperty.call(p,l),l}s.implications=function(l){let m=[];if(Object.keys(o).forEach(E=>{let C=E;(o[E]||[]).forEach(b=>{let d=C,v=b;d=a(l,d),b=a(l,b),d&&!b&&m.push(` ${C} -> ${v}`)})}),m.length){let E=`${r("Implications failed:")}
78
+ `;m.forEach(C=>{E+=C}),t.fail(E)}};let f={};s.conflicts=function(l,m){A("<string|object> [array|string]",[l,m],arguments.length),typeof l=="object"?Object.keys(l).forEach(E=>{s.conflicts(E,l[E])}):(n.global(l),f[l]||(f[l]=[]),Array.isArray(m)?m.forEach(E=>s.conflicts(l,E)):f[l].push(m))},s.getConflicting=()=>f,s.conflicting=function(l){Object.keys(l).forEach(m=>{f[m]&&f[m].forEach(E=>{E&&l[m]!==void 0&&l[E]!==void 0&&t.fail(r("Arguments %s and %s are mutually exclusive",m,E))})}),n.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(f).forEach(m=>{f[m].forEach(E=>{E&&l[e.Parser.camelCase(m)]!==void 0&&l[e.Parser.camelCase(E)]!==void 0&&t.fail(r("Arguments %s and %s are mutually exclusive",m,E))})})},s.recommendCommands=function(l,m){m=m.sort((d,v)=>v.length-d.length);let C=null,b=1/0;for(let d=0,v;(v=m[d])!==void 0;d++){let z=Ns(l,v);z<=3&&z<b&&(b=z,C=v)}C&&t.fail(r("Did you mean %s?",C))},s.reset=function(l){return o=Gt(o,m=>!l[m]),f=Gt(f,m=>!l[m]),s};let g=[];return s.freeze=function(){g.push({implied:o,conflicting:f})},s.unfreeze=function(){let l=g.pop();gt(l,void 0,e),{implied:o,conflicting:f}=l},s}var _c={},Tr=[],Ve;function gn(n,t,e,r){Ve=r;let i={};if(Object.prototype.hasOwnProperty.call(n,"extends")){if(typeof n.extends!="string")return i;let s=/\.json|\..*rc$/.test(n.extends),o=null;if(s)o=Bc(t,n.extends);else try{o=_c.resolve(n.extends)}catch{return n}Oc(o),Tr.push(o),i=s?JSON.parse(Ve.readFileSync(o,"utf8")):r.require(n.extends),delete n.extends,i=gn(i,Ve.path.dirname(o),e,Ve)}return Tr=[],e?zs(i,n):Object.assign({},i,n)}function Oc(n){if(Tr.indexOf(n)>-1)throw new ot(`Circular extended configurations: '${n}'.`)}function Bc(n,t){return Ve.path.resolve(n,t)}function zs(n,t){let e={};function r(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(e,n);for(let i of Object.keys(t))r(t[i])&&r(e[i])?e[i]=zs(n[i],t[i]):e[i]=t[i];return e}var O=function(n,t,e,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},u=function(n,t,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!r:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(n):r?r.value:t.get(n)},ut,se,He,Ft,xt,Fn,Kt,oe,Cn,Bt,En,_t,Tt,wt,St,bn,ue,Dt,P,xn,wn,yt,ae,Pe,ce,Jt,yn,M,le,fe,De,$,An,$t,it;function oo(n){return(t=[],e=n.process.cwd(),r)=>{let i=new Gr(t,e,r,n);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Rs=Symbol("copyDoubleDash"),Ws=Symbol("copyDoubleDash"),$r=Symbol("deleteFromParserHintObject"),Vs=Symbol("emitWarning"),Hs=Symbol("freeze"),qs=Symbol("getDollarZero"),he=Symbol("getParserConfiguration"),Gs=Symbol("getUsageConfiguration"),Nr=Symbol("guessLocale"),Ys=Symbol("guessVersion"),Ks=Symbol("parsePositionalNumbers"),Lr=Symbol("pkgUp"),Qt=Symbol("populateParserHintArray"),Ie=Symbol("populateParserHintSingleValueDictionary"),Ur=Symbol("populateParserHintArrayDictionary"),zr=Symbol("populateParserHintDictionary"),Rr=Symbol("sanitizeKey"),Wr=Symbol("setKey"),Vr=Symbol("unfreeze"),Js=Symbol("validateAsync"),Qs=Symbol("getCommandInstance"),Zs=Symbol("getContext"),Xs=Symbol("getHasOutput"),ks=Symbol("getLoggerInstance"),to=Symbol("getParseContext"),eo=Symbol("getUsageInstance"),no=Symbol("getValidationInstance"),On=Symbol("hasParseCallback"),ro=Symbol("isGlobalContext"),de=Symbol("postProcess"),io=Symbol("rebase"),Hr=Symbol("reset"),qe=Symbol("runYargsParserAndExecuteCommands"),qr=Symbol("runValidation"),so=Symbol("setHasOutput"),pe=Symbol("kTrackManuallySetKeys"),Sc="en_US",Gr=class{constructor(t=[],e,r,i){this.customScriptName=!1,this.parsed=!1,ut.set(this,void 0),se.set(this,void 0),He.set(this,{commands:[],fullCommands:[]}),Ft.set(this,null),xt.set(this,null),Fn.set(this,"show-hidden"),Kt.set(this,null),oe.set(this,!0),Cn.set(this,{}),Bt.set(this,!0),En.set(this,[]),_t.set(this,void 0),Tt.set(this,{}),wt.set(this,!1),St.set(this,null),bn.set(this,!0),ue.set(this,void 0),Dt.set(this,""),P.set(this,void 0),xn.set(this,void 0),wn.set(this,{}),yt.set(this,null),ae.set(this,null),Pe.set(this,{}),ce.set(this,{}),Jt.set(this,void 0),yn.set(this,!1),M.set(this,void 0),le.set(this,!1),fe.set(this,!1),De.set(this,!1),$.set(this,void 0),An.set(this,{}),$t.set(this,null),it.set(this,void 0),O(this,M,i,"f"),O(this,Jt,t,"f"),O(this,se,e,"f"),O(this,xn,r,"f"),O(this,_t,new dn(this),"f"),this.$0=this[qs](),this[Hr](),O(this,ut,u(this,ut,"f"),"f"),O(this,$,u(this,$,"f"),"f"),O(this,it,u(this,it,"f"),"f"),O(this,P,u(this,P,"f"),"f"),u(this,P,"f").showHiddenOpt=u(this,Fn,"f"),O(this,ue,this[Ws](),"f"),u(this,M,"f").y18n.setLocale(Sc)}addHelpOpt(t,e){let r="help";return A("[string|boolean] [string]",[t,e],arguments.length),u(this,St,"f")&&(this[$r](u(this,St,"f")),O(this,St,null,"f")),t===!1&&e===void 0?this:(O(this,St,typeof t=="string"?t:r,"f"),this.boolean(u(this,St,"f")),this.describe(u(this,St,"f"),e||u(this,$,"f").deferY18nLookup("Show help")),this)}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(A("[string|boolean] [string]",[t,e],arguments.length),t===!1&&e===void 0)return this;let r=typeof t=="string"?t:u(this,Fn,"f");return this.boolean(r),this.describe(r,e||u(this,$,"f").deferY18nLookup("Show hidden options")),u(this,P,"f").showHiddenOpt=r,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return A("<object|string|array> [string|array]",[t,e],arguments.length),this[Ur](this.alias.bind(this),"alias",t,e),this}array(t){return A("<array|string>",[t],arguments.length),this[Qt]("array",t),this[pe](t),this}boolean(t){return A("<array|string>",[t],arguments.length),this[Qt]("boolean",t),this[pe](t),this}check(t,e){return A("<function> [boolean]",[t,e],arguments.length),this.middleware((r,i)=>ie(()=>t(r,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&u(this,$,"f").fail(s.toString(),s):u(this,$,"f").fail(u(this,M,"f").y18n.__("Argument check failed: %s",t.toString())),r),s=>(u(this,$,"f").fail(s.message?s.message:s.toString(),s),r)),!1,e),this}choices(t,e){return A("<object|string|array> [string|array]",[t,e],arguments.length),this[Ur](this.choices.bind(this),"choices",t,e),this}coerce(t,e){if(A("<object|string|array> [function]",[t,e],arguments.length),Array.isArray(t)){if(!e)throw new ot("coerce callback must be provided");for(let i of t)this.coerce(i,e);return this}else if(typeof t=="object"){for(let i of Object.keys(t))this.coerce(i,t[i]);return this}if(!e)throw new ot("coerce callback must be provided");let r=t;return u(this,P,"f").key[r]=!0,u(this,_t,"f").addCoerceMiddleware((i,s)=>{var o;let a=(o=s.getAliases()[r])!==null&&o!==void 0?o:[],f=[r,...a].filter(g=>Object.prototype.hasOwnProperty.call(i,g));return f.length===0?i:ie(()=>e(i[f[0]]),g=>(f.forEach(p=>{i[p]=g}),i),g=>{throw new ot(g.message)})},r),this}conflicts(t,e){return A("<string|object> [string|array]",[t,e],arguments.length),u(this,it,"f").conflicts(t,e),this}config(t="config",e,r){return A("[object|string] [string|function] [function]",[t,e,r],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=gn(t,u(this,se,"f"),this[he]()["deep-merge-config"]||!1,u(this,M,"f")),u(this,P,"f").configObjects=(u(this,P,"f").configObjects||[]).concat(t),this):(typeof e=="function"&&(r=e,e=void 0),this.describe(t,e||u(this,$,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{u(this,P,"f").config[i]=r||!0}),this)}completion(t,e,r){return A("[string] [string|boolean|function] [function]",[t,e,r],arguments.length),typeof e=="function"&&(r=e,e=void 0),O(this,xt,t||u(this,xt,"f")||"completion","f"),!e&&e!==!1&&(e="generate completion script"),this.command(u(this,xt,"f"),e),r&&u(this,Ft,"f").registerFunction(r),this}command(t,e,r,i,s,o){return A("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,r,i,s,o],arguments.length),u(this,ut,"f").addHandler(t,e,r,i,s,o),this}commands(t,e,r,i,s,o){return this.command(t,e,r,i,s,o)}commandDir(t,e){A("<string> [object]",[t,e],arguments.length);let r=u(this,xn,"f")||u(this,M,"f").require;return u(this,ut,"f").addDirectory(t,r,u(this,M,"f").getCallerFile(),e),this}count(t){return A("<array|string>",[t],arguments.length),this[Qt]("count",t),this[pe](t),this}default(t,e,r){return A("<object|string|array> [*] [string]",[t,e,r],arguments.length),r&&(Ir(t,u(this,M,"f")),u(this,P,"f").defaultDescription[t]=r),typeof e=="function"&&(Ir(t,u(this,M,"f")),u(this,P,"f").defaultDescription[t]||(u(this,P,"f").defaultDescription[t]=u(this,$,"f").functionDescription(e)),e=e.call()),this[Ie](this.default.bind(this),"default",t,e),this}defaults(t,e,r){return this.default(t,e,r)}demandCommand(t=1,e,r,i){return A("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,r,i],arguments.length),typeof e!="number"&&(r=e,e=1/0),this.global("_",!1),u(this,P,"f").demandedCommands._={min:t,max:e,minMsg:r,maxMsg:i},this}demand(t,e,r){return Array.isArray(e)?(e.forEach(i=>{gt(r,!0,u(this,M,"f")),this.demandOption(i,r)}),e=1/0):typeof e!="number"&&(r=e,e=1/0),typeof t=="number"?(gt(r,!0,u(this,M,"f")),this.demandCommand(t,e,r,r)):Array.isArray(t)?t.forEach(i=>{gt(r,!0,u(this,M,"f")),this.demandOption(i,r)}):typeof r=="string"?this.demandOption(t,r):(r===!0||typeof r>"u")&&this.demandOption(t),this}demandOption(t,e){return A("<object|string|array> [string]",[t,e],arguments.length),this[Ie](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return A("<string> [string|boolean]",[t,e],arguments.length),u(this,P,"f").deprecatedOptions[t]=e,this}describe(t,e){return A("<object|string|array> [string]",[t,e],arguments.length),this[Wr](t,!0),u(this,$,"f").describe(t,e),this}detectLocale(t){return A("<boolean>",[t],arguments.length),O(this,oe,t,"f"),this}env(t){return A("[string|boolean]",[t],arguments.length),t===!1?delete u(this,P,"f").envPrefix:u(this,P,"f").envPrefix=t||"",this}epilogue(t){return A("<string>",[t],arguments.length),u(this,$,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return A("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach(r=>this.example(...r)):u(this,$,"f").example(t,e),this}exit(t,e){O(this,wt,!0,"f"),O(this,Kt,e,"f"),u(this,Bt,"f")&&u(this,M,"f").process.exit(t)}exitProcess(t=!0){return A("[boolean]",[t],arguments.length),O(this,Bt,t,"f"),this}fail(t){if(A("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new ot("Invalid first argument. Expected function or boolean 'false'");return u(this,$,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return A("<array> [function]",[t,e],arguments.length),e?u(this,Ft,"f").getCompletion(t,e):new Promise((r,i)=>{u(this,Ft,"f").getCompletion(t,(s,o)=>{s?i(s):r(o)})})}getDemandedOptions(){return A([],0),u(this,P,"f").demandedOptions}getDemandedCommands(){return A([],0),u(this,P,"f").demandedCommands}getDeprecatedOptions(){return A([],0),u(this,P,"f").deprecatedOptions}getDetectLocale(){return u(this,oe,"f")}getExitProcess(){return u(this,Bt,"f")}getGroups(){return Object.assign({},u(this,Tt,"f"),u(this,ce,"f"))}getHelp(){if(O(this,wt,!0,"f"),!u(this,$,"f").hasCachedHelpMessage()){if(!this.parsed){let e=this[qe](u(this,Jt,"f"),void 0,void 0,0,!0);if(Q(e))return e.then(()=>u(this,$,"f").help())}let t=u(this,ut,"f").runDefaultBuilderOn(this);if(Q(t))return t.then(()=>u(this,$,"f").help())}return Promise.resolve(u(this,$,"f").help())}getOptions(){return u(this,P,"f")}getStrict(){return u(this,le,"f")}getStrictCommands(){return u(this,fe,"f")}getStrictOptions(){return u(this,De,"f")}global(t,e){return A("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),e!==!1?u(this,P,"f").local=u(this,P,"f").local.filter(r=>t.indexOf(r)===-1):t.forEach(r=>{u(this,P,"f").local.includes(r)||u(this,P,"f").local.push(r)}),this}group(t,e){A("<string|array> <string>",[t,e],arguments.length);let r=u(this,ce,"f")[e]||u(this,Tt,"f")[e];u(this,ce,"f")[e]&&delete u(this,ce,"f")[e];let i={};return u(this,Tt,"f")[e]=(r||[]).concat(t).filter(s=>i[s]?!1:i[s]=!0),this}hide(t){return A("<string>",[t],arguments.length),u(this,P,"f").hiddenOptions.push(t),this}implies(t,e){return A("<string|object> [number|string|array]",[t,e],arguments.length),u(this,it,"f").implies(t,e),this}locale(t){return A("[string]",[t],arguments.length),t===void 0?(this[Nr](),u(this,M,"f").y18n.getLocale()):(O(this,oe,!1,"f"),u(this,M,"f").y18n.setLocale(t),this)}middleware(t,e,r){return u(this,_t,"f").addMiddleware(t,!!e,r)}nargs(t,e){return A("<string|object|array> [number]",[t,e],arguments.length),this[Ie](this.nargs.bind(this),"narg",t,e),this}normalize(t){return A("<array|string>",[t],arguments.length),this[Qt]("normalize",t),this}number(t){return A("<array|string>",[t],arguments.length),this[Qt]("number",t),this[pe](t),this}option(t,e){if(A("<string|object> [object]",[t,e],arguments.length),typeof t=="object")Object.keys(t).forEach(r=>{this.options(r,t[r])});else{typeof e!="object"&&(e={}),this[pe](t),u(this,$t,"f")&&(t==="version"||e?.alias==="version")&&this[Vs](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
79
+ `),void 0,"versionWarning"),u(this,P,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);let r=e.deprecate||e.deprecated;r&&this.deprecateOption(t,r);let i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,typeof e.demandOption=="string"?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),e.implies!==void 0&&this.implies(t,e.implies),e.nargs!==void 0&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||e.type==="boolean")&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||e.type==="array")&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||e.type==="number")&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||e.type==="string")&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||e.type==="count")&&this.count(t),typeof e.global=="boolean"&&this.global(t,e.global),e.defaultDescription&&(u(this,P,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);let s=e.describe||e.description||e.desc,o=u(this,$,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(o,t)||typeof s=="string")&&this.describe(t,s),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,r){A("[string|array] [function|boolean|object] [function]",[t,e,r],arguments.length),this[Hs](),typeof t>"u"&&(t=u(this,Jt,"f")),typeof e=="object"&&(O(this,ae,e,"f"),e=r),typeof e=="function"&&(O(this,yt,e,"f"),e=!1),e||O(this,Jt,t,"f"),u(this,yt,"f")&&O(this,Bt,!1,"f");let i=this[qe](t,!!e),s=this.parsed;return u(this,Ft,"f").setParsed(this.parsed),Q(i)?i.then(o=>(u(this,yt,"f")&&u(this,yt,"f").call(this,u(this,Kt,"f"),o,u(this,Dt,"f")),o)).catch(o=>{throw u(this,yt,"f")&&u(this,yt,"f")(o,this.parsed.argv,u(this,Dt,"f")),o}).finally(()=>{this[Vr](),this.parsed=s}):(u(this,yt,"f")&&u(this,yt,"f").call(this,u(this,Kt,"f"),i,u(this,Dt,"f")),this[Vr](),this.parsed=s,i)}parseAsync(t,e,r){let i=this.parse(t,e,r);return Q(i)?i:Promise.resolve(i)}parseSync(t,e,r){let i=this.parse(t,e,r);if(Q(i))throw new ot(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return A("<object>",[t],arguments.length),O(this,wn,t,"f"),this}pkgConf(t,e){A("<string> [string]",[t,e],arguments.length);let r=null,i=this[Lr](e||u(this,se,"f"));return i[t]&&typeof i[t]=="object"&&(r=gn(i[t],e||u(this,se,"f"),this[he]()["deep-merge-config"]||!1,u(this,M,"f")),u(this,P,"f").configObjects=(u(this,P,"f").configObjects||[]).concat(r)),this}positional(t,e){A("<string> <object>",[t,e],arguments.length);let r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=Gt(e,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:r.includes(o));let i=u(this,He,"f").fullCommands[u(this,He,"f").fullCommands.length-1],s=i?u(this,ut,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return _e(s).forEach(o=>{let a=s[o];Array.isArray(a)?a.indexOf(t)!==-1&&(e[o]=!0):a[t]&&!(o in e)&&(e[o]=a[t])}),this.group(t,u(this,$,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return A("[boolean]",[t],arguments.length),O(this,yn,t,"f"),this}required(t,e,r){return this.demand(t,e,r)}require(t,e,r){return this.demand(t,e,r)}requiresArg(t){return A("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&u(this,P,"f").narg[t]?this:(this[Ie](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,e){return A("[string] [string]",[t,e],arguments.length),t=t||this.$0,u(this,ue,"f").log(u(this,Ft,"f").generateCompletionScript(t,e||u(this,xt,"f")||"completion")),this}showHelp(t){if(A("[string|function]",[t],arguments.length),O(this,wt,!0,"f"),!u(this,$,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[qe](u(this,Jt,"f"),void 0,void 0,0,!0);if(Q(r))return r.then(()=>{u(this,$,"f").showHelp(t)}),this}let e=u(this,ut,"f").runDefaultBuilderOn(this);if(Q(e))return e.then(()=>{u(this,$,"f").showHelp(t)}),this}return u(this,$,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return A("[boolean|string] [string]",[t,e],arguments.length),u(this,$,"f").showHelpOnFail(t,e),this}showVersion(t){return A("[string|function]",[t],arguments.length),u(this,$,"f").showVersion(t),this}skipValidation(t){return A("<array|string>",[t],arguments.length),this[Qt]("skipValidation",t),this}strict(t){return A("[boolean]",[t],arguments.length),O(this,le,t!==!1,"f"),this}strictCommands(t){return A("[boolean]",[t],arguments.length),O(this,fe,t!==!1,"f"),this}strictOptions(t){return A("[boolean]",[t],arguments.length),O(this,De,t!==!1,"f"),this}string(t){return A("<array|string>",[t],arguments.length),this[Qt]("string",t),this[pe](t),this}terminalWidth(){return A([],0),u(this,M,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return A("<object>",[t],arguments.length),O(this,oe,!1,"f"),u(this,M,"f").y18n.updateLocale(t),this}usage(t,e,r,i){if(A("<string|null|undefined> [string|boolean] [function|object] [function]",[t,e,r,i],arguments.length),e!==void 0){if(gt(t,null,u(this,M,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,e,r,i);throw new ot(".usage() description must start with $0 if being used as alias for .command()")}else return u(this,$,"f").usage(t),this}usageConfiguration(t){return A("<object>",[t],arguments.length),O(this,An,t,"f"),this}version(t,e,r){let i="version";if(A("[boolean|string] [string] [string]",[t,e,r],arguments.length),u(this,$t,"f")&&(this[$r](u(this,$t,"f")),u(this,$,"f").version(void 0),O(this,$t,null,"f")),arguments.length===0)r=this[Ys](),t=i;else if(arguments.length===1){if(t===!1)return this;r=t,t=i}else arguments.length===2&&(r=e,e=void 0);return O(this,$t,typeof t=="string"?t:i,"f"),e=e||u(this,$,"f").deferY18nLookup("Show version number"),u(this,$,"f").version(r||void 0),this.boolean(u(this,$t,"f")),this.describe(u(this,$t,"f"),e),this}wrap(t){return A("<number|null|undefined>",[t],arguments.length),u(this,$,"f").wrap(t),this}[(ut=new WeakMap,se=new WeakMap,He=new WeakMap,Ft=new WeakMap,xt=new WeakMap,Fn=new WeakMap,Kt=new WeakMap,oe=new WeakMap,Cn=new WeakMap,Bt=new WeakMap,En=new WeakMap,_t=new WeakMap,Tt=new WeakMap,wt=new WeakMap,St=new WeakMap,bn=new WeakMap,ue=new WeakMap,Dt=new WeakMap,P=new WeakMap,xn=new WeakMap,wn=new WeakMap,yt=new WeakMap,ae=new WeakMap,Pe=new WeakMap,ce=new WeakMap,Jt=new WeakMap,yn=new WeakMap,M=new WeakMap,le=new WeakMap,fe=new WeakMap,De=new WeakMap,$=new WeakMap,An=new WeakMap,$t=new WeakMap,it=new WeakMap,Rs)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[Ws](){return{log:(...t)=>{this[On]()||console.log(...t),O(this,wt,!0,"f"),u(this,Dt,"f").length&&O(this,Dt,u(this,Dt,"f")+`
80
+ `,"f"),O(this,Dt,u(this,Dt,"f")+t.join(" "),"f")},error:(...t)=>{this[On]()||console.error(...t),O(this,wt,!0,"f"),u(this,Dt,"f").length&&O(this,Dt,u(this,Dt,"f")+`
81
+ `,"f"),O(this,Dt,u(this,Dt,"f")+t.join(" "),"f")}}}[$r](t){_e(u(this,P,"f")).forEach(e=>{if((i=>i==="configObjects")(e))return;let r=u(this,P,"f")[e];Array.isArray(r)?r.includes(t)&&r.splice(r.indexOf(t),1):typeof r=="object"&&delete r[t]}),delete u(this,$,"f").getDescriptions()[t]}[Vs](t,e,r){u(this,Cn,"f")[r]||(u(this,M,"f").process.emitWarning(t,e),u(this,Cn,"f")[r]=!0)}[Hs](){u(this,En,"f").push({options:u(this,P,"f"),configObjects:u(this,P,"f").configObjects.slice(0),exitProcess:u(this,Bt,"f"),groups:u(this,Tt,"f"),strict:u(this,le,"f"),strictCommands:u(this,fe,"f"),strictOptions:u(this,De,"f"),completionCommand:u(this,xt,"f"),output:u(this,Dt,"f"),exitError:u(this,Kt,"f"),hasOutput:u(this,wt,"f"),parsed:this.parsed,parseFn:u(this,yt,"f"),parseContext:u(this,ae,"f")}),u(this,$,"f").freeze(),u(this,it,"f").freeze(),u(this,ut,"f").freeze(),u(this,_t,"f").freeze()}[qs](){let t="",e;return/\b(node|iojs|electron)(\.exe)?$/.test(u(this,M,"f").process.argv()[0])?e=u(this,M,"f").process.argv().slice(1,2):e=u(this,M,"f").process.argv().slice(0,1),t=e.map(r=>{let i=this[io](u(this,se,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<r.length?i:r}).join(" ").trim(),u(this,M,"f").getEnv("_")&&u(this,M,"f").getProcessArgvBin()===u(this,M,"f").getEnv("_")&&(t=u(this,M,"f").getEnv("_").replace(`${u(this,M,"f").path.dirname(u(this,M,"f").process.execPath())}/`,"")),t}[he](){return u(this,wn,"f")}[Gs](){return u(this,An,"f")}[Nr](){if(!u(this,oe,"f"))return;let t=u(this,M,"f").getEnv("LC_ALL")||u(this,M,"f").getEnv("LC_MESSAGES")||u(this,M,"f").getEnv("LANG")||u(this,M,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Ys](){return this[Lr]().version||"unknown"}[Ks](t){let e=t["--"]?t["--"]:t._;for(let r=0,i;(i=e[r])!==void 0;r++)u(this,M,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(e[r]=Number(i));return t}[Lr](t){let e=t||"*";if(u(this,Pe,"f")[e])return u(this,Pe,"f")[e];let r={};try{let i=t||u(this,M,"f").mainFilename;u(this,M,"f").path.extname(i)&&(i=u(this,M,"f").path.dirname(i));let s=u(this,M,"f").findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});gt(s,void 0,u(this,M,"f")),r=JSON.parse(u(this,M,"f").readFileSync(s,"utf8"))}catch{}return u(this,Pe,"f")[e]=r||{},u(this,Pe,"f")[e]}[Qt](t,e){e=[].concat(e),e.forEach(r=>{r=this[Rr](r),u(this,P,"f")[t].push(r)})}[Ie](t,e,r,i){this[zr](t,e,r,i,(s,o,a)=>{u(this,P,"f")[s][o]=a})}[Ur](t,e,r,i){this[zr](t,e,r,i,(s,o,a)=>{u(this,P,"f")[s][o]=(u(this,P,"f")[s][o]||[]).concat(a)})}[zr](t,e,r,i,s){if(Array.isArray(r))r.forEach(o=>{t(o,i)});else if((o=>typeof o=="object")(r))for(let o of _e(r))t(o,r[o]);else s(e,this[Rr](r),i)}[Rr](t){return t==="__proto__"?"___proto___":t}[Wr](t,e){return this[Ie](this[Wr].bind(this),"key",t,e),this}[Vr](){var t,e,r,i,s,o,a,f,g,p,l,m;let E=u(this,En,"f").pop();gt(E,void 0,u(this,M,"f"));let C;t=this,e=this,r=this,i=this,s=this,o=this,a=this,f=this,g=this,p=this,l=this,m=this,{options:{set value(b){O(t,P,b,"f")}}.value,configObjects:C,exitProcess:{set value(b){O(e,Bt,b,"f")}}.value,groups:{set value(b){O(r,Tt,b,"f")}}.value,output:{set value(b){O(i,Dt,b,"f")}}.value,exitError:{set value(b){O(s,Kt,b,"f")}}.value,hasOutput:{set value(b){O(o,wt,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){O(a,le,b,"f")}}.value,strictCommands:{set value(b){O(f,fe,b,"f")}}.value,strictOptions:{set value(b){O(g,De,b,"f")}}.value,completionCommand:{set value(b){O(p,xt,b,"f")}}.value,parseFn:{set value(b){O(l,yt,b,"f")}}.value,parseContext:{set value(b){O(m,ae,b,"f")}}.value}=E,u(this,P,"f").configObjects=C,u(this,$,"f").unfreeze(),u(this,it,"f").unfreeze(),u(this,ut,"f").unfreeze(),u(this,_t,"f").unfreeze()}[Js](t,e){return ie(e,r=>(t(r),r))}getInternalMethods(){return{getCommandInstance:this[Qs].bind(this),getContext:this[Zs].bind(this),getHasOutput:this[Xs].bind(this),getLoggerInstance:this[ks].bind(this),getParseContext:this[to].bind(this),getParserConfiguration:this[he].bind(this),getUsageConfiguration:this[Gs].bind(this),getUsageInstance:this[eo].bind(this),getValidationInstance:this[no].bind(this),hasParseCallback:this[On].bind(this),isGlobalContext:this[ro].bind(this),postProcess:this[de].bind(this),reset:this[Hr].bind(this),runValidation:this[qr].bind(this),runYargsParserAndExecuteCommands:this[qe].bind(this),setHasOutput:this[so].bind(this)}}[Qs](){return u(this,ut,"f")}[Zs](){return u(this,He,"f")}[Xs](){return u(this,wt,"f")}[ks](){return u(this,ue,"f")}[to](){return u(this,ae,"f")||{}}[eo](){return u(this,$,"f")}[no](){return u(this,it,"f")}[On](){return!!u(this,yt,"f")}[ro](){return u(this,bn,"f")}[de](t,e,r,i){return r||Q(t)||(e||(t=this[Rs](t)),(this[he]()["parse-positional-numbers"]||this[he]()["parse-positional-numbers"]===void 0)&&(t=this[Ks](t)),i&&(t=re(t,this,u(this,_t,"f").getMiddleware(),!1))),t}[Hr](t={}){O(this,P,u(this,P,"f")||{},"f");let e={};e.local=u(this,P,"f").local||[],e.configObjects=u(this,P,"f").configObjects||[];let r={};e.local.forEach(o=>{r[o]=!0,(t[o]||[]).forEach(a=>{r[a]=!0})}),Object.assign(u(this,ce,"f"),Object.keys(u(this,Tt,"f")).reduce((o,a)=>{let f=u(this,Tt,"f")[a].filter(g=>!(g in r));return f.length>0&&(o[a]=f),o},{})),O(this,Tt,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{e[o]=(u(this,P,"f")[o]||[]).filter(a=>!r[a])}),s.forEach(o=>{e[o]=Gt(u(this,P,"f")[o],a=>!r[a])}),e.envPrefix=u(this,P,"f").envPrefix,O(this,P,e,"f"),O(this,$,u(this,$,"f")?u(this,$,"f").reset(r):js(this,u(this,M,"f")),"f"),O(this,it,u(this,it,"f")?u(this,it,"f").reset(r):Us(this,u(this,$,"f"),u(this,M,"f")),"f"),O(this,ut,u(this,ut,"f")?u(this,ut,"f").reset():Ps(u(this,$,"f"),u(this,it,"f"),u(this,_t,"f"),u(this,M,"f")),"f"),u(this,Ft,"f")||O(this,Ft,$s(this,u(this,$,"f"),u(this,ut,"f"),u(this,M,"f")),"f"),u(this,_t,"f").reset(),O(this,xt,null,"f"),O(this,Dt,"","f"),O(this,Kt,null,"f"),O(this,wt,!1,"f"),this.parsed=!1,this}[io](t,e){return u(this,M,"f").path.relative(t,e)}[qe](t,e,r,i=0,s=!1){var o,a,f,g;let p=!!r||s;t=t||u(this,Jt,"f"),u(this,P,"f").__=u(this,M,"f").y18n.__,u(this,P,"f").configuration=this[he]();let l=!!u(this,P,"f").configuration["populate--"],m=Object.assign({},u(this,P,"f").configuration,{"populate--":!0}),E=u(this,M,"f").Parser.detailed(t,Object.assign({},u(this,P,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),C=Object.assign(E.argv,u(this,ae,"f")),b,d=E.aliases,v=!1,z=!1;Object.keys(C).forEach(L=>{L===u(this,St,"f")&&C[L]?v=!0:L===u(this,$t,"f")&&C[L]&&(z=!0)}),C.$0=this.$0,this.parsed=E,i===0&&u(this,$,"f").clearCachedHelpMessage();try{if(this[Nr](),e)return this[de](C,l,!!r,!1);u(this,St,"f")&&[u(this,St,"f")].concat(d[u(this,St,"f")]||[]).filter(H=>H.length>1).includes(""+C._[C._.length-1])&&(C._.pop(),v=!0),O(this,bn,!1,"f");let L=u(this,ut,"f").getCommands(),U=!((o=u(this,Ft,"f"))===null||o===void 0)&&o.completionKey?[(a=u(this,Ft,"f"))===null||a===void 0?void 0:a.completionKey,...(g=this.getAliases()[(f=u(this,Ft,"f"))===null||f===void 0?void 0:f.completionKey])!==null&&g!==void 0?g:[]].some(W=>Object.prototype.hasOwnProperty.call(C,W)):!1,R=v||U||s;if(C._.length){if(L.length){let W;for(let H=i||0,K;C._[H]!==void 0;H++)if(K=String(C._[H]),L.includes(K)&&K!==u(this,xt,"f")){let dt=u(this,ut,"f").runCommand(K,this,E,H+1,s,v||z||s);return this[de](dt,l,!!r,!1)}else if(!W&&K!==u(this,xt,"f")){W=K;break}!u(this,ut,"f").hasDefaultCommand()&&u(this,yn,"f")&&W&&!R&&u(this,it,"f").recommendCommands(W,L)}u(this,xt,"f")&&C._.includes(u(this,xt,"f"))&&!U&&(u(this,Bt,"f")&&Yt(!0),this.showCompletionScript(),this.exit(0))}if(u(this,ut,"f").hasDefaultCommand()&&!R){let W=u(this,ut,"f").runCommand(null,this,E,0,s,v||z||s);return this[de](W,l,!!r,!1)}if(U){u(this,Bt,"f")&&Yt(!0),t=[].concat(t);let W=t.slice(t.indexOf(`--${u(this,Ft,"f").completionKey}`)+1);return u(this,Ft,"f").getCompletion(W,(H,K)=>{if(H)throw new ot(H.message);(K||[]).forEach(dt=>{u(this,ue,"f").log(dt)}),this.exit(0)}),this[de](C,!l,!!r,!1)}if(u(this,wt,"f")||(v?(u(this,Bt,"f")&&Yt(!0),p=!0,this.showHelp(W=>{u(this,ue,"f").log(W),this.exit(0)})):z&&(u(this,Bt,"f")&&Yt(!0),p=!0,u(this,$,"f").showVersion("log"),this.exit(0))),!p&&u(this,P,"f").skipValidation.length>0&&(p=Object.keys(C).some(W=>u(this,P,"f").skipValidation.indexOf(W)>=0&&C[W]===!0)),!p){if(E.error)throw new ot(E.error.message);if(!U){let W=this[qr](d,{},E.error);r||(b=re(C,this,u(this,_t,"f").getMiddleware(),!0)),b=this[Js](W,b??C),Q(b)&&!r&&(b=b.then(()=>re(C,this,u(this,_t,"f").getMiddleware(),!1)))}}}catch(L){if(L instanceof ot)u(this,$,"f").fail(L.message,L);else throw L}return this[de](b??C,l,!!r,!0)}[qr](t,e,r,i){let s={...this.getDemandedOptions()};return o=>{if(r)throw new ot(r.message);u(this,it,"f").nonOptionCount(o),u(this,it,"f").requiredArguments(o,s);let a=!1;u(this,fe,"f")&&(a=u(this,it,"f").unknownCommands(o)),u(this,le,"f")&&!a?u(this,it,"f").unknownArguments(o,t,e,!!i):u(this,De,"f")&&u(this,it,"f").unknownArguments(o,t,{},!1,!1),u(this,it,"f").limitedChoices(o),u(this,it,"f").implications(o),u(this,it,"f").conflicting(o)}}[so](){O(this,wt,!0,"f")}[pe](t){if(typeof t=="string")u(this,P,"f").key[t]=!0;else for(let e of t)u(this,P,"f").key[e]=!0}};function Is(n){return!!n&&typeof n.getInternalMethods=="function"}var Pc=oo(ys),uo=Pc;var fo=me(co(),1),jc={},Ic=process.argv.slice(2),lo=new fo.default(uo),Kr=console.log;async function Jr(n){lo.yargs.option("listen",{desc:"daemon control listen multiaddr",type:"string",default:"/unix/tmp/p2pd.sock"}).option("quiet",{alias:"q",desc:"be quiet",type:"boolean",default:!1}).option("id",{desc:"peer identity; private key file",type:"string",default:""}).option("hostAddrs",{desc:"Comma separated list of multiaddrs the host should listen on",type:"string",default:""}).option("announceAddrs",{desc:"Comma separated list of multiaddrs the host should announce to the network",type:"string",default:""}).option("bootstrap",{alias:"b",desc:"Connects to bootstrap peers and bootstraps the dht if enabled",type:"boolean",default:!1}).option("bootstrapPeers",{desc:"Comma separated list of bootstrap peers; defaults to the IPFS DHT peers",type:"string",default:""}).option("dht",{desc:"Enables the DHT in full node mode",type:"boolean",default:!1}).option("dhtClient",{desc:"(Not yet supported) Enables the DHT in client mode",type:"boolean",default:!1}).option("nat",{desc:"Enables UPnP NAT hole punching",type:"boolean",default:!1}).option("connMgr",{desc:"(Not yet supported) Enables the Connection Manager",type:"boolean",default:!1}).option("connMgrLo",{desc:"Number identifying the number of peers below which this node will not activate preemptive disconnections",type:"number"}).option("connMgrHi",{desc:"Number identifying the maximum number of peers the current peer is willing to be connected to before is starts disconnecting",type:"number"}).option("pubsub",{desc:"Enables pubsub",type:"boolean",default:!1}).option("pubsubRouter",{desc:"Specifies the pubsub router implementation",type:"string",default:"gossipsub"}).fail((i,s,o)=>{if(s!=null)throw s;Ic.length>0&&Kr(i),o.showHelp()});let{data:t,argv:e}=await lo.parse(n);t!=null&&(Kr(t),process.exit(0)),await(await Do($i(e.listen),e)).start(),e.quiet!==!0&&Kr("daemon has started")}async function Do(n,t){throw new Error("Not implemented yet")}dr(jc)&&Jr(process.argv).catch(n=>{console.error(n),process.exit(1)});return Co(vc);})();
82
82
  /*! Bundled license information:
83
83
 
84
84
  yargs-parser/build/lib/string-utils.js: