create-openfort 0.0.1
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/README.md +2 -0
- package/dist/index.mjs +247 -0
- package/dist/raw-templates/README.md +19 -0
- package/dist/raw-templates/template-nextjs/README.md +34 -0
- package/dist/raw-templates/template-nextjs/_.gitignore +41 -0
- package/dist/raw-templates/template-nextjs/eslint.config.mjs +16 -0
- package/dist/raw-templates/template-nextjs/next-env.d.ts +5 -0
- package/dist/raw-templates/template-nextjs/next.config.ts +7 -0
- package/dist/raw-templates/template-nextjs/package.json +27 -0
- package/dist/raw-templates/template-nextjs/postcss.config.mjs +5 -0
- package/dist/raw-templates/template-nextjs/src/app/globals.css +1 -0
- package/dist/raw-templates/template-nextjs/src/app/layout.tsx +19 -0
- package/dist/raw-templates/template-nextjs/src/app/page.tsx +7 -0
- package/dist/raw-templates/template-nextjs/tsconfig.json +27 -0
- package/dist/raw-templates/template-vite/README.md +54 -0
- package/dist/raw-templates/template-vite/eslint.config.js +28 -0
- package/dist/raw-templates/template-vite/index.html +13 -0
- package/dist/raw-templates/template-vite/package.json +29 -0
- package/dist/raw-templates/template-vite/public/vite.svg +1 -0
- package/dist/raw-templates/template-vite/src/App.css +42 -0
- package/dist/raw-templates/template-vite/src/App.tsx +35 -0
- package/dist/raw-templates/template-vite/src/assets/react.svg +1 -0
- package/dist/raw-templates/template-vite/src/index.css +68 -0
- package/dist/raw-templates/template-vite/src/main.tsx +10 -0
- package/dist/raw-templates/template-vite/src/vite-env.d.ts +1 -0
- package/dist/raw-templates/template-vite/tsconfig.app.json +26 -0
- package/dist/raw-templates/template-vite/tsconfig.json +7 -0
- package/dist/raw-templates/template-vite/tsconfig.node.json +24 -0
- package/dist/raw-templates/template-vite/vite.config.ts +7 -0
- package/dist/updated-files/README.md +3 -0
- package/dist/updated-files/common/template-vite/index.html +13 -0
- package/dist/updated-files/common/template-vite/public/favicon.ico +0 -0
- package/dist/updated-files/openfortkit/common/package.json +8 -0
- package/dist/updated-files/openfortkit/template-nextjs/src/app/layout.tsx +22 -0
- package/dist/updated-files/openfortkit/template-nextjs/src/app/page.tsx +13 -0
- package/dist/updated-files/openfortkit/template-nextjs/src/app/providers.tsx +45 -0
- package/dist/updated-files/openfortkit/template-vite/src/App.css +6 -0
- package/dist/updated-files/openfortkit/template-vite/src/App.tsx +13 -0
- package/dist/updated-files/openfortkit/template-vite/src/index.css +22 -0
- package/dist/updated-files/openfortkit/template-vite/src/providers.tsx +42 -0
- package/index.js +3 -0
- package/package.json +34 -0
package/README.md
ADDED
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import{stripVTControlCharacters as K}from"node:util";import k,{stdout as bu,stdin as Au}from"node:process";import*as Q from"node:readline";import yu from"node:readline";import{WriteStream as cD}from"node:tty";import A from"node:fs";import I from"node:path";import{spawn as ve}from"node:child_process";import{fileURLToPath as be}from"node:url";function Ae(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var CD,hD,ED,P=function(){if(hD)return CD;hD=1;const t="\x1B[",D={to:(s,u)=>u?`${t}${u+1};${s+1}H`:`${t}${s+1}G`,move(s,u){let n="";return s<0?n+=`${t}${-s}D`:s>0&&(n+=`${t}${s}C`),u<0?n+=`${t}${-u}A`:u>0&&(n+=`${t}${u}B`),n},up:(s=1)=>`${t}${s}A`,down:(s=1)=>`${t}${s}B`,forward:(s=1)=>`${t}${s}C`,backward:(s=1)=>`${t}${s}D`,nextLine:(s=1)=>`${t}E`.repeat(s),prevLine:(s=1)=>`${t}F`.repeat(s),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:"\x1B7",restore:"\x1B8"},e={up:(s=1)=>`${t}S`.repeat(s),down:(s=1)=>`${t}T`.repeat(s)},r={screen:`${t}2J`,up:(s=1)=>`${t}1J`.repeat(s),down:(s=1)=>`${t}J`.repeat(s),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(s){let u="";for(let n=0;n<s;n++)u+=this.line+(n<s-1?D.up():"");return s&&(u+=D.left),u}};return CD={cursor:D,scroll:e,erase:r,beep:"\x07"}}(),wu={exports:{}},ye=function(){if(ED)return wu.exports;ED=1;let t=process||{},D=t.argv||[],e=t.env||{},r=!(e.NO_COLOR||D.includes("--no-color"))&&(!!e.FORCE_COLOR||D.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&e.TERM!=="dumb"||!!e.CI),s=(l,i,F=l)=>C=>{let c=""+C,d=c.indexOf(i,l.length);return~d?l+u(c,i,F,d)+i:l+c+i},u=(l,i,F,C)=>{let c="",d=0;do c+=l.substring(d,C)+F,d=C+i.length,C=l.indexOf(i,d);while(~C);return c+l.substring(d)},n=(l=r)=>{let i=l?s:()=>String;return{isColorSupported:l,reset:i("\x1B[0m","\x1B[0m"),bold:i("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:i("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:i("\x1B[3m","\x1B[23m"),underline:i("\x1B[4m","\x1B[24m"),inverse:i("\x1B[7m","\x1B[27m"),hidden:i("\x1B[8m","\x1B[28m"),strikethrough:i("\x1B[9m","\x1B[29m"),black:i("\x1B[30m","\x1B[39m"),red:i("\x1B[31m","\x1B[39m"),green:i("\x1B[32m","\x1B[39m"),yellow:i("\x1B[33m","\x1B[39m"),blue:i("\x1B[34m","\x1B[39m"),magenta:i("\x1B[35m","\x1B[39m"),cyan:i("\x1B[36m","\x1B[39m"),white:i("\x1B[37m","\x1B[39m"),gray:i("\x1B[90m","\x1B[39m"),bgBlack:i("\x1B[40m","\x1B[49m"),bgRed:i("\x1B[41m","\x1B[49m"),bgGreen:i("\x1B[42m","\x1B[49m"),bgYellow:i("\x1B[43m","\x1B[49m"),bgBlue:i("\x1B[44m","\x1B[49m"),bgMagenta:i("\x1B[45m","\x1B[49m"),bgCyan:i("\x1B[46m","\x1B[49m"),bgWhite:i("\x1B[47m","\x1B[49m"),blackBright:i("\x1B[90m","\x1B[39m"),redBright:i("\x1B[91m","\x1B[39m"),greenBright:i("\x1B[92m","\x1B[39m"),yellowBright:i("\x1B[93m","\x1B[39m"),blueBright:i("\x1B[94m","\x1B[39m"),magentaBright:i("\x1B[95m","\x1B[39m"),cyanBright:i("\x1B[96m","\x1B[39m"),whiteBright:i("\x1B[97m","\x1B[39m"),bgBlackBright:i("\x1B[100m","\x1B[49m"),bgRedBright:i("\x1B[101m","\x1B[49m"),bgGreenBright:i("\x1B[102m","\x1B[49m"),bgYellowBright:i("\x1B[103m","\x1B[49m"),bgBlueBright:i("\x1B[104m","\x1B[49m"),bgMagentaBright:i("\x1B[105m","\x1B[49m"),bgCyanBright:i("\x1B[106m","\x1B[49m"),bgWhiteBright:i("\x1B[107m","\x1B[49m")}};return wu.exports=n(),wu.exports.createColors=n,wu.exports}(),o=Ae(ye);const we=function({onlyFirst:t=!1}={}){const D=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(D,t?void 0:"g")}();function dD(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(we,"")}function pD(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var BD={exports:{}};(function(){var t={};function D(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}BD.exports=t,t.eastAsianWidth=function(e){var r=e.charCodeAt(0),s=e.length==2?e.charCodeAt(1):0,u=r;return 55296<=r&&r<=56319&&56320<=s&&s<=57343&&(u=(r&=1023)<<10|(s&=1023),u+=65536),u==12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u==8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u==172||u==175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u==161||u==164||167<=u&&u<=168||u==170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u==198||u==208||215<=u&&u<=216||222<=u&&u<=225||u==230||232<=u&&u<=234||236<=u&&u<=237||u==240||242<=u&&u<=243||247<=u&&u<=250||u==252||u==254||u==257||u==273||u==275||u==283||294<=u&&u<=295||u==299||305<=u&&u<=307||u==312||319<=u&&u<=322||u==324||328<=u&&u<=331||u==333||338<=u&&u<=339||358<=u&&u<=359||u==363||u==462||u==464||u==466||u==468||u==470||u==472||u==474||u==476||u==593||u==609||u==708||u==711||713<=u&&u<=715||u==717||u==720||728<=u&&u<=731||u==733||u==735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u==1025||1040<=u&&u<=1103||u==1105||u==8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u==8240||8242<=u&&u<=8243||u==8245||u==8251||u==8254||u==8308||u==8319||8321<=u&&u<=8324||u==8364||u==8451||u==8453||u==8457||u==8467||u==8470||8481<=u&&u<=8482||u==8486||u==8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u==8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u==8658||u==8660||u==8679||u==8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u==8715||u==8719||u==8721||u==8725||u==8730||8733<=u&&u<=8736||u==8739||u==8741||8743<=u&&u<=8748||u==8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u==8776||u==8780||u==8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u==8853||u==8857||u==8869||u==8895||u==8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u==9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u==9711||9733<=u&&u<=9734||u==9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u==9756||u==9758||u==9792||u==9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u==9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u==9955||9960<=u&&u<=9983||u==10045||u==10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u==65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},t.characterLength=function(e){var r=this.eastAsianWidth(e);return r=="F"||r=="W"||r=="A"?2:1},t.length=function(e){for(var r=D(e),s=0,u=0;u<r.length;u++)s+=this.characterLength(r[u]);return s},t.slice=function(e,r,s){textLen=t.length(e),s=s||1,(r=r||0)<0&&(r=textLen+r),s<0&&(s=textLen+s);for(var u="",n=0,l=D(e),i=0;i<l.length;i++){var F=l[i],C=t.length(F);if(n>=r-(C==2?1:0)){if(!(n+C<=s))break;u+=F}n+=C}return u}})();const xe=pD(BD.exports),Se=pD(function(){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});function du(t,D={}){if(typeof t!="string"||t.length===0||(D={ambiguousIsNarrow:!0,...D},(t=dD(t)).length===0))return 0;t=t.replace(Se()," ");const e=D.ambiguousIsNarrow?1:2;let r=0;for(const s of t){const u=s.codePointAt(0);if(!(u<=31||u>=127&&u<=159||u>=768&&u<=879))switch(xe.eastAsianWidth(s)){case"F":case"W":r+=2;break;case"A":r+=e;break;default:r+=1}}return r}const gD=(t=0)=>D=>`\x1B[${D+t}m`,mD=(t=0)=>D=>`\x1B[${38+t};5;${D}m`,fD=(t=0)=>(D,e,r)=>`\x1B[${38+t};2;${D};${e};${r}m`,x={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]}};Object.keys(x.modifier),Object.keys(x.color),Object.keys(x.bgColor);const ke=function(){const t=new Map;for(const[D,e]of Object.entries(x)){for(const[r,s]of Object.entries(e))x[r]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},e[r]=x[r],t.set(s[0],s[1]);Object.defineProperty(x,D,{value:e,enumerable:!1})}return Object.defineProperty(x,"codes",{value:t,enumerable:!1}),x.color.close="\x1B[39m",x.bgColor.close="\x1B[49m",x.color.ansi=gD(),x.color.ansi256=mD(),x.color.ansi16m=fD(),x.bgColor.ansi=gD(10),x.bgColor.ansi256=mD(10),x.bgColor.ansi16m=fD(10),Object.defineProperties(x,{rgbToAnsi256:{value:(D,e,r)=>D===e&&e===r?D<8?16:D>248?231:Math.round((D-8)/247*24)+232:16+36*Math.round(D/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:D=>{const e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(D.toString(16));if(!e)return[0,0,0];let[r]=e;r.length===3&&(r=[...r].map(u=>u+u).join(""));const s=Number.parseInt(r,16);return[s>>16&255,s>>8&255,255&s]},enumerable:!1},hexToAnsi256:{value:D=>x.rgbToAnsi256(...x.hexToRgb(D)),enumerable:!1},ansi256ToAnsi:{value:D=>{if(D<8)return 30+D;if(D<16)return D-8+90;let e,r,s;if(D>=232)e=(10*(D-232)+8)/255,r=e,s=e;else{const l=(D-=16)%36;e=Math.floor(D/36)/5,r=Math.floor(l/6)/5,s=l%6/5}const u=2*Math.max(e,r,s);if(u===0)return 30;let n=30+(Math.round(s)<<2|Math.round(r)<<1|Math.round(e));return u===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(D,e,r)=>x.ansi256ToAnsi(x.rgbToAnsi256(D,e,r)),enumerable:!1},hexToAnsi:{value:D=>x.ansi256ToAnsi(x.hexToAnsi256(D)),enumerable:!1}}),x}(),xu=new Set(["\x1B","\x9B"]),Pu="]8;;",$D=t=>`${xu.values().next().value}[${t}m`,vD=t=>`${xu.values().next().value}${Pu}${t}\x07`,Ru=(t,D,e)=>{const r=[...D];let s=!1,u=!1,n=du(dD(t[t.length-1]));for(const[l,i]of r.entries()){const F=du(i);n+F<=e?t[t.length-1]+=i:(t.push(i),n=0),xu.has(i)&&(s=!0,u=r.slice(l+1).join("").startsWith(Pu)),s?u?i==="\x07"&&(s=!1,u=!1):i==="m"&&(s=!1):(n+=F,n===e&&l<r.length-1&&(t.push(""),n=0))}!n&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},_e=(t,D,e={})=>{if(e.trim!==!1&&t.trim()==="")return"";let r,s,u="";const n=(F=>F.split(" ").map(C=>du(C)))(t);let l=[""];for(const[F,C]of t.split(" ").entries()){e.trim!==!1&&(l[l.length-1]=l[l.length-1].trimStart());let c=du(l[l.length-1]);if(F!==0&&(c>=D&&(e.wordWrap===!1||e.trim===!1)&&(l.push(""),c=0),(c>0||e.trim===!1)&&(l[l.length-1]+=" ",c++)),e.hard&&n[F]>D){const d=D-c,m=1+Math.floor((n[F]-d-1)/D);Math.floor((n[F]-1)/D)<m&&l.push(""),Ru(l,C,D)}else{if(c+n[F]>D&&c>0&&n[F]>0){if(e.wordWrap===!1&&c<D){Ru(l,C,D);continue}l.push("")}c+n[F]>D&&e.wordWrap===!1?Ru(l,C,D):l[l.length-1]+=C}}e.trim!==!1&&(l=l.map(F=>(C=>{const c=C.split(" ");let d=c.length;for(;d>0&&!(du(c[d-1])>0);)d--;return d===c.length?C:c.slice(0,d).join(" ")+c.slice(d).join("")})(F)));const i=[...l.join(`
|
|
2
|
+
`)];for(const[F,C]of i.entries()){if(u+=C,xu.has(C)){const{groups:d}=new RegExp(`(?:\\[(?<code>\\d+)m|\\${Pu}(?<uri>.*)\x07)`).exec(i.slice(F).join(""))||{groups:{}};if(d.code!==void 0){const m=Number.parseFloat(d.code);r=m===39?void 0:m}else d.uri!==void 0&&(s=d.uri.length===0?void 0:d.uri)}const c=ke.codes.get(Number(r));i[F+1]===`
|
|
3
|
+
`?(s&&(u+=vD("")),r&&c&&(u+=$D(c))):C===`
|
|
4
|
+
`&&(r&&c&&(u+=$D(r)),s&&(u+=vD(s)))}return u};function bD(t,D,e){return String(t).normalize().replace(/\r\n/g,`
|
|
5
|
+
`).split(`
|
|
6
|
+
`).map(r=>_e(r,D,e)).join(`
|
|
7
|
+
`)}const Fu={actions:new Set(["up","down","left","right","space","enter","cancel"]),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function Lu(t,D){if(typeof t=="string")return Fu.aliases.get(t)===D;for(const e of t)if(e!==void 0&&Lu(e,D))return!0;return!1}const Te=globalThis.process.platform.startsWith("win"),Nu=Symbol("clack:cancel");function cu(t){return t===Nu}function Su(t,D){const e=t;e.isTTY&&e.setRawMode(D)}var Oe=Object.defineProperty,W=(t,D,e)=>(((r,s,u)=>{s in r?Oe(r,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[s]=u})(t,typeof D!="symbol"?D+"":D,e),e);let eu=class{constructor(D,e=!0){W(this,"input"),W(this,"output"),W(this,"_abortSignal"),W(this,"rl"),W(this,"opts"),W(this,"_render"),W(this,"_track",!1),W(this,"_prevFrame",""),W(this,"_subscribers",new Map),W(this,"_cursor",0),W(this,"state","initial"),W(this,"error",""),W(this,"value");const{input:r=Au,output:s=bu,render:u,signal:n,...l}=D;this.opts=l,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=e,this._abortSignal=n,this.input=r,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(D,e){const r=this._subscribers.get(D)??[];r.push(e),this._subscribers.set(D,r)}on(D,e){this.setSubscriber(D,{cb:e})}once(D,e){this.setSubscriber(D,{cb:e,once:!0})}emit(D,...e){const r=this._subscribers.get(D)??[],s=[];for(const u of r)u.cb(...e),u.once&&s.push(()=>r.splice(r.indexOf(u),1));for(const u of s)u()}prompt(){return new Promise((D,e)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),D(Nu);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}const r=new cD(0);r._write=(s,u,n)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),n()},this.input.pipe(r),this.rl=yu.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),yu.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),Su(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(P.cursor.show),this.output.off("resize",this.render),Su(this.input,!1),D(this.value)}),this.once("cancel",()=>{this.output.write(P.cursor.show),this.output.off("resize",this.render),Su(this.input,!1),D(Nu)})})}onKeypress(D,e){if(this.state==="error"&&(this.state="active"),e?.name&&(!this._track&&Fu.aliases.has(e.name)&&this.emit("cursor",Fu.aliases.get(e.name)),Fu.actions.has(e.name)&&this.emit("cursor",e.name)),D&&(D.toLowerCase()==="y"||D.toLowerCase()==="n")&&this.emit("confirm",D.toLowerCase()==="y"),D===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),D&&this.emit("key",D.toLowerCase()),e?.name==="return"){if(this.opts.validate){const r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Lu([D,e?.name,e?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
8
|
+
`),Su(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const D=bD(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
9
|
+
`).length-1;this.output.write(P.cursor.move(-999,-1*D))}render(){const D=bD(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(P.cursor.hide);else{const e=function(r,s){if(r===s)return;const u=r.split(`
|
|
10
|
+
`),n=s.split(`
|
|
11
|
+
`),l=[];for(let i=0;i<Math.max(u.length,n.length);i++)u[i]!==n[i]&&l.push(i);return l}(this._prevFrame,D);if(this.restoreCursor(),e&&e?.length===1){const r=e[0];this.output.write(P.cursor.move(0,r)),this.output.write(P.erase.lines(1));const s=D.split(`
|
|
12
|
+
`);return this.output.write(s[r]),this._prevFrame=D,void this.output.write(P.cursor.move(0,s.length-r-1))}if(e&&e?.length>1){const r=e[0];this.output.write(P.cursor.move(0,r)),this.output.write(P.erase.down());const s=D.split(`
|
|
13
|
+
`).slice(r);return this.output.write(s.join(`
|
|
14
|
+
`)),void(this._prevFrame=D)}this.output.write(P.erase.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}},Me=class extends eu{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",e=>{this.output.write(P.cursor.move(0,-1)),this.value=e,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var je=Object.defineProperty,AD=(t,D,e)=>(((r,s,u)=>{s in r?je(r,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[s]=u})(t,typeof D!="symbol"?D+"":D,e),e);let Ie=class extends eu{constructor(D){super(D,!1),AD(this,"options"),AD(this,"cursor",0);const{options:e}=D;this.options=Object.entries(e).flatMap(([r,s])=>[{value:r,group:!0,label:r},...s.map(u=>({...u,group:r}))]),this.value=[...D.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:r})=>r===D.cursorAt),0),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue()}})}getGroupItems(D){return this.options.filter(e=>e.group===D)}isGroupSelected(D){return this.getGroupItems(D).every(e=>this.value.includes(e.value))}toggleValue(){const D=this.options[this.cursor];if(D.group===!0){const e=D.value,r=this.getGroupItems(e);this.isGroupSelected(e)?this.value=this.value.filter(s=>r.findIndex(u=>u.value===s)===-1):this.value=[...this.value,...r.map(s=>s.value)],this.value=Array.from(new Set(this.value))}else{const e=this.value.includes(D.value);this.value=e?this.value.filter(r=>r!==D.value):[...this.value,D.value]}}};var Pe=Object.defineProperty,yD=(t,D,e)=>(((r,s,u)=>{s in r?Pe(r,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[s]=u})(t,typeof D!="symbol"?D+"":D,e),e);let Re=class extends eu{constructor(D){super(D,!1),yD(this,"options"),yD(this,"cursor",0),this.options=D.options,this.value=[...D.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===D.cursorAt),0),this.on("key",e=>{e==="a"&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue()}})}get _value(){return this.options[this.cursor].value}toggleAll(){const D=this.value.length===this.options.length;this.value=D?[]:this.options.map(e=>e.value)}toggleValue(){const D=this.value.includes(this._value);this.value=D?this.value.filter(e=>e!==this._value):[...this.value,this._value]}};var Le=Object.defineProperty,wD=(t,D,e)=>(((r,s,u)=>{s in r?Le(r,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[s]=u})(t,typeof D!="symbol"?D+"":D,e),e);let Ne=class extends eu{constructor({mask:D,...e}){super(e),wD(this,"valueWithCursor",""),wD(this,"_mask","\u2022"),this._mask=D??"\u2022",this.on("finalize",()=>{this.valueWithCursor=this.masked}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${o.inverse(o.hidden("_"))}`;else{const r=this.masked.slice(0,this.cursor),s=this.masked.slice(this.cursor);this.valueWithCursor=`${r}${o.inverse(s[0])}${s.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}};var We=Object.defineProperty,xD=(t,D,e)=>(((r,s,u)=>{s in r?We(r,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[s]=u})(t,typeof D!="symbol"?D+"":D,e),e);let Ve=class extends eu{constructor(D){super(D,!1),xD(this,"options"),xD(this,"cursor",0),this.options=D.options,this.cursor=this.options.findIndex(({value:e})=>e===D.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var Ke=Object.defineProperty,SD=(t,D,e)=>(((r,s,u)=>{s in r?Ke(r,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[s]=u})(t,typeof D!="symbol"?D+"":D,e),e);class Ge extends eu{constructor(D){super(D,!1),SD(this,"options"),SD(this,"cursor",0),this.options=D.options;const e=this.options.map(({value:[r]})=>r?.toLowerCase());this.cursor=Math.max(e.indexOf(D.initialValue),0),this.on("key",r=>{if(!e.includes(r))return;const s=this.options.find(({value:[u]})=>u?.toLowerCase()===r);s&&(this.value=s.value,this.state="submit",this.emit("submit"))})}}class ze extends eu{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;const D=this.value.slice(0,this.cursor),[e,...r]=this.value.slice(this.cursor);return`${D}${o.inverse(e)}${r.join("")}`}get cursor(){return this._cursor}constructor(D){super(D),this.on("finalize",()=>{this.value||(this.value=D.defaultValue)})}}const Wu=k.platform!=="win32"?k.env.TERM!=="linux":!!k.env.CI||!!k.env.WT_SESSION||!!k.env.TERMINUS_SUBLIME||k.env.ConEmuTask==="{cmd::Cmder}"||k.env.TERM_PROGRAM==="Terminus-Sublime"||k.env.TERM_PROGRAM==="vscode"||k.env.TERM==="xterm-256color"||k.env.TERM==="alacritty"||k.env.TERMINAL_EMULATOR==="JetBrains-JediTerm",T=(t,D)=>Wu?t:D,Ye=T("\u25C6","*"),kD=T("\u25A0","x"),_D=T("\u25B2","x"),pu=T("\u25C7","o"),qe=T("\u250C","T"),h=T("\u2502","|"),L=T("\u2514","\u2014"),Vu=T("\u25CF",">"),Ku=T("\u25CB"," "),Gu=T("\u25FB","[\u2022]"),Bu=T("\u25FC","[+]"),TD=T("\u25FB","[ ]"),He=T("\u25AA","\u2022"),OD=T("\u2500","-"),Je=T("\u256E","+"),Ue=T("\u251C","+"),Ze=T("\u256F","+"),MD=T("\u25CF","\u2022"),jD=T("\u25C6","*"),ID=T("\u25B2","!"),PD=T("\u25A0","x"),tu=t=>{switch(t){case"initial":case"active":return o.cyan(Ye);case"cancel":return o.red(kD);case"error":return o.yellow(_D);case"submit":return o.green(pu)}},zu=t=>{const{cursor:D,options:e,style:r}=t,s=t.maxItems??Number.POSITIVE_INFINITY,u=Math.max(process.stdout.rows-4,0),n=Math.min(u,Math.max(s,5));let l=0;D>=l+n-3?l=Math.max(Math.min(D-n+3,e.length-n),0):D<l+2&&(l=Math.max(D-2,0));const i=n<e.length&&l>0,F=n<e.length&&l+n<e.length;return e.slice(l,l+n).map((C,c,d)=>{const m=c===0&&i,$=c===d.length-1&&F;return m||$?o.dim("..."):r(C,c+l===D)})},Yu=t=>new ze({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){const D=`${o.gray(h)}
|
|
15
|
+
${tu(this.state)} ${t.message}
|
|
16
|
+
`,e=t.placeholder?o.inverse(t.placeholder[0])+o.dim(t.placeholder.slice(1)):o.inverse(o.hidden("_")),r=this.value?this.valueWithCursor:e;switch(this.state){case"error":return`${D.trim()}
|
|
17
|
+
${o.yellow(h)} ${r}
|
|
18
|
+
${o.yellow(L)} ${o.yellow(this.error)}
|
|
19
|
+
`;case"submit":return`${D}${o.gray(h)} ${o.dim(this.value||t.placeholder)}`;case"cancel":return`${D}${o.gray(h)} ${o.strikethrough(o.dim(this.value??""))}${this.value?.trim()?`
|
|
20
|
+
${o.gray(h)}`:""}`;default:return`${D}${o.cyan(h)} ${r}
|
|
21
|
+
${o.cyan(L)}
|
|
22
|
+
`}}}).prompt(),qu=t=>{const D=(e,r)=>{const s=e.label??String(e.value);switch(r){case"selected":return`${o.dim(s)}`;case"active":return`${o.green(Vu)} ${s} ${e.hint?o.dim(`(${e.hint})`):""}`;case"cancelled":return`${o.strikethrough(o.dim(s))}`;default:return`${o.dim(Ku)} ${o.dim(s)}`}};return new Ve({options:t.options,initialValue:t.initialValue,render(){const e=`${o.gray(h)}
|
|
23
|
+
${tu(this.state)} ${t.message}
|
|
24
|
+
`;switch(this.state){case"submit":return`${e}${o.gray(h)} ${D(this.options[this.cursor],"selected")}`;case"cancel":return`${e}${o.gray(h)} ${D(this.options[this.cursor],"cancelled")}
|
|
25
|
+
${o.gray(h)}`;default:return`${e}${o.cyan(h)} ${zu({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(r,s)=>D(r,s?"active":"inactive")}).join(`
|
|
26
|
+
${o.cyan(h)} `)}
|
|
27
|
+
${o.cyan(L)}
|
|
28
|
+
`}}}).prompt()},RD=(t="")=>{process.stdout.write(`${o.gray(L)} ${o.red(t)}
|
|
29
|
+
|
|
30
|
+
`)},LD=(t="")=>{process.stdout.write(`${o.gray(h)}
|
|
31
|
+
${o.gray(L)} ${t}
|
|
32
|
+
|
|
33
|
+
`)},Y={message:(t="",{symbol:D=o.gray(h)}={})=>{const e=[`${o.gray(h)}`];if(t){const[r,...s]=t.split(`
|
|
34
|
+
`);e.push(`${D} ${r}`,...s.map(u=>`${o.gray(h)} ${u}`))}process.stdout.write(`${e.join(`
|
|
35
|
+
`)}
|
|
36
|
+
`)},info:t=>{Y.message(t,{symbol:o.blue(MD)})},success:t=>{Y.message(t,{symbol:o.green(jD)})},step:t=>{Y.message(t,{symbol:o.green(pu)})},warn:t=>{Y.message(t,{symbol:o.yellow(ID)})},warning:t=>{Y.warn(t)},error:t=>{Y.message(t,{symbol:o.red(PD)})}},ND=`${o.gray(h)} `,ru={message:async(t,{symbol:D=o.gray(h)}={})=>{process.stdout.write(`${o.gray(h)}
|
|
37
|
+
${D} `);let e=3;for await(let r of t){r=r.replace(/\n/g,`
|
|
38
|
+
${ND}`),r.includes(`
|
|
39
|
+
`)&&(e=3+K(r.slice(r.lastIndexOf(`
|
|
40
|
+
`))).length);const s=K(r).length;e+s<process.stdout.columns?(e+=s,process.stdout.write(r)):(process.stdout.write(`
|
|
41
|
+
${ND}${r.trimStart()}`),e=3+K(r.trimStart()).length)}process.stdout.write(`
|
|
42
|
+
`)},info:t=>ru.message(t,{symbol:o.blue(MD)}),success:t=>ru.message(t,{symbol:o.green(jD)}),step:t=>ru.message(t,{symbol:o.green(pu)}),warn:t=>ru.message(t,{symbol:o.yellow(ID)}),warning:t=>ru.warn(t),error:t=>ru.message(t,{symbol:o.red(PD)})},Hu=({indicator:t="dots"}={})=>{const D=Wu?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=Wu?80:120,r=process.env.CI==="true";let s,u,n,l=!1,i="",F=performance.now();const C=B=>{l&&b(B>1?"Something went wrong":"Canceled",B)},c=()=>C(2),d=()=>C(1),m=()=>{if(n===void 0)return;r&&process.stdout.write(`
|
|
43
|
+
`);const B=n.split(`
|
|
44
|
+
`);process.stdout.write(P.cursor.move(-999,B.length-1)),process.stdout.write(P.erase.down(B.length))},$=B=>B.replace(/\.+$/,""),f=B=>{const y=(performance.now()-B)/1e3,v=Math.floor(y/60),p=Math.floor(y%60);return v>0?`[${v}m ${p}s]`:`[${p}s]`},b=(B="",y=0)=>{l=!1,clearInterval(u),m();const v=y===0?o.green(pu):y===1?o.red(kD):o.red(_D);i=$(B??i),t==="timer"?process.stdout.write(`${v} ${i} ${f(F)}
|
|
45
|
+
`):process.stdout.write(`${v} ${i}
|
|
46
|
+
`),process.removeListener("uncaughtExceptionMonitor",c),process.removeListener("unhandledRejection",c),process.removeListener("SIGINT",d),process.removeListener("SIGTERM",d),process.removeListener("exit",C),s()};return{start:(B="")=>{l=!0,s=function({input:p=Au,output:M=bu,overwrite:au=!0,hideCursor:H=!0}={}){const J=Q.createInterface({input:p,output:M,prompt:"",tabSize:1});Q.emitKeypressEvents(p,J),p.isTTY&&p.setRawMode(!0);const q=(lu,{name:U,sequence:z})=>{if(Lu([String(lu),U,z],"cancel"))return H&&M.write(P.cursor.show),void process.exit(0);if(!au)return;const uu=U==="return"?0:-1,Z=U==="return"?-1:0;Q.moveCursor(M,uu,Z,()=>{Q.clearLine(M,1,()=>{p.once("keypress",q)})})};return H&&M.write(P.cursor.hide),p.once("keypress",q),()=>{p.off("keypress",q),H&&M.write(P.cursor.show),p.isTTY&&!Te&&p.setRawMode(!1),J.terminal=!1,J.close()}}(),i=$(B),F=performance.now(),process.stdout.write(`${o.gray(h)}
|
|
47
|
+
`);let y=0,v=0;process.on("uncaughtExceptionMonitor",c),process.on("unhandledRejection",c),process.on("SIGINT",d),process.on("SIGTERM",d),process.on("exit",C),u=setInterval(()=>{if(r&&i===n)return;m(),n=i;const p=o.magenta(D[y]);if(r)process.stdout.write(`${p} ${i}...`);else if(t==="timer")process.stdout.write(`${p} ${i} ${f(F)}`);else{const M=".".repeat(Math.floor(v)).slice(0,3);process.stdout.write(`${p} ${i}${M}`)}y=y+1<D.length?y+1:0,v=v<D.length?v+.125:0},e)},stop:b,message:(B="")=>{i=$(B??i)}}};var g=Object.freeze({__proto__:null,cancel:RD,confirm:t=>{const D=t.active??"Yes",e=t.inactive??"No";return new Me({active:D,inactive:e,initialValue:t.initialValue??!0,render(){const r=`${o.gray(h)}
|
|
48
|
+
${tu(this.state)} ${t.message}
|
|
49
|
+
`,s=this.value?D:e;switch(this.state){case"submit":return`${r}${o.gray(h)} ${o.dim(s)}`;case"cancel":return`${r}${o.gray(h)} ${o.strikethrough(o.dim(s))}
|
|
50
|
+
${o.gray(h)}`;default:return`${r}${o.cyan(h)} ${this.value?`${o.green(Vu)} ${D}`:`${o.dim(Ku)} ${o.dim(D)}`} ${o.dim("/")} ${this.value?`${o.dim(Ku)} ${o.dim(e)}`:`${o.green(Vu)} ${e}`}
|
|
51
|
+
${o.cyan(L)}
|
|
52
|
+
`}}}).prompt()},group:async(t,D)=>{const e={},r=Object.keys(t);for(const s of r){const u=t[s],n=await u({results:e})?.catch(l=>{throw l});typeof D?.onCancel=="function"&&cu(n)?(e[s]="canceled",D.onCancel({results:e})):e[s]=n}return e},groupMultiselect:t=>{const D=(e,r,s=[])=>{const u=e.label??String(e.value),n=typeof e.group=="string",l=n&&(s[s.indexOf(e)+1]??{group:!0}),i=n&&l.group===!0,F=n?`${i?L:h} `:"";return r==="active"?`${o.dim(F)}${o.cyan(Gu)} ${u} ${e.hint?o.dim(`(${e.hint})`):""}`:r==="group-active"?`${F}${o.cyan(Gu)} ${o.dim(u)}`:r==="group-active-selected"?`${F}${o.green(Bu)} ${o.dim(u)}`:r==="selected"?`${o.dim(F)}${o.green(Bu)} ${o.dim(u)}`:r==="cancelled"?`${o.strikethrough(o.dim(u))}`:r==="active-selected"?`${o.dim(F)}${o.green(Bu)} ${u} ${e.hint?o.dim(`(${e.hint})`):""}`:r==="submitted"?`${o.dim(u)}`:`${o.dim(F)}${o.dim(TD)} ${o.dim(u)}`};return new Ie({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(e){if(this.required&&e.length===0)return`Please select at least one option.
|
|
53
|
+
${o.reset(o.dim(`Press ${o.gray(o.bgWhite(o.inverse(" space ")))} to select, ${o.gray(o.bgWhite(o.inverse(" enter ")))} to submit`))}`},render(){const e=`${o.gray(h)}
|
|
54
|
+
${tu(this.state)} ${t.message}
|
|
55
|
+
`;switch(this.state){case"submit":return`${e}${o.gray(h)} ${this.options.filter(({value:r})=>this.value.includes(r)).map(r=>D(r,"submitted")).join(o.dim(", "))}`;case"cancel":{const r=this.options.filter(({value:s})=>this.value.includes(s)).map(s=>D(s,"cancelled")).join(o.dim(", "));return`${e}${o.gray(h)} ${r.trim()?`${r}
|
|
56
|
+
${o.gray(h)}`:""}`}case"error":{const r=this.error.split(`
|
|
57
|
+
`).map((s,u)=>u===0?`${o.yellow(L)} ${o.yellow(s)}`:` ${s}`).join(`
|
|
58
|
+
`);return`${e}${o.yellow(h)} ${this.options.map((s,u,n)=>{const l=this.value.includes(s.value)||s.group===!0&&this.isGroupSelected(`${s.value}`),i=u===this.cursor;return i||typeof s.group!="string"||this.options[this.cursor].value!==s.group?D(s,i&&l?"active-selected":l?"selected":i?"active":"inactive",n):D(s,l?"group-active-selected":"group-active",n)}).join(`
|
|
59
|
+
${o.yellow(h)} `)}
|
|
60
|
+
${r}
|
|
61
|
+
`}default:return`${e}${o.cyan(h)} ${this.options.map((r,s,u)=>{const n=this.value.includes(r.value)||r.group===!0&&this.isGroupSelected(`${r.value}`),l=s===this.cursor;return l||typeof r.group!="string"||this.options[this.cursor].value!==r.group?D(r,l&&n?"active-selected":n?"selected":l?"active":"inactive",u):D(r,n?"group-active-selected":"group-active",u)}).join(`
|
|
62
|
+
${o.cyan(h)} `)}
|
|
63
|
+
${o.cyan(L)}
|
|
64
|
+
`}}}).prompt()},intro:(t="")=>{process.stdout.write(`${o.gray(qe)} ${t}
|
|
65
|
+
`)},log:Y,multiselect:t=>{const D=(e,r)=>{const s=e.label??String(e.value);return r==="active"?`${o.cyan(Gu)} ${s} ${e.hint?o.dim(`(${e.hint})`):""}`:r==="selected"?`${o.green(Bu)} ${o.dim(s)}`:r==="cancelled"?`${o.strikethrough(o.dim(s))}`:r==="active-selected"?`${o.green(Bu)} ${s} ${e.hint?o.dim(`(${e.hint})`):""}`:r==="submitted"?`${o.dim(s)}`:`${o.dim(TD)} ${o.dim(s)}`};return new Re({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(e){if(this.required&&e.length===0)return`Please select at least one option.
|
|
66
|
+
${o.reset(o.dim(`Press ${o.gray(o.bgWhite(o.inverse(" space ")))} to select, ${o.gray(o.bgWhite(o.inverse(" enter ")))} to submit`))}`},render(){const e=`${o.gray(h)}
|
|
67
|
+
${tu(this.state)} ${t.message}
|
|
68
|
+
`,r=(s,u)=>{const n=this.value.includes(s.value);return D(s,u&&n?"active-selected":n?"selected":u?"active":"inactive")};switch(this.state){case"submit":return`${e}${o.gray(h)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>D(s,"submitted")).join(o.dim(", "))||o.dim("none")}`;case"cancel":{const s=this.options.filter(({value:u})=>this.value.includes(u)).map(u=>D(u,"cancelled")).join(o.dim(", "));return`${e}${o.gray(h)} ${s.trim()?`${s}
|
|
69
|
+
${o.gray(h)}`:""}`}case"error":{const s=this.error.split(`
|
|
70
|
+
`).map((u,n)=>n===0?`${o.yellow(L)} ${o.yellow(u)}`:` ${u}`).join(`
|
|
71
|
+
`);return`${e+o.yellow(h)} ${zu({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(`
|
|
72
|
+
${o.yellow(h)} `)}
|
|
73
|
+
${s}
|
|
74
|
+
`}default:return`${e}${o.cyan(h)} ${zu({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(`
|
|
75
|
+
${o.cyan(h)} `)}
|
|
76
|
+
${o.cyan(L)}
|
|
77
|
+
`}}}).prompt()},note:(t="",D="")=>{const e=`
|
|
78
|
+
${t}
|
|
79
|
+
`.split(`
|
|
80
|
+
`),r=K(D).length,s=Math.max(e.reduce((n,l)=>{const i=K(l);return i.length>n?i.length:n},0),r)+2,u=e.map(n=>`${o.gray(h)} ${o.dim(n)}${" ".repeat(s-K(n).length)}${o.gray(h)}`).join(`
|
|
81
|
+
`);process.stdout.write(`${o.gray(h)}
|
|
82
|
+
${o.green(pu)} ${o.reset(D)} ${o.gray(OD.repeat(Math.max(s-r-1,1))+Je)}
|
|
83
|
+
${u}
|
|
84
|
+
${o.gray(Ue+OD.repeat(s+2)+Ze)}
|
|
85
|
+
`)},outro:LD,password:t=>new Ne({validate:t.validate,mask:t.mask??He,render(){const D=`${o.gray(h)}
|
|
86
|
+
${tu(this.state)} ${t.message}
|
|
87
|
+
`,e=this.valueWithCursor,r=this.masked;switch(this.state){case"error":return`${D.trim()}
|
|
88
|
+
${o.yellow(h)} ${r}
|
|
89
|
+
${o.yellow(L)} ${o.yellow(this.error)}
|
|
90
|
+
`;case"submit":return`${D}${o.gray(h)} ${o.dim(r)}`;case"cancel":return`${D}${o.gray(h)} ${o.strikethrough(o.dim(r??""))}${r?`
|
|
91
|
+
${o.gray(h)}`:""}`;default:return`${D}${o.cyan(h)} ${e}
|
|
92
|
+
${o.cyan(L)}
|
|
93
|
+
`}}}).prompt(),select:qu,selectKey:t=>{const D=(e,r="inactive")=>{const s=e.label??String(e.value);return r==="selected"?`${o.dim(s)}`:r==="cancelled"?`${o.strikethrough(o.dim(s))}`:r==="active"?`${o.bgCyan(o.gray(` ${e.value} `))} ${s} ${e.hint?o.dim(`(${e.hint})`):""}`:`${o.gray(o.bgWhite(o.inverse(` ${e.value} `)))} ${s} ${e.hint?o.dim(`(${e.hint})`):""}`};return new Ge({options:t.options,initialValue:t.initialValue,render(){const e=`${o.gray(h)}
|
|
94
|
+
${tu(this.state)} ${t.message}
|
|
95
|
+
`;switch(this.state){case"submit":return`${e}${o.gray(h)} ${D(this.options.find(r=>r.value===this.value)??t.options[0],"selected")}`;case"cancel":return`${e}${o.gray(h)} ${D(this.options[0],"cancelled")}
|
|
96
|
+
${o.gray(h)}`;default:return`${e}${o.cyan(h)} ${this.options.map((r,s)=>D(r,s===this.cursor?"active":"inactive")).join(`
|
|
97
|
+
${o.cyan(h)} `)}
|
|
98
|
+
${o.cyan(L)}
|
|
99
|
+
`}}}).prompt()},spinner:Hu,stream:ru,tasks:async t=>{for(const D of t){if(D.enabled===!1)continue;const e=Hu();e.start(D.title);const r=await D.task(e.message);e.stop(r||D.title)}},text:Yu,isCancel:cu,updateSettings:function(t){for(const D in t){const e=D;if(!Object.hasOwn(t,e))continue;const r=t[e];if(e==="aliases")for(const s in r)Object.hasOwn(r,s)&&(Fu.aliases.has(s)||Fu.aliases.set(s,r[s]))}}});const _=(t="Operation cancelled")=>RD(t);function Xe(){const t=process.env.npm_config_user_agent;if(!t)return;const D=t.split(" ")[0].split("/");return{name:D[0],version:D[1]}}function WD(t){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(t)}function Ju(t){return t.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}async function Qe(t,D,e){return await new Promise((r,s)=>{const u=ve("npx",["degit",t,D],{cwd:e,shell:!0});u.on("close",(n,l)=>{n===0?r():s(new Error(`Process exited with code ${n}`))}),u.on("error",n=>{s(n)})})}function ut(t,D){const e=A.readFileSync(t,"utf-8");A.writeFileSync(t,D(e),"utf-8")}function VD(t){return t.trim().replace(/\/+$/g,"")}let Dt=class{constructor({verbose:D}={}){var e,r,s,u,n,l;this.cwd=process.cwd(),this.hasBackend=!1,this.pkgManager="npm",this.pkgInfo=Xe(),this.pkgManager=(r=(e=this.pkgInfo)===null||e===void 0?void 0:e.name)!==null&&r!==void 0?r:"npm",this.verbose=!!D,D&&Y.info(`Using ${(u=(s=this.pkgInfo)===null||s===void 0?void 0:s.name)!==null&&u!==void 0?u:"npm"} ${(l=(n=this.pkgInfo)===null||n===void 0?void 0:n.version)!==null&&l!==void 0?l:""}`)}async init({argTargetDir:D,argOverwrite:e,defaultTargetDir:r}){if(D)this.targetDir=D,Y.success(`Project name: ${this.targetDir}`);else{const u=await Yu({message:"Project name:",defaultValue:r,placeholder:r});if(cu(u))return _();this.targetDir=VD(u)}if(A.existsSync(this.targetDir)&&!function(u){const n=A.readdirSync(u);return n.length===0||n.length===1&&n[0]===".git"}(this.targetDir)){const u=e?"yes":await qu({message:(this.targetDir==="."?"Current directory":`Target directory "${this.targetDir}"`)+" is not empty. Please choose how to proceed:",options:[{label:"Cancel operation",value:"no"},{label:"Remove existing files and continue",value:"yes"},{label:"Ignore files and continue",value:"ignore"}]});if(cu(u))return _();switch(u){case"yes":(function(n){if(A.existsSync(n))for(const l of A.readdirSync(n))l!==".git"&&A.rmSync(I.resolve(n,l),{recursive:!0,force:!0})})(this.targetDir);break;case"no":return _()}}let s=I.basename(I.resolve(this.targetDir));if(!WD(s)){const u=await Yu({message:"Package name:",defaultValue:Ju(s),placeholder:Ju(s),validate(n){if(n&&!WD(n))return"Invalid package.json name"}});if(cu(u))return _();s=u||Ju(s)}return this.packageName=s,this.root=I.join(this.cwd,this.targetDir),A.mkdirSync(this.root,{recursive:!0}),this}isInitialized(){return!!this.root}getFilePath(D){if(!this.root)throw new Error("FileManager not initialized");return I.join(this.root,this.hasBackend?"frontend":"",D)}write(D,e){if(!this.root)throw new Error("FileManager not initialized");const r=this.getFilePath(D);e!==void 0&&A.writeFileSync(r,e)}read(D){if(!this.root)throw new Error("FileManager not initialized");const e=this.getFilePath(D);return A.readFileSync(e,"utf-8").toString()}async createBackend({openfortSecretKey:D,shieldSecretKey:e,shieldApiKey:r,shieldEncryptionShare:s,port:u}){if(!this.root)throw new Error("FileManager not initialized");this.hasBackend=!0;const n=Hu();n.start("Creating backend...");try{this.verbose&&Y.info("Creating backend folder from openfort-xyz/openfort-backend-template"),await Qe("openfort-xyz/auth-sample-backend","backend",this.root),this.verbose&&Y.info("Cloned backend folder");const l=I.join(this.root,"backend",".env.example"),i=I.join(this.root,"backend",".env"),F=A.readFileSync(l,"utf-8").toString().replace(/OPENFORT_SECRET_KEY=/g,`OPENFORT_SECRET_KEY=${D}`).replace(/SHIELD_SECRET_KEY=/g,`SHIELD_SECRET_KEY=${e}`).replace(/SHIELD_API_KEY=/g,`SHIELD_API_KEY=${r}`).replace(/SHIELD_ENCRYPTION_SHARE=/g,`SHIELD_ENCRYPTION_SHARE=${s}`).replace(/PORT=/g,`PORT=${u}`);A.writeFileSync(i,F),n.stop("Backend creation completed successfully! \u{1F680}")}catch(l){n.stop("Failed to create backend: "+JSON.stringify(l))}}editFile(D,e){if(!this.root)throw new Error("FileManager not initialized");ut(this.getFilePath(D),e)}outro(){let D="";const e=I.relative(this.cwd,this.root);D+=`Done.
|
|
100
|
+
|
|
101
|
+
Now run:`,this.root!==this.cwd&&(D+=`
|
|
102
|
+
cd ${e.includes(" ")?`"${e}"`:e}`);const r=()=>{this.pkgManager==="yarn"?(D+=`
|
|
103
|
+
yarn`,D+=`
|
|
104
|
+
yarn dev`):(D+=`
|
|
105
|
+
${this.pkgManager} install`,D+=`
|
|
106
|
+
${this.pkgManager} run dev`)};this.hasBackend&&(D+=`
|
|
107
|
+
|
|
108
|
+
For the backend project, run in one terminal.`,D+=`
|
|
109
|
+
cd backend`,r(),D+=`
|
|
110
|
+
|
|
111
|
+
Then run the frontend project in another terminal.`,D+=`
|
|
112
|
+
cd frontend`),r(),LD(D)}};const{blue:sr,blueBright:ir,cyan:et,green:tt,greenBright:nr,magenta:or,red:ar,redBright:lr,reset:Fr,yellow:cr}=o,Uu=[{name:"vite",display:"Vite (React)",color:et},{name:"nextjs",display:"Next.js",color:tt}],rt=Uu.map(t=>t.name);async function st({argFramework:t,availableTemplates:D=rt}){let e=t,r=!1;if(!t||Uu.some(s=>s.name===t)&&D.includes(t)||(e=void 0,r=!0),!e){const s=await qu({message:r?`"${t}" isn't a valid template. Please choose from below: `:"Select a framework:",options:Uu.map(u=>({label:(0,u.color)(u.display||u.name),value:u}))});if(cu(s))return _();e=s.name}return e}var KD,GD,zD,gu,R=function(){if(GD)return KD;GD=1;const t="\x1B[",D={to:(s,u)=>u?`${t}${u+1};${s+1}H`:`${t}${s+1}G`,move(s,u){let n="";return s<0?n+=`${t}${-s}D`:s>0&&(n+=`${t}${s}C`),u<0?n+=`${t}${-u}A`:u>0&&(n+=`${t}${u}B`),n},up:(s=1)=>`${t}${s}A`,down:(s=1)=>`${t}${s}B`,forward:(s=1)=>`${t}${s}C`,backward:(s=1)=>`${t}${s}D`,nextLine:(s=1)=>`${t}E`.repeat(s),prevLine:(s=1)=>`${t}F`.repeat(s),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:"\x1B7",restore:"\x1B8"},e={up:(s=1)=>`${t}S`.repeat(s),down:(s=1)=>`${t}T`.repeat(s)},r={screen:`${t}2J`,up:(s=1)=>`${t}1J`.repeat(s),down:(s=1)=>`${t}J`.repeat(s),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(s){let u="";for(let n=0;n<s;n++)u+=this.line+(n<s-1?D.up():"");return s&&(u+=D.left),u}};return KD={cursor:D,scroll:e,erase:r,beep:"\x07"}}(),ku={exports:{}},it=function(){if(zD)return ku.exports;zD=1;let t=process||{},D=t.argv||[],e=t.env||{},r=!(e.NO_COLOR||D.includes("--no-color"))&&(!!e.FORCE_COLOR||D.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&e.TERM!=="dumb"||!!e.CI),s=(l,i,F=l)=>C=>{let c=""+C,d=c.indexOf(i,l.length);return~d?l+u(c,i,F,d)+i:l+c+i},u=(l,i,F,C)=>{let c="",d=0;do c+=l.substring(d,C)+F,d=C+i.length,C=l.indexOf(i,d);while(~C);return c+l.substring(d)},n=(l=r)=>{let i=l?s:()=>String;return{isColorSupported:l,reset:i("\x1B[0m","\x1B[0m"),bold:i("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:i("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:i("\x1B[3m","\x1B[23m"),underline:i("\x1B[4m","\x1B[24m"),inverse:i("\x1B[7m","\x1B[27m"),hidden:i("\x1B[8m","\x1B[28m"),strikethrough:i("\x1B[9m","\x1B[29m"),black:i("\x1B[30m","\x1B[39m"),red:i("\x1B[31m","\x1B[39m"),green:i("\x1B[32m","\x1B[39m"),yellow:i("\x1B[33m","\x1B[39m"),blue:i("\x1B[34m","\x1B[39m"),magenta:i("\x1B[35m","\x1B[39m"),cyan:i("\x1B[36m","\x1B[39m"),white:i("\x1B[37m","\x1B[39m"),gray:i("\x1B[90m","\x1B[39m"),bgBlack:i("\x1B[40m","\x1B[49m"),bgRed:i("\x1B[41m","\x1B[49m"),bgGreen:i("\x1B[42m","\x1B[49m"),bgYellow:i("\x1B[43m","\x1B[49m"),bgBlue:i("\x1B[44m","\x1B[49m"),bgMagenta:i("\x1B[45m","\x1B[49m"),bgCyan:i("\x1B[46m","\x1B[49m"),bgWhite:i("\x1B[47m","\x1B[49m"),blackBright:i("\x1B[90m","\x1B[39m"),redBright:i("\x1B[91m","\x1B[39m"),greenBright:i("\x1B[92m","\x1B[39m"),yellowBright:i("\x1B[93m","\x1B[39m"),blueBright:i("\x1B[94m","\x1B[39m"),magentaBright:i("\x1B[95m","\x1B[39m"),cyanBright:i("\x1B[96m","\x1B[39m"),whiteBright:i("\x1B[97m","\x1B[39m"),bgBlackBright:i("\x1B[100m","\x1B[49m"),bgRedBright:i("\x1B[101m","\x1B[49m"),bgGreenBright:i("\x1B[102m","\x1B[49m"),bgYellowBright:i("\x1B[103m","\x1B[49m"),bgBlueBright:i("\x1B[104m","\x1B[49m"),bgMagentaBright:i("\x1B[105m","\x1B[49m"),bgCyanBright:i("\x1B[106m","\x1B[49m"),bgWhiteBright:i("\x1B[107m","\x1B[49m")}};return ku.exports=n(),ku.exports.createColors=n,ku.exports}(),a=(gu=it)&&gu.__esModule&&Object.prototype.hasOwnProperty.call(gu,"default")?gu.default:gu;const nt=function({onlyFirst:t=!1}={}){const D=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(D,t?void 0:"g")}();function YD(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(nt,"")}function qD(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var HD={exports:{}};(function(){var t={};function D(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}HD.exports=t,t.eastAsianWidth=function(e){var r=e.charCodeAt(0),s=e.length==2?e.charCodeAt(1):0,u=r;return 55296<=r&&r<=56319&&56320<=s&&s<=57343&&(u=(r&=1023)<<10|(s&=1023),u+=65536),u==12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u==8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u==172||u==175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u==161||u==164||167<=u&&u<=168||u==170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u==198||u==208||215<=u&&u<=216||222<=u&&u<=225||u==230||232<=u&&u<=234||236<=u&&u<=237||u==240||242<=u&&u<=243||247<=u&&u<=250||u==252||u==254||u==257||u==273||u==275||u==283||294<=u&&u<=295||u==299||305<=u&&u<=307||u==312||319<=u&&u<=322||u==324||328<=u&&u<=331||u==333||338<=u&&u<=339||358<=u&&u<=359||u==363||u==462||u==464||u==466||u==468||u==470||u==472||u==474||u==476||u==593||u==609||u==708||u==711||713<=u&&u<=715||u==717||u==720||728<=u&&u<=731||u==733||u==735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u==1025||1040<=u&&u<=1103||u==1105||u==8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u==8240||8242<=u&&u<=8243||u==8245||u==8251||u==8254||u==8308||u==8319||8321<=u&&u<=8324||u==8364||u==8451||u==8453||u==8457||u==8467||u==8470||8481<=u&&u<=8482||u==8486||u==8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u==8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u==8658||u==8660||u==8679||u==8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u==8715||u==8719||u==8721||u==8725||u==8730||8733<=u&&u<=8736||u==8739||u==8741||8743<=u&&u<=8748||u==8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u==8776||u==8780||u==8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u==8853||u==8857||u==8869||u==8895||u==8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u==9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u==9711||9733<=u&&u<=9734||u==9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u==9756||u==9758||u==9792||u==9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u==9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u==9955||9960<=u&&u<=9983||u==10045||u==10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u==65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},t.characterLength=function(e){var r=this.eastAsianWidth(e);return r=="F"||r=="W"||r=="A"?2:1},t.length=function(e){for(var r=D(e),s=0,u=0;u<r.length;u++)s+=this.characterLength(r[u]);return s},t.slice=function(e,r,s){textLen=t.length(e),s=s||1,(r=r||0)<0&&(r=textLen+r),s<0&&(s=textLen+s);for(var u="",n=0,l=D(e),i=0;i<l.length;i++){var F=l[i],C=t.length(F);if(n>=r-(C==2?1:0)){if(!(n+C<=s))break;u+=F}n+=C}return u}})();const ot=qD(HD.exports),at=qD(function(){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});function mu(t,D={}){if(typeof t!="string"||t.length===0||(D={ambiguousIsNarrow:!0,...D},(t=YD(t)).length===0))return 0;t=t.replace(at()," ");const e=D.ambiguousIsNarrow?1:2;let r=0;for(const s of t){const u=s.codePointAt(0);if(!(u<=31||u>=127&&u<=159||u>=768&&u<=879))switch(ot.eastAsianWidth(s)){case"F":case"W":r+=2;break;case"A":r+=e;break;default:r+=1}}return r}const JD=(t=0)=>D=>`\x1B[${D+t}m`,UD=(t=0)=>D=>`\x1B[${38+t};5;${D}m`,ZD=(t=0)=>(D,e,r)=>`\x1B[${38+t};2;${D};${e};${r}m`,S={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]}};Object.keys(S.modifier),Object.keys(S.color),Object.keys(S.bgColor);const lt=function(){const t=new Map;for(const[D,e]of Object.entries(S)){for(const[r,s]of Object.entries(e))S[r]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},e[r]=S[r],t.set(s[0],s[1]);Object.defineProperty(S,D,{value:e,enumerable:!1})}return Object.defineProperty(S,"codes",{value:t,enumerable:!1}),S.color.close="\x1B[39m",S.bgColor.close="\x1B[49m",S.color.ansi=JD(),S.color.ansi256=UD(),S.color.ansi16m=ZD(),S.bgColor.ansi=JD(10),S.bgColor.ansi256=UD(10),S.bgColor.ansi16m=ZD(10),Object.defineProperties(S,{rgbToAnsi256:{value:(D,e,r)=>D===e&&e===r?D<8?16:D>248?231:Math.round((D-8)/247*24)+232:16+36*Math.round(D/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:D=>{const e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(D.toString(16));if(!e)return[0,0,0];let[r]=e;r.length===3&&(r=[...r].map(u=>u+u).join(""));const s=Number.parseInt(r,16);return[s>>16&255,s>>8&255,255&s]},enumerable:!1},hexToAnsi256:{value:D=>S.rgbToAnsi256(...S.hexToRgb(D)),enumerable:!1},ansi256ToAnsi:{value:D=>{if(D<8)return 30+D;if(D<16)return D-8+90;let e,r,s;if(D>=232)e=(10*(D-232)+8)/255,r=e,s=e;else{const l=(D-=16)%36;e=Math.floor(D/36)/5,r=Math.floor(l/6)/5,s=l%6/5}const u=2*Math.max(e,r,s);if(u===0)return 30;let n=30+(Math.round(s)<<2|Math.round(r)<<1|Math.round(e));return u===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(D,e,r)=>S.ansi256ToAnsi(S.rgbToAnsi256(D,e,r)),enumerable:!1},hexToAnsi:{value:D=>S.ansi256ToAnsi(S.hexToAnsi256(D)),enumerable:!1}}),S}(),_u=new Set(["\x1B","\x9B"]),Zu="]8;;",XD=t=>`${_u.values().next().value}[${t}m`,QD=t=>`${_u.values().next().value}${Zu}${t}\x07`,Xu=(t,D,e)=>{const r=[...D];let s=!1,u=!1,n=mu(YD(t[t.length-1]));for(const[l,i]of r.entries()){const F=mu(i);n+F<=e?t[t.length-1]+=i:(t.push(i),n=0),_u.has(i)&&(s=!0,u=r.slice(l+1).join("").startsWith(Zu)),s?u?i==="\x07"&&(s=!1,u=!1):i==="m"&&(s=!1):(n+=F,n===e&&l<r.length-1&&(t.push(""),n=0))}!n&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())};function ue(t,D,e){return String(t).normalize().replace(/\r\n/g,`
|
|
113
|
+
`).split(`
|
|
114
|
+
`).map(r=>((s,u,n={})=>{if(n.trim!==!1&&s.trim()==="")return"";let l,i,F="";const C=(m=>m.split(" ").map($=>mu($)))(s);let c=[""];for(const[m,$]of s.split(" ").entries()){n.trim!==!1&&(c[c.length-1]=c[c.length-1].trimStart());let f=mu(c[c.length-1]);if(m!==0&&(f>=u&&(n.wordWrap===!1||n.trim===!1)&&(c.push(""),f=0),(f>0||n.trim===!1)&&(c[c.length-1]+=" ",f++)),n.hard&&C[m]>u){const b=u-f,B=1+Math.floor((C[m]-b-1)/u);Math.floor((C[m]-1)/u)<B&&c.push(""),Xu(c,$,u)}else{if(f+C[m]>u&&f>0&&C[m]>0){if(n.wordWrap===!1&&f<u){Xu(c,$,u);continue}c.push("")}f+C[m]>u&&n.wordWrap===!1?Xu(c,$,u):c[c.length-1]+=$}}n.trim!==!1&&(c=c.map(m=>($=>{const f=$.split(" ");let b=f.length;for(;b>0&&!(mu(f[b-1])>0);)b--;return b===f.length?$:f.slice(0,b).join(" ")+f.slice(b).join("")})(m)));const d=[...c.join(`
|
|
115
|
+
`)];for(const[m,$]of d.entries()){if(F+=$,_u.has($)){const{groups:b}=new RegExp(`(?:\\[(?<code>\\d+)m|\\${Zu}(?<uri>.*)\x07)`).exec(d.slice(m).join(""))||{groups:{}};if(b.code!==void 0){const B=Number.parseFloat(b.code);l=B===39?void 0:B}else b.uri!==void 0&&(i=b.uri.length===0?void 0:b.uri)}const f=lt.codes.get(Number(l));d[m+1]===`
|
|
116
|
+
`?(i&&(F+=QD("")),l&&f&&(F+=XD(f))):$===`
|
|
117
|
+
`&&(l&&f&&(F+=XD(l)),i&&(F+=QD(i)))}return F})(r,D,e)).join(`
|
|
118
|
+
`)}const Cu={actions:new Set(["up","down","left","right","space","enter","cancel"]),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function Qu(t,D){if(typeof t=="string")return Cu.aliases.get(t)===D;for(const e of t)if(e!==void 0&&Qu(e,D))return!0;return!1}const Ft=globalThis.process.platform.startsWith("win"),uD=Symbol("clack:cancel");function De(t){return t===uD}function Tu(t,D){const e=t;e.isTTY&&e.setRawMode(D)}var ct=Object.defineProperty,V=(t,D,e)=>(((r,s,u)=>{s in r?ct(r,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[s]=u})(t,typeof D!="symbol"?D+"":D,e),e);class su{constructor(D,e=!0){V(this,"input"),V(this,"output"),V(this,"_abortSignal"),V(this,"rl"),V(this,"opts"),V(this,"_render"),V(this,"_track",!1),V(this,"_prevFrame",""),V(this,"_subscribers",new Map),V(this,"_cursor",0),V(this,"state","initial"),V(this,"error",""),V(this,"value");const{input:r=Au,output:s=bu,render:u,signal:n,...l}=D;this.opts=l,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=e,this._abortSignal=n,this.input=r,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(D,e){const r=this._subscribers.get(D)??[];r.push(e),this._subscribers.set(D,r)}on(D,e){this.setSubscriber(D,{cb:e})}once(D,e){this.setSubscriber(D,{cb:e,once:!0})}emit(D,...e){const r=this._subscribers.get(D)??[],s=[];for(const u of r)u.cb(...e),u.once&&s.push(()=>r.splice(r.indexOf(u),1));for(const u of s)u()}prompt(){return new Promise((D,e)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),D(uD);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}const r=new cD(0);r._write=(s,u,n)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),n()},this.input.pipe(r),this.rl=yu.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),yu.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),Tu(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(R.cursor.show),this.output.off("resize",this.render),Tu(this.input,!1),D(this.value)}),this.once("cancel",()=>{this.output.write(R.cursor.show),this.output.off("resize",this.render),Tu(this.input,!1),D(uD)})})}onKeypress(D,e){if(this.state==="error"&&(this.state="active"),e?.name&&(!this._track&&Cu.aliases.has(e.name)&&this.emit("cursor",Cu.aliases.get(e.name)),Cu.actions.has(e.name)&&this.emit("cursor",e.name)),D&&(D.toLowerCase()==="y"||D.toLowerCase()==="n")&&this.emit("confirm",D.toLowerCase()==="y"),D===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),D&&this.emit("key",D.toLowerCase()),e?.name==="return"){if(this.opts.validate){const r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Qu([D,e?.name,e?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
119
|
+
`),Tu(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const D=ue(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
120
|
+
`).length-1;this.output.write(R.cursor.move(-999,-1*D))}render(){const D=ue(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(R.cursor.hide);else{const e=function(r,s){if(r===s)return;const u=r.split(`
|
|
121
|
+
`),n=s.split(`
|
|
122
|
+
`),l=[];for(let i=0;i<Math.max(u.length,n.length);i++)u[i]!==n[i]&&l.push(i);return l}(this._prevFrame,D);if(this.restoreCursor(),e&&e?.length===1){const r=e[0];this.output.write(R.cursor.move(0,r)),this.output.write(R.erase.lines(1));const s=D.split(`
|
|
123
|
+
`);return this.output.write(s[r]),this._prevFrame=D,void this.output.write(R.cursor.move(0,s.length-r-1))}if(e&&e?.length>1){const r=e[0];this.output.write(R.cursor.move(0,r)),this.output.write(R.erase.down());const s=D.split(`
|
|
124
|
+
`).slice(r);return this.output.write(s.join(`
|
|
125
|
+
`)),void(this._prevFrame=D)}this.output.write(R.erase.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}}class Ct extends su{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",e=>{this.output.write(R.cursor.move(0,-1)),this.value=e,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var ht=Object.defineProperty,ee=(t,D,e)=>(((r,s,u)=>{s in r?ht(r,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[s]=u})(t,typeof D!="symbol"?D+"":D,e),e);let Et=class extends su{constructor(t){super(t,!1),ee(this,"options"),ee(this,"cursor",0);const{options:D}=t;this.options=Object.entries(D).flatMap(([e,r])=>[{value:e,group:!0,label:e},...r.map(s=>({...s,group:e}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===t.cursorAt),0),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue()}})}getGroupItems(t){return this.options.filter(D=>D.group===t)}isGroupSelected(t){return this.getGroupItems(t).every(D=>this.value.includes(D.value))}toggleValue(){const t=this.options[this.cursor];if(t.group===!0){const D=t.value,e=this.getGroupItems(D);this.isGroupSelected(D)?this.value=this.value.filter(r=>e.findIndex(s=>s.value===r)===-1):this.value=[...this.value,...e.map(r=>r.value)],this.value=Array.from(new Set(this.value))}else{const D=this.value.includes(t.value);this.value=D?this.value.filter(e=>e!==t.value):[...this.value,t.value]}}};var dt=Object.defineProperty,te=(t,D,e)=>(((r,s,u)=>{s in r?dt(r,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[s]=u})(t,typeof D!="symbol"?D+"":D,e),e);let pt=class extends su{constructor(t){super(t,!1),te(this,"options"),te(this,"cursor",0),this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:D})=>D===t.cursorAt),0),this.on("key",D=>{D==="a"&&this.toggleAll()}),this.on("cursor",D=>{switch(D){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue()}})}get _value(){return this.options[this.cursor].value}toggleAll(){const t=this.value.length===this.options.length;this.value=t?[]:this.options.map(D=>D.value)}toggleValue(){const t=this.value.includes(this._value);this.value=t?this.value.filter(D=>D!==this._value):[...this.value,this._value]}};var Bt=Object.defineProperty,re=(t,D,e)=>(((r,s,u)=>{s in r?Bt(r,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[s]=u})(t,typeof D!="symbol"?D+"":D,e),e);class gt extends su{constructor({mask:D,...e}){super(e),re(this,"valueWithCursor",""),re(this,"_mask","\u2022"),this._mask=D??"\u2022",this.on("finalize",()=>{this.valueWithCursor=this.masked}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${a.inverse(a.hidden("_"))}`;else{const r=this.masked.slice(0,this.cursor),s=this.masked.slice(this.cursor);this.valueWithCursor=`${r}${a.inverse(s[0])}${s.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}}var mt=Object.defineProperty,se=(t,D,e)=>(((r,s,u)=>{s in r?mt(r,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[s]=u})(t,typeof D!="symbol"?D+"":D,e),e);class ft extends su{constructor(D){super(D,!1),se(this,"options"),se(this,"cursor",0),this.options=D.options,this.cursor=this.options.findIndex(({value:e})=>e===D.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}var $t=Object.defineProperty,ie=(t,D,e)=>(((r,s,u)=>{s in r?$t(r,s,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[s]=u})(t,typeof D!="symbol"?D+"":D,e),e);class vt extends su{constructor(D){super(D,!1),ie(this,"options"),ie(this,"cursor",0),this.options=D.options;const e=this.options.map(({value:[r]})=>r?.toLowerCase());this.cursor=Math.max(e.indexOf(D.initialValue),0),this.on("key",r=>{if(!e.includes(r))return;const s=this.options.find(({value:[u]})=>u?.toLowerCase()===r);s&&(this.value=s.value,this.state="submit",this.emit("submit"))})}}class bt extends su{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;const D=this.value.slice(0,this.cursor),[e,...r]=this.value.slice(this.cursor);return`${D}${a.inverse(e)}${r.join("")}`}get cursor(){return this._cursor}constructor(D){super(D),this.on("finalize",()=>{this.value||(this.value=D.defaultValue)})}}const DD=k.platform!=="win32"?k.env.TERM!=="linux":!!k.env.CI||!!k.env.WT_SESSION||!!k.env.TERMINUS_SUBLIME||k.env.ConEmuTask==="{cmd::Cmder}"||k.env.TERM_PROGRAM==="Terminus-Sublime"||k.env.TERM_PROGRAM==="vscode"||k.env.TERM==="xterm-256color"||k.env.TERM==="alacritty"||k.env.TERMINAL_EMULATOR==="JetBrains-JediTerm",O=(t,D)=>DD?t:D,At=O("\u25C6","*"),ne=O("\u25A0","x"),oe=O("\u25B2","x"),fu=O("\u25C7","o"),yt=O("\u250C","T"),E=O("\u2502","|"),N=O("\u2514","\u2014"),eD=O("\u25CF",">"),tD=O("\u25CB"," "),rD=O("\u25FB","[\u2022]"),$u=O("\u25FC","[+]"),ae=O("\u25FB","[ ]"),wt=O("\u25AA","\u2022"),le=O("\u2500","-"),xt=O("\u256E","+"),St=O("\u251C","+"),kt=O("\u256F","+"),Fe=O("\u25CF","\u2022"),ce=O("\u25C6","*"),Ce=O("\u25B2","!"),he=O("\u25A0","x"),iu=t=>{switch(t){case"initial":case"active":return a.cyan(At);case"cancel":return a.red(ne);case"error":return a.yellow(oe);case"submit":return a.green(fu)}},sD=t=>{const{cursor:D,options:e,style:r}=t,s=t.maxItems??Number.POSITIVE_INFINITY,u=Math.max(process.stdout.rows-4,0),n=Math.min(u,Math.max(s,5));let l=0;D>=l+n-3?l=Math.max(Math.min(D-n+3,e.length-n),0):D<l+2&&(l=Math.max(D-2,0));const i=n<e.length&&l>0,F=n<e.length&&l+n<e.length;return e.slice(l,l+n).map((C,c,d)=>{const m=c===0&&i,$=c===d.length-1&&F;return m||$?a.dim("..."):r(C,c+l===D)})},nu={message:(t="",{symbol:D=a.gray(E)}={})=>{const e=[`${a.gray(E)}`];if(t){const[r,...s]=t.split(`
|
|
126
|
+
`);e.push(`${D} ${r}`,...s.map(u=>`${a.gray(E)} ${u}`))}process.stdout.write(`${e.join(`
|
|
127
|
+
`)}
|
|
128
|
+
`)},info:t=>{nu.message(t,{symbol:a.blue(Fe)})},success:t=>{nu.message(t,{symbol:a.green(ce)})},step:t=>{nu.message(t,{symbol:a.green(fu)})},warn:t=>{nu.message(t,{symbol:a.yellow(Ce)})},warning:t=>{nu.warn(t)},error:t=>{nu.message(t,{symbol:a.red(he)})}},Ee=`${a.gray(E)} `,ou={message:async(t,{symbol:D=a.gray(E)}={})=>{process.stdout.write(`${a.gray(E)}
|
|
129
|
+
${D} `);let e=3;for await(let r of t){r=r.replace(/\n/g,`
|
|
130
|
+
${Ee}`),r.includes(`
|
|
131
|
+
`)&&(e=3+K(r.slice(r.lastIndexOf(`
|
|
132
|
+
`))).length);const s=K(r).length;e+s<process.stdout.columns?(e+=s,process.stdout.write(r)):(process.stdout.write(`
|
|
133
|
+
${Ee}${r.trimStart()}`),e=3+K(r.trimStart()).length)}process.stdout.write(`
|
|
134
|
+
`)},info:t=>ou.message(t,{symbol:a.blue(Fe)}),success:t=>ou.message(t,{symbol:a.green(ce)}),step:t=>ou.message(t,{symbol:a.green(fu)}),warn:t=>ou.message(t,{symbol:a.yellow(Ce)}),warning:t=>ou.warn(t),error:t=>ou.message(t,{symbol:a.red(he)})},de=({indicator:t="dots"}={})=>{const D=DD?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=DD?80:120,r=process.env.CI==="true";let s,u,n,l=!1,i="",F=performance.now();const C=B=>{l&&b(B>1?"Something went wrong":"Canceled",B)},c=()=>C(2),d=()=>C(1),m=()=>{if(n===void 0)return;r&&process.stdout.write(`
|
|
135
|
+
`);const B=n.split(`
|
|
136
|
+
`);process.stdout.write(R.cursor.move(-999,B.length-1)),process.stdout.write(R.erase.down(B.length))},$=B=>B.replace(/\.+$/,""),f=B=>{const y=(performance.now()-B)/1e3,v=Math.floor(y/60),p=Math.floor(y%60);return v>0?`[${v}m ${p}s]`:`[${p}s]`},b=(B="",y=0)=>{l=!1,clearInterval(u),m();const v=y===0?a.green(fu):y===1?a.red(ne):a.red(oe);i=$(B??i),t==="timer"?process.stdout.write(`${v} ${i} ${f(F)}
|
|
137
|
+
`):process.stdout.write(`${v} ${i}
|
|
138
|
+
`),process.removeListener("uncaughtExceptionMonitor",c),process.removeListener("unhandledRejection",c),process.removeListener("SIGINT",d),process.removeListener("SIGTERM",d),process.removeListener("exit",C),s()};return{start:(B="")=>{l=!0,s=function({input:p=Au,output:M=bu,overwrite:au=!0,hideCursor:H=!0}={}){const J=Q.createInterface({input:p,output:M,prompt:"",tabSize:1});Q.emitKeypressEvents(p,J),p.isTTY&&p.setRawMode(!0);const q=(lu,{name:U,sequence:z})=>{if(Qu([String(lu),U,z],"cancel"))return H&&M.write(R.cursor.show),void process.exit(0);if(!au)return;const uu=U==="return"?0:-1,Z=U==="return"?-1:0;Q.moveCursor(M,uu,Z,()=>{Q.clearLine(M,1,()=>{p.once("keypress",q)})})};return H&&M.write(R.cursor.hide),p.once("keypress",q),()=>{p.off("keypress",q),H&&M.write(R.cursor.show),p.isTTY&&!Ft&&p.setRawMode(!1),J.terminal=!1,J.close()}}(),i=$(B),F=performance.now(),process.stdout.write(`${a.gray(E)}
|
|
139
|
+
`);let y=0,v=0;process.on("uncaughtExceptionMonitor",c),process.on("unhandledRejection",c),process.on("SIGINT",d),process.on("SIGTERM",d),process.on("exit",C),u=setInterval(()=>{if(r&&i===n)return;m(),n=i;const p=a.magenta(D[y]);if(r)process.stdout.write(`${p} ${i}...`);else if(t==="timer")process.stdout.write(`${p} ${i} ${f(F)}`);else{const M=".".repeat(Math.floor(v)).slice(0,3);process.stdout.write(`${p} ${i}${M}`)}y=y+1<D.length?y+1:0,v=v<D.length?v+.125:0},e)},stop:b,message:(B="")=>{i=$(B??i)}}};var hu=Object.freeze({__proto__:null,cancel:(t="")=>{process.stdout.write(`${a.gray(N)} ${a.red(t)}
|
|
140
|
+
|
|
141
|
+
`)},confirm:t=>{const D=t.active??"Yes",e=t.inactive??"No";return new Ct({active:D,inactive:e,initialValue:t.initialValue??!0,render(){const r=`${a.gray(E)}
|
|
142
|
+
${iu(this.state)} ${t.message}
|
|
143
|
+
`,s=this.value?D:e;switch(this.state){case"submit":return`${r}${a.gray(E)} ${a.dim(s)}`;case"cancel":return`${r}${a.gray(E)} ${a.strikethrough(a.dim(s))}
|
|
144
|
+
${a.gray(E)}`;default:return`${r}${a.cyan(E)} ${this.value?`${a.green(eD)} ${D}`:`${a.dim(tD)} ${a.dim(D)}`} ${a.dim("/")} ${this.value?`${a.dim(tD)} ${a.dim(e)}`:`${a.green(eD)} ${e}`}
|
|
145
|
+
${a.cyan(N)}
|
|
146
|
+
`}}}).prompt()},group:async(t,D)=>{const e={},r=Object.keys(t);for(const s of r){const u=t[s],n=await u({results:e})?.catch(l=>{throw l});typeof D?.onCancel=="function"&&De(n)?(e[s]="canceled",D.onCancel({results:e})):e[s]=n}return e},groupMultiselect:t=>{const D=(e,r,s=[])=>{const u=e.label??String(e.value),n=typeof e.group=="string",l=n&&(s[s.indexOf(e)+1]??{group:!0}),i=n&&l.group===!0,F=n?`${i?N:E} `:"";return r==="active"?`${a.dim(F)}${a.cyan(rD)} ${u} ${e.hint?a.dim(`(${e.hint})`):""}`:r==="group-active"?`${F}${a.cyan(rD)} ${a.dim(u)}`:r==="group-active-selected"?`${F}${a.green($u)} ${a.dim(u)}`:r==="selected"?`${a.dim(F)}${a.green($u)} ${a.dim(u)}`:r==="cancelled"?`${a.strikethrough(a.dim(u))}`:r==="active-selected"?`${a.dim(F)}${a.green($u)} ${u} ${e.hint?a.dim(`(${e.hint})`):""}`:r==="submitted"?`${a.dim(u)}`:`${a.dim(F)}${a.dim(ae)} ${a.dim(u)}`};return new Et({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(e){if(this.required&&e.length===0)return`Please select at least one option.
|
|
147
|
+
${a.reset(a.dim(`Press ${a.gray(a.bgWhite(a.inverse(" space ")))} to select, ${a.gray(a.bgWhite(a.inverse(" enter ")))} to submit`))}`},render(){const e=`${a.gray(E)}
|
|
148
|
+
${iu(this.state)} ${t.message}
|
|
149
|
+
`;switch(this.state){case"submit":return`${e}${a.gray(E)} ${this.options.filter(({value:r})=>this.value.includes(r)).map(r=>D(r,"submitted")).join(a.dim(", "))}`;case"cancel":{const r=this.options.filter(({value:s})=>this.value.includes(s)).map(s=>D(s,"cancelled")).join(a.dim(", "));return`${e}${a.gray(E)} ${r.trim()?`${r}
|
|
150
|
+
${a.gray(E)}`:""}`}case"error":{const r=this.error.split(`
|
|
151
|
+
`).map((s,u)=>u===0?`${a.yellow(N)} ${a.yellow(s)}`:` ${s}`).join(`
|
|
152
|
+
`);return`${e}${a.yellow(E)} ${this.options.map((s,u,n)=>{const l=this.value.includes(s.value)||s.group===!0&&this.isGroupSelected(`${s.value}`),i=u===this.cursor;return i||typeof s.group!="string"||this.options[this.cursor].value!==s.group?D(s,i&&l?"active-selected":l?"selected":i?"active":"inactive",n):D(s,l?"group-active-selected":"group-active",n)}).join(`
|
|
153
|
+
${a.yellow(E)} `)}
|
|
154
|
+
${r}
|
|
155
|
+
`}default:return`${e}${a.cyan(E)} ${this.options.map((r,s,u)=>{const n=this.value.includes(r.value)||r.group===!0&&this.isGroupSelected(`${r.value}`),l=s===this.cursor;return l||typeof r.group!="string"||this.options[this.cursor].value!==r.group?D(r,l&&n?"active-selected":n?"selected":l?"active":"inactive",u):D(r,n?"group-active-selected":"group-active",u)}).join(`
|
|
156
|
+
${a.cyan(E)} `)}
|
|
157
|
+
${a.cyan(N)}
|
|
158
|
+
`}}}).prompt()},intro:(t="")=>{process.stdout.write(`${a.gray(yt)} ${t}
|
|
159
|
+
`)},log:nu,multiselect:t=>{const D=(e,r)=>{const s=e.label??String(e.value);return r==="active"?`${a.cyan(rD)} ${s} ${e.hint?a.dim(`(${e.hint})`):""}`:r==="selected"?`${a.green($u)} ${a.dim(s)}`:r==="cancelled"?`${a.strikethrough(a.dim(s))}`:r==="active-selected"?`${a.green($u)} ${s} ${e.hint?a.dim(`(${e.hint})`):""}`:r==="submitted"?`${a.dim(s)}`:`${a.dim(ae)} ${a.dim(s)}`};return new pt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(e){if(this.required&&e.length===0)return`Please select at least one option.
|
|
160
|
+
${a.reset(a.dim(`Press ${a.gray(a.bgWhite(a.inverse(" space ")))} to select, ${a.gray(a.bgWhite(a.inverse(" enter ")))} to submit`))}`},render(){const e=`${a.gray(E)}
|
|
161
|
+
${iu(this.state)} ${t.message}
|
|
162
|
+
`,r=(s,u)=>{const n=this.value.includes(s.value);return D(s,u&&n?"active-selected":n?"selected":u?"active":"inactive")};switch(this.state){case"submit":return`${e}${a.gray(E)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>D(s,"submitted")).join(a.dim(", "))||a.dim("none")}`;case"cancel":{const s=this.options.filter(({value:u})=>this.value.includes(u)).map(u=>D(u,"cancelled")).join(a.dim(", "));return`${e}${a.gray(E)} ${s.trim()?`${s}
|
|
163
|
+
${a.gray(E)}`:""}`}case"error":{const s=this.error.split(`
|
|
164
|
+
`).map((u,n)=>n===0?`${a.yellow(N)} ${a.yellow(u)}`:` ${u}`).join(`
|
|
165
|
+
`);return`${e+a.yellow(E)} ${sD({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(`
|
|
166
|
+
${a.yellow(E)} `)}
|
|
167
|
+
${s}
|
|
168
|
+
`}default:return`${e}${a.cyan(E)} ${sD({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(`
|
|
169
|
+
${a.cyan(E)} `)}
|
|
170
|
+
${a.cyan(N)}
|
|
171
|
+
`}}}).prompt()},note:(t="",D="")=>{const e=`
|
|
172
|
+
${t}
|
|
173
|
+
`.split(`
|
|
174
|
+
`),r=K(D).length,s=Math.max(e.reduce((n,l)=>{const i=K(l);return i.length>n?i.length:n},0),r)+2,u=e.map(n=>`${a.gray(E)} ${a.dim(n)}${" ".repeat(s-K(n).length)}${a.gray(E)}`).join(`
|
|
175
|
+
`);process.stdout.write(`${a.gray(E)}
|
|
176
|
+
${a.green(fu)} ${a.reset(D)} ${a.gray(le.repeat(Math.max(s-r-1,1))+xt)}
|
|
177
|
+
${u}
|
|
178
|
+
${a.gray(St+le.repeat(s+2)+kt)}
|
|
179
|
+
`)},outro:(t="")=>{process.stdout.write(`${a.gray(E)}
|
|
180
|
+
${a.gray(N)} ${t}
|
|
181
|
+
|
|
182
|
+
`)},password:t=>new gt({validate:t.validate,mask:t.mask??wt,render(){const D=`${a.gray(E)}
|
|
183
|
+
${iu(this.state)} ${t.message}
|
|
184
|
+
`,e=this.valueWithCursor,r=this.masked;switch(this.state){case"error":return`${D.trim()}
|
|
185
|
+
${a.yellow(E)} ${r}
|
|
186
|
+
${a.yellow(N)} ${a.yellow(this.error)}
|
|
187
|
+
`;case"submit":return`${D}${a.gray(E)} ${a.dim(r)}`;case"cancel":return`${D}${a.gray(E)} ${a.strikethrough(a.dim(r??""))}${r?`
|
|
188
|
+
${a.gray(E)}`:""}`;default:return`${D}${a.cyan(E)} ${e}
|
|
189
|
+
${a.cyan(N)}
|
|
190
|
+
`}}}).prompt(),select:t=>{const D=(e,r)=>{const s=e.label??String(e.value);switch(r){case"selected":return`${a.dim(s)}`;case"active":return`${a.green(eD)} ${s} ${e.hint?a.dim(`(${e.hint})`):""}`;case"cancelled":return`${a.strikethrough(a.dim(s))}`;default:return`${a.dim(tD)} ${a.dim(s)}`}};return new ft({options:t.options,initialValue:t.initialValue,render(){const e=`${a.gray(E)}
|
|
191
|
+
${iu(this.state)} ${t.message}
|
|
192
|
+
`;switch(this.state){case"submit":return`${e}${a.gray(E)} ${D(this.options[this.cursor],"selected")}`;case"cancel":return`${e}${a.gray(E)} ${D(this.options[this.cursor],"cancelled")}
|
|
193
|
+
${a.gray(E)}`;default:return`${e}${a.cyan(E)} ${sD({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(r,s)=>D(r,s?"active":"inactive")}).join(`
|
|
194
|
+
${a.cyan(E)} `)}
|
|
195
|
+
${a.cyan(N)}
|
|
196
|
+
`}}}).prompt()},selectKey:t=>{const D=(e,r="inactive")=>{const s=e.label??String(e.value);return r==="selected"?`${a.dim(s)}`:r==="cancelled"?`${a.strikethrough(a.dim(s))}`:r==="active"?`${a.bgCyan(a.gray(` ${e.value} `))} ${s} ${e.hint?a.dim(`(${e.hint})`):""}`:`${a.gray(a.bgWhite(a.inverse(` ${e.value} `)))} ${s} ${e.hint?a.dim(`(${e.hint})`):""}`};return new vt({options:t.options,initialValue:t.initialValue,render(){const e=`${a.gray(E)}
|
|
197
|
+
${iu(this.state)} ${t.message}
|
|
198
|
+
`;switch(this.state){case"submit":return`${e}${a.gray(E)} ${D(this.options.find(r=>r.value===this.value)??t.options[0],"selected")}`;case"cancel":return`${e}${a.gray(E)} ${D(this.options[0],"cancelled")}
|
|
199
|
+
${a.gray(E)}`;default:return`${e}${a.cyan(E)} ${this.options.map((r,s)=>D(r,s===this.cursor?"active":"inactive")).join(`
|
|
200
|
+
${a.cyan(E)} `)}
|
|
201
|
+
${a.cyan(N)}
|
|
202
|
+
`}}}).prompt()},spinner:de,stream:ou,tasks:async t=>{for(const D of t){if(D.enabled===!1)continue;const e=de();e.start(D.title);const r=await D.task(e.message);e.stop(r||D.title)}},text:t=>new bt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){const D=`${a.gray(E)}
|
|
203
|
+
${iu(this.state)} ${t.message}
|
|
204
|
+
`,e=t.placeholder?a.inverse(t.placeholder[0])+a.dim(t.placeholder.slice(1)):a.inverse(a.hidden("_")),r=this.value?this.valueWithCursor:e;switch(this.state){case"error":return`${D.trim()}
|
|
205
|
+
${a.yellow(E)} ${r}
|
|
206
|
+
${a.yellow(N)} ${a.yellow(this.error)}
|
|
207
|
+
`;case"submit":return`${D}${a.gray(E)} ${a.dim(this.value||t.placeholder)}`;case"cancel":return`${D}${a.gray(E)} ${a.strikethrough(a.dim(this.value??""))}${this.value?.trim()?`
|
|
208
|
+
${a.gray(E)}`:""}`;default:return`${D}${a.cyan(E)} ${r}
|
|
209
|
+
${a.cyan(N)}
|
|
210
|
+
`}}}).prompt(),isCancel:De,updateSettings:function(t){for(const D in t){const e=D;if(!Object.hasOwn(t,e))continue;const r=t[e];if(e==="aliases")for(const s in r)Object.hasOwn(r,s)&&(Cu.aliases.has(s)||Cu.aliases.set(s,r[s]))}}});function pe(t,D,e=[]){e.some(r=>r===t)||(A.statSync(t).isDirectory()?function(r,s,u=[]){A.mkdirSync(s,{recursive:!0});for(const n of A.readdirSync(r))pe(I.resolve(r,n),I.resolve(s,n),u)}(t,D,e):A.copyFileSync(t,D))}const{blue:Cr,blueBright:hr,cyan:_t,green:Tt,greenBright:Er,magenta:dr,red:pr,redBright:Br,reset:gr,yellow:mr}=a;function iD(t,D){var e;if(typeof t!="object"||typeof D!="object")return D;for(const r in D)D[r]&&typeof D[r]=="object"?t[r]=iD((e=t[r])!==null&&e!==void 0?e:{},D[r]):t[r]=D[r];return t}[{name:"vite",display:"Vite (React)",color:_t},{name:"nextjs",display:"Next.js",color:Tt}].map(t=>t.name);class nD{constructor(D,e,r=!1){if(!e.root)throw new Error("FileManager not initialized");return this.verbose=r,this.template=D,this.fileManager=e,this}getFolderDir(D,e=!0){return I.resolve(be(import.meta.url),"../../dist",D,e?`template-${this.template}`:"")}copyDir(D,e){if(!A.existsSync(D))return void(this.verbose&&hu.log.error(`Template '${this.template}' of '${D}' not found`));this.verbose&&hu.log.info(`Copying ${D}`);const r=A.readdirSync(D);for(const s of r){const u=this.fileManager.getFilePath(s.startsWith("_")?s.slice(1):s);pe(I.join(D,s),u,e?.map(n=>I.join(D,n)))}return{srcDir:D}}addToPackageJson({devDependencies:D={},dependencies:e={},scripts:r={}}={}){const s=JSON.parse(this.fileManager.read("package.json"));if(!s)throw new Error("package.json not found");s.devDependencies={...s.devDependencies,...D},s.dependencies={...s.dependencies,...e},s.scripts={...s.scripts,...r},this.verbose&&hu.log.info("Adding to package.json"),this.fileManager.write("package.json",JSON.stringify(s,null,2)+`
|
|
211
|
+
`)}mergePackageJson(D){this.verbose&&hu.log.info("Copying package.json");const e=this.getFolderDir("raw-templates"),r=I.join(e,"package.json"),s=A.existsSync(r)?JSON.parse(A.readFileSync(r,"utf-8")):{},u=this.getFolderDir(`updated-files/${D}`),n=I.join(u,"package.json"),l=A.existsSync(n)?JSON.parse(A.readFileSync(n,"utf-8")):{},i=this.getFolderDir(`updated-files/${D}/common`,!1),F=I.join(i,"package.json"),C=iD(s,iD(l,A.existsSync(F)?JSON.parse(A.readFileSync(F,"utf-8")):{}));C.name=this.fileManager.packageName||"openfort-app",this.fileManager.write("package.json",JSON.stringify(C,null,2)+`
|
|
212
|
+
`)}copyRaw(){this.copyDir(this.getFolderDir("raw-templates"))}copyTemplate(D){if(!this.fileManager.root)throw new Error("FileManager not initialized");this.fileManager.hasBackend&&(this.verbose&&hu.log.info(`Creating frontend folder ${this.fileManager.root}/frontend`),A.mkdirSync(I.join(this.fileManager.root,"frontend"))),this.copyRaw(),this.mergePackageJson(D),this.copyDir(this.getFolderDir("updated-files/common")),this.copyDir(this.getFolderDir(`updated-files/${D}`),["package.json"]),this.copyDir(this.getFolderDir(`updated-files/${D}/common`,!1),["package.json"])}addEnv(D){this.fileManager.write(".env.local",D?Object.entries(D).map(([e,r])=>r?`${e}=${r}`:`${e}=`).join(`
|
|
213
|
+
`):`
|
|
214
|
+
`),this.fileManager.write(".env.example",D?Object.keys(D).map(e=>`${e}=`).join(`
|
|
215
|
+
`):`
|
|
216
|
+
`)}getEnvName(D,e){return D||""}}class Ot extends nD{constructor(D,e=!1){super("vite",D,e)}copyRaw(){this.copyDir(this.getFolderDir("raw-templates"),["package.json","src/App.tsx","src/assets/react.svg","public/vite.svg"])}getEnvName(D,e){return`import.meta.env.VITE_${D}`}addEnv(D){const e=Object.entries(D).reduce((r,[s,u])=>(s.startsWith("VITE_")?r[s]=u:r[`VITE_${s}`]=u,r),{});super.addEnv(e)}}class Mt extends nD{constructor(D,e=!1){super("nextjs",D,e)}copyRaw(){this.copyDir(this.getFolderDir("raw-templates"),["package.json"])}getEnvName(D,e){return`process.env.NEXT_PUBLIC_${D}!`}addEnv(D){const e=Object.entries(D).reduce((r,[s,u])=>(s.startsWith("NEXT_PUBLIC_")?r[s]=u:r[`NEXT_PUBLIC_${s}`]=u,r),{});super.addEnv(e)}}class jt{static getTransformer(D,e,r=!1){switch(D){case"vite":return new Ot(e,r);case"nextjs":return new Mt(e,r);default:return hu.log.error(`Template transformer for '${D}' not found`),new nD(D,e,r)}}}function oD(t){return t==null?[]:Array.isArray(t)?t:[t]}function It(t,D,e,r){var s,u=t[D],n=~r.string.indexOf(D)?e==null||e===!0?"":String(e):typeof e=="boolean"?e:~r.boolean.indexOf(D)?e==="false"?!1:e==="true"||(t._.push((s=+e,s*0===0?s:e)),!!e):(s=+e,s*0===0?s:e);t[D]=u==null?n:Array.isArray(u)?u.concat(n):[u,n]}function Pt(t,D){t=t||[],D=D||{};var e,r,s,u,n,l={_:[]},i=0,F=0,C=0,c=t.length;const d=D.alias!==void 0,m=D.unknown!==void 0,$=D.default!==void 0;if(D.alias=D.alias||{},D.string=oD(D.string),D.boolean=oD(D.boolean),d)for(e in D.alias)for(r=D.alias[e]=oD(D.alias[e]),i=0;i<r.length;i++)(D.alias[r[i]]=r.concat(e)).splice(i,1);for(i=D.boolean.length;i-- >0;)for(r=D.alias[D.boolean[i]]||[],F=r.length;F-- >0;)D.boolean.push(r[F]);for(i=D.string.length;i-- >0;)for(r=D.alias[D.string[i]]||[],F=r.length;F-- >0;)D.string.push(r[F]);if($){for(e in D.default)if(u=typeof D.default[e],r=D.alias[e]=D.alias[e]||[],D[u]!==void 0)for(D[u].push(e),i=0;i<r.length;i++)D[u].push(r[i])}const f=m?Object.keys(D.alias):[];for(i=0;i<c;i++){if(s=t[i],s==="--"){l._=l._.concat(t.slice(++i));break}for(F=0;F<s.length&&s.charCodeAt(F)===45;F++);if(F===0)l._.push(s);else if(s.substring(F,F+3)==="no-"){if(u=s.substring(F+3),m&&!~f.indexOf(u))return D.unknown(s);l[u]=!1}else{for(C=F+1;C<s.length&&s.charCodeAt(C)!==61;C++);for(u=s.substring(F,C),n=s.substring(++C)||i+1===c||(""+t[i+1]).charCodeAt(0)===45||t[++i],r=F===2?[u]:u,C=0;C<r.length;C++){if(u=r[C],m&&!~f.indexOf(u))return D.unknown("-".repeat(F)+u);It(l,u,C+1<r.length||n,D)}}}if($)for(e in D.default)l[e]===void 0&&(l[e]=D.default[e]);if(d)for(e in l)for(r=D.alias[e]||[];r.length>0;)l[r.shift()]=l[e];return l}var Rt=(t=>(t.PASSWORD="password",t.AUTOMATIC="automatic",t))(Rt||{}),Lt=(t=>(t.GOOGLE="google",t.TWITTER="twitter",t.FACEBOOK="facebook",t.EMAIL="email",t.WALLET="wallet",t.GUEST="guest",t))(Lt||{});const G=Pt(process.argv.slice(2),{alias:{h:"help",t:"theme",o:"overwrite",v:"verbose",d:"default",f:"framework"},boolean:["help","overwrite","verbose","validate"],string:["framework","dashboard","theme","template"],default:{template:"vite",overwrite:!1,verbose:!1,validate:!0,default:!1,dashboard:!1}}),Nt=`Usage: create-openfort [OPTION]... [DIRECTORY]
|
|
217
|
+
|
|
218
|
+
Create a new Openfortkit project in TypeScript.
|
|
219
|
+
With no arguments, start the CLI in interactive mode.
|
|
220
|
+
|
|
221
|
+
Options:
|
|
222
|
+
-h, --help Show this help message and exit
|
|
223
|
+
-f, --framework Framework to use
|
|
224
|
+
-o, --overwrite Overwrite existing files
|
|
225
|
+
-v, --verbose Enable verbose mode
|
|
226
|
+
-d, --default Use default values for all inputs
|
|
227
|
+
-t, --theme Theme to use
|
|
228
|
+
|
|
229
|
+
--no-validate Disable input validation
|
|
230
|
+
`,Be={vite:{providers:"src/providers.tsx"},nextjs:{providers:"src/app/providers.tsx"}},Wt="openfortkit-project",Vt="http://localhost:3110/api/protected-create-encryption-session",ge="https://dashboard.openfort.xyz";async function Kt(){const t=G._[0]?VD(String(G._[0])):void 0,D=G.template,e=G.overwrite,r=G.verbose,s=!!G.validate,u=G.default,n=G.dashboard?G.dashboard!==!0?String(G.dashboard):ge:!1,l=G.theme;if(G.help){console.log(Nt);return}console.log(`
|
|
231
|
+
`),g.intro("Let's create a new Openfortkit project!"),r&&g.log.success("Verbose mode enabled"),n&&g.log.info(`You can manage your Openfort project at ${n}`),s||g.log.warn(`No validation will be performed on the input values.
|
|
232
|
+
Please make sure to provide valid values.`);const i=await new Dt({verbose:r}).init({argTargetDir:t,argOverwrite:e,defaultTargetDir:Wt});if(!i||!i.root)return;const F=await st({argFramework:D});if(!F)return;if(!Be[F])return g.log.error(`Template ${F} not found. This is a bug, please report it to https://openfort.io.`),_();const C=["email","guest"],c=u?C:await g.multiselect({message:"Select your auth providers. (use arrow keys / space bar)",initialValues:C,options:[{value:"guest",label:"Guest"},{value:"email",label:"Email"},{value:"wallet",label:"Wallet"},{value:"facebook",label:"Facebook"},{value:"google",label:"Google"},{value:"twitter",label:"Twitter"}],required:!1});if(g.isCancel(c))return _();const d=c.includes("wallet");let m=!0,$;if(d){g.log.info(`Wallet Connect is required for the Wallet provider.
|
|
233
|
+
Get your Wallet Connect Project ID from https://cloud.reown.com/.`);const w=await g.text({message:"Wallet Connect Project ID:",placeholder:"Your Wallet Connect Project ID"});if(g.isCancel(w))return _();$=w;const j=await g.select({message:"Do you want to create an embedded signer for your users?",options:[{value:!0,label:"Yes",hint:"Recommended"},{value:!1,label:"No"}]});if(g.isCancel(j))return _();m=j}else u||g.log.info("No Wallet provider selected. Embedded signer will be created for the users.");let f=!1,b,B=Vt;if(m){const w=u?"password":await g.select({message:"Select a recovery method for the embedded signer.",options:[{value:"automatic",label:"Automatic",hint:"Requires a backend to create an encryption session"},{value:"password",label:"Password"}]});if(g.isCancel(w))return _();if(b=w,b==="automatic"){const j=await g.select({message:"Do you have a backend to create an encryption session?",options:[{value:!0,label:"No",hint:"We will create a sample backend for you"},{value:!1,label:"Yes",hint:"You will need to provide an endpoint to create an encryption session"}]});if(g.isCancel(j))return _();f=j;let Iu=f,lD=0;for(;!Iu;){const FD=await g.text({message:lD===0?"Please provide your API endpoint to create an encryption session:":"Please provide a valid API endpoint to create an encryption session:",placeholder:"http://localhost:3110/api/protected-create-encryption-session",validate:Du=>{if(s&&!Du)return"API endpoint is required"}});if(g.isCancel(FD))return _();B=FD,await fetch(B,{method:"POST",headers:{"Content-Type":"application/json"}}).then(Du=>Du.json()).then(Du=>{Du.session?Iu=!0:g.log.error(`Invalid API endpoint:
|
|
234
|
+
|
|
235
|
+
Response must be:
|
|
236
|
+
{
|
|
237
|
+
"session": "<session>"
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
But got:
|
|
241
|
+
${JSON.stringify(Du,null,2)}
|
|
242
|
+
`)}).catch(Du=>{g.log.error("Invalid API endpoint. Ensure you have a backend running and the endpoint is correct.")}),s||(Iu=!0),lD++}}}const y=l||await g.select({message:"Select a theme:",options:[{value:"auto",label:"Default",hint:"Auto"},{value:"midnight",label:"Midnight"},{value:"minimal",label:"Minimal"},{value:"soft",label:"Soft"},{value:"web95",label:"Web95"},{value:"rounded",label:"Rounded"},{value:"retro",label:"Retro"},{value:"nouns",label:"Nouns"}]});if(g.isCancel(y))return _();g.log.success(`Good! You are all set.
|
|
243
|
+
Please provide the following keys to continue.
|
|
244
|
+
Get your keys from ${n||ge}/developers/api-keys`);const v=jt.getTransformer(F,i,r),p={},M="[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}",au=`(test|live)_${M}`,H=new RegExp(`^sk_${au}$`),J=new RegExp(`^pk_${au}$`),q=new RegExp(`^${M}$`),lu=await g.text({message:"Openfort Publishable Key:",placeholder:"pk...",validate:w=>{if(s)if(w){if(!J.test(w))return"Openfort Publishable Key is invalid"}else return"Openfort Publishable Key is required"}});if(g.isCancel(lu))return _();p.OPENFORT_PUBLISHABLE_KEY=lu;const U=async()=>{const w=await g.text({message:"Openfort Secret:",placeholder:"sk_...",validate:j=>{if(s)if(j){if(!H.test(j))return"Openfort Secret Key is invalid"}else return"Openfort Secret Key is required"}});if(g.isCancel(w))return _();Mu=w};let z;const uu=async()=>{const w=await g.text({message:"Shield Publishable Key:",placeholder:"Your Shield Publishable Key",validate:j=>{if(s)if(j){if(!q.test(j))return"Shield Publishable Key is invalid"}else return"Shield Publishable Key is required"}});if(g.isCancel(w))return _();z=w};let Z,Ou,Mu;const me=async()=>{const w=await g.text({message:"Shield Secret:",placeholder:"Your Shield Secret",validate:j=>{if(s)if(j){if(!q.test(j))return"Shield Secret Key is invalid"}else return"Shield Secret Key is required"}});if(g.isCancel(w))return _();Ou=w},aD=async()=>{const w=await g.text({message:"Shield Encryption Share:",placeholder:"Your Shield Encryption Share",validate:j=>{if(s)if(j){if(j.length!==44)return"Shield Encryption Share is invalid"}else return"Shield Encryption Share is required"}});if(g.isCancel(w))return _();Z=w};let vu=null;if(m)if(b==="password"){if(await aD(),await uu(),!z||!Z)return _("Missing Shield Publishable Key or Shield Encryption Share");p.SHIELD_PUBLISHABLE_KEY=z,p.SHIELD_ENCRYPTION_SHARE=Z,vu={createEmbeddedSigner:!0,embeddedSignerConfiguration:{shieldPublishableKey:"_ENV_.SHIELD_PUBLISHABLE_KEY",recoveryMethod:b,shieldEncryptionKey:"_ENV_.SHIELD_ENCRYPTION_SHARE"}}}else if(b==="automatic"){if(f?(await U(),await aD(),await uu(),await me()):await uu(),!z)return _("Missing Shield Publishable Key");p.SHIELD_PUBLISHABLE_KEY=z,p.API_ENDPOINT=B,vu={createEmbeddedSigner:!0,embeddedSignerConfiguration:{shieldPublishableKey:"_ENV_.SHIELD_PUBLISHABLE_KEY",recoveryMethod:b,createEncryptedSessionEndpoint:"_ENV_.API_ENDPOINT"}}}else _("Invalid recovery method");else vu={linkWalletOnSignUp:!0};if(r&&g.log.info(`Using template: ${F}`),g.log.step(`Scaffolding project in ${i.root}...`),f){if(!Mu||!Ou||!z||!Z)return _("Missing Openfort Secret, Shield Secret, Shield Publishable Key or Shield Encryption Share");await i.createBackend({openfortSecretKey:Mu,shieldSecretKey:Ou,shieldApiKey:z,shieldEncryptionShare:Z,port:3110})}v.copyTemplate("openfortkit"),r&&g.log.info(`Template copied: ${F}`);let X=JSON.stringify(vu,null,2);const ju=/"_ENV_\.(.*)"/;let Eu=X.match(ju);for(;Eu;)r&&g.log.info(`Replacing ${Eu[0]} with ${v.getEnvName(Eu[1])}`),X=X.replace(ju,v.getEnvName(Eu[1])),Eu=X.match(ju);X=X.replace('"recoveryMethod": "automatic"',"recoveryMethod: RecoveryMethod.AUTOMATIC"),X=X.replace('"recoveryMethod": "password"',"recoveryMethod: RecoveryMethod.PASSWORD");const fe={email:"AuthProvider.EMAIL",guest:"AuthProvider.GUEST",wallet:"AuthProvider.WALLET",facebook:"AuthProvider.FACEBOOK",google:"AuthProvider.GOOGLE",twitter:"AuthProvider.TWITTER"},$e=`[
|
|
245
|
+
`+c.map(w=>fe[w]).join(`,
|
|
246
|
+
`)+`
|
|
247
|
+
]`;i.editFile(Be[F].providers,w=>w.replace(/WALLET_CONFIG/g,X).replace(/WALLET_CONNECT_PROJECT_ID/g,v.getEnvName("WALLET_CONNECT_PROJECT_ID")).replace(/OPENFORT_PUBLISHABLE_KEY/g,v.getEnvName("OPENFORT_PUBLISHABLE_KEY")).replace(/AUTH_PROVIDERS/g,$e).replace(/VAR_THEME/g,y).replace(/"([^"]+)": /g,"$1: ")),p.WALLET_CONNECT_PROJECT_ID=$,v.addEnv(p),i.outro()}Kt().catch(t=>{console.error(t)});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
## Raw templates
|
|
2
|
+
|
|
3
|
+
This templates are generated directly from each app.
|
|
4
|
+
|
|
5
|
+
This way we can update them easily and `template transformer` manages the basic changes of structure.
|
|
6
|
+
|
|
7
|
+
### Vite
|
|
8
|
+
|
|
9
|
+
> yarn create vite template-vite -t react-ts
|
|
10
|
+
|
|
11
|
+
### Nextjs
|
|
12
|
+
|
|
13
|
+
> npx create-next-app@latest template-nextjs --empty --typescript --use-yarn
|
|
14
|
+
|
|
15
|
+
Accept all default. Yarn crate will break but that's the expected behaviour so the package doesn't get installed.
|
|
16
|
+
|
|
17
|
+
### CRA
|
|
18
|
+
|
|
19
|
+
TBD
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
|
2
|
+
|
|
3
|
+
## Getting Started
|
|
4
|
+
|
|
5
|
+
First, run the development server:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run dev
|
|
9
|
+
# or
|
|
10
|
+
yarn dev
|
|
11
|
+
# or
|
|
12
|
+
pnpm dev
|
|
13
|
+
# or
|
|
14
|
+
bun dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
18
|
+
|
|
19
|
+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
|
20
|
+
|
|
21
|
+
## Learn More
|
|
22
|
+
|
|
23
|
+
To learn more about Next.js, take a look at the following resources:
|
|
24
|
+
|
|
25
|
+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
|
26
|
+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
27
|
+
|
|
28
|
+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
|
29
|
+
|
|
30
|
+
## Deploy on Vercel
|
|
31
|
+
|
|
32
|
+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
|
33
|
+
|
|
34
|
+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.*
|
|
7
|
+
.yarn/*
|
|
8
|
+
!.yarn/patches
|
|
9
|
+
!.yarn/plugins
|
|
10
|
+
!.yarn/releases
|
|
11
|
+
!.yarn/versions
|
|
12
|
+
|
|
13
|
+
# testing
|
|
14
|
+
/coverage
|
|
15
|
+
|
|
16
|
+
# next.js
|
|
17
|
+
/.next/
|
|
18
|
+
/out/
|
|
19
|
+
|
|
20
|
+
# production
|
|
21
|
+
/build
|
|
22
|
+
|
|
23
|
+
# misc
|
|
24
|
+
.DS_Store
|
|
25
|
+
*.pem
|
|
26
|
+
|
|
27
|
+
# debug
|
|
28
|
+
npm-debug.log*
|
|
29
|
+
yarn-debug.log*
|
|
30
|
+
yarn-error.log*
|
|
31
|
+
.pnpm-debug.log*
|
|
32
|
+
|
|
33
|
+
# env files (can opt-in for committing if needed)
|
|
34
|
+
.env*
|
|
35
|
+
|
|
36
|
+
# vercel
|
|
37
|
+
.vercel
|
|
38
|
+
|
|
39
|
+
# typescript
|
|
40
|
+
*.tsbuildinfo
|
|
41
|
+
next-env.d.ts
|