@mintlify/cli 4.1.25 → 4.1.26
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/start.js +6 -5
- package/package.json +2 -2
package/dist/start.js
CHANGED
|
@@ -2224,13 +2224,13 @@ try {
|
|
|
2224
2224
|
}
|
|
2225
2225
|
`,JSON.stringify([e,n,r,t])]]:[e,n];Nr(i,a,Object.assign(Object.assign({},r?{}:c1),{detached:!0,stdio:`ignore`,windowsHide:!0})).unref()},rIt=(e,t)=>{let n=e=>e.split(`-`)[0].split(`.`).map(e=>Number.parseInt(e,10)||0),r=n(e),i=n(t);for(let e=0;e<Math.max(r.length,i.length);e++){let t=(r[e]??0)-(i[e]??0);if(t!==0)return t>0}return!1},iIt=()=>process.env.MINTLIFY_DISABLE_AUTOUPDATE===`1`||N1(`autoUpdate`)===`false`,aIt=(e=qt(import.meta.url),t=process.cwd())=>{let n=e=>process.platform===`win32`?e.toLowerCase():e,r=n(e).split(Rt.sep);if(r.some(e=>e===`_npx`||e===`dlx`||e.startsWith(`dlx-`)))return`ephemeral`;let i=r.slice(0,r.indexOf(`node_modules`)).join(Rt.sep),a=n(t);return i&&(a===i||a.startsWith(i+Rt.sep))?`local`:`global`},oIt=e=>i2(void 0,void 0,void 0,function*(){let t=F1().latest?.[e];if(t&&Date.now()-t.checkedAt<144e5)return t.version;let n=yield tMt(e);if(!n)return t?.version;let r=F1();return yield DMt(Object.assign(Object.assign({},r),{latest:Object.assign(Object.assign({},r.latest),{[e]:{version:n,checkedAt:Date.now()}})})),n}),sIt=e=>i2(void 0,void 0,void 0,function*(){let t=F1();if(t.installAttemptedAt&&Date.now()-t.installAttemptedAt<36e5)return!1;let n=yield aMt({packageName:e}),r=Date.now();return yield DMt(Object.assign(Object.assign({},t),{installAttemptedAt:r})),process.once(`exit`,()=>{if(!((F1().installAttemptedAt??0)>r))try{nIt(n,e)}catch{}}),!0}),cIt=(e,t)=>i2(void 0,void 0,void 0,function*(){if(t===`update`||process.env.CLI_TEST_MODE===`true`||F$())return;let n=o1(e);if(n&&n!==`linked to local package`)try{let t=yield oIt(e);if(!t||!rIt(t,n))return;let r=`${e} ${t} is available (you have ${n}).`;if(!iIt()&&aIt()===`global`&&(yield sIt(e))){console.error(eY.yellow(`${r} Updating in the background after this command exits.`));return}console.error(eY.yellow(`${r} Run \`${e} update\` to upgrade.`))}catch{}}),lIt=[];function a2(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)||lIt,r=[];for(;++t<n.length;)r[t]=a2(n[t]);return r.join(``)}const uIt={}.hasOwnProperty;function dIt(e,t,n){let r=-1;if(!e)throw Error(`Iterate requires that |this| not be `+e);if(!uIt.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 o2(e){return t;function t(e){if(!e||!e.children)throw Error("Missing children in `parent` for `modifier`");dIt(e.children,n,e)}function n(t,n){return e(t,n,this)}}const fIt=o2(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=a2(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)}}}}),pIt=/^([!"').?\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*$/,mIt=/^[ \t]*((\r?\n|\r)[\t ]*)+$/,hIt=/^([!.?\u2026\u203D]+)$/,gIt=/^([&'\-.:=?@\u00AD\u00B7\u2010\u2011\u2019\u2027]|_+)$/,_It=/^(?:[\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])+$/,vIt=/^\d/,yIt=/^(?:[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])/,bIt=/[\uD800-\uDFFF]/,xIt=/[!"'-),-/:;?[-\]_{}\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]/,SIt=/[\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]/,CIt=/[\t-\r \u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,wIt=o2(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`)&&pIt.test(a2(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}}),TIt=o2(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`||a2(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}}),EIt=o2(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 s2(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 DIt=s2(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)}}}),OIt=o2(function(e,t,n){if(t>0&&(e.type===`SymbolNode`||e.type===`PunctuationNode`)&&a2(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}}),kIt=o2(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`&&vIt.test(a2(i)))return r.children.push(...e.children),n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t}}),AIt=o2(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 yIt.test(a2(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}}}}),jIt=o2(function(e,t,n){if(e.type!==`SymbolNode`&&e.type!==`PunctuationNode`||a2(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}),MIt=o2(function(e,t,n){if(t>0&&e.type===`PunctuationNode`&&a2(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=a2(e);if(i%2==0){if(t.length>1)return;_It.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}}}),NIt=o2(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`)&&gIt.test(a2(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}}}}),PIt=o2(function(e,t,n){let r=n.children,i=r[t-1];if(i&&i.type===`WordNode`&&(e.type===`SymbolNode`||e.type===`PunctuationNode`)&&a2(e)===`/`){let n=a2(i),a=e,o=[e],s=1,c=``,l=r[t+1];if(l&&l.type===`WordNode`&&(c=a2(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}}),FIt=o2(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))}}),IIt=/* @__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)$`),LIt=o2(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`)&&a2(r)===`.`){let i=e.children[e.children.length-2];if(i&&i.type===`WordNode`&&IIt.test(a2(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}}}}),RIt=s2(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(!hIt.test(a2(r)))continue;if(!n){n=!0;continue}if(a2(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`&&a2(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))}}}),zIt=o2(function(e,t,n){if(`children`in e&&e.children.length===0)return n.children.splice(t,1),t}),c2=s2(function(e,t,n){let r=n.children;e.position&&t<1&&(!n.position||!n.position.start)&&(BIt(n),n.position.start=e.position.start),e.position&&t===r.length-1&&(!n.position||!n.position.end)&&(BIt(n),n.position.end=e.position.end)});function BIt(e){e.position||={}}var l2=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:VIt(this.tokenizeParagraph(e),`WhiteSpaceNode`,mIt)},n=-1;for(;this.tokenizeRootPlugins[++n];)this.tokenizeRootPlugins[n](t);return t}tokenizeParagraph(e){let t={type:`ParagraphNode`,children:VIt(this.tokenizeSentence(e),`PunctuationNode`,hIt)},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=CIt.test(l)?`WhiteSpaceNode`:xIt.test(l)?`PunctuationNode`:SIt.test(l)?`WordNode`:`SymbolNode`;r<i&&o&&u&&(o!==u||o!==`WordNode`&&o!==`WhiteSpaceNode`&&l!==s&&!bIt.test(l))&&(t.push(c(o,e.slice(r,i))),r=i,a={...n}),l===`\r`||l===`
|
|
2226
2226
|
`&&s!==`\r`?(n.line++,n.column=1):l!==`
|
|
2227
|
-
`&&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}}}}}};l2.prototype.tokenizeSentencePlugins=[jIt,OIt,NIt,PIt,MIt,c2],l2.prototype.tokenizeParagraphPlugins=[FIt,wIt,AIt,kIt,LIt,fIt,RIt,DIt,EIt,TIt,zIt,c2],l2.prototype.tokenizeRootPlugins=[DIt,EIt,zIt,c2];function VIt(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(a2(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 HIt(){let e=this;e.parser=t;function t(t){let n=new l2;return u2(n.tokenizeParagraphPlugins,e.data(`nlcstParagraphExtensions`)),u2(n.tokenizeRootPlugins,e.data(`nlcstRootExtensions`)),u2(n.tokenizeSentencePlugins,e.data(`nlcstSentenceExtensions`)),n.parse(t)}}function u2(e,t){t&&e.unshift(...t)}function UIt(){let e=this;e.compiler=WIt}function WIt(e){return a2(e)}const GIt=Je().use(HIt).use(UIt).freeze(),KIt=[`”`,`’`],qIt=[`“`,`‘`],JIt={};function YIt(e){let t=e||JIt,n=[];if(t.quotes!==!1&&n.push(iLt),t.ellipses===`spaced`?n.push(nLt):t.ellipses===`unspaced`?n.push(rLt):t.ellipses!==!1&&n.push(tLt),t.backticks===`all`){if(t.quotes!==!1)throw Error("Cannot accept `backticks: 'all'` with `quotes: true`");n.push(XIt)}else t.backticks!==!1&&n.push(ZIt);t.dashes===`inverted`?n.push($It):t.dashes===`oldschool`?n.push(eLt):t.dashes!==!1&&n.push(QIt);let r={close:t.closingQuotes?[t.closingQuotes.double,t.closingQuotes.single]:KIt,open:t.openingQuotes?[t.openingQuotes.double,t.openingQuotes.single]:qIt};return function(e){p(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 XIt(e,t,n,r){ZIt(e,t,n,r),t.value==="`"?t.value=`‘`:t.value===`'`&&(t.value=`’`)}function ZIt(e,t){t.value==="``"?t.value=`“`:t.value===`''`&&(t.value=`”`)}function QIt(e,t){t.value===`--`&&(t.value=`—`)}function $It(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 eLt(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 tLt(e,t,n,r){nLt(e,t,n,r),rLt(e,t,n,r)}function nLt(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 rLt(e,t){/^\.{3,}$/.test(t.value)&&(t.value=`…`)}function iLt(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?a2(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 aLt=/* @__PURE__ */ new Set([`text`,`inlineCode`,`paragraph`]),oLt=/* @__PURE__ */ new Set([`style`,`script`]),sLt=(e,t,n)=>n&&(n.type!==`mdxJsxTextElement`||`name`in n&&typeof n.name==`string`&&!oLt.has(n.name))&&aLt.has(e.type)&&(d2(e)||f2(e)),cLt=e=>{let t=GIt().use(YIt,{...e,ellipses:!1,dashes:!1,backticks:!1}),n=GIt().use(YIt,{...e,quotes:!1});return e=>{let r=``,i=0,a=[];p(e,sLt,e=>{d2(e)?r+=e.type===`text`?e.value:`A`.repeat(e.value.length):f2(e)&&(r+=` `),a.push(e)}),/["']/.test(r)&&(r=t.processSync(r).toString());for(let e of a)if(d2(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 f2(e)&&(i+=1)}};function d2(e){return`value`in e&&typeof e.value==`string`}function f2(e){return e.type===`paragraph`}const lLt=(function(e){if(e==null)return pLt;if(typeof e==`string`)return fLt(e);if(typeof e==`object`)return Array.isArray(e)?uLt(e):dLt(e);if(typeof e==`function`)return p2(e);throw Error(`Expected function, string, or object as test`)});function uLt(e){let t=[],n=-1;for(;++n<e.length;)t[n]=lLt(e[n]);return p2(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}}function dLt(e){return p2(t);function t(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function fLt(e){return p2(t);function t(t){return t&&t.type===e}}function p2(e){return t;function t(t,...n){return!!(t&&typeof t==`object`&&`type`in t&&e.call(this,t,...n))}}function pLt(){return!0}function mLt(e){return`\x1B[33m`+e+`\x1B[39m`}const hLt=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null);let i=lLt(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 (`+mLt(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=[],u,d,f;if((!t||i(e,s,c[c.length-1]||null))&&(l=gLt(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 gLt(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:[e]}const m2=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null),hLt(e,t,i,r);function i(e,t){let r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}}),_Lt=[`.mdx`,`.md`],vLt=[`.jpeg`,`.jpg`,`.jfif`,`.pjpeg`,`.pjp`,`.png`,`.svg`,`.svgz`,`.ico`,`.webp`,`.gif`,`.apng`,`.avif`,`.bmp`,`.mp4`,`.css`,`.xml`],yLt=e=>!(e.dir===`node_modules`||e.dir.startsWith(`node_modules/`)),bLt=e=>!(e.dir===`.github`||e.dir.startsWith(`.github/`)),h2=e=>_Lt.includes(e.ext),xLt=e=>vLt.includes(e.ext),SLt=e=>h2(e)||xLt(e),CLt=e=>e.map(v2).map(Tt).filter(yLt),wLt=e=>CLt(e).filter(h2).filter(bLt),TLt=e=>CLt(e).filter(SLt).filter(bLt),ELt=e=>Ct(e.dir,e.base),DLt=e=>Ct(e.dir,e.name),g2=e=>e.split(`#`)[0].split(`?`)[0],OLt=(e,t=[])=>wLt(AP(e,e,t)).map(ELt),_2=(e,t=[])=>TLt(AP(e,e,t)).map(ELt),v2=e=>wt(y2(e)),y2=e=>e.startsWith(`/`)?e.slice(1):e;var b2;(function(e){e.INTERNAL=`internal`,e.EXTERNAL=`external`,e.DATA=`data`})(b2||={});const kLt=e=>{try{return decodeURIComponent(e)}catch{return e}},x2=e=>/[:*]/.test(e);var S2;(function(e){e.MD=`md`,e.SRC=`src`,e.HREF=`href`,e.CARD=`card`,e.IMPORT=`import`,e.DEFINITION=`definition`})(S2||={});var ALt;(function(e){e.CONTENT=`content`,e.NAVIGATION=`navigation`})(ALt||={});var C2=class e{static getPathType(e){let t;return t=URL.canParse(e)?b2.EXTERNAL:e.startsWith(`data:`)?b2.DATA:b2.INTERNAL,t}constructParsedPath(){let t=e.getPathType(this.originalPath),n,r;if(t===b2.INTERNAL){let e=new URL(`mintlify:/`);e.pathname=`/${this.relativeDir}/${this.filename}`.replaceAll(Pr,`/`),n=new URL(this.originalPath.replaceAll(Pr,`/`),e);let t=kLt(n.pathname).slice(1);t.endsWith(`/`)&&(t=t.slice(0,-1)),t===``&&(t=`.`),r=Tt(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===b2.INTERNAL?kLt(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=v2(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===b2.INTERNAL){let e=this.path;return Ct(e.dir,e.base)}return this.path.toString()}getResolvedFiles(e,t){if(this.pathType!==b2.INTERNAL||this.path instanceof URL)return[];let{dir:n,name:r,base:i}=Tt(this.toString()),a=[];return Xt(Ot(t,this.toString()))&&a.push(Ct(n,i)),a.push(...e.lookup(n,r,i)),a}keepsMdxExtension(){let e=this.wrapper===S2.DEFINITION?this.originalPath:this.wrapper===S2.MD||this.wrapper===S2.HREF?oMe(Ct(this.relativeDir,this.filename),this.originalPath,!0):void 0;return e!==void 0&&/\.mdx$/i.test(g2(e))}resolvesTo(e,t,n){return this.pathType===b2.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===b2.INTERNAL).map(e=>e.toString())}},jLt=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}=Tt(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)}},w2=class{constructor(e,t=[]){this.label=e,this.paths=t,this.edges=[],this.headingSlugs=null,this.relativeDir=v2(bt(e)),this.filename=yt(e),this.label=Ct(this.relativeDir,this.filename)}toString(){return this.label}equals(e){return this.label===e.label}addPath(e,t,n){let r=new C2(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}},MLt=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}},NLt=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}addNode(e){return this.nodes[e]||(this.nodes[e]=new w2(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 w2(t).toString())}setRedirects(e){this.configRedirects=e,this.redirectMap.clear();for(let t of e){let e=v2(t.source);this.redirectMap.has(e)||this.redirectMap.set(e,v2(t.destination))}this.wildcardRedirects=[...this.redirectMap].filter(([e])=>x2(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=C2.filterMapInternalPaths(nYe(this.baseDir,this.baseDir,this.mintIgnoreGlobs)).filter(e=>!wP(e,this.mintIgnoreGlobs));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===b2.INTERNAL&&i.anchorLink&&e.has(Ct(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=ALt.CONTENT){let r=new MLt(e,t,n);return this.edges.find(e=>e.equals(r)?(e.incrementCount(),!0):!1)||(this.edges.push(r),r)}addEdgesBetweenNodes(){let e=new jLt(_2(this.baseDir,this.mintIgnoreGlobs));for(let t of Object.values(this.nodes))for(let n of t.paths)if(n.pathType===b2.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 jLt(_2(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===b2.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=Ct(e,`index.mdx`),i=this.nodes[r]?r:Ct(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===b2.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=qE(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===b2.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=Tt(t),r=h2(n)?DLt(n):t;return yt(r)===`index`?bt(r):r}getPageCandidates(e){return e===`.`?[`index.mdx`,`index.md`]:[`${e}.mdx`,`${e}.md`,Ct(e,`index.mdx`),Ct(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=g2(e);return!n||x2(n)?!0:this.reachesPage(v2(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=v2(n);t.has(i)||(t.add(i),!URL.canParse(r)&&(x2(g2(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===b2.EXTERNAL);r.length>0&&e.set(t,r)}return e}getAllInternalPaths(){return Object.values(this.nodes).flatMap(e=>e.paths).filter(e=>e.pathType===b2.INTERNAL).map(e=>e.originalPath+` => `+e.toString())}},T2=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 E2=e=>T2(void 0,void 0,void 0,function*(){for(let t of[`docs.json`,`mint.json`]){let n=vt.join(e,t);if(cF.default.existsSync(n))try{let{resolved:r}=yield sF(yield cF.default.readJSON(n),e);if(r&&typeof r==`object`&&!Array.isArray(r))return{configFile:t,json:r}}catch(e){console.warn(`Warning: Failed to read or resolve ${t}: ${e}`)}}return null}),PLt=e=>T2(void 0,void 0,void 0,function*(){let t=yield E2(e);return t?t.configFile===`docs.json`?jd(kd(t.json)):Ad(t.json):null}),FLt=e=>T2(void 0,void 0,void 0,function*(){let t=yield E2(e);if(!t||t.configFile!==`docs.json`)return null;let n=jd(kd(t.json));return n.success?n.data:null});var ILt=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 LLt=e=>ILt(void 0,void 0,void 0,function*(){let t=yield FLt(e);if(!t)return[];let{generatedRoutes:n}=yield oB(t,t=>sB(t,e),{onSourceError:(e,t)=>console.warn(`Warning: Failed to load GraphQL schema ${e}: ${t}`)});return n});var RLt=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 zLt=e=>typeof e==`string`&&e!==``&&Pf(e)===void 0&&CJe(e)===void 0,D2=e=>{if(typeof e!=`object`||!e)return[];if(Array.isArray(e))return e.flatMap(D2);let t=e,n=[];if(typeof t.href==`string`&&n.push(t.href),zLt(t.root)&&n.push(t.root.startsWith(`/`)?t.root:`/${t.root}`),Array.isArray(t.pages))for(let e of t.pages)zLt(e)&&n.push(e.startsWith(`/`)?e:`/${e}`);for(let e of Object.values(t))n.push(...D2(e));return n},BLt=e=>RLt(void 0,void 0,void 0,function*(){let t=yield E2(e);if(t&&t.json.navigation)return{hrefs:D2(t.json.navigation),configFile:t.configFile}});var VLt=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 HLt=(e,t)=>VLt(void 0,void 0,void 0,function*(){let n=[];try{let r=yield FLt(e),i=r?uf(r):void 0,a=yield tnt(e,{explicitOverlays:i,fetchRemoteDocument:t?.fetchRemoteDocument});if(r){let o=yield ent(e,{explicitOverlays:i,fetchRemoteDocument:t?.fetchRemoteDocument}),s=yield ULt(r,o,t?.fetchRemoteDocument),c=[...a,...s],l={};try{yield q9e(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 tZe(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)]}),ULt=(e,t,n)=>VLt(void 0,void 0,void 0,function*(){try{return yield cB(`docs`,e,void 0,t,n)}catch(e){return console.warn(`Warning: Failed to fetch URL-based OpenAPI specs: ${e}`),[]}});var WLt=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 GLt=e=>WLt(void 0,void 0,void 0,function*(){let t=[],n=yield PLt(e);return n&&n.success&&`redirects`in n.data&&n.data.redirects&&t.push(...n.data.redirects),t}),KLt=[`ImportDefaultSpecifier`,`ImportNamespaceSpecifier`],qLt=e=>{let t=[],n=[],r=[],i=/* @__PURE__ */ new Set;m2(e,e=>{if(st(e)&<(e)){for(let n of e.data.estree.body){if(!f(n)||typeof n.source.value!=`string`)continue;let e=n.source.value;t.push(e);for(let t of n.specifiers)KLt.includes(t.type)&&r.push({source:e,name:t.local.name})}return}if(!g(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/`+y2(a))});for(let{source:e,name:t}of r)i.has(t)&&n.push(e);return{imported:t,rendered:n}},JLt=[`snippets/`,`_snippets/`],O2=e=>e.replaceAll(Pr,`/`),YLt=({originalPath:e,pathType:t,wrapper:n})=>n!==S2.IMPORT&&t===b2.INTERNAL&&!e.startsWith(`/`),XLt=(e,t)=>{var n;let r=new Map([...t.keys()].map(e=>[O2(e),e])),i=(e,t)=>e.flatMap(e=>{let n=WT(e,O2(t)),i=n&&r.get(y2(n));return i?[i]:[]}),a=/* @__PURE__ */ new Set;for(let[e,{imported:n}]of t){let t=O2(e).toLowerCase();JLt.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(YLt)??[])e.pagePaths.push(new C2(e.originalPath,i.relativeDir,i.filename,e.wrapper));for(let e of r?.headingSlugs??[])(n=i.headingSlugs)==null||n.add(e)}}},ZLt=(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(O2(e));let a=new Map([...e.snippetReferencesByFile.keys()].map(e=>[O2(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=WT(e,t);if(!n)continue;let i=y2(n);r.add(i),s(i)}};for(let e of[...t,...i])s(O2(e));return r};var k2=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 QLt=e=>{let t=/* @__PURE__ */ new Set;for(let n of e){t.add(KE(n.slug));for(let e of QLt(n.children))t.add(e)}return t},$Lt=/* @__PURE__ */ new Set([`ParamField`,`Param`,`ResponseField`]),eRt=/* @__PURE__ */ new Set([`query`,`path`,`body`,`header`,`name`]),tRt=e=>{let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map;return m2(e,`mdxJsxFlowElement`,e=>{if($Lt.has(e.name??``)){let r=e.attributes.find(e=>`name`in e&&eRt.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(TDe(r.value,e))}return}if(fNe.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=pNe.has(e.name??``)?KE(r.value):r.value;t.add(n)}}),t},nRt=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},rRt=(e,t,n)=>k2(void 0,void 0,void 0,function*(){let r={},i=()=>t=>{let n=/* @__PURE__ */ new Set;return m2(t,[`linkReference`,`imageReference`],e=>{`identifier`in e&&n.add(e.identifier)}),m2(t,t=>{let r=t.position?.start.line,i=r===void 0?void 0:s[r-1];if(t.type===`link`||t.type===`image`){e.addPath(t.url,S2.MD,i);return}if(t.type===`definition`){n.delete(t.identifier)&&e.addPath(t.url,S2.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=nRt(a.attributes[t]?.value);if(typeof n==`string`){e.addPath(n,S2.SRC,i);return}}else if(a.name===`a`||a.name===`Card`){let t=a.attributes.findIndex(e=>e.type===`mdxJsxAttribute`&&e.name===`href`),n=nRt(a.attributes[t]?.value);if(typeof n==`string`){e.addPath(n,S2.HREF,i);return}}}),t},a=Ny(t),o=O(a),s=pe(a),c=NT().use(cLt).use(i).use(Ije).use(Wje,r),l=c.parse(o),u=qLt(l);if(n?.checkSnippets)for(let t of u.imported)e.addPath(t,S2.IMPORT);yield c.run(l);let d=r.tableOfContents?QLt(r.tableOfContents):/* @__PURE__ */ new Set,f=tRt(l);return e.headingSlugs=/* @__PURE__ */ new Set([...d,...f]),u}),iRt=(e,t)=>k2(void 0,void 0,void 0,function*(){let n=e||process.cwd(),r=yield dF(n),i=new NLt(n,r),a=_2(n,r).filter(e=>!wP(e,r));i.addNodes(a);let o=yield GLt(n);i.setRedirects(o),i.addAliasNodes();try{let e=yield HLt(n,{fetchRemoteDocument:t?.fetchRemoteDocument});i.addVirtualNodes(e)}catch(e){console.warn(`Warning: Failed to extract OpenAPI page paths: ${e}`)}try{let e=yield LLt(n);i.addVirtualNodes(e)}catch(e){console.warn(`Warning: Failed to extract GraphQL page paths: ${e}`)}let s=yield BLt(n);if(s){let e=i.addNode(s.configFile);for(let t of s.hrefs){let n=t===`/`||t===``?`/index`:t.replace(/^\/#/,`/index#`);e.addPath(n)}}let c=OLt(n,r).filter(e=>!wP(e,r)),l=/* @__PURE__ */ new Map,u=0;return yield Promise.all(Array.from({length:Math.min(8,c.length)},()=>k2(void 0,void 0,void 0,function*(){for(;u<c.length;){let e=c[u++];if(e===void 0)continue;let r=i.getNode(e);if(!r)continue;let a=cF.default.readFileSync(vt.join(n,e)).toString();try{let n=yield rRt(r,a,{checkSnippets:t?.checkSnippets});l.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)}}}))),XLt(i,l),i.snippetReferencesByFile=l,i});var A2=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 aRt=e=>{try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}},oRt=(e,t)=>A2(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)}}),sRt=/* @__PURE__ */ new Set([404,405]),cRt=e=>A2(void 0,void 0,void 0,function*(){try{let t=yield oRt(e,`HEAD`),n=sRt.has(t)?yield oRt(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`}}}),lRt=(e,t,n)=>A2(void 0,void 0,void 0,function*(){let r=[],i=0,a=()=>A2(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}),uRt=(e,t)=>A2(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(aRt(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 lRt(r,e=>A2(void 0,void 0,void 0,function*(){let t=yield cRt(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 j2=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 dRt=/[*?]/,fRt=/\.mdx?$/i,pRt=/[.+^${}()|\\[\]]/,mRt=/* @__PURE__ */ new Set([`.git`,`node_modules`]);function hRt(e){return e.split(Rt.sep).join(`/`)}function gRt(e){return hRt(e).replace(/^\.\//,``)}function _Rt(e){let t=``,n=0;for(;n<e.length;){let r=e[n];r===`*`?e[n+1]===`*`?e[n+2]===`/`?(t+=`(?:[^/]+/)*`,n+=3):(t+=`.*`,n+=2):(t+=`[^/]*`,n+=1):r===`?`?(t+=`[^/]`,n+=1):(t+=pRt.test(r)?`\\${r}`:r,n+=1)}return RegExp(`^${t}$`)}function vRt(e){return j2(this,void 0,void 0,function*(){try{return(yield Wn.stat(e)).isFile()}catch{return!1}})}function yRt(e){return j2(this,arguments,void 0,function*(e,t=``){let n=yield Wn.readdir(Rt.join(e,t),{withFileTypes:!0}),r=[];for(let i of n){if(mRt.has(i.name))continue;let n=t?`${t}/${i.name}`:i.name;i.isDirectory()?r.push(...yield yRt(e,n)):r.push(n)}return r})}var bRt=class extends Error{};function xRt(e,t){return j2(this,void 0,void 0,function*(){let n=null,r=[],i=[];for(let a of t){let t=gRt(a);if(dRt.test(t)){n??=yield yRt(e);let o=_Rt(t),s=n.filter(e=>fRt.test(e)&&o.test(e)).sort();s.length===0?i.push(a):r.push(...s)}else(yield vRt(Rt.join(e,t)))?r.push(t):i.push(a)}if(i.length>0)throw new bRt(`No matching files for: ${i.join(`, `)} (globs match .md and .mdx files)`);return[...new Set(r)]})}var SRt=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 CRt=e=>{for(let t of e)OH((0,R.jsx)(bH,{message:t}));e.length>0&&OH((0,R.jsx)(yH,{message:`skipped ${e.length} file(s) that could not be parsed; links in them were not checked`}))},wRt=e=>{if(!e.trim())return`--links-to needs a page path, e.g. /guides/setup`;if(e.startsWith(`#`))return`--links-to needs a page path before the anchor, e.g. /guides/setup${e}`;if(e.startsWith(`//`)||URL.canParse(e))return`--links-to takes a page path, not a full URL: ${e}`},TRt=e=>SRt(void 0,void 0,void 0,function*(){yield Yjt();let t=e[`links-to`],n=t===void 0?void 0:wRt(t);if(n)OH((0,R.jsx)(bH,{message:n})),yield d1(1);else{OH((0,R.jsx)(vH,{message:t===void 0?`checking for broken links...`:`finding links to ${t}...`}));try{let n=yield qjt(a1),r=(e.files??[]).map(String).filter(Boolean),i=r.length>0?new Set((yield xRt(a1,r)).map(e=>vt.relative(n,vt.resolve(a1,e)))):void 0,a=/* @__PURE__ */ new Map,o=yield iRt(n,{checkSnippets:e[`check-snippets`],onParseError:(e,t)=>a.set(e,t.message)});o.precomputeFileResolutions();let s=i?ZLt(o,i,{checkAnchors:e[`check-anchors`],checkSnippets:e[`check-snippets`]}):void 0,c=[...a].filter(([e])=>!i||i.has(e)||s?.has(e.split(vt.sep).join(`/`))).map(([,e])=>e),l=({relativeDir:e,filename:t})=>!i||i.has(vt.join(e,t));if(t!==void 0){let e=o.getLinksTo(new C2(t)).filter(l);MH(),e.length>0?OH((0,R.jsx)(zat,{target:t,links:e.map(e=>({file:vt.join(e.relativeDir,e.filename),line:e.line,link:e.originalPath}))})):OH((0,R.jsx)(_H,{message:`no links to ${t} found`})),CRt(c),yield d1(0);return}let u=o.getBrokenInternalLinks({checkAnchors:e[`check-anchors`]}).filter(l),d={};if(u.forEach(e=>{let t=vt.join(e.relativeDir,e.filename),n=d[t];n?n.push(e.originalPath):d[t]=[e.originalPath]}),e[`check-external`]){let e=yield uRt(o,i?{sourceFiles:i}:void 0);for(let t of e)for(let e of t.sources){let n=t.status?`${t.url} (${t.status})`:`${t.url} (${t.error})`,r=d[e.file];r?r.push(n):d[e.file]=[n]}}if(e[`check-redirects`]){let e=o.getBrokenRedirects();if(e.length>0){let t=yield Wn.access(vt.join(n,`docs.json`)).then(()=>`docs.json`).catch(()=>`mint.json`),r=e.map(({source:e,destination:t})=>`${e} → ${t}`),i=d[t];i?i.push(...r):d[t]=r}}let f=Object.keys(d).length>0;!f&&c.length===0&&(MH(),OH((0,R.jsx)(_H,{message:`no broken links found`})),yield d1(0)),MH(),OH(f?(0,R.jsx)(Rat,{brokenLinksByFile:d}):(0,R.jsx)(_H,{message:`no broken links found in the files that parsed`})),CRt(c)}catch(e){OH((0,R.jsx)(bH,{message:e instanceof Error?e.message:`unknown error`})),yield d1(1)}yield d1(1)}});var ERt=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())})};function DRt(e,t){return()=>ERt(this,void 0,void 0,function*(){M1()?OH((0,R.jsx)(_H,{message:`Thanks for your interest in "${t} ${e}"! Your vote has been counted.`})):OH((0,R.jsx)(yH,{message:`Telemetry is disabled, so your vote won't be counted. Enable it with: ${t} --telemetry=true`})),OH((0,R.jsx)(pH,{dimColor:!0,children:`This feature is currently in development. Learn more at https://mintlify.com/docs`})),yield d1(0)})}var M2=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 ORt=F({status:at(`ready`),deploymentId:Ke().min(1),subdomain:Ke().min(1),remote:Le(),branch:at(`main`),expiresAt:Ie(),orgSlug:Ke().min(1).optional()}),kRt=Ae(`status`,[ORt.extend({code:at(`deployment_already_exists`)}),F({status:at(`provisioning`),code:at(`deployment_already_exists`),deploymentId:Ke().optional(),subdomain:Ke().optional()}),F({status:at(`expired`),code:Te([`deployment_already_exists`,`deployment_claim_expired`]),deploymentId:Ke(),subdomain:Ke(),expiresAt:Ie().optional()})]),ARt=F({remote:Le(),branch:at(`main`),token:Ke().min(1),tokenExpiresAt:Ie()}),jRt=F({subdomain:Ke().min(1),trustedRepos:Ye(F({repositoryId:Ke(),repository:Ke(),branch:Ke()}))});function MRt(e,t,n){return M2(this,void 0,void 0,function*(){for(let r=0;r<4;r++){let i=yield z1(`${e}/api/agent/deployments/provision`,{method:`POST`,headers:{Authorization:`Bearer ${t}`,"Content-Type":`application/json`},body:JSON.stringify(Object.assign(Object.assign({},n),{docsPath:``}))});if(i.status!==409)return Object.assign(Object.assign({},yield B1(i,ORt)),{created:!0});let a=yield i.json().catch(()=>null),o=kRt.safeParse(a);if(!o.success)throw Error(`The deployment service returned an unexpected response.`);if(o.data.status!==`provisioning`)return Object.assign(Object.assign({},o.data),{created:!1});r<3&&(yield Fr(1e3*(r+1)))}throw Error(`Your site is still provisioning. Run the same command again.`)})}function NRt(e,t){return M2(this,void 0,void 0,function*(){return B1(yield z1(`${e}/api/agent/deployments/token`,{method:`POST`,headers:{Authorization:`Bearer ${t}`}}),ARt)})}function PRt(e,t,n){return M2(this,void 0,void 0,function*(){return B1(yield z1(`${e}/api/agent/deployments/github-actions/token`,{method:`POST`,headers:{Authorization:`Bearer ${t}`,"Content-Type":`application/json`},body:JSON.stringify({subdomain:n})}),ARt)})}function FRt(e,t,n){return M2(this,void 0,void 0,function*(){return B1(yield z1(`${e}/api/agent/deployments/trusted-repos`,{method:`POST`,headers:{Authorization:`Bearer ${t}`,"Content-Type":`application/json`},body:JSON.stringify(n)}),jRt)})}var IRt=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())})};function LRt(e,t){return IRt(this,arguments,void 0,function*(e,t,n=()=>{}){let{apiUrl:r}=e,i=Rt.resolve(e.directory),a=JSON.stringify([new URL(r).origin,i]),o=xMt(a);n(`Authenticating agent...`);let s=e.newSite?null:yield $Mt(r,i).catch(()=>{if(o)throw Error(`Could not read this site’s saved credentials. Unlock your keyring or use --new for another site.`);return t(`Could not read the keyring. Continuing with a new registration for this run.`),null}),c=e.subdomain??(e.newSite?void 0:o?.subdomain);if(!c)throw Error(`Choose a site name with --subdomain <name>.`);let l=yield H1(r),u=e.base?`workspace`:`site`,d=e=>eNt(r,i,e);for(let i=0;i<2;i++){let i=s??(yield WMt(l));n0(`agent_signup.discovered`,{registration_id:i.registrationId}),s||n0(`agent_signup.registered`,{registration_id:i.registrationId}),yield d(i);let o=yield U1(l,i);yield d(o);let f=yield GMt(r,o.accessToken);if(f.registrationId!==i.registrationId)throw Error(`Agent identity does not match the saved registration.`);if(f.identityType===`user_bound`)return{status:`claimed`};n(`Provisioning the ${e.base?`base`:`site`} and repository...`);let p=yield MRt(r,o.accessToken,Object.assign({subdomain:c,orgName:e.orgName},e.base&&{projectType:u}));if(p.status===`expired`){t(`The previous anonymous site expired. Creating a new registration and site.`),s=null;continue}n0(`cli.deploy.provisioned`,{registration_id:i.registrationId,deployment_id:p.deploymentId,subdomain:p.subdomain,created:p.created}),yield SMt(a,{registrationId:i.registrationId,subdomain:p.subdomain}).catch(()=>t(`Could not save the site name locally. Provide --subdomain on your next invocation.`)),n(`Getting repository write access...`);let m=yield NRt(r,o.accessToken);if(m.remote!==p.remote)throw Error(`Repository credentials do not match the provisioned site.`);return{status:`ready`,projectType:u,site:p,write:m,created:p.created,credentials:o}}throw Error(`The new anonymous site is already expired. Please retry later.`)})}function N2(e,t){let n=new URL(e).hostname===`leaves-dev.mintlify.com`?`mint-dev.mintlify.me`:`mintlify.site`;return new URL(`https://${t}.${n}`).toString()}function RRt(e){return e.orgSlug?new URL(`/${e.orgSlug}/${e.subdomain}/editor`,w1).toString():new URL(w1).toString()}function zRt(e,t){if(e.status===`claimed`)return`This site has been claimed. Manage it in the Mintlify dashboard. Use mint deploy --new --subdomain <name> to create another site.`;let{site:n,write:r}=e,i=[`Repository: ${n.remote}`,`Branch: ${n.branch}`,`Write token: ${r.token}`,`Write token expires: ${r.tokenExpiresAt}`];if(e.projectType===`workspace`)return[e.created?`Base provisioned.`:`Using the existing anonymous base.`,`Editor: ${RRt(n)}`,`Expires: ${n.expiresAt}. Claim it before then or it is deleted.`].join(`
|
|
2227
|
+
`&&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}}}}}};l2.prototype.tokenizeSentencePlugins=[jIt,OIt,NIt,PIt,MIt,c2],l2.prototype.tokenizeParagraphPlugins=[FIt,wIt,AIt,kIt,LIt,fIt,RIt,DIt,EIt,TIt,zIt,c2],l2.prototype.tokenizeRootPlugins=[DIt,EIt,zIt,c2];function VIt(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(a2(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 HIt(){let e=this;e.parser=t;function t(t){let n=new l2;return u2(n.tokenizeParagraphPlugins,e.data(`nlcstParagraphExtensions`)),u2(n.tokenizeRootPlugins,e.data(`nlcstRootExtensions`)),u2(n.tokenizeSentencePlugins,e.data(`nlcstSentenceExtensions`)),n.parse(t)}}function u2(e,t){t&&e.unshift(...t)}function UIt(){let e=this;e.compiler=WIt}function WIt(e){return a2(e)}const GIt=Je().use(HIt).use(UIt).freeze(),KIt=[`”`,`’`],qIt=[`“`,`‘`],JIt={};function YIt(e){let t=e||JIt,n=[];if(t.quotes!==!1&&n.push(iLt),t.ellipses===`spaced`?n.push(nLt):t.ellipses===`unspaced`?n.push(rLt):t.ellipses!==!1&&n.push(tLt),t.backticks===`all`){if(t.quotes!==!1)throw Error("Cannot accept `backticks: 'all'` with `quotes: true`");n.push(XIt)}else t.backticks!==!1&&n.push(ZIt);t.dashes===`inverted`?n.push($It):t.dashes===`oldschool`?n.push(eLt):t.dashes!==!1&&n.push(QIt);let r={close:t.closingQuotes?[t.closingQuotes.double,t.closingQuotes.single]:KIt,open:t.openingQuotes?[t.openingQuotes.double,t.openingQuotes.single]:qIt};return function(e){p(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 XIt(e,t,n,r){ZIt(e,t,n,r),t.value==="`"?t.value=`‘`:t.value===`'`&&(t.value=`’`)}function ZIt(e,t){t.value==="``"?t.value=`“`:t.value===`''`&&(t.value=`”`)}function QIt(e,t){t.value===`--`&&(t.value=`—`)}function $It(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 eLt(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 tLt(e,t,n,r){nLt(e,t,n,r),rLt(e,t,n,r)}function nLt(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 rLt(e,t){/^\.{3,}$/.test(t.value)&&(t.value=`…`)}function iLt(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?a2(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 aLt=/* @__PURE__ */ new Set([`text`,`inlineCode`,`paragraph`]),oLt=/* @__PURE__ */ new Set([`style`,`script`]),sLt=(e,t,n)=>n&&(n.type!==`mdxJsxTextElement`||`name`in n&&typeof n.name==`string`&&!oLt.has(n.name))&&aLt.has(e.type)&&(d2(e)||f2(e)),cLt=e=>{let t=GIt().use(YIt,{...e,ellipses:!1,dashes:!1,backticks:!1}),n=GIt().use(YIt,{...e,quotes:!1});return e=>{let r=``,i=0,a=[];p(e,sLt,e=>{d2(e)?r+=e.type===`text`?e.value:`A`.repeat(e.value.length):f2(e)&&(r+=` `),a.push(e)}),/["']/.test(r)&&(r=t.processSync(r).toString());for(let e of a)if(d2(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 f2(e)&&(i+=1)}};function d2(e){return`value`in e&&typeof e.value==`string`}function f2(e){return e.type===`paragraph`}const lLt=(function(e){if(e==null)return pLt;if(typeof e==`string`)return fLt(e);if(typeof e==`object`)return Array.isArray(e)?uLt(e):dLt(e);if(typeof e==`function`)return p2(e);throw Error(`Expected function, string, or object as test`)});function uLt(e){let t=[],n=-1;for(;++n<e.length;)t[n]=lLt(e[n]);return p2(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}}function dLt(e){return p2(t);function t(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function fLt(e){return p2(t);function t(t){return t&&t.type===e}}function p2(e){return t;function t(t,...n){return!!(t&&typeof t==`object`&&`type`in t&&e.call(this,t,...n))}}function pLt(){return!0}function mLt(e){return`\x1B[33m`+e+`\x1B[39m`}const hLt=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null);let i=lLt(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 (`+mLt(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=[],u,d,f;if((!t||i(e,s,c[c.length-1]||null))&&(l=gLt(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 gLt(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:[e]}const m2=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null),hLt(e,t,i,r);function i(e,t){let r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}}),_Lt=[`.mdx`,`.md`],vLt=[`.jpeg`,`.jpg`,`.jfif`,`.pjpeg`,`.pjp`,`.png`,`.svg`,`.svgz`,`.ico`,`.webp`,`.gif`,`.apng`,`.avif`,`.bmp`,`.mp4`,`.css`,`.xml`],yLt=e=>!(e.dir===`node_modules`||e.dir.startsWith(`node_modules/`)),bLt=e=>!(e.dir===`.github`||e.dir.startsWith(`.github/`)),h2=e=>_Lt.includes(e.ext),xLt=e=>vLt.includes(e.ext),SLt=e=>h2(e)||xLt(e),CLt=e=>e.map(v2).map(Tt).filter(yLt),wLt=e=>CLt(e).filter(h2).filter(bLt),TLt=e=>CLt(e).filter(SLt).filter(bLt),ELt=e=>Ct(e.dir,e.base),DLt=e=>Ct(e.dir,e.name),g2=e=>e.split(`#`)[0].split(`?`)[0],OLt=(e,t=[])=>wLt(AP(e,e,t)).map(ELt),_2=(e,t=[])=>TLt(AP(e,e,t)).map(ELt),v2=e=>wt(y2(e)),y2=e=>e.startsWith(`/`)?e.slice(1):e;var b2;(function(e){e.INTERNAL=`internal`,e.EXTERNAL=`external`,e.DATA=`data`})(b2||={});const kLt=e=>{try{return decodeURIComponent(e)}catch{return e}},x2=e=>/[:*]/.test(e);var S2;(function(e){e.MD=`md`,e.SRC=`src`,e.HREF=`href`,e.CARD=`card`,e.IMPORT=`import`,e.DEFINITION=`definition`})(S2||={});var ALt;(function(e){e.CONTENT=`content`,e.NAVIGATION=`navigation`})(ALt||={});var C2=class e{static getPathType(e){let t;return t=URL.canParse(e)?b2.EXTERNAL:e.startsWith(`data:`)?b2.DATA:b2.INTERNAL,t}constructParsedPath(){let t=e.getPathType(this.originalPath),n,r;if(t===b2.INTERNAL){let e=new URL(`mintlify:/`);e.pathname=`/${this.relativeDir}/${this.filename}`.replaceAll(Pr,`/`),n=new URL(this.originalPath.replaceAll(Pr,`/`),e);let t=kLt(n.pathname).slice(1);t.endsWith(`/`)&&(t=t.slice(0,-1)),t===``&&(t=`.`),r=Tt(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===b2.INTERNAL?kLt(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=v2(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===b2.INTERNAL){let e=this.path;return Ct(e.dir,e.base)}return this.path.toString()}getResolvedFiles(e,t){if(this.pathType!==b2.INTERNAL||this.path instanceof URL)return[];let{dir:n,name:r,base:i}=Tt(this.toString()),a=[];return Xt(Ot(t,this.toString()))&&a.push(Ct(n,i)),a.push(...e.lookup(n,r,i)),a}keepsMdxExtension(){let e=this.wrapper===S2.DEFINITION?this.originalPath:this.wrapper===S2.MD||this.wrapper===S2.HREF?oMe(Ct(this.relativeDir,this.filename),this.originalPath,!0):void 0;return e!==void 0&&/\.mdx$/i.test(g2(e))}resolvesTo(e,t,n){return this.pathType===b2.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===b2.INTERNAL).map(e=>e.toString())}},jLt=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}=Tt(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)}},w2=class{constructor(e,t=[]){this.label=e,this.paths=t,this.edges=[],this.headingSlugs=null,this.relativeDir=v2(bt(e)),this.filename=yt(e),this.label=Ct(this.relativeDir,this.filename)}toString(){return this.label}equals(e){return this.label===e.label}addPath(e,t,n){let r=new C2(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}},MLt=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}},NLt=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}addNode(e){return this.nodes[e]||(this.nodes[e]=new w2(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 w2(t).toString())}setRedirects(e){this.configRedirects=e,this.redirectMap.clear();for(let t of e){let e=v2(t.source);this.redirectMap.has(e)||this.redirectMap.set(e,v2(t.destination))}this.wildcardRedirects=[...this.redirectMap].filter(([e])=>x2(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=C2.filterMapInternalPaths(nYe(this.baseDir,this.baseDir,this.mintIgnoreGlobs)).filter(e=>!wP(e,this.mintIgnoreGlobs));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===b2.INTERNAL&&i.anchorLink&&e.has(Ct(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=ALt.CONTENT){let r=new MLt(e,t,n);return this.edges.find(e=>e.equals(r)?(e.incrementCount(),!0):!1)||(this.edges.push(r),r)}addEdgesBetweenNodes(){let e=new jLt(_2(this.baseDir,this.mintIgnoreGlobs));for(let t of Object.values(this.nodes))for(let n of t.paths)if(n.pathType===b2.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 jLt(_2(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===b2.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=Ct(e,`index.mdx`),i=this.nodes[r]?r:Ct(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===b2.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=qE(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===b2.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=Tt(t),r=h2(n)?DLt(n):t;return yt(r)===`index`?bt(r):r}getPageCandidates(e){return e===`.`?[`index.mdx`,`index.md`]:[`${e}.mdx`,`${e}.md`,Ct(e,`index.mdx`),Ct(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=g2(e);return!n||x2(n)?!0:this.reachesPage(v2(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=v2(n);t.has(i)||(t.add(i),!URL.canParse(r)&&(x2(g2(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===b2.EXTERNAL);r.length>0&&e.set(t,r)}return e}getAllInternalPaths(){return Object.values(this.nodes).flatMap(e=>e.paths).filter(e=>e.pathType===b2.INTERNAL).map(e=>e.originalPath+` => `+e.toString())}},T2=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 E2=e=>T2(void 0,void 0,void 0,function*(){for(let t of[`docs.json`,`mint.json`]){let n=vt.join(e,t);if(cF.default.existsSync(n))try{let{resolved:r}=yield sF(yield cF.default.readJSON(n),e);if(r&&typeof r==`object`&&!Array.isArray(r))return{configFile:t,json:r}}catch(e){console.warn(`Warning: Failed to read or resolve ${t}: ${e}`)}}return null}),PLt=e=>T2(void 0,void 0,void 0,function*(){let t=yield E2(e);return t?t.configFile===`docs.json`?jd(kd(t.json)):Ad(t.json):null}),FLt=e=>T2(void 0,void 0,void 0,function*(){let t=yield E2(e);if(!t||t.configFile!==`docs.json`)return null;let n=jd(kd(t.json));return n.success?n.data:null});var ILt=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 LLt=e=>ILt(void 0,void 0,void 0,function*(){let t=yield FLt(e);if(!t)return[];let{generatedRoutes:n}=yield oB(t,t=>sB(t,e),{onSourceError:(e,t)=>console.warn(`Warning: Failed to load GraphQL schema ${e}: ${t}`)});return n});var RLt=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 zLt=e=>typeof e==`string`&&e!==``&&Pf(e)===void 0&&CJe(e)===void 0,D2=e=>{if(typeof e!=`object`||!e)return[];if(Array.isArray(e))return e.flatMap(D2);let t=e,n=[];if(typeof t.href==`string`&&n.push(t.href),zLt(t.root)&&n.push(t.root.startsWith(`/`)?t.root:`/${t.root}`),Array.isArray(t.pages))for(let e of t.pages)zLt(e)&&n.push(e.startsWith(`/`)?e:`/${e}`);for(let e of Object.values(t))n.push(...D2(e));return n},BLt=e=>RLt(void 0,void 0,void 0,function*(){let t=yield E2(e);if(t&&t.json.navigation)return{hrefs:D2(t.json.navigation),configFile:t.configFile}});var VLt=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 HLt=(e,t)=>VLt(void 0,void 0,void 0,function*(){let n=[];try{let r=yield FLt(e),i=r?uf(r):void 0,a=yield tnt(e,{explicitOverlays:i,fetchRemoteDocument:t?.fetchRemoteDocument});if(r){let o=yield ent(e,{explicitOverlays:i,fetchRemoteDocument:t?.fetchRemoteDocument}),s=yield ULt(r,o,t?.fetchRemoteDocument),c=[...a,...s],l={};try{yield q9e(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 tZe(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)]}),ULt=(e,t,n)=>VLt(void 0,void 0,void 0,function*(){try{return yield cB(`docs`,e,void 0,t,n)}catch(e){return console.warn(`Warning: Failed to fetch URL-based OpenAPI specs: ${e}`),[]}});var WLt=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 GLt=e=>WLt(void 0,void 0,void 0,function*(){let t=[],n=yield PLt(e);return n&&n.success&&`redirects`in n.data&&n.data.redirects&&t.push(...n.data.redirects),t}),KLt=[`ImportDefaultSpecifier`,`ImportNamespaceSpecifier`],qLt=e=>{let t=[],n=[],r=[],i=/* @__PURE__ */ new Set;m2(e,e=>{if(st(e)&<(e)){for(let n of e.data.estree.body){if(!f(n)||typeof n.source.value!=`string`)continue;let e=n.source.value;t.push(e);for(let t of n.specifiers)KLt.includes(t.type)&&r.push({source:e,name:t.local.name})}return}if(!g(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/`+y2(a))});for(let{source:e,name:t}of r)i.has(t)&&n.push(e);return{imported:t,rendered:n}},JLt=[`snippets/`,`_snippets/`],O2=e=>e.replaceAll(Pr,`/`),YLt=({originalPath:e,pathType:t,wrapper:n})=>n!==S2.IMPORT&&t===b2.INTERNAL&&!e.startsWith(`/`),XLt=(e,t)=>{var n;let r=new Map([...t.keys()].map(e=>[O2(e),e])),i=(e,t)=>e.flatMap(e=>{let n=WT(e,O2(t)),i=n&&r.get(y2(n));return i?[i]:[]}),a=/* @__PURE__ */ new Set;for(let[e,{imported:n}]of t){let t=O2(e).toLowerCase();JLt.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(YLt)??[])e.pagePaths.push(new C2(e.originalPath,i.relativeDir,i.filename,e.wrapper));for(let e of r?.headingSlugs??[])(n=i.headingSlugs)==null||n.add(e)}}},ZLt=(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(O2(e));let a=new Map([...e.snippetReferencesByFile.keys()].map(e=>[O2(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=WT(e,t);if(!n)continue;let i=y2(n);r.add(i),s(i)}};for(let e of[...t,...i])s(O2(e));return r};var k2=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 QLt=e=>{let t=/* @__PURE__ */ new Set;for(let n of e){t.add(KE(n.slug));for(let e of QLt(n.children))t.add(e)}return t},$Lt=/* @__PURE__ */ new Set([`ParamField`,`Param`,`ResponseField`]),eRt=/* @__PURE__ */ new Set([`query`,`path`,`body`,`header`,`name`]),tRt=e=>{let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map;return m2(e,`mdxJsxFlowElement`,e=>{if($Lt.has(e.name??``)){let r=e.attributes.find(e=>`name`in e&&eRt.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(TDe(r.value,e))}return}if(fNe.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=pNe.has(e.name??``)?KE(r.value):r.value;t.add(n)}}),t},nRt=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},rRt=(e,t,n)=>k2(void 0,void 0,void 0,function*(){let r={},i=()=>t=>{let n=/* @__PURE__ */ new Set;return m2(t,[`linkReference`,`imageReference`],e=>{`identifier`in e&&n.add(e.identifier)}),m2(t,t=>{let r=t.position?.start.line,i=r===void 0?void 0:s[r-1];if(t.type===`link`||t.type===`image`){e.addPath(t.url,S2.MD,i);return}if(t.type===`definition`){n.delete(t.identifier)&&e.addPath(t.url,S2.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=nRt(a.attributes[t]?.value);if(typeof n==`string`){e.addPath(n,S2.SRC,i);return}}else if(a.name===`a`||a.name===`Card`){let t=a.attributes.findIndex(e=>e.type===`mdxJsxAttribute`&&e.name===`href`),n=nRt(a.attributes[t]?.value);if(typeof n==`string`){e.addPath(n,S2.HREF,i);return}}}),t},a=Ny(t),o=O(a),s=pe(a),c=NT().use(cLt).use(i).use(Ije).use(Wje,r),l=c.parse(o),u=qLt(l);if(n?.checkSnippets)for(let t of u.imported)e.addPath(t,S2.IMPORT);yield c.run(l);let d=r.tableOfContents?QLt(r.tableOfContents):/* @__PURE__ */ new Set,f=tRt(l);return e.headingSlugs=/* @__PURE__ */ new Set([...d,...f]),u}),iRt=(e,t)=>k2(void 0,void 0,void 0,function*(){let n=e||process.cwd(),r=yield dF(n),i=new NLt(n,r),a=_2(n,r).filter(e=>!wP(e,r));i.addNodes(a);let o=yield GLt(n);i.setRedirects(o),i.addAliasNodes();try{let e=yield HLt(n,{fetchRemoteDocument:t?.fetchRemoteDocument});i.addVirtualNodes(e)}catch(e){console.warn(`Warning: Failed to extract OpenAPI page paths: ${e}`)}try{let e=yield LLt(n);i.addVirtualNodes(e)}catch(e){console.warn(`Warning: Failed to extract GraphQL page paths: ${e}`)}let s=yield BLt(n);if(s){let e=i.addNode(s.configFile);for(let t of s.hrefs){let n=t===`/`||t===``?`/index`:t.replace(/^\/#/,`/index#`);e.addPath(n)}}let c=OLt(n,r).filter(e=>!wP(e,r)),l=/* @__PURE__ */ new Map,u=0;return yield Promise.all(Array.from({length:Math.min(8,c.length)},()=>k2(void 0,void 0,void 0,function*(){for(;u<c.length;){let e=c[u++];if(e===void 0)continue;let r=i.getNode(e);if(!r)continue;let a=cF.default.readFileSync(vt.join(n,e)).toString();try{let n=yield rRt(r,a,{checkSnippets:t?.checkSnippets});l.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)}}}))),XLt(i,l),i.snippetReferencesByFile=l,i});var A2=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 aRt=e=>{try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}},oRt=(e,t)=>A2(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)}}),sRt=/* @__PURE__ */ new Set([404,405]),cRt=e=>A2(void 0,void 0,void 0,function*(){try{let t=yield oRt(e,`HEAD`),n=sRt.has(t)?yield oRt(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`}}}),lRt=(e,t,n)=>A2(void 0,void 0,void 0,function*(){let r=[],i=0,a=()=>A2(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}),uRt=(e,t)=>A2(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(aRt(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 lRt(r,e=>A2(void 0,void 0,void 0,function*(){let t=yield cRt(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 j2=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 dRt=/[*?]/,fRt=/\.mdx?$/i,pRt=/[.+^${}()|\\[\]]/,mRt=/* @__PURE__ */ new Set([`.git`,`node_modules`]);function hRt(e){return e.split(Rt.sep).join(`/`)}function gRt(e){return hRt(e).replace(/^\.\//,``)}function _Rt(e){let t=``,n=0;for(;n<e.length;){let r=e[n];r===`*`?e[n+1]===`*`?e[n+2]===`/`?(t+=`(?:[^/]+/)*`,n+=3):(t+=`.*`,n+=2):(t+=`[^/]*`,n+=1):r===`?`?(t+=`[^/]`,n+=1):(t+=pRt.test(r)?`\\${r}`:r,n+=1)}return RegExp(`^${t}$`)}function vRt(e){return j2(this,void 0,void 0,function*(){try{return(yield Wn.stat(e)).isFile()}catch{return!1}})}function yRt(e){return j2(this,arguments,void 0,function*(e,t=``){let n=yield Wn.readdir(Rt.join(e,t),{withFileTypes:!0}),r=[];for(let i of n){if(mRt.has(i.name))continue;let n=t?`${t}/${i.name}`:i.name;i.isDirectory()?r.push(...yield yRt(e,n)):r.push(n)}return r})}var bRt=class extends Error{};function xRt(e,t){return j2(this,void 0,void 0,function*(){let n=null,r=[],i=[];for(let a of t){let t=gRt(a);if(dRt.test(t)){n??=yield yRt(e);let o=_Rt(t),s=n.filter(e=>fRt.test(e)&&o.test(e)).sort();s.length===0?i.push(a):r.push(...s)}else(yield vRt(Rt.join(e,t)))?r.push(t):i.push(a)}if(i.length>0)throw new bRt(`No matching files for: ${i.join(`, `)} (globs match .md and .mdx files)`);return[...new Set(r)]})}var SRt=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 CRt=e=>{for(let t of e)OH((0,R.jsx)(bH,{message:t}));e.length>0&&OH((0,R.jsx)(yH,{message:`skipped ${e.length} file(s) that could not be parsed; links in them were not checked`}))},wRt=e=>{if(!e.trim())return`--links-to needs a page path, e.g. /guides/setup`;if(e.startsWith(`#`))return`--links-to needs a page path before the anchor, e.g. /guides/setup${e}`;if(e.startsWith(`//`)||URL.canParse(e))return`--links-to takes a page path, not a full URL: ${e}`},TRt=e=>SRt(void 0,void 0,void 0,function*(){yield Yjt();let t=e[`links-to`],n=t===void 0?void 0:wRt(t);if(n)OH((0,R.jsx)(bH,{message:n})),yield d1(1);else{OH((0,R.jsx)(vH,{message:t===void 0?`checking for broken links...`:`finding links to ${t}...`}));try{let n=yield qjt(a1),r=(e.files??[]).map(String).filter(Boolean),i=r.length>0?new Set((yield xRt(a1,r)).map(e=>vt.relative(n,vt.resolve(a1,e)))):void 0,a=/* @__PURE__ */ new Map,o=yield iRt(n,{checkSnippets:e[`check-snippets`],onParseError:(e,t)=>a.set(e,t.message)});o.precomputeFileResolutions();let s=i?ZLt(o,i,{checkAnchors:e[`check-anchors`],checkSnippets:e[`check-snippets`]}):void 0,c=[...a].filter(([e])=>!i||i.has(e)||s?.has(e.split(vt.sep).join(`/`))).map(([,e])=>e),l=({relativeDir:e,filename:t})=>!i||i.has(vt.join(e,t));if(t!==void 0){let e=o.getLinksTo(new C2(t)).filter(l);MH(),e.length>0?OH((0,R.jsx)(zat,{target:t,links:e.map(e=>({file:vt.join(e.relativeDir,e.filename),line:e.line,link:e.originalPath}))})):OH((0,R.jsx)(_H,{message:`no links to ${t} found`})),CRt(c),yield d1(0);return}let u=o.getBrokenInternalLinks({checkAnchors:e[`check-anchors`]}).filter(l),d={};if(u.forEach(e=>{let t=vt.join(e.relativeDir,e.filename),n=d[t];n?n.push(e.originalPath):d[t]=[e.originalPath]}),e[`check-external`]){let e=yield uRt(o,i?{sourceFiles:i}:void 0);for(let t of e)for(let e of t.sources){let n=t.status?`${t.url} (${t.status})`:`${t.url} (${t.error})`,r=d[e.file];r?r.push(n):d[e.file]=[n]}}if(e[`check-redirects`]){let e=o.getBrokenRedirects();if(e.length>0){let t=yield Wn.access(vt.join(n,`docs.json`)).then(()=>`docs.json`).catch(()=>`mint.json`),r=e.map(({source:e,destination:t})=>`${e} → ${t}`),i=d[t];i?i.push(...r):d[t]=r}}let f=Object.keys(d).length>0;!f&&c.length===0&&(MH(),OH((0,R.jsx)(_H,{message:`no broken links found`})),yield d1(0)),MH(),OH(f?(0,R.jsx)(Rat,{brokenLinksByFile:d}):(0,R.jsx)(_H,{message:`no broken links found in the files that parsed`})),CRt(c)}catch(e){OH((0,R.jsx)(bH,{message:e instanceof Error?e.message:`unknown error`})),yield d1(1)}yield d1(1)}});var ERt=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())})};function DRt(e,t){return()=>ERt(this,void 0,void 0,function*(){M1()?OH((0,R.jsx)(_H,{message:`Thanks for your interest in "${t} ${e}"! Your vote has been counted.`})):OH((0,R.jsx)(yH,{message:`Telemetry is disabled, so your vote won't be counted. Enable it with: ${t} --telemetry=true`})),OH((0,R.jsx)(pH,{dimColor:!0,children:`This feature is currently in development. Learn more at https://mintlify.com/docs`})),yield d1(0)})}var M2=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 ORt=F({status:at(`ready`),deploymentId:Ke().min(1),subdomain:Ke().min(1),remote:Le(),branch:at(`main`),expiresAt:Ie(),orgSlug:Ke().min(1).optional()}),kRt=Ae(`status`,[ORt.extend({code:at(`deployment_already_exists`)}),F({status:at(`provisioning`),code:at(`deployment_already_exists`),deploymentId:Ke().optional(),subdomain:Ke().optional()}),F({status:at(`expired`),code:Te([`deployment_already_exists`,`deployment_claim_expired`]),deploymentId:Ke(),subdomain:Ke(),expiresAt:Ie().optional()})]),ARt=F({remote:Le(),branch:at(`main`),token:Ke().min(1),tokenExpiresAt:Ie()}),jRt=F({subdomain:Ke().min(1),trustedRepos:Ye(F({repositoryId:Ke(),repository:Ke(),branch:Ke()}))});function MRt(e,t,n){return M2(this,void 0,void 0,function*(){for(let r=0;r<4;r++){let i=yield z1(`${e}/api/agent/deployments/provision`,{method:`POST`,headers:{Authorization:`Bearer ${t}`,"Content-Type":`application/json`},body:JSON.stringify(Object.assign(Object.assign({},n),{docsPath:``}))});if(i.status!==409)return Object.assign(Object.assign({},yield B1(i,ORt)),{created:!0});let a=yield i.json().catch(()=>null),o=kRt.safeParse(a);if(!o.success)throw Error(`The deployment service returned an unexpected response.`);if(o.data.status!==`provisioning`)return Object.assign(Object.assign({},o.data),{created:!1});r<3&&(yield Fr(1e3*(r+1)))}throw Error(`Your site is still provisioning. Run the same command again.`)})}function NRt(e,t){return M2(this,void 0,void 0,function*(){return B1(yield z1(`${e}/api/agent/deployments/token`,{method:`POST`,headers:{Authorization:`Bearer ${t}`}}),ARt)})}function PRt(e,t,n){return M2(this,void 0,void 0,function*(){return B1(yield z1(`${e}/api/agent/deployments/github-actions/token`,{method:`POST`,headers:{Authorization:`Bearer ${t}`,"Content-Type":`application/json`},body:JSON.stringify({subdomain:n})}),ARt)})}function FRt(e,t,n){return M2(this,void 0,void 0,function*(){return B1(yield z1(`${e}/api/agent/deployments/trusted-repos`,{method:`POST`,headers:{Authorization:`Bearer ${t}`,"Content-Type":`application/json`},body:JSON.stringify(n)}),jRt)})}var IRt=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())})};function LRt(e,t){return IRt(this,arguments,void 0,function*(e,t,n=()=>{}){let{apiUrl:r}=e,i=Rt.resolve(e.directory),a=JSON.stringify([new URL(r).origin,i]),o=xMt(a);n(`Authenticating agent...`);let s=e.newSite?null:yield $Mt(r,i).catch(()=>{if(o)throw Error(`Could not read this site’s saved credentials. Unlock your keyring or use --new for another site.`);return t(`Could not read the keyring. Continuing with a new registration for this run.`),null}),c=e.subdomain??(e.newSite?void 0:o?.subdomain);if(!c)throw Error(`Choose a site name with --subdomain <name>.`);let l=yield H1(r),u=e.base?`workspace`:`site`,d=e=>eNt(r,i,e);for(let i=0;i<2;i++){let i=s??(yield WMt(l));n0(`agent_signup.discovered`,{registration_id:i.registrationId}),s||n0(`agent_signup.registered`,{registration_id:i.registrationId}),yield d(i);let o=yield U1(l,i);yield d(o);let f=yield GMt(r,o.accessToken);if(f.registrationId!==i.registrationId)throw Error(`Agent identity does not match the saved registration.`);if(f.identityType===`user_bound`)return{status:`claimed`};n(`Provisioning the ${e.base?`knowledge base`:`site`} and repository...`);let p=yield MRt(r,o.accessToken,Object.assign({subdomain:c,orgName:e.orgName},e.base&&{projectType:u}));if(p.status===`expired`){t(`The previous anonymous site expired. Creating a new registration and site.`),s=null;continue}n0(`cli.deploy.provisioned`,{registration_id:i.registrationId,deployment_id:p.deploymentId,subdomain:p.subdomain,created:p.created}),yield SMt(a,{registrationId:i.registrationId,subdomain:p.subdomain}).catch(()=>t(`Could not save the site name locally. Provide --subdomain on your next invocation.`)),n(`Getting repository write access...`);let m=yield NRt(r,o.accessToken);if(m.remote!==p.remote)throw Error(`Repository credentials do not match the provisioned site.`);return{status:`ready`,projectType:u,site:p,write:m,created:p.created,credentials:o}}throw Error(`The new anonymous site is already expired. Please retry later.`)})}function N2(e,t){let n=new URL(e).hostname===`leaves-dev.mintlify.com`?`mint-dev.mintlify.me`:`mintlify.site`;return new URL(`https://${t}.${n}`).toString()}function RRt(e){return e.orgSlug?new URL(`/${e.orgSlug}/${e.subdomain}/editor`,w1).toString():new URL(w1).toString()}function zRt(e,t){if(e.status===`claimed`)return`This site has been claimed. Manage it in the Mintlify dashboard. Use mint deploy --new --subdomain <name> to create another site.`;let{site:n,write:r}=e,i=[`Repository: ${n.remote}`,`Branch: ${n.branch}`,`Write token: ${r.token}`,`Write token expires: ${r.tokenExpiresAt}`];if(e.projectType===`workspace`)return[e.created?`Knowledge base provisioned.`:`Using the existing anonymous knowledge base.`,`Editor: ${RRt(n)}`,`Expires: ${n.expiresAt}. Claim it before then or it is deleted.`].join(`
|
|
2228
2228
|
`);let a=N2(t,n.subdomain);return[e.created?`Repository provisioned; push required to build the site.`:`Using the existing anonymous repository; push any changes to build the site.`,`Site: ${a}`,`Expires: ${n.expiresAt}`,...i,`Commit and push your documentation to this repository to start the build.`,`The site link becomes available after the push and build complete.`].join(`
|
|
2229
2229
|
`)}var P2=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 BRt=F({value:Ke().min(1)});function VRt(e=process.env){return e.GITHUB_ACTIONS===`true`}function HRt(e,t){return P2(this,void 0,void 0,function*(){let n=e.ACTIONS_ID_TOKEN_REQUEST_URL,r=e.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!n||!r)throw Error("GitHub Actions did not provide an OIDC token. Add `permissions: id-token: write` to the workflow or job.");let i;try{i=yield fetch(`${n}&audience=${encodeURIComponent(t)}`,{headers:{Authorization:`Bearer ${r}`},signal:AbortSignal.timeout(3e4)})}catch{throw Error(`Could not request a GitHub Actions OIDC token. Retry the workflow.`)}let a=BRt.safeParse(yield i.json().catch(()=>null));if(!i.ok||!a.success)throw Error(`Could not get a GitHub Actions OIDC token (HTTP ${i.status}). Check that the workflow has \`permissions: id-token: write\`.`);return a.data.value})}function F2(e,t,n){return new Promise((r,i)=>{let a=Nr(`git`,e,{cwd:t,env:n,stdio:[`ignore`,`pipe`,`inherit`]}),o=``;a.stdout.on(`data`,e=>o+=e.toString()),a.on(`error`,i),a.on(`close`,t=>t===0?r(o.trim()):i(/* @__PURE__ */ Error(`git ${e[0]} failed`)))})}function URt(e,t){return P2(this,void 0,void 0,function*(){let n=yield F2([`rev-parse`,`HEAD:${yield F2([`rev-parse`,`--show-prefix`],e,t)}`],e,t),[r=``,i=``,a=``,o=``,s=``]=(yield F2([`log`,`-1`,`--format=%an%n%ae%n%aI%n%H%n%s`],e,t)).split(`
|
|
2230
|
-
`);return F2([`commit-tree`,n,`-m`,s,`-m`,`Deployed from ${t.GITHUB_REPOSITORY?`${t.GITHUB_REPOSITORY}@`:``}${o}`],e,Object.assign(Object.assign({},t),{GIT_AUTHOR_NAME:r,GIT_AUTHOR_EMAIL:i,GIT_AUTHOR_DATE:a,GIT_COMMITTER_NAME:r,GIT_COMMITTER_EMAIL:i}))})}function WRt(e,t,n,r){let i=Number(r.GIT_CONFIG_COUNT)||0,a=Buffer.from(`x-access-token:${n.token}`).toString(`base64`);return new Promise((o,s)=>{let c=Nr(`git`,[`push`,`--force`,n.remote,`${t}:refs/heads/${n.branch}`],{cwd:e,stdio:[`ignore`,`inherit`,`inherit`],env:Object.assign(Object.assign({},r),{GIT_CONFIG_COUNT:String(i+1),[`GIT_CONFIG_KEY_${i}`]:`http.${n.remote}.extraHeader`,[`GIT_CONFIG_VALUE_${i}`]:`Authorization: Basic ${a}`})}),l=()=>s(/* @__PURE__ */ Error(`git push to the site repository failed.`));c.on(`error`,l),c.on(`close`,e=>e===0?o():l())})}function GRt(e){return P2(this,arguments,void 0,function*(e,t=()=>{},n=process.env){let{apiUrl:r,subdomain:i}=e;if(!i)throw Error(`Pass the site name with --subdomain <name>.`);let a=Rt.resolve(e.directory),o=yield URt(a,n).catch(()=>{throw Error(`Could not read ${e.directory} from the checked-out commit. Run mint deploy after actions/checkout, with --directory inside the repository.`)});t(`Requesting a GitHub Actions identity token...`);let s=yield HRt(n,r);t(`Getting repository write access...`);let c;try{c=yield PRt(r,s,i)}catch(e){throw e instanceof LMt&&e.status===403?Error(`This repository/branch isn't trusted to deploy ${i}. Run \`mint deploy --github\` locally from this repository to trust it.`):e}return t(`Pushing to the site repository...`),yield WRt(a,o,c,n),N2(r,i)})}var KRt=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())})};function qRt(e,t){return KRt(this,void 0,void 0,function*(){let n=Object.assign(Object.assign({},process.env),{GIT_CONFIG_COUNT:`1`,GIT_CONFIG_KEY_0:`http.${t.remote}.extraHeader`,GIT_CONFIG_VALUE_0:`Authorization: Bearer ${t.token}`});yield F2([`fetch`,t.remote,t.branch],e,n),yield F2([`rebase`,`FETCH_HEAD`],e,n).catch(()=>{throw Error(`Could not rebase ${e} onto the latest ${t.branch}. Resolve the conflicts, run git rebase --continue, then rerun mint deploy --base --push ${e}.`)}),yield F2([`push`,t.remote,`HEAD:refs/heads/${t.branch}`],e,n)})}const JRt=[`No login is required. This command provisions a temporary site and returns repository access. Commit and push the documentation yourself; the CLI does not upload files.`,`Run from your documentation directory, or pass --directory. Put docs.json, pages, and assets at the hosted repository root.`,`Run again from the same documentation directory for the current anonymous site and a fresh write token. Use --new --subdomain <name> to create another site.`,`Claimed sites are managed in the dashboard. Confirmed expired sites start a new anonymous registration.`,`To hand the site to the user, run mint claim. Do not ask for their email: they sign in on the claim page with any account. If you already know the email of their Mintlify account, pass --email to prefill the sign-in. Show the link to the user; they sign in and click Confirm, and the site moves into their account. There is no code to relay. Run it from the original documentation directory, or pass --directory.`,`The output contains a short-lived write token. Do not paste it into public logs or save it in a Git remote.`,`Pass --github from the root of a GitHub repository to deploy on every push: it trusts the repository (via the gh CLI and the origin remote) to deploy the site and writes .github/workflows/mintlify.yml. Commit and push that workflow. Pass --directory to deploy a docs subdirectory of the repository as the site root. Use --force to overwrite a different existing workflow.`,`Pass --base to provision a base instead of a docs site. The output has the claim steps, a clone command, and the editor link; there is no site URL. Commit in the clone, then run mint deploy --base --push <clone-directory> to publish. --base cannot be combined with --github.`,"In GitHub Actions (GITHUB_ACTIONS=true), no agent credentials are used: the workflow needs `permissions: id-token: write`, --subdomain is required, and the current commit is force-pushed to the site from a trusted repository and branch."].join(`
|
|
2230
|
+
`);return F2([`commit-tree`,n,`-m`,s,`-m`,`Deployed from ${t.GITHUB_REPOSITORY?`${t.GITHUB_REPOSITORY}@`:``}${o}`],e,Object.assign(Object.assign({},t),{GIT_AUTHOR_NAME:r,GIT_AUTHOR_EMAIL:i,GIT_AUTHOR_DATE:a,GIT_COMMITTER_NAME:r,GIT_COMMITTER_EMAIL:i}))})}function WRt(e,t,n,r){let i=Number(r.GIT_CONFIG_COUNT)||0,a=Buffer.from(`x-access-token:${n.token}`).toString(`base64`);return new Promise((o,s)=>{let c=Nr(`git`,[`push`,`--force`,n.remote,`${t}:refs/heads/${n.branch}`],{cwd:e,stdio:[`ignore`,`inherit`,`inherit`],env:Object.assign(Object.assign({},r),{GIT_CONFIG_COUNT:String(i+1),[`GIT_CONFIG_KEY_${i}`]:`http.${n.remote}.extraHeader`,[`GIT_CONFIG_VALUE_${i}`]:`Authorization: Basic ${a}`})}),l=()=>s(/* @__PURE__ */ Error(`git push to the site repository failed.`));c.on(`error`,l),c.on(`close`,e=>e===0?o():l())})}function GRt(e){return P2(this,arguments,void 0,function*(e,t=()=>{},n=process.env){let{apiUrl:r,subdomain:i}=e;if(!i)throw Error(`Pass the site name with --subdomain <name>.`);let a=Rt.resolve(e.directory),o=yield URt(a,n).catch(()=>{throw Error(`Could not read ${e.directory} from the checked-out commit. Run mint deploy after actions/checkout, with --directory inside the repository.`)});t(`Requesting a GitHub Actions identity token...`);let s=yield HRt(n,r);t(`Getting repository write access...`);let c;try{c=yield PRt(r,s,i)}catch(e){throw e instanceof LMt&&e.status===403?Error(`This repository/branch isn't trusted to deploy ${i}. Run \`mint deploy --github\` locally from this repository to trust it.`):e}return t(`Pushing to the site repository...`),yield WRt(a,o,c,n),N2(r,i)})}var KRt=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())})};function qRt(e,t){return KRt(this,void 0,void 0,function*(){let n=Object.assign(Object.assign({},process.env),{GIT_CONFIG_COUNT:`1`,GIT_CONFIG_KEY_0:`http.${t.remote}.extraHeader`,GIT_CONFIG_VALUE_0:`Authorization: Bearer ${t.token}`});yield F2([`fetch`,t.remote,t.branch],e,n),yield F2([`rebase`,`FETCH_HEAD`],e,n).catch(()=>{throw Error(`Could not rebase ${e} onto the latest ${t.branch}. Resolve the conflicts, run git rebase --continue, then rerun mint deploy --knowledge-base --push ${e}.`)}),yield F2([`push`,t.remote,`HEAD:refs/heads/${t.branch}`],e,n)})}const JRt=[`No login is required. This command provisions a temporary site and returns repository access. Commit and push the documentation yourself; the CLI does not upload files.`,`Run from your documentation directory, or pass --directory. Put docs.json, pages, and assets at the hosted repository root.`,`Run again from the same documentation directory for the current anonymous site and a fresh write token. Use --new --subdomain <name> to create another site.`,`Claimed sites are managed in the dashboard. Confirmed expired sites start a new anonymous registration.`,`To hand the site to the user, run mint claim. Do not ask for their email: they sign in on the claim page with any account. If you already know the email of their Mintlify account, pass --email to prefill the sign-in. Show the link to the user; they sign in and click Confirm, and the site moves into their account. There is no code to relay. Run it from the original documentation directory, or pass --directory.`,`The output contains a short-lived write token. Do not paste it into public logs or save it in a Git remote.`,`Pass --github from the root of a GitHub repository to deploy on every push: it trusts the repository (via the gh CLI and the origin remote) to deploy the site and writes .github/workflows/mintlify.yml. Commit and push that workflow. Pass --directory to deploy a docs subdirectory of the repository as the site root. Use --force to overwrite a different existing workflow.`,`Pass --knowledge-base to provision a knowledge base instead of a docs site. The output has the claim steps, a clone command, and the editor link; there is no site URL. Commit in the clone, then run mint deploy --knowledge-base --push <clone-directory> to publish. --knowledge-base cannot be combined with --github.`,"In GitHub Actions (GITHUB_ACTIONS=true), no agent credentials are used: the workflow needs `permissions: id-token: write`, --subdomain is required, and the current commit is force-pushed to the site from a trusted repository and branch."].join(`
|
|
2231
2231
|
|
|
2232
|
-
`),YRt=[`To hand the site to the user, run mint claim from the same documentation directory (or repeat --directory). Do not ask for their email first; they sign in on the claim page with any account.`,`Show them the claim link it prints. They sign in and click Confirm; there is no code to relay and nothing more to run.`],XRt=e=>e?[`3. Claim the base last. Send the user this link: ${e}`,` They sign in with any account and click Confirm. There is no code to relay.`]:[`3. Claim the base last. Run mint claim, without asking the user for an email.`,` Send the user the claim link it prints. They sign in with any account and click Confirm. There is no code to relay.`];function ZRt(e,t){let{site:n,write:r}=e,i=n.subdomain;return[`
|
|
2233
|
-
Next steps:`,`1. Clone the base into ./${i}:`,` git -c http.${r.remote}.extraHeader="Authorization: Bearer ${r.token}" clone ${r.remote} ${i}`,` The clone command works until ${r.tokenExpiresAt}. Run mint deploy --base again for a fresh one.`,`2. Commit your changes in ./${i}, then publish them:`,` mint deploy --base --push ${i}`,` This rebases onto the latest main and pushes. Do not run git push yourself.`,...XRt(t),` After the claim, the user opens the base at the editor link above and edits it there. The CLI can no longer push to it.`,`Run every mint command from this directory (or repeat --directory).`].join(`
|
|
2232
|
+
`),YRt=[`To hand the site to the user, run mint claim from the same documentation directory (or repeat --directory). Do not ask for their email first; they sign in on the claim page with any account.`,`Show them the claim link it prints. They sign in and click Confirm; there is no code to relay and nothing more to run.`],XRt=e=>e?[`3. Claim the knowledge base last. Send the user this link: ${e}`,` They sign in with any account and click Confirm. There is no code to relay.`]:[`3. Claim the knowledge base last. Run mint claim, without asking the user for an email.`,` Send the user the claim link it prints. They sign in with any account and click Confirm. There is no code to relay.`];function ZRt(e,t){let{site:n,write:r}=e,i=n.subdomain;return[`
|
|
2233
|
+
Next steps:`,`1. Clone the knowledge base into ./${i}:`,` git -c http.${r.remote}.extraHeader="Authorization: Bearer ${r.token}" clone ${r.remote} ${i}`,` The clone command works until ${r.tokenExpiresAt}. Run mint deploy --knowledge-base again for a fresh one.`,`2. Commit your changes in ./${i}, then publish them:`,` mint deploy --knowledge-base --push ${i}`,` This rebases onto the latest main and pushes. Do not run git push yourself.`,...XRt(t),` After the claim, the user opens the knowledge base at the editor link above and edits it there. The CLI can no longer push to it.`,`Run every mint command from this directory (or repeat --directory).`].join(`
|
|
2234
2234
|
`)}function QRt(e,t){return e.status===`ready`?e.projectType===`workspace`?ZRt(e,t):[`
|
|
2235
2235
|
Next steps:`,`1. Clone the hosted repository into a separate directory. Do not replace the user’s existing Git remote.`,`2. Copy the selected documentation into its root, including docs.json, .md/.mdx pages, images, and other required assets. Exclude credentials, .env files, node_modules, and .git.`,`3. Commit the documentation. For subsequent updates, fetch the hosted main branch and commit on top of it. Do not force-push.`,`4. Push to main. Supply the write token as an HTTP Authorization: Bearer header for this Git operation only; never embed it in the remote URL or persist it in Git config.`,`5. If the write token expires, run mint deploy again from the same documentation directory to obtain a fresh token.`,`A successful push starts the normal build. Provisioning and Git success do not confirm build success.`,``,`Git examples (POSIX shell): set REPOSITORY_URL and WRITE_TOKEN from the output above. Set CHECKOUT_DIR to a new directory outside the source documentation directory. Keep the token private and do not enable shell tracing.`,'GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="http.${REPOSITORY_URL}.extraHeader" GIT_CONFIG_VALUE_0="Authorization: Bearer ${WRITE_TOKEN}" git clone "$REPOSITORY_URL" "$CHECKOUT_DIR"',`After copying and committing the documentation:`,'GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="http.${REPOSITORY_URL}.extraHeader" GIT_CONFIG_VALUE_0="Authorization: Bearer ${WRITE_TOKEN}" git -C "$CHECKOUT_DIR" push origin HEAD:main',`These settings apply only to that Git process. Use the same authentication settings for later fetches.`,``,...t?[`Claim link for the user: ${t}`,`Show this link to the user. They open it, sign in, and click Confirm; the site moves into their account. Do not sign in on their behalf. There is no code to relay.`]:YRt].join(`
|
|
2236
2236
|
`):``}var I2=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 $Rt=F({id:Me().int().positive(),full_name:Ke().regex(/^[\w.-]+\/[\w.-]+$/),default_branch:Ke().min(1)}),L2=Rt.join(`.github`,`workflows`,`mintlify.yml`);function R2(e,t,n){return new Promise((r,i)=>{Mr(e,t,{cwd:n},(e,t)=>e?i(e):r(String(t).trim()))})}function ezt(e){let t=e.trim().match(/^(?:https:\/\/(?:[^@/]+@)?github\.com\/|ssh:\/\/git@github\.com(?::\d+)?\/|git@github\.com:)([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);return t?.[1]&&t[2]?{owner:t[1],repo:t[2]}:null}function tzt(e,t,n=``){let r=/^[\w./-]+$/.test(n)?n:JSON.stringify(n);return[`name: Deploy to Mintlify`,`on:`,` push:`,` branches: [${JSON.stringify(e)}]`,...n?[` paths: [${JSON.stringify(`${n}/**`)}, ".github/workflows/mintlify.yml"]`]:[],`permissions:`,` id-token: write`,` contents: read`,`concurrency:`,` group: mintlify-deploy`,` cancel-in-progress: true`,`jobs:`,` deploy:`,` runs-on: ubuntu-latest`,` steps:`,` - uses: actions/checkout@v4`,` - run: npx mint@latest deploy --subdomain ${t}${n?` --directory ${r}`:``}`,``].join(`
|
|
@@ -2331,6 +2331,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2331
2331
|
`}var J5t=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())})};function q9(e,t){return J5t(this,void 0,void 0,function*(){let n=yield O1(`${C1}/api/cli/workflows${e}`,Object.assign(Object.assign({},t),{headers:Object.assign({Accept:`application/json`},t?.headers)}));if(!n.ok){let e=yield n.text().catch(()=>``);throw Error(`API error (${n.status}): ${e||n.statusText}`)}return n.json()})}function Y5t(e,t){return q9(`/${encodeURIComponent(e)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})}function X5t(e){return q9(`/${encodeURIComponent(e)}`)}function Z5t(e,t){return q9(`/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`DELETE`})}const J9=[`changelog`,`source-code-agent`,`translations`,`writing-style`,`typo-check`,`broken-link-detection`,`seo-metadata-audit`,`assistant-docs-updates`,`contextual-feedback-docs-updates`];var Y9=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())})};function X9(e){return e.format===`json`?`json`:`table`}function Z9(e,t){e===`table`?OH((0,R.jsx)(pH,{children:t})):process.stdout.write(t+`
|
|
2332
2332
|
`)}function Q9(e){if(!e)throw Error("No subdomain set. Pass --subdomain, or run `mint config set subdomain <name>`.");return e}function Q5t(e){return Y9(this,void 0,void 0,function*(){let t=Rt.isAbsolute(e)?e:Rt.join(a1,e),n=yield Wn.readFile(t,`utf-8`);return/\.ya?ml$/i.test(t)?ne.load(n):JSON.parse(n)})}function $5t(e){let t=(e.pushRepo??[]).map(String).filter(Boolean);if(e.cron&&t.length>0)throw Error(`Specify either --cron or --push-repo, not both.`);if(e.cron)return{cron:e.cron};if(t.length>0)return{push:t.map(e=>({repo:e}))};throw Error(`A trigger is required. Pass --cron <expr> or --push-repo <owner/repo>.`)}function e7t(e){if(!e.name)throw Error(`--name is required when --file is not provided.`);let t=e.type;if(t!==void 0&&!J9.includes(t))throw Error(`Invalid --type "${t}". Valid types: ${J9.join(`, `)}`);let n={name:e.name,on:$5t(e)};e.prompt&&(n.prompt=e.prompt),t&&(n.type=t),e.automerge!==void 0&&(n.automerge=e.automerge);let r=(e.contextRepo??[]).map(String).filter(Boolean);return r.length>0&&(n.context=r.map(e=>({repo:e}))),n}function t7t(e){return`webhook`in e?`webhook`:`cron`in e?`cron(${e.cron})`:`push`in e?`push(${e.push.map(e=>e.repo).join(`, `)})`:`composio(${e.composio.toolkit}:${e.composio.triggerSlug})`}function n7t(e){let t=[];return t.push(eY.bold(`\nAutomation ${e.name}`)),t.push(` ${eY.dim(`ID`)} ${e._id}`),t.push(` ${eY.dim(`Status`)} ${e.status}`),e.type&&t.push(` ${eY.dim(`Type`)} ${e.type}`),t.push(` ${eY.dim(`Trigger`)} ${t7t(e.trigger)}`),e.automerge!==void 0&&t.push(` ${eY.dim(`Automerge`)} ${e.automerge}`),t.join(`
|
|
2333
2333
|
`)}function r7t(e){if(e.length===0)return`No automations found.`;let t=e.map(e=>[e._id,e.name,e.type??`—`,t7t(e.trigger),e.status]),n=[`ID`,`Name`,`Type`,`Trigger`,`Status`],r=n.map((e,n)=>Math.max(e.length,...t.map(e=>String(e[n]).length))),i=e=>e.map((e,t)=>e.padEnd(r[t])).join(` `);return[eY.bold(i(n)),...t.map(i)].join(`
|
|
2334
|
-
`)}const i7t=e=>e.option(`subdomain`,{type:`string`,description:`Documentation subdomain (default: mint config set subdomain)`}),a7t=e=>e.option(`format`,{type:`string`,choices:[`table`,`json`],description:`Output format (table=pretty, json=raw)`}),o7t=e=>e.middleware(AFt).command(`create`,`Create a new automation`,e=>a7t(i7t(e).option(`name`,{type:`string`,description:`Automation name`}).option(`prompt`,{type:`string`,description:`Automation prompt`}).option(`type`,{type:`string`,choices:J9,description:`Automation type`}).option(`cron`,{type:`string`,description:`Cron expression for a scheduled trigger`}).option(`push-repo`,{type:`string`,array:!0,description:`Repository (owner/repo) for a push trigger (repeatable)`}).option(`context-repo`,{type:`string`,array:!0,description:`Additional context repository (repeatable)`}).option(`automerge`,{type:`boolean`,description:`Automatically merge PRs opened by this automation`}).option(`file`,{type:`string`,description:`Path to a JSON or YAML file with the full automation body`})).example(`mint automations create --name Translations --cron "0 6 * * *" --type translations`,``).example(`mint automations create --file automation.yaml`,``),e=>Y9(void 0,void 0,void 0,function*(){let t=X9(e);try{let n=Q9(e.subdomain),r=e.file?yield Q5t(e.file):e7t(e);t===`table`&&OH((0,R.jsx)(vH,{message:`Creating automation...`}));let i=yield Y5t(n,r);t===`table`&&NH(),n0(`cli.automation.created`,{subdomain:n,type:i.type,triggerKind:t7t(i.trigger).split(`(`)[0]}),t===`json`?Z9(t,JSON.stringify(i,null,2)):(OH((0,R.jsx)(_H,{message:`Created automation ${i._id}`})),Z9(t,n7t(i))),yield d1(0)}catch(e){t===`table`&&NH();let n=e instanceof Error?e.message:`unknown error`;t===`json`?process.stderr.write(`Error: ${n}\n`):OH((0,R.jsx)(bH,{message:n})),yield d1(1)}})).command(`list`,`List automations for the current deployment`,e=>a7t(i7t(e)),e=>Y9(void 0,void 0,void 0,function*(){let t=X9(e);try{let n=Q9(e.subdomain);t===`table`&&OH((0,R.jsx)(vH,{message:`Fetching automations...`}));let r=yield X5t(n);t===`table`&&NH(),t===`json`?Z9(t,JSON.stringify(r,null,2)):Z9(t,r7t(r)),yield d1(0)}catch(e){t===`table`&&NH();let n=e instanceof Error?e.message:`unknown error`;t===`json`?process.stderr.write(`Error: ${n}\n`):OH((0,R.jsx)(bH,{message:n})),yield d1(1)}})).command(`delete <id>`,`Delete an automation by ID`,e=>a7t(i7t(e)).positional(`id`,{type:`string`,demandOption:!0,description:`Automation schema ID`}),e=>Y9(void 0,void 0,void 0,function*(){let t=X9(e);try{let n=Q9(e.subdomain);t===`table`&&OH((0,R.jsx)(vH,{message:`Deleting automation...`})),yield Z5t(n,e.id),t===`table`&&NH(),t===`json`?Z9(t,JSON.stringify({success:!0,id:e.id},null,2)):OH((0,R.jsx)(_H,{message:`Deleted automation ${e.id}`})),yield d1(0)}catch(e){t===`table`&&NH();let n=e instanceof Error?e.message:`unknown error`;t===`json`?process.stderr.write(`Error: ${n}\n`):OH((0,R.jsx)(bH,{message:n})),yield d1(1)}})).demandCommand(1,`specify a subcommand: create, list, or delete`);var $9=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 s7t=e=>{if(!process.stdout.isTTY||p1()||process.env.CLI_TEST_MODE===`true`)return!1;if(e.length===0)return!0;let t=e.filter(e=>!e.startsWith(`-`)),n=t[0],r=n===void 0||n===`help`&&t.length===1,i=n===`help`||e.includes(`--help`)||e.includes(`-h`);return r&&i},c7t=e=>$9(void 0,void 0,void 0,function*(){let{cli:t}=s1(e),n=N1(`subdomain`),r=!1;try{r=!!(yield x1())}catch{}process.stdout.write(q5t({packageName:e,version:t,signedIn:r,subdomain:n})),yield cIt(e,void 0),yield d1(0)}),l7t=({packageName:e=`mint`})=>{let t=wxt(process.argv);if(s7t(t))return c7t(e);let n=NBt();return Dat((0,R.jsx)(Bat,{})),kSt(t).scriptName(e).option(`telemetry`,{type:`boolean`,alias:`t`,description:`Enable or disable usage telemetry`}).middleware(e=>$9(void 0,void 0,void 0,function*(){e.telemetry!==void 0&&e._.length===0&&(yield CMt(e.telemetry),yield gNt({enabled:e.telemetry}),OH((0,R.jsx)(_H,{message:`telemetry ${e.telemetry?`enabled`:`disabled`}`})),yield d1(0))}),!0).middleware(Gjt).middleware(rMt).middleware(n).middleware(t=>cIt(e,t._[0])).command(`agent`,`Set up AI coding agents for Mintlify`,e=>e.command(`setup`,`Install Mintlify skills and configure Admin MCP`,e=>e.exitProcess(!1).option(`agent`,{alias:`a`,type:`string`,array:!0,choices:J0,description:`Agents to configure (defaults to interactive selection)`}).option(`global`,{alias:`g`,type:`boolean`,default:!1,description:`Set up agents for your user account instead of this project`}).example(`$0 agent setup`,`Choose agents and set up the current project`).example(`$0 agent setup --agent codex --global`,`Set up Codex for your user account`).epilog(`Requires Node.js 22.20 or later and npm. Admin MCP requires a separate OAuth sign-in in each agent.`),e=>$9(void 0,void 0,void 0,function*(){try{yield OFt({agents:e.agent,global:e.global}),yield d1(0)}catch(e){process.stderr.write(`${e instanceof Error?e.message:`Agent setup failed.`}\n`),yield d1(1)}})).demandCommand(1,`Run mint agent setup to configure your coding agents.`)).command(`claim`,`Claim a site created with mint deploy`,e=>e.option(`email`,{type:`string`,description:`Email of the user's Mintlify account, if known, to prefill sign-in`}).option(`code`,{type:`string`,description:`Code returned by the user from the claim page`}).option(`directory`,{type:`string`,default:`.`,description:`Original documentation directory used for mint deploy`}).conflicts(`code`,`email`).example(`$0 claim`,`Get a claim link for the current site`).example(`$0 claim --code ABCDEFGH`,`Finish a claim from an older claim link that showed a code`).epilog(`Run from the same directory as mint deploy, or pass --directory. Do not ask the user for an email; they sign in on the claim page with any account. Ask the user to open the claim link and click Confirm; there is no code to relay. --code only finishes claims from older claim links. The CLI reads saved credentials internally; do not read or print keychain secrets. Retry the same command if Mintlify signup fails.`),e=>$9(void 0,void 0,void 0,function*(){try{let t=yield SNt({apiUrl:C1,directory:e.directory,code:e.code,email:e.email},e=>process.stderr.write(`${e}\n`));process.stdout.write(`${t}\n`),yield d1(0)}catch(e){process.stderr.write(`${e instanceof Error?e.message:`Claim failed.`}\n`),yield d1(1)}})).command(`deploy`,`Provision an anonymous docs site and get Git push instructions`,e=>e.option(`subdomain`,{type:`string`,description:`Requested site name; required for the first deployment or --new`}).option(`org-name`,{type:`string`,description:`Organization display name`}).option(`directory`,{type:`string`,default:`.`,description:`Documentation directory associated with this site`}).option(`new`,{type:`boolean`,default:!1,description:`Create a new registration and site`}).option(`email`,{type:`string`,description:`Also print a claim link, prefilled with this Mintlify account email`}).option(`github`,{type:`boolean`,description:`Trust this GitHub repository to deploy the site and write a GitHub Actions workflow`}).option(`force`,{type:`boolean`,default:!1,description:`With --github, overwrite an existing .github/workflows/mintlify.yml`}).option(`base`,{type:`boolean`,description:`Provision a base, edited in the Mintlify editor, instead of a docs site`}).option(`push`,{type:`string`,description:`With --base, rebase this clone onto main and push it to the base`}).
|
|
2334
|
+
`)}const i7t=e=>e.option(`subdomain`,{type:`string`,description:`Documentation subdomain (default: mint config set subdomain)`}),a7t=e=>e.option(`format`,{type:`string`,choices:[`table`,`json`],description:`Output format (table=pretty, json=raw)`}),o7t=e=>e.middleware(AFt).command(`create`,`Create a new automation`,e=>a7t(i7t(e).option(`name`,{type:`string`,description:`Automation name`}).option(`prompt`,{type:`string`,description:`Automation prompt`}).option(`type`,{type:`string`,choices:J9,description:`Automation type`}).option(`cron`,{type:`string`,description:`Cron expression for a scheduled trigger`}).option(`push-repo`,{type:`string`,array:!0,description:`Repository (owner/repo) for a push trigger (repeatable)`}).option(`context-repo`,{type:`string`,array:!0,description:`Additional context repository (repeatable)`}).option(`automerge`,{type:`boolean`,description:`Automatically merge PRs opened by this automation`}).option(`file`,{type:`string`,description:`Path to a JSON or YAML file with the full automation body`})).example(`mint automations create --name Translations --cron "0 6 * * *" --type translations`,``).example(`mint automations create --file automation.yaml`,``),e=>Y9(void 0,void 0,void 0,function*(){let t=X9(e);try{let n=Q9(e.subdomain),r=e.file?yield Q5t(e.file):e7t(e);t===`table`&&OH((0,R.jsx)(vH,{message:`Creating automation...`}));let i=yield Y5t(n,r);t===`table`&&NH(),n0(`cli.automation.created`,{subdomain:n,type:i.type,triggerKind:t7t(i.trigger).split(`(`)[0]}),t===`json`?Z9(t,JSON.stringify(i,null,2)):(OH((0,R.jsx)(_H,{message:`Created automation ${i._id}`})),Z9(t,n7t(i))),yield d1(0)}catch(e){t===`table`&&NH();let n=e instanceof Error?e.message:`unknown error`;t===`json`?process.stderr.write(`Error: ${n}\n`):OH((0,R.jsx)(bH,{message:n})),yield d1(1)}})).command(`list`,`List automations for the current deployment`,e=>a7t(i7t(e)),e=>Y9(void 0,void 0,void 0,function*(){let t=X9(e);try{let n=Q9(e.subdomain);t===`table`&&OH((0,R.jsx)(vH,{message:`Fetching automations...`}));let r=yield X5t(n);t===`table`&&NH(),t===`json`?Z9(t,JSON.stringify(r,null,2)):Z9(t,r7t(r)),yield d1(0)}catch(e){t===`table`&&NH();let n=e instanceof Error?e.message:`unknown error`;t===`json`?process.stderr.write(`Error: ${n}\n`):OH((0,R.jsx)(bH,{message:n})),yield d1(1)}})).command(`delete <id>`,`Delete an automation by ID`,e=>a7t(i7t(e)).positional(`id`,{type:`string`,demandOption:!0,description:`Automation schema ID`}),e=>Y9(void 0,void 0,void 0,function*(){let t=X9(e);try{let n=Q9(e.subdomain);t===`table`&&OH((0,R.jsx)(vH,{message:`Deleting automation...`})),yield Z5t(n,e.id),t===`table`&&NH(),t===`json`?Z9(t,JSON.stringify({success:!0,id:e.id},null,2)):OH((0,R.jsx)(_H,{message:`Deleted automation ${e.id}`})),yield d1(0)}catch(e){t===`table`&&NH();let n=e instanceof Error?e.message:`unknown error`;t===`json`?process.stderr.write(`Error: ${n}\n`):OH((0,R.jsx)(bH,{message:n})),yield d1(1)}})).demandCommand(1,`specify a subcommand: create, list, or delete`);var $9=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 s7t=e=>{if(!process.stdout.isTTY||p1()||process.env.CLI_TEST_MODE===`true`)return!1;if(e.length===0)return!0;let t=e.filter(e=>!e.startsWith(`-`)),n=t[0],r=n===void 0||n===`help`&&t.length===1,i=n===`help`||e.includes(`--help`)||e.includes(`-h`);return r&&i},c7t=e=>$9(void 0,void 0,void 0,function*(){let{cli:t}=s1(e),n=N1(`subdomain`),r=!1;try{r=!!(yield x1())}catch{}process.stdout.write(q5t({packageName:e,version:t,signedIn:r,subdomain:n})),yield cIt(e,void 0),yield d1(0)}),l7t=({packageName:e=`mint`})=>{let t=wxt(process.argv);if(s7t(t))return c7t(e);let n=NBt();return Dat((0,R.jsx)(Bat,{})),kSt(t).scriptName(e).option(`telemetry`,{type:`boolean`,alias:`t`,description:`Enable or disable usage telemetry`}).middleware(e=>$9(void 0,void 0,void 0,function*(){e.telemetry!==void 0&&e._.length===0&&(yield CMt(e.telemetry),yield gNt({enabled:e.telemetry}),OH((0,R.jsx)(_H,{message:`telemetry ${e.telemetry?`enabled`:`disabled`}`})),yield d1(0))}),!0).middleware(Gjt).middleware(rMt).middleware(n).middleware(t=>cIt(e,t._[0])).command(`agent`,`Set up AI coding agents for Mintlify`,e=>e.command(`setup`,`Install Mintlify skills and configure Admin MCP`,e=>e.exitProcess(!1).option(`agent`,{alias:`a`,type:`string`,array:!0,choices:J0,description:`Agents to configure (defaults to interactive selection)`}).option(`global`,{alias:`g`,type:`boolean`,default:!1,description:`Set up agents for your user account instead of this project`}).example(`$0 agent setup`,`Choose agents and set up the current project`).example(`$0 agent setup --agent codex --global`,`Set up Codex for your user account`).epilog(`Requires Node.js 22.20 or later and npm. Admin MCP requires a separate OAuth sign-in in each agent.`),e=>$9(void 0,void 0,void 0,function*(){try{yield OFt({agents:e.agent,global:e.global}),yield d1(0)}catch(e){process.stderr.write(`${e instanceof Error?e.message:`Agent setup failed.`}\n`),yield d1(1)}})).demandCommand(1,`Run mint agent setup to configure your coding agents.`)).command(`claim`,`Claim a site created with mint deploy`,e=>e.option(`email`,{type:`string`,description:`Email of the user's Mintlify account, if known, to prefill sign-in`}).option(`code`,{type:`string`,description:`Code returned by the user from the claim page`}).option(`directory`,{type:`string`,default:`.`,description:`Original documentation directory used for mint deploy`}).conflicts(`code`,`email`).example(`$0 claim`,`Get a claim link for the current site`).example(`$0 claim --code ABCDEFGH`,`Finish a claim from an older claim link that showed a code`).epilog(`Run from the same directory as mint deploy, or pass --directory. Do not ask the user for an email; they sign in on the claim page with any account. Ask the user to open the claim link and click Confirm; there is no code to relay. --code only finishes claims from older claim links. The CLI reads saved credentials internally; do not read or print keychain secrets. Retry the same command if Mintlify signup fails.`),e=>$9(void 0,void 0,void 0,function*(){try{let t=yield SNt({apiUrl:C1,directory:e.directory,code:e.code,email:e.email},e=>process.stderr.write(`${e}\n`));process.stdout.write(`${t}\n`),yield d1(0)}catch(e){process.stderr.write(`${e instanceof Error?e.message:`Claim failed.`}\n`),yield d1(1)}})).command(`deploy`,`Provision an anonymous docs site and get Git push instructions`,e=>e.option(`subdomain`,{type:`string`,description:`Requested site name; required for the first deployment or --new`}).option(`org-name`,{type:`string`,description:`Organization display name`}).option(`directory`,{type:`string`,default:`.`,description:`Documentation directory associated with this site`}).option(`new`,{type:`boolean`,default:!1,description:`Create a new registration and site`}).option(`email`,{type:`string`,description:`Also print a claim link, prefilled with this Mintlify account email`}).option(`github`,{type:`boolean`,description:`Trust this GitHub repository to deploy the site and write a GitHub Actions workflow`}).option(`force`,{type:`boolean`,default:!1,description:`With --github, overwrite an existing .github/workflows/mintlify.yml`}).option(`knowledge-base`,{type:`boolean`,description:`Provision a knowledge base, edited in the Mintlify editor, instead of a docs site`}).option(`base`,{type:`boolean`,hidden:!0}).option(`push`,{type:`string`,description:`With --knowledge-base, rebase this clone onto main and push it to the knowledge base`}).check(e=>e.push===void 0||e.knowledgeBase||e.base?!0:`--push requires --knowledge-base`).conflicts(`push`,`email`).conflicts(`github`,`email`).conflicts(`knowledge-base`,`github`).conflicts(`base`,`github`).example(`$0 deploy --subdomain my-docs`,`Provision a site without signing in`).example(`$0 deploy --email you@example.com`,`Get repository access and a claim link for the current site`).example(`$0 deploy --new --subdomain another-site`,`Create another anonymous site`).example(`$0 deploy --knowledge-base --subdomain my-knowledge-base`,`Provision a knowledge base and get its editor link`).example(`$0 deploy --github --subdomain my-docs`,`Deploy the site from GitHub Actions on every push to the default branch`).example(`$0 deploy --subdomain my-docs`,`In GitHub Actions with id-token: write, push the current commit to a trusted site`).epilog(JRt),e=>$9(void 0,void 0,void 0,function*(){try{if(e.base&&process.stderr.write(`Warning: --base is deprecated and will be removed in a future release. Use --knowledge-base instead.
|
|
2335
|
+
`),VRt()){let t=yield GRt({apiUrl:C1,directory:e.directory,subdomain:e.subdomain},e=>process.stderr.write(`${e}\n`));process.stdout.write(`Pushed to ${e.subdomain}; the build starts now.\nSite: ${t}\n`),yield d1(0);return}if(e.github){let t=yield ozt({apiUrl:C1,directory:e.directory,subdomain:e.subdomain,orgName:e.orgName,newSite:e.new,force:e.force},e=>process.stderr.write(`Warning: ${e}\n`),e=>process.stderr.write(`${e}\n`));process.stdout.write(`${szt(t)}\n`),yield d1(0);return}let t=yield LRt({apiUrl:C1,directory:e.directory,subdomain:e.subdomain,orgName:e.orgName,newSite:e.new,base:e.knowledgeBase||e.base},e=>{process.stderr.write(`Warning: ${e}\n`)},e=>process.stderr.write(`${e}\n`));if(e.push&&t.status===`ready`){yield qRt(e.push,t.write),process.stdout.write(`Pushed ${e.push} to the knowledge base.\nEditor: ${RRt(t.site)}\n`),yield d1(0);return}process.stdout.write(`${zRt(t,C1)}\n`);let n;if(e.email&&t.status===`ready`)try{process.stderr.write(`Creating the claim link...
|
|
2335
2336
|
`),n=yield yNt(C1,t.credentials,e.email)}catch(e){let t=e instanceof Error?` ${e.message}`:``;process.stderr.write(`Warning: Could not create the claim link.${t} Your site is provisioned; run mint claim for a claim link.\n`)}process.stdout.write(`${QRt(t,n)}\n`),yield d1(0)}catch(e){process.stderr.write(`${e instanceof Error?e.message:`Deployment failed.`}\n`),yield d1(1)}})).command(`dev`,`Initialize a local preview environment`,e=>e.option(`open`,{type:`boolean`,default:!0,description:`open a local preview in the browser`}).option(`local-schema`,{type:`boolean`,default:!1,hidden:!0,description:`use a locally hosted schema file (note: only https protocol is supported in production)`}).option(`client-version`,{type:`string`,hidden:!0,description:`the version of the client to use for cli testing`}).option(`local-client-version`,{type:`string`,hidden:!0,description:`path to local client repo to symlink for development`}).option(`groups`,{type:`array`,description:`Mock user groups for local development and testing`,example:`--groups admin user`}).option(`signed-in`,{type:`boolean`,default:!1,description:`Mock a signed-in user with no groups for local development and testing`}).option(`disable-openapi`,{type:`boolean`,default:!1,description:`Disable OpenAPI file generation`}).option(`disable-prefetch`,{type:`boolean`,default:!1,description:`Disable navigation prefetching in the local preview`}).option(`host`,{type:`boolean`,default:!1,description:`Expose the local preview on your network`}).option(`classic`,{type:`boolean`,default:!1,description:`Preview with the classic client`}).usage(`usage: mintlify dev [options]`).example(`mintlify dev`,`run with default settings (opens in browser)`).example(`mintlify dev --no-open`,`run without opening in browser`),t=>$9(void 0,void 0,void 0,function*(){yield Yjt();let n=yield Wjt(t),{cli:r}=s1(e),i,a;try{i=(yield x1())??void 0,a=N1(`subdomain`)??(i?(yield R1(i))[0]:void 0)}catch{}n==null?(OH((0,R.jsx)(bH,{message:`no available port found`})),yield d1(1)):yield Xbt(Object.assign(Object.assign({},t),{groups:t.groups??(t.signedIn?[]:void 0),port:n,packageName:e,cliVersion:r,accessToken:i,subdomain:a,apiUrl:C1}))})).command(`validate`,`Check the docs: content, OpenAPI specs, then a strict build. Exits 0 with no errors, 1 with errors, 2 when validate itself could not run`,e=>e.option(`local-schema`,{type:`boolean`,default:!1,hidden:!0,description:`use a locally hosted schema file`}).option(`client-version`,{type:`string`,hidden:!0,description:`the version of the client to use for cli testing`}).option(`groups`,{type:`array`,description:`Mock user groups for validation`}).option(`files`,{type:`string`,array:!0,description:`Limit page checks to these files or globs; site-wide checks and the build still cover the whole site`}).option(`build`,{type:`boolean`,default:!0,description:`Run the strict build after the other checks pass; --no-build skips it, so no client download is needed. Remote OpenAPI specs are still fetched unless openapi rules are disabled`}).option(`enable`,{type:`string`,array:!0,coerce:R5t,description:`Turn on rules or groups (comma-separated), for example after --disable all`}).option(`disable`,{type:`string`,array:!0,coerce:R5t,description:`Turn off rules or groups (comma-separated), or all; parse errors are still reported`}).option(`fix`,{type:`boolean`,default:!1,description:`Apply the fixes and check again`}).option(`format`,{type:`string`,choices:[`text`,`json`],default:`text`,description:`Output format; json prints one report ({ passed, summary, diagnostics, build }) and nothing else on stdout, and errors to stderr`}).usage(`usage: mint validate [options]`).epilogue([`Groups: ${B9.join(`, `)}. Rules:`,...z9.map(({id:e,description:t})=>` ${e} — ${t}`),` parse-error — ${N9.description} (always runs)`].join(`
|
|
2336
2337
|
`)).example(`mint validate`,`run every check and the build`).example(`mint validate --no-build --format json`,`fast offline check for scripts and agents`).example(`mint validate --files "guides/**/*.mdx" --fix`,`check some pages and apply fixes`).example(`mint validate --disable all --enable content`,`run the content rules only; missing-file and import-error still run the build`).strict(),t=>H5t(t,e)).command(`export`,`Export a static site for air-gapped deployment`,e=>e.option(`output`,{type:`string`,default:`export.zip`,description:`output zip file path`}).option(`client-version`,{type:`string`,hidden:!0}).option(`local-client-version`,{type:`string`,hidden:!0,description:`path to local client repo to symlink for development`}).option(`groups`,{type:`array`,description:`Mock user groups for export`}).option(`base-path`,{type:`string`,description:`path prefix the export will be served under, e.g. /docs`}).option(`disable-openapi`,{type:`boolean`,default:!1,description:`Disable OpenAPI file generation`}).option(`classic`,{type:`boolean`,default:!1,description:`Export with the classic client`}).usage(`usage: mintlify export [options]`).example(`mintlify export`,`export as export.zip`).example(`mintlify export --output docs.zip`,`export to custom filename`).example(`mintlify export --base-path /docs`,`export for hosting under /docs`),t=>$9(void 0,void 0,void 0,function*(){let{cli:n}=s1(e);yield Uht(Object.assign(Object.assign({},t),{packageName:e,cliVersion:n})),yield d1(0)})).command(`openapi-check <filename>`,!1,e=>e.positional(`filename`,{describe:`the filename of the OpenAPI spec (e.g. ./openapi.yaml) or the URL to the OpenAPI spec (e.g. https://petstore3.swagger.io/api/v3/openapi.json)`,type:`string`,demandOption:!0}).option(`local-schema`,{type:`boolean`,default:!1,description:`use a locally hosted schema file (note: only https protocol is supported in production)`}),e=>$9(void 0,[e],void 0,function*({filename:e,"local-schema":t}){OH((0,R.jsx)(yH,{message:"openapi-check is deprecated, use `mintlify validate` instead"}));let n;try{n=yield C6t(t)}catch(e){OH((0,R.jsx)(bH,{message:e instanceof Error?e.message:String(e)})),yield d1(1);return}let r=yield T6t(e,t,n);yield d1(+!r)})).command(`broken-links`,`Check for broken links`,e=>e.option(`files`,{type:`string`,array:!0,description:`Files or globs to check (defaults to the whole site)`}).option(`check-anchors`,{type:`boolean`,default:!1,description:`also validate anchor links (e.g. #section) against heading slugs`}).option(`check-external`,{type:`boolean`,default:!1,description:`also check external links for broken URLs`}).option(`check-snippets`,{type:`boolean`,default:!1,description:`also check links inside <Snippet> components`}).option(`check-redirects`,{type:`boolean`,default:!1,description:`also check that docs.json redirect destinations resolve to valid paths`}).option(`links-to`,{type:`string`,description:`list every internal link that points to this page (e.g. /guides/setup or /guides/setup#install) instead of checking for broken links`}).example(`mint broken-links --files introduction.mdx`,`Check a specific page`).example(`mint broken-links --files "guides/**/*.mdx"`,`Check pages matching a glob`).example(`mint broken-links --links-to /guides/setup`,`List links to a page`),e=>TRt(e)).command(`instructions [topics..]`,`Print Mintlify workflow instructions for agents`,e=>e.positional(`topics`,{type:`string`,array:!0,default:[],description:`Topic and optional subtopic`}).example(`mint instructions`,`List topics`).example(`mint instructions publish domain`,`Custom domain instructions`),e=>$9(void 0,[e],void 0,function*({topics:e}){if(e.length===0){process.stdout.write(jzt()),yield d1(0);return}let t;try{t=yield Pzt(e)}catch(e){OH((0,R.jsx)(bH,{message:e instanceof Error?e.message:String(e)})),yield d1(1);return}yield new Promise(e=>process.stdout.write(t,()=>e())),yield d1(0)})).command(`status`,`View current authentication status`,()=>void 0,()=>$9(void 0,void 0,void 0,function*(){yield AMt(),yield d1(0)})).command(`logout`,`Logout of your Mintlify account`,()=>void 0,()=>$9(void 0,void 0,void 0,function*(){yield bBt(),yield d1(0)})).command(`login`,`Authenticate your account to Mintlify`,()=>void 0,()=>$9(void 0,void 0,void 0,function*(){yield gBt(),yield d1(0)})).command(`signup`,`Create a new Mintlify account`,e=>e.option(`firstName`,{type:`string`,description:`First name`}).option(`lastName`,{type:`string`,description:`Last name`}).option(`company`,{type:`string`,description:`Company name`}).option(`email`,{type:`string`,description:`Email address`}).epilogue(`Note: this command does not return until the user clicks the verification link sent to their email, which can take several minutes. Non-interactive or scripted callers should run it as a background process rather than waiting on it synchronously.`),e=>$9(void 0,void 0,void 0,function*(){yield W6t({firstName:e.firstName,lastName:e.lastName,company:e.company,email:e.email}),yield d1(0)})).command(`add-domain <domain>`,`Add a custom domain to your deployment`,e=>e.positional(`domain`,{type:`string`,demandOption:!0,description:`The custom domain to add (e.g. docs.example.com)`}).option(`basePath`,{type:`string`,description:`Serve the docs under a base path (e.g. /docs)`}),e=>$9(void 0,void 0,void 0,function*(){yield PMt(e.domain,e.basePath),yield d1(0)})).command(`feedback <message>`,`Send feedback to the Mintlify team`,e=>e.positional(`message`,{type:`string`,demandOption:!0,description:`Feedback to send. Leave out API keys, tokens, and other secrets`}).option(`client-id`,{type:`string`,demandOption:!0,description:`ID for this report, so the team can tell retries apart`}).option(`category`,{choices:lzt,demandOption:!0,description:`Feedback category`}).example(`$0 feedback "mint dev crashes on a missing image" --client-id 7f3a --category bug`,`Report a bug`).epilog(`Never include API keys, tokens, passwords, or other secrets in the message.`),e=>$9(void 0,void 0,void 0,function*(){let t=yield dzt({message:e.message,clientId:e.clientId,category:e.category});yield d1(+!t)})).command(`config`,`Manage CLI configuration`,e=>e.command(`set <key> <value>`,`Set a configuration value`,e=>e.positional(`key`,{type:`string`,demandOption:!0,description:`Config key (e.g. subdomain)`}).positional(`value`,{type:`string`,demandOption:!0,description:`Config value`}),e=>$9(void 0,void 0,void 0,function*(){let t=[`subdomain`,`dateFrom`,`dateTo`,`autoUpdate`];t.includes(e.key)?(yield P1(e.key,e.value),OH((0,R.jsx)(_H,{message:`${e.key} = "${e.value}"`})),yield d1(0)):(OH((0,R.jsx)(bH,{message:`Unknown config key: "${e.key}". Valid keys: ${t.join(`, `)}`})),yield d1(1))})).command(`get <key>`,`Get a configuration value`,e=>e.positional(`key`,{type:`string`,demandOption:!0,description:`Config key (e.g. subdomain, dateFrom, dateTo, autoUpdate)`}),e=>$9(void 0,void 0,void 0,function*(){let t=[`subdomain`,`dateFrom`,`dateTo`,`autoUpdate`];if(!t.includes(e.key)){OH((0,R.jsx)(bH,{message:`Unknown config key: "${e.key}". Valid keys: ${t.join(`, `)}`})),yield d1(1);return}let n=N1(e.key);OH((0,R.jsx)(pH,{children:n??`not set`})),yield d1(0)})).command(`clear <key>`,`Remove a configuration value`,e=>e.positional(`key`,{type:`string`,demandOption:!0,description:`Config key (e.g. subdomain, dateFrom, dateTo, autoUpdate)`}),e=>$9(void 0,void 0,void 0,function*(){let t=[`subdomain`,`dateFrom`,`dateTo`,`autoUpdate`];t.includes(e.key)?(yield wMt(e.key),OH((0,R.jsx)(_H,{message:`${e.key} cleared`})),yield d1(0)):(OH((0,R.jsx)(bH,{message:`Unknown config key: "${e.key}". Valid keys: ${t.join(`, `)}`})),yield d1(1))})).demandCommand(1,`specify a subcommand: set, get, or clear`)).command(`update`,`Update the CLI to the latest version`,()=>void 0,()=>$9(void 0,void 0,void 0,function*(){yield q6t({packageName:e}),yield d1(0)})).command([`a11y`,`accessibility-check`,`a11y-check`,`accessibility`],`Check for accessibility issues in documentation`,e=>e.option(`skip-contrast`,{type:`boolean`,default:!1,description:`Skip color contrast checks`}).option(`skip-alt-text`,{type:`boolean`,default:!1,description:`Skip alt text checks on images and videos`}).check(e=>{if(e.skipContrast&&e.skipAltText)throw Error(`Cannot skip both contrast and alt-text checks`);return!0}).example(`mint a11y`,`Run all accessibility checks`).example(`mint a11y --skip-contrast`,`Only check for missing alt text`).example(`mint a11y --skip-alt-text`,`Only check color contrast`),e=>$9(void 0,void 0,void 0,function*(){let t=0,n=0;e.skipContrast||(t=yield sMt()),e.skipAltText||(n=yield TBt()),yield d1(t||n)})).command(`og [page]`,`Render the social preview (OG) image for a page`,e=>e.positional(`page`,{type:`string`,description:`Page path, such as guides/webhooks. Defaults to index`}).option(`preset`,{choices:Os.shape.preset.unwrap().options,description:`Try a preset without editing docs.json`}).option(`surface`,{choices:Os.shape.surface.unwrap().options,description:`Try a surface without editing docs.json`}).option(`appearance`,{choices:Os.shape.appearance.unwrap().options,description:`Try an appearance without editing docs.json`}).option(`output`,{type:`string`,description:`Where to write the PNG. Defaults to a temporary file`}).option(`open`,{type:`boolean`,default:!0,description:`Open the image after rendering. Use --no-open in CI`}).example(`mint og guides/webhooks`,`Render one page and open it`).example(`mint og --preset headline --surface brand`,`Try settings on the home page`).example(`mint og --output og.png --no-open`,`Render to a file in CI`),e=>$9(void 0,void 0,void 0,function*(){yield d1(yield b6t(e))})).command([`version`,`v`],`Display the current version of the CLI and client`,()=>void 0,()=>$9(void 0,void 0,void 0,function*(){let{cli:t,client:n}=s1(e);OH((0,R.jsxs)(pH,{children:[(0,R.jsx)(pH,{bold:!0,color:`green`,children:`cli version`}),` `,t]})),OH((0,R.jsxs)(pH,{children:[(0,R.jsx)(pH,{bold:!0,color:`green`,children:`client version`}),` `,n]}))})).command(`new [directory]`,`Create a new Mintlify documentation site`,e=>e.positional(`directory`,{describe:`The directory to initialize your documentation`,type:`string`,default:`.`}).option(`theme`,{type:`string`,description:`Theme for the documentation site`}).option(`name`,{type:`string`,description:`Name of the documentation project`}).option(`template`,{type:`string`,description:`Use a template as a starting point`}).option(`force`,{type:`boolean`,default:!1,description:`Create the documentation in a subdirectory`}),e=>$9(void 0,[e],void 0,function*({directory:e,theme:t,name:n,force:r,template:i}){try{yield Dzt(e,r,t,n,i),yield d1(0)}catch(e){OH((0,R.jsx)(bH,{message:e instanceof Error?e.message:`error occurred`})),yield d1(1)}})).command(`analytics`,`View analytics for your documentation`,eIt).command([`automations`,`workflow`,`workflows`],`Create and manage automations`,o7t).command(`score [url]`,`Run agent readiness checks on a docs site`,e=>e.positional(`url`,{type:`string`,description:`URL of the docs site to check (defaults to your configured subdomain)`}).option(`format`,{type:`string`,choices:[`table`,`plain`,`json`],description:`Output format`}).example(`mint score`,`Run agent readiness checks on your default subdomain`).example(`mint score docs.example.com`,`Run agent readiness checks on a URL`),z6t).command(`format`,`Format MDX files in the current directory`,e=>e.usage(`usage: mint format`).example(`mint format`,`format all MDX files in the current directory`),vzt).command(`migrate`,`Print instructions for migrating a docs site to Mintlify`,e=>e.option(`from`,{type:`string`,choices:n4(`sources`),description:`Include instructions for a source platform`}).option(`topic`,{type:`string`,choices:n4(`topics`),description:`Print a single topic`}).option(`agent`,{type:`string`,choices:Object.keys(r4),description:`Run the migration with a coding agent`}).option(`claude`,{type:`boolean`,description:`Alias for --agent claude`}),e=>$9(void 0,void 0,void 0,function*(){let t=e.agent??(e.claude?`claude`:void 0);if(n0(`cli.migrate.executed`,{from:e.from,topic:e.topic,agent:t}),t)try{return yield d1(yield zBt(t,e.from))}catch(e){return OH((0,R.jsx)(bH,{message:e instanceof Error?e.message:String(e)})),yield d1(1)}yield new Promise(t=>process.stdout.write(IBt(e),()=>t())),yield d1(0)})).command(`ai`,`[Coming soon] AI-powered documentation (run mint ai to vote)`,()=>void 0,DRt(`ai`,e)).command(`mcp`,`[Coming soon] MCP server for documentation (run mint mcp to vote)`,()=>void 0,DRt(`mcp`,e)).strictCommands().demandCommand(1,`unknown command. see above for the list of supported commands.`).alias(`h`,`help`).alias(`v`,`version`).parseAsync()};var u7t=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())})};l7t({packageName:process.env.MINTLIFY_PACKAGE_NAME??`mint`}).catch(e=>{console.error(e instanceof Error?e.message:e),process.exit(1)});function d7t(e){return u7t(this,void 0,void 0,function*(){yield r1(),process.exit(e)})}process.once(`beforeExit`,()=>u7t(void 0,void 0,void 0,function*(){try{yield r1()}catch{}})),process.on(`SIGINT`,()=>{d7t(130)}),process.on(`SIGTERM`,()=>{d7t(143)});export{};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.26",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"yargs": "17.7.1",
|
|
114
114
|
"zod": "4.3.6"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "541cdf14a089519118cba89a839eb65122f9dbec"
|
|
117
117
|
}
|