cf 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/{abuse-reports-Dy76QPNP.mjs → abuse-reports-Ina5TlsU.mjs} +2 -2
- package/dist/{accounts-CjtZ8x1z.mjs → accounts-B_joQcMi.mjs} +9 -9
- package/dist/{acm-C2lYIWs1.mjs → acm-_kIHqYME.mjs} +2 -2
- package/dist/{addressing-CHFK6uxW.mjs → addressing-CaFlw8y1.mjs} +10 -10
- package/dist/{agent-context-CgGCT0xU.mjs → agent-context-DMPfi54f.mjs} +1 -1
- package/dist/ai-CqnhNb_c.mjs +2 -0
- package/dist/ai-gateway-pgYGI519.mjs +8 -0
- package/dist/ai-search-eqQMPQol.mjs +7 -0
- package/dist/ai_gateway--vuVLnOm.mjs +4 -0
- package/dist/{alerting-Bk85NNf5.mjs → alerting-CPxHiYHb.mjs} +5 -5
- package/dist/{analytics-CkhhhZWZ.mjs → analytics-DSSRDZz8.mjs} +1 -1
- package/dist/analytics_engine-gWyfnsCs.mjs +2 -0
- package/dist/{api-gateway-CWdR4Ne7.mjs → api-gateway-BXXGFCVR.mjs} +10 -10
- package/dist/argo-aC6A3JyX.mjs +2 -0
- package/dist/artifacts-HD4V2xpK.mjs +4 -0
- package/dist/audit-logs-BuExU_nz.mjs +2 -0
- package/dist/auth-CSC4yhEJ.mjs +9 -0
- package/dist/auth-D5hNsOFq.mjs +5 -0
- package/dist/billing-COaghyxl.mjs +2 -0
- package/dist/bot-management-DmEzeV1Y.mjs +5 -0
- package/dist/botnet-feed-ByEAXAkw.mjs +3 -0
- package/dist/brand-protection-dPrGe8sL.mjs +3 -0
- package/dist/{browser-rendering-Rae0AUt0.mjs → browser-rendering-BiSGnpBf.mjs} +3 -3
- package/dist/{build-BE4o4imx.mjs → build-HuS9-R0V.mjs} +2 -2
- package/dist/{cache-B7pRbpTy.mjs → cache-CY-7Lt71.mjs} +4 -4
- package/dist/{calls-DXRWsZ8n.mjs → calls-wOQGDWPl.mjs} +3 -3
- package/dist/certificate-authorities-CtqzAtxQ.mjs +2 -0
- package/dist/client-certificates-CRf41xLe.mjs +3 -0
- package/dist/cloud-connector-BA5IRZUP.mjs +2 -0
- package/dist/{cloudforce-one-B6HYfk5Z.mjs → cloudforce-one-Bq_qPAWs.mjs} +20 -20
- package/dist/{completions-D_9WsLG7.mjs → completions-DOeHPdCG.mjs} +2 -2
- package/dist/{config-7CBz8Xm0.mjs → config-B5k-XbwS.mjs} +1 -1
- package/dist/connectivity-Bx3MgTHX.mjs +3 -0
- package/dist/connector-interrupts-D7ylweJZ.mjs +2 -0
- package/dist/connector-telemetry-events-6izV1kbP.mjs +2 -0
- package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +2 -0
- package/dist/connectors-DRt4e6d_.mjs +3 -0
- package/dist/{content-scanning-CnW2A0pv.mjs → content-scanning-Cd2vy5Sz.mjs} +3 -3
- package/dist/context-jpewmual.mjs +2 -0
- package/dist/{custom-certificates-CnYh6Yi-.mjs → custom-certificates-DYE-9epx.mjs} +3 -3
- package/dist/{custom-hostnames-C2upqZso.mjs → custom-hostnames-CtuTdFcX.mjs} +4 -4
- package/dist/custom-nameservers-CWqA51in.mjs +3 -0
- package/dist/custom-pages-DeUKEFGe.mjs +4 -0
- package/dist/d1-DvWY9Gp4.mjs +4 -0
- package/dist/data-security-BPo6dIWu.mjs +6 -0
- package/dist/dcv-delegation-Bgf86J-r.mjs +2 -0
- package/dist/{deploy-KBRFIatG.mjs → deploy-dVrgDUOp.mjs} +1 -1
- package/dist/{dev-pPazzZvt.mjs → dev-C01_Lby6.mjs} +1 -1
- package/dist/diagnostics-6nKPmVgz.mjs +3 -0
- package/dist/{dispatch-namespaces-Cz2rajnP.mjs → dispatch-namespaces-64lXx2WJ.mjs} +6 -6
- package/dist/{dist-DpDjsWWn.mjs → dist-C6zxsVdY.mjs} +2 -2
- package/dist/{dist-DA54ZQu0.mjs → dist-t_YrL25p.mjs} +1 -1
- package/dist/{dns-62t95Xif.mjs → dns-ClciFGxx.mjs} +13 -13
- package/dist/dns-firewall-DfUmXDCe.mjs +57 -0
- package/dist/durable-objects-CMaYZ-YU.mjs +2 -0
- package/dist/{email-routing-BDUYYeV3.mjs → email-routing-CGXhFqF5.mjs} +9 -9
- package/dist/{email-security-ChHA6eqQ.mjs → email-security-D5viPq8S.mjs} +7 -7
- package/dist/email-sending-C2jpc3gh.mjs +3 -0
- package/dist/{filters-qJpU9uAS.mjs → filters-bzsFcWt0.mjs} +3 -3
- package/dist/{firewall-C3DDwfwh.mjs → firewall-DYZcTtIC.mjs} +10 -10
- package/dist/{fraud-DY3YXFVf.mjs → fraud-C03MtdZb.mjs} +1 -1
- package/dist/google-tag-gateway-Dfy887yA.mjs +2 -0
- package/dist/{healthchecks-Drvb79v0.mjs → healthchecks-DRoAlWgr.mjs} +3 -3
- package/dist/hostnames-CFgIVI3s.mjs +3 -0
- package/dist/hyperdrive-C7-gwTSV.mjs +18 -0
- package/dist/iam-DqVPzGrb.mjs +6 -0
- package/dist/{images-D1jI3r3O.mjs → images-BYfl4YgR.mjs} +6 -6
- package/dist/index.mjs +1 -1
- package/dist/intel-duTEPIHc.mjs +3 -0
- package/dist/{ips-B6JETVOY.mjs → ips-nv9INuWZ.mjs} +1 -1
- package/dist/keyless-certificates-CRCDVd3g.mjs +3 -0
- package/dist/{kv-CSWoD9ks.mjs → kv-CZoV4tiv.mjs} +4 -4
- package/dist/leaked-credential-checks-DNIBg7Pe.mjs +3 -0
- package/dist/{load-balancers-Du1tNuUt.mjs → load-balancers--OMg0HNt.mjs} +5 -5
- package/dist/{logpush-SuJyO-uX.mjs → logpush-C0_lZTyY.mjs} +3 -3
- package/dist/{logs-DcDNRPRl.mjs → logs-BtpWZQfV.mjs} +2 -2
- package/dist/magic-cloud-networking-u6rwYbGg.mjs +5 -0
- package/dist/{magic-network-monitoring-CqtvOePQ.mjs → magic-network-monitoring-CKgQyRj4.mjs} +3 -3
- package/dist/{magic-transit-BTbkhBtF.mjs → magic-transit-CLhMcJ_-.mjs} +32 -32
- package/dist/managed-transforms-D0Z2mlth.mjs +3 -0
- package/dist/mtls-certificates-BL65NK5T.mjs +3 -0
- package/dist/{network-interconnects-DsiNytOU.mjs → network-interconnects-Bgu9gmaG.mjs} +5 -5
- package/dist/oauth-Bk-F-tIO.mjs +52 -0
- package/dist/{observability-CLqZ7OSi.mjs → observability-BynRbTF4.mjs} +3 -3
- package/dist/{open-YWOUIZ5Y-BpqIuBsR.mjs → open-YWOUIZ5Y-3jqSKAB1.mjs} +1 -1
- package/dist/{organizations-aRi1bhFC.mjs → organizations-BqJHyvMK.mjs} +3 -3
- package/dist/origin-ca-certificates-BGvYwm3C.mjs +3 -0
- package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +2 -0
- package/dist/{origin-tls-client-auth-CnQNy9-l.mjs → origin-tls-client-auth-d3snC3vr.mjs} +3 -3
- package/dist/{output-CUxZRM5A.mjs → output-B6fBFRqe.mjs} +1 -1
- package/dist/{page-rules-CYqtPU1p.mjs → page-rules-EZHJePmn.mjs} +4 -4
- package/dist/{page-shield-D8l9ZMUl.mjs → page-shield-CXJioWPs.mjs} +5 -5
- package/dist/{pages-ChurJ2H7.mjs → pages-D4aYteKk.mjs} +8 -8
- package/dist/{pipelines-CeyujvRf.mjs → pipelines-G8Iusxq-.mjs} +5 -5
- package/dist/progress-DrDErV9w.mjs +2 -0
- package/dist/queues-DEkbKqZX.mjs +6 -0
- package/dist/{r2-BtuTO3vQ.mjs → r2-CV0IkCAW.mjs} +9 -9
- package/dist/r2-data-catalog-NtqGC_a_.mjs +14 -0
- package/dist/{radar-CzGM92uM.mjs → radar-D986zPJr.mjs} +1 -1
- package/dist/{rate-limits-Bbk7HxP7.mjs → rate-limits-B2wRsUX1.mjs} +3 -3
- package/dist/raw-fetch-_n0lMAnD.mjs +2 -0
- package/dist/{realtime-kit-CivLpkpg.mjs → realtime-kit-Ld3c5eU6.mjs} +9 -9
- package/dist/{registrar-8IeA5DKd.mjs → registrar-CDIwTz3G.mjs} +6 -6
- package/dist/request-tracers-D7SFMDik.mjs +2 -0
- package/dist/{resource-sharing-B-Pcto7-.mjs → resource-sharing-YIQ04jXE.mjs} +4 -4
- package/dist/{resource-tagging-Bpb6Qq1M.mjs → resource-tagging-Bd6Y03sg.mjs} +7 -7
- package/dist/rules-DHjLP5Kx.mjs +4 -0
- package/dist/{rulesets-lYczEcJp.mjs → rulesets-q4QABpKs.mjs} +7 -7
- package/dist/rum-SmT4HZmM.mjs +4 -0
- package/dist/{schema-hefO-tzo.mjs → schema-BR31o4P6.mjs} +1 -1
- package/dist/{schema-validation-DTq517Em.mjs → schema-validation-vVetgC_P.mjs} +5 -5
- package/dist/{scim-BiLfOQ89.mjs → scim-ChOkZpNx.mjs} +2 -2
- package/dist/{session-CsvPYFj8.mjs → sdk-DhIhH6GB.mjs} +4 -4
- package/dist/{secrets-store-CBX0dvHL.mjs → secrets-store-BAK9G12O.mjs} +12 -12
- package/dist/security-center-eScuYDKP.mjs +2 -0
- package/dist/security-txt-x7R4gmQu.mjs +3 -0
- package/dist/session-DHYCE-PM.mjs +93 -0
- package/dist/shared-BAjo72Lz.mjs +2 -0
- package/dist/{smart-shield-DblHIce0.mjs → smart-shield-CWlSsNi8.mjs} +2 -2
- package/dist/snippets-DrlgYJYp.mjs +4 -0
- package/dist/{spawn-DK7pott_.mjs → spawn-CCGzKlC4.mjs} +1 -1
- package/dist/{spectrum-CnrG0jIC.mjs → spectrum-pVGxb7u5.mjs} +6 -6
- package/dist/speed-ZFrMWDgd.mjs +4 -0
- package/dist/src-DU7FBCOX.mjs +108 -0
- package/dist/ssl-9JY05sYt.mjs +15 -0
- package/dist/{stream-CGTRN4ZN.mjs → stream-tRU39b8K.mjs} +13 -13
- package/dist/{tenants-o_M62Y1n.mjs → tenants-HLGUazms.mjs} +1 -1
- package/dist/{token-validation-Ca5AGEns.mjs → token-validation-_VdamKpz.mjs} +4 -4
- package/dist/{tools-DtNNmO6l.mjs → tools-D_hfUU_Z.mjs} +1 -1
- package/dist/{turnstile-l7mo9BWL.mjs → turnstile-BRzXd28B.mjs} +4 -4
- package/dist/{ui-B97lRnOv.mjs → ui-erjBdVKL.mjs} +1 -1
- package/dist/url-normalization-D-NxuLtN.mjs +3 -0
- package/dist/url-scanner-BzzR6iDx.mjs +2 -0
- package/dist/{user-CiyYZ69X.mjs → user-C4omq__w.mjs} +1 -1
- package/dist/vectorize-By6EqcNR.mjs +4 -0
- package/dist/{versions-B6E8WQyA.mjs → versions-CBHwWPAM.mjs} +1 -1
- package/dist/{waiting-rooms-Bhy_nuV3.mjs → waiting-rooms-u6KwrzWd.mjs} +6 -6
- package/dist/{web3-DlHE0CZc.mjs → web3-DQ5dmE9W.mjs} +3 -3
- package/dist/{workers-DRAkU6YR.mjs → workers-D8Be7_as.mjs} +14 -14
- package/dist/workers-builds-BE3W3qNk.mjs +7 -0
- package/dist/{workflows-z6oapEJs.mjs → workflows-BWWufqFA.mjs} +3 -3
- package/dist/zaraz-Bsa9AvVL.mjs +2 -0
- package/dist/{zero-trust-fyyIelWx.mjs → zero-trust-UNVZFnKu.mjs} +87 -87
- package/dist/zero_trust-B0_Rk4p2.mjs +3 -0
- package/dist/{zones-MSULnDwW.mjs → zones-BXtdwt6E.mjs} +6 -6
- package/package.json +1 -1
- package/dist/ai-DS3i-I1a.mjs +0 -2
- package/dist/ai-gateway-RIsegO2x.mjs +0 -8
- package/dist/ai-search-Dcj4BauG.mjs +0 -7
- package/dist/ai_gateway-w7YwfcPE.mjs +0 -4
- package/dist/analytics_engine-B7qgDJCA.mjs +0 -2
- package/dist/argo-DnJRVnGX.mjs +0 -2
- package/dist/artifacts-BVWKiJUl.mjs +0 -4
- package/dist/audit-logs-DjTstbzL.mjs +0 -2
- package/dist/auth-BqDOIrKX.mjs +0 -150
- package/dist/auth-DKkSwnxh.mjs +0 -5
- package/dist/billing-3rEqF83h.mjs +0 -2
- package/dist/bot-management-CJxD1pqi.mjs +0 -5
- package/dist/botnet-feed-MG91D7BR.mjs +0 -3
- package/dist/brand-protection-CK7gJi06.mjs +0 -3
- package/dist/certificate-authorities-BR3gXBLs.mjs +0 -2
- package/dist/client-certificates-B0ebLJdk.mjs +0 -3
- package/dist/cloud-connector-BOjaggJk.mjs +0 -2
- package/dist/connectivity-welFvZ7X.mjs +0 -3
- package/dist/connector-interrupts-DTV3F-50.mjs +0 -2
- package/dist/connector-telemetry-events-kDqb_AGm.mjs +0 -2
- package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +0 -2
- package/dist/connectors-3vjrdFLB.mjs +0 -3
- package/dist/context-CONbNKO-.mjs +0 -2
- package/dist/custom-nameservers-BGkAD_PZ.mjs +0 -3
- package/dist/custom-pages-5fCSP8in.mjs +0 -4
- package/dist/d1-CyiRbZZn.mjs +0 -4
- package/dist/data-security-Casx4OS_.mjs +0 -6
- package/dist/dcv-delegation-DVYO10oA.mjs +0 -2
- package/dist/diagnostics-BqYDoDfw.mjs +0 -3
- package/dist/dns-firewall-Coy8d47t.mjs +0 -57
- package/dist/durable-objects-BSuRERkw.mjs +0 -2
- package/dist/email-sending-CVrRqn6S.mjs +0 -3
- package/dist/google-tag-gateway-B00MHDfB.mjs +0 -2
- package/dist/hostnames-BdAQo1Mr.mjs +0 -3
- package/dist/hyperdrive-99OJV9nl.mjs +0 -18
- package/dist/iam-BRbpg3lN.mjs +0 -6
- package/dist/intel-C3ajLpXd.mjs +0 -3
- package/dist/keyless-certificates-C4MZ4xnf.mjs +0 -3
- package/dist/leaked-credential-checks-Dgs2oKm9.mjs +0 -3
- package/dist/magic-cloud-networking-D-T0RCvi.mjs +0 -5
- package/dist/managed-transforms-CfUBSz9p.mjs +0 -3
- package/dist/mtls-certificates-Cf1O8c2E.mjs +0 -3
- package/dist/origin-ca-certificates-BB4H89a_.mjs +0 -3
- package/dist/origin-post-quantum-encryption-DurP3PXG.mjs +0 -2
- package/dist/progress-Cent9Lsg.mjs +0 -2
- package/dist/queues-Rf_n11Cx.mjs +0 -6
- package/dist/r2-data-catalog-Debz38kv.mjs +0 -14
- package/dist/raw-fetch-DnbAMFBp.mjs +0 -2
- package/dist/request-tracers-D1aH4NmL.mjs +0 -2
- package/dist/rules-B10XWY10.mjs +0 -4
- package/dist/rum-B5GUKa4I.mjs +0 -4
- package/dist/security-center-AVpTOBK3.mjs +0 -2
- package/dist/security-txt-DVlh8y9l.mjs +0 -3
- package/dist/shared-0bwWVDLo.mjs +0 -2
- package/dist/snippets-DrpqSXYC.mjs +0 -4
- package/dist/speed-BzRY3Xlh.mjs +0 -4
- package/dist/src-D9_Gq68b.mjs +0 -108
- package/dist/ssl-Cp6tQkZH.mjs +0 -15
- package/dist/url-normalization-D1CogSIG.mjs +0 -3
- package/dist/url-scanner-BnJHJqcz.mjs +0 -2
- package/dist/vectorize-D3LgMLOn.mjs +0 -4
- package/dist/workers-builds-BmNjiHDZ.mjs +0 -7
- package/dist/zaraz-CyzfYOEU.mjs +0 -2
- package/dist/zero_trust-BAhlNkjo.mjs +0 -3
- /package/dist/{body-parser-CBpeIUns.mjs → body-parser-DWSy7uZ8.mjs} +0 -0
- /package/dist/{chunk-6IEM75FG-U3L9fKgi.mjs → chunk-6IEM75FG-BEjRFMGh.mjs} +0 -0
- /package/dist/{cli-types-CMNMD1V7.mjs → cli-types-BeyOc81z.mjs} +0 -0
- /package/dist/{input-validation-CTqtyiY9.mjs → input-validation-_fMCApaH.mjs} +0 -0
- /package/dist/{lib-B6xvCJjc.mjs → lib-4PQI6yRW.mjs} +0 -0
- /package/dist/{local-D8bhHUMK.mjs → local-CYc9q7l2.mjs} +0 -0
- /package/dist/{metadata-jh2EIan8.mjs → metadata-OOwvpR8m.mjs} +0 -0
- /package/dist/{resolve-D1mG0REg.mjs → resolve-C3h-mwp7.mjs} +0 -0
- /package/dist/{theme-CFHr0Dh9.mjs → theme-DbNbIY4d.mjs} +0 -0
package/dist/src-D9_Gq68b.mjs
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{o as e,t}from"./chunk-DH-VkVmc.mjs";import{c as n,i as r,l as i,n as a,s as o,t as s}from"./session-CsvPYFj8.mjs";import{R as c}from"./dist-DpDjsWWn.mjs";import{a as l,n as u,t as d}from"./theme-CFHr0Dh9.mjs";import{a as f,t as p}from"./ui-B97lRnOv.mjs";import{createRequire as m}from"node:module";import{notStrictEqual as h,strictEqual as g}from"assert";import{basename as ee,dirname as _,extname as te,join as v,normalize as ne,relative as re,resolve as y}from"path";import{readFileSync as b,readdirSync as x,statSync as S,writeFile as ie}from"fs";import{format as C,inspect as ae}from"util";import{fileURLToPath as oe}from"url";import{readFileSync as se,readdirSync as ce}from"node:fs";const le={right:me,center:w};var ue=class{constructor(e){this.width=e.width,this.wrap=e.wrap??!0,this.rows=[]}span(...e){let t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(``),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]==`string`)return this.applyLayoutDSL(e[0]);let t=e.map(e=>typeof e==`string`?this.colFromString(e):e);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]==`string`&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
|
|
3
|
-
`).map(e=>e.split(` `)),n=0;return t.forEach(e=>{e.length>1&&T.stringWidth(e[0])>n&&(n=Math.min(Math.floor(this.width*.5),T.stringWidth(e[0])))}),t.forEach(e=>{this.div(...e.map((t,r)=>({text:t.trim(),padding:this.measurePadding(t),width:r===0&&e.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let t=T.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(t=>{this.rowToString(t,e)}),e.filter(e=>!e.hidden).map(e=>e.text).join(`
|
|
4
|
-
`)}rowToString(e,t){return this.rasterize(e).forEach((n,r)=>{let i=``;n.forEach((n,a)=>{let{width:o}=e[a],s=this.negatePadding(e[a]),c=n;if(s>T.stringWidth(n)&&(c+=` `.repeat(s-T.stringWidth(n))),e[a].align&&e[a].align!==`left`&&this.wrap){let t=le[e[a].align];c=t(c,s),T.stringWidth(c)<s&&(c+=` `.repeat((o||0)-T.stringWidth(c)-1))}let l=e[a].padding||[0,0,0,0];l[3]&&(i+=` `.repeat(l[3])),i+=de(e[a],c,`| `),i+=c,i+=de(e[a],c,` |`),l[1]&&(i+=` `.repeat(l[1])),r===0&&t.length>0&&(i=this.renderInline(i,t[t.length-1]))}),t.push({text:i.replace(/ +$/,``),span:e.span})}),t}renderInline(e,t){let n=e.match(/^ */),r=n?n[0].length:0,i=t.text,a=T.stringWidth(i.trimRight());return t.span?this.wrap?r<a?e:(t.hidden=!0,i.trimRight()+` `.repeat(r-a)+e.trimLeft()):(t.hidden=!0,i+e):e}rasterize(e){let t=[],n=this.columnWidths(e),r;return e.forEach((e,i)=>{e.width=n[i],r=this.wrap?T.wrap(e.text,this.negatePadding(e),{hard:!0}).split(`
|
|
5
|
-
`):e.text.split(`
|
|
6
|
-
`),e.border&&(r.unshift(`.`+`-`.repeat(this.negatePadding(e)+2)+`.`),r.push(`'`+`-`.repeat(this.negatePadding(e)+2)+`'`)),e.padding&&(r.unshift(...Array(e.padding[0]||0).fill(``)),r.push(...Array(e.padding[2]||0).fill(``))),r.forEach((e,n)=>{t[n]||t.push([]);let r=t[n];for(let e=0;e<i;e++)r[e]===void 0&&r.push(``);r.push(e)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[3]||0)+(e.padding[1]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(e=>e.width||T.stringWidth(e.text));let t=e.length,n=this.width,r=e.map(e=>{if(e.width)return t--,n-=e.width,e.width}),i=t?Math.floor(n/t):0;return r.map((t,n)=>t===void 0?Math.max(i,fe(e[n])):t)}};function de(e,t,n){return e.border?/[.']-+[.']/.test(t)?``:t.trim().length===0?` `:n:``}function fe(e){let t=e.padding||[],n=1+(t[3]||0)+(t[1]||0);return e.border?n+4:n}function pe(){return typeof process==`object`&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function me(e,t){e=e.trim();let n=T.stringWidth(e);return n<t?` `.repeat(t-n)+e:e}function w(e,t){e=e.trim();let n=T.stringWidth(e);return n>=t?e:` `.repeat(t-n>>1)+e}let T;function he(e,t){return T=t,new ue({width:e?.width||pe(),wrap:e?.wrap})}const ge=[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],_e=[12288,12288,65281,65376,65504,65510],ve=[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],E=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},ye=19968,[be,D]=xe(ve);function xe(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(ye>=i&&ye<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}const Se=e=>e<161||e>1114109?!1:E(ge,e),Ce=e=>e<12288||e>65510?!1:E(_e,e),we=e=>e>=be&&e<=D?!0:e<4352||e>262141?!1:E(ve,e);function Te(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Ee(e,{ambiguousAsWide:t=!1}={}){return Te(e),Ce(e)||we(e)||t&&Se(e)?2:1}var De=e(t(((e,t)=>{t.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}))(),1);const Oe=new Intl.Segmenter,ke=/^\p{Default_Ignorable_Code_Point}$/u;function Ae(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=i(e)),e.length===0)return 0;let a=0,o={ambiguousAsWide:!n};for(let{segment:t}of Oe.segment(e)){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159)&&!(e>=8203&&e<=8207||e===65279)&&!(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071)&&!(e>=55296&&e<=57343)&&!(e>=65024&&e<=65039)&&!ke.test(t)){if((0,De.default)().test(t)){a+=2;continue}a+=Ee(e,o)}}return a}const je=new Set([`\x1B`,``]),Me=`]8;;`,Ne=e=>`${je.values().next().value}[${e}m`,Pe=e=>`${je.values().next().value}${Me}${e}`,Fe=e=>e.split(` `).map(e=>Ae(e)),Ie=(e,t,n)=>{let r=[...t],a=!1,o=!1,s=Ae(i(e.at(-1)));for(let[t,i]of r.entries()){let c=Ae(i);if(s+c<=n?e[e.length-1]+=i:(e.push(i),s=0),je.has(i)&&(a=!0,o=r.slice(t+1,t+1+4).join(``)===Me),a){o?i===`\x07`&&(a=!1,o=!1):i===`m`&&(a=!1);continue}s+=c,s===n&&t<r.length-1&&(e.push(``),s=0)}!s&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Le=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(Ae(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Re=(e,t,r={})=>{if(r.trim!==!1&&e.trim()===``)return``;let i=``,a,o,s=Fe(e),c=[``];for(let[n,i]of e.split(` `).entries()){r.trim!==!1&&(c[c.length-1]=c.at(-1).trimStart());let e=Ae(c.at(-1));if(n!==0&&(e>=t&&(r.wordWrap===!1||r.trim===!1)&&(c.push(``),e=0),(e>0||r.trim===!1)&&(c[c.length-1]+=` `,e++)),r.hard&&s[n]>t){let r=t-e,a=1+Math.floor((s[n]-r-1)/t);Math.floor((s[n]-1)/t)<a&&c.push(``),Ie(c,i,t);continue}if(e+s[n]>t&&e>0&&s[n]>0){if(r.wordWrap===!1&&e<t){Ie(c,i,t);continue}c.push(``)}if(e+s[n]>t&&r.wordWrap===!1){Ie(c,i,t);continue}c[c.length-1]+=i}r.trim!==!1&&(c=c.map(e=>Le(e)));let l=c.join(`
|
|
7
|
-
`),u=[...l],d=0;for(let[e,t]of u.entries()){if(i+=t,je.has(t)){let{groups:e}=RegExp(`(?:\\[(?<code>\\d+)m|\\${Me}(?<uri>.*))`).exec(l.slice(d))||{groups:{}};if(e.code!==void 0){let t=Number.parseFloat(e.code);a=t===39?void 0:t}else e.uri!==void 0&&(o=e.uri.length===0?void 0:e.uri)}let r=n.codes.get(Number(a));u[e+1]===`
|
|
8
|
-
`?(o&&(i+=Pe(``)),a&&r&&(i+=Ne(r))):t===`
|
|
9
|
-
`&&(a&&r&&(i+=Ne(a)),o&&(i+=Pe(o))),d+=t.length}return i};function ze(e,t,n){return String(e).normalize().replaceAll(`\r
|
|
10
|
-
`,`
|
|
11
|
-
`).split(`
|
|
12
|
-
`).map(e=>Re(e,t,n)).join(`
|
|
13
|
-
`)}function Be(e){return he(e,{stringWidth:Ae,stripAnsi:i,wrap:ze})}function Ve(e,t){let n=y(`.`,e),r;for(S(n).isDirectory()||(n=_(n));;){if(r=t(n,x(n)),r)return y(n,r);if(n=_(r=n),r===n)break}}
|
|
14
|
-
/**
|
|
15
|
-
* @license
|
|
16
|
-
* Copyright (c) 2016, Contributors
|
|
17
|
-
* SPDX-License-Identifier: ISC
|
|
18
|
-
*/
|
|
19
|
-
function He(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf(`-`)===-1&&e.indexOf(`_`)===-1)return e;{let t=``,n=!1,r=e.match(/^-+/);for(let i=r?r[0].length:0;i<e.length;i++){let r=e.charAt(i);n&&(n=!1,r=r.toUpperCase()),i!==0&&(r===`-`||r===`_`)?n=!0:r!==`-`&&r!==`_`&&(t+=r)}return t}}function Ue(e,t){let n=e.toLowerCase();t||=`-`;let r=``;for(let i=0;i<e.length;i++){let a=n.charAt(i),o=e.charAt(i);a!==o&&i>0?r+=`${t}${n.charAt(i)}`:r+=o}return r}function We(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)}
|
|
20
|
-
/**
|
|
21
|
-
* @license
|
|
22
|
-
* Copyright (c) 2016, Contributors
|
|
23
|
-
* SPDX-License-Identifier: ISC
|
|
24
|
-
*/
|
|
25
|
-
function Ge(e){if(Array.isArray(e))return e.map(e=>typeof e==`string`?e:e+``);e=e.trim();let t=0,n=null,r=null,i=null,a=[];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),a[t]||(a[t]=``),a[t]+=r}return a}
|
|
26
|
-
/**
|
|
27
|
-
* @license
|
|
28
|
-
* Copyright (c) 2016, Contributors
|
|
29
|
-
* SPDX-License-Identifier: ISC
|
|
30
|
-
*/
|
|
31
|
-
var O;(function(e){e.BOOLEAN=`boolean`,e.STRING=`string`,e.NUMBER=`number`,e.ARRAY=`array`})(O||={});
|
|
32
|
-
/**
|
|
33
|
-
* @license
|
|
34
|
-
* Copyright (c) 2016, Contributors
|
|
35
|
-
* SPDX-License-Identifier: ISC
|
|
36
|
-
*/
|
|
37
|
-
let k;var Ke=class{constructor(e){k=e}parse(e,t){let n=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},t),r=Ge(e),i=typeof e==`string`,a=qe(Object.assign(Object.create(null),n.alias)),o=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},n.configuration),s=Object.assign(Object.create(null),n.default),c=n.configObjects||[],l=n.envPrefix,u=o[`populate--`],d=u?`--`:`_`,f=Object.create(null),p=Object.create(null),m=n.__||k.format,h={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:[]},g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,ee=RegExp(`^--`+o[`negation-prefix`]+`(.+)`);[].concat(n.array||[]).filter(Boolean).forEach(function(e){let t=typeof e==`object`?e.key:e,n=Object.keys(e).map(function(e){return{boolean:`bools`,string:`strings`,number:`numbers`}[e]}).filter(Boolean).pop();n&&(h[n][t]=!0),h.arrays[t]=!0,h.keys.push(t)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(e){h.bools[e]=!0,h.keys.push(e)}),[].concat(n.string||[]).filter(Boolean).forEach(function(e){h.strings[e]=!0,h.keys.push(e)}),[].concat(n.number||[]).filter(Boolean).forEach(function(e){h.numbers[e]=!0,h.keys.push(e)}),[].concat(n.count||[]).filter(Boolean).forEach(function(e){h.counts[e]=!0,h.keys.push(e)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(e){h.normalize[e]=!0,h.keys.push(e)}),typeof n.narg==`object`&&Object.entries(n.narg).forEach(([e,t])=>{typeof t==`number`&&(h.nargs[e]=t,h.keys.push(e))}),typeof n.coerce==`object`&&Object.entries(n.coerce).forEach(([e,t])=>{typeof t==`function`&&(h.coercions[e]=t,h.keys.push(e))}),n.config!==void 0&&(Array.isArray(n.config)||typeof n.config==`string`?[].concat(n.config).filter(Boolean).forEach(function(e){h.configs[e]=!0}):typeof n.config==`object`&&Object.entries(n.config).forEach(([e,t])=>{(typeof t==`boolean`||typeof t==`function`)&&(h.configs[e]=t)})),me(n.key,a,n.default,h.arrays),Object.keys(s).forEach(function(e){(h.aliases[e]||[]).forEach(function(t){s[t]=s[e]})});let _=null;xe();let te=[],v=Object.assign(Object.create(null),{_:[]}),ne={};for(let e=0;e<r.length;e++){let t=r[e],n=t.replace(/^-{3,}/,`---`),i,a,s,c,l,u;if(t!==`--`&&/^-/.test(t)&&_e(t))re(t);else if(n.match(/^---+(=|$)/)){re(t);continue}else if(t.match(/^--.+=/)||!o[`short-option-groups`]&&t.match(/^-.+=/))c=t.match(/^--?([^=]+)=([\s\S]*)$/),c!==null&&Array.isArray(c)&&c.length>=3&&(w(c[1],h.arrays)?e=b(e,c[1],r,c[2]):w(c[1],h.nargs)===!1?x(c[1],c[2],!0):e=y(e,c[1],r,c[2]));else if(t.match(ee)&&o[`boolean-negation`])c=t.match(ee),c!==null&&Array.isArray(c)&&c.length>=2&&(a=c[1],x(a,w(a,h.arrays)?[!1]:!1));else if(t.match(/^--.+/)||!o[`short-option-groups`]&&t.match(/^-[^-]+/))c=t.match(/^--?(.+)/),c!==null&&Array.isArray(c)&&c.length>=2&&(a=c[1],w(a,h.arrays)?e=b(e,a,r):w(a,h.nargs)===!1?(l=r[e+1],l!==void 0&&(!l.match(/^-/)||l.match(g))&&!w(a,h.bools)&&!w(a,h.counts)||/^(true|false)$/.test(l)?(x(a,l),e++):x(a,E(a))):e=y(e,a,r));else if(t.match(/^-.\..+=/))c=t.match(/^-([^=]+)=([\s\S]*)$/),c!==null&&Array.isArray(c)&&c.length>=3&&x(c[1],c[2]);else if(t.match(/^-.\..+/)&&!t.match(g))l=r[e+1],c=t.match(/^-(.\..+)/),c!==null&&Array.isArray(c)&&c.length>=2&&(a=c[1],l!==void 0&&!l.match(/^-/)&&!w(a,h.bools)&&!w(a,h.counts)?(x(a,l),e++):x(a,E(a)));else if(t.match(/^-[^-]+/)&&!t.match(g)){s=t.slice(1,-1).split(``),i=!1;for(let n=0;n<s.length;n++){if(l=t.slice(n+2),s[n+1]&&s[n+1]===`=`){u=t.slice(n+3),a=s[n],w(a,h.arrays)?e=b(e,a,r,u):w(a,h.nargs)===!1?x(a,u):e=y(e,a,r,u),i=!0;break}if(l===`-`){x(s[n],l);continue}if(/[A-Za-z]/.test(s[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&w(l,h.bools)===!1){x(s[n],l),i=!0;break}if(s[n+1]&&s[n+1].match(/\W/)){x(s[n],l),i=!0;break}else x(s[n],E(s[n]))}a=t.slice(-1)[0],!i&&a!==`-`&&(w(a,h.arrays)?e=b(e,a,r):w(a,h.nargs)===!1?(l=r[e+1],l!==void 0&&(!/^(-|--)[^-]/.test(l)||l.match(g))&&!w(a,h.bools)&&!w(a,h.counts)||/^(true|false)$/.test(l)?(x(a,l),e++):x(a,E(a))):e=y(e,a,r))}else if(t.match(/^-[0-9]$/)&&t.match(g)&&w(t.slice(1),h.bools))a=t.slice(1),x(a,E(a));else if(t===`--`){te=r.slice(e+1);break}else if(o[`halt-at-non-option`]){te=r.slice(e);break}else re(t)}ce(v,!0),ce(v,!1),ae(v),se(),de(v,h.aliases,s,!0),le(v),o[`set-placeholder-key`]&&ue(v),Object.keys(h.counts).forEach(function(e){fe(v,e.split(`.`))||x(e,0)}),u&&te.length&&(v[d]=[]),te.forEach(function(e){v[d].push(e)}),o[`camel-case-expansion`]&&o[`strip-dashed`]&&Object.keys(v).filter(e=>e!==`--`&&e.includes(`-`)).forEach(e=>{delete v[e]}),o[`strip-aliased`]&&[].concat(...Object.keys(a).map(e=>a[e])).forEach(e=>{o[`camel-case-expansion`]&&e.includes(`-`)&&delete v[e.split(`.`).map(e=>He(e)).join(`.`)],delete v[e]});function re(e){let t=C(`_`,e);(typeof t==`string`||typeof t==`number`)&&v._.push(t)}function y(e,t,n,r){let i,a=w(t,h.nargs);if(a=typeof a!=`number`||isNaN(a)?1:a,a===0)return D(r)||(_=Error(m(`Argument unexpected for: %s`,t))),x(t,E(t)),e;let s=+!D(r);if(o[`nargs-eats-options`])n.length-(e+1)+s<a&&(_=Error(m(`Not enough arguments following: %s`,t))),s=a;else{for(i=e+1;i<n.length&&(!n[i].match(/^-[^0-9]/)||n[i].match(g)||_e(n[i]));i++)s++;s<a&&(_=Error(m(`Not enough arguments following: %s`,t)))}let c=Math.min(s,a);for(!D(r)&&c>0&&(x(t,r),c--),i=e+1;i<c+e+1;i++)x(t,n[i]);return e+c}function b(e,t,n,r){let a=[],c=r||n[e+1],l=w(t,h.nargs);if(w(t,h.bools)&&!/^(true|false)$/.test(c))a.push(!0);else if(D(c)||D(r)&&/^-/.test(c)&&!g.test(c)&&!_e(c)){if(s[t]!==void 0){let e=s[t];a=Array.isArray(e)?e:[e]}}else{D(r)||a.push(ie(t,r,!0));for(let r=e+1;r<n.length&&!(!o[`greedy-arrays`]&&a.length>0||l&&typeof l==`number`&&a.length>=l||(c=n[r],/^-/.test(c)&&!g.test(c)&&!_e(c)));r++)e=r,a.push(ie(t,c,i))}return typeof l==`number`&&(l&&a.length<l||isNaN(l)&&a.length===0)&&(_=Error(m(`Not enough arguments following: %s`,t))),x(t,a),e}function x(e,t,n=i){/-/.test(e)&&o[`camel-case-expansion`]&&S(e,e.split(`.`).map(function(e){return He(e)}).join(`.`));let r=ie(e,t,n),a=e.split(`.`);pe(v,a,r),h.aliases[e]&&h.aliases[e].forEach(function(e){pe(v,e.split(`.`),r)}),a.length>1&&o[`dot-notation`]&&(h.aliases[a[0]]||[]).forEach(function(t){let n=t.split(`.`),i=[].concat(a);i.shift(),n=n.concat(i),(h.aliases[e]||[]).includes(n.join(`.`))||pe(v,n,r)}),w(e,h.normalize)&&!w(e,h.arrays)&&[e].concat(h.aliases[e]||[]).forEach(function(e){Object.defineProperty(ne,e,{enumerable:!0,get(){return t},set(e){t=typeof e==`string`?k.normalize(e):e}})})}function S(e,t){h.aliases[e]&&h.aliases[e].length||(h.aliases[e]=[t],f[t]=!0),h.aliases[t]&&h.aliases[t].length||S(t,e)}function ie(e,t,n){n&&(t=Xe(t)),(w(e,h.bools)||w(e,h.counts))&&typeof t==`string`&&(t=t===`true`);let r=Array.isArray(t)?t.map(function(t){return C(e,t)}):C(e,t);return w(e,h.counts)&&(D(r)||typeof r==`boolean`)&&(r=Je()),w(e,h.normalize)&&w(e,h.arrays)&&(r=Array.isArray(t)?t.map(e=>k.normalize(e)):k.normalize(t)),r}function C(e,t){return!o[`parse-positional-numbers`]&&e===`_`||!w(e,h.strings)&&!w(e,h.bools)&&!Array.isArray(t)&&(We(t)&&o[`parse-numbers`]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))||!D(t)&&w(e,h.numbers))&&(t=Number(t)),t}function ae(e){let t=Object.create(null);de(t,h.aliases,s),Object.keys(h.configs).forEach(function(n){let r=e[n]||t[n];if(r)try{let e=null,t=k.resolve(k.cwd(),r),i=h.configs[n];if(typeof i==`function`){try{e=i(t)}catch(t){e=t}if(e instanceof Error){_=e;return}}else e=k.require(t);oe(e)}catch(t){t.name===`PermissionDenied`?_=t:e[n]&&(_=Error(m(`Invalid JSON config file: %s`,r)))}})}function oe(e,t){Object.keys(e).forEach(function(n){let r=e[n],i=t?t+`.`+n:n;typeof r==`object`&&r&&!Array.isArray(r)&&o[`dot-notation`]?oe(r,i):(!fe(v,i.split(`.`))||w(i,h.arrays)&&o[`combine-arrays`])&&x(i,r)})}function se(){c!==void 0&&c.forEach(function(e){oe(e)})}function ce(e,t){if(l===void 0)return;let n=typeof l==`string`?l:``,r=k.env();Object.keys(r).forEach(function(i){if(n===``||i.lastIndexOf(n,0)===0){let a=i.split(`__`).map(function(e,t){return t===0&&(e=e.substring(n.length)),He(e)});(t&&h.configs[a.join(`.`)]||!t)&&!fe(e,a)&&x(a.join(`.`),r[i])}})}function le(e){let t,n=new Set;Object.keys(e).forEach(function(r){if(!n.has(r)&&(t=w(r,h.coercions),typeof t==`function`))try{let i=C(r,t(e[r]));[].concat(h.aliases[r]||[],r).forEach(t=>{n.add(t),e[t]=i})}catch(e){_=e}})}function ue(e){return h.keys.forEach(t=>{~t.indexOf(`.`)||e[t]===void 0&&(e[t]=void 0)}),e}function de(e,t,n,r=!1){Object.keys(n).forEach(function(i){fe(e,i.split(`.`))||(pe(e,i.split(`.`),n[i]),r&&(p[i]=!0),(t[i]||[]).forEach(function(t){fe(e,t.split(`.`))||pe(e,t.split(`.`),n[i])}))})}function fe(e,t){let n=e;o[`dot-notation`]||(t=[t.join(`.`)]),t.slice(0,-1).forEach(function(e){n=n[e]||{}});let r=t[t.length-1];return typeof n==`object`?r in n:!1}function pe(e,t,n){let r=e;o[`dot-notation`]||(t=[t.join(`.`)]),t.slice(0,-1).forEach(function(e){e=Ye(e),typeof r==`object`&&r[e]===void 0&&(r[e]={}),typeof r[e]!=`object`||Array.isArray(r[e])?(Array.isArray(r[e])?r[e].push({}):r[e]=[r[e],{}],r=r[e][r[e].length-1]):r=r[e]});let i=Ye(t[t.length-1]),a=w(t.join(`.`),h.arrays),s=Array.isArray(n),c=o[`duplicate-arguments-array`];!c&&w(i,h.nargs)&&(c=!0,(!D(r[i])&&h.nargs[i]===1||Array.isArray(r[i])&&r[i].length===h.nargs[i])&&(r[i]=void 0)),n===Je()?r[i]=Je(r[i]):Array.isArray(r[i])?c&&a&&s?r[i]=o[`flatten-duplicate-arrays`]?r[i].concat(n):(Array.isArray(r[i][0])?r[i]:[r[i]]).concat([n]):!c&&!!a==!!s?r[i]=n:r[i]=r[i].concat([n]):r[i]===void 0&&a?r[i]=s?n:[n]:c&&!(r[i]===void 0||w(i,h.counts)||w(i,h.bools))?r[i]=[r[i],n]:r[i]=n}function me(...e){e.forEach(function(e){Object.keys(e||{}).forEach(function(e){h.aliases[e]||(h.aliases[e]=[].concat(a[e]||[]),h.aliases[e].concat(e).forEach(function(t){if(/-/.test(t)&&o[`camel-case-expansion`]){let n=He(t);n!==e&&h.aliases[e].indexOf(n)===-1&&(h.aliases[e].push(n),f[n]=!0)}}),h.aliases[e].concat(e).forEach(function(t){if(t.length>1&&/[A-Z]/.test(t)&&o[`camel-case-expansion`]){let n=Ue(t,`-`);n!==e&&h.aliases[e].indexOf(n)===-1&&(h.aliases[e].push(n),f[n]=!0)}}),h.aliases[e].forEach(function(t){h.aliases[t]=[e].concat(h.aliases[e].filter(function(e){return t!==e}))}))})})}function w(e,t){let n=[].concat(h.aliases[e]||[],e),r=Object.keys(t),i=n.find(e=>r.includes(e));return i?t[i]:!1}function T(e){let t=Object.keys(h);return[].concat(t.map(e=>h[e])).some(function(t){return Array.isArray(t)?t.includes(e):t[e]})}function he(e,...t){return[].concat(...t).some(function(t){let n=e.match(t);return n&&T(n[1])})}function ge(e){if(e.match(g)||!e.match(/^-[^-]+/))return!1;let t=!0,n,r=e.slice(1).split(``);for(let i=0;i<r.length;i++){if(n=e.slice(i+2),!T(r[i])){t=!1;break}if(r[i+1]&&r[i+1]===`=`||n===`-`||/[A-Za-z]/.test(r[i])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(n)||r[i+1]&&r[i+1].match(/\W/))break}return t}function _e(e){return o[`unknown-options-as-args`]&&ve(e)}function ve(e){return e=e.replace(/^-{3,}/,`--`),e.match(g)||ge(e)?!1:!he(e,/^-+([^=]+?)=[\s\S]*$/,ee,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function E(e){return!w(e,h.bools)&&!w(e,h.counts)&&`${e}`in s?s[e]:ye(be(e))}function ye(e){return{[O.BOOLEAN]:!0,[O.STRING]:``,[O.NUMBER]:void 0,[O.ARRAY]:[]}[e]}function be(e){let t=O.BOOLEAN;return w(e,h.strings)?t=O.STRING:w(e,h.numbers)?t=O.NUMBER:w(e,h.bools)?t=O.BOOLEAN:w(e,h.arrays)&&(t=O.ARRAY),t}function D(e){return e===void 0}function xe(){Object.keys(h.counts).find(e=>w(e,h.arrays)?(_=Error(m(`Invalid configuration: %s, opts.count excludes opts.array.`,e)),!0):w(e,h.nargs)?(_=Error(m(`Invalid configuration: %s, opts.count excludes opts.narg.`,e)),!0):!1)}return{aliases:Object.assign({},h.aliases),argv:Object.assign(ne,v),configuration:o,defaulted:Object.assign({},p),error:_,newAliases:Object.assign({},f)}}};function qe(e){let t=[],n=Object.create(null),r=!0;for(Object.keys(e).forEach(function(n){t.push([].concat(e[n],n))});r;){r=!1;for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++)if(t[e].filter(function(e){return t[n].indexOf(e)!==-1}).length){t[e]=t[e].concat(t[n]),t.splice(n,1),r=!0;break}}return t.forEach(function(e){e=e.filter(function(e,t,n){return n.indexOf(e)===t});let t=e.pop();t!==void 0&&typeof t==`string`&&(n[t]=e)}),n}function Je(e){return e===void 0?1:e+1}function Ye(e){return e===`__proto__`?`___proto___`:e}function Xe(e){return typeof e==`string`&&(e[0]===`'`||e[0]===`"`)&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}const Ze=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20,Qe=(process==null?void 0:process.versions)?.node??(process==null?void 0:process.version)?.slice(1);if(Qe&&Number(Qe.match(/^([^.]+)/)[1])<Ze)throw Error(`yargs parser supports a minimum Node.js version of ${Ze}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const $e=process?process.env:{},et=m?m(import.meta.url):void 0,tt=new Ke({cwd:process.cwd,env:()=>$e,format:C,normalize:ne,resolve:y,require:e=>{if(et!==void 0)return et(e);if(e.match(/\.json$/))return JSON.parse(b(e,`utf8`));throw Error(`only .json config files are supported in ESM`)}}),nt=function(e,t){return tt.parse(e.slice(),t).argv};nt.detailed=function(e,t){return tt.parse(e.slice(),t)},nt.camelCase=He,nt.decamelize=Ue,nt.looksLikeNumber=We;function rt(){return+!it()}function it(){return at()&&!process.defaultApp}function at(){return!!process.versions.electron}function ot(e){return e.slice(rt()+1)}function st(){return process.argv[rt()]}var ct={fs:{readFileSync:b,writeFile:ie},format:C,resolve:y,exists:e=>{try{return S(e).isFile()}catch{return!1}}};let A;var lt=class{constructor(e){e||={},this.directory=e.directory||`./locales`,this.updateFiles=typeof e.updateFiles==`boolean`?e.updateFiles:!0,this.locale=e.locale||`en`,this.fallbackToLanguage=typeof e.fallbackToLanguage==`boolean`?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!=`string`)return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),n=function(){};return typeof e[e.length-1]==`function`&&(n=e.pop()),n||=function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),A.format.apply(A.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),r=e.shift(),i=function(){};typeof e[e.length-1]==`function`&&(i=e.pop()),this.cache[this.locale]||this._readLocaleFile();let a=r===1?t:n;this.cache[this.locale][t]&&(a=this.cache[this.locale][t][r===1?`one`:`other`]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();let o=[a];return~a.indexOf(`%d`)&&o.push(r),A.format.apply(A.format,o.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n=``;return e.forEach(function(e,r){let i=t[r+1];n+=e,i!==void 0&&(n+=`%s`)}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],n=t.directory,r=t.locale,i=t.cb,a=this._resolveLocaleFile(n,r),o=JSON.stringify(this.cache[r],null,2);A.fs.writeFile(a,o,`utf-8`,function(t){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),i(t)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{A.fs.readFileSync&&(e=JSON.parse(A.fs.readFileSync(t,`utf-8`)))}catch(n){if(n instanceof SyntaxError&&(n.message=`syntax error in `+t),n.code===`ENOENT`)e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=A.resolve(e,`./`,t+`.json`);if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf(`_`)){let r=A.resolve(e,`./`,t.split(`_`)[0]+`.json`);this._fileExistsSync(r)&&(n=r)}return n}_fileExistsSync(e){return A.exists(e)}};function ut(e,t){A=t;let n=new lt(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}}const dt=e=>ut(e,ct);var ft=e(t(((e,t)=>{t.exports=function(e){if(e===void 0&&(e=2),e>=Error.stackTraceLimit)throw TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var t=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var n=Error().stack;if(Error.prepareStackTrace=t,typeof n==`object`&&n)return n[e]?n[e].getFileName():void 0}}))(),1);const pt=oe(import.meta.url),mt=pt.substring(0,pt.lastIndexOf(`node_modules`)),ht=m(import.meta.url);var gt={assert:{notStrictEqual:h,strictEqual:g},cliui:Be,findUp:Ve,getEnv:e=>process.env[e],inspect:ae,getProcessArgvBin:st,mainFilename:mt||process.cwd(),Parser:nt,path:{basename:ee,dirname:_,extname:te,relative:re,resolve:y,join:v},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:process.stdout.columns===void 0?null:process.stdout.columns},readFileSync:se,readdirSync:ce,require:ht,getCallerFile:()=>{let e=(0,ft.default)(3);return e.match(/^file:\/\//)?oe(e):e},stringWidth:Ae,y18n:dt({directory:y(pt,`../../../locales`),updateFiles:!1})};function j(e,t,n,r){n.assert.notStrictEqual(e,t,r)}function _t(e,t){t.assert.strictEqual(typeof e,`string`)}function vt(e){return Object.keys(e)}function M(e){return!!e&&!!e.then&&typeof e.then==`function`}var N=class e extends Error{constructor(t){super(t||`yargs error`),this.name=`YError`,Error.captureStackTrace&&Error.captureStackTrace(this,e)}};function yt(e){let t=e.replace(/\s{2,}/g,` `).split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,r=t.shift();if(!r)throw Error(`No command found in: ${e}`);let i={cmd:r.replace(n,``),demanded:[],optional:[]};return t.forEach((e,r)=>{let a=!1;e=e.replace(/\s/g,``),/\.+[\]>]/.test(e)&&r===t.length-1&&(a=!0),/^\[/.test(e)?i.optional.push({cmd:e.replace(n,``).split(`|`),variadic:a}):i.demanded.push({cmd:e.replace(n,``).split(`|`),variadic:a})}),i}const bt=[`first`,`second`,`third`,`fourth`,`fifth`,`sixth`];function P(e,t,n){function r(){return typeof e==`object`?[{demanded:[],optional:[]},e,t]:[yt(`cmd ${e}`),t,n]}try{let e=0,[t,n,i]=r(),a=[].slice.call(n);for(;a.length&&a[a.length-1]===void 0;)a.pop();let o=i||a.length;if(o<t.demanded.length)throw new N(`Not enough arguments provided. Expected ${t.demanded.length} but received ${a.length}.`);let s=t.demanded.length+t.optional.length;if(o>s)throw new N(`Too many arguments provided. Expected max ${s} but received ${o}.`);t.demanded.forEach(t=>{let n=xt(a.shift());t.cmd.filter(e=>e===n||e===`*`).length===0&&St(n,t.cmd,e),e+=1}),t.optional.forEach(t=>{if(a.length===0)return;let n=xt(a.shift());t.cmd.filter(e=>e===n||e===`*`).length===0&&St(n,t.cmd,e),e+=1})}catch(e){console.warn(e.stack)}}function xt(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e}function St(e,t,n){throw new N(`Invalid ${bt[n]||`manyith`} argument. Expected ${t.join(` or `)} but received ${e}.`)}var Ct=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0,r=!1){if(P(`<array|function> [boolean] [boolean] [boolean]`,[e,t,n],arguments.length),Array.isArray(e)){for(let r=0;r<e.length;r++){if(typeof e[r]!=`function`)throw Error(`middleware must be a function`);let i=e[r];i.applyBeforeValidation=t,i.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e==`function`){let i=e;i.applyBeforeValidation=t,i.global=n,i.mutates=r,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(e=>{let r=[...n[t]||[],t];return e.option?!r.includes(e.option):!0}),e.option=t,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function wt(e){return e?e.map(e=>(e.applyBeforeValidation=!1,e)):[]}function Tt(e,t,n,r){return n.reduce((e,n)=>{if(n.applyBeforeValidation!==r)return e;if(n.mutates){if(n.applied)return e;n.applied=!0}if(M(e))return e.then(e=>Promise.all([e,n(e,t)])).then(([e,t])=>Object.assign(e,t));{let r=n(e,t);return M(r)?r.then(t=>Object.assign(e,t)):Object.assign(e,r)}},e)}function Et(e,t,n=e=>{throw e}){try{let n=Dt(e)?e():e;return M(n)?n.then(e=>t(e)):t(n)}catch(e){return n(e)}}function Dt(e){return typeof e==`function`}const Ot=/(^\*)|(^\$0)/;var kt=class{constructor(e,t,n,r){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=r,this.usage=e,this.globalMiddleware=n,this.validation=t}addDirectory(e,t,n,r){r||={},this.requireCache.add(n);let i=this.shim.path.resolve(this.shim.path.dirname(n),e),a=this.shim.readdirSync(i,{recursive:!!r.recurse});Array.isArray(r.extensions)||(r.extensions=[`js`]);let o=typeof r.visit==`function`?r.visit:e=>e;for(let e of a){let n=e.toString();if(r.exclude){let e=!1;if(e=typeof r.exclude==`function`?r.exclude(n):r.exclude.test(n),e)continue}if(r.include){let e=!1;if(e=typeof r.include==`function`?r.include(n):r.include.test(n),!e)continue}let a=!1;for(let e of r.extensions)n.endsWith(e)&&(a=!0);if(a){let e=this.shim.path.join(i,n),r=t(e),a=Object.create(null,Object.getOwnPropertyDescriptors({...r}));if(o(a,e,n)){if(this.requireCache.has(e))continue;this.requireCache.add(e),a.command||=this.shim.path.basename(e,this.shim.path.extname(e)),this.addHandler(a)}}}}addHandler(e,t,n,r,i,a){let o=[],s=wt(i);if(r||=(()=>{}),Array.isArray(e))if(Mt(e))[e,...o]=e;else for(let t of e)this.addHandler(t);else if(Ft(e)){let t=Array.isArray(e.command)||typeof e.command==`string`?e.command:null;if(t===null)throw Error(`No command name given for module: ${this.shim.inspect(e)}`);e.aliases&&(t=[].concat(t,e.aliases)),this.addHandler(t,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(jt(n)){this.addHandler([e].concat(o),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e==`string`){let i=yt(e);o=o.map(e=>yt(e).cmd);let c=!1,l=[i.cmd].concat(o).filter(e=>Ot.test(e)?(c=!0,!1):!0);l.length===0&&c&&l.push(`$0`),c&&(i.cmd=l[0],o=l.slice(1),e=e.replace(Ot,i.cmd)),o.forEach(e=>{this.aliasMap[e]=i.cmd}),t!==!1&&this.usage.command(e,t,c,o,a),this.handlers[i.cmd]={original:e,description:t,handler:r,builder:n||{},middlewares:s,deprecated:a,demanded:i.demanded,optional:i.optional},c&&(this.defaultCommand=this.handlers[i.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,n,r,i,a){let o=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,s=t.getInternalMethods().getContext(),c=s.commands.slice(),l=!e;e&&(s.commands.push(e),s.fullCommands.push(o.original));let u=this.applyBuilderUpdateUsageAndParse(l,o,t,n.aliases,c,r,i,a);return M(u)?u.then(e=>this.applyMiddlewareAndGetResult(l,o,e.innerArgv,s,i,e.aliases,t)):this.applyMiddlewareAndGetResult(l,o,u.innerArgv,s,i,u.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,r,i,a,o,s){let c=t.builder,l=n;if(Nt(c)){n.getInternalMethods().getUsageInstance().freeze();let u=c(n.getInternalMethods().reset(r),s);if(M(u))return u.then(r=>(l=sr(r)?r:n,this.parseAndUpdateUsage(e,t,l,i,a,o)))}else Pt(c)&&(n.getInternalMethods().getUsageInstance().freeze(),l=n.getInternalMethods().reset(r),Object.keys(t.builder).forEach(e=>{l.option(e,c[e])}));return this.parseAndUpdateUsage(e,t,l,i,a,o)}parseAndUpdateUsage(e,t,n,r,i,a){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,t),t.description);let o=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,a);return M(o)?o.then(e=>({aliases:n.parsed.aliases,innerArgv:e})):{aliases:n.parsed.aliases,innerArgv:o}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let n=Ot.test(t.original)?t.original.replace(Ot,``).trim():t.original,r=e.filter(e=>!Ot.test(e));return r.push(n),`$0 ${r.join(` `)}`}handleValidationAndGetResult(e,t,n,r,i,a,o,s){if(!a.getInternalMethods().getHasOutput()){let t=a.getInternalMethods().runValidation(i,s,a.parsed.error,e);n=Et(n,e=>(t(e),e))}if(t.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let r=!!a.getOptions().configuration[`populate--`];a.getInternalMethods().postProcess(n,r,!1,!1),n=Tt(n,a,o,!1),n=Et(n,e=>{let n=t.handler(e);return M(n)?n.then(()=>e):e}),e||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),M(n)&&!a.getInternalMethods().hasParseCallback()&&n.catch(e=>{try{a.getInternalMethods().getUsageInstance().fail(null,e)}catch{}})}return e||(r.commands.pop(),r.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,t,n,r,i,a,o){let s={};if(i)return n;o.getInternalMethods().getHasOutput()||(s=this.populatePositionals(t,n,r,o));let c=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares),l=Tt(n,o,c,!0);return M(l)?l.then(n=>this.handleValidationAndGetResult(e,t,n,r,a,o,c,s)):this.handleValidationAndGetResult(e,t,l,r,a,o,c,s)}populatePositionals(e,t,n,r){t._=t._.slice(n.commands.length);let i=e.demanded.slice(0),a=e.optional.slice(0),o={};for(this.validation.positionalCount(i.length,t._.length);i.length;){let e=i.shift();this.populatePositional(e,t,o)}for(;a.length;){let e=a.shift();this.populatePositional(e,t,o)}return t._=n.commands.concat(t._.map(e=>``+e)),this.postProcessPositionals(t,o,this.cmdToParseOptions(e.original),r),o}populatePositional(e,t,n){let r=e.cmd[0];e.variadic?n[r]=t._.splice(0).map(String):t._.length&&(n[r]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},n=yt(e);return n.demanded.forEach(e=>{let[n,...r]=e.cmd;e.variadic&&(t.array.push(n),t.default[n]=[]),t.alias[n]=r,t.demand[n]=!0}),n.optional.forEach(e=>{let[n,...r]=e.cmd;e.variadic&&(t.array.push(n),t.default[n]=[]),t.alias[n]=r}),t}postProcessPositionals(e,t,n,r){let i=Object.assign({},r.getOptions());i.default=Object.assign(n.default,i.default);for(let e of Object.keys(n.alias))i.alias[e]=(i.alias[e]||[]).concat(n.alias[e]);i.array=i.array.concat(n.array),i.config={};let a=[];if(Object.keys(t).forEach(e=>{t[e].map(t=>{i.configuration[`unknown-options-as-args`]&&(i.key[e]=!0),a.push(`--${e}`),a.push(t)})}),!a.length)return;let o=Object.assign({},i.configuration,{"populate--":!1}),s=this.shim.Parser.detailed(a,Object.assign({},i,{configuration:o}));if(s.error)r.getInternalMethods().getUsageInstance().fail(s.error.message,s.error);else{let n=Object.keys(t);Object.keys(t).forEach(e=>{n.push(...s.aliases[e])}),Object.keys(s.argv).forEach(i=>{n.includes(i)&&(t[i]||(t[i]=s.argv[i]),!this.isInConfigs(r,i)&&!this.isDefaulted(r,i)&&Object.prototype.hasOwnProperty.call(e,i)&&Object.prototype.hasOwnProperty.call(s.argv,i)&&(Array.isArray(e[i])||Array.isArray(s.argv[i]))?e[i]=[].concat(e[i],s.argv[i]):e[i]=s.argv[i])})}}isDefaulted(e,t){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,t)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(t))}isInConfigs(e,t){let{configObjects:n}=e.getOptions();return n.some(e=>Object.prototype.hasOwnProperty.call(e,t))||n.some(e=>Object.prototype.hasOwnProperty.call(e,this.shim.Parser.camelCase(t)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let t=Ot.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,`$0 `);e.getInternalMethods().getUsageInstance().usage(t,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(Nt(t))return t(e,!0);jt(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}extractDesc({describe:e,description:t,desc:n}){for(let r of[e,t,n]){if(typeof r==`string`||r===!1)return r;j(r,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();j(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function At(e,t,n,r){return new kt(e,t,n,r)}function jt(e){return typeof e==`object`&&!!e.builder&&typeof e.handler==`function`}function Mt(e){return e.every(e=>typeof e==`string`)}function Nt(e){return typeof e==`function`}function Pt(e){return typeof e==`object`}function Ft(e){return typeof e==`object`&&!Array.isArray(e)}function It(e={},t=()=>!0){let n={};return vt(e).forEach(r=>{t(r,e[r])&&(n[r]=e[r])}),n}function Lt(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 Rt(e){return typeof e==`boolean`}function zt(e,t){let n=t.y18n.__,r={},i=[];r.failFn=function(e){i.push(e)};let a=null,o=null,s=!0;r.showHelpOnFail=function(t=!0,n){let[i,c]=typeof t==`string`?[!0,t]:[t,n];return e.getInternalMethods().isGlobalContext()&&(o=c),a=c,s=i,r};let c=!1;r.fail=function(t,n){let l=e.getInternalMethods().getLoggerInstance();if(i.length)for(let e=i.length-1;e>=0;--e){let a=i[e];if(Rt(a)){if(n)throw n;if(t)throw Error(t)}else a(t,n,r)}else{if(e.getExitProcess()&&Lt(!0),!c){c=!0,s&&(e.showHelp(`error`),l.error()),(t||n)&&l.error(t||n);let r=a||o;r&&((t||n)&&l.error(``),l.error(r))}if(n||=new N(t),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,n);throw n}};let l=[],u=!1;r.usage=(e,t)=>e===null?(u=!0,l=[],r):(u=!1,l.push([e,t||``]),r),r.getUsage=()=>l,r.getUsageDisabled=()=>u,r.getPositionalGroupName=()=>n(`Positionals:`);let d=[];r.example=(e,t)=>{d.push([e,t||``])};let f=[];r.command=function(e,t,n,r,i=!1){n&&(f=f.map(e=>(e[2]=!1,e))),f.push([e,t||``,n,r,i])},r.getCommands=()=>f;let p={};r.describe=function(e,t){Array.isArray(e)?e.forEach(e=>{r.describe(e,t)}):typeof e==`object`?Object.keys(e).forEach(t=>{r.describe(t,e[t])}):p[e]=t},r.getDescriptions=()=>p;let m=[];r.epilog=e=>{m.push(e)};let h=!1,g;r.wrap=e=>{h=!0,g=e},r.getWrap=()=>t.getEnv(`YARGS_DISABLE_WRAP`)?null:(h||=(g=b(),!0),g);let ee=`__yargsString__:`;r.deferY18nLookup=e=>ee+e,r.help=function(){if(v)return v;te();let i=e.customScriptName?e.$0:t.path.basename(e.$0),a=e.getDemandedOptions(),o=e.getDemandedCommands(),s=e.getDeprecatedOptions(),c=e.getGroups(),h=e.getOptions(),g=[];g=g.concat(Object.keys(p)),g=g.concat(Object.keys(a)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(h.default)),g=g.filter(re),g=Object.keys(g.reduce((e,t)=>(t!==`_`&&(e[t]=!0),e),{}));let b=r.getWrap(),x=t.cliui({width:b,wrap:!!b});if(!u){if(l.length)l.forEach(e=>{x.div({text:`${e[0].replace(/\$0/g,i)}`}),e[1]&&x.div({text:`${e[1]}`,padding:[1,0,0,0]})}),x.div();else if(f.length){let e=null;e=o._?`${i} <${n(`command`)}>\n`:`${i} [${n(`command`)}]\n`,x.div(`${e}`)}}if(f.length>1||f.length===1&&!f[0][2]){x.div(n(`Commands:`));let t=e.getInternalMethods().getContext(),r=t.commands.length?`${t.commands.join(` `)} `:``;e.getInternalMethods().getParserConfiguration()[`sort-commands`]===!0&&(f=f.sort((e,t)=>e[0].localeCompare(t[0])));let a=i?`${i} `:``;f.forEach(e=>{let t=`${a}${r}${e[0].replace(/^\$0 ?/,``)}`;x.span({text:t,padding:[0,2,0,2],width:_(f,b,`${i}${r}`)+4},{text:e[1]});let o=[];e[2]&&o.push(`[${n(`default`)}]`),e[3]&&e[3].length&&o.push(`[${n(`aliases:`)} ${e[3].join(`, `)}]`),e[4]&&(typeof e[4]==`string`?o.push(`[${n(`deprecated: %s`,e[4])}]`):o.push(`[${n(`deprecated`)}]`)),o.length?x.div({text:o.join(` `),padding:[0,0,0,2],align:`right`}):x.div()}),x.div()}let S=(Object.keys(h.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);g=g.filter(t=>!e.parsed.newAliases[t]&&S.every(e=>(h.alias[e]||[]).indexOf(t)===-1));let ie=n(`Options:`);c[ie]||(c[ie]=[]),ne(g,h.alias,c,ie);let C=e=>/^--/.test(Ut(e)),ae=Object.keys(c).filter(e=>c[e].length>0).map(e=>({groupName:e,normalizedKeys:c[e].filter(re).map(e=>{if(S.includes(e))return e;for(let t=0,n;(n=S[t])!==void 0;t++)if((h.alias[n]||[]).includes(e))return n;return e})})).filter(({normalizedKeys:e})=>e.length>0).map(({groupName:e,normalizedKeys:t})=>({groupName:e,normalizedKeys:t,switches:t.reduce((t,n)=>(t[n]=[n].concat(h.alias[n]||[]).map(t=>e===r.getPositionalGroupName()?t:(/^[0-9]$/.test(t)?h.boolean.includes(n)?`-`:`--`:t.length>1?`--`:`-`)+t).sort((e,t)=>C(e)===C(t)?0:C(e)?1:-1).join(`, `),t),{})}));if(ae.filter(({groupName:e})=>e!==r.getPositionalGroupName()).some(({normalizedKeys:e,switches:t})=>!e.every(e=>C(t[e])))&&ae.filter(({groupName:e})=>e!==r.getPositionalGroupName()).forEach(({normalizedKeys:e,switches:t})=>{e.forEach(e=>{C(t[e])&&(t[e]=Vt(t[e],4))})}),ae.forEach(({groupName:t,normalizedKeys:i,switches:o})=>{x.div(t),i.forEach(t=>{let i=o[t],c=p[t]||``,l=null;c.includes(ee)&&(c=n(c.substring(16))),h.boolean.includes(t)&&(l=`[${n(`boolean`)}]`),h.count.includes(t)&&(l=`[${n(`count`)}]`),h.string.includes(t)&&(l=`[${n(`string`)}]`),h.normalize.includes(t)&&(l=`[${n(`string`)}]`),h.array.includes(t)&&(l=`[${n(`array`)}]`),h.number.includes(t)&&(l=`[${n(`number`)}]`);let u=[t in s?(e=>typeof e==`string`?`[${n(`deprecated: %s`,e)}]`:`[${n(`deprecated`)}]`)(s[t]):null,l,t in a?`[${n(`required`)}]`:null,h.choices&&h.choices[t]?`[${n(`choices:`)} ${r.stringifiedValues(h.choices[t])}]`:null,y(h.default[t],h.defaultDescription[t])].filter(Boolean).join(` `);x.span({text:Ut(i),padding:[0,2,0,2+Ht(i)],width:_(o,b)+4},c);let d=e.getInternalMethods().getUsageConfiguration()[`hide-types`]===!0;u&&!d?x.div({text:u,padding:[0,0,0,2],align:`right`}):x.div()}),x.div()}),d.length&&(x.div(n(`Examples:`)),d.forEach(e=>{e[0]=e[0].replace(/\$0/g,i)}),d.forEach(e=>{e[1]===``?x.div({text:e[0],padding:[0,2,0,2]}):x.div({text:e[0],padding:[0,2,0,2],width:_(d,b)+4},{text:e[1]})}),x.div()),m.length>0){let e=m.map(e=>e.replace(/\$0/g,i)).join(`
|
|
38
|
-
`);x.div(`${e}\n`)}return x.toString().replace(/\s*$/,``)};function _(e,n,r){let i=0;return Array.isArray(e)||(e=Object.values(e).map(e=>[e])),e.forEach(e=>{i=Math.max(t.stringWidth(r?`${r} ${Ut(e[0])}`:Ut(e[0]))+Ht(e[0]),i)}),n&&(i=Math.min(i,parseInt((n*.5).toString(),10))),i}function te(){let t=e.getDemandedOptions(),n=e.getOptions();(Object.keys(n.alias)||[]).forEach(i=>{n.alias[i].forEach(a=>{p[a]&&r.describe(i,p[a]),a in t&&e.demandOption(i,t[a]),n.boolean.includes(a)&&e.boolean(i),n.count.includes(a)&&e.count(i),n.string.includes(a)&&e.string(i),n.normalize.includes(a)&&e.normalize(i),n.array.includes(a)&&e.array(i),n.number.includes(a)&&e.number(i)})})}let v;r.cacheHelpMessage=function(){v=this.help()},r.clearCachedHelpMessage=function(){v=void 0},r.hasCachedHelpMessage=function(){return!!v};function ne(e,t,n,r){let i=[],a=null;return Object.keys(n).forEach(e=>{i=i.concat(n[e])}),e.forEach(e=>{a=[e].concat(t[e]),a.some(e=>i.indexOf(e)!==-1)||n[r].push(e)}),i}function re(t){return e.getOptions().hiddenOptions.indexOf(t)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}r.showHelp=t=>{let n=e.getInternalMethods().getLoggerInstance();t||=`error`,(typeof t==`function`?t:n[t])(r.help())},r.functionDescription=e=>[`(`,e.name?t.Parser.decamelize(e.name,`-`):n(`generated-value`),`)`].join(``),r.stringifiedValues=function(e,t){let n=``,r=t||`, `,i=[].concat(e);return!e||!i.length||i.forEach(e=>{n.length&&(n+=r),n+=JSON.stringify(e)}),n};function y(e,t){let r=`[${n(`default:`)} `;if(e===void 0&&!t)return null;if(t)r+=t;else switch(typeof e){case`string`:r+=`"${e}"`;break;case`object`:r+=JSON.stringify(e);break;default:r+=e}return`${r}]`}function b(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let x=null;r.version=e=>{x=e},r.showVersion=t=>{let n=e.getInternalMethods().getLoggerInstance();t||=`error`,(typeof t==`function`?t:n[t])(x)},r.reset=function(e){return a=null,c=!1,l=[],u=!1,m=[],d=[],f=[],p=It(p,t=>!e[t]),r};let S=[];return r.freeze=function(){S.push({failMessage:a,failureOutput:c,usages:l,usageDisabled:u,epilogs:m,examples:d,commands:f,descriptions:p})},r.unfreeze=function(e=!1){let t=S.pop();t&&(e?(p={...t.descriptions,...p},f=[...t.commands,...f],l=[...t.usages,...l],d=[...t.examples,...d],m=[...t.epilogs,...m]):{failMessage:a,failureOutput:c,usages:l,usageDisabled:u,epilogs:m,examples:d,commands:f,descriptions:p}=t)},r}function Bt(e){return typeof e==`object`}function Vt(e,t){return Bt(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Ht(e){return Bt(e)?e.indentation:0}function Ut(e){return Bt(e)?e.text:e}var Wt=class{constructor(e,t,n,r){this.yargs=e,this.usage=t,this.command=n,this.shim=r,this.completionKey=`get-yargs-completions`,this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(this.shim.getEnv(`SHELL`)?.includes(`zsh`)||this.shim.getEnv(`ZSH_NAME`)?.includes(`zsh`))??!1}defaultCompletion(e,t,n,r){let i=this.command.getCommandHandlers();for(let t=0,n=e.length;t<n;++t)if(i[e[t]]&&i[e[t]].builder){let n=i[e[t]].builder;if(Nt(n)){this.indexAfterLastReset=t+1;let e=this.yargs.getInternalMethods().reset();return n(e,!0),e.argv}}let a=[];this.commandCompletions(a,e,n),this.optionCompletions(a,e,t,n),this.choicesFromOptionsCompletions(a,e,t,n),this.choicesFromPositionalsCompletions(a,e,t,n),r(null,a)}commandCompletions(e,t,n){let r=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&r[r.length-1]!==n&&!this.previousArgHasChoices(t)&&this.usage.getCommands().forEach(n=>{let r=yt(n[0]).cmd;if(t.indexOf(r)===-1)if(!this.zshShell)e.push(r);else{let t=n[1]||``;e.push(r.replace(/:/g,`\\:`)+`:`+t)}})}optionCompletions(e,t,n,r){if((r.match(/^-/)||r===``&&e.length===0)&&!this.previousArgHasChoices(t)){let n=this.yargs.getOptions(),i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach(a=>{let o=!!n.configuration[`boolean-negation`]&&n.boolean.includes(a);!i.includes(a)&&!n.hiddenOptions.includes(a)&&!this.argsContainKey(t,a,o)&&this.completeOptionKey(a,e,r,o&&!!n.default[a])})}}choicesFromOptionsCompletions(e,t,n,r){if(this.previousArgHasChoices(t)){let n=this.getPreviousArgChoices(t);n&&n.length>0&&e.push(...n.map(e=>e.replace(/:/g,`\\:`)))}}choicesFromPositionalsCompletions(e,t,n,r){if(r===``&&e.length>0&&this.previousArgHasChoices(t))return;let i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],a=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=i[n._.length-a-1];if(!o)return;let s=this.yargs.getOptions().choices[o]||[];for(let t of s)t.startsWith(r)&&e.push(t.replace(/:/g,`\\:`))}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1],n=``;if(!t.startsWith(`-`)&&e.length>1&&(n=t,t=e[e.length-2]),!t.startsWith(`-`))return;let r=t.replace(/^-+/,``),i=this.yargs.getOptions(),a=[r,...this.yargs.getAliases()[r]||[]],o;for(let e of a)if(Object.prototype.hasOwnProperty.call(i.key,e)&&Array.isArray(i.choices[e])){o=i.choices[e];break}if(o)return o.filter(e=>!n||e.startsWith(n))}previousArgHasChoices(e){let t=this.getPreviousArgChoices(e);return t!==void 0&&t.length>0}argsContainKey(e,t,n){let r=t=>e.indexOf((/^[^0-9]$/.test(t)?`-`:`--`)+t)!==-1;if(r(t)||n&&r(`no-${t}`))return!0;if(this.aliases){for(let e of this.aliases[t])if(r(e))return!0}return!1}completeOptionKey(e,t,n,r){let i=e;if(this.zshShell){let t=this.usage.getDescriptions(),n=((this===null||this===void 0?void 0:this.aliases)?.[e])?.find(e=>{let n=t[e];return typeof n==`string`&&n.length>0}),r=n?t[n]:void 0,a=t[e]??r??``;i=`${e.replace(/:/g,`\\:`)}:${a.replace(`__yargsString__:`,``).replace(/(\r\n|\n|\r)/gm,` `)}`}let a=!(e=>/^--/.test(e))(n)&&(e=>/^[^0-9]$/.test(e))(e)?`-`:`--`;t.push(a+i),r&&t.push(a+`no-`+i)}customCompletion(e,t,n,r){if(j(this.customCompletionFunction,null,this.shim),Kt(this.customCompletionFunction)){let e=this.customCompletionFunction(n,t);return M(e)?e.then(e=>{this.shim.process.nextTick(()=>{r(null,e)})}).catch(e=>{this.shim.process.nextTick(()=>{r(e,void 0)})}):r(null,e)}else if(qt(this.customCompletionFunction))return this.customCompletionFunction(n,t,(i=r)=>this.defaultCompletion(e,t,n,i),e=>{r(null,e)});else return this.customCompletionFunction(n,t,e=>{r(null,e)})}getCompletion(e,t){let n=e.length?e[e.length-1]:``,r=this.yargs.parse(e,!0),i=this.customCompletionFunction?r=>this.customCompletion(e,r,n,t):r=>this.defaultCompletion(e,r,n,t);return M(r)?r.then(i):i(r)}generateCompletionScript(e,t){let n=this.zshShell?`#compdef {{app_name}}
|
|
39
|
-
###-begin-{{app_name}}-completions-###
|
|
40
|
-
#
|
|
41
|
-
# yargs command completion script
|
|
42
|
-
#
|
|
43
|
-
# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
|
|
44
|
-
# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
|
|
45
|
-
#
|
|
46
|
-
_{{app_name}}_yargs_completions()
|
|
47
|
-
{
|
|
48
|
-
local reply
|
|
49
|
-
local si=$IFS
|
|
50
|
-
IFS=$'
|
|
51
|
-
' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
|
|
52
|
-
IFS=$si
|
|
53
|
-
if [[ \${#reply} -gt 0 ]]; then
|
|
54
|
-
_describe 'values' reply
|
|
55
|
-
else
|
|
56
|
-
_default
|
|
57
|
-
fi
|
|
58
|
-
}
|
|
59
|
-
if [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then
|
|
60
|
-
_{{app_name}}_yargs_completions "$@"
|
|
61
|
-
else
|
|
62
|
-
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
63
|
-
fi
|
|
64
|
-
###-end-{{app_name}}-completions-###
|
|
65
|
-
`:`###-begin-{{app_name}}-completions-###
|
|
66
|
-
#
|
|
67
|
-
# yargs command completion script
|
|
68
|
-
#
|
|
69
|
-
# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
|
|
70
|
-
# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
|
|
71
|
-
#
|
|
72
|
-
_{{app_name}}_yargs_completions()
|
|
73
|
-
{
|
|
74
|
-
local cur_word args type_list
|
|
75
|
-
|
|
76
|
-
cur_word="\${COMP_WORDS[COMP_CWORD]}"
|
|
77
|
-
args=("\${COMP_WORDS[@]}")
|
|
78
|
-
|
|
79
|
-
# ask yargs to generate completions.
|
|
80
|
-
# see https://stackoverflow.com/a/40944195/7080036 for the spaces-handling awk
|
|
81
|
-
mapfile -t type_list < <({{app_path}} --get-yargs-completions "\${args[@]}")
|
|
82
|
-
mapfile -t COMPREPLY < <(compgen -W "$( printf '%q ' "\${type_list[@]}" )" -- "\${cur_word}" |
|
|
83
|
-
awk '/ / { print "\\""$0"\\"" } /^[^ ]+$/ { print $0 }')
|
|
84
|
-
|
|
85
|
-
# if no match was found, fall back to filename completion
|
|
86
|
-
if [ \${#COMPREPLY[@]} -eq 0 ]; then
|
|
87
|
-
COMPREPLY=()
|
|
88
|
-
fi
|
|
89
|
-
|
|
90
|
-
return 0
|
|
91
|
-
}
|
|
92
|
-
complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
|
|
93
|
-
###-end-{{app_name}}-completions-###
|
|
94
|
-
`,r=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,r),n=n.replace(/{{completion_command}}/g,t),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function Gt(e,t,n,r){return new Wt(e,t,n,r)}function Kt(e){return e.length<3}function qt(e){return e.length>3}function Jt(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]}const Yt=[`$0`,`--`,`_`];function Xt(e,t,n){let r=n.y18n.__,i=n.y18n.__n,a={};a.nonOptionCount=function(n){let r=e.getDemandedCommands(),a=n._.length+(n[`--`]?n[`--`].length:0)-e.getInternalMethods().getContext().commands.length;r._&&(a<r._.min||a>r._.max)&&(a<r._.min?r._.minMsg===void 0?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`,a,a.toString(),r._.min.toString())):t.fail(r._.minMsg?r._.minMsg.replace(/\$0/g,a.toString()).replace(/\$1/,r._.min.toString()):null):a>r._.max&&(r._.maxMsg===void 0?t.fail(i(`Too many non-option arguments: got %s, maximum of %s`,`Too many non-option arguments: got %s, maximum of %s`,a,a.toString(),r._.max.toString())):t.fail(r._.maxMsg?r._.maxMsg.replace(/\$0/g,a.toString()).replace(/\$1/,r._.max.toString()):null)))},a.positionalCount=function(e,n){n<e&&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`,n,n+``,e+``))},a.requiredArguments=function(e,n){let r=null;for(let t of Object.keys(n))(!Object.prototype.hasOwnProperty.call(e,t)||e[t]===void 0)&&(r||={},r[t]=n[t]);if(r){let e=[];for(let t of Object.keys(r)){let n=r[t];n&&e.indexOf(n)<0&&e.push(n)}let n=e.length?`\n${e.join(`
|
|
95
|
-
`)}`:``;t.fail(i(`Missing required argument: %s`,`Missing required arguments: %s`,Object.keys(r).length,Object.keys(r).join(`, `)+n))}},a.unknownArguments=function(n,r,o,s,c=!0){let l=e.getInternalMethods().getCommandInstance().getCommands(),u=[],d=e.getInternalMethods().getContext();if(Object.keys(n).forEach(t=>{!Yt.includes(t)&&!Object.prototype.hasOwnProperty.call(o,t)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),t)&&!a.isValidAndSomeAliasIsNotNew(t,r)&&u.push(t)}),c&&(d.commands.length>0||l.length>0||s)&&n._.slice(d.commands.length).forEach(e=>{l.includes(``+e)||u.push(``+e)}),c){let t=e.getDemandedCommands()._?.max||0,r=d.commands.length+t;r<n._.length&&n._.slice(r).forEach(e=>{e=String(e),!d.commands.includes(e)&&!u.includes(e)&&u.push(e)})}u.length&&t.fail(i(`Unknown argument: %s`,`Unknown arguments: %s`,u.length,u.map(e=>e.trim()?e:`"${e}"`).join(`, `)))},a.unknownCommands=function(n){let r=e.getInternalMethods().getCommandInstance().getCommands(),a=[],o=e.getInternalMethods().getContext();return(o.commands.length>0||r.length>0)&&n._.slice(o.commands.length).forEach(e=>{r.includes(``+e)||a.push(``+e)}),a.length>0?(t.fail(i(`Unknown command: %s`,`Unknown commands: %s`,a.length,a.join(`, `))),!0):!1},a.isValidAndSomeAliasIsNotNew=function(t,n){if(!Object.prototype.hasOwnProperty.call(n,t))return!1;let r=e.parsed.newAliases;return[t,...n[t]].some(e=>!Object.prototype.hasOwnProperty.call(r,e)||!r[t])},a.limitedChoices=function(n){let i=e.getOptions(),a={};if(!Object.keys(i.choices).length)return;Object.keys(n).forEach(e=>{Yt.indexOf(e)===-1&&Object.prototype.hasOwnProperty.call(i.choices,e)&&[].concat(n[e]).forEach(t=>{i.choices[e].indexOf(t)===-1&&t!==void 0&&(a[e]=(a[e]||[]).concat(t))})});let o=Object.keys(a);if(!o.length)return;let s=r(`Invalid values:`);o.forEach(e=>{s+=`\n ${r(`Argument: %s, Given: %s, Choices: %s`,e,t.stringifiedValues(a[e]),t.stringifiedValues(i.choices[e]))}`}),t.fail(s)};let o={};a.implies=function(t,r){P(`<string|object> [array|number|string]`,[t,r],arguments.length),typeof t==`object`?Object.keys(t).forEach(e=>{a.implies(e,t[e])}):(e.global(t),o[t]||(o[t]=[]),Array.isArray(r)?r.forEach(e=>a.implies(t,e)):(j(r,void 0,n),o[t].push(r)))},a.getImplied=function(){return o};function s(e,t){let n=Number(t);return t=isNaN(n)?t:n,typeof t==`number`?t=e._.length>=t:t.match(/^--no-.+/)?(t=t.match(/^--no-(.+)/)[1],t=!Object.prototype.hasOwnProperty.call(e,t)):t=Object.prototype.hasOwnProperty.call(e,t),t}a.implications=function(e){let n=[];if(Object.keys(o).forEach(t=>{let r=t;(o[t]||[]).forEach(t=>{let i=r,a=t;i=s(e,i),t=s(e,t),i&&!t&&n.push(` ${r} -> ${a}`)})}),n.length){let e=`${r(`Implications failed:`)}\n`;n.forEach(t=>{e+=t}),t.fail(e)}};let c={};a.conflicts=function(t,n){P(`<string|object> [array|string]`,[t,n],arguments.length),typeof t==`object`?Object.keys(t).forEach(e=>{a.conflicts(e,t[e])}):(e.global(t),c[t]||(c[t]=[]),Array.isArray(n)?n.forEach(e=>a.conflicts(t,e)):c[t].push(n))},a.getConflicting=()=>c,a.conflicting=function(i){Object.keys(i).forEach(e=>{c[e]&&c[e].forEach(n=>{n&&i[e]!==void 0&&i[n]!==void 0&&t.fail(r(`Arguments %s and %s are mutually exclusive`,e,n))})}),e.getInternalMethods().getParserConfiguration()[`strip-dashed`]&&Object.keys(c).forEach(e=>{c[e].forEach(a=>{a&&i[n.Parser.camelCase(e)]!==void 0&&i[n.Parser.camelCase(a)]!==void 0&&t.fail(r(`Arguments %s and %s are mutually exclusive`,e,a))})})},a.recommendCommands=function(e,n){n=n.sort((e,t)=>t.length-e.length);let i=null,a=1/0;for(let t=0,r;(r=n[t])!==void 0;t++){let t=Jt(e,r);t<=3&&t<a&&(a=t,i=r)}i&&t.fail(r(`Did you mean %s?`,i))},a.reset=function(e){return o=It(o,t=>!e[t]),c=It(c,t=>!e[t]),a};let l=[];return a.freeze=function(){l.push({implied:o,conflicting:c})},a.unfreeze=function(){let e=l.pop();j(e,void 0,n),{implied:o,conflicting:c}=e},a}let Zt=[],Qt;function $t(e,t,n,r){Qt=r;let i={};if(Object.prototype.hasOwnProperty.call(e,`extends`)){if(typeof e.extends!=`string`)return i;let a=/\.json|\..*rc$/.test(e.extends),o=null;if(a)o=tn(t,e.extends);else try{o=import.meta.resolve(e.extends)}catch{return e}en(o),Zt.push(o),i=a?JSON.parse(Qt.readFileSync(o,`utf8`)):r.require(e.extends),delete e.extends,i=$t(i,Qt.path.dirname(o),n,Qt)}return Zt=[],n?nn(i,e):Object.assign({},i,e)}function en(e){if(Zt.indexOf(e)>-1)throw new N(`Circular extended configurations: '${e}'.`)}function tn(e,t){return Qt.path.resolve(e,t)}function nn(e,t){let n={};function r(e){return e&&typeof e==`object`&&!Array.isArray(e)}Object.assign(n,e);for(let i of Object.keys(t))r(t[i])&&r(n[i])?n[i]=nn(e[i],t[i]):n[i]=t[i];return n}var F=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw 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},I=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw 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)},L,rn,an,R,z,on,B,sn,cn,V,ln,H,U,W,G,un,dn,K,q,fn,pn,J,mn,hn,gn,_n,vn,Y,yn,bn,xn,X,Sn,Z,Q;function Cn(e){return(t=[],n=e.process.cwd(),r)=>{let i=new or(t,n,r,e);return Object.defineProperty(i,`argv`,{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}const wn=Symbol(`copyDoubleDash`),Tn=Symbol(`copyDoubleDash`),En=Symbol(`deleteFromParserHintObject`),Dn=Symbol(`emitWarning`),On=Symbol(`freeze`),kn=Symbol(`getDollarZero`),An=Symbol(`getParserConfiguration`),jn=Symbol(`getUsageConfiguration`),Mn=Symbol(`guessLocale`),Nn=Symbol(`guessVersion`),Pn=Symbol(`parsePositionalNumbers`),Fn=Symbol(`pkgUp`),In=Symbol(`populateParserHintArray`),Ln=Symbol(`populateParserHintSingleValueDictionary`),Rn=Symbol(`populateParserHintArrayDictionary`),zn=Symbol(`populateParserHintDictionary`),Bn=Symbol(`sanitizeKey`),Vn=Symbol(`setKey`),Hn=Symbol(`unfreeze`),Un=Symbol(`validateAsync`),Wn=Symbol(`getCommandInstance`),Gn=Symbol(`getContext`),Kn=Symbol(`getHasOutput`),qn=Symbol(`getLoggerInstance`),Jn=Symbol(`getParseContext`),Yn=Symbol(`getUsageInstance`),Xn=Symbol(`getValidationInstance`),Zn=Symbol(`hasParseCallback`),Qn=Symbol(`isGlobalContext`),$n=Symbol(`postProcess`),er=Symbol(`rebase`),tr=Symbol(`reset`),nr=Symbol(`runYargsParserAndExecuteCommands`),rr=Symbol(`runValidation`),ir=Symbol(`setHasOutput`),ar=Symbol(`kTrackManuallySetKeys`);var or=class{constructor(e=[],t,n,r){this.customScriptName=!1,this.parsed=!1,L.set(this,void 0),rn.set(this,void 0),an.set(this,{commands:[],fullCommands:[]}),R.set(this,null),z.set(this,null),on.set(this,`show-hidden`),B.set(this,null),sn.set(this,!0),cn.set(this,{}),V.set(this,!0),ln.set(this,[]),H.set(this,void 0),U.set(this,{}),W.set(this,!1),G.set(this,null),un.set(this,!0),dn.set(this,void 0),K.set(this,``),q.set(this,void 0),fn.set(this,void 0),pn.set(this,{}),J.set(this,null),mn.set(this,null),hn.set(this,{}),gn.set(this,{}),_n.set(this,void 0),vn.set(this,!1),Y.set(this,void 0),yn.set(this,!1),bn.set(this,!1),xn.set(this,!1),X.set(this,void 0),Sn.set(this,{}),Z.set(this,null),Q.set(this,void 0),F(this,Y,r,`f`),F(this,_n,e,`f`),F(this,rn,t,`f`),F(this,fn,n,`f`),F(this,H,new Ct(this),`f`),this.$0=this[kn](),this[tr](),F(this,L,I(this,L,`f`),`f`),F(this,X,I(this,X,`f`),`f`),F(this,Q,I(this,Q,`f`),`f`),F(this,q,I(this,q,`f`),`f`),I(this,q,`f`).showHiddenOpt=I(this,on,`f`),F(this,dn,this[Tn](),`f`),I(this,Y,`f`).y18n.setLocale(`en_US`)}addHelpOpt(e,t){return P(`[string|boolean] [string]`,[e,t],arguments.length),I(this,G,`f`)&&(this[En](I(this,G,`f`)),F(this,G,null,`f`)),e===!1&&t===void 0?this:(F(this,G,typeof e==`string`?e:`help`,`f`),this.boolean(I(this,G,`f`)),this.describe(I(this,G,`f`),t||I(this,X,`f`).deferY18nLookup(`Show help`)),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(P(`[string|boolean] [string]`,[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e==`string`?e:I(this,on,`f`);return this.boolean(n),this.describe(n,t||I(this,X,`f`).deferY18nLookup(`Show hidden options`)),I(this,q,`f`).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return P(`<object|string|array> [string|array]`,[e,t],arguments.length),this[Rn](this.alias.bind(this),`alias`,e,t),this}array(e){return P(`<array|string>`,[e],arguments.length),this[In](`array`,e),this[ar](e),this}boolean(e){return P(`<array|string>`,[e],arguments.length),this[In](`boolean`,e),this[ar](e),this}check(e,t){return P(`<function> [boolean]`,[e,t],arguments.length),this.middleware((t,n)=>Et(()=>e(t,n.getOptions()),n=>(n?(typeof n==`string`||n instanceof Error)&&I(this,X,`f`).fail(n.toString(),n):I(this,X,`f`).fail(I(this,Y,`f`).y18n.__(`Argument check failed: %s`,e.toString())),t),e=>(I(this,X,`f`).fail(e.message?e.message:e.toString(),e),t)),!1,t),this}choices(e,t){return P(`<object|string|array> [string|array]`,[e,t],arguments.length),this[Rn](this.choices.bind(this),`choices`,e,t),this}coerce(e,t){if(P(`<object|string|array> [function]`,[e,t],arguments.length),Array.isArray(e)){if(!t)throw new N(`coerce callback must be provided`);for(let n of e)this.coerce(n,t);return this}else if(typeof e==`object`){for(let t of Object.keys(e))this.coerce(t,e[t]);return this}if(!t)throw new N(`coerce callback must be provided`);let n=e;return I(this,q,`f`).key[n]=!0,I(this,H,`f`).addCoerceMiddleware((e,r)=>{let i=[n,...r.getAliases()[n]??[]].filter(t=>Object.prototype.hasOwnProperty.call(e,t));return i.length===0?e:Et(()=>t(e[i[0]]),t=>(i.forEach(n=>{e[n]=t}),e),e=>{throw new N(e.message)})},n),this}conflicts(e,t){return P(`<string|object> [string|array]`,[e,t],arguments.length),I(this,Q,`f`).conflicts(e,t),this}config(e=`config`,t,n){return P(`[object|string] [string|function] [function]`,[e,t,n],arguments.length),typeof e==`object`&&!Array.isArray(e)?(e=$t(e,I(this,rn,`f`),this[An]()[`deep-merge-config`]||!1,I(this,Y,`f`)),I(this,q,`f`).configObjects=(I(this,q,`f`).configObjects||[]).concat(e),this):(typeof t==`function`&&(n=t,t=void 0),this.describe(e,t||I(this,X,`f`).deferY18nLookup(`Path to JSON config file`)),(Array.isArray(e)?e:[e]).forEach(e=>{I(this,q,`f`).config[e]=n||!0}),this)}completion(e,t,n){return P(`[string] [string|boolean|function] [function]`,[e,t,n],arguments.length),typeof t==`function`&&(n=t,t=void 0),F(this,z,e||I(this,z,`f`)||`completion`,`f`),!t&&t!==!1&&(t=`generate completion script`),this.command(I(this,z,`f`),t),n&&I(this,R,`f`).registerFunction(n),this}command(e,t,n,r,i,a){return P(`<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]`,[e,t,n,r,i,a],arguments.length),I(this,L,`f`).addHandler(e,t,n,r,i,a),this}commands(e,t,n,r,i,a){return this.command(e,t,n,r,i,a)}commandDir(e,t){P(`<string> [object]`,[e,t],arguments.length);let n=I(this,fn,`f`)||I(this,Y,`f`).require;return I(this,L,`f`).addDirectory(e,n,I(this,Y,`f`).getCallerFile(),t),this}count(e){return P(`<array|string>`,[e],arguments.length),this[In](`count`,e),this[ar](e),this}default(e,t,n){return P(`<object|string|array> [*] [string]`,[e,t,n],arguments.length),n&&(_t(e,I(this,Y,`f`)),I(this,q,`f`).defaultDescription[e]=n),typeof t==`function`&&(_t(e,I(this,Y,`f`)),I(this,q,`f`).defaultDescription[e]||(I(this,q,`f`).defaultDescription[e]=I(this,X,`f`).functionDescription(t)),t=t.call()),this[Ln](this.default.bind(this),`default`,e,t),this}defaults(e,t,n){return this.default(e,t,n)}demandCommand(e=1,t,n,r){return P(`[number] [number|string] [string|null|undefined] [string|null|undefined]`,[e,t,n,r],arguments.length),typeof t!=`number`&&(n=t,t=1/0),this.global(`_`,!1),I(this,q,`f`).demandedCommands._={min:e,max:t,minMsg:n,maxMsg:r},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(e=>{j(n,!0,I(this,Y,`f`)),this.demandOption(e,n)}),t=1/0):typeof t!=`number`&&(n=t,t=1/0),typeof e==`number`?(j(n,!0,I(this,Y,`f`)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(e=>{j(n,!0,I(this,Y,`f`)),this.demandOption(e,n)}):typeof n==`string`?this.demandOption(e,n):(n===!0||n===void 0)&&this.demandOption(e),this}demandOption(e,t){return P(`<object|string|array> [string]`,[e,t],arguments.length),this[Ln](this.demandOption.bind(this),`demandedOptions`,e,t),this}deprecateOption(e,t){return P(`<string> [string|boolean]`,[e,t],arguments.length),I(this,q,`f`).deprecatedOptions[e]=t,this}describe(e,t){return P(`<object|string|array> [string]`,[e,t],arguments.length),this[Vn](e,!0),I(this,X,`f`).describe(e,t),this}detectLocale(e){return P(`<boolean>`,[e],arguments.length),F(this,sn,e,`f`),this}env(e){return P(`[string|boolean]`,[e],arguments.length),e===!1?delete I(this,q,`f`).envPrefix:I(this,q,`f`).envPrefix=e||``,this}epilogue(e){return P(`<string>`,[e],arguments.length),I(this,X,`f`).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return P(`<string|array> [string]`,[e,t],arguments.length),Array.isArray(e)?e.forEach(e=>this.example(...e)):I(this,X,`f`).example(e,t),this}exit(e,t){F(this,W,!0,`f`),F(this,B,t,`f`),I(this,V,`f`)&&I(this,Y,`f`).process.exit(e)}exitProcess(e=!0){return P(`[boolean]`,[e],arguments.length),F(this,V,e,`f`),this}fail(e){if(P(`<function|boolean>`,[e],arguments.length),typeof e==`boolean`&&e!==!1)throw new N(`Invalid first argument. Expected function or boolean 'false'`);return I(this,X,`f`).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return P(`<array> [function]`,[e,t],arguments.length),t?I(this,R,`f`).getCompletion(e,t):new Promise((t,n)=>{I(this,R,`f`).getCompletion(e,(e,r)=>{e?n(e):t(r)})})}getDemandedOptions(){return P([],0),I(this,q,`f`).demandedOptions}getDemandedCommands(){return P([],0),I(this,q,`f`).demandedCommands}getDeprecatedOptions(){return P([],0),I(this,q,`f`).deprecatedOptions}getDetectLocale(){return I(this,sn,`f`)}getExitProcess(){return I(this,V,`f`)}getGroups(){return Object.assign({},I(this,U,`f`),I(this,gn,`f`))}getHelp(){if(F(this,W,!0,`f`),!I(this,X,`f`).hasCachedHelpMessage()){if(!this.parsed){let e=this[nr](I(this,_n,`f`),void 0,void 0,0,!0);if(M(e))return e.then(()=>I(this,X,`f`).help())}let e=I(this,L,`f`).runDefaultBuilderOn(this);if(M(e))return e.then(()=>I(this,X,`f`).help())}return Promise.resolve(I(this,X,`f`).help())}getOptions(){return I(this,q,`f`)}getStrict(){return I(this,yn,`f`)}getStrictCommands(){return I(this,bn,`f`)}getStrictOptions(){return I(this,xn,`f`)}global(e,t){return P(`<string|array> [boolean]`,[e,t],arguments.length),e=[].concat(e),t===!1?e.forEach(e=>{I(this,q,`f`).local.includes(e)||I(this,q,`f`).local.push(e)}):I(this,q,`f`).local=I(this,q,`f`).local.filter(t=>e.indexOf(t)===-1),this}group(e,t){P(`<string|array> <string>`,[e,t],arguments.length);let n=I(this,gn,`f`)[t]||I(this,U,`f`)[t];I(this,gn,`f`)[t]&&delete I(this,gn,`f`)[t];let r={};return I(this,U,`f`)[t]=(n||[]).concat(e).filter(e=>r[e]?!1:r[e]=!0),this}hide(e){return P(`<string>`,[e],arguments.length),I(this,q,`f`).hiddenOptions.push(e),this}implies(e,t){return P(`<string|object> [number|string|array]`,[e,t],arguments.length),I(this,Q,`f`).implies(e,t),this}locale(e){return P(`[string]`,[e],arguments.length),e===void 0?(this[Mn](),I(this,Y,`f`).y18n.getLocale()):(F(this,sn,!1,`f`),I(this,Y,`f`).y18n.setLocale(e),this)}middleware(e,t,n){return I(this,H,`f`).addMiddleware(e,!!t,n)}nargs(e,t){return P(`<string|object|array> [number]`,[e,t],arguments.length),this[Ln](this.nargs.bind(this),`narg`,e,t),this}normalize(e){return P(`<array|string>`,[e],arguments.length),this[In](`normalize`,e),this}number(e){return P(`<array|string>`,[e],arguments.length),this[In](`number`,e),this[ar](e),this}option(e,t){if(P(`<string|object> [object]`,[e,t],arguments.length),typeof e==`object`)Object.keys(e).forEach(t=>{this.options(t,e[t])});else{typeof t!=`object`&&(t={}),this[ar](e),I(this,Z,`f`)&&(e===`version`||t?.alias===`version`)&&this[Dn]([`"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(`
|
|
96
|
-
`),void 0,`versionWarning`),I(this,q,`f`).key[e]=!0,t.alias&&this.alias(e,t.alias);let n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);let r=t.demand||t.required||t.require;r&&this.demand(e,r),t.demandOption&&this.demandOption(e,typeof t.demandOption==`string`?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),`default`in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type===`boolean`)&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type===`array`)&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type===`number`)&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type===`string`)&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type===`count`)&&this.count(e),typeof t.global==`boolean`&&this.global(e,t.global),t.defaultDescription&&(I(this,q,`f`).defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let i=t.describe||t.description||t.desc,a=I(this,X,`f`).getDescriptions();(!Object.prototype.hasOwnProperty.call(a,e)||typeof i==`string`)&&this.describe(e,i),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){P(`[string|array] [function|boolean|object] [function]`,[e,t,n],arguments.length),this[On](),e===void 0&&(e=I(this,_n,`f`)),typeof t==`object`&&(F(this,mn,t,`f`),t=n),typeof t==`function`&&(F(this,J,t,`f`),t=!1),t||F(this,_n,e,`f`),I(this,J,`f`)&&F(this,V,!1,`f`);let r=this[nr](e,!!t),i=this.parsed;return I(this,R,`f`).setParsed(this.parsed),M(r)?r.then(e=>(I(this,J,`f`)&&I(this,J,`f`).call(this,I(this,B,`f`),e,I(this,K,`f`)),e)).catch(e=>{throw I(this,J,`f`)&&I(this,J,`f`)(e,this.parsed.argv,I(this,K,`f`)),e}).finally(()=>{this[Hn](),this.parsed=i}):(I(this,J,`f`)&&I(this,J,`f`).call(this,I(this,B,`f`),r,I(this,K,`f`)),this[Hn](),this.parsed=i,r)}parseAsync(e,t,n){let r=this.parse(e,t,n);return M(r)?r:Promise.resolve(r)}parseSync(e,t,n){let r=this.parse(e,t,n);if(M(r))throw new N(`.parseSync() must not be used with asynchronous builders, handlers, or middleware`);return r}parserConfiguration(e){return P(`<object>`,[e],arguments.length),F(this,pn,e,`f`),this}pkgConf(e,t){P(`<string> [string]`,[e,t],arguments.length);let n=null,r=this[Fn](t||I(this,rn,`f`));return r[e]&&typeof r[e]==`object`&&(n=$t(r[e],t||I(this,rn,`f`),this[An]()[`deep-merge-config`]||!1,I(this,Y,`f`)),I(this,q,`f`).configObjects=(I(this,q,`f`).configObjects||[]).concat(n)),this}positional(e,t){P(`<string> <object>`,[e,t],arguments.length);let n=[`default`,`defaultDescription`,`implies`,`normalize`,`choices`,`conflicts`,`coerce`,`type`,`describe`,`desc`,`description`,`alias`];t=It(t,(e,t)=>e===`type`&&![`string`,`number`,`boolean`].includes(t)?!1:n.includes(e));let r=I(this,an,`f`).fullCommands[I(this,an,`f`).fullCommands.length-1],i=r?I(this,L,`f`).cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return vt(i).forEach(n=>{let r=i[n];Array.isArray(r)?r.indexOf(e)!==-1&&(t[n]=!0):r[e]&&!(n in t)&&(t[n]=r[e])}),this.group(e,I(this,X,`f`).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return P(`[boolean]`,[e],arguments.length),F(this,vn,e,`f`),this}required(e,t,n){return this.demand(e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return P(`<array|string|object> [number]`,[e],arguments.length),typeof e==`string`&&I(this,q,`f`).narg[e]||this[Ln](this.requiresArg.bind(this),`narg`,e,NaN),this}showCompletionScript(e,t){return P(`[string] [string]`,[e,t],arguments.length),e||=this.$0,I(this,dn,`f`).log(I(this,R,`f`).generateCompletionScript(e,t||I(this,z,`f`)||`completion`)),this}showHelp(e){if(P(`[string|function]`,[e],arguments.length),F(this,W,!0,`f`),!I(this,X,`f`).hasCachedHelpMessage()){if(!this.parsed){let t=this[nr](I(this,_n,`f`),void 0,void 0,0,!0);if(M(t))return t.then(()=>{I(this,X,`f`).showHelp(e)}),this}let t=I(this,L,`f`).runDefaultBuilderOn(this);if(M(t))return t.then(()=>{I(this,X,`f`).showHelp(e)}),this}return I(this,X,`f`).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return P(`[boolean|string] [string]`,[e,t],arguments.length),I(this,X,`f`).showHelpOnFail(e,t),this}showVersion(e){return P(`[string|function]`,[e],arguments.length),I(this,X,`f`).showVersion(e),this}skipValidation(e){return P(`<array|string>`,[e],arguments.length),this[In](`skipValidation`,e),this}strict(e){return P(`[boolean]`,[e],arguments.length),F(this,yn,e!==!1,`f`),this}strictCommands(e){return P(`[boolean]`,[e],arguments.length),F(this,bn,e!==!1,`f`),this}strictOptions(e){return P(`[boolean]`,[e],arguments.length),F(this,xn,e!==!1,`f`),this}string(e){return P(`<array|string>`,[e],arguments.length),this[In](`string`,e),this[ar](e),this}terminalWidth(){return P([],0),I(this,Y,`f`).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return P(`<object>`,[e],arguments.length),F(this,sn,!1,`f`),I(this,Y,`f`).y18n.updateLocale(e),this}usage(e,t,n,r){if(P(`<string|null|undefined> [string|boolean] [function|object] [function]`,[e,t,n,r],arguments.length),t!==void 0){if(j(e,null,I(this,Y,`f`)),(e||``).match(/^\$0( |$)/))return this.command(e,t,n,r);throw new N(`.usage() description must start with $0 if being used as alias for .command()`)}else return I(this,X,`f`).usage(e),this}usageConfiguration(e){return P(`<object>`,[e],arguments.length),F(this,Sn,e,`f`),this}version(e,t,n){let r=`version`;if(P(`[boolean|string] [string] [string]`,[e,t,n],arguments.length),I(this,Z,`f`)&&(this[En](I(this,Z,`f`)),I(this,X,`f`).version(void 0),F(this,Z,null,`f`)),arguments.length===0)n=this[Nn](),e=r;else if(arguments.length===1){if(e===!1)return this;n=e,e=r}else arguments.length===2&&(n=t,t=void 0);return F(this,Z,typeof e==`string`?e:r,`f`),t||=I(this,X,`f`).deferY18nLookup(`Show version number`),I(this,X,`f`).version(n||void 0),this.boolean(I(this,Z,`f`)),this.describe(I(this,Z,`f`),t),this}wrap(e){return P(`<number|null|undefined>`,[e],arguments.length),I(this,X,`f`).wrap(e),this}[(L=new WeakMap,rn=new WeakMap,an=new WeakMap,R=new WeakMap,z=new WeakMap,on=new WeakMap,B=new WeakMap,sn=new WeakMap,cn=new WeakMap,V=new WeakMap,ln=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,G=new WeakMap,un=new WeakMap,dn=new WeakMap,K=new WeakMap,q=new WeakMap,fn=new WeakMap,pn=new WeakMap,J=new WeakMap,mn=new WeakMap,hn=new WeakMap,gn=new WeakMap,_n=new WeakMap,vn=new WeakMap,Y=new WeakMap,yn=new WeakMap,bn=new WeakMap,xn=new WeakMap,X=new WeakMap,Sn=new WeakMap,Z=new WeakMap,Q=new WeakMap,wn)](e){if(!e._||!e[`--`])return e;e._.push.apply(e._,e[`--`]);try{delete e[`--`]}catch{}return e}[Tn](){return{log:(...e)=>{this[Zn]()||console.log(...e),F(this,W,!0,`f`),I(this,K,`f`).length&&F(this,K,I(this,K,`f`)+`
|
|
97
|
-
`,`f`),F(this,K,I(this,K,`f`)+e.join(` `),`f`)},error:(...e)=>{this[Zn]()||console.error(...e),F(this,W,!0,`f`),I(this,K,`f`).length&&F(this,K,I(this,K,`f`)+`
|
|
98
|
-
`,`f`),F(this,K,I(this,K,`f`)+e.join(` `),`f`)}}}[En](e){vt(I(this,q,`f`)).forEach(t=>{if((e=>e===`configObjects`)(t))return;let n=I(this,q,`f`)[t];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n==`object`&&delete n[e]}),delete I(this,X,`f`).getDescriptions()[e]}[Dn](e,t,n){I(this,cn,`f`)[n]||(I(this,Y,`f`).process.emitWarning(e,t),I(this,cn,`f`)[n]=!0)}[On](){I(this,ln,`f`).push({options:I(this,q,`f`),configObjects:I(this,q,`f`).configObjects.slice(0),exitProcess:I(this,V,`f`),groups:I(this,U,`f`),strict:I(this,yn,`f`),strictCommands:I(this,bn,`f`),strictOptions:I(this,xn,`f`),completionCommand:I(this,z,`f`),output:I(this,K,`f`),exitError:I(this,B,`f`),hasOutput:I(this,W,`f`),parsed:this.parsed,parseFn:I(this,J,`f`),parseContext:I(this,mn,`f`)}),I(this,X,`f`).freeze(),I(this,Q,`f`).freeze(),I(this,L,`f`).freeze(),I(this,H,`f`).freeze()}[kn](){let e=``,t;return t=/\b(node|iojs|electron)(\.exe)?$/.test(I(this,Y,`f`).process.argv()[0])?I(this,Y,`f`).process.argv().slice(1,2):I(this,Y,`f`).process.argv().slice(0,1),e=t.map(e=>{let t=this[er](I(this,rn,`f`),e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&t.length<e.length?t:e}).join(` `).trim(),I(this,Y,`f`).getEnv(`_`)&&I(this,Y,`f`).getProcessArgvBin()===I(this,Y,`f`).getEnv(`_`)&&(e=I(this,Y,`f`).getEnv(`_`).replace(`${I(this,Y,`f`).path.dirname(I(this,Y,`f`).process.execPath())}/`,``)),e}[An](){return I(this,pn,`f`)}[jn](){return I(this,Sn,`f`)}[Mn](){if(!I(this,sn,`f`))return;let e=I(this,Y,`f`).getEnv(`LC_ALL`)||I(this,Y,`f`).getEnv(`LC_MESSAGES`)||I(this,Y,`f`).getEnv(`LANG`)||I(this,Y,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(e.replace(/[.:].*/,``))}[Nn](){return this[Fn]().version||`unknown`}[Pn](e){let t=e[`--`]?e[`--`]:e._;for(let e=0,n;(n=t[e])!==void 0;e++)I(this,Y,`f`).Parser.looksLikeNumber(n)&&Number.isSafeInteger(Math.floor(parseFloat(`${n}`)))&&(t[e]=Number(n));return e}[Fn](e){let t=e||`*`;if(I(this,hn,`f`)[t])return I(this,hn,`f`)[t];let n={};try{let t=e||I(this,Y,`f`).mainFilename;I(this,Y,`f`).path.extname(t)&&(t=I(this,Y,`f`).path.dirname(t));let r=I(this,Y,`f`).findUp(t,(e,t)=>{if(t.includes(`package.json`))return`package.json`});j(r,void 0,I(this,Y,`f`)),n=JSON.parse(I(this,Y,`f`).readFileSync(r,`utf8`))}catch{}return I(this,hn,`f`)[t]=n||{},I(this,hn,`f`)[t]}[In](e,t){t=[].concat(t),t.forEach(t=>{t=this[Bn](t),I(this,q,`f`)[e].push(t)})}[Ln](e,t,n,r){this[zn](e,t,n,r,(e,t,n)=>{I(this,q,`f`)[e][t]=n})}[Rn](e,t,n,r){this[zn](e,t,n,r,(e,t,n)=>{I(this,q,`f`)[e][t]=(I(this,q,`f`)[e][t]||[]).concat(n)})}[zn](e,t,n,r,i){if(Array.isArray(n))n.forEach(t=>{e(t,r)});else if((e=>typeof e==`object`)(n))for(let t of vt(n))e(t,n[t]);else i(t,this[Bn](n),r)}[Bn](e){return e===`__proto__`?`___proto___`:e}[Vn](e,t){return this[Ln](this[Vn].bind(this),`key`,e,t),this}[Hn](){var e,t,n,r,i,a,o,s,c,l,u,d;let f=I(this,ln,`f`).pop();j(f,void 0,I(this,Y,`f`));let p;e=this,t=this,n=this,r=this,i=this,a=this,o=this,s=this,c=this,l=this,u=this,d=this,{options:{set value(t){F(e,q,t,`f`)}}.value,configObjects:p,exitProcess:{set value(e){F(t,V,e,`f`)}}.value,groups:{set value(e){F(n,U,e,`f`)}}.value,output:{set value(e){F(r,K,e,`f`)}}.value,exitError:{set value(e){F(i,B,e,`f`)}}.value,hasOutput:{set value(e){F(a,W,e,`f`)}}.value,parsed:this.parsed,strict:{set value(e){F(o,yn,e,`f`)}}.value,strictCommands:{set value(e){F(s,bn,e,`f`)}}.value,strictOptions:{set value(e){F(c,xn,e,`f`)}}.value,completionCommand:{set value(e){F(l,z,e,`f`)}}.value,parseFn:{set value(e){F(u,J,e,`f`)}}.value,parseContext:{set value(e){F(d,mn,e,`f`)}}.value}=f,I(this,q,`f`).configObjects=p,I(this,X,`f`).unfreeze(),I(this,Q,`f`).unfreeze(),I(this,L,`f`).unfreeze(),I(this,H,`f`).unfreeze()}[Un](e,t){return Et(t,t=>(e(t),t))}getInternalMethods(){return{getCommandInstance:this[Wn].bind(this),getContext:this[Gn].bind(this),getHasOutput:this[Kn].bind(this),getLoggerInstance:this[qn].bind(this),getParseContext:this[Jn].bind(this),getParserConfiguration:this[An].bind(this),getUsageConfiguration:this[jn].bind(this),getUsageInstance:this[Yn].bind(this),getValidationInstance:this[Xn].bind(this),hasParseCallback:this[Zn].bind(this),isGlobalContext:this[Qn].bind(this),postProcess:this[$n].bind(this),reset:this[tr].bind(this),runValidation:this[rr].bind(this),runYargsParserAndExecuteCommands:this[nr].bind(this),setHasOutput:this[ir].bind(this)}}[Wn](){return I(this,L,`f`)}[Gn](){return I(this,an,`f`)}[Kn](){return I(this,W,`f`)}[qn](){return I(this,dn,`f`)}[Jn](){return I(this,mn,`f`)||{}}[Yn](){return I(this,X,`f`)}[Xn](){return I(this,Q,`f`)}[Zn](){return!!I(this,J,`f`)}[Qn](){return I(this,un,`f`)}[$n](e,t,n,r){return n||M(e)?e:(t||(e=this[wn](e)),(this[An]()[`parse-positional-numbers`]||this[An]()[`parse-positional-numbers`]===void 0)&&(e=this[Pn](e)),r&&(e=Tt(e,this,I(this,H,`f`).getMiddleware(),!1)),e)}[tr](e={}){F(this,q,I(this,q,`f`)||{},`f`);let t={};t.local=I(this,q,`f`).local||[],t.configObjects=I(this,q,`f`).configObjects||[];let n={};return t.local.forEach(t=>{n[t]=!0,(e[t]||[]).forEach(e=>{n[e]=!0})}),Object.assign(I(this,gn,`f`),Object.keys(I(this,U,`f`)).reduce((e,t)=>{let r=I(this,U,`f`)[t].filter(e=>!(e in n));return r.length>0&&(e[t]=r),e},{})),F(this,U,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(e=>{t[e]=(I(this,q,`f`)[e]||[]).filter(e=>!n[e])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(e=>{t[e]=It(I(this,q,`f`)[e],e=>!n[e])}),t.envPrefix=I(this,q,`f`).envPrefix,F(this,q,t,`f`),F(this,X,I(this,X,`f`)?I(this,X,`f`).reset(n):zt(this,I(this,Y,`f`)),`f`),F(this,Q,I(this,Q,`f`)?I(this,Q,`f`).reset(n):Xt(this,I(this,X,`f`),I(this,Y,`f`)),`f`),F(this,L,I(this,L,`f`)?I(this,L,`f`).reset():At(I(this,X,`f`),I(this,Q,`f`),I(this,H,`f`),I(this,Y,`f`)),`f`),I(this,R,`f`)||F(this,R,Gt(this,I(this,X,`f`),I(this,L,`f`),I(this,Y,`f`)),`f`),I(this,H,`f`).reset(),F(this,z,null,`f`),F(this,K,``,`f`),F(this,B,null,`f`),F(this,W,!1,`f`),this.parsed=!1,this}[er](e,t){return I(this,Y,`f`).path.relative(e,t)}[nr](e,t,n,r=0,i=!1){let a=!!n||i;e||=I(this,_n,`f`),I(this,q,`f`).__=I(this,Y,`f`).y18n.__,I(this,q,`f`).configuration=this[An]();let o=!!I(this,q,`f`).configuration[`populate--`],s=Object.assign({},I(this,q,`f`).configuration,{"populate--":!0}),c=I(this,Y,`f`).Parser.detailed(e,Object.assign({},I(this,q,`f`),{configuration:{"parse-positional-numbers":!1,...s}})),l=Object.assign(c.argv,I(this,mn,`f`)),u,d=c.aliases,f=!1,p=!1;Object.keys(l).forEach(e=>{e===I(this,G,`f`)&&l[e]?f=!0:e===I(this,Z,`f`)&&l[e]&&(p=!0)}),l.$0=this.$0,this.parsed=c,r===0&&I(this,X,`f`).clearCachedHelpMessage();try{if(this[Mn](),t)return this[$n](l,o,!!n,!1);I(this,G,`f`)&&[I(this,G,`f`)].concat(d[I(this,G,`f`)]||[]).filter(e=>e.length>1).includes(``+l._[l._.length-1])&&(l._.pop(),f=!0),F(this,un,!1,`f`);let s=I(this,L,`f`).getCommands(),m=I(this,R,`f`)?.completionKey?[I(this,R,`f`)?.completionKey,...this.getAliases()[I(this,R,`f`)?.completionKey]??[]].some(e=>Object.prototype.hasOwnProperty.call(l,e)):!1,h=f||m||i;if(l._.length){if(s.length){let e;for(let t=r||0,a;l._[t]!==void 0;t++)if(a=String(l._[t]),s.includes(a)&&a!==I(this,z,`f`)){let e=I(this,L,`f`).runCommand(a,this,c,t+1,i,f||p||i);return this[$n](e,o,!!n,!1)}else if(!e&&a!==I(this,z,`f`)){e=a;break}!I(this,L,`f`).hasDefaultCommand()&&I(this,vn,`f`)&&e&&!h&&I(this,Q,`f`).recommendCommands(e,s)}I(this,z,`f`)&&l._.includes(I(this,z,`f`))&&!m&&(I(this,V,`f`)&&Lt(!0),this.showCompletionScript(),this.exit(0))}if(I(this,L,`f`).hasDefaultCommand()&&!h){let e=I(this,L,`f`).runCommand(null,this,c,0,i,f||p||i);return this[$n](e,o,!!n,!1)}if(m){I(this,V,`f`)&&Lt(!0),e=[].concat(e);let t=e.slice(e.indexOf(`--${I(this,R,`f`).completionKey}`)+1);return I(this,R,`f`).getCompletion(t,(e,t)=>{if(e)throw new N(e.message);(t||[]).forEach(e=>{I(this,dn,`f`).log(e)}),this.exit(0)}),this[$n](l,!o,!!n,!1)}if(I(this,W,`f`)||(f?(I(this,V,`f`)&&Lt(!0),a=!0,this.showHelp(e=>{I(this,dn,`f`).log(e),this.exit(0)})):p&&(I(this,V,`f`)&&Lt(!0),a=!0,I(this,X,`f`).showVersion(`log`),this.exit(0))),!a&&I(this,q,`f`).skipValidation.length>0&&(a=Object.keys(l).some(e=>I(this,q,`f`).skipValidation.indexOf(e)>=0&&l[e]===!0)),!a){if(c.error)throw new N(c.error.message);if(!m){let e=this[rr](d,{},c.error);n||(u=Tt(l,this,I(this,H,`f`).getMiddleware(),!0)),u=this[Un](e,u??l),M(u)&&!n&&(u=u.then(()=>Tt(l,this,I(this,H,`f`).getMiddleware(),!1)))}}}catch(e){if(e instanceof N)I(this,X,`f`).fail(e.message,e);else throw e}return this[$n](u??l,o,!!n,!0)}[rr](e,t,n,r){let i={...this.getDemandedOptions()};return a=>{if(n)throw new N(n.message);I(this,Q,`f`).nonOptionCount(a),I(this,Q,`f`).requiredArguments(a,i);let o=!1;I(this,bn,`f`)&&(o=I(this,Q,`f`).unknownCommands(a)),I(this,yn,`f`)&&!o?I(this,Q,`f`).unknownArguments(a,e,t,!!r):I(this,xn,`f`)&&I(this,Q,`f`).unknownArguments(a,e,{},!1,!1),I(this,Q,`f`).limitedChoices(a),I(this,Q,`f`).implications(a),I(this,Q,`f`).conflicting(a)}}[ir](){F(this,W,!0,`f`)}[ar](e){if(typeof e==`string`)I(this,q,`f`).key[e]=!0;else for(let t of e)I(this,q,`f`).key[t]=!0}};function sr(e){return!!e&&typeof e.getInternalMethods==`function`}const cr=Cn(gt);function $(e,t,n){return{command:e,describe:t,builder:async e=>{let t=(await n()).default.builder;return typeof t==`function`?t(e):e},handler:async e=>{await(await n()).default.handler(e)}}}const lr=[{command:$(`abuse-reports`,`Submit and track abuse reports for phishing, malware, and other policy violations on Cloudflare-proxied sites`,()=>import(`./abuse-reports-Dy76QPNP.mjs`)),hideCommand:!0},{command:$(`accounts`,`Account settings, members, roles, subscriptions, and API tokens for your Cloudflare account`,()=>import(`./accounts-CjtZ8x1z.mjs`)),hideCommand:!1},{command:$(`acm`,`Advanced Certificate Manager — Total TLS auto-issuance and custom origin trust store certificates`,()=>import(`./acm-C2lYIWs1.mjs`)),hideCommand:!0},{command:$(`addressing`,`IP address management — BYOIP prefixes, address maps, regional hostnames, and BGP advertisement control`,()=>import(`./addressing-CHFK6uxW.mjs`)),hideCommand:!0},{command:$(`ai`,`Run inference on Workers AI models — text generation, image classification, embeddings, and more`,()=>import(`./ai-DS3i-I1a.mjs`)),hideCommand:!0},{command:$(`ai_gateway`,`ai_gateway`,()=>import(`./ai_gateway-w7YwfcPE.mjs`)),hideCommand:!0},{command:$(`ai-gateway`,`Proxy, cache, rate-limit, and observe requests to AI providers — OpenAI, Anthropic, Workers AI, and more`,()=>import(`./ai-gateway-RIsegO2x.mjs`)),hideCommand:!0},{command:$(`ai-search`,`ai-search`,()=>import(`./ai-search-Dcj4BauG.mjs`)),hideCommand:!1},{command:$(`alerting`,`Notification policies, delivery destinations, silence windows, and alert history`,()=>import(`./alerting-Bk85NNf5.mjs`)),hideCommand:!0},{command:$(`analytics`,`Zone-level traffic analytics — dashboard summaries, per-colo breakdowns, and Argo latency metrics`,()=>import(`./analytics-CkhhhZWZ.mjs`)),hideCommand:!0},{command:$(`analytics_engine`,`analytics_engine`,()=>import(`./analytics_engine-B7qgDJCA.mjs`)),hideCommand:!0},{command:$(`api-gateway`,`Discover, monitor, and protect your API endpoints with schema validation, abuse detection, and routing`,()=>import(`./api-gateway-CWdR4Ne7.mjs`)),hideCommand:!0},{command:$(`argo`,`Network optimization features that speed up and improve reliability of traffic to your origins`,()=>import(`./argo-DnJRVnGX.mjs`)),hideCommand:!0},{command:$(`artifacts`,`artifacts`,()=>import(`./artifacts-BVWKiJUl.mjs`)),hideCommand:!0},{command:$(`audit-logs`,`Immutable audit trail of actions taken by account members — who changed what and when`,()=>import(`./audit-logs-DjTstbzL.mjs`)),hideCommand:!0},{command:$(`billing`,`Account billing profiles and usage data for Cloudflare subscriptions and add-on services`,()=>import(`./billing-3rEqF83h.mjs`)),hideCommand:!0},{command:$(`bot-management`,`Bot detection and mitigation settings — configure bot scores, JavaScript detections, and challenge behavior`,()=>import(`./bot-management-CJxD1pqi.mjs`)),hideCommand:!0},{command:$(`botnet-feed`,`Botnet threat intelligence feeds — IP and ASN-level data on known command-and-control infrastructure`,()=>import(`./botnet-feed-MG91D7BR.mjs`)),hideCommand:!0},{command:$(`brand-protection`,`Monitor the Internet for phishing sites, lookalike domains, and unauthorized use of your brand assets`,()=>import(`./brand-protection-CK7gJi06.mjs`)),hideCommand:!0},{command:$(`browser-rendering`,`browser-rendering`,()=>import(`./browser-rendering-Rae0AUt0.mjs`)),hideCommand:!0},{command:$(`cache`,`Purge cached content and configure Cache Reserve, tiered caching, and variant serving`,()=>import(`./cache-B7pRbpTy.mjs`)),hideCommand:!0},{command:$(`calls`,`calls`,()=>import(`./calls-DXRWsZ8n.mjs`)),hideCommand:!0},{command:$(`certificate-authorities`,`Map client certificates to specific hostnames for mTLS authentication`,()=>import(`./certificate-authorities-BR3gXBLs.mjs`)),hideCommand:!0},{command:$(`client-certificates`,`Issue and manage client certificates for mutual TLS (mTLS) authentication on your zone`,()=>import(`./client-certificates-B0ebLJdk.mjs`)),hideCommand:!0},{command:$(`cloud-connector`,`Route traffic from Cloudflare directly to cloud provider services (AWS, Azure, GCP) without origin servers`,()=>import(`./cloud-connector-BOjaggJk.mjs`)),hideCommand:!0},{command:$(`cloudforce-one`,`Threat intelligence platform — request investigations, scan indicators, and track threat events`,()=>import(`./cloudforce-one-B6HYfk5Z.mjs`)),hideCommand:!0},{command:$(`connectivity`,`Service directory for network connectivity endpoints and their configurations`,()=>import(`./connectivity-welFvZ7X.mjs`)),hideCommand:!0},{command:$(`connector-interrupts`,`connector-interrupts`,()=>import(`./connector-interrupts-DTV3F-50.mjs`)),hideCommand:!0},{command:$(`connector-telemetry-events`,`connector-telemetry-events`,()=>import(`./connector-telemetry-events-kDqb_AGm.mjs`)),hideCommand:!0},{command:$(`connector-telemetry-snapshots`,`connector-telemetry-snapshots`,()=>import(`./connector-telemetry-snapshots-DC-wD75E.mjs`)),hideCommand:!0},{command:$(`connectors`,`connectors`,()=>import(`./connectors-3vjrdFLB.mjs`)),hideCommand:!0},{command:$(`content-scanning`,`content-scanning`,()=>import(`./content-scanning-CnW2A0pv.mjs`)),hideCommand:!0},{command:$(`custom-certificates`,`Upload and manage your own SSL/TLS certificates for a zone, with priority ordering`,()=>import(`./custom-certificates-CnYh6Yi-.mjs`)),hideCommand:!0},{command:$(`custom-hostnames`,`Bring custom vanity domains to your SaaS zone with per-hostname SSL and origin mapping`,()=>import(`./custom-hostnames-C2upqZso.mjs`)),hideCommand:!0},{command:$(`custom-nameservers`,`Vanity nameservers that use your own domain instead of Cloudflare-assigned NS records`,()=>import(`./custom-nameservers-BGkAD_PZ.mjs`)),hideCommand:!0},{command:$(`custom-pages`,`Custom error and challenge pages (1000s, WAF blocks, captchas) for zones and accounts`,()=>import(`./custom-pages-5fCSP8in.mjs`)),hideCommand:!0},{command:$(`d1`,`D1 is Cloudflare's managed, serverless database with SQLite's SQL semantics, built-in disaster recovery, and Worker and HTTP API access.`,()=>import(`./d1-CyiRbZZn.mjs`)),hideCommand:!0},{command:$(`data-security`,`data-security`,()=>import(`./data-security-Casx4OS_.mjs`)),hideCommand:!0},{command:$(`dcv-delegation`,`Delegate domain control validation (DCV) to Cloudflare so certificates auto-renew without manual DNS changes`,()=>import(`./dcv-delegation-DVYO10oA.mjs`)),hideCommand:!0},{command:$(`diagnostics`,`Network diagnostic tools — traceroutes from Cloudflare's edge and endpoint health checks`,()=>import(`./diagnostics-BqYDoDfw.mjs`)),hideCommand:!0},{command:$(`dispatch-namespaces`,`Workers for Platforms dispatch namespaces — isolate customer Workers for SaaS and multi-tenant deployments`,()=>import(`./dispatch-namespaces-Cz2rajnP.mjs`)),hideCommand:!0},{command:$(`dns`,`DNS management API for zones, records, DNSSEC, analytics, and zone transfers`,()=>import(`./dns-62t95Xif.mjs`)),hideCommand:!1},{command:$(`dns-firewall`,`DNS proxy clusters that filter and forward DNS queries with DDoS protection and caching`,()=>import(`./dns-firewall-Coy8d47t.mjs`)),hideCommand:!0},{command:$(`durable-objects`,`Stateful serverless objects with transactional storage, ideal for coordination, sessions, and real-time collaboration`,()=>import(`./durable-objects-BSuRERkw.mjs`)),hideCommand:!0},{command:$(`email-routing`,`Route incoming emails to destination addresses using custom rules, catch-all handlers, and DNS configuration`,()=>import(`./email-routing-BDUYYeV3.mjs`)),hideCommand:!0},{command:$(`email-security`,`Cloud email security (Area 1) — investigate threats, manage allow/block policies, and detect phishing`,()=>import(`./email-security-ChHA6eqQ.mjs`)),hideCommand:!0},{command:$(`email-sending`,`Send emails and manage sending subdomains`,()=>import(`./email-sending-CVrRqn6S.mjs`)),hideCommand:!0},{command:$(`filters`,`Filter expressions used by legacy firewall rules to match requests — prefer Rulesets for new configurations`,()=>import(`./filters-qJpU9uAS.mjs`)),hideCommand:!0},{command:$(`firewall`,`Legacy firewall rules, zone lockdowns, access rules, user-agent blocking, and WAF packages`,()=>import(`./firewall-C3DDwfwh.mjs`)),hideCommand:!0},{command:$(`fraud`,`Fraud detection for login and signup flows — identify credential stuffing, account takeover, and fake accounts`,()=>import(`./fraud-DY3YXFVf.mjs`)),hideCommand:!0},{command:$(`google-tag-gateway`,`Google Tag Gateway operations`,()=>import(`./google-tag-gateway-B00MHDfB.mjs`)),hideCommand:!0},{command:$(`healthchecks`,`Standalone health checks that monitor origin server availability from Cloudflare's edge`,()=>import(`./healthchecks-Drvb79v0.mjs`)),hideCommand:!0},{command:$(`hostnames`,`Per-hostname TLS settings — minimum TLS version, ciphers, and certificate pinning overrides`,()=>import(`./hostnames-BdAQo1Mr.mjs`)),hideCommand:!0},{command:$(`hyperdrive`,`Accelerate access to existing databases by caching queries and pooling connections at the edge`,()=>import(`./hyperdrive-99OJV9nl.mjs`)),hideCommand:!0},{command:$(`iam`,`Identity and access management — permission groups, resource groups, user groups, and SSO connectors`,()=>import(`./iam-BRbpg3lN.mjs`)),hideCommand:!0},{command:$(`images`,`images`,()=>import(`./images-D1jI3r3O.mjs`)),hideCommand:!1},{command:$(`intel`,`Threat intelligence lookups — IP reputation, domain info, ASN details, WHOIS, and indicator feeds`,()=>import(`./intel-C3ajLpXd.mjs`)),hideCommand:!0},{command:$(`ips`,`List Cloudflare's IP ranges used for proxying traffic — useful for firewall allowlisting`,()=>import(`./ips-B6JETVOY.mjs`)),hideCommand:!0},{command:$(`keyless-certificates`,`Use your own SSL certificates without exposing private keys — keys stay on your infrastructure`,()=>import(`./keyless-certificates-C4MZ4xnf.mjs`)),hideCommand:!0},{command:$(`kv`,`Global, low-latency key-value storage for Workers — namespaces, keys, values, and bulk operations`,()=>import(`./kv-CSWoD9ks.mjs`)),hideCommand:!0},{command:$(`leaked-credential-checks`,`leaked-credential-checks`,()=>import(`./leaked-credential-checks-Dgs2oKm9.mjs`)),hideCommand:!0},{command:$(`load-balancers`,`Distribute traffic across origin pools with health monitoring, geo-steering, and failover`,()=>import(`./load-balancers-Du1tNuUt.mjs`)),hideCommand:!0},{command:$(`logpush`,`Push Cloudflare logs to external storage destinations — R2, S3, Splunk, Datadog, and more`,()=>import(`./logpush-SuJyO-uX.mjs`)),hideCommand:!0},{command:$(`logs`,`Log control, retention, and raw log access — CMB config, ray ID lookups, and received fields`,()=>import(`./logs-DcDNRPRl.mjs`)),hideCommand:!0},{command:$(`magic-cloud-networking`,`Multi-cloud networking — discover cloud resources, manage on-ramps, and automate cross-cloud connectivity`,()=>import(`./magic-cloud-networking-D-T0RCvi.mjs`)),hideCommand:!0},{command:$(`magic-network-monitoring`,`Flow-based network traffic monitoring with configurable alerting rules and VPC flow ingestion`,()=>import(`./magic-network-monitoring-CqtvOePQ.mjs`)),hideCommand:!0},{command:$(`magic-transit`,`DDoS-protected network transit — GRE/IPsec tunnels, static routes, Magic WAN sites, connectors, and packet captures`,()=>import(`./magic-transit-BTbkhBtF.mjs`)),hideCommand:!0},{command:$(`managed-transforms`,`Cloudflare-managed HTTP header transforms — automatically add security headers, remove server info, etc.`,()=>import(`./managed-transforms-CfUBSz9p.mjs`)),hideCommand:!0},{command:$(`mtls-certificates`,`Upload and manage mTLS certificates used by API Shield, Workers, and Gateway for client authentication`,()=>import(`./mtls-certificates-Cf1O8c2E.mjs`)),hideCommand:!0},{command:$(`network-interconnects`,`Physical and virtual private interconnects between your infrastructure and Cloudflare's network`,()=>import(`./network-interconnects-DsiNytOU.mjs`)),hideCommand:!0},{command:$(`observability`,`observability`,()=>import(`./observability-CLqZ7OSi.mjs`)),hideCommand:!0},{command:$(`organizations`,`Multi-user organizations that group accounts, members, and shared settings under a single entity`,()=>import(`./organizations-aRi1bhFC.mjs`)),hideCommand:!0},{command:$(`origin-ca-certificates`,`Free Cloudflare-signed certificates installed on your origin server for Full (strict) SSL mode`,()=>import(`./origin-ca-certificates-BB4H89a_.mjs`)),hideCommand:!0},{command:$(`origin-post-quantum-encryption`,`Enable post-quantum key exchange for connections between Cloudflare and your origin server`,()=>import(`./origin-post-quantum-encryption-DurP3PXG.mjs`)),hideCommand:!0},{command:$(`origin-tls-client-auth`,`Authenticated Origin Pulls — require Cloudflare to present a client certificate when connecting to your origin`,()=>import(`./origin-tls-client-auth-CnQNy9-l.mjs`)),hideCommand:!0},{command:$(`page-rules`,`Legacy URL-pattern rules that override zone settings for matching requests — prefer Rules/Transform Rules instead`,()=>import(`./page-rules-CYqtPU1p.mjs`)),hideCommand:!0},{command:$(`page-shield`,`Client-side security — monitor JavaScript, connections, and cookies on your pages for supply-chain attacks`,()=>import(`./page-shield-D8l9ZMUl.mjs`)),hideCommand:!0},{command:$(`pages`,`Full-stack application hosting with Git-integrated builds, preview deployments, and custom domains`,()=>import(`./pages-ChurJ2H7.mjs`)),hideCommand:!0},{command:$(`pipelines`,`Ingest, transform, and route event streams into R2, analytics, or other destinations in real time`,()=>import(`./pipelines-CeyujvRf.mjs`)),hideCommand:!0},{command:$(`queues`,`Reliable message queuing between Workers — produce, consume, and batch-process messages at scale`,()=>import(`./queues-Rf_n11Cx.mjs`)),hideCommand:!0},{command:$(`r2`,`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,()=>import(`./r2-BtuTO3vQ.mjs`)),hideCommand:!0},{command:$(`r2-data-catalog`,`Iceberg-compatible data catalog for R2 — organize objects into tables and namespaces for SQL query engines`,()=>import(`./r2-data-catalog-Debz38kv.mjs`)),hideCommand:!0},{command:$(`radar`,`radar`,()=>import(`./radar-CzGM92uM.mjs`)),hideCommand:!0},{command:$(`rate-limits`,`Legacy per-zone rate limiting rules — prefer Advanced Rate Limiting in Rulesets for new configurations`,()=>import(`./rate-limits-Bbk7HxP7.mjs`)),hideCommand:!0},{command:$(`realtime-kit`,`Real-time video and audio — meetings, livestreams, recordings, and session management via Cloudflare Calls`,()=>import(`./realtime-kit-CivLpkpg.mjs`)),hideCommand:!0},{command:$(`registrar`,`Domain registration and transfer management through Cloudflare Registrar`,()=>import(`./registrar-8IeA5DKd.mjs`)),hideCommand:!1},{command:$(`request-tracers`,`request-tracers`,()=>import(`./request-tracers-D1aH4NmL.mjs`)),hideCommand:!0},{command:$(`resource-sharing`,`resource-sharing`,()=>import(`./resource-sharing-B-Pcto7-.mjs`)),hideCommand:!0},{command:$(`resource-tagging`,`Tag accounts and zones with key-value metadata for organization, filtering, and policy targeting`,()=>import(`./resource-tagging-Bpb6Qq1M.mjs`)),hideCommand:!0},{command:$(`rules`,`Account-level IP lists, hostname lists, and other reusable lists referenced by firewall rules and rulesets`,()=>import(`./rules-B10XWY10.mjs`)),hideCommand:!0},{command:$(`rulesets`,`Versioned collections of rules that control how Cloudflare processes traffic — WAF, transform, redirect, and more`,()=>import(`./rulesets-lYczEcJp.mjs`)),hideCommand:!0},{command:$(`rum`,`rum`,()=>import(`./rum-B5GUKa4I.mjs`)),hideCommand:!0},{command:$(`schema-validation`,`API schema validation settings — enforce request/response schemas and configure validation behavior`,()=>import(`./schema-validation-DTq517Em.mjs`)),hideCommand:!0},{command:$(`scim`,`SCIM 2.0 provisioning — manage users, groups, and identity provider sync for your account`,()=>import(`./scim-BiLfOQ89.mjs`)),hideCommand:!0},{command:$(`secrets-store`,`Centralized secret management — store API keys, tokens, and credentials for use across Workers and other products`,()=>import(`./secrets-store-CBX0dvHL.mjs`)),hideCommand:!0},{command:$(`security-center`,`Security posture dashboard — view and manage security insights, misconfigurations, and vulnerabilities`,()=>import(`./security-center-AVpTOBK3.mjs`)),hideCommand:!0},{command:$(`security-txt`,`Manage the /.well-known/security.txt file that tells security researchers how to report vulnerabilities`,()=>import(`./security-txt-DVlh8y9l.mjs`)),hideCommand:!0},{command:$(`smart-shield`,`Smart Shield settings, health checks, and cache reserve management`,()=>import(`./smart-shield-DblHIce0.mjs`)),hideCommand:!0},{command:$(`snippets`,`Lightweight JavaScript snippets that run on requests before Workers — for quick header modifications and redirects`,()=>import(`./snippets-DrpqSXYC.mjs`)),hideCommand:!0},{command:$(`spectrum`,`Proxy and protect arbitrary TCP/UDP applications through Cloudflare's network with DDoS mitigation`,()=>import(`./spectrum-CnrG0jIC.mjs`)),hideCommand:!0},{command:$(`speed`,`speed`,()=>import(`./speed-BzRY3Xlh.mjs`)),hideCommand:!0},{command:$(`ssl`,`SSL/TLS certificate management — certificate packs, Universal SSL, verification, and TLS mode recommendations`,()=>import(`./ssl-Cp6tQkZH.mjs`)),hideCommand:!0},{command:$(`stream`,`stream`,()=>import(`./stream-CGTRN4ZN.mjs`)),hideCommand:!0},{command:$(`tenants`,`Multi-tenant account management — manage tenant accounts, entitlements, and memberships`,()=>import(`./tenants-o_M62Y1n.mjs`)),hideCommand:!0},{command:$(`token-validation`,`Validate JWT tokens at the edge — configure token sources, signing keys, and validation rules`,()=>import(`./token-validation-Ca5AGEns.mjs`)),hideCommand:!0},{command:$(`turnstile`,`turnstile`,()=>import(`./turnstile-l7mo9BWL.mjs`)),hideCommand:!0},{command:$(`url-normalization`,`Normalize incoming request URLs to a consistent format before rule evaluation and caching`,()=>import(`./url-normalization-D1CogSIG.mjs`)),hideCommand:!0},{command:$(`url-scanner`,`Scan URLs for phishing, malware, and other threats — submit scans and retrieve detailed results`,()=>import(`./url-scanner-BnJHJqcz.mjs`)),hideCommand:!0},{command:$(`user`,`Your Cloudflare user profile, invitations, organizations, billing, and personal API tokens`,()=>import(`./user-CiyYZ69X.mjs`)),hideCommand:!0},{command:$(`vectorize`,`Globally distributed vector database for building semantic search, recommendations, and RAG applications on Workers`,()=>import(`./vectorize-D3LgMLOn.mjs`)),hideCommand:!0},{command:$(`waiting-rooms`,`Virtual queues that throttle traffic to your site during peak demand with customizable waiting pages`,()=>import(`./waiting-rooms-Bhy_nuV3.mjs`)),hideCommand:!0},{command:$(`web3`,`Web3 gateways — serve IPFS and Ethereum content through custom hostnames on Cloudflare`,()=>import(`./web3-DlHE0CZc.mjs`)),hideCommand:!0},{command:$(`workers`,`Deploy and manage serverless JavaScript/WASM applications on Cloudflare's global network`,()=>import(`./workers-DRAkU6YR.mjs`)),hideCommand:!0},{command:$(`workers-builds`,`Automated build and deployment pipeline for Workers — track builds, logs, and repo connections`,()=>import(`./workers-builds-BmNjiHDZ.mjs`)),hideCommand:!0},{command:$(`workflows`,`Durable, multi-step workflows that run on Workers with automatic retries and state persistence`,()=>import(`./workflows-z6oapEJs.mjs`)),hideCommand:!0},{command:$(`zaraz`,`Server-side tag manager — load third-party tools (analytics, pixels, etc.) from Cloudflare's edge without client-side JS`,()=>import(`./zaraz-CyzfYOEU.mjs`)),hideCommand:!0},{command:$(`zero_trust`,`zero_trust`,()=>import(`./zero_trust-BAhlNkjo.mjs`)),hideCommand:!0},{command:$(`zero-trust`,`Cloudflare's SASE platform — secure access, device posture, DLP, tunnels, gateway policies, and network segmentation`,()=>import(`./zero-trust-fyyIelWx.mjs`)),hideCommand:!0},{command:$(`zones`,`Zones are domains on Cloudflare — list, create, and configure domain settings`,()=>import(`./zones-MSULnDwW.mjs`)),hideCommand:!1}];function ur(e){try{let t=new URL(e);return`${t.pathname.replace(/^\/client\/v\d+/,``)}${t.search}`}catch{return e}}function dr(e){if(s(r),e instanceof o){let t=u(),n=e.statusCode,r=e.body,i=n===void 0?`Envelope Error`:pr(n),a=[];if(r){let e=r;Array.isArray(e.errors)&&(a=e.errors)}let o=e.rawResponse?.url?`HTTP ${ur(e.rawResponse.url)}`:void 0,s=n===void 0?i:`${n} ${i}`,c=o?`${s} · ${o}`:s,l=t.dim(c),m=``;return a.length>0?m=a.map((e,n)=>{let r=typeof e.code==`number`?t.hex(d.error).bold(`[${e.code}]`):t.hex(d.error).bold(`[error]`),i=t.bold(e.message??``);return n===a.length-1?`${r} ${i}\n${l}`:`${r} ${i}`}).join(`
|
|
99
|
-
|
|
100
|
-
`):(m=t.hex(d.error).bold(e.message||c),e.message&&c&&(m+=`\n${l}`)),console.error(f(m,void 0,{title:`APIError`,rawMessage:!0})),n===401?console.error(`
|
|
101
|
-
`+p(`Try running: cf auth login`)):n===403&&console.error(`
|
|
102
|
-
`+p(`Check your API token permissions`)),e}if(e instanceof c){let t=u(),n=e.status===void 0?``:`${e.status} ${pr(e.status)}`.trim(),r=n?t.dim(n):``,i=e.notes??[],a;if(i.length>0){let n=typeof e.code==`number`?t.hex(d.error).bold(`[${e.code}]`):t.hex(d.error).bold(`[error]`);a=i.map((e,a)=>{let o=t.bold(e.text),s=a===0?`${n} ${o}`:o;return a===i.length-1&&r?`${s}\n${r}`:s}).join(`
|
|
103
|
-
|
|
104
|
-
`)}else{let n=t.hex(d.error).bold(e.message);a=r?`${n}\n${r}`:n}return console.error(f(a,void 0,{title:`APIError`,rawMessage:!0})),e.status===401?console.error(`
|
|
105
|
-
`+p(`Try running: cf auth login`)):e.status===403&&console.error(`
|
|
106
|
-
`+p(`Check your API token permissions`)),e}if(e instanceof Error){let t=process.env.DEBUG&&e.stack?fr(e.stack):void 0;return console.error(f(e.message,t)),e}return console.error(f(`An unexpected error occurred`,String(e))),e}function fr(e){return e.replace(/[A-Za-z0-9_-]{40,}/g,`[REDACTED]`)}function pr(e){return{400:`Bad Request`,401:`Unauthorized`,403:`Forbidden`,404:`Not Found`,405:`Method Not Allowed`,409:`Conflict`,422:`Unprocessable Entity`,429:`Too Many Requests`,500:`Internal Server Error`,502:`Bad Gateway`,503:`Service Unavailable`,504:`Gateway Timeout`}[e]??``}const mr=$(`auth`,`Authentication commands (login, logout, whoami)`,()=>import(`./auth-DKkSwnxh.mjs`)),hr=$(`context`,`Manage default account and zone context`,()=>import(`./context-CONbNKO-.mjs`)),gr=$(`complete [shell]`,`Generate and handle shell completions`,()=>import(`./completions-D_9WsLG7.mjs`)),_r=$(`schema [command..]`,`Show API schema details for a command`,()=>import(`./schema-hefO-tzo.mjs`)),vr=$(`agent-context [product]`,`Output agent context and tool definitions`,()=>import(`./agent-context-CgGCT0xU.mjs`)),yr=$(`tools`,!1,()=>import(`./tools-DtNNmO6l.mjs`)),br=$(`dev [implArgs..]`,`Run the project's Cloudflare dev server`,()=>import(`./dev-pPazzZvt.mjs`)),xr=$(`build`,`Build a project for Cloudflare`,()=>import(`./build-BE4o4imx.mjs`).then(e=>e.t)),Sr=$(`deploy`,`Deploy a project to Cloudflare`,()=>import(`./deploy-KBRFIatG.mjs`)),Cr=$(`versions`,`Manage Worker Versions`,()=>import(`./versions-B6E8WQyA.mjs`));function wr(e){return e.includes(`--quiet`)||e.includes(`-q`)}function Tr(){process.stderr.isTTY&&(wr(process.argv.slice(2))||process.argv.slice(2).find(e=>!e.startsWith(`-`))!==`complete`&&import(`./config-7CBz8Xm0.mjs`).then(e=>e.t).then(({loadConfig:e,updateConfig:t})=>{e().completions?.prompted||(process.stderr.write(l.muted("Tip: run `cf complete <bash|zsh|fish>` to install shell completions.\n")),t({completions:{prompted:!0}}))}))}function Er(){let e=process.argv.slice(2);return!e.includes(`--version`)&&!e.includes(`-v`)?!1:(console.log(a(r)),!0)}function Dr(){if(process.argv.slice(2).length>0)return!1;let e=[a(r),``,`The Cloudflare CLI — manage your account, zones, and developer platform.`,``,`${l.bold(`Get started:`)}`,` ${l.code(`cf auth login`)} ${l.muted(`Authenticate with Cloudflare`)}`,` ${l.code(`cf --help`)} ${l.muted(`Browse all commands`)}`,` ${l.code(`cf <command> --help`)} ${l.muted(`Per-command help`)}`,` ${l.code(`cf complete bash`)} ${l.muted(`Install shell completions`)}`,``,`${l.bold(`Docs:`)} ${l.brand(`https://developers.cloudflare.com/`)}`,``];return console.log(e.join(`
|
|
107
|
-
`)),!0}function Or(){let e=process.argv.slice(2);e.length!==0&&(e.includes(`--version`)||e.includes(`-v`)||e.find(e=>!e.startsWith(`-`))!==`complete`&&s(r,{quiet:wr(e)}))}function kr(e){let t=e=>l.brand(e),n=cr(e).scriptName(`cf`).usage(`$0 <command> [options]`).usage(`
|
|
108
|
-
The Cloudflare CLI - manage your Cloudflare resources`).updateStrings({"Commands:":t(`Commands`),"Options:":t(`Options`),"Positionals:":t(`Positionals`),"Examples:":t(`Examples`)}).help(`help`,`Show help`).alias(`h`,`help`).option(`quiet`,{type:`boolean`,alias:`q`,description:`Suppress non-essential output`,global:!0,default:!1}).option(`zone`,{type:`string`,alias:`z`,description:`Zone ID or domain name (overrides CLOUDFLARE_ZONE_ID)`,global:!0}).option(`local`,{type:`boolean`,description:"Route to a local `wrangler dev` / `cf dev` Miniflare session",global:!0,default:!1}).option(`local-endpoint`,{type:`string`,description:`Local Miniflare endpoint URL (required with --local until auto-discovery ships)`,global:!0}).group([`quiet`,`zone`,`local`,`local-endpoint`,`help`,`version`],t(`Global flags`)).command(mr).command(hr).command(xr).command(gr).command(Sr).command(br).command(Cr).command(_r).command(vr).command(yr);for(let e of lr)e.hideCommand?n.command({...e.command,describe:!1}):n.command(e.command);return n.middleware(e=>{if(e.local&&!e.localEndpoint)throw Error("--local requires --local-endpoint <url> (e.g. http://127.0.0.1:8787).\nDiscovery via the dev registry will land in a future release; until then,\npoint cf at your running `wrangler dev` / `cf dev` session explicitly.")}).demandCommand(1,`You need to specify a command`).strict().version(r).alias(`v`,`version`).epilogue(`For more information, visit https://developers.cloudflare.com/`).exitProcess(!1).fail((e,t,n)=>{if(t)throw t;if(e===`Please specify a subcommand`){n.showHelp(`log`);return}throw n.showHelp(`error`),Error(e)}),n}var Ar=class extends Error{constructor(e){super(`CliExit(${e})`),this.code=e,this.name=`CliExit`}};async function jr(e){let t=process.argv;process.argv=[`node`,`cf`,...e];try{await Mr()}finally{process.argv=t}}async function Mr(){if(Er()||Dr())throw new Ar(0);Or();let e=kr(ot(process.argv));Tr();try{await e.parse(ot(process.argv))}catch(e){throw e instanceof Ar?e:dr(e)}}export{jr as i,kr as n,Mr as r,Ar as t};
|
package/dist/ssl-Cp6tQkZH.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,S as t,T as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{n as l}from"./input-validation-CTqtyiY9.mjs";import{t as u}from"./cli-types-CMNMD1V7.mjs";function d(e){return e.option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Returns the set of hostnames, the signature algorithm, and the expiration date of the certificate.`,builder:d,handler:async e=>{if(e.dryRun){s({command:`cf ssl analyze create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/analyze`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({bundle_method:l(e[`bundle-method`],`bundle-method`,`text`),certificate:l(e.certificate,`certificate`,`text`)}):i(e.body)});return}let n=await r(e),u=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=u,e.body){let t=i(e.body);o(await c(`Creating`,async()=>n.ssl.analyze.create({...t,zone_id:u})),{successLabel:`Created`});return}let d=a({bundle_method:l(e[`bundle-method`],`bundle-method`,`text`),certificate:l(e.certificate,`certificate`,`text`)});o(await c(`Creating`,async()=>n.ssl.analyze.create({...d,zone_id:u})),{successLabel:`Created`})}},p={command:`analyze`,describe:`Operations for analyze`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get`,describe:`If the system is enabled, the response will include next_scheduled_scan, representing the next time this zone will be scanned and the zone's ssl/tls encryption mode is potentially upgraded by the system. If the system is disabled, next_scheduled_scan will not be present in the response body.`,builder:m,handler:async e=>{if(e.dryRun){s({command:`cf ssl automatic-upgrader get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/ssl_automatic_mode`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.ssl.automaticUpgrader.get({zone_id:i})),{successLabel:`Loaded`})}};function g(e){return e.option(`value`,{type:`string`,description:`Controls enablement of Automatic SSL/TLS.`,choices:[`auto`,`custom`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Automatic SSL/TLS.`})}const _={command:`patch`,describe:`The automatic system is enabled when this endpoint is hit with value in the request body is set to "auto", and disabled when the request body value is set to "custom".`,builder:g,handler:async n=>{if(n.dryRun){s({command:`cf ssl automatic-upgrader patch`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/settings/ssl_automatic_mode`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({value:l(n.value,`value`,`text`)}):i(n.body)});return}let u=await r(n),d=await t({zone:n.zone},u,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=i(n.body);o(await c(`Updating`,async()=>u.ssl.automaticUpgrader.patch({...e,zone_id:d})),{successLabel:`Updated`});return}n.value===void 0&&(n.value=await e(`value`,`Controls enablement of Automatic SSL/TLS.`,[`auto`,`custom`]));let f=a({value:l(n.value,`value`,`text`)});o(await c(`Updating`,async()=>u.ssl.automaticUpgrader.patch({...f,zone_id:d})),{successLabel:`Updated`})}},v={command:`automatic-upgrader`,describe:`SSL automatic mode enrollment — get or update automatic SSL/TLS upgrader settings`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`certificate-authority`,{type:`string`,description:`Certificate Authority selected for the order. For information on any certificate authority specific details or restrictions [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities).`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`hosts`,{type:`string`,array:!0,description:`Comma separated list of valid host names for the certificate packs. Must contain the zone apex, may not contain more than 50 hosts, and may not be empty.`}).option(`type`,{type:`string`,description:`Type of certificate pack.`,choices:[`advanced`]}).option(`validation-method`,{type:`string`,description:`Validation Method selected for the order.`,choices:[`txt`,`http`,`email`]}).option(`validity-days`,{type:`number`,description:`Validity Days selected for the order.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create`,describe:`For a given zone, order an advanced certificate pack.`,builder:y,handler:async n=>{if(n.dryRun){s({command:`cf ssl certificate-packs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/ssl/certificate_packs/order`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({certificate_authority:l(n[`certificate-authority`],`certificate-authority`,`text`),cloudflare_branding:n[`cloudflare-branding`],hosts:n.hosts,type:l(n.type,`type`,`text`),validation_method:l(n[`validation-method`],`validation-method`,`text`),validity_days:n[`validity-days`]}):i(n.body)});return}let u=await r(n),d=await t({zone:n.zone},u,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.ssl.certificatePacks.create({...e,zone_id:d})),{successLabel:`Created`});return}if(n[`certificate-authority`]===void 0&&(n[`certificate-authority`]=await e(`certificate-authority`,`Certificate Authority selected for the order. For information on any certificate authority specific details or restrictions [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities).`,[`google`,`lets_encrypt`,`ssl_com`])),n.hosts===void 0)throw Error(`--hosts is required (or pass --body with this field set).`);if(n.type===void 0&&(n.type=await e(`type`,`Type of certificate pack.`,[`advanced`])),n[`validation-method`]===void 0&&(n[`validation-method`]=await e(`validation-method`,`Validation Method selected for the order.`,[`txt`,`http`,`email`])),n[`validity-days`]===void 0)throw Error(`--validity-days is required (or pass --body with this field set).`);let f=a({certificate_authority:l(n[`certificate-authority`],`certificate-authority`,`text`),cloudflare_branding:n[`cloudflare-branding`],hosts:n.hosts,type:l(n.type,`type`,`text`),validation_method:l(n[`validation-method`],`validation-method`,`text`),validity_days:n[`validity-days`]});o(await c(`Creating`,async()=>u.ssl.certificatePacks.create({...f,zone_id:d})),{successLabel:`Created`})}};function x(e){return e.positional(`certificate-pack-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <certificate-pack-id>`,describe:`For a given zone, delete an advanced certificate pack.`,builder:x,handler:async e=>{if(e.dryRun){s({command:`cf ssl certificate-packs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/certificate_packs/${e[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(e[`certificate-pack-id`]))}`,pathParams:{"certificate-pack-id":String(e[`certificate-pack-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}o(await c(`Deleting`,async()=>i.ssl.certificatePacks.delete({zone_id:a,certificate_pack_id:e[`certificate-pack-id`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`certificate-pack-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`edit <certificate-pack-id>`,describe:`For a given zone, restart validation or add cloudflare branding for an advanced certificate pack. The former is only a validation operation for a Certificate Pack in a validation_timed_out status.`,builder:C,handler:async e=>{if(e.dryRun){s({command:`cf ssl certificate-packs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/certificate_packs/${e[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(e[`certificate-pack-id`]))}`,pathParams:{"certificate-pack-id":String(e[`certificate-pack-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({cloudflare_branding:e[`cloudflare-branding`]}):i(e.body)});return}let n=await r(e),l=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=i(e.body);o(await c(`Updating`,async()=>n.ssl.certificatePacks.edit({...t,zone_id:l,certificate_pack_id:e[`certificate-pack-id`]})),{successLabel:`Updated`});return}let u=a({cloudflare_branding:e[`cloudflare-branding`]});o(await c(`Updating`,async()=>n.ssl.certificatePacks.edit({...u,zone_id:l,certificate_pack_id:e[`certificate-pack-id`]})),{successLabel:`Updated`})}};function T(e){return e.positional(`certificate-pack-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <certificate-pack-id>`,describe:`For a given zone, get a certificate pack.`,builder:T,handler:async e=>{if(e.dryRun){s({command:`cf ssl certificate-packs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/certificate_packs/${e[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(e[`certificate-pack-id`]))}`,pathParams:{"certificate-pack-id":String(e[`certificate-pack-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.ssl.certificatePacks.get({zone_id:i,certificate_pack_id:e[`certificate-pack-id`]})),{successLabel:`Loaded`})}};function D(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of certificate packs per page.`}).option(`status`,{type:`string`,description:`Include Certificate Packs of all statuses, not just active ones.`,choices:[`all`]}).option(`deploy`,{type:`string`,description:`Specify the deployment environment for the certificate packs.`,choices:[`staging`,`production`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`For a given zone, list all active certificate packs.`,builder:u(D),handler:async e=>{let n={page:e.page,per_page:e[`per-page`],status:e.status,deploy:e.deploy};if(e.dryRun){s({command:`cf ssl certificate-packs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/certificate_packs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.ssl.certificatePacks.list({zone_id:a,...n})),{successLabel:`Loaded`})}};function k(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get`,describe:`For a given zone, list certificate pack quotas.`,builder:k,handler:async e=>{if(e.dryRun){s({command:`cf ssl certificate-packs quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/certificate_packs/quota`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.ssl.certificatePacks.quota.get({zone_id:i})),{successLabel:`Loaded`})}},j={command:`quota`,describe:`Operations for certificate-packs.quota`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},M={command:`certificate-packs`,describe:`Operations for certificate-packs`,builder:e=>e.command(b).command(S).command(w).command(E).command(O).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`enabled`,{type:`boolean`,description:`Disabling Universal SSL removes any currently active Universal SSL certificates for your zone from the edge and prevents any future Universal SSL certificates from being ordered. If there are no advanced certificates or custom certificates uploaded for the domain, visitors will be unable to access the domain over HTTPS.
|
|
4
|
-
|
|
5
|
-
By disabling Universal SSL, you understand that the following Cloudflare settings and preferences will result in visitors being unable to visit your domain unless you have uploaded a custom certificate or purchased an advanced certificate.
|
|
6
|
-
|
|
7
|
-
* HSTS
|
|
8
|
-
* Always Use HTTPS
|
|
9
|
-
* Opportunistic Encryption
|
|
10
|
-
* Onion Routing
|
|
11
|
-
* Any Page Rules redirecting traffic to HTTPS
|
|
12
|
-
|
|
13
|
-
Similarly, any HTTP redirect to HTTPS at the origin while the Cloudflare proxy is enabled will result in users being unable to visit your site without a valid certificate at Cloudflare's edge.
|
|
14
|
-
|
|
15
|
-
If you do not have a valid custom or advanced certificate at Cloudflare's edge and are unsure if any of the above Cloudflare settings are enabled, or if any HTTP redirects exist at your origin, we advise leaving Universal SSL enabled for your domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`edit`,describe:`Patch Universal SSL Settings for a Zone.`,builder:N,handler:async e=>{if(e.dryRun){s({command:`cf ssl universal settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/universal/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({enabled:e.enabled}):i(e.body)});return}let n=await r(e),l=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=i(e.body);o(await c(`Updating`,async()=>n.ssl.universal.settings.edit({body:t,zone_id:l})),{successLabel:`Updated`});return}let u=a({enabled:e.enabled});o(await c(`Updating`,async()=>n.ssl.universal.settings.edit({body:u,zone_id:l})),{successLabel:`Updated`})}};function F(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get`,describe:`Get Universal SSL Settings for a Zone.`,builder:F,handler:async e=>{if(e.dryRun){s({command:`cf ssl universal settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/universal/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.ssl.universal.settings.get({zone_id:i})),{successLabel:`Loaded`})}},L={command:`settings`,describe:`Operations for universal.settings`,builder:e=>e.command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},R={command:`universal`,describe:`Operations for universal`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.positional(`certificate-pack-id`,{type:`string`,description:`Certificate Pack UUID.`,demandOption:!0}).option(`validation-method`,{type:`string`,description:`Desired validation method.`,choices:[`http`,`cname`,`txt`,`email`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`edit <certificate-pack-id>`,describe:`Edit SSL validation method for a certificate pack. A PATCH request will request an immediate validation check on any certificate, and return the updated status. If a validation method is provided, the validation will be immediately attempted using that method.`,builder:z,handler:async n=>{if(n.dryRun){s({command:`cf ssl verification edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/ssl/verification/${n[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(n[`certificate-pack-id`]))}`,pathParams:{"certificate-pack-id":String(n[`certificate-pack-id`]??``),"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({validation_method:l(n[`validation-method`],`validation-method`,`text`)}):i(n.body)});return}let u=await r(n),d=await t({zone:n.zone},u,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=i(n.body);o(await c(`Updating`,async()=>u.ssl.verification.edit({...e,zone_id:d,certificate_pack_id:n[`certificate-pack-id`]})),{successLabel:`Updated`});return}n[`validation-method`]===void 0&&(n[`validation-method`]=await e(`validation-method`,`Desired validation method.`,[`http`,`cname`,`txt`,`email`]));let f=a({validation_method:l(n[`validation-method`],`validation-method`,`text`)});o(await c(`Updating`,async()=>u.ssl.verification.edit({...f,zone_id:d,certificate_pack_id:n[`certificate-pack-id`]})),{successLabel:`Updated`})}};function V(e){return e.option(`retry`,{type:`string`,description:`Immediately retry SSL Verification.`,choices:[`true`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get`,describe:`Get SSL Verification Info for a Zone.`,builder:u(V),handler:async e=>{let n={retry:e.retry};if(e.dryRun){s({command:`cf ssl verification get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ssl/verification`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.ssl.verification.get({zone_id:a,...n})),{successLabel:`Loaded`})}},U={command:`verification`,describe:`Operations for verification`,builder:e=>e.command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},W={command:`ssl`,describe:`SSL/TLS certificate management — certificate packs, Universal SSL, verification, and TLS mode recommendations`,builder:e=>e.command(p).command(v).command(M).command(R).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{W as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,S as t,T as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{n as l}from"./input-validation-CTqtyiY9.mjs";function u(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const d={command:`delete`,describe:`Deletes the URL Normalization settings.`,builder:u,handler:async e=>{if(e.dryRun){s({command:`cf url-normalization delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/url_normalization`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}o(await c(`Deleting`,async()=>i.urlNormalization.delete({zone_id:a})),{successLabel:`Deleted`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get`,describe:`Fetches the current URL Normalization settings.`,builder:f,handler:async e=>{if(e.dryRun){s({command:`cf url-normalization get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/url_normalization`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.urlNormalization.get({zone_id:i})),{successLabel:`Loaded`})}};function m(e){return e.option(`scope`,{type:`string`,description:`The scope of the URL normalization.`,choices:[`incoming`,`both`,`none`]}).option(`type`,{type:`string`,description:`The type of URL normalization performed by Cloudflare.`,choices:[`cloudflare`,`rfc3986`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A URL Normalization object.`})}const h={command:`update`,describe:`Updates the URL Normalization settings.`,builder:m,handler:async n=>{if(n.dryRun){s({command:`cf url-normalization update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/url_normalization`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({scope:l(n.scope,`scope`,`text`),type:l(n.type,`type`,`text`)}):i(n.body)});return}let u=await r(n),d=await t({zone:n.zone},u,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=i(n.body);o(await c(`Updating`,async()=>u.urlNormalization.update({body:e,zone_id:d})),{successLabel:`Updated`});return}n.scope===void 0&&(n.scope=await e(`scope`,`The scope of the URL normalization.`,[`incoming`,`both`,`none`])),n.type===void 0&&(n.type=await e(`type`,`The type of URL normalization performed by Cloudflare.`,[`cloudflare`,`rfc3986`]));let f=a({scope:l(n.scope,`scope`,`text`),type:l(n.type,`type`,`text`)});o(await c(`Updating`,async()=>u.urlNormalization.update({body:f,zone_id:d})),{successLabel:`Updated`})}},g={command:`url-normalization`,describe:`Normalize incoming request URLs to a consistent format before rule evaluation and caching`,builder:e=>e.command(d).command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as e,D as t,_ as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{n as l}from"./input-validation-CTqtyiY9.mjs";import{t as u}from"./local-D8bhHUMK.mjs";import{n as d,t as f}from"./raw-fetch-DnbAMFBp.mjs";function p(e){return e.positional(`response-id`,{type:`string`,description:`Response hash.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <response-id>`,describe:"Returns the raw response of the network request. Find the `response_id` in the `data.requests.response.hash`.",builder:p,handler:async t=>{if(t.dryRun){s({command:`cf url-scanner responses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/urlscanner/v2/responses/${t[`response-id`]==null?`<response-id>`:encodeURIComponent(String(t[`response-id`]))}`,pathParams:{"response-id":String(t[`response-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,d((await c(`Loading`,async()=>f(`/accounts/${a}/urlscanner/v2/responses/${encodeURIComponent(String(t[`response-id`]))}`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}))).toString(`utf-8`))}},h={command:`responses`,describe:`Operations for responses`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of urls to scan (up to a 100).`})}const _={command:`bulk-create`,describe:`Submit URLs to scan. Check limits at https://developers.cloudflare.com/security-center/investigate/scan-limits/ and take into account scans submitted in bulk have lower priority and may take longer to finish.`,builder:g,handler:async t=>{if(t.dryRun){s({command:`cf url-scanner scans bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/urlscanner/v2/bulk`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:i(t.body)});return}let a=await r(t),l=t.local?u:await n(a);if(t.accountId=l,t.body){let e=i(t.body);o(await c(`Creating`,async()=>a.urlScanner.scans.bulkCreate({body:e,account_id:l})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function v(e){return e.option(`agent-readiness`,{type:`boolean`,description:`Enable agent readiness checks.`}).option(`country`,{type:`string`,description:`Country to geo egress from`,choices:`AF.AL.DZ.AD.AO.AG.AR.AM.AU.AT.AZ.BH.BD.BB.BY.BE.BZ.BJ.BM.BT.BO.BA.BW.BR.BN.BG.BF.BI.KH.CM.CA.CV.KY.CF.TD.CL.CN.CO.KM.CG.CR.CI.HR.CU.CY.CZ.CD.DK.DJ.DM.DO.EC.EG.SV.GQ.ER.EE.SZ.ET.FJ.FI.FR.GA.GE.DE.GH.GR.GL.GD.GT.GN.GW.GY.HT.HN.HU.IS.IN.ID.IR.IQ.IE.IL.IT.JM.JP.JO.KZ.KE.KI.KW.KG.LA.LV.LB.LS.LR.LY.LI.LT.LU.MO.MG.MW.MY.MV.ML.MR.MU.MX.FM.MD.MC.MN.MS.MA.MZ.MM.NA.NR.NP.NL.NZ.NI.NE.NG.KP.MK.NO.OM.PK.PS.PA.PG.PY.PE.PH.PL.PT.QA.RO.RU.RW.SH.KN.LC.VC.WS.SM.ST.SA.SN.RS.SC.SL.SK.SI.SB.SO.ZA.KR.SS.ES.LK.SD.SR.SE.CH.SY.TW.TJ.TZ.TH.BS.GM.TL.TG.TO.TT.TN.TR.TM.UG.UA.AE.GB.US.UY.UZ.VU.VE.VN.YE.ZM.ZW`.split(`.`)}).option(`customagent`,{type:`string`,description:`The customagent field`}).option(`referer`,{type:`string`,description:`The referer field`}).option(`screenshots-resolutions`,{type:`string`,array:!0,description:`Take multiple screenshots targeting different device types.`}).option(`url`,{type:`string`,description:`The url field`}).option(`visibility`,{type:`string`,description:"The option `Public` means it will be included in listings like recent scans and search results. `Unlisted` means it will not be included in the aforementioned listings, users will need to have the scan's ID to access it. A a scan will be automatically marked as unlisted if it fails, if it contains potential PII or other sensitive material.",choices:[`Public`,`Unlisted`],default:`Public`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Submit a URL to scan. Check limits at https://developers.cloudflare.com/security-center/investigate/scan-limits/.`,builder:v,handler:async d=>{if(d.dryRun){s({command:`cf url-scanner scans create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/urlscanner/v2/scan`,pathParams:{},bodyKind:`json`,body:d.body===void 0?a({agentReadiness:d[`agent-readiness`],country:l(d.country,`country`,`text`),customagent:l(d.customagent,`customagent`,`text`),referer:l(d.referer,`referer`,`text`),screenshotsResolutions:d[`screenshots-resolutions`],url:l(d.url,`url`,`text`),visibility:l(d.visibility,`visibility`,`text`)}):i(d.body)});return}let f=await r(d),p=d.local?u:await n(f);if(d.accountId=p,d.body){let e=i(d.body);o(await c(`Creating`,async()=>f.urlScanner.scans.create({...e,account_id:p})),{successLabel:`Created`});return}d.url===void 0&&(d.url=await t(`url`,`The url field`));let m=a({agentReadiness:d[`agent-readiness`],country:l(d.country,`country`,`text`),customagent:l(d.customagent,`customagent`,`text`),referer:l(d.referer,`referer`,`text`),screenshotsResolutions:d[`screenshots-resolutions`],url:l(d.url,`url`,`text`),visibility:l(d.visibility,`visibility`,`text`)});o(await c(`Creating`,async()=>f.urlScanner.scans.create({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.positional(`scan-id`,{type:`string`,description:`Scan UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`dom <scan-id>`,describe:`Returns a plain text response, with the scan's DOM content as rendered by Chrome.`,builder:b,handler:async t=>{if(t.dryRun){s({command:`cf url-scanner scans dom`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/urlscanner/v2/dom/${t[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(t[`scan-id`]))}`,pathParams:{"scan-id":String(t[`scan-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,d((await c(`Loading`,async()=>f(`/accounts/${a}/urlscanner/v2/dom/${encodeURIComponent(String(t[`scan-id`]))}`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}))).toString(`utf-8`))}};function S(e){return e.positional(`scan-id`,{type:`string`,description:`Scan UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <scan-id>`,describe:`Get URL scan by uuid`,builder:S,handler:async t=>{if(t.dryRun){s({command:`cf url-scanner scans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/urlscanner/v2/result/${t[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(t[`scan-id`]))}`,pathParams:{"scan-id":String(t[`scan-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.urlScanner.scans.get({account_id:a,scan_id:t[`scan-id`]})),{successLabel:`Loaded`})}};function w(e){return e.positional(`scan-id`,{type:`string`,description:`Scan UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`har <scan-id>`,describe:`Get a URL scan's HAR file. See HAR spec at http://www.softwareishard.com/blog/har-12-spec/.`,builder:w,handler:async t=>{if(t.dryRun){s({command:`cf url-scanner scans har`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/urlscanner/v2/har/${t[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(t[`scan-id`]))}`,pathParams:{"scan-id":String(t[`scan-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.urlScanner.scans.har({account_id:a,scan_id:t[`scan-id`]})),{successLabel:`Loaded`})}};function E(e){return e.option(`size`,{type:`number`,description:`Limit the number of objects in the response.`}).option(`q`,{type:`string`,description:`Filter scans`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`Use a subset of ElasticSearch Query syntax to filter scans. Some example queries:<br/> <br/>- 'path:"/bundles/jquery.js"': Searches for scans who requested resources with the given path.<br/>- 'page.asn:AS24940 AND hash:xxx': Websites hosted in AS24940 where a resource with the given hash was downloaded.<br/>- 'page.domain:microsoft* AND verdicts.malicious:true AND NOT page.domain:microsoft.com': malicious scans whose hostname starts with "microsoft".<br/>- 'apikey:me AND date:[2025-01 TO 2025-02]': my scans from 2025 January to 2025 February.`,builder:E,handler:async t=>{let i={size:t.size,q:t.q};if(t.dryRun){s({command:`cf url-scanner scans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/urlscanner/v2/search`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.urlScanner.scans.list({account_id:l,...i})),{successLabel:`Loaded`})}};function O(e){return e.positional(`scan-id`,{type:`string`,description:`Scan UUID.`,demandOption:!0}).option(`resolution`,{type:`string`,description:`Target device type.`,choices:[`desktop`,`mobile`,`tablet`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const k={command:`screenshot <scan-id>`,describe:`Get scan's screenshot by resolution (desktop/mobile/tablet).`,builder:O,handler:async t=>{let i={resolution:t.resolution};if(t.dryRun){s({command:`cf url-scanner scans screenshot`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/urlscanner/v2/screenshots/${t[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(t[`scan-id`]))}.png`,pathParams:{"scan-id":String(t[`scan-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(t),o=t.local?u:await n(a);t.accountId=o;let l=new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),p=await c(`Loading`,async()=>f(`/accounts/${o}/urlscanner/v2/screenshots/${encodeURIComponent(String(t[`scan-id`]))}.png${l?`?`+l:``}`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}));d(t.text===!0?p.toString(`utf-8`):p)}},A={command:`scans`,describe:`Operations for scans`,builder:e=>e.command(_).command(y).command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`url-scanner`,describe:`Scan URLs for phishing, malware, and other threats — submit scans and retrieve detailed results`,builder:e=>e.command(h).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{j as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as e,D as t,E as n,T as r,_ as i,i as a,n as o}from"./auth-BqDOIrKX.mjs";import{n as s,t as c}from"./body-parser-CBpeIUns.mjs";import{t as l}from"./output-CUxZRM5A.mjs";import{n as u,t as d}from"./progress-Cent9Lsg.mjs";import{n as f,t as p}from"./input-validation-CTqtyiY9.mjs";import{t as m}from"./local-D8bhHUMK.mjs";function h(e){return e.option(`config-dimensions`,{type:`number`,description:`Specifies the number of dimensions for the index`}).option(`config-metric`,{type:`string`,description:`Specifies the type of metric to use calculating distance.`,choices:[`cosine`,`euclidean`,`dot-product`]}).option(`config-preset`,{type:`string`,description:`Specifies the preset to use for the index.`,choices:[`@cf/baai/bge-small-en-v1.5`,`@cf/baai/bge-base-en-v1.5`,`@cf/baai/bge-large-en-v1.5`,`openai/text-embedding-ada-002`,`cohere/embed-multilingual-v2.0`]}).option(`description`,{type:`string`,description:`Specifies the description of the index.`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`config-dimensions`,[`config-preset`]).implies(`config-dimensions`,[`config-metric`]).conflicts(`config-metric`,[`config-preset`]).implies(`config-metric`,[`config-dimensions`]).conflicts(`config-preset`,[`config-dimensions`,`config-metric`])}const g={command:`create`,describe:`Creates and returns a new Vectorize Index.`,builder:h,handler:async n=>{if(n.dryRun){u({command:`cf vectorize create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({config:{dimensions:n[`config-dimensions`],metric:f(n[`config-metric`],`config-metric`,`text`),preset:f(n[`config-preset`],`config-preset`,`text`)},description:f(n.description,`description`,`text`),name:f(n.name,`name`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?m:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.vectorize.create({body:e,account_id:a})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`The name field`));let p=c({config:{dimensions:n[`config-dimensions`],metric:f(n[`config-metric`],`config-metric`,`text`),preset:f(n[`config-preset`],`config-preset`,`text`)},description:f(n.description,`description`,`text`),name:f(n.name,`name`,`text`)});l(await d(`Creating`,async()=>r.vectorize.create({body:p,account_id:a})),{successLabel:`Created`})}};function _(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`A list of vector identifiers to delete from the index indicated by the path.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`delete-by-ids <index-name>`,describe:`Delete a set of vectors from an index by their vector identifiers.`,builder:_,handler:async t=>{if(t.dryRun){u({command:`cf vectorize delete-by-ids`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes/${t[`index-name`]==null?`<index-name>`:encodeURIComponent(String(t[`index-name`]))}/delete_by_ids`,pathParams:{"index-name":String(t[`index-name`]??``)},bodyKind:`json`,body:t.body===void 0?c({ids:t.ids}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.vectorize.deleteByIds({body:e,account_id:r,index_name:t[`index-name`]})),{successLabel:`Created`});return}let a=c({ids:t.ids});l(await d(`Creating`,async()=>n.vectorize.deleteByIds({body:a,account_id:r,index_name:t[`index-name`]})),{successLabel:`Created`})}};function y(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`delete <index-name>`,describe:`Deletes the specified Vectorize Index.`,builder:y,handler:async t=>{if(t.dryRun){u({command:`cf vectorize delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes/${t[`index-name`]==null?`<index-name>`:encodeURIComponent(String(t[`index-name`]))}`,pathParams:{"index-name":String(t[`index-name`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}l(await d(`Deleting`,async()=>n.vectorize.delete({account_id:a,index_name:t[`index-name`]})),{successLabel:`Deleted`})}};function x(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`A list of vector identifiers to retrieve from the index indicated by the path.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`get-by-ids <index-name>`,describe:`Get a set of vectors from an index by their vector identifiers.`,builder:x,handler:async t=>{if(t.dryRun){u({command:`cf vectorize get-by-ids`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes/${t[`index-name`]==null?`<index-name>`:encodeURIComponent(String(t[`index-name`]))}/get_by_ids`,pathParams:{"index-name":String(t[`index-name`]??``)},bodyKind:`json`,body:t.body===void 0?c({ids:t.ids}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.vectorize.getByIds({body:e,account_id:r,index_name:t[`index-name`]})),{successLabel:`Created`});return}let a=c({ids:t.ids});l(await d(`Creating`,async()=>n.vectorize.getByIds({body:a,account_id:r,index_name:t[`index-name`]})),{successLabel:`Created`})}};function C(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <index-name>`,describe:`Returns the specified Vectorize Index.`,builder:C,handler:async t=>{if(t.dryRun){u({command:`cf vectorize get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes/${t[`index-name`]==null?`<index-name>`:encodeURIComponent(String(t[`index-name`]))}`,pathParams:{"index-name":String(t[`index-name`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.vectorize.get({account_id:r,index_name:t[`index-name`]})),{successLabel:`Loaded`})}};function T(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`info <index-name>`,describe:`Get information about a vectorize index.`,builder:T,handler:async t=>{if(t.dryRun){u({command:`cf vectorize info`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes/${t[`index-name`]==null?`<index-name>`:encodeURIComponent(String(t[`index-name`]))}/info`,pathParams:{"index-name":String(t[`index-name`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.vectorize.info({account_id:r,index_name:t[`index-name`]})),{successLabel:`Loaded`})}};function D(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`unparsable-behavior`,{type:`string`,description:`Behavior for ndjson parse failures.`,choices:[`error`,`discard`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const O={command:`insert <index-name>`,describe:`Inserts vectors into the specified index and returns a mutation id corresponding to the vectors enqueued for insertion.`,builder:D,handler:async t=>{let n={"unparsable-behavior":t[`unparsable-behavior`]};if(t.dryRun){u({command:`cf vectorize insert`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes/${t[`index-name`]==null?`<index-name>`:encodeURIComponent(String(t[`index-name`]))}/insert`,pathParams:{"index-name":String(t[`index-name`]??``)},query:n,bodyKind:`octet-stream`,body:t.body});return}let r=await o(t),s=t.local?m:await i(r);if(t.accountId=s,t.file){let e=p(t.file);l(await d(`Creating`,async()=>a(r,`POST`,`/accounts/${s}/vectorize/v2/indexes/${encodeURIComponent(String(t[`index-name`]))}/insert`,{body:e,headers:{"Content-Type":`application/x-ndjson`}})),{successLabel:`Created`});return}if(t.body){let e=f(t.body,`body`,`binary`),i=new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();l(await d(`Creating`,async()=>a(r,`POST`,`/accounts/${s}/vectorize/v2/indexes/${encodeURIComponent(String(t[`index-name`]))}/insert${i?`?`+i:``}`,{body:e,headers:{"Content-Type":`application/x-ndjson`}})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function k(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`count`,{type:`number`,description:`Maximum number of vectors to return`}).option(`cursor`,{type:`string`,description:`Cursor for pagination to get the next page of results`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list-vectors <index-name>`,describe:`Returns a paginated list of vector identifiers from the specified index.`,builder:k,handler:async t=>{let n={count:t.count,cursor:t.cursor};if(t.dryRun){u({command:`cf vectorize list-vectors`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes/${t[`index-name`]==null?`<index-name>`:encodeURIComponent(String(t[`index-name`]))}/list`,pathParams:{"index-name":String(t[`index-name`]??``)},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.vectorize.listVectors({account_id:a,index_name:t[`index-name`],...n})),{successLabel:`Loaded`})}};function j(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`Returns a list of Vectorize Indexes`,builder:j,handler:async t=>{if(t.dryRun){u({command:`cf vectorize list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.vectorize.list({account_id:r})),{successLabel:`Loaded`})}};function N(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`index-type`,{type:`string`,description:`Specifies the type of metadata property to index.`,choices:[`string`,`number`,`boolean`]}).option(`property-name`,{type:`string`,description:`Specifies the metadata property to index.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`create <index-name>`,describe:`Enable metadata filtering based on metadata property. Limited to 10 properties.`,builder:N,handler:async r=>{if(r.dryRun){u({command:`cf vectorize metadata-index create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes/${r[`index-name`]==null?`<index-name>`:encodeURIComponent(String(r[`index-name`]))}/metadata_index/create`,pathParams:{"index-name":String(r[`index-name`]??``)},bodyKind:`json`,body:r.body===void 0?c({indexType:f(r[`index-type`],`index-type`,`text`),propertyName:f(r[`property-name`],`property-name`,`text`)}):s(r.body)});return}let a=await o(r),p=r.local?m:await i(a);if(r.accountId=p,r.body){let e=s(r.body);l(await d(`Creating`,async()=>a.vectorize.metadataIndex.create({...e,account_id:p,index_name:r[`index-name`]})),{successLabel:`Created`});return}r[`index-type`]===void 0&&(r[`index-type`]=await n(`index-type`,`Specifies the type of metadata property to index.`,[`string`,`number`,`boolean`])),r[`property-name`]===void 0&&(r[`property-name`]=await t(`property-name`,`Specifies the metadata property to index.`));let h=c({indexType:f(r[`index-type`],`index-type`,`text`),propertyName:f(r[`property-name`],`property-name`,`text`)});l(await d(`Creating`,async()=>a.vectorize.metadataIndex.create({...h,account_id:p,index_name:r[`index-name`]})),{successLabel:`Created`})}};function F(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`property-name`,{type:`string`,description:`Specifies the metadata property for which the index must be deleted.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`delete <index-name>`,describe:`Allow Vectorize to delete the specified metadata index.`,builder:F,handler:async n=>{if(n.dryRun){u({command:`cf vectorize metadata-index delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes/${n[`index-name`]==null?`<index-name>`:encodeURIComponent(String(n[`index-name`]))}/metadata_index/delete`,pathParams:{"index-name":String(n[`index-name`]??``)},bodyKind:`json`,body:n.body===void 0?c({propertyName:f(n[`property-name`],`property-name`,`text`)}):s(n.body)});return}let a=await o(n),p=n.local?m:await i(a);if(n.accountId=p,!await r({force:!!n.force,message:`This operation deletes a metadata index destructively.`})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}if(n.body){let e=s(n.body);l(await d(`Deleting`,async()=>a.vectorize.metadataIndex.delete({...e,account_id:p,index_name:n[`index-name`]})),{successLabel:`Deleted`});return}n[`property-name`]===void 0&&(n[`property-name`]=await t(`property-name`,`Specifies the metadata property for which the index must be deleted.`));let h=c({propertyName:f(n[`property-name`],`property-name`,`text`)});l(await d(`Deleting`,async()=>a.vectorize.metadataIndex.delete({...h,account_id:p,index_name:n[`index-name`]})),{successLabel:`Deleted`})}};function L(e){return e.option(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`List Metadata Indexes for the specified Vectorize Index.`,builder:L,handler:async t=>{if(t.dryRun){u({command:`cf vectorize metadata-index list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes/${t[`index-name`]==null?`<index-name>`:encodeURIComponent(String(t[`index-name`]))}/metadata_index/list`,pathParams:{"index-name":String(t[`index-name`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.vectorize.metadataIndex.list({account_id:r,index_name:t[`index-name`]})),{successLabel:`Loaded`})}},z={command:`metadata-index`,describe:`Metadata indexes for filtered vector search`,builder:e=>e.command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`return-metadata`,{type:`string`,description:`Whether to return no metadata, indexed metadata or all metadata associated with the closest vectors.`,choices:[`none`,`indexed`,`all`],default:`none`}).option(`return-values`,{type:`boolean`,description:`Whether to return the values associated with the closest vectors.`,default:!1}).option(`top-k`,{type:`number`,description:`The number of nearest neighbors to find.`,default:5}).option(`vector`,{type:`string`,array:!0,description:`The search vector that will be used to find the nearest neighbors.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`query <index-name>`,describe:`Finds vectors closest to a given vector in an index.`,builder:B,handler:async t=>{if(t.dryRun){u({command:`cf vectorize query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes/${t[`index-name`]==null?`<index-name>`:encodeURIComponent(String(t[`index-name`]))}/query`,pathParams:{"index-name":String(t[`index-name`]??``)},bodyKind:`json`,body:t.body===void 0?c({returnMetadata:f(t[`return-metadata`],`return-metadata`,`text`),returnValues:t[`return-values`],topK:t[`top-k`],vector:t.vector}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Loading`,async()=>n.vectorize.query({...e,account_id:r,index_name:t[`index-name`]})),{successLabel:`Loaded`});return}if(t.vector===void 0)throw Error(`--vector is required (or pass --body with this field set).`);let a=c({returnMetadata:f(t[`return-metadata`],`return-metadata`,`text`),returnValues:t[`return-values`],topK:t[`top-k`],vector:t.vector});l(await d(`Loading`,async()=>n.vectorize.query({...a,account_id:r,index_name:t[`index-name`]})),{successLabel:`Loaded`})}};function H(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`unparsable-behavior`,{type:`string`,description:`Behavior for ndjson parse failures.`,choices:[`error`,`discard`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const U={command:`upsert <index-name>`,describe:`Upserts vectors into the specified index, creating them if they do not exist and returns a mutation id corresponding to the vectors enqueued for upsertion.`,builder:H,handler:async t=>{let n={"unparsable-behavior":t[`unparsable-behavior`]};if(t.dryRun){u({command:`cf vectorize upsert`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/vectorize/v2/indexes/${t[`index-name`]==null?`<index-name>`:encodeURIComponent(String(t[`index-name`]))}/upsert`,pathParams:{"index-name":String(t[`index-name`]??``)},query:n,bodyKind:`octet-stream`,body:t.body});return}let r=await o(t),s=t.local?m:await i(r);if(t.accountId=s,t.file){let e=p(t.file);l(await d(`Creating`,async()=>a(r,`POST`,`/accounts/${s}/vectorize/v2/indexes/${encodeURIComponent(String(t[`index-name`]))}/upsert`,{body:e,headers:{"Content-Type":`application/x-ndjson`}})),{successLabel:`Created`});return}if(t.body){let e=f(t.body,`body`,`binary`),i=new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();l(await d(`Creating`,async()=>a(r,`POST`,`/accounts/${s}/vectorize/v2/indexes/${encodeURIComponent(String(t[`index-name`]))}/upsert${i?`?`+i:``}`,{body:e,headers:{"Content-Type":`application/x-ndjson`}})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},W={command:`vectorize`,describe:`Globally distributed vector database for building semantic search, recommendations, and RAG applications on Workers`,builder:e=>e.command(g).command(b).command(v).command(w).command(S).command(E).command(O).command(M).command(A).command(V).command(U).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{W as default};
|