@mintlify/cli 4.1.80 → 4.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{build-DF0EjyfW.js → build-B-oc3MuD.js} +1 -1
- package/dist/{build-Nkr-5oHQ.js → build-dp785b-C.js} +10 -10
- package/dist/{cli-DL0XjNkX.js → cli-Bjdy2s-s.js} +48 -48
- package/dist/{config-BRjblI1P.js → config-DLwNRkEH.js} +8 -8
- package/dist/{config-BFe5lXi4.js → config-o7H193Xj.js} +1 -1
- package/dist/{converter-D-xOhkG2.js → converter-D-AXgjro.js} +1 -1
- package/dist/{currencyMath-JTNtcXni.js → currencyMath-DWVndHDc.js} +1 -1
- package/dist/{dist-mgq-wN7W.js → dist-B9Tpyt5G.js} +1 -1
- package/dist/dist-BVY4bzYW.js +7 -0
- package/dist/{dist-CFVRFIi3.js → dist-Cgbskz5I.js} +117 -117
- package/dist/{dist-CqfF8gCi.js → dist-Ds9rgRXa.js} +273 -273
- package/dist/{esm-BtDK7B-d.js → esm-Bzf2rZuk.js} +3 -3
- package/dist/{lib-5Y5r5XbK.js → lib-B_P28NMU.js} +1 -1
- package/dist/live-BR7YGuvT.js +19 -0
- package/dist/{live-CfaF_fTw.js → live-C37won3z.js} +1 -1
- package/dist/{multi-repo-cache-BXVYZO0d.js → multi-repo-cache-DQ4-qH_V.js} +1 -1
- package/dist/multi-repo-command-DmTEZuwj.js +101 -0
- package/dist/{multi-repo-command-COrx6q0u.js → multi-repo-command-jpsmcxmw.js} +1 -1
- package/dist/{multi-repo-config-BgQ6B20D.js → multi-repo-config-fDV9HAT5.js} +1 -1
- package/dist/multi-repo-preview-C-LdbybQ.js +12 -0
- package/dist/{multi-repo-setup-CPWU9RaS.js → multi-repo-setup-CRaAzjLQ.js} +3 -3
- package/dist/{remark-utils-snuBUKxh.js → remark-utils-FAwkaMKD.js} +1 -1
- package/dist/start.js +1 -1
- package/dist/{utils-D9fHH3a7.js → utils-B1yewEzF.js} +2 -2
- package/package.json +9 -9
- package/dist/dist-CdeiUm_D.js +0 -7
- package/dist/live-4hULgCEx.js +0 -19
- package/dist/multi-repo-command-Co1AaKVp.js +0 -101
- package/dist/multi-repo-preview-BFjWTBl7.js +0 -12
package/dist/live-4hULgCEx.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { createRequire as __mintCreateRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __mintFileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __mintDirname } from 'node:path';
|
|
4
|
-
const require = __mintCreateRequire(import.meta.url);
|
|
5
|
-
const __filename = __mintFileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __mintDirname(__filename);
|
|
7
|
-
import{o as e}from"./rolldown-runtime-CEAe2Uac.js";import{$ as t,D as n,J as r,K as i,Q as a,X as o,Y as s,Z as c,g as l,k as u,n as d,tt as f,v as p,w as m}from"./dist-CFVRFIi3.js";import{$t as h,C as g,Cn as _,E as v,Ft as y,Gt as b,It as x,Jt as ee,Lt as te,Pt as S,Q as C,Qn as w,Rt as T,St as E,U as D,Vt as ne,X as re,Xn as ie,Yt as ae,Z as oe,Zn as se,a as ce,bn as le,bt as ue,et as de,gt as fe,hn as pe,ht as me,it as he,k as ge,mn as _e,o as ve,or as ye,ot as be,pn as xe,qn as Se,qt as Ce,st as we,vt as Te,w as Ee,wn as De,yn as Oe,zn as ke}from"./dist-CqfF8gCi.js";import{B as Ae,M as je,P as Me,Q as Ne,X as Pe,Z as Fe,_ as O,_t as Ie,b as Le,c as Re,d as ze,r as Be,s as Ve,st as He,t as Ue,tt as k,u as We,w as Ge,x as Ke,y as qe}from"./utils-D9fHH3a7.js";import{a as Je,c as Ye,i as Xe,n as Ze,o as Qe,r as $e,s as et,t as A}from"./remark-utils-snuBUKxh.js";import{t as tt}from"./watcher-CrrSXFeO.js";import nt,{basename as rt,dirname as it,join as j,normalize as at,parse as M,resolve as ot}from"path";import st,{readFileSync as ct,watch as lt}from"node:fs";import{existsSync as ut}from"fs";import dt from"node:os";import ft from"node:fs/promises";import N from"node:path";import{createHash as pt}from"node:crypto";import{sep as mt}from"path/win32";function ht(e,t){let n=t>0?`_${t}`:``;return b(`param-${e}${n}`,{decamelize:!0,separator:`-`})}function gt(e){return(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name===`Variation`}function _t(e){let t=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`is`);if(!t)return{kind:`missing`};if(typeof t.value==`string`){let e=t.value.trim();return e?{kind:`valid`,ids:[e]}:{kind:`invalid`}}if(!t.value)return{kind:`invalid`};let n=t.value.data?.estree,r=n?.body[0],i=r?.type===`ExpressionStatement`?r.expression:void 0;if(i?.type===`Literal`&&typeof i.value==`string`){let e=i.value.trim();return e?{kind:`valid`,ids:[e]}:{kind:`invalid`}}if(i?.type===`TemplateLiteral`&&i.expressions.length===0){let e=(i.quasis[0]?.value.cooked)?.trim();return e?{kind:`valid`,ids:[e]}:{kind:`invalid`}}if(i?.type===`ArrayExpression`){let e=[];for(let t of i.elements){if(t?.type!==`Literal`||typeof t.value!=`string`)return{kind:`invalid`};let n=t.value.trim();if(!n)return{kind:`invalid`};e.push(n)}return e.length>0?{kind:`valid`,ids:[...new Set(e)]}:{kind:`invalid`}}if(n)return{kind:`invalid`};let a=t.value.value.trim().match(/^(["'`])([\s\S]*)\1$/);return(a?.[2])?.trim()?{kind:`valid`,ids:[a[2].trim()]}:{kind:`invalid`}}const vt=[`h1`,`h2`,`h3`,`h4`],yt=[`Accordion`,`AccordionGroup`,`Expandable`,`Update`,`Prompt`];function P(e,t){let n=e.find(e=>`name`in e&&e.name===t);if(n&&`value`in n&&typeof n.value==`string`)return n.value}const bt=e=>e&&[...e].sort(),xt=e=>{if(typeof e==`string`)return e;let t=He(Ye(e.groups));return JSON.stringify([bt(t?.includes),bt(t?.excludes)])},St=(e,t)=>{if(t===void 0)return!0;let n=new Set(e?.map(xt));return t.every(e=>n.has(xt(e)))},Ct=(e,t)=>{let n=c();return i=>{let a=[],o=!1,c=/* @__PURE__ */ new Map,l=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Map,d=/* @__PURE__ */ new Map,f=/* @__PURE__ */ new Map,p=/* @__PURE__ */ new Set,m=r.includes(t?.mode??``);k(i,e=>{if(e.type===`mdxJsxFlowElement`&&e.name===`_MintIsland`)for(let t of e.data?.islandHeadings??[])n.reserve(t.slug);e.type===`mdxJsxFlowElement`&&e.name&&yt.includes(e.name)&&k(e,t=>{t!==e&&p.add(t)});let t=e;if(Je(t)){let n=Qe(t),r=et(n);Xe(n)?k(e,t=>{t!==e&&p.add(t)}):r&&k(e,t=>{t!==e&&d.set(t,[...d.get(t)??[],r])})}if(e.type===`mdxJsxFlowElement`&&e.name===`Steps`){let t=P(e.attributes,`titleSize`);if(t){let n=e=>{for(let r of e)r.type===`mdxJsxFlowElement`&&(r.name===`Step`?f.set(r,t):ze(r)&&n(r.children))};n(e.children)}}if(e.type===`mdxJsxFlowElement`&&e.name===`Tab`){let t=P(e.attributes,`id`),n=P(e.attributes,`title`),r=t??(n?ae($e(e,n)):void 0);r&&k(e,e=>{c.set(e,r)})}if(e.type===`mdxJsxFlowElement`&&e.name===`View`){let t=P(e.attributes,`title`);t&&k(e,e=>{l.set(e,t)})}let r=e;if(gt(r)){let t=_t(r),n=t.kind===`valid`?t.ids:[];k(e,e=>{let t=u.get(e);u.set(e,t?t.filter(e=>n.includes(e)):n)})}});let h=(e,t)=>{if(!e.title.trim())return;if(t!==void 0&&Number(t)<=2){o=!0,a.push(e);return}let n=a;if(o){let t=a.at(-1);t&&!(t.depth>2&&t.depth>=e.depth)&&(t.tabId===void 0||t.tabId===e.tabId)&&(t.viewId===void 0||t.viewId===e.viewId)&&(t.variationIds===void 0||e.variationIds!==void 0&&e.variationIds.every(e=>t.variationIds?.includes(e)))&&St(e.authRules,t.authRules)&&(n=t.children)}n.push(e)};k(i,e=>{if(p.has(e))return;let t=c.get(e),r=l.get(e),i=u.get(e),a=d.get(e);if(e.type===`mdxFlowExpression`||e.type===`mdxTextExpression`){let o=e.data?.tableOfContents;if(!o?.length)return;let s=e=>{for(let t of e)n.reserve(t.slug),s(t.children)};s(o);for(let e of o)h(Object.assign(Object.assign({},e),{tabId:t,viewId:r,variationIds:i,authRules:a||e.authRules?[...a??[],...e.authRules??[]]:void 0}),e.depth);return}if(e.type===`mdxJsxFlowElement`&&e.name===`_MintIsland`){if(m)return;for(let{title:n,slug:o,depth:s}of e.data?.islandHeadings??[])h({title:n,slug:o,depth:s,children:[],tabId:t,viewId:r,variationIds:i,authRules:a},s);return}let o=e.type===`heading`&&s.includes(e.depth),g=e.type===`mdxJsxFlowElement`&&vt.includes(e.name??``),_=e.type===`mdxJsxFlowElement`&&e.name===`Heading`,v=e.type===`mdxJsxFlowElement`&&e.name===`Update`&&e.attributes.some(e=>`name`in e&&e.name===`label`),y=e.type===`mdxJsxFlowElement`&&e.name===`Step`?P(e.attributes,`titleSize`)??f.get(e):void 0,b=e.type===`mdxJsxFlowElement`&&e.attributes.some(e=>`name`in e&&e.name===`noAnchor`&&(e.value==null||e.value===`true`||typeof e.value==`object`&&e.value.value===`true`)),x=e.type===`mdxJsxFlowElement`&&e.name===`Step`?$e(e,P(e.attributes,`title`)??``):void 0,te=e.type===`mdxJsxFlowElement`&&e.name===`Step`&&!b&&[`h2`,`h3`].includes(y??``)&&x?.trim()!==``,S=e.type===`mdxJsxFlowElement`&&e.attributes.some(e=>`name`in e&&e.name===`id`);if(!o&&!g&&!_&&!v&&!te||m&&(o||g))return;let C;if(`name`in e&&e.name===`Update`)C=1,e.depth=1;else if(`name`in e&&e.name===`Step`)C={h2:2,h3:3,h4:4}[y??``]??3,e.depth=C;else if(`depth`in e)C=e.depth;else if(`name`in e&&e.name===`Heading`){let t=e.attributes.find(e=>`name`in e&&e.name===`level`);t&&`value`in t&&typeof t.value==`number`&&(C=t.value)}else if(`name`in e&&e.name?.[1]){let t=Number(e.name[1]);C=isNaN(t)?void 0:t,C!==void 0&&(e.depth=C)}let w=x??Ze(e),T,E=`name`in e&&(e.name===`Heading`||e.name===`Step`||e.name===`Update`)||S?P(e.attributes,`id`):void 0;T=E?n.claim(ee(E)||ae(w)):n.claim(ae(w));let D;if(`name`in e&&e.name===`Update`){let t=P(e.attributes,`id`);D=t?t===T?e.attributes:e.attributes.map(e=>`name`in e&&e.name===`id`?A(`id`,T):e):[...e.attributes,A(`id`,T)]}else if(`name`in e&&e.name===`Step`){let t=P(e.attributes,`id`);D=t?t===T?e.attributes:e.attributes.map(e=>`name`in e&&e.name===`id`?A(`id`,T):e):[...e.attributes,A(`id`,T)]}else if(`name`in e&&e.name===`Heading`)D=E&&T!==E?e.attributes.map(e=>`name`in e&&e.name===`id`?A(`id`,T):e):e.attributes;else if(C!==void 0&&S){let t=E&&T!==E?e.attributes.map(e=>`name`in e&&e.name===`id`?A(`id`,T):e):e.attributes;D=[A(`level`,C),...t]}else C!==void 0&&!S&&(D=[A(`level`,C),A(`id`,T)],g&&e.attributes.length>0&&D.push(...e.attributes));e.attributes=D,e.type=`mdxJsxFlowElement`,e.name=e.name===`Update`?`Update`:e.name===`Step`?`Step`:`Heading`;let ne=e.depth;h({title:w,slug:T,depth:ne,children:[],tabId:t,viewId:r,variationIds:i,authRules:a},C)}),e&&(e.tableOfContents=a)}},wt=/* @__PURE__ */ new Set([`codeFenced`,`codeText`,`yaml`,`toml`]),Tt=[je([`yaml`,`toml`]),Ae(),{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}],Et=e=>{let t=+!!e.startsWith(``),n=Fe(Ne({extensions:Tt}).document().write(Pe()(e.slice(t),void 0,!0))),r=[];for(let[e,i]of n)e===`enter`&&wt.has(i.type)&&r.push([i.start.offset+t,i.end.offset+t]);return r},Dt=/* @__PURE__ */ new Set(/* @__PURE__ */ `Info.Warning.Note.Tip.Check.Danger.Callout.AccordionGroup.Card.CardGroup.Tabs.CodeGroup.Column.Columns.CustomCode.CustomComponent.DynamicCustomComponent.Expandable.Frame.GitHub.Github.Icon.Latex.Mermaid.Panel.Popup.Prompt.List.Quote.RequestExample.ResponseExample.SnippetGroup.Steps.Tile.Tooltip.Tree.FileTree.Variation.Visibility.MDX.Badge.Color.ZoomImage`.split(`.`)),Ot=/* @__PURE__ */ new Set([`Heading`,`Step`,`Update`]),kt=[`Example`,`Snippet`],At=e=>Ue.includes(e)||kt.includes(e),jt=[];function F(e){let t=-1;if(!e||!Array.isArray(e)&&!e.type)throw Error("Expected node, not `"+e+"`");if(`value`in e)return e.value;let n=(Array.isArray(e)?e:e.children)||jt,r=[];for(;++t<n.length;)r[t]=F(n[t]);return r.join(``)}const Mt={}.hasOwnProperty;function Nt(e,t,n){let r=-1;if(!e)throw Error(`Iterate requires that |this| not be `+e);if(!Mt.call(e,`length`))throw Error("Iterate requires that |this| has a `length`");if(typeof t!=`function`)throw TypeError("`callback` must be a function");for(;++r<e.length;){if(!(r in e))continue;let i=t.call(n,e[r],r,e);typeof i==`number`&&(i<0&&(r=0),r=i-1)}}function I(e){return t;function t(e){if(!e||!e.children)throw Error("Missing children in `parent` for `modifier`");Nt(e.children,n,e)}function n(t,n){return e(t,n,this)}}const Pt=I(function(e,t,n){let r=n.children[t-1];if(r&&`children`in r&&`children`in e&&e.children.length>0){let i=-1;for(;e.children[++i];){let a=e.children[i];if(a.type===`WordNode`)return;if(a.type===`SymbolNode`||a.type===`PunctuationNode`){let i=F(a);return i!==`,`&&i!==`;`?void 0:(r.children.push(...e.children),r.position&&e.position&&(r.position.end=e.position.end),n.children.splice(t,1),t)}}}}),Ft=/^([!"').?\u0F3B\u0F3D\u169C\u2019\u201D\u2026\u203A\u203D\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21\u2E23\u2E25\u2E27\u2E29\u2E56\u2E58\u2E5A\u2E5C\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63\u00BB\]}])\1*$/,It=/^[ \t]*((\r?\n|\r)[\t ]*)+$/,Lt=/^([!.?\u2026\u203D]+)$/,Rt=/^([&'\-.:=?@\u00AD\u00B7\u2010\u2011\u2019\u2027]|_+)$/,zt=/^(?:[\d\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])+$/,Bt=/^\d/,Vt=/^(?:[a-z\u00B5\u00DF-\u00F6\u00F8-\u00FF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5F\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7BB\uA7BD\uA7BF\uA7C1\uA7C3\uA7C8\uA7CA\uA7D1\uA7D3\uA7D5\uA7D7\uA7D9\uA7F6\uA7FA\uAB30-\uAB5A\uAB60-\uAB68\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD837[\uDF00-\uDF09\uDF0B-\uDF1E\uDF25-\uDF2A]|\uD83A[\uDD22-\uDD43])/,Ht=/[\uD800-\uDFFF]/,Ut=/[!"'-),-/:;?[-\]_{}\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u201F\u2022-\u2027\u2032-\u203A\u203C-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Wt=/[\dA-Za-z\u00AA\u00B2\u00B3\u00B5\u00B9\u00BA\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u0870-\u0887\u0889-\u088E\u0898-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09F4-\u09F9\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BF2\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D63\u0D66-\u0D78\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1715\u171F-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u17F0-\u17F9\u180B-\u180D\u180F-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ACE\u1B00-\u1B4C\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA827\uA82C\uA830-\uA835\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE6\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDEFD-\uDF27\uDF30-\uDF54\uDF70-\uDF85\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC52-\uDC75\uDC7F-\uDCBA\uDCC2\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE37\uDE3E-\uDE41\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6\uDF00-\uDF10\uDF12-\uDF3A\uDF3E-\uDF42\uDF50-\uDF59\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC40-\uDC55]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC30-\uDC6D\uDC8F\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAE\uDEC0-\uDEF9]|\uD839[\uDCD0-\uDCF9\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF]|\uDB40[\uDD00-\uDDEF]/,Gt=/[\t-\r \u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Kt=I(function(e,t,n){if(`children`in e&&e.children.length>0&&t>0){let r=n.children[t-1],i=e.children[0],a=e.children[1];if(r&&r.type===`SentenceNode`&&(i.type===`SymbolNode`||i.type===`PunctuationNode`)&&Ft.test(F(i)))return e.children.shift(),r.children.push(i),i.position&&r.position&&(r.position.end=i.position.end),a&&a.position&&e.position&&(e.position.start=a.position.start),t-1}}),qt=I(function(e,t,n){if(e.type!==`SentenceNode`)return;let r=e.children,i=0;for(;++i<r.length-1;){let a=r[i];if(a.type!==`WhiteSpaceNode`||F(a).split(/\r\n|\r|\n/).length<3)continue;e.children=r.slice(0,i);let o={type:`SentenceNode`,children:r.slice(i+1)},s=r[i-1],c=r[i+1];if(n.children.splice(t+1,0,a,o),e.position&&s.position&&c.position){let t=e.position.end;e.position.end=s.position.end,o.position={start:c.position.start,end:t}}return t+1}}),Jt=I(function(e,t,n){if(`children`in e){let r=e.children[e.children.length-1];if(r&&r.type===`WhiteSpaceNode`){e.children.pop(),n.children.splice(t+1,0,r);let i=e.children[e.children.length-1];return i&&i.position&&e.position&&(e.position.end=i.position.end),t}}});function Yt(e){return t;function t(t){let n=t&&t.children,r=-1;if(!n)throw Error("Missing children in `parent` for `visit`");for(;++r in n;)e(n[r],r,t)}}const Xt=Yt(function(e,t,n){if(`children`in e&&e.children){let r=e.children[0];if(r&&r.type===`WhiteSpaceNode`){e.children.shift(),n.children.splice(t,0,r);let i=e.children[0];i&&i.position&&e.position&&(e.position.start=i.position.start)}}}),Zt=I(function(e,t,n){if(t>0&&(e.type===`SymbolNode`||e.type===`PunctuationNode`)&&F(e)===`-`){let r=n.children,i=r[t-1],a=r[t+1];if((!a||a.type!==`WordNode`)&&i&&i.type===`WordNode`)return r.splice(t,1),i.children.push(e),i.position&&e.position&&(i.position.end=e.position.end),t}}),Qt=I(function(e,t,n){let r=n.children[t-1];if(r&&r.type===`SentenceNode`&&e.type===`SentenceNode`){let i=e.children[0];if(i&&i.type===`WordNode`&&Bt.test(F(i)))return r.children.push(...e.children),n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t}}),$t=I(function(e,t,n){if(e.type===`SentenceNode`&&t>0){let r=n.children[t-1],i=e.children;if(i.length>0&&r.type===`SentenceNode`){let a=-1;for(;i[++a];){let o=i[a];if(o.type===`WordNode`)return Vt.test(F(o))?(r.children.push(...i),n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t):void 0;if(o.type===`SymbolNode`||o.type===`PunctuationNode`)return}}}}),en=I(function(e,t,n){if(e.type!==`SymbolNode`&&e.type!==`PunctuationNode`||F(e)!==`&`)return;let r=n.children,i=r[t+1];if(!(t>0&&r[t-1].type===`WordNode`||!(i&&i.type===`WordNode`)))return r.splice(t,1),i.children.unshift(e),i.position&&e.position&&(i.position.start=e.position.start),t-1}),tn=I(function(e,t,n){if(t>0&&e.type===`PunctuationNode`&&F(e)===`.`){let r=n.children[t-1];if(r.type===`WordNode`&&r.children&&r.children.length!==1&&r.children.length%2!=0){let i=r.children.length,a=!0;for(;r.children[--i];){let e=r.children[i],t=F(e);if(i%2==0){if(t.length>1)return;zt.test(t)||(a=!1)}else if(t!==`.`){if(i<r.children.length-2)break;return}}if(!a)return n.children.splice(t,1),r.children.push(e),r.position&&e.position&&(r.position.end=e.position.end),t}}}),nn=I(function(e,t,n){if(t>0&&(e.type===`SymbolNode`||e.type===`PunctuationNode`)){let e=n.children,r=e[t-1];if(r&&r.type===`WordNode`){let n=t-1,i=[],a=[];for(;e[++n];){let t=e[n];if(t.type===`WordNode`)i.push(...a,...t.children),a=[];else if((t.type===`SymbolNode`||t.type===`PunctuationNode`)&&Rt.test(F(t)))a.push(t);else break}if(i.length>0){a.length>0&&(n-=a.length),e.splice(t,n-t),r.children.push(...i);let o=i[i.length-1];return r.position&&o.position&&(r.position.end=o.position.end),t}}}}),rn=I(function(e,t,n){let r=n.children,i=r[t-1];if(i&&i.type===`WordNode`&&(e.type===`SymbolNode`||e.type===`PunctuationNode`)&&F(e)===`/`){let n=F(i),a=e,o=[e],s=1,c=``,l=r[t+1];if(l&&l.type===`WordNode`&&(c=F(l),a=l,o.push(...l.children),s++),n.length<3&&(!c||c.length<3))return i.children.push(...o),r.splice(t,s),i.position&&a.position&&(i.position.end=a.position.end),t}}),an=I(function(e,t,n){if(`children`in e){let r=-1;for(;e.children[++r];)if(e.children[r].type===`WordNode`)return;let i=n.children[t-1];if(i&&`children`in i)return i.children.push(...e.children),n.children.splice(t,1),i.position&&e.position&&(i.position.end=e.position.end),t;let a=n.children[t+1];a&&`children`in a&&(a.children.unshift(...e.children),a.position&&e.position&&(a.position.start=e.position.start),n.children.splice(t,1))}}),on=/* @__PURE__ */ RegExp(`^([0-9]{1,3}|[a-z]|al|ca|cap|cca|cent|cf|cit|con|cp|cwt|ead|etc|ff|fl|ibid|id|nem|op|pro|seq|sic|stat|tem|viz)$`),sn=I(function(e,t,n){if(`children`in e&&e.children.length>1){let r=e.children[e.children.length-1];if(r&&(r.type===`PunctuationNode`||r.type===`SymbolNode`)&&F(r)===`.`){let i=e.children[e.children.length-2];if(i&&i.type===`WordNode`&&on.test(F(i).toLowerCase())){i.children.push(r),e.children.pop(),r.position&&i.position&&(i.position.end=r.position.end);let a=n.children[t+1];if(a&&a.type===`SentenceNode`)return e.children.push(...a.children),n.children.splice(t+1,1),a.position&&e.position&&(e.position.end=a.position.end),t-1}}}}),cn=Yt(function(e,t,n){if(`children`in e){let t=e.children.length,n=!1;for(;e.children[--t];){let r=e.children[t];if(r.type!==`SymbolNode`&&r.type!==`PunctuationNode`){r.type===`WordNode`&&(n=!0);continue}if(!Lt.test(F(r)))continue;if(!n){n=!0;continue}if(F(r)!==`.`)continue;let i=e.children[t-1],a=e.children[t+1];if(i&&i.type===`WordNode`){let n=e.children[t+2];if(a&&n&&a.type===`WhiteSpaceNode`&&F(n)===`.`)continue;e.children.splice(t,1),i.children.push(r),r.position&&i.position&&(i.position.end=r.position.end),t--}else a&&a.type===`WordNode`&&(e.children.splice(t,1),a.children.unshift(r),r.position&&a.position&&(a.position.start=r.position.start))}}}),ln=I(function(e,t,n){if(`children`in e&&e.children.length===0)return n.children.splice(t,1),t}),un=Yt(function(e,t,n){let r=n.children;e.position&&t<1&&(!n.position||!n.position.start)&&(dn(n),n.position.start=e.position.start),!e.position||t!==r.length-1||n.position&&n.position.end||(dn(n),n.position.end=e.position.end)});function dn(e){e.position||={}}var fn=class{constructor(e,t){let n=t||e;this.doc=n?String(n):void 0,this.tokenizeRootPlugins=[...this.tokenizeRootPlugins],this.tokenizeParagraphPlugins=[...this.tokenizeParagraphPlugins],this.tokenizeSentencePlugins=[...this.tokenizeSentencePlugins]}parse(e){return this.tokenizeRoot(e||this.doc)}tokenizeRoot(e){let t={type:`RootNode`,children:pn(this.tokenizeParagraph(e),`WhiteSpaceNode`,It)},n=-1;for(;this.tokenizeRootPlugins[++n];)this.tokenizeRootPlugins[n](t);return t}tokenizeParagraph(e){let t={type:`ParagraphNode`,children:pn(this.tokenizeSentence(e),`PunctuationNode`,Lt)},n=-1;for(;this.tokenizeParagraphPlugins[++n];)this.tokenizeParagraphPlugins[n](t);return t}tokenizeSentence(e){let t={type:`SentenceNode`,children:this.tokenize(e)},n=-1;for(;this.tokenizeSentencePlugins[++n];)this.tokenizeSentencePlugins[n](t);return t}tokenize(e){let t=[];if(!e)return t;let n={line:1,column:1,offset:0},r=0,i=0,a={...n},o,s;for(;i<e.length;){let l=e.charAt(i),u=Gt.test(l)?`WhiteSpaceNode`:Ut.test(l)?`PunctuationNode`:Wt.test(l)?`WordNode`:`SymbolNode`;r<i&&o&&u&&(o!==u||o!==`WordNode`&&o!==`WhiteSpaceNode`&&l!==s&&!Ht.test(l))&&(t.push(c(o,e.slice(r,i))),r=i,a={...n}),l===`\r`||l===`
|
|
8
|
-
`&&s!==`\r`?(n.line++,n.column=1):l!==`
|
|
9
|
-
`&&n.column++,n.offset++,o=u,s=l,i++}return o&&r<i&&t.push(c(o,e.slice(r,i))),t;function c(e,t){return e===`WordNode`?{type:`WordNode`,children:[{type:`TextNode`,value:t,position:{start:a,end:{...n}}}],position:{start:a,end:{...n}}}:{type:e,value:t,position:{start:a,end:{...n}}}}}};fn.prototype.tokenizeSentencePlugins=[en,Zt,nn,rn,tn,un],fn.prototype.tokenizeParagraphPlugins=[an,Kt,$t,Qt,sn,Pt,cn,Xt,Jt,qt,ln,un],fn.prototype.tokenizeRootPlugins=[Xt,Jt,ln,un];function pn(e,t,n){let r=[],i=-1,a=0;for(;++i<e.children.length;){let o=e.children[i];if(i===e.children.length-1||o.type===t&&n.test(F(o))){let t={type:e.type,children:e.children.slice(a,i+1)},n=e.children[a],s=o;n.position&&s.position&&(t.position={start:n.position.start,end:s.position.end}),r.push(t),a=i+1}}return r}function mn(){let e=this;e.parser=t;function t(t){let n=new fn;return hn(n.tokenizeParagraphPlugins,e.data(`nlcstParagraphExtensions`)),hn(n.tokenizeRootPlugins,e.data(`nlcstRootExtensions`)),hn(n.tokenizeSentencePlugins,e.data(`nlcstSentenceExtensions`)),n.parse(t)}}function hn(e,t){t&&e.unshift(...t)}function gn(){let e=this;e.compiler=_n}function _n(e){return F(e)}var vn=f(),yn=/* @__PURE__ */ e(we(),1);const bn=Me().use(mn).use(gn).freeze(),xn=[`”`,`’`],Sn=[`“`,`‘`],Cn={};function wn(e){let t=e||Cn,n=[];if(t.quotes!==!1&&n.push(Nn),t.ellipses===`spaced`?n.push(jn):t.ellipses===`unspaced`?n.push(Mn):t.ellipses!==!1&&n.push(An),t.backticks===`all`){if(t.quotes!==!1)throw Error("Cannot accept `backticks: 'all'` with `quotes: true`");n.push(Tn)}else t.backticks!==!1&&n.push(En);t.dashes===`inverted`?n.push(On):t.dashes===`oldschool`?n.push(kn):t.dashes!==!1&&n.push(Dn);let r={close:t.closingQuotes?[t.closingQuotes.double,t.closingQuotes.single]:xn,open:t.openingQuotes?[t.openingQuotes.double,t.openingQuotes.single]:Sn};return function(e){k(e,function(e,t,i){let a=-1;if(i&&t!==void 0&&(e.type===`PunctuationNode`||e.type===`SymbolNode`)){for(;++a<n.length;)if(n[a](r,e,t,i)===!0)return console.log(`drop`,e),i.children.splice(t,1),t}})}}function Tn(e,t,n,r){En(e,t,n,r),t.value==="`"?t.value=`‘`:t.value===`'`&&(t.value=`’`)}function En(e,t){t.value==="``"?t.value=`“`:t.value===`''`&&(t.value=`”`)}function Dn(e,t){t.value===`--`&&(t.value=`—`)}function On(e,t,n,r){let i=r.children[n+1];if(t.value===`—`&&i&&i.type===`PunctuationNode`&&i.value===`-`)return i.value=`–`,!0;t.value===`---`?t.value=`–`:t.value===`--`&&(t.value=`—`)}function kn(e,t,n,r){let i=r.children[n+1];if(t.value===`–`&&i&&i.type===`PunctuationNode`&&i.value===`-`)return i.value=`—`,!0;t.value===`---`?t.value=`—`:t.value===`--`&&(t.value=`–`)}function An(e,t,n,r){jn(e,t,n,r),Mn(e,t,n,r)}function jn(e,t,n,r){let i=t.value,a=r.children;if(!/^\.+$/.test(i))return;let o=[],s=n,c=1;for(;--s>0;){let e=a[s];if(e.type!==`WhiteSpaceNode`)break;let t=e;if(e=a[--s],e&&(e.type===`PunctuationNode`||e.type===`SymbolNode`)&&/^\.+$/.test(e.value))o.push(t,e),c++;else break}c<3||(a.splice(n-o.length,o.length),t.value=`…`)}function Mn(e,t){/^\.{3,}$/.test(t.value)&&(t.value=`…`)}function Nn(e,t,n,r){let i=r.children,a=t.value;if(a!==`"`&&a!==`'`)return;let o=a===`"`?0:1,s=i[n-1],c=i[n+1],l=i[n+2],u=c?F(c):``;c&&(c.type===`PunctuationNode`||c.type===`SymbolNode`)&&(!l||l.type!==`WordNode`)?t.value=e.close[o]:c&&(c.type===`PunctuationNode`||c.type===`SymbolNode`)&&(u===`"`||u===`'`)&&l&&l.type===`WordNode`?(t.value=e.open[o],c.value=e.open[u===`"`?0:1]):t.value=c&&/^\d\ds$/.test(u)?e.close[o]:s&&(s.type===`WhiteSpaceNode`||s.type===`PunctuationNode`||s.type===`SymbolNode`)&&c&&c.type===`WordNode`?e.open[o]:s&&s.type!==`WhiteSpaceNode`&&s.type!==`SymbolNode`&&s.type!==`PunctuationNode`||!c||c.type===`WhiteSpaceNode`||a===`'`&&u===`s`?e.close[o]:e.open[o]}const Pn=/* @__PURE__ */ new Set([`text`,`inlineCode`,`paragraph`]),Fn=/* @__PURE__ */ new Set([`style`,`script`]),In=(e,t,n)=>n&&(n.type!==`mdxJsxTextElement`||`name`in n&&typeof n.name==`string`&&!Fn.has(n.name))&&Pn.has(e.type)&&(Rn(e)||zn(e)),Ln=e=>{let t=bn().use(wn,{...e,ellipses:!1,dashes:!1,backticks:!1}),n=bn().use(wn,{...e,quotes:!1});return e=>{let r=``,i=0,a=[];k(e,In,e=>{Rn(e)?r+=e.type===`text`?e.value:`A`.repeat(e.value.length):zn(e)&&(r+=` `),a.push(e)}),/["']/.test(r)&&(r=t.processSync(r).toString());for(let e of a)if(Rn(e)){let t=i+e.value.length;if(e.type===`text`){let a=r.slice(i,t);e.value=/\.[\s\u0085]*\.|--|``|''/.test(a)?n.processSync(a).toString():a}i=t}else zn(e)&&(i+=1)}};function Rn(e){return`value`in e&&typeof e.value==`string`}function zn(e){return e.type===`paragraph`}const Bn=(function(e){if(e==null)return Gn;if(typeof e==`string`)return Un(e);if(typeof e==`object`)return Array.isArray(e)?Vn(e):Hn(e);if(typeof e==`function`)return Wn(e);throw Error(`Expected function, string, or object as test`)});function Vn(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Bn(e[n]);return Wn(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}}function Hn(e){return Wn(t);function t(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function Un(e){return Wn(t);function t(t){return t&&t.type===e}}function Wn(e){return t;function t(t,...n){return!!(t&&typeof t==`object`&&`type`in t&&e.call(this,t,...n))}}function Gn(){return!0}function Kn(e){return`\x1B[33m`+e+`\x1B[39m`}const qn=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null);let i=Bn(t),a=r?-1:1;o(e,void 0,[])();function o(e,s,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Kn(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=[],u,d,f;if((!t||i(e,s,c[c.length-1]||null))&&(l=Jn(n(e,c)),l[0]===!1))return l;if(e.children&&l[0]!==`skip`)for(d=(r?e.children.length:-1)+a,f=c.concat(e);d>-1&&d<e.children.length;){if(u=o(e.children[d],d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+a}return l}}});function Jn(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:[e]}const Yn=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null),qn(e,t,i,r);function i(e,t){let r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}}),Xn=[`.mdx`,`.md`],Zn=[`.jpeg`,`.jpg`,`.jfif`,`.pjpeg`,`.pjp`,`.png`,`.svg`,`.svgz`,`.ico`,`.webp`,`.gif`,`.apng`,`.avif`,`.bmp`,`.mp4`,`.css`,`.xml`],Qn=e=>!(e.dir===`node_modules`||e.dir.startsWith(`node_modules/`)),$n=e=>!(e.dir===`.github`||e.dir.startsWith(`.github/`)),er=e=>Xn.includes(e.ext),tr=e=>Zn.includes(e.ext),nr=e=>er(e)||tr(e),rr=e=>e.map(L).map(M).filter(Qn),ir=e=>rr(e).filter(er).filter($n),ar=e=>rr(e).filter(nr).filter($n),or=e=>j(e.dir,e.base),sr=e=>j(e.dir,e.name),cr=e=>e.split(`#`)[0].split(`?`)[0],lr=(e,t=[])=>ir(me(e,e,t)).map(or),ur=(e,t=[])=>ar(me(e,e,t)).map(or),L=e=>at(dr(e)),dr=e=>e.startsWith(`/`)?e.slice(1):e;var R;(function(e){e.INTERNAL=`internal`,e.EXTERNAL=`external`,e.DATA=`data`})(R||={});const fr=e=>{try{return decodeURIComponent(e)}catch{return e}},pr=e=>/[:*]/.test(e);var z;(function(e){e.MD=`md`,e.SRC=`src`,e.HREF=`href`,e.CARD=`card`,e.IMPORT=`import`,e.DEFINITION=`definition`})(z||={});var mr;(function(e){e.CONTENT=`content`,e.NAVIGATION=`navigation`})(mr||={});var hr=class e{static getPathType(e){let t;return t=URL.canParse(e)?R.EXTERNAL:e.startsWith(`data:`)?R.DATA:R.INTERNAL,t}constructParsedPath(){let t=e.getPathType(this.originalPath),n,r;if(t===R.INTERNAL){let e=new URL(`mintlify:/`);e.pathname=`/${this.relativeDir}/${this.filename}`.replaceAll(mt,`/`),n=new URL(this.originalPath.replaceAll(mt,`/`),e);let t=fr(n.pathname).slice(1);t.endsWith(`/`)&&(t=t.slice(0,-1)),t===``&&(t=`.`),r=M(t)}else try{n=new URL(this.originalPath),r=n}catch{throw Error(`Failed to parse path as URL: ${this.originalPath}. If this is a purposefully malformed path, please wrap it in backticks, i.e \`${this.originalPath}\` `)}let i=n.hash?t===R.INTERNAL?fr(n.hash):n.hash:void 0,a=n.searchParams;return{path:r,pathType:t,anchorLink:i,queryParams:a}}constructor(e,t=``,n=``,r,i){this.originalPath=e,this.relativeDir=t,this.filename=n,this.wrapper=r,this.line=i,this.pagePaths=[],this.relativeDir=L(t);let{path:a,pathType:o,anchorLink:s,queryParams:c}=this.constructParsedPath();this.path=a,this.pathType=o,this.anchorLink=s,this.queryParams=c}toString(){if(this.pathType===R.INTERNAL){let e=this.path;return j(e.dir,e.base)}return this.path.toString()}getResolvedFiles(e,t){if(this.pathType!==R.INTERNAL||this.path instanceof URL)return[];let{dir:n,name:r,base:i}=M(this.toString()),a=[];return ut(ot(t,this.toString()))&&a.push(j(n,i)),a.push(...e.lookup(n,r,i)),a}keepsMdxExtension(){let e=this.wrapper===z.DEFINITION?this.originalPath:this.wrapper===z.MD||this.wrapper===z.HREF?a(j(this.relativeDir,this.filename),this.originalPath,!0):void 0;return e!==void 0&&/\.mdx$/i.test(cr(e))}resolvesTo(e,t,n){return this.pathType===R.INTERNAL&&!!(this.toString()===e.toString()||this.getResolvedFiles(t,n).includes(e.toString()))}static filterMapInternalPaths(t){return t.map(t=>new e(t)).filter(({pathType:e})=>e===R.INTERNAL).map(e=>e.toString())}},gr=class e{constructor(t){this.byDirAndName=/* @__PURE__ */ new Map,t.forEach((t,n)=>{let r=t.startsWith(`/`)?t.slice(1):t,{dir:i,name:a}=M(r),o=e.key(i,a),s=[n,r],c=this.byDirAndName.get(o);c?c.push(s):this.byDirAndName.set(o,[s])})}static key(e,t){return`${e}\0${t}`}lookup(t,n,r){let i=this.byDirAndName.get(e.key(t,n))??[],a=r===n?[]:this.byDirAndName.get(e.key(t,r))??[];return[...i,...a].sort(([e],[t])=>e-t).map(([,e])=>e)}},_r=class{constructor(e,t=[]){this.label=e,this.paths=t,this.edges=[],this.headingSlugs=null,this.relativeDir=L(it(e)),this.filename=rt(e),this.label=j(this.relativeDir,this.filename)}toString(){return this.label}equals(e){return this.label===e.label}addPath(e,t,n){let r=new hr(e,this.relativeDir,this.filename,t,n);this.paths.push(r)}addOutgoingEdge(e){let t=this.edges.find(t=>t.equals(e));t?t.incrementCount():this.edges.push(e)}getChildNodes(e=1){let t=[];for(let n of this.edges){let r=n.target;t.push(r),e>1&&t.push(...r.getChildNodes(e-1))}return t}},vr=class{constructor(e,t,n){this.source=e,this.target=t,this.edgeType=n,this.count=0,this.count++}incrementCount(){this.count++}getCount(){return this.count}equals(e){return this.source.equals(e.source)&&this.target.equals(e.target)&&this.edgeType===e.edgeType}},yr=class{constructor(e,t=[]){this.baseDir=e,this.nodes=Object.create(null),this.edges=[],this.fileResolutionMap=/* @__PURE__ */ new Map,this.redirectMap=/* @__PURE__ */ new Map,this.wildcardRedirects=[],this.configRedirects=[],this.mintIgnoreGlobs=[],this.virtualNodes=/* @__PURE__ */ new Set,this.snippetReferencesByFile=/* @__PURE__ */ new Map,this.baseDir=ot(e),this.mintIgnoreGlobs=t,this.mintIgnoreMatcher=Te(t)}addNode(e){return this.nodes[e]||(this.nodes[e]=new _r(e)),this.nodes[e]}addNodes(e){for(let t of e)this.addNode(t)}addVirtualNodes(e){for(let t of e)this.addNode(t),this.virtualNodes.add(new _r(t).toString())}setRedirects(e){this.configRedirects=e,this.redirectMap.clear();for(let t of e){let e=L(t.source);this.redirectMap.has(e)||this.redirectMap.set(e,L(t.destination))}this.wildcardRedirects=[...this.redirectMap].filter(([e])=>pr(e))}matchesWildcardPattern(e,t){let n=`^${t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/:(\w+)/g,`(?<$1>[^/]+)`).replace(/\\\*/g,`(.*)`)}$`;return new RegExp(n).test(e)}applyWildcardRedirect(e,t,n){let r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=[],a=r.replace(/:(\w+)/g,(e,t)=>(i.push({type:`param`,name:t}),`(?<${t}>[^/]+)`)).replace(/\\\*/g,()=>(i.push({type:`wildcard`}),`(.*)`)),o=RegExp(`^${a}$`),s=e.match(o);if(!s)return n;let c=n,l=s.groups||{};for(let[e,t]of Object.entries(l))c=c.replace(RegExp(`:${e}`,`g`),t);let u=s.slice(1),d=0,f=u.filter((e,t)=>i[t]&&i[t].type===`wildcard`);return c=c.replace(/\*/g,()=>f[d++]||``),c}addAliasNodes(){let e=hr.filterMapInternalPaths(fe(this.baseDir,this.baseDir,this.mintIgnoreGlobs)).filter(e=>!ue(e,this.mintIgnoreMatcher));this.addNodes(e)}getNode(e){return this.nodes[e]}getAnchorTargetFiles(e){this.fileResolutionMap.size===0&&this.precomputeFileResolutions();let t=new Set(Object.keys(this.nodes)),n=/* @__PURE__ */ new Set;for(let r of Object.values(this.nodes))for(let i of r.paths.flatMap(e=>[e,...e.pagePaths]))if(i.pathType===R.INTERNAL&&i.anchorLink&&e.has(j(i.relativeDir,i.filename)))for(let e of this.getHeadingSlugCandidates(i.toString(),t)){let t=this.nodes[e];if(t&&(n.add(e),t.headingSlugs!==null))break}return n}addEdge(e,t,n=mr.CONTENT){let r=new vr(e,t,n);return this.edges.find(e=>e.equals(r)?(e.incrementCount(),!0):!1)||(this.edges.push(r),r)}addEdgesBetweenNodes(){let e=new gr(ur(this.baseDir,this.mintIgnoreGlobs));for(let t of Object.values(this.nodes))for(let n of t.paths)if(n.pathType===R.INTERNAL){let r=Object.values(this.nodes).find(t=>n.resolvesTo(t,e,this.baseDir));if(r){let e=this.addEdge(t,r);t.addOutgoingEdge(e)}}}precomputeFileResolutions(){let e=new gr(ur(this.baseDir,this.mintIgnoreGlobs)),t=/* @__PURE__ */ new Set;Object.values(this.nodes).forEach(n=>{n.paths.flatMap(e=>[e,...e.pagePaths]).filter(e=>e.pathType===R.INTERNAL).forEach(n=>{let r=n.toString();if(t.has(r))return;t.add(r);let i=n.getResolvedFiles(e,this.baseDir);this.fileResolutionMap.set(r,new Set(i))})})}getHeadingSlugCandidates(e,t){let n=[...this.fileResolutionMap.get(e)??[]].filter(e=>t.has(e)),r=j(e,`index.mdx`),i=this.nodes[r]?r:j(e,`index.md`);return[...n,e,i]}getHeadingSlugsForPath(e,t){for(let n of this.getHeadingSlugCandidates(e,t)){let e=this.nodes[n];if(e&&e.headingSlugs!==null)return e.headingSlugs}}getBrokenInternalLinks(e){this.fileResolutionMap.size===0&&this.precomputeFileResolutions();let t=/* @__PURE__ */ new Set,n=new Set(Object.values(this.nodes).map(e=>e.toString()));for(let r of Object.values(this.nodes))for(let i of r.paths.flatMap(e=>[e,...e.pagePaths]))if(i.pathType===R.INTERNAL){let r=i.toString(),a=this.fileResolutionMap.get(r),o=r===`.`||a&&[...a].some(e=>n.has(e))||this.virtualNodes.has(r);if(i.keepsMdxExtension()&&!this.redirectsToPage(r)||!o&&!this.reachesPage(r))t.add(i);else if(e?.checkAnchors&&i.anchorLink){let e=ee(i.anchorLink.slice(1)),a=this.getHeadingSlugsForPath(r,n);a&&!a.has(e)&&t.add(i)}}return Object.values(this.nodes).flatMap(e=>e.paths).filter(e=>t.has(e)&&(e.pagePaths.length===0||e.pagePaths.some(e=>t.has(e))))}getLinksTo(e){let t=this.getPageRoute(e.toString()),n=n=>n.pathType===R.INTERNAL&&!n.originalPath.startsWith(`#`)&&this.getPageRoute(n.toString())===t&&(!e.anchorLink||n.anchorLink===e.anchorLink);return Object.values(this.nodes).flatMap(e=>e.paths).filter(e=>n(e)||e.pagePaths.some(n))}getPageRoute(e){let t=[...this.getPageCandidates(e),e].find(e=>this.nodes[e])??e,n=M(t),r=er(n)?sr(n):t;return rt(r)===`index`?it(r):r}getPageCandidates(e){return e===`.`?[`index.mdx`,`index.md`]:[`${e}.mdx`,`${e}.md`,j(e,`index.mdx`),j(e,`index.md`)]}isPageRoute(e){return this.getPageCandidates(e).some(e=>this.nodes[e])||this.virtualNodes.has(e)}resolvesToValidPath(e,t=/* @__PURE__ */ new Set){if(URL.canParse(e))return!0;let n=cr(e);return!n||pr(n)?!0:this.reachesPage(L(n),t)}redirectsToPage(e){let t=this.getRedirectTarget(e);return t!==void 0&&this.resolvesToValidPath(t,/* @__PURE__ */ new Set([e]))}reachesPage(e,t=/* @__PURE__ */ new Set){if(t.has(e))return!1;t.add(e);let n=this.getExactRedirectTarget(e);if(n!==void 0)return this.resolvesToValidPath(n,t);if(e!==`.`&&this.nodes[e]||this.isPageRoute(e))return!0;let r=this.getRedirectTarget(e);return r!==void 0&&this.resolvesToValidPath(r,t)}getExactRedirectTarget(e){return this.redirectMap.get(e)}getRedirectTarget(e){let t=this.getExactRedirectTarget(e);if(t!==void 0)return t;for(let[t,n]of this.wildcardRedirects)if(this.matchesWildcardPattern(e,t))return this.applyWildcardRedirect(e,t,n)}getBrokenRedirects(){let e=[],t=/* @__PURE__ */ new Set;for(let{source:n,destination:r}of this.configRedirects){let i=L(n);t.has(i)||(t.add(i),URL.canParse(r)||pr(cr(r))||this.resolvesToValidPath(r)||e.push({source:n,destination:r}))}return e}getExternalPathsByNode(){let e=/* @__PURE__ */ new Map;for(let[t,n]of Object.entries(this.nodes)){let r=n.paths.filter(e=>e.pathType===R.EXTERNAL);r.length>0&&e.set(t,r)}return e}getAllInternalPaths(){return Object.values(this.nodes).flatMap(e=>e.paths).filter(e=>e.pathType===R.INTERNAL).map(e=>e.originalPath+` => `+e.toString())}},br=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const xr=e=>br(void 0,void 0,void 0,function*(){for(let t of[`docs.json`,`mint.json`]){let n=nt.join(e,t);if(yn.default.existsSync(n))try{let r=yield yn.default.readJSON(n),{resolved:i}=yield be(r,e);if(i&&typeof i==`object`&&!Array.isArray(i))return{configFile:t,json:i}}catch(e){console.warn(`Warning: Failed to read or resolve ${t}: ${e}`)}}return null}),Sr=e=>br(void 0,void 0,void 0,function*(){let t=yield xr(e);return t?t.configFile===`docs.json`?se(ie(t.json)):w(t.json):null}),Cr=e=>br(void 0,void 0,void 0,function*(){let t=yield xr(e);if(!t||t.configFile!==`docs.json`)return null;let n=se(ie(t.json));return n.success?n.data:null});var wr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Tr=e=>wr(void 0,void 0,void 0,function*(){let t=yield Cr(e);if(!t)return[];let{generatedRoutes:n}=yield v(t,t=>ge(t,e),{onSourceError:(e,t)=>console.warn(`Warning: Failed to load GraphQL schema ${e}: ${t}`)});return n});var Er=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Dr=e=>typeof e==`string`&&e!==``&&ke(e)===void 0&&E(e)===void 0,Or=e=>{if(typeof e!=`object`||!e)return[];if(Array.isArray(e))return e.flatMap(Or);let t=e,n=[];if(typeof t.href==`string`&&n.push(t.href),Dr(t.root)&&n.push(t.root.startsWith(`/`)?t.root:`/${t.root}`),Array.isArray(t.pages))for(let e of t.pages)Dr(e)&&n.push(e.startsWith(`/`)?e:`/${e}`);for(let e of Object.values(t))n.push(...Or(e));return n},kr=e=>Er(void 0,void 0,void 0,function*(){let t=yield xr(e);if(t&&t.json.navigation)return{hrefs:Or(t.json.navigation),configFile:t.configFile}});var Ar=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const jr=(e,t)=>Ar(void 0,void 0,void 0,function*(){let n=[];try{let r=yield Cr(e),i=r?Se(r):void 0,a=yield ce(e,{explicitOverlays:i,fetchRemoteDocument:t?.fetchRemoteDocument});if(r){let o=yield ve(e,{explicitOverlays:i,fetchRemoteDocument:t?.fetchRemoteDocument}),s=yield Mr(r,o,t?.fetchRemoteDocument),c=[...a,...s],l={};try{yield g(r.navigation,c,l,{writeFiles:!1,overlayRegistry:o,fetchRemoteDocument:t?.fetchRemoteDocument})}catch(e){console.warn(`Warning: Failed to extract OpenAPI pages from navigation: ${e}`)}n.push(...Object.keys(l))}for(let e of a)try{let{pagesAcc:t}=yield D(e.spec,{openApiFilePath:e.originalFileLocation,writeFiles:!1,outDir:`api-reference`});n.push(...Object.keys(t))}catch(t){console.warn(`Warning: Failed to extract pages from OpenAPI spec ${e.originalFileLocation}: ${t}`)}}catch(e){console.warn(`Warning: Failed to categorize files for OpenAPI extraction: ${e}`)}return[...new Set(n)]}),Mr=(e,t,n)=>Ar(void 0,void 0,void 0,function*(){try{return yield Ee(`docs`,e,void 0,t,n)}catch(e){return console.warn(`Warning: Failed to fetch URL-based OpenAPI specs: ${e}`),[]}});var Nr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Pr=e=>Nr(void 0,void 0,void 0,function*(){let t=[],n=yield Sr(e);return n&&n.success&&`redirects`in n.data&&n.data.redirects&&t.push(...n.data.redirects),t}),Fr=[`ImportDefaultSpecifier`,`ImportNamespaceSpecifier`],Ir=e=>{let t=[],n=[],r=[],i=/* @__PURE__ */ new Set;Yn(e,e=>{if(Re(e)&&Be(e)){for(let n of e.data.estree.body){if(!Ve(n)||typeof n.source.value!=`string`)continue;let e=n.source.value;t.push(e);for(let t of n.specifiers)Fr.includes(t.type)&&r.push({source:e,name:t.local.name})}return}if(!We(e)||!e.name||(i.add(e.name),e.name!==`Snippet`))return;let a=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`file`)?.value;typeof a==`string`&&n.push(`/_snippets/`+dr(a))});for(let{source:e,name:t}of r)i.has(t)&&n.push(e);return{imported:t,rendered:n}},Lr=[`snippets/`,`_snippets/`],B=e=>e.replaceAll(mt,`/`),Rr=({originalPath:e,pathType:t,wrapper:n})=>n!==z.IMPORT&&t===R.INTERNAL&&!e.startsWith(`/`),zr=(e,t)=>{var n;let r=new Map([...t.keys()].map(e=>[B(e),e])),i=(e,t)=>e.flatMap(e=>{let n=pe(e,B(t)),i=n&&r.get(dr(n));return i?[i]:[]}),a=/* @__PURE__ */ new Set;for(let[e,{imported:n}]of t){let t=B(e).toLowerCase();Lr.some(e=>t.startsWith(e))&&a.add(e);for(let t of i(n,e))a.add(t)}let o=(e,n)=>{let r=t.get(e)?.rendered??[];for(let t of i(r,e))!n.has(t)&&a.has(t)&&(n.add(t),o(t,n));return n},s=/* @__PURE__ */ new Map;for(let e of t.keys())a.has(e)||s.set(e,o(e,/* @__PURE__ */ new Set));for(let[t,r]of s){let i=e.getNode(t);if(i)for(let t of r){let r=e.getNode(t);for(let e of r?.paths.filter(Rr)??[])e.pagePaths.push(new hr(e.originalPath,i.relativeDir,i.filename,e.wrapper));for(let e of r?.headingSlugs??[])(n=i.headingSlugs)==null||n.add(e)}}},Br=(e,t,n)=>{let r=/* @__PURE__ */ new Set;if(!n.checkAnchors&&!n.checkSnippets)return r;let i=n.checkAnchors?[...e.getAnchorTargetFiles(t)]:[];for(let e of i)r.add(B(e));let a=new Map([...e.snippetReferencesByFile.keys()].map(e=>[B(e),e])),o=/* @__PURE__ */ new Set,s=t=>{if(o.has(t))return;o.add(t);let n=a.get(t),i=n?e.snippetReferencesByFile.get(n)?.rendered??[]:[];for(let e of i){let n=pe(e,t);if(!n)continue;let i=dr(n);r.add(i),s(i)}};for(let e of[...t,...i])s(B(e));return r};var Vr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Hr=e=>{let t=/* @__PURE__ */ new Set;for(let n of e){t.add(Ce(n.slug));for(let e of Hr(n.children))t.add(e)}return t},Ur=/* @__PURE__ */ new Set([`ParamField`,`Param`,`ResponseField`]),Wr=/* @__PURE__ */ new Set([`query`,`path`,`body`,`header`,`name`]),Gr=e=>{let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map;return Yn(e,`mdxJsxFlowElement`,e=>{if(Ur.has(e.name??``)){let r=e.attributes.find(e=>`name`in e&&Wr.has(e.name));if(r&&typeof r.value==`string`&&r.value){let e=n.get(r.value)??0;n.set(r.value,e+1),t.add(ht(r.value,e))}return}if(Dt.has(e.name??``))return;let r=e.attributes.find(e=>`name`in e&&e.name===`id`);if(r&&typeof r.value==`string`&&r.value){let n=Ot.has(e.name??``)?Ce(r.value):r.value;t.add(n)}}),t},Kr=e=>{if(typeof e==`string`)return e;let t=(e?.data?.estree)?.body[0],n=t?.type===`ExpressionStatement`?t.expression:void 0;if(n?.type===`Literal`&&typeof n.value==`string`)return n.value;if(n?.type===`TemplateLiteral`&&n.expressions.length===0)return n.quasis[0]?.value.cooked??void 0},qr=(e,t,n)=>Vr(void 0,void 0,void 0,function*(){let r={},i=()=>t=>{let n=/* @__PURE__ */ new Set;return Yn(t,[`linkReference`,`imageReference`],e=>{`identifier`in e&&n.add(e.identifier)}),Yn(t,t=>{let r=t.position?.start.line,i=r===void 0?void 0:c[r-1];if(t.type===`link`||t.type===`image`){e.addPath(t.url,z.MD,i);return}if(t.type===`definition`){n.delete(t.identifier)&&e.addPath(t.url,z.DEFINITION,i);return}let a=t;if(a.name===`img`||a.name===`source`){let t=a.attributes.findIndex(e=>e.type===`mdxJsxAttribute`&&e.name===`src`),n=Kr(a.attributes[t]?.value);if(typeof n==`string`){e.addPath(n,z.SRC,i);return}}else if(a.name===`a`||a.name===`Card`){let t=a.attributes.findIndex(e=>e.type===`mdxJsxAttribute`&&e.name===`href`),n=Kr(a.attributes[t]?.value);if(typeof n==`string`){e.addPath(n,z.HREF,i);return}}}),t},a=_(t),s=Ge(a),c=Ke(a),l=Oe().use(Ln).use(i).use(o).use(Ct,r),u=l.parse(s),d=Ir(u);if(n?.checkSnippets)for(let t of d.imported)e.addPath(t,z.IMPORT);yield l.run(u);let f=r.tableOfContents?Hr(r.tableOfContents):/* @__PURE__ */ new Set,p=Gr(u);return e.headingSlugs=/* @__PURE__ */ new Set([...f,...p]),d}),Jr=(e,t)=>Vr(void 0,void 0,void 0,function*(){let n=e||process.cwd(),r=yield he(n),i=Te(r),a=new yr(n,r),o=ur(n,r).filter(e=>!ue(e,i));a.addNodes(o);let s=yield Pr(n);a.setRedirects(s),a.addAliasNodes();try{let e=yield jr(n,{fetchRemoteDocument:t?.fetchRemoteDocument});a.addVirtualNodes(e)}catch(e){console.warn(`Warning: Failed to extract OpenAPI page paths: ${e}`)}try{let e=yield Tr(n);a.addVirtualNodes(e)}catch(e){console.warn(`Warning: Failed to extract GraphQL page paths: ${e}`)}let c=yield kr(n);if(c){let e=a.addNode(c.configFile);for(let t of c.hrefs){let n=t===`/`||t===``?`/index`:t.replace(/^\/#/,`/index#`);e.addPath(n)}}let l=lr(n,r).filter(e=>!ue(e,i)),u=/* @__PURE__ */ new Map,d=0,f=performance.now();return yield Promise.all(Array.from({length:Math.min(8,l.length)},()=>Vr(void 0,void 0,void 0,function*(){for(;d<l.length;){performance.now()-f>50&&(yield new Promise(e=>setImmediate(e)),f=performance.now());let e=l[d++];if(e===void 0)continue;let r=a.getNode(e);if(!r)continue;let i=yn.default.readFileSync(nt.join(n,e)).toString();try{let n=yield qr(r,i,{checkSnippets:t?.checkSnippets});u.set(e,n)}catch(n){let r=/* @__PURE__ */ Error(`Syntax error - Unable to parse ${e} - ${n}`);if(!t?.onParseError)throw r;t.onParseError(e,r)}}}))),zr(a,u),a.snippetReferencesByFile=u,a});var V=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Yr=e=>{try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}},Xr=(e,t)=>V(void 0,void 0,void 0,function*(){let n=new AbortController,r=setTimeout(()=>n.abort(),1e4);try{let r=yield fetch(e,{method:t,signal:n.signal,headers:{"User-Agent":`Mintlify-LinkChecker/1.0`},redirect:`follow`});return yield r.body?.cancel().catch(()=>void 0),r.status}finally{clearTimeout(r)}}),Zr=/* @__PURE__ */ new Set([404,405]),Qr=e=>V(void 0,void 0,void 0,function*(){try{let t=yield Xr(e,`HEAD`),n=Zr.has(t)?yield Xr(e,`GET`).catch(()=>t):t;return{ok:n!==404,status:n}}catch(e){return{ok:!1,status:null,error:e instanceof Error?e.message:`unknown error`}}}),$r=(e,t,n)=>V(void 0,void 0,void 0,function*(){let r=[],i=0,a=()=>V(void 0,void 0,void 0,function*(){for(;i<e.length;){let n=i++;r[n]=yield t(e[n])}}),o=Array.from({length:Math.min(n,e.length)},()=>a());return yield Promise.all(o),r}),ei=(e,t)=>V(void 0,void 0,void 0,function*(){let n=/* @__PURE__ */ new Map;for(let[r,i]of e.getExternalPathsByNode())if(!t?.sourceFiles||t.sourceFiles.has(r)){for(let e of i)if(Yr(e.originalPath)){let t=e.originalPath,i=n.get(t),a={file:r,originalPath:e.originalPath};i?i.push(a):n.set(t,[a])}}let r=[...n.keys()];return(yield $r(r,e=>V(void 0,void 0,void 0,function*(){let t=yield Qr(e);if(t.ok)return null;let r={url:e,status:t.status,sources:n.get(e)};return t.error&&(r.error=t.error),r}),5)).filter(e=>e!==null)});var ti=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const ni=new RegExp(Le.source,`gm`),ri=/^(?:import|export)(?=[\s{*])/,ii=/<[A-Za-z][\w.:-]*(?:"[^"]*"|'[^']*'|\{[^{}]*\}|[^<>"'{}])*>/g,ai=/"[^"]*"|'[^']*'|\{[^{}]*\}/g,oi=e=>/\{\s*#[^}]+?\s*\}\s*$/.test(e),si=e=>{let t=e.replace(ni,(e,t,n,r)=>{let i=e.indexOf(r,t.length+n.length)+r.length;return e.slice(0,i).padEnd(e.length,` `)});return Oe().parse(t)},ci=(e,t)=>{let n=``,r=0;for(let[i,a]of[...t].sort((e,t)=>e[0]-t[0])){let t=Math.max(i,r);a<=t||(n+=e.slice(r,t)+e.slice(t,a).replace(/[^\n]/g,` `),r=a)}return n+e.slice(r)},li=(e,t)=>t.reduce((e,t)=>ci(e,t(e)),e),ui=e=>{try{return De.parse(e,{ecmaVersion:`latest`,sourceType:`module`}),!0}catch(t){let n=t.pos;return typeof n!=`number`||n<e.trimEnd().length}},di=e=>{let t=x.exec(e);return t?[[t.index,t.index+t[0].length]]:[]},fi=(e,t)=>{let n,r=!0,i=[],a=0;for(let o of e.split(`
|
|
10
|
-
`)){let e=o.trim()===``,s=r;r=e,n?e&&ui(n.join(`
|
|
11
|
-
`))?n=void 0:(n.push(o),i.push([a,a+o.length])):s&&ri.test(o)&&!t.some(([e,t])=>e<=a&&a<t)&&(n=[o],i.push([a,a+o.length])),a+=o.length+1}return i},pi=e=>ci(e,di(e)),mi=(e,{keepEsm:t=!1}={})=>{let n=Et(e);return ci(e,[...di(e),...n,...t?[]:fi(e,n)])},hi=/* @__PURE__ */ new Set([`{`,"${"]),gi=(e,t)=>{let n=[],r=0;try{let i=De.tokenizer(e.slice(t),{ecmaVersion:`latest`,onComment:(e,r,i,a)=>n.push([t+i+2,t+a-(e?2:0)])});for(let a of i){let i=a.type.label;if(i===`template`)n.push([t+a.start,t+a.end]);else if(i===`string`)n.push([t+a.start+1,t+a.end-1]);else if(i===`regexp`){let r=e.slice(t+a.start,t+a.end);n.push([t+a.start+1,t+a.start+r.lastIndexOf(`/`)])}else if(hi.has(i))r++;else if(i===`}`&&r--===0)return{ranges:n,end:t+a.end}}}catch(r){if(!(r instanceof SyntaxError&&`pos`in r&&typeof r.pos==`number`))return{ranges:n,end:e.length};let i=t+r.pos;if(!r.message.startsWith(`Unterminated string`))return{ranges:n,end:i};let a=e.indexOf(`
|
|
12
|
-
`,i);n.push([i+1,a===-1?e.length:a])}return{ranges:n,end:e.length}},_i=e=>{let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(r===`\\`)n++;else if(r===`{`){let r=gi(e,n+1);t.push(...r.ranges),n=r.end-1}}return t},vi=e=>[...e.matchAll(ii)].flatMap(({index:e,0:t})=>[...t.matchAll(ai)].map(({index:t,0:n})=>[e+t+1,e+t+n.length-1])),yi=e=>[...e.matchAll(/\\[\s\S]/g)].flatMap(({index:e,0:t})=>t===`\\<`?[[e+1,e+2]]:[]),bi=e=>li(mi(e),[vi,yi,_i]),xi=e=>{let t=e.map((e,t)=>({edit:e,index:t})).sort((e,t)=>t.edit.start-e.edit.start||t.edit.end-e.edit.end||t.index-e.index),n=[],r=1/0;for(let{edit:e}of t)e.end>r||(n.push(e),r=e.start);return n},Si=(e,t)=>xi(t).reduce((e,t)=>e.slice(0,t.start)+t.text+e.slice(t.end),e),Ci=(e,t,n=1)=>{let r=0;for(let n=1;n<t;n++){let t=e.indexOf(`
|
|
13
|
-
`,r);if(t===-1)break;r=t+1}return r+n-1},H=(e,t)=>{let n=e.slice(0,t).split(`
|
|
14
|
-
`);return{line:n.length,column:(n.pop()?.length??0)+1}},wi=(e,t)=>e.start-t.start;function Ti(e,t,n){let r=0;for(let i of e){let e=i.start+r;if(n===`snap`?t<e:t<=e)break;if(t<e+i.text.length)return n===`snap`?i.start:void 0;r+=i.text.length-(i.end-i.start)}return t-r}const Ei=(e,t,n)=>{let{start:r,end:i}=n;for(let{edits:n}of e.slice(0,t).reverse()){let e=[...n].sort(wi),t=Ti(e,r,`reject`),a=Ti(e,i,`reject`);if(t===void 0||a===void 0||e.some(e=>e.start<a&&e.end>t))return;r=t,i=a}return{start:r,end:i,text:n.text}},Di=(e,t,n)=>{let r=e[t],i=e[0];if(!r||!i||n.line===void 0)return{};let a=e.slice(0,t).reduceRight((e,{edits:t})=>Ti([...t].sort(wi),e,`snap`),Ci(r.content,n.line,n.column)),o=H(i.content,a);return n.column===void 0?{line:o.line}:o},Oi=e=>t(S(e)).replace(/^\.$/,``),ki=(e,t)=>ti(void 0,void 0,void 0,function*(){let n=new _r(e);try{yield qr(n,t)}catch{return[]}return n.paths.flatMap(e=>e.pathType===R.INTERNAL&&e.anchorLink?[`${Oi(y(e.toString()))}#${ee(e.anchorLink.slice(1))}`]:[])}),Ai=(e,t,n)=>{let r=`${Oi(t)}#`;for(let t of e??[]){if(!t.startsWith(r))continue;let e=t.slice(r.length),i=e.startsWith(`${n}-`)&&/^\d/.test(e.slice(n.length+1));if(e===n||i)return e}},ji={id:`parse-error`,group:`content`,severity:`error`,description:`files MDX can't parse; other checks skip them`};var Mi=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Ni=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Pi=/* @__PURE__ */ new Set([`page`,`snippet`,`snippet-v2`]),Fi=(e,t)=>[...new Set([...t].flatMap(t=>{let n=pe(t,`/${e.replace(/^\//,``)}`);return n?[n.toLowerCase()]:[]}))].sort().join(`
|
|
15
|
-
`),Ii=e=>Mi(void 0,void 0,void 0,function*(){let{mdxCandidates:t}=yield C(e,yield he(e)),{snippets:n,snippetsV2:r,fileImportsMap:i}=yield re(e,t),a=/* @__PURE__ */ new Set([...n,...r]),o=new Map(t.map(e=>[e.replace(/^\//,``),[...i.get(e.toLowerCase())??[]].sort().join(`
|
|
16
|
-
`)]));return{files:t.filter(e=>/\.mdx?$/.test(e)&&Pi.has(T(e))).map(e=>({file:e.replace(/^\//,``),kind:a.has(e)?`snippet`:`page`})),imports:o}}),Li=e=>{try{let{attributes:t}=te(e);return t&&typeof t==`object`?Object.assign({},t):{}}catch{return{}}},Ri=/\s*\(\d+:\d+(?:-\d+:\d+)?\)$/,zi=/* @__PURE__ */ new Set([`unexpected-character`,`unexpected-eof`]),Bi=(e,t,n)=>{let{source:r,ruleId:i}=e??{};return r===`micromark-extension-mdx-jsx`&&typeof i==`string`&&zi.has(i)&&n?.line!=null&&n.column!=null&&t[Ci(t,n.line,n.column)-1]===`<`},Vi=(e,t=``)=>{let n=e?.reason,r=e instanceof Error?e.message:`could not parse this file`,i=typeof n==`string`?n:r,a=e&&typeof e==`object`?de(e):null,o=Bi(e,t,a)?`; if this < isn't a tag, escape it as \\<`:``;return Object.assign(Object.assign(Object.assign({},a?.line!=null&&{line:a.line}),a?.column!=null&&{column:a.column}),{message:i.replace(Ri,``)+o})},Hi=(e,t)=>Object.assign(Object.assign({},t),{rule:ji.id,group:ji.group,severity:ji.severity,file:e,message:`${t.message} (other checks were skipped for this file)`}),Ui=e=>{try{return si(e)}catch{return}},Wi=(e,t,n,r={})=>{let i=Object.assign({file:e,content:t,baseDir:n,frontmatter:Li(t)},r),a=Ui(t);if(a)return{context:Object.assign(Object.assign({},i),{tree:a}),approximate:!1};try{return{context:Object.assign(Object.assign({},i),{tree:le(t,e)}),approximate:!0}}catch(e){return{error:Vi(e,t)}}},Gi={type:`root`,children:[]},Ki=/\{\{\s*([\w.\-]+)\s*\}\}/g,qi=(e,t={})=>[...e.matchAll(Ki)].filter(e=>e[1]!==void 0&&t[e[1]]!==void 0).map(e=>({start:e.index,end:e.index+e[0].length,text:ne(e[0],t)})),Ji=(e,t,n,r,i)=>{var{edit:a}=n,o=Ni(n,[`edit`]);let s=a&&Ei(r,i,a);return Object.assign(Object.assign(Object.assign(Object.assign({},o),Di(r,i,o)),{rule:e.id,group:e.group,severity:e.severity,file:t}),s&&{fix:Object.assign({file:t},s)})},Yi=(e,{file:t,kind:n},r,i,a,o)=>{let s=n===`snippet`?e.filter(e=>!e.pagesOnly):e,c=s.filter(e=>e.raw),l=s.filter(e=>!e.raw),u=n===`snippet`?qi(r,o):[],d=Si(r,u),f={file:t,content:d,baseDir:i,frontmatter:{},tree:Gi,variables:o},p=c.flatMap(e=>e.check(f).map(t=>({rule:e,finding:t}))),m=xi(p.flatMap(({finding:e})=>e.edit?[e.edit]:[])),h=Si(d,m),g=[{content:r,edits:u},{content:d,edits:m},{content:h,edits:[]}],_=p.map(({rule:e,finding:n})=>Ji(e,t,n,g,1)),v=Wi(t,h,i,Object.assign(Object.assign({},a),{variables:o}));if(`error`in v)return _.unshift(Hi(t,Object.assign(Object.assign({},v.error),Di(g,2,v.error)))),_;for(let e of l)for(let n of e.check(v.context)){let r=v.approximate?Object.assign(Object.assign({},n),{edit:void 0}):n;_.push(Ji(e,t,r,g,2))}return _},Xi=e=>Mi(void 0,void 0,void 0,function*(){let t=yield Promise.all(e.files.map(({file:t})=>ki(t,e.read(t)??``)));return new Set(t.flat())}),Zi=(e,t)=>Mi(void 0,void 0,void 0,function*(){let n=new Set(t.filter(e=>e.needsAnchorLinks).map(({id:e})=>e)),r=e.files.filter(({file:t})=>!e.selected||e.selected.has(t)),i=(n,r)=>{let i=e.read(n.file);return i===void 0?[Hi(n.file,{message:`could not read this file`})]:Yi(t,n,i,e.baseDir,r,e.variables)},a=e=>e.some(({rule:e})=>n.has(e)),o={readFile:e.read,themeVersion:e.themeVersion},s=r.map(e=>i(e,o));if(!s.some(a))return s.flat();let c=Object.assign(Object.assign({},o),{anchorLinks:yield Xi(e)});return r.flatMap((e,t)=>{let n=s[t]??[];return a(n)?i(e,c):n})}),Qi=[`humans`,`agents`,`signed-in`,`signed-out`],$i={wide:"The page keeps the default width and still hides the table of contents; without `mode` the table of contents shows.",center:"The page keeps the default layout and still hides the table of contents; without `mode` the table of contents shows.",frame:"The page uses the default layout, but its headings still get no anchor ids and no table of contents; without `mode` they do."},ea=[`children`,`className`,`id`,`key`,`style`],ta=[`right`,`left`,`none`],na=[`grey`,`violet`,`sky`,`teal`,`plum`,`crimson`,`info`,`success`,`warning`,`destructive`],ra=[`inline`,`base`],ia=[`default`,`color`],aa=[`dot`,`number`,`box`],oa=[`timeline`,`divided`],sa=[`box`,`circle`,`dot`,`number`],ca=[`solid`,`dashed`],la=[`h2`,`h3`,`h4`],ua=[`rule`,`card`,`plain`],da=[`background`,`plain`,`separator`],fa=[`compact`,`table`],pa=[`minimal`,`grid`],ma=[`equal`,`auto`],ha=[`start`,`center`,`end`],ga=[`subtle`,`strong`],U=(e,{legacy:t={},invalid:n}={})=>Object.assign({values:e,legacy:t},n!==void 0&&{invalid:n}),_a=e=>e,W={icon:{kind:`icon`},iconType:{kind:`iconType`}},G={kind:`flag`},K={kind:`any`},q={status:`supported`,props:W,removedProps:{color:{note:`It is ignored. Style the callout with custom CSS on [data-component-item="alert"].`}}},va={status:`pending`,anyProps:!0},ya={type:K,typeHref:K,location:K,default:K,required:G,deprecated:G,hidden:G,pre:K,post:K},ba={status:`supported`,within:[`Table`],anyProps:!0},xa=Object.assign(Object.assign({},ba),{props:{align:U(ha)}}),Sa={status:`supported`,props:{cols:{kind:`integer`,min:1,max:4},joined:G,variant:U(da)}},Ca={status:`supported`,props:Object.assign(Object.assign({},W),{filename:K,language:K,lang:K,lines:G,wrap:G,expandable:G,nocopy:G,inline:G})},wa={status:`supported`},Ta={status:`supported`,within:[`Tree`,`FileTree`],props:{name:K,highlight:G}},Ea=Object.assign(Object.assign({},Ta),{props:Object.assign(Object.assign({},Ta.props),{defaultOpen:G,openable:G})}),Da=Object.assign({},va),Oa=`A tooltip holds text only. Put the link in the text next to the tooltip, or make the trigger itself a link.`,ka={status:`removed`,note:"It belonged to twoslash popups. Remove the tag and the `twoslash` option from the code fence."},Aa=_a({Accordion:{status:`supported`,props:Object.assign(Object.assign({},W),{title:K,description:K,defaultOpen:G})},AccordionGroup:{status:`supported`,children:[`Accordion`]},ApiPlayground:{status:`removed`,note:`Nothing renders in its place. Generate the API playground from OpenAPI or AsyncAPI.`},Badge:{status:`supported`,props:Object.assign(Object.assign({},W),{color:U(na,{legacy:{gray:`grey`,blue:[`sky`,`info`],green:[`teal`,`success`],orange:`warning`,yellow:`warning`,red:[`crimson`,`destructive`],purple:`violet`,white:null,surface:null,"white-destructive":`destructive`,"surface-destructive":`destructive`}}),size:U(ra,{legacy:{xs:`inline`,sm:`inline`,md:`inline`,lg:`base`}}),type:U(ia)}),removedProps:{shape:{note:`The badge has one shape.`,remove:!0},stroke:{note:`The badge has no outline.`,remove:!0},disabled:{note:`The badge has no disabled state.`,remove:!0}}},Callout:q,Card:{status:`supported`,props:Object.assign(Object.assign({},W),{title:K,color:K,horizontal:G,href:K,img:K,disabled:G,cta:K,variant:U(da)}),removedProps:{arrow:{note:"The card has no corner icon. Add a `cta` instead: it shows a chevron when the card links within the site."},type:{note:`It is ignored.`,remove:!0}}},CardGroup:Object.assign(Object.assign({},Sa),{status:`deprecated`,replacement:`Columns`}),Check:q,CodeBlock:Ca,CodeGroup:{status:`supported`,props:{dropdown:G,report:G}},Color:{status:`supported`,props:{variant:U(fa)}},"Color.Row":{status:`supported`,within:[`Color`],props:{title:K}},"Color.Item":{status:`supported`,within:[`Color`],required:[{props:[`value`],note:`Without it the item does not render.`}],props:{name:K,value:{kind:`text`}}},Column:{status:`supported`,within:[`Columns`,`CardGroup`]},Columns:Sa,CustomCode:{status:`supported`,anyProps:!0},CustomComponent:{status:`supported`,anyProps:!0},Danger:q,DynamicCustomComponent:{status:`supported`,anyProps:!0},Expandable:{status:`supported`,props:{title:K,defaultOpen:G},removedProps:{lazy:{note:`It is ignored.`,remove:!0},uniqueParamId:{note:`It is ignored.`,remove:!0}}},FileTree:wa,Frame:{status:`supported`,props:{caption:K,hint:K,containerClassName:K},removedProps:{as:{note:`It is ignored.`,remove:!0}}},GitHub:Da,"GitHub.Repo":Da,Github:Da,"Github.Repo":Da,Heading:{status:`supported`,anyProps:!0},Icon:{status:`supported`,props:Object.assign(Object.assign({},W),{src:K,library:K,color:K,size:K,title:K,"aria-label":K})},Info:q,Latex:{status:`supported`},Link:{status:`supported`,anyProps:!0,props:{iconPosition:U(ta)}},List:{status:`supported`,props:{marker:U(aa),start:{kind:`integer`}}},MDX:{status:`supported`},MDXContentController:{status:`supported`,anyProps:!0},Mermaid:{status:`supported`,props:{chart:K,title:K,actions:K},removedProps:{placement:{note:`It is ignored.`,remove:!0}}},Note:q,OptimizedVideo:{status:`supported`,anyProps:!0},Panel:{status:`supported`,anyProps:!0},Param:{status:`removed`,replacement:`ParamField`,note:`Only its description renders.`},ParamField:{status:`supported`,required:[{props:[`query`,`path`,`body`,`header`],note:`It names the parameter and where it goes; without one the field does not render.`}],props:Object.assign(Object.assign({},ya),{query:K,path:K,body:K,header:K,placeholder:K,enum:K})},Popup:ka,PopupContent:ka,PopupTrigger:ka,Prompt:{status:`supported`,props:{description:K,actions:K},removedProps:{icon:{note:`It is ignored.`,remove:!0},iconType:{note:`It is ignored.`,remove:!0}}},Quote:{status:`supported`,props:{variant:U(ua),author:K,img:K,icon:K}},RequestExample:{status:`supported`,props:{dropdown:G}},ResponseExample:{status:`supported`,props:{dropdown:G}},ResponseField:{status:`supported`,required:[{props:[`name`],note:`Without it the field does not render.`}],props:Object.assign(Object.assign({},ya),{name:K})},SnippetGroup:{status:`removed`,replacement:`CodeGroup`,note:`Its code blocks render without the group.`},Step:{status:`supported`,within:[`Steps`],props:Object.assign(Object.assign({},W),{title:K,description:K,stepNumber:K,titleSize:U(la),noAnchor:G})},Steps:{status:`supported`,children:[`Step`],props:{titleSize:U(la),variant:U(oa),marker:U(sa),line:U(ca),background:G,start:{kind:`integer`}}},Tab:{status:`supported`,within:[`Tabs`],required:[{props:[`title`],note:`Without it the tab is labelled "Tab Title".`}],props:Object.assign(Object.assign({},W),{title:K})},Table:{status:`supported`,props:{variant:U(pa),layout:U(ma),"aria-label":K}},"Table.Body":ba,"Table.Cell":Object.assign(Object.assign({},xa),{props:Object.assign(Object.assign({},xa.props),{variant:U(ga)})}),"Table.Header":ba,"Table.HeaderCell":xa,"Table.Row":ba,"Table.RowHeader":xa,Tabs:{status:`supported`,children:[`Tab`],props:{defaultTabIndex:{kind:`integer`,min:0},borderBottom:G,sync:G}},Tile:va,Tip:Object.assign(Object.assign({},q),{status:`deprecated`,replacement:`Check`}),Tooltip:{status:`supported`,required:[{props:[`tip`,`headline`],note:`Without either one the trigger renders as plain text, with no tooltip.`}],linksOnlyWhole:!0,props:{tip:K,headline:K,triggerAriaLabel:K,iconPosition:U(ta)},removedProps:{cta:{note:Oa},href:{note:Oa}}},Tree:wa,"Tree.File":Ta,"Tree.Folder":Ea,Update:va,Variation:va,View:{status:`supported`,required:[{props:[`title`],note:`Without it readers can never pick this view.`}],props:Object.assign(Object.assign({},W),{title:K})},Visibility:{status:`supported`,required:[{props:[`for`],note:`Without it readers see nothing.`}],props:{for:U(Qi,{invalid:`Readers see nothing.`})}},Warning:q,ZoomImage:{status:`supported`,anyProps:!0}}),ja=e=>{let t=/* @__PURE__ */ new Set;return k(e.tree,`mdxjsEsm`,e=>{for(let n of e.data?.estree?.body??[])if(n.type===`ImportDeclaration`)for(let e of n.specifiers)O(e.local,t);else if(n.type===`ExportNamedDeclaration`){let e=n.declaration;if(e?.type===`VariableDeclaration`)for(let n of e.declarations)O(n.id,t);else e&&O(e.id,t);for(let e of n.specifiers)O(e.local,t),O(e.exported,t)}else if(n.type===`ExportDefaultDeclaration`){let e=n.declaration;(e.type===`FunctionDeclaration`||e.type===`ClassDeclaration`)&&O(e.id,t)}}),t},Ma=e=>(e.tree.children.find(e=>[`yaml`,`toml`].includes(e.type))?.position)?.end.offset??0,Na=(e,t,n)=>{let r;try{r=h(le(e,t))}catch{return}return r.has(n)?`{ ${n} }`:r.has(`default`)?n:void 0},Pa={id:`unknown-component`,group:`content`,severity:`error`,scope:`file`,description:`JSX components that are not built in, imported or exported`,pagesOnly:!0,check:e=>{let t=ja(e),n=/* @__PURE__ */ new Set,r=[],i=Ma(e),a=i===0?``:`
|
|
17
|
-
|
|
18
|
-
`,o=/^\n*/.exec(e.content.slice(i))?.[0].length??0,s=`
|
|
19
|
-
`.repeat(Math.max(0,2-o)),c=(o,c)=>{let l=o?.split(`.`)[0];if(!o||!l||!/^[A-Z]/.test(l)||t.has(l)||n.has(o)||At(o)||e.themeVersion===2&&Object.prototype.hasOwnProperty.call(Aa,o))return;n.add(o);let u=_e.map(e=>`snippets/${l}${e}`).find(t=>e.readFile?.call(e,t)!==void 0),d=u&&e.readFile?.call(e,u),f=u&&d!==void 0&&o===l?Na(d,u,l):void 0;r.push({line:c?.line,column:c?.column,message:`<${o}> is not built in, imported or exported on this page`,edit:f?{start:i,end:i,text:`${a}import ${f} from "/${u}";${s}`}:void 0})},l=(e,t)=>qe(e,/* @__PURE__ */ new Set,{reference:e=>{if(e.type!==`JSXIdentifier`)return;let n=e.loc;c(String(e.name),n?.start??t)}});return k(e.tree,e=>{if(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`){c(e.name,e.position?.start);for(let t of e.attributes){let n=t.type===`mdxJsxAttribute`?t.value:t;n&&typeof n==`object`&&l(n.data?.estree,e.position?.start)}}else(e.type===`mdxFlowExpression`||e.type===`mdxTextExpression`)&&l(e.data?.estree,e.position?.start)}),r}},Fa=Aa,Ia=new Set(ea),J=e=>e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`,Y=e=>e&&Object.prototype.hasOwnProperty.call(Fa,e)?Fa[e]:void 0,La=e=>(e.children??[]).flatMap(e=>J(e)&&e.name?[e]:La(e)),Ra=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(r!==void 0&&t(r))return n}return-1},za=e=>e?.split(`.`)[0]??``,X=(e,t)=>{let n=ja(e),r=(e,i,a)=>{let o=i;if(J(e)){let r=n.has(za(e.name))?void 0:Y(e.name);r&&t(e,r,i,a),o=[...i,e]}let s=[...a,e];for(let t of e.children??[])r(t,o,s)};r(e.tree,[],[])},Ba=e=>e.data?.estree,Va=e=>{let t=/* @__PURE__ */ new Set,n=e=>{if(Array.isArray(e)){for(let t of e)n(t);return}if(typeof e!=`object`||!e)return;let{type:r,name:i}=e;if(r===`JSXClosingElement`){let e=i;for(;e?.type===`JSXMemberExpression`;)e=e.object;t.add(e)}for(let[t,r]of Object.entries(e))t!==`loc`&&t!==`range`&&typeof r==`object`&&n(r)};return n(e),t},Ha=(e,t)=>{let n=ja(e),r=e=>{let r=Va(e);qe(e,/* @__PURE__ */ new Set,{reference:e=>{if(e.type!==`JSXIdentifier`||r.has(e))return;let i=String(e.name),a=n.has(i)?void 0:Y(i),o=e.loc?.start;a&&t({name:i,spec:a,position:o?{line:o.line,column:o.column+1}:{}})}})},i=e=>{if(J(e)){let i=n.has(za(e.name))?void 0:Y(e.name);i&&e.name&&t({name:e.name,spec:i,position:Q(e),element:e});for(let t of e.attributes){let e=t.type===`mdxJsxAttribute`?t.value:t;e&&typeof e==`object`&&r(Ba(e))}}else(e.type===`mdxFlowExpression`||e.type===`mdxTextExpression`)&&r(Ba(e));for(let t of e.children??[])i(t)};i(e.tree)},Z=(e,t)=>Object.assign(Object.assign({},e),{scope:`file`,group:`content`,severity:`warning`,theme:2,check:e=>{let n=[];return t(e,e=>n.push(e)),n}}),Q=e=>({line:e.position?.start.line,column:e.position?.start.column}),Ua=e=>e.map(e=>`"${e}"`).join(`, `),Wa=e=>e.map(e=>`<${e}>`).join(` or `),Ga=(e,t)=>{let n=e.toLowerCase(),r=t.toLowerCase(),i=Array.from({length:n.length+1},(e,t)=>Array.from({length:r.length+1},(e,n)=>t===0?n:n===0?t:0)),a=(e,t)=>i[e]?.[t]??0;for(let e=1;e<=n.length;e++)for(let t=1;t<=r.length;t++){let o=n[e-1]===r[t-1]?0:1,s=Math.min(a(e-1,t)+1,a(e,t-1)+1,a(e-1,t-1)+o);e>1&&t>1&&n[e-1]===r[t-2]&&n[e-2]===r[t-1]&&(s=Math.min(s,a(e-2,t-2)+1));let c=i[e];c&&(c[t]=s)}return a(n.length,r.length)},Ka=(e,t)=>{let n=Math.max(1,Math.floor(e.length/3));return t.map(t=>({candidate:t,score:Ga(e,t)})).filter(({score:e})=>e<=n).sort((e,t)=>e.score-t.score)[0]?.candidate},qa=(e,t)=>{let n=Ka(e,t);return n?` Did you mean "${n}"?`:``},Ja=e=>{if(e!==null)return typeof e==`string`?`"${e}"`:Ua(e).replace(/, (?=[^,]*$)/,` or `)},Ya=e=>e.attributes.filter(e=>e.type===`mdxJsxAttribute`),Xa=/[^\s=/>{}"']+/y,Za=e=>e.attributes.flatMap(e=>{let t=e.type===`mdxJsxAttribute`?e.value:e,n=t&&typeof t==`object`?Ba(t):void 0;return typeof n?.start==`number`&&typeof n.end==`number`?[{start:n.start,end:n.end}]:[]}),Qa=(e,t,n)=>{let r=/* @__PURE__ */ new Map,i=t=>{let r=n.find(({start:e})=>e===t+1);if(!r)return;let i=r.end;for(;i<e.length&&/[\s>]/.test(e[i]??``);)i++;return e[i]===`}`?i+1:void 0},a=t,o=()=>{for(;a<e.length&&/\s/.test(e[a]??``);)a++};for(;;){o();let t=e[a];if(t===void 0||t===`>`||t===`/`)break;if(t===`{`){let e=i(a);if(e===void 0)break;a=e;continue}Xa.lastIndex=a;let n=Xa.exec(e)?.[0];if(!n)break;let s=a;a+=n.length;let c=a;if(o(),e[a]===`=`){a++,o();let t=e[a];if(t===`"`||t===`'`){let n=e.indexOf(t,a+1);a=n===-1?e.length:n+1}else if(t===`{`){let e=i(a);if(e===void 0)break;a=e}}else a=c;r.set(n,[...r.get(n)??[],{start:s,end:a}])}return r},$a=(e,t)=>{let n=Ya(t),r=t.position?.start.offset;if(r===void 0||!t.name)return n.map(e=>({attribute:e}));let{content:i}=e,a=Qa(i,r+t.name.length+1,Za(t)),o=/* @__PURE__ */ new Map;return n.map(e=>{let t=o.get(e.name)??0;o.set(e.name,t+1);let n=a.get(e.name)?.[t];return n?Object.assign(Object.assign({attribute:e},n),{source:i.slice(n.start,n.end)}):{attribute:e}})},eo=(e,t,n)=>t===void 0?Q(n):H(e.content,t),to={known:!1},no=e=>{let t=e;if(t.type===`Literal`)return{known:!0,value:t.value};if(t.type===`TemplateLiteral`&&t.expressions?.length===0)return{known:!0,value:(t.quasis?.[0])?.value.cooked};if(t.type===`UnaryExpression`&&t.operator===`-`){let e=no(t.argument);return e.known&&typeof e.value==`number`?{known:!0,value:-e.value}:to}return to},ro=e=>{let{value:t}=e;if(typeof t!=`object`||!t)return;let[n]=Ba(t)?.body??[];return n?.type===`ExpressionStatement`?n.expression:void 0},io=e=>{let{value:t}=e;return t==null?{known:!0,value:!0}:typeof t==`string`?{known:!0,value:t}:no(ro(e))},ao=e=>{let t=io(e);if(!t.known)return;let{value:n}=t;return typeof n==`string`||typeof n==`number`?String(n):void 0},oo=(e,t)=>{let n=`values`in e||e.kind===`integer`||e.kind===`iconType`,r=io(t);return n&&r.known&&typeof r.value==`boolean`?String(r.value):void 0},so=e=>{let t=ro(e)?.type;return t===`ObjectExpression`||t===`ArrayExpression`},co=e=>e===``||e===!1||e==null,lo=e=>{let t=io(e);return!t.known||!co(t.value)},uo=({start:e,end:t},n)=>e===void 0||t===void 0?void 0:{start:e,end:t,text:n},fo=(e,{start:t,end:n})=>{if(t===void 0||n===void 0)return;let r=t;for(;r>0&&/[ \t]/.test(e.content[r-1]??``);)r--;return{start:r,end:n,text:``}},po=e=>e.replace(/\./g,`\\.`),mo=(e,t,n)=>{let r=t.position?.start.offset,i=t.position?.end.offset,a=t.name;if(r===void 0||i===void 0||!a)return;let o=e.content.slice(r,i),s=po(a),c=RegExp(`^<\\s*${s}(?![\\w.:-])`).exec(o);if(!c)return;let l=RegExp(`</\\s*${s}\\s*>$`).exec(o);if(l||o.endsWith(`/>`))return{start:r,end:i,text:`<${n}${o.slice(c[0].length,l?l.index:o.length)}${l?`</${n}>`:``}`}},ho=Z({id:`removed-component`,description:`Components that no longer render`},(e,t)=>Ha(e,({name:e,spec:n,position:r})=>{if(n.status!==`removed`)return;let i=n.replacement?` Use <${n.replacement}> instead.`:``;t(Object.assign(Object.assign({},r),{message:`<${e}> is removed. ${n.note??``}${i}`.trim()}))})),go=Z({id:`deprecated-component`,description:`Components that still render but have a replacement`},(e,t)=>{let n=ja(e);Ha(e,({name:r,spec:i,position:a,element:o})=>{let{replacement:s}=i;if(i.status!==`deprecated`||!s)return;let c=n.has(s);t(Object.assign(Object.assign({},a),{message:c?`<${r}> is deprecated. Use the built-in <${s}>, which takes the same props; this page declares its own <${s}>, so rename that first.`:`<${r}> is deprecated. Use <${s}>, which takes the same props.`,edit:o&&!c?mo(e,o,s):void 0}))})}),_o=Z({id:`pending-component`,description:`Components that do not render yet`},(e,t)=>Ha(e,({name:e,spec:n,position:r})=>{n.status===`pending`&&t(Object.assign(Object.assign({},r),{message:`<${e}> is not supported yet. It renders only its content, without its own styling.`}))})),vo=Z({id:`removed-prop`,description:`Props that are no longer read`},(e,t)=>X(e,(n,r)=>{for(let i of $a(e,n)){let{attribute:a}=i,o=r.removedProps?.[a.name];if(o===void 0)continue;let s=o.remove?` Remove the prop.`:``;t(Object.assign(Object.assign({},eo(e,i.start,n)),{message:`\`${a.name}\` on <${n.name}> is removed. ${o.note}${s}`,edit:o.remove?fo(e,i):void 0}))}})),yo=Z({id:`unknown-prop`,description:`Props a component does not take`},(e,t)=>X(e,(n,r)=>{if(r.anyProps||r.status===`removed`||r.status===`pending`)return;let i=Object.keys(r.props??{});for(let a of $a(e,n)){let{name:o}=a.attribute;if(Ia.has(o)||i.includes(o)||r.removedProps?.[o]!==void 0||o.startsWith(`data-`)||o.startsWith(`aria-`))continue;let s=i.length>0?` It takes ${Ua(i)}.`:` It takes no props.`;t(Object.assign(Object.assign({},eo(e,a.start,n)),{message:`<${n.name}> has no \`${o}\` prop, so it is ignored.${qa(o,i)}${s}`}))}})),bo=(e,t)=>Object.prototype.hasOwnProperty.call(e.legacy,t)?e.legacy[t]:void 0,xo=(e,t,n,r)=>{let i=`\`${t.source??`${t.attribute.name}="${r}"`}\` on <${e.name}>`;if(`values`in n){if(n.values.includes(r))return;let e=bo(n,r);if(e!==void 0){let t=Ja(e);return{message:t?`${i} is an old value. Use ${t}.`:`${i} is an old value with no replacement. Remove it to get the default.`}}return{message:`${i} is not a supported value${n.invalid?`. ${n.invalid}`:`, so the default is used.`}${qa(r,n.values)} Allowed: ${Ua(n.values)}.`}}if(n.kind===`iconType`)return Ie.includes(r)?void 0:{message:`${i} is not an icon type, so the icon is not drawn.${qa(r,Ie)} Allowed: ${Ua(Ie)}.`};if(n.kind===`integer`){let e=Number(r);return Number.isInteger(e)&&(n.min===void 0||e>=n.min)&&(n.max===void 0||e<=n.max)?void 0:{message:`${i} must be a whole number${n.min!==void 0&&n.max!==void 0?` from ${n.min} to ${n.max}`:n.min===void 0?``:` of at least ${n.min}`}.`}}},So=Z({id:`invalid-value`,description:`Prop values a component does not support`},(e,t)=>X(e,(n,r)=>{for(let i of $a(e,n)){let{attribute:a}=i,o=r.props?.[a.name];if(o&&`kind`in o&&o.kind===`text`){let r=io(a);(so(a)||r.known&&typeof r.value!=`string`)&&t(Object.assign(Object.assign({},eo(e,i.start,n)),{message:`\`${i.source??a.name}\` on <${n.name}> must be one plain string. Any other value does not render.`}));continue}if(!o)continue;let s=ao(a)??oo(o,a);if(s===void 0)continue;let c=xo(n,i,o,s);if(!c)continue;let l=`values`in o?bo(o,s):void 0;t(Object.assign(Object.assign(Object.assign({},eo(e,i.start,n)),c),{edit:typeof l==`string`?uo(i,`${a.name}="${l}"`):void 0}))}})),Co=e=>e.type===`text`&&!e.value?.trim(),wo=e=>J(e)&&!e.name||e.type===`paragraph`&&e.children.every(e=>Co(e)||e.type===`mdxJsxTextElement`||e.type===`mdxTextExpression`),To=Z({id:`component-placement`,description:`Components used outside the component they belong in`,pagesOnly:!0},(e,t)=>X(e,(e,n,r,i)=>{let{within:a}=n;if(!a)return;let o=Ra(i,e=>J(e)&&a.includes(e.name??``)),s=i[o];if(!s||!J(s)){t(Object.assign(Object.assign({},Q(e)),{message:`<${e.name}> only works inside ${Wa(a)}. Here it renders without the layout that component gives it.`}));return}if(!(Y(s.name)?.children)?.includes(e.name??``))return;let c=i.slice(o+1).find(e=>!wo(e));if(!c)return;let l=J(c)?`<${c.name}>`:`a ${c.type}`;t(Object.assign(Object.assign({},Q(e)),{message:`<${e.name}> must be a direct child of <${s.name}>; only a fragment may wrap it. Here it is inside ${l}, so <${s.name}> drops it.`}))})),Eo=Z({id:`dropped-child`,description:`Children a component does not render`},(e,t)=>{let n=ja(e);X(e,(e,r)=>{if(r.children)for(let i of La(e)){let a=i.name??``;r.children.includes(a)||!Y(a)||n.has(za(a))||t(Object.assign(Object.assign({},Q(i)),{message:`<${e.name}> holds only ${Wa(r.children)}. This <${a}> is dropped.`}))}})}),Do=e=>e.map(e=>`\`${e}\``).join(` or `),Oo=Z({id:`missing-prop`,description:`Props a component needs to render its main part`},(e,t)=>X(e,(e,n)=>{let{attributes:r}=e,i=e=>{let t=Ra(r,t=>t.type===`mdxJsxAttribute`&&t.name===e),n=r.slice(t+1).some(({type:e})=>e===`mdxJsxExpressionAttribute`),i=r[t];return n||i?.type===`mdxJsxAttribute`&&lo(i)};for(let{props:r,note:a}of n.required??[])r.some(i)||t(Object.assign(Object.assign({},Q(e)),{message:`<${e.name}> needs ${Do(r)}. ${a}`}))})),ko=e=>{let t=/* @__PURE__ */ new Set,n=e=>{e.type===`definition`&&t.add(String(e.identifier).toLowerCase());for(let t of e.children??[])n(t)};return n(e),t},Ao=(e,t)=>e.type===`link`||e.type===`linkReference`&&t.has(String(e.identifier).toLowerCase())||J(e)&&(e.name===`a`||e.name===`Link`||e.name===`button`),jo=(e,t)=>Ao(e,t)||(e.children??[]).some(e=>jo(e,t)),Mo=e=>e.flatMap(e=>e.type===`paragraph`?Mo(e.children):e.type===`text`&&!e.value?.trim()?[]:[e]),No=[ho,go,_o,vo,yo,So,Oo,To,Eo,Z({id:`nested-link`,description:`Links inside a component that only works when the link is its whole content`},(e,t)=>{let n=ko(e.tree);X(e,(e,r)=>{if(!r.linksOnlyWhole)return;let i=Mo(e.children),[a]=i;i.length===1&&a&&Ao(a,n)||i.some(e=>jo(e,n))&&t(Object.assign(Object.assign({},Q(e)),{message:`<${e.name}> around text that contains a link shows no tooltip. Make the whole trigger the link, or move the link out of it.`}))})}),Z({id:`removed-page-mode`,description:`Page modes that no longer exist`,pagesOnly:!0},(e,t)=>{let{mode:n}=e.frontmatter,r=$i;if(typeof n!=`string`||!Object.prototype.hasOwnProperty.call(r,n))return;let i=e.content.search(/^mode\s*:/m);t(Object.assign(Object.assign({},i===-1?{}:H(e.content,i)),{message:`\`mode: ${n}\` in the frontmatter is deprecated. ${r[n]} Use custom CSS for a different layout.`}))})];var Po=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Fo=e=>{try{let t=JSON.parse(e);return t&&typeof t==`object`?t:{}}catch{return{}}},Io=ye,Lo=({theme:e,themeVersion:t})=>{let n=Io[typeof e==`string`?e:`mint`]??1;return typeof t==`number`&&Number.isInteger(t)&&t>=1&&t<=n?t:1},Ro=e=>st.existsSync(N.join(e,`docs.json`))?`docs.json`:`mint.json`,zo=e=>{try{return Lo(Fo(st.readFileSync(N.join(e,Ro(e)),`utf-8`)))}catch{return Lo({})}},Bo=(e,t)=>Po(void 0,[e,t],void 0,function*(e,{selected:t,localSchema:n}){let{files:r,imports:i}=yield Ii(e),a=/* @__PURE__ */ new Map,o=Ro(e),s=t=>{if(!a.has(t))try{a.set(t,st.readFileSync(N.join(e,t),`utf-8`))}catch{a.set(t,void 0)}return a.get(t)},c=Fo(s(o)??``);return{baseDir:e,files:r,imports:i,selected:t,configFile:o,variables:c.variables&&typeof c.variables==`object`?c.variables:void 0,themeVersion:Lo(c),localSchema:n,read:s,locate:(e,t)=>{let n=s(e)??``,r=t?n.indexOf(t):-1;return r===-1?{}:H(n,r)}}});var $=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Vo=N.join(dt.homedir(),`.mintlify`,`diagnostics`),Ho=(e,t=Vo)=>{let n=N.resolve(e),r=pt(`sha256`).update(n).digest(`hex`).slice(0,12),i=N.basename(n).replace(/[^\w.-]+/g,`-`)||`site`;return N.join(t,`${i}-${r}.json`)},Uo=/\.mdx?$/,Wo=e=>xe(N.extname(e).slice(1)),Go=/* @__PURE__ */ new Set([`docs.json`,`mint.json`,`.mintignore`]),Ko=(e,t)=>`${e} ${t}${e===1?``:`s`}`,qo=({rule:e,message:t})=>`${e}:${t}`,Jo=new Set(No.map(({id:e})=>e)),Yo=e=>e.filter(({rule:e})=>Jo.has(e)),Xo=(e,t)=>{let n=/* @__PURE__ */ new Map;for(let t of e)n.set(qo(t),(n.get(qo(t))??0)+1);return t.filter(e=>{let t=n.get(qo(e))??0;return n.set(qo(e),t-1),t<=0})},Zo=e=>{let t=e.line?`:${e.line}${e.column?`:${e.column}`:``}`:``;return`${e.file}${t} ${e.rule} ${e.message}`},Qo=e=>[...e].sort((e,t)=>(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0)),$o=e=>{let t=/* @__PURE__ */ new Map;for(let n of e)t.set(n.file,[...t.get(n.file)??[],n]);return t},es=(e,t,n)=>n===void 0?``:Fi(t,oe(n,N.join(e,t))),ts=e=>{let t=/* @__PURE__ */ new Map;return{read:n=>{if(!t.has(n))try{t.set(n,ct(N.join(e,n),`utf-8`))}catch{t.set(n,void 0)}return t.get(n)},forget:e=>t.delete(e)}},ns=(e,...t)=>$(void 0,[e,...t],void 0,function*(e,{reportDir:t}={}){let r=Ho(e,t),a,o=ts(e),s=/* @__PURE__ */ new Map,c,f,h=Promise.resolve(),g=/* @__PURE__ */ new Map,_=/* @__PURE__ */ new Map,v=()=>[...s.values()].flat(),y=()=>$(void 0,void 0,void 0,function*(){let e=v(),t={version:1,updatedAt:(/* @__PURE__ */ new Date()).toISOString(),summary:{warnings:e.length,files:s.size,fixable:e.filter(({fix:e})=>e).length},diagnostics:e};yield ft.mkdir(N.dirname(r),{recursive:!0});let n=`${r}.${process.pid}.tmp`;yield ft.writeFile(n,`${JSON.stringify(t,null,2)}\n`),yield ft.rename(n,r)}),b=()=>{let e=v().length,t=e===0?void 0:(0,vn.jsx)(i,{message:`${Ko(e,`component usage warning`)} in ${Ko(s.size,`file`)}. Run \`mint validate\` to list them, or read ${r}.`});f&&t?u(f,t):t?p(t):f&&n(f),f=t},x=e=>{h=h.then(e).catch(()=>void 0)},ee=(e,t)=>{clearTimeout(g.get(e)),g.set(e,setTimeout(()=>{g.delete(e),x(t)},150))},te=()=>$(void 0,void 0,void 0,function*(){let t=ts(e),n=yield Bo(e,{localSchema:!1});return{site:Object.assign(Object.assign({},n),{read:t.read}),reader:t}}),S=(e,t)=>$(void 0,void 0,void 0,function*(){let n=s.get(t)??[],r=e.files.some(e=>e.file===t)?Qo(Yo(yield Zi(Object.assign(Object.assign({},e),{selected:/* @__PURE__ */ new Set([t])}),No))):[];return r.length>0?s.set(t,r):s.delete(t),Xo(n,r)}),C=e=>new Map(e.files.map(({file:e,kind:t})=>[e,t])),w=t=>$(void 0,void 0,void 0,function*(){if(!a)return;let n=!1;for(let[r,i]of t){o.forget(r),es(e,r,o.read(r))!==(a.imports?.get(r)??``)&&(n=!0);let t=Uo.test(r)&&!a.files.some(e=>e.file===r);(i||t)&&(n=!0)}let r=new Set([...t.keys()].filter(e=>Uo.test(e)));if(n){let e=C(a),n;try{n=yield te()}catch(e){for(let[e,n]of t)_.set(e,(_.get(e)??!1)||n);throw e}a=n.site,o=n.reader;for(let[t,n]of C(a))e.get(t)!==n&&r.add(t);for(let t of e.keys())a.files.some(e=>e.file===t)||r.add(t)}let s=a,c=(yield Promise.all([...r].map(e=>S(s,e)))).flat();for(let e of c.slice(0,5))l((0,vn.jsx)(i,{message:Zo(e)}));c.length>5&&l((0,vn.jsx)(i,{message:`${Ko(c.length-5,`more component usage warning`)}`})),b(),yield y()}),T=()=>{let e=new Map(_);return _.clear(),w(e)},E=()=>$(void 0,void 0,void 0,function*(){if(zo(e)!==2){yield c?.close(),c=void 0,a=void 0,s=/* @__PURE__ */ new Map,b(),yield ft.rm(r,{force:!0});return}let t=yield he(e),n=yield tt(e,{ignored:d(e,t),onEvent:(t,n)=>{let r=N.relative(e,n).split(N.sep).join(`/`);Wo(r)&&(_.set(r,(_.get(r)??!1)||t!==`change`),ee(`files`,T))},onError:()=>void 0}),i;try{i=yield te()}catch(e){throw yield n.close(),e}yield c?.close(),c=n,a=i.site,o=i.reader,s=$o(Qo(Yo(yield Zi(a,No)))),b(),yield y()}),D=m(()=>{f&&p(f)}),ne=lt(e,(e,t)=>{t&&Go.has(String(t))&&ee(`config`,E)});return ne.on(`error`,()=>void 0),x(E),yield h,{close:()=>$(void 0,void 0,void 0,function*(){ne.close(),D();for(let e of g.values())clearTimeout(e);yield h,yield c?.close()})}});export{Ln as S,H as _,No as a,Br as b,Wi as c,oi as d,Ai as f,xi as g,bi as h,Bo as i,ji as l,pi as m,Ho as n,Pa as o,mi as p,ns as r,Zi as s,Vo as t,Si as u,ei as v,hr as x,Jr as y};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { createRequire as __mintCreateRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __mintFileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __mintDirname } from 'node:path';
|
|
4
|
-
const require = __mintCreateRequire(import.meta.url);
|
|
5
|
-
const __filename = __mintFileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __mintDirname(__filename);
|
|
7
|
-
import{i as e,o as t}from"./rolldown-runtime-CEAe2Uac.js";import{t as n}from"./multi-repo-config-BgQ6B20D.js";import{basename as r,dirname as i,extname as a,normalize as o,relative as s,resolve as c}from"path";import{fileURLToPath as l}from"url";import{readFileSync as u,readdirSync as d,statSync as f,writeFile as p}from"fs";import{format as m,inspect as h}from"util";import{notStrictEqual as g,strictEqual as ee}from"assert";import _ from"node:os";import te from"node:path";const v={right:b,center:x};var ne=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(`
|
|
8
|
-
`).map(e=>e.split(` `)),n=0;return t.forEach(e=>{e.length>1&&S.stringWidth(e[0])>n&&(n=Math.min(Math.floor(this.width*.5),S.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=S.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(`
|
|
9
|
-
`)}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>S.stringWidth(n)&&(c+=` `.repeat(s-S.stringWidth(n))),e[a].align&&e[a].align!==`left`&&this.wrap){let t=v[e[a].align];c=t(c,s),S.stringWidth(c)<s&&(c+=` `.repeat((o||0)-S.stringWidth(c)-1))}let l=e[a].padding||[0,0,0,0];l[3]&&(i+=` `.repeat(l[3])),i+=re(e[a],c,`| `),i+=c,i+=re(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=S.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?S.wrap(e.text,this.negatePadding(e),{hard:!0}).split(`
|
|
10
|
-
`):e.text.split(`
|
|
11
|
-
`),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||S.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,ie(e[n])):t)}};function re(e,t,n){return e.border?/[.']-+[.']/.test(t)?``:t.trim().length===0?` `:n:``}function ie(e){let t=e.padding||[],n=1+(t[3]||0)+(t[1]||0);return e.border?n+4:n}function y(){return typeof process==`object`&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function b(e,t){e=e.trim();let n=S.stringWidth(e);return n<t?` `.repeat(t-n)+e:e}function x(e,t){e=e.trim();let n=S.stringWidth(e);return n>=t?e:` `.repeat(t-n>>1)+e}let S;function C(e,t){return S=t,new ne({width:e?.width||y(),wrap:e?.wrap})}const ae=/* @__PURE__ */ RegExp(`\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)`,`g`);function oe(e){return e.replace(ae,``)}function se(e,t){let[n,r]=e.match(ae)||[``,``];e=oe(e);let i=``;for(let n=0;n<e.length;n++)n!==0&&n%t===0&&(i+=`
|
|
12
|
-
`),i+=e.charAt(n);return n&&r&&(i=`${n}${i}${r}`),i}function ce(e){return C(e,{stringWidth:e=>[...e].length,stripAnsi:oe,wrap:se})}function le(e,t){let n=c(`.`,e),r;for(f(n).isDirectory()||(n=i(n));;){if(r=t(n,d(n)),r)return c(n,r);if(n=i(r=n),r===n)break}}
|
|
13
|
-
/**
|
|
14
|
-
* @license
|
|
15
|
-
* Copyright (c) 2016, Contributors
|
|
16
|
-
* SPDX-License-Identifier: ISC
|
|
17
|
-
*/
|
|
18
|
-
function ue(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 de(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);r+=a!==o&&i>0?`${t}${n.charAt(i)}`:o}return r}function fe(e){return e==null?!1:typeof e==`number`||/^0x[0-9a-f]+$/i.test(e)?!0:!/^0[^.]/.test(e)&&/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}
|
|
19
|
-
/**
|
|
20
|
-
* @license
|
|
21
|
-
* Copyright (c) 2016, Contributors
|
|
22
|
-
* SPDX-License-Identifier: ISC
|
|
23
|
-
*/
|
|
24
|
-
function pe(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++)n=r,r=e.charAt(o),r===` `&&!i?n!==` `&&t++:(r===i?i=null:r!==`'`&&r!==`"`||i||(i=r),a[t]||(a[t]=``),a[t]+=r);return a}
|
|
25
|
-
/**
|
|
26
|
-
* @license
|
|
27
|
-
* Copyright (c) 2016, Contributors
|
|
28
|
-
* SPDX-License-Identifier: ISC
|
|
29
|
-
*/
|
|
30
|
-
var w;(function(e){e.BOOLEAN=`boolean`,e.STRING=`string`,e.NUMBER=`number`,e.ARRAY=`array`})(w||={});
|
|
31
|
-
/**
|
|
32
|
-
* @license
|
|
33
|
-
* Copyright (c) 2016, Contributors
|
|
34
|
-
* SPDX-License-Identifier: ISC
|
|
35
|
-
*/
|
|
36
|
-
let T;var me=class{constructor(e){T=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=pe(e),i=typeof e==`string`,a=he(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.__||T.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)})),Se(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;ke();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)&&Te(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&&(E(c[1],h.arrays)?e=y(e,c[1],r,c[2]):E(c[1],h.nargs)===!1?b(c[1],c[2],!0):e=ie(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],b(a,E(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],E(a,h.arrays)?e=y(e,a,r):E(a,h.nargs)===!1?(l=r[e+1],l!==void 0&&(!l.match(/^-/)||l.match(g))&&!E(a,h.bools)&&!E(a,h.counts)||/^(true|false)$/.test(l)?(b(a,l),e++):b(a,O(a))):e=ie(e,a,r));else if(t.match(/^-.\..+=/))c=t.match(/^-([^=]+)=([\s\S]*)$/),c!==null&&Array.isArray(c)&&c.length>=3&&b(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(/^-/)&&!E(a,h.bools)&&!E(a,h.counts)?(b(a,l),e++):b(a,O(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],E(a,h.arrays)?e=y(e,a,r,u):E(a,h.nargs)===!1?b(a,u):e=ie(e,a,r,u),i=!0;break}if(l===`-`)b(s[n],l);else{if(/[A-Za-z]/.test(s[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&E(l,h.bools)===!1||s[n+1]&&s[n+1].match(/\W/)){b(s[n],l),i=!0;break}b(s[n],O(s[n]))}}a=t.slice(-1)[0],!i&&a!==`-`&&(E(a,h.arrays)?e=y(e,a,r):E(a,h.nargs)===!1?(l=r[e+1],l!==void 0&&(!/^(-|--)[^-]/.test(l)||l.match(g))&&!E(a,h.bools)&&!E(a,h.counts)||/^(true|false)$/.test(l)?(b(a,l),e++):b(a,O(a))):e=ie(e,a,r))}else if(t.match(/^-[0-9]$/)&&t.match(g)&&E(t.slice(1),h.bools))a=t.slice(1),b(a,O(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(),ye(v,h.aliases,s,!0),le(v),o[`set-placeholder-key`]&&me(v),Object.keys(h.counts).forEach(function(e){be(v,e.split(`.`))||b(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=>ue(e)).join(`.`)],delete v[e]});function re(e){let t=C(`_`,e);(typeof t==`string`||typeof t==`number`)&&v._.push(t)}function ie(e,t,n,r){let i,a=E(t,h.nargs);if(a=typeof a!=`number`||isNaN(a)?1:a,a===0)return k(r)||(_=Error(m(`Argument unexpected for: %s`,t))),b(t,O(t)),e;let s=+!k(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)||Te(n[i]));i++)s++;s<a&&(_=Error(m(`Not enough arguments following: %s`,t)))}let c=Math.min(s,a);for(!k(r)&&c>0&&(b(t,r),c--),i=e+1;i<c+e+1;i++)b(t,n[i]);return e+c}function y(e,t,n,r){let a=[],c=r||n[e+1],l=E(t,h.nargs);if(E(t,h.bools)&&!/^(true|false)$/.test(c))a.push(!0);else if(k(c)||k(r)&&/^-/.test(c)&&!g.test(c)&&!Te(c)){if(s[t]!==void 0){let e=s[t];a=Array.isArray(e)?e:[e]}}else{k(r)||a.push(S(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)&&!Te(c)));r++)e=r,a.push(S(t,c,i))}return typeof l==`number`&&(l&&a.length<l||isNaN(l)&&a.length===0)&&(_=Error(m(`Not enough arguments following: %s`,t))),b(t,a),e}function b(e,t,n=i){/-/.test(e)&&o[`camel-case-expansion`]&&x(e,e.split(`.`).map(function(e){return ue(e)}).join(`.`));let r=S(e,t,n),a=e.split(`.`);xe(v,a,r),h.aliases[e]&&h.aliases[e].forEach(function(e){let t=e.split(`.`);xe(v,t,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(`.`))||xe(v,n,r)}),E(e,h.normalize)&&!E(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`?T.normalize(e):e}})})}function x(e,t){h.aliases[e]&&h.aliases[e].length||(h.aliases[e]=[t],f[t]=!0),h.aliases[t]&&h.aliases[t].length||x(t,e)}function S(e,t,n){n&&(t=ve(t)),(E(e,h.bools)||E(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 E(e,h.counts)&&(k(r)||typeof r==`boolean`)&&(r=ge()),E(e,h.normalize)&&E(e,h.arrays)&&(r=Array.isArray(t)?t.map(e=>T.normalize(e)):T.normalize(t)),r}function C(e,t){return!o[`parse-positional-numbers`]&&e===`_`||!E(e,h.strings)&&!E(e,h.bools)&&!Array.isArray(t)&&(fe(t)&&o[`parse-numbers`]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))||!k(t)&&E(e,h.numbers))&&(t=Number(t)),t}function ae(e){let t=Object.create(null);ye(t,h.aliases,s),Object.keys(h.configs).forEach(function(n){let r=e[n]||t[n];if(r)try{let e=null,t=T.resolve(T.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=T.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):(!be(v,i.split(`.`))||E(i,h.arrays)&&o[`combine-arrays`])&&b(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=T.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)),ue(e)});(t&&h.configs[a.join(`.`)]||!t)&&!be(e,a)&&b(a.join(`.`),r[i])}})}function le(e){let t,n=/* @__PURE__ */ new Set;Object.keys(e).forEach(function(r){if(!n.has(r)&&(t=E(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 me(e){return h.keys.forEach(t=>{~t.indexOf(`.`)||e[t]===void 0&&(e[t]=void 0)}),e}function ye(e,t,n,r=!1){Object.keys(n).forEach(function(i){be(e,i.split(`.`))||(xe(e,i.split(`.`),n[i]),r&&(p[i]=!0),(t[i]||[]).forEach(function(t){be(e,t.split(`.`))||xe(e,t.split(`.`),n[i])}))})}function be(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}function xe(e,t,n){let r=e;o[`dot-notation`]||(t=[t.join(`.`)]),t.slice(0,-1).forEach(function(e){e=_e(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=_e(t[t.length-1]),a=E(t.join(`.`),h.arrays),s=Array.isArray(n),c=o[`duplicate-arguments-array`];!c&&E(i,h.nargs)&&(c=!0,(!k(r[i])&&h.nargs[i]===1||Array.isArray(r[i])&&r[i].length===h.nargs[i])&&(r[i]=void 0)),n===ge()?r[i]=ge(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||E(i,h.counts)||E(i,h.bools))?r[i]=[r[i],n]:r[i]=n}function Se(...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=ue(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=de(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 E(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 Ce(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 D(e,...t){return[].concat(...t).some(function(t){let n=e.match(t);return n&&Ce(n[1])})}function we(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),!Ce(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 Te(e){return o[`unknown-options-as-args`]&&Ee(e)}function Ee(e){return e=e.replace(/^-{3,}/,`--`),e.match(g)||we(e)?!1:!D(e,/^-+([^=]+?)=[\s\S]*$/,ee,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function O(e){return!E(e,h.bools)&&!E(e,h.counts)&&`${e}`in s?s[e]:De(Oe(e))}function De(e){return{[w.BOOLEAN]:!0,[w.STRING]:``,[w.NUMBER]:void 0,[w.ARRAY]:[]}[e]}function Oe(e){let t=w.BOOLEAN;return E(e,h.strings)?t=w.STRING:E(e,h.numbers)?t=w.NUMBER:E(e,h.bools)?t=w.BOOLEAN:E(e,h.arrays)&&(t=w.ARRAY),t}function k(e){return e===void 0}function ke(){Object.keys(h.counts).find(e=>E(e,h.arrays)?(_=Error(m(`Invalid configuration: %s, opts.count excludes opts.array.`,e)),!0):E(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 he(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 ge(e){return e===void 0?1:e+1}function _e(e){return e===`__proto__`?`___proto___`:e}function ve(e){return typeof e==`string`&&(e[0]===`'`||e[0]===`"`)&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}
|
|
37
|
-
/**
|
|
38
|
-
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
|
|
39
|
-
* CJS and ESM environments.
|
|
40
|
-
*
|
|
41
|
-
* @license
|
|
42
|
-
* Copyright (c) 2016, Contributors
|
|
43
|
-
* SPDX-License-Identifier: ISC
|
|
44
|
-
*/
|
|
45
|
-
const ye=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,be=(process==null?void 0:process.versions)?.node??(process==null?void 0:process.version)?.slice(1);if(be&&Number(be.match(/^([^.]+)/)[1])<ye)throw Error(`yargs parser supports a minimum Node.js version of ${ye}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const xe=process?process.env:{},Se=new me({cwd:process.cwd,env:()=>xe,format:m,normalize:o,resolve:c,require:t=>{if(e!==void 0)return e(t);if(t.match(/\.json$/))return JSON.parse(u(t,`utf8`));throw Error(`only .json config files are supported in ESM`)}}),E=function(e,t){return Se.parse(e.slice(),t).argv};E.detailed=function(e,t){return Se.parse(e.slice(),t)},E.camelCase=ue,E.decamelize=de,E.looksLikeNumber=fe;var Ce={fs:{readFileSync:u,writeFile:p},format:m,resolve:c,exists:e=>{try{return f(e).isFile()}catch{return!1}}};let D;var we=class{constructor(e){e||={},this.directory=e.directory||`./locales`,this.updateFiles=typeof e.updateFiles!=`boolean`||e.updateFiles,this.locale=e.locale||`en`,this.fallbackToLanguage=typeof e.fallbackToLanguage!=`boolean`||e.fallbackToLanguage,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(),D.format.apply(D.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),D.format.apply(D.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);D.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{D.fs.readFileSync&&(e=JSON.parse(D.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=D.resolve(e,`./`,t+`.json`);if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf(`_`)){let r=D.resolve(e,`./`,t.split(`_`)[0]+`.json`);this._fileExistsSync(r)&&(n=r)}return n}_fileExistsSync(e){return D.exists(e)}};function Te(e,t){D=t;let n=new we(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 Ee=e=>Te(e,Ce);function O(){return+!De()}function De(){return Oe()&&!process.defaultApp}function Oe(){return!!process.versions.electron}function k(e){return e.slice(O()+1)}function ke(){return process.argv[O()]}var A=class e extends Error{constructor(t){super(t||`yargs error`),this.name=`YError`,Error.captureStackTrace&&Error.captureStackTrace(this,e)}};const Ae=`loading a directory of commands is not supported yet for ESM`;let je;try{je=l(import.meta.url)}catch{je=process.cwd()}const Me=je.substring(0,je.lastIndexOf(`node_modules`));var Ne={assert:{notStrictEqual:g,strictEqual:ee},cliui:ce,findUp:le,getEnv:e=>process.env[e],inspect:h,getCallerFile:()=>{throw new A(Ae)},getProcessArgvBin:ke,mainFilename:Me||process.cwd(),Parser:E,path:{basename:r,dirname:i,extname:a,relative:s,resolve:c},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:process.stdout.columns===void 0?null:process.stdout.columns},readFileSync:u,require:()=>{throw new A(`require is not supported by ESM`)},requireDirectory:()=>{throw new A(Ae)},stringWidth:e=>[...e].length,y18n:Ee({directory:c(je,`../assets/yargs-locales`),updateFiles:!1})};function j(e,t,n,r){n.assert.notStrictEqual(e,t,r)}function Pe(e,t){t.assert.strictEqual(typeof e,`string`)}function Fe(e){return Object.keys(e)}function M(e){return!!e&&!!e.then&&typeof e.then==`function`}function Ie(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 Le=[`first`,`second`,`third`,`fourth`,`fifth`,`sixth`];function N(e,t,n){function r(){return typeof e==`object`?[{demanded:[],optional:[]},e,t]:[Ie(`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 A(`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 A(`Too many arguments provided. Expected max ${s} but received ${o}.`);t.demanded.forEach(t=>{let n=Re(a.shift());t.cmd.filter(e=>e===n||e===`*`).length===0&&ze(n,t.cmd,e),e+=1}),t.optional.forEach(t=>{if(a.length===0)return;let n=Re(a.shift());t.cmd.filter(e=>e===n||e===`*`).length===0&&ze(n,t.cmd,e),e+=1})}catch(e){console.warn(e.stack)}}function Re(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e}function ze(e,t,n){throw new A(`Invalid ${Le[n]||`manyith`} argument. Expected ${t.join(` or `)} but received ${e}.`)}var Be=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0,r=!1){if(N(`<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)}),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 Ve(e){return e?e.map(e=>(e.applyBeforeValidation=!1,e)):[]}function He(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 Ue(e,t,n=e=>{throw e}){try{let n=We(e)?e():e;return M(n)?n.then(e=>t(e)):t(n)}catch(e){return n(e)}}function We(e){return typeof e==`function`}function Ge(t){if(e===void 0)return null;for(let n=0,r=Object.keys(e.cache),i;n<r.length;n++)if(i=e.cache[r[n]],i.exports===t)return i;return null}const Ke=/(^\*)|(^\$0)/;var qe=class{constructor(e,t,n,r){this.requireCache=/* @__PURE__ */ 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||={},typeof r.recurse!=`boolean`&&(r.recurse=!1),Array.isArray(r.extensions)||(r.extensions=[`js`]);let i=typeof r.visit==`function`?r.visit:e=>e;r.visit=(e,t,n)=>{let r=i(e,t,n);if(r){if(this.requireCache.has(t))return r;this.requireCache.add(t),this.addHandler(r)}return r},this.shim.requireDirectory({require:t,filename:n},e,r)}addHandler(e,t,n,r,i,a){let o=[],s=Ve(i);if(r||=(()=>{}),Array.isArray(e)){if(Xe(e))[e,...o]=e;else for(let t of e)this.addHandler(t)}else if($e(e)){let t=Array.isArray(e.command)||typeof e.command==`string`?e.command:this.moduleName(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(Ye(n)){this.addHandler([e].concat(o),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e==`string`){let i=Ie(e);o=o.map(e=>Ie(e).cmd);let c=!1,l=[i.cmd].concat(o).filter(e=>!Ke.test(e)||(c=!0,!1));l.length===0&&c&&l.push(`$0`),c&&(i.cmd=l[0],o=l.slice(1),e=e.replace(Ke,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(Ze(c)){n.getInternalMethods().getUsageInstance().freeze();let u=c(n.getInternalMethods().reset(r),s);if(M(u))return u.then(r=>(l=Cn(r)?r:n,this.parseAndUpdateUsage(e,t,l,i,a,o)))}else Qe(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=Ke.test(t.original)?t.original.replace(Ke,``).trim():t.original,r=e.filter(e=>!Ke.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=Ue(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=He(n,a,o,!1),n=Ue(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=He(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=Ie(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]),e[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]))?[].concat(e[i],s.argv[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=Ke.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(Ze(t))return t(e,!0);Ye(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){let t=Ge(e);if(!t)throw Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(t.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}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=/* @__PURE__ */ new Set,this}};function Je(e,t,n,r){return new qe(e,t,n,r)}function Ye(e){return typeof e==`object`&&!!e.builder&&typeof e.handler==`function`}function Xe(e){return e.every(e=>typeof e==`string`)}function Ze(e){return typeof e==`function`}function Qe(e){return typeof e==`object`}function $e(e){return typeof e==`object`&&!Array.isArray(e)}function et(e={},t=()=>!0){let n={};return Fe(e).forEach(r=>{t(r,e[r])&&(n[r]=e[r])}),n}function tt(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 nt(e){return typeof e==`boolean`}function rt(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(nt(a)){if(n)throw n;if(t)throw Error(t)}else a(t,n,r)}else{if(e.getExitProcess()&&tt(!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 A(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=y(),!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 y=r.getWrap(),b=t.cliui({width:y,wrap:!!y});if(!u){if(l.length)l.forEach(e=>{b.div({text:`${e[0].replace(/\$0/g,i)}`}),e[1]&&b.div({text:`${e[1]}`,padding:[1,0,0,0]})}),b.div();else if(f.length){let e=null;e=o._?`${i} <${n(`command`)}>\n`:`${i} [${n(`command`)}]\n`,b.div(`${e}`)}}if(f.length>1||f.length===1&&!f[0][2]){b.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 ?/,``)}`;b.span({text:t,padding:[0,2,0,2],width:_(f,y,`${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?b.div({text:o.join(` `),padding:[0,0,0,2],align:`right`}):b.div()}),b.div()}let x=(Object.keys(h.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);g=g.filter(t=>!e.parsed.newAliases[t]&&x.every(e=>(h.alias[e]||[]).indexOf(t)===-1));let S=n(`Options:`);c[S]||(c[S]=[]),ne(g,h.alias,c,S);let C=e=>/^--/.test(st(e)),ae=Object.keys(c).filter(e=>c[e].length>0).map(e=>({groupName:e,normalizedKeys:c[e].filter(re).map(e=>{if(x.includes(e))return e;for(let t=0,n;(n=x[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]=at(t[e],4))})}),ae.forEach(({groupName:t,normalizedKeys:i,switches:o})=>{b.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,ie(h.default[t],h.defaultDescription[t])].filter(Boolean).join(` `);b.span({text:st(i),padding:[0,2,0,2+ot(i)],width:_(o,y)+4},c);let d=e.getInternalMethods().getUsageConfiguration()[`hide-types`]===!0;u&&!d?b.div({text:u,padding:[0,0,0,2],align:`right`}):b.div()}),b.div()}),d.length&&(b.div(n(`Examples:`)),d.forEach(e=>{e[0]=e[0].replace(/\$0/g,i)}),d.forEach(e=>{e[1]===``?b.div({text:e[0],padding:[0,2,0,2]}):b.div({text:e[0],padding:[0,2,0,2],width:_(d,y)+4},{text:e[1]})}),b.div()),m.length>0){let e=m.map(e=>e.replace(/\$0/g,i)).join(`
|
|
46
|
-
`);b.div(`${e}\n`)}return b.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} ${st(e[0])}`:st(e[0]))+ot(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 ie(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 y(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let b=null;r.version=e=>{b=e},r.showVersion=t=>{let n=e.getInternalMethods().getLoggerInstance();t||=`error`,(typeof t==`function`?t:n[t])(b)},r.reset=function(e){return a=null,c=!1,l=[],u=!1,m=[],d=[],f=[],p=et(p,t=>!e[t]),r};let x=[];return r.freeze=function(){x.push({failMessage:a,failureOutput:c,usages:l,usageDisabled:u,epilogs:m,examples:d,commands:f,descriptions:p})},r.unfreeze=function(e=!1){let t=x.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 it(e){return typeof e==`object`}function at(e,t){return it(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function ot(e){return it(e)?e.indentation:0}function st(e){return it(e)?e.text:e}var ct=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(Ze(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=Ie(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]&&this.completeOptionKey(`no-${a}`,e,r))})}}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){let r=this.usage.getDescriptions(),i=!(e=>/^--/.test(e))(n)&&(e=>/^[^0-9]$/.test(e))(e)?`-`:`--`;if(!this.zshShell)t.push(i+e);else{let n=(this===null||this===void 0?void 0:this.aliases)?.[e].find(e=>{let t=r[e];return typeof t==`string`&&t.length>0}),a=n?r[n]:void 0,o=r[e]??a??``;t.push(i+`${e.replace(/:/g,`\\:`)}:${o.replace(`__yargsString__:`,``).replace(/(\r\n|\n|\r)/gm,` `)}`)}}customCompletion(e,t,n,r){if(j(this.customCompletionFunction,null,this.shim),ut(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)}return dt(this.customCompletionFunction)?this.customCompletionFunction(n,t,(i=r)=>this.defaultCompletion(e,t,n,i),e=>{r(null,e)}):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}}
|
|
47
|
-
###-begin-{{app_name}}-completions-###
|
|
48
|
-
#
|
|
49
|
-
# yargs command completion script
|
|
50
|
-
#
|
|
51
|
-
# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
|
|
52
|
-
# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
|
|
53
|
-
#
|
|
54
|
-
_{{app_name}}_yargs_completions()
|
|
55
|
-
{
|
|
56
|
-
local reply
|
|
57
|
-
local si=$IFS
|
|
58
|
-
IFS=$'
|
|
59
|
-
' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
|
|
60
|
-
IFS=$si
|
|
61
|
-
_describe 'values' reply
|
|
62
|
-
}
|
|
63
|
-
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
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
|
-
type_list=$({{app_path}} --get-yargs-completions "\${args[@]}")
|
|
81
|
-
|
|
82
|
-
COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) )
|
|
83
|
-
|
|
84
|
-
# if no match was found, fall back to filename completion
|
|
85
|
-
if [ \${#COMPREPLY[@]} -eq 0 ]; then
|
|
86
|
-
COMPREPLY=()
|
|
87
|
-
fi
|
|
88
|
-
|
|
89
|
-
return 0
|
|
90
|
-
}
|
|
91
|
-
complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
|
|
92
|
-
###-end-{{app_name}}-completions-###
|
|
93
|
-
`,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 lt(e,t,n,r){return new ct(e,t,n,r)}function ut(e){return e.length<3}function dt(e){return e.length>3}function ft(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[],r=0;for(;r<=t.length;r++)n[r]=[r];let i=0;for(;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 pt=[`$0`,`--`,`_`];function mt(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(`
|
|
94
|
-
`)}`:``;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=>{pt.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)},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=>{pt.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){N(`<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){N(`<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=ft(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=et(o,t=>!e[t]),c=et(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 ht=[],gt;function _t(t,n,r,i){gt=i;let a={};if(Object.prototype.hasOwnProperty.call(t,`extends`)){if(typeof t.extends!=`string`)return a;let i=/\.json|\..*rc$/.test(t.extends),o=null;if(i)o=yt(n,t.extends);else try{o=e.resolve(t.extends)}catch{return t}vt(o),ht.push(o),a=i?JSON.parse(gt.readFileSync(o,`utf8`)):e(t.extends),delete t.extends,a=_t(a,gt.path.dirname(o),r,gt)}return ht=[],r?bt(a,t):Object.assign({},a,t)}function vt(e){if(ht.indexOf(e)>-1)throw new A(`Circular extended configurations: '${e}'.`)}function yt(e,t){return gt.path.resolve(e,t)}function bt(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))n[i]=r(t[i])&&r(n[i])?bt(e[i],t[i]):t[i];return n}var P=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},F=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)},I,xt,St,L,R,Ct,z,wt,Tt,B,Et,V,H,U,W,Dt,Ot,G,K,kt,At,q,jt,Mt,Nt,J,Pt,Y,Ft,It,Lt,X,Rt,Z,Q;function zt(e){return(t=[],n=e.process.cwd(),r)=>{let i=new Sn(t,n,r,e);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}const Bt=Symbol(`copyDoubleDash`),Vt=Symbol(`copyDoubleDash`),Ht=Symbol(`deleteFromParserHintObject`),Ut=Symbol(`emitWarning`),Wt=Symbol(`freeze`),Gt=Symbol(`getDollarZero`),Kt=Symbol(`getParserConfiguration`),qt=Symbol(`getUsageConfiguration`),Jt=Symbol(`guessLocale`),Yt=Symbol(`guessVersion`),Xt=Symbol(`parsePositionalNumbers`),Zt=Symbol(`pkgUp`),$=Symbol(`populateParserHintArray`),Qt=Symbol(`populateParserHintSingleValueDictionary`),$t=Symbol(`populateParserHintArrayDictionary`),en=Symbol(`populateParserHintDictionary`),tn=Symbol(`sanitizeKey`),nn=Symbol(`setKey`),rn=Symbol(`unfreeze`),an=Symbol(`validateAsync`),on=Symbol(`getCommandInstance`),sn=Symbol(`getContext`),cn=Symbol(`getHasOutput`),ln=Symbol(`getLoggerInstance`),un=Symbol(`getParseContext`),dn=Symbol(`getUsageInstance`),fn=Symbol(`getValidationInstance`),pn=Symbol(`hasParseCallback`),mn=Symbol(`isGlobalContext`),hn=Symbol(`postProcess`),gn=Symbol(`rebase`),_n=Symbol(`reset`),vn=Symbol(`runYargsParserAndExecuteCommands`),yn=Symbol(`runValidation`),bn=Symbol(`setHasOutput`),xn=Symbol(`kTrackManuallySetKeys`);var Sn=class{constructor(e=[],t,n,r){this.customScriptName=!1,this.parsed=!1,I.set(this,void 0),xt.set(this,void 0),St.set(this,{commands:[],fullCommands:[]}),L.set(this,null),R.set(this,null),Ct.set(this,`show-hidden`),z.set(this,null),wt.set(this,!0),Tt.set(this,{}),B.set(this,!0),Et.set(this,[]),V.set(this,void 0),H.set(this,{}),U.set(this,!1),W.set(this,null),Dt.set(this,!0),Ot.set(this,void 0),G.set(this,``),K.set(this,void 0),kt.set(this,void 0),At.set(this,{}),q.set(this,null),jt.set(this,null),Mt.set(this,{}),Nt.set(this,{}),J.set(this,void 0),Pt.set(this,!1),Y.set(this,void 0),Ft.set(this,!1),It.set(this,!1),Lt.set(this,!1),X.set(this,void 0),Rt.set(this,{}),Z.set(this,null),Q.set(this,void 0),P(this,Y,r,`f`),P(this,J,e,`f`),P(this,xt,t,`f`),P(this,kt,n,`f`),P(this,V,new Be(this),`f`),this.$0=this[Gt](),this[_n](),P(this,I,F(this,I,`f`),`f`),P(this,X,F(this,X,`f`),`f`),P(this,Q,F(this,Q,`f`),`f`),P(this,K,F(this,K,`f`),`f`),F(this,K,`f`).showHiddenOpt=F(this,Ct,`f`),P(this,Ot,this[Vt](),`f`)}addHelpOpt(e,t){return N(`[string|boolean] [string]`,[e,t],arguments.length),F(this,W,`f`)&&(this[Ht](F(this,W,`f`)),P(this,W,null,`f`)),e===!1&&t===void 0||(P(this,W,typeof e==`string`?e:`help`,`f`),this.boolean(F(this,W,`f`)),this.describe(F(this,W,`f`),t||F(this,X,`f`).deferY18nLookup(`Show help`))),this}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(N(`[string|boolean] [string]`,[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e==`string`?e:F(this,Ct,`f`);return this.boolean(n),this.describe(n,t||F(this,X,`f`).deferY18nLookup(`Show hidden options`)),F(this,K,`f`).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return N(`<object|string|array> [string|array]`,[e,t],arguments.length),this[$t](this.alias.bind(this),`alias`,e,t),this}array(e){return N(`<array|string>`,[e],arguments.length),this[$](`array`,e),this[xn](e),this}boolean(e){return N(`<array|string>`,[e],arguments.length),this[$](`boolean`,e),this[xn](e),this}check(e,t){return N(`<function> [boolean]`,[e,t],arguments.length),this.middleware((t,n)=>Ue(()=>e(t,n.getOptions()),n=>(n?(typeof n==`string`||n instanceof Error)&&F(this,X,`f`).fail(n.toString(),n):F(this,X,`f`).fail(F(this,Y,`f`).y18n.__(`Argument check failed: %s`,e.toString())),t),e=>(F(this,X,`f`).fail(e.message?e.message:e.toString(),e),t)),!1,t),this}choices(e,t){return N(`<object|string|array> [string|array]`,[e,t],arguments.length),this[$t](this.choices.bind(this),`choices`,e,t),this}coerce(e,t){if(N(`<object|string|array> [function]`,[e,t],arguments.length),Array.isArray(e)){if(!t)throw new A(`coerce callback must be provided`);for(let n of e)this.coerce(n,t);return this}if(typeof e==`object`){for(let t of Object.keys(e))this.coerce(t,e[t]);return this}if(!t)throw new A(`coerce callback must be provided`);return F(this,K,`f`).key[e]=!0,F(this,V,`f`).addCoerceMiddleware((n,r)=>{let i;return Object.prototype.hasOwnProperty.call(n,e)?Ue(()=>(i=r.getAliases(),t(n[e])),t=>{n[e]=t;let a=r.getInternalMethods().getParserConfiguration()[`strip-aliased`];if(i[e]&&a!==!0)for(let r of i[e])n[r]=t;return n},e=>{throw new A(e.message)}):n},e),this}conflicts(e,t){return N(`<string|object> [string|array]`,[e,t],arguments.length),F(this,Q,`f`).conflicts(e,t),this}config(e=`config`,t,n){return N(`[object|string] [string|function] [function]`,[e,t,n],arguments.length),typeof e==`object`&&!Array.isArray(e)?(e=_t(e,F(this,xt,`f`),this[Kt]()[`deep-merge-config`]||!1,F(this,Y,`f`)),F(this,K,`f`).configObjects=(F(this,K,`f`).configObjects||[]).concat(e),this):(typeof t==`function`&&(n=t,t=void 0),this.describe(e,t||F(this,X,`f`).deferY18nLookup(`Path to JSON config file`)),(Array.isArray(e)?e:[e]).forEach(e=>{F(this,K,`f`).config[e]=n||!0}),this)}completion(e,t,n){return N(`[string] [string|boolean|function] [function]`,[e,t,n],arguments.length),typeof t==`function`&&(n=t,t=void 0),P(this,R,e||F(this,R,`f`)||`completion`,`f`),!t&&t!==!1&&(t=`generate completion script`),this.command(F(this,R,`f`),t),n&&F(this,L,`f`).registerFunction(n),this}command(e,t,n,r,i,a){return N(`<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]`,[e,t,n,r,i,a],arguments.length),F(this,I,`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){N(`<string> [object]`,[e,t],arguments.length);let n=F(this,kt,`f`)||F(this,Y,`f`).require;return F(this,I,`f`).addDirectory(e,n,F(this,Y,`f`).getCallerFile(),t),this}count(e){return N(`<array|string>`,[e],arguments.length),this[$](`count`,e),this[xn](e),this}default(e,t,n){return N(`<object|string|array> [*] [string]`,[e,t,n],arguments.length),n&&(Pe(e,F(this,Y,`f`)),F(this,K,`f`).defaultDescription[e]=n),typeof t==`function`&&(Pe(e,F(this,Y,`f`)),F(this,K,`f`).defaultDescription[e]||(F(this,K,`f`).defaultDescription[e]=F(this,X,`f`).functionDescription(t)),t=t.call()),this[Qt](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 N(`[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),F(this,K,`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,F(this,Y,`f`)),this.demandOption(e,n)}),t=1/0):typeof t!=`number`&&(n=t,t=1/0),typeof e==`number`?(j(n,!0,F(this,Y,`f`)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(e=>{j(n,!0,F(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 N(`<object|string|array> [string]`,[e,t],arguments.length),this[Qt](this.demandOption.bind(this),`demandedOptions`,e,t),this}deprecateOption(e,t){return N(`<string> [string|boolean]`,[e,t],arguments.length),F(this,K,`f`).deprecatedOptions[e]=t,this}describe(e,t){return N(`<object|string|array> [string]`,[e,t],arguments.length),this[nn](e,!0),F(this,X,`f`).describe(e,t),this}detectLocale(e){return N(`<boolean>`,[e],arguments.length),P(this,wt,e,`f`),this}env(e){return N(`[string|boolean]`,[e],arguments.length),e===!1?delete F(this,K,`f`).envPrefix:F(this,K,`f`).envPrefix=e||``,this}epilogue(e){return N(`<string>`,[e],arguments.length),F(this,X,`f`).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return N(`<string|array> [string]`,[e,t],arguments.length),Array.isArray(e)?e.forEach(e=>this.example(...e)):F(this,X,`f`).example(e,t),this}exit(e,t){P(this,U,!0,`f`),P(this,z,t,`f`),F(this,B,`f`)&&F(this,Y,`f`).process.exit(e)}exitProcess(e=!0){return N(`[boolean]`,[e],arguments.length),P(this,B,e,`f`),this}fail(e){if(N(`<function|boolean>`,[e],arguments.length),typeof e==`boolean`&&e!==!1)throw new A(`Invalid first argument. Expected function or boolean 'false'`);return F(this,X,`f`).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return N(`<array> [function]`,[e,t],arguments.length),t?F(this,L,`f`).getCompletion(e,t):new Promise((t,n)=>{F(this,L,`f`).getCompletion(e,(e,r)=>{e?n(e):t(r)})})}getDemandedOptions(){return N([],0),F(this,K,`f`).demandedOptions}getDemandedCommands(){return N([],0),F(this,K,`f`).demandedCommands}getDeprecatedOptions(){return N([],0),F(this,K,`f`).deprecatedOptions}getDetectLocale(){return F(this,wt,`f`)}getExitProcess(){return F(this,B,`f`)}getGroups(){return Object.assign({},F(this,H,`f`),F(this,Nt,`f`))}getHelp(){if(P(this,U,!0,`f`),!F(this,X,`f`).hasCachedHelpMessage()){if(!this.parsed){let e=this[vn](F(this,J,`f`),void 0,void 0,0,!0);if(M(e))return e.then(()=>F(this,X,`f`).help())}let e=F(this,I,`f`).runDefaultBuilderOn(this);if(M(e))return e.then(()=>F(this,X,`f`).help())}return Promise.resolve(F(this,X,`f`).help())}getOptions(){return F(this,K,`f`)}getStrict(){return F(this,Ft,`f`)}getStrictCommands(){return F(this,It,`f`)}getStrictOptions(){return F(this,Lt,`f`)}global(e,t){return N(`<string|array> [boolean]`,[e,t],arguments.length),e=[].concat(e),t===!1?e.forEach(e=>{F(this,K,`f`).local.includes(e)||F(this,K,`f`).local.push(e)}):F(this,K,`f`).local=F(this,K,`f`).local.filter(t=>e.indexOf(t)===-1),this}group(e,t){N(`<string|array> <string>`,[e,t],arguments.length);let n=F(this,Nt,`f`)[t]||F(this,H,`f`)[t];F(this,Nt,`f`)[t]&&delete F(this,Nt,`f`)[t];let r={};return F(this,H,`f`)[t]=(n||[]).concat(e).filter(e=>r[e]?!1:r[e]=!0),this}hide(e){return N(`<string>`,[e],arguments.length),F(this,K,`f`).hiddenOptions.push(e),this}implies(e,t){return N(`<string|object> [number|string|array]`,[e,t],arguments.length),F(this,Q,`f`).implies(e,t),this}locale(e){return N(`[string]`,[e],arguments.length),e===void 0?(this[Jt](),F(this,Y,`f`).y18n.getLocale()):(P(this,wt,!1,`f`),F(this,Y,`f`).y18n.setLocale(e),this)}middleware(e,t,n){return F(this,V,`f`).addMiddleware(e,!!t,n)}nargs(e,t){return N(`<string|object|array> [number]`,[e,t],arguments.length),this[Qt](this.nargs.bind(this),`narg`,e,t),this}normalize(e){return N(`<array|string>`,[e],arguments.length),this[$](`normalize`,e),this}number(e){return N(`<array|string>`,[e],arguments.length),this[$](`number`,e),this[xn](e),this}option(e,t){if(N(`<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[xn](e),F(this,Z,`f`)&&(e===`version`||t?.alias===`version`)&&this[Ut](`"version" is a reserved word.
|
|
95
|
-
Please do one of the following:
|
|
96
|
-
- Disable version with \`yargs.version(false)\` if using "version" as an option
|
|
97
|
-
- Use the built-in \`yargs.version\` method instead (if applicable)
|
|
98
|
-
- Use a different option key
|
|
99
|
-
https://yargs.js.org/docs/#api-reference-version`,void 0,`versionWarning`),F(this,K,`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&&(F(this,K,`f`).defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let i=t.describe||t.description||t.desc,a=F(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){N(`[string|array] [function|boolean|object] [function]`,[e,t,n],arguments.length),this[Wt](),e===void 0&&(e=F(this,J,`f`)),typeof t==`object`&&(P(this,jt,t,`f`),t=n),typeof t==`function`&&(P(this,q,t,`f`),t=!1),t||P(this,J,e,`f`),F(this,q,`f`)&&P(this,B,!1,`f`);let r=this[vn](e,!!t),i=this.parsed;return F(this,L,`f`).setParsed(this.parsed),M(r)?r.then(e=>(F(this,q,`f`)&&F(this,q,`f`).call(this,F(this,z,`f`),e,F(this,G,`f`)),e)).catch(e=>{throw F(this,q,`f`)&&F(this,q,`f`)(e,this.parsed.argv,F(this,G,`f`)),e}).finally(()=>{this[rn](),this.parsed=i}):(F(this,q,`f`)&&F(this,q,`f`).call(this,F(this,z,`f`),r,F(this,G,`f`)),this[rn](),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 A(`.parseSync() must not be used with asynchronous builders, handlers, or middleware`);return r}parserConfiguration(e){return N(`<object>`,[e],arguments.length),P(this,At,e,`f`),this}pkgConf(e,t){N(`<string> [string]`,[e,t],arguments.length);let n=null,r=this[Zt](t||F(this,xt,`f`));return r[e]&&typeof r[e]==`object`&&(n=_t(r[e],t||F(this,xt,`f`),this[Kt]()[`deep-merge-config`]||!1,F(this,Y,`f`)),F(this,K,`f`).configObjects=(F(this,K,`f`).configObjects||[]).concat(n)),this}positional(e,t){N(`<string> <object>`,[e,t],arguments.length);let n=[`default`,`defaultDescription`,`implies`,`normalize`,`choices`,`conflicts`,`coerce`,`type`,`describe`,`desc`,`description`,`alias`];t=et(t,(e,t)=>e===`type`&&![`string`,`number`,`boolean`].includes(t)?!1:n.includes(e));let r=F(this,St,`f`).fullCommands[F(this,St,`f`).fullCommands.length-1],i=r?F(this,I,`f`).cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return Fe(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,F(this,X,`f`).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return N(`[boolean]`,[e],arguments.length),P(this,Pt,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 N(`<array|string|object> [number]`,[e],arguments.length),typeof e==`string`&&F(this,K,`f`).narg[e]||this[Qt](this.requiresArg.bind(this),`narg`,e,NaN),this}showCompletionScript(e,t){return N(`[string] [string]`,[e,t],arguments.length),e||=this.$0,F(this,Ot,`f`).log(F(this,L,`f`).generateCompletionScript(e,t||F(this,R,`f`)||`completion`)),this}showHelp(e){if(N(`[string|function]`,[e],arguments.length),P(this,U,!0,`f`),!F(this,X,`f`).hasCachedHelpMessage()){if(!this.parsed){let t=this[vn](F(this,J,`f`),void 0,void 0,0,!0);if(M(t))return t.then(()=>{F(this,X,`f`).showHelp(e)}),this}let t=F(this,I,`f`).runDefaultBuilderOn(this);if(M(t))return t.then(()=>{F(this,X,`f`).showHelp(e)}),this}return F(this,X,`f`).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return N(`[boolean|string] [string]`,[e,t],arguments.length),F(this,X,`f`).showHelpOnFail(e,t),this}showVersion(e){return N(`[string|function]`,[e],arguments.length),F(this,X,`f`).showVersion(e),this}skipValidation(e){return N(`<array|string>`,[e],arguments.length),this[$](`skipValidation`,e),this}strict(e){return N(`[boolean]`,[e],arguments.length),P(this,Ft,e!==!1,`f`),this}strictCommands(e){return N(`[boolean]`,[e],arguments.length),P(this,It,e!==!1,`f`),this}strictOptions(e){return N(`[boolean]`,[e],arguments.length),P(this,Lt,e!==!1,`f`),this}string(e){return N(`<array|string>`,[e],arguments.length),this[$](`string`,e),this[xn](e),this}terminalWidth(){return N([],0),F(this,Y,`f`).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return N(`<object>`,[e],arguments.length),P(this,wt,!1,`f`),F(this,Y,`f`).y18n.updateLocale(e),this}usage(e,t,n,r){if(N(`<string|null|undefined> [string|boolean] [function|object] [function]`,[e,t,n,r],arguments.length),t!==void 0){if(j(e,null,F(this,Y,`f`)),(e||``).match(/^\$0( |$)/))return this.command(e,t,n,r);throw new A(`.usage() description must start with $0 if being used as alias for .command()`)}return F(this,X,`f`).usage(e),this}usageConfiguration(e){return N(`<object>`,[e],arguments.length),P(this,Rt,e,`f`),this}version(e,t,n){let r=`version`;if(N(`[boolean|string] [string] [string]`,[e,t,n],arguments.length),F(this,Z,`f`)&&(this[Ht](F(this,Z,`f`)),F(this,X,`f`).version(void 0),P(this,Z,null,`f`)),arguments.length===0)n=this[Yt](),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 P(this,Z,typeof e==`string`?e:r,`f`),t||=F(this,X,`f`).deferY18nLookup(`Show version number`),F(this,X,`f`).version(n||void 0),this.boolean(F(this,Z,`f`)),this.describe(F(this,Z,`f`),t),this}wrap(e){return N(`<number|null|undefined>`,[e],arguments.length),F(this,X,`f`).wrap(e),this}[(I=/* @__PURE__ */ new WeakMap,xt=/* @__PURE__ */ new WeakMap,St=/* @__PURE__ */ new WeakMap,L=/* @__PURE__ */ new WeakMap,R=/* @__PURE__ */ new WeakMap,Ct=/* @__PURE__ */ new WeakMap,z=/* @__PURE__ */ new WeakMap,wt=/* @__PURE__ */ new WeakMap,Tt=/* @__PURE__ */ new WeakMap,B=/* @__PURE__ */ new WeakMap,Et=/* @__PURE__ */ new WeakMap,V=/* @__PURE__ */ new WeakMap,H=/* @__PURE__ */ new WeakMap,U=/* @__PURE__ */ new WeakMap,W=/* @__PURE__ */ new WeakMap,Dt=/* @__PURE__ */ new WeakMap,Ot=/* @__PURE__ */ new WeakMap,G=/* @__PURE__ */ new WeakMap,K=/* @__PURE__ */ new WeakMap,kt=/* @__PURE__ */ new WeakMap,At=/* @__PURE__ */ new WeakMap,q=/* @__PURE__ */ new WeakMap,jt=/* @__PURE__ */ new WeakMap,Mt=/* @__PURE__ */ new WeakMap,Nt=/* @__PURE__ */ new WeakMap,J=/* @__PURE__ */ new WeakMap,Pt=/* @__PURE__ */ new WeakMap,Y=/* @__PURE__ */ new WeakMap,Ft=/* @__PURE__ */ new WeakMap,It=/* @__PURE__ */ new WeakMap,Lt=/* @__PURE__ */ new WeakMap,X=/* @__PURE__ */ new WeakMap,Rt=/* @__PURE__ */ new WeakMap,Z=/* @__PURE__ */ new WeakMap,Q=/* @__PURE__ */ new WeakMap,Bt)](e){if(!e._||!e[`--`])return e;e._.push.apply(e._,e[`--`]);try{delete e[`--`]}catch{}return e}[Vt](){return{log:(...e)=>{this[pn]()||console.log(...e),P(this,U,!0,`f`),F(this,G,`f`).length&&P(this,G,F(this,G,`f`)+`
|
|
100
|
-
`,`f`),P(this,G,F(this,G,`f`)+e.join(` `),`f`)},error:(...e)=>{this[pn]()||console.error(...e),P(this,U,!0,`f`),F(this,G,`f`).length&&P(this,G,F(this,G,`f`)+`
|
|
101
|
-
`,`f`),P(this,G,F(this,G,`f`)+e.join(` `),`f`)}}}[Ht](e){Fe(F(this,K,`f`)).forEach(t=>{if((e=>e===`configObjects`)(t))return;let n=F(this,K,`f`)[t];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n==`object`&&delete n[e]}),delete F(this,X,`f`).getDescriptions()[e]}[Ut](e,t,n){F(this,Tt,`f`)[n]||(F(this,Y,`f`).process.emitWarning(e,t),F(this,Tt,`f`)[n]=!0)}[Wt](){F(this,Et,`f`).push({options:F(this,K,`f`),configObjects:F(this,K,`f`).configObjects.slice(0),exitProcess:F(this,B,`f`),groups:F(this,H,`f`),strict:F(this,Ft,`f`),strictCommands:F(this,It,`f`),strictOptions:F(this,Lt,`f`),completionCommand:F(this,R,`f`),output:F(this,G,`f`),exitError:F(this,z,`f`),hasOutput:F(this,U,`f`),parsed:this.parsed,parseFn:F(this,q,`f`),parseContext:F(this,jt,`f`)}),F(this,X,`f`).freeze(),F(this,Q,`f`).freeze(),F(this,I,`f`).freeze(),F(this,V,`f`).freeze()}[Gt](){let e=``,t;return t=/\b(node|iojs|electron)(\.exe)?$/.test(F(this,Y,`f`).process.argv()[0])?F(this,Y,`f`).process.argv().slice(1,2):F(this,Y,`f`).process.argv().slice(0,1),e=t.map(e=>{let t=this[gn](F(this,xt,`f`),e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&t.length<e.length?t:e}).join(` `).trim(),F(this,Y,`f`).getEnv(`_`)&&F(this,Y,`f`).getProcessArgvBin()===F(this,Y,`f`).getEnv(`_`)&&(e=F(this,Y,`f`).getEnv(`_`).replace(`${F(this,Y,`f`).path.dirname(F(this,Y,`f`).process.execPath())}/`,``)),e}[Kt](){return F(this,At,`f`)}[qt](){return F(this,Rt,`f`)}[Jt](){if(!F(this,wt,`f`))return;let e=F(this,Y,`f`).getEnv(`LC_ALL`)||F(this,Y,`f`).getEnv(`LC_MESSAGES`)||F(this,Y,`f`).getEnv(`LANG`)||F(this,Y,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(e.replace(/[.:].*/,``))}[Yt](){return this[Zt]().version||`unknown`}[Xt](e){let t=e[`--`]?e[`--`]:e._;for(let e=0,n;(n=t[e])!==void 0;e++)F(this,Y,`f`).Parser.looksLikeNumber(n)&&Number.isSafeInteger(Math.floor(parseFloat(`${n}`)))&&(t[e]=Number(n));return e}[Zt](e){let t=e||`*`;if(F(this,Mt,`f`)[t])return F(this,Mt,`f`)[t];let n={};try{let t=e||F(this,Y,`f`).mainFilename;!e&&F(this,Y,`f`).path.extname(t)&&(t=F(this,Y,`f`).path.dirname(t));let r=F(this,Y,`f`).findUp(t,(e,t)=>{if(t.includes(`package.json`))return`package.json`});j(r,void 0,F(this,Y,`f`)),n=JSON.parse(F(this,Y,`f`).readFileSync(r,`utf8`))}catch{}return F(this,Mt,`f`)[t]=n||{},F(this,Mt,`f`)[t]}[$](e,t){t=[].concat(t),t.forEach(t=>{t=this[tn](t),F(this,K,`f`)[e].push(t)})}[Qt](e,t,n,r){this[en](e,t,n,r,(e,t,n)=>{F(this,K,`f`)[e][t]=n})}[$t](e,t,n,r){this[en](e,t,n,r,(e,t,n)=>{F(this,K,`f`)[e][t]=(F(this,K,`f`)[e][t]||[]).concat(n)})}[en](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 Fe(n))e(t,n[t]);else i(t,this[tn](n),r)}[tn](e){return e===`__proto__`?`___proto___`:e}[nn](e,t){return this[Qt](this[nn].bind(this),`key`,e,t),this}[rn](){var e,t,n,r,i,a,o,s,c,l,u,d;let f=F(this,Et,`f`).pop();j(f,void 0,F(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){P(e,K,t,`f`)}}.value,configObjects:p,exitProcess:{set value(e){P(t,B,e,`f`)}}.value,groups:{set value(e){P(n,H,e,`f`)}}.value,output:{set value(e){P(r,G,e,`f`)}}.value,exitError:{set value(e){P(i,z,e,`f`)}}.value,hasOutput:{set value(e){P(a,U,e,`f`)}}.value,parsed:this.parsed,strict:{set value(e){P(o,Ft,e,`f`)}}.value,strictCommands:{set value(e){P(s,It,e,`f`)}}.value,strictOptions:{set value(e){P(c,Lt,e,`f`)}}.value,completionCommand:{set value(e){P(l,R,e,`f`)}}.value,parseFn:{set value(e){P(u,q,e,`f`)}}.value,parseContext:{set value(e){P(d,jt,e,`f`)}}.value}=f,F(this,K,`f`).configObjects=p,F(this,X,`f`).unfreeze(),F(this,Q,`f`).unfreeze(),F(this,I,`f`).unfreeze(),F(this,V,`f`).unfreeze()}[an](e,t){return Ue(t,t=>(e(t),t))}getInternalMethods(){return{getCommandInstance:this[on].bind(this),getContext:this[sn].bind(this),getHasOutput:this[cn].bind(this),getLoggerInstance:this[ln].bind(this),getParseContext:this[un].bind(this),getParserConfiguration:this[Kt].bind(this),getUsageConfiguration:this[qt].bind(this),getUsageInstance:this[dn].bind(this),getValidationInstance:this[fn].bind(this),hasParseCallback:this[pn].bind(this),isGlobalContext:this[mn].bind(this),postProcess:this[hn].bind(this),reset:this[_n].bind(this),runValidation:this[yn].bind(this),runYargsParserAndExecuteCommands:this[vn].bind(this),setHasOutput:this[bn].bind(this)}}[on](){return F(this,I,`f`)}[sn](){return F(this,St,`f`)}[cn](){return F(this,U,`f`)}[ln](){return F(this,Ot,`f`)}[un](){return F(this,jt,`f`)||{}}[dn](){return F(this,X,`f`)}[fn](){return F(this,Q,`f`)}[pn](){return!!F(this,q,`f`)}[mn](){return F(this,Dt,`f`)}[hn](e,t,n,r){return n||M(e)||(t||(e=this[Bt](e)),(this[Kt]()[`parse-positional-numbers`]||this[Kt]()[`parse-positional-numbers`]===void 0)&&(e=this[Xt](e)),r&&(e=He(e,this,F(this,V,`f`).getMiddleware(),!1))),e}[_n](e={}){P(this,K,F(this,K,`f`)||{},`f`);let t={};t.local=F(this,K,`f`).local||[],t.configObjects=F(this,K,`f`).configObjects||[];let n={};return t.local.forEach(t=>{n[t]=!0,(e[t]||[]).forEach(e=>{n[e]=!0})}),Object.assign(F(this,Nt,`f`),Object.keys(F(this,H,`f`)).reduce((e,t)=>{let r=F(this,H,`f`)[t].filter(e=>!(e in n));return r.length>0&&(e[t]=r),e},{})),P(this,H,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(e=>{t[e]=(F(this,K,`f`)[e]||[]).filter(e=>!n[e])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(e=>{t[e]=et(F(this,K,`f`)[e],e=>!n[e])}),t.envPrefix=F(this,K,`f`).envPrefix,P(this,K,t,`f`),P(this,X,F(this,X,`f`)?F(this,X,`f`).reset(n):rt(this,F(this,Y,`f`)),`f`),P(this,Q,F(this,Q,`f`)?F(this,Q,`f`).reset(n):mt(this,F(this,X,`f`),F(this,Y,`f`)),`f`),P(this,I,F(this,I,`f`)?F(this,I,`f`).reset():Je(F(this,X,`f`),F(this,Q,`f`),F(this,V,`f`),F(this,Y,`f`)),`f`),F(this,L,`f`)||P(this,L,lt(this,F(this,X,`f`),F(this,I,`f`),F(this,Y,`f`)),`f`),F(this,V,`f`).reset(),P(this,R,null,`f`),P(this,G,``,`f`),P(this,z,null,`f`),P(this,U,!1,`f`),this.parsed=!1,this}[gn](e,t){return F(this,Y,`f`).path.relative(e,t)}[vn](e,t,n,r=0,i=!1){let a=!!n||i;e||=F(this,J,`f`),F(this,K,`f`).__=F(this,Y,`f`).y18n.__,F(this,K,`f`).configuration=this[Kt]();let o=!!F(this,K,`f`).configuration[`populate--`],s=Object.assign({},F(this,K,`f`).configuration,{"populate--":!0}),c=F(this,Y,`f`).Parser.detailed(e,Object.assign({},F(this,K,`f`),{configuration:{"parse-positional-numbers":!1,...s}})),l=Object.assign(c.argv,F(this,jt,`f`)),u,d=c.aliases,f=!1,p=!1;Object.keys(l).forEach(e=>{e===F(this,W,`f`)&&l[e]?f=!0:e===F(this,Z,`f`)&&l[e]&&(p=!0)}),l.$0=this.$0,this.parsed=c,r===0&&F(this,X,`f`).clearCachedHelpMessage();try{if(this[Jt](),t)return this[hn](l,o,!!n,!1);F(this,W,`f`)&&[F(this,W,`f`)].concat(d[F(this,W,`f`)]||[]).filter(e=>e.length>1).includes(``+l._[l._.length-1])&&(l._.pop(),f=!0),P(this,Dt,!1,`f`);let s=F(this,I,`f`).getCommands(),m=F(this,L,`f`).completionKey in l,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!==F(this,R,`f`)){let e=F(this,I,`f`).runCommand(a,this,c,t+1,i,f||p||i);return this[hn](e,o,!!n,!1)}if(!e&&a!==F(this,R,`f`)){e=a;break}}!F(this,I,`f`).hasDefaultCommand()&&F(this,Pt,`f`)&&e&&!h&&F(this,Q,`f`).recommendCommands(e,s)}F(this,R,`f`)&&l._.includes(F(this,R,`f`))&&!m&&(F(this,B,`f`)&&tt(!0),this.showCompletionScript(),this.exit(0))}if(F(this,I,`f`).hasDefaultCommand()&&!h){let e=F(this,I,`f`).runCommand(null,this,c,0,i,f||p||i);return this[hn](e,o,!!n,!1)}if(m){F(this,B,`f`)&&tt(!0),e=[].concat(e);let t=e.slice(e.indexOf(`--${F(this,L,`f`).completionKey}`)+1);return F(this,L,`f`).getCompletion(t,(e,t)=>{if(e)throw new A(e.message);(t||[]).forEach(e=>{F(this,Ot,`f`).log(e)}),this.exit(0)}),this[hn](l,!o,!!n,!1)}if(F(this,U,`f`)||(f?(F(this,B,`f`)&&tt(!0),a=!0,this.showHelp(`log`),this.exit(0)):p&&(F(this,B,`f`)&&tt(!0),a=!0,F(this,X,`f`).showVersion(`log`),this.exit(0))),!a&&F(this,K,`f`).skipValidation.length>0&&(a=Object.keys(l).some(e=>F(this,K,`f`).skipValidation.indexOf(e)>=0&&l[e]===!0)),!a){if(c.error)throw new A(c.error.message);if(!m){let e=this[yn](d,{},c.error);n||(u=He(l,this,F(this,V,`f`).getMiddleware(),!0)),u=this[an](e,u??l),M(u)&&!n&&(u=u.then(()=>He(l,this,F(this,V,`f`).getMiddleware(),!1)))}}}catch(e){if(e instanceof A)F(this,X,`f`).fail(e.message,e);else throw e}return this[hn](u??l,o,!!n,!0)}[yn](e,t,n,r){let i={...this.getDemandedOptions()};return a=>{if(n)throw new A(n.message);F(this,Q,`f`).nonOptionCount(a),F(this,Q,`f`).requiredArguments(a,i);let o=!1;F(this,It,`f`)&&(o=F(this,Q,`f`).unknownCommands(a)),F(this,Ft,`f`)&&!o?F(this,Q,`f`).unknownArguments(a,e,t,!!r):F(this,Lt,`f`)&&F(this,Q,`f`).unknownArguments(a,e,{},!1,!1),F(this,Q,`f`).limitedChoices(a),F(this,Q,`f`).implications(a),F(this,Q,`f`).conflicting(a)}}[bn](){P(this,U,!0,`f`)}[xn](e){if(typeof e==`string`)F(this,K,`f`).key[e]=!0;else for(let t of e)F(this,K,`f`).key[t]=!0}};function Cn(e){return!!e&&typeof e.getInternalMethods==`function`}const wn=zt(Ne);var Tn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const En=e=>e.option(`multi-repo`,{type:`boolean`,description:`Compose local repositories; set up a workspace if no config exists`}).option(`workspace`,{type:`string`,requiresArg:!0,description:`Path to a local multi-repo config (implies --multi-repo)`}).option(`setup`,{type:`boolean`,description:`Review saved setup (requires --multi-repo or --workspace); preserve cache`}).option(`non-interactive`,{type:`boolean`,description:`Never prompt (requires --multi-repo or --workspace and a valid config)`}).wrap(null).epilog(n),Dn=(e,t)=>En(wn(e).scriptName(t).usage(`$0 dev --multi-repo [options]`)).option(`port`,{type:`number`,default:3e3,description:`Local preview port`}).option(`open`,{type:`boolean`,default:!1,description:`Open the preview in a browser`}).option(`client-version`,{type:`string`,hidden:!0}).option(`local-client-version`,{type:`string`,hidden:!0}).option(`local-schema`,{type:`boolean`,hidden:!0}).option(`classic`,{type:`boolean`,default:!1,description:`Preview with the classic client`}).option(`beta`,{type:`boolean`,default:!1,hidden:!0}).option(`groups`,{type:`array`,description:`Mock user groups`}).option(`signed-in`,{type:`boolean`,default:!1}).option(`disable-openapi`,{type:`boolean`,default:!1}).option(`disable-prefetch`,{type:`boolean`,default:!1}).option(`host`,{type:`boolean`,default:!1}).option(`telemetry`,{alias:`t`,type:`boolean`}).help().alias(`help`,`h`).exitProcess(!1).strictOptions().fail(e=>{throw Error(e)});function On(e){return Dn(e,`mint`).help(!1).version(!1).strictOptions(!1).parseSync()._[0]===`dev`}function kn(e,n,r,i){return Tn(this,void 0,void 0,function*(){let a=Dn(e,n).parseSync();if(a.help||a.version)return;if(a.workspace!==void 0&&!a.workspace.trim())throw Error(`--workspace requires a config path.`);if(!a[`multi-repo`]&&!a.workspace)throw Error(`Use --multi-repo with --setup or --non-interactive.`);if(!Number.isInteger(a.port)||a.port<1||a.port>65535)throw Error(`--port must be an integer from 1 to 65535.`);let{resolveWorkspace:o}=yield import(`./multi-repo-setup-CPWU9RaS.js`),s;console.log(`Checking multi-repo configuration…`);let c=yield o({cwd:process.cwd(),workspace:a.workspace,setup:a.setup,nonInteractive:a[`non-interactive`],onSaved:e=>{s=`Saved ${e}. Keep machine-specific paths out of Git; add the local config to .gitignore.`}}),{prepareMultiRepoPreview:l}=yield import(`./multi-repo-preview-BFjWTBl7.js`),u=performance.now(),d=0,f=yield l(c,!0,{compositionCacheDirectory:te.join(_.homedir(),`.mintlify`,`multi-repo-compositions`),onProgress:e=>{e.stage===`cold`&&console.log(`Preparing the workspace for the first time. Large repositories can take around two minutes; later runs reuse the saved workspace.`),e.stage===`cached`&&console.log(`Checking the saved workspace for changes…`),e.stage===`watching`&&console.log(`Starting repository watchers…`),e.stage===`files`&&performance.now()-d>=1e3&&(d=performance.now(),console.log(`Checked ${e.files.toLocaleString()} files…`))}});r(f.close);let p=f.getStats();console.log(`Workspace ready in ${((performance.now()-u)/1e3).toFixed(1)}s: ${p?.reusedFiles??0} files reused. Starting preview…`);for(let e of f.sources)console.log(` ${e.repo} → /${e.mountPath}`);if(process.chdir(f.directory),typeof a.telemetry==`boolean`){let{setTelemetryEnabled:e}=yield import(`./config-BFe5lXi4.js`);yield e(a.telemetry)}let[{dev:m,Logs:h},{render:g},{createElement:ee}]=yield Promise.all([import(`./dist-CdeiUm_D.js`),import(`./build-DF0EjyfW.js`),import(`./react-CA8V--cT.js`).then(e=>/* @__PURE__ */ t(e.default,1))]);if(g(ee(h)),a.classic!==!0){let{watchComponentUsage:e}=yield import(`./live-CfaF_fTw.js`);e(f.directory).catch(()=>void 0)}yield m(Object.assign(Object.assign({},a),{groups:a.groups??(a[`signed-in`]?[]:void 0),packageName:n,previewReadyMessage:s,onExit:i}))})}export{k as a,wn as i,En as n,kn as r,On as t};
|