@mintlify/cli 4.1.75 → 4.1.76

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.
@@ -4,7 +4,7 @@ import { dirname as __mintDirname } from 'node:path';
4
4
  const require = __mintCreateRequire(import.meta.url);
5
5
  const __filename = __mintFileURLToPath(import.meta.url);
6
6
  const __dirname = __mintDirname(__filename);
7
- import{i as e,o as t,t as n}from"./rolldown-runtime-CEAe2Uac.js";import{$ as r,A as i,F as a,G as o,H as s,J as c,K as l,L as u,P as d,R as f,V as p,W as m,X as h,Y as g,Z as _,_ as v,d as y,f as b,g as x,l as S,m as C,n as w,q as T,r as E,t as D,u as O,v as k,w as A,x as ee}from"./dist-DgyavKdR.js";import{$ as j,$n as te,An as ne,Bt as re,C as ie,Cn as ae,Dn as oe,E as se,En as ce,Fn as le,Ft as ue,In as de,It as fe,Jt as pe,Kn as me,Kt as he,Ln as ge,Lt as _e,Mn as ve,Nn as ye,Nt as be,On as xe,Pt as Se,Qt as Ce,Rn as we,Sn as Te,U as Ee,Wn as De,Wt as Oe,X as ke,Xn as Ae,Y as je,Yn as Me,Z as Ne,Zn as Pe,_t as Fe,a as Ie,at as Le,bt as Re,et as ze,ht as Be,ir as Ve,jn as He,k as Ue,m as We,mn as Ge,mt as Ke,o as qe,ot as Je,pn as Ye,qt as Xe,rt as Ze,s as Qe,tr as $e,tt as et,vn as tt,w as nt,wn as rt,xt as it,yn as at,yt as ot}from"./dist-BA3H54nL.js";import{g as st,h as M,m as ct}from"./build-Nkr-5oHQ.js";import{a as lt,i as ut,n as dt}from"./multi-repo-command-DvqhX76Z.js";import{c as ft,l as pt,n as mt,t as ht,u as gt}from"./agent-Da2kI1tZ.js";import{A as _t,C as vt,D as yt,E as bt,F as xt,I as St,L as N,M as Ct,N as wt,O as Tt,P as Et,R as Dt,S as Ot,T as kt,_ as At,a as jt,b as Mt,c as Nt,d as Pt,f as Ft,g as It,h as Lt,i as Rt,j as zt,k as Bt,l as Vt,m as Ht,n as Ut,o as Wt,p as Gt,r as Kt,s as qt,t as Jt,u as Yt,v as Xt,w as Zt,x as Qt,y as $t,z as en}from"./config-B9UTDqKX.js";import{n as tn,t as nn}from"./client-DXQ6Tgw0.js";import{_ as rn,a as an,b as on,c as sn,d as cn,f as ln,g as un,h as dn,i as fn,l as pn,m as mn,n as hn,o as gn,p as _n,r as vn,s as yn,t as bn,u as xn,v as Sn}from"./esm-BtDK7B-d.js";import{B as Cn,M as wn,P as Tn,Q as En,X as Dn,Z as On,_ as kn,b as An,c as jn,d as Mn,dt as Nn,r as Pn,s as Fn,st as In,t as Ln,tt as Rn,u as zn,w as Bn,x as Vn,y as Hn}from"./utils-B7dNmFFf.js";import{a as Un,c as Wn,i as Gn,n as Kn,o as qn,r as Jn,s as Yn,t as Xn}from"./remark-utils-heM5aat5.js";import{_ as Zn,a as Qn,c as $n,d as er,f as tr,l as nr,m as rr,o as ir,p as ar,s as or,u as sr,v as cr}from"./schemas-CVKidklE.js";import{t as lr}from"./currencyMath-DcWm_B16.js";import{createRequire as ur}from"node:module";import dr,{basename as fr,dirname as pr,join as mr,normalize as hr,parse as gr,resolve as _r}from"path";import vr,{existsSync as yr,readFileSync as br,readdirSync as xr}from"node:fs";import Sr,{existsSync as Cr,promises as wr}from"fs";import Tr from"os";import Er from"crypto";import Dr from"node:process";import Or from"node:os";import{createRequire as kr}from"module";import Ar,{mkdir as jr,mkdtemp as Mr,readFile as Nr,writeFile as Pr}from"node:fs/promises";import Fr from"node:path";import{execFile as Ir,spawn as Lr}from"node:child_process";import{fileURLToPath as Rr}from"node:url";import{createHash as zr,randomUUID as Br}from"node:crypto";import{format as Vr,stripVTControlCharacters as Hr}from"node:util";import{sep as Ur}from"path/win32";import{setTimeout as Wr}from"node:timers/promises";var P=r();const Gr=(e,t)=>{let n=t.a+e.a-t.a*e.a;if(n===0)return{r:0,g:0,b:0,a:0};let r=t.a/n,i=(e,t)=>Math.round((1-r)*e+r*t);return{r:i(e.r,t.r),g:i(e.g,t.g),b:i(e.b,t.b),a:n}},Kr=e=>{let t=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e)?.[1];if(!t)throw TypeError(`Expected a valid hex string, got ${e}`);let n=t.length<6?[...t].map(e=>e+e).join(``):t,r=Number.parseInt(n.slice(0,6),16);return{red:r>>16,green:r>>8&255,blue:r&255,alpha:n.length===8?Number.parseInt(n.slice(6,8),16)/255:1}},qr=e=>{try{let t=Kr(e);return`${t.red} ${t.green} ${t.blue}`}catch{return`0 0 0`}},Jr=e=>`${e.r} ${e.g} ${e.b}`,Yr=e=>`#${e.r.toString(16).padStart(2,`0`)}${e.g.toString(16).padStart(2,`0`)}${e.b.toString(16).padStart(2,`0`)}`,Xr=(e,t,n)=>{if(t)return n?t:qr(t);let r=Zr(`#09090b`,1,e,.02);return n?Yr(r):Jr(r)},Zr=(e,t,n,r)=>{let i=Kr(e),a=Kr(n);return Gr({r:i.red,g:i.green,b:i.blue,a:t},{r:a.red,g:a.green,b:a.blue,a:r})},Qr=`#4ADE80`,$r=(e=Qr)=>({light:`#ffffff`,dark:Xr(e,void 0,!0)});function ei(e){let t=e?.colors.primary||`#16A34A`,n=e?.colors.light??Qr;e?.theme===`linden`&&(e.background=Object.assign(Object.assign({},e.background),{color:{light:e.background?.color?.light||Yr(Zr(`#FFFFFF`,1,t,.03)),dark:e.background?.color?.dark||Yr(Zr(`#09090B`,1,n,.03))}}));let r=e?.background?.color?.light??`#ffffff`;return{light:qr(r),dark:Xr(n,e?.background?.color?.dark),lightHex:r,darkHex:Xr(n,e?.background?.color?.dark,!0),background:e?.thumbnails?.background}}var F=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},ti=/([A-Z])/g,ni=e=>e.replace(ti,`-$1`).toLowerCase(),ri={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},ii=/[&><"']/g,ai=e=>String(e).replace(ii,e=>ri[e]),oi=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?oi(e.body[0]):e:e.type===`font`?oi(e.body):e,si=/* @__PURE__ */ new Set([`mathord`,`textord`,`atom`]),ci=e=>si.has(oi(e).type),li=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},ui={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function di(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function fi(e){return e.default===void 0?di(Array.isArray(e.type)?e.type[0]:e.type):e.default}function pi(e,t,n,r){var i=n[t];e[t]=i===void 0?fi(r):r.processor?r.processor(i):i}var mi=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(ui)){var n=ui[t];n&&pi(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new F(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=li(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},hi=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return wi[Ti[this.id]]}sub(){return wi[Ei[this.id]]}fracNum(){return wi[Di[this.id]]}fracDen(){return wi[Oi[this.id]]}cramp(){return wi[ki[this.id]]}text(){return wi[Ai[this.id]]}isTight(){return this.size>=2}},gi=0,_i=1,vi=2,yi=3,bi=4,xi=5,Si=6,Ci=7,wi=[new hi(gi,0,!1),new hi(_i,0,!0),new hi(vi,1,!1),new hi(yi,1,!0),new hi(bi,2,!1),new hi(xi,2,!0),new hi(Si,3,!1),new hi(Ci,3,!0)],Ti=[bi,xi,bi,xi,Si,Ci,Si,Ci],Ei=[xi,xi,xi,xi,Ci,Ci,Ci,Ci],Di=[vi,yi,bi,xi,Si,Ci,Si,Ci],Oi=[yi,yi,xi,xi,Ci,Ci,Ci,Ci],ki=[_i,_i,yi,yi,xi,xi,Ci,Ci],Ai=[gi,_i,vi,yi,vi,yi,vi,yi],ji={DISPLAY:wi[gi],TEXT:wi[vi],SCRIPT:wi[bi],SCRIPTSCRIPT:wi[Si]},Mi=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function Ni(e){for(var t=0;t<Mi.length;t++)for(var n=Mi[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Pi=[];Mi.forEach(e=>e.blocks.forEach(e=>Pi.push(...e)));function Fi(e){for(var t=0;t<Pi.length;t+=2)if(e>=Pi[t]&&e<=Pi[t+1])return!0;return!1}var Ii=e=>e+` `+e,Li=80,Ri=function(e,t){return`M95,`+(622+e+t)+`
7
+ import{i as e,o as t,t as n}from"./rolldown-runtime-CEAe2Uac.js";import{$ as r,A as i,F as a,G as o,H as s,J as c,K as l,L as u,P as d,R as f,V as p,W as m,X as h,Y as g,Z as _,_ as v,d as y,f as b,g as x,l as S,m as C,n as w,q as T,r as E,t as D,u as O,v as k,w as A,x as ee}from"./dist-DFkRL36G.js";import{$ as j,$n as te,An as ne,Bt as re,C as ie,Cn as ae,Dn as oe,E as se,En as ce,Fn as le,Ft as ue,In as de,It as fe,Jt as pe,Kn as me,Kt as he,Ln as ge,Lt as _e,Mn as ve,Nn as ye,Nt as be,On as xe,Pt as Se,Qt as Ce,Rn as we,Sn as Te,U as Ee,Wn as De,Wt as Oe,X as ke,Xn as Ae,Y as je,Yn as Me,Z as Ne,Zn as Pe,_t as Fe,a as Ie,at as Le,bt as Re,et as ze,ht as Be,ir as Ve,jn as He,k as Ue,m as We,mn as Ge,mt as Ke,o as qe,ot as Je,pn as Ye,qt as Xe,rt as Ze,s as Qe,tr as $e,tt as et,vn as tt,w as nt,wn as rt,xt as it,yn as at,yt as ot}from"./dist-BZO00XVw.js";import{g as st,h as M,m as ct}from"./build-Nkr-5oHQ.js";import{a as lt,i as ut,n as dt}from"./multi-repo-command-B1xakqrg.js";import{c as ft,l as pt,n as mt,t as ht,u as gt}from"./agent-Da2kI1tZ.js";import{A as _t,C as vt,D as yt,E as bt,F as xt,I as St,L as N,M as Ct,N as wt,O as Tt,P as Et,R as Dt,S as Ot,T as kt,_ as At,a as jt,b as Mt,c as Nt,d as Pt,f as Ft,g as It,h as Lt,i as Rt,j as zt,k as Bt,l as Vt,m as Ht,n as Ut,o as Wt,p as Gt,r as Kt,s as qt,t as Jt,u as Yt,v as Xt,w as Zt,x as Qt,y as $t,z as en}from"./config-VhqDayo8.js";import{n as tn,t as nn}from"./client-DXQ6Tgw0.js";import{_ as rn,a as an,b as on,c as sn,d as cn,f as ln,g as un,h as dn,i as fn,l as pn,m as mn,n as hn,o as gn,p as _n,r as vn,s as yn,t as bn,u as xn,v as Sn}from"./esm-BtDK7B-d.js";import{B as Cn,M as wn,P as Tn,Q as En,X as Dn,Z as On,_ as kn,b as An,c as jn,d as Mn,dt as Nn,r as Pn,s as Fn,st as In,t as Ln,tt as Rn,u as zn,w as Bn,x as Vn,y as Hn}from"./utils-D9fHH3a7.js";import{a as Un,c as Wn,i as Gn,n as Kn,o as qn,r as Jn,s as Yn,t as Xn}from"./remark-utils-snuBUKxh.js";import{_ as Zn,a as Qn,c as $n,d as er,f as tr,l as nr,m as rr,o as ir,p as ar,s as or,u as sr,v as cr}from"./schemas-CVKidklE.js";import{t as lr}from"./currencyMath-JTNtcXni.js";import{createRequire as ur}from"node:module";import dr,{basename as fr,dirname as pr,join as mr,normalize as hr,parse as gr,resolve as _r}from"path";import vr,{existsSync as yr,readFileSync as br,readdirSync as xr}from"node:fs";import Sr,{existsSync as Cr,promises as wr}from"fs";import Tr from"os";import Er from"crypto";import Dr from"node:process";import Or from"node:os";import{createRequire as kr}from"module";import Ar,{mkdir as jr,mkdtemp as Mr,readFile as Nr,writeFile as Pr}from"node:fs/promises";import Fr from"node:path";import{execFile as Ir,spawn as Lr}from"node:child_process";import{fileURLToPath as Rr}from"node:url";import{createHash as zr,randomUUID as Br}from"node:crypto";import{format as Vr,stripVTControlCharacters as Hr}from"node:util";import{sep as Ur}from"path/win32";import{setTimeout as Wr}from"node:timers/promises";var P=r();const Gr=(e,t)=>{let n=t.a+e.a-t.a*e.a;if(n===0)return{r:0,g:0,b:0,a:0};let r=t.a/n,i=(e,t)=>Math.round((1-r)*e+r*t);return{r:i(e.r,t.r),g:i(e.g,t.g),b:i(e.b,t.b),a:n}},Kr=e=>{let t=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e)?.[1];if(!t)throw TypeError(`Expected a valid hex string, got ${e}`);let n=t.length<6?[...t].map(e=>e+e).join(``):t,r=Number.parseInt(n.slice(0,6),16);return{red:r>>16,green:r>>8&255,blue:r&255,alpha:n.length===8?Number.parseInt(n.slice(6,8),16)/255:1}},qr=e=>{try{let t=Kr(e);return`${t.red} ${t.green} ${t.blue}`}catch{return`0 0 0`}},Jr=e=>`${e.r} ${e.g} ${e.b}`,Yr=e=>`#${e.r.toString(16).padStart(2,`0`)}${e.g.toString(16).padStart(2,`0`)}${e.b.toString(16).padStart(2,`0`)}`,Xr=(e,t,n)=>{if(t)return n?t:qr(t);let r=Zr(`#09090b`,1,e,.02);return n?Yr(r):Jr(r)},Zr=(e,t,n,r)=>{let i=Kr(e),a=Kr(n);return Gr({r:i.red,g:i.green,b:i.blue,a:t},{r:a.red,g:a.green,b:a.blue,a:r})},Qr=`#4ADE80`,$r=(e=Qr)=>({light:`#ffffff`,dark:Xr(e,void 0,!0)});function ei(e){let t=e?.colors.primary||`#16A34A`,n=e?.colors.light??Qr;e?.theme===`linden`&&(e.background=Object.assign(Object.assign({},e.background),{color:{light:e.background?.color?.light||Yr(Zr(`#FFFFFF`,1,t,.03)),dark:e.background?.color?.dark||Yr(Zr(`#09090B`,1,n,.03))}}));let r=e?.background?.color?.light??`#ffffff`;return{light:qr(r),dark:Xr(n,e?.background?.color?.dark),lightHex:r,darkHex:Xr(n,e?.background?.color?.dark,!0),background:e?.thumbnails?.background}}var F=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},ti=/([A-Z])/g,ni=e=>e.replace(ti,`-$1`).toLowerCase(),ri={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},ii=/[&><"']/g,ai=e=>String(e).replace(ii,e=>ri[e]),oi=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?oi(e.body[0]):e:e.type===`font`?oi(e.body):e,si=/* @__PURE__ */ new Set([`mathord`,`textord`,`atom`]),ci=e=>si.has(oi(e).type),li=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},ui={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function di(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function fi(e){return e.default===void 0?di(Array.isArray(e.type)?e.type[0]:e.type):e.default}function pi(e,t,n,r){var i=n[t];e[t]=i===void 0?fi(r):r.processor?r.processor(i):i}var mi=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(ui)){var n=ui[t];n&&pi(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new F(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=li(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},hi=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return wi[Ti[this.id]]}sub(){return wi[Ei[this.id]]}fracNum(){return wi[Di[this.id]]}fracDen(){return wi[Oi[this.id]]}cramp(){return wi[ki[this.id]]}text(){return wi[Ai[this.id]]}isTight(){return this.size>=2}},gi=0,_i=1,vi=2,yi=3,bi=4,xi=5,Si=6,Ci=7,wi=[new hi(gi,0,!1),new hi(_i,0,!0),new hi(vi,1,!1),new hi(yi,1,!0),new hi(bi,2,!1),new hi(xi,2,!0),new hi(Si,3,!1),new hi(Ci,3,!0)],Ti=[bi,xi,bi,xi,Si,Ci,Si,Ci],Ei=[xi,xi,xi,xi,Ci,Ci,Ci,Ci],Di=[vi,yi,bi,xi,Si,Ci,Si,Ci],Oi=[yi,yi,xi,xi,Ci,Ci,Ci,Ci],ki=[_i,_i,yi,yi,xi,xi,Ci,Ci],Ai=[gi,_i,vi,yi,vi,yi,vi,yi],ji={DISPLAY:wi[gi],TEXT:wi[vi],SCRIPT:wi[bi],SCRIPTSCRIPT:wi[Si]},Mi=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function Ni(e){for(var t=0;t<Mi.length;t++)for(var n=Mi[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Pi=[];Mi.forEach(e=>e.blocks.forEach(e=>Pi.push(...e)));function Fi(e){for(var t=0;t<Pi.length;t+=2)if(e>=Pi[t]&&e<=Pi[t+1])return!0;return!1}var Ii=e=>e+` `+e,Li=80,Ri=function(e,t){return`M95,`+(622+e+t)+`
8
8
  c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
9
9
  c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
10
10
  c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
@@ -554,7 +554,7 @@ Next steps:`,`1. Clone the knowledge base into ./${i}:`,` git -c http.${r.remo
554
554
  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.`]:Dv].join(`
555
555
  `):``}var jv=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 Mv=tr({id:er().int().positive(),full_name:rr().regex(/^[\w.-]+\/[\w.-]+$/),default_branch:rr().min(1)}),Nv=Fr.join(`.github`,`workflows`,`mintlify.yml`);function Pv(e,t,n){return new Promise((r,i)=>{Ir(e,t,{cwd:n},(e,t)=>e?i(e):r(String(t).trim()))})}function Fv(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 Iv(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(`
556
556
  `)}function Lv(e){return jv(this,void 0,void 0,function*(){return Ar.readFile(e,`utf8`).catch(e=>{if(e.code!==`ENOENT`)throw e})})}function Rv(e,t){return jv(this,arguments,void 0,function*(e,t,n=!1){let r=Fr.join(e,Nv),i=yield Lv(r);if(i===t)return`unchanged`;if(i!==void 0&&!n)throw Error(`${Nv} already exists with different contents. Pass --force to overwrite it.`);return yield Ar.mkdir(Fr.dirname(r),{recursive:!0}),yield Ar.writeFile(r,t),i===void 0?`created`:`updated`})}function zv(e){return jv(this,void 0,void 0,function*(){try{return yield Pv(`git`,[`rev-parse`,`--show-toplevel`],e)}catch{throw Error(`--github requires a Git repository. Run it inside your docs repository.`)}})}function Bv(e){return jv(this,void 0,void 0,function*(){let t=yield Pv(`git`,[`remote`,`get-url`,`origin`],e).catch(()=>{throw Error(`This repository has no origin remote. Add a github.com origin and retry.`)}),n=Fv(t);if(!n)throw Error(`The origin remote (${t}) is not a github.com repository.`);let r=yield Pv(`gh`,[`api`,`repos/${n.owner}/${n.repo}`,`--jq`,`{id: .id, full_name: .full_name, default_branch: .default_branch}`],e).catch(e=>{throw e.code===`ENOENT`?Error("The GitHub CLI (gh) is required. Install it and run `gh auth login`."):Error(`Could not read ${n.owner}/${n.repo} with gh. Run \`gh auth login\` with access to the repository and retry.`)});try{return Mv.parse(JSON.parse(r))}catch{throw Error(`gh returned an unexpected repository response.`)}})}function Vv(e,t){return jv(this,arguments,void 0,function*(e,t,n=()=>{}){let r=Fr.resolve(e.directory),i=yield zv(r),[a,o]=yield Promise.all([Ar.realpath(i),Ar.realpath(r)]),s=Fr.relative(a,o).split(Fr.sep).join(`/`);if(!(yield Lv(Fr.join(r,`docs.json`))))throw Error(`No docs.json in ${r}. Pass the docs folder with --directory.`);n(`Resolving the GitHub repository...`);let c=yield Bv(i),l=yield pv(e,t,n);if(l.status===`claimed`)throw Error(`This site has been claimed. Setting up GitHub deploys for claimed sites is not supported yet; connect the repository from the Mintlify dashboard.`);let u=l.credentials.accessToken;if(!u)throw Error(`Agent authentication did not return an access token.`);n(`Trusting ${c.full_name}@${c.default_branch} to deploy...`),yield dv(e.apiUrl,u,{repositoryId:String(c.id),repository:c.full_name,branch:c.default_branch});let d=yield Rv(i,Iv(c.default_branch,l.site.subdomain,s),e.force);return{siteUrl:mv(e.apiUrl,l.site.subdomain),subdomain:l.site.subdomain,repository:c.full_name,branch:c.default_branch,workflowPath:Nv,workflow:d}})}function Hv(e){return[`Site: ${e.siteUrl}`,`Trusted repository: ${e.repository} (branch ${e.branch})`,`Workflow: ${e.workflowPath} (${e.workflow})`,``,`Next steps:`,`1. Commit and push ${e.workflowPath} to ${e.branch}.`,`2. Every push to ${e.branch} then deploys ${e.subdomain} through GitHub Actions. No secrets are stored in the repository.`,``,...Dv].join(`
557
- `)}var Uv=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 Wv=[`bug`,`docs`,`idea`];function Gv(e){return Uv(this,void 0,void 0,function*(){let t;try{t=yield fetch(`${Ft}/api/cli/feedback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(Object.assign(Object.assign({},e),{source:`cli`}))})}catch{return`could not reach the server`}return t.ok?void 0:`could not send feedback (HTTP ${t.status})`})}function Kv(e){return Uv(this,void 0,void 0,function*(){let t=yield Gv(e);return v(t?(0,P.jsx)(d,{message:t}):(0,P.jsx)(s,{message:`feedback sent`})),!t})}var qv=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())})},Jv=function(e){return this instanceof Jv?(this.v=e,this):new Jv(e)},Yv=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},Xv=function(e){var t={},n;return r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:Jv(e[r](t)),done:!1}:i?i(t):t}:i}},Zv=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Jv?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function Qv(){return qv(this,void 0,void 0,function*(){try{let e=yield Ar.readFile(Fr.join(Mt,`.gitignore`),`utf-8`);return Re(e)}catch{return[]}})}function $v(e,t){return Zv(this,arguments,function*(){let n=yield Jv(Ar.readdir(e,{withFileTypes:!0}));for(let r of n){let n=Fr.join(e,r.name),i=Fr.relative(Mt,n).split(Fr.sep).join(`/`);ot(i,t,r.isDirectory())||(r.isDirectory()?yield Jv(yield*Xv(Yv($v(n,t)))):r.name.endsWith(`.mdx`)&&(yield yield Jv(n)))}})}const ey=()=>qv(void 0,void 0,void 0,function*(){var e,t,n,r;let{mdxToPm:i,pmToMdx:a,canonicalPmToMdxOptions:o}=yield import(`./converter-3_OvM8TS.js`),c=[...yield Qv(),...yield Ze(Mt)],l=Fe(c),u=0,f=0,p=0;try{for(var m=!0,h=Yv($v(Mt,l)),g;g=yield h.next(),e=g.done,!e;m=!0){r=g.value,m=!1;let e=r;u++;let t=Fr.relative(Mt,e);try{let t=yield Ar.readFile(e,`utf-8`),n=t,r=0;for(let e=0;e<3;e++){let{doc:t,frontmatter:s}=i(n);e===0&&(r=Object.keys(s).length);let c=`${a(t,Object.assign({frontmatter:s},o))}\n`;if(c===n)break;n=c}if(r>0&&!n.startsWith(`---`))throw Error(`formatting would remove frontmatter; file left untouched`);n!==t&&(yield Ar.writeFile(e,n),f++)}catch(e){p++,v((0,P.jsx)(d,{message:`${t}: ${e instanceof Error?e.message:`unknown error`}`}))}}}catch(e){t={error:e}}finally{try{!m&&!e&&(n=h.return)&&(yield n.call(h))}finally{if(t)throw t.error}}v((0,P.jsx)(s,{message:`formatted ${f} of ${u} mdx file${u===1?``:`s`}${p>0?` (${p} failed)`:``}`})),yield N(+(p>0))});var ty=/* @__PURE__ */ n(((e,t)=>{t.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}})),ny=/* @__PURE__ */ n((e=>{let t={INVALID_LOC:`Invalid LOC header (bad signature)`,INVALID_CEN:`Invalid CEN header (bad signature)`,INVALID_END:`Invalid END header (bad signature)`,DESCRIPTOR_NOT_EXIST:`No descriptor present`,DESCRIPTOR_UNKNOWN:`Unknown descriptor format`,DESCRIPTOR_FAULTY:`Descriptor data is malformed`,NO_DATA:`Nothing to decompress`,BAD_CRC:`CRC32 checksum failed {0}`,FILE_IN_THE_WAY:`There is a file in the way: {0}`,UNKNOWN_METHOD:`Invalid/unsupported compression method`,AVAIL_DATA:`inflate::Available inflate data did not terminate`,INVALID_DISTANCE:`inflate::Invalid literal/length or distance code in fixed or dynamic block`,TO_MANY_CODES:`inflate::Dynamic block code description: too many length or distance codes`,INVALID_REPEAT_LEN:`inflate::Dynamic block code description: repeat more than specified lengths`,INVALID_REPEAT_FIRST:`inflate::Dynamic block code description: repeat lengths with no first length`,INCOMPLETE_CODES:`inflate::Dynamic block code description: code lengths codes incomplete`,INVALID_DYN_DISTANCE:`inflate::Dynamic block code description: invalid distance code lengths`,INVALID_CODES_LEN:`inflate::Dynamic block code description: invalid literal/length code lengths`,INVALID_STORE_BLOCK:`inflate::Stored block length did not match one's complement`,INVALID_BLOCK_TYPE:`inflate::Invalid block type (type == 3)`,CANT_EXTRACT_FILE:`Could not extract the file`,CANT_OVERRIDE:`Target file already exists`,DISK_ENTRY_TOO_LARGE:`Number of disk entries is too large`,NO_ZIP:`No zip file was loaded`,NO_ENTRY:`Entry doesn't exist`,DIRECTORY_CONTENT_ERROR:`A directory cannot have content`,FILE_NOT_FOUND:`File not found: "{0}"`,NOT_IMPLEMENTED:`Not implemented`,INVALID_FILENAME:`Invalid filename`,INVALID_FORMAT:`Invalid or unsupported zip format. No END header found`,INVALID_PASS_PARAM:`Incompatible password parameter`,WRONG_PASSWORD:`Wrong Password`,COMMENT_TOO_LONG:`Comment is too long`,EXTRA_FIELD_PARSE_ERROR:`Extra field parsing error`};function n(e){return function(...t){return t.length&&(e=e.replace(/\{(\d)\}/g,(e,n)=>t[n]||``)),/* @__PURE__ */ Error(`ADM-ZIP: `+e)}}for(let r of Object.keys(t))e[r]=n(t[r])})),ry=/* @__PURE__ */ n(((t,n)=>{let r=e(`fs`),i=e(`path`),a=ty(),o=ny(),s=typeof process==`object`&&process.platform===`win32`,c=e=>typeof e==`object`&&!!e,l=(/* @__PURE__ */ new Uint32Array(256)).map((e,t)=>{for(let e=0;e<8;e++)t&1?t=3988292384^t>>>1:t>>>=1;return t>>>0});function u(e){this.sep=i.sep,this.fs=r,c(e)&&c(e.fs)&&typeof e.fs.statSync==`function`&&(this.fs=e.fs)}n.exports=u,u.prototype.makeDir=function(e){let t=this;function n(e){let n=e.split(t.sep)[0];e.split(t.sep).forEach(function(e){if(e&&e.substr(-1,1)!==`:`){n+=t.sep+e;var r;try{r=t.fs.statSync(n)}catch(e){if(e.message&&e.message.startsWith(`ENOENT`))t.fs.mkdirSync(n);else throw e}if(r&&r.isFile())throw o.FILE_IN_THE_WAY(`"${n}"`)}})}n(e)},u.prototype.writeFileTo=function(e,t,n,r){let a=this;if(a.fs.existsSync(e)&&(!n||a.fs.statSync(e).isDirectory()))return!1;var o=i.dirname(e);a.fs.existsSync(o)||a.makeDir(o);var s;try{s=a.fs.openSync(e,`w`,438)}catch{a.fs.chmodSync(e,438),s=a.fs.openSync(e,`w`,438)}if(s)try{a.fs.writeSync(s,t,0,t.length,0)}finally{a.fs.closeSync(s)}return a.fs.chmodSync(e,r||438),!0},u.prototype.writeFileToAsync=function(e,t,n,r,a){typeof r==`function`&&(a=r,r=void 0);let o=this;o.fs.exists(e,function(s){if(s&&!n)return a(!1);o.fs.stat(e,function(n,c){if(s&&c&&c.isDirectory())return a(!1);var l=i.dirname(e);o.fs.exists(l,function(n){if(!n)try{o.makeDir(l)}catch{return a(!1)}let i=function(n){o.fs.write(n,t,0,t.length,0,function(t){o.fs.close(n,function(){if(t)return a(!1);o.fs.chmod(e,r||438,function(){a(!0)})})})};o.fs.open(e,`w`,438,function(t,n){t?o.fs.chmod(e,438,function(){o.fs.open(e,`w`,438,function(e,t){if(e||!t)return a(!1);i(t)})}):n?i(n):a(!1)})})})})},u.prototype.findFiles=function(e){let t=this;function n(e,r,a,o){typeof r==`boolean`&&(a=r,r=void 0);let s=[];return t.fs.readdirSync(e).forEach(function(c){let l=i.join(e,c),u=t.fs.statSync(l);if((!r||r.test(l))&&s.push(i.normalize(l)+(u.isDirectory()?t.sep:``)),u.isDirectory()&&a){let e=t.fs.realpathSync(l);o.has(e)||(o.add(e),s=s.concat(n(l,r,a,o)))}}),s}return n(e,void 0,!0,/* @__PURE__ */ new Set([t.fs.realpathSync(e)]))},u.prototype.findFilesAsync=function(e,t){let n=this,r=[],a=!1,o=function(e){a||(a=!0,t(e,e?void 0:r))},s=function(e,t,a){n.fs.readdir(e,function(o,c){if(o)return a(o);let l=c.length;if(!l)return a();c.forEach(function(o){let c=i.join(e,o);n.fs.stat(c,function(e,o){if(e)return a(e);o?(r.push(i.normalize(c)+(o.isDirectory()?n.sep:``)),o.isDirectory()?n.fs.realpath(c,function(e,n){if(e)return a(e);t.has(n)?--l||a():(t.add(n),s(c,t,function(e){if(e)return a(e);--l||a()}))}):--l||a()):--l||a()})})})};n.fs.realpath(e,function(t,n){if(t)return o(t);s(e,/* @__PURE__ */ new Set([n]),o)})},u.prototype.getAttributes=function(){},u.prototype.setAttributes=function(){},u.crc32update=function(e,t){return l[(e^t)&255]^e>>>8},u.crc32=function(e){typeof e==`string`&&(e=Buffer.from(e,`utf8`));let t=e.length,n=-1;for(let r=0;r<t;)n=u.crc32update(n,e[r++]);return~n>>>0},u.methodToString=function(e){switch(e){case a.STORED:return`STORED (`+e+`)`;case a.DEFLATED:return`DEFLATED (`+e+`)`;default:return`UNSUPPORTED (`+e+`)`}},u.canonical=function(e){if(!e)return``;let t=i.posix.normalize(`/`+e.split(`\\`).join(`/`));return i.join(`.`,t)},u.zipnamefix=function(e){if(!e)return``;let t=i.posix.normalize(`/`+e.split(`\\`).join(`/`));return i.posix.join(`.`,t)},u.findLast=function(e,t){if(!Array.isArray(e))throw TypeError(`arr is not array`);let n=e.length>>>0;for(let r=n-1;r>=0;r--)if(t(e[r],r,e))return e[r]},u.sanitize=function(e,t){e=i.resolve(i.normalize(e));for(var n=t.split(`/`),r=0,a=n.length;r<a;r++){var o=i.normalize(i.join(e,n.slice(r,a).join(i.sep)));if(o===e||o.startsWith(e+i.sep))return o}return i.normalize(i.join(e,i.basename(t)))},u.toBuffer=function(e,t){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e==`string`?t(e):Buffer.alloc(0)},u.readBigUInt64LE=function(e,t){let n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n},u.writeBigUInt64LE=function(e,t,n){let r=t>>>0,i=Math.floor(t/4294967296)>>>0;e.writeUInt32LE(r,n),e.writeUInt32LE(i,n+4)},u.fromDOS2Date=function(e){return new Date((e>>25&127)+1980,Math.max((e>>21&15)-1,0),Math.max(e>>16&31,1),e>>11&31,e>>5&63,(e&31)<<1)},u.fromDate2DOS=function(e){let t=0,n=0;return e.getFullYear()>1979&&(t=(e.getFullYear()-1980&127)<<9|e.getMonth()+1<<5|e.getDate(),n=e.getHours()<<11|e.getMinutes()<<5|e.getSeconds()>>1),t<<16|n},u.isWin=s,u.crcTable=l})),iy=/* @__PURE__ */ n(((t,n)=>{let r=e(`path`);n.exports=function(e,{fs:t}){var n=e||``,i=o(),a=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return n&&t.existsSync(n)?(a=t.statSync(n),i.directory=a.isDirectory(),i.mtime=a.mtime,i.atime=a.atime,i.executable=!!(73&a.mode),i.readonly=!(128&a.mode),i.hidden=r.basename(n)[0]===`.`):console.warn(`Invalid path: `+n),{get directory(){return i.directory},get readOnly(){return i.readonly},get hidden(){return i.hidden},get mtime(){return i.mtime},get atime(){return i.atime},get executable(){return i.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:n,isDirectory:i.directory,isReadOnly:i.readonly,isHidden:i.hidden,isExecutable:i.executable,mTime:i.mtime,aTime:i.atime}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),ay=/* @__PURE__ */ n(((e,t)=>{t.exports={efs:!0,encode:e=>Buffer.from(e,`utf8`),decode:e=>e.toString(`utf8`)}})),oy=/* @__PURE__ */ n(((e,t)=>{t.exports=ry(),t.exports.Constants=ty(),t.exports.Errors=ny(),t.exports.FileAttr=iy(),t.exports.decoder=ay()})),sy=/* @__PURE__ */ n(((e,t)=>{var n=oy(),r=n.Constants;t.exports=function(){var e=20,t=10,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0;e|=n.isWin?2560:768,i|=r.FLG_EFS;let _={extraLen:0},v=e=>Math.max(0,e)>>>0,y=e=>Math.max(0,e)&255;return o=n.fromDate2DOS(/* @__PURE__ */ new Date),{get made(){return e},set made(t){e=t},get version(){return t},set version(e){t=e},get flags(){return i},set flags(e){i=e},get flags_efs(){return(i&r.FLG_EFS)>0},set flags_efs(e){e?i|=r.FLG_EFS:i&=~r.FLG_EFS},get flags_desc(){return(i&r.FLG_DESC)>0},set flags_desc(e){e?i|=r.FLG_DESC:i&=~r.FLG_DESC},get method(){return a},set method(e){switch(e){case r.STORED:this.version=10;break;case r.DEFLATED:default:this.version=20}a=e},get time(){return n.fromDOS2Date(this.timeval)},set time(e){e=new Date(e),this.timeval=n.fromDate2DOS(e)},get timeval(){return o},set timeval(e){o=v(e)},get timeHighByte(){return y(o>>>8)},get crc(){return s},set crc(e){s=v(e)},get compressedSize(){return c},set compressedSize(e){c=v(e)},get size(){return l},set size(e){l=v(e)},get fileNameLength(){return u},set fileNameLength(e){u=e},get extraLength(){return d},set extraLength(e){d=e},get extraLocalLength(){return _.extraLen},set extraLocalLength(e){_.extraLen=e},get commentLength(){return f},set commentLength(e){f=e},get diskNumStart(){return p},set diskNumStart(e){p=v(e)},get inAttr(){return m},set inAttr(e){m=v(e)},get attr(){return h},set attr(e){h=v(e)},get fileAttr(){return(h||0)>>16&4095},get offset(){return g},set offset(e){g=v(e)},get encrypted(){return(i&r.FLG_ENC)===r.FLG_ENC},get centralHeaderSize(){return r.CENHDR+u+d+f},get realDataOffset(){return g+r.LOCHDR+_.fnameLen+_.extraLen},get localHeader(){return _},loadLocalHeaderFromBinary:function(e){var t=e.slice(g,g+r.LOCHDR);if(t.readUInt32LE(0)!==r.LOCSIG)throw n.Errors.INVALID_LOC();_.version=t.readUInt16LE(r.LOCVER),_.flags=t.readUInt16LE(r.LOCFLG),_.flags_desc=(_.flags&r.FLG_DESC)>0,_.method=t.readUInt16LE(r.LOCHOW),_.time=t.readUInt32LE(r.LOCTIM),_.crc=t.readUInt32LE(r.LOCCRC),_.compressedSize=t.readUInt32LE(r.LOCSIZ),_.size=t.readUInt32LE(r.LOCLEN),_.fnameLen=t.readUInt16LE(r.LOCNAM),_.extraLen=t.readUInt16LE(r.LOCEXT);let i=g+r.LOCHDR+_.fnameLen,a=i+_.extraLen;return e.slice(i,a)},loadFromBinary:function(_){if(_.length!==r.CENHDR||_.readUInt32LE(0)!==r.CENSIG)throw n.Errors.INVALID_CEN();e=_.readUInt16LE(r.CENVEM),t=_.readUInt16LE(r.CENVER),i=_.readUInt16LE(r.CENFLG),a=_.readUInt16LE(r.CENHOW),o=_.readUInt32LE(r.CENTIM),s=_.readUInt32LE(r.CENCRC),c=_.readUInt32LE(r.CENSIZ),l=_.readUInt32LE(r.CENLEN),u=_.readUInt16LE(r.CENNAM),d=_.readUInt16LE(r.CENEXT),f=_.readUInt16LE(r.CENCOM),p=_.readUInt16LE(r.CENDSK),m=_.readUInt16LE(r.CENATT),h=_.readUInt32LE(r.CENATX),g=_.readUInt32LE(r.CENOFF)},localHeaderToBinary:function(){var e=Buffer.alloc(r.LOCHDR);return e.writeUInt32LE(r.LOCSIG,0),e.writeUInt16LE(t,r.LOCVER),e.writeUInt16LE(i&~r.FLG_DESC,r.LOCFLG),e.writeUInt16LE(a,r.LOCHOW),e.writeUInt32LE(o,r.LOCTIM),e.writeUInt32LE(s,r.LOCCRC),e.writeUInt32LE(c,r.LOCSIZ),e.writeUInt32LE(l,r.LOCLEN),e.writeUInt16LE(u,r.LOCNAM),e.writeUInt16LE(_.extraLen,r.LOCEXT),e},centralHeaderToBinary:function(){var n=Buffer.alloc(r.CENHDR+u+d+f);return n.writeUInt32LE(r.CENSIG,0),n.writeUInt16LE(e,r.CENVEM),n.writeUInt16LE(t,r.CENVER),n.writeUInt16LE(i&~r.FLG_DESC,r.CENFLG),n.writeUInt16LE(a,r.CENHOW),n.writeUInt32LE(o,r.CENTIM),n.writeUInt32LE(s,r.CENCRC),n.writeUInt32LE(c,r.CENSIZ),n.writeUInt32LE(l,r.CENLEN),n.writeUInt16LE(u,r.CENNAM),n.writeUInt16LE(d,r.CENEXT),n.writeUInt16LE(f,r.CENCOM),n.writeUInt16LE(p,r.CENDSK),n.writeUInt16LE(m,r.CENATT),n.writeUInt32LE(h,r.CENATX),n.writeUInt32LE(g,r.CENOFF),n},toJSON:function(){let o=function(e){return e+` bytes`};return{made:e,version:t,flags:i,method:n.methodToString(a),time:this.time,crc:`0x`+s.toString(16).toUpperCase(),compressedSize:o(c),size:o(l),fileNameLength:o(u),extraLength:o(d),commentLength:o(f),diskNumStart:p,inAttr:m,attr:h,offset:g,centralHeaderSize:o(r.CENHDR+u+d+f)}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),cy=/* @__PURE__ */ n(((e,t)=>{var n=oy(),r=n.Constants;t.exports=function(){var e=0,t=0,i=0,a=0,o=0;let s=()=>e>r.EF_ZIP64_OR_16||t>r.EF_ZIP64_OR_16||i>r.EF_ZIP64_OR_32||a>r.EF_ZIP64_OR_32;return{get diskEntries(){return e},set diskEntries(n){e=t=n},get totalEntries(){return t},set totalEntries(n){t=e=n},get size(){return i},set size(e){i=e},get offset(){return a},set offset(e){a=e},get commentLength(){return o},set commentLength(e){o=e},get mainHeaderSize(){return(s()?r.ZIP64HDR+r.END64HDR:0)+r.ENDHDR+o},loadFromBinary:function(s){if((s.length!==r.ENDHDR||s.readUInt32LE(0)!==r.ENDSIG)&&(s.length<r.ZIP64HDR||s.readUInt32LE(0)!==r.ZIP64SIG))throw n.Errors.INVALID_END();s.readUInt32LE(0)===r.ENDSIG?(e=s.readUInt16LE(r.ENDSUB),t=s.readUInt16LE(r.ENDTOT),i=s.readUInt32LE(r.ENDSIZ),a=s.readUInt32LE(r.ENDOFF),o=s.readUInt16LE(r.ENDCOM)):(e=n.readBigUInt64LE(s,r.ZIP64SUB),t=n.readBigUInt64LE(s,r.ZIP64TOT),i=n.readBigUInt64LE(s,r.ZIP64SIZB),a=n.readBigUInt64LE(s,r.ZIP64OFF),o=0)},toBinary:function(){if(!s()){var c=Buffer.alloc(r.ENDHDR+o);return c.writeUInt32LE(r.ENDSIG,0),c.writeUInt32LE(0,4),c.writeUInt16LE(e,r.ENDSUB),c.writeUInt16LE(t,r.ENDTOT),c.writeUInt32LE(i,r.ENDSIZ),c.writeUInt32LE(a,r.ENDOFF),c.writeUInt16LE(o,r.ENDCOM),c.fill(` `,r.ENDHDR),c}var c=Buffer.alloc(this.mainHeaderSize);let l=0;c.writeUInt32LE(r.ZIP64SIG,l),n.writeBigUInt64LE(c,r.ZIP64HDR-r.ZIP64LEAD,l+r.ZIP64SIZE),c.writeUInt16LE(45,l+r.ZIP64VEM),c.writeUInt16LE(45,l+r.ZIP64VER),c.writeUInt32LE(0,l+r.ZIP64DSK),c.writeUInt32LE(0,l+r.ZIP64DSKDIR),n.writeBigUInt64LE(c,e,l+r.ZIP64SUB),n.writeBigUInt64LE(c,t,l+r.ZIP64TOT),n.writeBigUInt64LE(c,i,l+r.ZIP64SIZB),n.writeBigUInt64LE(c,a,l+r.ZIP64OFF);let u=a+i;return l+=r.ZIP64HDR,c.writeUInt32LE(r.END64SIG,l),c.writeUInt32LE(0,l+r.END64START),n.writeBigUInt64LE(c,u,l+r.END64OFF),c.writeUInt32LE(1,l+r.END64NUMDISKS),l+=r.END64HDR,c.writeUInt32LE(r.ENDSIG,l),c.writeUInt32LE(0,l+4),c.writeUInt16LE(Math.min(e,r.EF_ZIP64_OR_16),l+r.ENDSUB),c.writeUInt16LE(Math.min(t,r.EF_ZIP64_OR_16),l+r.ENDTOT),c.writeUInt32LE(Math.min(i,r.EF_ZIP64_OR_32),l+r.ENDSIZ),c.writeUInt32LE(Math.min(a,r.EF_ZIP64_OR_32),l+r.ENDOFF),c.writeUInt16LE(o,l+r.ENDCOM),c.fill(` `,l+r.ENDHDR),c},toJSON:function(){return{diskEntries:e,totalEntries:t,size:i+` bytes`,offset:function(e,t){let n=e.toString(16).toUpperCase();for(;n.length<t;)n=`0`+n;return`0x`+n}(a,4),commentLength:o}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),ly=/* @__PURE__ */ n((e=>{e.EntryHeader=sy(),e.MainHeader=cy()})),uy=/* @__PURE__ */ n(((t,n)=>{n.exports=function(t){var n=e(`zlib`),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return n.deflateRawSync(t,r)},deflateAsync:function(e){var i=n.createDeflateRaw(r),a=[],o=0;i.on(`data`,function(e){a.push(e),o+=e.length}),i.on(`end`,function(){var t=Buffer.alloc(o),n=0;t.fill(0);for(var r=0;r<a.length;r++){var i=a[r];i.copy(t,n),n+=i.length}e&&e(t)}),i.end(t)}}}})),dy=/* @__PURE__ */ n(((t,n)=>{let r=+(process?.versions?.node??``).split(`.`)[0]||0;n.exports=function(t,n){var i=e(`zlib`);let a=r>=15&&n>0?{maxOutputLength:n}:{};return{inflate:function(){return i.inflateRawSync(t,a)},inflateAsync:function(e){var n=i.createInflateRaw(a),r=[],o=0;n.on(`data`,function(e){r.push(e),o+=e.length}),n.on(`end`,function(){var t=Buffer.alloc(o),n=0;t.fill(0);for(var i=0;i<r.length;i++){var a=r[i];a.copy(t,n),n+=a.length}e&&e(t)}),n.end(t)}}}})),fy=/* @__PURE__ */ n(((t,n)=>{let{randomFillSync:r}=e(`crypto`),i=ny(),a=(/* @__PURE__ */ new Uint32Array(256)).map((e,t)=>{for(let e=0;e<8;e++)t&1?t=t>>>1^3988292384:t>>>=1;return t>>>0}),o=(e,t)=>Math.imul(e,t)>>>0,s=(e,t)=>a[(e^t)&255]^e>>>8,c=()=>typeof r==`function`?r(Buffer.alloc(12)):c.node();c.node=()=>{let e=Buffer.alloc(12),t=e.length;for(let n=0;n<t;n++)e[n]=Math.random()*256&255;return e};let l={genSalt:c};function u(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let e=0;e<t.length;e++)this.updateKeys(t[e])}u.prototype.updateKeys=function(e){let t=this.keys;return t[0]=s(t[0],e),t[1]+=t[0]&255,t[1]=o(t[1],134775813)+1,t[2]=s(t[2],t[1]>>>24),e},u.prototype.next=function(){let e=(this.keys[2]|2)>>>0;return o(e,e^1)>>8&255};function d(e){let t=new u(e);return function(e){let n=Buffer.alloc(e.length),r=0;for(let i of e)n[r++]=t.updateKeys(i^t.next());return n}}function f(e){let t=new u(e);return function(e,n,r=0){n||=Buffer.alloc(e.length);for(let i of e){let e=t.next();n[r++]=i^e,t.updateKeys(i)}return n}}function p(e,t,n){if(!e||!Buffer.isBuffer(e)||e.length<12)return Buffer.alloc(0);let r=d(n),a=r(e.slice(0,12)),o=(t.flags&8)==8?t.timeHighByte:t.crc>>>24;if(a[11]!==o)throw i.WRONG_PASSWORD();return r(e.slice(12))}function m(e){Buffer.isBuffer(e)&&e.length>=12?l.genSalt=function(){return e.slice(0,12)}:e===`node`?l.genSalt=c.node:l.genSalt=c}function h(e,t,n,r=!1){e??=Buffer.alloc(0),Buffer.isBuffer(e)||(e=Buffer.from(e.toString()));let i=f(n),a=l.genSalt();a[11]=t.crc>>>24&255,r&&(a[10]=t.crc>>>16&255);let o=Buffer.alloc(e.length+12);return i(a,o),i(e,o,12)}n.exports={decrypt:p,encrypt:h,_salter:m}})),py=/* @__PURE__ */ n((e=>{e.Deflater=uy(),e.Inflater=dy(),e.ZipCrypto=fy()})),my=/* @__PURE__ */ n(((e,t)=>{var n=oy(),r=ly(),i=n.Constants,a=py();t.exports=function(e,t){var o=new r.EntryHeader,s=Buffer.alloc(0),c=Buffer.alloc(0),l=!1,u=null,d=Buffer.alloc(0),f=Buffer.alloc(0),p=!0;let m=e,h=typeof m.decoder==`object`?m.decoder:n.decoder;p=h.hasOwnProperty(`efs`)?h.efs:!1;function g(){return!t||!(t instanceof Uint8Array)?Buffer.alloc(0):(f=o.loadLocalHeaderFromBinary(t),t.slice(o.realDataOffset,o.realDataOffset+o.compressedSize))}function _(e){let t=o.flags_desc||o.localHeader.flags_desc?o.crc:o.localHeader.crc;return n.crc32(e)===t}function v(e,t,r){if(t===void 0&&typeof e==`string`&&(r=e,e=void 0),l)return e&&t&&t(Buffer.alloc(0),n.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var i=g();if(i.length===0)return e&&t&&t(i),i;if(o.encrypted){if(typeof r!=`string`&&!Buffer.isBuffer(r))throw n.Errors.INVALID_PASS_PARAM();i=a.ZipCrypto.decrypt(i,o,r)}var c;switch(o.method){case n.Constants.STORED:if(c=Buffer.alloc(i.length),i.copy(c),_(c))return e&&t&&t(c),c;throw e&&t&&t(c,n.Errors.BAD_CRC()),n.Errors.BAD_CRC();case n.Constants.DEFLATED:var u=new a.Inflater(i,o.size);if(e)u.inflateAsync(function(e){t&&(_(e)?t(e):t(e,n.Errors.BAD_CRC()))});else{if(c=u.inflate(),!_(c))throw n.Errors.BAD_CRC(`"${h.decode(s)}"`);return c}break;default:throw e&&t&&t(Buffer.alloc(0),n.Errors.UNKNOWN_METHOD()),n.Errors.UNKNOWN_METHOD()}}function y(e,r){if((!u||!u.length)&&Buffer.isBuffer(t))return e&&r&&r(g()),g();if(u.length&&!l){var i;switch(o.method){case n.Constants.STORED:return o.compressedSize=o.size,i=Buffer.alloc(u.length),u.copy(i),e&&r&&r(i),i;default:case n.Constants.DEFLATED:var s=new a.Deflater(u);if(e)s.deflateAsync(function(e){i=Buffer.alloc(e.length),o.compressedSize=e.length,e.copy(i),r&&r(i)});else{var c=s.deflate();return o.compressedSize=c.length,c}s=null}}else if(e&&r)r(Buffer.alloc(0));else return Buffer.alloc(0)}function b(e,t){return n.readBigUInt64LE(e,t)}function x(e){try{for(var t=0,r,a,o;t+4<e.length;)r=e.readUInt16LE(t),t+=2,a=e.readUInt16LE(t),t+=2,o=e.slice(t,t+a),t+=a,i.ID_ZIP64===r&&S(o)}catch{throw n.Errors.EXTRA_FIELD_PARSE_ERROR()}}function S(e){var t,n,r,a;e.length>=i.EF_ZIP64_SCOMP&&(t=b(e,i.EF_ZIP64_SUNCOMP),o.size===i.EF_ZIP64_OR_32&&(o.size=t)),e.length>=i.EF_ZIP64_RHO&&(n=b(e,i.EF_ZIP64_SCOMP),o.compressedSize===i.EF_ZIP64_OR_32&&(o.compressedSize=n)),e.length>=i.EF_ZIP64_DSN&&(r=b(e,i.EF_ZIP64_RHO),o.offset===i.EF_ZIP64_OR_32&&(o.offset=r)),e.length>=i.EF_ZIP64_DSN+4&&(a=e.readUInt32LE(i.EF_ZIP64_DSN),o.diskNumStart===i.EF_ZIP64_OR_16&&(o.diskNumStart=a))}return{get entryName(){return h.decode(s)},get rawEntryName(){return s},set entryName(e){s=n.toBuffer(e,h.encode);var t=s[s.length-1];l=t===47||t===92,o.fileNameLength=s.length},get efs(){return typeof p==`function`?p(this.entryName):p},get extra(){return d},set extra(e){d=e,o.extraLength=e.length,x(e)},get comment(){return h.decode(c)},set comment(e){if(c=n.toBuffer(e,h.encode),o.commentLength=c.length,c.length>65535)throw n.Errors.COMMENT_TOO_LONG()},get name(){let e=h.decode(s);return l?e.replace(/[/\\]$/,``).split(`/`).pop():e.split(`/`).pop()},get isDirectory(){return l},getCompressedData:function(){return y(!1,null)},getCompressedDataAsync:function(e){y(!0,e)},setData:function(e){u=n.toBuffer(e,n.decoder.encode),!l&&u.length?(o.size=u.length,o.method=n.Constants.DEFLATED,o.crc=n.crc32(e),o.changed=!0):o.method=n.Constants.STORED},getData:function(e){return o.changed?u:v(!1,null,e)},getDataAsync:function(e,t){o.changed?e(u):v(!0,e,t)},set attr(e){o.attr=e},get attr(){return o.attr},set header(e){o.loadFromBinary(e)},get header(){return o},packCentralHeader:function(){o.flags_efs=this.efs,o.extraLength=d.length;var e=o.centralHeaderToBinary(),t=n.Constants.CENHDR;return s.copy(e,t),t+=s.length,d.copy(e,t),t+=o.extraLength,c.copy(e,t),e},packLocalHeader:function(){let e=0;o.flags_efs=this.efs,o.extraLocalLength=f.length;let t=o.localHeaderToBinary(),n=Buffer.alloc(t.length+s.length+o.extraLocalLength);return t.copy(n,e),e+=t.length,s.copy(n,e),e+=s.length,f.copy(n,e),e+=f.length,n},toJSON:function(){let e=function(e){return`<`+(e&&e.length+` bytes buffer`||`null`)+`>`};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:o.toJSON(),compressedData:e(t),data:e(u)}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),hy=/* @__PURE__ */ n(((e,t)=>{let n=my(),r=ly(),i=oy();t.exports=function(e,t){var a=[],o=Object.create(null),s=Buffer.alloc(0),c=new r.MainHeader,l=!1;let u=/* @__PURE__ */ new Set,d=t,{noSort:f,decoder:p}=d;e?g(d.readEntries):l=!0;function m(){let e=/* @__PURE__ */ new Set;for(let t of Object.keys(o)){let n=t.split(`/`);if(n.pop(),n.length)for(let t=0;t<n.length;t++){let r=n.slice(0,t+1).join(`/`)+`/`;e.add(r)}}for(let t of e)if(!(t in o)){let e=new n(d);e.entryName=t,e.attr=16,e.temporary=!0,a.push(e),o[e.entryName]=e,u.add(e)}}function h(){if(l=!0,o=Object.create(null),c.diskEntries>(e.length-c.offset)/i.Constants.CENHDR)throw i.Errors.DISK_ENTRY_TOO_LARGE();a=Array(c.diskEntries);for(var t=c.offset,r=0;r<a.length;r++){var s=t,f=new n(d,e);f.header=e.slice(s,s+=i.Constants.CENHDR),f.entryName=e.slice(s,s+=f.header.fileNameLength),f.header.extraLength&&(f.extra=e.slice(s,s+=f.header.extraLength)),f.header.commentLength&&(f.comment=e.slice(s,s+f.header.commentLength)),t+=f.header.centralHeaderSize,a[r]=f,o[f.entryName]=f}u.clear(),m()}function g(t){var n=e.length-i.Constants.ENDHDR,r=Math.max(0,n-65535),a=r,o=e.length,l=-1,u=0;for(typeof d.trailingSpace==`boolean`&&d.trailingSpace&&(r=0);n>=a;n--)if(e[n]===80){if(e.readUInt32LE(n)===i.Constants.ENDSIG)l=n,u=n,o=n+i.Constants.ENDHDR,a=n-i.Constants.END64HDR;else if(e.readUInt32LE(n)===i.Constants.END64SIG)a=r;else if(e.readUInt32LE(n)===i.Constants.ZIP64SIG){l=n,o=n+i.readBigUInt64LE(e,n+i.Constants.ZIP64SIZE)+i.Constants.ZIP64LEAD;break}}if(l==-1)throw i.Errors.INVALID_FORMAT();c.loadFromBinary(e.slice(l,o)),c.commentLength&&(s=e.slice(u+i.Constants.ENDHDR)),t&&h()}function _(){a.length>1&&!f&&(a=a.map(e=>({entry:e,key:e.entryName.toLowerCase()})).sort((e,t)=>e.key.localeCompare(t.key)).map(e=>e.entry))}return{get entries(){return l||h(),a.filter(e=>!u.has(e))},get comment(){return p.decode(s)},set comment(e){s=i.toBuffer(e,p.encode),c.commentLength=s.length},getEntryCount:function(){return l?a.length:c.diskEntries},forEach:function(e){this.entries.forEach(e)},getEntry:function(e){return l||h(),o[e]||null},setEntry:function(e){l||h(),a.push(e),o[e.entryName]=e,c.totalEntries=a.length},deleteFile:function(e,t=!0){l||h();let n=o[e];this.getEntryChildren(n,t).map(e=>e.entryName).forEach(this.deleteEntry)},deleteEntry:function(e){l||h();let t=o[e],n=a.indexOf(t);n>=0&&(a.splice(n,1),delete o[e],c.totalEntries=a.length)},getEntryChildren:function(e,t=!0){if(l||h(),typeof e==`object`){if(e.isDirectory&&t){let t=[],n=e.entryName;for(let e of a)e.entryName.startsWith(n)&&t.push(e);return t}return[e]}return[]},getChildCount:function(e){if(e&&e.isDirectory){let t=this.getEntryChildren(e);return t.includes(e)?t.length-1:t.length}return 0},compressToBuffer:function(){l||h(),_();let t=[],n=[],r=0,i=0;c.size=0,c.offset=0;let a=0;for(let e of this.entries){let o=e.getCompressedData();e.header.offset=i;let s=e.packLocalHeader(),l=s.length+o.length;i+=l,t.push(s),t.push(o);let u=e.packCentralHeader();n.push(u),c.size+=u.length,r+=l+u.length,a++}r+=c.mainHeaderSize,c.offset=i,c.totalEntries=a,i=0;let o=Buffer.alloc(r);for(let e of t)e.copy(o,i),i+=e.length;for(let e of n)e.copy(o,i),i+=e.length;let u=c.toBinary();return s&&s.copy(u,u.length-s.length),u.copy(o,i),e=o,l=!1,o},toAsyncBuffer:function(t,n,r,i){try{l||h(),_();let n=[],a=[],o=0,u=0,d=0;c.size=0,c.offset=0;let f=function(p){if(p.length>0){let e=p.shift(),t=e.entryName+e.extra.toString();r&&r(t),e.getCompressedDataAsync(function(r){i&&i(t),e.header.offset=u;let s=e.packLocalHeader(),l=s.length+r.length;u+=l,n.push(s),n.push(r);let m=e.packCentralHeader();a.push(m),c.size+=m.length,o+=l+m.length,d++,f(p)})}else{o+=c.mainHeaderSize,c.offset=u,c.totalEntries=d,u=0;let r=Buffer.alloc(o);n.forEach(function(e){e.copy(r,u),u+=e.length}),a.forEach(function(e){e.copy(r,u),u+=e.length});let i=c.toBinary();s&&s.copy(i,i.length-s.length),i.copy(r,u),e=r,l=!1,t(r)}};f(Array.from(this.entries))}catch(e){n(e)}}}}})),gy=/* @__PURE__ */ t((/* @__PURE__ */ n(((t,n)=>{let r=oy(),i=e(`path`),a=my(),o=hy(),s=(...e)=>r.findLast(e,e=>typeof e==`boolean`),c=(...e)=>r.findLast(e,e=>typeof e==`string`),l=(...e)=>r.findLast(e,e=>typeof e==`function`),u={noSort:!1,readEntries:!1,method:r.Constants.NONE,fs:null};n.exports=function(e,t){let n=null,d=Object.assign(Object.create(null),u);e&&typeof e==`object`&&(e instanceof Uint8Array||(Object.assign(d,e),e=d.input?d.input:void 0,d.input&&delete d.input),Buffer.isBuffer(e)&&(n=e,d.method=r.Constants.BUFFER,e=void 0)),Object.assign(d,t);let f=new r(d),p=e=>{e.filter(e=>e.attr).sort((e,t)=>t.path.length-e.path.length).forEach(e=>f.fs.chmodSync(e.path,e.attr))};if((typeof d.decoder!=`object`||typeof d.decoder.encode!=`function`||typeof d.decoder.decode!=`function`)&&(d.decoder=r.decoder),e&&typeof e==`string`){if(f.fs.existsSync(e))d.method=r.Constants.FILE,d.filename=e,n=f.fs.readFileSync(e);else throw r.Errors.INVALID_FILENAME()}let m=new o(n,d),{canonical:h,sanitize:g,zipnamefix:_}=r;function v(e){if(e&&m){var t;if(typeof e==`string`&&(t=m.getEntry(i.posix.normalize(e))),typeof e==`object`&&e.entryName!==void 0&&e.header!==void 0&&(t=m.getEntry(e.entryName)),t)return t}return null}function y(e){let{join:t,normalize:n,sep:r}=i.posix;return t(i.isAbsolute(e)?`/`:`.`,n(r+e.split(`\\`).join(r)+r))}function b(e){return e instanceof RegExp?(function(e){return function(t){return e.test(t)}})(e):typeof e==`function`?e:()=>!0}let x=(e,t)=>{let n=t.slice(-1);return n=n===f.sep?f.sep:``,i.relative(e,t)+n};return{readFile:function(e,t){var n=v(e);return n&&n.getData(t)||null},childCount:function(e){let t=v(e);if(t)return m.getChildCount(t)},readFileAsync:function(e,t){var n=v(e);n?n.getDataAsync(t):t(null,`getEntry failed for:`+e)},readAsText:function(e,t){var n=v(e);if(n){var r=n.getData();if(r&&r.length)return r.toString(t||`utf8`)}return``},readAsTextAsync:function(e,t,n){var r=v(e);r?r.getDataAsync(function(e,r){r?t(e,r):e&&e.length?t(e.toString(n||`utf8`)):t(``)}):t(``)},deleteFile:function(e,t=!0){var n=v(e);n&&m.deleteFile(n.entryName,t)},deleteEntry:function(e){var t=v(e);t&&m.deleteEntry(t.entryName)},addZipComment:function(e){m.comment=e},getZipComment:function(){return m.comment||``},addZipEntryComment:function(e,t){var n=v(e);n&&(n.comment=t)},getZipEntryComment:function(e){var t=v(e);return t&&t.comment||``},updateFile:function(e,t){var n=v(e);n&&n.setData(t)},addLocalFile:function(e,t,n,a){if(f.fs.existsSync(e)){t=t?y(t):``;let r=i.win32.basename(i.win32.normalize(e));t+=n||r;let o=f.fs.statSync(e),s=o.isFile()?f.fs.readFileSync(e):Buffer.alloc(0);o.isDirectory()&&(t+=f.sep),this.addFile(t,s,a,o)}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFileAsync:function(e,t){e=typeof e==`object`?e:{localPath:e};let n=i.resolve(e.localPath),{comment:r}=e,{zipPath:a,zipName:o}=e,s=this;f.fs.stat(n,function(e,c){if(e)return t(e,!1);a=a?y(a):``;let l=i.win32.basename(i.win32.normalize(n));if(a+=o||l,c.isFile())f.fs.readFile(n,function(e,n){return e?t(e,!1):(s.addFile(a,n,r,c),setImmediate(t,void 0,!0))});else if(c.isDirectory())return a+=f.sep,s.addFile(a,Buffer.alloc(0),r,c),setImmediate(t,void 0,!0)})},addLocalFolder:function(e,t,n){if(n=b(n),t=t?y(t):``,e=i.normalize(e),f.fs.existsSync(e)){let r=f.findFiles(e),a=this;if(r.length)for(let o of r){let r=i.join(t,x(e,o));n(r)&&a.addLocalFile(o,i.dirname(r))}}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFolderAsync:function(e,t,n,a){a=b(a),n=n?y(n):``,e=i.normalize(e);var o=this;f.fs.open(e,`r`,function(i){if(i&&i.code===`ENOENT`)t(void 0,r.Errors.FILE_NOT_FOUND(e));else if(i)t(void 0,i);else{var s=f.findFiles(e),c=-1,l=function(){if(c+=1,c<s.length){var r=s[c],i=x(e,r).split(`\\`).join(`/`);i=i.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x20-\x7E]/g,``),a(i)?f.fs.stat(r,function(e,a){e&&t(void 0,e),a.isFile()?f.fs.readFile(r,function(e,r){e?t(void 0,e):(o.addFile(n+i,r,``,a),l())}):(o.addFile(n+i+`/`,Buffer.alloc(0),``,a),l())}):process.nextTick(()=>{l()})}else t(!0,void 0)};l()}})},addLocalFolderAsync2:function(e,t){let n=this;e=typeof e==`object`?e:{localPath:e};let a=i.resolve(y(e.localPath)),{zipPath:o,filter:s,namefix:c}=e;s instanceof RegExp?s=(function(e){return function(t){return e.test(t)}})(s):typeof s!=`function`&&(s=function(){return!0}),o=o?y(o):``,c===`latin1`&&(c=e=>e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x20-\x7E]/g,``)),typeof c!=`function`&&(c=e=>e);let l=e=>i.join(o,c(x(a,e))),u=e=>i.win32.basename(i.win32.normalize(c(e)));f.fs.open(a,`r`,function(e){e&&e.code===`ENOENT`?t(void 0,r.Errors.FILE_NOT_FOUND(a)):e?t(void 0,e):f.findFilesAsync(a,function(e,r){if(e)return t(e);r=r.filter(e=>s(l(e))),r.length||t(void 0,!1),setImmediate(r.reverse().reduce(function(e,t){return function(r,a){if(r||a===!1)return setImmediate(e,r,!1);n.addLocalFileAsync({localPath:t,zipPath:i.dirname(l(t)),zipName:u(t)},e)}},t))})})},addLocalFolderPromise:function(e,t){return new Promise((n,r)=>{this.addLocalFolderAsync2(Object.assign({localPath:e},t),(e,t)=>{e&&r(e),t&&n(this)})})},addFile:function(e,t,n,r){e=_(e);let i=v(e),o=i!=null;o||(i=new a(d),i.entryName=e),i.comment=n||``;let s=typeof r==`object`&&r instanceof f.fs.Stats;s&&(i.header.time=r.mtime);var c=i.isDirectory?16:0;let l=i.isDirectory?16384:32768;return l|=s?4095&r.mode:typeof r==`number`?4095&r:i.isDirectory?493:420,c=(c|l<<16)>>>0,i.attr=c,i.setData(t),o||m.setEntry(i),i},getEntries:function(e){return m.password=e,m?m.entries:[]},getEntry:function(e){return v(e)},getEntryCount:function(){return m.getEntryCount()},forEach:function(e){return m.forEach(e)},extractEntryTo:function(e,t,n,a,o,l){a=s(!1,a),o=s(!1,o),n=s(!0,n),l=c(o,l);var u=v(e);if(!u)throw r.Errors.NO_ENTRY();var d=h(u.entryName),p=g(t,l&&!u.isDirectory?h(l):n?d:i.basename(d));if(u.isDirectory)return m.getEntryChildren(u).forEach(function(e){if(e.isDirectory)return;var i=e.getData();if(!i)throw r.Errors.CANT_EXTRACT_FILE();var s=h(n?e.entryName:e.entryName.substring(u.entryName.length)),c=g(t,s);let l=o?e.header.fileAttr:void 0;f.writeFileTo(c,i,a,l)}),!0;var _=u.getData(m.password);if(!_)throw r.Errors.CANT_EXTRACT_FILE();if(f.fs.existsSync(p)&&!a)throw r.Errors.CANT_OVERRIDE();let y=o?e.header.fileAttr:void 0;return f.writeFileTo(p,_,a,y),!0},test:function(e){if(!m)return!1;for(var t of m.entries)try{if(t.isDirectory)continue;if(!t.getData(e))return!1}catch{return!1}return!0},extractAllTo:function(e,t,n,i){if(n=s(!1,n),i=c(n,i),t=s(!1,t),!m)throw r.Errors.NO_ZIP();let a=[];m.entries.forEach(function(o){var s=g(e,h(o.entryName));if(o.isDirectory){f.makeDir(s),n&&a.push({path:s,attr:o.header.fileAttr});return}var c=o.getData(i);if(!c)throw r.Errors.CANT_EXTRACT_FILE();let l=n?o.header.fileAttr:void 0;f.writeFileTo(s,c,t,l);try{f.fs.utimesSync(s,o.header.time,o.header.time)}catch{}}),p(a)},extractAllToAsync:function(e,t,n,a){if(a=l(t,n,a),n=s(!1,n),t=s(!1,t),!a)return new Promise((r,i)=>{this.extractAllToAsync(e,t,n,function(e){e?i(e):r(this)})});if(!m){a(r.Errors.NO_ZIP());return}e=i.resolve(e);let o=t=>g(e,i.normalize(h(t.entryName))),c=(e,t)=>/* @__PURE__ */ Error(e+`: "`+t+`"`),u=[],d=[];m.entries.forEach(e=>{e.isDirectory?u.push(e):d.push(e)});let _=[];for(let e of u){let t=o(e),r=n?e.header.fileAttr:void 0;try{f.makeDir(t)}catch{a(c(`Unable to create folder`,t));continue}r&&_.push({path:t,attr:r});try{f.fs.utimesSync(t,e.header.time,e.header.time)}catch{}}d.reverse().reduce(function(a,o){return function(s){if(s)a(s);else{let s=i.normalize(h(o.entryName)),l=g(e,s);o.getDataAsync(function(e,i){if(i)a(i);else if(!e)a(r.Errors.CANT_EXTRACT_FILE());else{let r=n?o.header.fileAttr:void 0;f.writeFileToAsync(l,e,t,r,function(e){if(!e)return a(c(`Unable to write file`,l));f.fs.utimes(l,o.header.time,o.header.time,function(){a()})})}})}}},e=>{if(!e)try{p(_)}catch(e){return a(c(`Unable to set folder permissions`,e.path||``))}a(e)})()},writeZip:function(e,t){if(arguments.length===1&&typeof e==`function`&&(t=e,e=``),!e&&d.filename&&(e=d.filename),e){var n=m.compressToBuffer();if(n){var r=f.writeFileTo(e,n,!0);typeof t==`function`&&t(r?null:/* @__PURE__ */ Error(`failed`),``)}}},writeZipPromise:function(e,t){let{overwrite:n,perm:r}=Object.assign({overwrite:!0},t);return new Promise((t,i)=>{!e&&d.filename&&(e=d.filename),e||i(`ADM-ZIP: ZIP File Name Missing`),this.toBufferPromise().then(a=>{f.writeFileToAsync(e,a,n,r,e=>e?t(e):i(`ADM-ZIP: Wasn't able to write zip file`))},i)})},toBufferPromise:function(){return new Promise((e,t)=>{m.toAsyncBuffer(e,t)})},toBuffer:function(e,t,n,r){return typeof e==`function`?(m.toAsyncBuffer(e,t,n,r),null):m.compressToBuffer()}}}})))(),1),_y=/* @__PURE__ */ t(en(),1),vy=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 yy=`mintlify`,by=`templates`,xy=`main`;function Sy(){return vy(this,void 0,void 0,function*(){let e=yield fetch(`https://api.github.com/repos/${yy}/${by}/contents/?ref=${xy}`,{headers:{Accept:`application/vnd.github.v3+json`}});if(!e.ok)throw Error(`Failed to fetch templates: ${e.status} ${e.statusText}`);return(yield e.json()).filter(e=>e.type===`dir`).map(e=>e.name)})}function Cy(e){return vy(this,void 0,void 0,function*(){if(!e||e===`.`||e===`..`||e.includes(`/`))throw Error(`Invalid template name: "${e}".`);let t=`https://api.github.com/repos/${yy}/${by}/contents/${encodeURIComponent(e)}?ref=${xy}`,n=yield fetch(t,{headers:{Accept:`application/vnd.github.v3+json`}});if(!n.ok){let t=yield Sy().catch(()=>[]),n=t.length>0?` Available templates: ${t.join(`, `)}`:``;throw Error(`Template "${e}" not found in ${yy}/${by}.${n}`)}if(!(yield n.json()).some(e=>e.name===`docs.json`))throw Error(`Template "${e}" is not a valid Mintlify template (missing docs.json).`);return e})}function wy(){return vy(this,void 0,void 0,function*(){v((0,P.jsx)(p,{message:`fetching available templates...`}));let e;try{e=yield Sy()}catch{throw A(),Error(`Failed to fetch templates. Please check your network connection and try again.`)}if(A(),e.length===0)throw Error(`No templates are currently available.`);return ip({message:`Choose a template`,choices:e.map(e=>({name:e,value:e}))})})}function Ty(e,t,n,r){return vy(this,void 0,void 0,function*(){let i=dr.join(e,`__template__.zip`),a=dr.join(e,`__template_extract__`);try{v((0,P.jsx)(p,{message:`downloading template "${t}"...`}));try{let e=yield fetch(`https://github.com/${yy}/${by}/archive/refs/heads/${xy}.zip`);if(!e.ok)throw Error(`Failed to download templates archive: ${e.status}`);let t=yield e.arrayBuffer();yield _y.default.writeFile(i,Buffer.from(t))}finally{A()}v((0,P.jsx)(p,{message:`extracting template...`}));try{new gy.default(i).extractAllTo(a,!0)}finally{A()}let n=dr.join(a,`${by}-${xy}`),r=dr.join(n,t);if(!(yield _y.default.pathExists(r)))throw Error(`Template directory "${t}" not found in the downloaded archive.`);yield _y.default.copy(r,e,{overwrite:!0})}finally{yield _y.default.remove(i).catch(()=>{}),yield _y.default.remove(a).catch(()=>{})}let o=dr.join(e,`docs.json`);if(yield _y.default.pathExists(o)){let e=yield _y.default.readJson(o);n&&(e.name=n),r&&(e.theme=r),yield _y.default.writeJson(o,e,{spaces:2})}})}var Ey=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 Dy=e=>{k((0,P.jsx)(M,{bold:!0,children:`Documentation Setup!`}),(0,P.jsx)(M,{children:`To see your docs run`}),(0,P.jsxs)(st,{children:[(0,P.jsx)(M,{color:`blue`,children:`cd`}),(0,P.jsxs)(M,{children:[` `,e]})]}),(0,P.jsx)(M,{color:`blue`,children:`mint dev`})),Et()&&v((0,P.jsxs)(M,{children:["When the docs are ready, run `mint validate` in ",e,` to check the build and get publish steps.`]}))},Oy=(e,t,n,r)=>{let i=r===void 0?`Unable to fetch templates — use --template flag if you know the name`:r.length>0?`Templates: ${JSON.stringify(r)}`:`No templates are currently available`;k((0,P.jsx)(M,{children:`Agent Detected - sending AI friendly prompt`}),(0,P.jsx)(M,{children:`<system-message>`}),(0,P.jsx)(M,{children:"Help the user set up a Mintlify docs site with `mint new`. Ask each step one at a time unless the user asks you to skip questions or use your best judgment."}),(0,P.jsx)(M,{children:[`- [ ] Pick a theme or clone a template? (${i})`,`- [ ] If template: which one? If theme: which one? (Themes: ${JSON.stringify(n)})`,`- [ ] Project name?`,`- [ ] Directory? (default: "${e}", auto-created if needed)${t?` ⚠️ "${e}" is occupied — subdirectory, overwrite (--force), or different path?`:``}`].join(`
557
+ `)}var Uv=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 Wv=[`bug`,`docs`,`idea`];function Gv(e){return Uv(this,void 0,void 0,function*(){let t;try{t=yield fetch(`${Ft}/api/cli/feedback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(Object.assign(Object.assign({},e),{source:`cli`}))})}catch{return`could not reach the server`}return t.ok?void 0:`could not send feedback (HTTP ${t.status})`})}function Kv(e){return Uv(this,void 0,void 0,function*(){let t=yield Gv(e);return v(t?(0,P.jsx)(d,{message:t}):(0,P.jsx)(s,{message:`feedback sent`})),!t})}var qv=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())})},Jv=function(e){return this instanceof Jv?(this.v=e,this):new Jv(e)},Yv=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},Xv=function(e){var t={},n;return r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:Jv(e[r](t)),done:!1}:i?i(t):t}:i}},Zv=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Jv?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function Qv(){return qv(this,void 0,void 0,function*(){try{let e=yield Ar.readFile(Fr.join(Mt,`.gitignore`),`utf-8`);return Re(e)}catch{return[]}})}function $v(e,t){return Zv(this,arguments,function*(){let n=yield Jv(Ar.readdir(e,{withFileTypes:!0}));for(let r of n){let n=Fr.join(e,r.name),i=Fr.relative(Mt,n).split(Fr.sep).join(`/`);ot(i,t,r.isDirectory())||(r.isDirectory()?yield Jv(yield*Xv(Yv($v(n,t)))):r.name.endsWith(`.mdx`)&&(yield yield Jv(n)))}})}const ey=()=>qv(void 0,void 0,void 0,function*(){var e,t,n,r;let{mdxToPm:i,pmToMdx:a,canonicalPmToMdxOptions:o}=yield import(`./converter-D-xOhkG2.js`),c=[...yield Qv(),...yield Ze(Mt)],l=Fe(c),u=0,f=0,p=0;try{for(var m=!0,h=Yv($v(Mt,l)),g;g=yield h.next(),e=g.done,!e;m=!0){r=g.value,m=!1;let e=r;u++;let t=Fr.relative(Mt,e);try{let t=yield Ar.readFile(e,`utf-8`),n=t,r=0;for(let e=0;e<3;e++){let{doc:t,frontmatter:s}=i(n);e===0&&(r=Object.keys(s).length);let c=`${a(t,Object.assign({frontmatter:s},o))}\n`;if(c===n)break;n=c}if(r>0&&!n.startsWith(`---`))throw Error(`formatting would remove frontmatter; file left untouched`);n!==t&&(yield Ar.writeFile(e,n),f++)}catch(e){p++,v((0,P.jsx)(d,{message:`${t}: ${e instanceof Error?e.message:`unknown error`}`}))}}}catch(e){t={error:e}}finally{try{!m&&!e&&(n=h.return)&&(yield n.call(h))}finally{if(t)throw t.error}}v((0,P.jsx)(s,{message:`formatted ${f} of ${u} mdx file${u===1?``:`s`}${p>0?` (${p} failed)`:``}`})),yield N(+(p>0))});var ty=/* @__PURE__ */ n(((e,t)=>{t.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}})),ny=/* @__PURE__ */ n((e=>{let t={INVALID_LOC:`Invalid LOC header (bad signature)`,INVALID_CEN:`Invalid CEN header (bad signature)`,INVALID_END:`Invalid END header (bad signature)`,DESCRIPTOR_NOT_EXIST:`No descriptor present`,DESCRIPTOR_UNKNOWN:`Unknown descriptor format`,DESCRIPTOR_FAULTY:`Descriptor data is malformed`,NO_DATA:`Nothing to decompress`,BAD_CRC:`CRC32 checksum failed {0}`,FILE_IN_THE_WAY:`There is a file in the way: {0}`,UNKNOWN_METHOD:`Invalid/unsupported compression method`,AVAIL_DATA:`inflate::Available inflate data did not terminate`,INVALID_DISTANCE:`inflate::Invalid literal/length or distance code in fixed or dynamic block`,TO_MANY_CODES:`inflate::Dynamic block code description: too many length or distance codes`,INVALID_REPEAT_LEN:`inflate::Dynamic block code description: repeat more than specified lengths`,INVALID_REPEAT_FIRST:`inflate::Dynamic block code description: repeat lengths with no first length`,INCOMPLETE_CODES:`inflate::Dynamic block code description: code lengths codes incomplete`,INVALID_DYN_DISTANCE:`inflate::Dynamic block code description: invalid distance code lengths`,INVALID_CODES_LEN:`inflate::Dynamic block code description: invalid literal/length code lengths`,INVALID_STORE_BLOCK:`inflate::Stored block length did not match one's complement`,INVALID_BLOCK_TYPE:`inflate::Invalid block type (type == 3)`,CANT_EXTRACT_FILE:`Could not extract the file`,CANT_OVERRIDE:`Target file already exists`,DISK_ENTRY_TOO_LARGE:`Number of disk entries is too large`,NO_ZIP:`No zip file was loaded`,NO_ENTRY:`Entry doesn't exist`,DIRECTORY_CONTENT_ERROR:`A directory cannot have content`,FILE_NOT_FOUND:`File not found: "{0}"`,NOT_IMPLEMENTED:`Not implemented`,INVALID_FILENAME:`Invalid filename`,INVALID_FORMAT:`Invalid or unsupported zip format. No END header found`,INVALID_PASS_PARAM:`Incompatible password parameter`,WRONG_PASSWORD:`Wrong Password`,COMMENT_TOO_LONG:`Comment is too long`,EXTRA_FIELD_PARSE_ERROR:`Extra field parsing error`};function n(e){return function(...t){return t.length&&(e=e.replace(/\{(\d)\}/g,(e,n)=>t[n]||``)),/* @__PURE__ */ Error(`ADM-ZIP: `+e)}}for(let r of Object.keys(t))e[r]=n(t[r])})),ry=/* @__PURE__ */ n(((t,n)=>{let r=e(`fs`),i=e(`path`),a=ty(),o=ny(),s=typeof process==`object`&&process.platform===`win32`,c=e=>typeof e==`object`&&!!e,l=(/* @__PURE__ */ new Uint32Array(256)).map((e,t)=>{for(let e=0;e<8;e++)t&1?t=3988292384^t>>>1:t>>>=1;return t>>>0});function u(e){this.sep=i.sep,this.fs=r,c(e)&&c(e.fs)&&typeof e.fs.statSync==`function`&&(this.fs=e.fs)}n.exports=u,u.prototype.makeDir=function(e){let t=this;function n(e){let n=e.split(t.sep)[0];e.split(t.sep).forEach(function(e){if(e&&e.substr(-1,1)!==`:`){n+=t.sep+e;var r;try{r=t.fs.statSync(n)}catch(e){if(e.message&&e.message.startsWith(`ENOENT`))t.fs.mkdirSync(n);else throw e}if(r&&r.isFile())throw o.FILE_IN_THE_WAY(`"${n}"`)}})}n(e)},u.prototype.writeFileTo=function(e,t,n,r){let a=this;if(a.fs.existsSync(e)&&(!n||a.fs.statSync(e).isDirectory()))return!1;var o=i.dirname(e);a.fs.existsSync(o)||a.makeDir(o);var s;try{s=a.fs.openSync(e,`w`,438)}catch{a.fs.chmodSync(e,438),s=a.fs.openSync(e,`w`,438)}if(s)try{a.fs.writeSync(s,t,0,t.length,0)}finally{a.fs.closeSync(s)}return a.fs.chmodSync(e,r||438),!0},u.prototype.writeFileToAsync=function(e,t,n,r,a){typeof r==`function`&&(a=r,r=void 0);let o=this;o.fs.exists(e,function(s){if(s&&!n)return a(!1);o.fs.stat(e,function(n,c){if(s&&c&&c.isDirectory())return a(!1);var l=i.dirname(e);o.fs.exists(l,function(n){if(!n)try{o.makeDir(l)}catch{return a(!1)}let i=function(n){o.fs.write(n,t,0,t.length,0,function(t){o.fs.close(n,function(){if(t)return a(!1);o.fs.chmod(e,r||438,function(){a(!0)})})})};o.fs.open(e,`w`,438,function(t,n){t?o.fs.chmod(e,438,function(){o.fs.open(e,`w`,438,function(e,t){if(e||!t)return a(!1);i(t)})}):n?i(n):a(!1)})})})})},u.prototype.findFiles=function(e){let t=this;function n(e,r,a,o){typeof r==`boolean`&&(a=r,r=void 0);let s=[];return t.fs.readdirSync(e).forEach(function(c){let l=i.join(e,c),u=t.fs.statSync(l);if((!r||r.test(l))&&s.push(i.normalize(l)+(u.isDirectory()?t.sep:``)),u.isDirectory()&&a){let e=t.fs.realpathSync(l);o.has(e)||(o.add(e),s=s.concat(n(l,r,a,o)))}}),s}return n(e,void 0,!0,/* @__PURE__ */ new Set([t.fs.realpathSync(e)]))},u.prototype.findFilesAsync=function(e,t){let n=this,r=[],a=!1,o=function(e){a||(a=!0,t(e,e?void 0:r))},s=function(e,t,a){n.fs.readdir(e,function(o,c){if(o)return a(o);let l=c.length;if(!l)return a();c.forEach(function(o){let c=i.join(e,o);n.fs.stat(c,function(e,o){if(e)return a(e);o?(r.push(i.normalize(c)+(o.isDirectory()?n.sep:``)),o.isDirectory()?n.fs.realpath(c,function(e,n){if(e)return a(e);t.has(n)?--l||a():(t.add(n),s(c,t,function(e){if(e)return a(e);--l||a()}))}):--l||a()):--l||a()})})})};n.fs.realpath(e,function(t,n){if(t)return o(t);s(e,/* @__PURE__ */ new Set([n]),o)})},u.prototype.getAttributes=function(){},u.prototype.setAttributes=function(){},u.crc32update=function(e,t){return l[(e^t)&255]^e>>>8},u.crc32=function(e){typeof e==`string`&&(e=Buffer.from(e,`utf8`));let t=e.length,n=-1;for(let r=0;r<t;)n=u.crc32update(n,e[r++]);return~n>>>0},u.methodToString=function(e){switch(e){case a.STORED:return`STORED (`+e+`)`;case a.DEFLATED:return`DEFLATED (`+e+`)`;default:return`UNSUPPORTED (`+e+`)`}},u.canonical=function(e){if(!e)return``;let t=i.posix.normalize(`/`+e.split(`\\`).join(`/`));return i.join(`.`,t)},u.zipnamefix=function(e){if(!e)return``;let t=i.posix.normalize(`/`+e.split(`\\`).join(`/`));return i.posix.join(`.`,t)},u.findLast=function(e,t){if(!Array.isArray(e))throw TypeError(`arr is not array`);let n=e.length>>>0;for(let r=n-1;r>=0;r--)if(t(e[r],r,e))return e[r]},u.sanitize=function(e,t){e=i.resolve(i.normalize(e));for(var n=t.split(`/`),r=0,a=n.length;r<a;r++){var o=i.normalize(i.join(e,n.slice(r,a).join(i.sep)));if(o===e||o.startsWith(e+i.sep))return o}return i.normalize(i.join(e,i.basename(t)))},u.toBuffer=function(e,t){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e==`string`?t(e):Buffer.alloc(0)},u.readBigUInt64LE=function(e,t){let n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n},u.writeBigUInt64LE=function(e,t,n){let r=t>>>0,i=Math.floor(t/4294967296)>>>0;e.writeUInt32LE(r,n),e.writeUInt32LE(i,n+4)},u.fromDOS2Date=function(e){return new Date((e>>25&127)+1980,Math.max((e>>21&15)-1,0),Math.max(e>>16&31,1),e>>11&31,e>>5&63,(e&31)<<1)},u.fromDate2DOS=function(e){let t=0,n=0;return e.getFullYear()>1979&&(t=(e.getFullYear()-1980&127)<<9|e.getMonth()+1<<5|e.getDate(),n=e.getHours()<<11|e.getMinutes()<<5|e.getSeconds()>>1),t<<16|n},u.isWin=s,u.crcTable=l})),iy=/* @__PURE__ */ n(((t,n)=>{let r=e(`path`);n.exports=function(e,{fs:t}){var n=e||``,i=o(),a=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return n&&t.existsSync(n)?(a=t.statSync(n),i.directory=a.isDirectory(),i.mtime=a.mtime,i.atime=a.atime,i.executable=!!(73&a.mode),i.readonly=!(128&a.mode),i.hidden=r.basename(n)[0]===`.`):console.warn(`Invalid path: `+n),{get directory(){return i.directory},get readOnly(){return i.readonly},get hidden(){return i.hidden},get mtime(){return i.mtime},get atime(){return i.atime},get executable(){return i.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:n,isDirectory:i.directory,isReadOnly:i.readonly,isHidden:i.hidden,isExecutable:i.executable,mTime:i.mtime,aTime:i.atime}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),ay=/* @__PURE__ */ n(((e,t)=>{t.exports={efs:!0,encode:e=>Buffer.from(e,`utf8`),decode:e=>e.toString(`utf8`)}})),oy=/* @__PURE__ */ n(((e,t)=>{t.exports=ry(),t.exports.Constants=ty(),t.exports.Errors=ny(),t.exports.FileAttr=iy(),t.exports.decoder=ay()})),sy=/* @__PURE__ */ n(((e,t)=>{var n=oy(),r=n.Constants;t.exports=function(){var e=20,t=10,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0;e|=n.isWin?2560:768,i|=r.FLG_EFS;let _={extraLen:0},v=e=>Math.max(0,e)>>>0,y=e=>Math.max(0,e)&255;return o=n.fromDate2DOS(/* @__PURE__ */ new Date),{get made(){return e},set made(t){e=t},get version(){return t},set version(e){t=e},get flags(){return i},set flags(e){i=e},get flags_efs(){return(i&r.FLG_EFS)>0},set flags_efs(e){e?i|=r.FLG_EFS:i&=~r.FLG_EFS},get flags_desc(){return(i&r.FLG_DESC)>0},set flags_desc(e){e?i|=r.FLG_DESC:i&=~r.FLG_DESC},get method(){return a},set method(e){switch(e){case r.STORED:this.version=10;break;case r.DEFLATED:default:this.version=20}a=e},get time(){return n.fromDOS2Date(this.timeval)},set time(e){e=new Date(e),this.timeval=n.fromDate2DOS(e)},get timeval(){return o},set timeval(e){o=v(e)},get timeHighByte(){return y(o>>>8)},get crc(){return s},set crc(e){s=v(e)},get compressedSize(){return c},set compressedSize(e){c=v(e)},get size(){return l},set size(e){l=v(e)},get fileNameLength(){return u},set fileNameLength(e){u=e},get extraLength(){return d},set extraLength(e){d=e},get extraLocalLength(){return _.extraLen},set extraLocalLength(e){_.extraLen=e},get commentLength(){return f},set commentLength(e){f=e},get diskNumStart(){return p},set diskNumStart(e){p=v(e)},get inAttr(){return m},set inAttr(e){m=v(e)},get attr(){return h},set attr(e){h=v(e)},get fileAttr(){return(h||0)>>16&4095},get offset(){return g},set offset(e){g=v(e)},get encrypted(){return(i&r.FLG_ENC)===r.FLG_ENC},get centralHeaderSize(){return r.CENHDR+u+d+f},get realDataOffset(){return g+r.LOCHDR+_.fnameLen+_.extraLen},get localHeader(){return _},loadLocalHeaderFromBinary:function(e){var t=e.slice(g,g+r.LOCHDR);if(t.readUInt32LE(0)!==r.LOCSIG)throw n.Errors.INVALID_LOC();_.version=t.readUInt16LE(r.LOCVER),_.flags=t.readUInt16LE(r.LOCFLG),_.flags_desc=(_.flags&r.FLG_DESC)>0,_.method=t.readUInt16LE(r.LOCHOW),_.time=t.readUInt32LE(r.LOCTIM),_.crc=t.readUInt32LE(r.LOCCRC),_.compressedSize=t.readUInt32LE(r.LOCSIZ),_.size=t.readUInt32LE(r.LOCLEN),_.fnameLen=t.readUInt16LE(r.LOCNAM),_.extraLen=t.readUInt16LE(r.LOCEXT);let i=g+r.LOCHDR+_.fnameLen,a=i+_.extraLen;return e.slice(i,a)},loadFromBinary:function(_){if(_.length!==r.CENHDR||_.readUInt32LE(0)!==r.CENSIG)throw n.Errors.INVALID_CEN();e=_.readUInt16LE(r.CENVEM),t=_.readUInt16LE(r.CENVER),i=_.readUInt16LE(r.CENFLG),a=_.readUInt16LE(r.CENHOW),o=_.readUInt32LE(r.CENTIM),s=_.readUInt32LE(r.CENCRC),c=_.readUInt32LE(r.CENSIZ),l=_.readUInt32LE(r.CENLEN),u=_.readUInt16LE(r.CENNAM),d=_.readUInt16LE(r.CENEXT),f=_.readUInt16LE(r.CENCOM),p=_.readUInt16LE(r.CENDSK),m=_.readUInt16LE(r.CENATT),h=_.readUInt32LE(r.CENATX),g=_.readUInt32LE(r.CENOFF)},localHeaderToBinary:function(){var e=Buffer.alloc(r.LOCHDR);return e.writeUInt32LE(r.LOCSIG,0),e.writeUInt16LE(t,r.LOCVER),e.writeUInt16LE(i&~r.FLG_DESC,r.LOCFLG),e.writeUInt16LE(a,r.LOCHOW),e.writeUInt32LE(o,r.LOCTIM),e.writeUInt32LE(s,r.LOCCRC),e.writeUInt32LE(c,r.LOCSIZ),e.writeUInt32LE(l,r.LOCLEN),e.writeUInt16LE(u,r.LOCNAM),e.writeUInt16LE(_.extraLen,r.LOCEXT),e},centralHeaderToBinary:function(){var n=Buffer.alloc(r.CENHDR+u+d+f);return n.writeUInt32LE(r.CENSIG,0),n.writeUInt16LE(e,r.CENVEM),n.writeUInt16LE(t,r.CENVER),n.writeUInt16LE(i&~r.FLG_DESC,r.CENFLG),n.writeUInt16LE(a,r.CENHOW),n.writeUInt32LE(o,r.CENTIM),n.writeUInt32LE(s,r.CENCRC),n.writeUInt32LE(c,r.CENSIZ),n.writeUInt32LE(l,r.CENLEN),n.writeUInt16LE(u,r.CENNAM),n.writeUInt16LE(d,r.CENEXT),n.writeUInt16LE(f,r.CENCOM),n.writeUInt16LE(p,r.CENDSK),n.writeUInt16LE(m,r.CENATT),n.writeUInt32LE(h,r.CENATX),n.writeUInt32LE(g,r.CENOFF),n},toJSON:function(){let o=function(e){return e+` bytes`};return{made:e,version:t,flags:i,method:n.methodToString(a),time:this.time,crc:`0x`+s.toString(16).toUpperCase(),compressedSize:o(c),size:o(l),fileNameLength:o(u),extraLength:o(d),commentLength:o(f),diskNumStart:p,inAttr:m,attr:h,offset:g,centralHeaderSize:o(r.CENHDR+u+d+f)}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),cy=/* @__PURE__ */ n(((e,t)=>{var n=oy(),r=n.Constants;t.exports=function(){var e=0,t=0,i=0,a=0,o=0;let s=()=>e>r.EF_ZIP64_OR_16||t>r.EF_ZIP64_OR_16||i>r.EF_ZIP64_OR_32||a>r.EF_ZIP64_OR_32;return{get diskEntries(){return e},set diskEntries(n){e=t=n},get totalEntries(){return t},set totalEntries(n){t=e=n},get size(){return i},set size(e){i=e},get offset(){return a},set offset(e){a=e},get commentLength(){return o},set commentLength(e){o=e},get mainHeaderSize(){return(s()?r.ZIP64HDR+r.END64HDR:0)+r.ENDHDR+o},loadFromBinary:function(s){if((s.length!==r.ENDHDR||s.readUInt32LE(0)!==r.ENDSIG)&&(s.length<r.ZIP64HDR||s.readUInt32LE(0)!==r.ZIP64SIG))throw n.Errors.INVALID_END();s.readUInt32LE(0)===r.ENDSIG?(e=s.readUInt16LE(r.ENDSUB),t=s.readUInt16LE(r.ENDTOT),i=s.readUInt32LE(r.ENDSIZ),a=s.readUInt32LE(r.ENDOFF),o=s.readUInt16LE(r.ENDCOM)):(e=n.readBigUInt64LE(s,r.ZIP64SUB),t=n.readBigUInt64LE(s,r.ZIP64TOT),i=n.readBigUInt64LE(s,r.ZIP64SIZB),a=n.readBigUInt64LE(s,r.ZIP64OFF),o=0)},toBinary:function(){if(!s()){var c=Buffer.alloc(r.ENDHDR+o);return c.writeUInt32LE(r.ENDSIG,0),c.writeUInt32LE(0,4),c.writeUInt16LE(e,r.ENDSUB),c.writeUInt16LE(t,r.ENDTOT),c.writeUInt32LE(i,r.ENDSIZ),c.writeUInt32LE(a,r.ENDOFF),c.writeUInt16LE(o,r.ENDCOM),c.fill(` `,r.ENDHDR),c}var c=Buffer.alloc(this.mainHeaderSize);let l=0;c.writeUInt32LE(r.ZIP64SIG,l),n.writeBigUInt64LE(c,r.ZIP64HDR-r.ZIP64LEAD,l+r.ZIP64SIZE),c.writeUInt16LE(45,l+r.ZIP64VEM),c.writeUInt16LE(45,l+r.ZIP64VER),c.writeUInt32LE(0,l+r.ZIP64DSK),c.writeUInt32LE(0,l+r.ZIP64DSKDIR),n.writeBigUInt64LE(c,e,l+r.ZIP64SUB),n.writeBigUInt64LE(c,t,l+r.ZIP64TOT),n.writeBigUInt64LE(c,i,l+r.ZIP64SIZB),n.writeBigUInt64LE(c,a,l+r.ZIP64OFF);let u=a+i;return l+=r.ZIP64HDR,c.writeUInt32LE(r.END64SIG,l),c.writeUInt32LE(0,l+r.END64START),n.writeBigUInt64LE(c,u,l+r.END64OFF),c.writeUInt32LE(1,l+r.END64NUMDISKS),l+=r.END64HDR,c.writeUInt32LE(r.ENDSIG,l),c.writeUInt32LE(0,l+4),c.writeUInt16LE(Math.min(e,r.EF_ZIP64_OR_16),l+r.ENDSUB),c.writeUInt16LE(Math.min(t,r.EF_ZIP64_OR_16),l+r.ENDTOT),c.writeUInt32LE(Math.min(i,r.EF_ZIP64_OR_32),l+r.ENDSIZ),c.writeUInt32LE(Math.min(a,r.EF_ZIP64_OR_32),l+r.ENDOFF),c.writeUInt16LE(o,l+r.ENDCOM),c.fill(` `,l+r.ENDHDR),c},toJSON:function(){return{diskEntries:e,totalEntries:t,size:i+` bytes`,offset:function(e,t){let n=e.toString(16).toUpperCase();for(;n.length<t;)n=`0`+n;return`0x`+n}(a,4),commentLength:o}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),ly=/* @__PURE__ */ n((e=>{e.EntryHeader=sy(),e.MainHeader=cy()})),uy=/* @__PURE__ */ n(((t,n)=>{n.exports=function(t){var n=e(`zlib`),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return n.deflateRawSync(t,r)},deflateAsync:function(e){var i=n.createDeflateRaw(r),a=[],o=0;i.on(`data`,function(e){a.push(e),o+=e.length}),i.on(`end`,function(){var t=Buffer.alloc(o),n=0;t.fill(0);for(var r=0;r<a.length;r++){var i=a[r];i.copy(t,n),n+=i.length}e&&e(t)}),i.end(t)}}}})),dy=/* @__PURE__ */ n(((t,n)=>{let r=+(process?.versions?.node??``).split(`.`)[0]||0;n.exports=function(t,n){var i=e(`zlib`);let a=r>=15&&n>0?{maxOutputLength:n}:{};return{inflate:function(){return i.inflateRawSync(t,a)},inflateAsync:function(e){var n=i.createInflateRaw(a),r=[],o=0;n.on(`data`,function(e){r.push(e),o+=e.length}),n.on(`end`,function(){var t=Buffer.alloc(o),n=0;t.fill(0);for(var i=0;i<r.length;i++){var a=r[i];a.copy(t,n),n+=a.length}e&&e(t)}),n.end(t)}}}})),fy=/* @__PURE__ */ n(((t,n)=>{let{randomFillSync:r}=e(`crypto`),i=ny(),a=(/* @__PURE__ */ new Uint32Array(256)).map((e,t)=>{for(let e=0;e<8;e++)t&1?t=t>>>1^3988292384:t>>>=1;return t>>>0}),o=(e,t)=>Math.imul(e,t)>>>0,s=(e,t)=>a[(e^t)&255]^e>>>8,c=()=>typeof r==`function`?r(Buffer.alloc(12)):c.node();c.node=()=>{let e=Buffer.alloc(12),t=e.length;for(let n=0;n<t;n++)e[n]=Math.random()*256&255;return e};let l={genSalt:c};function u(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let e=0;e<t.length;e++)this.updateKeys(t[e])}u.prototype.updateKeys=function(e){let t=this.keys;return t[0]=s(t[0],e),t[1]+=t[0]&255,t[1]=o(t[1],134775813)+1,t[2]=s(t[2],t[1]>>>24),e},u.prototype.next=function(){let e=(this.keys[2]|2)>>>0;return o(e,e^1)>>8&255};function d(e){let t=new u(e);return function(e){let n=Buffer.alloc(e.length),r=0;for(let i of e)n[r++]=t.updateKeys(i^t.next());return n}}function f(e){let t=new u(e);return function(e,n,r=0){n||=Buffer.alloc(e.length);for(let i of e){let e=t.next();n[r++]=i^e,t.updateKeys(i)}return n}}function p(e,t,n){if(!e||!Buffer.isBuffer(e)||e.length<12)return Buffer.alloc(0);let r=d(n),a=r(e.slice(0,12)),o=(t.flags&8)==8?t.timeHighByte:t.crc>>>24;if(a[11]!==o)throw i.WRONG_PASSWORD();return r(e.slice(12))}function m(e){Buffer.isBuffer(e)&&e.length>=12?l.genSalt=function(){return e.slice(0,12)}:e===`node`?l.genSalt=c.node:l.genSalt=c}function h(e,t,n,r=!1){e??=Buffer.alloc(0),Buffer.isBuffer(e)||(e=Buffer.from(e.toString()));let i=f(n),a=l.genSalt();a[11]=t.crc>>>24&255,r&&(a[10]=t.crc>>>16&255);let o=Buffer.alloc(e.length+12);return i(a,o),i(e,o,12)}n.exports={decrypt:p,encrypt:h,_salter:m}})),py=/* @__PURE__ */ n((e=>{e.Deflater=uy(),e.Inflater=dy(),e.ZipCrypto=fy()})),my=/* @__PURE__ */ n(((e,t)=>{var n=oy(),r=ly(),i=n.Constants,a=py();t.exports=function(e,t){var o=new r.EntryHeader,s=Buffer.alloc(0),c=Buffer.alloc(0),l=!1,u=null,d=Buffer.alloc(0),f=Buffer.alloc(0),p=!0;let m=e,h=typeof m.decoder==`object`?m.decoder:n.decoder;p=h.hasOwnProperty(`efs`)?h.efs:!1;function g(){return!t||!(t instanceof Uint8Array)?Buffer.alloc(0):(f=o.loadLocalHeaderFromBinary(t),t.slice(o.realDataOffset,o.realDataOffset+o.compressedSize))}function _(e){let t=o.flags_desc||o.localHeader.flags_desc?o.crc:o.localHeader.crc;return n.crc32(e)===t}function v(e,t,r){if(t===void 0&&typeof e==`string`&&(r=e,e=void 0),l)return e&&t&&t(Buffer.alloc(0),n.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var i=g();if(i.length===0)return e&&t&&t(i),i;if(o.encrypted){if(typeof r!=`string`&&!Buffer.isBuffer(r))throw n.Errors.INVALID_PASS_PARAM();i=a.ZipCrypto.decrypt(i,o,r)}var c;switch(o.method){case n.Constants.STORED:if(c=Buffer.alloc(i.length),i.copy(c),_(c))return e&&t&&t(c),c;throw e&&t&&t(c,n.Errors.BAD_CRC()),n.Errors.BAD_CRC();case n.Constants.DEFLATED:var u=new a.Inflater(i,o.size);if(e)u.inflateAsync(function(e){t&&(_(e)?t(e):t(e,n.Errors.BAD_CRC()))});else{if(c=u.inflate(),!_(c))throw n.Errors.BAD_CRC(`"${h.decode(s)}"`);return c}break;default:throw e&&t&&t(Buffer.alloc(0),n.Errors.UNKNOWN_METHOD()),n.Errors.UNKNOWN_METHOD()}}function y(e,r){if((!u||!u.length)&&Buffer.isBuffer(t))return e&&r&&r(g()),g();if(u.length&&!l){var i;switch(o.method){case n.Constants.STORED:return o.compressedSize=o.size,i=Buffer.alloc(u.length),u.copy(i),e&&r&&r(i),i;default:case n.Constants.DEFLATED:var s=new a.Deflater(u);if(e)s.deflateAsync(function(e){i=Buffer.alloc(e.length),o.compressedSize=e.length,e.copy(i),r&&r(i)});else{var c=s.deflate();return o.compressedSize=c.length,c}s=null}}else if(e&&r)r(Buffer.alloc(0));else return Buffer.alloc(0)}function b(e,t){return n.readBigUInt64LE(e,t)}function x(e){try{for(var t=0,r,a,o;t+4<e.length;)r=e.readUInt16LE(t),t+=2,a=e.readUInt16LE(t),t+=2,o=e.slice(t,t+a),t+=a,i.ID_ZIP64===r&&S(o)}catch{throw n.Errors.EXTRA_FIELD_PARSE_ERROR()}}function S(e){var t,n,r,a;e.length>=i.EF_ZIP64_SCOMP&&(t=b(e,i.EF_ZIP64_SUNCOMP),o.size===i.EF_ZIP64_OR_32&&(o.size=t)),e.length>=i.EF_ZIP64_RHO&&(n=b(e,i.EF_ZIP64_SCOMP),o.compressedSize===i.EF_ZIP64_OR_32&&(o.compressedSize=n)),e.length>=i.EF_ZIP64_DSN&&(r=b(e,i.EF_ZIP64_RHO),o.offset===i.EF_ZIP64_OR_32&&(o.offset=r)),e.length>=i.EF_ZIP64_DSN+4&&(a=e.readUInt32LE(i.EF_ZIP64_DSN),o.diskNumStart===i.EF_ZIP64_OR_16&&(o.diskNumStart=a))}return{get entryName(){return h.decode(s)},get rawEntryName(){return s},set entryName(e){s=n.toBuffer(e,h.encode);var t=s[s.length-1];l=t===47||t===92,o.fileNameLength=s.length},get efs(){return typeof p==`function`?p(this.entryName):p},get extra(){return d},set extra(e){d=e,o.extraLength=e.length,x(e)},get comment(){return h.decode(c)},set comment(e){if(c=n.toBuffer(e,h.encode),o.commentLength=c.length,c.length>65535)throw n.Errors.COMMENT_TOO_LONG()},get name(){let e=h.decode(s);return l?e.replace(/[/\\]$/,``).split(`/`).pop():e.split(`/`).pop()},get isDirectory(){return l},getCompressedData:function(){return y(!1,null)},getCompressedDataAsync:function(e){y(!0,e)},setData:function(e){u=n.toBuffer(e,n.decoder.encode),!l&&u.length?(o.size=u.length,o.method=n.Constants.DEFLATED,o.crc=n.crc32(e),o.changed=!0):o.method=n.Constants.STORED},getData:function(e){return o.changed?u:v(!1,null,e)},getDataAsync:function(e,t){o.changed?e(u):v(!0,e,t)},set attr(e){o.attr=e},get attr(){return o.attr},set header(e){o.loadFromBinary(e)},get header(){return o},packCentralHeader:function(){o.flags_efs=this.efs,o.extraLength=d.length;var e=o.centralHeaderToBinary(),t=n.Constants.CENHDR;return s.copy(e,t),t+=s.length,d.copy(e,t),t+=o.extraLength,c.copy(e,t),e},packLocalHeader:function(){let e=0;o.flags_efs=this.efs,o.extraLocalLength=f.length;let t=o.localHeaderToBinary(),n=Buffer.alloc(t.length+s.length+o.extraLocalLength);return t.copy(n,e),e+=t.length,s.copy(n,e),e+=s.length,f.copy(n,e),e+=f.length,n},toJSON:function(){let e=function(e){return`<`+(e&&e.length+` bytes buffer`||`null`)+`>`};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:o.toJSON(),compressedData:e(t),data:e(u)}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),hy=/* @__PURE__ */ n(((e,t)=>{let n=my(),r=ly(),i=oy();t.exports=function(e,t){var a=[],o=Object.create(null),s=Buffer.alloc(0),c=new r.MainHeader,l=!1;let u=/* @__PURE__ */ new Set,d=t,{noSort:f,decoder:p}=d;e?g(d.readEntries):l=!0;function m(){let e=/* @__PURE__ */ new Set;for(let t of Object.keys(o)){let n=t.split(`/`);if(n.pop(),n.length)for(let t=0;t<n.length;t++){let r=n.slice(0,t+1).join(`/`)+`/`;e.add(r)}}for(let t of e)if(!(t in o)){let e=new n(d);e.entryName=t,e.attr=16,e.temporary=!0,a.push(e),o[e.entryName]=e,u.add(e)}}function h(){if(l=!0,o=Object.create(null),c.diskEntries>(e.length-c.offset)/i.Constants.CENHDR)throw i.Errors.DISK_ENTRY_TOO_LARGE();a=Array(c.diskEntries);for(var t=c.offset,r=0;r<a.length;r++){var s=t,f=new n(d,e);f.header=e.slice(s,s+=i.Constants.CENHDR),f.entryName=e.slice(s,s+=f.header.fileNameLength),f.header.extraLength&&(f.extra=e.slice(s,s+=f.header.extraLength)),f.header.commentLength&&(f.comment=e.slice(s,s+f.header.commentLength)),t+=f.header.centralHeaderSize,a[r]=f,o[f.entryName]=f}u.clear(),m()}function g(t){var n=e.length-i.Constants.ENDHDR,r=Math.max(0,n-65535),a=r,o=e.length,l=-1,u=0;for(typeof d.trailingSpace==`boolean`&&d.trailingSpace&&(r=0);n>=a;n--)if(e[n]===80){if(e.readUInt32LE(n)===i.Constants.ENDSIG)l=n,u=n,o=n+i.Constants.ENDHDR,a=n-i.Constants.END64HDR;else if(e.readUInt32LE(n)===i.Constants.END64SIG)a=r;else if(e.readUInt32LE(n)===i.Constants.ZIP64SIG){l=n,o=n+i.readBigUInt64LE(e,n+i.Constants.ZIP64SIZE)+i.Constants.ZIP64LEAD;break}}if(l==-1)throw i.Errors.INVALID_FORMAT();c.loadFromBinary(e.slice(l,o)),c.commentLength&&(s=e.slice(u+i.Constants.ENDHDR)),t&&h()}function _(){a.length>1&&!f&&(a=a.map(e=>({entry:e,key:e.entryName.toLowerCase()})).sort((e,t)=>e.key.localeCompare(t.key)).map(e=>e.entry))}return{get entries(){return l||h(),a.filter(e=>!u.has(e))},get comment(){return p.decode(s)},set comment(e){s=i.toBuffer(e,p.encode),c.commentLength=s.length},getEntryCount:function(){return l?a.length:c.diskEntries},forEach:function(e){this.entries.forEach(e)},getEntry:function(e){return l||h(),o[e]||null},setEntry:function(e){l||h(),a.push(e),o[e.entryName]=e,c.totalEntries=a.length},deleteFile:function(e,t=!0){l||h();let n=o[e];this.getEntryChildren(n,t).map(e=>e.entryName).forEach(this.deleteEntry)},deleteEntry:function(e){l||h();let t=o[e],n=a.indexOf(t);n>=0&&(a.splice(n,1),delete o[e],c.totalEntries=a.length)},getEntryChildren:function(e,t=!0){if(l||h(),typeof e==`object`){if(e.isDirectory&&t){let t=[],n=e.entryName;for(let e of a)e.entryName.startsWith(n)&&t.push(e);return t}return[e]}return[]},getChildCount:function(e){if(e&&e.isDirectory){let t=this.getEntryChildren(e);return t.includes(e)?t.length-1:t.length}return 0},compressToBuffer:function(){l||h(),_();let t=[],n=[],r=0,i=0;c.size=0,c.offset=0;let a=0;for(let e of this.entries){let o=e.getCompressedData();e.header.offset=i;let s=e.packLocalHeader(),l=s.length+o.length;i+=l,t.push(s),t.push(o);let u=e.packCentralHeader();n.push(u),c.size+=u.length,r+=l+u.length,a++}r+=c.mainHeaderSize,c.offset=i,c.totalEntries=a,i=0;let o=Buffer.alloc(r);for(let e of t)e.copy(o,i),i+=e.length;for(let e of n)e.copy(o,i),i+=e.length;let u=c.toBinary();return s&&s.copy(u,u.length-s.length),u.copy(o,i),e=o,l=!1,o},toAsyncBuffer:function(t,n,r,i){try{l||h(),_();let n=[],a=[],o=0,u=0,d=0;c.size=0,c.offset=0;let f=function(p){if(p.length>0){let e=p.shift(),t=e.entryName+e.extra.toString();r&&r(t),e.getCompressedDataAsync(function(r){i&&i(t),e.header.offset=u;let s=e.packLocalHeader(),l=s.length+r.length;u+=l,n.push(s),n.push(r);let m=e.packCentralHeader();a.push(m),c.size+=m.length,o+=l+m.length,d++,f(p)})}else{o+=c.mainHeaderSize,c.offset=u,c.totalEntries=d,u=0;let r=Buffer.alloc(o);n.forEach(function(e){e.copy(r,u),u+=e.length}),a.forEach(function(e){e.copy(r,u),u+=e.length});let i=c.toBinary();s&&s.copy(i,i.length-s.length),i.copy(r,u),e=r,l=!1,t(r)}};f(Array.from(this.entries))}catch(e){n(e)}}}}})),gy=/* @__PURE__ */ t((/* @__PURE__ */ n(((t,n)=>{let r=oy(),i=e(`path`),a=my(),o=hy(),s=(...e)=>r.findLast(e,e=>typeof e==`boolean`),c=(...e)=>r.findLast(e,e=>typeof e==`string`),l=(...e)=>r.findLast(e,e=>typeof e==`function`),u={noSort:!1,readEntries:!1,method:r.Constants.NONE,fs:null};n.exports=function(e,t){let n=null,d=Object.assign(Object.create(null),u);e&&typeof e==`object`&&(e instanceof Uint8Array||(Object.assign(d,e),e=d.input?d.input:void 0,d.input&&delete d.input),Buffer.isBuffer(e)&&(n=e,d.method=r.Constants.BUFFER,e=void 0)),Object.assign(d,t);let f=new r(d),p=e=>{e.filter(e=>e.attr).sort((e,t)=>t.path.length-e.path.length).forEach(e=>f.fs.chmodSync(e.path,e.attr))};if((typeof d.decoder!=`object`||typeof d.decoder.encode!=`function`||typeof d.decoder.decode!=`function`)&&(d.decoder=r.decoder),e&&typeof e==`string`){if(f.fs.existsSync(e))d.method=r.Constants.FILE,d.filename=e,n=f.fs.readFileSync(e);else throw r.Errors.INVALID_FILENAME()}let m=new o(n,d),{canonical:h,sanitize:g,zipnamefix:_}=r;function v(e){if(e&&m){var t;if(typeof e==`string`&&(t=m.getEntry(i.posix.normalize(e))),typeof e==`object`&&e.entryName!==void 0&&e.header!==void 0&&(t=m.getEntry(e.entryName)),t)return t}return null}function y(e){let{join:t,normalize:n,sep:r}=i.posix;return t(i.isAbsolute(e)?`/`:`.`,n(r+e.split(`\\`).join(r)+r))}function b(e){return e instanceof RegExp?(function(e){return function(t){return e.test(t)}})(e):typeof e==`function`?e:()=>!0}let x=(e,t)=>{let n=t.slice(-1);return n=n===f.sep?f.sep:``,i.relative(e,t)+n};return{readFile:function(e,t){var n=v(e);return n&&n.getData(t)||null},childCount:function(e){let t=v(e);if(t)return m.getChildCount(t)},readFileAsync:function(e,t){var n=v(e);n?n.getDataAsync(t):t(null,`getEntry failed for:`+e)},readAsText:function(e,t){var n=v(e);if(n){var r=n.getData();if(r&&r.length)return r.toString(t||`utf8`)}return``},readAsTextAsync:function(e,t,n){var r=v(e);r?r.getDataAsync(function(e,r){r?t(e,r):e&&e.length?t(e.toString(n||`utf8`)):t(``)}):t(``)},deleteFile:function(e,t=!0){var n=v(e);n&&m.deleteFile(n.entryName,t)},deleteEntry:function(e){var t=v(e);t&&m.deleteEntry(t.entryName)},addZipComment:function(e){m.comment=e},getZipComment:function(){return m.comment||``},addZipEntryComment:function(e,t){var n=v(e);n&&(n.comment=t)},getZipEntryComment:function(e){var t=v(e);return t&&t.comment||``},updateFile:function(e,t){var n=v(e);n&&n.setData(t)},addLocalFile:function(e,t,n,a){if(f.fs.existsSync(e)){t=t?y(t):``;let r=i.win32.basename(i.win32.normalize(e));t+=n||r;let o=f.fs.statSync(e),s=o.isFile()?f.fs.readFileSync(e):Buffer.alloc(0);o.isDirectory()&&(t+=f.sep),this.addFile(t,s,a,o)}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFileAsync:function(e,t){e=typeof e==`object`?e:{localPath:e};let n=i.resolve(e.localPath),{comment:r}=e,{zipPath:a,zipName:o}=e,s=this;f.fs.stat(n,function(e,c){if(e)return t(e,!1);a=a?y(a):``;let l=i.win32.basename(i.win32.normalize(n));if(a+=o||l,c.isFile())f.fs.readFile(n,function(e,n){return e?t(e,!1):(s.addFile(a,n,r,c),setImmediate(t,void 0,!0))});else if(c.isDirectory())return a+=f.sep,s.addFile(a,Buffer.alloc(0),r,c),setImmediate(t,void 0,!0)})},addLocalFolder:function(e,t,n){if(n=b(n),t=t?y(t):``,e=i.normalize(e),f.fs.existsSync(e)){let r=f.findFiles(e),a=this;if(r.length)for(let o of r){let r=i.join(t,x(e,o));n(r)&&a.addLocalFile(o,i.dirname(r))}}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFolderAsync:function(e,t,n,a){a=b(a),n=n?y(n):``,e=i.normalize(e);var o=this;f.fs.open(e,`r`,function(i){if(i&&i.code===`ENOENT`)t(void 0,r.Errors.FILE_NOT_FOUND(e));else if(i)t(void 0,i);else{var s=f.findFiles(e),c=-1,l=function(){if(c+=1,c<s.length){var r=s[c],i=x(e,r).split(`\\`).join(`/`);i=i.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x20-\x7E]/g,``),a(i)?f.fs.stat(r,function(e,a){e&&t(void 0,e),a.isFile()?f.fs.readFile(r,function(e,r){e?t(void 0,e):(o.addFile(n+i,r,``,a),l())}):(o.addFile(n+i+`/`,Buffer.alloc(0),``,a),l())}):process.nextTick(()=>{l()})}else t(!0,void 0)};l()}})},addLocalFolderAsync2:function(e,t){let n=this;e=typeof e==`object`?e:{localPath:e};let a=i.resolve(y(e.localPath)),{zipPath:o,filter:s,namefix:c}=e;s instanceof RegExp?s=(function(e){return function(t){return e.test(t)}})(s):typeof s!=`function`&&(s=function(){return!0}),o=o?y(o):``,c===`latin1`&&(c=e=>e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x20-\x7E]/g,``)),typeof c!=`function`&&(c=e=>e);let l=e=>i.join(o,c(x(a,e))),u=e=>i.win32.basename(i.win32.normalize(c(e)));f.fs.open(a,`r`,function(e){e&&e.code===`ENOENT`?t(void 0,r.Errors.FILE_NOT_FOUND(a)):e?t(void 0,e):f.findFilesAsync(a,function(e,r){if(e)return t(e);r=r.filter(e=>s(l(e))),r.length||t(void 0,!1),setImmediate(r.reverse().reduce(function(e,t){return function(r,a){if(r||a===!1)return setImmediate(e,r,!1);n.addLocalFileAsync({localPath:t,zipPath:i.dirname(l(t)),zipName:u(t)},e)}},t))})})},addLocalFolderPromise:function(e,t){return new Promise((n,r)=>{this.addLocalFolderAsync2(Object.assign({localPath:e},t),(e,t)=>{e&&r(e),t&&n(this)})})},addFile:function(e,t,n,r){e=_(e);let i=v(e),o=i!=null;o||(i=new a(d),i.entryName=e),i.comment=n||``;let s=typeof r==`object`&&r instanceof f.fs.Stats;s&&(i.header.time=r.mtime);var c=i.isDirectory?16:0;let l=i.isDirectory?16384:32768;return l|=s?4095&r.mode:typeof r==`number`?4095&r:i.isDirectory?493:420,c=(c|l<<16)>>>0,i.attr=c,i.setData(t),o||m.setEntry(i),i},getEntries:function(e){return m.password=e,m?m.entries:[]},getEntry:function(e){return v(e)},getEntryCount:function(){return m.getEntryCount()},forEach:function(e){return m.forEach(e)},extractEntryTo:function(e,t,n,a,o,l){a=s(!1,a),o=s(!1,o),n=s(!0,n),l=c(o,l);var u=v(e);if(!u)throw r.Errors.NO_ENTRY();var d=h(u.entryName),p=g(t,l&&!u.isDirectory?h(l):n?d:i.basename(d));if(u.isDirectory)return m.getEntryChildren(u).forEach(function(e){if(e.isDirectory)return;var i=e.getData();if(!i)throw r.Errors.CANT_EXTRACT_FILE();var s=h(n?e.entryName:e.entryName.substring(u.entryName.length)),c=g(t,s);let l=o?e.header.fileAttr:void 0;f.writeFileTo(c,i,a,l)}),!0;var _=u.getData(m.password);if(!_)throw r.Errors.CANT_EXTRACT_FILE();if(f.fs.existsSync(p)&&!a)throw r.Errors.CANT_OVERRIDE();let y=o?e.header.fileAttr:void 0;return f.writeFileTo(p,_,a,y),!0},test:function(e){if(!m)return!1;for(var t of m.entries)try{if(t.isDirectory)continue;if(!t.getData(e))return!1}catch{return!1}return!0},extractAllTo:function(e,t,n,i){if(n=s(!1,n),i=c(n,i),t=s(!1,t),!m)throw r.Errors.NO_ZIP();let a=[];m.entries.forEach(function(o){var s=g(e,h(o.entryName));if(o.isDirectory){f.makeDir(s),n&&a.push({path:s,attr:o.header.fileAttr});return}var c=o.getData(i);if(!c)throw r.Errors.CANT_EXTRACT_FILE();let l=n?o.header.fileAttr:void 0;f.writeFileTo(s,c,t,l);try{f.fs.utimesSync(s,o.header.time,o.header.time)}catch{}}),p(a)},extractAllToAsync:function(e,t,n,a){if(a=l(t,n,a),n=s(!1,n),t=s(!1,t),!a)return new Promise((r,i)=>{this.extractAllToAsync(e,t,n,function(e){e?i(e):r(this)})});if(!m){a(r.Errors.NO_ZIP());return}e=i.resolve(e);let o=t=>g(e,i.normalize(h(t.entryName))),c=(e,t)=>/* @__PURE__ */ Error(e+`: "`+t+`"`),u=[],d=[];m.entries.forEach(e=>{e.isDirectory?u.push(e):d.push(e)});let _=[];for(let e of u){let t=o(e),r=n?e.header.fileAttr:void 0;try{f.makeDir(t)}catch{a(c(`Unable to create folder`,t));continue}r&&_.push({path:t,attr:r});try{f.fs.utimesSync(t,e.header.time,e.header.time)}catch{}}d.reverse().reduce(function(a,o){return function(s){if(s)a(s);else{let s=i.normalize(h(o.entryName)),l=g(e,s);o.getDataAsync(function(e,i){if(i)a(i);else if(!e)a(r.Errors.CANT_EXTRACT_FILE());else{let r=n?o.header.fileAttr:void 0;f.writeFileToAsync(l,e,t,r,function(e){if(!e)return a(c(`Unable to write file`,l));f.fs.utimes(l,o.header.time,o.header.time,function(){a()})})}})}}},e=>{if(!e)try{p(_)}catch(e){return a(c(`Unable to set folder permissions`,e.path||``))}a(e)})()},writeZip:function(e,t){if(arguments.length===1&&typeof e==`function`&&(t=e,e=``),!e&&d.filename&&(e=d.filename),e){var n=m.compressToBuffer();if(n){var r=f.writeFileTo(e,n,!0);typeof t==`function`&&t(r?null:/* @__PURE__ */ Error(`failed`),``)}}},writeZipPromise:function(e,t){let{overwrite:n,perm:r}=Object.assign({overwrite:!0},t);return new Promise((t,i)=>{!e&&d.filename&&(e=d.filename),e||i(`ADM-ZIP: ZIP File Name Missing`),this.toBufferPromise().then(a=>{f.writeFileToAsync(e,a,n,r,e=>e?t(e):i(`ADM-ZIP: Wasn't able to write zip file`))},i)})},toBufferPromise:function(){return new Promise((e,t)=>{m.toAsyncBuffer(e,t)})},toBuffer:function(e,t,n,r){return typeof e==`function`?(m.toAsyncBuffer(e,t,n,r),null):m.compressToBuffer()}}}})))(),1),_y=/* @__PURE__ */ t(en(),1),vy=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 yy=`mintlify`,by=`templates`,xy=`main`;function Sy(){return vy(this,void 0,void 0,function*(){let e=yield fetch(`https://api.github.com/repos/${yy}/${by}/contents/?ref=${xy}`,{headers:{Accept:`application/vnd.github.v3+json`}});if(!e.ok)throw Error(`Failed to fetch templates: ${e.status} ${e.statusText}`);return(yield e.json()).filter(e=>e.type===`dir`).map(e=>e.name)})}function Cy(e){return vy(this,void 0,void 0,function*(){if(!e||e===`.`||e===`..`||e.includes(`/`))throw Error(`Invalid template name: "${e}".`);let t=`https://api.github.com/repos/${yy}/${by}/contents/${encodeURIComponent(e)}?ref=${xy}`,n=yield fetch(t,{headers:{Accept:`application/vnd.github.v3+json`}});if(!n.ok){let t=yield Sy().catch(()=>[]),n=t.length>0?` Available templates: ${t.join(`, `)}`:``;throw Error(`Template "${e}" not found in ${yy}/${by}.${n}`)}if(!(yield n.json()).some(e=>e.name===`docs.json`))throw Error(`Template "${e}" is not a valid Mintlify template (missing docs.json).`);return e})}function wy(){return vy(this,void 0,void 0,function*(){v((0,P.jsx)(p,{message:`fetching available templates...`}));let e;try{e=yield Sy()}catch{throw A(),Error(`Failed to fetch templates. Please check your network connection and try again.`)}if(A(),e.length===0)throw Error(`No templates are currently available.`);return ip({message:`Choose a template`,choices:e.map(e=>({name:e,value:e}))})})}function Ty(e,t,n,r){return vy(this,void 0,void 0,function*(){let i=dr.join(e,`__template__.zip`),a=dr.join(e,`__template_extract__`);try{v((0,P.jsx)(p,{message:`downloading template "${t}"...`}));try{let e=yield fetch(`https://github.com/${yy}/${by}/archive/refs/heads/${xy}.zip`);if(!e.ok)throw Error(`Failed to download templates archive: ${e.status}`);let t=yield e.arrayBuffer();yield _y.default.writeFile(i,Buffer.from(t))}finally{A()}v((0,P.jsx)(p,{message:`extracting template...`}));try{new gy.default(i).extractAllTo(a,!0)}finally{A()}let n=dr.join(a,`${by}-${xy}`),r=dr.join(n,t);if(!(yield _y.default.pathExists(r)))throw Error(`Template directory "${t}" not found in the downloaded archive.`);yield _y.default.copy(r,e,{overwrite:!0})}finally{yield _y.default.remove(i).catch(()=>{}),yield _y.default.remove(a).catch(()=>{})}let o=dr.join(e,`docs.json`);if(yield _y.default.pathExists(o)){let e=yield _y.default.readJson(o);n&&(e.name=n),r&&(e.theme=r),yield _y.default.writeJson(o,e,{spaces:2})}})}var Ey=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 Dy=e=>{k((0,P.jsx)(M,{bold:!0,children:`Documentation Setup!`}),(0,P.jsx)(M,{children:`To see your docs run`}),(0,P.jsxs)(st,{children:[(0,P.jsx)(M,{color:`blue`,children:`cd`}),(0,P.jsxs)(M,{children:[` `,e]})]}),(0,P.jsx)(M,{color:`blue`,children:`mint dev`})),Et()&&v((0,P.jsxs)(M,{children:["When the docs are ready, run `mint validate` in ",e,` to check the build and get publish steps.`]}))},Oy=(e,t,n,r)=>{let i=r===void 0?`Unable to fetch templates — use --template flag if you know the name`:r.length>0?`Templates: ${JSON.stringify(r)}`:`No templates are currently available`;k((0,P.jsx)(M,{children:`Agent Detected - sending AI friendly prompt`}),(0,P.jsx)(M,{children:`<system-message>`}),(0,P.jsx)(M,{children:"Help the user set up a Mintlify docs site with `mint new`. Ask each step one at a time unless the user asks you to skip questions or use your best judgment."}),(0,P.jsx)(M,{children:[`- [ ] Pick a theme or clone a template? (${i})`,`- [ ] If template: which one? If theme: which one? (Themes: ${JSON.stringify(n)})`,`- [ ] Project name?`,`- [ ] Directory? (default: "${e}", auto-created if needed)${t?` ⚠️ "${e}" is occupied — subdirectory, overwrite (--force), or different path?`:``}`].join(`
558
558
  `)}),(0,P.jsx)(M,{children:"Command: `mint new [dir] --theme [theme] --name [name]` or `mint new [dir] --template [template] --name [name]`. --theme optionally overrides a template default. --force overwrites non-empty dirs. Use AskQuestion to present choices."}),(0,P.jsx)(M,{children:`</system-message>`}))};function ky(e,t,n){return Ey(this,void 0,void 0,function*(){let r=yield Sy().catch(()=>void 0);Oy(e,t,n,r)})}function Ay(e,t,n){return Ey(this,void 0,void 0,function*(){if(!n)return e;if(Et())return t?e:void 0;let r=yield ip({message:`Directory ${e} is not empty. What would you like to do?`,choices:[{name:`Create in a subdirectory`,value:`subdir`},{name:`Overwrite current directory (may lose contents)`,value:`overwrite`},{name:`Cancel`,value:`cancel`}]});if(r!==`cancel`){if(r===`subdir`){let t=yield hn({message:`Subdirectory name:`,default:`docs`});if(!t||t.trim()===``)throw Error(`Subdirectory name cannot be empty`);let n=e===`.`?t:`${e}/${t}`;return De(n,process.cwd()),n}return e}})}function jy(e,t){return Ey(this,void 0,void 0,function*(){return t||hn({message:`Project Name`,default:e===`.`?`Mintlify`:e})})}function My(){return Ey(this,void 0,void 0,function*(){if((yield ip({message:`How would you like to set up your docs?`,choices:[{name:`Pick a theme`,value:`theme`},{name:`Clone a template`,value:`template`}]}))===`template`)return wy()})}function Ny(e,t,n,r,i){return Ey(this,void 0,void 0,function*(){De(e);let a=te.options.map(e=>e.shape.theme._def.value),o=(yield _y.default.readdir(e).catch(()=>[])).length>0;if(Et()&&(!r||!i&&!n)||Et()&&o&&!t){yield ky(e,o,a);return}let s=i?yield Cy(i).then(()=>i):!Et()&&!n?yield My():void 0;if(s){let i=yield Ay(e,t,o);if(i===void 0){Et()&&(yield ky(e,o,a));return}let c=yield jy(i,r);yield _y.default.ensureDir(i),yield Ty(i,s,c,n),Dy(i);return}let c=yield Ay(e,t,o);if(c===void 0){Et()&&(yield ky(e,o,a));return}let l=r,u=n;Et()||u&&l||(l=yield jy(c,l),u||=yield ip({message:`Theme`,choices:a.map(e=>({name:e,value:e}))})),l===void 0||u===void 0?yield ky(c,o,a):(yield _y.default.ensureDir(c),yield Py(c,l,u),Dy(c))})}const Py=(e,t,n)=>Ey(void 0,void 0,void 0,function*(){v((0,P.jsx)(p,{message:`downloading starter template...`}));let r=yield(yield fetch(`https://github.com/mintlify/starter/archive/refs/heads/main.zip`)).arrayBuffer();yield _y.default.writeFile(e+`/starter.zip`,Buffer.from(r)),A(),v((0,P.jsx)(p,{message:`extracting...`})),new gy.default(e+`/starter.zip`).extractAllTo(e,!0),A(),yield _y.default.copy(e+`/starter-main`,e,{overwrite:!0,filter:e=>!e.includes(`starter-main/starter-main`)}),yield _y.default.remove(e+`/starter.zip`),yield _y.default.remove(e+`/starter-main`);let i=e+`/docs.json`,a=yield _y.default.readJson(i);a.theme=n,a.name=t,yield _y.default.writeJson(i,a,{spaces:2})});var Fy=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 Iy=[{name:`overview`,when:`Start here: how Mintlify works and facts agents most often get wrong`},{name:`new-site`,when:`New docs site, first publish, no account, claim a site, login, no docs.json yet`},{name:`write`,when:`Before creating a page or writing more than a sentence or two; changelogs`},{name:`write components`,when:`Adding or changing components: callouts, cards, steps, tabs, accordions, fields`},{name:`configure`,when:`Changing docs.json: theme, colors, logo, favicon, required fields`},{name:`configure navigation`,when:`Changing navigation: groups, tabs, anchors, dropdowns, products, versions, languages`},{name:`configure settings`,when:`navbar, footer, banner, SEO, search, integrations, contextual menu, redirects, 404`},{name:`configure customization`,when:`Themes, fonts, CSS, JavaScript, or React snippets`},{name:`api-docs`,when:`API documentation: OpenAPI, AsyncAPI, GraphQL, playground`},{name:`api-docs sdk`,when:`SDK reference pages, x-codeSamples, oneOf/anyOf, multiple responses, hiding endpoints`},{name:`publish`,when:`Deploying, "is it live", previews, rollbacks, MCP, llms.txt, skill.md, Markdown export`},{name:`publish domain`,when:`Custom domain (mint add-domain), /docs subpath, reverse proxy, CSP`},{name:`publish repo`,when:`Monorepo, multi-repo, GitHub/GitLab/Bitbucket, offline export, self-host`},{name:`publish analytics`,when:`mint analytics, feedback, search data, analytics integrations`},{name:`publish assistant`,when:`AI assistant, widget, Assistant.md, skills, narration, own model`},{name:`access`,when:`Private docs, reader login, user groups, personalization`},{name:`access team`,when:`Team members, roles, SSO, SCIM, audit logs, session security`},{name:`automate`,when:`Keep docs in sync with code: agent, Autopilot, automations, Slack, CI`},{name:`migrate`,when:`Moving docs from Docusaurus, GitBook, ReadMe, Fern, Document360, Confluence, Markdown`},{name:`troubleshoot`,when:`An error, a failed build or deploy, or the site looks wrong`}],Ly=()=>{let e=Math.max(...Iy.map(({name:e})=>e.length))+2;return[`Usage: mint instructions <topic> [subtopic]`,``,...Iy.map(({name:t,when:n})=>` ${t.padEnd(e)}${n}`),``].join(`
559
559
  `)},Ry=e=>`https://www.mintlify.com/docs/mint-instructions/${e.map(encodeURIComponent).join(`/`)}.md`,zy=e=>e.replace(/^(?:>.*\n|\s*\n)*/,``);function By(e){return Fy(this,void 0,void 0,function*(){let t=Ry(e),n=yield fetch(t);if(n.status===404)throw Error(`no instructions for "${e.join(` `)}". Run \`mint instructions\` to list topics.`);if(!n.ok)throw Error(`failed to fetch ${t}: ${n.status} ${n.statusText}`);return zy(yield n.text())})}var Vy=/* @__PURE__ */ t(E(),1);typeof navigator>`u`||navigator.userAgent?.startsWith?.(`Mozilla/5.0 `);const Hy=`ERR_INVALID_ARG_VALUE`;function Uy(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}const Wy=Symbol(),Gy=Symbol(),Ky=Symbol(),qy=new TextEncoder,Jy=new TextDecoder;function Yy(e){return typeof e==`string`?qy.encode(e):Jy.decode(e)}let Xy;if(Uint8Array.prototype.toBase64)Xy=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:`base64url`,omitPadding:!0}));else{let e=32768;Xy=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));let n=[];for(let r=0;r<t.byteLength;r+=e)n.push(String.fromCharCode.apply(null,t.subarray(r,r+e)));return btoa(n.join(``)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}}let Zy;Zy=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:`base64url`})}catch(e){throw Uy(`The input to be decoded is not correctly encoded.`,Hy,e)}}:e=>{try{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`).replace(/\s/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch(e){throw Uy(`The input to be decoded is not correctly encoded.`,Hy,e)}};function Qy(e){return typeof e==`string`?Zy(e):Xy(e)}var $y=class extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,t?.code&&(this.code=t?.code),Error.captureStackTrace?.(this,this.constructor)}};function eb(e,t,n){return new $y(e,{code:t,cause:n})}function tb(e,t,n,r){try{if(typeof e!=`string`)throw Uy(`${t} must be a string`,`ERR_INVALID_ARG_TYPE`,r);if(e.length===0)throw Uy(`${t} must not be empty`,Hy,r)}catch(e){throw n?eb(e.message,n,r):e}}function nb(){return Qy(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)))}function rb(){return nb()}function ib(){return nb()}function ab(){return nb()}async function ob(e){return tb(e,`codeVerifier`),Qy(await crypto.subtle.digest(`SHA-256`,Yy(e)))}function sb(e){return tb(e,`"clientSecret"`),(t,n,r,i)=>{r.set(`client_id`,n.client_id),r.set(`client_secret`,e)}}function cb(){return(e,t,n,r)=>{n.set(`client_id`,t.client_id)}}URL.parse;const lb=Symbol();typeof navigator<`u`&&navigator.userAgent?.startsWith?.(`Mozilla/5.0 `);const ub=e=>db.get(e);let db,fb;function pb(e){return e===void 0?(fb||=/* @__PURE__ */ new WeakMap,(e,t,n,r)=>{let i;return(i=fb.get(t))||(mb(t.client_secret,`"metadata.client_secret"`),i=sb(t.client_secret),fb.set(t,i)),i(e,t,n,r)}):sb(e)}function mb(e,t){if(typeof e!=`string`)throw yb(`${t} must be a string`,vb);if(e.length===0)throw yb(`${t} must not be empty`,_b)}function hb(){return cb()}const gb=Ky,_b=`ERR_INVALID_ARG_VALUE`,vb=`ERR_INVALID_ARG_TYPE`;function yb(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}function bb(e){return ob(e)}function xb(){return rb()}function Sb(){return ab()}function Cb(){return ib()}new TextDecoder;function wb(e){return{supportsPKCE:{__proto__:null,value(t=`S256`){return e.code_challenge_methods_supported?.includes(t)===!0}}}}function Tb(e){Object.defineProperties(e,wb(e))}const Eb=Symbol();Object.freeze(class{constructor(e,t,n,r){if(typeof t!=`string`||!t.length)throw yb(`"clientId" must be a non-empty string`,vb);if(typeof n==`string`&&(n={client_secret:n}),n?.client_id!==void 0&&t!==n.client_id)throw yb(`"clientId" and "metadata.client_id" must be the same`,_b);let i={...structuredClone(n),client_id:t};i[Wy]=n?.[Wy]??0,i[Gy]=n?.[Gy]??30;let a;a=r||(typeof i.client_secret==`string`&&i.client_secret.length?pb(i.client_secret):hb());let o=Object.freeze(i),s=structuredClone(e);Eb in e&&(s[lb]=({claims:{tid:t}})=>e.issuer.replace(`{tenantid}`,t));let c=Object.freeze(s);db||=/* @__PURE__ */ new WeakMap,db.set(this,{__proto__:null,as:c,c:o,auth:a,tlsOnly:!0,jwksCache:{}})}serverMetadata(){let e=structuredClone(ub(this).as);return Tb(e),e}clientMetadata(){return structuredClone(ub(this).c)}get timeout(){return ub(this).timeout}set timeout(e){ub(this).timeout=e}get[gb](){return ub(this).fetch}set[gb](e){ub(this).fetch=e}}.prototype);var Db=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 Ob(){return Db(this,void 0,void 0,function*(){let{default:e}=yield import(`http`),t,n,r=!1,i=new Promise((e,r)=>{t=e,n=r}),a=e.createServer((e,n)=>{if(n.setHeader(`Access-Control-Allow-Origin`,It),n.setHeader(`Access-Control-Allow-Methods`,`POST, OPTIONS`),n.setHeader(`Access-Control-Allow-Headers`,`Content-Type`),e.method===`OPTIONS`)n.writeHead(204),n.end();else if(e.method===`POST`){let i=``;e.on(`data`,e=>{i+=e}),e.on(`end`,()=>{try{let{code:e}=JSON.parse(i);n.writeHead(200,{"Content-Type":`application/json`}),n.end(JSON.stringify({ok:!0})),r=!0,a.close(),t(e)}catch{n.writeHead(400),n.end(JSON.stringify({error:`invalid body`}))}})}else n.writeHead(405),n.end()});return a.listen(Gt,`localhost`),{codePromise:i,close:()=>{r||(r=!0,a.close(),n(/* @__PURE__ */ Error(`Login cancelled`)))}}})}var kb=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 Ab(){return kb(this,void 0,void 0,function*(){let e=xb(),t=yield bb(e),n=Sb(),r=Cb(),i=Buffer.from(JSON.stringify({nonce:n,clientState:r})).toString(`base64url`),a=new URL(`/api/cli/oauth/authorize`,It);a.searchParams.set(`state`,i),a.searchParams.set(`code_challenge`,t);let o=a.toString();Sf();let{codePromise:c,close:l}=yield Ob();v((0,P.jsxs)(st,{flexDirection:`column`,gap:1,paddingY:1,children:[(0,P.jsxs)(M,{bold:!0,children:[(0,P.jsx)(M,{color:`green`,children:`◆ `}),`A browser window will open for Mintlify authentication`]}),(0,P.jsxs)(st,{flexDirection:`column`,paddingLeft:3,gap:1,children:[(0,P.jsx)(M,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL:`}),(0,P.jsx)(M,{dimColor:!0,children:o})]})]})),(0,Vy.default)(o).catch(()=>{}),v((0,P.jsxs)(st,{flexDirection:`column`,paddingLeft:1,marginTop:1,children:[(0,P.jsx)(M,{dimColor:!0,children:`╭─ Paste the authorization code from your browser`}),(0,P.jsx)(M,{dimColor:!0,children:`│`})]})),yield new Promise(e=>setTimeout(e,50));let u=hn({message:`█`,theme:{prefix:w.dim(` │`),style:{answer:e=>w.cyan(e)}}}),f;try{f=yield Promise.race([c,u])}catch{l(),u.cancel(),v((0,P.jsx)(d,{message:`login cancelled`}));return}l(),u.cancel();let p=yield fetch($t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({grant_type:`authorization_code`,code:f,code_verifier:e})}),m=yield p.json().catch(()=>({}));if(!p.ok){let e=m.error_message??m.error??`unknown error`;wf(e),v((0,P.jsx)(d,{message:`login failed: ${e}`}));return}let h=m;yield nd(h.access_token,h.refresh_token,cd(h.id_token)??null),Cf(),v((0,P.jsx)(s,{message:`logged in successfully`})),yield Mb(h.access_token)})}function jb(e){return e instanceof Error&&e.name===`ExitPromptError`}function Mb(e){return kb(this,void 0,void 0,function*(){let t=yield bd(e);if(t.length===0)return;if(t.length===1){yield Vt(`subdomain`,t[0]),v((0,P.jsx)(a,{message:`default project set to ${t[0]}`}));return}yield new Promise(e=>setTimeout(e,50));let n;try{n=yield bn({message:`Select a default project`,source:e=>(e?t.filter(t=>t.toLowerCase().includes(e.toLowerCase())):t).map(e=>({name:e,value:e}))})}catch(e){if(jb(e)){v((0,P.jsx)(a,{message:`No project set. To set a default project, run ${w.bold(`mintlify config set subdomain <subdomain>`)}`}));return}throw e}yield Vt(`subdomain`,n),v((0,P.jsx)(a,{message:`default project set to ${n}`}))})}var Nb=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 Pb(){return Nb(this,void 0,void 0,function*(){yield sd(),v((0,P.jsx)(s,{message:`logged out successfully`}))})}var Fb=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 Ib=(e,t)=>{let n=[],r=()=>t=>(Rn(t,t=>{if(t.type===`image`){t.alt&&t.alt.trim()!==``||n.push({filePath:e,line:t.position?.start.line,column:t.position?.start.column,element:`img`,tagName:`image (markdown)`});return}let r=t;if(r.name===`img`||r.name===`video`){let i=r.attributes.findIndex(e=>e.type===`mdxJsxAttribute`&&e.name===`alt`),a=r.attributes[i];a&&typeof a.value==`string`&&a.value.trim()!==``||n.push({filePath:e,line:t.position?.start.line,column:t.position?.start.column,element:r.name,tagName:r.name})}else if(r.name===`a`){let i=e=>e.some(e=>e.type===`text`?e.value.trim()!==``:`children`in e&&Array.isArray(e.children)?i(e.children):!1);i(r.children)||n.push({filePath:e,line:t.position?.start.line,column:t.position?.start.column,element:`a`,tagName:`<a>`})}}),t);try{let e=t.replace(/^( {0,3}#{1,6}\s+.+?)\s*\{#[^}]+\}\s*$/gm,`$1`);tt().use(r).processSync(e)}catch(t){console.warn(`Warning: Could not parse ${e}: ${t}`)}return n},Lb=(...e)=>Fb(void 0,[...e],void 0,function*(e=process.cwd()){let t=yield Ze(e),{contentFilenames:n}=yield je(e,t),r=[];for(let t of n)r.push(dr.join(e,t));let i=[],a=/* @__PURE__ */ new Set;for(let e of r)try{let t=Sr.readFileSync(e,`utf-8`),n=Ib(e,t);n.length>0&&(i.push(...n),a.add(e))}catch(t){console.warn(`Warning: Could not read file ${e}: ${t}`)}return{missingAltAttributes:i,totalFiles:r.length,filesWithIssues:a.size}});var Rb=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 zb=()=>Rb(void 0,void 0,void 0,function*(){try{v((0,P.jsx)(M,{bold:!0,color:`cyan`,children:`Checking mdx files for accessibility issues...`}));let e=yield Lb();if(e.missingAltAttributes.length===0)return v((0,P.jsx)(s,{message:`no accessibility issues found`})),v((0,P.jsxs)(M,{children:[`Checked `,e.totalFiles,` MDX files - all images and videos have alt attributes.`]})),0;let t={};e.missingAltAttributes.forEach(e=>{var n;t[e.filePath]||(t[e.filePath]=[]),(n=t[e.filePath])==null||n.push(e)}),v((0,P.jsxs)(M,{bold:!0,color:`red`,children:[`Found `,e.missingAltAttributes.length,` accessibility issues in`,` `,e.filesWithIssues,` files:`]})),v((0,P.jsx)(M,{}));for(let[e,n]of Object.entries(t)){let t=dr.relative(process.cwd(),e);v((0,P.jsxs)(M,{bold:!0,children:[t,`:`]}));for(let e of n){let t=e.line&&e.column?` (line ${e.line}, col ${e.column})`:``;e.element===`a`?v((0,P.jsxs)(M,{children:[(0,P.jsx)(M,{color:`red`,children:` ✗`}),` Missing text attribute `,(0,P.jsx)(M,{bold:!0,children:e.tagName}),` `,`element`,t]})):v((0,P.jsxs)(M,{children:[(0,P.jsx)(M,{color:`red`,children:` ✗`}),` Missing alt attribute on `,(0,P.jsx)(M,{bold:!0,children:e.tagName}),` `,`element`,t]}))}v((0,P.jsx)(M,{}))}return v((0,P.jsxs)(M,{color:`yellow`,children:[(0,P.jsx)(M,{bold:!0,children:`Recommendation:`}),` Add alt attributes to all images and videos for better accessibility.`]})),1}catch(e){return v((0,P.jsx)(d,{message:`MDX accessibility check failed: ${e instanceof Error?e.message:`Unknown error`}`})),1}});var Bb=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 Vb=/* @__PURE__ */ new Set([`page`,`site`,`openapi`]),Hb=/* @__PURE__ */ new Set([`stats`,`search`,`feedback`,`conversation`]),Ub=/* @__PURE__ */ new Set([`set`,`get`,`clear`]),Wb=/* @__PURE__ */ new Set([`list`,`view`,`buckets`]),Gb=/* @__PURE__ */ new Set([`list`,`view`]);function Kb(e){let t=e.filter(e=>typeof e==`string`);if(t.length===0)return``;let n=t[0],r=t[1],i=t[2];if(n===`scrape`&&r!==void 0&&Vb.has(r))return`scrape ${r}`;if(n===`config`&&r!==void 0&&Ub.has(r))return`config ${r}`;if(n===`analytics`&&r!==void 0&&Hb.has(r)){if(r===`conversation`&&i!==void 0&&Wb.has(i)){let e=t[3];return i===`buckets`&&e!==void 0&&Gb.has(e)?`analytics conversation buckets ${e}`:`analytics conversation ${i}`}return`analytics ${r}`}return n}function qb(){let e=!1;return function(t){return Bb(this,void 0,void 0,function*(){if(typeof t._[0]==`string`){if(e)return;e=!0;let n=Kb(t._),{cli:r}=wt();bf({command:n,cliVersion:r,subdomain:Kt(`subdomain`)})}})}}const Jb=Rr(new URL(`../migrate`,import.meta.url)),Yb=(...e)=>br(Fr.join(Jb,...e),`utf8`),Xb=e=>xr(Fr.join(Jb,e)).filter(e=>e.endsWith(`.md`)).map(e=>e.slice(0,-3)).sort(),Zb=()=>[Yb(`index.md`).trimEnd(),`Topics: ${Xb(`topics`).join(`, `)}. Run \`mint migrate --topic <name>\`.`,`Sources: ${Xb(`sources`).join(`, `)}. Run \`mint migrate --from <name>\`.`].join(`
560
560
 
@@ -4,7 +4,7 @@ import { dirname as __mintDirname } from 'node:path';
4
4
  const require = __mintCreateRequire(import.meta.url);
5
5
  const __filename = __mintFileURLToPath(import.meta.url);
6
6
  const __dirname = __mintDirname(__filename);
7
- import{i as e,o as t,t as n}from"./rolldown-runtime-CEAe2Uac.js";import{K as r,Wn as i,ar as a,cr as o,lr as s,or as c,qn as l,sr as u,tt as d}from"./dist-BA3H54nL.js";import{$ as f,F as p,H as m,P as h,Q as g,V as _,W as v,_ as y,et as b,m as x,w as S}from"./dist-DgyavKdR.js";import{a as C,c as ee,i as te,o as ne,r as re,s as ie,t as ae}from"./agent-Da2kI1tZ.js";import{dt as oe}from"./utils-B7dNmFFf.js";import{r as se}from"./client-DXQ6Tgw0.js";import{f as ce,m as le}from"./schemas-CVKidklE.js";import{createRequire as ue}from"node:module";import w from"path";import{readFileSync as de}from"node:fs";import fe,*as pe from"node:readline";import{AsyncLocalStorage as me,AsyncResource as he}from"node:async_hooks";import{spawn as ge,spawnSync as _e}from"child_process";import ve,{readFileSync as ye,unlinkSync as be,writeFileSync as xe}from"fs";import Se from"os";import T from"node:process";import Ce from"node:os";import we from"node:fs/promises";import Te from"node:path";import{execFile as Ee}from"node:child_process";import{fileURLToPath as De}from"node:url";import{randomUUID as Oe}from"node:crypto";import{promisify as ke,stripVTControlCharacters as Ae}from"node:util";var je=/* @__PURE__ */ n(((t,n)=>{var r=e(`os`),i=e(`fs`),a=e(`child_process`),o=`/etc/resolv.conf`;function s(){var e=`eth`,t=r.platform();return t===`darwin`?e=`en`:t===`win32`&&(e=null),e}function c(){return r.platform()===`win32`?`ipconfig/all`:`/sbin/ifconfig`}function l(e,t){return t===`IPv4`?e===`IPv4`||e===4:t===`IPv6`?e===`IPv6`||e===6:e===t}function u(e,t){typeof e==`function`&&(t=e,e=null);var n={ip:u.ip(e),ipv6:u.ipv6(e),mac:null};u.mac(e,function(e,r){r&&(n.mac=r),t(e,n)})}u.interface=function(e,t){var n=r.networkInterfaces(),i=!t;t||=s(),e||=`IPv4`;for(var a=-1;a<8;a++){var o=n[t+(a>=0?a:``)];if(o)for(var c=0;c<o.length;c++){var u=o[c];if(l(u.family,e))return u}}if(i)for(var d in n)for(var o=n[d],a=0;a<o.length;a++){var u=o[a];if(l(u.family,e)&&!u.address.startsWith(`127.`))return u}},u.ip=function(e){var t=u.interface(`IPv4`,e);return t&&t.address},u.ipv6=function(e){var t=u.interface(`IPv6`,e);return t&&t.address};var d=/^(\w+)\:\s+flags=/,f=/^(\w+)\s{2,}link encap:\w+/i,p=u.MAC_RE=/(?:ether|HWaddr)\s+((?:[a-z0-9]{2}\:){5}[a-z0-9]{2})/i,m=u.MAC_IP_RE=/inet\s(?:addr\:)?(\d+\.\d+\.\d+\.\d+)/;function h(e,t,n){for(var r=e.split(`
7
+ import{i as e,o as t,t as n}from"./rolldown-runtime-CEAe2Uac.js";import{K as r,Wn as i,ar as a,cr as o,lr as s,or as c,qn as l,sr as u,tt as d}from"./dist-BZO00XVw.js";import{$ as f,F as p,H as m,P as h,Q as g,V as _,W as v,_ as y,et as b,m as x,w as S}from"./dist-DFkRL36G.js";import{a as C,c as ee,i as te,o as ne,r as re,s as ie,t as ae}from"./agent-Da2kI1tZ.js";import{dt as oe}from"./utils-D9fHH3a7.js";import{r as se}from"./client-DXQ6Tgw0.js";import{f as ce,m as le}from"./schemas-CVKidklE.js";import{createRequire as ue}from"node:module";import w from"path";import{readFileSync as de}from"node:fs";import fe,*as pe from"node:readline";import{AsyncLocalStorage as me,AsyncResource as he}from"node:async_hooks";import{spawn as ge,spawnSync as _e}from"child_process";import ve,{readFileSync as ye,unlinkSync as be,writeFileSync as xe}from"fs";import Se from"os";import T from"node:process";import Ce from"node:os";import we from"node:fs/promises";import Te from"node:path";import{execFile as Ee}from"node:child_process";import{fileURLToPath as De}from"node:url";import{randomUUID as Oe}from"node:crypto";import{promisify as ke,stripVTControlCharacters as Ae}from"node:util";var je=/* @__PURE__ */ n(((t,n)=>{var r=e(`os`),i=e(`fs`),a=e(`child_process`),o=`/etc/resolv.conf`;function s(){var e=`eth`,t=r.platform();return t===`darwin`?e=`en`:t===`win32`&&(e=null),e}function c(){return r.platform()===`win32`?`ipconfig/all`:`/sbin/ifconfig`}function l(e,t){return t===`IPv4`?e===`IPv4`||e===4:t===`IPv6`?e===`IPv6`||e===6:e===t}function u(e,t){typeof e==`function`&&(t=e,e=null);var n={ip:u.ip(e),ipv6:u.ipv6(e),mac:null};u.mac(e,function(e,r){r&&(n.mac=r),t(e,n)})}u.interface=function(e,t){var n=r.networkInterfaces(),i=!t;t||=s(),e||=`IPv4`;for(var a=-1;a<8;a++){var o=n[t+(a>=0?a:``)];if(o)for(var c=0;c<o.length;c++){var u=o[c];if(l(u.family,e))return u}}if(i)for(var d in n)for(var o=n[d],a=0;a<o.length;a++){var u=o[a];if(l(u.family,e)&&!u.address.startsWith(`127.`))return u}},u.ip=function(e){var t=u.interface(`IPv4`,e);return t&&t.address},u.ipv6=function(e){var t=u.interface(`IPv6`,e);return t&&t.address};var d=/^(\w+)\:\s+flags=/,f=/^(\w+)\s{2,}link encap:\w+/i,p=u.MAC_RE=/(?:ether|HWaddr)\s+((?:[a-z0-9]{2}\:){5}[a-z0-9]{2})/i,m=u.MAC_IP_RE=/inet\s(?:addr\:)?(\d+\.\d+\.\d+\.\d+)/;function h(e,t,n){for(var r=e.split(`
8
8
  `),i=0;i<r.length;i++){var a=r[i].trimRight(),o=d.exec(a)||f.exec(a);if(o&&o[1].indexOf(t)===0){var s=null,c=null,l=p.exec(a);for(l&&(c=l[1]),i++;;){if(a=r[i],!a||d.exec(a)||f.exec(a)){i--;break}c||(l=p.exec(a),l&&(c=l[1])),s||(l=m.exec(a),l&&(s=l[1])),i++}if(s===n)return c}}}u.mac=function(e,t){typeof e==`function`&&(t=e,e=null),e||=s();var n=u.interface(`IPv4`,e);if(!n)return t();if(process.env.CI||n.mac!==`ff:00:00:00:00:00`&&n.mac!==`00:00:00:00:00:00`||(n.mac=``),n.mac)return t(null,n.mac);a.exec(c(),{timeout:5e3},function(r,i,a){if(r||!i)return t(r);var o=h(i||``,e,n.address);t(null,o)})};var g=/^nameserver\s+(\d+\.\d+\.\d+\.\d+)$/i;u.dns=function(e,t){typeof e==`function`&&(t=e,e=null),e||=o,i.readFile(e,`utf8`,function(e,n){if(e)return t(e);var r=[];n||=``;for(var i=n.split(`
9
9
  `),a=0;a<i.length;a++){var o=i[a].trim(),s=g.exec(o);s&&r.push(s[1])}t(null,r)})},n.exports=u})),Me=/* @__PURE__ */ n(((t,n)=>{let r=e(`net`),i=je(),a=b()(`detect-port`);n.exports=(e,t)=>{let n=``;typeof e==`object`&&e?(n=e.hostname,t=e.callback,e=e.port):typeof e==`function`&&(t=e,e=null),e=parseInt(e)||0;let r=e+10;return r>65535&&(r=65535),a(`detect free port between [%s, %s)`,e,r),typeof t==`function`?o(e,r,n,t):new Promise(t=>{o(e,r,n,(e,n)=>{t(n)})})};function o(e,t,n,r){function c(){e++,e>=t&&(a(`port: %s >= maxPort: %s, give up and use random port`,e,t),e=0,t=0),o(e,t,n,r)}n?s(e,n,(e,t)=>{if(e)return e.code===`EADDRNOTAVAIL`?r(/* @__PURE__ */ Error(`the ip that is not unknown on the machine`)):c();r(null,t)}):s(e,null,(t,n)=>{if(e===0)return r(t,n);if(t)return c(t);s(e,`0.0.0.0`,t=>{if(t)return c(t);s(e,`localhost`,t=>{if(t&&t.code!==`EADDRNOTAVAIL`)return c(t);s(e,i.ip(),(e,t)=>{if(e)return c(e);r(null,t)})})})})}function s(e,t,n){let i=new r.Server;i.on(`error`,r=>(a(`listen %s:%s error: %s`,t,e,r),i.close(),r.code===`ENOTFOUND`?(a(`ignore dns ENOTFOUND error, get free %s:%s`,t,e),n(null,e)):n(r))),i.listen(e,t,()=>(e=i.address().port,i.close(),a(`get free %s:%s`,t,e),n(null,e)))}})),Ne=/* @__PURE__ */ n(((e,t)=>{let n=b()(`wait-port`),r=Me(),i=e=>new Promise(t=>setTimeout(t,e));async function a(e,t={}){let{retryInterval:a=1e3,retries:o=1/0}=t,s=1;async function c(){if(n(`retries`,o,`count`,s),s>o){let e=/* @__PURE__ */ Error(`retries exceeded`);throw e.retries=o,e.count=s,e}return s++,await r(e)!==e||(await i(a),c())}return await c()}t.exports=a})),Pe=/* @__PURE__ */ n(((e,t)=>{t.exports=Me(),t.exports.waitPort=Ne()})),E=/* @__PURE__ */ n((e=>{let t=o().fromCallback,n=u(),r=(/* @__PURE__ */ `access.appendFile.chmod.chown.close.copyFile.fchmod.fchown.fdatasync.fstat.fsync.ftruncate.futimes.lchmod.lchown.link.lstat.mkdir.mkdtemp.open.opendir.readdir.readFile.readlink.realpath.rename.rm.rmdir.stat.symlink.truncate.unlink.utimes.writeFile`.split(`.`)).filter(e=>typeof n[e]==`function`);Object.assign(e,n),r.forEach(r=>{e[r]=t(n[r])}),e.exists=function(e,t){return typeof t==`function`?n.exists(e,t):new Promise(t=>n.exists(e,t))},e.read=function(e,t,r,i,a,o){return typeof o==`function`?n.read(e,t,r,i,a,o):new Promise((o,s)=>{n.read(e,t,r,i,a,(e,t,n)=>{if(e)return s(e);o({bytesRead:t,buffer:n})})})},e.write=function(e,t,...r){return typeof r[r.length-1]==`function`?n.write(e,t,...r):new Promise((i,a)=>{n.write(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffer:n})})})},e.readv=function(e,t,...r){return typeof r[r.length-1]==`function`?n.readv(e,t,...r):new Promise((i,a)=>{n.readv(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesRead:t,buffers:n})})})},e.writev=function(e,t,...r){return typeof r[r.length-1]==`function`?n.writev(e,t,...r):new Promise((i,a)=>{n.writev(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffers:n})})})},typeof n.realpath.native==`function`?e.realpath.native=t(n.realpath.native):process.emitWarning(`fs.realpath.native is not a function. Is fs being monkey-patched?`,`Warning`,`fs-extra-WARN0003`)})),Fe=/* @__PURE__ */ n(((t,n)=>{let r=e(`path`);n.exports.checkPath=function(e){if(process.platform===`win32`&&/[<>:"|?*]/.test(e.replace(r.parse(e).root,``))){let t=/* @__PURE__ */ Error(`Path contains invalid characters: ${e}`);throw t.code=`EINVAL`,t}}})),Ie=/* @__PURE__ */ n(((e,t)=>{let n=E(),{checkPath:r}=Fe(),i=e=>typeof e==`number`?e:{mode:511,...e}.mode;t.exports.makeDir=async(e,t)=>(r(e),n.mkdir(e,{mode:i(t),recursive:!0})),t.exports.makeDirSync=(e,t)=>(r(e),n.mkdirSync(e,{mode:i(t),recursive:!0}))})),D=/* @__PURE__ */ n(((e,t)=>{let n=o().fromPromise,{makeDir:r,makeDirSync:i}=Ie(),a=n(r);t.exports={mkdirs:a,mkdirsSync:i,mkdirp:a,mkdirpSync:i,ensureDir:a,ensureDirSync:i}})),Le=/* @__PURE__ */ n(((e,t)=>{let n=o().fromPromise,r=E();function i(e){return r.access(e).then(()=>!0).catch(()=>!1)}t.exports={pathExists:n(i),pathExistsSync:r.existsSync}})),Re=/* @__PURE__ */ n(((e,t)=>{let n=E(),r=o().fromPromise;async function i(e,t,r){let i=await n.open(e,`r+`),a=null;try{await n.futimes(i,t,r)}finally{try{await n.close(i)}catch(e){a=e}}if(a)throw a}function a(e,t,r){let i=n.openSync(e,`r+`);return n.futimesSync(i,t,r),n.closeSync(i)}t.exports={utimesMillis:r(i),utimesMillisSync:a}})),ze=/* @__PURE__ */ n(((t,n)=>{let r=E(),i=e(`path`),a=o().fromPromise;function s(e,t,n){let i=n.dereference?e=>r.stat(e,{bigint:!0}):e=>r.lstat(e,{bigint:!0});return Promise.all([i(e),i(t).catch(e=>{if(e.code===`ENOENT`)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}function c(e,t,n){let i,a=n.dereference?e=>r.statSync(e,{bigint:!0}):e=>r.lstatSync(e,{bigint:!0}),o=a(e);try{i=a(t)}catch(e){if(e.code===`ENOENT`)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:i}}async function l(e,t,n,r){let{srcStat:a,destStat:o}=await s(e,t,r);if(o){if(p(a,o)){let r=i.basename(e),s=i.basename(t);if(n===`move`&&r!==s&&r.toLowerCase()===s.toLowerCase())return{srcStat:a,destStat:o,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(a.isDirectory()&&!o.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&o.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&m(e,t))throw Error(h(e,t,n));return{srcStat:a,destStat:o}}function u(e,t,n,r){let{srcStat:a,destStat:o}=c(e,t,r);if(o){if(p(a,o)){let r=i.basename(e),s=i.basename(t);if(n===`move`&&r!==s&&r.toLowerCase()===s.toLowerCase())return{srcStat:a,destStat:o,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(a.isDirectory()&&!o.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&o.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&m(e,t))throw Error(h(e,t,n));return{srcStat:a,destStat:o}}async function d(e,t,n,a){let o=i.resolve(i.dirname(e)),s=i.resolve(i.dirname(n));if(s===o||s===i.parse(s).root)return;let c;try{c=await r.stat(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(p(t,c))throw Error(h(e,n,a));return d(e,t,s,a)}function f(e,t,n,a){let o=i.resolve(i.dirname(e)),s=i.resolve(i.dirname(n));if(s===o||s===i.parse(s).root)return;let c;try{c=r.statSync(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(p(t,c))throw Error(h(e,n,a));return f(e,t,s,a)}function p(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function m(e,t){let n=i.resolve(e).split(i.sep).filter(e=>e),r=i.resolve(t).split(i.sep).filter(e=>e);return n.every((e,t)=>r[t]===e)}function h(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}n.exports={checkPaths:a(l),checkPathsSync:u,checkParentPaths:a(d),checkParentPathsSync:f,isSrcSubdir:m,areIdentical:p}})),Be=/* @__PURE__ */ n(((t,n)=>{let r=E(),i=e(`path`),{mkdirs:a}=D(),{pathExists:o}=Le(),{utimesMillis:s}=Re(),c=ze();async function l(e,t,n={}){typeof n==`function`&&(n={filter:n}),n.clobber=`clobber`in n?!!n.clobber:!0,n.overwrite=`overwrite`in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch===`ia32`&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
10
10
 
@@ -4,4 +4,4 @@ import { dirname as __mintDirname } from 'node:path';
4
4
  const require = __mintCreateRequire(import.meta.url);
5
5
  const __filename = __mintFileURLToPath(import.meta.url);
6
6
  const __dirname = __mintDirname(__filename);
7
- export{t as clearConfigValue,n as getAgentSiteMetadata,r as getConfigValue,i as getUpdateState,a as hasShownPublishPrompt,o as isTelemetryEnabled,s as markPublishPromptShown,c as setAgentSiteMetadata,l as setConfigValue,u as setTelemetryEnabled,d as setUpdateState}from"./config-B9UTDqKX.js";
7
+ export{t as clearConfigValue,n as getAgentSiteMetadata,r as getConfigValue,i as getUpdateState,a as hasShownPublishPrompt,o as isTelemetryEnabled,s as markPublishPromptShown,c as setAgentSiteMetadata,l as setConfigValue,u as setTelemetryEnabled,d as setUpdateState}from"./config-VhqDayo8.js";