@soybeanjs/changelog 0.3.9-beta.0 → 0.3.9-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,28 +1,2554 @@
1
- "use strict";const cliProgress=require("cli-progress"),r=require("node:process"),promises=require("node:fs/promises"),ofetch=require("ofetch"),A$1=require("dayjs"),node_fs=require("node:fs"),convertGitmoji=require("convert-gitmoji");function _interopDefaultCompat(o){return o&&typeof o=="object"&&"default"in o?o.default:o}const r__default=_interopDefaultCompat(r),A__default=_interopDefaultCompat(A$1),LogLevels={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},LogTypes={silent:{level:-1},fatal:{level:LogLevels.fatal},error:{level:LogLevels.error},warn:{level:LogLevels.warn},log:{level:LogLevels.log},info:{level:LogLevels.info},success:{level:LogLevels.success},fail:{level:LogLevels.fail},ready:{level:LogLevels.info},start:{level:LogLevels.info},box:{level:LogLevels.info},debug:{level:LogLevels.debug},trace:{level:LogLevels.trace},verbose:{level:LogLevels.verbose}};function isObject(o){return o!==null&&typeof o=="object"}function _defu(o,t,e=".",s){if(!isObject(t))return _defu(o,{},e,s);const n=Object.assign({},t);for(const i in o){if(i==="__proto__"||i==="constructor")continue;const a=o[i];a!=null&&(s&&s(n,i,a,e)||(Array.isArray(a)&&Array.isArray(n[i])?n[i]=[...a,...n[i]]:isObject(a)&&isObject(n[i])?n[i]=_defu(a,n[i],(e?`${e}.`:"")+i.toString(),s):n[i]=a))}return n}function createDefu(o){return(...t)=>t.reduce((e,s)=>_defu(e,s,"",o),{})}const defu=createDefu();function isPlainObject(o){return Object.prototype.toString.call(o)==="[object Object]"}function isLogObj(o){return!(!isPlainObject(o)||!o.message&&!o.args||o.stack)}let paused=!1;const queue=[];class Consola{constructor(t={}){const e=t.types||LogTypes;this.options=defu({...t,defaults:{...t.defaults},level:_normalizeLogLevel(t.level,e),reporters:[...t.reporters||[]]},{types:LogTypes,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const s in e){const n={type:s,...this.options.defaults,...e[s]};this[s]=this._wrapLogFn(n),this[s].raw=this._wrapLogFn(n,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(t){this.options.level=_normalizeLogLevel(t,this.options.types,this.options.level)}prompt(t,e){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(t,e)}create(t){const e=new Consola({...this.options,...t});return this._mockFn&&e.mockTypes(this._mockFn),e}withDefaults(t){return this.create({...this.options,defaults:{...this.options.defaults,...t}})}withTag(t){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+t:t})}addReporter(t){return this.options.reporters.push(t),this}removeReporter(t){if(t){const e=this.options.reporters.indexOf(t);if(e>=0)return this.options.reporters.splice(e,1)}else this.options.reporters.splice(0);return this}setReporters(t){return this.options.reporters=Array.isArray(t)?t:[t],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const t in this.options.types)console["__"+t]||(console["__"+t]=console[t]),console[t]=this[t].raw}restoreConsole(){for(const t in this.options.types)console["__"+t]&&(console[t]=console["__"+t],delete console["__"+t])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(t,e){t&&(t.__write||(t.__write=t.write),t.write=s=>{this[e].raw(String(s).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}pauseLogs(){paused=!0}resumeLogs(){paused=!1;const t=queue.splice(0);for(const e of t)e[0]._logFn(e[1],e[2])}mockTypes(t){const e=t||this.options.mockFn;if(this._mockFn=e,typeof e=="function")for(const s in this.options.types)this[s]=e(s,this.options.types[s])||this[s],this[s].raw=this[s]}_wrapLogFn(t,e){return(...s)=>{if(paused){queue.push([this,t,s,e]);return}return this._logFn(t,s,e)}}_logFn(t,e,s){if((t.level||0)>this.level)return!1;const n={date:new Date,args:[],...t,level:_normalizeLogLevel(t.level,this.options.types)};!s&&e.length===1&&isLogObj(e[0])?Object.assign(n,e[0]):n.args=[...e],n.message&&(n.args.unshift(n.message),delete n.message),n.additional&&(Array.isArray(n.additional)||(n.additional=n.additional.split(`
2
- `)),n.args.push(`
3
- `+n.additional.join(`
4
- `)),delete n.additional),n.type=typeof n.type=="string"?n.type.toLowerCase():"log",n.tag=typeof n.tag=="string"?n.tag:"";const i=(c=!1)=>{const l=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&l>0){const u=[...this._lastLog.object.args];l>1&&u.push(`(repeated ${l} times)`),this._log({...this._lastLog.object,args:u}),this._lastLog.count=1}c&&(this._lastLog.object=n,this._log(n))};clearTimeout(this._lastLog.timeout);const a=this._lastLog.time&&n.date?n.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=n.date,a<this.options.throttle)try{const c=JSON.stringify([n.type,n.tag,n.args]),l=this._lastLog.serialized===c;if(this._lastLog.serialized=c,l&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(i,this.options.throttle);return}}catch{}i(!0)}_log(t){for(const e of this.options.reporters)e.log(t,{options:this.options})}}function _normalizeLogLevel(o,t={},e=3){return o===void 0?e:typeof o=="number"?o:t[o]&&t[o].level!==void 0?t[o].level:e}Consola.prototype.add=Consola.prototype.addReporter,Consola.prototype.remove=Consola.prototype.removeReporter,Consola.prototype.clear=Consola.prototype.removeReporter,Consola.prototype.withScope=Consola.prototype.withTag,Consola.prototype.mock=Consola.prototype.mockTypes,Consola.prototype.pause=Consola.prototype.pauseLogs,Consola.prototype.resume=Consola.prototype.resumeLogs;function createConsola$1(o={}){return new Consola(o)}class BrowserReporter{constructor(t){this.options={...t},this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}_getLogFn(t){return t<1?console.__error||console.error:t===1?console.__warn||console.warn:console.__log||console.log}log(t){const e=this._getLogFn(t.level),s=t.type==="log"?"":t.type,n=t.tag||"",a=`
5
- background: ${this.typeColorMap[t.type]||this.levelColorMap[t.level]||this.defaultColor};
6
- border-radius: 0.5em;
7
- color: white;
8
- font-weight: bold;
9
- padding: 2px 0.5em;
10
- `,c=`%c${[n,s].filter(Boolean).join(":")}`;typeof t.args[0]=="string"?e(`${c}%c ${t.args[0]}`,a,"",...t.args.slice(1)):e(c,a,...t.args)}}function createConsola(o={}){return createConsola$1({reporters:o.reporters||[new BrowserReporter({})],prompt(e,s={}){return s.type==="confirm"?Promise.resolve(confirm(e)):Promise.resolve(prompt(e))},...o})}const consola=createConsola();async function execCommand(o,t,e){const{execa:s}=await import("execa");return(await s(o,t,e))?.stdout?.trim()||""}function notNullish(o){return o!=null}function partition(o,...t){const e=Array.from({length:t.length+1}).fill(null).map(()=>[]);return o.forEach((s,n,i)=>{let a=0;for(const c of t){if(c(s,n,i)){e[a].push(s);return}a+=1}e[a].push(s)}),e}function groupBy(o,t,e={}){for(const s of o){const n=s[t];e[n]||(e[n]=[]),e[n].push(s)}return e}function capitalize(o){return o.charAt(0).toUpperCase()+o.slice(1)}function join(o,t=", ",e=" and "){return!o||o.length===0?"":o.length===1?o[0]:o.length===2?o.join(e):`${o.slice(0,-1).join(t)}${e}${o.slice(-1)}`}const VERSION_REG=/v\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?/,VERSION_REG_OF_MARKDOWN=/## \[v\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?]/g,VERSION_WITH_RELEASE=/release\sv\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?/;async function getTotalGitTags(){return(await execCommand("git",["--no-pager","tag","-l","--sort=creatordate"])).split(`
11
- `)}async function getTagDateMap(){const o=await execCommand("git",["--no-pager","log","--tags","--simplify-by-decoration","--pretty=format:%ci %d"]),t="tag: ",e=new Map;return o.split(`
12
- `).filter(s=>s.includes(t)).forEach(s=>{const[n,i]=s.split(t),a=A__default(n).format("YYYY-MM-DD"),c=i.match(VERSION_REG)?.[0];c&&a&&e.set(c.trim(),a)}),e}function getFromToTags(o){const t=[];return o.forEach((e,s)=>{s<o.length-1&&t.push({from:e,to:o[s+1]})}),t}async function getLastGitTag(o=0){const t=await getTotalGitTags();return t[t.length+o-1]}async function v$1(){return await execCommand("git",["rev-parse","--abbrev-ref","HEAD"])}async function getCurrentGitBranch(){const o=await execCommand("git",["tag","--points-at","HEAD"]),t=v$1();return o||t}async function getGitHubRepo(){const o=await execCommand("git",["config","--get","remote.origin.url"]),t=o.match(/github\.com[/:]([\w\d._-]+?)\/([\w\d._-]+?)(\.git)?$/i);if(!t)throw new Error(`Can not parse GitHub repo from url ${o}`);return`${t[1]}/${t[2]}`}function isPrerelease(o){return!/^[^.]*[\d.]+$/.test(o)}function getFirstGitCommit(){return execCommand("git",["rev-list","--max-parents=0","HEAD"])}async function E(o,t="HEAD"){return(await execCommand("git",["--no-pager","log",`${o?`${o}...`:""}${t}`,'--pretty="----%n%s|%h|%an|%ae%n%b"',"--name-status"])).split(`----
13
- `).splice(1).map(e=>{const[s,...n]=e.split(`
14
- `),[i,a,c,l]=s.split("|");return{message:i,shortHash:a,author:{name:c,email:l},body:n.join(`
15
- `)}})}function x$1(o){const t=/(?<type>[a-z]+)(\((?<scope>.+)\))?(?<breaking>!)?: (?<description>.+)/i,e=/co-authored-by:\s*(?<name>.+)(<(?<email>.+)>)/gim,s=/\([a-z]*(#\d+)\s*\)/gm,n=/(#\d+)/gm,i=o.message.match(t);if(!i?.groups)return null;const a=i.groups.type,c=i.groups.scope||"",l=!!i.groups.breaking;let u=i.groups.description;const p=[];for(const g of u.matchAll(s))p.push({type:"pull-request",value:g[1]});for(const g of u.matchAll(n))p.some(_=>_.value===g[1])||p.push({type:"issue",value:g[1]});p.push({value:o.shortHash,type:"hash"}),u=u.replace(s,"").trim();const m=[o.author],f=o.body.matchAll(e);for(const g of f){const{name:_="",email:b=""}=g.groups||{},F={name:_.trim(),email:b.trim()};m.push(F)}return{...o,authors:m,resolvedAuthors:[],description:u,type:a,scope:c,references:p,isBreaking:l}}async function getGitCommits(o,t="HEAD"){return(await E(o,t)).map(e=>x$1(e)).filter(notNullish)}function C(o){return{accept:"application/vnd.github.v3+json",authorization:`token ${o}`}}async function $(o,t,e){let s="";try{s=(await ofetch.ofetch(`https://ungh.cc/users/find/${e}`))?.user?.username||""}catch(a){consola.log("e: ",a)}if(s)return s;const{repo:n,token:i}=o;if(!i)return s;if(t.length)try{s=(await ofetch.ofetch(`https://api.github.com/repos/${n}/commits/${t[0]}`,{headers:C(i)}))?.author?.login||""}catch(a){consola.log("e: ",a)}if(s)return s;try{s=(await ofetch.ofetch(`https://api.github.com/search/users?q=${encodeURIComponent(e)}`,{headers:C(i)})).items[0].login}catch(a){consola.log("e: ",a)}return s}async function getGitCommitsAndResolvedAuthors(o,t,e){const s=[],n=new Map;for await(const i of o){const a=[];for await(const[l,u]of i.authors.entries()){const{email:p,name:m}=u;if(p&&m){const f=[];l===0&&f.push(i.shortHash);const g={name:m,email:p,commits:f,login:""};if(e?.has(p)){const _=e?.get(p)||"";g.login=_}else{const _=await $(t,f,p);g.login=_,e?.set(p,_)}a.push(g),n.has(p)||n.set(p,g)}}const c={...i,resolvedAuthors:a};s.push(c)}return{commits:s,contributors:Array.from(n.values())}}function w$1(){return{cwd:r__default.cwd(),types:{feat:"\u{1F680} Features",fix:"\u{1F41E} Bug Fixes",perf:"\u{1F525} Performance",refactor:"\u{1F485} Refactors",docs:"\u{1F4D6} Documentation",build:"\u{1F4E6} Build",types:"\u{1F30A} Types",chore:"\u{1F3E1} Chore",examples:"\u{1F3C0} Examples",test:"\u2705 Tests",style:"\u{1F3A8} Styles",ci:"\u{1F916} CI"},github:{repo:"",token:r__default.env.GITHUB_TOKEN||""},from:"",to:"",tags:[],tagDateMap:new Map,capitalize:!1,emoji:!0,titles:{breakingChanges:"\u{1F6A8} Breaking Changes"},output:"CHANGELOG.md",regenerate:!1,newVersion:""}}async function h(o){let t="";try{const e=await promises.readFile(`${o}/package.json`,"utf-8");t=JSON.parse(e)?.version||""}catch{}return{newVersion:t}}async function createOptions(o){var t;const e=w$1();Object.assign(e,o);const{newVersion:s}=await h(e.cwd);if((t=e.github).repo||(t.repo=await getGitHubRepo()),e.newVersion||(e.newVersion=`v${s}`),e.from||(e.from=await getLastGitTag()),e.to||(e.to=await getCurrentGitBranch()),e.to===e.from){const n=await getLastGitTag(-1),i=await getFirstGitCommit();e.from=n||i}return e.tags=await getTotalGitTags(),e.tagDateMap=await getTagDateMap(),e.prerelease||(e.prerelease=isPrerelease(e.to)),e}function d(o,t,e){const s=o.filter(i=>e==="issues"?i.type==="issue"||i.type==="pull-request":i.type==="hash").map(i=>t?i.type==="pull-request"||i.type==="issue"?`https://github.com/${t}/issues/${i.value.slice(1)}`:`[<samp>(${i.value.slice(0,5)})</samp>](https://github.com/${t}/commit/${i.value})`:i.value),n=join(s).trim();return e==="issues"?n&&`in ${n}`:n}function G(o,t){const e=d(o.references,t.github.repo,"issues"),s=d(o.references,t.github.repo,"hash");let n=join([...new Set(o.resolvedAuthors.map(a=>a.login?`@${a.login}`:`**${a.name}**`))]).trim();n&&(n=`by ${n}`);let i=[n,e,s].filter(a=>a?.trim()).join(" ");return i&&(i=`&nbsp;-&nbsp; ${i}`),[t.capitalize?capitalize(o.description):o.description,i].filter(a=>a?.trim()).join(" ")}function k(o,t){const e=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;let s=o.trim();return t.emoji||(s=o.replace(e,"").trim()),`### &nbsp;&nbsp;&nbsp;${s}`}function v(o,t,e){if(!o.length)return[];const s=["",k(t,e),""],n=groupBy(o,"scope");let i=!0;return Object.entries(n).some(([a,c])=>a&&c.length>1)||(i=!1),Object.keys(n).sort().forEach(a=>{let c="",l="";const u=`**${a}**`;a&&i?(s.push(`- ${u}:`),c=" "):a&&(l=`${u}: `),s.push(...n[a].reverse().map(p=>`${c}- ${l}${G(p,e)}`))}),s}function y(o){return`https://github.com/${o}`}function x(o){return`${y(o)}.png?size=48`}function A(o){let t="",e="";const s=new Map;return o.forEach(n=>{s.set(n.email,n)}),Array.from(s.values()).forEach((n,i)=>{const{name:a,email:c,login:l}=n;if(l){const u=y(l),p=x(l);t+=`[![${l}](${p})](${u})&nbsp;&nbsp;`}else{let u=`[${a}](mailto:${c})`;i<o.length-1&&(u+=",&nbsp;"),e+=u}}),`${t}
16
- ${e}`}function generateMarkdown(o){const{options:t,showTitle:e,contributors:s}=o,n=o.commits.filter(f=>f.description.match(VERSION_WITH_RELEASE)===null),i=[],{version:a,isNewVersion:c}=w(t.to,t.newVersion),l=`https://github.com/${t.github.repo}/compare/${t.from}...${a}`;if(e){const f=c?A__default().format("YY-MM-DD"):t.tagDateMap.get(t.to);let g=`## [${a}](${l})`;f&&(g+=` (${f})`),i.push(g)}const[u,p]=partition(n,f=>f.isBreaking),m=groupBy(p,"type");i.push(...v(u,t.titles.breakingChanges,t));for(const f of Object.keys(t.types)){const g=m[f]||[];i.push(...v(g,t.types[f],t))}if(i.length||i.push("*No significant changes*"),e||i.push("",`##### &nbsp;&nbsp;&nbsp;&nbsp;[View changes on GitHub](${l})`),e){i.push("","### &nbsp;&nbsp;&nbsp;\u2764\uFE0F Contributors","");const f=A(s);i.push(f)}return convertGitmoji.convert(i.join(`
17
- `).trim(),!0)}async function isVersionInMarkdown(o,t,e){let s=!1,n="";try{n=await promises.readFile(e,"utf8")}catch{}if(n){const i=n.match(VERSION_REG_OF_MARKDOWN);if(i?.length){const{version:a}=w(o,t),c=`## [${a}]`;s=i.includes(c)}}return s}function w(o,t){const e=!VERSION_REG.test(o);return{version:e?t:o,isNewVersion:e}}async function writeMarkdown(o,t,e=!1){let s="";const n="# Changelog";node_fs.existsSync(t)||await promises.writeFile(t,`${n}
18
-
19
- `,"utf8"),e||(s=await promises.readFile(t,"utf8")),s.startsWith(n)||(s=`${n}
20
-
21
- ${s}`);const i=s.match(/^###?\s+.*$/m);i?s=`${s.slice(0,i.index)+o}
22
-
23
- ${s.slice(i.index)}`:s+=`
24
- ${o}
25
-
26
- `,await promises.writeFile(t,s)}async function getChangelogMarkdown(o,t=!0){const e=await createOptions(o),s=await getGitCommits(e.from,e.to),{commits:n,contributors:i}=await getGitCommitsAndResolvedAuthors(s,e.github);return{markdown:generateMarkdown({commits:n,options:e,showTitle:t,contributors:i}),commits:n,options:e}}async function getTotalChangelogMarkdown(o,t=!0){const e=await createOptions(o);let s=null;t&&(s=new cliProgress.SingleBar({format:"generate total changelog: [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"},cliProgress.Presets.shades_classic));const n=getFromToTags(e.tags);if(n.length===0){const{markdown:c}=await getChangelogMarkdown(e);return c}s?.start(n.length,0);let i="";const a=new Map;for await(const[c,l]of n.entries()){const{from:u,to:p}=l,m=await getGitCommits(u,p),{commits:f,contributors:g}=await getGitCommitsAndResolvedAuthors(m,e.github,a);i=`${generateMarkdown({commits:f,options:{...e,from:u,to:p},showTitle:!0,contributors:g})}
27
-
28
- ${i}`,s?.update(c+1)}return s?.stop(),i}async function generateChangelog(o){const t=await createOptions(o),e=await isVersionInMarkdown(t.to,t.newVersion,t.output);if(!t.regenerate&&e)return;const{markdown:s}=await getChangelogMarkdown(t);await writeMarkdown(s,t.output,t.regenerate)}async function generateTotalChangelog(o,t=!0){const e=await createOptions(o),s=await getTotalChangelogMarkdown(e,t);await writeMarkdown(s,e.output,!0)}exports.generateChangelog=generateChangelog,exports.generateTotalChangelog=generateTotalChangelog,exports.getChangelogMarkdown=getChangelogMarkdown,exports.getTotalChangelogMarkdown=getTotalChangelogMarkdown;
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __esm = (fn, res) => function __init() {
9
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ };
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+
33
+ // node_modules/.pnpm/tsup@8.0.1_typescript@5.3.3/node_modules/tsup/assets/cjs_shims.js
34
+ var init_cjs_shims = __esm({
35
+ "node_modules/.pnpm/tsup@8.0.1_typescript@5.3.3/node_modules/tsup/assets/cjs_shims.js"() {
36
+ "use strict";
37
+ }
38
+ });
39
+
40
+ // node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/core.mjs
41
+ function isObject(value) {
42
+ return value !== null && typeof value === "object";
43
+ }
44
+ function _defu(baseObject, defaults, namespace = ".", merger) {
45
+ if (!isObject(defaults)) {
46
+ return _defu(baseObject, {}, namespace, merger);
47
+ }
48
+ const object = Object.assign({}, defaults);
49
+ for (const key in baseObject) {
50
+ if (key === "__proto__" || key === "constructor") {
51
+ continue;
52
+ }
53
+ const value = baseObject[key];
54
+ if (value === null || value === void 0) {
55
+ continue;
56
+ }
57
+ if (merger && merger(object, key, value, namespace)) {
58
+ continue;
59
+ }
60
+ if (Array.isArray(value) && Array.isArray(object[key])) {
61
+ object[key] = [...value, ...object[key]];
62
+ } else if (isObject(value) && isObject(object[key])) {
63
+ object[key] = _defu(
64
+ value,
65
+ object[key],
66
+ (namespace ? `${namespace}.` : "") + key.toString(),
67
+ merger
68
+ );
69
+ } else {
70
+ object[key] = value;
71
+ }
72
+ }
73
+ return object;
74
+ }
75
+ function createDefu(merger) {
76
+ return (...arguments_) => (
77
+ // eslint-disable-next-line unicorn/no-array-reduce
78
+ arguments_.reduce((p2, c2) => _defu(p2, c2, "", merger), {})
79
+ );
80
+ }
81
+ function isPlainObject(obj) {
82
+ return Object.prototype.toString.call(obj) === "[object Object]";
83
+ }
84
+ function isLogObj(arg) {
85
+ if (!isPlainObject(arg)) {
86
+ return false;
87
+ }
88
+ if (!arg.message && !arg.args) {
89
+ return false;
90
+ }
91
+ if (arg.stack) {
92
+ return false;
93
+ }
94
+ return true;
95
+ }
96
+ function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
97
+ if (input === void 0) {
98
+ return defaultLevel;
99
+ }
100
+ if (typeof input === "number") {
101
+ return input;
102
+ }
103
+ if (types[input] && types[input].level !== void 0) {
104
+ return types[input].level;
105
+ }
106
+ return defaultLevel;
107
+ }
108
+ function createConsola(options = {}) {
109
+ return new Consola(options);
110
+ }
111
+ var LogLevels, LogTypes, defu, paused, queue, Consola;
112
+ var init_core = __esm({
113
+ "node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/core.mjs"() {
114
+ "use strict";
115
+ init_cjs_shims();
116
+ LogLevels = {
117
+ silent: Number.NEGATIVE_INFINITY,
118
+ fatal: 0,
119
+ error: 0,
120
+ warn: 1,
121
+ log: 2,
122
+ info: 3,
123
+ success: 3,
124
+ fail: 3,
125
+ ready: 3,
126
+ start: 3,
127
+ box: 3,
128
+ debug: 4,
129
+ trace: 5,
130
+ verbose: Number.POSITIVE_INFINITY
131
+ };
132
+ LogTypes = {
133
+ // Silent
134
+ silent: {
135
+ level: -1
136
+ },
137
+ // Level 0
138
+ fatal: {
139
+ level: LogLevels.fatal
140
+ },
141
+ error: {
142
+ level: LogLevels.error
143
+ },
144
+ // Level 1
145
+ warn: {
146
+ level: LogLevels.warn
147
+ },
148
+ // Level 2
149
+ log: {
150
+ level: LogLevels.log
151
+ },
152
+ // Level 3
153
+ info: {
154
+ level: LogLevels.info
155
+ },
156
+ success: {
157
+ level: LogLevels.success
158
+ },
159
+ fail: {
160
+ level: LogLevels.fail
161
+ },
162
+ ready: {
163
+ level: LogLevels.info
164
+ },
165
+ start: {
166
+ level: LogLevels.info
167
+ },
168
+ box: {
169
+ level: LogLevels.info
170
+ },
171
+ // Level 4
172
+ debug: {
173
+ level: LogLevels.debug
174
+ },
175
+ // Level 5
176
+ trace: {
177
+ level: LogLevels.trace
178
+ },
179
+ // Verbose
180
+ verbose: {
181
+ level: LogLevels.verbose
182
+ }
183
+ };
184
+ defu = createDefu();
185
+ paused = false;
186
+ queue = [];
187
+ Consola = class _Consola {
188
+ constructor(options = {}) {
189
+ const types = options.types || LogTypes;
190
+ this.options = defu(
191
+ {
192
+ ...options,
193
+ defaults: { ...options.defaults },
194
+ level: _normalizeLogLevel(options.level, types),
195
+ reporters: [...options.reporters || []]
196
+ },
197
+ {
198
+ types: LogTypes,
199
+ throttle: 1e3,
200
+ throttleMin: 5,
201
+ formatOptions: {
202
+ date: true,
203
+ colors: false,
204
+ compact: true
205
+ }
206
+ }
207
+ );
208
+ for (const type in types) {
209
+ const defaults = {
210
+ type,
211
+ ...this.options.defaults,
212
+ ...types[type]
213
+ };
214
+ this[type] = this._wrapLogFn(defaults);
215
+ this[type].raw = this._wrapLogFn(
216
+ defaults,
217
+ true
218
+ );
219
+ }
220
+ if (this.options.mockFn) {
221
+ this.mockTypes();
222
+ }
223
+ this._lastLog = {};
224
+ }
225
+ get level() {
226
+ return this.options.level;
227
+ }
228
+ set level(level) {
229
+ this.options.level = _normalizeLogLevel(
230
+ level,
231
+ this.options.types,
232
+ this.options.level
233
+ );
234
+ }
235
+ prompt(message, opts) {
236
+ if (!this.options.prompt) {
237
+ throw new Error("prompt is not supported!");
238
+ }
239
+ return this.options.prompt(message, opts);
240
+ }
241
+ create(options) {
242
+ const instance = new _Consola({
243
+ ...this.options,
244
+ ...options
245
+ });
246
+ if (this._mockFn) {
247
+ instance.mockTypes(this._mockFn);
248
+ }
249
+ return instance;
250
+ }
251
+ withDefaults(defaults) {
252
+ return this.create({
253
+ ...this.options,
254
+ defaults: {
255
+ ...this.options.defaults,
256
+ ...defaults
257
+ }
258
+ });
259
+ }
260
+ withTag(tag) {
261
+ return this.withDefaults({
262
+ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
263
+ });
264
+ }
265
+ addReporter(reporter) {
266
+ this.options.reporters.push(reporter);
267
+ return this;
268
+ }
269
+ removeReporter(reporter) {
270
+ if (reporter) {
271
+ const i = this.options.reporters.indexOf(reporter);
272
+ if (i >= 0) {
273
+ return this.options.reporters.splice(i, 1);
274
+ }
275
+ } else {
276
+ this.options.reporters.splice(0);
277
+ }
278
+ return this;
279
+ }
280
+ setReporters(reporters) {
281
+ this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
282
+ return this;
283
+ }
284
+ wrapAll() {
285
+ this.wrapConsole();
286
+ this.wrapStd();
287
+ }
288
+ restoreAll() {
289
+ this.restoreConsole();
290
+ this.restoreStd();
291
+ }
292
+ wrapConsole() {
293
+ for (const type in this.options.types) {
294
+ if (!console["__" + type]) {
295
+ console["__" + type] = console[type];
296
+ }
297
+ console[type] = this[type].raw;
298
+ }
299
+ }
300
+ restoreConsole() {
301
+ for (const type in this.options.types) {
302
+ if (console["__" + type]) {
303
+ console[type] = console["__" + type];
304
+ delete console["__" + type];
305
+ }
306
+ }
307
+ }
308
+ wrapStd() {
309
+ this._wrapStream(this.options.stdout, "log");
310
+ this._wrapStream(this.options.stderr, "log");
311
+ }
312
+ _wrapStream(stream, type) {
313
+ if (!stream) {
314
+ return;
315
+ }
316
+ if (!stream.__write) {
317
+ stream.__write = stream.write;
318
+ }
319
+ stream.write = (data) => {
320
+ this[type].raw(String(data).trim());
321
+ };
322
+ }
323
+ restoreStd() {
324
+ this._restoreStream(this.options.stdout);
325
+ this._restoreStream(this.options.stderr);
326
+ }
327
+ _restoreStream(stream) {
328
+ if (!stream) {
329
+ return;
330
+ }
331
+ if (stream.__write) {
332
+ stream.write = stream.__write;
333
+ delete stream.__write;
334
+ }
335
+ }
336
+ pauseLogs() {
337
+ paused = true;
338
+ }
339
+ resumeLogs() {
340
+ paused = false;
341
+ const _queue = queue.splice(0);
342
+ for (const item of _queue) {
343
+ item[0]._logFn(item[1], item[2]);
344
+ }
345
+ }
346
+ mockTypes(mockFn) {
347
+ const _mockFn = mockFn || this.options.mockFn;
348
+ this._mockFn = _mockFn;
349
+ if (typeof _mockFn !== "function") {
350
+ return;
351
+ }
352
+ for (const type in this.options.types) {
353
+ this[type] = _mockFn(type, this.options.types[type]) || this[type];
354
+ this[type].raw = this[type];
355
+ }
356
+ }
357
+ _wrapLogFn(defaults, isRaw) {
358
+ return (...args) => {
359
+ if (paused) {
360
+ queue.push([this, defaults, args, isRaw]);
361
+ return;
362
+ }
363
+ return this._logFn(defaults, args, isRaw);
364
+ };
365
+ }
366
+ _logFn(defaults, args, isRaw) {
367
+ if ((defaults.level || 0) > this.level) {
368
+ return false;
369
+ }
370
+ const logObj = {
371
+ date: /* @__PURE__ */ new Date(),
372
+ args: [],
373
+ ...defaults,
374
+ level: _normalizeLogLevel(defaults.level, this.options.types)
375
+ };
376
+ if (!isRaw && args.length === 1 && isLogObj(args[0])) {
377
+ Object.assign(logObj, args[0]);
378
+ } else {
379
+ logObj.args = [...args];
380
+ }
381
+ if (logObj.message) {
382
+ logObj.args.unshift(logObj.message);
383
+ delete logObj.message;
384
+ }
385
+ if (logObj.additional) {
386
+ if (!Array.isArray(logObj.additional)) {
387
+ logObj.additional = logObj.additional.split("\n");
388
+ }
389
+ logObj.args.push("\n" + logObj.additional.join("\n"));
390
+ delete logObj.additional;
391
+ }
392
+ logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
393
+ logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
394
+ const resolveLog = (newLog = false) => {
395
+ const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
396
+ if (this._lastLog.object && repeated > 0) {
397
+ const args2 = [...this._lastLog.object.args];
398
+ if (repeated > 1) {
399
+ args2.push(`(repeated ${repeated} times)`);
400
+ }
401
+ this._log({ ...this._lastLog.object, args: args2 });
402
+ this._lastLog.count = 1;
403
+ }
404
+ if (newLog) {
405
+ this._lastLog.object = logObj;
406
+ this._log(logObj);
407
+ }
408
+ };
409
+ clearTimeout(this._lastLog.timeout);
410
+ const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
411
+ this._lastLog.time = logObj.date;
412
+ if (diffTime < this.options.throttle) {
413
+ try {
414
+ const serializedLog = JSON.stringify([
415
+ logObj.type,
416
+ logObj.tag,
417
+ logObj.args
418
+ ]);
419
+ const isSameLog = this._lastLog.serialized === serializedLog;
420
+ this._lastLog.serialized = serializedLog;
421
+ if (isSameLog) {
422
+ this._lastLog.count = (this._lastLog.count || 0) + 1;
423
+ if (this._lastLog.count > this.options.throttleMin) {
424
+ this._lastLog.timeout = setTimeout(
425
+ resolveLog,
426
+ this.options.throttle
427
+ );
428
+ return;
429
+ }
430
+ }
431
+ } catch {
432
+ }
433
+ }
434
+ resolveLog(true);
435
+ }
436
+ _log(logObj) {
437
+ for (const reporter of this.options.reporters) {
438
+ reporter.log(logObj, {
439
+ options: this.options
440
+ });
441
+ }
442
+ }
443
+ };
444
+ Consola.prototype.add = Consola.prototype.addReporter;
445
+ Consola.prototype.remove = Consola.prototype.removeReporter;
446
+ Consola.prototype.clear = Consola.prototype.removeReporter;
447
+ Consola.prototype.withScope = Consola.prototype.withTag;
448
+ Consola.prototype.mock = Consola.prototype.mockTypes;
449
+ Consola.prototype.pause = Consola.prototype.pauseLogs;
450
+ Consola.prototype.resume = Consola.prototype.resumeLogs;
451
+ }
452
+ });
453
+
454
+ // node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.06ad8a64.mjs
455
+ function parseStack(stack) {
456
+ const cwd = process.cwd() + import_node_path.sep;
457
+ const lines = stack.split("\n").splice(1).map((l2) => l2.trim().replace("file://", "").replace(cwd, ""));
458
+ return lines;
459
+ }
460
+ function writeStream(data, stream) {
461
+ const write = stream.__write || stream.write;
462
+ return write.call(stream, data);
463
+ }
464
+ var import_node_util, import_node_path, bracket, BasicReporter;
465
+ var init_consola_06ad8a64 = __esm({
466
+ "node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.06ad8a64.mjs"() {
467
+ "use strict";
468
+ init_cjs_shims();
469
+ import_node_util = require("util");
470
+ import_node_path = require("path");
471
+ bracket = (x) => x ? `[${x}]` : "";
472
+ BasicReporter = class {
473
+ formatStack(stack, opts) {
474
+ return " " + parseStack(stack).join("\n ");
475
+ }
476
+ formatArgs(args, opts) {
477
+ const _args = args.map((arg) => {
478
+ if (arg && typeof arg.stack === "string") {
479
+ return arg.message + "\n" + this.formatStack(arg.stack, opts);
480
+ }
481
+ return arg;
482
+ });
483
+ return (0, import_node_util.formatWithOptions)(opts, ..._args);
484
+ }
485
+ formatDate(date, opts) {
486
+ return opts.date ? date.toLocaleTimeString() : "";
487
+ }
488
+ filterAndJoin(arr) {
489
+ return arr.filter(Boolean).join(" ");
490
+ }
491
+ formatLogObj(logObj, opts) {
492
+ const message = this.formatArgs(logObj.args, opts);
493
+ if (logObj.type === "box") {
494
+ return "\n" + [
495
+ bracket(logObj.tag),
496
+ logObj.title && logObj.title,
497
+ ...message.split("\n")
498
+ ].filter(Boolean).map((l2) => " > " + l2).join("\n") + "\n";
499
+ }
500
+ return this.filterAndJoin([
501
+ bracket(logObj.type),
502
+ bracket(logObj.tag),
503
+ message
504
+ ]);
505
+ }
506
+ log(logObj, ctx) {
507
+ const line = this.formatLogObj(logObj, {
508
+ columns: ctx.options.stdout.columns || 0,
509
+ ...ctx.options.formatOptions
510
+ });
511
+ return writeStream(
512
+ line + "\n",
513
+ logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout
514
+ );
515
+ }
516
+ };
517
+ }
518
+ });
519
+
520
+ // node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/utils.mjs
521
+ function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
522
+ return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
523
+ }
524
+ function clearBleed(index, string, open, close, replace) {
525
+ return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
526
+ }
527
+ function filterEmpty(open, close, replace = open, at = open.length + 1) {
528
+ return (string) => string || !(string === "" || string === void 0) ? clearBleed(
529
+ ("" + string).indexOf(close, at),
530
+ string,
531
+ open,
532
+ close,
533
+ replace
534
+ ) : "";
535
+ }
536
+ function init(open, close, replace) {
537
+ return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
538
+ }
539
+ function createColors(useColor = isColorSupported) {
540
+ return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
541
+ }
542
+ function getColor(color, fallback = "reset") {
543
+ return colors[color] || colors[fallback];
544
+ }
545
+ function stripAnsi(text2) {
546
+ return text2.replace(new RegExp(ansiRegex, "g"), "");
547
+ }
548
+ function box(text2, _opts = {}) {
549
+ const opts = {
550
+ ..._opts,
551
+ style: {
552
+ ...defaultStyle,
553
+ ..._opts.style
554
+ }
555
+ };
556
+ const textLines = text2.split("\n");
557
+ const boxLines = [];
558
+ const _color = getColor(opts.style.borderColor);
559
+ const borderStyle = {
560
+ ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
561
+ };
562
+ if (_color) {
563
+ for (const key in borderStyle) {
564
+ borderStyle[key] = _color(
565
+ borderStyle[key]
566
+ );
567
+ }
568
+ }
569
+ const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
570
+ const height = textLines.length + paddingOffset;
571
+ const width = Math.max(...textLines.map((line) => line.length)) + paddingOffset;
572
+ const widthOffset = width + paddingOffset;
573
+ const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
574
+ if (opts.style.marginTop > 0) {
575
+ boxLines.push("".repeat(opts.style.marginTop));
576
+ }
577
+ if (opts.title) {
578
+ const left = borderStyle.h.repeat(
579
+ Math.floor((width - stripAnsi(opts.title).length) / 2)
580
+ );
581
+ const right = borderStyle.h.repeat(
582
+ width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset
583
+ );
584
+ boxLines.push(
585
+ `${leftSpace}${borderStyle.tl}${left}${opts.title}${right}${borderStyle.tr}`
586
+ );
587
+ } else {
588
+ boxLines.push(
589
+ `${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`
590
+ );
591
+ }
592
+ const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
593
+ for (let i = 0; i < height; i++) {
594
+ if (i < valignOffset || i >= valignOffset + textLines.length) {
595
+ boxLines.push(
596
+ `${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`
597
+ );
598
+ } else {
599
+ const line = textLines[i - valignOffset];
600
+ const left = " ".repeat(paddingOffset);
601
+ const right = " ".repeat(width - stripAnsi(line).length);
602
+ boxLines.push(
603
+ `${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`
604
+ );
605
+ }
606
+ }
607
+ boxLines.push(
608
+ `${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`
609
+ );
610
+ if (opts.style.marginBottom > 0) {
611
+ boxLines.push("".repeat(opts.style.marginBottom));
612
+ }
613
+ return boxLines.join("\n");
614
+ }
615
+ var tty, env, argv, platform, isDisabled, isForced, isWindows, isDumbTerminal, isCompatibleTerminal, isCI, isColorSupported, colorDefs, colors, ansiRegex, boxStylePresets, defaultStyle;
616
+ var init_utils = __esm({
617
+ "node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/utils.mjs"() {
618
+ "use strict";
619
+ init_cjs_shims();
620
+ tty = __toESM(require("tty"), 1);
621
+ ({
622
+ env = {},
623
+ argv = [],
624
+ platform = ""
625
+ } = typeof process === "undefined" ? {} : process);
626
+ isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
627
+ isForced = "FORCE_COLOR" in env || argv.includes("--color");
628
+ isWindows = platform === "win32";
629
+ isDumbTerminal = env.TERM === "dumb";
630
+ isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
631
+ isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
632
+ isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
633
+ colorDefs = {
634
+ reset: init(0, 0),
635
+ bold: init(1, 22, "\x1B[22m\x1B[1m"),
636
+ dim: init(2, 22, "\x1B[22m\x1B[2m"),
637
+ italic: init(3, 23),
638
+ underline: init(4, 24),
639
+ inverse: init(7, 27),
640
+ hidden: init(8, 28),
641
+ strikethrough: init(9, 29),
642
+ black: init(30, 39),
643
+ red: init(31, 39),
644
+ green: init(32, 39),
645
+ yellow: init(33, 39),
646
+ blue: init(34, 39),
647
+ magenta: init(35, 39),
648
+ cyan: init(36, 39),
649
+ white: init(37, 39),
650
+ gray: init(90, 39),
651
+ bgBlack: init(40, 49),
652
+ bgRed: init(41, 49),
653
+ bgGreen: init(42, 49),
654
+ bgYellow: init(43, 49),
655
+ bgBlue: init(44, 49),
656
+ bgMagenta: init(45, 49),
657
+ bgCyan: init(46, 49),
658
+ bgWhite: init(47, 49),
659
+ blackBright: init(90, 39),
660
+ redBright: init(91, 39),
661
+ greenBright: init(92, 39),
662
+ yellowBright: init(93, 39),
663
+ blueBright: init(94, 39),
664
+ magentaBright: init(95, 39),
665
+ cyanBright: init(96, 39),
666
+ whiteBright: init(97, 39),
667
+ bgBlackBright: init(100, 49),
668
+ bgRedBright: init(101, 49),
669
+ bgGreenBright: init(102, 49),
670
+ bgYellowBright: init(103, 49),
671
+ bgBlueBright: init(104, 49),
672
+ bgMagentaBright: init(105, 49),
673
+ bgCyanBright: init(106, 49),
674
+ bgWhiteBright: init(107, 49)
675
+ };
676
+ colors = createColors();
677
+ ansiRegex = [
678
+ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
679
+ "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
680
+ ].join("|");
681
+ boxStylePresets = {
682
+ solid: {
683
+ tl: "\u250C",
684
+ tr: "\u2510",
685
+ bl: "\u2514",
686
+ br: "\u2518",
687
+ h: "\u2500",
688
+ v: "\u2502"
689
+ },
690
+ double: {
691
+ tl: "\u2554",
692
+ tr: "\u2557",
693
+ bl: "\u255A",
694
+ br: "\u255D",
695
+ h: "\u2550",
696
+ v: "\u2551"
697
+ },
698
+ doubleSingle: {
699
+ tl: "\u2553",
700
+ tr: "\u2556",
701
+ bl: "\u2559",
702
+ br: "\u255C",
703
+ h: "\u2500",
704
+ v: "\u2551"
705
+ },
706
+ doubleSingleRounded: {
707
+ tl: "\u256D",
708
+ tr: "\u256E",
709
+ bl: "\u2570",
710
+ br: "\u256F",
711
+ h: "\u2500",
712
+ v: "\u2551"
713
+ },
714
+ singleThick: {
715
+ tl: "\u250F",
716
+ tr: "\u2513",
717
+ bl: "\u2517",
718
+ br: "\u251B",
719
+ h: "\u2501",
720
+ v: "\u2503"
721
+ },
722
+ singleDouble: {
723
+ tl: "\u2552",
724
+ tr: "\u2555",
725
+ bl: "\u2558",
726
+ br: "\u255B",
727
+ h: "\u2550",
728
+ v: "\u2502"
729
+ },
730
+ singleDoubleRounded: {
731
+ tl: "\u256D",
732
+ tr: "\u256E",
733
+ bl: "\u2570",
734
+ br: "\u256F",
735
+ h: "\u2550",
736
+ v: "\u2502"
737
+ },
738
+ rounded: {
739
+ tl: "\u256D",
740
+ tr: "\u256E",
741
+ bl: "\u2570",
742
+ br: "\u256F",
743
+ h: "\u2500",
744
+ v: "\u2502"
745
+ }
746
+ };
747
+ defaultStyle = {
748
+ borderColor: "white",
749
+ borderStyle: "rounded",
750
+ valign: "center",
751
+ padding: 2,
752
+ marginLeft: 1,
753
+ marginTop: 1,
754
+ marginBottom: 1
755
+ };
756
+ }
757
+ });
758
+
759
+ // node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/chunks/prompt.mjs
760
+ var prompt_exports = {};
761
+ __export(prompt_exports, {
762
+ prompt: () => prompt
763
+ });
764
+ function z({ onlyFirst: t = false } = {}) {
765
+ const u = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
766
+ return new RegExp(u, t ? void 0 : "g");
767
+ }
768
+ function $(t) {
769
+ if (typeof t != "string")
770
+ throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
771
+ return t.replace(z(), "");
772
+ }
773
+ function c(t, u = {}) {
774
+ if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = $(t), t.length === 0))
775
+ return 0;
776
+ t = t.replace(Y(), " ");
777
+ const F = u.ambiguousIsNarrow ? 1 : 2;
778
+ let e = 0;
779
+ for (const s3 of t) {
780
+ const C = s3.codePointAt(0);
781
+ if (C <= 31 || C >= 127 && C <= 159 || C >= 768 && C <= 879)
782
+ continue;
783
+ switch (K.eastAsianWidth(s3)) {
784
+ case "F":
785
+ case "W":
786
+ e += 2;
787
+ break;
788
+ case "A":
789
+ e += F;
790
+ break;
791
+ default:
792
+ e += 1;
793
+ }
794
+ }
795
+ return e;
796
+ }
797
+ function U() {
798
+ const t = /* @__PURE__ */ new Map();
799
+ for (const [u, F] of Object.entries(r)) {
800
+ for (const [e, s3] of Object.entries(F))
801
+ r[e] = { open: `\x1B[${s3[0]}m`, close: `\x1B[${s3[1]}m` }, F[e] = r[e], t.set(s3[0], s3[1]);
802
+ Object.defineProperty(r, u, { value: F, enumerable: false });
803
+ }
804
+ return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L(), r.color.ansi256 = M(), r.color.ansi16m = T(), r.bgColor.ansi = L(v), r.bgColor.ansi256 = M(v), r.bgColor.ansi16m = T(v), Object.defineProperties(r, { rgbToAnsi256: { value: (u, F, e) => u === F && F === e ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(F / 255 * 5) + Math.round(e / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
805
+ const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
806
+ if (!F)
807
+ return [0, 0, 0];
808
+ let [e] = F;
809
+ e.length === 3 && (e = [...e].map((C) => C + C).join(""));
810
+ const s3 = Number.parseInt(e, 16);
811
+ return [s3 >> 16 & 255, s3 >> 8 & 255, s3 & 255];
812
+ }, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
813
+ if (u < 8)
814
+ return 30 + u;
815
+ if (u < 16)
816
+ return 90 + (u - 8);
817
+ let F, e, s3;
818
+ if (u >= 232)
819
+ F = ((u - 232) * 10 + 8) / 255, e = F, s3 = F;
820
+ else {
821
+ u -= 16;
822
+ const i = u % 36;
823
+ F = Math.floor(u / 36) / 5, e = Math.floor(i / 6) / 5, s3 = i % 6 / 5;
824
+ }
825
+ const C = Math.max(F, e, s3) * 2;
826
+ if (C === 0)
827
+ return 30;
828
+ let D = 30 + (Math.round(s3) << 2 | Math.round(e) << 1 | Math.round(F));
829
+ return C === 2 && (D += 60), D;
830
+ }, enumerable: false }, rgbToAnsi: { value: (u, F, e) => r.ansi256ToAnsi(r.rgbToAnsi256(u, F, e)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
831
+ }
832
+ function P(t, u, F) {
833
+ return String(t).normalize().replace(/\r\n/g, `
834
+ `).split(`
835
+ `).map((e) => uD(e, u, F)).join(`
836
+ `);
837
+ }
838
+ function FD(t, u) {
839
+ if (t === u)
840
+ return;
841
+ const F = t.split(`
842
+ `), e = u.split(`
843
+ `), s3 = [];
844
+ for (let C = 0; C < Math.max(F.length, e.length); C++)
845
+ F[C] !== e[C] && s3.push(C);
846
+ return s3;
847
+ }
848
+ function g(t, u) {
849
+ t.isTTY && t.setRawMode(u);
850
+ }
851
+ async function prompt(message, opts = {}) {
852
+ if (!opts.type || opts.type === "text") {
853
+ return await text({
854
+ message,
855
+ defaultValue: opts.default,
856
+ placeholder: opts.placeholder,
857
+ initialValue: opts.initial
858
+ });
859
+ }
860
+ if (opts.type === "confirm") {
861
+ return await confirm({
862
+ message,
863
+ initialValue: opts.initial
864
+ });
865
+ }
866
+ if (opts.type === "select") {
867
+ return await select({
868
+ message,
869
+ options: opts.options.map(
870
+ (o) => typeof o === "string" ? { value: o, label: o } : o
871
+ )
872
+ });
873
+ }
874
+ if (opts.type === "multiselect") {
875
+ return await multiselect({
876
+ message,
877
+ options: opts.options.map(
878
+ (o) => typeof o === "string" ? { value: o, label: o } : o
879
+ ),
880
+ required: opts.required
881
+ });
882
+ }
883
+ throw new Error(`Unknown prompt type: ${opts.type}`);
884
+ }
885
+ var import_node_process, import_node_readline, import_node_tty, import_tty, import_node_util2, import_node_path2, ESC, CSI, beep, cursor, scroll, erase, src, picocolors, tty2, isColorSupported2, formatter, replaceClose2, createColors2, picocolorsExports, l, m, G, K, Y, v, L, M, T, r, Z, H, q, p, J, b, W, Q, I, w, N, j, X, _, DD, uD, R, V, tD, h, sD, iD, ED, oD, unicode, s, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR, S_BAR_END, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, symbol, text, confirm, select, multiselect;
886
+ var init_prompt = __esm({
887
+ "node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/chunks/prompt.mjs"() {
888
+ "use strict";
889
+ init_cjs_shims();
890
+ import_node_process = require("process");
891
+ import_node_readline = __toESM(require("readline"), 1);
892
+ import_node_tty = require("tty");
893
+ init_consola_36c0034f();
894
+ import_tty = __toESM(require("tty"), 1);
895
+ init_utils();
896
+ init_core();
897
+ init_consola_06ad8a64();
898
+ import_node_util2 = require("util");
899
+ import_node_path2 = require("path");
900
+ ESC = "\x1B";
901
+ CSI = `${ESC}[`;
902
+ beep = "\x07";
903
+ cursor = {
904
+ to(x, y) {
905
+ if (!y)
906
+ return `${CSI}${x + 1}G`;
907
+ return `${CSI}${y + 1};${x + 1}H`;
908
+ },
909
+ move(x, y) {
910
+ let ret = "";
911
+ if (x < 0)
912
+ ret += `${CSI}${-x}D`;
913
+ else if (x > 0)
914
+ ret += `${CSI}${x}C`;
915
+ if (y < 0)
916
+ ret += `${CSI}${-y}A`;
917
+ else if (y > 0)
918
+ ret += `${CSI}${y}B`;
919
+ return ret;
920
+ },
921
+ up: (count = 1) => `${CSI}${count}A`,
922
+ down: (count = 1) => `${CSI}${count}B`,
923
+ forward: (count = 1) => `${CSI}${count}C`,
924
+ backward: (count = 1) => `${CSI}${count}D`,
925
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
926
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
927
+ left: `${CSI}G`,
928
+ hide: `${CSI}?25l`,
929
+ show: `${CSI}?25h`,
930
+ save: `${ESC}7`,
931
+ restore: `${ESC}8`
932
+ };
933
+ scroll = {
934
+ up: (count = 1) => `${CSI}S`.repeat(count),
935
+ down: (count = 1) => `${CSI}T`.repeat(count)
936
+ };
937
+ erase = {
938
+ screen: `${CSI}2J`,
939
+ up: (count = 1) => `${CSI}1J`.repeat(count),
940
+ down: (count = 1) => `${CSI}J`.repeat(count),
941
+ line: `${CSI}2K`,
942
+ lineEnd: `${CSI}K`,
943
+ lineStart: `${CSI}1K`,
944
+ lines(count) {
945
+ let clear = "";
946
+ for (let i = 0; i < count; i++)
947
+ clear += this.line + (i < count - 1 ? cursor.up() : "");
948
+ if (count)
949
+ clear += cursor.left;
950
+ return clear;
951
+ }
952
+ };
953
+ src = { cursor, scroll, erase, beep };
954
+ picocolors = { exports: {} };
955
+ tty2 = import_tty.default;
956
+ isColorSupported2 = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty2.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env);
957
+ formatter = (open, close, replace = open) => (input) => {
958
+ let string = "" + input;
959
+ let index = string.indexOf(close, open.length);
960
+ return ~index ? open + replaceClose2(string, close, replace, index) + close : open + string + close;
961
+ };
962
+ replaceClose2 = (string, close, replace, index) => {
963
+ let start = string.substring(0, index) + replace;
964
+ let end = string.substring(index + close.length);
965
+ let nextIndex = end.indexOf(close);
966
+ return ~nextIndex ? start + replaceClose2(end, close, replace, nextIndex) : start + end;
967
+ };
968
+ createColors2 = (enabled = isColorSupported2) => ({
969
+ isColorSupported: enabled,
970
+ reset: enabled ? (s3) => `\x1B[0m${s3}\x1B[0m` : String,
971
+ bold: enabled ? formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m") : String,
972
+ dim: enabled ? formatter("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m") : String,
973
+ italic: enabled ? formatter("\x1B[3m", "\x1B[23m") : String,
974
+ underline: enabled ? formatter("\x1B[4m", "\x1B[24m") : String,
975
+ inverse: enabled ? formatter("\x1B[7m", "\x1B[27m") : String,
976
+ hidden: enabled ? formatter("\x1B[8m", "\x1B[28m") : String,
977
+ strikethrough: enabled ? formatter("\x1B[9m", "\x1B[29m") : String,
978
+ black: enabled ? formatter("\x1B[30m", "\x1B[39m") : String,
979
+ red: enabled ? formatter("\x1B[31m", "\x1B[39m") : String,
980
+ green: enabled ? formatter("\x1B[32m", "\x1B[39m") : String,
981
+ yellow: enabled ? formatter("\x1B[33m", "\x1B[39m") : String,
982
+ blue: enabled ? formatter("\x1B[34m", "\x1B[39m") : String,
983
+ magenta: enabled ? formatter("\x1B[35m", "\x1B[39m") : String,
984
+ cyan: enabled ? formatter("\x1B[36m", "\x1B[39m") : String,
985
+ white: enabled ? formatter("\x1B[37m", "\x1B[39m") : String,
986
+ gray: enabled ? formatter("\x1B[90m", "\x1B[39m") : String,
987
+ bgBlack: enabled ? formatter("\x1B[40m", "\x1B[49m") : String,
988
+ bgRed: enabled ? formatter("\x1B[41m", "\x1B[49m") : String,
989
+ bgGreen: enabled ? formatter("\x1B[42m", "\x1B[49m") : String,
990
+ bgYellow: enabled ? formatter("\x1B[43m", "\x1B[49m") : String,
991
+ bgBlue: enabled ? formatter("\x1B[44m", "\x1B[49m") : String,
992
+ bgMagenta: enabled ? formatter("\x1B[45m", "\x1B[49m") : String,
993
+ bgCyan: enabled ? formatter("\x1B[46m", "\x1B[49m") : String,
994
+ bgWhite: enabled ? formatter("\x1B[47m", "\x1B[49m") : String
995
+ });
996
+ picocolors.exports = createColors2();
997
+ picocolors.exports.createColors = createColors2;
998
+ picocolorsExports = picocolors.exports;
999
+ l = /* @__PURE__ */ getDefaultExportFromCjs(picocolorsExports);
1000
+ m = {};
1001
+ G = { get exports() {
1002
+ return m;
1003
+ }, set exports(t) {
1004
+ m = t;
1005
+ } };
1006
+ (function(t) {
1007
+ var u = {};
1008
+ t.exports = u, u.eastAsianWidth = function(e) {
1009
+ var s3 = e.charCodeAt(0), C = e.length == 2 ? e.charCodeAt(1) : 0, D = s3;
1010
+ return 55296 <= s3 && s3 <= 56319 && 56320 <= C && C <= 57343 && (s3 &= 1023, C &= 1023, D = s3 << 10 | C, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
1011
+ }, u.characterLength = function(e) {
1012
+ var s3 = this.eastAsianWidth(e);
1013
+ return s3 == "F" || s3 == "W" || s3 == "A" ? 2 : 1;
1014
+ };
1015
+ function F(e) {
1016
+ return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
1017
+ }
1018
+ u.length = function(e) {
1019
+ for (var s3 = F(e), C = 0, D = 0; D < s3.length; D++)
1020
+ C = C + this.characterLength(s3[D]);
1021
+ return C;
1022
+ }, u.slice = function(e, s3, C) {
1023
+ textLen = u.length(e), s3 = s3 || 0, C = C || 1, s3 < 0 && (s3 = textLen + s3), C < 0 && (C = textLen + C);
1024
+ for (var D = "", i = 0, o = F(e), E = 0; E < o.length; E++) {
1025
+ var a = o[E], n = u.length(a);
1026
+ if (i >= s3 - (n == 2 ? 1 : 0))
1027
+ if (i + n <= C)
1028
+ D += a;
1029
+ else
1030
+ break;
1031
+ i += n;
1032
+ }
1033
+ return D;
1034
+ };
1035
+ })(G);
1036
+ K = m;
1037
+ Y = function() {
1038
+ return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
1039
+ };
1040
+ v = 10;
1041
+ L = (t = 0) => (u) => `\x1B[${u + t}m`;
1042
+ M = (t = 0) => (u) => `\x1B[${38 + t};5;${u}m`;
1043
+ T = (t = 0) => (u, F, e) => `\x1B[${38 + t};2;${u};${F};${e}m`;
1044
+ r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
1045
+ Object.keys(r.modifier);
1046
+ Z = Object.keys(r.color);
1047
+ H = Object.keys(r.bgColor);
1048
+ [...Z, ...H];
1049
+ q = U();
1050
+ p = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
1051
+ J = 39;
1052
+ b = "\x07";
1053
+ W = "[";
1054
+ Q = "]";
1055
+ I = "m";
1056
+ w = `${Q}8;;`;
1057
+ N = (t) => `${p.values().next().value}${W}${t}${I}`;
1058
+ j = (t) => `${p.values().next().value}${w}${t}${b}`;
1059
+ X = (t) => t.split(" ").map((u) => c(u));
1060
+ _ = (t, u, F) => {
1061
+ const e = [...u];
1062
+ let s3 = false, C = false, D = c($(t[t.length - 1]));
1063
+ for (const [i, o] of e.entries()) {
1064
+ const E = c(o);
1065
+ if (D + E <= F ? t[t.length - 1] += o : (t.push(o), D = 0), p.has(o) && (s3 = true, C = e.slice(i + 1).join("").startsWith(w)), s3) {
1066
+ C ? o === b && (s3 = false, C = false) : o === I && (s3 = false);
1067
+ continue;
1068
+ }
1069
+ D += E, D === F && i < e.length - 1 && (t.push(""), D = 0);
1070
+ }
1071
+ !D && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
1072
+ };
1073
+ DD = (t) => {
1074
+ const u = t.split(" ");
1075
+ let F = u.length;
1076
+ for (; F > 0 && !(c(u[F - 1]) > 0); )
1077
+ F--;
1078
+ return F === u.length ? t : u.slice(0, F).join(" ") + u.slice(F).join("");
1079
+ };
1080
+ uD = (t, u, F = {}) => {
1081
+ if (F.trim !== false && t.trim() === "")
1082
+ return "";
1083
+ let e = "", s3, C;
1084
+ const D = X(t);
1085
+ let i = [""];
1086
+ for (const [E, a] of t.split(" ").entries()) {
1087
+ F.trim !== false && (i[i.length - 1] = i[i.length - 1].trimStart());
1088
+ let n = c(i[i.length - 1]);
1089
+ if (E !== 0 && (n >= u && (F.wordWrap === false || F.trim === false) && (i.push(""), n = 0), (n > 0 || F.trim === false) && (i[i.length - 1] += " ", n++)), F.hard && D[E] > u) {
1090
+ const B = u - n, A = 1 + Math.floor((D[E] - B - 1) / u);
1091
+ Math.floor((D[E] - 1) / u) < A && i.push(""), _(i, a, u);
1092
+ continue;
1093
+ }
1094
+ if (n + D[E] > u && n > 0 && D[E] > 0) {
1095
+ if (F.wordWrap === false && n < u) {
1096
+ _(i, a, u);
1097
+ continue;
1098
+ }
1099
+ i.push("");
1100
+ }
1101
+ if (n + D[E] > u && F.wordWrap === false) {
1102
+ _(i, a, u);
1103
+ continue;
1104
+ }
1105
+ i[i.length - 1] += a;
1106
+ }
1107
+ F.trim !== false && (i = i.map((E) => DD(E)));
1108
+ const o = [...i.join(`
1109
+ `)];
1110
+ for (const [E, a] of o.entries()) {
1111
+ if (e += a, p.has(a)) {
1112
+ const { groups: B } = new RegExp(`(?:\\${W}(?<code>\\d+)m|\\${w}(?<uri>.*)${b})`).exec(o.slice(E).join("")) || { groups: {} };
1113
+ if (B.code !== void 0) {
1114
+ const A = Number.parseFloat(B.code);
1115
+ s3 = A === J ? void 0 : A;
1116
+ } else
1117
+ B.uri !== void 0 && (C = B.uri.length === 0 ? void 0 : B.uri);
1118
+ }
1119
+ const n = q.codes.get(Number(s3));
1120
+ o[E + 1] === `
1121
+ ` ? (C && (e += j("")), s3 && n && (e += N(n))) : a === `
1122
+ ` && (s3 && n && (e += N(s3)), C && (e += j(C)));
1123
+ }
1124
+ return e;
1125
+ };
1126
+ R = Symbol("clack:cancel");
1127
+ V = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
1128
+ tD = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
1129
+ h = class {
1130
+ constructor({ render: u, input: F = import_node_process.stdin, output: e = import_node_process.stdout, ...s3 }, C = true) {
1131
+ this._track = false, this._cursor = 0, this.state = "initial", this.error = "", this.subscribers = /* @__PURE__ */ new Map(), this._prevFrame = "", this.opts = s3, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C, this.input = F, this.output = e;
1132
+ }
1133
+ prompt() {
1134
+ const u = new import_node_tty.WriteStream(0);
1135
+ return u._write = (F, e, s3) => {
1136
+ this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s3();
1137
+ }, this.input.pipe(u), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), g(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F, e) => {
1138
+ this.once("submit", () => {
1139
+ this.output.write(src.cursor.show), this.output.off("resize", this.render), g(this.input, false), F(this.value);
1140
+ }), this.once("cancel", () => {
1141
+ this.output.write(src.cursor.show), this.output.off("resize", this.render), g(this.input, false), F(R);
1142
+ });
1143
+ });
1144
+ }
1145
+ on(u, F) {
1146
+ const e = this.subscribers.get(u) ?? [];
1147
+ e.push({ cb: F }), this.subscribers.set(u, e);
1148
+ }
1149
+ once(u, F) {
1150
+ const e = this.subscribers.get(u) ?? [];
1151
+ e.push({ cb: F, once: true }), this.subscribers.set(u, e);
1152
+ }
1153
+ emit(u, ...F) {
1154
+ const e = this.subscribers.get(u) ?? [], s3 = [];
1155
+ for (const C of e)
1156
+ C.cb(...F), C.once && s3.push(() => e.splice(e.indexOf(C), 1));
1157
+ for (const C of s3)
1158
+ C();
1159
+ }
1160
+ unsubscribe() {
1161
+ this.subscribers.clear();
1162
+ }
1163
+ onKeypress(u, F) {
1164
+ if (this.state === "error" && (this.state = "active"), (F == null ? void 0 : F.name) && !this._track && V.has(F.name) && this.emit("cursor", V.get(F.name)), (F == null ? void 0 : F.name) && tD.has(F.name) && this.emit("cursor", F.name), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u && this.emit("key", u.toLowerCase()), (F == null ? void 0 : F.name) === "return") {
1165
+ if (this.opts.validate) {
1166
+ const e = this.opts.validate(this.value);
1167
+ e && (this.error = e, this.state = "error", this.rl.write(this.value));
1168
+ }
1169
+ this.state !== "error" && (this.state = "submit");
1170
+ }
1171
+ u === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
1172
+ }
1173
+ close() {
1174
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
1175
+ `), g(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
1176
+ }
1177
+ restoreCursor() {
1178
+ const u = P(this._prevFrame, process.stdout.columns, { hard: true }).split(`
1179
+ `).length - 1;
1180
+ this.output.write(src.cursor.move(-999, u * -1));
1181
+ }
1182
+ render() {
1183
+ const u = P(this._render(this) ?? "", process.stdout.columns, { hard: true });
1184
+ if (u !== this._prevFrame) {
1185
+ if (this.state === "initial")
1186
+ this.output.write(src.cursor.hide);
1187
+ else {
1188
+ const F = FD(this._prevFrame, u);
1189
+ if (this.restoreCursor(), F && (F == null ? void 0 : F.length) === 1) {
1190
+ const e = F[0];
1191
+ this.output.write(src.cursor.move(0, e)), this.output.write(src.erase.lines(1));
1192
+ const s3 = u.split(`
1193
+ `);
1194
+ this.output.write(s3[e]), this._prevFrame = u, this.output.write(src.cursor.move(0, s3.length - e - 1));
1195
+ return;
1196
+ } else if (F && (F == null ? void 0 : F.length) > 1) {
1197
+ const e = F[0];
1198
+ this.output.write(src.cursor.move(0, e)), this.output.write(src.erase.down());
1199
+ const C = u.split(`
1200
+ `).slice(e);
1201
+ this.output.write(C.join(`
1202
+ `)), this._prevFrame = u;
1203
+ return;
1204
+ }
1205
+ this.output.write(src.erase.down());
1206
+ }
1207
+ this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
1208
+ }
1209
+ }
1210
+ };
1211
+ sD = class extends h {
1212
+ get cursor() {
1213
+ return this.value ? 0 : 1;
1214
+ }
1215
+ get _value() {
1216
+ return this.cursor === 0;
1217
+ }
1218
+ constructor(u) {
1219
+ super(u, false), this.value = !!u.initialValue, this.on("value", () => {
1220
+ this.value = this._value;
1221
+ }), this.on("confirm", (F) => {
1222
+ this.output.write(src.cursor.move(0, -1)), this.value = F, this.state = "submit", this.close();
1223
+ }), this.on("cursor", () => {
1224
+ this.value = !this.value;
1225
+ });
1226
+ }
1227
+ };
1228
+ iD = class extends h {
1229
+ constructor(u) {
1230
+ super(u, false), this.cursor = 0, this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), 0), this.on("key", (F) => {
1231
+ F === "a" && this.toggleAll();
1232
+ }), this.on("cursor", (F) => {
1233
+ switch (F) {
1234
+ case "left":
1235
+ case "up":
1236
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1237
+ break;
1238
+ case "down":
1239
+ case "right":
1240
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1241
+ break;
1242
+ case "space":
1243
+ this.toggleValue();
1244
+ break;
1245
+ }
1246
+ });
1247
+ }
1248
+ get _value() {
1249
+ return this.options[this.cursor].value;
1250
+ }
1251
+ toggleAll() {
1252
+ const u = this.value.length === this.options.length;
1253
+ this.value = u ? [] : this.options.map((F) => F.value);
1254
+ }
1255
+ toggleValue() {
1256
+ const u = this.value.includes(this._value);
1257
+ this.value = u ? this.value.filter((F) => F !== this._value) : [...this.value, this._value];
1258
+ }
1259
+ };
1260
+ ED = class extends h {
1261
+ constructor(u) {
1262
+ super(u, false), this.cursor = 0, this.options = u.options, this.cursor = this.options.findIndex(({ value: F }) => F === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F) => {
1263
+ switch (F) {
1264
+ case "left":
1265
+ case "up":
1266
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1267
+ break;
1268
+ case "down":
1269
+ case "right":
1270
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1271
+ break;
1272
+ }
1273
+ this.changeValue();
1274
+ });
1275
+ }
1276
+ get _value() {
1277
+ return this.options[this.cursor];
1278
+ }
1279
+ changeValue() {
1280
+ this.value = this._value.value;
1281
+ }
1282
+ };
1283
+ oD = class extends h {
1284
+ constructor(u) {
1285
+ super(u), this.valueWithCursor = "", this.on("finalize", () => {
1286
+ this.value || (this.value = u.defaultValue), this.valueWithCursor = this.value;
1287
+ }), this.on("value", () => {
1288
+ if (this.cursor >= this.value.length)
1289
+ this.valueWithCursor = `${this.value}${l.inverse(l.hidden("_"))}`;
1290
+ else {
1291
+ const F = this.value.slice(0, this.cursor), e = this.value.slice(this.cursor);
1292
+ this.valueWithCursor = `${F}${l.inverse(e[0])}${e.slice(1)}`;
1293
+ }
1294
+ });
1295
+ }
1296
+ get cursor() {
1297
+ return this._cursor;
1298
+ }
1299
+ };
1300
+ unicode = isUnicodeSupported();
1301
+ s = (c2, fallback) => unicode ? c2 : fallback;
1302
+ S_STEP_ACTIVE = s("\u276F", ">");
1303
+ S_STEP_CANCEL = s("\u25A0", "x");
1304
+ S_STEP_ERROR = s("\u25B2", "x");
1305
+ S_STEP_SUBMIT = s("\u2714", "\u221A");
1306
+ S_BAR = "";
1307
+ S_BAR_END = "";
1308
+ S_RADIO_ACTIVE = s("\u25CF", ">");
1309
+ S_RADIO_INACTIVE = s("\u25CB", " ");
1310
+ S_CHECKBOX_ACTIVE = s("\u25FB", "[\u2022]");
1311
+ S_CHECKBOX_SELECTED = s("\u25FC", "[+]");
1312
+ S_CHECKBOX_INACTIVE = s("\u25FB", "[ ]");
1313
+ symbol = (state) => {
1314
+ switch (state) {
1315
+ case "initial":
1316
+ case "active": {
1317
+ return colors.cyan(S_STEP_ACTIVE);
1318
+ }
1319
+ case "cancel": {
1320
+ return colors.red(S_STEP_CANCEL);
1321
+ }
1322
+ case "error": {
1323
+ return colors.yellow(S_STEP_ERROR);
1324
+ }
1325
+ case "submit": {
1326
+ return colors.green(S_STEP_SUBMIT);
1327
+ }
1328
+ }
1329
+ };
1330
+ text = (opts) => {
1331
+ return new oD({
1332
+ validate: opts.validate,
1333
+ placeholder: opts.placeholder,
1334
+ defaultValue: opts.defaultValue,
1335
+ initialValue: opts.initialValue,
1336
+ render() {
1337
+ var _a;
1338
+ const title = `${colors.gray(S_BAR)}
1339
+ ${symbol(this.state)} ${opts.message}
1340
+ `;
1341
+ const placeholder = opts.placeholder ? colors.inverse(opts.placeholder[0]) + colors.dim(opts.placeholder.slice(1)) : colors.inverse(colors.hidden("_"));
1342
+ const value = this.value ? this.valueWithCursor : placeholder;
1343
+ switch (this.state) {
1344
+ case "error": {
1345
+ return `${title.trim()}
1346
+ ${colors.yellow(
1347
+ S_BAR
1348
+ )} ${value}
1349
+ ${colors.yellow(S_BAR_END)} ${colors.yellow(
1350
+ this.error
1351
+ )}
1352
+ `;
1353
+ }
1354
+ case "submit": {
1355
+ return `${title}${colors.gray(S_BAR)} ${colors.dim(
1356
+ this.value || opts.placeholder
1357
+ )}`;
1358
+ }
1359
+ case "cancel": {
1360
+ return `${title}${colors.gray(S_BAR)} ${colors.strikethrough(
1361
+ colors.dim(this.value ?? "")
1362
+ )}${((_a = this.value) == null ? void 0 : _a.trim()) ? "\n" + colors.gray(S_BAR) : ""}`;
1363
+ }
1364
+ default: {
1365
+ return `${title}${colors.cyan(S_BAR)} ${value}
1366
+ ${colors.cyan(
1367
+ S_BAR_END
1368
+ )}
1369
+ `;
1370
+ }
1371
+ }
1372
+ }
1373
+ }).prompt();
1374
+ };
1375
+ confirm = (opts) => {
1376
+ const active = opts.active ?? "Yes";
1377
+ const inactive = opts.inactive ?? "No";
1378
+ return new sD({
1379
+ active,
1380
+ inactive,
1381
+ initialValue: opts.initialValue ?? true,
1382
+ render() {
1383
+ const title = `${colors.gray(S_BAR)}
1384
+ ${symbol(this.state)} ${opts.message}
1385
+ `;
1386
+ const value = this.value ? active : inactive;
1387
+ switch (this.state) {
1388
+ case "submit": {
1389
+ return `${title}${colors.gray(S_BAR)} ${colors.dim(value)}`;
1390
+ }
1391
+ case "cancel": {
1392
+ return `${title}${colors.gray(S_BAR)} ${colors.strikethrough(
1393
+ colors.dim(value)
1394
+ )}
1395
+ ${colors.gray(S_BAR)}`;
1396
+ }
1397
+ default: {
1398
+ return `${title}${colors.cyan(S_BAR)} ${this.value ? `${colors.green(S_RADIO_ACTIVE)} ${active}` : `${colors.dim(S_RADIO_INACTIVE)} ${colors.dim(active)}`} ${colors.dim("/")} ${this.value ? `${colors.dim(S_RADIO_INACTIVE)} ${colors.dim(inactive)}` : `${colors.green(S_RADIO_ACTIVE)} ${inactive}`}
1399
+ ${colors.cyan(S_BAR_END)}
1400
+ `;
1401
+ }
1402
+ }
1403
+ }
1404
+ }).prompt();
1405
+ };
1406
+ select = (opts) => {
1407
+ const opt = (option, state) => {
1408
+ const label = option.label ?? String(option.value);
1409
+ switch (state) {
1410
+ case "active": {
1411
+ return `${colors.green(S_RADIO_ACTIVE)} ${label} ${option.hint ? colors.dim(`(${option.hint})`) : ""}`;
1412
+ }
1413
+ case "selected": {
1414
+ return `${colors.dim(label)}`;
1415
+ }
1416
+ case "cancelled": {
1417
+ return `${colors.strikethrough(colors.dim(label))}`;
1418
+ }
1419
+ }
1420
+ return `${colors.dim(S_RADIO_INACTIVE)} ${colors.dim(label)}`;
1421
+ };
1422
+ return new ED({
1423
+ options: opts.options,
1424
+ initialValue: opts.initialValue,
1425
+ render() {
1426
+ const title = `${colors.gray(S_BAR)}
1427
+ ${symbol(this.state)} ${opts.message}
1428
+ `;
1429
+ switch (this.state) {
1430
+ case "submit": {
1431
+ return `${title}${colors.gray(S_BAR)} ${opt(
1432
+ this.options[this.cursor],
1433
+ "selected"
1434
+ )}`;
1435
+ }
1436
+ case "cancel": {
1437
+ return `${title}${colors.gray(S_BAR)} ${opt(
1438
+ this.options[this.cursor],
1439
+ "cancelled"
1440
+ )}
1441
+ ${colors.gray(S_BAR)}`;
1442
+ }
1443
+ default: {
1444
+ return `${title}${colors.cyan(S_BAR)} ${this.options.map(
1445
+ (option, i) => opt(option, i === this.cursor ? "active" : "inactive")
1446
+ ).join(`
1447
+ ${colors.cyan(S_BAR)} `)}
1448
+ ${colors.cyan(S_BAR_END)}
1449
+ `;
1450
+ }
1451
+ }
1452
+ }
1453
+ }).prompt();
1454
+ };
1455
+ multiselect = (opts) => {
1456
+ const opt = (option, state) => {
1457
+ const label = option.label ?? String(option.value);
1458
+ switch (state) {
1459
+ case "active": {
1460
+ return `${colors.cyan(S_CHECKBOX_ACTIVE)} ${label} ${option.hint ? colors.dim(`(${option.hint})`) : ""}`;
1461
+ }
1462
+ case "selected": {
1463
+ return `${colors.green(S_CHECKBOX_SELECTED)} ${colors.dim(label)}`;
1464
+ }
1465
+ case "cancelled": {
1466
+ return `${colors.strikethrough(colors.dim(label))}`;
1467
+ }
1468
+ case "active-selected": {
1469
+ return `${colors.green(S_CHECKBOX_SELECTED)} ${label} ${option.hint ? colors.dim(`(${option.hint})`) : ""}`;
1470
+ }
1471
+ case "submitted": {
1472
+ return `${colors.dim(label)}`;
1473
+ }
1474
+ }
1475
+ return `${colors.dim(S_CHECKBOX_INACTIVE)} ${colors.dim(label)}`;
1476
+ };
1477
+ return new iD({
1478
+ options: opts.options,
1479
+ initialValues: opts.initialValues,
1480
+ required: opts.required ?? true,
1481
+ cursorAt: opts.cursorAt,
1482
+ validate(selected) {
1483
+ if (this.required && selected.length === 0) {
1484
+ return `Please select at least one option.
1485
+ ${colors.reset(
1486
+ colors.dim(
1487
+ `Press ${colors.gray(
1488
+ colors.bgWhite(colors.inverse(" space "))
1489
+ )} to select, ${colors.gray(
1490
+ colors.bgWhite(colors.inverse(" enter "))
1491
+ )} to submit`
1492
+ )
1493
+ )}`;
1494
+ }
1495
+ },
1496
+ render() {
1497
+ const title = `${colors.gray(S_BAR)}
1498
+ ${symbol(this.state)} ${opts.message}
1499
+ `;
1500
+ switch (this.state) {
1501
+ case "submit": {
1502
+ return `${title}${colors.gray(S_BAR)} ${this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "submitted")).join(colors.dim(", ")) || colors.dim("none")}`;
1503
+ }
1504
+ case "cancel": {
1505
+ const label = this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "cancelled")).join(colors.dim(", "));
1506
+ return `${title}${colors.gray(S_BAR)} ${label.trim() ? `${label}
1507
+ ${colors.gray(S_BAR)}` : ""}`;
1508
+ }
1509
+ case "error": {
1510
+ const footer = this.error.split("\n").map(
1511
+ (ln, i) => i === 0 ? `${colors.yellow(S_BAR_END)} ${colors.yellow(ln)}` : ` ${ln}`
1512
+ ).join("\n");
1513
+ return title + colors.yellow(S_BAR) + " " + this.options.map((option, i) => {
1514
+ const selected = this.value.includes(option.value);
1515
+ const active = i === this.cursor;
1516
+ if (active && selected) {
1517
+ return opt(option, "active-selected");
1518
+ }
1519
+ if (selected) {
1520
+ return opt(option, "selected");
1521
+ }
1522
+ return opt(option, active ? "active" : "inactive");
1523
+ }).join(`
1524
+ ${colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
1525
+ }
1526
+ default: {
1527
+ return `${title}${colors.cyan(S_BAR)} ${this.options.map((option, i) => {
1528
+ const selected = this.value.includes(option.value);
1529
+ const active = i === this.cursor;
1530
+ if (active && selected) {
1531
+ return opt(option, "active-selected");
1532
+ }
1533
+ if (selected) {
1534
+ return opt(option, "selected");
1535
+ }
1536
+ return opt(option, active ? "active" : "inactive");
1537
+ }).join(`
1538
+ ${colors.cyan(S_BAR)} `)}
1539
+ ${colors.cyan(S_BAR_END)}
1540
+ `;
1541
+ }
1542
+ }
1543
+ }
1544
+ }).prompt();
1545
+ };
1546
+ }
1547
+ });
1548
+
1549
+ // node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.36c0034f.mjs
1550
+ function detectProvider(env2) {
1551
+ for (const provider of providers) {
1552
+ const envName = provider[1] || provider[0];
1553
+ if (env2[envName]) {
1554
+ return {
1555
+ name: provider[0].toLowerCase(),
1556
+ ...provider[2]
1557
+ };
1558
+ }
1559
+ }
1560
+ if (env2.SHELL && env2.SHELL === "/bin/jsh") {
1561
+ return {
1562
+ name: "stackblitz",
1563
+ ci: false
1564
+ };
1565
+ }
1566
+ return {
1567
+ name: "",
1568
+ ci: false
1569
+ };
1570
+ }
1571
+ function toBoolean(val) {
1572
+ return val ? val !== "false" : false;
1573
+ }
1574
+ function ansiRegex2({ onlyFirst = false } = {}) {
1575
+ const pattern = [
1576
+ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
1577
+ "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
1578
+ ].join("|");
1579
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
1580
+ }
1581
+ function stripAnsi2(string) {
1582
+ if (typeof string !== "string") {
1583
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
1584
+ }
1585
+ return string.replace(regex, "");
1586
+ }
1587
+ function getDefaultExportFromCjs(x) {
1588
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1589
+ }
1590
+ function stringWidth$1(string, options) {
1591
+ if (typeof string !== "string" || string.length === 0) {
1592
+ return 0;
1593
+ }
1594
+ options = {
1595
+ ambiguousIsNarrow: true,
1596
+ countAnsiEscapeCodes: false,
1597
+ ...options
1598
+ };
1599
+ if (!options.countAnsiEscapeCodes) {
1600
+ string = stripAnsi2(string);
1601
+ }
1602
+ if (string.length === 0) {
1603
+ return 0;
1604
+ }
1605
+ const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
1606
+ let width = 0;
1607
+ for (const { segment: character } of new Intl.Segmenter().segment(string)) {
1608
+ const codePoint = character.codePointAt(0);
1609
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
1610
+ continue;
1611
+ }
1612
+ if (codePoint >= 768 && codePoint <= 879) {
1613
+ continue;
1614
+ }
1615
+ if (emojiRegex().test(character)) {
1616
+ width += 2;
1617
+ continue;
1618
+ }
1619
+ const code = eastAsianWidth.eastAsianWidth(character);
1620
+ switch (code) {
1621
+ case "F":
1622
+ case "W": {
1623
+ width += 2;
1624
+ break;
1625
+ }
1626
+ case "A": {
1627
+ width += ambiguousCharacterWidth;
1628
+ break;
1629
+ }
1630
+ default: {
1631
+ width += 1;
1632
+ }
1633
+ }
1634
+ }
1635
+ return width;
1636
+ }
1637
+ function isUnicodeSupported() {
1638
+ if (import_node_process2.default.platform !== "win32") {
1639
+ return import_node_process2.default.env.TERM !== "linux";
1640
+ }
1641
+ return Boolean(import_node_process2.default.env.CI) || Boolean(import_node_process2.default.env.WT_SESSION) || Boolean(import_node_process2.default.env.TERMINUS_SUBLIME) || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1642
+ }
1643
+ function stringWidth(str) {
1644
+ if (!Intl.Segmenter) {
1645
+ return stripAnsi(str).length;
1646
+ }
1647
+ return stringWidth$1(str);
1648
+ }
1649
+ function characterFormat(str) {
1650
+ return str.replace(/`([^`]+)`/gm, (_2, m2) => colors.cyan(m2)).replace(/\s+_([^_]+)_\s+/gm, (_2, m2) => ` ${colors.underline(m2)} `);
1651
+ }
1652
+ function getColor2(color = "white") {
1653
+ return colors[color] || colors.white;
1654
+ }
1655
+ function getBgColor(color = "bgWhite") {
1656
+ return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
1657
+ }
1658
+ function createConsola2(options = {}) {
1659
+ let level = _getDefaultLogLevel();
1660
+ if (process.env.CONSOLA_LEVEL) {
1661
+ level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
1662
+ }
1663
+ const consola2 = createConsola({
1664
+ level,
1665
+ defaults: { level },
1666
+ stdout: process.stdout,
1667
+ stderr: process.stderr,
1668
+ prompt: (...args) => Promise.resolve().then(() => (init_prompt(), prompt_exports)).then((m2) => m2.prompt(...args)),
1669
+ reporters: options.reporters || [
1670
+ options.fancy ?? !(isCI2 || isTest) ? new FancyReporter() : new BasicReporter()
1671
+ ],
1672
+ ...options
1673
+ });
1674
+ return consola2;
1675
+ }
1676
+ function _getDefaultLogLevel() {
1677
+ if (isDebug) {
1678
+ return LogLevels.debug;
1679
+ }
1680
+ if (isTest) {
1681
+ return LogLevels.warn;
1682
+ }
1683
+ return LogLevels.info;
1684
+ }
1685
+ var import_node_process2, providers, processShim, envShim, providerInfo, nodeENV, isCI2, hasTTY, isDebug, isTest, regex, eastasianwidth, eastasianwidthExports, eastAsianWidth, emojiRegex, TYPE_COLOR_MAP, LEVEL_COLOR_MAP, unicode2, s2, TYPE_ICONS, FancyReporter, consola;
1686
+ var init_consola_36c0034f = __esm({
1687
+ "node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.36c0034f.mjs"() {
1688
+ "use strict";
1689
+ init_cjs_shims();
1690
+ init_core();
1691
+ init_consola_06ad8a64();
1692
+ import_node_process2 = __toESM(require("process"), 1);
1693
+ init_utils();
1694
+ providers = [
1695
+ ["APPVEYOR"],
1696
+ ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
1697
+ ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
1698
+ ["APPCIRCLE", "AC_APPCIRCLE"],
1699
+ ["BAMBOO", "bamboo_planKey"],
1700
+ ["BITBUCKET", "BITBUCKET_COMMIT"],
1701
+ ["BITRISE", "BITRISE_IO"],
1702
+ ["BUDDY", "BUDDY_WORKSPACE_ID"],
1703
+ ["BUILDKITE"],
1704
+ ["CIRCLE", "CIRCLECI"],
1705
+ ["CIRRUS", "CIRRUS_CI"],
1706
+ ["CLOUDFLARE_PAGES", "CF_PAGES", { ci: true }],
1707
+ ["CODEBUILD", "CODEBUILD_BUILD_ARN"],
1708
+ ["CODEFRESH", "CF_BUILD_ID"],
1709
+ ["DRONE"],
1710
+ ["DRONE", "DRONE_BUILD_EVENT"],
1711
+ ["DSARI"],
1712
+ ["GITHUB_ACTIONS"],
1713
+ ["GITLAB", "GITLAB_CI"],
1714
+ ["GITLAB", "CI_MERGE_REQUEST_ID"],
1715
+ ["GOCD", "GO_PIPELINE_LABEL"],
1716
+ ["LAYERCI"],
1717
+ ["HUDSON", "HUDSON_URL"],
1718
+ ["JENKINS", "JENKINS_URL"],
1719
+ ["MAGNUM"],
1720
+ ["NETLIFY"],
1721
+ ["NETLIFY", "NETLIFY_LOCAL", { ci: false }],
1722
+ ["NEVERCODE"],
1723
+ ["RENDER"],
1724
+ ["SAIL", "SAILCI"],
1725
+ ["SEMAPHORE"],
1726
+ ["SCREWDRIVER"],
1727
+ ["SHIPPABLE"],
1728
+ ["SOLANO", "TDDIUM"],
1729
+ ["STRIDER"],
1730
+ ["TEAMCITY", "TEAMCITY_VERSION"],
1731
+ ["TRAVIS"],
1732
+ ["VERCEL", "NOW_BUILDER"],
1733
+ ["APPCENTER", "APPCENTER_BUILD_ID"],
1734
+ ["CODESANDBOX", "CODESANDBOX_SSE", { ci: false }],
1735
+ ["STACKBLITZ"],
1736
+ ["STORMKIT"],
1737
+ ["CLEAVR"]
1738
+ ];
1739
+ processShim = typeof process !== "undefined" ? process : {};
1740
+ envShim = processShim.env || {};
1741
+ providerInfo = detectProvider(envShim);
1742
+ nodeENV = typeof process !== "undefined" && process.env && process.env.NODE_ENV || "";
1743
+ processShim.platform;
1744
+ providerInfo.name;
1745
+ isCI2 = toBoolean(envShim.CI) || providerInfo.ci !== false;
1746
+ hasTTY = toBoolean(processShim.stdout && processShim.stdout.isTTY);
1747
+ isDebug = toBoolean(envShim.DEBUG);
1748
+ isTest = nodeENV === "test" || toBoolean(envShim.TEST);
1749
+ toBoolean(envShim.MINIMAL) || isCI2 || isTest || !hasTTY;
1750
+ regex = ansiRegex2();
1751
+ eastasianwidth = { exports: {} };
1752
+ (function(module2) {
1753
+ var eaw = {};
1754
+ {
1755
+ module2.exports = eaw;
1756
+ }
1757
+ eaw.eastAsianWidth = function(character) {
1758
+ var x = character.charCodeAt(0);
1759
+ var y = character.length == 2 ? character.charCodeAt(1) : 0;
1760
+ var codePoint = x;
1761
+ if (55296 <= x && x <= 56319 && (56320 <= y && y <= 57343)) {
1762
+ x &= 1023;
1763
+ y &= 1023;
1764
+ codePoint = x << 10 | y;
1765
+ codePoint += 65536;
1766
+ }
1767
+ if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) {
1768
+ return "F";
1769
+ }
1770
+ if (8361 == codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) {
1771
+ return "H";
1772
+ }
1773
+ if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) {
1774
+ return "W";
1775
+ }
1776
+ if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 == codePoint || 175 == codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) {
1777
+ return "Na";
1778
+ }
1779
+ if (161 == codePoint || 164 == codePoint || 167 <= codePoint && codePoint <= 168 || 170 == codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 == codePoint || 208 == codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 == codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 == codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 == codePoint || 254 == codePoint || 257 == codePoint || 273 == codePoint || 275 == codePoint || 283 == codePoint || 294 <= codePoint && codePoint <= 295 || 299 == codePoint || 305 <= codePoint && codePoint <= 307 || 312 == codePoint || 319 <= codePoint && codePoint <= 322 || 324 == codePoint || 328 <= codePoint && codePoint <= 331 || 333 == codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 == codePoint || 462 == codePoint || 464 == codePoint || 466 == codePoint || 468 == codePoint || 470 == codePoint || 472 == codePoint || 474 == codePoint || 476 == codePoint || 593 == codePoint || 609 == codePoint || 708 == codePoint || 711 == codePoint || 713 <= codePoint && codePoint <= 715 || 717 == codePoint || 720 == codePoint || 728 <= codePoint && codePoint <= 731 || 733 == codePoint || 735 == codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 == codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 == codePoint || 8208 == codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 == codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 == codePoint || 8251 == codePoint || 8254 == codePoint || 8308 == codePoint || 8319 == codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 == codePoint || 8451 == codePoint || 8453 == codePoint || 8457 == codePoint || 8467 == codePoint || 8470 == codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 == codePoint || 8491 == codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 == codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 == codePoint || 8660 == codePoint || 8679 == codePoint || 8704 == codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 == codePoint || 8719 == codePoint || 8721 == codePoint || 8725 == codePoint || 8730 == codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 == codePoint || 8741 == codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 == codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 == codePoint || 8780 == codePoint || 8786 == codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 == codePoint || 8857 == codePoint || 8869 == codePoint || 8895 == codePoint || 8978 == codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 == codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 == codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 == codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 == codePoint || 9758 == codePoint || 9792 == codePoint || 9794 == codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 == codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 == codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 == codePoint || 10071 == codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 == codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109) {
1780
+ return "A";
1781
+ }
1782
+ return "N";
1783
+ };
1784
+ eaw.characterLength = function(character) {
1785
+ var code = this.eastAsianWidth(character);
1786
+ if (code == "F" || code == "W" || code == "A") {
1787
+ return 2;
1788
+ } else {
1789
+ return 1;
1790
+ }
1791
+ };
1792
+ function stringToArray(string) {
1793
+ return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
1794
+ }
1795
+ eaw.length = function(string) {
1796
+ var characters = stringToArray(string);
1797
+ var len = 0;
1798
+ for (var i = 0; i < characters.length; i++) {
1799
+ len = len + this.characterLength(characters[i]);
1800
+ }
1801
+ return len;
1802
+ };
1803
+ eaw.slice = function(text2, start, end) {
1804
+ textLen = eaw.length(text2);
1805
+ start = start ? start : 0;
1806
+ end = end ? end : 1;
1807
+ if (start < 0) {
1808
+ start = textLen + start;
1809
+ }
1810
+ if (end < 0) {
1811
+ end = textLen + end;
1812
+ }
1813
+ var result = "";
1814
+ var eawLen = 0;
1815
+ var chars = stringToArray(text2);
1816
+ for (var i = 0; i < chars.length; i++) {
1817
+ var char = chars[i];
1818
+ var charLen = eaw.length(char);
1819
+ if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
1820
+ if (eawLen + charLen <= end) {
1821
+ result += char;
1822
+ } else {
1823
+ break;
1824
+ }
1825
+ }
1826
+ eawLen += charLen;
1827
+ }
1828
+ return result;
1829
+ };
1830
+ })(eastasianwidth);
1831
+ eastasianwidthExports = eastasianwidth.exports;
1832
+ eastAsianWidth = /* @__PURE__ */ getDefaultExportFromCjs(eastasianwidthExports);
1833
+ emojiRegex = () => {
1834
+ return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
1835
+ };
1836
+ TYPE_COLOR_MAP = {
1837
+ info: "cyan",
1838
+ fail: "red",
1839
+ success: "green",
1840
+ ready: "green",
1841
+ start: "magenta"
1842
+ };
1843
+ LEVEL_COLOR_MAP = {
1844
+ 0: "red",
1845
+ 1: "yellow"
1846
+ };
1847
+ unicode2 = isUnicodeSupported();
1848
+ s2 = (c2, fallback) => unicode2 ? c2 : fallback;
1849
+ TYPE_ICONS = {
1850
+ error: s2("\u2716", "\xD7"),
1851
+ fatal: s2("\u2716", "\xD7"),
1852
+ ready: s2("\u2714", "\u221A"),
1853
+ warn: s2("\u26A0", "\u203C"),
1854
+ info: s2("\u2139", "i"),
1855
+ success: s2("\u2714", "\u221A"),
1856
+ debug: s2("\u2699", "D"),
1857
+ trace: s2("\u2192", "\u2192"),
1858
+ fail: s2("\u2716", "\xD7"),
1859
+ start: s2("\u25D0", "o"),
1860
+ log: ""
1861
+ };
1862
+ FancyReporter = class extends BasicReporter {
1863
+ formatStack(stack) {
1864
+ return "\n" + parseStack(stack).map(
1865
+ (line) => " " + line.replace(/^at +/, (m2) => colors.gray(m2)).replace(/\((.+)\)/, (_2, m2) => `(${colors.cyan(m2)})`)
1866
+ ).join("\n");
1867
+ }
1868
+ formatType(logObj, isBadge, opts) {
1869
+ const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
1870
+ if (isBadge) {
1871
+ return getBgColor(typeColor)(
1872
+ colors.black(` ${logObj.type.toUpperCase()} `)
1873
+ );
1874
+ }
1875
+ const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
1876
+ return _type ? getColor2(typeColor)(_type) : "";
1877
+ }
1878
+ formatLogObj(logObj, opts) {
1879
+ const [message, ...additional] = this.formatArgs(logObj.args, opts).split(
1880
+ "\n"
1881
+ );
1882
+ if (logObj.type === "box") {
1883
+ return box(
1884
+ characterFormat(
1885
+ message + (additional.length > 0 ? "\n" + additional.join("\n") : "")
1886
+ ),
1887
+ {
1888
+ title: logObj.title ? characterFormat(logObj.title) : void 0,
1889
+ style: logObj.style
1890
+ }
1891
+ );
1892
+ }
1893
+ const date = this.formatDate(logObj.date, opts);
1894
+ const coloredDate = date && colors.gray(date);
1895
+ const isBadge = logObj.badge ?? logObj.level < 2;
1896
+ const type = this.formatType(logObj, isBadge, opts);
1897
+ const tag = logObj.tag ? colors.gray(logObj.tag) : "";
1898
+ let line;
1899
+ const left = this.filterAndJoin([type, characterFormat(message)]);
1900
+ const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
1901
+ const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
1902
+ line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
1903
+ line += characterFormat(
1904
+ additional.length > 0 ? "\n" + additional.join("\n") : ""
1905
+ );
1906
+ if (logObj.type === "trace") {
1907
+ const _err = new Error("Trace: " + logObj.message);
1908
+ line += this.formatStack(_err.stack || "");
1909
+ }
1910
+ return isBadge ? "\n" + line + "\n" : line;
1911
+ }
1912
+ };
1913
+ consola = createConsola2();
1914
+ }
1915
+ });
1916
+
1917
+ // src/index.ts
1918
+ var src_exports = {};
1919
+ __export(src_exports, {
1920
+ generateChangelog: () => generateChangelog,
1921
+ generateTotalChangelog: () => generateTotalChangelog,
1922
+ getChangelogMarkdown: () => getChangelogMarkdown,
1923
+ getTotalChangelogMarkdown: () => getTotalChangelogMarkdown
1924
+ });
1925
+ module.exports = __toCommonJS(src_exports);
1926
+ init_cjs_shims();
1927
+ var import_cli_progress = require("cli-progress");
1928
+
1929
+ // src/options.ts
1930
+ init_cjs_shims();
1931
+ var import_node_process4 = __toESM(require("process"), 1);
1932
+ var import_promises = require("fs/promises");
1933
+
1934
+ // src/git.ts
1935
+ init_cjs_shims();
1936
+ var import_ofetch = require("ofetch");
1937
+ var import_dayjs = __toESM(require("dayjs"), 1);
1938
+
1939
+ // node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/index.mjs
1940
+ init_cjs_shims();
1941
+ init_consola_36c0034f();
1942
+ init_core();
1943
+ init_consola_06ad8a64();
1944
+ var import_node_process3 = require("process");
1945
+ init_utils();
1946
+ var import_node_tty2 = require("tty");
1947
+ var import_node_util3 = require("util");
1948
+ var import_node_path3 = require("path");
1949
+
1950
+ // src/shared.ts
1951
+ init_cjs_shims();
1952
+ async function execCommand(cmd, args, options) {
1953
+ var _a;
1954
+ const { execa } = await import("execa");
1955
+ const res = await execa(cmd, args, options);
1956
+ return ((_a = res == null ? void 0 : res.stdout) == null ? void 0 : _a.trim()) || "";
1957
+ }
1958
+ function notNullish(v2) {
1959
+ return v2 !== null && v2 !== void 0;
1960
+ }
1961
+ function partition(array, ...filters) {
1962
+ const result = Array.from({ length: filters.length + 1 }).fill(null).map(() => []);
1963
+ array.forEach((e, idx, arr) => {
1964
+ let i = 0;
1965
+ for (const filter of filters) {
1966
+ if (filter(e, idx, arr)) {
1967
+ result[i].push(e);
1968
+ return;
1969
+ }
1970
+ i += 1;
1971
+ }
1972
+ result[i].push(e);
1973
+ });
1974
+ return result;
1975
+ }
1976
+ function groupBy(items, key, groups = {}) {
1977
+ for (const item of items) {
1978
+ const v2 = item[key];
1979
+ groups[v2] || (groups[v2] = []);
1980
+ groups[v2].push(item);
1981
+ }
1982
+ return groups;
1983
+ }
1984
+ function capitalize(str) {
1985
+ return str.charAt(0).toUpperCase() + str.slice(1);
1986
+ }
1987
+ function join(array, glue = ", ", finalGlue = " and ") {
1988
+ if (!array || array.length === 0)
1989
+ return "";
1990
+ if (array.length === 1)
1991
+ return array[0];
1992
+ if (array.length === 2)
1993
+ return array.join(finalGlue);
1994
+ return `${array.slice(0, -1).join(glue)}${finalGlue}${array.slice(-1)}`;
1995
+ }
1996
+
1997
+ // src/constant.ts
1998
+ init_cjs_shims();
1999
+ var VERSION_REG = /v\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?/;
2000
+ var VERSION_REG_OF_MARKDOWN = /## \[v\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?]/g;
2001
+ var VERSION_WITH_RELEASE = /release\sv\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?/;
2002
+
2003
+ // src/git.ts
2004
+ async function getTotalGitTags() {
2005
+ const tagStr = await execCommand("git", ["--no-pager", "tag", "-l", "--sort=creatordate"]);
2006
+ const tags = tagStr.split("\n");
2007
+ return tags;
2008
+ }
2009
+ async function getTagDateMap() {
2010
+ const tagDateStr = await execCommand("git", [
2011
+ "--no-pager",
2012
+ "log",
2013
+ "--tags",
2014
+ "--simplify-by-decoration",
2015
+ "--pretty=format:%ci %d"
2016
+ ]);
2017
+ const TAG_MARK = "tag: ";
2018
+ const map = /* @__PURE__ */ new Map();
2019
+ const dates = tagDateStr.split("\n").filter((item) => item.includes(TAG_MARK));
2020
+ dates.forEach((item) => {
2021
+ var _a;
2022
+ const [dateStr, tagStr] = item.split(TAG_MARK);
2023
+ const date = (0, import_dayjs.default)(dateStr).format("YYYY-MM-DD");
2024
+ const tag = (_a = tagStr.match(VERSION_REG)) == null ? void 0 : _a[0];
2025
+ if (tag && date) {
2026
+ map.set(tag.trim(), date);
2027
+ }
2028
+ });
2029
+ return map;
2030
+ }
2031
+ function getFromToTags(tags) {
2032
+ const result = [];
2033
+ tags.forEach((tag, index) => {
2034
+ if (index < tags.length - 1) {
2035
+ result.push({ from: tag, to: tags[index + 1] });
2036
+ }
2037
+ });
2038
+ return result;
2039
+ }
2040
+ async function getLastGitTag(delta = 0) {
2041
+ const tags = await getTotalGitTags();
2042
+ return tags[tags.length + delta - 1];
2043
+ }
2044
+ async function getGitMainBranchName() {
2045
+ const main = await execCommand("git", ["rev-parse", "--abbrev-ref", "HEAD"]);
2046
+ return main;
2047
+ }
2048
+ async function getCurrentGitBranch() {
2049
+ const tag = await execCommand("git", ["tag", "--points-at", "HEAD"]);
2050
+ const main = getGitMainBranchName();
2051
+ return tag || main;
2052
+ }
2053
+ async function getGitHubRepo() {
2054
+ const url = await execCommand("git", ["config", "--get", "remote.origin.url"]);
2055
+ const match = url.match(/github\.com[/:]([\w\d._-]+?)\/([\w\d._-]+?)(\.git)?$/i);
2056
+ if (!match) {
2057
+ throw new Error(`Can not parse GitHub repo from url ${url}`);
2058
+ }
2059
+ return `${match[1]}/${match[2]}`;
2060
+ }
2061
+ function isPrerelease(version) {
2062
+ const REG = /^[^.]*[\d.]+$/;
2063
+ return !REG.test(version);
2064
+ }
2065
+ function getFirstGitCommit() {
2066
+ return execCommand("git", ["rev-list", "--max-parents=0", "HEAD"]);
2067
+ }
2068
+ async function getGitDiff(from, to = "HEAD") {
2069
+ const rawGit = await execCommand("git", [
2070
+ "--no-pager",
2071
+ "log",
2072
+ `${from ? `${from}...` : ""}${to}`,
2073
+ '--pretty="----%n%s|%h|%an|%ae%n%b"',
2074
+ "--name-status"
2075
+ ]);
2076
+ const rwaGitLines = rawGit.split("----\n").splice(1);
2077
+ const gitCommits = rwaGitLines.map((line) => {
2078
+ const [firstLine, ...body] = line.split("\n");
2079
+ const [message, shortHash, authorName, authorEmail] = firstLine.split("|");
2080
+ const gitCommit = {
2081
+ message,
2082
+ shortHash,
2083
+ author: { name: authorName, email: authorEmail },
2084
+ body: body.join("\n")
2085
+ };
2086
+ return gitCommit;
2087
+ });
2088
+ return gitCommits;
2089
+ }
2090
+ function parseGitCommit(commit) {
2091
+ const ConventionalCommitRegex = /(?<type>[a-z]+)(\((?<scope>.+)\))?(?<breaking>!)?: (?<description>.+)/i;
2092
+ const CoAuthoredByRegex = /co-authored-by:\s*(?<name>.+)(<(?<email>.+)>)/gim;
2093
+ const PullRequestRE = /\([a-z]*(#\d+)\s*\)/gm;
2094
+ const IssueRE = /(#\d+)/gm;
2095
+ const match = commit.message.match(ConventionalCommitRegex);
2096
+ if (!(match == null ? void 0 : match.groups)) {
2097
+ return null;
2098
+ }
2099
+ const type = match.groups.type;
2100
+ const scope = match.groups.scope || "";
2101
+ const isBreaking = Boolean(match.groups.breaking);
2102
+ let description = match.groups.description;
2103
+ const references = [];
2104
+ for (const m2 of description.matchAll(PullRequestRE)) {
2105
+ references.push({ type: "pull-request", value: m2[1] });
2106
+ }
2107
+ for (const m2 of description.matchAll(IssueRE)) {
2108
+ if (!references.some((i) => i.value === m2[1])) {
2109
+ references.push({ type: "issue", value: m2[1] });
2110
+ }
2111
+ }
2112
+ references.push({ value: commit.shortHash, type: "hash" });
2113
+ description = description.replace(PullRequestRE, "").trim();
2114
+ const authors = [commit.author];
2115
+ const matches = commit.body.matchAll(CoAuthoredByRegex);
2116
+ for (const $match of matches) {
2117
+ const { name = "", email = "" } = $match.groups || {};
2118
+ const author = {
2119
+ name: name.trim(),
2120
+ email: email.trim()
2121
+ };
2122
+ authors.push(author);
2123
+ }
2124
+ return {
2125
+ ...commit,
2126
+ authors,
2127
+ resolvedAuthors: [],
2128
+ description,
2129
+ type,
2130
+ scope,
2131
+ references,
2132
+ isBreaking
2133
+ };
2134
+ }
2135
+ async function getGitCommits(from, to = "HEAD") {
2136
+ const rwaGitCommits = await getGitDiff(from, to);
2137
+ const commits = rwaGitCommits.map((commit) => parseGitCommit(commit)).filter(notNullish);
2138
+ return commits;
2139
+ }
2140
+ function getHeaders(githubToken) {
2141
+ return {
2142
+ accept: "application/vnd.github.v3+json",
2143
+ authorization: `token ${githubToken}`
2144
+ };
2145
+ }
2146
+ async function getResolvedAuthorLogin(github, commitHashes, email) {
2147
+ var _a, _b;
2148
+ let login = "";
2149
+ try {
2150
+ const data = await (0, import_ofetch.ofetch)(`https://ungh.cc/users/find/${email}`);
2151
+ login = ((_a = data == null ? void 0 : data.user) == null ? void 0 : _a.username) || "";
2152
+ } catch (e) {
2153
+ consola.log("e: ", e);
2154
+ }
2155
+ if (login) {
2156
+ return login;
2157
+ }
2158
+ const { repo, token } = github;
2159
+ if (!token) {
2160
+ return login;
2161
+ }
2162
+ if (commitHashes.length) {
2163
+ try {
2164
+ const data = await (0, import_ofetch.ofetch)(`https://api.github.com/repos/${repo}/commits/${commitHashes[0]}`, {
2165
+ headers: getHeaders(token)
2166
+ });
2167
+ login = ((_b = data == null ? void 0 : data.author) == null ? void 0 : _b.login) || "";
2168
+ } catch (e) {
2169
+ consola.log("e: ", e);
2170
+ }
2171
+ }
2172
+ if (login) {
2173
+ return login;
2174
+ }
2175
+ try {
2176
+ const data = await (0, import_ofetch.ofetch)(`https://api.github.com/search/users?q=${encodeURIComponent(email)}`, {
2177
+ headers: getHeaders(token)
2178
+ });
2179
+ login = data.items[0].login;
2180
+ } catch (e) {
2181
+ consola.log("e: ", e);
2182
+ }
2183
+ return login;
2184
+ }
2185
+ async function getGitCommitsAndResolvedAuthors(commits, github, resolvedLogins) {
2186
+ const resultCommits = [];
2187
+ const map = /* @__PURE__ */ new Map();
2188
+ for await (const commit of commits) {
2189
+ const resolvedAuthors = [];
2190
+ for await (const [index, author] of commit.authors.entries()) {
2191
+ const { email, name } = author;
2192
+ if (email && name) {
2193
+ const commitHashes = [];
2194
+ if (index === 0) {
2195
+ commitHashes.push(commit.shortHash);
2196
+ }
2197
+ const resolvedAuthor = {
2198
+ name,
2199
+ email,
2200
+ commits: commitHashes,
2201
+ login: ""
2202
+ };
2203
+ if (!(resolvedLogins == null ? void 0 : resolvedLogins.has(email))) {
2204
+ const login = await getResolvedAuthorLogin(github, commitHashes, email);
2205
+ resolvedAuthor.login = login;
2206
+ resolvedLogins == null ? void 0 : resolvedLogins.set(email, login);
2207
+ } else {
2208
+ const login = (resolvedLogins == null ? void 0 : resolvedLogins.get(email)) || "";
2209
+ resolvedAuthor.login = login;
2210
+ }
2211
+ resolvedAuthors.push(resolvedAuthor);
2212
+ if (!map.has(email)) {
2213
+ map.set(email, resolvedAuthor);
2214
+ }
2215
+ }
2216
+ }
2217
+ const resultCommit = { ...commit, resolvedAuthors };
2218
+ resultCommits.push(resultCommit);
2219
+ }
2220
+ return {
2221
+ commits: resultCommits,
2222
+ contributors: Array.from(map.values())
2223
+ };
2224
+ }
2225
+
2226
+ // src/options.ts
2227
+ function createDefaultOptions() {
2228
+ const cwd = import_node_process4.default.cwd();
2229
+ const options = {
2230
+ cwd,
2231
+ types: {
2232
+ feat: "\u{1F680} Features",
2233
+ fix: "\u{1F41E} Bug Fixes",
2234
+ perf: "\u{1F525} Performance",
2235
+ refactor: "\u{1F485} Refactors",
2236
+ docs: "\u{1F4D6} Documentation",
2237
+ build: "\u{1F4E6} Build",
2238
+ types: "\u{1F30A} Types",
2239
+ chore: "\u{1F3E1} Chore",
2240
+ examples: "\u{1F3C0} Examples",
2241
+ test: "\u2705 Tests",
2242
+ style: "\u{1F3A8} Styles",
2243
+ ci: "\u{1F916} CI"
2244
+ },
2245
+ github: {
2246
+ repo: "",
2247
+ token: import_node_process4.default.env.GITHUB_TOKEN || ""
2248
+ },
2249
+ from: "",
2250
+ to: "",
2251
+ tags: [],
2252
+ tagDateMap: /* @__PURE__ */ new Map(),
2253
+ capitalize: false,
2254
+ emoji: true,
2255
+ titles: {
2256
+ breakingChanges: "\u{1F6A8} Breaking Changes"
2257
+ },
2258
+ output: "CHANGELOG.md",
2259
+ regenerate: false,
2260
+ newVersion: ""
2261
+ };
2262
+ return options;
2263
+ }
2264
+ async function getVersionFromPkgJson(cwd) {
2265
+ let newVersion = "";
2266
+ try {
2267
+ const pkgJson = await (0, import_promises.readFile)(`${cwd}/package.json`, "utf-8");
2268
+ const pkg = JSON.parse(pkgJson);
2269
+ newVersion = (pkg == null ? void 0 : pkg.version) || "";
2270
+ } catch {
2271
+ }
2272
+ return {
2273
+ newVersion
2274
+ };
2275
+ }
2276
+ async function createOptions(options) {
2277
+ var _a;
2278
+ const opts = createDefaultOptions();
2279
+ Object.assign(opts, options);
2280
+ const { newVersion } = await getVersionFromPkgJson(opts.cwd);
2281
+ (_a = opts.github).repo || (_a.repo = await getGitHubRepo());
2282
+ opts.newVersion || (opts.newVersion = `v${newVersion}`);
2283
+ opts.from || (opts.from = await getLastGitTag());
2284
+ opts.to || (opts.to = await getCurrentGitBranch());
2285
+ if (opts.to === opts.from) {
2286
+ const lastTag = await getLastGitTag(-1);
2287
+ const firstCommit = await getFirstGitCommit();
2288
+ opts.from = lastTag || firstCommit;
2289
+ }
2290
+ opts.tags = await getTotalGitTags();
2291
+ opts.tagDateMap = await getTagDateMap();
2292
+ opts.prerelease || (opts.prerelease = isPrerelease(opts.to));
2293
+ const isFromPrerelease = isPrerelease(opts.from);
2294
+ if (!opts.prerelease && isFromPrerelease) {
2295
+ const allReleaseTags = opts.tags.filter((tag) => !isPrerelease(tag));
2296
+ opts.from = allReleaseTags[allReleaseTags.length - 2];
2297
+ }
2298
+ return opts;
2299
+ }
2300
+
2301
+ // src/markdown.ts
2302
+ init_cjs_shims();
2303
+ var import_node_fs = require("fs");
2304
+ var import_promises2 = require("fs/promises");
2305
+ var import_dayjs2 = __toESM(require("dayjs"), 1);
2306
+ var import_convert_gitmoji = require("convert-gitmoji");
2307
+ function formatReferences(references, githubRepo, type) {
2308
+ const refs = references.filter((i) => {
2309
+ if (type === "issues")
2310
+ return i.type === "issue" || i.type === "pull-request";
2311
+ return i.type === "hash";
2312
+ }).map((ref) => {
2313
+ if (!githubRepo)
2314
+ return ref.value;
2315
+ if (ref.type === "pull-request" || ref.type === "issue")
2316
+ return `https://github.com/${githubRepo}/issues/${ref.value.slice(1)}`;
2317
+ return `[<samp>(${ref.value.slice(0, 5)})</samp>](https://github.com/${githubRepo}/commit/${ref.value})`;
2318
+ });
2319
+ const referencesString = join(refs).trim();
2320
+ if (type === "issues")
2321
+ return referencesString && `in ${referencesString}`;
2322
+ return referencesString;
2323
+ }
2324
+ function formatLine(commit, options) {
2325
+ const prRefs = formatReferences(commit.references, options.github.repo, "issues");
2326
+ const hashRefs = formatReferences(commit.references, options.github.repo, "hash");
2327
+ let authors = join([...new Set(commit.resolvedAuthors.map((i) => i.login ? `@${i.login}` : `**${i.name}**`))]).trim();
2328
+ if (authors) {
2329
+ authors = `by ${authors}`;
2330
+ }
2331
+ let refs = [authors, prRefs, hashRefs].filter((i) => i == null ? void 0 : i.trim()).join(" ");
2332
+ if (refs) {
2333
+ refs = `&nbsp;-&nbsp; ${refs}`;
2334
+ }
2335
+ const description = options.capitalize ? capitalize(commit.description) : commit.description;
2336
+ return [description, refs].filter((i) => i == null ? void 0 : i.trim()).join(" ");
2337
+ }
2338
+ function formatTitle(name, options) {
2339
+ const emojisRE = /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;
2340
+ let formatName = name.trim();
2341
+ if (!options.emoji) {
2342
+ formatName = name.replace(emojisRE, "").trim();
2343
+ }
2344
+ return `### &nbsp;&nbsp;&nbsp;${formatName}`;
2345
+ }
2346
+ function formatSection(commits, sectionName, options) {
2347
+ if (!commits.length)
2348
+ return [];
2349
+ const lines = ["", formatTitle(sectionName, options), ""];
2350
+ const scopes = groupBy(commits, "scope");
2351
+ let useScopeGroup = true;
2352
+ if (!Object.entries(scopes).some(([k, v2]) => k && v2.length > 1)) {
2353
+ useScopeGroup = false;
2354
+ }
2355
+ Object.keys(scopes).sort().forEach((scope) => {
2356
+ let padding = "";
2357
+ let prefix = "";
2358
+ const scopeText = `**${scope}**`;
2359
+ if (scope && useScopeGroup) {
2360
+ lines.push(`- ${scopeText}:`);
2361
+ padding = " ";
2362
+ } else if (scope) {
2363
+ prefix = `${scopeText}: `;
2364
+ }
2365
+ lines.push(...scopes[scope].reverse().map((commit) => `${padding}- ${prefix}${formatLine(commit, options)}`));
2366
+ });
2367
+ return lines;
2368
+ }
2369
+ function getUserGithub(userName) {
2370
+ const githubUrl = `https://github.com/${userName}`;
2371
+ return githubUrl;
2372
+ }
2373
+ function getGitUserAvatar(userName) {
2374
+ const githubUrl = getUserGithub(userName);
2375
+ const avatarUrl = `${githubUrl}.png?size=48`;
2376
+ return avatarUrl;
2377
+ }
2378
+ function createContributorLine(contributors) {
2379
+ let loginLine = "";
2380
+ let unLoginLine = "";
2381
+ const contributorMap = /* @__PURE__ */ new Map();
2382
+ contributors.forEach((contributor) => {
2383
+ contributorMap.set(contributor.email, contributor);
2384
+ });
2385
+ const filteredContributors = Array.from(contributorMap.values());
2386
+ filteredContributors.forEach((contributor, index) => {
2387
+ const { name, email, login } = contributor;
2388
+ if (!login) {
2389
+ let line = `[${name}](mailto:${email})`;
2390
+ if (index < contributors.length - 1) {
2391
+ line += ",&nbsp;";
2392
+ }
2393
+ unLoginLine += line;
2394
+ } else {
2395
+ const githubUrl = getUserGithub(login);
2396
+ const avatar = getGitUserAvatar(login);
2397
+ loginLine += `[![${login}](${avatar})](${githubUrl})&nbsp;&nbsp;`;
2398
+ }
2399
+ });
2400
+ return `${loginLine}
2401
+ ${unLoginLine}`;
2402
+ }
2403
+ function generateMarkdown(params) {
2404
+ const { options, showTitle, contributors } = params;
2405
+ const commits = params.commits.filter((commit) => commit.description.match(VERSION_WITH_RELEASE) === null);
2406
+ const lines = [];
2407
+ const { version, isNewVersion } = getVersionInfo(options.to, options.newVersion);
2408
+ const url = `https://github.com/${options.github.repo}/compare/${options.from}...${version}`;
2409
+ if (showTitle) {
2410
+ const date = isNewVersion ? (0, import_dayjs2.default)().format("YY-MM-DD") : options.tagDateMap.get(options.to);
2411
+ let title = `## [${version}](${url})`;
2412
+ if (date) {
2413
+ title += ` (${date})`;
2414
+ }
2415
+ lines.push(title);
2416
+ }
2417
+ const [breaking, changes] = partition(commits, (c2) => c2.isBreaking);
2418
+ const group = groupBy(changes, "type");
2419
+ lines.push(...formatSection(breaking, options.titles.breakingChanges, options));
2420
+ for (const type of Object.keys(options.types)) {
2421
+ const items = group[type] || [];
2422
+ lines.push(...formatSection(items, options.types[type], options));
2423
+ }
2424
+ if (!lines.length) {
2425
+ lines.push("*No significant changes*");
2426
+ }
2427
+ if (!showTitle) {
2428
+ lines.push("", `##### &nbsp;&nbsp;&nbsp;&nbsp;[View changes on GitHub](${url})`);
2429
+ }
2430
+ if (showTitle) {
2431
+ lines.push("", "### &nbsp;&nbsp;&nbsp;\u2764\uFE0F Contributors", "");
2432
+ const contributorLine = createContributorLine(contributors);
2433
+ lines.push(contributorLine);
2434
+ }
2435
+ const md = (0, import_convert_gitmoji.convert)(lines.join("\n").trim(), true);
2436
+ return md;
2437
+ }
2438
+ async function isVersionInMarkdown(to, newVersion, mdPath) {
2439
+ let isIn = false;
2440
+ let md = "";
2441
+ try {
2442
+ md = await (0, import_promises2.readFile)(mdPath, "utf8");
2443
+ } catch (error) {
2444
+ }
2445
+ if (md) {
2446
+ const matches = md.match(VERSION_REG_OF_MARKDOWN);
2447
+ if (matches == null ? void 0 : matches.length) {
2448
+ const { version } = getVersionInfo(to, newVersion);
2449
+ const versionInMarkdown = `## [${version}]`;
2450
+ isIn = matches.includes(versionInMarkdown);
2451
+ }
2452
+ }
2453
+ return isIn;
2454
+ }
2455
+ function getVersionInfo(to, newVersion) {
2456
+ const isNewVersion = !VERSION_REG.test(to);
2457
+ const version = isNewVersion ? newVersion : to;
2458
+ return {
2459
+ version,
2460
+ isNewVersion
2461
+ };
2462
+ }
2463
+ async function writeMarkdown(md, mdPath, regenerate = false) {
2464
+ let changelogMD = "";
2465
+ const changelogPrefix = "# Changelog";
2466
+ if (!(0, import_node_fs.existsSync)(mdPath)) {
2467
+ await (0, import_promises2.writeFile)(mdPath, `${changelogPrefix}
2468
+
2469
+ `, "utf8");
2470
+ }
2471
+ if (!regenerate) {
2472
+ changelogMD = await (0, import_promises2.readFile)(mdPath, "utf8");
2473
+ }
2474
+ if (!changelogMD.startsWith(changelogPrefix)) {
2475
+ changelogMD = `${changelogPrefix}
2476
+
2477
+ ${changelogMD}`;
2478
+ }
2479
+ const lastEntry = changelogMD.match(/^###?\s+.*$/m);
2480
+ if (lastEntry) {
2481
+ changelogMD = `${changelogMD.slice(0, lastEntry.index) + md}
2482
+
2483
+ ${changelogMD.slice(lastEntry.index)}`;
2484
+ } else {
2485
+ changelogMD += `
2486
+ ${md}
2487
+
2488
+ `;
2489
+ }
2490
+ await (0, import_promises2.writeFile)(mdPath, changelogMD);
2491
+ }
2492
+
2493
+ // src/index.ts
2494
+ async function getChangelogMarkdown(options, showTitle = true) {
2495
+ const opts = await createOptions(options);
2496
+ const gitCommits = await getGitCommits(opts.from, opts.to);
2497
+ const { commits, contributors } = await getGitCommitsAndResolvedAuthors(gitCommits, opts.github);
2498
+ const markdown = generateMarkdown({ commits, options: opts, showTitle, contributors });
2499
+ return {
2500
+ markdown,
2501
+ commits,
2502
+ options: opts
2503
+ };
2504
+ }
2505
+ async function getTotalChangelogMarkdown(options, showProgress = true) {
2506
+ const opts = await createOptions(options);
2507
+ let bar = null;
2508
+ if (showProgress) {
2509
+ bar = new import_cli_progress.SingleBar(
2510
+ { format: "generate total changelog: [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}" },
2511
+ import_cli_progress.Presets.shades_classic
2512
+ );
2513
+ }
2514
+ const tags = getFromToTags(opts.tags);
2515
+ if (tags.length === 0) {
2516
+ const { markdown: markdown2 } = await getChangelogMarkdown(opts);
2517
+ return markdown2;
2518
+ }
2519
+ bar == null ? void 0 : bar.start(tags.length, 0);
2520
+ let markdown = "";
2521
+ const resolvedLogins = /* @__PURE__ */ new Map();
2522
+ for await (const [index, tag] of tags.entries()) {
2523
+ const { from, to } = tag;
2524
+ const gitCommits = await getGitCommits(from, to);
2525
+ const { commits, contributors } = await getGitCommitsAndResolvedAuthors(gitCommits, opts.github, resolvedLogins);
2526
+ const nextMd = generateMarkdown({ commits, options: { ...opts, from, to }, showTitle: true, contributors });
2527
+ markdown = `${nextMd}
2528
+
2529
+ ${markdown}`;
2530
+ bar == null ? void 0 : bar.update(index + 1);
2531
+ }
2532
+ bar == null ? void 0 : bar.stop();
2533
+ return markdown;
2534
+ }
2535
+ async function generateChangelog(options) {
2536
+ const opts = await createOptions(options);
2537
+ const existContent = await isVersionInMarkdown(opts.to, opts.newVersion, opts.output);
2538
+ if (!opts.regenerate && existContent)
2539
+ return;
2540
+ const { markdown } = await getChangelogMarkdown(opts);
2541
+ await writeMarkdown(markdown, opts.output, opts.regenerate);
2542
+ }
2543
+ async function generateTotalChangelog(options, showProgress = true) {
2544
+ const opts = await createOptions(options);
2545
+ const markdown = await getTotalChangelogMarkdown(opts, showProgress);
2546
+ await writeMarkdown(markdown, opts.output, true);
2547
+ }
2548
+ // Annotate the CommonJS export names for ESM import in node:
2549
+ 0 && (module.exports = {
2550
+ generateChangelog,
2551
+ generateTotalChangelog,
2552
+ getChangelogMarkdown,
2553
+ getTotalChangelogMarkdown
2554
+ });