@mintlify/cli 4.1.81 → 4.1.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -554,7 +554,7 @@ Next steps:`,`1. Clone the hosted repository into a separate directory. Do not r
554
554
  `)}function eh(e){return Jm(this,void 0,void 0,function*(){return Hn.readFile(e,`utf8`).catch(e=>{if(e.code!==`ENOENT`)throw e})})}function th(e,t){return Jm(this,arguments,void 0,function*(e,t,n=!1){let r=In.join(e,Xm),i=yield eh(r);if(i===t)return`unchanged`;if(i!==void 0&&!n)throw Error(`${Xm} already exists with different contents. Pass --force to overwrite it.`);return yield Hn.mkdir(In.dirname(r),{recursive:!0}),yield Hn.writeFile(r,t),i===void 0?`created`:`updated`})}function nh(e){return Jm(this,void 0,void 0,function*(){try{return yield Zm(`git`,[`rev-parse`,`--show-toplevel`],e)}catch{throw Error(`--github requires a Git repository. Run it inside your docs repository.`)}})}function rh(e){return Jm(this,void 0,void 0,function*(){let t=yield Zm(`git`,[`remote`,`get-url`,`origin`],e).catch(()=>{throw Error(`This repository has no origin remote. Add a github.com origin and retry.`)}),n=Qm(t);if(!n)throw Error(`The origin remote (${t}) is not a github.com repository.`);let r=yield Zm(`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 Ym.parse(JSON.parse(r))}catch{throw Error(`gh returned an unexpected repository response.`)}})}function ih(e,t){return Jm(this,arguments,void 0,function*(e,t,n=()=>{}){let r=In.resolve(e.directory),i=yield nh(r),[a,o]=yield Promise.all([Hn.realpath(i),Hn.realpath(r)]),s=In.relative(a,o).split(In.sep).join(`/`);if(!(yield eh(In.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 rh(i),l=yield Am(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 Om(e.apiUrl,u,{repositoryId:String(c.id),repository:c.full_name,branch:c.default_branch});let d=yield th(i,$m(c.default_branch,l.site.subdomain,s),e.force);return{siteUrl:jm(e.apiUrl,l.site.subdomain),subdomain:l.site.subdomain,repository:c.full_name,branch:c.default_branch,workflowPath:Xm,workflow:d}})}function ah(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.`,``,...Wm].join(`
555
555
  `)}var oh=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 sh=[`bug`,`docs`,`idea`];function ch(e){return oh(this,void 0,void 0,function*(){let t;try{t=yield fetch(`${rt}/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 lh(e){return oh(this,void 0,void 0,function*(){let t=yield ch(e);return D(t?(0,P.jsx)(c,{message:t}):(0,P.jsx)(o,{message:`feedback sent`})),!t})}var uh=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())})},dh=function(e){return this instanceof dh?(this.v=e,this):new dh(e)},fh=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)}},ph=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:dh(e[r](t)),done:!1}:i?i(t):t}:i}},mh=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 dh?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 hh(){return uh(this,void 0,void 0,function*(){try{let e=yield Hn.readFile(In.join(et,`.gitignore`),`utf-8`);return le(e)}catch{return[]}})}function gh(e,t){return mh(this,arguments,function*(){let n=yield dh(Hn.readdir(e,{withFileTypes:!0}));for(let r of n){let n=In.join(e,r.name),i=In.relative(et,n).split(In.sep).join(`/`);De(i,t,r.isDirectory())||(r.isDirectory()?yield dh(yield*ph(fh(gh(n,t)))):r.name.endsWith(`.mdx`)&&(yield yield dh(n)))}})}const _h=()=>uh(void 0,void 0,void 0,function*(){var e,t,n,r;let{mdxToPm:i,pmToMdx:a,canonicalPmToMdxOptions:s}=yield import(`./converter-D-AXgjro.js`),l=[...yield hh(),...yield ge(et)],u=ce(l),d=0,f=0,p=0;try{for(var m=!0,h=fh(gh(et,u)),g;g=yield h.next(),e=g.done,!e;m=!0){r=g.value,m=!1;let e=r;d++;let t=In.relative(et,e);try{let t=yield Hn.readFile(e,`utf-8`),n=t,r=0;for(let e=0;e<3;e++){let{doc:t,frontmatter:o}=i(n);e===0&&(r=Object.keys(o).length);let c=`${a(t,Object.assign({frontmatter:o},s))}\n`;if(c===n)break;n=c}if(r>0&&!n.startsWith(`---`))throw Error(`formatting would remove frontmatter; file left untouched`);n!==t&&(yield Hn.writeFile(e,n),f++)}catch(e){p++,D((0,P.jsx)(c,{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}}D((0,P.jsx)(o,{message:`formatted ${f} of ${d} mdx file${d===1?``:`s`}${p>0?` (${p} failed)`:``}`})),yield N(+(p>0))});var vh=/* @__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}})),yh=/* @__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])})),bh=/* @__PURE__ */ n(((t,n)=>{let r=e(`fs`),i=e(`path`),a=vh(),o=yh(),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})),xh=/* @__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,` `)}}}})),Sh=/* @__PURE__ */ n(((e,t)=>{t.exports={efs:!0,encode:e=>Buffer.from(e,`utf8`),decode:e=>e.toString(`utf8`)}})),Ch=/* @__PURE__ */ n(((e,t)=>{t.exports=bh(),t.exports.Constants=vh(),t.exports.Errors=yh(),t.exports.FileAttr=xh(),t.exports.decoder=Sh()})),wh=/* @__PURE__ */ n(((e,t)=>{var n=Ch(),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,` `)}}}})),Th=/* @__PURE__ */ n(((e,t)=>{var n=Ch(),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,` `)}}}})),Eh=/* @__PURE__ */ n((e=>{e.EntryHeader=wh(),e.MainHeader=Th()})),Dh=/* @__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)}}}})),Oh=/* @__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)}}}})),kh=/* @__PURE__ */ n(((t,n)=>{let{randomFillSync:r}=e(`crypto`),i=yh(),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}})),Ah=/* @__PURE__ */ n((e=>{e.Deflater=Dh(),e.Inflater=Oh(),e.ZipCrypto=kh()})),jh=/* @__PURE__ */ n(((e,t)=>{var n=Ch(),r=Eh(),i=n.Constants,a=Ah();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,` `)}}}})),Mh=/* @__PURE__ */ n(((e,t)=>{let n=jh(),r=Eh(),i=Ch();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)}}}}})),Nh=/* @__PURE__ */ t((/* @__PURE__ */ n(((t,n)=>{let r=Ch(),i=e(`path`),a=jh(),o=Mh(),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),Ph=/* @__PURE__ */ t(St(),1),Fh=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 Ih=`mintlify`,Lh=`templates`,Rh=`main`;function zh(){return Fh(this,void 0,void 0,function*(){let e=yield fetch(`https://api.github.com/repos/${Ih}/${Lh}/contents/?ref=${Rh}`,{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 Bh(e){return Fh(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/${Ih}/${Lh}/contents/${encodeURIComponent(e)}?ref=${Rh}`,n=yield fetch(t,{headers:{Accept:`application/vnd.github.v3+json`}});if(!n.ok){let t=yield zh().catch(()=>[]),n=t.length>0?` Available templates: ${t.join(`, `)}`:``;throw Error(`Template "${e}" not found in ${Ih}/${Lh}.${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 Vh(){return Fh(this,void 0,void 0,function*(){D((0,P.jsx)(f,{message:`fetching available templates...`}));let e;try{e=yield zh()}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 Yd({message:`Choose a template`,choices:e.map(e=>({name:e,value:e}))})})}function Hh(e,t,n,r){return Fh(this,void 0,void 0,function*(){let i=kn.join(e,`__template__.zip`),o=kn.join(e,`__template_extract__`);try{D((0,P.jsx)(f,{message:`downloading template "${t}"...`}));try{let e=yield fetch(`https://github.com/${Ih}/${Lh}/archive/refs/heads/${Rh}.zip`);if(!e.ok)throw Error(`Failed to download templates archive: ${e.status}`);let t=yield e.arrayBuffer();yield Ph.default.writeFile(i,Buffer.from(t))}finally{a()}D((0,P.jsx)(f,{message:`extracting template...`}));try{new Nh.default(i).extractAllTo(o,!0)}finally{a()}let n=kn.join(o,`${Lh}-${Rh}`),r=kn.join(n,t);if(!(yield Ph.default.pathExists(r)))throw Error(`Template directory "${t}" not found in the downloaded archive.`);yield Ph.default.copy(r,e,{overwrite:!0})}finally{yield Ph.default.remove(i).catch(()=>{}),yield Ph.default.remove(o).catch(()=>{})}let s=kn.join(e,`docs.json`);if(yield Ph.default.pathExists(s)){let e=yield Ph.default.readJson(s);n&&(e.name=n),r&&(e.theme=r),yield Ph.default.writeJson(s,e,{spaces:2})}})}var Uh=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 Wh=e=>{h((0,P.jsx)(M,{bold:!0,children:`Documentation Setup!`}),(0,P.jsx)(M,{children:`To see your docs run`}),(0,P.jsxs)(ke,{children:[(0,P.jsx)(M,{color:`blue`,children:`cd`}),(0,P.jsxs)(M,{children:[` `,e]})]}),(0,P.jsx)(M,{color:`blue`,children:`mint dev`})),Je()&&D((0,P.jsxs)(M,{children:["When the docs are ready, run `mint validate` in ",e,` to check the build and get publish steps.`]}))},Gh=(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`;h((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(`
556
556
  `)}),(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 Kh(e,t,n){return Uh(this,void 0,void 0,function*(){let r=yield zh().catch(()=>void 0);Gh(e,t,n,r)})}function qh(e,t,n){return Uh(this,void 0,void 0,function*(){if(!n)return e;if(Je())return t?e:void 0;let r=yield Yd({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 It({message:`Subdirectory name:`,default:`docs`});if(!t||t.trim()===``)throw Error(`Subdirectory name cannot be empty`);let n=e===`.`?t:`${e}/${t}`;return pe(n,process.cwd()),n}return e}})}function Jh(e,t){return Uh(this,void 0,void 0,function*(){return t||It({message:`Project Name`,default:e===`.`?`Mintlify`:e})})}function Yh(){return Uh(this,void 0,void 0,function*(){if((yield Yd({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 Vh()})}function Xh(e,t,n,r,i){return Uh(this,void 0,void 0,function*(){pe(e);let a=he.options.map(e=>e.shape.theme._def.value),o=(yield Ph.default.readdir(e).catch(()=>[])).length>0;if(Je()&&(!r||!i&&!n)||Je()&&o&&!t){yield Kh(e,o,a);return}let s=i?yield Bh(i).then(()=>i):!Je()&&!n?yield Yh():void 0;if(s){let i=yield qh(e,t,o);if(i===void 0){Je()&&(yield Kh(e,o,a));return}let c=yield Jh(i,r);yield Ph.default.ensureDir(i),yield Hh(i,s,c,n),Wh(i);return}let c=yield qh(e,t,o);if(c===void 0){Je()&&(yield Kh(e,o,a));return}let l=r,u=n;Je()||u&&l||(l=yield Jh(c,l),u||=yield Yd({message:`Theme`,choices:a.map(e=>({name:e,value:e}))})),l===void 0||u===void 0?yield Kh(c,o,a):(yield Ph.default.ensureDir(c),yield Zh(c,l,u),Wh(c))})}const Zh=(e,t,n)=>Uh(void 0,void 0,void 0,function*(){D((0,P.jsx)(f,{message:`downloading starter template...`}));let r=yield(yield fetch(`https://github.com/mintlify/starter/archive/refs/heads/main.zip`)).arrayBuffer();yield Ph.default.writeFile(e+`/starter.zip`,Buffer.from(r)),a(),D((0,P.jsx)(f,{message:`extracting...`})),new Nh.default(e+`/starter.zip`).extractAllTo(e,!0),a(),yield Ph.default.copy(e+`/starter-main`,e,{overwrite:!0,filter:e=>!e.includes(`starter-main/starter-main`)}),yield Ph.default.remove(e+`/starter.zip`),yield Ph.default.remove(e+`/starter-main`);let i=e+`/docs.json`,o=yield Ph.default.readJson(i);o.theme=n,o.name=t,yield Ph.default.writeJson(i,o,{spaces:2})});var Qh=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 $h=[{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`}],eg=()=>{let e=Math.max(...$h.map(({name:e})=>e.length))+2;return[`Usage: mint instructions <topic> [subtopic]`,``,...$h.map(({name:t,when:n})=>` ${t.padEnd(e)}${n}`),``].join(`
557
- `)},tg=e=>`https://www.mintlify.com/docs/mint-instructions/${e.map(encodeURIComponent).join(`/`)}.md`,ng=e=>e.replace(/^(?:>.*\n|\s*\n)*/,``);function rg(e){return Qh(this,void 0,void 0,function*(){let t=tg(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 ng(yield n.text())})}var ig=/* @__PURE__ */ t(m(),1);typeof navigator>`u`||navigator.userAgent?.startsWith?.(`Mozilla/5.0 `);const ag=`ERR_INVALID_ARG_VALUE`;function og(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}const sg=Symbol(),cg=Symbol(),lg=Symbol(),ug=new TextEncoder,dg=new TextDecoder;function fg(e){return typeof e==`string`?ug.encode(e):dg.decode(e)}let pg;if(Uint8Array.prototype.toBase64)pg=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:`base64url`,omitPadding:!0}));else{let e=32768;pg=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 mg;mg=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:`base64url`})}catch(e){throw og(`The input to be decoded is not correctly encoded.`,ag,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 og(`The input to be decoded is not correctly encoded.`,ag,e)}};function hg(e){return typeof e==`string`?mg(e):pg(e)}var gg=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 _g(e,t,n){return new gg(e,{code:t,cause:n})}function vg(e,t,n,r){try{if(typeof e!=`string`)throw og(`${t} must be a string`,`ERR_INVALID_ARG_TYPE`,r);if(e.length===0)throw og(`${t} must not be empty`,ag,r)}catch(e){throw n?_g(e.message,n,r):e}}function yg(){return hg(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)))}function bg(){return yg()}function xg(){return yg()}function Sg(){return yg()}async function Cg(e){return vg(e,`codeVerifier`),hg(await crypto.subtle.digest(`SHA-256`,fg(e)))}function wg(e){return vg(e,`"clientSecret"`),(t,n,r,i)=>{r.set(`client_id`,n.client_id),r.set(`client_secret`,e)}}function Tg(){return(e,t,n,r)=>{n.set(`client_id`,t.client_id)}}URL.parse;const Eg=Symbol();typeof navigator<`u`&&navigator.userAgent?.startsWith?.(`Mozilla/5.0 `);const Dg=e=>Og.get(e);let Og,kg;function Ag(e){return e===void 0?(kg||=/* @__PURE__ */ new WeakMap,(e,t,n,r)=>{let i;return(i=kg.get(t))||(jg(t.client_secret,`"metadata.client_secret"`),i=wg(t.client_secret),kg.set(t,i)),i(e,t,n,r)}):wg(e)}function jg(e,t){if(typeof e!=`string`)throw Ig(`${t} must be a string`,Fg);if(e.length===0)throw Ig(`${t} must not be empty`,Pg)}function Mg(){return Tg()}const Ng=lg,Pg=`ERR_INVALID_ARG_VALUE`,Fg=`ERR_INVALID_ARG_TYPE`;function Ig(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}function Lg(e){return Cg(e)}function Rg(){return bg()}function zg(){return Sg()}function Bg(){return xg()}new TextDecoder;function Vg(e){return{supportsPKCE:{__proto__:null,value(t=`S256`){return e.code_challenge_methods_supported?.includes(t)===!0}}}}function Hg(e){Object.defineProperties(e,Vg(e))}const Ug=Symbol();Object.freeze(class{constructor(e,t,n,r){if(typeof t!=`string`||!t.length)throw Ig(`"clientId" must be a non-empty string`,Fg);if(typeof n==`string`&&(n={client_secret:n}),n?.client_id!==void 0&&t!==n.client_id)throw Ig(`"clientId" and "metadata.client_id" must be the same`,Pg);let i={...structuredClone(n),client_id:t};i[sg]=n?.[sg]??0,i[cg]=n?.[cg]??30;let a;a=r||(typeof i.client_secret==`string`&&i.client_secret.length?Ag(i.client_secret):Mg());let o=Object.freeze(i),s=structuredClone(e);Ug in e&&(s[Eg]=({claims:{tid:t}})=>e.issuer.replace(`{tenantid}`,t));let c=Object.freeze(s);Og||=/* @__PURE__ */ new WeakMap,Og.set(this,{__proto__:null,as:c,c:o,auth:a,tlsOnly:!0,jwksCache:{}})}serverMetadata(){let e=structuredClone(Dg(this).as);return Hg(e),e}clientMetadata(){return structuredClone(Dg(this).c)}get timeout(){return Dg(this).timeout}set timeout(e){Dg(this).timeout=e}get[Ng](){return Dg(this).fetch}set[Ng](e){Dg(this).fetch=e}}.prototype);var Wg=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 Gg(){return Wg(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(pt,`localhost`),{codePromise:i,close:()=>{r||(r=!0,a.close(),n(/* @__PURE__ */ Error(`Login cancelled`)))}}})}var Kg=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 qg(){return Kg(this,void 0,void 0,function*(){let e=Rg(),t=yield Lg(e),n=zg(),r=Bg(),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 s=a.toString();pd();let{codePromise:l,close:u}=yield Gg();D((0,P.jsxs)(ke,{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)(ke,{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:s})]})]})),(0,ig.default)(s).catch(()=>{}),D((0,P.jsxs)(ke,{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 d=It({message:`█`,theme:{prefix:w.dim(` │`),style:{answer:e=>w.cyan(e)}}}),f;try{f=yield Promise.race([l,d])}catch{u(),d.cancel(),D((0,P.jsx)(c,{message:`login cancelled`}));return}u(),d.cancel();let p=yield fetch(xt,{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`;hd(e),D((0,P.jsx)(c,{message:`login failed: ${e}`}));return}let h=m;yield Jl(h.access_token,h.refresh_token,eu(h.id_token)??null),md(),D((0,P.jsx)(o,{message:`logged in successfully`})),yield Yg(h.access_token)})}function Jg(e){return e instanceof Error&&e.name===`ExitPromptError`}function Yg(e){return Kg(this,void 0,void 0,function*(){let t=yield fu(e);if(t.length===0)return;if(t.length===1){yield lt(`subdomain`,t[0]),D((0,P.jsx)(u,{message:`default project set to ${t[0]}`}));return}yield new Promise(e=>setTimeout(e,50));let n;try{n=yield Vt({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(Jg(e)){D((0,P.jsx)(u,{message:`No project set. To set a default project, run ${w.bold(`mintlify config set subdomain <subdomain>`)}`}));return}throw e}yield lt(`subdomain`,n),D((0,P.jsx)(u,{message:`default project set to ${n}`}))})}var Xg=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 Zg(){return Xg(this,void 0,void 0,function*(){yield $l(),D((0,P.jsx)(o,{message:`logged out successfully`}))})}var Qg=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 $g=(e,t)=>{let n=[],r=()=>t=>(pn(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`);A().use(r).processSync(e)}catch(t){console.warn(`Warning: Could not parse ${e}: ${t}`)}return n},e_=(...e)=>Qg(void 0,[...e],void 0,function*(e=process.cwd()){let t=yield ge(e),{contentFilenames:n}=yield fe(e,t),r=[];for(let t of n)r.push(kn.join(e,t));let i=[],a=/* @__PURE__ */ new Set;for(let e of r)try{let t=Jn.readFileSync(e,`utf-8`),n=$g(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 t_=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 n_=()=>t_(void 0,void 0,void 0,function*(){try{D((0,P.jsx)(M,{bold:!0,color:`cyan`,children:`Checking mdx files for accessibility issues...`}));let e=yield e_();if(e.missingAltAttributes.length===0)return D((0,P.jsx)(o,{message:`no accessibility issues found`})),D((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)}),D((0,P.jsxs)(M,{bold:!0,color:`red`,children:[`Found `,e.missingAltAttributes.length,` accessibility issues in`,` `,e.filesWithIssues,` files:`]})),D((0,P.jsx)(M,{}));for(let[e,n]of Object.entries(t)){let t=kn.relative(process.cwd(),e);D((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`?D((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]})):D((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]}))}D((0,P.jsx)(M,{}))}return D((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 D((0,P.jsx)(c,{message:`MDX accessibility check failed: ${e instanceof Error?e.message:`Unknown error`}`})),1}});var r_=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 i_=/* @__PURE__ */ new Set([`page`,`site`,`openapi`]),a_=/* @__PURE__ */ new Set([`stats`,`search`,`feedback`,`conversation`]),o_=/* @__PURE__ */ new Set([`set`,`get`,`clear`]),s_=/* @__PURE__ */ new Set([`list`,`view`,`buckets`]),c_=/* @__PURE__ */ new Set([`list`,`view`]);function l_(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&&i_.has(r))return`scrape ${r}`;if(n===`config`&&r!==void 0&&o_.has(r))return`config ${r}`;if(n===`analytics`&&r!==void 0&&a_.has(r)){if(r===`conversation`&&i!==void 0&&s_.has(i)){let e=t[3];return i===`buckets`&&e!==void 0&&c_.has(e)?`analytics conversation buckets ${e}`:`analytics conversation ${i}`}return`analytics ${r}`}return n}function u_(){let e=!1;return function(t){return r_(this,void 0,void 0,function*(){if(typeof t._[0]==`string`){if(e)return;e=!0;let n=l_(t._),{cli:r}=Ke();dd({command:n,cliVersion:r,subdomain:mt(`subdomain`)})}})}}const d_=zn(new URL(`../migrate`,import.meta.url)),f_=(...e)=>jn(In.join(d_,...e),`utf8`),p_=e=>Mn(In.join(d_,e)).filter(e=>e.endsWith(`.md`)).map(e=>e.slice(0,-3)).sort(),m_=()=>[f_(`index.md`).trimEnd(),`Topics: ${p_(`topics`).join(`, `)}. Run \`mint migrate --topic <name>\`.`,`Sources: ${p_(`sources`).join(`, `)}. Run \`mint migrate --from <name>\`.`].join(`
557
+ `)},tg=e=>`https://www.mintlify.com/docs/mint-instructions/${e.map(encodeURIComponent).join(`/`)}.md`,ng=e=>e.replace(/^(?:>.*\n|\s*\n)*/,``);function rg(e){return Qh(this,void 0,void 0,function*(){let t=tg(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 ng(yield n.text())})}var ig=/* @__PURE__ */ t(m(),1);typeof navigator>`u`||navigator.userAgent?.startsWith?.(`Mozilla/5.0 `);const ag=`ERR_INVALID_ARG_VALUE`;function og(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}const sg=Symbol(),cg=Symbol(),lg=Symbol(),ug=new TextEncoder,dg=new TextDecoder;function fg(e){return typeof e==`string`?ug.encode(e):dg.decode(e)}let pg;if(Uint8Array.prototype.toBase64)pg=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:`base64url`,omitPadding:!0}));else{let e=32768;pg=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 mg;mg=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:`base64url`})}catch(e){throw og(`The input to be decoded is not correctly encoded.`,ag,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 og(`The input to be decoded is not correctly encoded.`,ag,e)}};function hg(e){return typeof e==`string`?mg(e):pg(e)}var gg=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 _g(e,t,n){return new gg(e,{code:t,cause:n})}function vg(e,t,n,r){try{if(typeof e!=`string`)throw og(`${t} must be a string`,`ERR_INVALID_ARG_TYPE`,r);if(e.length===0)throw og(`${t} must not be empty`,ag,r)}catch(e){throw n?_g(e.message,n,r):e}}function yg(){return hg(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)))}function bg(){return yg()}function xg(){return yg()}function Sg(){return yg()}async function Cg(e){return vg(e,`codeVerifier`),hg(await crypto.subtle.digest(`SHA-256`,fg(e)))}function wg(e){return vg(e,`"clientSecret"`),(t,n,r,i)=>{r.set(`client_id`,n.client_id),r.set(`client_secret`,e)}}function Tg(){return(e,t,n,r)=>{n.set(`client_id`,t.client_id)}}URL.parse;const Eg=Symbol();typeof navigator<`u`&&navigator.userAgent?.startsWith?.(`Mozilla/5.0 `);const Dg=e=>Og.get(e);let Og,kg;function Ag(e){return e===void 0?(kg||=/* @__PURE__ */ new WeakMap,(e,t,n,r)=>{let i;return(i=kg.get(t))||(jg(t.client_secret,`"metadata.client_secret"`),i=wg(t.client_secret),kg.set(t,i)),i(e,t,n,r)}):wg(e)}function jg(e,t){if(typeof e!=`string`)throw Ig(`${t} must be a string`,Fg);if(e.length===0)throw Ig(`${t} must not be empty`,Pg)}function Mg(){return Tg()}const Ng=lg,Pg=`ERR_INVALID_ARG_VALUE`,Fg=`ERR_INVALID_ARG_TYPE`;function Ig(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}function Lg(e){return Cg(e)}function Rg(){return bg()}function zg(){return Sg()}function Bg(){return xg()}new TextDecoder;function Vg(e){return{supportsPKCE:{__proto__:null,value(t=`S256`){return e.code_challenge_methods_supported?.includes(t)===!0}}}}function Hg(e){Object.defineProperties(e,Vg(e))}const Ug=Symbol();Object.freeze(class{constructor(e,t,n,r){if(typeof t!=`string`||!t.length)throw Ig(`"clientId" must be a non-empty string`,Fg);if(typeof n==`string`&&(n={client_secret:n}),n?.client_id!==void 0&&t!==n.client_id)throw Ig(`"clientId" and "metadata.client_id" must be the same`,Pg);let i={...structuredClone(n),client_id:t};i[sg]=n?.[sg]??0,i[cg]=n?.[cg]??30;let a;a=r||(typeof i.client_secret==`string`&&i.client_secret.length?Ag(i.client_secret):Mg());let o=Object.freeze(i),s=structuredClone(e);Ug in e&&(s[Eg]=({claims:{tid:t}})=>e.issuer.replace(`{tenantid}`,t));let c=Object.freeze(s);Og||=/* @__PURE__ */ new WeakMap,Og.set(this,{__proto__:null,as:c,c:o,auth:a,tlsOnly:!0,jwksCache:{}})}serverMetadata(){let e=structuredClone(Dg(this).as);return Hg(e),e}clientMetadata(){return structuredClone(Dg(this).c)}get timeout(){return Dg(this).timeout}set timeout(e){Dg(this).timeout=e}get[Ng](){return Dg(this).fetch}set[Ng](e){Dg(this).fetch=e}}.prototype);var Wg=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 Gg(){return Wg(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(pt,`localhost`),{codePromise:i,close:()=>{r||(r=!0,a.close(),n(/* @__PURE__ */ Error(`Login cancelled`)))}}})}var Kg=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 qg(){return Kg(this,arguments,void 0,function*({signup:e=!1}={}){let t=Rg(),n=yield Lg(t),r=zg(),i=Bg(),a=Buffer.from(JSON.stringify({nonce:r,clientState:i})).toString(`base64url`),s=new URL(`/api/cli/oauth/authorize`,it);s.searchParams.set(`state`,a),s.searchParams.set(`code_challenge`,n),e&&s.searchParams.set(`flow`,`cli-signup`);let l=new URL(`/signup`,it);l.searchParams.set(`next`,`${s.pathname}${s.search}`);let u=(e?l:s).toString();pd();let{codePromise:d,close:f}=yield Gg();D((0,P.jsxs)(ke,{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 to`,` `,e?`create your Mintlify account`:`authenticate with Mintlify`]}),(0,P.jsxs)(ke,{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:u})]})]})),(0,ig.default)(u).catch(()=>{}),D((0,P.jsxs)(ke,{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 p=It({message:`█`,theme:{prefix:w.dim(` │`),style:{answer:e=>w.cyan(e)}}}),m;try{m=yield Promise.race([d,p])}catch{f(),p.cancel(),D((0,P.jsx)(c,{message:`login cancelled`}));return}f(),p.cancel();let h=yield fetch(xt,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({grant_type:`authorization_code`,code:m,code_verifier:t})}),g=yield h.json().catch(()=>({}));if(!h.ok){let e=g.error_message??g.error??`unknown error`;hd(e),D((0,P.jsx)(c,{message:`login failed: ${e}`}));return}let _=g;yield Jl(_.access_token,_.refresh_token,eu(_.id_token)??null),e&&(yield gt(`subdomain`).catch(()=>void 0)),md(),D((0,P.jsx)(o,{message:e?`account created and logged in successfully`:`logged in successfully`})),yield Yg(_.access_token)})}function Jg(e){return e instanceof Error&&e.name===`ExitPromptError`}function Yg(e){return Kg(this,void 0,void 0,function*(){let t=yield fu(e);if(t.length===0)return;if(t.length===1){yield lt(`subdomain`,t[0]),D((0,P.jsx)(u,{message:`default project set to ${t[0]}`}));return}yield new Promise(e=>setTimeout(e,50));let n;try{n=yield Vt({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(Jg(e)){D((0,P.jsx)(u,{message:`No project set. To set a default project, run ${w.bold(`mintlify config set subdomain <subdomain>`)}`}));return}throw e}yield lt(`subdomain`,n),D((0,P.jsx)(u,{message:`default project set to ${n}`}))})}var Xg=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 Zg(){return Xg(this,void 0,void 0,function*(){yield $l(),D((0,P.jsx)(o,{message:`logged out successfully`}))})}var Qg=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 $g=(e,t)=>{let n=[],r=()=>t=>(pn(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`);A().use(r).processSync(e)}catch(t){console.warn(`Warning: Could not parse ${e}: ${t}`)}return n},e_=(...e)=>Qg(void 0,[...e],void 0,function*(e=process.cwd()){let t=yield ge(e),{contentFilenames:n}=yield fe(e,t),r=[];for(let t of n)r.push(kn.join(e,t));let i=[],a=/* @__PURE__ */ new Set;for(let e of r)try{let t=Jn.readFileSync(e,`utf-8`),n=$g(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 t_=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 n_=()=>t_(void 0,void 0,void 0,function*(){try{D((0,P.jsx)(M,{bold:!0,color:`cyan`,children:`Checking mdx files for accessibility issues...`}));let e=yield e_();if(e.missingAltAttributes.length===0)return D((0,P.jsx)(o,{message:`no accessibility issues found`})),D((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)}),D((0,P.jsxs)(M,{bold:!0,color:`red`,children:[`Found `,e.missingAltAttributes.length,` accessibility issues in`,` `,e.filesWithIssues,` files:`]})),D((0,P.jsx)(M,{}));for(let[e,n]of Object.entries(t)){let t=kn.relative(process.cwd(),e);D((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`?D((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]})):D((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]}))}D((0,P.jsx)(M,{}))}return D((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 D((0,P.jsx)(c,{message:`MDX accessibility check failed: ${e instanceof Error?e.message:`Unknown error`}`})),1}});var r_=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 i_=/* @__PURE__ */ new Set([`page`,`site`,`openapi`]),a_=/* @__PURE__ */ new Set([`stats`,`search`,`feedback`,`conversation`]),o_=/* @__PURE__ */ new Set([`set`,`get`,`clear`]),s_=/* @__PURE__ */ new Set([`list`,`view`,`buckets`]),c_=/* @__PURE__ */ new Set([`list`,`view`]);function l_(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&&i_.has(r))return`scrape ${r}`;if(n===`config`&&r!==void 0&&o_.has(r))return`config ${r}`;if(n===`analytics`&&r!==void 0&&a_.has(r)){if(r===`conversation`&&i!==void 0&&s_.has(i)){let e=t[3];return i===`buckets`&&e!==void 0&&c_.has(e)?`analytics conversation buckets ${e}`:`analytics conversation ${i}`}return`analytics ${r}`}return n}function u_(){let e=!1;return function(t){return r_(this,void 0,void 0,function*(){if(typeof t._[0]==`string`){if(e)return;e=!0;let n=l_(t._),{cli:r}=Ke();dd({command:n,cliVersion:r,subdomain:mt(`subdomain`)})}})}}const d_=zn(new URL(`../migrate`,import.meta.url)),f_=(...e)=>jn(In.join(d_,...e),`utf8`),p_=e=>Mn(In.join(d_,e)).filter(e=>e.endsWith(`.md`)).map(e=>e.slice(0,-3)).sort(),m_=()=>[f_(`index.md`).trimEnd(),`Topics: ${p_(`topics`).join(`, `)}. Run \`mint migrate --topic <name>\`.`,`Sources: ${p_(`sources`).join(`, `)}. Run \`mint migrate --from <name>\`.`].join(`
558
558
 
559
559
  `),h_=({from:e,topic:t})=>t?f_(`topics`,`${t}.md`):e?`${m_()}\n\n${f_(`sources`,`${e}.md`)}`:`${m_()}\n`,g_=e=>`Migrate a documentation site to Mintlify in the current directory. Run \`mint migrate${e?` --from ${e}`:``}\` and follow the instructions it prints.`,__={claude:{bin:`claude`,args:e=>[e],install:`npm install -g @anthropic-ai/claude-code`},codex:{bin:`codex`,args:e=>[e],install:`npm install -g @openai/codex`},cursor:{bin:`cursor-agent`,args:e=>[e],install:`curl https://cursor.com/install -fsS | bash`},gemini:{bin:`gemini`,args:e=>[`-i`,e],install:`npm install -g @google/gemini-cli`}},v_=(e,t)=>__[e].args(g_(t)),y_=(e,t)=>new Promise((n,r)=>{let{bin:i,install:a}=__[e],o=v_(e,t).map(e=>Ye.shell?`"${e}"`:e),s=Pn(i,o,Object.assign({stdio:`inherit`},Ye));s.on(`error`,e=>r(e.code===`ENOENT`?/* @__PURE__ */ Error(`${i} not found. Install it with: ${a}`):e)),s.on(`close`,e=>n(e??1))}),b_=1200,x_=`legacy`,S_={light:.32,dark:.52},C_=({eyebrow:e,title:t,description:n})=>({eyebrow:e||null,title:El(t)||null,description:El(n)||null}),w_=10485760,T_=[[[119,79,70,70],`font/woff`],[[0,1,0,0],`font/ttf`],[[116,114,117,101],`font/ttf`],[[79,84,84,79],`font/otf`]],E_=e=>{if(e.byteLength<44)return!1;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=44+t.getUint16(12)*20;if(t.getUint32(8)!==e.byteLength||n>e.byteLength||t.getUint32(16)>w_)return!1;let r=0;for(let i=44;i<n;i+=20){let n=t.getUint32(i+4),a=t.getUint32(i+8),o=t.getUint32(i+12);if(n+a>e.byteLength||a>o)return!1;r+=o}return r<=w_},D_=e=>{let t=T_.find(([t])=>t.every((t,n)=>e[n]===t))?.[1];if(t!==`font/woff`||E_(e))return t},O_={400:new URL(`./assets/og/Inter-Regular.ttf`,import.meta.url),500:new URL(`./assets/og/Inter-Medium.ttf`,import.meta.url),600:new URL(`./assets/og/Inter-SemiBold.ttf`,import.meta.url),700:new URL(`./assets/og/Inter-Bold.ttf`,import.meta.url)},k_=new URL(`./assets/og/PaperMono-Regular.ttf`,import.meta.url);On(import.meta.url),[...Object.values(O_)];const A_=e=>e,j_=()=>zn(new URL(`./assets/og/index_bg.wasm`,import.meta.url));var M_=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 N_=[400,500,600,700],P_=[400,600,700],F_=/src: url\((.+?)\) format\('(opentype|truetype|woff)'\)/;let I_,L_;const R_=e=>M_(void 0,void 0,void 0,function*(){return{weight:e,data:yield Gn(A_(O_[e]))}}),z_=()=>(I_??=Promise.all(N_.map(R_)).then(e=>({family:`Inter`,faces:e}),e=>{throw I_=void 0,e}),I_),B_=()=>(L_??=Gn(A_(k_)).then(e=>({family:`Paper Mono`,faces:[{weight:400,data:e}]}),e=>{throw L_=void 0,e}),L_),V_=(e,t,n)=>`https://fonts.googleapis.com/css2?family=${encodeURIComponent(e).replace(/%20/g,`+`)}:wght@${n}&text=${encodeURIComponent(t)}`,H_=(e,t,n)=>M_(void 0,void 0,void 0,function*(){let r=(yield(yield fetch(V_(e,t,n),{headers:{"User-Agent":`MintlifyOG/1.0`}})).text()).match(F_)?.[1];if(!r)throw Error(`No Satori-compatible font source found`);let i=yield fetch(r);if(i.status!==200)throw Error(`Font request failed: ${i.status}`);return{weight:n,data:yield i.arrayBuffer()}}),U_=(e,t)=>M_(void 0,void 0,void 0,function*(){try{let[n,r]=yield Promise.all([Promise.all(P_.map(n=>H_(e,t,n))),H_(e,t,500).catch(()=>null)]);return{family:e,faces:r?[...n,r]:n}}catch(t){return console.error(`Failed to load Google Font "${e}":`,t),null}}),W_=e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},G_=e=>{let t=Math.min(1,Math.max(0,e)),n=t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055;return Math.round(n*255)},K_=e=>{let{red:t,green:n,blue:r}=tr(e),[i,a,o]=[W_(t),W_(n),W_(r)],s=Math.cbrt(.4122214708*i+.5363325363*a+.0514459929*o),c=Math.cbrt(.2119034982*i+.6806995451*a+.1073969566*o),l=Math.cbrt(.0883024619*i+.2817188376*a+.6299787005*o),u=.2104542553*s+.793617785*c-.0040720468*l,d=1.9779984951*s-2.428592205*c+.4505937099*l,f=.0259040371*s+.7827717662*c-.808675766*l,p=Math.atan2(f,d)*180/Math.PI;return{l:u,c:Math.hypot(d,f),h:(p+360)%360}},q_=({l:e,c:t,h:n})=>{let r=n*Math.PI/180,i=t*Math.cos(r),a=t*Math.sin(r),o=(e+.3963377774*i+.2158037573*a)**3,s=(e-.1055613458*i-.0638541728*a)**3,c=(e-.0894841775*i-1.291485548*a)**3;return[4.0767416621*o-3.3077115913*s+.2309699292*c,-1.2684380046*o+2.6097574011*s-.3413193965*c,-.0041960863*o-.7034186147*s+1.707614701*c]},J_=e=>q_(e).every(e=>e>=-1e-4&&e<=1.0001),Y_=e=>{let t=e.c;for(;t>0&&!J_(Object.assign(Object.assign({},e),{c:t}));)t-=.002;let[n,r,i]=q_(Object.assign(Object.assign({},e),{c:Math.max(0,t)}));return ir({r:G_(n),g:G_(r),b:G_(i),a:1})},X_={primaryColor:`#101828`,lightColor:`#f9fafb`},Z_={light:{fallbackBackgroundColor:`#FFF`,gradient:{primaryAlpha:.7,lightAlpha:.3,lightStop:`50%`}},dark:{fallbackBackgroundColor:`#000`,gradient:{primaryAlpha:.4,lightAlpha:.02,lightStop:`80%`}}},Q_=(e,t)=>ir(or(e,.8,t,.2)),$_=(e,t)=>{let{red:n,green:r,blue:i}=tr(e);return`rgba(${n}, ${r}, ${i}, ${t})`},ev=e=>{let{red:t,green:n,blue:r}=tr(e);return(t*2126+n*7152+r*722)/1e4>=128},tv=e=>{let t=e.appearance?.toLowerCase();return t===`light`||t===`dark`?t:e.primaryColor&&ev(e.primaryColor)?`light`:`dark`},nv=({primaryColor:e,lightColor:t})=>e&&t?{primaryColor:e,lightColor:t}:e?{primaryColor:e,lightColor:Q_(`#FFFFFF`,e)}:t?{primaryColor:Q_(`#000000`,t),lightColor:t}:X_,rv=(e,{primaryColor:t,lightColor:n})=>{let{primaryAlpha:r,lightAlpha:i,lightStop:a}=Z_[e].gradient;return`radial-gradient(circle at 1200px 800px, ${[`${$_(t,r)} 0%`,`${$_(n,i)} ${a}`,`${$_(n,.004)} 85%`].join(`, `)})`},iv=(e,t)=>{let n=tv(e),r=nv(e),i=(n===`light`?e.backgroundLight:e.backgroundDark)||Z_[n].fallbackBackgroundColor,a=t?{type:`image`,url:t}:{type:`gradient`,css:rv(n,r)};return Object.assign(Object.assign({appearance:n},r),{backgroundColor:i,background:a})},av=`#FFFFFF`,ov={light:`#FFFFFF`,dark:`#111111`},sv={lightness:.24,maxChroma:.03},cv={light:{line:{lightnessStep:-.14,maxChroma:.03},panelBorder:{lightnessStep:-.1,maxChroma:.04}},dark:{line:{lightnessStep:.12,maxChroma:.03},panelBorder:{lightnessStep:.08,maxChroma:.03}}},lv={lightness:.58,maxChroma:.16},uv={start:.01,end:.04},dv={light:`rgba(255, 255, 255, 0.7)`,dark:`rgba(0, 0, 0, 0.35)`},fv=(e,t,n)=>ir(or(e,1,t,n)),pv=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},mv=e=>{let{red:t,green:n,blue:r}=tr(e);return .2126*pv(t)+.7152*pv(n)+.0722*pv(r)},hv=(e,t)=>{let[n,r]=[mv(e),mv(t)];return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},gv=e=>(e.surface??`brand`)===`brand`,_v=(e,{lightness:t,maxChroma:n})=>{let{c:r,h:i}=K_(e);return Y_({l:t,c:Math.min(r,n),h:i})},vv=(e,t,{lightnessStep:n,maxChroma:r})=>_v(t,{lightness:K_(e).l+n,maxChroma:r}),yv=e=>{let{primaryColor:t,lightColor:n}=nv(e),r=K_(t).c,i=_v(n,lv);if(r<=uv.start)return i;let a=_v(t,lv);if(r>=uv.end)return a;let o=(r-uv.start)/(uv.end-uv.start),s=o**2*(3-2*o),c=K_(a),l=K_(i),u=c.h*Math.PI/180,d=l.h*Math.PI/180,f=l.c*Math.cos(d)*(1-s)+c.c*Math.cos(u)*s,p=l.c*Math.sin(d)*(1-s)+c.c*Math.sin(u)*s;return Y_({l:lv.lightness,c:Math.hypot(f,p),h:Math.atan2(p,f)*180/Math.PI})},bv=e=>hv(av,e)>=3?av:`#1A1A1A`,xv=(e,t)=>{let n=t===`light`?e.backgroundLight:e.backgroundDark,r=cr(e.lightColor)[t];return n&&n.toLowerCase()!==r.toLowerCase()?n:void 0},Sv=(e,t,n)=>gv(e)?xv(e,t)||(t===`light`?av:_v(n,sv)):(t===`light`?e.backgroundLight:e.backgroundDark)||ov[t],Cv=(e,t,n,r,i)=>{if(e.eyebrowColor)return e.eyebrowColor;let{primaryColor:a,lightColor:o}=nv(e),s=t===`light`?a:o;return hv(s,n)<2||i&&hv(s,fv(n,i.color,S_[t]))<2?r:s},wv=(e,t,n,r)=>{if(!gv(e))return{line:fv(n,r,r===av?.15:.2),panel:fv(n,r,.06),panelBorder:null,glow:null};let{primaryColor:i}=nv(e),a=cv[t];return{line:vv(n,i,a.line),panel:dv[t],panelBorder:vv(n,i,a.panelBorder),glow:{color:yv(e),appearance:t}}},Tv=e=>{let t=tv(e),n=Sv(e,t,nv(e).primaryColor),r=bv(n),i=wv(e,t,n,r),a=Cv(e,t,n,r,i.glow);return Object.assign(Object.assign({background:n},i),{title:r,description:fv(r,n,.22),eyebrow:a,badge:a,badgeText:bv(a)})},Ev=(e,t)=>t===`legacy`?tv(e):Tv(e).title===av?`dark`:`light`,Dv=`Inter var, sans-serif`,Ov=e=>e===`Inter`?Dv:`${e}, ${Dv}`,kv={width:1e3,size:72},Av=`${kv.width}px`,jv={light:{title:`#111827`,description:`rgba(0, 0, 0, 0.7)`},dark:{title:`#f9fafb`,description:`rgba(255, 255, 255, 0.7)`}},Mv={frame:{position:`relative`,display:`flex`,width:`100%`,height:`100%`,padding:`72px 68px`},content:{position:`relative`,display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`,marginRight:`-128px`},spacer:{display:`flex`,marginTop:`auto`,marginBottom:`auto`},text:{display:`flex`,flexDirection:`column`},eyebrow:{marginLeft:`4px`,fontSize:`30px`,lineHeight:`36px`,letterSpacing:`0.03rem`},eyebrowText:{display:`block`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,maxWidth:Av},title:{display:`block`,width:Av,overflow:`hidden`,lineClamp:2,marginTop:`12px`,fontSize:`${kv.size}px`,fontWeight:600,lineHeight:1.15,letterSpacing:`-0.025em`},description:{display:`block`,width:`750px`,overflow:`hidden`,lineClamp:2,marginTop:`24px`,fontSize:`30px`,lineHeight:1.625}},Nv=e=>e.type===`image`?{backgroundImage:`url(${e.url})`,backgroundSize:`100% 100%`}:{backgroundImage:e.css},Pv=({content:e,theme:t,logo:n,fontFamily:r})=>{let{eyebrow:i,title:a,description:o}=e,s=jv[t.appearance],c=t.appearance===`light`?t.primaryColor:t.lightColor,l=!a?.trim().includes(` `);return(0,P.jsx)(`div`,{style:Object.assign(Object.assign(Object.assign({},Mv.frame),{backgroundColor:t.backgroundColor,fontFamily:Ov(r)}),Nv(t.background)),children:(0,P.jsxs)(`div`,{style:Mv.content,children:[n&&(0,P.jsx)(`img`,{src:n.src,alt:`Logo`,style:Object.assign({height:`56px`},n.style)}),(0,P.jsx)(`div`,{style:Mv.spacer}),(0,P.jsxs)(`div`,{style:Mv.text,children:[(0,P.jsx)(`span`,{style:Object.assign(Object.assign({},Mv.eyebrow),{color:c}),children:(0,P.jsx)(`span`,{style:Mv.eyebrowText,children:i})}),a&&(0,P.jsx)(`span`,{style:Object.assign(Object.assign(Object.assign({},Mv.title),{color:s.title}),l&&{wordBreak:`break-word`}),children:a}),o&&(0,P.jsx)(`span`,{style:Object.assign(Object.assign({},Mv.description),{color:s.description}),children:o})]})]})})},Fv={classic:{light:{angle:200,stops:[[.3,0],[.14,35],[0,85]]},dark:{angle:192,stops:[[.48,0],[.16,35],[0,85]]}},headline:{light:{angle:351,stops:[[.3,0],[.15,35],[0,85]]},dark:{angle:350,stops:[[.5,0],[.17,35],[0,85]]}},minimal:{light:{angle:357,stops:[[S_.light,0],[.16,35],[0,85]]},dark:{angle:352,stops:[[S_.dark,0],[.17,35],[0,85]]}}},Iv=(e,t)=>t.glow?Object.assign({color:t.glow.color},Fv[e][t.glow.appearance]):null,Lv=e=>{if(!e)return;let t=e.stops.map(([t,n])=>`${$_(e.color,t)} ${n}%`);return`linear-gradient(${e.angle}deg, ${t.join(`, `)})`},Rv=1.5,zv=.03,Bv=e=>{let t=mv(e);return(t+.05)/.05>1.05/(t+.05)?`darker`:`lighter`},Vv=(e,t=Bv(e))=>{let n=K_(e),r=mv(e),i=t===`lighter`?Rv*(r+.05)-.05:(r+.05)/Rv-.05,a=0,o=1;for(let e=0;e<24;e++){let e=(a+o)/2,t=Y_({l:e,c:Math.min(n.c,zv),h:n.h});mv(t)<i?a=e:o=e}return Y_({l:(a+o)/2,c:Math.min(n.c,zv),h:n.h})},Hv=(e,t)=>{let n=e.stops[0];if(!n)return 0;if(t<=n[1])return n[0];for(let n=1;n<e.stops.length;n++){let r=e.stops[n-1],i=e.stops[n];if(!r||!i||t>i[1])continue;let a=(t-r[1])/(i[1]-r[1]);return r[0]+(i[0]-r[0])*a}return e.stops.at(-1)?.[0]??0},Uv=(e,t,n=Bv(e))=>t?Array.from({length:17},(r,i)=>{let a=i*100/16,o=ir(or(e,1,t.color,Hv(t,a)));return{position:a,color:Vv(o,n)}}):[{position:0,color:Vv(e,n)}],Wv={top:231.482,bottom:565.189},Gv={left:62.938,width:1074.12,dividers:Object.values(Wv)},Kv=({palette:e,glow:t,backgroundImageUrl:n})=>{if(n)return null;let r=e.title===`#FFFFFF`?`lighter`:`darker`,i=Uv(e.background,t,r),a=(t?.angle??0)*Math.PI/180,o=Math.sin(a),s=-Math.cos(a),c=b_*Math.abs(o)+630*Math.abs(s),l=Math.round(Gv.left),u=Math.round(Gv.width);return(0,P.jsxs)(`svg`,{width:b_,height:630,viewBox:`0 0 ${b_} 630`,style:{position:`absolute`,left:0,top:0},children:[(0,P.jsx)(`defs`,{children:(0,P.jsx)(`linearGradient`,{id:`classic-frame-gradient`,gradientUnits:`userSpaceOnUse`,x1:(b_-o*c)/2,y1:(630-s*c)/2,x2:(b_+o*c)/2,y2:(630+s*c)/2,children:i.map(({position:e,color:t})=>(0,P.jsx)(`stop`,{offset:`${e}%`,stopColor:t},e))})}),(0,P.jsx)(`rect`,{x:l,y:0,width:1,height:630,fill:`url(#classic-frame-gradient)`}),(0,P.jsx)(`rect`,{x:l+u-1,y:0,width:1,height:630,fill:`url(#classic-frame-gradient)`}),Gv.dividers.map(e=>(0,P.jsx)(`rect`,{x:l+1,y:Math.round(e),width:u-2,height:1,fill:`url(#classic-frame-gradient)`},e))]})},qv={left:89.386,top:435.728,width:1021.23,radius:48},Jv={height:56,topLeft:{left:89.649,top:82.788},bottomRight:{bottom:80.924,right:86},bottomCenter:{bottom:56.924}},Yv={classic:{align:`start`,contentLeft:89.649,contentTop:264,contentBounds:Wv,eyebrowGap:22.741,textGap:32,titleSize:77.868,titleWidth:951.652,descriptionWidth:716,eyebrowSize:25.17,eyebrowLineHeight:37.755,logo:`top-left`,frame:!0,panel:!1,textLines:3},headline:{align:`start`,contentLeft:106,contentTop:88.117,contentBounds:{top:0,bottom:630-Jv.bottomRight.bottom-Jv.height},eyebrowGap:52,textGap:32,titleSize:77.868,titleWidth:716,descriptionWidth:716,eyebrowSize:25.17,eyebrowLineHeight:37.755,logo:`bottom-right`,frame:!1,panel:!1,textLines:4},minimal:{align:`center`,contentLeft:0,contentTop:81.032,contentBounds:{top:0,bottom:qv.top},eyebrowGap:52,textGap:28,titleSize:70,titleWidth:836,descriptionWidth:637.886,eyebrowSize:29.155,eyebrowLineHeight:43.732,logo:`bottom-center`,frame:!1,panel:!0,textLines:3}},Xv=e=>({width:Yv[e].titleWidth,size:Yv[e].titleSize}),Zv={border:2,padding:25.229},Qv={paddingBlock:5.5,paddingInline:15},$v=-.02,ey={size:33.288,lineHeight:43.274},ty=e=>`${e*$v}px`,ny=e=>{let t={position:`absolute`,display:`flex`,alignItems:`center`,height:`${Jv.height}px`};return e===`top-left`?Object.assign(Object.assign({},t),{left:`${Jv.topLeft.left}px`,top:`${Jv.topLeft.top}px`}):e===`bottom-right`?Object.assign(Object.assign({},t),{right:`${Jv.bottomRight.right}px`,bottom:`${Jv.bottomRight.bottom}px`}):Object.assign(Object.assign({},t),{left:0,width:`100%`,justifyContent:`center`,bottom:`${Jv.bottomCenter.bottom}px`})},ry=({lines:e,box:t,lineHeight:n,align:r,style:i})=>(0,P.jsx)(`div`,{style:Object.assign(Object.assign({},i),{display:`flex`,flexDirection:`column`,alignItems:r===`center`?`center`:`flex-start`,width:`${t.width}px`,fontSize:`${t.fontSize}px`,fontWeight:t.fontWeight,lineHeight:`${n}px`,letterSpacing:`${t.letterSpacing}px`}),children:e.map((e,t)=>(0,P.jsx)(`span`,{style:{whiteSpace:`nowrap`},children:e},t))}),iy=({logo:e})=>(0,P.jsx)(`div`,{style:{position:`relative`,display:`flex`,width:`${e.width}px`,height:`${e.height}px`,overflow:`hidden`},children:(0,P.jsx)(`img`,{src:e.src,alt:``,width:e.image.width,height:e.image.height,style:{position:`absolute`,left:`${e.image.left}px`,top:`${e.image.top}px`}})}),ay=({text:e,style:t,palette:n,settings:r})=>{let i={fontFamily:`Paper Mono`,fontSize:`${r.eyebrowSize}px`,lineHeight:`${r.eyebrowLineHeight}px`,letterSpacing:ty(r.eyebrowSize),textTransform:`uppercase`,whiteSpace:`nowrap`,display:`block`,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:`${r.titleWidth}px`};return t===`pill`?(0,P.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,padding:`${Qv.paddingBlock}px ${Qv.paddingInline}px`,backgroundColor:n.badge},children:(0,P.jsx)(`span`,{style:Object.assign(Object.assign({},i),{color:n.badgeText}),children:e})}):t===`bar`?(0,P.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,marginLeft:`${-(Zv.border+Zv.padding)}px`,paddingLeft:`${Zv.padding}px`,borderLeft:`${Zv.border}px solid ${n.eyebrow}`},children:(0,P.jsx)(`span`,{style:Object.assign(Object.assign({},i),{color:n.eyebrow}),children:e})}):(0,P.jsx)(`span`,{style:Object.assign(Object.assign({},i),{color:n.eyebrow}),children:e})},oy=({preset:e,content:t,palette:n,backgroundImageUrl:r,eyebrowStyle:i,logo:a,fontFamily:o,fitText:s})=>{let c=Yv[e],{eyebrow:l,title:u,description:d}=t,f=c.align===`center`,p={fontSize:c.titleSize,fontWeight:500,letterSpacing:c.titleSize*$v,width:c.titleWidth,maxLines:2},m=u?s(u,p):[],h={fontSize:ey.size,fontWeight:400,letterSpacing:ey.size*$v,width:c.descriptionWidth,maxLines:Math.min(2,c.textLines-m.length)},g=d?s(d,h):[],_=m.length>0&&g.length>0?c.textGap:0,v=m.length*c.titleSize+g.length*ey.lineHeight+_,y=l?c.contentTop:Math.max(c.contentTop,(c.contentBounds.top+c.contentBounds.bottom-v)/2),b=Iv(e,n),x=Lv(b),S=e===`classic`&&r&&i===`bar`?`plain`:i;return(0,P.jsxs)(`div`,{style:Object.assign(Object.assign({position:`relative`,display:`flex`,width:`${b_}px`,height:`630px`,backgroundColor:n.background},r?{backgroundImage:`url(${r})`,backgroundSize:`100% 100%`}:x&&{backgroundImage:x}),{fontFamily:Ov(o)}),children:[c.frame&&(0,P.jsx)(Kv,{palette:n,glow:b,backgroundImageUrl:r}),c.panel&&(0,P.jsx)(`div`,{style:Object.assign({position:`absolute`,left:`${qv.left}px`,top:`${qv.top}px`,width:`${qv.width}px`,height:`${630-qv.top}px`,backgroundColor:n.panel,borderTopLeftRadius:`${qv.radius}px`,borderTopRightRadius:`${qv.radius}px`},n.panelBorder&&{borderTop:`1px solid ${n.panelBorder}`,borderLeft:`1px solid ${n.panelBorder}`,borderRight:`1px solid ${n.panelBorder}`})}),a&&(0,P.jsx)(`div`,{style:ny(c.logo),children:(0,P.jsx)(iy,{logo:a})}),(0,P.jsxs)(`div`,{style:Object.assign(Object.assign({position:`absolute`,top:`${y}px`,left:`${c.contentLeft}px`},f&&{width:`1200px`}),{display:`flex`,flexDirection:`column`,alignItems:f?`center`:`flex-start`}),children:[l&&(0,P.jsx)(ay,{text:l,style:S,palette:n,settings:c}),(0,P.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:f?`center`:`flex-start`,marginTop:l?`${c.eyebrowGap}px`:0},children:[m.length>0&&(0,P.jsx)(ry,{lines:m,box:p,lineHeight:c.titleSize,align:c.align,style:{color:n.title}}),g.length>0&&(0,P.jsx)(ry,{lines:g,box:h,lineHeight:ey.lineHeight,align:c.align,style:{color:n.description,marginTop:m.length>0?`${c.textGap}px`:0}})]})]})]})},sy={classic:`bar`,headline:`pill`,minimal:`plain`},cy=e=>e===`legacy`?kv:Xv(e);var ly,uy=Array(128).fill(void 0);uy.push(void 0,null,!0,!1);var dy=uy.length;function fy(e){dy===uy.length&&uy.push(uy.length+1);let t=dy;return dy=uy[t],uy[t]=e,t}function py(e){return uy[e]}function my(e){e<132||(uy[e]=dy,dy=e)}function hy(e){let t=py(e);return my(e),t}var gy=0,_y=null;function vy(){return(_y===null||_y.byteLength===0)&&(_y=new Uint8Array(ly.memory.buffer)),_y}var yy=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},by=typeof yy.encodeInto==`function`?function(e,t){return yy.encodeInto(e,t)}:function(e,t){let n=yy.encode(e);return t.set(n),{read:e.length,written:n.length}};function xy(e,t,n){if(n===void 0){let n=yy.encode(e),r=t(n.length,1)>>>0;return vy().subarray(r,r+n.length).set(n),gy=n.length,r}let r=e.length,i=t(r,1)>>>0,a=vy(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=vy().subarray(i+o,i+r),a=by(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return gy=o,i}function Sy(e){return e==null}var Cy=null;function wy(){return(Cy===null||Cy.byteLength===0)&&(Cy=new Int32Array(ly.memory.buffer)),Cy}var Ty=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&Ty.decode();function Ey(e,t){return e>>>=0,Ty.decode(vy().subarray(e,e+t))}function Dy(e,t){if(!(e instanceof t))throw Error(`expected instance of ${t.name}`);return e.ptr}function Oy(e,t){try{return e.apply(this,t)}catch(e){ly.__wbindgen_exn_store(fy(e))}}var ky=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ly.__wbg_bbox_free(e>>>0)),Ay=class e{static __wrap(t){t>>>=0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,ky.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ky.unregister(this),e}free(){let e=this.__destroy_into_raw();ly.__wbg_bbox_free(e)}get x(){return ly.__wbg_get_bbox_x(this.__wbg_ptr)}set x(e){ly.__wbg_set_bbox_x(this.__wbg_ptr,e)}get y(){return ly.__wbg_get_bbox_y(this.__wbg_ptr)}set y(e){ly.__wbg_set_bbox_y(this.__wbg_ptr,e)}get width(){return ly.__wbg_get_bbox_width(this.__wbg_ptr)}set width(e){ly.__wbg_set_bbox_width(this.__wbg_ptr,e)}get height(){return ly.__wbg_get_bbox_height(this.__wbg_ptr)}set height(e){ly.__wbg_set_bbox_height(this.__wbg_ptr,e)}},jy=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ly.__wbg_renderedimage_free(e>>>0)),My=class e{static __wrap(t){t>>>=0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,jy.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,jy.unregister(this),e}free(){let e=this.__destroy_into_raw();ly.__wbg_renderedimage_free(e)}get width(){return ly.renderedimage_width(this.__wbg_ptr)>>>0}get height(){return ly.renderedimage_height(this.__wbg_ptr)>>>0}asPng(){try{let n=ly.__wbindgen_add_to_stack_pointer(-16);ly.renderedimage_asPng(n,this.__wbg_ptr);var e=wy()[n/4+0],t=wy()[n/4+1];if(wy()[n/4+2])throw hy(t);return hy(e)}finally{ly.__wbindgen_add_to_stack_pointer(16)}}get pixels(){return hy(ly.renderedimage_pixels(this.__wbg_ptr))}},Ny=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>ly.__wbg_resvg_free(e>>>0)),Py=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,Ny.unregister(this),e}free(){let e=this.__destroy_into_raw();ly.__wbg_resvg_free(e)}constructor(e,t,n){try{let s=ly.__wbindgen_add_to_stack_pointer(-16);var r=Sy(t)?0:xy(t,ly.__wbindgen_malloc,ly.__wbindgen_realloc),i=gy;ly.resvg_new(s,fy(e),r,i,Sy(n)?0:fy(n));var a=wy()[s/4+0],o=wy()[s/4+1];if(wy()[s/4+2])throw hy(o);return this.__wbg_ptr=a>>>0,this}finally{ly.__wbindgen_add_to_stack_pointer(16)}}get width(){return ly.resvg_width(this.__wbg_ptr)}get height(){return ly.resvg_height(this.__wbg_ptr)}render(){try{let n=ly.__wbindgen_add_to_stack_pointer(-16);ly.resvg_render(n,this.__wbg_ptr);var e=wy()[n/4+0],t=wy()[n/4+1];if(wy()[n/4+2])throw hy(t);return My.__wrap(e)}finally{ly.__wbindgen_add_to_stack_pointer(16)}}toString(){let e,t;try{let i=ly.__wbindgen_add_to_stack_pointer(-16);ly.resvg_toString(i,this.__wbg_ptr);var n=wy()[i/4+0],r=wy()[i/4+1];return e=n,t=r,Ey(n,r)}finally{ly.__wbindgen_add_to_stack_pointer(16),ly.__wbindgen_free(e,t,1)}}innerBBox(){let e=ly.resvg_innerBBox(this.__wbg_ptr);return e===0?void 0:Ay.__wrap(e)}getBBox(){let e=ly.resvg_getBBox(this.__wbg_ptr);return e===0?void 0:Ay.__wrap(e)}cropByBBox(e){Dy(e,Ay),ly.resvg_cropByBBox(this.__wbg_ptr,e.__wbg_ptr)}imagesToResolve(){try{let n=ly.__wbindgen_add_to_stack_pointer(-16);ly.resvg_imagesToResolve(n,this.__wbg_ptr);var e=wy()[n/4+0],t=wy()[n/4+1];if(wy()[n/4+2])throw hy(t);return hy(e)}finally{ly.__wbindgen_add_to_stack_pointer(16)}}resolveImage(e,t){try{let r=ly.__wbindgen_add_to_stack_pointer(-16),i=xy(e,ly.__wbindgen_malloc,ly.__wbindgen_realloc),a=gy;ly.resvg_resolveImage(r,this.__wbg_ptr,i,a,fy(t));var n=wy()[r/4+0];if(wy()[r/4+1])throw hy(n)}finally{ly.__wbindgen_add_to_stack_pointer(16)}}};async function Fy(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.headers.get(`Content-Type`)!=`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function Iy(){let e={};return e.wbg={},e.wbg.__wbg_new_28c511d9baebfa89=function(e,t){return fy(Error(Ey(e,t)))},e.wbg.__wbindgen_memory=function(){let e=ly.memory;return fy(e)},e.wbg.__wbg_buffer_12d079cc21e14bdb=function(e){let t=py(e).buffer;return fy(t)},e.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb=function(e,t,n){return fy(new Uint8Array(py(e),t>>>0,n>>>0))},e.wbg.__wbindgen_object_drop_ref=function(e){hy(e)},e.wbg.__wbg_new_63b92bc8671ed464=function(e){return fy(new Uint8Array(py(e)))},e.wbg.__wbg_values_839f3396d5aac002=function(e){return fy(py(e).values())},e.wbg.__wbg_next_196c84450b364254=function(){return Oy(function(e){return fy(py(e).next())},arguments)},e.wbg.__wbg_done_298b57d23c0fc80c=function(e){return py(e).done},e.wbg.__wbg_value_d93c65011f51a456=function(e){let t=py(e).value;return fy(t)},e.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6=function(e){let t;try{t=py(e)instanceof Uint8Array}catch{t=!1}return t},e.wbg.__wbindgen_string_get=function(e,t){let n=py(t),r=typeof n==`string`?n:void 0;var i=Sy(r)?0:xy(r,ly.__wbindgen_malloc,ly.__wbindgen_realloc),a=gy;wy()[e/4+1]=a,wy()[e/4+0]=i},e.wbg.__wbg_new_16b304a2cfa7ff4a=function(){return fy([])},e.wbg.__wbindgen_string_new=function(e,t){return fy(Ey(e,t))},e.wbg.__wbg_push_a5b05aedc7234f9f=function(e,t){return py(e).push(py(t))},e.wbg.__wbg_length_c20a40f15020d68a=function(e){return py(e).length},e.wbg.__wbg_set_a47bac70306a19a7=function(e,t,n){py(e).set(py(t),n>>>0)},e.wbg.__wbindgen_throw=function(e,t){throw Error(Ey(e,t))},e}function Ly(e,t){return ly=e.exports,Ry.__wbindgen_wasm_module=t,Cy=null,_y=null,ly}async function Ry(e){if(ly!==void 0)return ly;e===void 0&&(e=new URL(`index_bg.wasm`,void 0));let t=Iy();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await Fy(await e,t);return Ly(n,r)}var zy=Ry,By=!1,Vy=async e=>{if(By)throw Error("Already initialized. The `initWasm()` function can be used only once.");await zy(await e),By=!0},Hy=class extends Py{constructor(e,t){if(!By)throw Error("Wasm has not been initialized. Call `initWasm()` function.");let n=t?.font;if(n&&Uy(n)){let r={...t,font:{...n,fontBuffers:void 0}};super(e,JSON.stringify(r),n.fontBuffers)}else super(e,JSON.stringify(t))}};function Uy(e){return Object.prototype.hasOwnProperty.call(e,`fontBuffers`)}var Wy=/* @__PURE__ */ n(((e,t)=>{function n(){this.table=/* @__PURE__ */ new Uint16Array(16),this.trans=/* @__PURE__ */ new Uint16Array(288)}function r(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new n,this.dtree=new n}var i=new n,a=new n,o=/* @__PURE__ */ new Uint8Array(30),s=/* @__PURE__ */ new Uint16Array(30),c=/* @__PURE__ */ new Uint8Array(30),l=/* @__PURE__ */ new Uint16Array(30),u=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new n,f=/* @__PURE__ */ new Uint8Array(320);function p(e,t,n,r){for(var i=0,a;i<n;++i)e[i]=0;for(i=0;i<30-n;++i)e[i+n]=i/n|0;for(a=r,i=0;i<30;++i)t[i]=a,a+=1<<e[i]}function m(e,t){for(var n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}var h=/* @__PURE__ */ new Uint16Array(16);function g(e,t,n,r){for(var i=0,a;i<16;++i)e.table[i]=0;for(i=0;i<r;++i)e.table[t[n+i]]++;for(e.table[0]=0,a=0,i=0;i<16;++i)h[i]=a,a+=e.table[i];for(i=0;i<r;++i)t[n+i]&&(e.trans[h[t[n+i]]++]=i)}function _(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=e.tag&1;return e.tag>>>=1,t}function v(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var r=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,r+n}function y(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=0,r=0,i=0,a=e.tag;do r=2*r+(a&1),a>>>=1,++i,n+=t.table[i],r-=t.table[i];while(r>=0);return e.tag=a,e.bitcount-=i,t.trans[n+r]}function b(e,t,n){for(var r=v(e,5,257),i=v(e,5,1),a=v(e,4,4),o=0,s,c;o<19;++o)f[o]=0;for(o=0;o<a;++o){var l=v(e,3,0);f[u[o]]=l}for(g(d,f,0,19),s=0;s<r+i;){var p=y(e,d);switch(p){case 16:var m=f[s-1];for(c=v(e,2,3);c;--c)f[s++]=m;break;case 17:for(c=v(e,3,3);c;--c)f[s++]=0;break;case 18:for(c=v(e,7,11);c;--c)f[s++]=0;break;default:f[s++]=p}}g(t,f,0,r),g(n,f,r,i)}function x(e,t,n){for(;;){var r=y(e,t);if(r===256)return 0;if(r<256)e.dest[e.destLen++]=r;else{var i,a,u,d;for(r-=257,i=v(e,o[r],s[r]),a=y(e,n),u=e.destLen-v(e,c[a],l[a]),d=u;d<u+i;++d)e.dest[e.destLen++]=e.dest[d]}}}function S(e){for(var t,n,r;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(t=e.source[e.sourceIndex+1],t=256*t+e.source[e.sourceIndex],n=e.source[e.sourceIndex+3],n=256*n+e.source[e.sourceIndex+2],t!==(~n&65535))return-3;for(e.sourceIndex+=4,r=t;r;--r)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,0}function C(e,t){var n=new r(e,t),o,s,c;do{switch(o=_(n),s=v(n,2,0),s){case 0:c=S(n);break;case 1:c=x(n,i,a);break;case 2:b(n,n.ltree,n.dtree),c=x(n,n.ltree,n.dtree);break;default:c=-3}if(c!==0)throw Error(`Data error`)}while(!o);return n.destLen<n.dest.length?typeof n.dest.slice==`function`?n.dest.slice(0,n.destLen):n.dest.subarray(0,n.destLen):n.dest}m(i,a),p(o,s,4,3),p(c,l,2,1),o[28]=0,s[28]=258,t.exports=C})),Gy=/* @__PURE__ */ n(((e,t)=>{let n=new Uint8Array(new Uint32Array([305419896]).buffer)[0]===18,r=(e,t,n)=>{let r=e[t];e[t]=e[n],e[n]=r},i=e=>{let t=e.length;for(let n=0;n<t;n+=4)r(e,n,n+3),r(e,n+1,n+2)};t.exports={swap32LE:e=>{n&&i(e)}}})),Ky=/* @__PURE__ */ n(((e,t)=>{let n=Wy(),{swap32LE:r}=Gy();t.exports=class{constructor(e){let t=typeof e.readUInt32BE==`function`&&typeof e.slice==`function`;if(t||e instanceof Uint8Array){let i;if(t)this.highStart=e.readUInt32LE(0),this.errorValue=e.readUInt32LE(4),i=e.readUInt32LE(8),e=e.slice(12);else{let t=new DataView(e.buffer);this.highStart=t.getUint32(0,!0),this.errorValue=t.getUint32(4,!0),i=t.getUint32(8,!0),e=e.subarray(12)}e=n(e,new Uint8Array(i)),e=n(e,new Uint8Array(i)),r(e),this.data=new Uint32Array(e.buffer)}else({data:this.data,highStart:this.highStart,errorValue:this.errorValue}=e)}get(e){let t;return e<0||e>1114111?this.errorValue:e<55296||e>56319&&e<=65535?(t=(this.data[e>>5]<<2)+(e&31),this.data[t]):e<=65535?(t=(this.data[2048+(e-55296>>5)]<<2)+(e&31),this.data[t]):e<this.highStart?(t=this.data[2080+(e>>11)],t=this.data[t+(e>>5&63)],t=(t<<2)+(e&31),this.data[t]):this.data[this.data.length-4]}}})),qy=/* @__PURE__ */ n(((e,t,n)=>{(function(e){var t=typeof Uint8Array<`u`?Uint8Array:Array,n=43,r=47,i=48,a=97,o=65,s=45,c=95;function l(e){var t=e.charCodeAt(0);if(t===n||t===s)return 62;if(t===r||t===c)return 63;if(t<i)return-1;if(t<i+10)return t-i+26+26;if(t<o+26)return t-o;if(t<a+26)return t-a+26}function u(e){var n,r,i,a,o,s;if(e.length%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var c=e.length;o=e.charAt(c-2)===`=`?2:+(e.charAt(c-1)===`=`),s=new t(e.length*3/4-o),i=o>0?e.length-4:e.length;var u=0;function d(e){s[u++]=e}for(n=0,r=0;n<i;n+=4,r+=3)a=l(e.charAt(n))<<18|l(e.charAt(n+1))<<12|l(e.charAt(n+2))<<6|l(e.charAt(n+3)),d((a&16711680)>>16),d((a&65280)>>8),d(a&255);return o===2?(a=l(e.charAt(n))<<2|l(e.charAt(n+1))>>4,d(a&255)):o===1&&(a=l(e.charAt(n))<<10|l(e.charAt(n+1))<<4|l(e.charAt(n+2))>>2,d(a>>8&255),d(a&255)),s}function d(e){var t,n=e.length%3,r=``,i,a;function o(e){return`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.charAt(e)}function s(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,a=e.length-n;t<a;t+=3)i=(e[t]<<16)+(e[t+1]<<8)+e[t+2],r+=s(i);switch(n){case 1:i=e[e.length-1],r+=o(i>>2),r+=o(i<<4&63),r+=`==`;break;case 2:i=(e[e.length-2]<<8)+e[e.length-1],r+=o(i>>10),r+=o(i>>4&63),r+=o(i<<2&63),r+=`=`}return r}e.toByteArray=u,e.fromByteArray=d})(e===void 0?n.base64js={}:e)})),Jy=/* @__PURE__ */ t(be(),1),Yy=/* @__PURE__ */ t(Ky(),1),Xy=/* @__PURE__ */ t(qy(),1),Zy={};const Qy=[[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,4,4,4,4,4,4,4,4,4,4,4],[0,4,4,1,1,4,4,4,4,1,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,4,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[4,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,1],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,1,0,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,1,1,1,1,0,0,4,2,4,1,1,1,1,1,0,1,1,1,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,0,1,4,4,4,0,0,1,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,0,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,4,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,1,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,1,1,1,1,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,1,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,1,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,1,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,1,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0],[0,4,4,1,1,0,4,4,4,0,0,0,0,0,0,0,0,0,0,0,4,2,4,0,0,0,0,0,0,0,0,1,0]],$y=Xy.default.toByteArray(`AAgOAAAAAAAQ4QAAAQ0P8vDtnQuMXUUZx+eyu7d7797d9m5bHoWltKVUlsjLWE0VJNigQoMVqkStEoNQQUl5GIo1KKmogEgqkKbBRki72lYabZMGKoGAjQRtJJDaCCIRiiigREBQS3z+xzOTnZ3O+3HOhd5NfpkzZx7fN9988zivu2M9hGwB28F94DnwEngd/Asc1EtIs9c/bIPDwCxwLDgezHcodyo4w5C+CCwBS8FnwSXgCnA1uFbI93XwbXAbWAfWgx+CzWAb+An4KfgFeAzsYWWfYuFz4CXwGvgb+Dfo6yNkEEwGh4CZYB44FpwI3g1OY+kfBItZOo2fB84Hy8DF4HJwNbiWpV8PVoO1LH4n2NRXyN+KcAd4kNVP9XsY4aPgcfAbsBfs6SniL4K/sPjfEf6HlanXCRkCw2BGvUh/keWfXS/CY+pFXs7x9XHmM94LTmWIeU2cgbxnS/k/B3kf86jDhU8L9V2E40vAFWAlWFUfb++NOL4F3C7JX4/4GiE+hvgWsF0oS7mXldspnN+F493gyXrh9xTav0cg3EvzgVfBG6wsmVSEkxBOBgdPGpd7JI6PnqRvJ68/xlbHof53gPeA94OzwLngk+ACsAwsByvASrAK3MB0Ws3CtQjvBJvAVrADPMDSHkb4CNijaccTwvnf4fiPEs8Lxy+D18A/QU8/xjgYBjPAbDAKTgYLwOngTHAO+EQ/8wuEF4EvsPiVCFf2+9tsFStzA8LVHuXXBsi6QyqzUYiPMR/7Mc7dAx7oL8bzw/3u/Bw8Bp4Az4AXwCtgHzsmDXP5fiF9iiVvly5d0sHngar16NKlS5cuXbp06fLmYlqHXrcd3ph4P0THUY3iXh49novju4S0tzfs5d+JPKewfAsRntZb3K9ZhOMlrO6lCC8An28U9+OuovcPcPxlVu5rCL/VmHh/iHIrzn3fIPu7SN8Axmg+8AOwEWwCm7tp3bRuWjetm5Y8bSu4B9zbKO6ZVsnORrVU3f4uXTqZ2H3sLoyx3eDXjfDndE9qyj6L838CfwVvgFpzYnof4oNgOhgBc8Fos9DrZIQLmtXPP1MmF6wGj4H+KXoWguvADkXaPil+YpuQy8Am8Ey7ODdtmJDF4HowBp4De6HDTNjhfHAHeBr0DBBy0kDxfPbcgSIusgrcWhtnJ8vL+TPix7UIOQtcBq4C28Cr4KRBnANbwSuDE+s50JgyNNFuXbp06XIgsXjIvPafjvXozKY+fVFz/z0LT1uCtKVSWbrOLWPnztG8e0Xfy7ol8XtZJi7WtG+5od2UFXQ/A12vUeS7jp27yVKHjdsU9lXB869TyNvAzt0lpP2oWbwLdjiO78bx/Sz+EMJHwK9Y/LcIfw+eZ3F67/Hl5vh9xX80J+rwX8SvRDhpgL17iPAQMHNArfPrqHPewLheI+AERV6efwV418B4nOZ/H+IfYHV8GOF5LJ3eAz0fx8sM9S0fUNud39O9CulfGZhY5huI3wzWgNvBelbHZoTbNPVpfYjKQpkHwUNgl0LWblbnk0LbbDxr0OMFpL3iqWdu9nWYPlVAWkXY39LnGdCkDbeqv1YNbfcMQ3t9oe8lzm6NH9N1ZB6Ln4BwfkJZJk7RyFnYKt6b/JDQXx9p5X+eFdqOjzM9P9MB/lUlFzr20aXIdzlY4dmn9F3YqtvoO76/2hp/D/xA5Zue88nNyL8GbFbs075X0tyUig3Qd2MCnf//HjnzpbsR3g9+1kHzzVjdnE71/qVBX9rGPUh/ysNWe1neFzvIDi5zAufV1sT0N0poR22wkFUfTOPfA4N2mbZ5fSrqOHSw+IbkSBbOGSzSRgf91/GTUWYBOB2cIZQ/G8cfBZ8CFwrnL8XxF8FKcA24jqXdiPA7Qr61OF7H4mMItwzuv2/YLth1ISt3Hzu3k4W7EH5JqPdRHD/O4k+z8A8IX5Lq3y7Z4nXE9xn6kX6vQ4bKfy+ok+hH+xf3hq9dnTTHhjKd2GmDuWA242iHMq4cC7A8kJ7i8o1+skSa7Jieo38HCWnoNjKFhdSFBxzpZ7QE6lI8N4S14aASZcryaV/WWHw66f6NHuCoxuQxmvM56GX9QMd8Q4D65ywGP+ZzRJuM+zQvx/MOS2VFeqQ4IXnH26zM9Xe6/E6D+4foAzzuajPZp8Qyw5ayZVDWuH0z0BtYRkeIDqH9KO9VbH1btd/lhNqCzvl8zeLnG0S/hnU6baHfpiuO6yy0rd+DHURo/zYF5H26j03rQsip2ndzz82u1z9N4VjWKWeb68Tedpt95HRVXp7H1R6p+/Wt4FPy/PpWwscOLRJ+PVWF/+W0iVyGzs18TIvXkOJ1Wxm66vSXz+vylenrZcj1ub439W+K8RNCGTJi2p/TJ1K23VaXr35tRpnzmjxequgfcfyk6B/TGBVlyedsNgpdd/h+W1U3P99QyFPNo1X3TwpM/WLTIWYfoBqXrv6iskHZ/RFr79R6hIyHBrH3f1nrUVnjP8SnZZ+rYtzr9Exld5MNbPNErusAPg+77u/eDOPftU9yj39TH7rezxd1LvsZQJlzkWlOirG/79zjMj/mtHUKu7vKy+3/LnXr9okyKedjX5/0He9iP/j63LwOQdarEVlfy8OO/Lqw023j6xcqmwxLiOd6heM2i9cV9LJy8jMJ23yQ+rpbfu7EQ/pXE8KYvUSqvVnb4XzZa6LrHMXHR+zcLvqWbm/Bn0/HzIs6fWPHoat8XfnDKmZGxRxeMbn2UqZ5Q94nmcZRbqqUXbZ8+lcjE+cPX11t814orvvAXNcG8vqj2vvk1MGn3anlj0bIT72v47bvE+Lc98T9b6r7AKn6j+8Duf7D0nnZx/j7Zjn0j9nbpSTndaLr9WNLivP+iN23xF7L+fqv6ZouFyb78jxVXvv5jJ9YUs9/sddO8h7KNg5jrhfaJGztT6G7KF+1d6yCmD5Kdb2fan60rSc552fZr3zeQ9DpnPp+Si5cx5Ktv2QfSzF/mMbWdOm46rFI4XstnU9xeqX4NKb7TKEdcr6pZOK3ID1k/LvFHkVczEuZLEDr499YqvqBym1aEHWgcvoYOtv0M91qQl5TfpO/in6rWx8OVpT1Wedkv3f5xom3T/xeR/6Gx6V86PWAOB4bBpqWdN+yTcVxjIyGRz/FrDGu6w/3d7kPm8StX8RyPu+uuvpNju/vTLJV37GpvoM0oZPnW87VLnL/5pDno1NoW1R6yedU6TyUv3u19a3KFnIbTLYz+ZCLP4T0tU1uivFgso0pnsJ/UtXvarNY28Xq5cvkBDrQP/E5ZaiuQwwfmTlsOiQRU1fMuqrDd/3ISSuwjOwXOfTyGUMpZIXq4GpLn3pUcdfzch2x7XO1u2uZHOPb1G6b3Xg9PH1IIWeEpJlPQtqos2EKW8b0u8rnuP1UeVLoXJb9be0uG9nnbchjU+XTszT5VeNBThPHnc5OKj1U9aj0GTHIVaGy1YhEWT4ixns00DT+XEzWn/7VAsIc63Cov3OdyhwjrnaqQqZvWKXdypRdlq+k8msZ031U+Rm4fA+3TtyeR9hwfW9G9yxDN0fZMN33F+9TE6md4hwoxumfaUzI9fN3PFT3xVV2msrQ3UsnChm6Nulk8TndpS28D3zX9tTIPsF/z7Am5OkTjm1tI1JZW74+4VgsZ0N3L1yXV3WeP5uR7TGHHdvC3JQlxybfpd22tDlk/2eofRK8TzrN/qnar/K/OUTth6I/+jAnEptNbPvFHP2gs40N3+dfMWtwqvVct7/wfd8gtQ7imifial9ZJ9/3IHLYU6eDj3+4PhsNhX+vwvcWLnu6kGfEMe8DuciPfUfGZB8X/7HJy/Gefe5n+VRGFd/wyP2ta7/LO4yh/sbLV/k9lev6kfO9Dt/5U67b1/6u/epqB1U9Me23jfHY9sscAg4tkbLl+e4/U36rJ9ddxfd6sg5vq5ice42Wpk/pb9FOJ36/W9tpv4kbC79nUbZceX8Zu6/qJ+P3WvhvA8v3reh7Jbn2d6rrNC7XNZTLma4Ba0JI9efX2uLzF5scG/w9UNU1ZxW+ymUfzELeTllXlQ1rUuhzjS5fp9c964iFBOqeSz63bU065nZKdU+mDEz3qHIjjifquw0pnb/raRtvrnsYcb46ihT3taoYz6brdNW9l6rWRnE/navdPn1XlR1km7hcz1WlH/elKuSOSvLLuE8U6m8uzwRdfcGl73VyTHuyMvzJ1Sa2cWDTP/Z63Kc94n2B1PYr24dz1JlyHLlcP+S4B6vD1c9EW4q2LWstCvUjeVy63k/LMYdUNd5D1xQfvVTzX1VjkMsUv88N8VH5fReVn/Fjn++/h6X6Q8a6b1/q3g/i/ewi0/Scs8zxXeV6mWIOUPlPzBgdFerW+bZrm2P18dnjuK6HunEp+rHvPMXbr+sHVb/lnL+pTP57jPw9Cvk3PW178JD9qChfzuvTf7Htl38L1QUf/VKu9SFjwWbTWPvFEvu7Uq76y7+31g6QlYPc669pbsm9Xur2LWI9Pu8ypfDXqm3A2z8s1FWGn4ntL9NfQu2oSlftX9uetvTtv7J8Ql4zxfXGZ3zk8PeQ9w59x2uMfqI8/q5eKh/l9cb2rwsu9rSNl06ZP2Pmxtz+rNMx93yno0n2/82rVH7rQ+y9P15H6FyRun9ViH81ATmffI7nJ5r8uXXW6enbP6b/B8/l5OifVHYLnb9S39s2zcc+Ph+rh8+eQgVPS72elzGWY/tUtbbabBpDiI7yN1q6/4th2y+ErAc5+9BVvu/7KamJbWNZeuqI/R4tRf+YyD1HmOZM1bMV3/14Sn10c0Xu+Sj1nOXb5jL73ncdy02uvlXZNde65dOHYl7Vs4KYuS6FzWLn2zJlpZqPXPVPOa5yzKOyn1VhT9lmMfdbfH7D11Wf2PXN5h9y+dD287+qxgSnaYmnIrRtIb8pJe6/Uv9OVer6Whn0zfGO/BEloZI9ojmfAlUflClDd178bTmVHVTpZXOkAlk/lb42UujmI89HH5V+cl7XtowY6vTxLVWok6UrGzoGTHN+bB+6ri05687VNpvfuvRfaP2uMlNQth1D5JjGelm/8yn+9p3p/7qk9gnfeddXZmq/Sm333PJT659Kv1zjNbZ9uv2Oi//67CV8/N1nj1DmviyXDNVeJkaeaX8UsyesYg8cu2+NvdaPfb+lLDu5tvt/`),eb=new Yy.default($y),tb=function(e){switch(e){case 33:return 12;case 39:case 40:case 42:return 12;case 35:return 5;default:return e}},nb=function(e){switch(e){case 37:case 38:return 34;case 41:return 22;default:return e}};var rb=class{constructor(e,t=!1){this.position=e,this.required=t}};Zy=class{nextCodePoint(){let e=this.string.charCodeAt(this.pos++),t=this.string.charCodeAt(this.pos);return 55296<=e&&e<=56319&&56320<=t&&t<=57343?(this.pos++,(e-55296)*1024+(t-56320)+65536):e}nextCharClass(){return tb(eb.get(this.nextCodePoint()))}getSimpleBreak(){switch(this.nextClass){case 41:return!1;case 34:case 37:case 38:return this.curClass=34,!1;case 36:return this.curClass=36,!1}return null}getPairTableBreak(e){let t=!1;switch(Qy[this.curClass][this.nextClass]){case 0:t=!0;break;case 1:t=e===41;break;case 2:if(t=e===41,!t)return t=!1,t;break;case 3:if(e!==41)return t}return this.LB8a&&(t=!1),this.LB21a&&(this.curClass===16||this.curClass===17)?(t=!1,this.LB21a=!1):this.LB21a=this.curClass===13,this.curClass===28?(this.LB30a++,this.LB30a==2&&this.nextClass===28&&(t=!0,this.LB30a=0)):this.LB30a=0,this.curClass=this.nextClass,t}nextBreak(){if(this.curClass==null){let e=this.nextCharClass();this.curClass=nb(e),this.nextClass=e,this.LB8a=e===31,this.LB30a=0}for(;this.pos<this.string.length;){this.lastPos=this.pos;let e=this.nextClass;if(this.nextClass=this.nextCharClass(),this.curClass===34||this.curClass===36&&this.nextClass!==37)return this.curClass=nb(tb(this.nextClass)),new rb(this.lastPos,!0);let t=this.getSimpleBreak();if(t===null&&(t=this.getPairTableBreak(e)),this.LB8a=this.nextClass===31,t)return new rb(this.lastPos)}return this.lastPos<this.string.length?(this.lastPos=this.string.length,new rb(this.string.length)):null}constructor(e){this.string=e,this.pos=0,this.lastPos=0,this.curClass=null,this.nextClass=null,this.LB8a=!1,this.LB21a=!1,this.LB30a=0}};var ib=/* @__PURE__ */ n(((e,t)=>{var n=/^[a-f0-9?-]+$/i;t.exports=function(e){for(var t=[],r=e,i,a,o,s,c,l,u,d,f=0,p=r.charCodeAt(f),m=r.length,h=[{nodes:t}],g=0,_,v=``,y=``,b=``;f<m;)if(p<=32){i=f;do i+=1,p=r.charCodeAt(i);while(p<=32);s=r.slice(f,i),o=t[t.length-1],p===41&&g?b=s:o&&o.type===`div`?(o.after=s,o.sourceEndIndex+=s.length):p===44||p===58||p===47&&r.charCodeAt(i+1)!==42&&(!_||_&&_.type===`function`&&_.value!==`calc`)?y=s:t.push({type:`space`,sourceIndex:f,sourceEndIndex:i,value:s}),f=i}else if(p===39||p===34){i=f,a=p===39?`'`:`"`,s={type:`string`,sourceIndex:f,quote:a};do if(c=!1,i=r.indexOf(a,i+1),~i)for(l=i;r.charCodeAt(l-1)===92;)--l,c=!c;else r+=a,i=r.length-1,s.unclosed=!0;while(c);s.value=r.slice(f+1,i),s.sourceEndIndex=s.unclosed?i:i+1,t.push(s),f=i+1,p=r.charCodeAt(f)}else if(p===47&&r.charCodeAt(f+1)===42)i=r.indexOf(`*/`,f),s={type:`comment`,sourceIndex:f,sourceEndIndex:i+2},i===-1&&(s.unclosed=!0,i=r.length,s.sourceEndIndex=i),s.value=r.slice(f+2,i),t.push(s),f=i+2,p=r.charCodeAt(f);else if((p===47||p===42)&&_&&_.type===`function`&&_.value===`calc`)s=r[f],t.push({type:`word`,sourceIndex:f-y.length,sourceEndIndex:f+s.length,value:s}),f+=1,p=r.charCodeAt(f);else if(p===47||p===44||p===58)s=r[f],t.push({type:`div`,sourceIndex:f-y.length,sourceEndIndex:f+s.length,value:s,before:y,after:``}),y=``,f+=1,p=r.charCodeAt(f);else if(p===40){i=f;do i+=1,p=r.charCodeAt(i);while(p<=32);if(d=f,s={type:`function`,sourceIndex:f-v.length,value:v,before:r.slice(d+1,i)},f=i,v===`url`&&p!==39&&p!==34){--i;do if(c=!1,i=r.indexOf(`)`,i+1),~i)for(l=i;r.charCodeAt(l-1)===92;)--l,c=!c;else r+=`)`,i=r.length-1,s.unclosed=!0;while(c);u=i;do--u,p=r.charCodeAt(u);while(p<=32);d<u?(f===u+1?s.nodes=[]:s.nodes=[{type:`word`,sourceIndex:f,sourceEndIndex:u+1,value:r.slice(f,u+1)}],s.unclosed&&u+1!==i?(s.after=``,s.nodes.push({type:`space`,sourceIndex:u+1,sourceEndIndex:i,value:r.slice(u+1,i)})):(s.after=r.slice(u+1,i),s.sourceEndIndex=i)):(s.after=``,s.nodes=[]),f=i+1,s.sourceEndIndex=s.unclosed?i:f,p=r.charCodeAt(f),t.push(s)}else g+=1,s.after=``,s.sourceEndIndex=f+1,t.push(s),h.push(s),t=s.nodes=[],_=s;v=``}else if(p===41&&g)f+=1,p=r.charCodeAt(f),_.after=b,_.sourceEndIndex+=b.length,b=``,--g,h[h.length-1].sourceEndIndex=f,h.pop(),_=h[g],t=_.nodes;else{i=f;do p===92&&(i+=1),i+=1,p=r.charCodeAt(i);while(i<m&&!(p<=32||p===39||p===34||p===44||p===58||p===47||p===40||p===42&&_&&_.type===`function`&&_.value===`calc`||p===47&&_.type===`function`&&_.value===`calc`||p===41&&g));s=r.slice(f,i),p===40?v=s:(s.charCodeAt(0)===117||s.charCodeAt(0)===85)&&s.charCodeAt(1)===43&&n.test(s.slice(2))?t.push({type:`unicode-range`,sourceIndex:f,sourceEndIndex:i,value:s}):t.push({type:`word`,sourceIndex:f,sourceEndIndex:i,value:s}),f=i}for(f=h.length-1;f;--f)h[f].unclosed=!0,h[f].sourceEndIndex=r.length;return h[0].nodes}})),ab=/* @__PURE__ */ n(((e,t)=>{t.exports=function e(t,n,r){for(var i=0,a=t.length,o,s;i<a;i+=1)o=t[i],r||(s=n(o,i,t)),s!==!1&&o.type===`function`&&Array.isArray(o.nodes)&&e(o.nodes,n,r),r&&n(o,i,t)}})),ob=/* @__PURE__ */ n(((e,t)=>{function n(e,t){var n=e.type,i=e.value,a,o;return t&&(o=t(e))!==void 0?o:n===`word`||n===`space`?i:n===`string`?(a=e.quote||``,a+i+(e.unclosed?``:a)):n===`comment`?`/*`+i+(e.unclosed?``:`*/`):n===`div`?(e.before||``)+i+(e.after||``):Array.isArray(e.nodes)?(a=r(e.nodes,t),n===`function`?i+`(`+(e.before||``)+a+(e.after||``)+(e.unclosed?``:`)`):a):i}function r(e,t){var r,i;if(Array.isArray(e)){for(r=``,i=e.length-1;~i;--i)r=n(e[i],t)+r;return r}return n(e,t)}t.exports=r})),sb=/* @__PURE__ */ n(((e,t)=>{function n(e){var t=e.charCodeAt(0),n;if(t===43||t===45){if(n=e.charCodeAt(1),n>=48&&n<=57)return!0;var r=e.charCodeAt(2);return n===46&&r>=48&&r<=57}return t===46?(n=e.charCodeAt(1),n>=48&&n<=57):t>=48&&t<=57}t.exports=function(e){var t=0,r=e.length,i,a,o;if(r===0||!n(e))return!1;for(i=e.charCodeAt(t),(i===43||i===45)&&t++;t<r&&(i=e.charCodeAt(t),!(i<48||i>57));)t+=1;if(i=e.charCodeAt(t),a=e.charCodeAt(t+1),i===46&&a>=48&&a<=57)for(t+=2;t<r&&(i=e.charCodeAt(t),!(i<48||i>57));)t+=1;if(i=e.charCodeAt(t),a=e.charCodeAt(t+1),o=e.charCodeAt(t+2),(i===101||i===69)&&(a>=48&&a<=57||(a===43||a===45)&&o>=48&&o<=57))for(t+=a===43||a===45?3:2;t<r&&(i=e.charCodeAt(t),!(i<48||i>57));)t+=1;return{number:e.slice(0,t),unit:e.slice(t)}}})),cb=/* @__PURE__ */ n(((e,t)=>{var n=ib(),r=ab(),i=ob();function a(e){return this instanceof a?(this.nodes=n(e),this):new a(e)}a.prototype.toString=function(){return Array.isArray(this.nodes)?i(this.nodes):``},a.prototype.walk=function(e,t){return r(this.nodes,e,t),this},a.unit=sb(),a.walk=r,a.stringify=i,t.exports=a})),lb=/* @__PURE__ */ n(((e,t)=>{t.exports=function(e){return typeof e==`string`?r(e):n(e)};function n(e){return!e||typeof e!=`object`||a(e)||o(e)?e:i(e)?l(e,n):u(c(e),function(t,i){var a=r(i);return t[a]=n(e[i]),t},{})}function r(e){return e.replace(/[_.-](\w|$)/g,function(e,t){return t.toUpperCase()})}var i=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`},a=function(e){return Object.prototype.toString.call(e)===`[object Date]`},o=function(e){return Object.prototype.toString.call(e)===`[object RegExp]`},s=Object.prototype.hasOwnProperty,c=Object.keys||function(e){var t=[];for(var n in e)s.call(e,n)&&t.push(n);return t};function l(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}function u(e,t,n){if(e.reduce)return e.reduce(t,n);for(var r=0;r<e.length;r++)n=t(n,e[r],r);return n}})),ub=/* @__PURE__ */ n(((e,t)=>{t.exports={black:`#000000`,silver:`#c0c0c0`,gray:`#808080`,white:`#ffffff`,maroon:`#800000`,red:`#ff0000`,purple:`#800080`,fuchsia:`#ff00ff`,green:`#008000`,lime:`#00ff00`,olive:`#808000`,yellow:`#ffff00`,navy:`#000080`,blue:`#0000ff`,teal:`#008080`,aqua:`#00ffff`,orange:`#ffa500`,aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,blanchedalmond:`#ffebcd`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,limegreen:`#32cd32`,linen:`#faf0e6`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,oldlace:`#fdf5e6`,olivedrab:`#6b8e23`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,whitesmoke:`#f5f5f5`,yellowgreen:`#9acd32`,rebeccapurple:`#663399`}})),db=/* @__PURE__ */ n(((e,t)=>{t.exports=ub()})),fb=/* @__PURE__ */ n((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){return e&&typeof e==`object`&&`default`in e?e.default:e}var n=cb(),r=t(n),i=t(lb()),a=t(db()),o=function(e){return e.type===`string`?e.value.replace(/\\([0-9a-f]{1,6})(?:\s|$)/gi,function(e,t){return String.fromCharCode(parseInt(t,16))}).replace(/\\/g,``):null},s=/^(#(?:[0-9a-f]{3,4}){1,2})$/i,c=/^(rgba?|hsla?|hwb|lab|lch|gray|color)$/,l=function(e){return e.type===`word`&&(s.test(e.value)||e.value in a||e.value===`transparent`)?e.value:e.type===`function`&&c.test(e.value)?n.stringify(e):null},u=/^(none)$/i,d=/^(auto)$/i,f=/(^-?[_a-z][_a-z0-9-]*$)/i,p=/^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?)$/i,m=/^(0$|(?:[+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?)(?=px$))/i,h=/^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?(ch|em|ex|rem|vh|vw|vmin|vmax|cm|mm|in|pc|pt))$/i,g=/^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?(?:deg|rad))$/i,_=/^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?%)$/i,v=function(e){return function(t){return e(t)?`<token>`:null}},y=function(e){return function(t){return t.type===e?t.value:null}},b=function(e,t){return t===void 0&&(t=String),function(n){if(n.type!==`word`)return null;var r=n.value.match(e);return r===null?null:t(r[1])}},x=v(function(e){return e.type===`space`}),S=v(function(e){return e.type===`div`&&e.value===`/`}),C=v(function(e){return e.type===`div`&&e.value===`,`}),w=y(`word`),T=b(u),E=b(d),D=b(p,Number),O=b(m,Number),k=b(h),A=b(g,function(e){return e.toLowerCase()}),ee=b(_),j=b(f),te=o,ne=l,re=b(/^(none|underline|line-through)$/i),ie=function(e){var t=e.expect(D);return e.hasTokens()&&(e.expect(S),t/=e.expect(D)),{aspectRatio:t}},ae=b(/^(solid|dashed|dotted)$/),oe=1,se=`black`,ce=`solid`,le=function(e){var t,n,r;if(e.matches(T))return e.expectEmpty(),{borderWidth:0,borderColor:`black`,borderStyle:`solid`};for(var i=0;i<3&&e.hasTokens();)i!==0&&e.expect(x),t===void 0&&e.matches(O,k)?t=e.lastValue:n===void 0&&e.matches(ne)?n=e.lastValue:r===void 0&&e.matches(ae)?r=e.lastValue:e.throw(),i+=1;return e.expectEmpty(),t===void 0&&(t=oe),n===void 0&&(n=se),r===void 0&&(r=ce),{borderWidth:t,borderColor:n,borderStyle:r}},ue=function(e){var t=e.types,n=t===void 0?[O,k,ee]:t,r=e.directions,i=r===void 0?[`Top`,`Right`,`Bottom`,`Left`]:r,a=e.prefix,o=a===void 0?``:a,s=e.suffix,c=s===void 0?``:s;return function(e){var t,r=[];for(r.push(e.expect.apply(e,n));r.length<4&&e.hasTokens();)e.expect(x),r.push(e.expect.apply(e,n));e.expectEmpty();var a=r[0],s=r[1],l=s===void 0?a:s,u=r[2],d=u===void 0?a:u,f=r[3],p=f===void 0?l:f,m=function(e){return``+o+i[e]+c};return t={},t[m(0)]=a,t[m(1)]=l,t[m(2)]=d,t[m(3)]=p,t}},de=function(e){var t=e.expect(O),n=e.matches(x)?e.expect(O):t;return e.expectEmpty(),{width:t,height:n}},fe=function(e){var t,n,r,i;if(e.matches(T))return e.expectEmpty(),{offset:{width:0,height:0},radius:0,color:`black`};for(var a=!1;e.hasTokens();)a&&e.expect(x),t===void 0&&e.matches(O,k)?(t=e.lastValue,e.expect(x),n=e.expect(O,k),e.saveRewindPoint(),e.matches(x)&&e.matches(O,k)?r=e.lastValue:e.rewind()):i===void 0&&e.matches(ne)?i=e.lastValue:e.throw(),a=!0;return t===void 0&&e.throw(),{offset:{width:t,height:n},radius:r===void 0?0:r,color:i===void 0?`black`:i}},pe=function(e){var t=fe(e);return{shadowOffset:t.offset,shadowRadius:t.radius,shadowColor:t.color,shadowOpacity:1}},me=1,he=1,ge=0,_e=function(e){var t,n,r;if(e.matches(T))return e.expectEmpty(),{flexGrow:0,flexShrink:0,flexBasis:`auto`};if(e.saveRewindPoint(),e.matches(E)&&!e.hasTokens())return{flexGrow:1,flexShrink:1,flexBasis:`auto`};e.rewind();for(var i=0;i<2&&e.hasTokens();)i!==0&&e.expect(x),t===void 0&&e.matches(D)?(t=e.lastValue,e.saveRewindPoint(),e.matches(x)&&e.matches(D)?n=e.lastValue:e.rewind()):r===void 0&&e.matches(O,k,ee)?r=e.lastValue:r===void 0&&e.matches(E)?r=`auto`:e.throw(),i+=1;return e.expectEmpty(),t===void 0&&(t=me),n===void 0&&(n=he),r===void 0&&(r=ge),{flexGrow:t,flexShrink:n,flexBasis:r}},ve=b(/(nowrap|wrap|wrap-reverse)/),ye=b(/(row|row-reverse|column|column-reverse)/),be=`nowrap`,xe=`row`,Se=function(e){for(var t,n,r=0;r<2&&e.hasTokens();)r!==0&&e.expect(x),t===void 0&&e.matches(ve)?t=e.lastValue:n===void 0&&e.matches(ye)?n=e.lastValue:e.throw(),r+=1;return e.expectEmpty(),t===void 0&&(t=be),n===void 0&&(n=xe),{flexWrap:t,flexDirection:n}},Ce=function(e){var t;if(e.matches(te))t=e.lastValue;else for(t=e.expect(j);e.hasTokens();){e.expect(x);var n=e.expect(j);t+=` `+n}return e.expectEmpty(),{fontFamily:t}},we=b(/^(normal)$/),Te=b(/^(italic)$/),Ee=b(/^([1-9]00|bold)$/),De=b(/^(small-caps)$/),Oe=`normal`,ke=`normal`,M=[],Ae=function(e){for(var t,n,r,i,a=0;a<3&&e.hasTokens();){if(!e.matches(we)){if(t===void 0&&e.matches(Te))t=e.lastValue;else if(n===void 0&&e.matches(Ee))n=e.lastValue;else if(r===void 0&&e.matches(De))r=[e.lastValue];else break}e.expect(x),a+=1}var o=e.expect(O,k);e.matches(S)&&(i=e.expect(O,k)),e.expect(x);var s=Ce(e).fontFamily;t===void 0&&(t=Oe),n===void 0&&(n=ke),r===void 0&&(r=M);var c={fontStyle:t,fontWeight:n,fontVariant:r,fontSize:o,fontFamily:s};return i!==void 0&&(c.lineHeight=i),c},je=function(e){for(var t=[e.expect(j)];e.hasTokens();)e.expect(x),t.push(e.expect(j));return{fontVariant:t}},Me=b(/(flex-(?:start|end)|center|stretch|space-(?:between|around))/),Ne=b(/(flex-(?:start|end)|center|space-(?:between|around|evenly))/),Pe=function(e){var t=e.expect(Me),n;return e.hasTokens()?(e.expect(x),n=e.expect(Ne)):n=`stretch`,e.expectEmpty(),{alignContent:t,justifyContent:n}},Fe=b(/^(solid|double|dotted|dashed)$/),Ie=`none`,Le=`solid`,Re=`black`,ze=function(e){for(var t,n,r,i=!1;e.hasTokens();){if(i&&e.expect(x),t===void 0&&e.matches(re)){var a=[e.lastValue.toLowerCase()];e.saveRewindPoint(),a[0]!==`none`&&e.matches(x)&&e.matches(re)?(a.push(e.lastValue.toLowerCase()),a.sort().reverse()):e.rewind(),t=a.join(` `)}else n===void 0&&e.matches(Fe)?n=e.lastValue:r===void 0&&e.matches(ne)?r=e.lastValue:e.throw();i=!0}return{textDecorationLine:t===void 0?Ie:t,textDecorationColor:r===void 0?Re:r,textDecorationStyle:n===void 0?Le:n}},Be=function(e){for(var t=[],n=!1;e.hasTokens();)n&&e.expect(x),t.push(e.expect(re).toLowerCase()),n=!0;return t.sort().reverse(),{textDecorationLine:t.join(` `)}},Ve=function(e){var t=fe(e);return{textShadowOffset:t.offset,textShadowRadius:t.radius,textShadowColor:t.color}},He=function(e){return function(t){var n=t.expect(e);return t.expectEmpty(),n}},Ue=He(D),We=He(O),N=He(A),Ge=function(e){return function(t,n){return function(r){var i,a,o=r.expect(e),s;if(r.hasTokens())r.expect(C),s=r.expect(e);else if(n!==void 0)s=n;else return o;return r.expectEmpty(),[(i={},i[t+`Y`]=s,i),(a={},a[t+`X`]=o,a)]}}},Ke=Ge(D),qe=Ge(O),Je=Ge(A),Ye={perspective:Ue,scale:Ke(`scale`),scaleX:Ue,scaleY:Ue,translate:qe(`translate`,0),translateX:We,translateY:We,rotate:N,rotateX:N,rotateY:N,rotateZ:N,skewX:N,skewY:N,skew:Je(`skew`,`0deg`)},Xe={aspectRatio:ie,background:function(e){return{backgroundColor:e.expect(ne)}},border:le,borderColor:ue({types:[ne],prefix:`border`,suffix:`Color`}),borderRadius:ue({directions:[`TopLeft`,`TopRight`,`BottomRight`,`BottomLeft`],prefix:`border`,suffix:`Radius`}),borderWidth:ue({prefix:`border`,suffix:`Width`}),boxShadow:pe,flex:_e,flexFlow:Se,font:Ae,fontFamily:Ce,fontVariant:je,fontWeight:function(e){return{fontWeight:e.expect(w)}},margin:ue({types:[O,k,ee,E],prefix:`margin`}),padding:ue({prefix:`padding`}),placeContent:Pe,shadowOffset:function(e){return{shadowOffset:de(e)}},textShadow:Ve,textShadowOffset:function(e){return{textShadowOffset:de(e)}},textDecoration:ze,textDecorationLine:Be,transform:function(e){for(var t=[],n=!1;e.hasTokens();){n&&e.expect(x);var r=e.expectFunction(),i=r.functionName,a=Ye[i](r);if(!Array.isArray(a)){var o;a=[(o={},o[i]=a,o)]}t=a.concat(t),n=!0}return{transform:t}}},Ze=`SYMBOL_MATCH`,Qe=/*#__PURE__*/ function(){function e(e,t){this.index=0,this.nodes=e,this.functionName=t==null?null:t.value,this.lastValue=null,this.rewindIndex=-1}var t=e.prototype;return t.hasTokens=function(){return this.index<=this.nodes.length-1},t[Ze]=function(){if(!this.hasTokens())return null;for(var e=this.nodes[this.index],t=0;t<arguments.length;t+=1){var n=(t<0||arguments.length<=t?void 0:arguments[t])(e);if(n!==null)return this.index+=1,this.lastValue=n,n}return null},t.matches=function(){return this[Ze].apply(this,arguments)!==null},t.expect=function(){var e=this[Ze].apply(this,arguments);return e===null?this.throw():e},t.matchesFunction=function(){var t=this.nodes[this.index];if(t.type!==`function`)return null;var n=new e(t.nodes,t);return this.index+=1,this.lastValue=null,n},t.expectFunction=function(){var e=this.matchesFunction();return e===null?this.throw():e},t.expectEmpty=function(){this.hasTokens()&&this.throw()},t.throw=function(){throw Error(`Unexpected token type: `+this.nodes[this.index].type)},t.saveRewindPoint=function(){this.rewindIndex=this.index},t.rewind=function(){if(this.rewindIndex===-1)throw Error(`Internal error`);this.index=this.rewindIndex,this.lastValue=null},e}(),$e=/^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?)(?:px)?$/i,et=/^true|false$/i,tt=/^null$/i,nt=/^undefined$/i,rt=function(e,t){var n=t.match($e);if(n!==null)return Number(n[1]);var r=t.match(et);if(r!==null)return r[0].toLowerCase()===`true`;if(t.match(tt)!==null)return null;if(t.match(nt)===null)return t},it=function(e,t){var n=new Qe(r(t).nodes);return Xe[e](n)};e.getPropertyName=function(e){return/^--\w+/.test(e)?e:i(e)},e.getStylesForProperty=function(e,t,n){var r,i=n===!1||!(e in Xe),a=t.trim();return i?(r={},r[e]=rt(e,a),r):it(e,a)}})),pb=/* @__PURE__ */ n(((e,t,n)=>{
560
560
  /*!
@@ -633,7 +633,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
633
633
  `)}function NH(e){return CH(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,e))})}function PH(e,t,n){return CH(this,void 0,void 0,function*(){let r=Date.now()+wH;for(;Date.now()<r;){yield NH(3e3),n?.();let r=yield SH(e);if(r&&(t===null||new Date(r.computedAt).getTime()>new Date(t).getTime()))return r}throw Error(`Score did not complete within ${wH/1e3}s`)})}function FH(){return CH(this,void 0,void 0,function*(){let e=mt(`subdomain`);if(e)return e;let t=yield Yl();if(t)return(yield fu(t))[0]})}const IH=e=>CH(void 0,void 0,void 0,function*(){let t=TH(e);try{let n=e.url;if(!n){let e=yield FH();if(!e)throw Error("No URL provided and no default subdomain set. Run `mint login` to set one, or pass a URL: `mint score <url>`.");n=`${e}.mintlify.site`}t===`table`&&D((0,P.jsx)(f,{message:`Checking agent readiness...`}));let r=yield xH(n),i;if(r.status===`ready`){let e=yield SH(r.slug);if(t===`table`&&a(),!e)throw Error(`Score was unexpectedly unavailable`);i=e}else if(r.status===`stale_refresh_queued`){let e=yield SH(r.slug);if(t===`table`&&a(),!e)throw Error(`Stale score was unexpectedly unavailable`);t===`table`?(MH(`table`,jH(e,{stale:!0})),D((0,P.jsx)(f,{message:`Refreshing score in the background...`}))):process.stderr.write(`Refreshing score in the background...
634
634
  `),i=yield PH(r.slug,e.computedAt),t===`table`&&a()}else t===`table`?(a(),D((0,P.jsx)(f,{message:`Queued a new scoring run. Waiting for first result...`}))):process.stderr.write(`Queued a new scoring run. Waiting for first result...
635
635
  `),i=yield PH(r.slug,null),t===`table`&&a();gd(`cli.score.executed`,{url:n,score:i.overallScore,format:t,status:r.status}),t===`json`?MH(t,JSON.stringify(i,null,2)):t===`plain`?MH(t,[`SCORE\t${i.overallScore}`,...AH(i.checks)].join(`
636
- `)):MH(t,jH(i)),yield N(0)}catch(e){let n=e instanceof Error?e.message:`unknown error`;t===`table`?(a(),D((0,P.jsx)(c,{message:n}))):process.stderr.write(`Error: ${n}\n`),yield N(1)}});var LH=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 RH=`https://mintlify.com/auth.md`,zH=()=>{h((0,P.jsx)(M,{children:`Agent Detected - sending AI friendly prompt`}),(0,P.jsx)(M,{children:`<mint-cli-instructions>`}),(0,P.jsxs)(M,{children:[`Could not fetch the agent signup guide. Read `,RH," directly, or create a site without an account by running `mint deploy --subdomain [subdomain]` from the documentation directory and following the instructions it prints."]}),(0,P.jsx)(M,{children:"To hand the site to the user, ask for their email (never invent one) and run `mint claim --email [email]`."}),(0,P.jsx)(M,{children:`</mint-cli-instructions>`}))},BH=()=>LH(void 0,void 0,void 0,function*(){!Je()||Ie()||process.env.MINTLIFY_SESSION_TOKEN||(yield Yl().catch(()=>void 0))||($e(et)?D((0,P.jsx)(M,{children:"Not published yet. Run `mint signup` or `mint login` to publish."})):(h((0,P.jsx)(M,{children:`<mint-cli-instructions>`}),(0,P.jsx)(M,{children:`Ready to publish? The Free plan needs no credit card.`}),(0,P.jsx)(M,{children:"Offer to create the user's Mintlify account: run `mint signup` and follow the instructions it prints."}),(0,P.jsx)(M,{children:"Have an account: `mint login`."}),(0,P.jsx)(M,{children:"Your site will then be live at https://[subdomain].mintlify.site (`mint status` shows the exact URL)."}),(0,P.jsx)(M,{children:`</mint-cli-instructions>`})),yield ht(et).catch(()=>void 0)))}),VH=()=>LH(void 0,void 0,void 0,function*(){try{let e=yield fetch(RH,{signal:AbortSignal.timeout(3e4)});if(!e.ok)throw Error(`auth.md returned ${e.status}`);process.stdout.write(`${yield e.text()}\n`)}catch{zH()}});function HH(){return LH(this,arguments,void 0,function*(e={}){if(Je()){yield VH();return}let t=e.firstName??(yield It({message:`First name`})),n=e.lastName??(yield It({message:`Last name`})),r=e.company??(yield It({message:`Company name`})),i=e.email??(yield It({message:`Email`})),a=Rg(),s=yield Lg(a),l=zg(),u=Bg(),d=Buffer.from(JSON.stringify({nonce:l,clientState:u})).toString(`base64url`),{codePromise:f,close:p}=yield Gg();f.catch(()=>{});try{let e=yield fetch(`${rt}/api/cli-onboarding/signup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({firstName:t,lastName:n,company:r,email:i,state:d,codeChallenge:s})});if(!e.ok){let t=yield e.json().catch(()=>({}));p(),D((0,P.jsx)(c,{message:`signup failed: ${t.error??`unknown error`}`}));return}}catch{p(),D((0,P.jsx)(c,{message:`signup failed: could not reach the server`}));return}D((0,P.jsxs)(ke,{flexDirection:`column`,gap:1,paddingY:1,children:[(0,P.jsxs)(M,{bold:!0,children:[(0,P.jsx)(M,{color:`green`,children:`◆ `}),`Check your email to verify your account`]}),(0,P.jsx)(ke,{flexDirection:`column`,paddingLeft:3,gap:1,children:(0,P.jsxs)(M,{dimColor:!0,children:[`We sent a verification link to `,i,`. Click it to continue.`]})})]}));let m;try{m=yield f}catch{D((0,P.jsx)(c,{message:`signup cancelled`}));return}let h=yield fetch(xt,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({grant_type:`authorization_code`,code:m,code_verifier:a})}),g=yield h.json().catch(()=>({}));if(!h.ok){let e=g.error_message??g.error??`unknown error`;D((0,P.jsx)(c,{message:`signup failed: ${e}`}));return}let _=g;yield Jl(_.access_token,_.refresh_token,eu(_.id_token)??i),yield gt(`subdomain`).catch(()=>void 0),D((0,P.jsx)(o,{message:`account created and logged in successfully`})),D((0,P.jsx)(M,{children:`Continue in the browser tab where you verified your email to connect GitHub.`}))})}var UH=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 WH=(e,t)=>UH(void 0,void 0,void 0,function*(){let n=yield He({packageName:e});try{yield qe(n,st(n,e),Ye);return}catch(r){return`Failed to update ${e}@${t} using ${n}: ${Ve(r)}`}}),GH=e=>UH(void 0,void 0,void 0,function*(){let t=y().trim();try{yield S({targetVersion:e,existingVersion:t===`none`?null:t});return}catch(e){return`Failed to update client: ${Ve(e)}`}}),KH=e=>UH(void 0,[e],void 0,function*({packageName:e}){bt(e),D((0,P.jsx)(f,{message:`updating...`}));let{cli:t}=Ke(e),[n,r]=yield Promise.all([Ge(e),b()]),a=!!t&&!!n&&n!==t.trim(),s=!!r&&y().trim()!==r.trim();i(),a&&D((0,P.jsx)(f,{message:`updating ${e} package...`})),s&&D((0,P.jsx)(f,{message:`updating client...`}));let l=(yield Promise.all([n?a?WH(e,n):void 0:`Failed to fetch the latest ${e} version`,s?GH(r.trim()):void 0])).filter(e=>!!e);i(),l.length?l.forEach(e=>E((0,P.jsx)(c,{message:e}))):D(!a&&!s?(0,P.jsx)(o,{message:`already up to date`}):(0,P.jsx)(o,{message:`updated ${e} to the latest version: ${n}`}))}),qH=String.raw`[\w@.\\/-]+\.(?:mdx?|jsx?|tsx?|json|ya?ml)\b`,JH=new RegExp(qH),YH=[new RegExp(String.raw`\(in (${qH}),`),new RegExp(String.raw`(?:\bin|imported from) (${qH})`)],XH=/* @__PURE__ */ new Set([`missing-file`,`invalid-import-path`,`import-resolution-error`,`default-import-no-default-export`,`export-collision`,`undeclared-package`,`package-import-conflict`]),ZH=/^:(\d+)(?::(\d+))?/,QH=/"([^"]+)"/,$H=(e,t)=>{let n=Vn(t.message).trim(),r=t.file==null&&XH.has(t.type)?YH.map(e=>e.exec(n)?.[1]).find(Boolean):void 0,i=t.file!=null||r||t.type===`missing-nav-page`?null:JH.exec(n),a=r??i?.[0],o=t.file??(a?ee(Oe(a)):e.configFile),s=i?ZH.exec(n.slice(i.index+i[0].length)):null,c=t.file==null&&o===e.configFile?QH.exec(n)?.[0]:void 0,l=t.ref!=null&&t.line==null?e.locate(o,JSON.stringify(t.ref)):c?e.locate(o,c):void 0;return Object.assign(Object.assign(Object.assign({file:o},t.line==null?s&&Object.assign({line:Number(s[1])},s[2]&&{column:Number(s[2])}):Object.assign({line:t.line},t.column!=null&&{column:t.column})),l),{message:n})},eU=/* @__PURE__ */ new Set([`parse-error`]),tU=(e,t,n,r,i=`error`)=>{for(let e of n)eU.add(e);return{id:e,group:t,severity:i,needsBuild:!0,scope:`site`,description:r,check:e=>(e.build?.warnings??[]).filter(({type:e})=>n.includes(e)).map(t=>$H(e,t))}},nU=[tU(`missing-nav-page`,`nav`,[`missing-nav-page`],`pages in the navigation that have no file`),tU(`missing-file`,`content`,[`missing-file`],`imported files that don't exist`),tU(`import-error`,`content`,[`invalid-import-path`,`import-resolution-error`,`default-import-no-default-export`,`export-collision`],`imports in pages and snippets that don't resolve`),tU(`package-import`,`config`,[`undeclared-package`,`package-import-conflict`],`npm package imports that are undeclared or conflict`),tU(`openapi-build`,`openapi`,[`openapi`],`OpenAPI pages the build could not generate`),tU(`url-collision`,`config`,[`url-collision`],`generated pages whose names differ only by case and get a new URL`,`warning`),{id:`build-failed`,group:`config`,severity:`error`,needsBuild:!0,scope:`site`,description:`the strict build failed for a reason no rule reports`,check:e=>{if(!e.build||e.build.passed)return[];let t=t=>t.type===`parse-error`&&e.selected!==void 0&&!e.selected.has($H(e,t).file),n=e.build.warnings.filter(e=>!e.notice&&!eU.has(e.type)||t(e)).map(t=>$H(e,t));return e.build.strict?n:[...n,{file:e.configFile,message:e.build.error}]}}],rU=(e,t)=>(e.build?.warnings??[]).filter(e=>e.type===t).map(t=>$H(e,t)),iU=e=>e.trim().replace(/\s+/g,` `),aU=dn().use(Wt),oU=e=>e.children.find(e=>e.type===`heading`),sU=e=>{let t=structuredClone(e),n={type:`root`,children:[t]};return aU.runSync(n),mn(t)},cU={id:`duplicate-h1`,group:`content`,severity:`warning`,scope:`file`,description:`remove a first heading that repeats the frontmatter title`,pagesOnly:!0,needsAnchorLinks:!0,check:({tree:e,frontmatter:t,content:n,file:r,anchorLinks:i})=>{let{title:a,mode:o}=t;if(typeof a!=`string`||p.includes(String(o)))return[];let s=oU(e);if(!s||s.depth!==1||iU(mn(s))!==iU(a))return[];let c=s.position?.start.offset??0,l=s.position?.end.offset??c,u={line:s.position?.start.line,column:s.position?.start.column},d=n.indexOf(`
636
+ `)):MH(t,jH(i)),yield N(0)}catch(e){let n=e instanceof Error?e.message:`unknown error`;t===`table`?(a(),D((0,P.jsx)(c,{message:n}))):process.stderr.write(`Error: ${n}\n`),yield N(1)}});var LH=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 RH=`https://mintlify.com/auth.md`,zH=()=>{h((0,P.jsx)(M,{children:`Agent Detected - sending AI friendly prompt`}),(0,P.jsx)(M,{children:`<mint-cli-instructions>`}),(0,P.jsxs)(M,{children:[`Could not fetch the agent signup guide. Read `,RH," directly, or create a site without an account by running `mint deploy --subdomain [subdomain]` from the documentation directory and following the instructions it prints."]}),(0,P.jsx)(M,{children:"To hand the site to the user, ask for their email (never invent one) and run `mint claim --email [email]`."}),(0,P.jsx)(M,{children:`</mint-cli-instructions>`}))},BH=()=>LH(void 0,void 0,void 0,function*(){!Je()||Ie()||process.env.MINTLIFY_SESSION_TOKEN||(yield Yl().catch(()=>void 0))||($e(et)?D((0,P.jsx)(M,{children:"Not published yet. Run `mint signup` or `mint login` to publish."})):(h((0,P.jsx)(M,{children:`<mint-cli-instructions>`}),(0,P.jsx)(M,{children:`Ready to publish? The Free plan needs no credit card.`}),(0,P.jsx)(M,{children:"Offer to create the user's Mintlify account: run `mint signup` and follow the instructions it prints."}),(0,P.jsx)(M,{children:"Have an account: `mint login`."}),(0,P.jsx)(M,{children:"Your site will then be live at https://[subdomain].mintlify.site (`mint status` shows the exact URL)."}),(0,P.jsx)(M,{children:`</mint-cli-instructions>`})),yield ht(et).catch(()=>void 0)))}),VH=()=>LH(void 0,void 0,void 0,function*(){try{let e=yield fetch(RH,{signal:AbortSignal.timeout(3e4)});if(!e.ok)throw Error(`auth.md returned ${e.status}`);process.stdout.write(`${yield e.text()}\n`)}catch{zH()}});function HH(){return LH(this,void 0,void 0,function*(){Je()?yield VH():yield qg({signup:!0})})}var UH=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 WH=(e,t)=>UH(void 0,void 0,void 0,function*(){let n=yield He({packageName:e});try{yield qe(n,st(n,e),Ye);return}catch(r){return`Failed to update ${e}@${t} using ${n}: ${Ve(r)}`}}),GH=e=>UH(void 0,void 0,void 0,function*(){let t=y().trim();try{yield S({targetVersion:e,existingVersion:t===`none`?null:t});return}catch(e){return`Failed to update client: ${Ve(e)}`}}),KH=e=>UH(void 0,[e],void 0,function*({packageName:e}){bt(e),D((0,P.jsx)(f,{message:`updating...`}));let{cli:t}=Ke(e),[n,r]=yield Promise.all([Ge(e),b()]),a=!!t&&!!n&&n!==t.trim(),s=!!r&&y().trim()!==r.trim();i(),a&&D((0,P.jsx)(f,{message:`updating ${e} package...`})),s&&D((0,P.jsx)(f,{message:`updating client...`}));let l=(yield Promise.all([n?a?WH(e,n):void 0:`Failed to fetch the latest ${e} version`,s?GH(r.trim()):void 0])).filter(e=>!!e);i(),l.length?l.forEach(e=>E((0,P.jsx)(c,{message:e}))):D(!a&&!s?(0,P.jsx)(o,{message:`already up to date`}):(0,P.jsx)(o,{message:`updated ${e} to the latest version: ${n}`}))}),qH=String.raw`[\w@.\\/-]+\.(?:mdx?|jsx?|tsx?|json|ya?ml)\b`,JH=new RegExp(qH),YH=[new RegExp(String.raw`\(in (${qH}),`),new RegExp(String.raw`(?:\bin|imported from) (${qH})`)],XH=/* @__PURE__ */ new Set([`missing-file`,`invalid-import-path`,`import-resolution-error`,`default-import-no-default-export`,`export-collision`,`undeclared-package`,`package-import-conflict`]),ZH=/^:(\d+)(?::(\d+))?/,QH=/"([^"]+)"/,$H=(e,t)=>{let n=Vn(t.message).trim(),r=t.file==null&&XH.has(t.type)?YH.map(e=>e.exec(n)?.[1]).find(Boolean):void 0,i=t.file!=null||r||t.type===`missing-nav-page`?null:JH.exec(n),a=r??i?.[0],o=t.file??(a?ee(Oe(a)):e.configFile),s=i?ZH.exec(n.slice(i.index+i[0].length)):null,c=t.file==null&&o===e.configFile?QH.exec(n)?.[0]:void 0,l=t.ref!=null&&t.line==null?e.locate(o,JSON.stringify(t.ref)):c?e.locate(o,c):void 0;return Object.assign(Object.assign(Object.assign({file:o},t.line==null?s&&Object.assign({line:Number(s[1])},s[2]&&{column:Number(s[2])}):Object.assign({line:t.line},t.column!=null&&{column:t.column})),l),{message:n})},eU=/* @__PURE__ */ new Set([`parse-error`]),tU=(e,t,n,r,i=`error`)=>{for(let e of n)eU.add(e);return{id:e,group:t,severity:i,needsBuild:!0,scope:`site`,description:r,check:e=>(e.build?.warnings??[]).filter(({type:e})=>n.includes(e)).map(t=>$H(e,t))}},nU=[tU(`missing-nav-page`,`nav`,[`missing-nav-page`],`pages in the navigation that have no file`),tU(`missing-file`,`content`,[`missing-file`],`imported files that don't exist`),tU(`import-error`,`content`,[`invalid-import-path`,`import-resolution-error`,`default-import-no-default-export`,`export-collision`],`imports in pages and snippets that don't resolve`),tU(`package-import`,`config`,[`undeclared-package`,`package-import-conflict`],`npm package imports that are undeclared or conflict`),tU(`openapi-build`,`openapi`,[`openapi`],`OpenAPI pages the build could not generate`),tU(`url-collision`,`config`,[`url-collision`],`generated pages whose names differ only by case and get a new URL`,`warning`),{id:`build-failed`,group:`config`,severity:`error`,needsBuild:!0,scope:`site`,description:`the strict build failed for a reason no rule reports`,check:e=>{if(!e.build||e.build.passed)return[];let t=t=>t.type===`parse-error`&&e.selected!==void 0&&!e.selected.has($H(e,t).file),n=e.build.warnings.filter(e=>!e.notice&&!eU.has(e.type)||t(e)).map(t=>$H(e,t));return e.build.strict?n:[...n,{file:e.configFile,message:e.build.error}]}}],rU=(e,t)=>(e.build?.warnings??[]).filter(e=>e.type===t).map(t=>$H(e,t)),iU=e=>e.trim().replace(/\s+/g,` `),aU=dn().use(Wt),oU=e=>e.children.find(e=>e.type===`heading`),sU=e=>{let t=structuredClone(e),n={type:`root`,children:[t]};return aU.runSync(n),mn(t)},cU={id:`duplicate-h1`,group:`content`,severity:`warning`,scope:`file`,description:`remove a first heading that repeats the frontmatter title`,pagesOnly:!0,needsAnchorLinks:!0,check:({tree:e,frontmatter:t,content:n,file:r,anchorLinks:i})=>{let{title:a,mode:o}=t;if(typeof a!=`string`||p.includes(String(o)))return[];let s=oU(e);if(!s||s.depth!==1||iU(mn(s))!==iU(a))return[];let c=s.position?.start.offset??0,l=s.position?.end.offset??c,u={line:s.position?.start.line,column:s.position?.start.column},d=n.indexOf(`
637
637
  `,c);if(Yt(n.slice(c,d===-1?void 0:d)))return[Object.assign(Object.assign({},u),{message:`first heading duplicates the frontmatter title; it has a custom {#id}, so remove it by hand and update links to it`})];let f=[sU(s),mn(s)].map(e=>Xt(i,r,oe(O(e)))).find(e=>e!==void 0);if(f!==void 0)return[Object.assign(Object.assign({},u),{message:`first heading duplicates the frontmatter title; links point to #${f}, so remove it by hand and update them`})];let m=/^\n*/.exec(n.slice(l))?.[0].length??0;return[Object.assign(Object.assign({},u),{message:`first heading duplicates the frontmatter title`,edit:{start:c,end:l+m,text:``}})]}},lU={note:`<Note>`,info:`<Info>`,tip:`<Tip>`,hint:`<Tip>`,success:`<Check>`,important:`<Note>`,warning:`<Warning>`,caution:`<Warning>`,danger:`<Warning>`,error:`<Warning>`,details:`<Accordion>`},uU=e=>lU[e?.toLowerCase()??``]??`a callout (<Note>, <Info>, <Tip> or <Warning>)`,dU={hint:`a callout (<Note>, <Info>, <Tip> or <Warning>)`,tabs:`<Tabs>`,tab:`<Tab title="…">`,stepper:`<Steps>`,step:`<Step title="…">`,embed:`a link or <Frame>`,"content-ref":`<Card>`,include:`a snippet import`,code:`a fenced code block`,file:`a link to the file`,swagger:`an OpenAPI page`,openapi:`an OpenAPI page`},fU=[{regex:/\{%-?\s*(?!end)([\w-]+)[^%\n]*?-?%\}/g,message:([e,t])=>{let n=t===`hint`?/style=["']?(\w+)/.exec(e)?.[1]:void 0;return`${e} is a GitBook or Liquid tag, which Mintlify does not support; use ${n?uU(n):dU[t??``]??`Markdown or a Mintlify component`}`}},{regex:/\{\{[<%]\s*([\w/-]+)[^}\n]*[>%]\}\}/g,message:([e])=>`${e} is a Hugo shortcode, which Mintlify does not support; use Markdown or a Mintlify component`},{regex:/\{\{-?\s*(?:(?:site|page|layout|include|jekyll|paginator)\.[^}\n]*|[^\s|{}]+\s*\|\s*\w+[^}\n]*)-?\}\}/g,message:([e])=>`${e} is a Liquid variable, which Mintlify does not support; write the value, or use a snippet or a variable`},{regex:/^ {0,3}:{3,}\s*([A-Za-z][\w-]*)/gm,message:([,e])=>`:::${e} is a Docusaurus or VitePress admonition, which Mintlify does not support; use ${uU(e)}`},{regex:/^ {0,3}::(?!:)([A-Za-z][\w-]*)/gm,message:([,e])=>`::${e} is an MDC (Nuxt Content, Docus) block, which Mintlify does not support; use the matching Mintlify component`},{regex:/^ {0,3}(!!!|\?\?\?\+?)[ \t]+([A-Za-z][\w-]*)/gm,message:([,e,t])=>`${e} ${t} is an MkDocs admonition, which Mintlify does not support; use ${e===`!!!`?uU(t):`<Accordion>`}`},{regex:/^ {0,3}===\+?[ \t]+["']/gm,message:()=>`=== "…" is an MkDocs content tab, which Mintlify does not support; use <Tabs> with <Tab title="…">`},{regex:/^[ \t]*;?[ \t]*--8<--/gm,scope:`everything`,message:()=>`--8<-- is an MkDocs snippet include, which Mintlify does not support; use a snippet import or paste the content`},{regex:/\{:\s*[.#\w][^}\n]*\}/g,message:([e])=>`${e} is a Kramdown attribute list, which Mintlify does not support; remove it, use a component, or use {#id} for a heading anchor`},{regex:/(?<![[{\w])\[\[([^[\]\n]+)\]\](?![(:[])/g,message:([e])=>`${e} is a wiki link, which Mintlify does not support; use a Markdown link such as [text](/path)`},{regex:/(?:\]\(|href=["'])((?:doc|ref|blog|changelog|page):[^)\s"']+)/g,scope:`links`,message:([,e])=>`${e} is a ReadMe link, which Mintlify does not support; link to the page path instead, such as /${e?.split(`:`)[1]??``}`},{regex:/["'(]@site\/[^"')\s]*/g,scope:`prose-and-esm`,message:([e])=>`${e.slice(1)} uses the Docusaurus @site alias, which Mintlify does not resolve; use a root-relative path such as /images/… or /snippets/…`}],pU={id:`foreign-syntax`,group:`content`,severity:`warning`,scope:`file`,description:`syntax from another docs framework that Mintlify doesn't render`,raw:!0,check:({content:e})=>{let t=rn(e),n=Qt(e),r={prose:t,links:t,"prose-and-esm":rn(e,{keepEsm:!0}),everything:tn(e)},i=[];for(let{regex:a,scope:o=`prose`,message:s}of fU)for(let c of r[o].matchAll(a)){let r=c.index+(c[0].length-c[0].trimStart().length);(o!==`prose`||n[r]===t[r])&&i.push(Object.assign(Object.assign({},Gt(e,r)),{message:s(c)}))}return i}},mU={id:`katex`,group:`content`,severity:`warning`,scope:`file`,description:`math that KaTeX can't render`,check:({tree:e,content:t})=>{let n=[];return pn(e,e=>{if((e.type===`math`||e.type===`inlineMath`)&&!(e.type===`inlineMath`&&Dn(e,t)))try{xl.renderToString(e.value,{throwOnError:!0,displayMode:e.type===`math`})}catch(t){n.push({line:e.position?.start.line,column:e.position?.start.column,message:t instanceof Error?t.message:`invalid math`})}}),n}},hU=(e,t)=>!e.startsWith(`/`)&&(t(`_snippets/${e}`)!==void 0||e.startsWith(`snippets/`)&&t(e)!==void 0),gU={id:`missing-snippet`,group:`content`,severity:`error`,scope:`file`,description:`<Snippet file> tags whose file the build cannot find`,check:({tree:e,readFile:t,variables:n})=>{if(!t)return[];let r=[];return pn(e,`mdxJsxFlowElement`,e=>{if(e.name!==`Snippet`)return;let i=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`file`)?.value;if(typeof i!=`string`)return;let a=j(i,n);hU(a,t)||r.push({line:e.position?.start.line,column:e.position?.start.column,message:`<Snippet file="${i}"> renders nothing: no snippet matches "${a}"`})}),r}},_U=/(?<!=\s*)\{\{\s*([\w.\-]+)\s*\}\}/g,vU={id:`undefined-variable`,group:`content`,severity:`error`,scope:`file`,description:`{{variables}} that docs.json does not define`,raw:!0,check:({content:e,variables:t={}})=>[...rn(e).matchAll(_U)].filter(([,e])=>e!==void 0&&t[e]===void 0).map(t=>Object.assign(Object.assign({},Gt(e,t.index)),{message:`{{${t[1]}}} is not defined in the variables of docs.json`}))},yU=Sl.filter(e=>e!==`image`),bU=String.raw`"[^"]*"|'[^']*'|\{[^{}]*\}|[^<>"'{}]`,xU=new RegExp(String.raw`<(${yU.join(`|`)})(?=[\s/>])(?:${bU})*?(\/?)>`,`g`),SU={id:`void-tags`,group:`content`,severity:`error`,scope:`file`,description:`self-close void HTML tags (<br>, <img>, <source>, …); MDX can't parse them unclosed`,raw:!0,check:({content:e})=>{let t=Qt(e),n=[];for(let r of t.matchAll(xU)){if(r[2])continue;let i=r.index,a=i+r[0].length;if(RegExp(`^\\s*</${r[1]}\\s*>`).test(t.slice(a)))continue;let o=e.slice(0,i).split(`
638
638
  `);n.push({line:o.length,column:(o.pop()?.length??0)+1,message:`<${r[1]}> must be self-closed`,edit:{start:i,end:a,text:`${e.slice(i,a-1).trimEnd()} />`}})}return n}};var CU=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 wU={id:`openapi-spec`,group:`openapi`,severity:`error`,scope:`site`,description:`OpenAPI specs in docs.json or mint.json that don't parse or validate, with overlays applied`,check:e=>CU(void 0,void 0,void 0,function*(){let t=[];try{let n=JSON.parse(yield Hn.readFile(In.join(e.baseDir,e.configFile),`utf-8`));t=gH(e.configFile===`mint.json`?{api:{openapi:n.openapi}}:n)}catch{}if(t.length===0)return[];let n;try{n=yield _H(e.localSchema)}catch(t){return[{file:e.configFile,message:`OpenAPI overlays: ${Ve(t)}`}]}return(yield Promise.all(t.map(t=>CU(void 0,void 0,void 0,function*(){let r=[];return yield yH(t,e.localSchema,n,e=>r.push(e)),r.flatMap(({level:e,message:n})=>e===`error`?[{file:t,message:n}]:e===`warning`?[{file:t,message:n,severity:`warning`}]:[])})))).flat()})},TU=[SU,cU,nn,vU,gU,mU,pU,...Kt,wU,...nU],EU=[`content`,`nav`,`config`,`openapi`];var DU=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())})},OU=class extends Error{};const kU=()=>TU.map(({id:e})=>e).join(`, `),AU=e=>{if(e===`all`)return TU;let t=TU.find(({id:t})=>t===e);if(t)return[t];if(EU.includes(e))return TU.filter(({group:t})=>t===e);throw new OU(`unknown rule or group "${e}". Groups: all, ${EU.join(`, `)}. Rules: ${kU()}`)},jU=({enable:e=[],disable:t=[]})=>{if([...t,...e].includes(en.id))throw new OU(`${en.id} always runs and can't be disabled`);let n=new Set(TU);for(let e of t)for(let t of AU(e))n.delete(t);for(let t of e)for(let e of AU(t))n.add(e);return TU.filter(e=>n.has(e))},MU=(e,t)=>Object.assign(Object.assign({},t),{rule:e.id,group:e.group,severity:t.severity??e.severity}),NU=new Map(TU.map(({id:e},t)=>[e,t])),PU=e=>e.sort((e,t)=>(e.file<t.file?-1:+(e.file>t.file))||(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0)||(NU.get(e.rule)??0)-(NU.get(t.rule)??0)),FU=(e,t,n,r)=>{let i=new Set(e.filter(e=>e.rule===t.id).map(r));for(let a of n)i.has(r(a))||(i.add(r(a)),e.push(MU(t,a)))},IU=(e,t,n)=>FU(t,en,n.filter(({file:t})=>!e.selected||e.selected.has(t)),({file:e})=>e),LU=e=>e.filter(e=>e.scope===`file`),RU=(e,t,n,r)=>DU(void 0,void 0,void 0,function*(){for(let i of t)if(i.scope===`site`&&!!i.needsBuild===n)for(let t of yield i.check(e))r.push(MU(i,t))}),zU=(e,t)=>DU(void 0,void 0,void 0,function*(){let n=yield on(e,LU(t));return yield RU(e,t,!1,n),PU(n)}),BU=(e,t,n)=>DU(void 0,void 0,void 0,function*(){return yield RU(e,t,!0,n),IU(e,n,rU(e,`parse-error`)),PU(n)}),VU=(e,t,n)=>{let r=Jt(e,t,n);return`error`in r?0:r.approximate?1:2},HU=(e,t)=>DU(void 0,void 0,void 0,function*(){let n=t=>e.read(t)??``,r=/* @__PURE__ */ new Map,i=({file:e,start:t,end:n})=>(r.get(e)??[]).some(({fix:e})=>t<e.end&&e.start<n);for(let{rule:e,fix:a}of t){if(!a||i(a))continue;let t=n(a.file),o=Object.assign(Object.assign({rule:e,file:a.file},Gt(t,a.start)),{before:t.slice(a.start,a.end),after:a.text});r.set(a.file,[...r.get(a.file)??[],{fix:a,change:o}])}let a=new Set(e.files.filter(({kind:e})=>e===`snippet`).map(({file:e})=>e)),o=(t,n)=>VU(t,a.has(t)?j(n,e.variables):n,e.baseDir),s=[];for(let[t,i]of r){let r=n(t),a=sn(r,Zt(i.map(({fix:e})=>e)));/\.mdx?$/.test(t)&&o(t,a)<o(t,r)||(yield Hn.writeFile(In.join(e.baseDir,t),a),s.push(...i.map(({change:e})=>e)))}return s}),UU=(e,t,n)=>DU(void 0,void 0,void 0,function*(){let r=[],i=yield $t(e,n),a=t.filter(({theme:e})=>e===void 0||e===i.themeVersion),{selected:o}=n;if(o&&!i.files.some(({file:e})=>o.has(e)))throw new OU(`none of the given files are pages or snippets of this site: ${[...o].join(`, `)}`);let s=yield zU(i,a);if(!n.fix)return{site:i,diagnostics:s,fixed:r};let c=s;for(let t=0;t<5;t++){let t=yield HU(i,c);if(t.length===0)break;r.push(...t),i=yield $t(e,n);let o=new Set(t.map(({file:e})=>e));c=PU(yield on(Object.assign(Object.assign({},i),{selected:o}),LU(a)))}return r.length===0?{site:i,diagnostics:s,fixed:r}:{site:i,diagnostics:yield zU(i,a),fixed:r}}),WU=e=>{let t=JSON.stringify(e);return t.length>60?`${t.slice(0,57)}..."`:t},GU=({line:e,column:t})=>e?`${e}${t?`:${t}`:``}`:``,KU=({diagnostic:e})=>{let t=GU(e);return(0,P.jsxs)(M,{children:[` `,e.severity===`error`?(0,P.jsx)(M,{color:`red`,children:`✗`}):(0,P.jsx)(M,{color:`yellow`,children:`!`}),` `,t&&(0,P.jsxs)(M,{dimColor:!0,children:[t,` `]}),(0,P.jsx)(M,{dimColor:!0,children:e.rule}),` `,e.message,e.fix&&(0,P.jsx)(M,{dimColor:!0,children:` (fixable)`})]})},qU=(e,t)=>`${e} ${t}${e===1?``:`s`}`,JU=e=>{for(let t of e.fixed??[])D((0,P.jsx)(o,{message:`fixed ${t.file}${t.line?`:${t.line}`:``} ${t.rule}: ${WU(t.before)} → ${WU(t.after)}`}));let t=/* @__PURE__ */ new Map;for(let n of e.diagnostics)t.get(n.file)?.push(n)??t.set(n.file,[n]);for(let[e,n]of t)D((0,P.jsxs)(ke,{flexDirection:`column`,marginBottom:1,children:[(0,P.jsx)(M,{bold:!0,children:e}),n.map((e,t)=>(0,P.jsx)(KU,{diagnostic:e},t))]}));let n=e.diagnostics.filter(({fix:e})=>e).length;n>0&&!e.fixed&&D((0,P.jsx)(u,{message:`\`--fix\` would fix ${qU(n,`issue`)}.`}));let{build:r}=e;r.ran&&r.passed?D((0,P.jsx)(o,{message:`build passed`})):r.ran&&e.passed?D((0,P.jsx)(u,{message:`build failed only on disabled rules`})):r.ran?D((0,P.jsx)(c,{message:`build failed`})):r.reason===`errors found`&&D((0,P.jsx)(u,{message:`build skipped until the errors above are fixed`}));let{errors:i,warnings:a}=e.summary,s=qU(a,`warning`),l=a>0?`passed with ${s}`:`validation passed`,d=`${qU(i,`error`)}${a>0?`, ${s}`:``}`;D(e.passed?(0,P.jsx)(o,{message:l}):(0,P.jsx)(c,{message:d}))},YU=(e,t,n)=>{let r={};for(let{rule:t}of e)r[t]=(r[t]??0)+1;let i=e.filter(({severity:e})=>e===`error`).length;return Object.assign({passed:i===0,summary:{errors:i,warnings:e.length-i,byRule:r},diagnostics:e.map(({rule:e,group:t,severity:n,file:r,line:i,column:a,message:o,fix:s})=>Object.assign(Object.assign(Object.assign(Object.assign({rule:e,group:t,severity:n,file:r},i!==void 0&&{line:i}),a!==void 0&&{column:a}),{message:o}),s&&{fix:s})),build:t},n&&{fixed:n})};var XU=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())})},ZU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const QU={passed:0,failed:1,crashed:2},$U=e=>e.flatMap(e=>e.split(`,`).map(e=>e.trim()).filter(Boolean)),eW=e=>new Promise(t=>{process.stdout.write(e,()=>t())}),tW=()=>{let e={log:console.log,info:console.info,warn:console.warn,error:console.error};return console.log=console.info=console.warn=console.error=(...e)=>{process.stderr.write(`${Bn(...e)}\n`)},()=>Object.assign(console,e)},nW=(e,t)=>XU(void 0,void 0,void 0,function*(){let n=(t??[]).map(String).filter(Boolean);if(n.length===0)return;let r=yield pm(et,n);return new Set(r.map(t=>In.relative(e,In.resolve(et,t)).split(In.sep).join(`/`)))}),rW=(e,t,...n)=>XU(void 0,[e,t,...n],void 0,function*(e,t,n=et){let r=e.format===`json`,a=r?tW():void 0;try{let o=jU({enable:e.enable,disable:e.disable??[]}),s=yield nW(n,e.files);r||D((0,P.jsx)(f,{message:`validating...`}));let c=yield UU(n,o,{selected:s,localSchema:e[`local-schema`],fix:e.fix}),{site:l,fixed:u}=c,{diagnostics:d}=ZU(c,[`site`,`fixed`]),p=o.some(({needsBuild:e})=>e),m;if(!e.build)m={ran:!1,reason:`disabled`};else if(!p)m={ran:!1,reason:`no build rules`};else if(d.some(({severity:e})=>e===`error`))m={ran:!1,reason:`errors found`};else{r||D((0,P.jsx)(f,{message:`building...`}));let{cli:n}=Ke(t);l.build=yield v(Object.assign(Object.assign({},e),{_:[],$0:t,packageName:t,cliVersion:n,disableOpenapi:!o.some(({group:e})=>e===`openapi`)})),d=yield BU(l,o,d),m={ran:!0,passed:l.build.passed}}let h=YU(d,m,e.fix?u:void 0);r?(a?.(),yield eW(`${JSON.stringify(h)}\n`)):(i(),JU(h),h.passed&&m.ran&&m.passed&&(yield BH())),yield N(h.passed?QU.passed:QU.failed)}catch(e){r?(a?.(),process.stderr.write(`Error: ${Ve(e)}\n`)):(i(),D((0,P.jsx)(c,{message:Ve(e)}))),yield N(QU.crashed)}}),iW=w.hex(`#18E299`),aW=[{title:`Preview`,commands:[{name:`dev`,description:`Start a local preview of your site`},{name:`new`,description:`Scaffold a new documentation site`},{name:`deploy`,description:`Provision a docs site without login; get Git push instructions`}]},{title:`Quality`,commands:[{name:`validate`,description:`Validate the site build (strict)`},{name:`broken-links`,description:`Find broken links before you ship`},{name:`a11y`,description:`Check site for accessibility issues`},{name:`score`,description:`Run agent-readiness checks`}]},{title:`Insights`,commands:[{name:`analytics`,description:`View analytics for your site`},{name:`automations`,description:`Create and manage automations`}]},{title:`Account`,commands:[{name:`login`,description:`Authenticate with Mintlify`},{name:`claim`,description:`Claim a site created with mint deploy`},{name:`logout`,description:`Sign out on this device`},{name:`status`,description:`View authentication status`}]},{title:`CLI`,commands:[{name:`agent setup`,description:`Install Mintlify skills and configure Admin MCP`},{name:`config`,description:`Manage CLI configuration`},{name:`instructions`,description:`Print Mintlify workflow instructions`},{name:`update`,description:`Update to the latest version`}]}],oW=[{name:`dev`,description:`Start a local preview of your site`},{name:`new docs`,description:`Scaffold a new site in ./docs`},{name:`claim`,description:`Get a claim link; use the deployment directory`},{name:`validate`,description:`Validate your site before shipping`},{name:`broken-links`,description:`Find broken links across your site`}],sW=aW.flatMap(e=>e.commands).reduce((e,t)=>Math.max(e,t.name.length),0)+2,cW=(e,t,n,r)=>` `.repeat(r)+iW(e.padEnd(n))+w.dim(t);function lW({packageName:e,version:t,signedIn:n,subdomain:r}){let i=`${e.charAt(0).toUpperCase()}${e.slice(1)} CLI`,a=t?/^\d/.test(t)?`v${t}`:t:void 0,o=[w.bold(i)+(a?w.dim(` ${a}`):``),``,n?w.dim(`Signed in to Mintlify`):w.dim(`Run `)+iW(`${e} login`)+w.dim(` to sign in`),...r?[w.dim(`Project ${r}`)]:[]],s=[``];s.push(...o);let c=oW.reduce((t,n)=>Math.max(t,`${e} ${n.name}`.length),0)+2;s.push(``,` `+w.bold(`EXAMPLES`));for(let t of oW)s.push(cW(`${e} ${t.name}`,t.description,c,3));s.push(``,` `+w.bold(`COMMANDS`));for(let e of aW){s.push(``,` `+w.bold(e.title));for(let t of e.commands)s.push(cW(t.name,t.description,sW,5))}return s.push(``,` `+w.dim(`Run `)+iW(`${e} <command> --help`)+w.dim(` for details on any command.`),``),s.join(`
639
639
  `)+`
@@ -659,4 +659,4 @@ Pass --knowledge-base to provision a knowledge base instead of a docs site. The
659
659
  In GitHub Actions (GITHUB_ACTIONS=true), no agent credentials are used: the workflow needs \`permissions: id-token: write\`, --subdomain is required, and the current commit is force-pushed to the site from a trusted repository and branch.`),e=>kW(void 0,void 0,void 0,function*(){try{if(e.base&&process.stderr.write(`Warning: --base is deprecated and will be removed in a future release. Use --knowledge-base instead.
660
660
  `),Im()){let t=yield Vm({apiUrl:rt,directory:e.directory,subdomain:e.subdomain},e=>process.stderr.write(`${e}\n`));process.stdout.write(`Pushed to ${e.subdomain}; the build starts now.\nSite: ${t}\n`),yield N(0);return}if(e.github){let t=yield ih({apiUrl:rt,directory:e.directory,subdomain:e.subdomain,orgName:e.orgName,newSite:e.new,force:e.force},e=>process.stderr.write(`Warning: ${e}\n`),e=>process.stderr.write(`${e}\n`));process.stdout.write(`${ah(t)}\n`),yield N(0);return}let t=yield Am({apiUrl:rt,directory:e.directory,subdomain:e.subdomain,orgName:e.orgName,newSite:e.new,base:e.knowledgeBase||e.base},e=>{process.stderr.write(`Warning: ${e}\n`)},e=>process.stderr.write(`${e}\n`));if(e.push&&t.status===`ready`){yield Um(e.push,t.write),process.stdout.write(`Pushed ${e.push} to the knowledge base.\nEditor: ${Mm(t.site)}\n`),yield N(0);return}process.stdout.write(`${Nm(t,rt)}\n`);let n;if(e.email&&t.status===`ready`)try{process.stderr.write(`Creating the claim link...
661
661
  `),n=yield bd(rt,t.credentials,e.email)}catch(e){let t=e instanceof Error?` ${e.message}`:``;process.stderr.write(`Warning: Could not create the claim link.${t} Your site is provisioned; run mint claim for a claim link.\n`)}process.stdout.write(`${qm(t,n)}\n`),yield N(0)}catch(e){process.stderr.write(`${e instanceof Error?e.message:`Deployment failed.`}\n`),yield N(1)}})).command(`dev`,`Initialize a local preview environment`,e=>Ne(e).option(`open`,{type:`boolean`,default:!0,description:`open a local preview in the browser`}).option(`local-schema`,{type:`boolean`,default:!1,hidden:!0,description:`use a locally hosted schema file (note: only https protocol is supported in production)`}).option(`client-version`,{type:`string`,hidden:!0,description:`the version of the client to use for cli testing`}).option(`local-client-version`,{type:`string`,hidden:!0,description:`path to local client repo to symlink for development`}).option(`groups`,{type:`array`,description:`Mock user groups for local development and testing`,example:`--groups admin user`}).option(`signed-in`,{type:`boolean`,default:!1,description:`Mock a signed-in user with no groups for local development and testing`}).option(`disable-openapi`,{type:`boolean`,default:!1,description:`Disable OpenAPI file generation`}).option(`disable-prefetch`,{type:`boolean`,default:!1,description:`Disable navigation prefetching in the local preview`}).option(`host`,{type:`boolean`,default:!1,description:`Expose the local preview on your network`}).option(`classic`,{type:`boolean`,default:!1,description:`Preview with the classic client`}).usage(`usage: mintlify dev [options]`).example(`mintlify dev`,`run with default settings (opens in browser)`).example(`mintlify dev --no-open`,`run without opening in browser`),t=>kW(void 0,void 0,void 0,function*(){yield Xe();let n=yield Ze(t),{cli:r}=Ke(e),i,a;try{i=(yield Yl())??void 0,a=mt(`subdomain`)??(i?(yield fu(i))[0]:void 0)}catch{}n==null?(D((0,P.jsx)(c,{message:`no available port found`})),yield N(1)):(t.classic||an(process.cwd()).catch(()=>void 0),yield T(Object.assign(Object.assign({},t),{groups:t.groups??(t.signedIn?[]:void 0),port:n,packageName:e,cliVersion:r,accessToken:i,subdomain:a,apiUrl:rt})))})).command(`validate`,`Check the docs: content, OpenAPI specs, then a strict build. Exits 0 with no errors, 1 with errors, 2 when validate itself could not run`,e=>e.option(`local-schema`,{type:`boolean`,default:!1,hidden:!0,description:`use a locally hosted schema file`}).option(`client-version`,{type:`string`,hidden:!0,description:`the version of the client to use for cli testing`}).option(`groups`,{type:`array`,description:`Mock user groups for validation`}).option(`files`,{type:`string`,array:!0,description:`Limit page checks to these files or globs; site-wide checks and the build still cover the whole site`}).option(`build`,{type:`boolean`,default:!0,description:`Run the strict build after the other checks pass; --no-build skips it, so no client download is needed. Remote OpenAPI specs are still fetched unless openapi rules are disabled`}).option(`enable`,{type:`string`,array:!0,coerce:$U,description:`Turn on rules or groups (comma-separated), for example after --disable all`}).option(`disable`,{type:`string`,array:!0,coerce:$U,description:`Turn off rules or groups (comma-separated), or all; parse errors are still reported`}).option(`fix`,{type:`boolean`,default:!1,description:`Apply the fixes and check again`}).option(`format`,{type:`string`,choices:[`text`,`json`],default:`text`,description:`Output format; json prints one report ({ passed, summary, diagnostics, build }) and nothing else on stdout, and errors to stderr`}).usage(`usage: mint validate [options]`).epilogue([`Groups: ${EU.join(`, `)}. Rules:`,...TU.map(({id:e,description:t})=>` ${e} — ${t}`),` parse-error — ${en.description} (always runs)`].join(`
662
- `)).example(`mint validate`,`run every check and the build`).example(`mint validate --no-build --format json`,`fast offline check for scripts and agents`).example(`mint validate --files "guides/**/*.mdx" --fix`,`check some pages and apply fixes`).example(`mint validate --disable all --enable content`,`run the content rules only; missing-file and import-error still run the build`).strict(),t=>rW(t,e)).command(`export`,`Export a static site for air-gapped deployment`,e=>e.option(`output`,{type:`string`,default:`export.zip`,description:`output zip file path`}).option(`client-version`,{type:`string`,hidden:!0}).option(`local-client-version`,{type:`string`,hidden:!0,description:`path to local client repo to symlink for development`}).option(`groups`,{type:`array`,description:`Mock user groups for export`}).option(`base-path`,{type:`string`,description:`path prefix the export will be served under, e.g. /docs`}).option(`disable-openapi`,{type:`boolean`,default:!1,description:`Disable OpenAPI file generation`}).option(`classic`,{type:`boolean`,default:!1,description:`Export with the classic client`}).usage(`usage: mintlify export [options]`).example(`mintlify export`,`export as export.zip`).example(`mintlify export --output docs.zip`,`export to custom filename`).example(`mintlify export --base-path /docs`,`export for hosting under /docs`),t=>kW(void 0,void 0,void 0,function*(){let{cli:n}=Ke(e);yield g(Object.assign(Object.assign({},t),{packageName:e,cliVersion:n})),yield N(0)})).command(`openapi-check <filename>`,!1,e=>e.positional(`filename`,{describe:`the filename of the OpenAPI spec (e.g. ./openapi.yaml) or the URL to the OpenAPI spec (e.g. https://petstore3.swagger.io/api/v3/openapi.json)`,type:`string`,demandOption:!0}).option(`local-schema`,{type:`boolean`,default:!1,description:`use a locally hosted schema file (note: only https protocol is supported in production)`}),e=>kW(void 0,[e],void 0,function*({filename:e,"local-schema":t}){D((0,P.jsx)(C,{message:"openapi-check is deprecated, use `mintlify validate` instead"}));let n;try{n=yield _H(t)}catch(e){D((0,P.jsx)(c,{message:e instanceof Error?e.message:String(e)})),yield N(1);return}let r=yield yH(e,t,n);yield N(+!r)})).command(`broken-links`,`Check for broken links`,e=>e.option(`files`,{type:`string`,array:!0,description:`Files or globs to check (defaults to the whole site)`}).option(`check-anchors`,{type:`boolean`,default:!1,description:`also validate anchor links (e.g. #section) against heading slugs`}).option(`check-external`,{type:`boolean`,default:!1,description:`also check external links for broken URLs`}).option(`check-snippets`,{type:`boolean`,default:!1,description:`also check links inside <Snippet> components`}).option(`check-redirects`,{type:`boolean`,default:!1,description:`also check that docs.json redirect destinations resolve to valid paths`}).option(`links-to`,{type:`string`,description:`list every internal link that points to this page (e.g. /guides/setup or /guides/setup#install) instead of checking for broken links`}).example(`mint broken-links --files introduction.mdx`,`Check a specific page`).example(`mint broken-links --files "guides/**/*.mdx"`,`Check pages matching a glob`).example(`mint broken-links --links-to /guides/setup`,`List links to a page`),e=>_m(e)).command(`instructions [topics..]`,`Print Mintlify workflow instructions for agents`,e=>e.positional(`topics`,{type:`string`,array:!0,default:[],description:`Topic and optional subtopic`}).example(`mint instructions`,`List topics`).example(`mint instructions publish domain`,`Custom domain instructions`),e=>kW(void 0,[e],void 0,function*({topics:e}){if(e.length===0){process.stdout.write(eg()),yield N(0);return}let t;try{t=yield rg(e)}catch(e){D((0,P.jsx)(c,{message:e instanceof Error?e.message:String(e)})),yield N(1);return}yield new Promise(e=>process.stdout.write(t,()=>e())),yield N(0)})).command(`status`,`View current authentication status`,()=>void 0,()=>kW(void 0,void 0,void 0,function*(){yield pu(),yield N(0)})).command(`logout`,`Logout of your Mintlify account`,()=>void 0,()=>kW(void 0,void 0,void 0,function*(){yield Zg(),yield N(0)})).command(`login`,`Authenticate your account to Mintlify`,()=>void 0,()=>kW(void 0,void 0,void 0,function*(){yield qg(),yield N(0)})).command(`signup`,`Create a new Mintlify account`,e=>e.option(`firstName`,{type:`string`,description:`First name`}).option(`lastName`,{type:`string`,description:`Last name`}).option(`company`,{type:`string`,description:`Company name`}).option(`email`,{type:`string`,description:`Email address`}).epilogue(`Note: this command does not return until the user clicks the verification link sent to their email, which can take several minutes. Non-interactive or scripted callers should run it as a background process rather than waiting on it synchronously.`),e=>kW(void 0,void 0,void 0,function*(){yield HH({firstName:e.firstName,lastName:e.lastName,company:e.company,email:e.email}),yield N(0)})).command(`add-domain <domain>`,`Add a custom domain to your deployment`,e=>e.positional(`domain`,{type:`string`,demandOption:!0,description:`The custom domain to add (e.g. docs.example.com)`}).option(`basePath`,{type:`string`,description:`Serve the docs under a base path (e.g. /docs)`}),e=>kW(void 0,void 0,void 0,function*(){yield _u(e.domain,e.basePath),yield N(0)})).command(`feedback <message>`,`Send feedback to the Mintlify team`,e=>e.positional(`message`,{type:`string`,demandOption:!0,description:`Feedback to send. Leave out API keys, tokens, and other secrets`}).option(`client-id`,{type:`string`,demandOption:!0,description:`ID for this report, so the team can tell retries apart`}).option(`category`,{choices:sh,demandOption:!0,description:`Feedback category`}).example(`$0 feedback "mint dev crashes on a missing image" --client-id 7f3a --category bug`,`Report a bug`).epilog(`Never include API keys, tokens, passwords, or other secrets in the message.`),e=>kW(void 0,void 0,void 0,function*(){let t=yield lh({message:e.message,clientId:e.clientId,category:e.category});yield N(+!t)})).command(`config`,`Manage CLI configuration`,e=>e.command(`set <key> <value>`,`Set a configuration value`,e=>e.positional(`key`,{type:`string`,demandOption:!0,description:`Config key (e.g. subdomain)`}).positional(`value`,{type:`string`,demandOption:!0,description:`Config value`}),e=>kW(void 0,void 0,void 0,function*(){let t=[`subdomain`,`dateFrom`,`dateTo`,`autoUpdate`];t.includes(e.key)?(yield lt(e.key,e.value),D((0,P.jsx)(o,{message:`${e.key} = "${e.value}"`})),yield N(0)):(D((0,P.jsx)(c,{message:`Unknown config key: "${e.key}". Valid keys: ${t.join(`, `)}`})),yield N(1))})).command(`get <key>`,`Get a configuration value`,e=>e.positional(`key`,{type:`string`,demandOption:!0,description:`Config key (e.g. subdomain, dateFrom, dateTo, autoUpdate)`}),e=>kW(void 0,void 0,void 0,function*(){let t=[`subdomain`,`dateFrom`,`dateTo`,`autoUpdate`];if(!t.includes(e.key)){D((0,P.jsx)(c,{message:`Unknown config key: "${e.key}". Valid keys: ${t.join(`, `)}`})),yield N(1);return}let n=mt(e.key);D((0,P.jsx)(M,{children:n??`not set`})),yield N(0)})).command(`clear <key>`,`Remove a configuration value`,e=>e.positional(`key`,{type:`string`,demandOption:!0,description:`Config key (e.g. subdomain, dateFrom, dateTo, autoUpdate)`}),e=>kW(void 0,void 0,void 0,function*(){let t=[`subdomain`,`dateFrom`,`dateTo`,`autoUpdate`];t.includes(e.key)?(yield gt(e.key),D((0,P.jsx)(o,{message:`${e.key} cleared`})),yield N(0)):(D((0,P.jsx)(c,{message:`Unknown config key: "${e.key}". Valid keys: ${t.join(`, `)}`})),yield N(1))})).demandCommand(1,`specify a subcommand: set, get, or clear`)).command(`update`,`Update the CLI to the latest version`,()=>void 0,()=>kW(void 0,void 0,void 0,function*(){yield KH({packageName:e}),yield N(0)})).command([`a11y`,`accessibility-check`,`a11y-check`,`accessibility`],`Check for accessibility issues in documentation`,e=>e.option(`skip-contrast`,{type:`boolean`,default:!1,description:`Skip color contrast checks`}).option(`skip-alt-text`,{type:`boolean`,default:!1,description:`Skip alt text checks on images and videos`}).check(e=>{if(e.skipContrast&&e.skipAltText)throw Error(`Cannot skip both contrast and alt-text checks`);return!0}).example(`mint a11y`,`Run all accessibility checks`).example(`mint a11y --skip-contrast`,`Only check for missing alt text`).example(`mint a11y --skip-alt-text`,`Only check color contrast`),e=>kW(void 0,void 0,void 0,function*(){let t=0,n=0;e.skipContrast||(t=yield Vl()),e.skipAltText||(n=yield n_()),yield N(t||n)})).command(`og [page]`,`Render the social preview (OG) image for a page`,e=>e.positional(`page`,{type:`string`,description:`Page path, such as guides/webhooks. Defaults to index`}).option(`preset`,{choices:Se.shape.preset.unwrap().options,description:`Try a preset without editing docs.json`}).option(`surface`,{choices:Se.shape.surface.unwrap().options,description:`Try a surface without editing docs.json`}).option(`appearance`,{choices:Se.shape.appearance.unwrap().options,description:`Try an appearance without editing docs.json`}).option(`output`,{type:`string`,description:`Where to write the PNG. Defaults to a temporary file`}).option(`open`,{type:`boolean`,default:!0,description:`Open the image after rendering. Use --no-open in CI`}).example(`mint og guides/webhooks`,`Render one page and open it`).example(`mint og --preset headline --surface brand`,`Try settings on the home page`).example(`mint og --output og.png --no-open`,`Render to a file in CI`),e=>kW(void 0,void 0,void 0,function*(){yield N(yield mH(e))})).command([`version`,`v`],`Display the current version of the CLI and client`,()=>void 0,()=>kW(void 0,void 0,void 0,function*(){let{cli:t,client:n}=Ke(e);D((0,P.jsxs)(M,{children:[(0,P.jsx)(M,{bold:!0,color:`green`,children:`cli version`}),` `,t]})),D((0,P.jsxs)(M,{children:[(0,P.jsx)(M,{bold:!0,color:`green`,children:`client version`}),` `,n]}))})).command(`new [directory]`,`Create a new Mintlify documentation site`,e=>e.positional(`directory`,{describe:`The directory to initialize your documentation`,type:`string`,default:`.`}).option(`theme`,{type:`string`,description:`Theme for the documentation site`}).option(`name`,{type:`string`,description:`Name of the documentation project`}).option(`template`,{type:`string`,description:`Use a template as a starting point`}).option(`force`,{type:`boolean`,default:!1,description:`Create the documentation in a subdirectory`}),e=>kW(void 0,[e],void 0,function*({directory:e,theme:t,name:n,force:r,template:i}){try{yield Xh(e,r,t,n,i),yield N(0)}catch(e){D((0,P.jsx)(c,{message:e instanceof Error?e.message:`error occurred`})),yield N(1)}})).command(`analytics`,`View analytics for your documentation`,Kp).command([`automations`,`workflow`,`workflows`],`Create and manage automations`,OW).command(`score [url]`,`Run agent readiness checks on a docs site`,e=>e.positional(`url`,{type:`string`,description:`URL of the docs site to check (defaults to your configured subdomain)`}).option(`format`,{type:`string`,choices:[`table`,`plain`,`json`],description:`Output format`}).example(`mint score`,`Run agent readiness checks on your default subdomain`).example(`mint score docs.example.com`,`Run agent readiness checks on a URL`),IH).command(`format`,`Format MDX files in the current directory`,e=>e.usage(`usage: mint format`).example(`mint format`,`format all MDX files in the current directory`),_h).command(`migrate`,`Print instructions for migrating a docs site to Mintlify`,e=>e.option(`from`,{type:`string`,choices:p_(`sources`),description:`Include instructions for a source platform`}).option(`topic`,{type:`string`,choices:p_(`topics`),description:`Print a single topic`}).option(`agent`,{type:`string`,choices:Object.keys(__),description:`Run the migration with a coding agent`}).option(`claude`,{type:`boolean`,description:`Alias for --agent claude`}),e=>kW(void 0,void 0,void 0,function*(){let t=e.agent??(e.claude?`claude`:void 0);if(gd(`cli.migrate.executed`,{from:e.from,topic:e.topic,agent:t}),t)try{return yield N(yield y_(t,e.from))}catch(e){return D((0,P.jsx)(c,{message:e instanceof Error?e.message:String(e)})),yield N(1)}yield new Promise(t=>process.stdout.write(h_(e),()=>t())),yield N(0)})).command(`ai`,`[Coming soon] AI-powered documentation (run mint ai to vote)`,()=>void 0,ym(`ai`,e)).command(`mcp`,`[Coming soon] MCP server for documentation (run mint mcp to vote)`,()=>void 0,ym(`mcp`,e)).strictCommands().demandCommand(1,`unknown command. see above for the list of supported commands.`).alias(`h`,`help`).alias(`v`,`version`).parseAsync()};export{MW as cli};
662
+ `)).example(`mint validate`,`run every check and the build`).example(`mint validate --no-build --format json`,`fast offline check for scripts and agents`).example(`mint validate --files "guides/**/*.mdx" --fix`,`check some pages and apply fixes`).example(`mint validate --disable all --enable content`,`run the content rules only; missing-file and import-error still run the build`).strict(),t=>rW(t,e)).command(`export`,`Export a static site for air-gapped deployment`,e=>e.option(`output`,{type:`string`,default:`export.zip`,description:`output zip file path`}).option(`client-version`,{type:`string`,hidden:!0}).option(`local-client-version`,{type:`string`,hidden:!0,description:`path to local client repo to symlink for development`}).option(`groups`,{type:`array`,description:`Mock user groups for export`}).option(`base-path`,{type:`string`,description:`path prefix the export will be served under, e.g. /docs`}).option(`disable-openapi`,{type:`boolean`,default:!1,description:`Disable OpenAPI file generation`}).option(`classic`,{type:`boolean`,default:!1,description:`Export with the classic client`}).usage(`usage: mintlify export [options]`).example(`mintlify export`,`export as export.zip`).example(`mintlify export --output docs.zip`,`export to custom filename`).example(`mintlify export --base-path /docs`,`export for hosting under /docs`),t=>kW(void 0,void 0,void 0,function*(){let{cli:n}=Ke(e);yield g(Object.assign(Object.assign({},t),{packageName:e,cliVersion:n})),yield N(0)})).command(`openapi-check <filename>`,!1,e=>e.positional(`filename`,{describe:`the filename of the OpenAPI spec (e.g. ./openapi.yaml) or the URL to the OpenAPI spec (e.g. https://petstore3.swagger.io/api/v3/openapi.json)`,type:`string`,demandOption:!0}).option(`local-schema`,{type:`boolean`,default:!1,description:`use a locally hosted schema file (note: only https protocol is supported in production)`}),e=>kW(void 0,[e],void 0,function*({filename:e,"local-schema":t}){D((0,P.jsx)(C,{message:"openapi-check is deprecated, use `mintlify validate` instead"}));let n;try{n=yield _H(t)}catch(e){D((0,P.jsx)(c,{message:e instanceof Error?e.message:String(e)})),yield N(1);return}let r=yield yH(e,t,n);yield N(+!r)})).command(`broken-links`,`Check for broken links`,e=>e.option(`files`,{type:`string`,array:!0,description:`Files or globs to check (defaults to the whole site)`}).option(`check-anchors`,{type:`boolean`,default:!1,description:`also validate anchor links (e.g. #section) against heading slugs`}).option(`check-external`,{type:`boolean`,default:!1,description:`also check external links for broken URLs`}).option(`check-snippets`,{type:`boolean`,default:!1,description:`also check links inside <Snippet> components`}).option(`check-redirects`,{type:`boolean`,default:!1,description:`also check that docs.json redirect destinations resolve to valid paths`}).option(`links-to`,{type:`string`,description:`list every internal link that points to this page (e.g. /guides/setup or /guides/setup#install) instead of checking for broken links`}).example(`mint broken-links --files introduction.mdx`,`Check a specific page`).example(`mint broken-links --files "guides/**/*.mdx"`,`Check pages matching a glob`).example(`mint broken-links --links-to /guides/setup`,`List links to a page`),e=>_m(e)).command(`instructions [topics..]`,`Print Mintlify workflow instructions for agents`,e=>e.positional(`topics`,{type:`string`,array:!0,default:[],description:`Topic and optional subtopic`}).example(`mint instructions`,`List topics`).example(`mint instructions publish domain`,`Custom domain instructions`),e=>kW(void 0,[e],void 0,function*({topics:e}){if(e.length===0){process.stdout.write(eg()),yield N(0);return}let t;try{t=yield rg(e)}catch(e){D((0,P.jsx)(c,{message:e instanceof Error?e.message:String(e)})),yield N(1);return}yield new Promise(e=>process.stdout.write(t,()=>e())),yield N(0)})).command(`status`,`View current authentication status`,()=>void 0,()=>kW(void 0,void 0,void 0,function*(){yield pu(),yield N(0)})).command(`logout`,`Logout of your Mintlify account`,()=>void 0,()=>kW(void 0,void 0,void 0,function*(){yield Zg(),yield N(0)})).command(`login`,`Authenticate your account to Mintlify`,()=>void 0,()=>kW(void 0,void 0,void 0,function*(){yield qg(),yield N(0)})).command(`signup`,`Create a new Mintlify account`,()=>void 0,()=>kW(void 0,void 0,void 0,function*(){yield HH(),yield N(0)})).command(`add-domain <domain>`,`Add a custom domain to your deployment`,e=>e.positional(`domain`,{type:`string`,demandOption:!0,description:`The custom domain to add (e.g. docs.example.com)`}).option(`basePath`,{type:`string`,description:`Serve the docs under a base path (e.g. /docs)`}),e=>kW(void 0,void 0,void 0,function*(){yield _u(e.domain,e.basePath),yield N(0)})).command(`feedback <message>`,`Send feedback to the Mintlify team`,e=>e.positional(`message`,{type:`string`,demandOption:!0,description:`Feedback to send. Leave out API keys, tokens, and other secrets`}).option(`client-id`,{type:`string`,demandOption:!0,description:`ID for this report, so the team can tell retries apart`}).option(`category`,{choices:sh,demandOption:!0,description:`Feedback category`}).example(`$0 feedback "mint dev crashes on a missing image" --client-id 7f3a --category bug`,`Report a bug`).epilog(`Never include API keys, tokens, passwords, or other secrets in the message.`),e=>kW(void 0,void 0,void 0,function*(){let t=yield lh({message:e.message,clientId:e.clientId,category:e.category});yield N(+!t)})).command(`config`,`Manage CLI configuration`,e=>e.command(`set <key> <value>`,`Set a configuration value`,e=>e.positional(`key`,{type:`string`,demandOption:!0,description:`Config key (e.g. subdomain)`}).positional(`value`,{type:`string`,demandOption:!0,description:`Config value`}),e=>kW(void 0,void 0,void 0,function*(){let t=[`subdomain`,`dateFrom`,`dateTo`,`autoUpdate`];t.includes(e.key)?(yield lt(e.key,e.value),D((0,P.jsx)(o,{message:`${e.key} = "${e.value}"`})),yield N(0)):(D((0,P.jsx)(c,{message:`Unknown config key: "${e.key}". Valid keys: ${t.join(`, `)}`})),yield N(1))})).command(`get <key>`,`Get a configuration value`,e=>e.positional(`key`,{type:`string`,demandOption:!0,description:`Config key (e.g. subdomain, dateFrom, dateTo, autoUpdate)`}),e=>kW(void 0,void 0,void 0,function*(){let t=[`subdomain`,`dateFrom`,`dateTo`,`autoUpdate`];if(!t.includes(e.key)){D((0,P.jsx)(c,{message:`Unknown config key: "${e.key}". Valid keys: ${t.join(`, `)}`})),yield N(1);return}let n=mt(e.key);D((0,P.jsx)(M,{children:n??`not set`})),yield N(0)})).command(`clear <key>`,`Remove a configuration value`,e=>e.positional(`key`,{type:`string`,demandOption:!0,description:`Config key (e.g. subdomain, dateFrom, dateTo, autoUpdate)`}),e=>kW(void 0,void 0,void 0,function*(){let t=[`subdomain`,`dateFrom`,`dateTo`,`autoUpdate`];t.includes(e.key)?(yield gt(e.key),D((0,P.jsx)(o,{message:`${e.key} cleared`})),yield N(0)):(D((0,P.jsx)(c,{message:`Unknown config key: "${e.key}". Valid keys: ${t.join(`, `)}`})),yield N(1))})).demandCommand(1,`specify a subcommand: set, get, or clear`)).command(`update`,`Update the CLI to the latest version`,()=>void 0,()=>kW(void 0,void 0,void 0,function*(){yield KH({packageName:e}),yield N(0)})).command([`a11y`,`accessibility-check`,`a11y-check`,`accessibility`],`Check for accessibility issues in documentation`,e=>e.option(`skip-contrast`,{type:`boolean`,default:!1,description:`Skip color contrast checks`}).option(`skip-alt-text`,{type:`boolean`,default:!1,description:`Skip alt text checks on images and videos`}).check(e=>{if(e.skipContrast&&e.skipAltText)throw Error(`Cannot skip both contrast and alt-text checks`);return!0}).example(`mint a11y`,`Run all accessibility checks`).example(`mint a11y --skip-contrast`,`Only check for missing alt text`).example(`mint a11y --skip-alt-text`,`Only check color contrast`),e=>kW(void 0,void 0,void 0,function*(){let t=0,n=0;e.skipContrast||(t=yield Vl()),e.skipAltText||(n=yield n_()),yield N(t||n)})).command(`og [page]`,`Render the social preview (OG) image for a page`,e=>e.positional(`page`,{type:`string`,description:`Page path, such as guides/webhooks. Defaults to index`}).option(`preset`,{choices:Se.shape.preset.unwrap().options,description:`Try a preset without editing docs.json`}).option(`surface`,{choices:Se.shape.surface.unwrap().options,description:`Try a surface without editing docs.json`}).option(`appearance`,{choices:Se.shape.appearance.unwrap().options,description:`Try an appearance without editing docs.json`}).option(`output`,{type:`string`,description:`Where to write the PNG. Defaults to a temporary file`}).option(`open`,{type:`boolean`,default:!0,description:`Open the image after rendering. Use --no-open in CI`}).example(`mint og guides/webhooks`,`Render one page and open it`).example(`mint og --preset headline --surface brand`,`Try settings on the home page`).example(`mint og --output og.png --no-open`,`Render to a file in CI`),e=>kW(void 0,void 0,void 0,function*(){yield N(yield mH(e))})).command([`version`,`v`],`Display the current version of the CLI and client`,()=>void 0,()=>kW(void 0,void 0,void 0,function*(){let{cli:t,client:n}=Ke(e);D((0,P.jsxs)(M,{children:[(0,P.jsx)(M,{bold:!0,color:`green`,children:`cli version`}),` `,t]})),D((0,P.jsxs)(M,{children:[(0,P.jsx)(M,{bold:!0,color:`green`,children:`client version`}),` `,n]}))})).command(`new [directory]`,`Create a new Mintlify documentation site`,e=>e.positional(`directory`,{describe:`The directory to initialize your documentation`,type:`string`,default:`.`}).option(`theme`,{type:`string`,description:`Theme for the documentation site`}).option(`name`,{type:`string`,description:`Name of the documentation project`}).option(`template`,{type:`string`,description:`Use a template as a starting point`}).option(`force`,{type:`boolean`,default:!1,description:`Create the documentation in a subdirectory`}),e=>kW(void 0,[e],void 0,function*({directory:e,theme:t,name:n,force:r,template:i}){try{yield Xh(e,r,t,n,i),yield N(0)}catch(e){D((0,P.jsx)(c,{message:e instanceof Error?e.message:`error occurred`})),yield N(1)}})).command(`analytics`,`View analytics for your documentation`,Kp).command([`automations`,`workflow`,`workflows`],`Create and manage automations`,OW).command(`score [url]`,`Run agent readiness checks on a docs site`,e=>e.positional(`url`,{type:`string`,description:`URL of the docs site to check (defaults to your configured subdomain)`}).option(`format`,{type:`string`,choices:[`table`,`plain`,`json`],description:`Output format`}).example(`mint score`,`Run agent readiness checks on your default subdomain`).example(`mint score docs.example.com`,`Run agent readiness checks on a URL`),IH).command(`format`,`Format MDX files in the current directory`,e=>e.usage(`usage: mint format`).example(`mint format`,`format all MDX files in the current directory`),_h).command(`migrate`,`Print instructions for migrating a docs site to Mintlify`,e=>e.option(`from`,{type:`string`,choices:p_(`sources`),description:`Include instructions for a source platform`}).option(`topic`,{type:`string`,choices:p_(`topics`),description:`Print a single topic`}).option(`agent`,{type:`string`,choices:Object.keys(__),description:`Run the migration with a coding agent`}).option(`claude`,{type:`boolean`,description:`Alias for --agent claude`}),e=>kW(void 0,void 0,void 0,function*(){let t=e.agent??(e.claude?`claude`:void 0);if(gd(`cli.migrate.executed`,{from:e.from,topic:e.topic,agent:t}),t)try{return yield N(yield y_(t,e.from))}catch(e){return D((0,P.jsx)(c,{message:e instanceof Error?e.message:String(e)})),yield N(1)}yield new Promise(t=>process.stdout.write(h_(e),()=>t())),yield N(0)})).command(`ai`,`[Coming soon] AI-powered documentation (run mint ai to vote)`,()=>void 0,ym(`ai`,e)).command(`mcp`,`[Coming soon] MCP server for documentation (run mint mcp to vote)`,()=>void 0,ym(`mcp`,e)).strictCommands().demandCommand(1,`unknown command. see above for the list of supported commands.`).alias(`h`,`help`).alias(`v`,`version`).parseAsync()};export{MW as cli};
package/dist/start.js CHANGED
@@ -5,4 +5,4 @@ import { dirname as __mintDirname } from 'node:path';
5
5
  const require = __mintCreateRequire(import.meta.url);
6
6
  const __filename = __mintFileURLToPath(import.meta.url);
7
7
  const __dirname = __mintDirname(__filename);
8
- import{r as e}from"./client-DXQ6Tgw0.js";var t=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 n(e,n=e=>process.exit(e)){let r;return i=>(r??=t(this,void 0,void 0,function*(){try{yield e()}catch(e){return console.error(`Preview cleanup failed:`,e),n(1)}return n(i)}),r)}var r=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 i=process.env.MINTLIFY_PACKAGE_NAME??`mint`;let a;function o(){return r(this,void 0,void 0,function*(){let e=a;a=void 0,yield e?.()})}function s(){return r(this,void 0,void 0,function*(){let e=process.argv.slice(2);if(e.some(e=>[`--multi-repo`,`--workspace`,`--setup`,`--non-interactive`].includes(e.split(`=`)[0]??``))){let{isMultiRepoDev:t,runMultiRepoDev:n}=yield import(`./multi-repo-command-jpsmcxmw.js`);if(t(e)){yield n(e,i,e=>{a=e},()=>c(0));return}}let{cli:t}=yield import(`./cli-F5_520xC.js`);yield t({packageName:i})})}s().catch(e=>r(void 0,void 0,void 0,function*(){console.error(e instanceof Error?e.message:e),yield c(1)}));const c=n(()=>r(void 0,void 0,void 0,function*(){try{yield o()}finally{yield e()}}));process.once(`beforeExit`,()=>r(void 0,void 0,void 0,function*(){try{yield o(),yield e()}catch{}})),process.on(`SIGINT`,()=>{c(130)}),process.on(`SIGTERM`,()=>{c(143)});export{};
8
+ import{r as e}from"./client-DXQ6Tgw0.js";var t=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 n(e,n=e=>process.exit(e)){let r;return i=>(r??=t(this,void 0,void 0,function*(){try{yield e()}catch(e){return console.error(`Preview cleanup failed:`,e),n(1)}return n(i)}),r)}var r=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 i=process.env.MINTLIFY_PACKAGE_NAME??`mint`;let a;function o(){return r(this,void 0,void 0,function*(){let e=a;a=void 0,yield e?.()})}function s(){return r(this,void 0,void 0,function*(){let e=process.argv.slice(2);if(e.some(e=>[`--multi-repo`,`--workspace`,`--setup`,`--non-interactive`].includes(e.split(`=`)[0]??``))){let{isMultiRepoDev:t,runMultiRepoDev:n}=yield import(`./multi-repo-command-jpsmcxmw.js`);if(t(e)){yield n(e,i,e=>{a=e},()=>c(0));return}}let{cli:t}=yield import(`./cli-Bjdy2s-s.js`);yield t({packageName:i})})}s().catch(e=>r(void 0,void 0,void 0,function*(){console.error(e instanceof Error?e.message:e),yield c(1)}));const c=n(()=>r(void 0,void 0,void 0,function*(){try{yield o()}finally{yield e()}}));process.once(`beforeExit`,()=>r(void 0,void 0,void 0,function*(){try{yield o(),yield e()}catch{}})),process.on(`SIGINT`,()=>{c(130)}),process.on(`SIGTERM`,()=>{c(143)});export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.1.81",
3
+ "version": "4.1.82",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -110,5 +110,5 @@
110
110
  "yargs": "17.7.1",
111
111
  "zod": "4.3.6"
112
112
  },
113
- "gitHead": "0db4d88fa680d02dd35a955761386c19ec0706f4"
113
+ "gitHead": "7d7593e380286a305a051ce6d9545a8ae6d4ea1b"
114
114
  }