@builder.io/dev-tools 1.28.16 → 1.28.17
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/cli/index.cjs +19 -19
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +1 -1
- package/core/index.mjs +1 -1
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +1 -1
- package/server/index.cjs +3 -3
- package/server/index.mjs +3 -3
- package/types/tsconfig.tsbuildinfo +1 -1
package/cli/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var vxe=Object.create;var nB=Object.defineProperty;var wxe=Object.getOwnPropertyDescriptor;var bxe=Object.getOwnPropertyNames;var Sxe=Object.getPrototypeOf,Fxe=Object.prototype.hasOwnProperty;var T=(t,e)=>()=>(t&&(e=t(t=0)),e);var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),rl=(t,e)=>{for(var i in e)nB(t,i,{get:e[i],enumerable:!0})},H4=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of bxe(e))!Fxe.call(t,r)&&r!==i&&nB(t,r,{get:()=>e[r],enumerable:!(n=wxe(e,r))||n.enumerable});return t};var ie=(t,e,i)=>(i=t!=null?vxe(Sxe(t)):{},H4(e||!t||!t.__esModule?nB(i,"default",{value:t,enumerable:!0}):i,t)),Wi=t=>H4(nB({},"__esModule",{value:!0}),t);var f=T(()=>{{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"
|
|
1
|
+
var vxe=Object.create;var nB=Object.defineProperty;var wxe=Object.getOwnPropertyDescriptor;var bxe=Object.getOwnPropertyNames;var Sxe=Object.getPrototypeOf,Fxe=Object.prototype.hasOwnProperty;var T=(t,e)=>()=>(t&&(e=t(t=0)),e);var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),rl=(t,e)=>{for(var i in e)nB(t,i,{get:e[i],enumerable:!0})},H4=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of bxe(e))!Fxe.call(t,r)&&r!==i&&nB(t,r,{get:()=>e[r],enumerable:!(n=wxe(e,r))||n.enumerable});return t};var ie=(t,e,i)=>(i=t!=null?vxe(Sxe(t)):{},H4(e||!t||!t.__esModule?nB(i,"default",{value:t,enumerable:!0}):i,t)),Wi=t=>H4(nB({},"__esModule",{value:!0}),t);var f=T(()=>{{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"9e8bd743099d148f34cff389a59d4170da3d2fc5"}}});var j4=b((Rlt,J4)=>{f();function Ib(t){return t==null?[]:Array.isArray(t)?t:[t]}function kxe(t,e,i,n){var r,s=t[e],o=~n.string.indexOf(e)?i==null||i===!0?"":String(i):typeof i=="boolean"?i:~n.boolean.indexOf(e)?i==="false"?!1:i==="true"||(t._.push((r=+i,r*0===0?r:i)),!!i):(r=+i,r*0===0?r:i);t[e]=s==null?o:Array.isArray(s)?s.concat(o):[s,o]}J4.exports=function(t,e){t=t||[],e=e||{};var i,n,r,s,o,a={_:[]},A=0,c=0,u=0,l=t.length;let p=e.alias!==void 0,d=e.unknown!==void 0,g=e.default!==void 0;if(e.alias=e.alias||{},e.string=Ib(e.string),e.boolean=Ib(e.boolean),p)for(i in e.alias)for(n=e.alias[i]=Ib(e.alias[i]),A=0;A<n.length;A++)(e.alias[n[A]]=n.concat(i)).splice(A,1);for(A=e.boolean.length;A-- >0;)for(n=e.alias[e.boolean[A]]||[],c=n.length;c-- >0;)e.boolean.push(n[c]);for(A=e.string.length;A-- >0;)for(n=e.alias[e.string[A]]||[],c=n.length;c-- >0;)e.string.push(n[c]);if(g){for(i in e.default)if(s=typeof e.default[i],n=e.alias[i]=e.alias[i]||[],e[s]!==void 0)for(e[s].push(i),A=0;A<n.length;A++)e[s].push(n[A])}let m=d?Object.keys(e.alias):[];for(A=0;A<l;A++){if(r=t[A],r==="--"){a._=a._.concat(t.slice(++A));break}for(c=0;c<r.length&&r.charCodeAt(c)===45;c++);if(c===0)a._.push(r);else if(r.substring(c,c+3)==="no-"){if(s=r.substring(c+3),d&&!~m.indexOf(s))return e.unknown(r);a[s]=!1}else{for(u=c+1;u<r.length&&r.charCodeAt(u)!==61;u++);for(s=r.substring(c,u),o=r.substring(++u)||A+1===l||(""+t[A+1]).charCodeAt(0)===45||t[++A],n=c===2?[s]:s,u=0;u<n.length;u++){if(s=n[u],d&&!~m.indexOf(s))return e.unknown("-".repeat(c)+s);kxe(a,s,u+1<n.length||o,e)}}}if(g)for(i in e.default)a[i]===void 0&&(a[i]=e.default[i]);if(p)for(i in a)for(n=e.alias[i]||[];n.length>0;)a[n.shift()]=a[i];return a}});function Rxe(){if(kf!==void 0)return kf;try{return kf=require("prettier"),kf}catch{return kf=null,null}}function Nxe(t){let e=[],i=sl.default.dirname(t);for(;i!==sl.default.dirname(i);){let n=sl.default.join(i,".prettierignore");Eb.default.existsSync(n)&&e.push(n);let r=sl.default.join(i,".git");if(Eb.default.existsSync(r))break;i=sl.default.dirname(i)}return e}function Txe(t){if(t)try{let i=(0,Y4.createRequire)(t)("prettier");if(i)return i}catch{}return Rxe()}async function jo(t,e,i,n){try{let r=sl.default.resolve(t,n??"file.tsx"),s=Txe(r);if(!s)return e;if(n){let A=Nxe(r);if((await s.getFileInfo(r,{ignorePath:A.length>0?A:void 0})).ignored)return e}let o=await s.resolveConfig(r);return await s.format(e,{...o,filepath:n,parser:i})}catch{return e}}var Y4,sl,Eb,kf,rB=T(()=>{"use strict";f();Y4=require("node:module"),sl=ie(require("node:path"),1),Eb=ie(require("node:fs"),1)});var Bb,eg,sB,oB,q4,ol,Qb,yb,al,$4,tg=T(()=>{"use strict";f();Bb="preview-url",eg="framework",sB="platform",oB="node",q4="/~builder-connect",ol="/~builder-connected",Qb="/~builder-dev-tools",yb="/~builder-dev-tools.js",al="/~builder-dev-tools-close",$4="/mappings"});var aB=b((Llt,z4)=>{"use strict";f();var Db={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let i="";return t<0?i+=`\x1B[${-t}D`:t>0&&(i+=`\x1B[${t}C`),e<0?i+=`\x1B[${-e}A`:e>0&&(i+=`\x1B[${e}B`),i},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Mxe={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Pxe={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let i=0;i<t;i++)e+=this.line+(i<t-1?Db.up():"");return t&&(e+=Db.left),e}};z4.exports={cursor:Db,scroll:Mxe,erase:Pxe,beep:"\x07"}});var Ri=b((Glt,xb)=>{f();var cB=process||{},V4=cB.argv||[],AB=cB.env||{},_xe=!(AB.NO_COLOR||V4.includes("--no-color"))&&(!!AB.FORCE_COLOR||V4.includes("--color")||cB.platform==="win32"||(cB.stdout||{}).isTTY&&AB.TERM!=="dumb"||!!AB.CI),Lxe=(t,e,i=t)=>n=>{let r=""+n,s=r.indexOf(e,t.length);return~s?t+Uxe(r,e,i,s)+e:t+r+e},Uxe=(t,e,i,n)=>{let r="",s=0;do r+=t.substring(s,n)+i,s=n+e.length,n=t.indexOf(e,s);while(~n);return r+t.substring(s)},W4=(t=_xe)=>{let e=t?Lxe:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};xb.exports=W4();xb.exports.createColors=W4});function Gxe({onlyFirst:t=!1}={}){let e=["[\\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(e,t?void 0:"g")}function AK(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Oxe,"")}function cK(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Rf(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=AK(t),t.length===0))return 0;t=t.replace(jxe()," ");let i=e.ambiguousIsNarrow?1:2,n=0;for(let r of t){let s=r.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(Hxe.eastAsianWidth(r)){case"F":case"W":n+=2;break;case"A":n+=i;break;default:n+=1}}return n}function $xe(){let t=new Map;for(let[e,i]of Object.entries(Ni)){for(let[n,r]of Object.entries(i))Ni[n]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},i[n]=Ni[n],t.set(r[0],r[1]);Object.defineProperty(Ni,e,{value:i,enumerable:!1})}return Object.defineProperty(Ni,"codes",{value:t,enumerable:!1}),Ni.color.close="\x1B[39m",Ni.bgColor.close="\x1B[49m",Ni.color.ansi=Z4(),Ni.color.ansi256=X4(),Ni.color.ansi16m=eK(),Ni.bgColor.ansi=Z4(vb),Ni.bgColor.ansi256=X4(vb),Ni.bgColor.ansi16m=eK(vb),Object.defineProperties(Ni,{rgbToAnsi256:{value:(e,i,n)=>e===i&&i===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let i=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!i)return[0,0,0];let[n]=i;n.length===3&&(n=[...n].map(s=>s+s).join(""));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>Ni.rgbToAnsi256(...Ni.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let i,n,r;if(e>=232)i=((e-232)*10+8)/255,n=i,r=i;else{e-=16;let a=e%36;i=Math.floor(e/36)/5,n=Math.floor(a/6)/5,r=a%6/5}let s=Math.max(i,n,r)*2;if(s===0)return 30;let o=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(i));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,i,n)=>Ni.ansi256ToAnsi(Ni.rgbToAnsi256(e,i,n)),enumerable:!1},hexToAnsi:{value:e=>Ni.ansi256ToAnsi(Ni.hexToAnsi256(e)),enumerable:!1}}),Ni}function nK(t,e,i){return String(t).normalize().replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`).map(n=>eve(n,e,i)).join(`
|
|
4
4
|
`)}function Rb(t,e){if(typeof t=="string")return lB.aliases.get(t)===e;for(let i of t)if(i!==void 0&&Rb(i,e))return!0;return!1}function ive(t,e){if(t===e)return;let i=t.split(`
|
|
@@ -73,7 +73,7 @@ ${hK}${n.trimStart()}`),i=3+(0,Al.stripVTControlCharacters)(n.trimStart()).lengt
|
|
|
73
73
|
`),g(),r()};return{start:I,stop:B,message:(E="")=>{a=h(E??a)}}}});function Lt(t,e=""){return t.ts.createSourceFile("module.tsx",typeof e=="string"?e:"",t.ts.ScriptTarget.Latest,void 0)}function CB(t,e=""){let i=Lt(t,e?.trim());if(i.statements.length===0)throw new Error(`No statements found in code: ${e}`);return i.statements[0]}function Ln(t,e,i){if(e){let n=t.ts.createPrinter({newLine:t.ts.NewLineKind.LineFeed,removeComments:i});return t.ts.isSourceFile(e)?n.printFile(e).trim()+`
|
|
74
74
|
`:n.printNode(t.ts.EmitHint.Unspecified,e,t.ts.createSourceFile("module.tsx","",t.ts.ScriptTarget.Latest)).trim()+`
|
|
75
75
|
`}return""}var Yi=T(()=>{"use strict";f()});var xK=b((ipt,DK)=>{"use strict";f();DK.exports=function(){if(process.env.npm_config_user_agent)return Ive(process.env.npm_config_user_agent)};function Ive(t){let e=t.split(" ")[0],i=e.lastIndexOf("/"),n=e.substring(0,i);return{name:n==="npminstall"?"cnpm":n,version:e.substring(i+1)}}});function Kr(t){return t.endsWith(".mapper.tsx")||t.endsWith(".mapper.jsx")||t.endsWith(".mapper.ts")||t.endsWith(".mapper.js")||t.endsWith(".mapper.mjs")}function Ut(t,e,i){e=Yo(e),i=Yo(i),e=t.dirname(e);let n=t.basename(i,t.extname(i));i=t.dirname(i);let r;return n==="index"?r=t.relative(e,i):r=t.relative(e,t.join(i,n)),r=Yo(t.normalize(r)),r.startsWith(".")||(r="./"+r),r}function Yo(t){return t.startsWith("\\\\?\\")?t:t.replace(/\\/g,"/")}function ul(t,e){let i=t.extname(e),n=t.basename(e,i).split(/[\/\\]/),r=n[n.length-1];return vK(r==="index"?t.basename(t.dirname(e)):r)}function vK(t){return fi(t).replace(/ /g,"")}function io(t,e){let i=t.extname(e),n=Yo(t.basename(e,i)).split("/").pop();return fi(n==="index"?t.basename(t.dirname(e)):n)}function hi(t,e){let i=Yo(t.relative(t.getAppRootDir(),e));i=i.split("/").filter(r=>r!=="."&&r!==".."&&r!=="").join("/"),i.endsWith(".tsx")||i.endsWith(".jsx")?i=i.slice(0,-4):(i.endsWith(".ts")||i.endsWith(".js"))&&(i=i.slice(0,-3));let n=t.getFrameworks();return i.startsWith("src/")&&(i=i.slice(4)),n.some(r=>r.name.includes("next"))?"@/"+i:"~/"+i}function ei(t,e){let i=e,n=[];for(let r=0;r<2;r++){let s=t.basename(i);if(!s||s==="components")break;n.unshift(s),i=t.dirname(i)}return n.join("/")}function fi(t){for(t=t.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();t.includes(" ");)t=t.replace(/ /g," ");return t.split(" ").map(e=>e.length>2?e[0].toUpperCase()+e.slice(1):e).join("").trim()}function ps(t){return t.sort((e,i)=>e.name.toLocaleLowerCase().localeCompare(i.name.toLocaleLowerCase()))}async function pi(t,e,i,n){if(typeof i!="string"||i==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${i}, ${e}`);return n&&(e=n),e=t.normalize(e),(await t.hash(e+"#"+i)).substring(0,8)}async function bK(t){return(await t.hash(t.getAppRootDir())).substring(0,8)}function Tf(t){return typeof t=="number"}function rg(t){return typeof t=="boolean"}function Hr(t){return typeof t=="string"}function sg(t){return typeof t=="string"?/^[A-Z][A-Za-z0-9]*$/.test(t):!1}function Ms(t){return JSON.parse(JSON.stringify(t))}function IB(t,e,i){for(let n of e)if(t.dirname(i).includes(n))return!0;return!1}function SK(){try{let t=(0,wK.default)();if(t?.name)return t.name}catch{}return"npm"}function Eve(){return process.platform.startsWith("win")}function si(){return process.pkg?"@builder.io/agent":Eve()?'"@builder.io/dev-tools"':"builder.io"}function Lb(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_")}var wK,kt=T(()=>{"use strict";f();wK=ie(xK(),1)});function Jr(t){let e=t.join(t.getAppRootDir(),"tsconfig.json");return t.exists(e)}async function gs(t,e){async function i(r,s){if(s>10)return;let o=await t.readdir(r);for(let a of o){if(Bve.includes(a))continue;let A=t.join(r,a),c=await t.stat(A);if(c){if(c.isFile()&&a.startsWith("builder-registry."))return A;if(c.isDirectory()){let u=await i(A,s+1);if(u)return u}}}}let n=await i(t.getAppRootDir(),0);if(!n){let s=`builder-registry.${await Jr(t)?"ts":"js"}`;return t.join(e,s)}return n}async function qo(t,e){let i=t.resolve("/");for(let n=0;n<20;n++){let r=t.join(e,"package.json"),s=await t.readFile(r);if(s)return JSON.parse(s);if(e===i)break;e=t.dirname(e)}return null}async function FK(t,e){for(let i=0;i<20;i++){let n=t.dirname(e),r=t.join(n,"node_modules");if(await t.exists(r))return r;if(e===t.getAppRootDir())break;e=t.dirname(e)}return t.join(t.getAppRootDir(),"node_modules")}async function Mf(t,e,i){let n=await t.readdir(e);return n.includes(i)?t.join(e,i):(await Promise.all(n.map(async s=>{if(s.startsWith(".")||s==="node_modules")return;let o=t.join(e,s);if((await t.stat(o)).isDirectory()){let A=await Mf(t,o,i);if(A)return A}}))).find(s=>typeof s=="string")}var Bve,yr=T(()=>{"use strict";f();Bve=["node_modules","dist","build","public"]});async function vn(t,e,i){if(!Array.isArray(e)||e.length===0)throw new Error(`createTsProgram() Invalid filePaths: ${e}`);let n=await FK(t,e[0]),r=t.join(n,"typescript","lib"),s=new Map,o={fileExists:a=>{if(a=t.normalize(a),a.includes("node_modules")){let A=Pf.get(a);if(!A){try{t.statSync(a).isFile()?A={exists:!0,content:t.readFileSync(a)}:A={exists:!1}}catch{A={exists:!1}}Pf.set(a,A)}return A.exists}if(!s.has(a))if(t.existsSync(a)){let c=t.statSync(a);s.set(a,c.isFile())}else s.set(a,!1);return s.get(a)},getCanonicalFileName:a=>t.normalize(a),getCurrentDirectory:()=>t.cwd(),getDefaultLibFileName:()=>t.join(r,"lib.d.ts"),getDefaultLibLocation:()=>r,getNewLine:()=>`
|
|
76
|
-
`,getSourceFile:a=>{if(a=t.normalize(a),a.includes("node_modules")){let c=Pf.get(a);if(c)return Lt(t,c.content)}let A;try{A=t.readFileSync(a)}catch{console.error(`Could not read: ${a}`),A==null}if(A==null){let c=t.basename(a),u=t.extname(c).toLowerCase();if(a.startsWith(r)&&u===".ts"&&(A=RK.get(c),A==null&&typeof self<"u"&&typeof fetch=="function"))throw new BB(c)}return a.includes("node_modules")&&(A?Pf.set(a,{exists:!0,content:A}):Pf.set(a,{exists:!1})),Lt(t,A)},readFile:a=>{let A=t.readFileSync(a);return typeof A=="string"?A:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return Qve(t,o,e,i)}catch(a){if(a instanceof BB){await yve(t,a.libName);continue}throw t.Sentry?.captureException(a),new Error(`createTsProgram() Could not create program for: ${e[0]}`,{cause:a})}}function Qve(t,e,i,n){let r={rootNames:[...i],host:e,options:{}},s=t.ts.findConfigFile(t.dirname(i[0]),o=>t.existsSync(o));if(s){let o=kK.get(s);if(!o){let a=t.ts.readConfigFile(s,A=>{let c=t.readFileSync(A);return typeof c=="string"?c:void 0});a.error?t.Sentry?.captureException(new Error("Error reading tsconfig for createTsProgram"),{extra:{error:a.error,tsConfigPath:s}}):(o=t.ts.parseJsonConfigFileContent(a.config,t.ts.sys||{useCaseSensitiveFileNames:!1,readDirectory:(c,u)=>t.readdirSync(c),fileExists:c=>t.existsSync(c),readFile:c=>t.readFileSync(c)||void 0},t.dirname(s),void 0,s).options,kK.set(s,o))}o&&(r.options=Ms(o))}return r.options.noEmit=!0,r.options.isolatedModules=!1,r.options.strict=!1,r.options.jsx=t.ts.JsxEmit.Preserve,r.options.allowJs=!0,Object.assign(r.options,n),t.ts.createProgram(r)}async function og(t,e,i){i||(i=await vn(t,[e]));let n=i.getSourceFile(e);if(!n)throw new Error(`getTypeChecker() Could not find source file: ${e}`);return{typeChecker:i.getTypeChecker(),sourceFile:n}}async function yve(t,e){let i=`https://cdn.jsdelivr.net/npm/typescript@${t.ts.version}/lib/${e}`;EB.has(e)||EB.set(e,fetch(i).then(n=>n.text()).then(n=>{RK.set(e,n)})),await EB.get(e),EB.delete(e)}async function NK(t,e){let i=await t.readFile(e.filePath);return i==null?{diagnostics:[{messageText:`Error reading: ${e.filePath}`}],code:null,output:null}:Ub(t,{code:i,filePath:e.filePath,compilerOptions:e.compilerOptions})}function Ub(t,e){let i={diagnostics:[],code:e.code,output:null};try{let n=t.ts.transpileModule(e.code,{compilerOptions:e.compilerOptions,fileName:e.filePath??"module.tsx",reportDiagnostics:!0});n.diagnostics?.forEach(r=>{i.diagnostics.push({messageText:String(r.messageText)})}),i.output=n.outputText}catch(n){console.error("transpileModule",n),i.diagnostics.push({messageText:String(n)})}return i}var BB,RK,EB,Pf,kK,no=T(()=>{"use strict";f();Yi();kt();yr();BB=class{libName;constructor(e){this.libName=e}};RK=new Map,EB=new Map,Pf=new Map,kK=new Map});var Dve,ut,on=T(()=>{"use strict";f();Dve="1.28.
|
|
76
|
+
`,getSourceFile:a=>{if(a=t.normalize(a),a.includes("node_modules")){let c=Pf.get(a);if(c)return Lt(t,c.content)}let A;try{A=t.readFileSync(a)}catch{console.error(`Could not read: ${a}`),A==null}if(A==null){let c=t.basename(a),u=t.extname(c).toLowerCase();if(a.startsWith(r)&&u===".ts"&&(A=RK.get(c),A==null&&typeof self<"u"&&typeof fetch=="function"))throw new BB(c)}return a.includes("node_modules")&&(A?Pf.set(a,{exists:!0,content:A}):Pf.set(a,{exists:!1})),Lt(t,A)},readFile:a=>{let A=t.readFileSync(a);return typeof A=="string"?A:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return Qve(t,o,e,i)}catch(a){if(a instanceof BB){await yve(t,a.libName);continue}throw t.Sentry?.captureException(a),new Error(`createTsProgram() Could not create program for: ${e[0]}`,{cause:a})}}function Qve(t,e,i,n){let r={rootNames:[...i],host:e,options:{}},s=t.ts.findConfigFile(t.dirname(i[0]),o=>t.existsSync(o));if(s){let o=kK.get(s);if(!o){let a=t.ts.readConfigFile(s,A=>{let c=t.readFileSync(A);return typeof c=="string"?c:void 0});a.error?t.Sentry?.captureException(new Error("Error reading tsconfig for createTsProgram"),{extra:{error:a.error,tsConfigPath:s}}):(o=t.ts.parseJsonConfigFileContent(a.config,t.ts.sys||{useCaseSensitiveFileNames:!1,readDirectory:(c,u)=>t.readdirSync(c),fileExists:c=>t.existsSync(c),readFile:c=>t.readFileSync(c)||void 0},t.dirname(s),void 0,s).options,kK.set(s,o))}o&&(r.options=Ms(o))}return r.options.noEmit=!0,r.options.isolatedModules=!1,r.options.strict=!1,r.options.jsx=t.ts.JsxEmit.Preserve,r.options.allowJs=!0,Object.assign(r.options,n),t.ts.createProgram(r)}async function og(t,e,i){i||(i=await vn(t,[e]));let n=i.getSourceFile(e);if(!n)throw new Error(`getTypeChecker() Could not find source file: ${e}`);return{typeChecker:i.getTypeChecker(),sourceFile:n}}async function yve(t,e){let i=`https://cdn.jsdelivr.net/npm/typescript@${t.ts.version}/lib/${e}`;EB.has(e)||EB.set(e,fetch(i).then(n=>n.text()).then(n=>{RK.set(e,n)})),await EB.get(e),EB.delete(e)}async function NK(t,e){let i=await t.readFile(e.filePath);return i==null?{diagnostics:[{messageText:`Error reading: ${e.filePath}`}],code:null,output:null}:Ub(t,{code:i,filePath:e.filePath,compilerOptions:e.compilerOptions})}function Ub(t,e){let i={diagnostics:[],code:e.code,output:null};try{let n=t.ts.transpileModule(e.code,{compilerOptions:e.compilerOptions,fileName:e.filePath??"module.tsx",reportDiagnostics:!0});n.diagnostics?.forEach(r=>{i.diagnostics.push({messageText:String(r.messageText)})}),i.output=n.outputText}catch(n){console.error("transpileModule",n),i.diagnostics.push({messageText:String(n)})}return i}var BB,RK,EB,Pf,kK,no=T(()=>{"use strict";f();Yi();kt();yr();BB=class{libName;constructor(e){this.libName=e}};RK=new Map,EB=new Map,Pf=new Map,kK=new Map});var Dve,ut,on=T(()=>{"use strict";f();Dve="1.28.17",ut=process.env.OVERRIDE_VERSION??Dve});async function ll(t){let e=[],i=await qo(t,t.getRepoRootDir());if(i){let n=await MK(i,t);e.push(...n)}return e}async function MK(t,e){let i=[];if(t&&typeof t=="object"){let n=new Set(Object.keys({...t.dependencies,...t.devDependencies}));for(let r of xve)if(n.has(r)&&!i.some(s=>s.name===r)){let s={name:r};TK.has(r)&&(s.version=await TK.get(r)(e)),i.push(s)}}return i}function Gb(t){let e=parseInt(t);return Number.isNaN(e)?void 0:e}var TK,xve,pl=T(()=>{"use strict";f();yr();kt();TK=new Map([["next",async t=>{if(!t.spawnSync)return;let e=SK(),i=e==="npm"?"npx":e,{stdout:n}=t.spawnSync(i,["next","-v"],{encoding:"utf8"});if(!n)return;let r=n.match(/(Next.js v)([\d.]+)/g);if(!r)return;let s=r[0].split("Next.js v")[1],[o,a,A]=s.split(".");return{major:Gb(o),minor:Gb(a),patch:Gb(A)}}]]),xve=["@shopify/remix-oxygen","@shopify/hydrogen","@builder.io/qwik-city","@remix-run/react","@sveltejs/kit","astro","gatsby","next","nuxt","@builder.io/qwik","@angular/core","react","solid-js","svelte","vue"]});async function ro(t){let e=PK(t),i=await t.readFile(e);return typeof i=="string"?JSON.parse(i):{}}async function so(t,e){e=typeof e=="object"&&e!=null?e:{};let i=PK(t);await t.writeFile(i,JSON.stringify(e??{},null,2))}function PK(t){let e=t.getAppRootDir();return t.join(e,"node_modules",".builder","builder-cache.json")}var gl=T(()=>{"use strict";f()});async function Fa(t,e,i){let n={envKey:i,envValue:null,file:""};for(let r of e){let s=t.join(t.getAppRootDir(),r),o=await vve(t,s);if(o){let a=o[i];if(typeof a=="string"&&a.length>0&&a!=="YOUR_API_KEY")return n.envValue=a,n.file=s,n}}return n.file=t.join(t.getAppRootDir(),e[e.length-1]),n}async function vve(t,e){let i=await t.readFile(e);return typeof i=="string"?_K(i):null}function _K(t){let e={},i=t.replace(/\r\n?/gm,`
|
|
77
77
|
`),n;for(;(n=wve.exec(i))!=null;){let r=n[1],s=n[2]||"";s=s.trim();let o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),o==='"'&&(s=s.replace(/\\n/g,`
|
|
78
78
|
`),s=s.replace(/\\r/g,"\r")),e[r]=s}return e}async function ka(t,e,i,n){let r="# https://www.builder.io/c/docs/using-your-api-key",s=await t.readFile(e);try{if(s)if(s.includes(i))if(s.includes(n))t.debug(`"${i}" with "${n}" already set in ${e}`);else return t.debug(`Replace "${i}" in ${e}`),s=s.replace(new RegExp(`${i}=.*`),`${i}=${n}`),await t.writeFile(e,s),"update";else return t.debug(`Append "${i}" to ${e}`),s+=`
|
|
79
79
|
|
|
@@ -1106,7 +1106,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),L=Y,J=Z),V===void 0&&(
|
|
|
1106
1106
|
`:`
|
|
1107
1107
|
`)+i,r=n+1,n=t.indexOf(`
|
|
1108
1108
|
`,r)}while(n!==-1);return s+=t.slice(r),s}var zj=T(()=>{f()});function Ah(t){return Xj(t)}var Vj,Wj,oF,vg,ah,Zj,wg,Cke,iQ,Xj,aF,Ike,Eke,AF,nQ,Bke,Syt,Fyt,eY=T(()=>{f();Kj();Yj();zj();({stdout:Vj,stderr:Wj}=jj),oF=Symbol("GENERATOR"),vg=Symbol("STYLER"),ah=Symbol("IS_EMPTY"),Zj=["ansi","ansi","ansi256","ansi16m"],wg=Object.create(null),Cke=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let i=Vj?Vj.level:0;t.level=e.level===void 0?i:e.level},iQ=class{constructor(e){return Xj(e)}},Xj=t=>{let e=(...i)=>i.join(" ");return Cke(e,t),Object.setPrototypeOf(e,Ah.prototype),e};Object.setPrototypeOf(Ah.prototype,Function.prototype);for(let[t,e]of Object.entries(Zo))wg[t]={get(){let i=nQ(this,AF(e.open,e.close,this[vg]),this[ah]);return Object.defineProperty(this,t,{value:i}),i}};wg.visible={get(){let t=nQ(this,this[vg],!0);return Object.defineProperty(this,"visible",{value:t}),t}};aF=(t,e,i,...n)=>t==="rgb"?e==="ansi16m"?Zo[i].ansi16m(...n):e==="ansi256"?Zo[i].ansi256(Zo.rgbToAnsi256(...n)):Zo[i].ansi(Zo.rgbToAnsi(...n)):t==="hex"?aF("rgb",e,i,...Zo.hexToRgb(...n)):Zo[i][t](...n),Ike=["rgb","hex","ansi256"];for(let t of Ike){wg[t]={get(){let{level:i}=this;return function(...n){let r=AF(aF(t,Zj[i],"color",...n),Zo.color.close,this[vg]);return nQ(this,r,this[ah])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);wg[e]={get(){let{level:i}=this;return function(...n){let r=AF(aF(t,Zj[i],"bgColor",...n),Zo.bgColor.close,this[vg]);return nQ(this,r,this[ah])}}}}Eke=Object.defineProperties(()=>{},{...wg,level:{enumerable:!0,get(){return this[oF].level},set(t){this[oF].level=t}}}),AF=(t,e,i)=>{let n,r;return i===void 0?(n=t,r=e):(n=i.openAll+t,r=e+i.closeAll),{open:t,close:e,openAll:n,closeAll:r,parent:i}},nQ=(t,e,i)=>{let n=(...r)=>Bke(n,r.length===1?""+r[0]:r.join(" "));return Object.setPrototypeOf(n,Eke),n[oF]=t,n[vg]=e,n[ah]=i,n},Bke=(t,e)=>{if(t.level<=0||!e)return t[ah]?"":e;let i=t[vg];if(i===void 0)return e;let{openAll:n,closeAll:r}=i;if(e.includes("\x1B"))for(;i!==void 0;)e=qj(e,i.close,i.open),i=i.parent;let s=e.indexOf(`
|
|
1109
|
-
`);return s!==-1&&(e=$j(e,r,n,s)),n+e+r};Object.defineProperties(Ah.prototype,wg);Syt=Ah(),Fyt=Ah({level:Wj?Wj.level:0})});function ch(t){let e=nF(t);return{highlight:i,highlightAuto:n,listLanguages:e.listLanguages,register:e.register,registerAlias:e.registerAlias,registered:e.registered};function i(r,s,o){let a=e.highlight(r,s),A=a.data;return{language:A.language,relevance:A.relevance,value:cF(o||tY,a)}}function n(r,s){let o,a;if(s&&("subset"in s||"sheet"in s)){let u=s;a={subset:u.subset},o=u.sheet}else o=s;let A=e.highlightAuto(r,a),c=A.data;return{language:c.language,relevance:c.relevance,value:cF(o||tY,A)}}}function cF(t,e){let i=new Set(e.type==="element"&&Array.isArray(e.properties.className)?e.properties.className.map(function(a){return String(a).replace(/^hljs-/,"")}):[]),n={},r,s="",o;for(o in t)if(Object.hasOwn(t,o)){let a=o.split(" "),A=t[o];i.has(a[0])?a.length===1?r=A:n[a.slice(1).join(" ")]=A:n[o]=A}return"value"in e?s=e.value:"children"in e&&(s=Qke(n,e.children)),r&&(s=r(s)),s}function Qke(t,e){let i=[],n=-1;for(;++n<e.length;)i.push(cF(t,e[n]));return i.join("")}var Tt,tY,iY=T(()=>{f();eY();rF();Tt=new iQ({level:2}),tY={comment:Tt.gray,quote:Tt.gray,keyword:Tt.green,"selector-tag":Tt.green,addition:Tt.green,number:Tt.cyan,string:Tt.cyan,"meta meta-string":Tt.cyan,literal:Tt.cyan,doctag:Tt.cyan,regexp:Tt.cyan,title:Tt.blue,section:Tt.blue,name:Tt.blue,"selector-id":Tt.blue,"selector-class":Tt.blue,attribute:Tt.yellow,attr:Tt.yellow,variable:Tt.yellow,"template-variable":Tt.yellow,"class title":Tt.yellow,type:Tt.yellow,symbol:Tt.magenta,bullet:Tt.magenta,subst:Tt.magenta,meta:Tt.magenta,"meta keyword":Tt.magenta,"selector-attr":Tt.magenta,"selector-pseudo":Tt.magenta,link:Tt.magenta,built_in:Tt.red,deletion:Tt.red,emphasis:Tt.italic,strong:Tt.bold,formula:Tt.inverse}});var uF=T(()=>{f();rF();iY()});async function be(t){if(process.env.NODE_ENV!=="test")try{let e=process.env.BUILDER_DISABLE_AMPLITUDE==="true",i=[nY.flush(2e3)];e||i.push(rY.flush().promise),await Promise.allSettled(i)}catch(e){console.error(e)}process.exit(t)}var nY,rY,co=T(()=>{"use strict";f();nY=ie(require("@sentry/node"),1),rY=ie(require("@amplitude/analytics-node"),1)});var Je,an=T(()=>{"use strict";f();Je=process.env.AIR_HOST||process.env.BUILDER_HOST||"https://api.builder.io"});var oY,sY=T(()=>{oY="1.28.16"});var AY=b(lF=>{f();var aY="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");lF.encode=function(t){if(0<=t&&t<aY.length)return aY[t];throw new TypeError("Must be between 0 and 63: "+t)};lF.decode=function(t){var e=65,i=90,n=97,r=122,s=48,o=57,a=43,A=47,c=26,u=52;return e<=t&&t<=i?t-e:n<=t&&t<=r?t-n+c:s<=t&&t<=o?t-s+u:t==a?62:t==A?63:-1}});var dF=b(gF=>{f();var cY=AY(),pF=5,uY=1<<pF,lY=uY-1,pY=uY;function Dke(t){return t<0?(-t<<1)+1:(t<<1)+0}function xke(t){var e=(t&1)===1,i=t>>1;return e?-i:i}gF.encode=function(e){var i="",n,r=Dke(e);do n=r&lY,r>>>=pF,r>0&&(n|=pY),i+=cY.encode(n);while(r>0);return i};gF.decode=function(e,i,n){var r=e.length,s=0,o=0,a,A;do{if(i>=r)throw new Error("Expected more digits in base 64 VLQ value.");if(A=cY.decode(e.charCodeAt(i++)),A===-1)throw new Error("Invalid base64 digit: "+e.charAt(i-1));a=!!(A&pY),A&=lY,s=s+(A<<o),o+=pF}while(a);n.value=xke(s),n.rest=i}});var Sg=b(Kn=>{f();function vke(t,e,i){if(e in t)return t[e];if(arguments.length===3)return i;throw new Error('"'+e+'" is a required argument.')}Kn.getArg=vke;var gY=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,wke=/^data:.+\,.+$/;function uh(t){var e=t.match(gY);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}Kn.urlParse=uh;function bg(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}Kn.urlGenerate=bg;var bke=32;function Ske(t){var e=[];return function(i){for(var n=0;n<e.length;n++)if(e[n].input===i){var r=e[0];return e[0]=e[n],e[n]=r,e[0].result}var s=t(i);return e.unshift({input:i,result:s}),e.length>bke&&e.pop(),s}}var mF=Ske(function(e){var i=e,n=uh(e);if(n){if(!n.path)return e;i=n.path}for(var r=Kn.isAbsolute(i),s=[],o=0,a=0;;)if(o=a,a=i.indexOf("/",o),a===-1){s.push(i.slice(o));break}else for(s.push(i.slice(o,a));a<i.length&&i[a]==="/";)a++;for(var A,c=0,a=s.length-1;a>=0;a--)A=s[a],A==="."?s.splice(a,1):A===".."?c++:c>0&&(A===""?(s.splice(a+1,c),c=0):(s.splice(a,2),c--));return i=s.join("/"),i===""&&(i=r?"/":"."),n?(n.path=i,bg(n)):i});Kn.normalize=mF;function dY(t,e){t===""&&(t="."),e===""&&(e=".");var i=uh(e),n=uh(t);if(n&&(t=n.path||"/"),i&&!i.scheme)return n&&(i.scheme=n.scheme),bg(i);if(i||e.match(wke))return e;if(n&&!n.host&&!n.path)return n.host=e,bg(n);var r=e.charAt(0)==="/"?e:mF(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=r,bg(n)):r}Kn.join=dY;Kn.isAbsolute=function(t){return t.charAt(0)==="/"||gY.test(t)};function Fke(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var i=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++i}return Array(i+1).join("../")+e.substr(t.length+1)}Kn.relative=Fke;var mY=(function(){var t=Object.create(null);return!("__proto__"in t)})();function fY(t){return t}function kke(t){return hY(t)?"$"+t:t}Kn.toSetString=mY?fY:kke;function Rke(t){return hY(t)?t.slice(1):t}Kn.fromSetString=mY?fY:Rke;function hY(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var i=e-10;i>=0;i--)if(t.charCodeAt(i)!==36)return!1;return!0}function Nke(t,e,i){var n=_A(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||i)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:_A(t.name,e.name)}Kn.compareByOriginalPositions=Nke;function Tke(t,e,i){var n;return n=t.originalLine-e.originalLine,n!==0||(n=t.originalColumn-e.originalColumn,n!==0||i)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:_A(t.name,e.name)}Kn.compareByOriginalPositionsNoSource=Tke;function Mke(t,e,i){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||i)||(n=_A(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:_A(t.name,e.name)}Kn.compareByGeneratedPositionsDeflated=Mke;function Pke(t,e,i){var n=t.generatedColumn-e.generatedColumn;return n!==0||i||(n=_A(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:_A(t.name,e.name)}Kn.compareByGeneratedPositionsDeflatedNoLine=Pke;function _A(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function _ke(t,e){var i=t.generatedLine-e.generatedLine;return i!==0||(i=t.generatedColumn-e.generatedColumn,i!==0)||(i=_A(t.source,e.source),i!==0)||(i=t.originalLine-e.originalLine,i!==0)||(i=t.originalColumn-e.originalColumn,i!==0)?i:_A(t.name,e.name)}Kn.compareByGeneratedPositionsInflated=_ke;function Lke(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}Kn.parseSourceMapInput=Lke;function Uke(t,e,i){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),i){var n=uh(i);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var r=n.path.lastIndexOf("/");r>=0&&(n.path=n.path.substring(0,r+1))}e=dY(bg(n),e)}return mF(e)}Kn.computeSourceURL=Uke});var CF=b(CY=>{f();var fF=Sg(),hF=Object.prototype.hasOwnProperty,xl=typeof Map<"u";function LA(){this._array=[],this._set=xl?new Map:Object.create(null)}LA.fromArray=function(e,i){for(var n=new LA,r=0,s=e.length;r<s;r++)n.add(e[r],i);return n};LA.prototype.size=function(){return xl?this._set.size:Object.getOwnPropertyNames(this._set).length};LA.prototype.add=function(e,i){var n=xl?e:fF.toSetString(e),r=xl?this.has(e):hF.call(this._set,n),s=this._array.length;(!r||i)&&this._array.push(e),r||(xl?this._set.set(e,s):this._set[n]=s)};LA.prototype.has=function(e){if(xl)return this._set.has(e);var i=fF.toSetString(e);return hF.call(this._set,i)};LA.prototype.indexOf=function(e){if(xl){var i=this._set.get(e);if(i>=0)return i}else{var n=fF.toSetString(e);if(hF.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};LA.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};LA.prototype.toArray=function(){return this._array.slice()};CY.ArraySet=LA});var BY=b(EY=>{f();var IY=Sg();function Gke(t,e){var i=t.generatedLine,n=e.generatedLine,r=t.generatedColumn,s=e.generatedColumn;return n>i||n==i&&s>=r||IY.compareByGeneratedPositionsInflated(t,e)<=0}function rQ(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}rQ.prototype.unsortedForEach=function(e,i){this._array.forEach(e,i)};rQ.prototype.add=function(e){Gke(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};rQ.prototype.toArray=function(){return this._sorted||(this._array.sort(IY.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};EY.MappingList=rQ});var IF=b(QY=>{f();var lh=dF(),An=Sg(),sQ=CF().ArraySet,Oke=BY().MappingList;function uo(t){t||(t={}),this._file=An.getArg(t,"file",null),this._sourceRoot=An.getArg(t,"sourceRoot",null),this._skipValidation=An.getArg(t,"skipValidation",!1),this._ignoreInvalidMapping=An.getArg(t,"ignoreInvalidMapping",!1),this._sources=new sQ,this._names=new sQ,this._mappings=new Oke,this._sourcesContents=null}uo.prototype._version=3;uo.fromSourceMap=function(e,i){var n=e.sourceRoot,r=new uo(Object.assign(i||{},{file:e.file,sourceRoot:n}));return e.eachMapping(function(s){var o={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(o.source=s.source,n!=null&&(o.source=An.relative(n,o.source)),o.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(o.name=s.name)),r.addMapping(o)}),e.sources.forEach(function(s){var o=s;n!==null&&(o=An.relative(n,s)),r._sources.has(o)||r._sources.add(o);var a=e.sourceContentFor(s);a!=null&&r.setSourceContent(s,a)}),r};uo.prototype.addMapping=function(e){var i=An.getArg(e,"generated"),n=An.getArg(e,"original",null),r=An.getArg(e,"source",null),s=An.getArg(e,"name",null);!this._skipValidation&&this._validateMapping(i,n,r,s)===!1||(r!=null&&(r=String(r),this._sources.has(r)||this._sources.add(r)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:i.line,generatedColumn:i.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:r,name:s}))};uo.prototype.setSourceContent=function(e,i){var n=e;this._sourceRoot!=null&&(n=An.relative(this._sourceRoot,n)),i!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[An.toSetString(n)]=i):this._sourcesContents&&(delete this._sourcesContents[An.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};uo.prototype.applySourceMap=function(e,i,n){var r=i;if(i==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);r=e.file}var s=this._sourceRoot;s!=null&&(r=An.relative(s,r));var o=new sQ,a=new sQ;this._mappings.unsortedForEach(function(A){if(A.source===r&&A.originalLine!=null){var c=e.originalPositionFor({line:A.originalLine,column:A.originalColumn});c.source!=null&&(A.source=c.source,n!=null&&(A.source=An.join(n,A.source)),s!=null&&(A.source=An.relative(s,A.source)),A.originalLine=c.line,A.originalColumn=c.column,c.name!=null&&(A.name=c.name))}var u=A.source;u!=null&&!o.has(u)&&o.add(u);var l=A.name;l!=null&&!a.has(l)&&a.add(l)},this),this._sources=o,this._names=a,e.sources.forEach(function(A){var c=e.sourceContentFor(A);c!=null&&(n!=null&&(A=An.join(n,A)),s!=null&&(A=An.relative(s,A)),this.setSourceContent(A,c))},this)};uo.prototype._validateMapping=function(e,i,n,r){if(i&&typeof i.line!="number"&&typeof i.column!="number"){var s="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!i&&!n&&!r)){if(e&&"line"in e&&"column"in e&&i&&"line"in i&&"column"in i&&e.line>0&&e.column>=0&&i.line>0&&i.column>=0&&n)return;var s="Invalid mapping: "+JSON.stringify({generated:e,source:n,original:i,name:r});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}};uo.prototype._serializeMappings=function(){for(var e=0,i=1,n=0,r=0,s=0,o=0,a="",A,c,u,l,p=this._mappings.toArray(),d=0,g=p.length;d<g;d++){if(c=p[d],A="",c.generatedLine!==i)for(e=0;c.generatedLine!==i;)A+=";",i++;else if(d>0){if(!An.compareByGeneratedPositionsInflated(c,p[d-1]))continue;A+=","}A+=lh.encode(c.generatedColumn-e),e=c.generatedColumn,c.source!=null&&(l=this._sources.indexOf(c.source),A+=lh.encode(l-o),o=l,A+=lh.encode(c.originalLine-1-r),r=c.originalLine-1,A+=lh.encode(c.originalColumn-n),n=c.originalColumn,c.name!=null&&(u=this._names.indexOf(c.name),A+=lh.encode(u-s),s=u)),a+=A}return a};uo.prototype._generateSourcesContent=function(e,i){return e.map(function(n){if(!this._sourcesContents)return null;i!=null&&(n=An.relative(i,n));var r=An.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)};uo.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};uo.prototype.toString=function(){return JSON.stringify(this.toJSON())};QY.SourceMapGenerator=uo});var yY=b(vl=>{f();vl.GREATEST_LOWER_BOUND=1;vl.LEAST_UPPER_BOUND=2;function EF(t,e,i,n,r,s){var o=Math.floor((e-t)/2)+t,a=r(i,n[o],!0);return a===0?o:a>0?e-o>1?EF(o,e,i,n,r,s):s==vl.LEAST_UPPER_BOUND?e<n.length?e:-1:o:o-t>1?EF(t,o,i,n,r,s):s==vl.LEAST_UPPER_BOUND?o:t<0?-1:t}vl.search=function(e,i,n,r){if(i.length===0)return-1;var s=EF(-1,i.length,e,i,n,r||vl.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(i[s],i[s-1],!0)===0;)--s;return s}});var vY=b(xY=>{f();function Kke(t){function e(r,s,o){var a=r[s];r[s]=r[o],r[o]=a}function i(r,s){return Math.round(r+Math.random()*(s-r))}function n(r,s,o,a){if(o<a){var A=i(o,a),c=o-1;e(r,A,a);for(var u=r[a],l=o;l<a;l++)s(r[l],u,!1)<=0&&(c+=1,e(r,c,l));e(r,c+1,l);var p=c+1;n(r,s,o,p-1),n(r,s,p+1,a)}}return n}function Hke(t){let e=Kke.toString();return new Function(`return ${e}`)()(t)}var DY=new WeakMap;xY.quickSort=function(t,e,i=0){let n=DY.get(e);n===void 0&&(n=Hke(e),DY.set(e,n)),n(t,e,i,t.length-1)}});var SY=b(oQ=>{f();var Te=Sg(),QF=yY(),Fg=CF().ArraySet,Jke=dF(),ph=vY().quickSort;function xi(t,e){var i=t;return typeof t=="string"&&(i=Te.parseSourceMapInput(t)),i.sections!=null?new Xo(i,e):new ir(i,e)}xi.fromSourceMap=function(t,e){return ir.fromSourceMap(t,e)};xi.prototype._version=3;xi.prototype.__generatedMappings=null;Object.defineProperty(xi.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});xi.prototype.__originalMappings=null;Object.defineProperty(xi.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});xi.prototype._charIsMappingSeparator=function(e,i){var n=e.charAt(i);return n===";"||n===","};xi.prototype._parseMappings=function(e,i){throw new Error("Subclasses must implement _parseMappings")};xi.GENERATED_ORDER=1;xi.ORIGINAL_ORDER=2;xi.GREATEST_LOWER_BOUND=1;xi.LEAST_UPPER_BOUND=2;xi.prototype.eachMapping=function(e,i,n){var r=i||null,s=n||xi.GENERATED_ORDER,o;switch(s){case xi.GENERATED_ORDER:o=this._generatedMappings;break;case xi.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var a=this.sourceRoot,A=e.bind(r),c=this._names,u=this._sources,l=this._sourceMapURL,p=0,d=o.length;p<d;p++){var g=o[p],m=g.source===null?null:u.at(g.source);m!==null&&(m=Te.computeSourceURL(a,m,l)),A({source:m,generatedLine:g.generatedLine,generatedColumn:g.generatedColumn,originalLine:g.originalLine,originalColumn:g.originalColumn,name:g.name===null?null:c.at(g.name)})}};xi.prototype.allGeneratedPositionsFor=function(e){var i=Te.getArg(e,"line"),n={source:Te.getArg(e,"source"),originalLine:i,originalColumn:Te.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var r=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Te.compareByOriginalPositions,QF.LEAST_UPPER_BOUND);if(s>=0){var o=this._originalMappings[s];if(e.column===void 0)for(var a=o.originalLine;o&&o.originalLine===a;)r.push({line:Te.getArg(o,"generatedLine",null),column:Te.getArg(o,"generatedColumn",null),lastColumn:Te.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s];else for(var A=o.originalColumn;o&&o.originalLine===i&&o.originalColumn==A;)r.push({line:Te.getArg(o,"generatedLine",null),column:Te.getArg(o,"generatedColumn",null),lastColumn:Te.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return r};oQ.SourceMapConsumer=xi;function ir(t,e){var i=t;typeof t=="string"&&(i=Te.parseSourceMapInput(t));var n=Te.getArg(i,"version"),r=Te.getArg(i,"sources"),s=Te.getArg(i,"names",[]),o=Te.getArg(i,"sourceRoot",null),a=Te.getArg(i,"sourcesContent",null),A=Te.getArg(i,"mappings"),c=Te.getArg(i,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=Te.normalize(o)),r=r.map(String).map(Te.normalize).map(function(u){return o&&Te.isAbsolute(o)&&Te.isAbsolute(u)?Te.relative(o,u):u}),this._names=Fg.fromArray(s.map(String),!0),this._sources=Fg.fromArray(r,!0),this._absoluteSources=this._sources.toArray().map(function(u){return Te.computeSourceURL(o,u,e)}),this.sourceRoot=o,this.sourcesContent=a,this._mappings=A,this._sourceMapURL=e,this.file=c}ir.prototype=Object.create(xi.prototype);ir.prototype.consumer=xi;ir.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Te.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var i;for(i=0;i<this._absoluteSources.length;++i)if(this._absoluteSources[i]==t)return i;return-1};ir.fromSourceMap=function(e,i){var n=Object.create(ir.prototype),r=n._names=Fg.fromArray(e._names.toArray(),!0),s=n._sources=Fg.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=i,n._absoluteSources=n._sources.toArray().map(function(d){return Te.computeSourceURL(n.sourceRoot,d,i)});for(var o=e._mappings.toArray().slice(),a=n.__generatedMappings=[],A=n.__originalMappings=[],c=0,u=o.length;c<u;c++){var l=o[c],p=new bY;p.generatedLine=l.generatedLine,p.generatedColumn=l.generatedColumn,l.source&&(p.source=s.indexOf(l.source),p.originalLine=l.originalLine,p.originalColumn=l.originalColumn,l.name&&(p.name=r.indexOf(l.name)),A.push(p)),a.push(p)}return ph(n.__originalMappings,Te.compareByOriginalPositions),n};ir.prototype._version=3;Object.defineProperty(ir.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function bY(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var BF=Te.compareByGeneratedPositionsDeflatedNoLine;function wY(t,e){let i=t.length,n=t.length-e;if(!(n<=1))if(n==2){let r=t[e],s=t[e+1];BF(r,s)>0&&(t[e]=s,t[e+1]=r)}else if(n<20)for(let r=e;r<i;r++)for(let s=r;s>e;s--){let o=t[s-1],a=t[s];if(BF(o,a)<=0)break;t[s-1]=a,t[s]=o}else ph(t,BF,e)}ir.prototype._parseMappings=function(e,i){var n=1,r=0,s=0,o=0,a=0,A=0,c=e.length,u=0,l={},p={},d=[],g=[],m,h,C,I,B;let E=0;for(;u<c;)if(e.charAt(u)===";")n++,u++,r=0,wY(g,E),E=g.length;else if(e.charAt(u)===",")u++;else{for(m=new bY,m.generatedLine=n,I=u;I<c&&!this._charIsMappingSeparator(e,I);I++);for(h=e.slice(u,I),C=[];u<I;)Jke.decode(e,u,p),B=p.value,u=p.rest,C.push(B);if(C.length===2)throw new Error("Found a source, but no line and column");if(C.length===3)throw new Error("Found a source and line, but no column");if(m.generatedColumn=r+C[0],r=m.generatedColumn,C.length>1&&(m.source=a+C[1],a+=C[1],m.originalLine=s+C[2],s=m.originalLine,m.originalLine+=1,m.originalColumn=o+C[3],o=m.originalColumn,C.length>4&&(m.name=A+C[4],A+=C[4])),g.push(m),typeof m.originalLine=="number"){let D=m.source;for(;d.length<=D;)d.push(null);d[D]===null&&(d[D]=[]),d[D].push(m)}}wY(g,E),this.__generatedMappings=g;for(var Q=0;Q<d.length;Q++)d[Q]!=null&&ph(d[Q],Te.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...d)};ir.prototype._findMapping=function(e,i,n,r,s,o){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return QF.search(e,i,s,o)};ir.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var i=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(i.generatedLine===n.generatedLine){i.lastGeneratedColumn=n.generatedColumn-1;continue}}i.lastGeneratedColumn=1/0}};ir.prototype.originalPositionFor=function(e){var i={generatedLine:Te.getArg(e,"line"),generatedColumn:Te.getArg(e,"column")},n=this._findMapping(i,this._generatedMappings,"generatedLine","generatedColumn",Te.compareByGeneratedPositionsDeflated,Te.getArg(e,"bias",xi.GREATEST_LOWER_BOUND));if(n>=0){var r=this._generatedMappings[n];if(r.generatedLine===i.generatedLine){var s=Te.getArg(r,"source",null);s!==null&&(s=this._sources.at(s),s=Te.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=Te.getArg(r,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:Te.getArg(r,"originalLine",null),column:Te.getArg(r,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};ir.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};ir.prototype.sourceContentFor=function(e,i){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var r=e;this.sourceRoot!=null&&(r=Te.relative(this.sourceRoot,r));var s;if(this.sourceRoot!=null&&(s=Te.urlParse(this.sourceRoot))){var o=r.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!s.path||s.path=="/")&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(i)return null;throw new Error('"'+r+'" is not in the SourceMap.')};ir.prototype.generatedPositionFor=function(e){var i=Te.getArg(e,"source");if(i=this._findSourceIndex(i),i<0)return{line:null,column:null,lastColumn:null};var n={source:i,originalLine:Te.getArg(e,"line"),originalColumn:Te.getArg(e,"column")},r=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Te.compareByOriginalPositions,Te.getArg(e,"bias",xi.GREATEST_LOWER_BOUND));if(r>=0){var s=this._originalMappings[r];if(s.source===n.source)return{line:Te.getArg(s,"generatedLine",null),column:Te.getArg(s,"generatedColumn",null),lastColumn:Te.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};oQ.BasicSourceMapConsumer=ir;function Xo(t,e){var i=t;typeof t=="string"&&(i=Te.parseSourceMapInput(t));var n=Te.getArg(i,"version"),r=Te.getArg(i,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Fg,this._names=new Fg;var s={line:-1,column:0};this._sections=r.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var a=Te.getArg(o,"offset"),A=Te.getArg(a,"line"),c=Te.getArg(a,"column");if(A<s.line||A===s.line&&c<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=a,{generatedOffset:{generatedLine:A+1,generatedColumn:c+1},consumer:new xi(Te.getArg(o,"map"),e)}})}Xo.prototype=Object.create(xi.prototype);Xo.prototype.constructor=xi;Xo.prototype._version=3;Object.defineProperty(Xo.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var i=0;i<this._sections[e].consumer.sources.length;i++)t.push(this._sections[e].consumer.sources[i]);return t}});Xo.prototype.originalPositionFor=function(e){var i={generatedLine:Te.getArg(e,"line"),generatedColumn:Te.getArg(e,"column")},n=QF.search(i,this._sections,function(s,o){var a=s.generatedLine-o.generatedOffset.generatedLine;return a||s.generatedColumn-o.generatedOffset.generatedColumn}),r=this._sections[n];return r?r.consumer.originalPositionFor({line:i.generatedLine-(r.generatedOffset.generatedLine-1),column:i.generatedColumn-(r.generatedOffset.generatedLine===i.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};Xo.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};Xo.prototype.sourceContentFor=function(e,i){for(var n=0;n<this._sections.length;n++){var r=this._sections[n],s=r.consumer.sourceContentFor(e,!0);if(s||s==="")return s}if(i)return null;throw new Error('"'+e+'" is not in the SourceMap.')};Xo.prototype.generatedPositionFor=function(e){for(var i=0;i<this._sections.length;i++){var n=this._sections[i];if(n.consumer._findSourceIndex(Te.getArg(e,"source"))!==-1){var r=n.consumer.generatedPositionFor(e);if(r){var s={line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};Xo.prototype._parseMappings=function(e,i){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var r=this._sections[n],s=r.consumer._generatedMappings,o=0;o<s.length;o++){var a=s[o],A=r.consumer._sources.at(a.source);A!==null&&(A=Te.computeSourceURL(r.consumer.sourceRoot,A,this._sourceMapURL)),this._sources.add(A),A=this._sources.indexOf(A);var c=null;a.name&&(c=r.consumer._names.at(a.name),this._names.add(c),c=this._names.indexOf(c));var u={source:A,generatedLine:a.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(r.generatedOffset.generatedLine===a.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:c};this.__generatedMappings.push(u),typeof u.originalLine=="number"&&this.__originalMappings.push(u)}ph(this.__generatedMappings,Te.compareByGeneratedPositionsDeflated),ph(this.__originalMappings,Te.compareByOriginalPositions)};oQ.IndexedSourceMapConsumer=Xo});var kY=b(FY=>{f();var jke=IF().SourceMapGenerator,aQ=Sg(),Yke=/(\r?\n)/,qke=10,kg="$$$isSourceNode$$$";function _s(t,e,i,n,r){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=i??null,this.name=r??null,this[kg]=!0,n!=null&&this.add(n)}_s.fromStringWithSourceMap=function(e,i,n){var r=new _s,s=e.split(Yke),o=0,a=function(){var p=g(),d=g()||"";return p+d;function g(){return o<s.length?s[o++]:void 0}},A=1,c=0,u=null;return i.eachMapping(function(p){if(u!==null)if(A<p.generatedLine)l(u,a()),A++,c=0;else{var d=s[o]||"",g=d.substr(0,p.generatedColumn-c);s[o]=d.substr(p.generatedColumn-c),c=p.generatedColumn,l(u,g),u=p;return}for(;A<p.generatedLine;)r.add(a()),A++;if(c<p.generatedColumn){var d=s[o]||"";r.add(d.substr(0,p.generatedColumn)),s[o]=d.substr(p.generatedColumn),c=p.generatedColumn}u=p},this),o<s.length&&(u&&l(u,a()),r.add(s.splice(o).join(""))),i.sources.forEach(function(p){var d=i.sourceContentFor(p);d!=null&&(n!=null&&(p=aQ.join(n,p)),r.setSourceContent(p,d))}),r;function l(p,d){if(p===null||p.source===void 0)r.add(d);else{var g=n?aQ.join(n,p.source):p.source;r.add(new _s(p.originalLine,p.originalColumn,g,d,p.name))}}};_s.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(i){this.add(i)},this);else if(e[kg]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};_s.prototype.prepend=function(e){if(Array.isArray(e))for(var i=e.length-1;i>=0;i--)this.prepend(e[i]);else if(e[kg]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};_s.prototype.walk=function(e){for(var i,n=0,r=this.children.length;n<r;n++)i=this.children[n],i[kg]?i.walk(e):i!==""&&e(i,{source:this.source,line:this.line,column:this.column,name:this.name})};_s.prototype.join=function(e){var i,n,r=this.children.length;if(r>0){for(i=[],n=0;n<r-1;n++)i.push(this.children[n]),i.push(e);i.push(this.children[n]),this.children=i}return this};_s.prototype.replaceRight=function(e,i){var n=this.children[this.children.length-1];return n[kg]?n.replaceRight(e,i):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,i):this.children.push("".replace(e,i)),this};_s.prototype.setSourceContent=function(e,i){this.sourceContents[aQ.toSetString(e)]=i};_s.prototype.walkSourceContents=function(e){for(var i=0,n=this.children.length;i<n;i++)this.children[i][kg]&&this.children[i].walkSourceContents(e);for(var r=Object.keys(this.sourceContents),i=0,n=r.length;i<n;i++)e(aQ.fromSetString(r[i]),this.sourceContents[r[i]])};_s.prototype.toString=function(){var e="";return this.walk(function(i){e+=i}),e};_s.prototype.toStringWithSourceMap=function(e){var i={code:"",line:1,column:0},n=new jke(e),r=!1,s=null,o=null,a=null,A=null;return this.walk(function(c,u){i.code+=c,u.source!==null&&u.line!==null&&u.column!==null?((s!==u.source||o!==u.line||a!==u.column||A!==u.name)&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:i.line,column:i.column},name:u.name}),s=u.source,o=u.line,a=u.column,A=u.name,r=!0):r&&(n.addMapping({generated:{line:i.line,column:i.column}}),s=null,r=!1);for(var l=0,p=c.length;l<p;l++)c.charCodeAt(l)===qke?(i.line++,i.column=0,l+1===p?(s=null,r=!1):r&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:i.line,column:i.column},name:u.name})):i.column++}),this.walkSourceContents(function(c,u){n.setSourceContent(c,u)}),{code:i.code,map:n}};FY.SourceNode=_s});var RY=b(AQ=>{f();AQ.SourceMapGenerator=IF().SourceMapGenerator;AQ.SourceMapConsumer=SY().SourceMapConsumer;AQ.SourceNode=kY().SourceNode});var c5=b(Qh=>{"use strict";f();Object.defineProperty(Qh,"__esModule",{value:!0});function $ke(t,e){if(t==null)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;i[n]=t[n]}return i}var ja=class{constructor(e,i,n){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=i,this.index=n}},Pg=class{constructor(e,i){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=i}};function $r(t,e){let{line:i,column:n,index:r}=t;return new ja(i,n+e,r+e)}var NY="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",zke={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:NY},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:NY}},TY={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},lQ=t=>t.type==="UpdateExpression"?TY.UpdateExpression[`${t.prefix}`]:TY[t.type],Vke={AccessorIsGenerator:({kind:t})=>`A ${t}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:t})=>`Missing initializer in ${t} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:t})=>`'import.${t}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
1109
|
+
`);return s!==-1&&(e=$j(e,r,n,s)),n+e+r};Object.defineProperties(Ah.prototype,wg);Syt=Ah(),Fyt=Ah({level:Wj?Wj.level:0})});function ch(t){let e=nF(t);return{highlight:i,highlightAuto:n,listLanguages:e.listLanguages,register:e.register,registerAlias:e.registerAlias,registered:e.registered};function i(r,s,o){let a=e.highlight(r,s),A=a.data;return{language:A.language,relevance:A.relevance,value:cF(o||tY,a)}}function n(r,s){let o,a;if(s&&("subset"in s||"sheet"in s)){let u=s;a={subset:u.subset},o=u.sheet}else o=s;let A=e.highlightAuto(r,a),c=A.data;return{language:c.language,relevance:c.relevance,value:cF(o||tY,A)}}}function cF(t,e){let i=new Set(e.type==="element"&&Array.isArray(e.properties.className)?e.properties.className.map(function(a){return String(a).replace(/^hljs-/,"")}):[]),n={},r,s="",o;for(o in t)if(Object.hasOwn(t,o)){let a=o.split(" "),A=t[o];i.has(a[0])?a.length===1?r=A:n[a.slice(1).join(" ")]=A:n[o]=A}return"value"in e?s=e.value:"children"in e&&(s=Qke(n,e.children)),r&&(s=r(s)),s}function Qke(t,e){let i=[],n=-1;for(;++n<e.length;)i.push(cF(t,e[n]));return i.join("")}var Tt,tY,iY=T(()=>{f();eY();rF();Tt=new iQ({level:2}),tY={comment:Tt.gray,quote:Tt.gray,keyword:Tt.green,"selector-tag":Tt.green,addition:Tt.green,number:Tt.cyan,string:Tt.cyan,"meta meta-string":Tt.cyan,literal:Tt.cyan,doctag:Tt.cyan,regexp:Tt.cyan,title:Tt.blue,section:Tt.blue,name:Tt.blue,"selector-id":Tt.blue,"selector-class":Tt.blue,attribute:Tt.yellow,attr:Tt.yellow,variable:Tt.yellow,"template-variable":Tt.yellow,"class title":Tt.yellow,type:Tt.yellow,symbol:Tt.magenta,bullet:Tt.magenta,subst:Tt.magenta,meta:Tt.magenta,"meta keyword":Tt.magenta,"selector-attr":Tt.magenta,"selector-pseudo":Tt.magenta,link:Tt.magenta,built_in:Tt.red,deletion:Tt.red,emphasis:Tt.italic,strong:Tt.bold,formula:Tt.inverse}});var uF=T(()=>{f();rF();iY()});async function be(t){if(process.env.NODE_ENV!=="test")try{let e=process.env.BUILDER_DISABLE_AMPLITUDE==="true",i=[nY.flush(2e3)];e||i.push(rY.flush().promise),await Promise.allSettled(i)}catch(e){console.error(e)}process.exit(t)}var nY,rY,co=T(()=>{"use strict";f();nY=ie(require("@sentry/node"),1),rY=ie(require("@amplitude/analytics-node"),1)});var Je,an=T(()=>{"use strict";f();Je=process.env.AIR_HOST||process.env.BUILDER_HOST||"https://api.builder.io"});var oY,sY=T(()=>{oY="1.28.17"});var AY=b(lF=>{f();var aY="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");lF.encode=function(t){if(0<=t&&t<aY.length)return aY[t];throw new TypeError("Must be between 0 and 63: "+t)};lF.decode=function(t){var e=65,i=90,n=97,r=122,s=48,o=57,a=43,A=47,c=26,u=52;return e<=t&&t<=i?t-e:n<=t&&t<=r?t-n+c:s<=t&&t<=o?t-s+u:t==a?62:t==A?63:-1}});var dF=b(gF=>{f();var cY=AY(),pF=5,uY=1<<pF,lY=uY-1,pY=uY;function Dke(t){return t<0?(-t<<1)+1:(t<<1)+0}function xke(t){var e=(t&1)===1,i=t>>1;return e?-i:i}gF.encode=function(e){var i="",n,r=Dke(e);do n=r&lY,r>>>=pF,r>0&&(n|=pY),i+=cY.encode(n);while(r>0);return i};gF.decode=function(e,i,n){var r=e.length,s=0,o=0,a,A;do{if(i>=r)throw new Error("Expected more digits in base 64 VLQ value.");if(A=cY.decode(e.charCodeAt(i++)),A===-1)throw new Error("Invalid base64 digit: "+e.charAt(i-1));a=!!(A&pY),A&=lY,s=s+(A<<o),o+=pF}while(a);n.value=xke(s),n.rest=i}});var Sg=b(Kn=>{f();function vke(t,e,i){if(e in t)return t[e];if(arguments.length===3)return i;throw new Error('"'+e+'" is a required argument.')}Kn.getArg=vke;var gY=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,wke=/^data:.+\,.+$/;function uh(t){var e=t.match(gY);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}Kn.urlParse=uh;function bg(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}Kn.urlGenerate=bg;var bke=32;function Ske(t){var e=[];return function(i){for(var n=0;n<e.length;n++)if(e[n].input===i){var r=e[0];return e[0]=e[n],e[n]=r,e[0].result}var s=t(i);return e.unshift({input:i,result:s}),e.length>bke&&e.pop(),s}}var mF=Ske(function(e){var i=e,n=uh(e);if(n){if(!n.path)return e;i=n.path}for(var r=Kn.isAbsolute(i),s=[],o=0,a=0;;)if(o=a,a=i.indexOf("/",o),a===-1){s.push(i.slice(o));break}else for(s.push(i.slice(o,a));a<i.length&&i[a]==="/";)a++;for(var A,c=0,a=s.length-1;a>=0;a--)A=s[a],A==="."?s.splice(a,1):A===".."?c++:c>0&&(A===""?(s.splice(a+1,c),c=0):(s.splice(a,2),c--));return i=s.join("/"),i===""&&(i=r?"/":"."),n?(n.path=i,bg(n)):i});Kn.normalize=mF;function dY(t,e){t===""&&(t="."),e===""&&(e=".");var i=uh(e),n=uh(t);if(n&&(t=n.path||"/"),i&&!i.scheme)return n&&(i.scheme=n.scheme),bg(i);if(i||e.match(wke))return e;if(n&&!n.host&&!n.path)return n.host=e,bg(n);var r=e.charAt(0)==="/"?e:mF(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=r,bg(n)):r}Kn.join=dY;Kn.isAbsolute=function(t){return t.charAt(0)==="/"||gY.test(t)};function Fke(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var i=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++i}return Array(i+1).join("../")+e.substr(t.length+1)}Kn.relative=Fke;var mY=(function(){var t=Object.create(null);return!("__proto__"in t)})();function fY(t){return t}function kke(t){return hY(t)?"$"+t:t}Kn.toSetString=mY?fY:kke;function Rke(t){return hY(t)?t.slice(1):t}Kn.fromSetString=mY?fY:Rke;function hY(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var i=e-10;i>=0;i--)if(t.charCodeAt(i)!==36)return!1;return!0}function Nke(t,e,i){var n=_A(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||i)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:_A(t.name,e.name)}Kn.compareByOriginalPositions=Nke;function Tke(t,e,i){var n;return n=t.originalLine-e.originalLine,n!==0||(n=t.originalColumn-e.originalColumn,n!==0||i)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:_A(t.name,e.name)}Kn.compareByOriginalPositionsNoSource=Tke;function Mke(t,e,i){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||i)||(n=_A(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:_A(t.name,e.name)}Kn.compareByGeneratedPositionsDeflated=Mke;function Pke(t,e,i){var n=t.generatedColumn-e.generatedColumn;return n!==0||i||(n=_A(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:_A(t.name,e.name)}Kn.compareByGeneratedPositionsDeflatedNoLine=Pke;function _A(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function _ke(t,e){var i=t.generatedLine-e.generatedLine;return i!==0||(i=t.generatedColumn-e.generatedColumn,i!==0)||(i=_A(t.source,e.source),i!==0)||(i=t.originalLine-e.originalLine,i!==0)||(i=t.originalColumn-e.originalColumn,i!==0)?i:_A(t.name,e.name)}Kn.compareByGeneratedPositionsInflated=_ke;function Lke(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}Kn.parseSourceMapInput=Lke;function Uke(t,e,i){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),i){var n=uh(i);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var r=n.path.lastIndexOf("/");r>=0&&(n.path=n.path.substring(0,r+1))}e=dY(bg(n),e)}return mF(e)}Kn.computeSourceURL=Uke});var CF=b(CY=>{f();var fF=Sg(),hF=Object.prototype.hasOwnProperty,xl=typeof Map<"u";function LA(){this._array=[],this._set=xl?new Map:Object.create(null)}LA.fromArray=function(e,i){for(var n=new LA,r=0,s=e.length;r<s;r++)n.add(e[r],i);return n};LA.prototype.size=function(){return xl?this._set.size:Object.getOwnPropertyNames(this._set).length};LA.prototype.add=function(e,i){var n=xl?e:fF.toSetString(e),r=xl?this.has(e):hF.call(this._set,n),s=this._array.length;(!r||i)&&this._array.push(e),r||(xl?this._set.set(e,s):this._set[n]=s)};LA.prototype.has=function(e){if(xl)return this._set.has(e);var i=fF.toSetString(e);return hF.call(this._set,i)};LA.prototype.indexOf=function(e){if(xl){var i=this._set.get(e);if(i>=0)return i}else{var n=fF.toSetString(e);if(hF.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};LA.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};LA.prototype.toArray=function(){return this._array.slice()};CY.ArraySet=LA});var BY=b(EY=>{f();var IY=Sg();function Gke(t,e){var i=t.generatedLine,n=e.generatedLine,r=t.generatedColumn,s=e.generatedColumn;return n>i||n==i&&s>=r||IY.compareByGeneratedPositionsInflated(t,e)<=0}function rQ(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}rQ.prototype.unsortedForEach=function(e,i){this._array.forEach(e,i)};rQ.prototype.add=function(e){Gke(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};rQ.prototype.toArray=function(){return this._sorted||(this._array.sort(IY.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};EY.MappingList=rQ});var IF=b(QY=>{f();var lh=dF(),An=Sg(),sQ=CF().ArraySet,Oke=BY().MappingList;function uo(t){t||(t={}),this._file=An.getArg(t,"file",null),this._sourceRoot=An.getArg(t,"sourceRoot",null),this._skipValidation=An.getArg(t,"skipValidation",!1),this._ignoreInvalidMapping=An.getArg(t,"ignoreInvalidMapping",!1),this._sources=new sQ,this._names=new sQ,this._mappings=new Oke,this._sourcesContents=null}uo.prototype._version=3;uo.fromSourceMap=function(e,i){var n=e.sourceRoot,r=new uo(Object.assign(i||{},{file:e.file,sourceRoot:n}));return e.eachMapping(function(s){var o={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(o.source=s.source,n!=null&&(o.source=An.relative(n,o.source)),o.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(o.name=s.name)),r.addMapping(o)}),e.sources.forEach(function(s){var o=s;n!==null&&(o=An.relative(n,s)),r._sources.has(o)||r._sources.add(o);var a=e.sourceContentFor(s);a!=null&&r.setSourceContent(s,a)}),r};uo.prototype.addMapping=function(e){var i=An.getArg(e,"generated"),n=An.getArg(e,"original",null),r=An.getArg(e,"source",null),s=An.getArg(e,"name",null);!this._skipValidation&&this._validateMapping(i,n,r,s)===!1||(r!=null&&(r=String(r),this._sources.has(r)||this._sources.add(r)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:i.line,generatedColumn:i.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:r,name:s}))};uo.prototype.setSourceContent=function(e,i){var n=e;this._sourceRoot!=null&&(n=An.relative(this._sourceRoot,n)),i!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[An.toSetString(n)]=i):this._sourcesContents&&(delete this._sourcesContents[An.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};uo.prototype.applySourceMap=function(e,i,n){var r=i;if(i==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);r=e.file}var s=this._sourceRoot;s!=null&&(r=An.relative(s,r));var o=new sQ,a=new sQ;this._mappings.unsortedForEach(function(A){if(A.source===r&&A.originalLine!=null){var c=e.originalPositionFor({line:A.originalLine,column:A.originalColumn});c.source!=null&&(A.source=c.source,n!=null&&(A.source=An.join(n,A.source)),s!=null&&(A.source=An.relative(s,A.source)),A.originalLine=c.line,A.originalColumn=c.column,c.name!=null&&(A.name=c.name))}var u=A.source;u!=null&&!o.has(u)&&o.add(u);var l=A.name;l!=null&&!a.has(l)&&a.add(l)},this),this._sources=o,this._names=a,e.sources.forEach(function(A){var c=e.sourceContentFor(A);c!=null&&(n!=null&&(A=An.join(n,A)),s!=null&&(A=An.relative(s,A)),this.setSourceContent(A,c))},this)};uo.prototype._validateMapping=function(e,i,n,r){if(i&&typeof i.line!="number"&&typeof i.column!="number"){var s="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!i&&!n&&!r)){if(e&&"line"in e&&"column"in e&&i&&"line"in i&&"column"in i&&e.line>0&&e.column>=0&&i.line>0&&i.column>=0&&n)return;var s="Invalid mapping: "+JSON.stringify({generated:e,source:n,original:i,name:r});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}};uo.prototype._serializeMappings=function(){for(var e=0,i=1,n=0,r=0,s=0,o=0,a="",A,c,u,l,p=this._mappings.toArray(),d=0,g=p.length;d<g;d++){if(c=p[d],A="",c.generatedLine!==i)for(e=0;c.generatedLine!==i;)A+=";",i++;else if(d>0){if(!An.compareByGeneratedPositionsInflated(c,p[d-1]))continue;A+=","}A+=lh.encode(c.generatedColumn-e),e=c.generatedColumn,c.source!=null&&(l=this._sources.indexOf(c.source),A+=lh.encode(l-o),o=l,A+=lh.encode(c.originalLine-1-r),r=c.originalLine-1,A+=lh.encode(c.originalColumn-n),n=c.originalColumn,c.name!=null&&(u=this._names.indexOf(c.name),A+=lh.encode(u-s),s=u)),a+=A}return a};uo.prototype._generateSourcesContent=function(e,i){return e.map(function(n){if(!this._sourcesContents)return null;i!=null&&(n=An.relative(i,n));var r=An.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)};uo.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};uo.prototype.toString=function(){return JSON.stringify(this.toJSON())};QY.SourceMapGenerator=uo});var yY=b(vl=>{f();vl.GREATEST_LOWER_BOUND=1;vl.LEAST_UPPER_BOUND=2;function EF(t,e,i,n,r,s){var o=Math.floor((e-t)/2)+t,a=r(i,n[o],!0);return a===0?o:a>0?e-o>1?EF(o,e,i,n,r,s):s==vl.LEAST_UPPER_BOUND?e<n.length?e:-1:o:o-t>1?EF(t,o,i,n,r,s):s==vl.LEAST_UPPER_BOUND?o:t<0?-1:t}vl.search=function(e,i,n,r){if(i.length===0)return-1;var s=EF(-1,i.length,e,i,n,r||vl.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(i[s],i[s-1],!0)===0;)--s;return s}});var vY=b(xY=>{f();function Kke(t){function e(r,s,o){var a=r[s];r[s]=r[o],r[o]=a}function i(r,s){return Math.round(r+Math.random()*(s-r))}function n(r,s,o,a){if(o<a){var A=i(o,a),c=o-1;e(r,A,a);for(var u=r[a],l=o;l<a;l++)s(r[l],u,!1)<=0&&(c+=1,e(r,c,l));e(r,c+1,l);var p=c+1;n(r,s,o,p-1),n(r,s,p+1,a)}}return n}function Hke(t){let e=Kke.toString();return new Function(`return ${e}`)()(t)}var DY=new WeakMap;xY.quickSort=function(t,e,i=0){let n=DY.get(e);n===void 0&&(n=Hke(e),DY.set(e,n)),n(t,e,i,t.length-1)}});var SY=b(oQ=>{f();var Te=Sg(),QF=yY(),Fg=CF().ArraySet,Jke=dF(),ph=vY().quickSort;function xi(t,e){var i=t;return typeof t=="string"&&(i=Te.parseSourceMapInput(t)),i.sections!=null?new Xo(i,e):new ir(i,e)}xi.fromSourceMap=function(t,e){return ir.fromSourceMap(t,e)};xi.prototype._version=3;xi.prototype.__generatedMappings=null;Object.defineProperty(xi.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});xi.prototype.__originalMappings=null;Object.defineProperty(xi.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});xi.prototype._charIsMappingSeparator=function(e,i){var n=e.charAt(i);return n===";"||n===","};xi.prototype._parseMappings=function(e,i){throw new Error("Subclasses must implement _parseMappings")};xi.GENERATED_ORDER=1;xi.ORIGINAL_ORDER=2;xi.GREATEST_LOWER_BOUND=1;xi.LEAST_UPPER_BOUND=2;xi.prototype.eachMapping=function(e,i,n){var r=i||null,s=n||xi.GENERATED_ORDER,o;switch(s){case xi.GENERATED_ORDER:o=this._generatedMappings;break;case xi.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var a=this.sourceRoot,A=e.bind(r),c=this._names,u=this._sources,l=this._sourceMapURL,p=0,d=o.length;p<d;p++){var g=o[p],m=g.source===null?null:u.at(g.source);m!==null&&(m=Te.computeSourceURL(a,m,l)),A({source:m,generatedLine:g.generatedLine,generatedColumn:g.generatedColumn,originalLine:g.originalLine,originalColumn:g.originalColumn,name:g.name===null?null:c.at(g.name)})}};xi.prototype.allGeneratedPositionsFor=function(e){var i=Te.getArg(e,"line"),n={source:Te.getArg(e,"source"),originalLine:i,originalColumn:Te.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var r=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Te.compareByOriginalPositions,QF.LEAST_UPPER_BOUND);if(s>=0){var o=this._originalMappings[s];if(e.column===void 0)for(var a=o.originalLine;o&&o.originalLine===a;)r.push({line:Te.getArg(o,"generatedLine",null),column:Te.getArg(o,"generatedColumn",null),lastColumn:Te.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s];else for(var A=o.originalColumn;o&&o.originalLine===i&&o.originalColumn==A;)r.push({line:Te.getArg(o,"generatedLine",null),column:Te.getArg(o,"generatedColumn",null),lastColumn:Te.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return r};oQ.SourceMapConsumer=xi;function ir(t,e){var i=t;typeof t=="string"&&(i=Te.parseSourceMapInput(t));var n=Te.getArg(i,"version"),r=Te.getArg(i,"sources"),s=Te.getArg(i,"names",[]),o=Te.getArg(i,"sourceRoot",null),a=Te.getArg(i,"sourcesContent",null),A=Te.getArg(i,"mappings"),c=Te.getArg(i,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=Te.normalize(o)),r=r.map(String).map(Te.normalize).map(function(u){return o&&Te.isAbsolute(o)&&Te.isAbsolute(u)?Te.relative(o,u):u}),this._names=Fg.fromArray(s.map(String),!0),this._sources=Fg.fromArray(r,!0),this._absoluteSources=this._sources.toArray().map(function(u){return Te.computeSourceURL(o,u,e)}),this.sourceRoot=o,this.sourcesContent=a,this._mappings=A,this._sourceMapURL=e,this.file=c}ir.prototype=Object.create(xi.prototype);ir.prototype.consumer=xi;ir.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Te.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var i;for(i=0;i<this._absoluteSources.length;++i)if(this._absoluteSources[i]==t)return i;return-1};ir.fromSourceMap=function(e,i){var n=Object.create(ir.prototype),r=n._names=Fg.fromArray(e._names.toArray(),!0),s=n._sources=Fg.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=i,n._absoluteSources=n._sources.toArray().map(function(d){return Te.computeSourceURL(n.sourceRoot,d,i)});for(var o=e._mappings.toArray().slice(),a=n.__generatedMappings=[],A=n.__originalMappings=[],c=0,u=o.length;c<u;c++){var l=o[c],p=new bY;p.generatedLine=l.generatedLine,p.generatedColumn=l.generatedColumn,l.source&&(p.source=s.indexOf(l.source),p.originalLine=l.originalLine,p.originalColumn=l.originalColumn,l.name&&(p.name=r.indexOf(l.name)),A.push(p)),a.push(p)}return ph(n.__originalMappings,Te.compareByOriginalPositions),n};ir.prototype._version=3;Object.defineProperty(ir.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function bY(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var BF=Te.compareByGeneratedPositionsDeflatedNoLine;function wY(t,e){let i=t.length,n=t.length-e;if(!(n<=1))if(n==2){let r=t[e],s=t[e+1];BF(r,s)>0&&(t[e]=s,t[e+1]=r)}else if(n<20)for(let r=e;r<i;r++)for(let s=r;s>e;s--){let o=t[s-1],a=t[s];if(BF(o,a)<=0)break;t[s-1]=a,t[s]=o}else ph(t,BF,e)}ir.prototype._parseMappings=function(e,i){var n=1,r=0,s=0,o=0,a=0,A=0,c=e.length,u=0,l={},p={},d=[],g=[],m,h,C,I,B;let E=0;for(;u<c;)if(e.charAt(u)===";")n++,u++,r=0,wY(g,E),E=g.length;else if(e.charAt(u)===",")u++;else{for(m=new bY,m.generatedLine=n,I=u;I<c&&!this._charIsMappingSeparator(e,I);I++);for(h=e.slice(u,I),C=[];u<I;)Jke.decode(e,u,p),B=p.value,u=p.rest,C.push(B);if(C.length===2)throw new Error("Found a source, but no line and column");if(C.length===3)throw new Error("Found a source and line, but no column");if(m.generatedColumn=r+C[0],r=m.generatedColumn,C.length>1&&(m.source=a+C[1],a+=C[1],m.originalLine=s+C[2],s=m.originalLine,m.originalLine+=1,m.originalColumn=o+C[3],o=m.originalColumn,C.length>4&&(m.name=A+C[4],A+=C[4])),g.push(m),typeof m.originalLine=="number"){let D=m.source;for(;d.length<=D;)d.push(null);d[D]===null&&(d[D]=[]),d[D].push(m)}}wY(g,E),this.__generatedMappings=g;for(var Q=0;Q<d.length;Q++)d[Q]!=null&&ph(d[Q],Te.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...d)};ir.prototype._findMapping=function(e,i,n,r,s,o){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return QF.search(e,i,s,o)};ir.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var i=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(i.generatedLine===n.generatedLine){i.lastGeneratedColumn=n.generatedColumn-1;continue}}i.lastGeneratedColumn=1/0}};ir.prototype.originalPositionFor=function(e){var i={generatedLine:Te.getArg(e,"line"),generatedColumn:Te.getArg(e,"column")},n=this._findMapping(i,this._generatedMappings,"generatedLine","generatedColumn",Te.compareByGeneratedPositionsDeflated,Te.getArg(e,"bias",xi.GREATEST_LOWER_BOUND));if(n>=0){var r=this._generatedMappings[n];if(r.generatedLine===i.generatedLine){var s=Te.getArg(r,"source",null);s!==null&&(s=this._sources.at(s),s=Te.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=Te.getArg(r,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:Te.getArg(r,"originalLine",null),column:Te.getArg(r,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};ir.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};ir.prototype.sourceContentFor=function(e,i){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var r=e;this.sourceRoot!=null&&(r=Te.relative(this.sourceRoot,r));var s;if(this.sourceRoot!=null&&(s=Te.urlParse(this.sourceRoot))){var o=r.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!s.path||s.path=="/")&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(i)return null;throw new Error('"'+r+'" is not in the SourceMap.')};ir.prototype.generatedPositionFor=function(e){var i=Te.getArg(e,"source");if(i=this._findSourceIndex(i),i<0)return{line:null,column:null,lastColumn:null};var n={source:i,originalLine:Te.getArg(e,"line"),originalColumn:Te.getArg(e,"column")},r=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Te.compareByOriginalPositions,Te.getArg(e,"bias",xi.GREATEST_LOWER_BOUND));if(r>=0){var s=this._originalMappings[r];if(s.source===n.source)return{line:Te.getArg(s,"generatedLine",null),column:Te.getArg(s,"generatedColumn",null),lastColumn:Te.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};oQ.BasicSourceMapConsumer=ir;function Xo(t,e){var i=t;typeof t=="string"&&(i=Te.parseSourceMapInput(t));var n=Te.getArg(i,"version"),r=Te.getArg(i,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Fg,this._names=new Fg;var s={line:-1,column:0};this._sections=r.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var a=Te.getArg(o,"offset"),A=Te.getArg(a,"line"),c=Te.getArg(a,"column");if(A<s.line||A===s.line&&c<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=a,{generatedOffset:{generatedLine:A+1,generatedColumn:c+1},consumer:new xi(Te.getArg(o,"map"),e)}})}Xo.prototype=Object.create(xi.prototype);Xo.prototype.constructor=xi;Xo.prototype._version=3;Object.defineProperty(Xo.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var i=0;i<this._sections[e].consumer.sources.length;i++)t.push(this._sections[e].consumer.sources[i]);return t}});Xo.prototype.originalPositionFor=function(e){var i={generatedLine:Te.getArg(e,"line"),generatedColumn:Te.getArg(e,"column")},n=QF.search(i,this._sections,function(s,o){var a=s.generatedLine-o.generatedOffset.generatedLine;return a||s.generatedColumn-o.generatedOffset.generatedColumn}),r=this._sections[n];return r?r.consumer.originalPositionFor({line:i.generatedLine-(r.generatedOffset.generatedLine-1),column:i.generatedColumn-(r.generatedOffset.generatedLine===i.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};Xo.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};Xo.prototype.sourceContentFor=function(e,i){for(var n=0;n<this._sections.length;n++){var r=this._sections[n],s=r.consumer.sourceContentFor(e,!0);if(s||s==="")return s}if(i)return null;throw new Error('"'+e+'" is not in the SourceMap.')};Xo.prototype.generatedPositionFor=function(e){for(var i=0;i<this._sections.length;i++){var n=this._sections[i];if(n.consumer._findSourceIndex(Te.getArg(e,"source"))!==-1){var r=n.consumer.generatedPositionFor(e);if(r){var s={line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};Xo.prototype._parseMappings=function(e,i){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var r=this._sections[n],s=r.consumer._generatedMappings,o=0;o<s.length;o++){var a=s[o],A=r.consumer._sources.at(a.source);A!==null&&(A=Te.computeSourceURL(r.consumer.sourceRoot,A,this._sourceMapURL)),this._sources.add(A),A=this._sources.indexOf(A);var c=null;a.name&&(c=r.consumer._names.at(a.name),this._names.add(c),c=this._names.indexOf(c));var u={source:A,generatedLine:a.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(r.generatedOffset.generatedLine===a.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:c};this.__generatedMappings.push(u),typeof u.originalLine=="number"&&this.__originalMappings.push(u)}ph(this.__generatedMappings,Te.compareByGeneratedPositionsDeflated),ph(this.__originalMappings,Te.compareByOriginalPositions)};oQ.IndexedSourceMapConsumer=Xo});var kY=b(FY=>{f();var jke=IF().SourceMapGenerator,aQ=Sg(),Yke=/(\r?\n)/,qke=10,kg="$$$isSourceNode$$$";function _s(t,e,i,n,r){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=i??null,this.name=r??null,this[kg]=!0,n!=null&&this.add(n)}_s.fromStringWithSourceMap=function(e,i,n){var r=new _s,s=e.split(Yke),o=0,a=function(){var p=g(),d=g()||"";return p+d;function g(){return o<s.length?s[o++]:void 0}},A=1,c=0,u=null;return i.eachMapping(function(p){if(u!==null)if(A<p.generatedLine)l(u,a()),A++,c=0;else{var d=s[o]||"",g=d.substr(0,p.generatedColumn-c);s[o]=d.substr(p.generatedColumn-c),c=p.generatedColumn,l(u,g),u=p;return}for(;A<p.generatedLine;)r.add(a()),A++;if(c<p.generatedColumn){var d=s[o]||"";r.add(d.substr(0,p.generatedColumn)),s[o]=d.substr(p.generatedColumn),c=p.generatedColumn}u=p},this),o<s.length&&(u&&l(u,a()),r.add(s.splice(o).join(""))),i.sources.forEach(function(p){var d=i.sourceContentFor(p);d!=null&&(n!=null&&(p=aQ.join(n,p)),r.setSourceContent(p,d))}),r;function l(p,d){if(p===null||p.source===void 0)r.add(d);else{var g=n?aQ.join(n,p.source):p.source;r.add(new _s(p.originalLine,p.originalColumn,g,d,p.name))}}};_s.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(i){this.add(i)},this);else if(e[kg]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};_s.prototype.prepend=function(e){if(Array.isArray(e))for(var i=e.length-1;i>=0;i--)this.prepend(e[i]);else if(e[kg]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};_s.prototype.walk=function(e){for(var i,n=0,r=this.children.length;n<r;n++)i=this.children[n],i[kg]?i.walk(e):i!==""&&e(i,{source:this.source,line:this.line,column:this.column,name:this.name})};_s.prototype.join=function(e){var i,n,r=this.children.length;if(r>0){for(i=[],n=0;n<r-1;n++)i.push(this.children[n]),i.push(e);i.push(this.children[n]),this.children=i}return this};_s.prototype.replaceRight=function(e,i){var n=this.children[this.children.length-1];return n[kg]?n.replaceRight(e,i):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,i):this.children.push("".replace(e,i)),this};_s.prototype.setSourceContent=function(e,i){this.sourceContents[aQ.toSetString(e)]=i};_s.prototype.walkSourceContents=function(e){for(var i=0,n=this.children.length;i<n;i++)this.children[i][kg]&&this.children[i].walkSourceContents(e);for(var r=Object.keys(this.sourceContents),i=0,n=r.length;i<n;i++)e(aQ.fromSetString(r[i]),this.sourceContents[r[i]])};_s.prototype.toString=function(){var e="";return this.walk(function(i){e+=i}),e};_s.prototype.toStringWithSourceMap=function(e){var i={code:"",line:1,column:0},n=new jke(e),r=!1,s=null,o=null,a=null,A=null;return this.walk(function(c,u){i.code+=c,u.source!==null&&u.line!==null&&u.column!==null?((s!==u.source||o!==u.line||a!==u.column||A!==u.name)&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:i.line,column:i.column},name:u.name}),s=u.source,o=u.line,a=u.column,A=u.name,r=!0):r&&(n.addMapping({generated:{line:i.line,column:i.column}}),s=null,r=!1);for(var l=0,p=c.length;l<p;l++)c.charCodeAt(l)===qke?(i.line++,i.column=0,l+1===p?(s=null,r=!1):r&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:i.line,column:i.column},name:u.name})):i.column++}),this.walkSourceContents(function(c,u){n.setSourceContent(c,u)}),{code:i.code,map:n}};FY.SourceNode=_s});var RY=b(AQ=>{f();AQ.SourceMapGenerator=IF().SourceMapGenerator;AQ.SourceMapConsumer=SY().SourceMapConsumer;AQ.SourceNode=kY().SourceNode});var c5=b(Qh=>{"use strict";f();Object.defineProperty(Qh,"__esModule",{value:!0});function $ke(t,e){if(t==null)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;i[n]=t[n]}return i}var ja=class{constructor(e,i,n){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=i,this.index=n}},Pg=class{constructor(e,i){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=i}};function $r(t,e){let{line:i,column:n,index:r}=t;return new ja(i,n+e,r+e)}var NY="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",zke={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:NY},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:NY}},TY={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},lQ=t=>t.type==="UpdateExpression"?TY.UpdateExpression[`${t.prefix}`]:TY[t.type],Vke={AccessorIsGenerator:({kind:t})=>`A ${t}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:t})=>`Missing initializer in ${t} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:t})=>`'import.${t}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
1110
1110
|
- Did you mean \`export { '${t}' as '${e}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:t})=>`'${t==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:t})=>`Unsyntactic ${t==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.",ImportBindingIsString:({importName:t})=>`A string literal cannot be used as an imported binding.
|
|
1111
1111
|
- Did you mean \`import { "${t}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:t})=>`\`import()\` requires exactly ${t===1?"one argument":"one or two arguments"}.`,ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:t})=>`Expected number in radix ${t}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:t})=>`Escape sequence in keyword ${t}.`,InvalidIdentifier:({identifierName:t})=>`Invalid identifier ${t}.`,InvalidLhs:({ancestor:t})=>`Invalid left-hand side in ${lQ(t)}.`,InvalidLhsBinding:({ancestor:t})=>`Binding invalid left-hand side in ${lQ(t)}.`,InvalidLhsOptionalChaining:({ancestor:t})=>`Invalid optional chaining in the left-hand side of ${lQ(t)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:t})=>`Unexpected character '${t}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:t})=>`Private name #${t} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:t})=>`Label '${t}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:t})=>`This experimental syntax requires enabling the parser plugin: ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:t})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:t})=>`Duplicate key "${t}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:t})=>`An export name cannot include a lone surrogate, found '\\u${t.toString(16)}'.`,ModuleExportUndefined:({localName:t})=>`Export '${t}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:t})=>`Private names are only allowed in property accesses (\`obj.#${t}\`) or in \`in\` expressions (\`#${t} in obj\`).`,PrivateNameRedeclaration:({identifierName:t})=>`Duplicate private name #${t}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:t})=>`Unexpected keyword '${t}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:t})=>`Unexpected reserved word '${t}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:t,unexpected:e})=>`Unexpected token${e?` '${e}'.`:""}${t?`, expected "${t}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:t,onlyValidPropertyName:e})=>`The only valid meta property for ${t} is ${t}.${e}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:t})=>`Identifier '${t}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},Wke={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:t})=>`Assigning to '${t}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:t})=>`Binding '${t}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Zke=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Xke={PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:t})=>`Invalid topic token ${t}. In order to use ${t} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${t}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:t})=>`Hack-style pipe body cannot be an unparenthesized ${lQ({type:t})}; please wrap it in parentheses.`,PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'},eRe=["message"];function MY(t,e,i){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,value:i})}function tRe({toMessage:t,code:e,reasonCode:i,syntaxPlugin:n}){let r=i==="MissingPlugin"||i==="MissingOneOfPlugins";{let s={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};s[i]&&(i=s[i])}return function s(o,a){let A=new SyntaxError;return A.code=e,A.reasonCode=i,A.loc=o,A.pos=o.index,A.syntaxPlugin=n,r&&(A.missingPlugin=a.missingPlugin),MY(A,"clone",function(u={}){var l;let{line:p,column:d,index:g}=(l=u.loc)!=null?l:o;return s(new ja(p,d,g),Object.assign({},a,u.details))}),MY(A,"details",a),Object.defineProperty(A,"message",{configurable:!0,get(){let c=`${t(a)} (${o.line}:${o.column})`;return this.message=c,c},set(c){Object.defineProperty(this,"message",{value:c,writable:!0})}}),A}}function KA(t,e){if(Array.isArray(t))return n=>KA(n,t[0]);let i={};for(let n of Object.keys(t)){let r=t[n],s=typeof r=="string"?{message:()=>r}:typeof r=="function"?{message:r}:r,{message:o}=s,a=$ke(s,eRe),A=typeof o=="string"?()=>o:o;i[n]=tRe(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:n,toMessage:A},e?{syntaxPlugin:e}:{},a))}return i}var q=Object.assign({},KA(zke),KA(Vke),KA(Wke),KA`pipelineOperator`(Xke)),{defineProperty:iRe}=Object,PY=(t,e)=>{t&&iRe(t,e,{enumerable:!1,value:t[e]})};function gh(t){return PY(t.loc.start,"index"),PY(t.loc.end,"index"),t}var nRe=t=>class extends t{parse(){let i=gh(super.parse());return this.options.tokens&&(i.tokens=i.tokens.map(gh)),i}parseRegExpLiteral({pattern:i,flags:n}){let r=null;try{r=new RegExp(i,n)}catch{}let s=this.estreeParseLiteral(r);return s.regex={pattern:i,flags:n},s}parseBigIntLiteral(i){let n;try{n=BigInt(i)}catch{n=null}let r=this.estreeParseLiteral(n);return r.bigint=String(r.value||i),r}parseDecimalLiteral(i){let r=this.estreeParseLiteral(null);return r.decimal=String(r.value||i),r}estreeParseLiteral(i){return this.parseLiteral(i,"Literal")}parseStringLiteral(i){return this.estreeParseLiteral(i)}parseNumericLiteral(i){return this.estreeParseLiteral(i)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(i){return this.estreeParseLiteral(i)}directiveToStmt(i){let n=i.value;delete i.value,n.type="Literal",n.raw=n.extra.raw,n.value=n.extra.expressionValue;let r=i;return r.type="ExpressionStatement",r.expression=n,r.directive=n.extra.rawValue,delete n.extra,r}initFunction(i,n){super.initFunction(i,n),i.expression=!1}checkDeclaration(i){i!=null&&this.isObjectProperty(i)?this.checkDeclaration(i.value):super.checkDeclaration(i)}getObjectOrClassMethodParams(i){return i.value.params}isValidDirective(i){var n;return i.type==="ExpressionStatement"&&i.expression.type==="Literal"&&typeof i.expression.value=="string"&&!((n=i.expression.extra)!=null&&n.parenthesized)}parseBlockBody(i,n,r,s,o){super.parseBlockBody(i,n,r,s,o);let a=i.directives.map(A=>this.directiveToStmt(A));i.body=a.concat(i.body),delete i.directives}pushClassMethod(i,n,r,s,o,a){this.parseMethod(n,r,s,o,a,"ClassMethod",!0),n.typeParameters&&(n.value.typeParameters=n.typeParameters,delete n.typeParameters),i.body.push(n)}parsePrivateName(){let i=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(i):i}convertPrivateNameToPrivateIdentifier(i){let n=super.getPrivateNameSV(i);return i=i,delete i.id,i.name=n,i.type="PrivateIdentifier",i}isPrivateName(i){return this.getPluginOption("estree","classFeatures")?i.type==="PrivateIdentifier":super.isPrivateName(i)}getPrivateNameSV(i){return this.getPluginOption("estree","classFeatures")?i.name:super.getPrivateNameSV(i)}parseLiteral(i,n){let r=super.parseLiteral(i,n);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(i,n,r=!1){super.parseFunctionBody(i,n,r),i.expression=i.body.type!=="BlockStatement"}parseMethod(i,n,r,s,o,a,A=!1){let c=this.startNode();return c.kind=i.kind,c=super.parseMethod(c,n,r,s,o,a,A),c.type="FunctionExpression",delete c.kind,i.value=c,a==="ClassPrivateMethod"&&(i.computed=!1),this.finishNode(i,"MethodDefinition")}nameIsConstructor(i){return i.type==="Literal"?i.value==="constructor":super.nameIsConstructor(i)}parseClassProperty(...i){let n=super.parseClassProperty(...i);return this.getPluginOption("estree","classFeatures")&&(n.type="PropertyDefinition"),n}parseClassPrivateProperty(...i){let n=super.parseClassPrivateProperty(...i);return this.getPluginOption("estree","classFeatures")&&(n.type="PropertyDefinition",n.computed=!1),n}parseObjectMethod(i,n,r,s,o){let a=super.parseObjectMethod(i,n,r,s,o);return a&&(a.type="Property",a.kind==="method"&&(a.kind="init"),a.shorthand=!1),a}parseObjectProperty(i,n,r,s){let o=super.parseObjectProperty(i,n,r,s);return o&&(o.kind="init",o.type="Property"),o}isValidLVal(i,n,r){return i==="Property"?"value":super.isValidLVal(i,n,r)}isAssignable(i,n){return i!=null&&this.isObjectProperty(i)?this.isAssignable(i.value,n):super.isAssignable(i,n)}toAssignable(i,n=!1){if(i!=null&&this.isObjectProperty(i)){let{key:r,value:s}=i;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(s,n)}else super.toAssignable(i,n)}toAssignableObjectExpressionProp(i,n,r){i.type==="Property"&&(i.kind==="get"||i.kind==="set")?this.raise(q.PatternHasAccessor,i.key):i.type==="Property"&&i.method?this.raise(q.PatternHasMethod,i.key):super.toAssignableObjectExpressionProp(i,n,r)}finishCallExpression(i,n){let r=super.finishCallExpression(i,n);if(r.callee.type==="Import"){if(r.type="ImportExpression",r.source=r.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var s,o;r.options=(s=r.arguments[1])!=null?s:null,r.attributes=(o=r.arguments[1])!=null?o:null}delete r.arguments,delete r.callee}return r}toReferencedArguments(i){i.type!=="ImportExpression"&&super.toReferencedArguments(i)}parseExport(i,n){let r=this.state.lastTokStartLoc,s=super.parseExport(i,n);switch(s.type){case"ExportAllDeclaration":s.exported=null;break;case"ExportNamedDeclaration":s.specifiers.length===1&&s.specifiers[0].type==="ExportNamespaceSpecifier"&&(s.type="ExportAllDeclaration",s.exported=s.specifiers[0].exported,delete s.specifiers);case"ExportDefaultDeclaration":{var o;let{declaration:a}=s;a?.type==="ClassDeclaration"&&((o=a.decorators)==null?void 0:o.length)>0&&a.start===s.start&&this.resetStartLocation(s,r)}break}return s}parseSubscript(i,n,r,s){let o=super.parseSubscript(i,n,r,s);if(s.optionalChainMember){if((o.type==="OptionalMemberExpression"||o.type==="OptionalCallExpression")&&(o.type=o.type.substring(8)),s.stop){let a=this.startNodeAtNode(o);return a.expression=o,this.finishNode(a,"ChainExpression")}}else(o.type==="MemberExpression"||o.type==="CallExpression")&&(o.optional=!1);return o}isOptionalMemberExpression(i){return i.type==="ChainExpression"?i.expression.type==="MemberExpression":super.isOptionalMemberExpression(i)}hasPropertyAsPrivateName(i){return i.type==="ChainExpression"&&(i=i.expression),super.hasPropertyAsPrivateName(i)}isObjectProperty(i){return i.type==="Property"&&i.kind==="init"&&!i.method}isObjectMethod(i){return i.type==="Property"&&(i.method||i.kind==="get"||i.kind==="set")}finishNodeAt(i,n,r){return gh(super.finishNodeAt(i,n,r))}resetStartLocation(i,n){super.resetStartLocation(i,n),gh(i)}resetEndLocation(i,n=this.state.lastTokEndLoc){super.resetEndLocation(i,n),gh(i)}},bl=class{constructor(e,i){this.token=void 0,this.preserveSpace=void 0,this.token=e,this.preserveSpace=!!i}},ni={brace:new bl("{"),j_oTag:new bl("<tag"),j_cTag:new bl("</tag"),j_expr:new bl("<tag>...</tag>",!0)};ni.template=new bl("`",!0);var Et=!0,ve=!0,yF=!0,dh=!0,jc=!0,rRe=!0,dQ=class{constructor(e,i={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=e,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.rightAssociative=!!i.rightAssociative,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop!=null?i.binop:null,this.updateContext=null}},zF=new Map;function Mt(t,e={}){e.keyword=t;let i=Oe(t,e);return zF.set(t,i),i}function qr(t,e){return Oe(t,{beforeExpr:Et,binop:e})}var Ch=-1,GA=[],VF=[],WF=[],ZF=[],XF=[],ek=[];function Oe(t,e={}){var i,n,r,s;return++Ch,VF.push(t),WF.push((i=e.binop)!=null?i:-1),ZF.push((n=e.beforeExpr)!=null?n:!1),XF.push((r=e.startsExpr)!=null?r:!1),ek.push((s=e.prefix)!=null?s:!1),GA.push(new dQ(t,e)),Ch}function It(t,e={}){var i,n,r,s;return++Ch,zF.set(t,Ch),VF.push(t),WF.push((i=e.binop)!=null?i:-1),ZF.push((n=e.beforeExpr)!=null?n:!1),XF.push((r=e.startsExpr)!=null?r:!1),ek.push((s=e.prefix)!=null?s:!1),GA.push(new dQ("name",e)),Ch}var sRe={bracketL:Oe("[",{beforeExpr:Et,startsExpr:ve}),bracketHashL:Oe("#[",{beforeExpr:Et,startsExpr:ve}),bracketBarL:Oe("[|",{beforeExpr:Et,startsExpr:ve}),bracketR:Oe("]"),bracketBarR:Oe("|]"),braceL:Oe("{",{beforeExpr:Et,startsExpr:ve}),braceBarL:Oe("{|",{beforeExpr:Et,startsExpr:ve}),braceHashL:Oe("#{",{beforeExpr:Et,startsExpr:ve}),braceR:Oe("}"),braceBarR:Oe("|}"),parenL:Oe("(",{beforeExpr:Et,startsExpr:ve}),parenR:Oe(")"),comma:Oe(",",{beforeExpr:Et}),semi:Oe(";",{beforeExpr:Et}),colon:Oe(":",{beforeExpr:Et}),doubleColon:Oe("::",{beforeExpr:Et}),dot:Oe("."),question:Oe("?",{beforeExpr:Et}),questionDot:Oe("?."),arrow:Oe("=>",{beforeExpr:Et}),template:Oe("template"),ellipsis:Oe("...",{beforeExpr:Et}),backQuote:Oe("`",{startsExpr:ve}),dollarBraceL:Oe("${",{beforeExpr:Et,startsExpr:ve}),templateTail:Oe("...`",{startsExpr:ve}),templateNonTail:Oe("...${",{beforeExpr:Et,startsExpr:ve}),at:Oe("@"),hash:Oe("#",{startsExpr:ve}),interpreterDirective:Oe("#!..."),eq:Oe("=",{beforeExpr:Et,isAssign:dh}),assign:Oe("_=",{beforeExpr:Et,isAssign:dh}),slashAssign:Oe("_=",{beforeExpr:Et,isAssign:dh}),xorAssign:Oe("_=",{beforeExpr:Et,isAssign:dh}),moduloAssign:Oe("_=",{beforeExpr:Et,isAssign:dh}),incDec:Oe("++/--",{prefix:jc,postfix:rRe,startsExpr:ve}),bang:Oe("!",{beforeExpr:Et,prefix:jc,startsExpr:ve}),tilde:Oe("~",{beforeExpr:Et,prefix:jc,startsExpr:ve}),doubleCaret:Oe("^^",{startsExpr:ve}),doubleAt:Oe("@@",{startsExpr:ve}),pipeline:qr("|>",0),nullishCoalescing:qr("??",1),logicalOR:qr("||",1),logicalAND:qr("&&",2),bitwiseOR:qr("|",3),bitwiseXOR:qr("^",4),bitwiseAND:qr("&",5),equality:qr("==/!=/===/!==",6),lt:qr("</>/<=/>=",7),gt:qr("</>/<=/>=",7),relational:qr("</>/<=/>=",7),bitShift:qr("<</>>/>>>",8),bitShiftL:qr("<</>>/>>>",8),bitShiftR:qr("<</>>/>>>",8),plusMin:Oe("+/-",{beforeExpr:Et,binop:9,prefix:jc,startsExpr:ve}),modulo:Oe("%",{binop:10,startsExpr:ve}),star:Oe("*",{binop:10}),slash:qr("/",10),exponent:Oe("**",{beforeExpr:Et,binop:11,rightAssociative:!0}),_in:Mt("in",{beforeExpr:Et,binop:7}),_instanceof:Mt("instanceof",{beforeExpr:Et,binop:7}),_break:Mt("break"),_case:Mt("case",{beforeExpr:Et}),_catch:Mt("catch"),_continue:Mt("continue"),_debugger:Mt("debugger"),_default:Mt("default",{beforeExpr:Et}),_else:Mt("else",{beforeExpr:Et}),_finally:Mt("finally"),_function:Mt("function",{startsExpr:ve}),_if:Mt("if"),_return:Mt("return",{beforeExpr:Et}),_switch:Mt("switch"),_throw:Mt("throw",{beforeExpr:Et,prefix:jc,startsExpr:ve}),_try:Mt("try"),_var:Mt("var"),_const:Mt("const"),_with:Mt("with"),_new:Mt("new",{beforeExpr:Et,startsExpr:ve}),_this:Mt("this",{startsExpr:ve}),_super:Mt("super",{startsExpr:ve}),_class:Mt("class",{startsExpr:ve}),_extends:Mt("extends",{beforeExpr:Et}),_export:Mt("export"),_import:Mt("import",{startsExpr:ve}),_null:Mt("null",{startsExpr:ve}),_true:Mt("true",{startsExpr:ve}),_false:Mt("false",{startsExpr:ve}),_typeof:Mt("typeof",{beforeExpr:Et,prefix:jc,startsExpr:ve}),_void:Mt("void",{beforeExpr:Et,prefix:jc,startsExpr:ve}),_delete:Mt("delete",{beforeExpr:Et,prefix:jc,startsExpr:ve}),_do:Mt("do",{isLoop:yF,beforeExpr:Et}),_for:Mt("for",{isLoop:yF}),_while:Mt("while",{isLoop:yF}),_as:It("as",{startsExpr:ve}),_assert:It("assert",{startsExpr:ve}),_async:It("async",{startsExpr:ve}),_await:It("await",{startsExpr:ve}),_defer:It("defer",{startsExpr:ve}),_from:It("from",{startsExpr:ve}),_get:It("get",{startsExpr:ve}),_let:It("let",{startsExpr:ve}),_meta:It("meta",{startsExpr:ve}),_of:It("of",{startsExpr:ve}),_sent:It("sent",{startsExpr:ve}),_set:It("set",{startsExpr:ve}),_source:It("source",{startsExpr:ve}),_static:It("static",{startsExpr:ve}),_using:It("using",{startsExpr:ve}),_yield:It("yield",{startsExpr:ve}),_asserts:It("asserts",{startsExpr:ve}),_checks:It("checks",{startsExpr:ve}),_exports:It("exports",{startsExpr:ve}),_global:It("global",{startsExpr:ve}),_implements:It("implements",{startsExpr:ve}),_intrinsic:It("intrinsic",{startsExpr:ve}),_infer:It("infer",{startsExpr:ve}),_is:It("is",{startsExpr:ve}),_mixins:It("mixins",{startsExpr:ve}),_proto:It("proto",{startsExpr:ve}),_require:It("require",{startsExpr:ve}),_satisfies:It("satisfies",{startsExpr:ve}),_keyof:It("keyof",{startsExpr:ve}),_readonly:It("readonly",{startsExpr:ve}),_unique:It("unique",{startsExpr:ve}),_abstract:It("abstract",{startsExpr:ve}),_declare:It("declare",{startsExpr:ve}),_enum:It("enum",{startsExpr:ve}),_module:It("module",{startsExpr:ve}),_namespace:It("namespace",{startsExpr:ve}),_interface:It("interface",{startsExpr:ve}),_type:It("type",{startsExpr:ve}),_opaque:It("opaque",{startsExpr:ve}),name:Oe("name",{startsExpr:ve}),string:Oe("string",{startsExpr:ve}),num:Oe("num",{startsExpr:ve}),bigint:Oe("bigint",{startsExpr:ve}),decimal:Oe("decimal",{startsExpr:ve}),regexp:Oe("regexp",{startsExpr:ve}),privateName:Oe("#name",{startsExpr:ve}),eof:Oe("eof"),jsxName:Oe("jsxName"),jsxText:Oe("jsxText",{beforeExpr:!0}),jsxTagStart:Oe("jsxTagStart",{startsExpr:!0}),jsxTagEnd:Oe("jsxTagEnd"),placeholder:Oe("%%",{startsExpr:!0})};function qt(t){return t>=93&&t<=132}function oRe(t){return t<=92}function ea(t){return t>=58&&t<=132}function $Y(t){return t>=58&&t<=136}function aRe(t){return ZF[t]}function SF(t){return XF[t]}function ARe(t){return t>=29&&t<=33}function _Y(t){return t>=129&&t<=131}function cRe(t){return t>=90&&t<=92}function tk(t){return t>=58&&t<=92}function uRe(t){return t>=39&&t<=59}function lRe(t){return t===34}function pRe(t){return ek[t]}function gRe(t){return t>=121&&t<=123}function dRe(t){return t>=124&&t<=130}function qc(t){return VF[t]}function pQ(t){return WF[t]}function mRe(t){return t===57}function mQ(t){return t>=24&&t<=25}function UA(t){return GA[t]}GA[8].updateContext=t=>{t.pop()},GA[5].updateContext=GA[7].updateContext=GA[23].updateContext=t=>{t.push(ni.brace)},GA[22].updateContext=t=>{t[t.length-1]===ni.template?t.pop():t.push(ni.template)},GA[142].updateContext=t=>{t.push(ni.j_expr,ni.j_oTag)};var ik="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",zY="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",fRe=new RegExp("["+ik+"]"),hRe=new RegExp("["+ik+zY+"]");ik=zY=null;var VY=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],CRe=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function FF(t,e){let i=65536;for(let n=0,r=e.length;n<r;n+=2){if(i+=e[n],i>t)return!1;if(i+=e[n+1],i>=t)return!0}return!1}function OA(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&fRe.test(String.fromCharCode(t)):FF(t,VY)}function Ng(t){return t<48?t===36:t<58?!0:t<65?!1:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&hRe.test(String.fromCharCode(t)):FF(t,VY)||FF(t,CRe)}var nk={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},IRe=new Set(nk.keyword),ERe=new Set(nk.strict),BRe=new Set(nk.strictBind);function WY(t,e){return e&&t==="await"||t==="enum"}function ZY(t,e){return WY(t,e)||ERe.has(t)}function XY(t){return BRe.has(t)}function e5(t,e){return ZY(t,e)||XY(t)}function QRe(t){return IRe.has(t)}function yRe(t,e,i){return t===64&&e===64&&OA(i)}var DRe=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function xRe(t){return DRe.has(t)}var Ih=class{constructor(e){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=e}},Eh=class{constructor(e,i){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=e,this.inModule=i}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let e=this.currentThisScopeFlags();return(e&64)>0&&(e&2)===0}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){let{flags:i}=this.scopeStack[e];if(i&128)return!0;if(i&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new Ih(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return!!(e.flags&130||!this.parser.inModule&&e.flags&1)}declareName(e,i,n){let r=this.currentScope();if(i&8||i&16){this.checkRedeclarationInScope(r,e,i,n);let s=r.names.get(e)||0;i&16?s=s|4:(r.firstLexicalName||(r.firstLexicalName=e),s=s|2),r.names.set(e,s),i&8&&this.maybeExportDefined(r,e)}else if(i&4)for(let s=this.scopeStack.length-1;s>=0&&(r=this.scopeStack[s],this.checkRedeclarationInScope(r,e,i,n),r.names.set(e,(r.names.get(e)||0)|1),this.maybeExportDefined(r,e),!(r.flags&387));--s);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(e)}maybeExportDefined(e,i){this.parser.inModule&&e.flags&1&&this.undefinedExports.delete(i)}checkRedeclarationInScope(e,i,n,r){this.isRedeclaredInScope(e,i,n)&&this.parser.raise(q.VarRedeclaration,r,{identifierName:i})}isRedeclaredInScope(e,i,n){if(!(n&1))return!1;if(n&8)return e.names.has(i);let r=e.names.get(i);return n&16?(r&2)>0||!this.treatFunctionsAsVarInScope(e)&&(r&1)>0:(r&2)>0&&!(e.flags&8&&e.firstLexicalName===i)||!this.treatFunctionsAsVarInScope(e)&&(r&4)>0}checkLocalExport(e){let{name:i}=e;this.scopeStack[0].names.has(i)||this.undefinedExports.set(i,e.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:i}=this.scopeStack[e];if(i&387)return i}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:i}=this.scopeStack[e];if(i&451&&!(i&4))return i}}},kF=class extends Ih{constructor(...e){super(...e),this.declareFunctions=new Set}},RF=class extends Eh{createScope(e){return new kF(e)}declareName(e,i,n){let r=this.currentScope();if(i&2048){this.checkRedeclarationInScope(r,e,i,n),this.maybeExportDefined(r,e),r.declareFunctions.add(e);return}super.declareName(e,i,n)}isRedeclaredInScope(e,i,n){if(super.isRedeclaredInScope(e,i,n))return!0;if(n&2048&&!e.declareFunctions.has(i)){let r=e.names.get(i);return(r&4)>0||(r&2)>0}return!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e)}},NF=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(e){if(typeof e=="string")return this.plugins.has(e);{let[i,n]=e;if(!this.hasPlugin(i))return!1;let r=this.plugins.get(i);for(let s of Object.keys(n))if(r?.[s]!==n[s])return!1;return!0}}getPluginOption(e,i){var n;return(n=this.plugins.get(e))==null?void 0:n[i]}};function t5(t,e){t.trailingComments===void 0?t.trailingComments=e:t.trailingComments.unshift(...e)}function vRe(t,e){t.leadingComments===void 0?t.leadingComments=e:t.leadingComments.unshift(...e)}function Bh(t,e){t.innerComments===void 0?t.innerComments=e:t.innerComments.unshift(...e)}function mh(t,e,i){let n=null,r=e.length;for(;n===null&&r>0;)n=e[--r];n===null||n.start>i.start?Bh(t,i.comments):t5(n,i.comments)}var TF=class extends NF{addComment(e){this.filename&&(e.loc.filename=this.filename);let{commentsLen:i}=this.state;this.comments.length!==i&&(this.comments.length=i),this.comments.push(e),this.state.commentsLen++}processComment(e){let{commentStack:i}=this.state,n=i.length;if(n===0)return;let r=n-1,s=i[r];s.start===e.end&&(s.leadingNode=e,r--);let{start:o}=e;for(;r>=0;r--){let a=i[r],A=a.end;if(A>o)a.containingNode=e,this.finalizeComment(a),i.splice(r,1);else{A===o&&(a.trailingNode=e);break}}}finalizeComment(e){let{comments:i}=e;if(e.leadingNode!==null||e.trailingNode!==null)e.leadingNode!==null&&t5(e.leadingNode,i),e.trailingNode!==null&&vRe(e.trailingNode,i);else{let{containingNode:n,start:r}=e;if(this.input.charCodeAt(r-1)===44)switch(n.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":mh(n,n.properties,e);break;case"CallExpression":case"OptionalCallExpression":mh(n,n.arguments,e);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":mh(n,n.params,e);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":mh(n,n.elements,e);break;case"ExportNamedDeclaration":case"ImportDeclaration":mh(n,n.specifiers,e);break;default:Bh(n,i)}else Bh(n,i)}}finalizeRemainingComments(){let{commentStack:e}=this.state;for(let i=e.length-1;i>=0;i--)this.finalizeComment(e[i]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(e){let{commentStack:i}=this.state,{length:n}=i;if(n===0)return;let r=i[n-1];r.leadingNode===e&&(r.leadingNode=null)}resetPreviousIdentifierLeadingComments(e){let{commentStack:i}=this.state,{length:n}=i;n!==0&&(i[n-1].trailingNode===e?i[n-1].trailingNode=null:n>=2&&i[n-2].trailingNode===e&&(i[n-2].trailingNode=null))}takeSurroundingComments(e,i,n){let{commentStack:r}=this.state,s=r.length;if(s===0)return;let o=s-1;for(;o>=0;o--){let a=r[o],A=a.end;if(a.start===n)a.leadingNode=e;else if(A===i)a.trailingNode=e;else if(A<i)break}}},wRe=/\r\n|[\r\n\u2028\u2029]/,cQ=new RegExp(wRe.source,"g");function Tg(t){switch(t){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function LY(t,e,i){for(let n=e;n<i;n++)if(Tg(t.charCodeAt(n)))return!0;return!1}var DF=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,xF=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function bRe(t){switch(t){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var MF=class t{constructor(){this.flags=1024,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=139,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[ni.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(e){e?this.flags|=1:this.flags&=-2}init({strictMode:e,sourceType:i,startLine:n,startColumn:r}){this.strict=e===!1?!1:e===!0?!0:i==="module",this.curLine=n,this.lineStart=-r,this.startLoc=this.endLoc=new ja(n,r,0)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(e){e?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(e){e?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(e){e?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(e){e?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(e){e?this.flags|=4096:this.flags&=-4097}curPosition(){return new ja(this.curLine,this.pos-this.lineStart,this.pos)}clone(){let e=new t;return e.flags=this.flags,e.curLine=this.curLine,e.lineStart=this.lineStart,e.startLoc=this.startLoc,e.endLoc=this.endLoc,e.errors=this.errors.slice(),e.potentialArrowAt=this.potentialArrowAt,e.noArrowAt=this.noArrowAt.slice(),e.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),e.topicContext=this.topicContext,e.labels=this.labels.slice(),e.commentsLen=this.commentsLen,e.commentStack=this.commentStack.slice(),e.pos=this.pos,e.type=this.type,e.value=this.value,e.start=this.start,e.end=this.end,e.lastTokEndLoc=this.lastTokEndLoc,e.lastTokStartLoc=this.lastTokStartLoc,e.context=this.context.slice(),e.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,e.strictErrors=this.strictErrors,e.tokensLength=this.tokensLength,e}},SRe=function(e){return e>=48&&e<=57},UY={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},uQ={bin:t=>t===48||t===49,oct:t=>t>=48&&t<=55,dec:t=>t>=48&&t<=57,hex:t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102};function GY(t,e,i,n,r,s){let o=i,a=n,A=r,c="",u=null,l=i,{length:p}=e;for(;;){if(i>=p){s.unterminated(o,a,A),c+=e.slice(l,i);break}let d=e.charCodeAt(i);if(FRe(t,d,e,i)){c+=e.slice(l,i);break}if(d===92){c+=e.slice(l,i);let g=kRe(e,i,n,r,t==="template",s);g.ch===null&&!u?u={pos:i,lineStart:n,curLine:r}:c+=g.ch,{pos:i,lineStart:n,curLine:r}=g,l=i}else d===8232||d===8233?(++i,++r,n=i):d===10||d===13?t==="template"?(c+=e.slice(l,i)+`
|
|
1112
1112
|
`,++i,d===13&&e.charCodeAt(i)===10&&++i,++r,l=n=i):s.unterminated(o,a,A):++i}return{pos:i,str:c,firstInvalidLoc:u,lineStart:n,curLine:r,containsInvalid:!!u}}function FRe(t,e,i,n){return t==="template"?e===96||e===36&&i.charCodeAt(n+1)===123:e===(t==="double"?34:39)}function kRe(t,e,i,n,r,s){let o=!r;e++;let a=c=>({pos:e,ch:c,lineStart:i,curLine:n}),A=t.charCodeAt(e++);switch(A){case 110:return a(`
|
|
@@ -1284,7 +1284,7 @@ Restarting server after Builder Devtools update...
|
|
|
1284
1284
|
<h3>How's Devtools working for you?</h3>
|
|
1285
1285
|
<p>We'd love your feedback!</p>
|
|
1286
1286
|
</div>
|
|
1287
|
-
\`,t.appendChild(e),setTimeout(()=>{e.classList.add("menu-toggle-tooltip-show"),e.addEventListener("click",()=>{e.classList.remove("menu-toggle-tooltip-show")})},1e3)};function ui(t){t.getElementById("go-to-builder").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(Nr(),"builder")}),t.getElementById("components-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();let u=t.querySelector(".nav-cmp-list .section-content");u.scrollTop=0,oe(t,"nav-cmp-list"),si(t)}),t.getElementById("settings-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),oe(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(je(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open("https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more")})}function ci(t){let e=t.getElementById("enable-edit");e.addEventListener("change",r=>{r.stopPropagation(),Ft(e.checked)}),e.checked=it(),Ft(e.checked)}var At=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=\`<style>*,*:before,*:after{box-sizing:border-box}:host{--background-color: rgba(40, 40, 40, 1);--primary-color: rgba(72, 161, 255, 1);--primary-color-subdued: rgb(72, 161, 255, .6);--primary-color-highlight: rgb(126, 188, 255);--primary-contrast-color: white;--edit-color: #1d74e2;--edit-color-highlight: #1c6bd1;--edit-color-alpha: rgb(72, 161, 255, .15);--error-color: #ff2b55;--text-color: white;--text-color-highlight: white;--border-color: #454545;--button-background-color-hover: rgba(255, 255, 255, .1);--menu-width: 320px;--transition-time: .15s;--font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-family:var(--font-family);line-height:1.6}button{cursor:pointer;color:var(--text-color);-webkit-tap-highlight-color:transparent}input,select,button{font-family:var(--font-family)}.menu-toggle{position:absolute;right:0;bottom:0;pointer-events:auto;padding:8px;background:transparent;border:none;appearance:none}.menu-toggle div{position:relative;width:64px;height:64px;pointer-events:none;border-radius:50%;background:#000;border:1px solid white;box-shadow:#00000054 0 0 8px}.menu-toggle:hover div{background-color:var(--background-color);border:1px solid rgb(220,220,220)}.menu-toggle svg{position:absolute;top:15px;left:15px;width:33px;height:32px}div.highlight-bg{position:absolute;top:-1px;left:-1px;background-color:#1a1a1a;pointer-events:none;transition:all .4s ease-out;opacity:0}.menu-toggle-highlight-no-transition div.highlight-bg{transition:none}.menu-toggle-highlight div.highlight-bg{opacity:1}.menu-toggle-tooltip{position:absolute;bottom:0;right:0;width:382px;height:72px;padding:0;text-align:left;appearance:none;background-color:transparent;border:none;pointer-events:none;transform:translate3d(320px,0,0);opacity:0;transition:all .15s ease-in-out;color:#fff}.menu-toggle-tooltip.menu-toggle-tooltip-show{pointer-events:auto;opacity:1;transform:translateZ(0)}.menu-toggle-tooltip-content{position:absolute;inset:0 95px 10px 0;padding:8px 12px;background-color:var(--primary-color);box-shadow:#00000054 0 0 20px;border-radius:2px}.menu-toggle-tooltip-content:before{content:"";position:absolute;bottom:15px;right:-6px;width:30px;height:30px;background-color:var(--primary-color);transform:rotate(45deg)}.menu-toggle-tooltip:hover .menu-toggle-tooltip-content,.menu-toggle-tooltip:hover .menu-toggle-tooltip-content:before{background-color:var(--primary-color-highlight)}.menu-toggle-tooltip-content h3{margin:0;font-size:16px}.menu-toggle-tooltip-content p{margin:0;font-size:12px}section{position:absolute;display:grid;grid-template-rows:64px auto 64px;top:0;left:0;width:100%;height:100%;padding:0;pointer-events:none}.section-content{margin:0;padding:0 0 10px;font-weight:300;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;overflow-y:auto}.section-content .error{color:var(--error-color);font-weight:700}section a{text-decoration:none;color:var(--text-color)}section h3,section p{margin-left:16px;margin-right:16px}.info{font-size:12px}ul.list{list-style:none;padding:0;margin:0}ul.list li{display:block;padding:0;margin:0}ul.list a,ul.list button{display:grid;grid-template-columns:24px auto;grid-gap:16px;padding:12px;margin:8px 0;border:none;background:transparent;appearance:none;width:100%;font-weight:300;text-align:left;text-decoration:none;color:var(--text-color)}ul.list a:hover,ul.list button:hover{text-decoration:none;color:var(--text-color);background-color:var(--button-background-color-hover)}ul.list a span,ul.list button span{display:block;font-size:16px;font-weight:500;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}header{position:relative;display:grid;grid-template-columns:44px 1fr;gap:8px;padding-left:8px;border-bottom:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}header>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-home header>div{margin-right:56px}header h2{margin:7px 0 0;font-size:18px;font-weight:500;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p{margin:2px 0 0;font-size:12px;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button{display:block;margin:0;padding:0;width:100%;font-size:12px;font-weight:300;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button:hover{text-decoration:underline;color:var(--primary-color)}.builder-logo{margin:12px 0 0 8px}#close{display:block;position:absolute;appearance:none;background:transparent;border:none;border-radius:50%;margin:0;padding:0;right:4px;top:8px;width:48px;height:48px;z-index:1;opacity:.7}#close:hover{opacity:1;background-color:var(--button-background-color-hover)}#close svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}.back-button{position:relative;display:block;margin:7px 0 0 -2px;width:48px;height:48px;background:transparent;border:none;appearance:none;border-radius:50%}.back-button:hover{background-color:var(--button-background-color-hover)}.back-button svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}footer{border-top:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}section.nav-cmp-list{grid-template-rows:64px auto 120px}footer a{text-decoration:underline;color:var(--primary-color)}footer a:hover{color:var(--primary-color);text-decoration:none}.nav-list{padding:2px 0}.nav-loading{pointer-events:none}.nav-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.nav-loading .nav-loading-icon{opacity:.5}.nav-list h4{margin:8px 8px 8px 10px;font-size:14px;font-weight:600}.nav-list .nav-list-item+h4{margin-top:30px}.nav-list-item{display:grid;grid-template-columns:1fr 1fr;gap:8px;position:relative;margin:2px 0;padding:8px 28px 8px 46px;width:100%;font-size:14px;font-weight:300;text-align:left;border:none;background:transparent;appearance:none}.nav-list-item:hover{background-color:var(--button-background-color-hover)}.nav-list-item-icon{position:absolute;top:4px;left:10px;width:24px;height:24px;object-fit:contain;filter:invert(100%);background-size:24px 24px;background-repeat:no-repeat;background-position:center center}.nav-list-item span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}.nav-list-item:after{display:block;position:absolute;content:"";background-image:url('data:image/svg+xml,<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L7 7L1 13" stroke="%23F2F2F2" stroke-opacity="0.5" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');background-repeat:no-repeat;background-position:12px 9px;top:0;right:0;width:32px;height:32px;pointer-events:none}.nav-list-item-note{opacity:0;font-size:12px;padding-top:1px;text-align:right}.nav-list-item:hover .nav-list-item-note{opacity:.5}.ui-select{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-select h3{margin:0;font-size:14px;font-weight:500}.ui-select p{margin:8px 0;font-size:12px;font-weight:300}.ui-select .select{position:relative;margin:8px 0;border-radius:4px;padding:0;line-height:1.1;overflow:hidden;border:1px solid var(--border-color)}.ui-select select{appearance:none;background-color:transparent;border:none;outline:none;padding:8px 32px 8px 8px;margin:0;width:100%;font-size:14px;cursor:pointer;text-overflow:ellipsis;opacity:.6;color:var(--text-color)}.ui-select .select:after{content:"";top:6px;right:5px;width:24px;height:24px;position:absolute;background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="%23F2F2F2" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>');background-repeat:no-repeat;background-position:center;pointer-events:none;opacity:.6}.ui-select .select:hover{border-color:var(--primary-color-subdued)}.ui-text-input .select:focus-within{border-color:var(--primary-color)}.ui-text-input .select:focus-within select{opacity:1}.spinner:after{content:" ";display:block;width:32px;height:32px;margin:0 auto;pointer-events:auto;border-radius:50%;border:3px solid var(--text-color);border-color:var(--text-color) transparent var(--text-color) transparent;animation:spinner .75s linear infinite}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ui-switch{display:grid;grid-template-columns:auto 48px;grid-gap:20px;margin:8px 0 16px;padding:8px 0 8px 16px;cursor:pointer}.ui-switch>*{pointer-events:none}.ui-switch input{display:none;visibility:hidden}.ui-switch .switcher{display:inline-block;border-radius:100px;width:35px;height:14px;background-color:#ccc;position:relative;top:6px;vertical-align:middle;cursor:pointer}.ui-switch input[type=checkbox]:checked+.switcher{background-color:var(--primary-color-subdued)}.ui-switch .switcher:before{content:"";display:block;width:20px;height:20px;background-color:var(--text-color);box-shadow:0 1px 3px #0009;border-radius:50%;position:absolute;top:-3px;left:0;margin-right:0;transition:all .15s}.ui-switch input[type=checkbox]:checked+.switcher:before{left:100%;margin-left:-20px;background-color:var(--primary-color)}.ui-switch h3{margin:0;font-size:14px;font-weight:500}.ui-switch p{margin:4px 0 0;font-size:12px;font-weight:300}.ui-text-input{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-text-input h3{margin:0;font-size:14px;font-weight:500}.ui-text-input p{margin:8px 0;font-size:12px;font-weight:300}.ui-text-input .input{position:relative;margin:8px 0;border:1px solid var(--border-color);border-radius:4px;background:transparent;padding:2px;overflow:hidden}.ui-text-input input{display:block;width:235px;font-size:14px;border:none;background:transparent;padding:6px;appearance:none;color:var(--text-color);opacity:.6;outline:none}.ui-text-input .input:hover{border-color:var(--primary-color-subdued)}.ui-text-input .input:focus-within{border-color:var(--primary-color)}.ui-text-input .input:focus-within input{opacity:1}.ui-text-input .input:after{content:"";position:absolute;top:5px;right:14px;width:8px;height:17px;border:2px solid rgba(51,181,51,1);border-top:none;border-left:none;transform:rotate(45deg);opacity:0;transition:opacity 80ms ease-in-out;pointer-events:none}.ui-text-input.saved .input:after{opacity:1}.ui-toast{position:fixed;bottom:8px;left:8px;right:8px;padding:6px 12px;font-size:14px;border-radius:4px;transform:translate3d(0,150%,0);opacity:0;transition:all var(--transition-time) ease-in-out;background-color:var(--primary-color-subdued);color:var(--text-color);pointer-events:none}.ui-toast.ui-toast-show{transform:translateZ(0);opacity:1;pointer-events:auto}[data-view=nav-home] .nav-home .section-content,[data-view=nav-cmp-list] .nav-cmp-list .section-content,[data-view=nav-cmp-detail] .nav-cmp-detail .section-content,[data-view=nav-cmp-input] .nav-cmp-input .section-content,[data-view=nav-settings] .nav-settings .section-content{transform:translateZ(0);pointer-events:auto}[data-view=nav-home] .nav-home header,[data-view=nav-home] .nav-home footer,[data-view=nav-cmp-list] .nav-cmp-list header,[data-view=nav-cmp-list] .nav-cmp-list footer,[data-view=nav-cmp-detail] .nav-cmp-detail header,[data-view=nav-cmp-detail] .nav-cmp-detail footer,[data-view=nav-cmp-input] .nav-cmp-input header,[data-view=nav-cmp-input] .nav-cmp-input footer,[data-view=nav-settings] .nav-settings header,[data-view=nav-settings] .nav-settings footer{opacity:1;pointer-events:auto}[data-view=nav-cmp-list] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-home .section-content,[data-view=nav-cmp-input] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-cmp-detail .section-content,[data-view=nav-settings] .nav-home .section-content{transform:translate3d(-105%,0,0)}.cmp-item .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.83 16.809C20.94 16.561 21 16.289 21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L7.988 3.99001M5.441 5.44801L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L18.544 18.56" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.532 10.538L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.27002 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 3L21 21" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');opacity:.3}.cmp-item.registered .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>');opacity:.8}.search-highlight{background-color:var(--primary-color-alpha);padding:0 2px;border-radius:2px;font-weight:500}.search-container{position:sticky;top:0;z-index:10;padding:12px 16px;background:var(--background-color);border-bottom:1px solid var(--border-color)}.search-input-wrapper{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:12px;color:var(--text-color-secondary);pointer-events:none}.component-search-input{width:100%;height:36px;padding:8px 36px;border:1px solid var(--border-color);border-radius:6px;background:var(--input-background);color:var(--text-color);font-size:14px;transition:border-color .2s,box-shadow .2s}.component-search-input:focus{outline:none;border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color-alpha)}.component-search-input::placeholder{color:var(--text-color-tertiary)}.clear-search-button{position:absolute;right:8px;padding:4px;color:var(--text-color-secondary);border:none;background:transparent;border-radius:4px;cursor:pointer;opacity:0;transition:opacity .2s,background-color .2s;display:flex;align-items:center;justify-content:center}.clear-search-button:hover{background-color:var(--hover-color)}.component-search-input:not(:placeholder-shown)+.clear-search-button{opacity:1}.no-results{padding:32px 16px;text-align:center;color:var(--text-color-secondary);font-size:14px}#cmp-detail{position:relative}.cmp-loading{pointer-events:none!important}.cmp-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.cmp-loading .cmp-loading-icon{opacity:.5}.cmp-cover{position:absolute;top:160px;left:0;width:100%;height:100vh;background:var(--background-color);transform:translateZ(0);pointer-events:none;display:none}[data-view=nav-cmp-detail] .cmp-cover{display:block;pointer-events:auto}.cmp-enabled .cmp-cover{transform:translate3d(0,105%,0);pointer-events:none}.section-ready .cmp-cover{transition:all var(--transition-time) ease-in-out}.cmp-detail-inputs-container{margin:8px 0 16px;padding:0}.cmp-detail-inputs-container h3{margin:0 0 6px;padding-left:16px;padding-right:8px;font-size:14px;font-weight:500;display:flex;justify-content:space-between;align-items:center}.cmp-detail-inputs-reload{font-weight:300;font-size:.9em;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmp-detail-inputs-reload:hover{text-decoration:underline;color:var(--primary-color)}.cmp-detail-inputs-container .cmp-inputs-empty{padding:0;margin-top:12px;font-size:12px;font-weight:300;opacity:.5;font-style:italic}.cmp-detail-inputs-container .nav-list-item-icon{opacity:.8;background-size:20px 20px;background-position:4px center}.input-icon{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>')}.input-icon-array{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-6a2 2 0 1 1 4 0v6"></path> <path d="M10 13h4"></path></svg>')}.input-icon-boolean{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16h2a2 2 0 1 0 0 -4h-2h2a2 2 0 1 0 0 -4h-2v8z"></path></svg>')}.input-icon-number{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-8l4 8v-8"></path></svg>')}.input-icon-object{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path></svg>')}.input-icon-string{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path></svg>')}.cmp-input-item-unregistered{opacity:.4}.cmp-input-item-unregistered .input-icon:after{content:"";position:absolute;top:11px;left:4px;width:20px;height:2px;background-color:#000;transform:rotate(-45deg)}.cmp-prop-info{border-bottom:1px solid var(--border-color)}.cmp-input-readonly{margin:16px 0;padding:0 16px;display:grid;grid-template-columns:50% 50%;gap:12px}.cmp-input-readonly h3{margin:0;font-size:14px;font-weight:500}.cmp-input-readonly span{margin-top:2px;font-size:12px;font-weight:300;opacity:.8}.cmp-input-detail{margin:16px 0}.cmp-input-detail a{color:var(--primary-color);text-decoration:none}.cmp-input-detail a:hover{text-decoration:underline}.input-cover{position:absolute;top:175px;left:0;width:100%;height:100%;background:var(--background-color);transform:translateZ(0);transition:all var(--transition-time) ease-in-out;pointer-events:auto}.input-enabled .input-cover{transform:translate3d(0,105%,0);pointer-events:none}.input-loading-icon{position:absolute;display:inline-block;top:190px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.input-loading .input-loading-icon{opacity:.5}:host{position:fixed;inset:0;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}aside{position:absolute;top:0;right:0;width:var(--menu-width);height:100%;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;background:var(--background-color);box-shadow:#000000c9 5px 0 20px;overflow:hidden;z-index:1}:host(.show-builder-menu) aside{pointer-events:auto;transform:translateZ(0)}#hit{position:absolute;inset:0;display:none}:host(.show-builder-menu) #hit{display:block;pointer-events:auto}#version{position:absolute;bottom:6px;right:6px;font-size:8px;color:#9b9b9b}</style><div id="hit"></div> <aside data-view="nav-home"> <section class="nav-home"> <header> <svg class="builder-logo" viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> <div> <h2 class="builder-home-title">Builder Devtools</h2> <p><button id="go-to-builder">Go to Builder</button></p> </div> <button id="close" aria-label="Close Menu"> <svg viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M18 6l-12 12" /> <path d="M6 6l12 12" /> </svg> </button> </header> <div class="section-content"> <ul class="list"> <li> <button id="components-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Components</span> </button> </li> <li> <button id="settings-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M10.325 4.317C10.751 2.561 13.249 2.561 13.675 4.317C13.7389 4.5808 13.8642 4.82578 14.0407 5.032C14.2172 5.23822 14.4399 5.39985 14.6907 5.50375C14.9414 5.60764 15.2132 5.65085 15.4838 5.62987C15.7544 5.60889 16.0162 5.5243 16.248 5.383C17.791 4.443 19.558 6.209 18.618 7.753C18.4769 7.98466 18.3924 8.24634 18.3715 8.51677C18.3506 8.78721 18.3938 9.05877 18.4975 9.30938C18.6013 9.55999 18.7627 9.78258 18.9687 9.95905C19.1747 10.1355 19.4194 10.2609 19.683 10.325C21.439 10.751 21.439 13.249 19.683 13.675C19.4192 13.7389 19.1742 13.8642 18.968 14.0407C18.7618 14.2172 18.6001 14.4399 18.4963 14.6907C18.3924 14.9414 18.3491 15.2132 18.3701 15.4838C18.3911 15.7544 18.4757 16.0162 18.617 16.248C19.557 17.791 17.791 19.558 16.247 18.618C16.0153 18.4769 15.7537 18.3924 15.4832 18.3715C15.2128 18.3506 14.9412 18.3938 14.6906 18.4975C14.44 18.6013 14.2174 18.7627 14.0409 18.9687C13.8645 19.1747 13.7391 19.4194 13.675 19.683C13.249 21.439 10.751 21.439 10.325 19.683C10.2611 19.4192 10.1358 19.1742 9.95929 18.968C9.7828 18.7618 9.56011 18.6001 9.30935 18.4963C9.05859 18.3924 8.78683 18.3491 8.51621 18.3701C8.24559 18.3911 7.98375 18.4757 7.752 18.617C6.209 19.557 4.442 17.791 5.382 16.247C5.5231 16.0153 5.60755 15.7537 5.62848 15.4832C5.64942 15.2128 5.60624 14.9412 5.50247 14.6906C5.3987 14.44 5.23726 14.2174 5.03127 14.0409C4.82529 13.8645 4.58056 13.7391 4.317 13.675C2.561 13.249 2.561 10.751 4.317 10.325C4.5808 10.2611 4.82578 10.1358 5.032 9.95929C5.23822 9.7828 5.39985 9.56011 5.50375 9.30935C5.60764 9.05859 5.65085 8.78683 5.62987 8.51621C5.60889 8.24559 5.5243 7.98375 5.383 7.752C4.443 6.209 6.209 4.442 7.753 5.382C8.753 5.99 10.049 5.452 10.325 4.317Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 12C9 12.7956 9.31607 13.5587 9.87868 14.1213C10.4413 14.6839 11.2044 15 12 15C12.7956 15 13.5587 14.6839 14.1213 14.1213C14.6839 13.5587 15 12.7956 15 12C15 11.2044 14.6839 10.4413 14.1213 9.87868C13.5587 9.31607 12.7956 9 12 9C11.2044 9 10.4413 9.31607 9.87868 9.87868C9.31607 10.4413 9 11.2044 9 12Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Settings</span> </button> </li> <li> <button id="add-page-link"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M14 3v4a1 1 0 0 0 1 1h4" /> <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /> <path d="M12 11l0 6" /> <path d="M9 14l6 0" /> </svg> <span>Add Builder Page</span> </button> </li> <li> <button id="import-from-figma"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-figma" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M15 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M6 3m0 3a3 3 0 0 1 3 -3h6a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-6a3 3 0 0 1 -3 -3z" /> <path d="M9 9a3 3 0 0 0 0 6h3m-3 0a3 3 0 1 0 3 3v-15" /> </svg> <span>Import From Figma</span> </button> </li> </ul> </div> <footer> <ul class="list"> <li> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform" target="_blank" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M11.013 17.0114L10.013 18.0114L2.513 10.5834C2.0183 10.102 1.62864 9.52342 1.36854 8.88404C1.10845 8.24466 0.983558 7.55836 1.00173 6.86834C1.01991 6.17832 1.18076 5.49954 1.47415 4.87474C1.76755 4.24994 2.18713 3.69266 2.70648 3.23799C3.22583 2.78331 3.8337 2.4411 4.49181 2.23289C5.14991 2.02468 5.844 1.95499 6.53036 2.02821C7.21673 2.10143 7.8805 2.31596 8.47987 2.65831C9.07925 3.00066 9.60124 3.46341 10.013 4.01741C10.8086 2.95654 11.9931 2.2552 13.3059 2.06766C14.6186 1.88012 15.9521 2.22176 17.013 3.01741C18.0739 3.81306 18.7752 4.99755 18.9627 6.3103C19.1503 7.62305 18.8086 8.95654 18.013 10.0174" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> <path d="M18.2006 19.8175L16.0286 20.9555C15.9642 20.989 15.8917 21.004 15.8192 20.9987C15.7467 20.9934 15.6771 20.9681 15.6182 20.9256C15.5593 20.8831 15.5134 20.825 15.4855 20.7579C15.4577 20.6907 15.4491 20.6172 15.4606 20.5455L15.8756 18.1345L14.1186 16.4275C14.0662 16.3768 14.0291 16.3123 14.0115 16.2416C13.9939 16.1708 13.9966 16.0965 14.0192 16.0271C14.0418 15.9578 14.0835 15.8962 14.1394 15.8494C14.1954 15.8026 14.2634 15.7725 14.3356 15.7625L16.7636 15.4105L17.8496 13.2175C17.8821 13.1521 17.9322 13.0972 17.9942 13.0588C18.0562 13.0204 18.1277 13 18.2006 13C18.2736 13 18.3451 13.0204 18.4071 13.0588C18.4691 13.0972 18.5191 13.1521 18.5516 13.2175L19.6376 15.4105L22.0656 15.7625C22.1377 15.7728 22.2054 15.8031 22.2611 15.85C22.3168 15.8968 22.3583 15.9583 22.3809 16.0275C22.4034 16.0967 22.4062 16.1708 22.3888 16.2415C22.3715 16.3122 22.3347 16.3766 22.2826 16.4275L20.5256 18.1345L20.9396 20.5445C20.9521 20.6163 20.9441 20.6902 20.9166 20.7578C20.8891 20.8254 20.8433 20.8839 20.7842 20.9267C20.7252 20.9695 20.6553 20.9949 20.5825 21C20.5098 21.005 20.4371 20.9896 20.3726 20.9555L18.2006 19.8175Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Give Feedback</span> </a> </li> </ul> <div id="version"></div> </footer> </section> <section class="nav-cmp-list"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div class="search-container"> <div class="search-input-wrapper"> <svg class="search-icon" viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M15.5 15.5L20 20M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z" /> </svg> <input type="text" id="component-search" class="component-search-input" placeholder="Search components..." autocomplete="off" spellcheck="false" /> <button id="clear-search" class="clear-search-button" type="button" aria-label="Clear search" > <svg viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M6 6l12 12M6 18L18 6" /> </svg> </button> </div> </div> <div> <h2>Custom Components</h2> <p> <button id="open-builder-registry"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-list" class="cmp-list nav-list"></div> </div> <div class="nav-loading-icon spinner"></div> <footer> <p class="info"> Expand on Builder's selection of built-in blocks by <a target="_blank" href="https://www.builder.io/c/docs/custom-components-intro" >registering components</a > from your codebase. This way, teammates can drag and drop your components within Builder's Visual Editor just like any other block. </p> </footer> </section> <section class="nav-cmp-detail"> <header> <button class="back-button" data-back="nav-cmp-list"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-detail-title"></h2> <p> <button id="cmp-open-source"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-error"></div> <label class="ui-switch"> <div> <h3>Register Component</h3> <p> Registers this component so it can be used within Builder Visual CMS </p> </div> <input type="checkbox" role="switch" id="cmp-register" /> <span class="switcher"></span> </label> <div id="cmp-detail"> <label class="ui-text-input"> <h3>Component Name</h3> <div class="input"> <input type="text" id="cmp-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="2" maxlength="30" required placeholder="e.g. My Counter" /> </div> <p> Unique name to identify this custom component within Builder. Press ESC to cancel </p> </label> <div class="cmp-detail-inputs-container"> <h3> <span>Builder Inputs (Props)</span> <button class="cmp-detail-inputs-reload" id="btn-inputs-reload"> Reload </button> </h3> <div id="cmp-detail-inputs"></div> </div> </div> </div> <div class="cmp-cover"></div> <div class="cmp-loading-icon spinner"></div> </section> <section class="nav-cmp-input"> <header> <button class="back-button" data-back="nav-cmp-detail"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-input-title"></h2> <p> <button id="input-open-source"></button> </p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable Input</h3> <p>Add this component prop as a Builder input</p> </div> <input type="checkbox" role="switch" id="input-register" /> <span class="switcher"></span> </label> <div class="cmp-prop-info"> <div class="cmp-input-readonly"> <h3>Prop Name</h3> <span id="cmp-prop-name"></span> </div> <div class="cmp-input-readonly"> <h3>Prop Type</h3> <span id="cmp-prop-type"></span> </div> </div> <div class="cmp-input-detail"> <label class="ui-text-input"> <h3>Builder Input Name</h3> <div class="input"> <input type="text" id="input-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="1" maxlength="30" required placeholder="e.g. Text" /> </div> <p> Friendly name to identify this component prop as a Builder input. Press ESC to cancel </p> </label> <label class="ui-select"> <h3>Builder Input Type</h3> <div class="select"> <select id="input-type"></select> </div> <p> Correlate to what editing UI is appropriate for this Builder input. <a href="https://www.builder.io/c/docs/custom-components-input-types" target="_blank" >Read more about input types.</a > </p> </label> </div> <div class="input-cover"></div> <div class="input-loading-icon spinner"></div> </div> </section> <section class="nav-settings"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2>Settings</h2> <p>Configure Builder's Devtools</p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable edit button in UI</h3> <p>Enables the edit button so you can edit content in Builder</p> </div> <input type="checkbox" role="switch" id="enable-edit" /> <span class="switcher"></span> </label> </div> </section> <div class="ui-toast" id="toast"></div> </aside> <button class="menu-toggle" aria-label="Toggle Builder Devtools"> <div> <div class="highlight-bg"></div> <svg viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> </div> </button>\`,ai(e),ui(e),oi(e),ri(e),ti(e),ci(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.28.16"}highlightOpener(){let e=this.shadowRoot.querySelector(".menu-toggle");e.classList.add("menu-toggle-highlight"),e.classList.add("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight")},20)},20)}};var lo=\`<style>*,*:before,*:after{box-sizing:border-box}html,body,:host{position:fixed;top:0;left:0;width:100%;height:100vh;z-index:2147483646;margin:0;padding:0;line-height:1.8;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background-color:#252525;color:#fff;transition:opacity .25s ease-in-out}:host([aria-hidden="true"]){opacity:0;pointer-events:none}main{position:absolute;top:0;left:0;width:100%;height:100vh}h1{margin-top:0;font-size:24px;font-weight:300;line-height:1.4}p{margin:20px 0;font-weight:300}button{cursor:pointer}aside{position:absolute;top:0;left:0;width:350px;height:100vh;padding:60px 0 0 50px;background-color:#121212}aside ul{margin:30px 0 0;padding:0;list-style:none}aside li{position:relative;margin:0;padding:20px 10px;font-weight:300}aside li.highlight{color:#48a1ff}aside li.active{font-weight:700}aside li .circle{position:absolute;top:20px;left:10px;width:24px;height:24px;border:3px solid white;border-radius:50%;font-size:14px}aside li.highlight .circle{border-color:#48a1ff}aside li.active .circle:after{content:"";position:absolute;top:3px;left:3px;width:12px;height:12px;border-radius:50%;background-color:#48a1ff}aside li.completed .circle{background-color:#48a1ff}aside li.completed .circle:after{content:"";position:absolute;top:2px;left:6px;width:6px;height:13px;border:3px solid black;border-top:none;border-left:none;transform:rotate(45deg)}aside li .line{position:absolute;top:44px;left:21px;width:3px;height:45px;background-color:#fff}aside li.completed .line{background-color:#48a1ff}aside li span{display:block;margin-left:44px}nav{margin-top:30px}section{position:absolute;top:135px;left:350px;padding:0 80px 0 140px;transition:opacity .15s ease-in-out}section[aria-hidden=true]{pointer-events:none;opacity:0}section h1,section p{min-width:300px;max-width:600px}.button{position:relative;display:inline-block;color:#fff;background-color:#48a1ff;border-radius:4px;text-decoration:none;padding:10px 40px 10px 20px;white-space:nowrap}.button:hover{background-color:#48a1ffd9}#button-icon{position:absolute;top:1px;right:5px;bottom:0;width:30px;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>');background-repeat:no-repeat;background-position:center;background-size:24px 24px}.button[aria-disabled=true]{opacity:.9;background-color:#ffffff4d;pointer-events:none;padding-right:60px}.button[aria-disabled=true] #button-icon{top:21px;right:29px;width:8px;height:8px;border-radius:4px;background:#fff;color:#fff;animation:dot-flashing .5s infinite linear alternate;animation-delay:.25s}.button[aria-disabled=true] #button-icon:before,.button[aria-disabled=true] #button-icon:after{content:"";display:inline-block;position:absolute;top:0}.button[aria-disabled=true] #button-icon:before{left:-12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:0s}.button[aria-disabled=true] #button-icon:after{left:12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:.5s}@keyframes dot-flashing{0%{background-color:#fff}50%,to{background-color:#ffffff4d}}.logo{margin-left:9px;background:url('data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>');background-repeat:no-repeat;width:150px;height:32px}@media (max-width: 840px){aside{width:250px;padding:60px 0 0 20px}section{left:250px;padding:0 80px}}@media (max-width: 590px){aside{width:230px;padding:60px 0 0 10px}section{left:230px;padding:0 40px}}#modified-files-message a{color:#cbcbcb;font-weight:300;text-decoration:underline}#modified-files-message a:hover{color:#fff;text-decoration:none}#restart-warning{border-radius:4px;padding:8px 16px;border:1px solid #fd6b3c;background:#fd6b3c1a}#react-router-steps{margin:0 0 5px;padding:0 20px}#need-help{color:#48a1ff;text-decoration:none}#router-message{border-radius:4px;padding:16px;border:1px solid #48a1ff}#router-finish-button{margin-top:12px}#router-checkbox-div{display:flex;align-items:center}#router-checkbox{margin-right:10px;width:15px;height:15px}#success-title{display:flex;align-items:center;gap:10px}#success-title .check-icon{display:inline-block;width:24px;height:24px;border:2px solid #28a745;border-radius:50%;position:relative}#success-title .check-icon:before{content:"";position:absolute;top:50%;left:50%;width:6px;height:12px;border:solid #28a745;border-width:0 2px 2px 0;transform:translate(-50%,-60%) rotate(45deg)}
|
|
1287
|
+
\`,t.appendChild(e),setTimeout(()=>{e.classList.add("menu-toggle-tooltip-show"),e.addEventListener("click",()=>{e.classList.remove("menu-toggle-tooltip-show")})},1e3)};function ui(t){t.getElementById("go-to-builder").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(Nr(),"builder")}),t.getElementById("components-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();let u=t.querySelector(".nav-cmp-list .section-content");u.scrollTop=0,oe(t,"nav-cmp-list"),si(t)}),t.getElementById("settings-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),oe(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(je(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open("https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more")})}function ci(t){let e=t.getElementById("enable-edit");e.addEventListener("change",r=>{r.stopPropagation(),Ft(e.checked)}),e.checked=it(),Ft(e.checked)}var At=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=\`<style>*,*:before,*:after{box-sizing:border-box}:host{--background-color: rgba(40, 40, 40, 1);--primary-color: rgba(72, 161, 255, 1);--primary-color-subdued: rgb(72, 161, 255, .6);--primary-color-highlight: rgb(126, 188, 255);--primary-contrast-color: white;--edit-color: #1d74e2;--edit-color-highlight: #1c6bd1;--edit-color-alpha: rgb(72, 161, 255, .15);--error-color: #ff2b55;--text-color: white;--text-color-highlight: white;--border-color: #454545;--button-background-color-hover: rgba(255, 255, 255, .1);--menu-width: 320px;--transition-time: .15s;--font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-family:var(--font-family);line-height:1.6}button{cursor:pointer;color:var(--text-color);-webkit-tap-highlight-color:transparent}input,select,button{font-family:var(--font-family)}.menu-toggle{position:absolute;right:0;bottom:0;pointer-events:auto;padding:8px;background:transparent;border:none;appearance:none}.menu-toggle div{position:relative;width:64px;height:64px;pointer-events:none;border-radius:50%;background:#000;border:1px solid white;box-shadow:#00000054 0 0 8px}.menu-toggle:hover div{background-color:var(--background-color);border:1px solid rgb(220,220,220)}.menu-toggle svg{position:absolute;top:15px;left:15px;width:33px;height:32px}div.highlight-bg{position:absolute;top:-1px;left:-1px;background-color:#1a1a1a;pointer-events:none;transition:all .4s ease-out;opacity:0}.menu-toggle-highlight-no-transition div.highlight-bg{transition:none}.menu-toggle-highlight div.highlight-bg{opacity:1}.menu-toggle-tooltip{position:absolute;bottom:0;right:0;width:382px;height:72px;padding:0;text-align:left;appearance:none;background-color:transparent;border:none;pointer-events:none;transform:translate3d(320px,0,0);opacity:0;transition:all .15s ease-in-out;color:#fff}.menu-toggle-tooltip.menu-toggle-tooltip-show{pointer-events:auto;opacity:1;transform:translateZ(0)}.menu-toggle-tooltip-content{position:absolute;inset:0 95px 10px 0;padding:8px 12px;background-color:var(--primary-color);box-shadow:#00000054 0 0 20px;border-radius:2px}.menu-toggle-tooltip-content:before{content:"";position:absolute;bottom:15px;right:-6px;width:30px;height:30px;background-color:var(--primary-color);transform:rotate(45deg)}.menu-toggle-tooltip:hover .menu-toggle-tooltip-content,.menu-toggle-tooltip:hover .menu-toggle-tooltip-content:before{background-color:var(--primary-color-highlight)}.menu-toggle-tooltip-content h3{margin:0;font-size:16px}.menu-toggle-tooltip-content p{margin:0;font-size:12px}section{position:absolute;display:grid;grid-template-rows:64px auto 64px;top:0;left:0;width:100%;height:100%;padding:0;pointer-events:none}.section-content{margin:0;padding:0 0 10px;font-weight:300;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;overflow-y:auto}.section-content .error{color:var(--error-color);font-weight:700}section a{text-decoration:none;color:var(--text-color)}section h3,section p{margin-left:16px;margin-right:16px}.info{font-size:12px}ul.list{list-style:none;padding:0;margin:0}ul.list li{display:block;padding:0;margin:0}ul.list a,ul.list button{display:grid;grid-template-columns:24px auto;grid-gap:16px;padding:12px;margin:8px 0;border:none;background:transparent;appearance:none;width:100%;font-weight:300;text-align:left;text-decoration:none;color:var(--text-color)}ul.list a:hover,ul.list button:hover{text-decoration:none;color:var(--text-color);background-color:var(--button-background-color-hover)}ul.list a span,ul.list button span{display:block;font-size:16px;font-weight:500;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}header{position:relative;display:grid;grid-template-columns:44px 1fr;gap:8px;padding-left:8px;border-bottom:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}header>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-home header>div{margin-right:56px}header h2{margin:7px 0 0;font-size:18px;font-weight:500;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p{margin:2px 0 0;font-size:12px;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button{display:block;margin:0;padding:0;width:100%;font-size:12px;font-weight:300;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button:hover{text-decoration:underline;color:var(--primary-color)}.builder-logo{margin:12px 0 0 8px}#close{display:block;position:absolute;appearance:none;background:transparent;border:none;border-radius:50%;margin:0;padding:0;right:4px;top:8px;width:48px;height:48px;z-index:1;opacity:.7}#close:hover{opacity:1;background-color:var(--button-background-color-hover)}#close svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}.back-button{position:relative;display:block;margin:7px 0 0 -2px;width:48px;height:48px;background:transparent;border:none;appearance:none;border-radius:50%}.back-button:hover{background-color:var(--button-background-color-hover)}.back-button svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}footer{border-top:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}section.nav-cmp-list{grid-template-rows:64px auto 120px}footer a{text-decoration:underline;color:var(--primary-color)}footer a:hover{color:var(--primary-color);text-decoration:none}.nav-list{padding:2px 0}.nav-loading{pointer-events:none}.nav-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.nav-loading .nav-loading-icon{opacity:.5}.nav-list h4{margin:8px 8px 8px 10px;font-size:14px;font-weight:600}.nav-list .nav-list-item+h4{margin-top:30px}.nav-list-item{display:grid;grid-template-columns:1fr 1fr;gap:8px;position:relative;margin:2px 0;padding:8px 28px 8px 46px;width:100%;font-size:14px;font-weight:300;text-align:left;border:none;background:transparent;appearance:none}.nav-list-item:hover{background-color:var(--button-background-color-hover)}.nav-list-item-icon{position:absolute;top:4px;left:10px;width:24px;height:24px;object-fit:contain;filter:invert(100%);background-size:24px 24px;background-repeat:no-repeat;background-position:center center}.nav-list-item span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}.nav-list-item:after{display:block;position:absolute;content:"";background-image:url('data:image/svg+xml,<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L7 7L1 13" stroke="%23F2F2F2" stroke-opacity="0.5" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');background-repeat:no-repeat;background-position:12px 9px;top:0;right:0;width:32px;height:32px;pointer-events:none}.nav-list-item-note{opacity:0;font-size:12px;padding-top:1px;text-align:right}.nav-list-item:hover .nav-list-item-note{opacity:.5}.ui-select{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-select h3{margin:0;font-size:14px;font-weight:500}.ui-select p{margin:8px 0;font-size:12px;font-weight:300}.ui-select .select{position:relative;margin:8px 0;border-radius:4px;padding:0;line-height:1.1;overflow:hidden;border:1px solid var(--border-color)}.ui-select select{appearance:none;background-color:transparent;border:none;outline:none;padding:8px 32px 8px 8px;margin:0;width:100%;font-size:14px;cursor:pointer;text-overflow:ellipsis;opacity:.6;color:var(--text-color)}.ui-select .select:after{content:"";top:6px;right:5px;width:24px;height:24px;position:absolute;background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="%23F2F2F2" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>');background-repeat:no-repeat;background-position:center;pointer-events:none;opacity:.6}.ui-select .select:hover{border-color:var(--primary-color-subdued)}.ui-text-input .select:focus-within{border-color:var(--primary-color)}.ui-text-input .select:focus-within select{opacity:1}.spinner:after{content:" ";display:block;width:32px;height:32px;margin:0 auto;pointer-events:auto;border-radius:50%;border:3px solid var(--text-color);border-color:var(--text-color) transparent var(--text-color) transparent;animation:spinner .75s linear infinite}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ui-switch{display:grid;grid-template-columns:auto 48px;grid-gap:20px;margin:8px 0 16px;padding:8px 0 8px 16px;cursor:pointer}.ui-switch>*{pointer-events:none}.ui-switch input{display:none;visibility:hidden}.ui-switch .switcher{display:inline-block;border-radius:100px;width:35px;height:14px;background-color:#ccc;position:relative;top:6px;vertical-align:middle;cursor:pointer}.ui-switch input[type=checkbox]:checked+.switcher{background-color:var(--primary-color-subdued)}.ui-switch .switcher:before{content:"";display:block;width:20px;height:20px;background-color:var(--text-color);box-shadow:0 1px 3px #0009;border-radius:50%;position:absolute;top:-3px;left:0;margin-right:0;transition:all .15s}.ui-switch input[type=checkbox]:checked+.switcher:before{left:100%;margin-left:-20px;background-color:var(--primary-color)}.ui-switch h3{margin:0;font-size:14px;font-weight:500}.ui-switch p{margin:4px 0 0;font-size:12px;font-weight:300}.ui-text-input{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-text-input h3{margin:0;font-size:14px;font-weight:500}.ui-text-input p{margin:8px 0;font-size:12px;font-weight:300}.ui-text-input .input{position:relative;margin:8px 0;border:1px solid var(--border-color);border-radius:4px;background:transparent;padding:2px;overflow:hidden}.ui-text-input input{display:block;width:235px;font-size:14px;border:none;background:transparent;padding:6px;appearance:none;color:var(--text-color);opacity:.6;outline:none}.ui-text-input .input:hover{border-color:var(--primary-color-subdued)}.ui-text-input .input:focus-within{border-color:var(--primary-color)}.ui-text-input .input:focus-within input{opacity:1}.ui-text-input .input:after{content:"";position:absolute;top:5px;right:14px;width:8px;height:17px;border:2px solid rgba(51,181,51,1);border-top:none;border-left:none;transform:rotate(45deg);opacity:0;transition:opacity 80ms ease-in-out;pointer-events:none}.ui-text-input.saved .input:after{opacity:1}.ui-toast{position:fixed;bottom:8px;left:8px;right:8px;padding:6px 12px;font-size:14px;border-radius:4px;transform:translate3d(0,150%,0);opacity:0;transition:all var(--transition-time) ease-in-out;background-color:var(--primary-color-subdued);color:var(--text-color);pointer-events:none}.ui-toast.ui-toast-show{transform:translateZ(0);opacity:1;pointer-events:auto}[data-view=nav-home] .nav-home .section-content,[data-view=nav-cmp-list] .nav-cmp-list .section-content,[data-view=nav-cmp-detail] .nav-cmp-detail .section-content,[data-view=nav-cmp-input] .nav-cmp-input .section-content,[data-view=nav-settings] .nav-settings .section-content{transform:translateZ(0);pointer-events:auto}[data-view=nav-home] .nav-home header,[data-view=nav-home] .nav-home footer,[data-view=nav-cmp-list] .nav-cmp-list header,[data-view=nav-cmp-list] .nav-cmp-list footer,[data-view=nav-cmp-detail] .nav-cmp-detail header,[data-view=nav-cmp-detail] .nav-cmp-detail footer,[data-view=nav-cmp-input] .nav-cmp-input header,[data-view=nav-cmp-input] .nav-cmp-input footer,[data-view=nav-settings] .nav-settings header,[data-view=nav-settings] .nav-settings footer{opacity:1;pointer-events:auto}[data-view=nav-cmp-list] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-home .section-content,[data-view=nav-cmp-input] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-cmp-detail .section-content,[data-view=nav-settings] .nav-home .section-content{transform:translate3d(-105%,0,0)}.cmp-item .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.83 16.809C20.94 16.561 21 16.289 21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L7.988 3.99001M5.441 5.44801L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L18.544 18.56" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.532 10.538L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.27002 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 3L21 21" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');opacity:.3}.cmp-item.registered .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>');opacity:.8}.search-highlight{background-color:var(--primary-color-alpha);padding:0 2px;border-radius:2px;font-weight:500}.search-container{position:sticky;top:0;z-index:10;padding:12px 16px;background:var(--background-color);border-bottom:1px solid var(--border-color)}.search-input-wrapper{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:12px;color:var(--text-color-secondary);pointer-events:none}.component-search-input{width:100%;height:36px;padding:8px 36px;border:1px solid var(--border-color);border-radius:6px;background:var(--input-background);color:var(--text-color);font-size:14px;transition:border-color .2s,box-shadow .2s}.component-search-input:focus{outline:none;border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color-alpha)}.component-search-input::placeholder{color:var(--text-color-tertiary)}.clear-search-button{position:absolute;right:8px;padding:4px;color:var(--text-color-secondary);border:none;background:transparent;border-radius:4px;cursor:pointer;opacity:0;transition:opacity .2s,background-color .2s;display:flex;align-items:center;justify-content:center}.clear-search-button:hover{background-color:var(--hover-color)}.component-search-input:not(:placeholder-shown)+.clear-search-button{opacity:1}.no-results{padding:32px 16px;text-align:center;color:var(--text-color-secondary);font-size:14px}#cmp-detail{position:relative}.cmp-loading{pointer-events:none!important}.cmp-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.cmp-loading .cmp-loading-icon{opacity:.5}.cmp-cover{position:absolute;top:160px;left:0;width:100%;height:100vh;background:var(--background-color);transform:translateZ(0);pointer-events:none;display:none}[data-view=nav-cmp-detail] .cmp-cover{display:block;pointer-events:auto}.cmp-enabled .cmp-cover{transform:translate3d(0,105%,0);pointer-events:none}.section-ready .cmp-cover{transition:all var(--transition-time) ease-in-out}.cmp-detail-inputs-container{margin:8px 0 16px;padding:0}.cmp-detail-inputs-container h3{margin:0 0 6px;padding-left:16px;padding-right:8px;font-size:14px;font-weight:500;display:flex;justify-content:space-between;align-items:center}.cmp-detail-inputs-reload{font-weight:300;font-size:.9em;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmp-detail-inputs-reload:hover{text-decoration:underline;color:var(--primary-color)}.cmp-detail-inputs-container .cmp-inputs-empty{padding:0;margin-top:12px;font-size:12px;font-weight:300;opacity:.5;font-style:italic}.cmp-detail-inputs-container .nav-list-item-icon{opacity:.8;background-size:20px 20px;background-position:4px center}.input-icon{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>')}.input-icon-array{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-6a2 2 0 1 1 4 0v6"></path> <path d="M10 13h4"></path></svg>')}.input-icon-boolean{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16h2a2 2 0 1 0 0 -4h-2h2a2 2 0 1 0 0 -4h-2v8z"></path></svg>')}.input-icon-number{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-8l4 8v-8"></path></svg>')}.input-icon-object{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path></svg>')}.input-icon-string{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path></svg>')}.cmp-input-item-unregistered{opacity:.4}.cmp-input-item-unregistered .input-icon:after{content:"";position:absolute;top:11px;left:4px;width:20px;height:2px;background-color:#000;transform:rotate(-45deg)}.cmp-prop-info{border-bottom:1px solid var(--border-color)}.cmp-input-readonly{margin:16px 0;padding:0 16px;display:grid;grid-template-columns:50% 50%;gap:12px}.cmp-input-readonly h3{margin:0;font-size:14px;font-weight:500}.cmp-input-readonly span{margin-top:2px;font-size:12px;font-weight:300;opacity:.8}.cmp-input-detail{margin:16px 0}.cmp-input-detail a{color:var(--primary-color);text-decoration:none}.cmp-input-detail a:hover{text-decoration:underline}.input-cover{position:absolute;top:175px;left:0;width:100%;height:100%;background:var(--background-color);transform:translateZ(0);transition:all var(--transition-time) ease-in-out;pointer-events:auto}.input-enabled .input-cover{transform:translate3d(0,105%,0);pointer-events:none}.input-loading-icon{position:absolute;display:inline-block;top:190px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.input-loading .input-loading-icon{opacity:.5}:host{position:fixed;inset:0;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}aside{position:absolute;top:0;right:0;width:var(--menu-width);height:100%;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;background:var(--background-color);box-shadow:#000000c9 5px 0 20px;overflow:hidden;z-index:1}:host(.show-builder-menu) aside{pointer-events:auto;transform:translateZ(0)}#hit{position:absolute;inset:0;display:none}:host(.show-builder-menu) #hit{display:block;pointer-events:auto}#version{position:absolute;bottom:6px;right:6px;font-size:8px;color:#9b9b9b}</style><div id="hit"></div> <aside data-view="nav-home"> <section class="nav-home"> <header> <svg class="builder-logo" viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> <div> <h2 class="builder-home-title">Builder Devtools</h2> <p><button id="go-to-builder">Go to Builder</button></p> </div> <button id="close" aria-label="Close Menu"> <svg viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M18 6l-12 12" /> <path d="M6 6l12 12" /> </svg> </button> </header> <div class="section-content"> <ul class="list"> <li> <button id="components-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Components</span> </button> </li> <li> <button id="settings-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M10.325 4.317C10.751 2.561 13.249 2.561 13.675 4.317C13.7389 4.5808 13.8642 4.82578 14.0407 5.032C14.2172 5.23822 14.4399 5.39985 14.6907 5.50375C14.9414 5.60764 15.2132 5.65085 15.4838 5.62987C15.7544 5.60889 16.0162 5.5243 16.248 5.383C17.791 4.443 19.558 6.209 18.618 7.753C18.4769 7.98466 18.3924 8.24634 18.3715 8.51677C18.3506 8.78721 18.3938 9.05877 18.4975 9.30938C18.6013 9.55999 18.7627 9.78258 18.9687 9.95905C19.1747 10.1355 19.4194 10.2609 19.683 10.325C21.439 10.751 21.439 13.249 19.683 13.675C19.4192 13.7389 19.1742 13.8642 18.968 14.0407C18.7618 14.2172 18.6001 14.4399 18.4963 14.6907C18.3924 14.9414 18.3491 15.2132 18.3701 15.4838C18.3911 15.7544 18.4757 16.0162 18.617 16.248C19.557 17.791 17.791 19.558 16.247 18.618C16.0153 18.4769 15.7537 18.3924 15.4832 18.3715C15.2128 18.3506 14.9412 18.3938 14.6906 18.4975C14.44 18.6013 14.2174 18.7627 14.0409 18.9687C13.8645 19.1747 13.7391 19.4194 13.675 19.683C13.249 21.439 10.751 21.439 10.325 19.683C10.2611 19.4192 10.1358 19.1742 9.95929 18.968C9.7828 18.7618 9.56011 18.6001 9.30935 18.4963C9.05859 18.3924 8.78683 18.3491 8.51621 18.3701C8.24559 18.3911 7.98375 18.4757 7.752 18.617C6.209 19.557 4.442 17.791 5.382 16.247C5.5231 16.0153 5.60755 15.7537 5.62848 15.4832C5.64942 15.2128 5.60624 14.9412 5.50247 14.6906C5.3987 14.44 5.23726 14.2174 5.03127 14.0409C4.82529 13.8645 4.58056 13.7391 4.317 13.675C2.561 13.249 2.561 10.751 4.317 10.325C4.5808 10.2611 4.82578 10.1358 5.032 9.95929C5.23822 9.7828 5.39985 9.56011 5.50375 9.30935C5.60764 9.05859 5.65085 8.78683 5.62987 8.51621C5.60889 8.24559 5.5243 7.98375 5.383 7.752C4.443 6.209 6.209 4.442 7.753 5.382C8.753 5.99 10.049 5.452 10.325 4.317Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 12C9 12.7956 9.31607 13.5587 9.87868 14.1213C10.4413 14.6839 11.2044 15 12 15C12.7956 15 13.5587 14.6839 14.1213 14.1213C14.6839 13.5587 15 12.7956 15 12C15 11.2044 14.6839 10.4413 14.1213 9.87868C13.5587 9.31607 12.7956 9 12 9C11.2044 9 10.4413 9.31607 9.87868 9.87868C9.31607 10.4413 9 11.2044 9 12Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Settings</span> </button> </li> <li> <button id="add-page-link"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M14 3v4a1 1 0 0 0 1 1h4" /> <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /> <path d="M12 11l0 6" /> <path d="M9 14l6 0" /> </svg> <span>Add Builder Page</span> </button> </li> <li> <button id="import-from-figma"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-figma" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M15 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M6 3m0 3a3 3 0 0 1 3 -3h6a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-6a3 3 0 0 1 -3 -3z" /> <path d="M9 9a3 3 0 0 0 0 6h3m-3 0a3 3 0 1 0 3 3v-15" /> </svg> <span>Import From Figma</span> </button> </li> </ul> </div> <footer> <ul class="list"> <li> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform" target="_blank" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M11.013 17.0114L10.013 18.0114L2.513 10.5834C2.0183 10.102 1.62864 9.52342 1.36854 8.88404C1.10845 8.24466 0.983558 7.55836 1.00173 6.86834C1.01991 6.17832 1.18076 5.49954 1.47415 4.87474C1.76755 4.24994 2.18713 3.69266 2.70648 3.23799C3.22583 2.78331 3.8337 2.4411 4.49181 2.23289C5.14991 2.02468 5.844 1.95499 6.53036 2.02821C7.21673 2.10143 7.8805 2.31596 8.47987 2.65831C9.07925 3.00066 9.60124 3.46341 10.013 4.01741C10.8086 2.95654 11.9931 2.2552 13.3059 2.06766C14.6186 1.88012 15.9521 2.22176 17.013 3.01741C18.0739 3.81306 18.7752 4.99755 18.9627 6.3103C19.1503 7.62305 18.8086 8.95654 18.013 10.0174" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> <path d="M18.2006 19.8175L16.0286 20.9555C15.9642 20.989 15.8917 21.004 15.8192 20.9987C15.7467 20.9934 15.6771 20.9681 15.6182 20.9256C15.5593 20.8831 15.5134 20.825 15.4855 20.7579C15.4577 20.6907 15.4491 20.6172 15.4606 20.5455L15.8756 18.1345L14.1186 16.4275C14.0662 16.3768 14.0291 16.3123 14.0115 16.2416C13.9939 16.1708 13.9966 16.0965 14.0192 16.0271C14.0418 15.9578 14.0835 15.8962 14.1394 15.8494C14.1954 15.8026 14.2634 15.7725 14.3356 15.7625L16.7636 15.4105L17.8496 13.2175C17.8821 13.1521 17.9322 13.0972 17.9942 13.0588C18.0562 13.0204 18.1277 13 18.2006 13C18.2736 13 18.3451 13.0204 18.4071 13.0588C18.4691 13.0972 18.5191 13.1521 18.5516 13.2175L19.6376 15.4105L22.0656 15.7625C22.1377 15.7728 22.2054 15.8031 22.2611 15.85C22.3168 15.8968 22.3583 15.9583 22.3809 16.0275C22.4034 16.0967 22.4062 16.1708 22.3888 16.2415C22.3715 16.3122 22.3347 16.3766 22.2826 16.4275L20.5256 18.1345L20.9396 20.5445C20.9521 20.6163 20.9441 20.6902 20.9166 20.7578C20.8891 20.8254 20.8433 20.8839 20.7842 20.9267C20.7252 20.9695 20.6553 20.9949 20.5825 21C20.5098 21.005 20.4371 20.9896 20.3726 20.9555L18.2006 19.8175Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Give Feedback</span> </a> </li> </ul> <div id="version"></div> </footer> </section> <section class="nav-cmp-list"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div class="search-container"> <div class="search-input-wrapper"> <svg class="search-icon" viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M15.5 15.5L20 20M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z" /> </svg> <input type="text" id="component-search" class="component-search-input" placeholder="Search components..." autocomplete="off" spellcheck="false" /> <button id="clear-search" class="clear-search-button" type="button" aria-label="Clear search" > <svg viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M6 6l12 12M6 18L18 6" /> </svg> </button> </div> </div> <div> <h2>Custom Components</h2> <p> <button id="open-builder-registry"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-list" class="cmp-list nav-list"></div> </div> <div class="nav-loading-icon spinner"></div> <footer> <p class="info"> Expand on Builder's selection of built-in blocks by <a target="_blank" href="https://www.builder.io/c/docs/custom-components-intro" >registering components</a > from your codebase. This way, teammates can drag and drop your components within Builder's Visual Editor just like any other block. </p> </footer> </section> <section class="nav-cmp-detail"> <header> <button class="back-button" data-back="nav-cmp-list"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-detail-title"></h2> <p> <button id="cmp-open-source"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-error"></div> <label class="ui-switch"> <div> <h3>Register Component</h3> <p> Registers this component so it can be used within Builder Visual CMS </p> </div> <input type="checkbox" role="switch" id="cmp-register" /> <span class="switcher"></span> </label> <div id="cmp-detail"> <label class="ui-text-input"> <h3>Component Name</h3> <div class="input"> <input type="text" id="cmp-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="2" maxlength="30" required placeholder="e.g. My Counter" /> </div> <p> Unique name to identify this custom component within Builder. Press ESC to cancel </p> </label> <div class="cmp-detail-inputs-container"> <h3> <span>Builder Inputs (Props)</span> <button class="cmp-detail-inputs-reload" id="btn-inputs-reload"> Reload </button> </h3> <div id="cmp-detail-inputs"></div> </div> </div> </div> <div class="cmp-cover"></div> <div class="cmp-loading-icon spinner"></div> </section> <section class="nav-cmp-input"> <header> <button class="back-button" data-back="nav-cmp-detail"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-input-title"></h2> <p> <button id="input-open-source"></button> </p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable Input</h3> <p>Add this component prop as a Builder input</p> </div> <input type="checkbox" role="switch" id="input-register" /> <span class="switcher"></span> </label> <div class="cmp-prop-info"> <div class="cmp-input-readonly"> <h3>Prop Name</h3> <span id="cmp-prop-name"></span> </div> <div class="cmp-input-readonly"> <h3>Prop Type</h3> <span id="cmp-prop-type"></span> </div> </div> <div class="cmp-input-detail"> <label class="ui-text-input"> <h3>Builder Input Name</h3> <div class="input"> <input type="text" id="input-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="1" maxlength="30" required placeholder="e.g. Text" /> </div> <p> Friendly name to identify this component prop as a Builder input. Press ESC to cancel </p> </label> <label class="ui-select"> <h3>Builder Input Type</h3> <div class="select"> <select id="input-type"></select> </div> <p> Correlate to what editing UI is appropriate for this Builder input. <a href="https://www.builder.io/c/docs/custom-components-input-types" target="_blank" >Read more about input types.</a > </p> </label> </div> <div class="input-cover"></div> <div class="input-loading-icon spinner"></div> </div> </section> <section class="nav-settings"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2>Settings</h2> <p>Configure Builder's Devtools</p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable edit button in UI</h3> <p>Enables the edit button so you can edit content in Builder</p> </div> <input type="checkbox" role="switch" id="enable-edit" /> <span class="switcher"></span> </label> </div> </section> <div class="ui-toast" id="toast"></div> </aside> <button class="menu-toggle" aria-label="Toggle Builder Devtools"> <div> <div class="highlight-bg"></div> <svg viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> </div> </button>\`,ai(e),ui(e),oi(e),ri(e),ti(e),ci(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.28.17"}highlightOpener(){let e=this.shadowRoot.querySelector(".menu-toggle");e.classList.add("menu-toggle-highlight"),e.classList.add("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight")},20)},20)}};var lo=\`<style>*,*:before,*:after{box-sizing:border-box}html,body,:host{position:fixed;top:0;left:0;width:100%;height:100vh;z-index:2147483646;margin:0;padding:0;line-height:1.8;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background-color:#252525;color:#fff;transition:opacity .25s ease-in-out}:host([aria-hidden="true"]){opacity:0;pointer-events:none}main{position:absolute;top:0;left:0;width:100%;height:100vh}h1{margin-top:0;font-size:24px;font-weight:300;line-height:1.4}p{margin:20px 0;font-weight:300}button{cursor:pointer}aside{position:absolute;top:0;left:0;width:350px;height:100vh;padding:60px 0 0 50px;background-color:#121212}aside ul{margin:30px 0 0;padding:0;list-style:none}aside li{position:relative;margin:0;padding:20px 10px;font-weight:300}aside li.highlight{color:#48a1ff}aside li.active{font-weight:700}aside li .circle{position:absolute;top:20px;left:10px;width:24px;height:24px;border:3px solid white;border-radius:50%;font-size:14px}aside li.highlight .circle{border-color:#48a1ff}aside li.active .circle:after{content:"";position:absolute;top:3px;left:3px;width:12px;height:12px;border-radius:50%;background-color:#48a1ff}aside li.completed .circle{background-color:#48a1ff}aside li.completed .circle:after{content:"";position:absolute;top:2px;left:6px;width:6px;height:13px;border:3px solid black;border-top:none;border-left:none;transform:rotate(45deg)}aside li .line{position:absolute;top:44px;left:21px;width:3px;height:45px;background-color:#fff}aside li.completed .line{background-color:#48a1ff}aside li span{display:block;margin-left:44px}nav{margin-top:30px}section{position:absolute;top:135px;left:350px;padding:0 80px 0 140px;transition:opacity .15s ease-in-out}section[aria-hidden=true]{pointer-events:none;opacity:0}section h1,section p{min-width:300px;max-width:600px}.button{position:relative;display:inline-block;color:#fff;background-color:#48a1ff;border-radius:4px;text-decoration:none;padding:10px 40px 10px 20px;white-space:nowrap}.button:hover{background-color:#48a1ffd9}#button-icon{position:absolute;top:1px;right:5px;bottom:0;width:30px;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>');background-repeat:no-repeat;background-position:center;background-size:24px 24px}.button[aria-disabled=true]{opacity:.9;background-color:#ffffff4d;pointer-events:none;padding-right:60px}.button[aria-disabled=true] #button-icon{top:21px;right:29px;width:8px;height:8px;border-radius:4px;background:#fff;color:#fff;animation:dot-flashing .5s infinite linear alternate;animation-delay:.25s}.button[aria-disabled=true] #button-icon:before,.button[aria-disabled=true] #button-icon:after{content:"";display:inline-block;position:absolute;top:0}.button[aria-disabled=true] #button-icon:before{left:-12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:0s}.button[aria-disabled=true] #button-icon:after{left:12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:.5s}@keyframes dot-flashing{0%{background-color:#fff}50%,to{background-color:#ffffff4d}}.logo{margin-left:9px;background:url('data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>');background-repeat:no-repeat;width:150px;height:32px}@media (max-width: 840px){aside{width:250px;padding:60px 0 0 20px}section{left:250px;padding:0 80px}}@media (max-width: 590px){aside{width:230px;padding:60px 0 0 10px}section{left:230px;padding:0 40px}}#modified-files-message a{color:#cbcbcb;font-weight:300;text-decoration:underline}#modified-files-message a:hover{color:#fff;text-decoration:none}#restart-warning{border-radius:4px;padding:8px 16px;border:1px solid #fd6b3c;background:#fd6b3c1a}#react-router-steps{margin:0 0 5px;padding:0 20px}#need-help{color:#48a1ff;text-decoration:none}#router-message{border-radius:4px;padding:16px;border:1px solid #48a1ff}#router-finish-button{margin-top:12px}#router-checkbox-div{display:flex;align-items:center}#router-checkbox{margin-right:10px;width:15px;height:15px}#success-title{display:flex;align-items:center;gap:10px}#success-title .check-icon{display:inline-block;width:24px;height:24px;border:2px solid #28a745;border-radius:50%;position:relative}#success-title .check-icon:before{content:"";position:absolute;top:50%;left:50%;width:6px;height:12px;border:solid #28a745;border-width:0 2px 2px 0;transform:translate(-50%,-60%) rotate(45deg)}
|
|
1288
1288
|
</style>\`,Dt=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=lo+\`<main>
|
|
1289
1289
|
<aside>
|
|
1290
1290
|
<div class="logo"></div>
|
|
@@ -1323,7 +1323,7 @@ Restarting server after Builder Devtools update...
|
|
|
1323
1323
|
</nav>
|
|
1324
1324
|
</section>
|
|
1325
1325
|
</main>
|
|
1326
|
-
\`,po();let r=new URL(Vr,ot);r.searchParams.set(Mr,location.href);let n=e.querySelectorAll(".next-step");for(let i of n)i.setAttribute("href",r.href);ye("overview step viewed")}},po=()=>{let t=document.head.querySelector("link[rel='icon'], link[rel='icon shortcut']");t?(t.href="https://cdn.builder.io/favicon.ico",t.removeAttribute("type")):(t=document.createElement("link"),t.rel="icon",t.href="https://cdn.builder.io/favicon.ico",document.head.appendChild(t))};var li=async()=>{(await qr()).isValid||fo()},fo=()=>{customElements.get("builder-dev-tools-overview")||customElements.define("builder-dev-tools-overview",Dt);let t=document.querySelector("builder-dev-tools-overview");t||(t=document.createElement("builder-dev-tools-overview"),t.setAttribute("aria-hidden","true"),document.body.appendChild(t)),setTimeout(()=>{t.removeAttribute("aria-hidden")},32)};var mo=()=>{try{customElements.get("builder-dev-tools-edit")||customElements.define("builder-dev-tools-edit",st),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",At);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.28.
|
|
1326
|
+
\`,po();let r=new URL(Vr,ot);r.searchParams.set(Mr,location.href);let n=e.querySelectorAll(".next-step");for(let i of n)i.setAttribute("href",r.href);ye("overview step viewed")}},po=()=>{let t=document.head.querySelector("link[rel='icon'], link[rel='icon shortcut']");t?(t.href="https://cdn.builder.io/favicon.ico",t.removeAttribute("type")):(t=document.createElement("link"),t.rel="icon",t.href="https://cdn.builder.io/favicon.ico",document.head.appendChild(t))};var li=async()=>{(await qr()).isValid||fo()},fo=()=>{customElements.get("builder-dev-tools-overview")||customElements.define("builder-dev-tools-overview",Dt);let t=document.querySelector("builder-dev-tools-overview");t||(t=document.createElement("builder-dev-tools-overview"),t.setAttribute("aria-hidden","true"),document.body.appendChild(t)),setTimeout(()=>{t.removeAttribute("aria-hidden")},32)};var mo=()=>{try{customElements.get("builder-dev-tools-edit")||customElements.define("builder-dev-tools-edit",st),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",At);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.28.17"),document.body.appendChild(t));let e=document.querySelector("builder-dev-tools-edit");e||(e=document.createElement("builder-dev-tools-edit"),document.body.appendChild(e));let r=document.getElementById("builder-dev-tools-style");r||(r=document.createElement("style"),r.id="builder-dev-tools-style",r.innerHTML=".builder-no-scroll{overflow:hidden !important}",document.head.appendChild(r)),li(),Jn()}catch(t){console.error("Builder Devtools:",t)}};window.location===window.parent.location&&(console.debug("Builder.io Devtools v1.28.17"),mo());})();`)}async function FX(t){return kX(t,`<!doctype html>
|
|
1327
1327
|
<html lang="en" dir="ltr">
|
|
1328
1328
|
<head>
|
|
1329
1329
|
<meta charset="utf-8" />
|
|
@@ -1821,9 +1821,9 @@ ${e}`.toLowerCase();return i.some(r=>r.test(n))}});async function p0({sys:t,cred
|
|
|
1821
1821
|
`):void 0})}return i}var Vle=T(()=>{"use strict";f()});var Gu,Wle=T(()=>{"use strict";f();Gu=(...t)=>{typeof process<"u"&&process.env.DEBUG==="true"&&console.debug("[DEBUG] ",...t)}});var Pze,Tm,Zle,_ze,Lze,Uze,rv,GU=T(()=>{"use strict";f();Wle();Pze=()=>{if(typeof globalThis<"u"&&globalThis.crypto)return globalThis.crypto;if(typeof require<"u")try{let t=require("crypto");if(t.webcrypto)return t.webcrypto}catch{}throw new Error("Web Crypto API is not available. Requires Node.js 15+ or a browser environment.")},Tm=Pze(),Zle=async()=>{let t=await Tm.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),e=await Tm.subtle.exportKey("jwk",t);return JSON.stringify(e)},_ze=async()=>Tm.getRandomValues(new Uint8Array(16)),Lze=async(t,e,i)=>{let n=await Tm.subtle.encrypt({name:"AES-GCM",iv:e,tagLength:128},t,typeof i=="string"?new TextEncoder().encode(i):i);return Buffer.from(n)},Uze=async(t,e,i)=>{let n=await Tm.subtle.decrypt({name:"AES-GCM",iv:e,tagLength:128},t,i);return new TextDecoder().decode(n)},rv=async t=>{try{Gu("validateEncryptionKey: Validating encryption key");let e=JSON.parse(t);Gu("validateEncryptionKey: Parsed JWK");let i=await Tm.subtle.importKey("jwk",e,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]);Gu("validateEncryptionKey: Imported crypto key");let n="test",r=await _ze();Gu("validateEncryptionKey: Generated test IV",r);let s=await Lze(i,r,n);Gu("validateEncryptionKey: Encrypted test data",s);let o=new Uint8Array(s);Gu("validateEncryptionKey: Encrypted test data array",o);let a=await Uze(i,r,o);return Gu("validateEncryptionKey: Decrypted test data",a),a===n}catch(e){return console.error("Could not validate encryption key:",e),!1}}});var npe=b((LKt,ipe)=>{"use strict";f();ipe.exports=epe;function epe(t,e,i){t instanceof RegExp&&(t=Xle(t,i)),e instanceof RegExp&&(e=Xle(e,i));var n=tpe(t,e,i);return n&&{start:n[0],end:n[1],pre:i.slice(0,n[0]),body:i.slice(n[0]+t.length,n[1]),post:i.slice(n[1]+e.length)}}function Xle(t,e){var i=e.match(t);return i?i[0]:null}epe.range=tpe;function tpe(t,e,i){var n,r,s,o,a,A=i.indexOf(t),c=i.indexOf(e,A+1),u=A;if(A>=0&&c>0){if(t===e)return[A,c];for(n=[],s=i.length;u>=0&&!a;)u==A?(n.push(u),A=i.indexOf(t,u+1)):n.length==1?a=[n.pop(),c]:(r=n.pop(),r<s&&(s=r,o=c),c=i.indexOf(e,u+1)),u=A<c&&A>=0?A:c;n.length&&(a=[s,o])}return a}});var lpe=b((GKt,upe)=>{f();var rpe=npe();upe.exports=Kze;var spe="\0SLASH"+Math.random()+"\0",ope="\0OPEN"+Math.random()+"\0",KU="\0CLOSE"+Math.random()+"\0",ape="\0COMMA"+Math.random()+"\0",Ape="\0PERIOD"+Math.random()+"\0";function OU(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function Gze(t){return t.split("\\\\").join(spe).split("\\{").join(ope).split("\\}").join(KU).split("\\,").join(ape).split("\\.").join(Ape)}function Oze(t){return t.split(spe).join("\\").split(ope).join("{").split(KU).join("}").split(ape).join(",").split(Ape).join(".")}function cpe(t){if(!t)return[""];var e=[],i=rpe("{","}",t);if(!i)return t.split(",");var n=i.pre,r=i.body,s=i.post,o=n.split(",");o[o.length-1]+="{"+r+"}";var a=cpe(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function Kze(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),tE(Gze(t),!0).map(Oze)):[]}function Hze(t){return"{"+t+"}"}function Jze(t){return/^-?0\d/.test(t)}function jze(t,e){return t<=e}function Yze(t,e){return t>=e}function tE(t,e){var i=[],n=rpe("{","}",t);if(!n)return[t];var r=n.pre,s=n.post.length?tE(n.post,!1):[""];if(/\$$/.test(n.pre))for(var o=0;o<s.length;o++){var a=r+"{"+n.body+"}"+s[o];i.push(a)}else{var A=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),u=A||c,l=n.body.indexOf(",")>=0;if(!u&&!l)return n.post.match(/,.*\}/)?(t=n.pre+"{"+n.body+KU+n.post,tE(t)):[t];var p;if(u)p=n.body.split(/\.\./);else if(p=cpe(n.body),p.length===1&&(p=tE(p[0],!1).map(Hze),p.length===1))return s.map(function(w){return n.pre+p[0]+w});var d;if(u){var g=OU(p[0]),m=OU(p[1]),h=Math.max(p[0].length,p[1].length),C=p.length==3?Math.abs(OU(p[2])):1,I=jze,B=m<g;B&&(C*=-1,I=Yze);var E=p.some(Jze);d=[];for(var Q=g;I(Q,m);Q+=C){var D;if(c)D=String.fromCharCode(Q),D==="\\"&&(D="");else if(D=String(Q),E){var x=h-D.length;if(x>0){var v=new Array(x+1).join("0");Q<0?D="-"+v+D.slice(1):D=v+D}}d.push(D)}}else{d=[];for(var R=0;R<p.length;R++)d.push.apply(d,tE(p[R],!1))}for(var R=0;R<d.length;R++)for(var o=0;o<s.length;o++){var a=r+d[R]+s[o];(!e||u||a)&&i.push(a)}}return i}});var iE,ppe=T(()=>{f();iE=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")}});var qze,nE,$ze,gpe,dpe,mpe=T(()=>{f();qze={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},nE=t=>t.replace(/[[\]\\-]/g,"\\$&"),$ze=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),gpe=t=>t.join(""),dpe=(t,e)=>{let i=e;if(t.charAt(i)!=="[")throw new Error("not in a brace expression");let n=[],r=[],s=i+1,o=!1,a=!1,A=!1,c=!1,u=i,l="";e:for(;s<t.length;){let m=t.charAt(s);if((m==="!"||m==="^")&&s===i+1){c=!0,s++;continue}if(m==="]"&&o&&!A){u=s+1;break}if(o=!0,m==="\\"&&!A){A=!0,s++;continue}if(m==="["&&!A){for(let[h,[C,I,B]]of Object.entries(qze))if(t.startsWith(h,s)){if(l)return["$.",!1,t.length-i,!0];s+=h.length,B?r.push(C):n.push(C),a=a||I;continue e}}if(A=!1,l){m>l?n.push(nE(l)+"-"+nE(m)):m===l&&n.push(nE(m)),l="",s++;continue}if(t.startsWith("-]",s+1)){n.push(nE(m+"-")),s+=2;continue}if(t.startsWith("-",s+1)){l=m,s+=2;continue}n.push(nE(m)),s++}if(u<s)return["",!1,0,!1];if(!n.length&&!r.length)return["$.",!1,t.length-i,!0];if(r.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!c){let m=n[0].length===2?n[0].slice(-1):n[0];return[$ze(m),!1,u-i,!1]}let p="["+(c?"^":"")+gpe(n)+"]",d="["+(c?"":"^")+gpe(r)+"]";return[n.length&&r.length?"("+p+"|"+d+")":n.length?p:d,a,u-i,!0]}});var Ou,sv=T(()=>{f();Ou=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")});var zze,fpe,Vze,ov,Wze,Zze,Xze,eVe,HU,hpe,Cpe,Mm,JU=T(()=>{f();mpe();sv();zze=new Set(["!","?","+","*","@"]),fpe=t=>zze.has(t),Vze="(?!(?:^|/)\\.\\.?(?:$|/))",ov="(?!\\.)",Wze=new Set(["[","."]),Zze=new Set(["..","."]),Xze=new Set("().*{}+?[]^$\\!"),eVe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),HU="[^/]",hpe=HU+"*?",Cpe=HU+"+?",Mm=class t{type;#r;#m;#f=!1;#i=[];#o;#e;#a;#Q=!1;#C;#w;#k=!1;constructor(e,i,n={}){this.type=e,e&&(this.#m=!0),this.#o=i,this.#r=this.#o?this.#o.#r:this,this.#C=this.#r===this?n:this.#r.#C,this.#a=this.#r===this?[]:this.#r.#a,e==="!"&&!this.#r.#Q&&this.#a.push(this),this.#e=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#m!==void 0)return this.#m;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#m=!0;return this.#m}toString(){return this.#w!==void 0?this.#w:this.type?this.#w=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#w=this.#i.map(e=>String(e)).join("")}#R(){if(this!==this.#r)throw new Error("should only call on root");if(this.#Q)return this;this.toString(),this.#Q=!0;let e;for(;e=this.#a.pop();){if(e.type!=="!")continue;let i=e,n=i.#o;for(;n;){for(let r=i.#e+1;!n.type&&r<n.#i.length;r++)for(let s of e.#i){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#i[r])}i=n,n=i.#o}}return this}push(...e){for(let i of e)if(i!==""){if(typeof i!="string"&&!(i instanceof t&&i.#o===this))throw new Error("invalid part: "+i);this.#i.push(i)}}toJSON(){let e=this.type===null?this.#i.slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...this.#i.map(i=>i.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#r||this.#r.#Q&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#r===this)return!0;if(!this.#o?.isStart())return!1;if(this.#e===0)return!0;let e=this.#o;for(let i=0;i<this.#e;i++){let n=e.#i[i];if(!(n instanceof t&&n.type==="!"))return!1}return!0}isEnd(){if(this.#r===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#e===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let i=new t(this.type,e);for(let n of this.#i)i.copyIn(n);return i}static#t(e,i,n,r){let s=!1,o=!1,a=-1,A=!1;if(i.type===null){let d=n,g="";for(;d<e.length;){let m=e.charAt(d++);if(s||m==="\\"){s=!s,g+=m;continue}if(o){d===a+1?(m==="^"||m==="!")&&(A=!0):m==="]"&&!(d===a+2&&A)&&(o=!1),g+=m;continue}else if(m==="["){o=!0,a=d,A=!1,g+=m;continue}if(!r.noext&&fpe(m)&&e.charAt(d)==="("){i.push(g),g="";let h=new t(m,i);d=t.#t(e,h,d,r),i.push(h);continue}g+=m}return i.push(g),d}let c=n+1,u=new t(null,i),l=[],p="";for(;c<e.length;){let d=e.charAt(c++);if(s||d==="\\"){s=!s,p+=d;continue}if(o){c===a+1?(d==="^"||d==="!")&&(A=!0):d==="]"&&!(c===a+2&&A)&&(o=!1),p+=d;continue}else if(d==="["){o=!0,a=c,A=!1,p+=d;continue}if(fpe(d)&&e.charAt(c)==="("){u.push(p),p="";let g=new t(d,u);u.push(g),c=t.#t(e,g,c,r);continue}if(d==="|"){u.push(p),p="",l.push(u),u=new t(null,i);continue}if(d===")")return p===""&&i.#i.length===0&&(i.#k=!0),u.push(p),p="",i.push(...l,u),c;p+=d}return i.type=null,i.#m=void 0,i.#i=[e.substring(n-1)],c}static fromGlob(e,i={}){let n=new t(null,void 0,i);return t.#t(e,n,0,i),n}toMMPattern(){if(this!==this.#r)return this.#r.toMMPattern();let e=this.toString(),[i,n,r,s]=this.toRegExpSource();if(!(r||this.#m||this.#C.nocase&&!this.#C.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#C.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${i}$`,a),{_src:i,_glob:e})}get options(){return this.#C}toRegExpSource(e){let i=e??!!this.#C.dot;if(this.#r===this&&this.#R(),!this.type){let A=this.isStart()&&this.isEnd(),c=this.#i.map(d=>{let[g,m,h,C]=typeof d=="string"?t.#l(d,this.#m,A):d.toRegExpSource(e);return this.#m=this.#m||h,this.#f=this.#f||C,g}).join(""),u="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&Zze.has(this.#i[0]))){let g=Wze,m=i&&g.has(c.charAt(0))||c.startsWith("\\.")&&g.has(c.charAt(2))||c.startsWith("\\.\\.")&&g.has(c.charAt(4)),h=!i&&!e&&g.has(c.charAt(0));u=m?Vze:h?ov:""}let l="";return this.isEnd()&&this.#r.#Q&&this.#o?.type==="!"&&(l="(?:$|\\/)"),[u+c+l,Ou(c),this.#m=!!this.#m,this.#f]}let n=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#A(i);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let A=this.toString();return this.#i=[A],this.type=null,this.#m=void 0,[A,Ou(this.toString()),!1,!1]}let o=!n||e||i||!ov?"":this.#A(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#k)a=(this.isStart()&&!i?ov:"")+Cpe;else{let A=this.type==="!"?"))"+(this.isStart()&&!i&&!e?ov:"")+hpe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=r+s+A}return[a,Ou(s),this.#m=!!this.#m,this.#f]}#A(e){return this.#i.map(i=>{if(typeof i=="string")throw new Error("string type in extglob ast??");let[n,r,s,o]=i.toRegExpSource(e);return this.#f=this.#f||o,n}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")}static#l(e,i,n=!1){let r=!1,s="",o=!1;for(let a=0;a<e.length;a++){let A=e.charAt(a);if(r){r=!1,s+=(Xze.has(A)?"\\":"")+A;continue}if(A==="\\"){a===e.length-1?s+="\\\\":r=!0;continue}if(A==="["){let[c,u,l,p]=dpe(e,a);if(l){s+=c,o=o||u,a+=l-1,i=i||p;continue}}if(A==="*"){n&&e==="*"?s+=Cpe:s+=hpe,i=!0;continue}if(A==="?"){s+=HU,i=!0;continue}s+=eVe(A)}return[s,Ou(e),!!i,o]}}});var jU,YU=T(()=>{f();jU=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")});var Bpe,gr,tVe,iVe,nVe,rVe,sVe,oVe,aVe,AVe,cVe,uVe,lVe,pVe,gVe,dVe,mVe,fVe,hVe,CVe,Qpe,ype,Dpe,Ipe,IVe,No,EVe,BVe,QVe,yVe,DVe,Ro,xVe,xpe,vVe,wVe,Epe,bVe,Pm,vpe=T(()=>{f();Bpe=ie(lpe(),1);ppe();JU();YU();sv();JU();YU();sv();gr=(t,e,i={})=>(iE(e),!i.nocomment&&e.charAt(0)==="#"?!1:new Pm(e,i).match(t)),tVe=/^\*+([^+@!?\*\[\(]*)$/,iVe=t=>e=>!e.startsWith(".")&&e.endsWith(t),nVe=t=>e=>e.endsWith(t),rVe=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),sVe=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),oVe=/^\*+\.\*+$/,aVe=t=>!t.startsWith(".")&&t.includes("."),AVe=t=>t!=="."&&t!==".."&&t.includes("."),cVe=/^\.\*+$/,uVe=t=>t!=="."&&t!==".."&&t.startsWith("."),lVe=/^\*+$/,pVe=t=>t.length!==0&&!t.startsWith("."),gVe=t=>t.length!==0&&t!=="."&&t!=="..",dVe=/^\?+([^+@!?\*\[\(]*)?$/,mVe=([t,e=""])=>{let i=Qpe([t]);return e?(e=e.toLowerCase(),n=>i(n)&&n.toLowerCase().endsWith(e)):i},fVe=([t,e=""])=>{let i=ype([t]);return e?(e=e.toLowerCase(),n=>i(n)&&n.toLowerCase().endsWith(e)):i},hVe=([t,e=""])=>{let i=ype([t]);return e?n=>i(n)&&n.endsWith(e):i},CVe=([t,e=""])=>{let i=Qpe([t]);return e?n=>i(n)&&n.endsWith(e):i},Qpe=([t])=>{let e=t.length;return i=>i.length===e&&!i.startsWith(".")},ype=([t])=>{let e=t.length;return i=>i.length===e&&i!=="."&&i!==".."},Dpe=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ipe={win32:{sep:"\\"},posix:{sep:"/"}},IVe=Dpe==="win32"?Ipe.win32.sep:Ipe.posix.sep;gr.sep=IVe;No=Symbol("globstar **");gr.GLOBSTAR=No;EVe="[^/]",BVe=EVe+"*?",QVe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",yVe="(?:(?!(?:\\/|^)\\.).)*?",DVe=(t,e={})=>i=>gr(i,t,e);gr.filter=DVe;Ro=(t,e={})=>Object.assign({},t,e),xVe=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return gr;let e=gr;return Object.assign((n,r,s={})=>e(n,r,Ro(t,s)),{Minimatch:class extends e.Minimatch{constructor(r,s={}){super(r,Ro(t,s))}static defaults(r){return e.defaults(Ro(t,r)).Minimatch}},AST:class extends e.AST{constructor(r,s,o={}){super(r,s,Ro(t,o))}static fromGlob(r,s={}){return e.AST.fromGlob(r,Ro(t,s))}},unescape:(n,r={})=>e.unescape(n,Ro(t,r)),escape:(n,r={})=>e.escape(n,Ro(t,r)),filter:(n,r={})=>e.filter(n,Ro(t,r)),defaults:n=>e.defaults(Ro(t,n)),makeRe:(n,r={})=>e.makeRe(n,Ro(t,r)),braceExpand:(n,r={})=>e.braceExpand(n,Ro(t,r)),match:(n,r,s={})=>e.match(n,r,Ro(t,s)),sep:e.sep,GLOBSTAR:No})};gr.defaults=xVe;xpe=(t,e={})=>(iE(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,Bpe.default)(t));gr.braceExpand=xpe;vVe=(t,e={})=>new Pm(t,e).makeRe();gr.makeRe=vVe;wVe=(t,e,i={})=>{let n=new Pm(e,i);return t=t.filter(r=>n.match(r)),n.options.nonull&&!t.length&&t.push(e),t};gr.match=wVe;Epe=/[?*]|[+@!]\(.*?\)|\[|\]/,bVe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Pm=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,i={}){iE(e),i=i||{},this.options=i,this.pattern=e,this.platform=i.platform||Dpe,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!i.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!i.nonegate,this.comment=!1,this.empty=!1,this.partial=!!i.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=i.windowsNoMagicRoot!==void 0?i.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let i of e)if(typeof i!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,i=this.options;if(!i.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],i.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let A=s[0]===""&&s[1]===""&&(s[2]==="?"||!Epe.test(s[2]))&&!Epe.test(s[3]),c=/^[a-z]:/i.test(s[0]);if(A)return[...s.slice(0,4),...s.slice(4).map(u=>this.parse(u))];if(c)return[s[0],...s.slice(1).map(u=>this.parse(u))]}return s.map(A=>this.parse(A))});if(this.debug(this.pattern,r),this.set=r.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let r=0;r<e[n].length;r++)e[n][r]==="**"&&(e[n][r]="*");let{optimizationLevel:i=1}=this.options;return i>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):i>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(i=>{let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let r=n;for(;i[r+1]==="**";)r++;r!==n&&i.splice(n,r-n)}return i})}levelOneOptimize(e){return e.map(i=>(i=i.reduce((n,r)=>{let s=n[n.length-1];return r==="**"&&s==="**"?n:r===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(r),n)},[]),i.length===0?[""]:i))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let i=!1;do{if(i=!1,!this.preserveMultipleSlashes){for(let r=1;r<e.length-1;r++){let s=e[r];r===1&&s===""&&e[0]===""||(s==="."||s==="")&&(i=!0,e.splice(r,1),r--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(i=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let r=e[n-1];r&&r!=="."&&r!==".."&&r!=="**"&&(i=!0,e.splice(n-1,2),n-=2)}}while(i);return e.length===0?[""]:e}firstPhasePreProcess(e){let i=!1;do{i=!1;for(let n of e){let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o>r&&n.splice(r+1,o-r);let a=n[r+1],A=n[r+2],c=n[r+3];if(a!==".."||!A||A==="."||A===".."||!c||c==="."||c==="..")continue;i=!0,n.splice(r,1);let u=n.slice(0);u[r]="**",e.push(u),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(i=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(i=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){i=!0;let A=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...A),n.length===0&&n.push(""),s-=2}}}}while(i);return e}secondPhasePreProcess(e){for(let i=0;i<e.length-1;i++)for(let n=i+1;n<e.length;n++){let r=this.partsMatch(e[i],e[n],!this.preserveMultipleSlashes);if(r){e[i]=[],e[n]=r;break}}return e.filter(i=>i.length)}partsMatch(e,i,n=!1){let r=0,s=0,o=[],a="";for(;r<e.length&&s<i.length;)if(e[r]===i[s])o.push(a==="b"?i[s]:e[r]),r++,s++;else if(n&&e[r]==="**"&&i[s]===e[r+1])o.push(e[r]),r++;else if(n&&i[s]==="**"&&e[r]===i[s+1])o.push(i[s]),s++;else if(e[r]==="*"&&i[s]&&(this.options.dot||!i[s].startsWith("."))&&i[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[r]),r++,s++}else if(i[s]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="a")return!1;a="b",o.push(i[s]),r++,s++}else return!1;return e.length===i.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,i=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)==="!";r++)i=!i,n++;n&&(this.pattern=e.slice(n)),this.negate=i}matchOne(e,i,n=!1){let r=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),h=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),C=typeof i[0]=="string"&&/^[a-z]:$/i.test(i[0]),I=!C&&i[0]===""&&i[1]===""&&i[2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3]),B=h?3:m?0:void 0,E=I?3:C?0:void 0;if(typeof B=="number"&&typeof E=="number"){let[Q,D]=[e[B],i[E]];Q.toLowerCase()===D.toLowerCase()&&(i[E]=Q,E>B?i=i.slice(E):B>E&&(e=e.slice(B)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:i}),this.debug("matchOne",e.length,i.length);for(var o=0,a=0,A=e.length,c=i.length;o<A&&a<c;o++,a++){this.debug("matchOne loop");var u=i[a],l=e[o];if(this.debug(i,u,l),u===!1)return!1;if(u===No){this.debug("GLOBSTAR",[i,u,l]);var p=o,d=a+1;if(d===c){for(this.debug("** at the end");o<A;o++)if(e[o]==="."||e[o]===".."||!r.dot&&e[o].charAt(0)===".")return!1;return!0}for(;p<A;){var g=e[p];if(this.debug(`
|
|
1822
1822
|
globstar while`,e,p,i,d,g),this.matchOne(e.slice(p),i.slice(d),n))return this.debug("globstar found match!",p,A,g),!0;if(g==="."||g===".."||!r.dot&&g.charAt(0)==="."){this.debug("dot detected!",e,p,i,d);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(n&&(this.debug(`
|
|
1823
1823
|
>>> no match, partial?`,e,p,i,d),p===A))}let m;if(typeof u=="string"?(m=l===u,this.debug("string match",u,l,m)):(m=u.test(l),this.debug("pattern match",u,l,m)),!m)return!1}if(o===A&&a===c)return!0;if(o===A)return n;if(a===c)return o===A-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return xpe(this.pattern,this.options)}parse(e){iE(e);let i=this.options;if(e==="**")return No;if(e==="")return"";let n,r=null;(n=e.match(lVe))?r=i.dot?gVe:pVe:(n=e.match(tVe))?r=(i.nocase?i.dot?sVe:rVe:i.dot?nVe:iVe)(n[1]):(n=e.match(dVe))?r=(i.nocase?i.dot?fVe:mVe:i.dot?hVe:CVe)(n):(n=e.match(oVe))?r=i.dot?AVe:aVe:(n=e.match(cVe))&&(r=uVe);let s=Mm.fromGlob(e,this.options).toMMPattern();return r&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:r}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let i=this.options,n=i.noglobstar?BVe:i.dot?QVe:yVe,r=new Set(i.nocase?["i"]:[]),s=e.map(A=>{let c=A.map(u=>{if(u instanceof RegExp)for(let l of u.flags.split(""))r.add(l);return typeof u=="string"?bVe(u):u===No?No:u._src});return c.forEach((u,l)=>{let p=c[l+1],d=c[l-1];u!==No||d===No||(d===void 0?p!==void 0&&p!==No?c[l+1]="(?:\\/|"+n+"\\/)?"+p:c[l]=n:p===void 0?c[l-1]=d+"(?:\\/|"+n+")?":p!==No&&(c[l-1]=d+"(?:\\/|\\/"+n+"\\/)"+p,c[l+1]=No))}),c.filter(u=>u!==No).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,i=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&i)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let r=this.slashSplit(e);this.debug(this.pattern,"split",r);let s=this.set;this.debug(this.pattern,"set",s);let o=r[r.length-1];if(!o)for(let a=r.length-2;!o&&a>=0;a--)o=r[a];for(let a=0;a<s.length;a++){let A=s[a],c=r;if(n.matchBase&&A.length===1&&(c=[o]),this.matchOne(c,A,i))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return gr.defaults(e).Minimatch}};gr.AST=Mm;gr.Minimatch=Pm;gr.escape=jU;gr.unescape=Ou});async function SVe(t,e,i){let n=t.builderPublicKey;if(!n)return[];let r=new URL(`${Je}/projects/memories`);r.searchParams.set("apiKey",n),r.searchParams.set("projectId",e),t.userId&&r.searchParams.set("userId",t.userId);let s={"Content-Type":"application/json"};t.builderPrivateKey&&(s.Authorization=`Bearer ${t.builderPrivateKey}`);let a=await(await He(r,{method:"GET",headers:s,keepalive:!0,signal:i})).json();return Array.isArray(a?.memories)?a.memories:[]}function FVe(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function wpe(t){return t.replace(/[*?{}[\]!]/g,"").replace(/\/+/g,"/").toLowerCase()}async function kVe(t,e){let i=Av.default.join(e,".builder","memories"),n=new Map;for(let s of t){let o=s.category||"general";n.has(o)||n.set(o,[]),n.get(o).push(s)}if(n.size===0)return;await av.default.mkdir(i,{recursive:!0});let r=[];for(let[s,o]of n){let a=`${FVe(s)}.md`,A=Av.default.join(i,a),c=o.filter(g=>g.glob),u=o.filter(g=>!g.glob),l=new Map;for(let g of c){let m=g.glob;l.has(m)||l.set(m,[]),l.get(m).push(g)}let p=[...l.keys()].sort((g,m)=>wpe(g).localeCompare(wpe(m))),d=[];if(d.push(`# ${s}`),d.push(""),p.length>0){d.push("## File-specific"),d.push("");for(let g of p){let m=l.get(g);d.push(`### \`${g}\``),d.push("");for(let h of m)d.push(`- **When**: ${h.when}`),d.push(` ${h.memory}`),d.push("")}}if(u.length>0){d.push("## General"),d.push("");for(let g of u)d.push(`- **When**: ${g.when}`),d.push(` ${g.memory}`),d.push("")}r.push(av.default.writeFile(A,d.join(`
|
|
1824
|
-
`),"utf-8"))}await Promise.all(r)}function RVe(t){let e=[],i=0,n=0;for(let r=0;r<t.length;r++){let s=t[r];s==="{"?i++:s==="}"&&i>0?i--:s===","&&i===0&&(e.push(t.slice(n,r)),n=r+1)}return e.push(t.slice(n)),e.map(r=>r.trim()).filter(Boolean)}function bpe(t,e){if(!e)return[];let i=e.replace(/\\/g,"/");return t.filter(n=>n.glob?RVe(n.glob).some(s=>{try{return gr(i,s.replace(/\\/g,"/"),{matchBase:!0})}catch{return!1}}):!1)}async function Spe(t,e,i,n){try{return await SVe(e,i,n)}catch(r){return t.Sentry?.captureException(new Error("Failed to load memories",{cause:r})),[]}}async function Fpe(t,e,i){try{let n=Av.default.join(i,".builder","memories");await av.default.rm(n,{recursive:!0,force:!0}),e.length>0&&await kVe(e,i)}catch(n){t.Sentry?.captureException(new Error("Failed to sync memories to disk",{cause:n}))}}var av,Av,kpe=T(()=>{"use strict";f();av=ie(require("node:fs/promises"),1),Av=ie(require("node:path"),1);vpe();an();ln()});function NVe(){if(rE!==void 0)return rE;try{return rE=require("prettier"),rE}catch{return rE=null,null}}var vp,Npe,Tpe,lv,uv,Mpe,rE,Rpe,TVe,CA,cv,Lm=T(()=>{"use strict";f();Yl();fie();Qn();Cs();an();ln();vp=ie(require("node:fs"),1);MM();Iie();PM();gC();yie();Npe=ie(require("node:os"),1);Sr();xie();g0();cne();lne();zM();Tpe=ie(require("chokidar"),1);pne();qU();hne();QT();ti();lv=ie(require("node:events"),1);uC();uv=require("node:crypto");PC();xne();KT();OD();pd();zle();FC();Vle();Mpe=require("node:fs/promises");GU();KD();DC();ZA();kpe();pa();JD();kD();WM();VM();Rpe=["ask-to-continue","credits-limit-daily","credits-limit-monthly","credits-limit-other","invalid-last-message"],TVe=["initial-with-url","initial-without-url","success"],CA=class t{#r;#m;#f;#i=[];#o;#e;#a;#Q;#C;#w;#k;#R;#t=process.env.FUSION_DEBUG==="true";#A=new lv.default;#l=new Map;#p;#z;#V;#
|
|
1824
|
+
`),"utf-8"))}await Promise.all(r)}function RVe(t){let e=[],i=0,n=0;for(let r=0;r<t.length;r++){let s=t[r];s==="{"?i++:s==="}"&&i>0?i--:s===","&&i===0&&(e.push(t.slice(n,r)),n=r+1)}return e.push(t.slice(n)),e.map(r=>r.trim()).filter(Boolean)}function bpe(t,e){if(!e)return[];let i=e.replace(/\\/g,"/");return t.filter(n=>n.glob?RVe(n.glob).some(s=>{try{return gr(i,s.replace(/\\/g,"/"),{matchBase:!0})}catch{return!1}}):!1)}async function Spe(t,e,i,n){try{return await SVe(e,i,n)}catch(r){return t.Sentry?.captureException(new Error("Failed to load memories",{cause:r})),[]}}async function Fpe(t,e,i){try{let n=Av.default.join(i,".builder","memories");await av.default.rm(n,{recursive:!0,force:!0}),e.length>0&&await kVe(e,i)}catch(n){t.Sentry?.captureException(new Error("Failed to sync memories to disk",{cause:n}))}}var av,Av,kpe=T(()=>{"use strict";f();av=ie(require("node:fs/promises"),1),Av=ie(require("node:path"),1);vpe();an();ln()});function NVe(){if(rE!==void 0)return rE;try{return rE=require("prettier"),rE}catch{return rE=null,null}}var vp,Npe,Tpe,lv,uv,Mpe,rE,Rpe,TVe,CA,cv,Lm=T(()=>{"use strict";f();Yl();fie();Qn();Cs();an();ln();vp=ie(require("node:fs"),1);MM();Iie();PM();gC();yie();Npe=ie(require("node:os"),1);Sr();xie();g0();cne();lne();zM();Tpe=ie(require("chokidar"),1);pne();qU();hne();QT();ti();lv=ie(require("node:events"),1);uC();uv=require("node:crypto");PC();xne();KT();OD();pd();zle();FC();Vle();Mpe=require("node:fs/promises");GU();KD();DC();ZA();kpe();pa();JD();kD();WM();VM();Rpe=["ask-to-continue","credits-limit-daily","credits-limit-monthly","credits-limit-other","invalid-last-message"],TVe=["initial-with-url","initial-without-url","success"],CA=class t{#r;#m;#f;#i=[];#o;#e;#a;#Q;#C;#w;#k;#R;#t=process.env.FUSION_DEBUG==="true";#A=new lv.default;#l=new Map;#p;#z;#V;#oe;#he=[];#Fe=void 0;#qe=Promise.resolve(void 0);#U=[];#F;#T=[];#ae;#J=new Map;#$e=[];#W;#ft=0;#Z;#G;#u;#g;#ze;#ke;#Re;#Ce=!1;#Ae;#ce=void 0;#Ne;#Te;#Ie;#X;#d;#c=[];#y;#Ve;#h;#Me;#ue;#Ee=0;#ee;#E;#We=[];#Ze=new Set;#s;#D;#O;#Xe;#j;#Be=!1;#et=0;#te=null;#ie=0;#Y=!1;#N=!1;#Qe;#ye;#De;#tt;#it;#ne=[];#xe=[];#le;#M={};#ht=new Set;#ve;#b={};#Pe;#_e=[];#pe=null;#nt=void 0;#B=new Map;#I={watcher:null,listeners:new Set,debounceMs:300,pendingEvents:[]};#rt=!1;#n=null;#we=new Set;get#v(){return this.#c[0]?.path||this.#d}#ge(e){if(!e)return this.#v;let i=this.#c.find(n=>n.folderName===e);if(!i)throw new Error(`Folder "${e}" not found in git-enabled folders`);return i.path}#st(e,i){if(i)return{repoPath:this.#ge(i),relativePath:e};for(let n of this.#c){let r=`${n.folderName}/`;if(e.startsWith(r))return{repoPath:n.path,relativePath:e.slice(r.length)}}return{repoPath:this.#v,relativePath:e}}constructor(e){if(this.#e=e.sys,this.#j=e.modelOverride,this.#a=e.credentials,"initialUrl"in e){let n=gee(e.initialUrl).id;n?this.#G=n:this.#Q=e.initialUrl}typeof e.autoImportLocalMCPs=="boolean"&&(this.#rt=e.autoImportLocalMCPs),"sessionOrCompletionId"in e?this.#G=e.sessionOrCompletionId:this.#G=e.fusionConfig?.sessionId;let i=e.workingDirectory??e.fusionConfig?.workingDirectory;if(this.#d=i?e.sys.resolve(e.sys.cwd(),i):e.sys.getCwdDir(),this.#w=e.skipFileDiff??!0,this.#C=e.position,this.#p=e.mode,this.#F=e.privacyMode??e.fusionConfig?.privacyMode,this.#u=e.devServerOrchestrator,this.#g=e.git??!1,this.#g&&(process.env.GIT_CEILING_DIRECTORIES=this.#d),this.#ze=e.gitAutoInit??!1,this.#s=e.fusionConfig,this.#z=e.fusionConfig?.autoPush,this.#D=e.fusionConfig?.projectId,this.#O=e.fusionConfig?.branchName,this.#V=e.fusionConfig?.featureBranch,this.#oe=e.fusionConfig?.aiBranch,this.#Qe=e.fusionConfig?.proxyOrigin,this.#ye=e.fusionConfig?.proxyDefaultOrigin,this.#ke=e.fusionStatusMonitor,process.env.FUSION_ENV_ORIGIN&&(this.#tt=process.env.FUSION_ENV_ORIGIN),this.#De=e.agentType,e.enabledTools)this.#E=cv(this.#s,e.enabledTools);else if(this.#p==="quality-v3"){let n=["write_file","search_replace_file","view_path","get_rule","get_style_inspiration","grep_search","web_search","find_media",process.platform==="win32"?"powershell":"bash"];this.#u&&n.push("dev_server_control"),this.#E=cv(this.#s,n)}else if(this.#p==="quality-v4"){let n=["Write","Edit","Read","MultiEdit","Grep","Glob","ReadRule","TodoRead","TodoWrite","Agent","Media","WebFetch","AskUserQuestion","ExitPlanMode","EnterPlanMode",process.platform==="win32"?"PowerShell":"Bash"],r=!!(this.#F?.enabled||this.#F?.redactUserMessages||this.#F?.redactLLMMessages);r||n.push("WebSearch"),this.#D&&!r&&this.getCommitMode()!=="commits"&&n.push("SearchMemories"),r||n.push("GetScreenshot"),this.#u&&n.push("DevServerControl"),this.#E=cv(this.#s,n)}if(this.#Ve=e.maxTokens,this.#Ne=e.builtInCustomInstructions??[],this.#Te=e.builtInCustomAgents??[],this.#Ie=e.builtInMCPServerConfig??{},this.#X=e.systemPromptOverride,this.#h=e.fusionConfig?.workspace,this.#Me=e.mcpServers??!1,this.#y=this.#d,this.#c=[],this.#h?.folders.length){let n=this.#h.folders.filter(s=>s.enableGit);this.#c=n.map(s=>({folderName:s.name||s.path,path:this.#e.resolve(this.#d,s.path),branchName:s.branchName||"main",repoUrl:s.repoUrl,repoName:s.repoName}));let r=n[0];if(r){let s=r.backupMetadata?.check.backup;this.#le=kC({version:s?.version,originalRepoUrl:s?.repoUrl,commitHash:s?.lastCommitHash})}}this.#c.length===0&&(this.#c=[{folderName:TC,path:this.#d,branchName:"main"}]),this.#ve=vee(this.#h),this.#h?.folders[0]&&this.#S()&&(this.#y=this.#e.resolve(this.#d,this.#h.folders[0].path))}get fusionConfig(){return this.#s}get gitEnabledFolder(){return this.#h?.folders.find(e=>e.enableGit)}get gitEnabledFolders(){return this.#h?.folders.filter(e=>e.enableGit)||[]}get gitRepoContexts(){return this.#c}get workingDirectory(){return this.#d}getSessionMode(){return this.#r?.sessionMode??"normal"}async switchSessionMode(e){let i=this.getSessionContext();i.sessionMode!==e&&(i.sessionMode=e,this.#N=!1,await this.#fe())}removeSystemReminder(e){let i=this.#T.findIndex(n=>n.tag===e);i!==-1&&this.#T.splice(i,1)}getMemoriesForFile(e){let i=bpe(this.#We,e).filter(n=>!this.#Ze.has(n.id));for(let n of i)this.#Ze.add(n.id);return i}queueSystemReminder(e){let i=e.tag?this.#T.findIndex(n=>n.tag===e.tag):-1;return i!==-1?e.text?(this.#T[i]=e,{operation:"update"}):(this.#T.splice(i,1),{operation:"delete"}):e.text?(this.#T.push(e),{operation:"add"}):{operation:"noop"}}setDefaultAutoPush(e){this.#z=e}async setPrivacyMode(e){if(e&&e.enabled){if(!e.encryptKey&&!this.#ae)this.#ae=await Zle();else if(e.encryptKey){if(!await rv(e.encryptKey))throw new Error("Invalid encryption key: key failed validation");this.#ae=e.encryptKey}}else this.#ae=void 0;this.#F=e}async initializeSession(e={}){return this.#Re||(this.#Re=this.#Et(e)),await this.#Re}async loadHistory(){let e=this.getSessionContext(),i=await _D(this.#e,this.#a,e.sessionId,!1),n=new Map,r=new Map;for(let a of i.turns)for(let A of[a.beforeCommit,a.afterCommit,a.lastCommit]){if(!A)continue;let c=$d(A,this.gitRepoContexts[0]?.folderName);n.set(A,c);for(let[u,l]of Object.entries(c))r.has(u)||r.set(u,new Set),r.get(u).add(l)}let s=new Map;for(let[a,A]of r.entries()){let c=this.gitRepoContexts.find(l=>l.folderName===a);if(!c||A.size===0)continue;let u=new Set;try{let p=(await this.git(["cat-file","--batch-check","--buffer"],{sys:this.#e,cwd:c.path,stdin:Array.from(A).map(g=>`${g}^{commit}`).join(`
|
|
1825
1825
|
`)})).trim().split(`
|
|
1826
|
-
`),d=new Set;for(let g of p)if(g.includes("missing")){let m=g.split(/\s+/)[0].replace("^{commit}","");d.add(m)}for(let g of A)d.has(g)||u.add(g)}catch(l){this.#e.Sentry?.captureException(l)}s.set(a,u)}let o=i.turns.filter(a=>{for(let A of[a.beforeCommit,a.afterCommit,a.lastCommit]){if(!A)continue;let c=n.get(A);if(c)for(let[u,l]of Object.entries(c)){if(!this.gitRepoContexts.find(g=>g.folderName===u))continue;let d=s.get(u);if(!d||!d.has(l))return!1}}return!0});return{sessionId:e.sessionId,title:e.title,beforeCommit:e.beforeCommit,createdUnixTime:e.createdUnixTime,updatedUnixTime:e.updatedUnixTime,turns:o}}async loadWholeSession(e={}){let{getAll:i=!0}=e,n=this.getSessionContext(),r=0;for(;n.canLoadMore&&n.canLoadMore;){let s=await this.loadMoreTurns();r+=s.length}return{sessionId:n.sessionId,title:n.title,beforeCommit:n.beforeCommit,createdUnixTime:n.createdUnixTime,updatedUnixTime:n.updatedUnixTime,addedTurns:r,turns:i?n.turns:n.turns.slice(0,r)}}async loadMoreTurns(){return this.#
|
|
1826
|
+
`),d=new Set;for(let g of p)if(g.includes("missing")){let m=g.split(/\s+/)[0].replace("^{commit}","");d.add(m)}for(let g of A)d.has(g)||u.add(g)}catch(l){this.#e.Sentry?.captureException(l)}s.set(a,u)}let o=i.turns.filter(a=>{for(let A of[a.beforeCommit,a.afterCommit,a.lastCommit]){if(!A)continue;let c=n.get(A);if(c)for(let[u,l]of Object.entries(c)){if(!this.gitRepoContexts.find(g=>g.folderName===u))continue;let d=s.get(u);if(!d||!d.has(l))return!1}}return!0});return{sessionId:e.sessionId,title:e.title,beforeCommit:e.beforeCommit,createdUnixTime:e.createdUnixTime,updatedUnixTime:e.updatedUnixTime,turns:o}}async loadWholeSession(e={}){let{getAll:i=!0}=e,n=this.getSessionContext(),r=0;for(;n.canLoadMore&&n.canLoadMore;){let s=await this.loadMoreTurns();r+=s.length}return{sessionId:n.sessionId,title:n.title,beforeCommit:n.beforeCommit,createdUnixTime:n.createdUnixTime,updatedUnixTime:n.updatedUnixTime,addedTurns:r,turns:i?n.turns:n.turns.slice(0,r)}}async loadMoreTurns(){return this.#Ae||(this.#Ae=this.#Ct().then(e=>(this.#Ae=void 0,e))),this.#Ae}async#Ct(){let e=this.getSessionContext();if(e.canLoadMore){let i=e.turns[0]?.completionId,n=await _D(this.#e,this.#a,e.sessionId,!0,i);return n.turns.length>0&&e.turns.unshift(...n.turns),e.canLoadMore=n.canLoadMore,n.turns}return[]}async#It(){try{let e=NVe();if(!e)return null;let i=this.#e.join(this.#v,"file.tsx");return await e.resolveConfig(i)}catch{return null}}async setCustomInstructions(e){this.#Ne=e,this.#r&&(this.#r.customInstructions=await this.#be())}async setCustomAgents(e){this.#Te=e,this.#r&&(this.#r.customAgents=await this.#Se())}async#be(){let i=(await Promise.all(this.#c.map(n=>BT({sys:this.#e,projectDir:this.#d,currentDir:n.path,rootDir:"/"})))).flat();return yT(this.#Ne??[],i)}async#Se(){if(!this.#E?.includes("Agent"))return[];let i=(await Promise.all(this.#c.map(n=>fne({sys:this.#e,projectDir:this.#d,currentDir:n.path,rootDir:"/"})))).flat();return yT(this.#Te??[],i)}async#Et(e){try{if(this.#Be)throw new Error("Code session already closed");if(this.#r)throw new Error("Session context already initialized");this.#t&&console.log(`[INITIALIZE]: Current AI working directory: ${this.#d}`),await this.setPrivacyMode(this.#F);let i=await this.#Qt(),n=await this.#It();i&&(this.#b=await this.#P());let r=this.#c[0]?.repoUrl;this.#Xe=await $M(r);let s,o;this.#G||(this.#G=i?.sessionId),this.#G?e.skipSessionLoading?s=this.#G:(o=await _D(this.#e,this.#a,this.#G,!0,void 0,e.signal),s=o.sessionId,this.#t&&console.log(`[INITIALIZE]: Session recovered (sessionId=${s}, turnsCount=${o.turns.length})`)):s=(0,uv.randomUUID)(),this.#V||(this.#V=i?.featureBranch?.trim());let a={turns:o?.turns??[],sessionId:s,customInstructions:await this.#be(),customAgents:await this.#Se(),title:o?.title,beforeCommit:o?.beforeCommit,createdUnixTime:o?.createdUnixTime??Date.now(),updatedUnixTime:o?.updatedUnixTime??Date.now(),userContext:await LD(this.#e,this.#v),prettierConfig:n,canLoadMore:o?.canLoadMore??!1,state:o?.turns.length?"success":this.#Q?"initial-with-url":"initial-without-url",sessionMode:o?.sessionMode??"normal"};if(this.#M=o?.metadata??{},o){let c=iA(o.turns);c?.completionId!==o.lastCompletionId&&this.#e.Sentry?.captureException(new Error("Last completion id mismatch"),{tags:{operation:"codegen-initialize-session"},extra:{lastTurn:c,sessionMetadata:o}})}this.#t&&this.#A.on("step",c=>{c.type!=="delta"&&console.log(`[EVENT](${c.type}): ${JSON.stringify(c)}`)}),await this.#Dt(a),this.#r=a;try{let c=await $le(this.#e,this.#v,this.#Ie,this.#rt,this.#t,e.signal);c.length>0?(this.#t&&console.log(`[INITIALIZE] Initializing ${c.length} local MCP server(s)...`),this.#ue=await qle(c,this.#e,this.#v,this.#t,e.signal)):this.#t&&console.log(`[INITIALIZE] No local MCP servers found in: ${this.#v}`)}catch(c){this.#t&&console.error("[INITIALIZE] Failed to initialize local MCP servers:",c)}if(this.#g&&this.#D&&this.#E?.includes("SearchMemories")){let c=await Spe(this.#e,this.#a,this.#D,e.signal);await Fpe(this.#e,c,this.#y),this.#We=c,this.#E&&c.length===0&&(this.#E=this.#E.filter(u=>u!=="SearchMemories"))}let A=this.#u;if(A){let c=()=>{this.#A.emit("step",FT(A,this.#s))},u=()=>{this.#A.emit("step",FT(A,this.#s)),this.#fe(),this.#me()},l=p=>{p==="ok-2xx"&&this.requestRefresh()};A.emitter.on("setupState",u),A.emitter.on("devState",u),A.emitter.on("httpServerData",u),A.emitter.on("httpServerState",l),A.emitter.on("validateState",c),this.#$e.push(()=>{A.emitter.off("setupState",u),A.emitter.off("devState",u),A.emitter.off("httpServerData",u),A.emitter.off("httpServerState",l),A.emitter.off("validateState",c)})}if(this.#De){let c=await this.getNamedAgentConfig(this.#De,this.getSessionId(),e.signal);c.success?(this.#k=c.options.includeMemories,this.#E=c.options.enabledTools,this.#j=c.options.modelOverride,this.#p=c.options.mode,this.#X=c.options.systemPromptOverride,this.#C=c.options.position,this.#Ie={...this.#Ie,...c.options.builtInMCPServerConfig},typeof c.options.mcpServers=="boolean"&&(this.#Me=c.options.mcpServers)):console.error(c.response)}}catch(i){throw console.error(i),this.#e.Sentry?.captureException(i,{tags:{operation:"codegen-initialize-session"}}),i}}async#Le(e,i){let n="reminder:health";this.removeSystemReminder(n);let r=this.#u;if(!r||!this.#E?.includes("DevServerControl"))return;let o=this.getSessionContext();if(o.sessionMode!=="normal")return;e&&await r.waitUntilIdle(500,500);let a=r.setupState,A=await this.#Ge(),c=r.devCommand,u=r.devState,l=r.state,p=r.setupCommand,d=await r.getOpenPorts(),g=r.proxyTarget,m=r.httpServerState.state,h=r.lastServerStatus,C=m==="error-fetch",I=!1;this.#g&&(I=await this.getCurrentBranch()!==this.getAiBranch());let B=m==="error-5xx"||m==="error-4xx"&&h!==401&&h!==404,E="",Q=!1,D=!1;l==="install-failed"||l==="install-aborted"?E=r.getSetupOutput():(E=r.getCheckpoints(1,u!=="running"?"err":"all"),Q=Cee(E??""));let x="",v="",R="error",w="Try to fix",F="repair-unknown";if(l==="not-installed"||l==="install-failed"||l==="install-aborted"||l==="failed"||I||C||B||Q||A.length>0){if(I&&(F="repair-bad-branch",v+=`- The current git branch is not the AI branch (${this.getAiBranch()}).
|
|
1827
1827
|
`,v+=`- Please switch to the AI branch using the 'git' tool.
|
|
1828
1828
|
`,x=`The current branch is not the AI branch (${this.getAiBranch()}).`),A.length>0){F="repair-merge-conflict",w="Resolve conflict",x="Merge conflict detected - changes from different sources need to be combined";let $=this.#Pe,M=$?`
|
|
1829
1829
|
ours (:2:) = ${$.ourBranch} (AI branch), theirs (:3:) = ${$.theirBranch} (${$.theirIsMain?"main \u2014 prefer preserving these changes":"AI remote"})`:"";v+=`Merge conflict detected. Resolve ALL conflicted files:
|
|
@@ -1874,20 +1874,20 @@ ${r.getSetupOutput().slice(-8e3)}
|
|
|
1874
1874
|
`:E&&(v+=`<dev_logs>
|
|
1875
1875
|
${E}
|
|
1876
1876
|
</dev_logs>
|
|
1877
|
-
`)}(i==="all"||i==="critical"&&!D)&&this.queueSystemReminder({text:fC(v,2e3),tag:n});let O={devServerState:u,setupState:a,httpServerState:m,proxyServer:g,devCommand:c,setupCommand:p,hasMergeConflict:A.length>0,hasConfigurationIssue:D,logs:E,prompt:"Debug and fix the issue before continuing.",message:x},j=this.#i.length===0&&TVe.includes(o.state);return{actionButtonText:w,type:"build-error",level:R,canAutoApply:j,healthStatus:O,message:O.message,userMessage:{userPrompt:O.prompt,repair:!0,category:F,displayPrompt:O.message}}}}async#Bt(){let e=await this.#Le(!1,"critical"),i=!!(e&&!e.healthStatus.hasConfigurationIssue);return i&&this.#u?.addCheckpoint(),{hasHealthIssue:i}}async#Qt(){let e;if(this.#g)try{if(this.#t&&console.info("[INITIALIZE]: Initializing Fusion session for AI side-car branch workflow..."),e=await this.#e.getRepoInfo(this.#v),!e.hasGit)if(this.#ze){this.#t&&console.warn("[INITIALIZE]: No git repository detected. Initializing a new git repository...");try{await this.git(["init"]),await this.git(["add","."]),await this.git(["branch","-M","main"]),await this.git(["commit","--allow-empty","--quiet","--no-verify","--no-gpg-sign","-m","Initial commit for Fusion workflow"]),this.#t&&console.log("[INITIALIZE]: Successfully initialized a new git repository")}catch(i){console.error("\u274C Failed to initialize git repository:",i);return}}else{console.error("\u274C Error: Not in a git repository. Fusion requires a git repository.");return}return await C0({sys:this.#e,gitWorkingDirectory:this.#v,strict:!0})}catch(i){U.error(`\u274C Error initializing Fusion session: ${i}`);let n=new Error("Initialize Git failed",{cause:i});throw this.#e.Sentry?.captureException(n,{level:"fatal",tags:{operation:"codegen-initialize-session"},extra:{repoInfo:e}}),n}}async#yt(e,i){try{await this.git(["checkout",e],{cwd:i})}catch{await this.git(["checkout","-b",e],{cwd:i})}}async#Dt(e){if(!this.#g)return;if(!this.#se){let s=Bne(this.getFeatureBranch(),e.sessionId);this.#se=s}let i=this.getAiBranch();await this.#_(async s=>{await this.getCurrentBranch(s.path)!==i&&await this.#yt(i,s.path);try{await this.git(["branch","--set-upstream-to",`refs/remotes/origin/${this.#ne(s)}`],{cwd:s.path})}catch{}});let n=iA(e.turns),r=n?.afterCommit??n?.lastCommit;if(r)for(let s of this.gitRepoContexts){let o=this.gitRepoContexts[0]?.folderName,a=Bu(r,s.folderName,o);if(a){let A=await this.getCurrentCommitHash("HEAD",s.path);A&&A!==a&&this.#e.Sentry?.captureException(new Error(`Init: After commit mismatch for ${s.folderName}`),{tags:{operation:"codegen-initialize-session",folderName:s.folderName},extra:{sessionId:e.sessionId,targetCommit:a,currentCommitHash:A,lastTurn:n}})}}if(e.beforeCommit)for(let s of this.gitRepoContexts){let o=this.gitRepoContexts[0]?.folderName,a=Bu(e.beforeCommit,s.folderName,o);if(a)try{await this.git(["rev-parse","--quiet","--verify",a],{cwd:s.path})}catch(A){this.#e.Sentry?.captureException(new Error(`Init: Before commit not found for ${s.folderName}`,{cause:A}),{tags:{operation:"codegen-initialize-session",folderName:s.folderName},extra:{sessionId:e.sessionId,beforeCommit:a,turnStates:e.turns.length,lastCompletionId:iA(e.turns)?.completionId}})}}}async#xt(e,i){let n;try{n=(await this.git(["remote","get-url","origin"],i)).trim()}catch{}let{url:r,token:s,provider:o}=e;try{new URL(r)}catch{throw this.#e.Sentry?.captureException(new Error("Provided remote url is invalid"),{tags:{operation:"codegen-git"},extra:{url:r,currentOriginUrl:n}}),new Error("Provided remote url is invalid")}n!==r&&(this.#le=void 0,n?await this.git(["remote","set-url","origin",r],i):await this.git(["remote","add","origin",r],i),(o==="github"||o==="selfHostedGithub")&&s&&(process.env.GH_TOKEN=s))}async pushRepoV2(e){return await this.#H(this.#de({pullFirst:!1,updateRepo:e,refreshRemote:!0}),"pushRepoV2",!0)}async ensureGitAuth(){return this.#Ue()}async#Ue(){let i=Date.now()-this.#et,n=300*1e3;return i<=n?{success:!0,message:"Git auth still valid (within 5min)"}:this.#ue?this.#ue:(this.#ue=this.#vt().then(r=>(r.success&&(this.#et=Date.now()),r)).finally(()=>{this.#ue=null}),this.#ue)}async#vt(){let e;try{let i=this.gitEnabledFolders;if(i.length===0)throw new Error("No git-enabled repos found");let n=i.filter(s=>!s.initializationCommand&&!s.repoUrl?.startsWith("ssh://"));if(n.length===0)return{success:!0,message:"Git remote URLs update not needed"};if(!this.#D)throw new Error("Project ID is required to update git URLs");let r=await Hd(this.#a,this.#D);if(!r.success)throw r.error;e=r.gitConfigs;for(let s of n){if(!s.repoName)continue;let o=e?.[s.repoName];if(o?.url){let a=this.#e.resolve(this.#d,s.path);await this.#xt(o,a)}}return{success:!0,message:"Git remote URLs updated"}}catch(i){let n=`Failed to update git remote URLs: ${ql(i)}`;return this.#t&&console.error(n),this.#A.emit("step",{type:"error",message:n,code:"git-update-error"}),this.#e.Sentry?.captureException(i,{tags:{operation:"codegen-git",endpoint:"updateGitUrls"},extra:{projectId:this.#D,workspaceFolders:this.#h?.folders,gitConfigs:e}}),{success:!1,message:n,error:i instanceof Error?i:new Error(n)}}}async zipFolder(e){let{resolvedPath:i}=this.resolveWorkspacePath(e,!1),n=Date.now(),r=Math.random().toString(36).substring(2,8),s=`zip-${n}-${r}.zip`,o="/tmp",a=this.#e.join(o,s);return vp.default.mkdirSync(o,{recursive:!0}),await ec("zip",["-r",a,".","-x","**/node_modules/**"],{cwd:i,debug:this.#t,sys:this.#e}),a}async archiveProject(){if(!this.#g)throw new Error("Can not archive project in non git mode");try{let e=Date.now(),i=Math.random().toString(36).substring(2,8),n=`project-${e}-${i}.zip`,r="/tmp",s=this.#e.join(r,n);return vp.default.mkdirSync(r,{recursive:!0}),await this.git(["archive","--format=zip","-o",s,"HEAD"]),s}catch(e){throw new Error("Failed to archive project",{cause:e})}}isIdle(){let e=this.getSessionContext(),i=["generating","replay"];return!this.#ee&&!i.includes(e.state)&&this.#ie.length===0}async needsBackup(){if(!this.#g||this.#c.length>1||!this.#D||!this.#O)return!1;let e=await this.getCurrentCommitHash();if(!e)return!1;let i=this.gitEnabledFolder?.originalRepoUrl;if(!i)return!1;let n=kC({version:"v2",originalRepoUrl:i,commitHash:e});return this.#le!==n}async uploadBackup(e=!1){try{await this.waitUntilBlockingPendingPromises(),await this.#q(!1);let i=this.#D,n=this.#O;if(!this.#g)throw new Error("Cannot upload backup in non-git mode");if(this.#c.length>1)throw new Error("Backups not supported for multi-repo setups");if(!i)throw new Error("Project ID is required for backup upload");if(!n)throw new Error("Branch ID is required for backup upload");let r=this.getAiBranch(),s=this.getFeatureBranch(),o=await this.#ct(()=>p0({sys:this.#e,credentials:this.#a,projectId:i,branchName:n,repoPath:this.#v,aiBranch:r,featureBranch:s,workspace:this.#h,debug:this.#t,isConnectedToProvider:!0,forcedFullBackup:e,canAbortMerge:this.#Be}));return o.success&&(this.#le=o.backupRef),o}catch(i){if(console.error("Failed to upload backup",i),this.#le=void 0,this.#e.Sentry?.captureException(i,{tags:{operation:"codegen-backup",backupError:""}}),i instanceof Error&&i.message.includes("Commit(s) not found on remote"))throw i instanceof Error?i:new Error(String(i));return{success:!1,error:i instanceof Error?i:new Error(String(i))}}}getCommitMode(){return this.#s?.commitMode??"prs"}#ne(e){return this.getCommitMode()==="commits"?`${e?.branchName||this.getFeatureBranch()}`:`${this.getAiBranch()}`}async#ot(e,i){let n=this.getCommitMode(),r=this.#ne(i),s=await this.getCurrentBranch(i?.path);return n==="commits"?["push","--no-verify","--set-upstream",...e?["-f"]:[],"origin",`${s}:${r}`]:["push","--no-verify","--set-upstream",...e?["-f"]:[],"origin",r]}async pushChanges(e){return this.#H(this.#de(e),"pushChanges",!0)}async#de(e){let{pullFirst:i,updateRepo:n,actor:r,refreshRemote:s,forcePush:o,folderName:a,requireFastForward:A,abortOnMergeConflict:c}=yee(e);try{if(!this.#g)throw new Error("Can not push changes in non-git mode");if(this.#s?.isFork)throw new Error("Cannot push changes to fork PRs. Fork PRs are read-only. You can only review and validate changes locally.");if(n){let g=this.#h?.folders.find(m=>m.enableGit);g&&(g.repoName=n.repoFullName,g.originalRepoUrl=n.repoUrl)}if(s||n){let g=await this.#Ue();if(!g.success)throw g.error}let u=a?this.#c.find(g=>g.folderName===a):this.#c[0];if(!u)throw new Error(a?`Folder "${a}" not found in workspace`:"No git repos configured");if(A&&await this.#wt(u),i){let g=await this.#bt({requestRefresh:!1,abortOnMergeConflict:c,ctx:u});if(!g.success)throw g.error??new Error(g.message)}if((await this.#K(u.path)).length>0)throw new Error(`Merge conflict detected in ${u.folderName}, please resolve before pushing`);let p=await this.#ot(o??!1,u);await this.git(p,{cwd:u.path}),await this.#x();let d=await this.#P();return await this.#re({lastCommit:AA(d)}),this.queueGitStatusReminder({trigger:"push-success",pushedToRemote:!0}),{success:!0}}catch(u){this.#e.Sentry?.captureException(u,{tags:{operation:"codegen-git",endpoint:"pushChanges",actor:r},extra:{pullFirst:i,forcePush:o,requireFastForward:A,abortOnMergeConflict:c,commitMode:this.getCommitMode(),updateRepo:n,refreshRemote:s}});let l=ql(u);return{success:!1,message:l,error:u instanceof Error?u:new Error(l)}}}async#wt(e){let i=this.#ne(e);await this.git(["fetch","origin",i],{cwd:e.path});let r=this.getCommitMode()==="commits"?await this.getCurrentBranch(e.path):i;try{await this.git(["merge-base","--is-ancestor",`origin/${i}`,r],{cwd:e.path})}catch{throw new Error("[GIT_PUSH_ERROR] Cannot push: remote has diverged from local branch. Fast-forward push is not possible. Please pull the latest changes first or use a different push mode.")}}async#bt(e){if(e?.abortOnMergeConflict){let n=e.ctx?[e.ctx]:this.#c;if(n.length===0)return{success:!1,message:"No git repos configured",error:new Error("No git repos configured")};try{for(let r of n){let s=this.#ne(r);await this.git(["fetch","origin",s],{cwd:r.path});try{await this.git(["merge",`origin/${s}`],{cwd:r.path})}catch(o){if((await this.#K(r.path)).length>0){try{await this.git(["merge","--abort"],{cwd:r.path})}catch(A){this.#e.Sentry?.captureException(A,{tags:{operation:"codegen-git",endpoint:"pullLatestFromRemote-abort-merge-conflict",folderName:r.folderName}})}throw new Error(`[GIT_PUSH_ERROR] Cannot push: merge conflict detected in ${r.folderName} when pulling latest changes. The merge has been aborted. Please resolve conflicts manually.`)}throw o}}return{success:!0}}catch(r){this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-git",endpoint:"pullLatestFromRemote"}});let s=ql(r);return{success:!1,message:s,error:r instanceof Error?r:new Error(s)}}}return await this.#H(this.#at({branches:[],allowUnrelatedHistory:!1,canPush:!1,uncommittedChanges:"commit",fastForward:"auto",requestRefresh:e?.requestRefresh??!0,syncRemoteBranch:!0}),"syncChangesFromBranches",!0)}async abortMerge(e=!0){try{let i=await this.#_(async n=>{try{return await this.git(["merge","--abort"],{cwd:n.path}),!0}catch{return!1}});return this.#Pe=void 0,e&&i.results.some(n=>n.result===!0)&&(await this.#x(),await this.#fe(),this.requestRefresh()),i.success?{success:!0,message:"Merge aborted"}:{success:!1,message:`Failed to abort merge in: ${i.results.filter(r=>!r.success).map(r=>r.folderName).join(", ")}`,error:new Error("Merge abort failed in some repositories")}}catch(i){await this.#x();let n=ql(i);return{success:!1,message:n,error:i instanceof Error?i:new Error(n)}}}async syncChangesFromRemote(e){let i=[],n=e?.remoteBranches??"both";return n==="both"?i.push(this.getAiBranch(),this.getFeatureBranch()):n==="main"?i.push(this.getFeatureBranch()):n==="ai"&&i.push(this.getAiBranch()),await this.#H(this.#at({branches:i,allowUnrelatedHistory:e?.allowUnrelatedHistory??!0,canPush:e?.canPush??!1,uncommittedChanges:e?.uncommittedChanges??"commit",requestRefresh:e?.requestRefresh,fastForward:e?.fastForward??"auto"}),"syncChangesFromRemote",!0)}async#K(e){try{return(await this.git(["--no-pager","diff","--name-only","--diff-filter=U"],{cwd:e})).trim().split(`
|
|
1877
|
+
`)}(i==="all"||i==="critical"&&!D)&&this.queueSystemReminder({text:fC(v,2e3),tag:n});let O={devServerState:u,setupState:a,httpServerState:m,proxyServer:g,devCommand:c,setupCommand:p,hasMergeConflict:A.length>0,hasConfigurationIssue:D,logs:E,prompt:"Debug and fix the issue before continuing.",message:x},j=this.#i.length===0&&TVe.includes(o.state);return{actionButtonText:w,type:"build-error",level:R,canAutoApply:j,healthStatus:O,message:O.message,userMessage:{userPrompt:O.prompt,repair:!0,category:F,displayPrompt:O.message}}}}async#Bt(){let e=await this.#Le(!1,"critical"),i=!!(e&&!e.healthStatus.hasConfigurationIssue);return i&&this.#u?.addCheckpoint(),{hasHealthIssue:i}}async#Qt(){let e;if(this.#g)try{if(this.#t&&console.info("[INITIALIZE]: Initializing Fusion session for AI side-car branch workflow..."),e=await this.#e.getRepoInfo(this.#v),!e.hasGit)if(this.#ze){this.#t&&console.warn("[INITIALIZE]: No git repository detected. Initializing a new git repository...");try{await this.git(["init"]),await this.git(["add","."]),await this.git(["branch","-M","main"]),await this.git(["commit","--allow-empty","--quiet","--no-verify","--no-gpg-sign","-m","Initial commit for Fusion workflow"]),this.#t&&console.log("[INITIALIZE]: Successfully initialized a new git repository")}catch(i){console.error("\u274C Failed to initialize git repository:",i);return}}else{console.error("\u274C Error: Not in a git repository. Fusion requires a git repository.");return}return await C0({sys:this.#e,gitWorkingDirectory:this.#v,strict:!0})}catch(i){U.error(`\u274C Error initializing Fusion session: ${i}`);let n=new Error("Initialize Git failed",{cause:i});throw this.#e.Sentry?.captureException(n,{level:"fatal",tags:{operation:"codegen-initialize-session"},extra:{repoInfo:e}}),n}}async#yt(e,i){try{await this.git(["checkout",e],{cwd:i})}catch{await this.git(["checkout","-b",e],{cwd:i})}}async#Dt(e){if(!this.#g)return;if(!this.#oe){let s=Bne(this.getFeatureBranch(),e.sessionId);this.#oe=s}let i=this.getAiBranch();await this.#_(async s=>{await this.getCurrentBranch(s.path)!==i&&await this.#yt(i,s.path);try{await this.git(["branch","--set-upstream-to",`refs/remotes/origin/${this.#re(s)}`],{cwd:s.path})}catch{}});let n=iA(e.turns),r=n?.afterCommit??n?.lastCommit;if(r)for(let s of this.gitRepoContexts){let o=this.gitRepoContexts[0]?.folderName,a=Bu(r,s.folderName,o);if(a){let A=await this.getCurrentCommitHash("HEAD",s.path);A&&A!==a&&this.#e.Sentry?.captureException(new Error(`Init: After commit mismatch for ${s.folderName}`),{tags:{operation:"codegen-initialize-session",folderName:s.folderName},extra:{sessionId:e.sessionId,targetCommit:a,currentCommitHash:A,lastTurn:n}})}}if(e.beforeCommit)for(let s of this.gitRepoContexts){let o=this.gitRepoContexts[0]?.folderName,a=Bu(e.beforeCommit,s.folderName,o);if(a)try{await this.git(["rev-parse","--quiet","--verify",a],{cwd:s.path})}catch(A){this.#e.Sentry?.captureException(new Error(`Init: Before commit not found for ${s.folderName}`,{cause:A}),{tags:{operation:"codegen-initialize-session",folderName:s.folderName},extra:{sessionId:e.sessionId,beforeCommit:a,turnStates:e.turns.length,lastCompletionId:iA(e.turns)?.completionId}})}}}async#xt(e,i){let n;try{n=(await this.git(["remote","get-url","origin"],i)).trim()}catch{}let{url:r,token:s,provider:o}=e;try{new URL(r)}catch{throw this.#e.Sentry?.captureException(new Error("Provided remote url is invalid"),{tags:{operation:"codegen-git"},extra:{url:r,currentOriginUrl:n}}),new Error("Provided remote url is invalid")}n!==r&&(this.#le=void 0,n?await this.git(["remote","set-url","origin",r],i):await this.git(["remote","add","origin",r],i),(o==="github"||o==="selfHostedGithub")&&s&&(process.env.GH_TOKEN=s))}async pushRepoV2(e){return await this.#H(this.#de({pullFirst:!1,updateRepo:e,refreshRemote:!0}),"pushRepoV2",!0)}async ensureGitAuth(){return this.#Ue()}async#Ue({force:e}={}){let n=Date.now()-this.#et,r=300*1e3;if(!e&&n<=r)return{success:!0,message:"Git auth still valid (within 5min)"};if(this.#te){if(!e)return this.#te;await this.#te.catch(()=>{})}return this.#te=this.#vt().then(s=>(s.success&&(this.#et=Date.now()),s)).finally(()=>{this.#te=null}),this.#te}async#vt(){let e;try{let i=this.gitEnabledFolders;if(i.length===0)throw new Error("No git-enabled repos found");let n=i.filter(s=>!s.initializationCommand&&!s.repoUrl?.startsWith("ssh://"));if(n.length===0)return{success:!0,message:"Git remote URLs update not needed"};if(!this.#D)throw new Error("Project ID is required to update git URLs");let r=await Hd(this.#a,this.#D);if(!r.success)throw r.error;e=r.gitConfigs;for(let s of n){if(!s.repoName)continue;let o=e?.[s.repoName];if(o?.url){let a=this.#e.resolve(this.#d,s.path);await this.#xt(o,a)}}return{success:!0,message:"Git remote URLs updated"}}catch(i){let n=`Failed to update git remote URLs: ${ql(i)}`;return this.#t&&console.error(n),this.#A.emit("step",{type:"error",message:n,code:"git-update-error"}),this.#e.Sentry?.captureException(i,{tags:{operation:"codegen-git",endpoint:"updateGitUrls"},extra:{projectId:this.#D,workspaceFolders:this.#h?.folders,gitConfigs:e}}),{success:!1,message:n,error:i instanceof Error?i:new Error(n)}}}async zipFolder(e){let{resolvedPath:i}=this.resolveWorkspacePath(e,!1),n=Date.now(),r=Math.random().toString(36).substring(2,8),s=`zip-${n}-${r}.zip`,o="/tmp",a=this.#e.join(o,s);return vp.default.mkdirSync(o,{recursive:!0}),await ec("zip",["-r",a,".","-x","**/node_modules/**"],{cwd:i,debug:this.#t,sys:this.#e}),a}async archiveProject(){if(!this.#g)throw new Error("Can not archive project in non git mode");try{let e=Date.now(),i=Math.random().toString(36).substring(2,8),n=`project-${e}-${i}.zip`,r="/tmp",s=this.#e.join(r,n);return vp.default.mkdirSync(r,{recursive:!0}),await this.git(["archive","--format=zip","-o",s,"HEAD"]),s}catch(e){throw new Error("Failed to archive project",{cause:e})}}isIdle(){let e=this.getSessionContext(),i=["generating","replay"];return!this.#ee&&!i.includes(e.state)&&this.#ne.length===0}async needsBackup(){if(!this.#g||this.#c.length>1||!this.#D||!this.#O)return!1;let e=await this.getCurrentCommitHash();if(!e)return!1;let i=this.gitEnabledFolder?.originalRepoUrl;if(!i)return!1;let n=kC({version:"v2",originalRepoUrl:i,commitHash:e});return this.#le!==n}async uploadBackup(e=!1){try{await this.waitUntilBlockingPendingPromises(),await this.#q(!1);let i=this.#D,n=this.#O;if(!this.#g)throw new Error("Cannot upload backup in non-git mode");if(this.#c.length>1)throw new Error("Backups not supported for multi-repo setups");if(!i)throw new Error("Project ID is required for backup upload");if(!n)throw new Error("Branch ID is required for backup upload");let r=this.getAiBranch(),s=this.getFeatureBranch(),o=await this.#ct(()=>p0({sys:this.#e,credentials:this.#a,projectId:i,branchName:n,repoPath:this.#v,aiBranch:r,featureBranch:s,workspace:this.#h,debug:this.#t,isConnectedToProvider:!0,forcedFullBackup:e,canAbortMerge:this.#Be}));return o.success&&(this.#le=o.backupRef),o}catch(i){if(console.error("Failed to upload backup",i),this.#le=void 0,this.#e.Sentry?.captureException(i,{tags:{operation:"codegen-backup",backupError:""}}),i instanceof Error&&i.message.includes("Commit(s) not found on remote"))throw i instanceof Error?i:new Error(String(i));return{success:!1,error:i instanceof Error?i:new Error(String(i))}}}getCommitMode(){return this.#s?.commitMode??"prs"}#re(e){return this.getCommitMode()==="commits"?`${e?.branchName||this.getFeatureBranch()}`:`${this.getAiBranch()}`}async#ot(e,i){let n=this.getCommitMode(),r=this.#re(i),s=await this.getCurrentBranch(i?.path);return n==="commits"?["push","--no-verify","--set-upstream",...e?["-f"]:[],"origin",`${s}:${r}`]:["push","--no-verify","--set-upstream",...e?["-f"]:[],"origin",r]}async pushChanges(e){return this.#H(this.#de(e),"pushChanges",!0)}async#de(e){let{pullFirst:i,updateRepo:n,actor:r,refreshRemote:s,forcePush:o,folderName:a,requireFastForward:A,abortOnMergeConflict:c}=yee(e);try{if(!this.#g)throw new Error("Can not push changes in non-git mode");if(this.#s?.isFork)throw new Error("Cannot push changes to fork PRs. Fork PRs are read-only. You can only review and validate changes locally.");if(n){let g=this.#h?.folders.find(m=>m.enableGit);g&&(g.repoName=n.repoFullName,g.originalRepoUrl=n.repoUrl)}if(s||n){let g=await this.#Ue({force:!!s});if(!g.success)throw g.error}let u=a?this.#c.find(g=>g.folderName===a):this.#c[0];if(!u)throw new Error(a?`Folder "${a}" not found in workspace`:"No git repos configured");if(A&&await this.#wt(u),i){let g=await this.#bt({requestRefresh:!1,abortOnMergeConflict:c,ctx:u});if(!g.success)throw g.error??new Error(g.message)}if((await this.#K(u.path)).length>0)throw new Error(`Merge conflict detected in ${u.folderName}, please resolve before pushing`);let p=await this.#ot(o??!1,u);await this.git(p,{cwd:u.path}),await this.#x();let d=await this.#P();return await this.#se({lastCommit:AA(d)}),this.queueGitStatusReminder({trigger:"push-success",pushedToRemote:!0}),{success:!0}}catch(u){this.#e.Sentry?.captureException(u,{tags:{operation:"codegen-git",endpoint:"pushChanges",actor:r},extra:{pullFirst:i,forcePush:o,requireFastForward:A,abortOnMergeConflict:c,commitMode:this.getCommitMode(),updateRepo:n,refreshRemote:s}});let l=ql(u);return{success:!1,message:l,error:u instanceof Error?u:new Error(l)}}}async#wt(e){let i=this.#re(e);await this.git(["fetch","origin",i],{cwd:e.path});let r=this.getCommitMode()==="commits"?await this.getCurrentBranch(e.path):i;try{await this.git(["merge-base","--is-ancestor",`origin/${i}`,r],{cwd:e.path})}catch{throw new Error("[GIT_PUSH_ERROR] Cannot push: remote has diverged from local branch. Fast-forward push is not possible. Please pull the latest changes first or use a different push mode.")}}async#bt(e){if(e?.abortOnMergeConflict){let n=e.ctx?[e.ctx]:this.#c;if(n.length===0)return{success:!1,message:"No git repos configured",error:new Error("No git repos configured")};try{for(let r of n){let s=this.#re(r);await this.git(["fetch","origin",s],{cwd:r.path});try{await this.git(["merge",`origin/${s}`],{cwd:r.path})}catch(o){if((await this.#K(r.path)).length>0){try{await this.git(["merge","--abort"],{cwd:r.path})}catch(A){this.#e.Sentry?.captureException(A,{tags:{operation:"codegen-git",endpoint:"pullLatestFromRemote-abort-merge-conflict",folderName:r.folderName}})}throw new Error(`[GIT_PUSH_ERROR] Cannot push: merge conflict detected in ${r.folderName} when pulling latest changes. The merge has been aborted. Please resolve conflicts manually.`)}throw o}}return{success:!0}}catch(r){this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-git",endpoint:"pullLatestFromRemote"}});let s=ql(r);return{success:!1,message:s,error:r instanceof Error?r:new Error(s)}}}return await this.#H(this.#at({branches:[],allowUnrelatedHistory:!1,canPush:!1,uncommittedChanges:"commit",fastForward:"auto",requestRefresh:e?.requestRefresh??!0,syncRemoteBranch:!0}),"syncChangesFromBranches",!0)}async abortMerge(e=!0){try{let i=await this.#_(async n=>{try{return await this.git(["merge","--abort"],{cwd:n.path}),!0}catch{return!1}});return this.#Pe=void 0,e&&i.results.some(n=>n.result===!0)&&(await this.#x(),await this.#fe(),this.requestRefresh()),i.success?{success:!0,message:"Merge aborted"}:{success:!1,message:`Failed to abort merge in: ${i.results.filter(r=>!r.success).map(r=>r.folderName).join(", ")}`,error:new Error("Merge abort failed in some repositories")}}catch(i){await this.#x();let n=ql(i);return{success:!1,message:n,error:i instanceof Error?i:new Error(n)}}}async syncChangesFromRemote(e){let i=[],n=e?.remoteBranches??"both";return n==="both"?i.push(this.getAiBranch(),this.getFeatureBranch()):n==="main"?i.push(this.getFeatureBranch()):n==="ai"&&i.push(this.getAiBranch()),await this.#H(this.#at({branches:i,allowUnrelatedHistory:e?.allowUnrelatedHistory??!0,canPush:e?.canPush??!1,uncommittedChanges:e?.uncommittedChanges??"commit",requestRefresh:e?.requestRefresh,fastForward:e?.fastForward??"auto"}),"syncChangesFromRemote",!0)}async#K(e){try{return(await this.git(["--no-pager","diff","--name-only","--diff-filter=U"],{cwd:e})).trim().split(`
|
|
1878
1878
|
`).filter(r=>r.length>0)}catch{return[]}}async#Ge(){return(await this.#_(async i=>{let n=await this.#K(i.path);return this.#S()?n:n.map(r=>this.#e.join(i.path,r))})).results.flatMap(i=>i.success?i.result??[]:[])}async#St(e){let i=n=>n.split(`
|
|
1879
|
-
`).map(r=>r.trim()).filter(r=>r.length>0).slice(0,20);try{let n=this.#V||"main",r=await this.git(["log",n,"-n","20","--format=%s"],{cwd:e});return i(r)}catch{try{let n=await this.git(["log","-n","20","--format=%s"],{cwd:e});return i(n)}catch{return[]}}}async#at({branches:e,allowUnrelatedHistory:i,canPush:n,fastForward:r,uncommittedChanges:s,requestRefresh:o=!1,syncRemoteBranch:a=!1}){try{if(!this.#g)throw new Error("Can not pull changes in non-git mode");if(!a&&!e.length)throw new Error("At least one branch name is required");let A=this.getAiBranch(),c=this.getFeatureBranch(),u=[];await this.#q(!1);let p=(await this.#_(async d=>{let g=d.path,m;a?m=[this.#
|
|
1879
|
+
`).map(r=>r.trim()).filter(r=>r.length>0).slice(0,20);try{let n=this.#V||"main",r=await this.git(["log",n,"-n","20","--format=%s"],{cwd:e});return i(r)}catch{try{let n=await this.git(["log","-n","20","--format=%s"],{cwd:e});return i(n)}catch{return[]}}}async#at({branches:e,allowUnrelatedHistory:i,canPush:n,fastForward:r,uncommittedChanges:s,requestRefresh:o=!1,syncRemoteBranch:a=!1}){try{if(!this.#g)throw new Error("Can not pull changes in non-git mode");if(!a&&!e.length)throw new Error("At least one branch name is required");let A=this.getAiBranch(),c=this.getFeatureBranch(),u=[];await this.#q(!1);let p=(await this.#_(async d=>{let g=d.path,m;a?m=[this.#re(d)]:m=e.map(D=>D===c?d.branchName:D);let h=await this.getCurrentBranch(g);if(h!==A)throw new Error(`Repo ${d.folderName} not on AI branch: ${h} != ${A}`);let C=await this.#K(g);if(C.length>0)throw new Error(`Merge conflict in ${d.folderName}:
|
|
1880
1880
|
${C.join(`
|
|
1881
1881
|
`)}`);let I=!1;if(!await this.#je(g))switch(s){case"stash":await this.git(["stash","--include-untracked"],{cwd:g}),I=!0;break;case"commit":await this.git(["add","-A","."],{cwd:g}),await this.git(["commit","--no-gpg-sign","-m","Commit unstaged changes"],{cwd:g});break;default:throw new Error(`Uncommitted changes in ${d.folderName}`)}await this.git(["fetch","origin","--prune"],{cwd:g});let E=await this.git(["for-each-ref","refs/remotes/origin"],{cwd:g}),Q=m.filter(D=>E.includes(`refs/remotes/origin/${D}`));for(let D of Q){D!==A&&await this.git(["update-ref",`refs/heads/${D}`,`refs/remotes/origin/${D}`],{cwd:g});try{let x=await this.git(["merge",...r==="never"?["--no-ff"]:[],...r==="required"?["--ff-only"]:[],...r==="auto"?["--ff"]:[],...i?["--allow-unrelated-histories"]:[],`refs/remotes/origin/${D}`],{cwd:g}),v=D===d.branchName,R=x?.includes("Already up to date"),w=this.#S()?"":`[${d.folderName}] `;R||u.push(`${w}Successfully merged branch "${D}" into ${A}${v?" (this was the main/feature branch \u2014 its changes are now in your working branch)":" (AI branch synced with remote)"}.`)}catch(x){let v=D===d.branchName,R=this.#S()?"":`[${d.folderName}] `;throw this.#Pe={ourBranch:A,theirBranch:D,theirIsMain:v},x instanceof WA&&u.push(`${R}The user tries to sync git changes, but something failed:
|
|
1882
1882
|
- our branch (ours): ${A} -- this is the AI's working branch
|
|
1883
1883
|
- their branch (theirs): refs/remotes/origin/${D} ${v?" -- this is main/feature branch (work here needs to be preserved)":"-- same branch pushed by remote"}
|
|
1884
|
-
`),x}}if(n){let D=await this.#ot(!0,d);await this.git(D,{cwd:d.path})}if(I)try{await this.git(["stash","pop"],{cwd:g})}catch(D){this.#e.Sentry?.captureException(D,{tags:{operation:"codegen-git",endpoint:"syncChanges-stash-pop"}})}})).results.filter(d=>!d.success||d.error);if(p.length>0){let d=p.map(g=>g.error?.message||`${g.folderName} failed`).join("; ");throw new Error(`Sync failed: ${d}`)}if(n){let d=await this.#de(!1);if(!d.success)throw d.error}else{await this.#x();let d=await this.#P();this.#b={...this.#b,...d},await this.#
|
|
1884
|
+
`),x}}if(n){let D=await this.#ot(!0,d);await this.git(D,{cwd:d.path})}if(I)try{await this.git(["stash","pop"],{cwd:g})}catch(D){this.#e.Sentry?.captureException(D,{tags:{operation:"codegen-git",endpoint:"syncChanges-stash-pop"}})}})).results.filter(d=>!d.success||d.error);if(p.length>0){let d=p.map(g=>g.error?.message||`${g.folderName} failed`).join("; ");throw new Error(`Sync failed: ${d}`)}if(n){let d=await this.#de(!1);if(!d.success)throw d.error}else{await this.#x();let d=await this.#P();this.#b={...this.#b,...d},await this.#se({lastCommit:AA(d)})}return u.length>0&&this.queueSystemReminder({text:u.join(`
|
|
1885
1885
|
|
|
1886
|
-
`)}),o&&this.requestRefresh(),{success:!0,message:`Successfully merged ${e.join(", ")} in all repos`}}catch(A){this.#t&&console.error(`[AGENT](#syncChangesFromBranches): error syncing changes from branches: ${A}`),await this.#x();let c=await this.#P();this.#b={...this.#b,...c},this.#e.Sentry?.captureException(A,{tags:{operation:"codegen-git",endpoint:"syncChangesFromBranches"},extra:{branches:e,allowUnrelatedHistory:i}});let u=ql(A);return{success:!1,message:u,error:A instanceof Error?A:new Error(u)}}}async getCurrentCommitHash(e="HEAD",i){if(this.#g)try{let n=["rev-parse",e];return(await this.git(n,{sys:this.#e,cwd:i})).trim()}catch{return}}async#P(e="HEAD"){let i={};for(let n of this.gitRepoContexts)try{let r=await this.getCurrentCommitHash(e,n.path);r&&(i[n.folderName]=r)}catch(r){console.warn(`Failed to get commit for ${n.folderName}:`,r)}return i}async getCurrentBranch(e){return(await this.git(["branch","--show-current"],{cwd:e})).trim()}getFeatureBranch(){if(!this.#V)throw new Error("Feature branch is missing");return this.#V}getAiBranch(){if(!this.#
|
|
1886
|
+
`)}),o&&this.requestRefresh(),{success:!0,message:`Successfully merged ${e.join(", ")} in all repos`}}catch(A){this.#t&&console.error(`[AGENT](#syncChangesFromBranches): error syncing changes from branches: ${A}`),await this.#x();let c=await this.#P();this.#b={...this.#b,...c},this.#e.Sentry?.captureException(A,{tags:{operation:"codegen-git",endpoint:"syncChangesFromBranches"},extra:{branches:e,allowUnrelatedHistory:i}});let u=ql(A);return{success:!1,message:u,error:A instanceof Error?A:new Error(u)}}}async getCurrentCommitHash(e="HEAD",i){if(this.#g)try{let n=["rev-parse",e];return(await this.git(n,{sys:this.#e,cwd:i})).trim()}catch{return}}async#P(e="HEAD"){let i={};for(let n of this.gitRepoContexts)try{let r=await this.getCurrentCommitHash(e,n.path);r&&(i[n.folderName]=r)}catch(r){console.warn(`Failed to get commit for ${n.folderName}:`,r)}return i}async getCurrentBranch(e){return(await this.git(["branch","--show-current"],{cwd:e})).trim()}getFeatureBranch(){if(!this.#V)throw new Error("Feature branch is missing");return this.#V}getAiBranch(){if(!this.#oe)throw new Error("AI branch is missing");return this.#oe}async git(e,i){if(!this.#g)throw new Error("Can not execute git command in non-git mode.");let n=e[0];(n==="push"||n==="fetch"||n==="pull")&&await this.#Ue();let s=typeof i=="object"?{sys:this.#e,...i}:i;return await this.#ct(()=>this.#kt(e,s))}async#_(e){if(this.#c.length===0)return{success:!0,partialSuccess:!1,results:[]};let n=(await Promise.allSettled(this.#c.map(o=>e(o)))).map((o,a)=>({folderName:this.#c[a].folderName,success:o.status==="fulfilled",result:o.status==="fulfilled"?o.value:void 0,error:o.status==="rejected"?o.reason:void 0,message:o.status==="rejected"?o.reason?.message:void 0})),r=n.filter(o=>o.success),s=n.filter(o=>!o.success);return{success:s.length===0,partialSuccess:r.length>0&&s.length>0,results:n}}#At(e){let i=Ys(e),n=this.#c.find(a=>{let A=Ys(a.folderName);return i.startsWith(A+"/")||i===A});if(n)return n;let r=e.startsWith("/")||e.includes(":")?e:this.#e.resolve(this.#d,e),s=Ys(r);return this.#c.find(a=>{let A=Ys(a.path);return s.startsWith(A+"/")||s===A})}#Ft(e){let i=new Map;for(let n of e){let r=this.#At(n);if(r){let s=i.get(r.folderName)||[];s.push(n),i.set(r.folderName,s)}}return i}#ct(e){let i=this.#qe.then(()=>e());return this.#qe=i.catch(()=>{}),i}async#kt(e,i){if(!this.#g)throw new Error(`Can not execute git command in non-git mode: git ${e.join(" ")}`);let n=`git ${e.join(" ")}`;this.#ee&&this.#e.Sentry?.captureException(new Error(`currentGitCommand is not finished yet. Current command: ${this.#ee}, New command Received: ${n}`),{tags:{operation:"codegen-git"},extra:{oldCommand:this.#ee,newCommand:n}});try{this.#ee=n;let r=typeof i=="object"?i:void 0,s=typeof i=="string"?i:r?.cwd??this.#v;return await ec("git",e,{...r,cwd:s,debug:this.#t,sys:this.#e,timeout:60*1e3})}finally{this.#ee=void 0}}setDebug(e){this.#t=e}async createTerminal(e){let i=this.#u,n=e?.terminalId||`pty_${Date.now()}_${(0,uv.randomUUID)()}`,r=this.#Oe().find(B=>B.terminalId===n),s=new Set,o=new Set;if(r&&e?.terminalId){if(!e?.force)return r;let B=this.#B.get(e.terminalId);if(!B)return r;B.onDataListeners.forEach(E=>{s.add(E)}),B.onExitListeners.forEach(E=>{o.add(E)}),this.disposeTerminal({terminalId:n,emitTerminals:!1})}let a=e?.shell||(process.platform==="win32"?"powershell.exe":process.env.SHELL||"/bin/bash"),A=e?.cols??120,c=e?.rows??30,u={...process.env,...i?.envVars,...e?.env};e?.inheritCredentials&&(u.BUILDER_USER_ID=e.createdBy??this.#a.userId,u.BUILDER_PUBLIC_KEY=this.#a.builderPublicKey,u.BUILDER_PRIVATE_KEY=this.#a.builderPrivateKey);let l=[],p=B=>{for(let E of s)E(B)},d=({exitCode:B,error:E})=>{let Q=this.#B.get(n);Q&&(Q.state=E?"error":"exited",Q.exitCode=B);for(let D of o)D(B);this.#B.delete(n),l.forEach(D=>D())},g=e?.cwd||this.#y,m,h;if(e?.readonly){m="starting";let B=la(a,e?.initialCommand??"true",{cwd:g,env:u,stdio:["ignore","pipe","pipe"]});B.on("spawn",()=>{let E=this.#B.get(n);E&&(E.state="running")}),B.stdout.on("data",E=>{p(E.toString())}),B.stderr.on("data",E=>{p(E.toString())}),B.on("error",E=>{d({exitCode:1,error:E})}),B.on("exit",E=>{d({exitCode:E??0})}),l.push(()=>{try{B.removeAllListeners()}catch{}B.kill()}),h=B}else{m="running";let B=FM(this.#e);if(!B)throw new Error("Could not import node-pty");let E=a.includes("bash")||a.includes("zsh"),Q=a.includes("zsh")?"%~ $ ":"\\w $ ",D=B.spawn(a,[],{name:"xterm-color",cwd:g,cols:A,rows:c,env:E?{...u,PS1:Q}:u}),x=D.onData(p);l.push(()=>{try{x?.dispose?.()}catch{}});let v=D.onExit(d);l.push(()=>{try{v?.dispose?.()}catch{}});let R=e?.initialCommand;R&&(R.endsWith(`
|
|
1887
1887
|
`)||(R+=`
|
|
1888
1888
|
`),D.write(R)),h=D}let C=Date.now(),I={terminalId:n,title:e?.title||`Terminal ${this.#B.size+1}`,cwd:g,createdAt:C,lastWrittenAt:C,createdBy:e?.createdBy||"unknown",readonly:e?.readonly??!1,initialCommand:e?.initialCommand,builtIn:!1,state:m,exitCode:void 0,command:void 0};return this.#B.set(n,{...I,pty:h,onDataListeners:s,onExitListeners:o,disposeFns:l,env:e?.env,shell:a,inheritCredentials:e?.inheritCredentials}),(e?.emitTerminals??!0)&&this.#me(),I}#Oe(){let e=this.getSessionContext(),i=Array.from(this.#B.values()).map(s=>({terminalId:s.terminalId,title:s.title,cwd:s.cwd,createdAt:s.createdAt,lastWrittenAt:s.lastWrittenAt,createdBy:s.createdBy,readonly:s.readonly,builtIn:s.builtIn,exitCode:s.exitCode,state:s.state,command:s.command})),n=[];this.#E?.includes("Bash")&&n.push({terminalId:"bash-tools",title:"Bash",cwd:this.#y,createdAt:e.createdUnixTime,lastWrittenAt:Date.now(),createdBy:"fusion",readonly:!0,builtIn:!0,exitCode:void 0,state:"running",command:void 0});let r=this.#u;if(r){let s=Date.now();if(r.devState!=="unset"&&n.push({terminalId:"dev-command",title:"Dev Command",cwd:this.#y,createdAt:e.createdUnixTime,lastWrittenAt:s,createdBy:"fusion",readonly:!r.devCommandProcess?.write,builtIn:!0,state:r.devState==="running"?"running":"exited",exitCode:void 0,command:r.devCommand}),r.setupCommand&&n.push({terminalId:"setup-command",title:"Setup Command",cwd:this.#y,createdAt:e.createdUnixTime,lastWrittenAt:s,createdBy:"fusion",readonly:!0,builtIn:!0,state:r.setupState==="installing"?"running":"exited",exitCode:void 0,command:r.setupCommand}),r.validateCommandState!=="unset"){let o;switch(r.validateCommandState){case"running":o="running";break;case"success":o="exited";break;case"failure":o="error";break;case"stopped":o="exited";break}n.unshift({terminalId:"validate-command",title:"Validate Command",cwd:this.#y,createdAt:e.createdUnixTime,lastWrittenAt:s,createdBy:"fusion",readonly:!0,builtIn:!0,state:o,exitCode:void 0,command:r.validateCommand})}}return n.push(...i),n}#me(){this.#A.emit("step",{type:"terminals",terminals:this.#Oe()})}updateTerminal({terminalId:e,cols:i,rows:n,title:r}){if(e==="dev-command"){if(i||n){let o=this.#u;if(o?.devCommandProcess?.resize)return o.devCommandProcess.resize(i,n),!0}return!1}let s=this.#B.get(e);return s?("resize"in s.pty&&(i||n)&&s.pty.resize(i??s.pty.cols,n??s.pty.rows),r&&(s.title=r,this.#me()),!0):!1}writeTerminal({terminalId:e,data:i}){if(e==="dev-command"){let r=this.#u;return r?.devCommandProcess?.write?(r.devCommandProcess.write(i),!0):!1}let n=this.#B.get(e);return!n||n.readonly?!1:("write"in n.pty&&n.pty.write(i),n.lastWrittenAt=Date.now(),!0)}signalTerminal({terminalId:e,signal:i}){if(e==="dev-command"){let r=this.#u;return r?.devCommandProcess?.kill?(r.devCommandProcess.kill(i),!0):!1}let n=this.#B.get(e);if(!n||n.readonly)return!1;try{"write"in n.pty?process.platform==="win32"?n.pty.kill():(i==="SIGINT"&&n.pty.write(""),n.pty.kill(i)):n.pty.kill(i)}catch{}return!0}disposeTerminal({terminalId:e,emitTerminals:i=!0}){let n=this.#B.get(e);if(!n)return!1;try{n.pty.kill()}catch{}return n.disposeFns.forEach(r=>{try{r()}catch{}}),n.onDataListeners.clear(),n.onExitListeners.clear(),n.disposeFns=[],this.#B.delete(e),i&&this.#me(),!0}async restartTerminal({terminalId:e}){if(e==="dev-command"){let r=this.#u;if(r)try{return await r.restart(),!0}catch(s){return this.#e.Sentry?.captureException(s),!1}return!1}if(e==="setup-command"){let r=this.#u;if(r)try{return await r.runSetupCommand(),!0}catch(s){return this.#e.Sentry?.captureException(s),!1}return!1}if(e==="validate-command"){if(this.#u)try{return await this.#dt(),!0}catch(s){return this.#e.Sentry?.captureException(s),!1}return!1}if(e==="bash-tools")return!1;let i=this.#B.get(e);return i?(await this.createTerminal({terminalId:e,title:i.title,cwd:i.cwd,env:i.env,shell:i.shell,cols:"cols"in i.pty?i.pty.cols:void 0,rows:"rows"in i.pty?i.pty.rows:void 0,createdBy:i.createdBy,emitTerminals:!1,initialCommand:i.initialCommand,readonly:i.readonly,inheritCredentials:i.inheritCredentials,force:!0}),this.#B.get(e)?(this.#me(),!0):!1):!1}subscribeTerminal({terminalId:e,onData:i,onExit:n}){if(e==="dev-command"){let r=this.#u;if(r){let s=r.getDevWrite();return s&&i(s),r.emitter.on("stdout",i),r.emitter.on("stderr",i),()=>{r.emitter.off("stdout",i),r.emitter.off("stderr",i)}}}else if(e==="setup-command"){let r=this.#u;if(r){let s=r.getSetupOutput();return s&&i(s),r.emitter.on("installStdout",i),r.emitter.on("installStderr",i),()=>{r.emitter.off("installStdout",i),r.emitter.off("installStderr",i)}}}else if(e==="validate-command"){let r=this.#u;if(r){let s=r.getValidateOutput();return s&&i(s),r.emitter.on("validateStdout",i),r.emitter.on("validateStderr",i),()=>{r.emitter.off("validateStdout",i),r.emitter.off("validateStderr",i)}}}else if(e==="bash-tools"){let r=s=>{s.type==="stdio"&&s.source==="tool-command"&&i(s.content)};return this.#A.on("step",r),()=>{this.#A.off("step",r)}}else{let r=this.#B.get(e);if(!r)throw new Error("Terminal not found");return r.onDataListeners.add(i),n&&r.onExitListeners.add(n),()=>{r.onDataListeners.delete(i),n&&r.onExitListeners.delete(n)}}}async getAllFiles(e={}){let{getDotFiles:i=!1,globbyPattern:n="**/*",includePattern:r,gitignore:s,deep:o,truncate:a,maxFiles:A=5e4,onlyFiles:c=!0}=e,u=this.#s?.accessControl,l=u?.entries?.filter(m=>m.action==="allow"&&m.permissions.includes("list")).map(m=>(m.resource.startsWith("/")?m.resource.slice(1):m.resource)||".")??[];if(!this.#h?.folders?.length){let m=await rp({basePath:this.#d,globPattern:[r??n,...l],extraIgnorePatterns:HD(u).deny,dot:i,gitignore:s,sys:this.#e,deep:o,onlyFiles:c,maxFiles:A});return OT(m,a)}let p=[],d=await this.#e.readdir(this.#d);for(let m of d)wT(m)&&p.push(m);!p.includes("AGENTS.md")&&this.#h.agentsMD&&p.push("AGENTS.md");for(let m of this.#h.folders){let h=this.#e.resolve(this.#d,m.path),C=await rp({basePath:h,globPattern:[n,...l],dot:i,gitignore:s,sys:this.#e,deep:o,onlyFiles:c,maxFiles:A}),I=this.#S()?".":m.name||this.#e.basename(h);for(let B of C)I!=="."?p.push(this.#e.join(I,B)):p.push(B)}let g=Fd({files:p,policy:u,filterPattern:r,getDotFiles:i});return OT(g,a)}async searchFiles(e){let{query:i,caseInsensitive:n=!0,includeGlob:r,excludeGlob:s,maxResults:o=1e3,contextBefore:a=0,contextAfter:A=0}=e,c=await _m(this.#e),u=["--path-separator","/","--json","--line-number","--column","--hidden","--max-columns","500"];return n&&u.push("-i"),a>0&&u.push("-B",a.toString()),A>0&&u.push("-A",A.toString()),r&&u.push("--glob",r),s&&u.push("--glob",`!${s}`),u.push("--ignore-file",".builderignore"),u.push("--",i),new Promise(l=>{let p=nA({command:c,args:u,options:{env:process.env,cwd:this.#y,stdio:["ignore","pipe","pipe"]}}),d=new Jn(5e4);p.stdout.on("data",g=>{d.write(g.toString())}),p.on("error",()=>{l({matches:[],totalMatches:0,filesWithMatches:0,truncated:!1})}),p.on("close",g=>{if(g!==0)l({matches:[],totalMatches:0,filesWithMatches:0,truncated:!1});else{let m=[],h=new Set,I=d.getContent().split(`
|
|
1889
1889
|
`),B=[],E=null;for(let D of I)if(D.trim())try{let x=JSON.parse(D);if(x.type==="match"){let v=x.data.path.text,R=x.data.line_number,w=x.data.lines.text.trimEnd(),F=x.data.submatches||[],O,j;F.length>0&&(O=F[0].start,j=F[0].end),h.add(v);let $={filePath:v,lineNumber:R,lineContent:w,columnStart:O,columnEnd:j,contextBefore:B,contextAfter:[]};if(B=[],E=$,m.push($),m.length>=o)break}else if(x.type==="context"){let v=x.data.line_number,R=x.data.lines.text.trimEnd();E&&v>E.lineNumber?E.contextAfter.push(R):B.push(R)}}catch{continue}let Q=m.length>=o;l({matches:m,totalMatches:m.length,filesWithMatches:h.size,truncated:Q})}})})}async searchFileTree(e){let{query:i,excludeGlob:n,maxResults:r=100}=e,s=await _m(this.#e),o=["--files","--path-separator","/"],a=Qie(i);a&&o.push("--glob",a),n&&o.push("--glob",`!${n}`);let A=this.#s?.accessControl,c=HD(A).deny;for(let l of c)o.push("--glob",`!${l}`);o.push("--ignore-file",".builderignore");let u=i.toLowerCase();return new Promise(l=>{let p=nA({command:s,args:o,options:{env:process.env,cwd:this.#y,stdio:["ignore","pipe","pipe"]}}),d=new Jn(1e5);p.stdout.on("data",g=>{d.write(g.toString())}),p.on("error",()=>{l({matches:[],totalMatches:0,truncated:!1})}),p.on("close",g=>{if(g!==0&&g!==1){l({matches:[],totalMatches:0,truncated:!1});return}let m=d.getContent(),h=[...new Set(m.split(`
|
|
1890
|
-
`).filter(B=>B.trim()))];h=Fd({files:h,policy:A,getDotFiles:!0});let C=[];for(let B of h){let E=B.lastIndexOf("/"),Q=E>=0?B.slice(E+1):B,D=E>=0?B.slice(0,E):"",x=Eie(u,B.toLowerCase()),v=Bie(u,B,x);C.push({filePath:B,fileName:Q,parentPath:D,matchIndices:x,score:v})}C.sort((B,E)=>E.score-B.score);let I=C.slice(0,r).map(({score:B,...E})=>E);l({matches:I,totalMatches:h.length,truncated:h.length>r})})})}async collectRepoMetrics(e={}){let i=this.#ge(e.folderName);return e.rootPath&&(i=this.#e.join(i,e.rootPath)),Ane(this.#e,i)}getSessionId(){return this.getSessionContext().sessionId}updateMetadata(e){this.#pt(e,!1)}getMetadata(){return this.#M}getSpaceId(){return this.#a.builderPublicKey}async revertToCommitSnapshot(e){this.#N=!1,await this.waitUntilBlockingPendingPromises(),await this.abortMerge(!1),await this.#q(!1);let n=(await this.#_(async a=>{let A=Bu(e,a.folderName,this.gitRepoContexts[0]?.folderName);return A?(await this.git(["revert","--no-commit",`${A}..HEAD`],{cwd:a.path}),await this.git(["commit","--allow-empty","--quiet","--no-verify","--no-gpg-sign","-m","Revert changes"],{cwd:a.path}),{commitHash:await this.getCurrentCommitHash("HEAD",a.path)}):(console.warn(`No commit found for ${a.folderName}, skipping revert`),{skipped:!0})})).results.filter(a=>!a.success);if(n.length>0)throw new Error(`Failed to revert ${n.length} repos`);let r=await this.#P();if(this.#b={...this.#b,...r},!(await this.#x())?.currentCommit){this.#e.Sentry?.captureException(new Error("Failed to get current commit hash after revert"),{tags:{operation:"codegen-git",endpoint:"revertToCommitHash"}});return}this.requestRefresh(),await this.#re({lastCommit:AA(r)})}async revertToCommitHash(e){let i=$d(e,this.gitRepoContexts[0]?.folderName),n=Object.keys(i).length===0?e:AA(i);return this.revertToCommitSnapshot(n)}async resetToCommitSnapshot(e,i=!0){this.#N=!1,await this.waitUntilBlockingPendingPromises(),await this.abortMerge(!1),await this.#q(!1);let r=(await this.#_(async o=>{let a=Bu(e,o.folderName,this.gitRepoContexts[0]?.folderName);if(!a)return console.warn(`No commit found for ${o.folderName}, skipping reset`),{skipped:!0};await this.git(["reset","--quiet","--hard",a],{cwd:o.path}),await this.git(["clean","-fd"],{cwd:o.path});let A=await this.getCurrentCommitHash("HEAD",o.path);if(A!==a)throw new Error(`Failed to reset commit hash for ${o.folderName}: expected ${a}, got ${A}`);return{commitHash:A}})).results.filter(o=>!o.success);if(r.length>0)throw new Error(`Failed to reset ${r.length} repos`);let s=$d(e,this.gitRepoContexts[0]?.folderName);this.#b={...this.#b,...s},await this.#x(),i&&this.requestRefresh()}async resetToCommitHash(e,i=!0){let n=$d(e,this.gitRepoContexts[0]?.folderName),r=Object.keys(n).length===0?e:AA(n);return this.resetToCommitSnapshot(r,i)}async restore({location:e,predicate:i,revert:n=!1,dryRun:r=!1,forceReplay:s=!1,debug:o}){let a=this.getSessionContext(),A=a.turns.length,c=null;for(let g=A-1;g>=-1;g--)if(i(g>=0?a.turns[g]:null,g)){c=g;break}if(c===null)return{undone:null,message:"Could not find the target to restore to, the completion id could be wrong"};n||await this.abort({cleanCurrentMessage:!0});let u=new Map,l=!!this.#g,p=a.turns,d=Math.max(0,e==="before"?c:c+1);for(let g=p.length-1;g>=d;g--){let m=p[g];for(let h of m.applyResults)u.set(h.filePath,h.oldContent??"")}if(!r){let g;if(l){c===-1?a.beforeCommit?g=a.beforeCommit:p.length>0&&(g=p[0].beforeCommit):c<p.length&&(e==="after"?(g=p[c].afterCommit,!g&&c+1<p.length&&(g=p[c+1].beforeCommit)):g=p[c].beforeCommit);let I={commitSnapshot:g,sessionId:a.sessionId,sessionBeforeCommit:a.beforeCommit,turnsLength:p.length,targetIndex:c,currentTurn:p[p.length-1],targetTurn:p[c],targetTurnNext:p[c+1],location:e,forceReplay:s,dryRun:r,debug:o};if(!g)return this.#e.Sentry?.captureException(new Error("No commit snapshot found for restore"),{tags:{operation:"codegen-git",endpoint:"revertToCommitHash"},contexts:{restore:I}}),{undone:null,message:"Could not find the target to restore to, the git history is missing"};try{n?await this.revertToCommitSnapshot(g):await this.resetToCommitSnapshot(g)}catch(B){return this.#e.Sentry?.captureException(new Error("Error resetting git",{cause:B}),{tags:{operation:"codegen-git",endpoint:"resetToCommitHash"},contexts:{restore:I}}),{undone:null,message:"Failed to reset/restore, the file history is missing"}}}else for(let[I,B]of u.entries())try{B?await this.writeFile(I,B):await this.deleteFile(I)}catch{}if(n)return{undone:[],message:"The revert operation was successful"};let m=p.splice(d,p.length-d),h=iA(p);h&&h?.afterCommit!==g&&(this.#e.Sentry?.captureException(new Error("Reset After commit snapshot mismatch"),{tags:{operation:"codegen-git",endpoint:"resetToCommitHash"},extra:{lastTurn:h,commitSnapshot:g}}),h.lastCommit=g,await this.#re({completionId:h.completionId,lastCommit:g}));let C=h?.completionId;if(m.length>0&&(await vT(this.#e,this.#a,{lastCompletionId:C,sessionId:a.sessionId},!!this.#t),a.updatedUnixTime=Date.now()),s){let I=a.state;this.#A.emit("step",{type:"batch",steps:[{type:"state",newState:"replay",abortable:!1,previousState:I},...this.#gt(),{type:"restore",files:Array.from(u.keys()),lastCompletionId:C,location:e},{type:"state",newState:I,abortable:!1,previousState:"replay"}]})}else m.length>0&&this.#A.emit("step",{type:"restore",files:Array.from(u.keys()),lastCompletionId:C,location:e})}return await this.#ut(),{undone:Array.from(u.keys()),message:"The restore operation was successful"}}async#ut(e){return await this.#u?.ensureDevCommand(e)}async restoreFromCompletionId({location:e,completionId:i,forceReplay:n}){let r=this.getSessionContext();return r.turns.find(o=>o.completionId===i)?this.restore({location:e,predicate:o=>o?.completionId===i,forceReplay:n,debug:`restore to: ${i}`}):(await this.#ae,r.turns=[],r.canLoadMore=!0,await vT(this.#e,this.#a,{sessionId:r.sessionId,lastCompletionId:i},!!this.#t),await this.loadMoreTurns(),this.restore({location:e,predicate:()=>!0,forceReplay:!0,debug:"restore after history"}))}async restoreBeforeCompletionId(e){return this.restoreFromCompletionId({location:"before",completionId:e,forceReplay:!1})}async undoLastUserMessage(e=!1){return this.restore({location:"before",predicate:i=>i?.user.role==="user",dryRun:e})}getLastUserCompletionId(){let e=this.getSessionContext();return Aee(e)?.completionId}getLastCompletionId(){let e=this.getSessionContext();return DT(e)?.completionId}getCurrentState(){return this.getSessionContext().state}getLastApplyResultsTurn(){let e=this.getSessionContext();return cee(e)}getLastTurn(){let e=this.getSessionContext();return DT(e)}getNextUrl(){return this.getLastTurn()?.nextUrl}async sendFeedback(e){if(process.env.NODE_ENV==="test")return;if(e.feedbackSentiment){let n=e.feedbackSentiment==="positive"?`User provided positive feedback (thumbs up) on the previous completion.${e.feedbackText??""}`:`User provided negative feedback (thumbs down) on the previous completion.${e.feedbackText??""}`;await this.queueSystemReminder({text:n,tag:"reminder:user-feedback"})}ot("quality code feedback given",{spaceId:this.#a.builderPublicKey,sentiment:e.feedbackSentiment,mode:"cli"});let i=e.id??this.getLastCompletionId();i&&await this.#Rt({...e,id:i})}#re(e){let i=e.completionId;if(!i){let r=this.getLastTurn();r&&e.lastCommit&&(r.lastCommit=e.lastCommit),i=r?.completionId}let n=xT(this.#e,this.#a,"/codegen/finalize",{completionId:i,projectId:this.#s?.projectId,branchName:this.#s?.branchName,userCompletionId:this.getLastUserCompletionId(),sessionId:this.getSessionId(),metadata:this.#M,...e});return this.#H(n,"completionFinalize")}#Rt(e){let i=xT(this.#e,this.#a,"/codegen/feedback",e);return this.#H(i,"completionFeedback")}#H(e,i,n=!1){let r=np();this.#t&&console.log(`[AGENT](addToPendingPromises-${r}): adding ${i} (blocking: ${n})`),this.#ie.push(e),n&&this.#xe.push(e);let s=new Error(`Deadlock detected in codegen (function: ${i})`),o=setTimeout(()=>{this.#e.Sentry?.captureException(s,{level:"fatal",tags:{operation:"codegen-stream",functionName:i,sessionId:this.getSessionId(),projectId:this.#D,branchName:this.#O}})},300*1e3);return e.finally(()=>{clearTimeout(o),this.#t&&console.log(`[AGENT](addToPendingPromises-${r}): removing ${i} (blocking: ${n})`);let a=this.#xe.indexOf(e);a!==-1&&this.#xe.splice(a,1);let A=this.#ie.indexOf(e);A!==-1&&this.#ie.splice(A,1)})}async lastTurnHasChanges(){let e=await this.undoLastUserMessage(!0);return e.undone?e.undone.length>0:!1}#L(e){let i=this.getSessionContext(),n=i.state;return n!==e?(i.state=e,this.#A.emit("step",{type:"state",abortable:e==="generating",previousState:n,newState:e}),!0):!1}waitUntilState(e,i=1e4){return new Promise(n=>{if(this.getSessionContext().state===e){n();return}let s,o=a=>{a.type==="state"&&a.newState===e&&(clearTimeout(s),this.#A.removeListener("step",o),n())};s=setTimeout(()=>{this.#A.removeListener("step",o),n()},i),this.#A.on("step",o)})}getProxyConfig(){return Ree({devServerUrl:this.#s?.serverUrl,proxyOrigin:this.#Qe,proxyDefaultOrigin:this.#ye,proxyDestination:this.#tt})}async clearSession(){this.#t&&console.log("[AGENT](clearSession): clearing session"),await this.abort({cleanCurrentMessage:!0,flushMessageQueue:!1});let e=this.getSessionContext();e.turns=[],e.customInstructions=await this.#be(),e.customAgents=await this.#Se(),this.#T.length=0,this.#N=!1,this.#M={},this.#Ce=!1,this.clearMessageQueue(),this.queueGitStatusReminder({trigger:"session-start"})}async clearMessageQueue(e=!1){let i=[];if(e)for(let n of this.#i)n.user&&i.push({type:"user",displayPrompt:n.displayPrompt,user:n.user,role:n.user.role,compacting:!1,idempotencyKey:n.idempotencyKey});this.#i.length=0,this.#Ke(),i.length>0&&this.#A.emit("step",{type:"batch",steps:i})}updateMessage(e){if(e.type==="delete"){let i=this.#i.findIndex(n=>n.idempotencyKey===e.idempotencyKey);i>=0&&this.#i.splice(i,1)}else if(e.type==="move"){let i=this.#i.findIndex(n=>n.idempotencyKey===e.idempotencyKey);i>=0&&xee(this.#i,i,i+e.delta)}this.#Ke()}async flushMessageQueue(){this.#t&&console.log("[AGENT](flushMessageQueue): flushing message queue"),await this.abort({cleanCurrentMessage:!1,flushMessageQueue:!0}),this.#f&&this.#f()}#lt(e){let i=e.idempotencyKey;if(i){let n=this.#i.findIndex(r=>r.idempotencyKey===i);if(n>=0)return this.#i[n]=e,!1}else e.idempotencyKey=(0,uv.randomUUID)();if(e.userPrompt==="___BROWSER_AUTOMATION_PROMPT___"){let n=this.getProxyConfig();e.userPrompt=Die(n.proxyDefaultOrigin)}return this.#i.push(e),!0}async sendMessage(e){this.#Ce=!1;let i=0;if(Array.isArray(e))for(let r of e)this.#lt(r)&&i++;else this.#lt(e)&&i++;if(i===0)return null;this.#t&&console.log(`[AGENT](sendMessage): added messages(${i}) to queue(${this.#i.length})`),this.#Ke();let n=this.#i[this.#i.length-1];return n?(this.#N=!1,this.cancelAllPendingToolFulfilments(),n.queue?this.#f&&this.#f():await this.flushMessageQueue(),await pu(),n.idempotencyKey):null}#Nt(){let e=this.#i;if(e.length!==0){for(let i of e)if(i.systemReminders)for(let n of i.systemReminders)this.queueSystemReminder(n);return this.#o=bT(e),this.clearMessageQueue(!0),this.#o}}#Tt(){let e=this.#i.length===0||this.#Ce,i=new Promise(n=>{e?this.#f=n:n()}).then(()=>{let n=this.#i;if(n.length===0)return;for(let s of n)if(s.systemReminders)for(let o of s.systemReminders)this.queueSystemReminder(o);let r=bT(n);if(!r.dropAbortedPrompt&&this.#o){let s=r.idempotencyKey;r=ST(this.#o,r),r.idempotencyKey=s}return this.clearMessageQueue(!0),this.#o=r,r});return{shouldWait:e,promise:i}}#Ke(){this.#A.emit("step",{type:"message-queue",queue:this.#i.map(e=>({idempotencyKey:e.idempotencyKey,displayPrompt:e.displayPrompt,user:e.user}))})}#pt(e,i=!1){i&&(this.#M={}),Object.assign(this.#M,e),this.#A.emit("step",{type:"metadata",...this.#M})}async waitForSetupCommand(e){let i=this.#u;if(!i)return{state:"installed",shouldProceed:!0};if(i.setupState==="installing")try{await gu(i.setupCommandPromise,e)}catch{}let n=i.setupState;return n==="not-installed"||n==="install-failed"||n==="install-aborted"?{state:n,shouldProceed:!0}:{state:"installed",shouldProceed:!0}}async waitForDevServer(e,i,n){if(!this.#u&&this.#s?.serverUrl)return{shouldProceed:!0,message:"Dev server is ready.",serverUrl:this.#s.serverUrl};let r=await this.waitForSetupCommand(e);if(!r.shouldProceed)return{shouldProceed:!1,message:`Project setup command did not completed. State: ${r.state}`};let s=this.#u;if(s){await s.ensureDevCommand(e);let o=await s.waitUntilServer(e,i,n);return o.ok?{shouldProceed:!0,message:"Dev server is ready.",serverUrl:s.serverUrl?.toString()}:{shouldProceed:!1,message:o.message,serverUrl:void 0}}return{shouldProceed:!1,message:"Dev server is not ready.",serverUrl:void 0}}async getNamedAgentConfig(e,i,n){let r=this.getSessionContext(),s=r.customAgents,o=e?s.find(R=>R.name.toLowerCase()===e.toLowerCase()):void 0,a=o?.name??"explorer",{mcpServers:A=!1,model:c,mode:u="quality-v4-agent",systemPrompt:l,subagent_type:p,includeMemories:d,needDevServer:g,needValidation:m,resetAfterRun:h=!1}={subagent_type:a,systemPrompt:o?.systemPrompt,model:o?.model,mode:o?.mode,includeMemories:o?.includeMemories??a==="explorer",needDevServer:o?.needDevServer,needValidation:o?.needValidation,resetAfterRun:o?.resetAfterRun},C=["Read","Glob","ReadRule","Grep","WebSearch","SearchMemories"];r.sessionMode==="deep-research"&&C.push("Bash","WebFetch"),C=C.filter(R=>this.#E?this.#E.includes(R):!0),C.push("ExplorationMetadata");let I=cv(this.#s,o?.tools??C),B=c===void 0?p==="explorer"?"opa5-mini":void 0:c,E=this.#u;if(g&&n){if(!E)return{success:!1,response:`The ${p} agent can not be used on this session. Do no try again.`};if(E.httpServerState.state==="stopped"||E.httpServerState.state==="connecting"||E.httpServerState.state==="error-fetch")try{if(E.state==="not-installed")throw new Error(`The ${p} agent can not be used until the setupCommand finish successfully. However, the dev server is not installed.`);if(E.state==="install-failed")throw new Error(`The ${p} agent can not be used until the setupCommand finish successfully. However, last time we try to run the install script, it failed.`);if(E.state==="install-aborted")throw new Error(`The ${p} agent can not be used until the setupCommand finish successfully. However, last time we try to run the install script, it was aborted.`);await this.waitForSetupCommand(n),await E.ensureDevCommand(n)}catch(w){return{success:!1,response:w instanceof Error?w.message:String(w)}}if(m&&E.validateCommand&&this.#Y){let w=await E.runValidateCommand(void 0,n);if(w.status==="failure")return{success:!1,response:`The Agent could not start yet, because the validate command failed:
|
|
1890
|
+
`).filter(B=>B.trim()))];h=Fd({files:h,policy:A,getDotFiles:!0});let C=[];for(let B of h){let E=B.lastIndexOf("/"),Q=E>=0?B.slice(E+1):B,D=E>=0?B.slice(0,E):"",x=Eie(u,B.toLowerCase()),v=Bie(u,B,x);C.push({filePath:B,fileName:Q,parentPath:D,matchIndices:x,score:v})}C.sort((B,E)=>E.score-B.score);let I=C.slice(0,r).map(({score:B,...E})=>E);l({matches:I,totalMatches:h.length,truncated:h.length>r})})})}async collectRepoMetrics(e={}){let i=this.#ge(e.folderName);return e.rootPath&&(i=this.#e.join(i,e.rootPath)),Ane(this.#e,i)}getSessionId(){return this.getSessionContext().sessionId}updateMetadata(e){this.#pt(e,!1)}getMetadata(){return this.#M}getSpaceId(){return this.#a.builderPublicKey}async revertToCommitSnapshot(e){this.#N=!1,await this.waitUntilBlockingPendingPromises(),await this.abortMerge(!1),await this.#q(!1);let n=(await this.#_(async a=>{let A=Bu(e,a.folderName,this.gitRepoContexts[0]?.folderName);return A?(await this.git(["revert","--no-commit",`${A}..HEAD`],{cwd:a.path}),await this.git(["commit","--allow-empty","--quiet","--no-verify","--no-gpg-sign","-m","Revert changes"],{cwd:a.path}),{commitHash:await this.getCurrentCommitHash("HEAD",a.path)}):(console.warn(`No commit found for ${a.folderName}, skipping revert`),{skipped:!0})})).results.filter(a=>!a.success);if(n.length>0)throw new Error(`Failed to revert ${n.length} repos`);let r=await this.#P();if(this.#b={...this.#b,...r},!(await this.#x())?.currentCommit){this.#e.Sentry?.captureException(new Error("Failed to get current commit hash after revert"),{tags:{operation:"codegen-git",endpoint:"revertToCommitHash"}});return}this.requestRefresh(),await this.#se({lastCommit:AA(r)})}async revertToCommitHash(e){let i=$d(e,this.gitRepoContexts[0]?.folderName),n=Object.keys(i).length===0?e:AA(i);return this.revertToCommitSnapshot(n)}async resetToCommitSnapshot(e,i=!0){this.#N=!1,await this.waitUntilBlockingPendingPromises(),await this.abortMerge(!1),await this.#q(!1);let r=(await this.#_(async o=>{let a=Bu(e,o.folderName,this.gitRepoContexts[0]?.folderName);if(!a)return console.warn(`No commit found for ${o.folderName}, skipping reset`),{skipped:!0};await this.git(["reset","--quiet","--hard",a],{cwd:o.path}),await this.git(["clean","-fd"],{cwd:o.path});let A=await this.getCurrentCommitHash("HEAD",o.path);if(A!==a)throw new Error(`Failed to reset commit hash for ${o.folderName}: expected ${a}, got ${A}`);return{commitHash:A}})).results.filter(o=>!o.success);if(r.length>0)throw new Error(`Failed to reset ${r.length} repos`);let s=$d(e,this.gitRepoContexts[0]?.folderName);this.#b={...this.#b,...s},await this.#x(),i&&this.requestRefresh()}async resetToCommitHash(e,i=!0){let n=$d(e,this.gitRepoContexts[0]?.folderName),r=Object.keys(n).length===0?e:AA(n);return this.resetToCommitSnapshot(r,i)}async restore({location:e,predicate:i,revert:n=!1,dryRun:r=!1,forceReplay:s=!1,debug:o}){let a=this.getSessionContext(),A=a.turns.length,c=null;for(let g=A-1;g>=-1;g--)if(i(g>=0?a.turns[g]:null,g)){c=g;break}if(c===null)return{undone:null,message:"Could not find the target to restore to, the completion id could be wrong"};n||await this.abort({cleanCurrentMessage:!0});let u=new Map,l=!!this.#g,p=a.turns,d=Math.max(0,e==="before"?c:c+1);for(let g=p.length-1;g>=d;g--){let m=p[g];for(let h of m.applyResults)u.set(h.filePath,h.oldContent??"")}if(!r){let g;if(l){c===-1?a.beforeCommit?g=a.beforeCommit:p.length>0&&(g=p[0].beforeCommit):c<p.length&&(e==="after"?(g=p[c].afterCommit,!g&&c+1<p.length&&(g=p[c+1].beforeCommit)):g=p[c].beforeCommit);let I={commitSnapshot:g,sessionId:a.sessionId,sessionBeforeCommit:a.beforeCommit,turnsLength:p.length,targetIndex:c,currentTurn:p[p.length-1],targetTurn:p[c],targetTurnNext:p[c+1],location:e,forceReplay:s,dryRun:r,debug:o};if(!g)return this.#e.Sentry?.captureException(new Error("No commit snapshot found for restore"),{tags:{operation:"codegen-git",endpoint:"revertToCommitHash"},contexts:{restore:I}}),{undone:null,message:"Could not find the target to restore to, the git history is missing"};try{n?await this.revertToCommitSnapshot(g):await this.resetToCommitSnapshot(g)}catch(B){return this.#e.Sentry?.captureException(new Error("Error resetting git",{cause:B}),{tags:{operation:"codegen-git",endpoint:"resetToCommitHash"},contexts:{restore:I}}),{undone:null,message:"Failed to reset/restore, the file history is missing"}}}else for(let[I,B]of u.entries())try{B?await this.writeFile(I,B):await this.deleteFile(I)}catch{}if(n)return{undone:[],message:"The revert operation was successful"};let m=p.splice(d,p.length-d),h=iA(p);h&&h?.afterCommit!==g&&(this.#e.Sentry?.captureException(new Error("Reset After commit snapshot mismatch"),{tags:{operation:"codegen-git",endpoint:"resetToCommitHash"},extra:{lastTurn:h,commitSnapshot:g}}),h.lastCommit=g,await this.#se({completionId:h.completionId,lastCommit:g}));let C=h?.completionId;if(m.length>0&&(await vT(this.#e,this.#a,{lastCompletionId:C,sessionId:a.sessionId},!!this.#t),a.updatedUnixTime=Date.now()),s){let I=a.state;this.#A.emit("step",{type:"batch",steps:[{type:"state",newState:"replay",abortable:!1,previousState:I},...this.#gt(),{type:"restore",files:Array.from(u.keys()),lastCompletionId:C,location:e},{type:"state",newState:I,abortable:!1,previousState:"replay"}]})}else m.length>0&&this.#A.emit("step",{type:"restore",files:Array.from(u.keys()),lastCompletionId:C,location:e})}return await this.#ut(),{undone:Array.from(u.keys()),message:"The restore operation was successful"}}async#ut(e){return await this.#u?.ensureDevCommand(e)}async restoreFromCompletionId({location:e,completionId:i,forceReplay:n}){let r=this.getSessionContext();return r.turns.find(o=>o.completionId===i)?this.restore({location:e,predicate:o=>o?.completionId===i,forceReplay:n,debug:`restore to: ${i}`}):(await this.#Ae,r.turns=[],r.canLoadMore=!0,await vT(this.#e,this.#a,{sessionId:r.sessionId,lastCompletionId:i},!!this.#t),await this.loadMoreTurns(),this.restore({location:e,predicate:()=>!0,forceReplay:!0,debug:"restore after history"}))}async restoreBeforeCompletionId(e){return this.restoreFromCompletionId({location:"before",completionId:e,forceReplay:!1})}async undoLastUserMessage(e=!1){return this.restore({location:"before",predicate:i=>i?.user.role==="user",dryRun:e})}getLastUserCompletionId(){let e=this.getSessionContext();return Aee(e)?.completionId}getLastCompletionId(){let e=this.getSessionContext();return DT(e)?.completionId}getCurrentState(){return this.getSessionContext().state}getLastApplyResultsTurn(){let e=this.getSessionContext();return cee(e)}getLastTurn(){let e=this.getSessionContext();return DT(e)}getNextUrl(){return this.getLastTurn()?.nextUrl}async sendFeedback(e){if(process.env.NODE_ENV==="test")return;if(e.feedbackSentiment){let n=e.feedbackSentiment==="positive"?`User provided positive feedback (thumbs up) on the previous completion.${e.feedbackText??""}`:`User provided negative feedback (thumbs down) on the previous completion.${e.feedbackText??""}`;await this.queueSystemReminder({text:n,tag:"reminder:user-feedback"})}ot("quality code feedback given",{spaceId:this.#a.builderPublicKey,sentiment:e.feedbackSentiment,mode:"cli"});let i=e.id??this.getLastCompletionId();i&&await this.#Rt({...e,id:i})}#se(e){let i=e.completionId;if(!i){let r=this.getLastTurn();r&&e.lastCommit&&(r.lastCommit=e.lastCommit),i=r?.completionId}let n=xT(this.#e,this.#a,"/codegen/finalize",{completionId:i,projectId:this.#s?.projectId,branchName:this.#s?.branchName,userCompletionId:this.getLastUserCompletionId(),sessionId:this.getSessionId(),metadata:this.#M,...e});return this.#H(n,"completionFinalize")}#Rt(e){let i=xT(this.#e,this.#a,"/codegen/feedback",e);return this.#H(i,"completionFeedback")}#H(e,i,n=!1){let r=np();this.#t&&console.log(`[AGENT](addToPendingPromises-${r}): adding ${i} (blocking: ${n})`),this.#ne.push(e),n&&this.#xe.push(e);let s=new Error(`Deadlock detected in codegen (function: ${i})`),o=setTimeout(()=>{this.#e.Sentry?.captureException(s,{level:"fatal",tags:{operation:"codegen-stream",functionName:i,sessionId:this.getSessionId(),projectId:this.#D,branchName:this.#O}})},300*1e3);return e.finally(()=>{clearTimeout(o),this.#t&&console.log(`[AGENT](addToPendingPromises-${r}): removing ${i} (blocking: ${n})`);let a=this.#xe.indexOf(e);a!==-1&&this.#xe.splice(a,1);let A=this.#ne.indexOf(e);A!==-1&&this.#ne.splice(A,1)})}async lastTurnHasChanges(){let e=await this.undoLastUserMessage(!0);return e.undone?e.undone.length>0:!1}#L(e){let i=this.getSessionContext(),n=i.state;return n!==e?(i.state=e,this.#A.emit("step",{type:"state",abortable:e==="generating",previousState:n,newState:e}),!0):!1}waitUntilState(e,i=1e4){return new Promise(n=>{if(this.getSessionContext().state===e){n();return}let s,o=a=>{a.type==="state"&&a.newState===e&&(clearTimeout(s),this.#A.removeListener("step",o),n())};s=setTimeout(()=>{this.#A.removeListener("step",o),n()},i),this.#A.on("step",o)})}getProxyConfig(){return Ree({devServerUrl:this.#s?.serverUrl,proxyOrigin:this.#Qe,proxyDefaultOrigin:this.#ye,proxyDestination:this.#tt})}async clearSession(){this.#t&&console.log("[AGENT](clearSession): clearing session"),await this.abort({cleanCurrentMessage:!0,flushMessageQueue:!1});let e=this.getSessionContext();e.turns=[],e.customInstructions=await this.#be(),e.customAgents=await this.#Se(),this.#T.length=0,this.#N=!1,this.#M={},this.#Ce=!1,this.clearMessageQueue(),this.queueGitStatusReminder({trigger:"session-start"})}async clearMessageQueue(e=!1){let i=[];if(e)for(let n of this.#i)n.user&&i.push({type:"user",displayPrompt:n.displayPrompt,user:n.user,role:n.user.role,compacting:!1,idempotencyKey:n.idempotencyKey});this.#i.length=0,this.#Ke(),i.length>0&&this.#A.emit("step",{type:"batch",steps:i})}updateMessage(e){if(e.type==="delete"){let i=this.#i.findIndex(n=>n.idempotencyKey===e.idempotencyKey);i>=0&&this.#i.splice(i,1)}else if(e.type==="move"){let i=this.#i.findIndex(n=>n.idempotencyKey===e.idempotencyKey);i>=0&&xee(this.#i,i,i+e.delta)}this.#Ke()}async flushMessageQueue(){this.#t&&console.log("[AGENT](flushMessageQueue): flushing message queue"),await this.abort({cleanCurrentMessage:!1,flushMessageQueue:!0}),this.#f&&this.#f()}#lt(e){let i=e.idempotencyKey;if(i){let n=this.#i.findIndex(r=>r.idempotencyKey===i);if(n>=0)return this.#i[n]=e,!1}else e.idempotencyKey=(0,uv.randomUUID)();if(e.userPrompt==="___BROWSER_AUTOMATION_PROMPT___"){let n=this.getProxyConfig();e.userPrompt=Die(n.proxyDefaultOrigin)}return this.#i.push(e),!0}async sendMessage(e){this.#Ce=!1;let i=0;if(Array.isArray(e))for(let r of e)this.#lt(r)&&i++;else this.#lt(e)&&i++;if(i===0)return null;this.#t&&console.log(`[AGENT](sendMessage): added messages(${i}) to queue(${this.#i.length})`),this.#Ke();let n=this.#i[this.#i.length-1];return n?(this.#N=!1,this.cancelAllPendingToolFulfilments(),n.queue?this.#f&&this.#f():await this.flushMessageQueue(),await pu(),n.idempotencyKey):null}#Nt(){let e=this.#i;if(e.length!==0){for(let i of e)if(i.systemReminders)for(let n of i.systemReminders)this.queueSystemReminder(n);return this.#o=bT(e),this.clearMessageQueue(!0),this.#o}}#Tt(){let e=this.#i.length===0||this.#Ce,i=new Promise(n=>{e?this.#f=n:n()}).then(()=>{let n=this.#i;if(n.length===0)return;for(let s of n)if(s.systemReminders)for(let o of s.systemReminders)this.queueSystemReminder(o);let r=bT(n);if(!r.dropAbortedPrompt&&this.#o){let s=r.idempotencyKey;r=ST(this.#o,r),r.idempotencyKey=s}return this.clearMessageQueue(!0),this.#o=r,r});return{shouldWait:e,promise:i}}#Ke(){this.#A.emit("step",{type:"message-queue",queue:this.#i.map(e=>({idempotencyKey:e.idempotencyKey,displayPrompt:e.displayPrompt,user:e.user}))})}#pt(e,i=!1){i&&(this.#M={}),Object.assign(this.#M,e),this.#A.emit("step",{type:"metadata",...this.#M})}async waitForSetupCommand(e){let i=this.#u;if(!i)return{state:"installed",shouldProceed:!0};if(i.setupState==="installing")try{await gu(i.setupCommandPromise,e)}catch{}let n=i.setupState;return n==="not-installed"||n==="install-failed"||n==="install-aborted"?{state:n,shouldProceed:!0}:{state:"installed",shouldProceed:!0}}async waitForDevServer(e,i,n){if(!this.#u&&this.#s?.serverUrl)return{shouldProceed:!0,message:"Dev server is ready.",serverUrl:this.#s.serverUrl};let r=await this.waitForSetupCommand(e);if(!r.shouldProceed)return{shouldProceed:!1,message:`Project setup command did not completed. State: ${r.state}`};let s=this.#u;if(s){await s.ensureDevCommand(e);let o=await s.waitUntilServer(e,i,n);return o.ok?{shouldProceed:!0,message:"Dev server is ready.",serverUrl:s.serverUrl?.toString()}:{shouldProceed:!1,message:o.message,serverUrl:void 0}}return{shouldProceed:!1,message:"Dev server is not ready.",serverUrl:void 0}}async getNamedAgentConfig(e,i,n){let r=this.getSessionContext(),s=r.customAgents,o=e?s.find(R=>R.name.toLowerCase()===e.toLowerCase()):void 0,a=o?.name??"explorer",{mcpServers:A=!1,model:c,mode:u="quality-v4-agent",systemPrompt:l,subagent_type:p,includeMemories:d,needDevServer:g,needValidation:m,resetAfterRun:h=!1}={subagent_type:a,systemPrompt:o?.systemPrompt,model:o?.model,mode:o?.mode,includeMemories:o?.includeMemories??a==="explorer",needDevServer:o?.needDevServer,needValidation:o?.needValidation,resetAfterRun:o?.resetAfterRun},C=["Read","Glob","ReadRule","Grep","WebSearch","SearchMemories"];r.sessionMode==="deep-research"&&C.push("Bash","WebFetch"),C=C.filter(R=>this.#E?this.#E.includes(R):!0),C.push("ExplorationMetadata");let I=cv(this.#s,o?.tools??C),B=c===void 0?p==="explorer"?"opa5-mini":void 0:c,E=this.#u;if(g&&n){if(!E)return{success:!1,response:`The ${p} agent can not be used on this session. Do no try again.`};if(E.httpServerState.state==="stopped"||E.httpServerState.state==="connecting"||E.httpServerState.state==="error-fetch")try{if(E.state==="not-installed")throw new Error(`The ${p} agent can not be used until the setupCommand finish successfully. However, the dev server is not installed.`);if(E.state==="install-failed")throw new Error(`The ${p} agent can not be used until the setupCommand finish successfully. However, last time we try to run the install script, it failed.`);if(E.state==="install-aborted")throw new Error(`The ${p} agent can not be used until the setupCommand finish successfully. However, last time we try to run the install script, it was aborted.`);await this.waitForSetupCommand(n),await E.ensureDevCommand(n)}catch(w){return{success:!1,response:w instanceof Error?w.message:String(w)}}if(m&&E.validateCommand&&this.#Y){let w=await E.runValidateCommand(void 0,n);if(w.status==="failure")return{success:!1,response:`The Agent could not start yet, because the validate command failed:
|
|
1891
1891
|
<command>
|
|
1892
1892
|
${w.command}
|
|
1893
1893
|
</command>
|
|
@@ -1902,10 +1902,10 @@ Please commit or stash your changes first, then try again.`};s=(await this.#x())
|
|
|
1902
1902
|
`);if(p.length>0&&(B=`<browser_automation_ui_issues>${JSON.stringify(p,null,2)}</browser_automation_ui_issues><browser_automation_summary>${B}</browser_automation_summary>`),d.length>0&&(B=`<code_review_issues>${JSON.stringify(d,null,2)}</code_review_issues><code_review_summary>${B}</code_review_summary>`),l.length>0)try{let E=l.map(F=>({hasImage:!!F.image,title:F.title})),Q=l.map(F=>F.image).filter(F=>F!==null),D=`${a.getSessionId()}.webp`,x=`${a.getSessionId()}.json`,v=this.#e.join(Npe.default.homedir(),".builder","recordings"),R=this.#e.join(v,D),w=this.#e.join(v,x);if(await vp.default.promises.mkdir(v,{recursive:!0}),await vp.default.promises.writeFile(w,JSON.stringify(E,null,2)),Q.length>0&&await Cie(Q,{duration:"1",outputPath:R,cleanup:!1,sys:this.#e,debug:this.#t,signal:i.signal})){if(c.gif_id=D??void 0,this.#t&&console.log(`[AGENT](subagent=${o}): Generated GIF from ${l.length} recorded frames: ${D}`),D){let O=E.map(j=>j.title);B=`<browser_automation_gif_id>${D}</browser_automation_gif_id>
|
|
1903
1903
|
<browser_automation_recorded_frames>${JSON.stringify(O)}</browser_automation_recorded_frames>
|
|
1904
1904
|
|
|
1905
|
-
${B}`}this.#pt({gif_id:D,gif_frames:E},!1)}}catch(E){console.warn(`[${o}] Failed to generate GIF (non-critical): ${E instanceof Error?E.message:String(E)}`),this.#e.Sentry?.captureException(E,{level:"warning",tags:{component:"gif-generator",operation:"generateGifFromImages",subagent_type:o},extra:{sessionId:a.getSessionId(),recordedFramesCount:l.length}})}return{success:!0,response:B,metadata:c,sessionId:A,lastTurn:I}}catch(I){return{success:!1,response:`Agent task failed: ${I instanceof Error?I.message:String(I)}`,metadata:{important_files:[]}}}finally{i.signal?.removeEventListener("abort",C);try{await h()}catch(I){console.warn(`[${o}] Cleanup failed: ${I instanceof Error?I.message:String(I)}`)}if(r.resetAfterRun&&s)try{await this.resetToCommitHash(s,!1)}catch(I){console.warn(`[${o}] Failed to reset changes: ${I instanceof Error?I.message:String(I)}`)}}}setProxyOrigin(e,i){if(e!==this.#Qe||i!==this.#ye){this.#Qe=e,this.#ye=i;let n=this.getProxyConfig();n.proxyDestination&&n.proxyDefaultOrigin&&this.queueSystemReminder({text:`The dev server is running at ${n.proxyDefaultOrigin}. e.g. for taking screenshots of a "/foo" route take a screenshot of ${n.proxyDefaultOrigin}/foo`,tag:"reminder:url"})}}async#Mt(e,i){let n=this.getProxyConfig();if(n.proxyOrigin&&!n.proxyDestination)return;let r=await lC(this.#a,"/codegen/get-browser-connection",{sessionId:e,projectId:this.#D,branchName:this.#O,proxyOrigin:n.proxyOrigin,proxyDefaultOrigin:n.proxyDefaultOrigin,proxyDst:n.proxyDestination},{signal:i});return typeof r?.wsUrl=="string"?r.wsUrl:void 0}getTurns(){let e=this.getSessionContext();return structuredClone(e.turns)}getSessionContext(){if(!this.#r)throw new Error("Session context not initialized");return this.#r}async runSetupCommand(){return await this.#u?.runSetupCommand()}abortSetupCommand(){return this.#u?.abortSetupCommand()}abortValidateCommand(){return this.#u?.abortValidateCommand()}toolsRunning(){return this.#U.length>0}abortAllTools(){for(let e of this.#U)e.abortController.abort()}toolFullfilment(e,i){return typeof i=="string"&&(i={toolResult:i,isError:!1}),this.fulfillToolCall(e,i)}cancelAllPendingToolFulfilments(){for(let e of Array.from(this.#J.keys()))this.fulfillToolCall(e,{toolResult:"Aborted by the user. So the task could not be completed.",isError:!0,title:"Aborted by the user."});this.#J.clear()}fulfillToolCall(e,i){let n=this.#J.get(e);return n?(n.resolve(i),this.#J.delete(e),!0):!1}abortToolCall(e,i){let n=this.#U.find(s=>s.id===e),r=nn(i??"The user manually aborted the tool call.");if(n)return n.abortController.abort(r),!0;if(this.#U.length===0){let s=new AbortController;return s.abort(r),this.#U.push({id:e,abortController:s,input:{id:e},name:"bash"}),!0}return!1}async acceptCode(){if(this.#Je()){let e=this.getLinesStats();await this.sendFeedback({position:this.#C,acceptedLines:e.net,linesOfCodeAdded:e.added,linesOfCodeRemoved:e.removed})}}async abort(e){this.#t&&console.log(`[AGENT](abort): ${JSON.stringify(e)}`);let i=!1,n=!0;return typeof e=="boolean"?i=e:(i=e?.cleanCurrentMessage??!1,n=e?.flushMessageQueue??!0),i&&(this.#o=void 0,this.clearMessageQueue()),this.#Ce=!n,this.cancelAllPendingToolFulfilments(),this.#
|
|
1906
|
-
${wee(i.environmentVariables)}`,tag:"reminder:environment-variables"})),e.proxyServer?r.push(i?.setProxyServer(e.proxyServer).then(s=>{n.proxyServer=s.updatedProxyServer,n.hosts=s.updatedHosts})):e.proxyPort&&r.push(i?.setPort(e.proxyPort).then(s=>n.proxyServer=s)),e.setupCommand!==void 0||e.setupDependencies!==void 0?r.push(i.setSetupCommand({setupDependencies:e.setupDependencies,setupCommand:e.setupCommand,forceRestart:e.forceSetupCommand}).then(s=>{n.setupCommand=!!s,n.setupResult=s??void 0})):(e.forceSetupCommand||n.env&&i.setupState!=="installed")&&r.push(i?.runSetupCommand().then(s=>{n.setupCommand=!!s,n.setupResult=s??void 0})),e.devCommand!==void 0?r.push(i.setDevCommand(e.devCommand??void 0,e.forceDevCommand||n.env).then(s=>{n.devCommand=s.status==="success",n.devResult=s??void 0})):(e.forceDevCommand||n.env)&&r.push(i?.restart().then(s=>{n.devCommand=!0,n.devResult=s??void 0})),e.autoDetectDevServer!==void 0&&r.push(i.setAutoDetectSettings(e.autoDetectDevServer,e.autoDetectDevServerPatterns).then(s=>n.proxyServer=n.proxyServer||s)),e.validateCommand!==void 0&&r.push(i.runValidateCommand(e.validateCommand).then(s=>n.validateResult=s)),await Promise.allSettled(r)}return n}#Pt(){for(let e of Array.from(this.#B.keys()))try{this.disposeTerminal({terminalId:e})}catch{}this.#B.clear()}async#He(){if(this.#I.debounceTimer&&clearTimeout(this.#I.debounceTimer),this.#I.pendingEvents=[],this.#I.listeners.clear(),this.#I.watcher){try{await this.#I.watcher.close()}catch{}this.#I.watcher=null}}#_t(){if(this.#I.watcher)return;let e=this.#c.map(A=>A.path),i=new Map;for(let A of this.#c)i.set(A.path,$U(A.path));let n=A=>{for(let c of this.#c)if(A.startsWith(c.path+"/")||A===c.path)return c.path;return null},r=A=>{let c=n(A);if(!c)return!1;let u=this.#e.relative(c,A).replace(/\\/g,"/");if(!u)return!1;if(this.#mt(u))return!0;let l=i.get(c);return l?l(u):!1},s,o=!1;try{s=Tpe.default.watch(e,{ignored:r,ignoreInitial:!0,persistent:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:100},ignorePermissionErrors:!0,followSymlinks:!1,usePolling:!0,interval:1e3,binaryInterval:3e5,atomic:!0})}catch(A){this.#e.Sentry?.captureException(A,{tags:{operation:"global-file-watch-init"}}),console.error(`\u26A0\uFE0F Failed to initialize file watcher: ${A instanceof Error?A.message:String(A)}`),console.error(" File watching will be disabled. Code generation will still work but may not detect all changes automatically.");return}let a=(A,c)=>{let u=n(c),l=u?this.#e.relative(u,c).replace(/\\/g,"/"):this.#e.relative(this.#v,c).replace(/\\/g,"/");if(this.#c.length>1&&u){let d=this.#c.find(g=>g.path===u);d&&!this.#S()&&(l=`${d.folderName}/${l}`)}let p={type:"folder-watch",watchId:"global",event:A,path:l,timestamp:Date.now()};this.#I.pendingEvents.push(p),this.#I.debounceTimer&&clearTimeout(this.#I.debounceTimer),this.#I.debounceTimer=setTimeout(()=>{let d=this.#I.pendingEvents;this.#I.pendingEvents=[];for(let g of d)for(let m of this.#I.listeners)try{m(g)}catch(h){this.#e.Sentry?.captureException(h)}},this.#I.debounceMs)};s.on("add",A=>a("add",A)).on("change",A=>a("change",A)).on("unlink",A=>a("unlink",A)).on("addDir",A=>a("addDir",A)).on("unlinkDir",A=>a("unlinkDir",A)).on("error",A=>{o||(o=!0,this.#e.Sentry?.captureException(A,{tags:{operation:"global-file-watch"}}),console.error(`\u26A0\uFE0F File watcher error: ${A instanceof Error?A.message:String(A)}`),console.error(" Closing file watcher to prevent further errors. File watching will be disabled."),this.#He().catch(()=>{}))}),this.#I.watcher=s,this.#t&&console.log(`[FILEWATCHER]: Initialized global file watcher on: ${e.join(", ")}`)}subscribeToFileChanges(e){return this.#I.listeners.size===0&&this.#_t(),this.#I.listeners.add(e),this.#t&&console.log(`[FILEWATCHER]: Subscribed to file changes(${this.#I.listeners.size} active listeners)`),async()=>{this.#I.listeners.delete(e),this.#t&&console.log(`[FILEWATCHER]: Unsubscribed from file changes(${this.#I.listeners.size} remaining listeners)`),this.#I.listeners.size===0&&this.#I.watcher&&(await this.#He(),this.#t&&console.log("[FILEWATCHER]: Closed global file watcher (no more listeners)"))}}async tsServerInit(){try{return this.#n?{ok:!0,cwd:this.#d}:(this.#n=new m0(this.#d),this.#n.setEventHandler(e=>{for(let i of this.#we)i(e)}),await this.#n.start(),{ok:!0,cwd:this.#d})}catch(e){return this.#n=null,{ok:!1,error:e?.message||"Failed to start tsserver"}}}async tsServerOpenFile(e,i){this.#n&&await this.#n.openFile(e,i)}async tsServerChangeFile(e,i){this.#n&&await this.#n.changeFile(e,i)}async tsServerCloseFile(e){this.#n&&await this.#n.closeFile(e)}async tsServerGetCompletions(e,i,n,r){return this.#n?this.#n.getCompletions(e,i,n,r):{success:!1,body:null}}async tsServerGetCompletionDetails(e,i,n,r){return this.#n?this.#n.getCompletionDetails(e,i,n,r):{success:!1,body:null}}async tsServerGetDefinition(e,i,n){return this.#n?this.#n.getDefinition(e,i,n):{success:!1,body:null}}async tsServerGetTypeDefinition(e,i,n){return this.#n?this.#n.getTypeDefinition(e,i,n):{success:!1,body:null}}async tsServerGetQuickInfo(e,i,n){return this.#n?this.#n.getQuickInfo(e,i,n):{success:!1,body:null}}async tsServerGetReferences(e,i,n){return this.#n?this.#n.getReferences(e,i,n):{success:!1,body:null}}async tsServerGetSignatureHelp(e,i,n){return this.#n?this.#n.getSignatureHelp(e,i,n):{success:!1,body:null}}async tsServerRequestDiagnostics(e){this.#n&&await this.#n.requestDiagnostics(e)}async tsServerGetRenameLocations(e,i,n){return this.#n?this.#n.getRenameLocations(e,i,n):{success:!1,body:null}}async tsServerGetNavTree(e){return this.#n?this.#n.getNavTree(e):{success:!1,body:null}}async tsServerOrganizeImports(e){return this.#n?this.#n.organizeImports(e):{success:!1,body:null}}async tsServerGetInlayHints(e){return this.#n?this.#n.getInlayHints(e):{success:!1,body:null}}async tsServerGetCodeFixes(e,i,n,r,s,o){return this.#n?this.#n.getCodeFixes(e,i,n,r,s,o):{success:!1,body:null}}async tsServerGetApplicableRefactors(e,i,n,r,s){return this.#n?this.#n.getApplicableRefactors(e,i,n,r,s):{success:!1,body:null}}async tsServerGetEditsForRefactor(e,i,n,r,s,o,a){return this.#n?this.#n.getEditsForRefactor(e,i,n,r,s,o,a):{success:!1,body:null}}async tsServerGetImplementation(e,i,n){return this.#n?this.#n.getImplementation(e,i,n):{success:!1,body:null}}async tsServerGetSelectionRange(e,i){return this.#n?this.#n.getSelectionRange(e,i):{success:!1,body:null}}async tsServerGetLinkedEditingRange(e,i,n){return this.#n?this.#n.getLinkedEditingRange(e,i,n):{success:!1,body:null}}async tsServerGetFormatRange(e,i,n,r,s){return this.#n?this.#n.getFormatRange(e,i,n,r,s):{success:!1,body:null}}subscribeToDiagnostics(e){return this.#we.add(e),()=>{this.#we.delete(e)}}async close(e=!1){if(!this.#Be){if(this.#Be=!0,this.#$e.forEach(i=>i()),this.#Pt(),await this.#He(),this.#n&&(this.#n.dispose(),this.#n=null),this.#we.clear(),this.#
|
|
1905
|
+
${B}`}this.#pt({gif_id:D,gif_frames:E},!1)}}catch(E){console.warn(`[${o}] Failed to generate GIF (non-critical): ${E instanceof Error?E.message:String(E)}`),this.#e.Sentry?.captureException(E,{level:"warning",tags:{component:"gif-generator",operation:"generateGifFromImages",subagent_type:o},extra:{sessionId:a.getSessionId(),recordedFramesCount:l.length}})}return{success:!0,response:B,metadata:c,sessionId:A,lastTurn:I}}catch(I){return{success:!1,response:`Agent task failed: ${I instanceof Error?I.message:String(I)}`,metadata:{important_files:[]}}}finally{i.signal?.removeEventListener("abort",C);try{await h()}catch(I){console.warn(`[${o}] Cleanup failed: ${I instanceof Error?I.message:String(I)}`)}if(r.resetAfterRun&&s)try{await this.resetToCommitHash(s,!1)}catch(I){console.warn(`[${o}] Failed to reset changes: ${I instanceof Error?I.message:String(I)}`)}}}setProxyOrigin(e,i){if(e!==this.#Qe||i!==this.#ye){this.#Qe=e,this.#ye=i;let n=this.getProxyConfig();n.proxyDestination&&n.proxyDefaultOrigin&&this.queueSystemReminder({text:`The dev server is running at ${n.proxyDefaultOrigin}. e.g. for taking screenshots of a "/foo" route take a screenshot of ${n.proxyDefaultOrigin}/foo`,tag:"reminder:url"})}}async#Mt(e,i){let n=this.getProxyConfig();if(n.proxyOrigin&&!n.proxyDestination)return;let r=await lC(this.#a,"/codegen/get-browser-connection",{sessionId:e,projectId:this.#D,branchName:this.#O,proxyOrigin:n.proxyOrigin,proxyDefaultOrigin:n.proxyDefaultOrigin,proxyDst:n.proxyDestination},{signal:i});return typeof r?.wsUrl=="string"?r.wsUrl:void 0}getTurns(){let e=this.getSessionContext();return structuredClone(e.turns)}getSessionContext(){if(!this.#r)throw new Error("Session context not initialized");return this.#r}async runSetupCommand(){return await this.#u?.runSetupCommand()}abortSetupCommand(){return this.#u?.abortSetupCommand()}abortValidateCommand(){return this.#u?.abortValidateCommand()}toolsRunning(){return this.#U.length>0}abortAllTools(){for(let e of this.#U)e.abortController.abort()}toolFullfilment(e,i){return typeof i=="string"&&(i={toolResult:i,isError:!1}),this.fulfillToolCall(e,i)}cancelAllPendingToolFulfilments(){for(let e of Array.from(this.#J.keys()))this.fulfillToolCall(e,{toolResult:"Aborted by the user. So the task could not be completed.",isError:!0,title:"Aborted by the user."});this.#J.clear()}fulfillToolCall(e,i){let n=this.#J.get(e);return n?(n.resolve(i),this.#J.delete(e),!0):!1}abortToolCall(e,i){let n=this.#U.find(s=>s.id===e),r=nn(i??"The user manually aborted the tool call.");if(n)return n.abortController.abort(r),!0;if(this.#U.length===0){let s=new AbortController;return s.abort(r),this.#U.push({id:e,abortController:s,input:{id:e},name:"bash"}),!0}return!1}async acceptCode(){if(this.#Je()){let e=this.getLinesStats();await this.sendFeedback({position:this.#C,acceptedLines:e.net,linesOfCodeAdded:e.added,linesOfCodeRemoved:e.removed})}}async abort(e){this.#t&&console.log(`[AGENT](abort): ${JSON.stringify(e)}`);let i=!1,n=!0;return typeof e=="boolean"?i=e:(i=e?.cleanCurrentMessage??!1,n=e?.flushMessageQueue??!0),i&&(this.#o=void 0,this.clearMessageQueue()),this.#Ce=!n,this.cancelAllPendingToolFulfilments(),this.#ie=0,this.#m?(this.#m.abort(),this.#m=void 0,!0):!1}async stopEventLoop(){await this.abort({cleanCurrentMessage:!0}),this.#R?.abort(),this.#R=void 0,this.#f&&this.#f()}requestRefresh(){this.#A.emit("step",{type:"builder-action",action:"refresh",metadata:{}})}async configureDevOrchestrator(e){let i=this.#u,n={devCommand:!1,hosts:!1,setupCommand:!1,proxyServer:!1,validateCommand:!1,env:!1,setupResult:void 0,devResult:void 0,validateResult:void 0};if(i){let r=[];e.env&&(e.replaceEnvs&&i.clearEnvVariables(),Object.entries(e.env).forEach(([s,o])=>{i.setEnvVariable(s,o??void 0)&&(n.env=!0)}),this.queueSystemReminder({text:`The system has the following environment variables:
|
|
1906
|
+
${wee(i.environmentVariables)}`,tag:"reminder:environment-variables"})),e.proxyServer?r.push(i?.setProxyServer(e.proxyServer).then(s=>{n.proxyServer=s.updatedProxyServer,n.hosts=s.updatedHosts})):e.proxyPort&&r.push(i?.setPort(e.proxyPort).then(s=>n.proxyServer=s)),e.setupCommand!==void 0||e.setupDependencies!==void 0?r.push(i.setSetupCommand({setupDependencies:e.setupDependencies,setupCommand:e.setupCommand,forceRestart:e.forceSetupCommand}).then(s=>{n.setupCommand=!!s,n.setupResult=s??void 0})):(e.forceSetupCommand||n.env&&i.setupState!=="installed")&&r.push(i?.runSetupCommand().then(s=>{n.setupCommand=!!s,n.setupResult=s??void 0})),e.devCommand!==void 0?r.push(i.setDevCommand(e.devCommand??void 0,e.forceDevCommand||n.env).then(s=>{n.devCommand=s.status==="success",n.devResult=s??void 0})):(e.forceDevCommand||n.env)&&r.push(i?.restart().then(s=>{n.devCommand=!0,n.devResult=s??void 0})),e.autoDetectDevServer!==void 0&&r.push(i.setAutoDetectSettings(e.autoDetectDevServer,e.autoDetectDevServerPatterns).then(s=>n.proxyServer=n.proxyServer||s)),e.validateCommand!==void 0&&r.push(i.runValidateCommand(e.validateCommand).then(s=>n.validateResult=s)),await Promise.allSettled(r)}return n}#Pt(){for(let e of Array.from(this.#B.keys()))try{this.disposeTerminal({terminalId:e})}catch{}this.#B.clear()}async#He(){if(this.#I.debounceTimer&&clearTimeout(this.#I.debounceTimer),this.#I.pendingEvents=[],this.#I.listeners.clear(),this.#I.watcher){try{await this.#I.watcher.close()}catch{}this.#I.watcher=null}}#_t(){if(this.#I.watcher)return;let e=this.#c.map(A=>A.path),i=new Map;for(let A of this.#c)i.set(A.path,$U(A.path));let n=A=>{for(let c of this.#c)if(A.startsWith(c.path+"/")||A===c.path)return c.path;return null},r=A=>{let c=n(A);if(!c)return!1;let u=this.#e.relative(c,A).replace(/\\/g,"/");if(!u)return!1;if(this.#mt(u))return!0;let l=i.get(c);return l?l(u):!1},s,o=!1;try{s=Tpe.default.watch(e,{ignored:r,ignoreInitial:!0,persistent:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:100},ignorePermissionErrors:!0,followSymlinks:!1,usePolling:!0,interval:1e3,binaryInterval:3e5,atomic:!0})}catch(A){this.#e.Sentry?.captureException(A,{tags:{operation:"global-file-watch-init"}}),console.error(`\u26A0\uFE0F Failed to initialize file watcher: ${A instanceof Error?A.message:String(A)}`),console.error(" File watching will be disabled. Code generation will still work but may not detect all changes automatically.");return}let a=(A,c)=>{let u=n(c),l=u?this.#e.relative(u,c).replace(/\\/g,"/"):this.#e.relative(this.#v,c).replace(/\\/g,"/");if(this.#c.length>1&&u){let d=this.#c.find(g=>g.path===u);d&&!this.#S()&&(l=`${d.folderName}/${l}`)}let p={type:"folder-watch",watchId:"global",event:A,path:l,timestamp:Date.now()};this.#I.pendingEvents.push(p),this.#I.debounceTimer&&clearTimeout(this.#I.debounceTimer),this.#I.debounceTimer=setTimeout(()=>{let d=this.#I.pendingEvents;this.#I.pendingEvents=[];for(let g of d)for(let m of this.#I.listeners)try{m(g)}catch(h){this.#e.Sentry?.captureException(h)}},this.#I.debounceMs)};s.on("add",A=>a("add",A)).on("change",A=>a("change",A)).on("unlink",A=>a("unlink",A)).on("addDir",A=>a("addDir",A)).on("unlinkDir",A=>a("unlinkDir",A)).on("error",A=>{o||(o=!0,this.#e.Sentry?.captureException(A,{tags:{operation:"global-file-watch"}}),console.error(`\u26A0\uFE0F File watcher error: ${A instanceof Error?A.message:String(A)}`),console.error(" Closing file watcher to prevent further errors. File watching will be disabled."),this.#He().catch(()=>{}))}),this.#I.watcher=s,this.#t&&console.log(`[FILEWATCHER]: Initialized global file watcher on: ${e.join(", ")}`)}subscribeToFileChanges(e){return this.#I.listeners.size===0&&this.#_t(),this.#I.listeners.add(e),this.#t&&console.log(`[FILEWATCHER]: Subscribed to file changes(${this.#I.listeners.size} active listeners)`),async()=>{this.#I.listeners.delete(e),this.#t&&console.log(`[FILEWATCHER]: Unsubscribed from file changes(${this.#I.listeners.size} remaining listeners)`),this.#I.listeners.size===0&&this.#I.watcher&&(await this.#He(),this.#t&&console.log("[FILEWATCHER]: Closed global file watcher (no more listeners)"))}}async tsServerInit(){try{return this.#n?{ok:!0,cwd:this.#d}:(this.#n=new m0(this.#d),this.#n.setEventHandler(e=>{for(let i of this.#we)i(e)}),await this.#n.start(),{ok:!0,cwd:this.#d})}catch(e){return this.#n=null,{ok:!1,error:e?.message||"Failed to start tsserver"}}}async tsServerOpenFile(e,i){this.#n&&await this.#n.openFile(e,i)}async tsServerChangeFile(e,i){this.#n&&await this.#n.changeFile(e,i)}async tsServerCloseFile(e){this.#n&&await this.#n.closeFile(e)}async tsServerGetCompletions(e,i,n,r){return this.#n?this.#n.getCompletions(e,i,n,r):{success:!1,body:null}}async tsServerGetCompletionDetails(e,i,n,r){return this.#n?this.#n.getCompletionDetails(e,i,n,r):{success:!1,body:null}}async tsServerGetDefinition(e,i,n){return this.#n?this.#n.getDefinition(e,i,n):{success:!1,body:null}}async tsServerGetTypeDefinition(e,i,n){return this.#n?this.#n.getTypeDefinition(e,i,n):{success:!1,body:null}}async tsServerGetQuickInfo(e,i,n){return this.#n?this.#n.getQuickInfo(e,i,n):{success:!1,body:null}}async tsServerGetReferences(e,i,n){return this.#n?this.#n.getReferences(e,i,n):{success:!1,body:null}}async tsServerGetSignatureHelp(e,i,n){return this.#n?this.#n.getSignatureHelp(e,i,n):{success:!1,body:null}}async tsServerRequestDiagnostics(e){this.#n&&await this.#n.requestDiagnostics(e)}async tsServerGetRenameLocations(e,i,n){return this.#n?this.#n.getRenameLocations(e,i,n):{success:!1,body:null}}async tsServerGetNavTree(e){return this.#n?this.#n.getNavTree(e):{success:!1,body:null}}async tsServerOrganizeImports(e){return this.#n?this.#n.organizeImports(e):{success:!1,body:null}}async tsServerGetInlayHints(e){return this.#n?this.#n.getInlayHints(e):{success:!1,body:null}}async tsServerGetCodeFixes(e,i,n,r,s,o){return this.#n?this.#n.getCodeFixes(e,i,n,r,s,o):{success:!1,body:null}}async tsServerGetApplicableRefactors(e,i,n,r,s){return this.#n?this.#n.getApplicableRefactors(e,i,n,r,s):{success:!1,body:null}}async tsServerGetEditsForRefactor(e,i,n,r,s,o,a){return this.#n?this.#n.getEditsForRefactor(e,i,n,r,s,o,a):{success:!1,body:null}}async tsServerGetImplementation(e,i,n){return this.#n?this.#n.getImplementation(e,i,n):{success:!1,body:null}}async tsServerGetSelectionRange(e,i){return this.#n?this.#n.getSelectionRange(e,i):{success:!1,body:null}}async tsServerGetLinkedEditingRange(e,i,n){return this.#n?this.#n.getLinkedEditingRange(e,i,n):{success:!1,body:null}}async tsServerGetFormatRange(e,i,n,r,s){return this.#n?this.#n.getFormatRange(e,i,n,r,s):{success:!1,body:null}}subscribeToDiagnostics(e){return this.#we.add(e),()=>{this.#we.delete(e)}}async close(e=!1){if(!this.#Be){if(this.#Be=!0,this.#$e.forEach(i=>i()),this.#Pt(),await this.#He(),this.#n&&(this.#n.dispose(),this.#n=null),this.#we.clear(),this.#ue)try{this.#t&&console.log("[CLOSING]: Cleaning up local MCP servers"),await this.#ue.cleanup()}catch(i){this.#e.Sentry?.captureException(i,{level:"warning",tags:{operation:"local-mcp-cleanup"}})}if(await this.stopEventLoop(),await this.waitUntilState("close",5e3),this.#A.removeAllListeners(),await Promise.allSettled(this.#ne),e){let i=await this.needsBackup();this.#t&&console.log(`[CLOSING]: Closing code gen server: ${JSON.stringify({uploadGitBackup:e,needsBackup:i})}`),i&&await this.uploadBackup()}else this.#t&&console.log(`[CLOSING]: Closing code gen server: ${JSON.stringify({uploadGitBackup:e})}`)}}async#x(){if(!this.#g||this.#c.length===0)return null;let i=(await this.#_(async r=>this.#Ut(r))).results.filter(r=>r.success&&r.result).map(r=>r.result);if(i.length===0)return null;for(let r of i)this.#A.emit("step",r);return this.#he=i,await this.#Lt(i),i.some(r=>r.hasMergeConflict)&&await this.#fe(),i[0]}async#Lt(e){if(!this.#D||!this.#O||!this.#a.builderPublicKey||!this.#a.userId||!this.#a.builderPrivateKey)return;let i=e.some(n=>n.ahead>0||n.isSessionDirty);try{let n=new URL("/projects/branches",Je);n.searchParams.set("apiKey",this.#a.builderPublicKey),n.searchParams.set("userId",this.#a.userId),n.searchParams.set("projectId",this.#D),n.searchParams.set("branchName",this.#O);let r=await He(n,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.#a.builderPrivateKey}`},body:JSON.stringify({hasUnpushedChanges:i}),signal:AbortSignal.timeout(1e4)});!r.ok&&this.#t&&console.error(`Failed to update branch unpushed status: ${r.status} ${r.statusText}`)}catch(n){this.#t&&console.error("Failed to update branch unpushed status:",n)}}queueGitStatusReminder(e){if(this.#he.length===0)return;let i=this.#he.map(n=>bee(n,this.gitEnabledFolders,e));this.queueSystemReminder({text:i.join(`
|
|
1907
1907
|
|
|
1908
|
-
`),tag:"reminder:git-status"})}async manualCommit(e){if(!this.#g)return!1;let i=this.getSessionContext();if(!i.beforeCommit){let n=await this.#P();Object.keys(n).length>0&&(i.beforeCommit=AA(n))}return await this.commitWorkInProgress(e.commitMessage,[e.add]),await this.#q(!0),!0}getLastSuggestedAction(){return this.#Z}async#fe(){let e=this.getSessionContext();if(e.state==="generating"||e.state==="close")return this.#Z=void 0,!1;let i=await this.#Le(!0,"all");return e=this.getSessionContext(),e.state!=="generating"&&e.state!=="close"?(this.#Z=i,this.#A.emit("step",{type:"wait-for-input",state:e.state,suggestion:i,sessionMode:e.sessionMode,hasPlanToApply:this.#N}),!0):!1}async#Ut(e){if(!this.#g)return null;this.#Ee++;let i=this.getCommitMode(),n=this.getFeatureBranch(),r=this.#ne(e),s=e.path,o=e.folderName===this.#c[0]?.folderName,a=this.getSessionContext(),A=!1,c=!1,u="",l=null;try{let E=await this.git(["rev-parse","--absolute-git-dir"],{cwd:s});l=this.#e.join(E.trim(),"FETCH_HEAD"),vp.default.existsSync(l)&&vp.default.unlinkSync(l)}catch(E){this.#e.Sentry?.captureException(E,{tags:{operation:"codegen-git",endpoint:"getGitStatus"},extra:{fetchHeadFilePath:l,isCheckingGitStatus:this.#Ee,folderName:e.folderName}}),l=null}try{u=await this.git(["fetch","--no-tags","origin",r],{cwd:s}),A=!0}catch{A=!1}let p=await this.#e.getRepoInfo(s),d=Bu(a.beforeCommit,e.folderName,this.gitRepoContexts[0]?.folderName);!o&&!e.initialCommit&&p.commit&&(e.initialCommit=p.commit),!d&&e.initialCommit&&(d=e.initialCommit);let g=this.#Je(e.folderName),m=g?1:0,h=0;if(A){if(n!==r)try{await this.git(["--no-pager","diff","--quiet",`refs/remotes/origin/${n}...refs/remotes/origin/${r}`],{cwd:s}),c=!1}catch{c=!0}else c=!0;try{let E=Bee(await this.git(["rev-list","--left-right","--count","HEAD...FETCH_HEAD"],{cwd:s}));m=E.ahead,h=E.behind}catch(E){let Q=null;if(l)try{Q=await this.#e.readFile(this.#e.join(s,".git/FETCH_HEAD")),Q=`FETCH_HEAD: ${Q} `}catch(D){Q=`FETCH_HEAD FAILED: ${String(D)} `}else Q="FETCH_HEAD MISSING";this.#e.Sentry?.captureException(E,{tags:{operation:"codegen-git",endpoint:"getGitStatus"},extra:{fetchOutput:u,fetchHead:Q,remoteBranch:r,currentBranch:p.currentBranch,currentCommit:p.commit,isCheckingGitStatus:this.#Ee,folderName:e.folderName}})}}else!A&&i!=="commits"&&d&&d!==p.commit&&(m=Math.max(m,1));let C=await this.#K(s),I=C.length>0,B=await this.#$t(s);return this.#Ee--,{type:"git",folderName:e.folderName,remoteBranchExists:A,remoteBranchHasChanges:c,hasGeneratingPlaceholder:await this.#Yt(),isSessionDirty:g||!!d&&d!==p.commit,canSync:(m>0||h>0||B)&&!I,canPush:(m>0||h>0)&&!I,hasStagedChanges:B,canPull:h>0&&A,ahead:m,hasMergeConflict:I,commitMode:i,behind:h,currentCommit:p.commit,currentBranch:p.currentBranch,pendingValidation:this.#Y,remoteBranch:r,unmergedFiles:C}}#gt(){let e=this.getSessionContext(),i=e.turns,n=[];n.push({type:"session",title:e.title,beforeCommit:e.beforeCommit,createdUnixTime:e.createdUnixTime,updatedUnixTime:e.updatedUnixTime,turns:e.turns.length,id:e.sessionId,lastCompletionId:this.getLastCompletionId(),sessionMode:e.sessionMode,fusionConfig:h0(this.#s),hasBrowserAutomation:e.customAgents.some(r=>r.name==="browser-testing"),customInstructions:e.customInstructions.filter(r=>!r.hideUI).map(r=>({name:r.name,description:r.description??"",type:r.type??"always",glob:r.glob}))}),Object.keys(this.#M).length>0&&n.push({type:"metadata",...this.#M}),this.#i.length>0&&n.push({type:"message-queue",queue:this.#i.map(r=>({idempotencyKey:r.idempotencyKey,displayPrompt:r.displayPrompt,user:r.user}))});for(let r of i){n.push({type:"user",displayPrompt:r.userMessage?r.userMessage.displayPrompt??r.userMessage.userPrompt:void 0,attachments:r.userMessage?.attachments,id:r.completionId,user:r.user,role:r.user.role,compacting:!1,idempotencyKey:r.userMessage?.idempotencyKey??""});for(let s of r.actions)(s.type==="tool"||s.type==="text"||s.type==="thinking")&&(n.push({type:"start",name:s.type,content:"",id:s.id??"",filePath:s.filePath??"",title:s.actionTitle??s.artifactTitle??s.filePath??""}),n.push({type:"delta",name:s.type,delta:s.content}),s.type==="tool"?n.push({type:s.type,id:s.id,name:s.filePath,content:s.content}):s.type==="thinking"?n.push({type:"planning",content:s.content}):s.type==="text"&&n.push({type:"text",content:s.content}))}return n}connectToEventLoop(e,i,n){let r=n?.canHandleTools??[];if(e){let s=[],o=this.getSessionContext();s.push({type:"state",newState:"replay",abortable:!1,previousState:o.state}),this.#Fe&&s.push(this.#Fe),s.push(...this.#he),s.push(...this.#gt()),this.#J.forEach(c=>{s.push({type:"tool-call-request",id:c.id,name:c.name,input:c.input})});let a=this.#Ae?iA(this.#Ae):void 0;if(a)switch(a.type){case"file":case"diff":case"text":case"thinking":case"suggestion":case"tool":s.push({type:"start",id:a.id,name:a.type,filePath:a.filePath??"",title:a.actionTitle??a.artifactTitle??"",content:""}),s.push({type:"delta",name:a.type,delta:a.content});break}s.push({type:"terminals",terminals:this.#Oe()});let A=this.#u;A?(s.push({type:"dev-server",devServerState:A.devState,setupState:A.setupState,httpServerState:A.httpServerState.state,devCommand:A.devCommand,setupCommand:A.setupCommand,proxyServer:A.proxyTarget,proxyServerSelection:A.proxyServerSelection,remoteAddress:A.httpServerState.remoteAddress,remotePort:A.httpServerState.remotePort,proxyServerReachable:!!this.#s?.isLocal,validateState:A.validateCommandState}),A.setupState!=="installed"&&s.push({type:"stdio",id:"setupCommand",command:A.setupCommand??"",content:A.getSetupWrite(),source:"run-command",stream:"stdout"}),s.push({type:"stdio",id:"devServer",command:A.devCommand,content:A.getDevWrite(),source:"run-command",stream:"stdout"})):i({type:"dev-server",devServerState:"running",setupState:"installed",httpServerState:"ok-2xx",devCommand:this.#s?.devCommand,setupCommand:this.#s?.setupCommand,proxyServer:this.#s?.serverUrl,proxyServerSelection:"hardcoded",remoteAddress:void 0,remotePort:void 0,proxyServerReachable:!!this.#s?.isLocal,validateState:"unset"}),s.push({type:"state",newState:o.state,abortable:o.state==="generating",previousState:"replay"}),this.#W&&o.state!=="generating"&&s.push({type:"wait-for-input",state:o.state,suggestion:this.#Z,sessionMode:o.sessionMode,hasPlanToApply:this.#N}),i({type:"batch",steps:s})}this.#A.on("step",i);for(let s of r)this.#l.set(s,(this.#l.get(s)??0)+1);return this.waitForEventLoop(),()=>{this.#A.off("step",i);for(let s of r)this.#l.set(s,(this.#l.get(s)??0)-1)}}waitUntilPendingPromises(e){let i=np();return this.#t&&console.log(`[AGENT](waitUntilPendingPromises-${i}): started`),gu(Promise.allSettled(this.#ie),e).then(()=>pu()).then(()=>{this.#t&&console.log(`[AGENT](waitUntilPendingPromises-${i}): finished`)})}waitUntilBlockingPendingPromises(e){let i=np();return this.#t&&console.log(`[AGENT](waitUntilBlockingPendingPromises-${i}): started`),gu(Promise.allSettled(this.#xe),e).then(()=>pu()).then(()=>{this.#t&&console.log(`[AGENT](waitUntilBlockingPendingPromises-${i}): finished`)})}waitUntilIdle(e){let i=np();return this.waitForEventLoop(),this.#t&&console.log(`[AGENT](waitUntilIdle-${i}): started`),gu(pu().then(()=>this.waitUntilPendingPromises()).then(()=>{let n=this.getSessionContext();return this.#t&&console.log(`[AGENT](waitUntilIdle-${i}): starting in ${n.state} `),n.state==="generating"?(0,lv.once)(this.#A,"idle"):Promise.resolve(void 0)}).then(()=>this.waitUntilPendingPromises()).then(()=>{this.#t&&console.log(`[AGENT](waitUntilIdle-${i}): idle reached in ${this.getSessionContext().state} `)}),e)}async#dt(e){let i=this.#u;if(!i)throw new Error("Dev server not found");let n=await i.runValidateCommand(void 0,e);return n.status==="success"&&(this.#Y=!1,this.#g&&(await this.#Ge()).length===0&&(await this.#je()||await this.manualCommit({add:".",commitMessage:"Validate command fixes"}))),n}waitForEventLoop(){return this.#W?this.#W:this.#W=this.#Gt()}async#Gt(){if(this.#W||this.#R)throw new Error("Event loop already started");this.#t&&console.log("[AGENT](eventLoop): started");let e=Eee(),i=a=>{a.type==="error"&&this.#te>0&&(Rpe.includes(a.code)||(a.restoreCredits=this.#te,this.#te=0,lee(this.#e,this.#a,s.sessionId,a.restoreCredits).catch(A=>{this.#e.Sentry?.captureException(A)}))),this.#A.emit("step",a)};this.#R=new AbortController;let n=this.#R.signal,r=this.#u,s=this.getSessionContext(),o=()=>this.getLastCompletionId();this.#e.Sentry?.setContext("codeGen",{sessionId:s.sessionId,get completionId(){return o()}}),await this.#H(this.#x(),"initial-emitGitStatus"),this.queueGitStatusReminder({trigger:"session-start"}),r?.setupState==="not-installed"&&this.runSetupCommand();try{let a=0;for(;!n.aborted;){a++,this.#m=void 0;let A=this.#Tt();if(this.#t&&console.log(`[AGENT](eventLoop-${a}): started (shouldWait: ${A.shouldWait})`),A.shouldWait){await this.#ut();let l=await this.#fe();if(n.aborted)break;l&&Dee(A.promise,500).then(p=>{p&&(this.#t&&console.log(`[AGENT](eventLoop-${a}): emitting idle on next message wait`),this.#A.emit("idle"))})}let c=await A.promise;if(n.aborted)break;if(!c)continue;this.#m=new AbortController;let u=Fn([n,this.#m.signal]);try{if(this.#Z=void 0,c.logsCheckpoint&&r?.addCheckpoint(),u?.aborted)throw nn(u.reason);this.#L("generating"),r?.abortValidateCommand(),c.syncChanges&&(this.#t&&console.log(`[AGENT](eventLoop-${a}): syncing changes from remote`),await this.syncChangesFromRemote(c.syncChanges),await this.#Le(!1,"critical")),c.sessionMode&&c.sessionMode!==s.sessionMode&&this.switchSessionMode(c.sessionMode),await this.#Ot(c,u,i),this.#L("success");let l=c.autoPush??this.#z??"none";if(l!=="none"&&(this.#t&&console.log(`[AGENT](eventLoop-${a}): autoPush: ${l}`),await this.waitUntilBlockingPendingPromises(),(await this.#Ge()).length===0)){let d=(()=>{switch(l){case"force-push":return{actor:"agent",forcePush:!0,pullFirst:!1};case"merge-push":return{actor:"agent",pullFirst:!0,forcePush:!1};case"ff-push":return{actor:"agent",requireFastForward:!0,pullFirst:!1};case"safe-push":return{actor:"agent",pullFirst:!0,abortOnMergeConflict:!0};default:return{actor:"agent"}}})();if(this.#c.length>1)for(let g of this.#c)await this.#de({...d,folderName:g.folderName});else await this.#de(d)}this.#Z=void 0}catch(l){l instanceof Error?l.name==="AbortError"?(i({type:"user-abort",hasContinueMessage:this.#i.length>0}),this.#L("abort")):l instanceof qe?(this.#o=void 0,i({type:"error",code:"cli-network-error",message:l.message}),this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#L("error")):l instanceof Gt?(this.#o=void 0,i({type:"error",code:"unknown",message:"An internal error occurred. Please try again."}),this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#L("error")):l instanceof Xr?(this.#o=void 0,i({type:"error",code:l.code,message:l.message}),Rpe.includes(l.code)||this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#L("error")):(this.#o=void 0,i({type:"error",code:"cli-genetic-error",message:l.message,metadata:{error:l}}),this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#L("error")):this.#L("error")}this.#ft++}}catch(a){throw this.#e.Sentry?.captureException(a,{level:"fatal"}),a}finally{this.#R=void 0,this.#W=void 0,e()}this.#t&&console.log("[AGENT](eventLoop): emitting idle on close"),this.#A.emit("idle"),this.#L("close")}async#Ot(e,i,n){this.#te=0,this.#Y=!1;let r=this.getSessionContext(),s=e.displayPrompt||e.userPrompt||"";s&&this.#_e.push(s);let o;if(e.agentType&&e.agentType!==this.#De){let Q=await this.getNamedAgentConfig(e.agentType,this.getSessionId(),i);Q.success&&(o={enabledTools:this.#E,modelOverride:this.#j,mode:this.#p,systemPromptOverride:this.#X,position:this.#C,includeMemories:this.#k},this.#E=Q.options.enabledTools,this.#j=Q.options.modelOverride,this.#p=Q.options.mode,this.#X=Q.options.systemPromptOverride,this.#C=Q.options.position,this.#k=Q.options.includeMemories)}let a=e.maxCompletions??this.#s?.maxAgentCompletions,A=a??PD,c=a??aee,u=0,l=0,p=!0,d=!1,g=!1,m,h=0,C=0,I=!1,B=0;try{for(;;B++){if(this.#t&&console.log(`[AGENT](agentCompletion-${B}): started`),this.#e.connectionTracker.getConnectionCount()>0&&l>=A||l>=c){n({type:"error",code:"ask-to-continue",message:"The agent has been working for a while. Do you want to continue?"});break}if(i?.aborted)throw nn(i.reason);try{if(this.cancelAllPendingToolFulfilments(),m||(m=await this.#Jt(e,p,i,n),m.modelOverride=e.modelOverride),m.user.role==="user"){let D=m.files.filter(x=>(x.importance??0)>2.5&&x.content).map(x=>({filePath:x.filePath,size:x.content?.length??0,isCustomInstruction:!1,wasIncluded:x.wasIncluded}));r.customInstructions.forEach(x=>{x.filePath&&x.type==="always"&&D.push({filePath:x.filePath,size:x.content?.length??0,isCustomInstruction:!0,wasIncluded:!0})}),n({type:"user-input",prompt:m.userMessage?.displayPrompt??m.userPrompt,files:D})}try{let D=await this.#Kt(r,m,i,n),{shouldContinue:x,completions:v,filesChanged:R}=D;if(this.#t&&console.log(`[AGENT](agentCompletion-${B}): completion: ${JSON.stringify(D)}`),p=!1,m=void 0,u=0,d||=R,g||=R,l+=v,this.#Y||=R,this.#o=void 0,R&&this.#u?.addCheckpoint(),i?.aborted)throw nn(i.reason);let w=this.#Nt();w?.syncChanges&&await this.syncChangesFromRemote(w.syncChanges);let{hasHealthIssue:F}=await this.#Bt();if(w){this.#t&&console.log(`[AGENT](agentCompletion-${B}): consumed queued messages`),p=!0,e=w,l=0;continue}if(!x){if(i?.aborted)throw nn(i.reason);if(this.getSessionMode()!=="normal"&&!this.#N&&!I&&C<3){this.#t&&console.log(`[AGENT](agentCompletion-${B}): adding reminder for missing plan`),I=!0,C++,this.queueSystemReminder({text:"Remember to always write the plan file and call the ExitPlanMode tool before finishing. Also, prefer using AskUserQuestion tool to ask questions to the user."});continue}if(F&&C<3){this.#t&&console.log(`[AGENT](agentCompletion-${B}): has health issue, continuing`),C++;continue}let O=this.#u,j=e.runValidateCommand??!0;if(O?.validateCommand&&j&&h<2&&this.#Y){g=!0,h++,n({type:"start",name:"validate-command",id:"validate-command",title:"Validate Command",content:""});let $=e.autoPush;this.#t&&console.log(`[AGENT](agentCompletion-${B}): running validate command`),this.#dt(i).then(M=>{if(this.#t&&console.log(`[AGENT](validate-command): result status ${M.status}`),M.status==="failure"&&M.code){let G=M.output?Sd(M.output,100,500):"";this.sendMessage({user:e.user,maxCompletions:e.maxCompletions,runValidateCommand:!0,userPrompt:`The validate command failed with code ${M.code}):
|
|
1908
|
+
`),tag:"reminder:git-status"})}async manualCommit(e){if(!this.#g)return!1;let i=this.getSessionContext();if(!i.beforeCommit){let n=await this.#P();Object.keys(n).length>0&&(i.beforeCommit=AA(n))}return await this.commitWorkInProgress(e.commitMessage,[e.add]),await this.#q(!0),!0}getLastSuggestedAction(){return this.#Z}async#fe(){let e=this.getSessionContext();if(e.state==="generating"||e.state==="close")return this.#Z=void 0,!1;let i=await this.#Le(!0,"all");return e=this.getSessionContext(),e.state!=="generating"&&e.state!=="close"?(this.#Z=i,this.#A.emit("step",{type:"wait-for-input",state:e.state,suggestion:i,sessionMode:e.sessionMode,hasPlanToApply:this.#N}),!0):!1}async#Ut(e){if(!this.#g)return null;this.#Ee++;let i=this.getCommitMode(),n=this.getFeatureBranch(),r=this.#re(e),s=e.path,o=e.folderName===this.#c[0]?.folderName,a=this.getSessionContext(),A=!1,c=!1,u="",l=null;try{let E=await this.git(["rev-parse","--absolute-git-dir"],{cwd:s});l=this.#e.join(E.trim(),"FETCH_HEAD"),vp.default.existsSync(l)&&vp.default.unlinkSync(l)}catch(E){this.#e.Sentry?.captureException(E,{tags:{operation:"codegen-git",endpoint:"getGitStatus"},extra:{fetchHeadFilePath:l,isCheckingGitStatus:this.#Ee,folderName:e.folderName}}),l=null}try{u=await this.git(["fetch","--no-tags","origin",r],{cwd:s}),A=!0}catch{A=!1}let p=await this.#e.getRepoInfo(s),d=Bu(a.beforeCommit,e.folderName,this.gitRepoContexts[0]?.folderName);!o&&!e.initialCommit&&p.commit&&(e.initialCommit=p.commit),!d&&e.initialCommit&&(d=e.initialCommit);let g=this.#Je(e.folderName),m=g?1:0,h=0;if(A){if(n!==r)try{await this.git(["--no-pager","diff","--quiet",`refs/remotes/origin/${n}...refs/remotes/origin/${r}`],{cwd:s}),c=!1}catch{c=!0}else c=!0;try{let E=Bee(await this.git(["rev-list","--left-right","--count","HEAD...FETCH_HEAD"],{cwd:s}));m=E.ahead,h=E.behind}catch(E){let Q=null;if(l)try{Q=await this.#e.readFile(this.#e.join(s,".git/FETCH_HEAD")),Q=`FETCH_HEAD: ${Q} `}catch(D){Q=`FETCH_HEAD FAILED: ${String(D)} `}else Q="FETCH_HEAD MISSING";this.#e.Sentry?.captureException(E,{tags:{operation:"codegen-git",endpoint:"getGitStatus"},extra:{fetchOutput:u,fetchHead:Q,remoteBranch:r,currentBranch:p.currentBranch,currentCommit:p.commit,isCheckingGitStatus:this.#Ee,folderName:e.folderName}})}}else!A&&i!=="commits"&&d&&d!==p.commit&&(m=Math.max(m,1));let C=await this.#K(s),I=C.length>0,B=await this.#$t(s);return this.#Ee--,{type:"git",folderName:e.folderName,remoteBranchExists:A,remoteBranchHasChanges:c,hasGeneratingPlaceholder:await this.#Yt(),isSessionDirty:g||!!d&&d!==p.commit,canSync:(m>0||h>0||B)&&!I,canPush:(m>0||h>0)&&!I,hasStagedChanges:B,canPull:h>0&&A,ahead:m,hasMergeConflict:I,commitMode:i,behind:h,currentCommit:p.commit,currentBranch:p.currentBranch,pendingValidation:this.#Y,remoteBranch:r,unmergedFiles:C}}#gt(){let e=this.getSessionContext(),i=e.turns,n=[];n.push({type:"session",title:e.title,beforeCommit:e.beforeCommit,createdUnixTime:e.createdUnixTime,updatedUnixTime:e.updatedUnixTime,turns:e.turns.length,id:e.sessionId,lastCompletionId:this.getLastCompletionId(),sessionMode:e.sessionMode,fusionConfig:h0(this.#s),hasBrowserAutomation:e.customAgents.some(r=>r.name==="browser-testing"),customInstructions:e.customInstructions.filter(r=>!r.hideUI).map(r=>({name:r.name,description:r.description??"",type:r.type??"always",glob:r.glob}))}),Object.keys(this.#M).length>0&&n.push({type:"metadata",...this.#M}),this.#i.length>0&&n.push({type:"message-queue",queue:this.#i.map(r=>({idempotencyKey:r.idempotencyKey,displayPrompt:r.displayPrompt,user:r.user}))});for(let r of i){n.push({type:"user",displayPrompt:r.userMessage?r.userMessage.displayPrompt??r.userMessage.userPrompt:void 0,attachments:r.userMessage?.attachments,id:r.completionId,user:r.user,role:r.user.role,compacting:!1,idempotencyKey:r.userMessage?.idempotencyKey??""});for(let s of r.actions)(s.type==="tool"||s.type==="text"||s.type==="thinking")&&(n.push({type:"start",name:s.type,content:"",id:s.id??"",filePath:s.filePath??"",title:s.actionTitle??s.artifactTitle??s.filePath??""}),n.push({type:"delta",name:s.type,delta:s.content}),s.type==="tool"?n.push({type:s.type,id:s.id,name:s.filePath,content:s.content}):s.type==="thinking"?n.push({type:"planning",content:s.content}):s.type==="text"&&n.push({type:"text",content:s.content}))}return n}connectToEventLoop(e,i,n){let r=n?.canHandleTools??[];if(e){let s=[],o=this.getSessionContext();s.push({type:"state",newState:"replay",abortable:!1,previousState:o.state}),this.#Fe&&s.push(this.#Fe),s.push(...this.#he),s.push(...this.#gt()),this.#J.forEach(c=>{s.push({type:"tool-call-request",id:c.id,name:c.name,input:c.input})});let a=this.#ce?iA(this.#ce):void 0;if(a)switch(a.type){case"file":case"diff":case"text":case"thinking":case"suggestion":case"tool":s.push({type:"start",id:a.id,name:a.type,filePath:a.filePath??"",title:a.actionTitle??a.artifactTitle??"",content:""}),s.push({type:"delta",name:a.type,delta:a.content});break}s.push({type:"terminals",terminals:this.#Oe()});let A=this.#u;A?(s.push({type:"dev-server",devServerState:A.devState,setupState:A.setupState,httpServerState:A.httpServerState.state,devCommand:A.devCommand,setupCommand:A.setupCommand,proxyServer:A.proxyTarget,proxyServerSelection:A.proxyServerSelection,remoteAddress:A.httpServerState.remoteAddress,remotePort:A.httpServerState.remotePort,proxyServerReachable:!!this.#s?.isLocal,validateState:A.validateCommandState}),A.setupState!=="installed"&&s.push({type:"stdio",id:"setupCommand",command:A.setupCommand??"",content:A.getSetupWrite(),source:"run-command",stream:"stdout"}),s.push({type:"stdio",id:"devServer",command:A.devCommand,content:A.getDevWrite(),source:"run-command",stream:"stdout"})):i({type:"dev-server",devServerState:"running",setupState:"installed",httpServerState:"ok-2xx",devCommand:this.#s?.devCommand,setupCommand:this.#s?.setupCommand,proxyServer:this.#s?.serverUrl,proxyServerSelection:"hardcoded",remoteAddress:void 0,remotePort:void 0,proxyServerReachable:!!this.#s?.isLocal,validateState:"unset"}),s.push({type:"state",newState:o.state,abortable:o.state==="generating",previousState:"replay"}),this.#W&&o.state!=="generating"&&s.push({type:"wait-for-input",state:o.state,suggestion:this.#Z,sessionMode:o.sessionMode,hasPlanToApply:this.#N}),i({type:"batch",steps:s})}this.#A.on("step",i);for(let s of r)this.#l.set(s,(this.#l.get(s)??0)+1);return this.waitForEventLoop(),()=>{this.#A.off("step",i);for(let s of r)this.#l.set(s,(this.#l.get(s)??0)-1)}}waitUntilPendingPromises(e){let i=np();return this.#t&&console.log(`[AGENT](waitUntilPendingPromises-${i}): started`),gu(Promise.allSettled(this.#ne),e).then(()=>pu()).then(()=>{this.#t&&console.log(`[AGENT](waitUntilPendingPromises-${i}): finished`)})}waitUntilBlockingPendingPromises(e){let i=np();return this.#t&&console.log(`[AGENT](waitUntilBlockingPendingPromises-${i}): started`),gu(Promise.allSettled(this.#xe),e).then(()=>pu()).then(()=>{this.#t&&console.log(`[AGENT](waitUntilBlockingPendingPromises-${i}): finished`)})}waitUntilIdle(e){let i=np();return this.waitForEventLoop(),this.#t&&console.log(`[AGENT](waitUntilIdle-${i}): started`),gu(pu().then(()=>this.waitUntilPendingPromises()).then(()=>{let n=this.getSessionContext();return this.#t&&console.log(`[AGENT](waitUntilIdle-${i}): starting in ${n.state} `),n.state==="generating"?(0,lv.once)(this.#A,"idle"):Promise.resolve(void 0)}).then(()=>this.waitUntilPendingPromises()).then(()=>{this.#t&&console.log(`[AGENT](waitUntilIdle-${i}): idle reached in ${this.getSessionContext().state} `)}),e)}async#dt(e){let i=this.#u;if(!i)throw new Error("Dev server not found");let n=await i.runValidateCommand(void 0,e);return n.status==="success"&&(this.#Y=!1,this.#g&&(await this.#Ge()).length===0&&(await this.#je()||await this.manualCommit({add:".",commitMessage:"Validate command fixes"}))),n}waitForEventLoop(){return this.#W?this.#W:this.#W=this.#Gt()}async#Gt(){if(this.#W||this.#R)throw new Error("Event loop already started");this.#t&&console.log("[AGENT](eventLoop): started");let e=Eee(),i=a=>{a.type==="error"&&this.#ie>0&&(Rpe.includes(a.code)||(a.restoreCredits=this.#ie,this.#ie=0,lee(this.#e,this.#a,s.sessionId,a.restoreCredits).catch(A=>{this.#e.Sentry?.captureException(A)}))),this.#A.emit("step",a)};this.#R=new AbortController;let n=this.#R.signal,r=this.#u,s=this.getSessionContext(),o=()=>this.getLastCompletionId();this.#e.Sentry?.setContext("codeGen",{sessionId:s.sessionId,get completionId(){return o()}}),await this.#H(this.#x(),"initial-emitGitStatus"),this.queueGitStatusReminder({trigger:"session-start"}),r?.setupState==="not-installed"&&this.runSetupCommand();try{let a=0;for(;!n.aborted;){a++,this.#m=void 0;let A=this.#Tt();if(this.#t&&console.log(`[AGENT](eventLoop-${a}): started (shouldWait: ${A.shouldWait})`),A.shouldWait){await this.#ut();let l=await this.#fe();if(n.aborted)break;l&&Dee(A.promise,500).then(p=>{p&&(this.#t&&console.log(`[AGENT](eventLoop-${a}): emitting idle on next message wait`),this.#A.emit("idle"))})}let c=await A.promise;if(n.aborted)break;if(!c)continue;this.#m=new AbortController;let u=Fn([n,this.#m.signal]);try{if(this.#Z=void 0,c.logsCheckpoint&&r?.addCheckpoint(),u?.aborted)throw nn(u.reason);this.#L("generating"),r?.abortValidateCommand(),c.syncChanges&&(this.#t&&console.log(`[AGENT](eventLoop-${a}): syncing changes from remote`),await this.syncChangesFromRemote(c.syncChanges),await this.#Le(!1,"critical")),c.sessionMode&&c.sessionMode!==s.sessionMode&&this.switchSessionMode(c.sessionMode),await this.#Ot(c,u,i),this.#L("success");let l=c.autoPush??this.#z??"none";if(l!=="none"&&(this.#t&&console.log(`[AGENT](eventLoop-${a}): autoPush: ${l}`),await this.waitUntilBlockingPendingPromises(),(await this.#Ge()).length===0)){let d=(()=>{switch(l){case"force-push":return{actor:"agent",forcePush:!0,pullFirst:!1};case"merge-push":return{actor:"agent",pullFirst:!0,forcePush:!1};case"ff-push":return{actor:"agent",requireFastForward:!0,pullFirst:!1};case"safe-push":return{actor:"agent",pullFirst:!0,abortOnMergeConflict:!0};default:return{actor:"agent"}}})();if(this.#c.length>1)for(let g of this.#c)await this.#de({...d,folderName:g.folderName});else await this.#de(d)}this.#Z=void 0}catch(l){l instanceof Error?l.name==="AbortError"?(i({type:"user-abort",hasContinueMessage:this.#i.length>0}),this.#L("abort")):l instanceof qe?(this.#o=void 0,i({type:"error",code:"cli-network-error",message:l.message}),this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#L("error")):l instanceof Gt?(this.#o=void 0,i({type:"error",code:"unknown",message:"An internal error occurred. Please try again."}),this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#L("error")):l instanceof Xr?(this.#o=void 0,i({type:"error",code:l.code,message:l.message}),Rpe.includes(l.code)||this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#L("error")):(this.#o=void 0,i({type:"error",code:"cli-genetic-error",message:l.message,metadata:{error:l}}),this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#L("error")):this.#L("error")}this.#ft++}}catch(a){throw this.#e.Sentry?.captureException(a,{level:"fatal"}),a}finally{this.#R=void 0,this.#W=void 0,e()}this.#t&&console.log("[AGENT](eventLoop): emitting idle on close"),this.#A.emit("idle"),this.#L("close")}async#Ot(e,i,n){this.#ie=0,this.#Y=!1;let r=this.getSessionContext(),s=e.displayPrompt||e.userPrompt||"";s&&this.#_e.push(s);let o;if(e.agentType&&e.agentType!==this.#De){let Q=await this.getNamedAgentConfig(e.agentType,this.getSessionId(),i);Q.success&&(o={enabledTools:this.#E,modelOverride:this.#j,mode:this.#p,systemPromptOverride:this.#X,position:this.#C,includeMemories:this.#k},this.#E=Q.options.enabledTools,this.#j=Q.options.modelOverride,this.#p=Q.options.mode,this.#X=Q.options.systemPromptOverride,this.#C=Q.options.position,this.#k=Q.options.includeMemories)}let a=e.maxCompletions??this.#s?.maxAgentCompletions,A=a??PD,c=a??aee,u=0,l=0,p=!0,d=!1,g=!1,m,h=0,C=0,I=!1,B=0;try{for(;;B++){if(this.#t&&console.log(`[AGENT](agentCompletion-${B}): started`),this.#e.connectionTracker.getConnectionCount()>0&&l>=A||l>=c){n({type:"error",code:"ask-to-continue",message:"The agent has been working for a while. Do you want to continue?"});break}if(i?.aborted)throw nn(i.reason);try{if(this.cancelAllPendingToolFulfilments(),m||(m=await this.#Jt(e,p,i,n),m.modelOverride=e.modelOverride),m.user.role==="user"){let D=m.files.filter(x=>(x.importance??0)>2.5&&x.content).map(x=>({filePath:x.filePath,size:x.content?.length??0,isCustomInstruction:!1,wasIncluded:x.wasIncluded}));r.customInstructions.forEach(x=>{x.filePath&&x.type==="always"&&D.push({filePath:x.filePath,size:x.content?.length??0,isCustomInstruction:!0,wasIncluded:!0})}),n({type:"user-input",prompt:m.userMessage?.displayPrompt??m.userPrompt,files:D})}try{let D=await this.#Kt(r,m,i,n),{shouldContinue:x,completions:v,filesChanged:R}=D;if(this.#t&&console.log(`[AGENT](agentCompletion-${B}): completion: ${JSON.stringify(D)}`),p=!1,m=void 0,u=0,d||=R,g||=R,l+=v,this.#Y||=R,this.#o=void 0,R&&this.#u?.addCheckpoint(),i?.aborted)throw nn(i.reason);let w=this.#Nt();w?.syncChanges&&await this.syncChangesFromRemote(w.syncChanges);let{hasHealthIssue:F}=await this.#Bt();if(w){this.#t&&console.log(`[AGENT](agentCompletion-${B}): consumed queued messages`),p=!0,e=w,l=0;continue}if(!x){if(i?.aborted)throw nn(i.reason);if(this.getSessionMode()!=="normal"&&!this.#N&&!I&&C<3){this.#t&&console.log(`[AGENT](agentCompletion-${B}): adding reminder for missing plan`),I=!0,C++,this.queueSystemReminder({text:"Remember to always write the plan file and call the ExitPlanMode tool before finishing. Also, prefer using AskUserQuestion tool to ask questions to the user."});continue}if(F&&C<3){this.#t&&console.log(`[AGENT](agentCompletion-${B}): has health issue, continuing`),C++;continue}let O=this.#u,j=e.runValidateCommand??!0;if(O?.validateCommand&&j&&h<2&&this.#Y){g=!0,h++,n({type:"start",name:"validate-command",id:"validate-command",title:"Validate Command",content:""});let $=e.autoPush;this.#t&&console.log(`[AGENT](agentCompletion-${B}): running validate command`),this.#dt(i).then(M=>{if(this.#t&&console.log(`[AGENT](validate-command): result status ${M.status}`),M.status==="failure"&&M.code){let G=M.output?Sd(M.output,100,500):"";this.sendMessage({user:e.user,maxCompletions:e.maxCompletions,runValidateCommand:!0,userPrompt:`The validate command failed with code ${M.code}):
|
|
1909
1909
|
<validate_command>
|
|
1910
1910
|
${M.command}
|
|
1911
1911
|
</validate_command>
|
|
@@ -1914,10 +1914,10 @@ ${M.command}
|
|
|
1914
1914
|
${G}
|
|
1915
1915
|
</output>
|
|
1916
1916
|
|
|
1917
|
-
failed with code ${M.code}`,dropAbortedPrompt:!0,attachments:void 0,displayPrompt:`The validation command ${M.command} failed with code ${M.code}.`,queue:!0,category:"repair-validate-command",syncChanges:void 0,autoPush:$})}})}break}}catch(D){throw await this.#x(),D}}catch(D){let x=function(v){return!!(v instanceof Xr&&v.code==="abrupt-end"||v instanceof Error&&v.name==="HTTPStreamBroke"||v instanceof qe&&[502,503].includes(v.statusCode??0)||v instanceof qe&&!v.statusCode&&["connection_reset","connection_timeout","connection_aborted"].includes(v.type))};var E=x;if(u<3&&x(D)){this.#t&&console.log(`[AGENT](agentCompletion-${B}): retrying error`,D),await jl(u,i),u++;continue}throw D}finally{uee(r.turns)}}}finally{this.#t&&console.log(`[AGENT](agentCompletion-${B}): finally block`),o&&(this.#E=o.enabledTools,this.#j=o.modelOverride,this.#p=o.mode,this.#X=o.systemPromptOverride,this.#C=o.position,this.#k=o.includeMemories),await this.#q(!0);let Q=this.#s?.refreshPreview??!0;d&&Q&&this.requestRefresh()}}async#Kt(e,i,n,r){if(n.aborted)throw nn(n.reason);if(this.#
|
|
1918
|
-
${E.completionId}`,O),await this.#x(),this.#
|
|
1917
|
+
failed with code ${M.code}`,dropAbortedPrompt:!0,attachments:void 0,displayPrompt:`The validation command ${M.command} failed with code ${M.code}.`,queue:!0,category:"repair-validate-command",syncChanges:void 0,autoPush:$})}})}break}}catch(D){throw await this.#x(),D}}catch(D){let x=function(v){return!!(v instanceof Xr&&v.code==="abrupt-end"||v instanceof Error&&v.name==="HTTPStreamBroke"||v instanceof qe&&[502,503].includes(v.statusCode??0)||v instanceof qe&&!v.statusCode&&["connection_reset","connection_timeout","connection_aborted"].includes(v.type))};var E=x;if(u<3&&x(D)){this.#t&&console.log(`[AGENT](agentCompletion-${B}): retrying error`,D),await jl(u,i),u++;continue}throw D}finally{uee(r.turns)}}}finally{this.#t&&console.log(`[AGENT](agentCompletion-${B}): finally block`),o&&(this.#E=o.enabledTools,this.#j=o.modelOverride,this.#p=o.mode,this.#X=o.systemPromptOverride,this.#C=o.position,this.#k=o.includeMemories),await this.#q(!0);let Q=this.#s?.refreshPreview??!0;d&&Q&&this.requestRefresh()}}async#Kt(e,i,n,r){if(n.aborted)throw nn(n.reason);if(this.#ce)throw new Error("generateCompletion already started");let s=np(),o=this.getLastTurn()?.nextUrl??this.#Q,a=!1,A=0;r({type:"start",id:"",name:"thinking",title:"Thinking",content:""});try{let c=this.#ce=[];if(!e.beforeCommit){let w=await this.#P();Object.keys(w).length>0&&(e.beforeCommit=AA(w))}let u=await this.#P(),l=AA(u),p=this.#Me;p&&this.#F?.enabled&&(p=!!this.#F.mcpServers);let d=i.userMessage?.uiContextPrompt;if(d&&!this.#S()){let w=this.#s?.workspace?.folders.find(F=>F.enableGit);w?.path&&(d=`Relative file paths are relative to: ${w.path}/`)}let g=this.#E;(i.userMessage?.enableQAReviewTool||e.userContext?.enableQAReviewTool)&&this.#p==="quality-v4"&&(g?.includes("SubmitPRReview")||(g=[...g||[],"SubmitPRReview","SubmitRecording","ResolveQAComments"]));let h={...e.userContext,fullstoryUrl:i.userMessage?.metadata?.fullstoryUrl,prNumber:i.userMessage?.metadata?.PR_NUMBER??e.userContext?.prNumber,prHeadSha:i.userMessage?.metadata?.PR_HEAD_SHA??e.userContext?.prHeadSha,repoFullName:i.userMessage?.metadata?.REPO_FULL_NAME??e.userContext?.repoFullName,hostname:i.userMessage?.metadata?.HOSTNAME??e.userContext?.hostname,enableQAReviewTool:i.userMessage?.enableQAReviewTool??e.userContext?.enableQAReviewTool,checkRunId:i.userMessage?.metadata?.CHECK_RUN_ID??e.userContext?.checkRunId,containerUrl:process.env.FUSION_ENV_ORIGIN??e.userContext?.containerUrl};e.userContext=h,this.#it=i.modelOverride;let C=this.#ue?.listTools(),I={url:o,position:this.#C,eventName:"cli code",maxPages:2,autoContinue:1,codeGenMode:this.#p,userContext:h,systemReminders:i.systemReminders,files:i.files,skipFileDiff:this.#w,maxTokens:this.#Ve,aclPolicy:this.#s?.accessControl,repoIndexingConfig:this.#s?.repoIndexingConfig,recommendedRoot:this.#ve,attachments:i.attachments,customInstructions:e.customInstructions,customAgents:e.customAgents.map(w=>({name:w.name,description:w.description})),systemPromptOverride:this.#X,sessionId:e.sessionId,userPrompt:i.userPrompt,metadata:{...h.prNumber&&{PR_NUMBER:h.prNumber},...h.prHeadSha&&{PR_HEAD_SHA:h.prHeadSha},...h.repoFullName&&{REPO_FULL_NAME:h.repoFullName},...h.hostname&&{HOSTNAME:h.hostname},...h.containerUrl&&{CONTAINER_URL:h.containerUrl},...h.checkRunId&&{CHECK_RUN_ID:h.checkRunId},...i.userMessage?.metadata},ephemeralUserPrompt:i.userMessage?.ephemeralUserPrompt,uiContextPrompt:i.userMessage?.uiContextPrompt,displayUserPrompt:i.userMessage?.displayPrompt,isManualContinue:i.userMessage?.isManualContinue,sessionMode:this.getSessionMode(),includeRelevantMemories:i.userMessage?i.userMessage.includeRelevantMemories??this.#k:void 0,projectId:this.#D,branchName:this.#O,repoHash:this.#Xe,pingEvents:!0,workingDirectory:this.#y,beforeCommit:l,toolResults:i.toolResults,role:i.user.role,user:i.user,repair:i.repair,category:i.category,enabledTools:g,enabledMCPs:p?i.enabledMCPs:void 0,localMCPTools:C,isLocal:this.#s?.isLocal,searchResponse:i.searchResponse,encryptKey:this.#ae,maxAgentTiming:180*1e3,mcpServers:p,environmentVariables:Qee(this.#s?.environmentVariables??[],this.#u?.environmentVariables??[]),redactUserMessages:this.#F?.redactUserMessages,redactLLMMessages:this.#F?.redactLLMMessages,modelOverride:i.modelOverride??this.#j};this.#t&&console.log(`[AGENT](generateCompletion-${s}): request partial body. ${JSON.stringify({url:I.url,userPrompt:I.userPrompt,systemReminders:I.systemReminders,toolResultsCount:I.toolResults?.length})}`);let B=pee(this.#e,this.#a,I,n),E,Q=!1,D=!1,x=async w=>{if(w.type==="user"){E&&E.state!=="done"&&this.#e.Sentry?.captureException(new Error("Turn was not completed before starting a new turn"),{tags:{operation:"codegen-stream"},extra:{lastTurn:E}});let F=E={state:"running",unixTime:Date.now(),title:"",sentiment:void 0,userMessage:i.userMessage,afterCommit:l,beforeCommit:l,lastCommit:void 0,creditsUsed:0,actions:[],applyResults:[],completionId:w.id??"",nextUrl:void 0,user:w.user,autoContinue:!1};E=F,e.turns.push(F),w.compacting&&(e.customInstructions=await this.#be(),e.customAgents=await this.#Se()),r({type:"user",displayPrompt:w.displayPrompt,id:w.id,user:w.user,role:w.user.role,compacting:w.compacting,idempotencyKey:i.userMessage?.idempotencyKey})}else if(w.type==="mcp-status")this.#Fe=w,r(w);else{if(w.type==="mcp-auth-required")return D=!0,r(w),!0;if(w.type==="error")return D=!0,r(w),!0;if(w.type==="done"){A++,this.#T.length=0,this.#ie+=w.creditsUsed;let F=E=await this.#jt(e,w,E,l);for(let $ of w.actions??[])$.type==="tool_result"&&($.filePath==="ExitPlanMode"&&(this.#N=!0),r({type:"tool_result",result:{content:$.content,tool_use_id:$.id,type:"tool_result",title:$.actionTitle,tool_name:$.filePath,is_error:!!$.errors?.length}}));await this.waitUntilBlockingPendingPromises(n);let O=await this.#zt(this.#e,F),j=O.length>0;j&&(a=!0),await this.commitWorkInProgress(`${E.title}
|
|
1918
|
+
${E.completionId}`,O),await this.#x(),this.#se({completionId:F.completionId,beforeCommit:F.beforeCommit}),r({type:"done",stopReason:w.stopReason,id:w.id,applyResults:F.applyResults,actions:w.actions??[],creditsUsed:w.creditsUsed,sessionUsage:w.sessionUsage,contextWindow:w.contextWindow,model:w.model,usage:w.usage,url:w.nextUrl,promptVersion:w.promptVersion,hasChanges:j})}else{if(w.type==="continue")return Q=w.autoContinue,D=!0,r({type:"continue",id:w.id,url:w.nextUrl,autoContinue:w.autoContinue}),!0;w.type==="thinking"&&(w.actionTitle="Planning"),"content"in w&&w.type!=="delta"&&r({type:"start",name:w.type,filePath:w.filePath??"",id:"id"in w?w.id:void 0,title:w.actionTitle??w.artifactTitle??w.filePath??"",content:w.content??""})}}return!1},v=w=>{if(w.type==="thinking"&&r({type:"planning",content:w.content}),w.type==="server_tool_result"){let F;try{F=JSON.parse(w.content)}catch(O){this.#e.Sentry?.captureException(O,{extra:{contentPreview:w.content?.substring(0,500),contentLength:w.content?.length},tags:{operation:"server-tool-result-parse"}}),F=w.content}r({type:"server_tool_result",content:F,title:w.actionTitle??w.artifactTitle??"Server Tool Result",id:w.id})}w.type==="file"&&w.filePath&&!w.synthetic&&r({type:"file",filePath:w.filePath,content:w.content,title:w.actionTitle??w.artifactTitle??"Created",id:w.id,errors:w.errors}),w.type==="diff"&&w.filePath&&!w.synthetic&&r({type:"diff",filePath:w.filePath,title:w.actionTitle??w.artifactTitle??"Updated",content:w.content,id:w.id,errors:w.errors}),w.type==="tool"&&w.filePath?r({type:"tool",name:w.filePath,id:w.id,content:w.content}):w.type==="text"&&r({type:"text",content:w.content})},R=(w,F)=>{r({type:"delta",name:w.type,delta:F})};for await(let w of B){if(w.type==="ping"){this.#t&&console.log(`[AGENT](generateCompletion-${s}): ping`);continue}if(w.type==="delta"){let F=w.content,O=iA(c);O&&"content"in O&&(O.content+=F,R(O,F))}else{let F=iA(c);if(w.type==="thinking"&&F?.type==="thinking")continue;if(F&&"content"in F&&(F.incomplete=!1,v(F)),c.push(w),await x(w))break}}if(!D)throw new Xr("Completion stream ended abruptly","abrupt-end");if(!E)throw new Xr("Completion stream ended abruptly","abrupt-end");return{completions:A,filesChanged:a,shouldContinue:Q||E.actions.some(w=>w.type==="tool")||E.autoContinue}}finally{this.#ce=void 0}}async commitWorkInProgress(e,i){if(!this.#g)return;let n=this.#Ft(i);await this.#_(async r=>{let s=n.get(r.folderName)||[],o=await this.#K(r.path);try{o.length>0?(s.length>0&&await this.git(["add",...s],{cwd:r.path,retry:2}),(await this.#K(r.path)).length===0&&await this.git(["add","-A","."],{cwd:r.path,retry:2})):await this.git(["add","-A","."],{cwd:r.path,retry:2})}catch(a){this.#e.Sentry?.captureException(new Error(`Error staging files in ${r.folderName}: ${a}`),{tags:{operation:"codegen-git-stage"}})}}),typeof this.#pe=="string"?this.#pe+=`
|
|
1919
1919
|
${e}`:this.#pe=e}async#q(e){if(!this.#g)return!1;let i=this.#pe,n=this.#_e,r=this.getLastTurn(),s=r?.completionId;this.#pe=null,this.#_e=[];let a=(async()=>{if(await this.#nt,!i)return!1;this.#t&&console.log("[AGENT](#commitAccumulatedChanges): committing pending changes");let A=!1;try{await this.#_(async l=>{let p="";try{await this.git(["--no-pager","diff","--cached","--quiet"],{cwd:l.path});return}catch{try{if(p=await this.git(["--no-pager","diff","--cached","--no-color"],{cwd:l.path}),!p.trim())return}catch{return}}let d=await this.#St(l.path),g=i,I=((await lC(this.#a,"/codegen/commit-message",{diff:Sd(p,1e3),userMessages:n,recentCommits:d,projectId:this.#D},{signal:AbortSignal.timeout(2e4)}))?.message||g).split(`
|
|
1920
|
-
`).flatMap(B=>["-m",B]);try{await this.git(["commit","--quiet","--no-verify","--no-gpg-sign",...I],{cwd:l.path}),A=!0}catch(B){this.#e.Sentry?.captureException(new Error(`Error in batch commit for ${l.folderName}: ${B}`),{tags:{operation:"codegen-git-batch-commit"}})}});let c=await this.#P(),u=AA(c);return u&&(this.#b={...this.#b,...c},r&&(r.afterCommit=u,r.lastCommit=u),this.#
|
|
1920
|
+
`).flatMap(B=>["-m",B]);try{await this.git(["commit","--quiet","--no-verify","--no-gpg-sign",...I],{cwd:l.path}),A=!0}catch(B){this.#e.Sentry?.captureException(new Error(`Error in batch commit for ${l.folderName}: ${B}`),{tags:{operation:"codegen-git-batch-commit"}})}});let c=await this.#P(),u=AA(c);return u&&(this.#b={...this.#b,...c},r&&(r.afterCommit=u,r.lastCommit=u),this.#se({completionId:s,beforeCommit:r?.beforeCommit,afterCommit:u,lastCommit:u,commitFailed:!1})),e&&await this.#x(),A}catch(c){return this.#e.Sentry?.captureException(new Error(`Error in #commitAccumulatedChanges: ${c}`),{tags:{operation:"codegen-git-batch-commit"}}),A}})();return this.#nt=a,this.#H(a,"commitAccumulatedChanges",!0)}async#Ht(e,i,n,r){let s=i.actions.filter(o=>o.type==="tool"&&o.id).map(o=>{let a=o.content.trim(),A={};try{A=a?JSON.parse(a):{}}catch{A={}}return{id:o.id,name:o.filePath,input:A,abortController:this.#U.find(c=>c.id===o.id)?.abortController??new AbortController}})??[];if(s.length>0){this.#U=s;try{let o={debug:this.#t,sys:this.#e,credentials:this.#a,files:e.files,user:e.user,position:this.#C,fusionConfig:this.#s,enabledTools:this.#E??[],sessionMode:this.getSessionMode(),fusionStatusMonitor:this.#ke,switchSessionMode:A=>this.switchSessionMode(A),signal:n,canCollapseWorkspace:this.#S(),emitter:this.#A,session:this,filterText:A=>(A=EV(A,this.#y),this.#s?.accessControl?.secrets&&(A=BV(A,this.#s.accessControl.secrets)),A),allowedCommands:_ee(this.#s?.allowedCommands??[]),getAllFiles:A=>this.getAllFiles({getDotFiles:A.getDotFiles,includePattern:A.pattern,gitignore:!0,maxFiles:A.maxFiles}),workingDirectory:this.#d,bashWorkingDirectory:this.#y,workspaceFolders:this.#h?.folders??[],restore:A=>this.restore(A),patchFusionConfig:A=>{e.patchFusionConfig||(e.patchFusionConfig={});let c=e.patchFusionConfig.envVariables;Object.assign(e.patchFusionConfig,A),e.patchFusionConfig.envVariables={...c,...A.envVariables}},readFile:A=>this.readFile(A),writeFile:(A,c)=>this.writeFile(A,c),deleteFile:A=>this.deleteFile(A),fileExists:A=>this.fileExists(A),listDir:A=>this.listDir(A),evaluateAccess:(A,c)=>rA(A,c,this.#s?.accessControl,this.#$()),stat:A=>this.stat(A),localMCPManager:this.#ue,passThrough:(A,c)=>new Promise((u,l)=>{if(!((this.#l.get(A.name)??0)>0)){l(new Error("The user is currently not present in the chat. Ie, he is not able to respond to the request"));return}let g=()=>{c.removeEventListener("abort",m),this.#J.delete(A.id)},m=()=>{g(),l(new Error("Aborted by the user. So the task could not be completed."))};if(c.aborted){m();return}c.addEventListener("abort",m,{once:!0}),this.#J.set(A.id,{id:A.id,name:A.name,input:A.input,resolve:h=>{g(),u(h)}}),this.#A.emit("step",{type:"tool-call-request",id:A.id,name:A.name,input:A.input})}),resolveWorkspacePath:(A,c)=>this.resolveWorkspacePath(A,c),absolutePathToWorkspaceUrl:A=>this.absolutePathToWorkspaceUrl(A),setHasPlanToApply:A=>{this.#N=A},devServerOrchestrator:this.#u},a=await Ppe(o,s,i.cachedToolResults,r);if(i.cachedToolResults=a,o.signal?.aborted)throw nn(o.signal.reason);e.patchFusionConfig&&this.#A.emit("step",{type:"fusion-config-patch",patch:e.patchFusionConfig}),e.files=o.files,e.toolResults=a}finally{this.#U=[]}}}async#Jt(e,i,n,r){let s=this.getSessionContext(),o=iA(s.turns),a=structuredClone(e.user??o?.user??{source:"agent",role:"agent"}),A={userMessage:void 0,userPrompt:"",systemReminders:this.#T.slice(),files:[],attachments:[],searchResponse:null,rerankFiles:0,mostRelevantFile:null,toolResults:[],user:a,modelOverride:e.modelOverride,repair:e.repair,category:e.category,enabledMCPs:e.enabledMCPs},c=!!this.getLastTurn()?.nextUrl,u=s.turns.length<2||!c;if(i){let l=null;if(u){let p=_pe(await this.getAllFiles({getDotFiles:!1,gitignore:!0,deep:4,truncate:2e4})),d=new Set,g=new Set;if(e.files)for(let B of e.files)d.add(hV(B));let m=e.includeBaseFiles??s.turns.length===0,h=Array.from(d),C=B=>m&&hee(B,this.#ve)?10:m&&fee(B,this.#ve)?5:g.has(B)||h.some(E=>B.toLowerCase().startsWith(E.toLowerCase()))?2:0,I=n.aborted?[]:p.map(B=>{let E=C(B);if(E===0)return{filePath:B};let Q=null;try{if(Q=this.readFileSync(B),!Q)return{filePath:B}}catch{return{filePath:B}}let D=Q.length<3e4;return{filePath:B,content:Q,importance:D?E:2}});A.files=I,A.attachments=e.attachments??[]}if(this.#g){let p,d=await this.getChangesReport();if(d){for(let g of d.files)if(!A.files.some(m=>m.filePath===g))try{let m=await this.readFile(g);A.files.push({filePath:g,importance:0,content:m??void 0})}catch{A.files.push({filePath:g,importance:0})}d.diff.length<3e4?p=d.diff:p=d.files.map(g=>`- ${g}`).join(`
|
|
1921
1921
|
`).trim().slice(0,3e4),p&&A.systemReminders.push({text:`
|
|
1922
1922
|
Since last time, some files were changed by the user or tools (formatting for example):
|
|
1923
1923
|
<modified-files-context>
|
|
@@ -2641,7 +2641,7 @@ return fn.apply(this, arguments)
|
|
|
2641
2641
|
`)+`\r
|
|
2642
2642
|
\r
|
|
2643
2643
|
`+i)}function qp(t,e,i,n,r,s){if(t.listenerCount("wsClientError")){let o=new Error(r);Error.captureStackTrace(o,qp),t.emit("wsClientError",o,i,e)}else VE(i,n,r,s)}});var cDe=b((uZt,ADe)=>{f();var g4=class{constructor(e,i,n){this.etaBufferLength=e||100,this.valueBuffer=[n],this.timeBuffer=[i],this.eta="0"}update(e,i,n){this.valueBuffer.push(i),this.timeBuffer.push(e),this.calculate(n-i)}getTime(){return this.eta}calculate(e){let i=this.valueBuffer.length,n=Math.min(this.etaBufferLength,i),r=this.valueBuffer[i-1]-this.valueBuffer[i-n],s=this.timeBuffer[i-1]-this.timeBuffer[i-n],o=r/s;this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);let a=Math.ceil(e/o/1e3);isNaN(a)?this.eta="NULL":isFinite(a)?a>1e7?this.eta="INF":a<0?this.eta=0:this.eta=a:this.eta="INF"}};ADe.exports=g4});var m4=b((pZt,uDe)=>{f();var $p=require("readline"),d4=class{constructor(e){this.stream=e,this.linewrap=!0,this.dy=0}cursorSave(){this.stream.isTTY&&this.stream.write("\x1B7")}cursorRestore(){this.stream.isTTY&&this.stream.write("\x1B8")}cursor(e){this.stream.isTTY&&(e?this.stream.write("\x1B[?25h"):this.stream.write("\x1B[?25l"))}cursorTo(e=null,i=null){this.stream.isTTY&&$p.cursorTo(this.stream,e,i)}cursorRelative(e=null,i=null){this.stream.isTTY&&(this.dy=this.dy+i,$p.moveCursor(this.stream,e,i))}cursorRelativeReset(){this.stream.isTTY&&($p.moveCursor(this.stream,0,-this.dy),$p.cursorTo(this.stream,0,null),this.dy=0)}clearRight(){this.stream.isTTY&&$p.clearLine(this.stream,1)}clearLine(){this.stream.isTTY&&$p.clearLine(this.stream,0)}clearBottom(){this.stream.isTTY&&$p.clearScreenDown(this.stream)}newline(){this.stream.write(`
|
|
2644
|
-
`),this.dy++}write(e,i=!1){this.linewrap===!0&&i===!1?this.stream.write(e.substr(0,this.getWidth())):this.stream.write(e)}lineWrapping(e){this.stream.isTTY&&(this.linewrap=e,e?this.stream.write("\x1B[?7h"):this.stream.write("\x1B[?7l"))}isTTY(){return this.stream.isTTY===!0}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}};uDe.exports=d4});var pDe=b((dZt,lDe)=>{"use strict";f();lDe.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var dDe=b((fZt,gDe)=>{"use strict";f();var $ct=pDe();gDe.exports=t=>typeof t=="string"?t.replace($ct(),""):t});var fDe=b((CZt,f4)=>{"use strict";f();var mDe=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);f4.exports=mDe;f4.exports.default=mDe});var CDe=b((EZt,hDe)=>{"use strict";f();hDe.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var EDe=b((QZt,h4)=>{"use strict";f();var zct=dDe(),Vct=fDe(),Wct=CDe(),IDe=t=>{if(typeof t!="string"||t.length===0||(t=zct(t),t.length===0))return 0;t=t.replace(Wct()," ");let e=0;for(let i=0;i<t.length;i++){let n=t.codePointAt(i);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&i++,e+=Vct(n)?2:1)}return e};h4.exports=IDe;h4.exports.default=IDe});var C4=b((DZt,BDe)=>{f();BDe.exports=function(e,i,n){if(i.autopadding!==!0)return e;function r(s,o){return(i.autopaddingChar+s).slice(-o)}switch(n){case"percentage":return r(e,3);default:return e}}});var I4=b((vZt,QDe)=>{f();QDe.exports=function(e,i){let n=Math.round(e*i.barsize),r=i.barsize-n;return i.barCompleteString.substr(0,n)+i.barGlue+i.barIncompleteString.substr(0,r)}});var E4=b((bZt,yDe)=>{f();yDe.exports=function(e,i,n){function r(o){return n?n*Math.round(o/n):o}function s(o){return(i.autopaddingChar+o).slice(-2)}return e>3600?s(Math.floor(e/3600))+"h"+s(r(e%3600/60))+"m":e>60?s(Math.floor(e/60))+"m"+s(r(e%60))+"s":e>10?s(r(e))+"s":s(e)+"s"}});var B4=b((FZt,DDe)=>{f();var Zct=EDe(),Xct=C4(),eut=I4(),tut=E4();DDe.exports=function(e,i,n){let r=e.format,s=e.formatTime||tut,o=e.formatValue||Xct,a=e.formatBar||eut,A=Math.floor(i.progress*100)+"",c=i.stopTime||Date.now(),u=Math.round((c-i.startTime)/1e3),l=Object.assign({},n,{bar:a(i.progress,e),percentage:o(A,e,"percentage"),total:o(i.total,e,"total"),value:o(i.value,e,"value"),eta:o(i.eta,e,"eta"),eta_formatted:s(i.eta,e,5),duration:o(u,e,"duration"),duration_formatted:s(u,e,1)});r=r.replace(/\{(\w+)\}/g,function(g,m){return typeof l[m]<"u"?l[m]:g});let p=Math.max(0,i.maxWidth-Zct(r)-2),d=Math.floor(p/2);switch(e.align){case"right":r=p>0?" ".repeat(p)+r:r;break;case"center":r=d>0?" ".repeat(d)+r:r;break;case"left":default:break}return r}});var rb=b((RZt,xDe)=>{f();function mi(t,e){return typeof t>"u"||t===null?e:t}xDe.exports={parse:function(e,i){let n={},r=Object.assign({},i,e);return n.throttleTime=1e3/mi(r.fps,10),n.stream=mi(r.stream,process.stderr),n.terminal=mi(r.terminal,null),n.clearOnComplete=mi(r.clearOnComplete,!1),n.stopOnComplete=mi(r.stopOnComplete,!1),n.barsize=mi(r.barsize,40),n.align=mi(r.align,"left"),n.hideCursor=mi(r.hideCursor,!1),n.linewrap=mi(r.linewrap,!1),n.barGlue=mi(r.barGlue,""),n.barCompleteChar=mi(r.barCompleteChar,"="),n.barIncompleteChar=mi(r.barIncompleteChar,"-"),n.format=mi(r.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),n.formatTime=mi(r.formatTime,null),n.formatValue=mi(r.formatValue,null),n.formatBar=mi(r.formatBar,null),n.etaBufferLength=mi(r.etaBuffer,10),n.etaAsynchronousUpdate=mi(r.etaAsynchronousUpdate,!1),n.progressCalculationRelative=mi(r.progressCalculationRelative,!1),n.synchronousUpdate=mi(r.synchronousUpdate,!0),n.noTTYOutput=mi(r.noTTYOutput,!1),n.notTTYSchedule=mi(r.notTTYSchedule,2e3),n.emptyOnZero=mi(r.emptyOnZero,!1),n.forceRedraw=mi(r.forceRedraw,!1),n.autopadding=mi(r.autopadding,!1),n.gracefulExit=mi(r.gracefulExit,!1),n},assignDerivedOptions:function(e){return e.barCompleteString=e.barCompleteChar.repeat(e.barsize+1),e.barIncompleteString=e.barIncompleteChar.repeat(e.barsize+1),e.autopaddingChar=e.autopadding?mi(e.autopaddingChar," "):"",e}}});var Q4=b((MZt,wDe)=>{f();var vDe=cDe(),iut=m4(),nut=B4(),rut=rb(),sut=require("events");wDe.exports=class extends sut{constructor(e){super(),this.options=rut.assignDerivedOptions(e),this.terminal=this.options.terminal?this.options.terminal:new iut(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new vDe(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter=typeof this.options.format=="function"?this.options.format:nut}render(e=!1){let i={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();let n=this.formatter(this.options,i,this.payload);(e||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=n)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(n),this.terminal.clearRight(),this.lastDrawnString=n,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(e,i,n){this.value=i||0,this.total=typeof e<"u"&&e>=0?e:100,this.startValue=i||0,this.payload=n||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new vDe(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",e,i)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,i={}){typeof e=="number"&&(this.value=e,this.eta.update(Date.now(),e,this.total));let n=(typeof e=="object"?e:i)||{};this.emit("update",this.total,this.value);for(let r in n)this.payload[r]=n[r];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}getProgress(){let e=this.value/this.total;return this.options.progressCalculationRelative&&(e=(this.value-this.startValue)/(this.total-this.startValue)),isNaN(e)&&(e=this.options&&this.options.emptyOnZero?0:1),e=Math.min(Math.max(e,0),1),e}increment(e=1,i={}){typeof e=="object"?this.update(this.value+1,e):this.update(this.value+e,i)}getTotal(){return this.total}setTotal(e){typeof e<"u"&&e>=0&&(this.total=e)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}}});var SDe=b((LZt,bDe)=>{f();var out=Q4(),aut=rb();bDe.exports=class extends out{constructor(e,i){super(aut.parse(e,i)),this.timer=null,this.options.noTTYOutput&&this.terminal.isTTY()===!1&&(this.options.synchronousUpdate=!1),this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){this.timer&&(clearTimeout(this.timer),this.timer=null),super.render(),this.options.noTTYOutput&&this.terminal.isTTY()===!1&&this.terminal.newline(),this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(e,i){this.timer&&(super.update(e,i),this.options.synchronousUpdate&&this.lastRedraw+this.options.throttleTime*2<Date.now()&&this.render())}start(e,i,n){this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1||(this.sigintCallback===null&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.terminal.cursorSave(),this.options.hideCursor===!0&&this.terminal.cursor(!1),this.options.linewrap===!1&&this.terminal.lineWrapping(!1),super.start(e,i,n),this.render())}stop(){this.timer&&(this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,this.options.hideCursor===!0&&this.terminal.cursor(!0),this.options.linewrap===!1&&this.terminal.lineWrapping(!0),this.terminal.cursorRestore(),this.options.clearOnComplete?(this.terminal.cursorTo(0,null),this.terminal.clearLine()):this.terminal.newline())}}});var kDe=b((OZt,FDe)=>{f();var Aut=m4(),cut=Q4(),uut=rb(),lut=require("events");FDe.exports=class extends lut{constructor(e,i){super(),this.bars=[],this.options=uut.parse(e,i),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new Aut(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(e,i,n,r={}){let s=new cut(Object.assign({},this.options,{terminal:this.terminal},r));return this.bars.push(s),this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1||(this.sigintCallback===null&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.isActive||(this.options.hideCursor===!0&&this.terminal.cursor(!1),this.options.linewrap===!1&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,s.start(e,i,n),this.emit("start")),s}remove(e){let i=this.bars.indexOf(e);return i<0?!1:(this.bars.splice(i,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0)}update(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0)for(this.terminal.clearLine();this.loggingBuffer.length>0;)this.terminal.write(this.loggingBuffer.shift(),!0);for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render();this.emit("redraw-post"),this.options.noTTYOutput&&this.terminal.isTTY()===!1&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find(e=>e.isActive)&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.isActive=!1,this.options.hideCursor===!0&&this.terminal.cursor(!0),this.options.linewrap===!1&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render(),this.bars[e].stop();this.terminal.newline()}this.emit("stop")}log(e){this.loggingBuffer.push(e)}}});var NDe=b((HZt,RDe)=>{f();RDe.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}});var MDe=b((jZt,TDe)=>{f();TDe.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var _De=b((qZt,PDe)=>{f();PDe.exports={format:" \x1B[90m{bar}\x1B[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var UDe=b((zZt,LDe)=>{f();LDe.exports={format:" {bar}\u25A0 {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u25A0",barIncompleteChar:" "}});var ODe=b((WZt,GDe)=>{f();var put=NDe(),gut=MDe(),dut=_De(),mut=UDe();GDe.exports={legacy:put,shades_classic:gut,shades_grey:dut,rect:mut}});var JDe=b((XZt,HDe)=>{f();var KDe=SDe(),fut=kDe(),hut=ODe(),Cut=B4(),Iut=C4(),Eut=I4(),But=E4();HDe.exports={Bar:KDe,SingleBar:KDe,MultiBar:fut,Presets:hut,Format:{Formatter:Cut,BarFormat:Eut,ValueFormat:Iut,TimeFormat:But}}});var VDe=b((aXt,zDe)=>{f();zDe.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Slt={};rl(Slt,{default:()=>blt});module.exports=Wi(Slt);f();f();try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="e8c7e0d3-d6ad-455a-b71f-ce803df73ea0",t._sentryDebugIdIdentifier="sentry-dbid-e8c7e0d3-d6ad-455a-b71f-ce803df73ea0")}catch{}f();var Bxe=require("../core/index.cjs"),Qxe=require("../node/index.cjs"),yxe=require("../server/index.cjs"),Dxe=ie(j4(),1);f();f();var vv=require("fs/promises");rB();Qn();wd();ti();var Oi=ie(Ri(),1),zm=require("node:path");co();Cs();ln();on();Ll();var mWe="https://cdn.builder.io",Xge=async(t,e)=>{console.log(""),Kt((0,Oi.bgCyan)((0,Oi.bold)((0,Oi.white)(" figma migrate ")))+" "+(0,Oi.dim)(ut));let{builderPrivateKey:i,builderPublicKey:n}=await Ai(t,e,{forceSpaceId:e.spaceId,builderPrivateKey:!0,builderPublicKey:!0});await ot("figma publish started",{spaceId:n});let r=await Jl(t);if(r.length>0){await ot("figma migrate with existing files",{spaceId:n}),U.warning(`${(0,Oi.yellow)("This repo already has figma mappings in:")}
|
|
2644
|
+
`),this.dy++}write(e,i=!1){this.linewrap===!0&&i===!1?this.stream.write(e.substr(0,this.getWidth())):this.stream.write(e)}lineWrapping(e){this.stream.isTTY&&(this.linewrap=e,e?this.stream.write("\x1B[?7h"):this.stream.write("\x1B[?7l"))}isTTY(){return this.stream.isTTY===!0}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}};uDe.exports=d4});var pDe=b((dZt,lDe)=>{"use strict";f();lDe.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var dDe=b((fZt,gDe)=>{"use strict";f();var $ct=pDe();gDe.exports=t=>typeof t=="string"?t.replace($ct(),""):t});var fDe=b((CZt,f4)=>{"use strict";f();var mDe=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);f4.exports=mDe;f4.exports.default=mDe});var CDe=b((EZt,hDe)=>{"use strict";f();hDe.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var EDe=b((QZt,h4)=>{"use strict";f();var zct=dDe(),Vct=fDe(),Wct=CDe(),IDe=t=>{if(typeof t!="string"||t.length===0||(t=zct(t),t.length===0))return 0;t=t.replace(Wct()," ");let e=0;for(let i=0;i<t.length;i++){let n=t.codePointAt(i);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&i++,e+=Vct(n)?2:1)}return e};h4.exports=IDe;h4.exports.default=IDe});var C4=b((DZt,BDe)=>{f();BDe.exports=function(e,i,n){if(i.autopadding!==!0)return e;function r(s,o){return(i.autopaddingChar+s).slice(-o)}switch(n){case"percentage":return r(e,3);default:return e}}});var I4=b((vZt,QDe)=>{f();QDe.exports=function(e,i){let n=Math.round(e*i.barsize),r=i.barsize-n;return i.barCompleteString.substr(0,n)+i.barGlue+i.barIncompleteString.substr(0,r)}});var E4=b((bZt,yDe)=>{f();yDe.exports=function(e,i,n){function r(o){return n?n*Math.round(o/n):o}function s(o){return(i.autopaddingChar+o).slice(-2)}return e>3600?s(Math.floor(e/3600))+"h"+s(r(e%3600/60))+"m":e>60?s(Math.floor(e/60))+"m"+s(r(e%60))+"s":e>10?s(r(e))+"s":s(e)+"s"}});var B4=b((FZt,DDe)=>{f();var Zct=EDe(),Xct=C4(),eut=I4(),tut=E4();DDe.exports=function(e,i,n){let r=e.format,s=e.formatTime||tut,o=e.formatValue||Xct,a=e.formatBar||eut,A=Math.floor(i.progress*100)+"",c=i.stopTime||Date.now(),u=Math.round((c-i.startTime)/1e3),l=Object.assign({},n,{bar:a(i.progress,e),percentage:o(A,e,"percentage"),total:o(i.total,e,"total"),value:o(i.value,e,"value"),eta:o(i.eta,e,"eta"),eta_formatted:s(i.eta,e,5),duration:o(u,e,"duration"),duration_formatted:s(u,e,1)});r=r.replace(/\{(\w+)\}/g,function(g,m){return typeof l[m]<"u"?l[m]:g});let p=Math.max(0,i.maxWidth-Zct(r)-2),d=Math.floor(p/2);switch(e.align){case"right":r=p>0?" ".repeat(p)+r:r;break;case"center":r=d>0?" ".repeat(d)+r:r;break;case"left":default:break}return r}});var rb=b((RZt,xDe)=>{f();function mi(t,e){return typeof t>"u"||t===null?e:t}xDe.exports={parse:function(e,i){let n={},r=Object.assign({},i,e);return n.throttleTime=1e3/mi(r.fps,10),n.stream=mi(r.stream,process.stderr),n.terminal=mi(r.terminal,null),n.clearOnComplete=mi(r.clearOnComplete,!1),n.stopOnComplete=mi(r.stopOnComplete,!1),n.barsize=mi(r.barsize,40),n.align=mi(r.align,"left"),n.hideCursor=mi(r.hideCursor,!1),n.linewrap=mi(r.linewrap,!1),n.barGlue=mi(r.barGlue,""),n.barCompleteChar=mi(r.barCompleteChar,"="),n.barIncompleteChar=mi(r.barIncompleteChar,"-"),n.format=mi(r.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),n.formatTime=mi(r.formatTime,null),n.formatValue=mi(r.formatValue,null),n.formatBar=mi(r.formatBar,null),n.etaBufferLength=mi(r.etaBuffer,10),n.etaAsynchronousUpdate=mi(r.etaAsynchronousUpdate,!1),n.progressCalculationRelative=mi(r.progressCalculationRelative,!1),n.synchronousUpdate=mi(r.synchronousUpdate,!0),n.noTTYOutput=mi(r.noTTYOutput,!1),n.notTTYSchedule=mi(r.notTTYSchedule,2e3),n.emptyOnZero=mi(r.emptyOnZero,!1),n.forceRedraw=mi(r.forceRedraw,!1),n.autopadding=mi(r.autopadding,!1),n.gracefulExit=mi(r.gracefulExit,!1),n},assignDerivedOptions:function(e){return e.barCompleteString=e.barCompleteChar.repeat(e.barsize+1),e.barIncompleteString=e.barIncompleteChar.repeat(e.barsize+1),e.autopaddingChar=e.autopadding?mi(e.autopaddingChar," "):"",e}}});var Q4=b((MZt,wDe)=>{f();var vDe=cDe(),iut=m4(),nut=B4(),rut=rb(),sut=require("events");wDe.exports=class extends sut{constructor(e){super(),this.options=rut.assignDerivedOptions(e),this.terminal=this.options.terminal?this.options.terminal:new iut(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new vDe(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter=typeof this.options.format=="function"?this.options.format:nut}render(e=!1){let i={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();let n=this.formatter(this.options,i,this.payload);(e||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=n)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(n),this.terminal.clearRight(),this.lastDrawnString=n,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(e,i,n){this.value=i||0,this.total=typeof e<"u"&&e>=0?e:100,this.startValue=i||0,this.payload=n||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new vDe(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",e,i)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,i={}){typeof e=="number"&&(this.value=e,this.eta.update(Date.now(),e,this.total));let n=(typeof e=="object"?e:i)||{};this.emit("update",this.total,this.value);for(let r in n)this.payload[r]=n[r];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}getProgress(){let e=this.value/this.total;return this.options.progressCalculationRelative&&(e=(this.value-this.startValue)/(this.total-this.startValue)),isNaN(e)&&(e=this.options&&this.options.emptyOnZero?0:1),e=Math.min(Math.max(e,0),1),e}increment(e=1,i={}){typeof e=="object"?this.update(this.value+1,e):this.update(this.value+e,i)}getTotal(){return this.total}setTotal(e){typeof e<"u"&&e>=0&&(this.total=e)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}}});var SDe=b((LZt,bDe)=>{f();var out=Q4(),aut=rb();bDe.exports=class extends out{constructor(e,i){super(aut.parse(e,i)),this.timer=null,this.options.noTTYOutput&&this.terminal.isTTY()===!1&&(this.options.synchronousUpdate=!1),this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){this.timer&&(clearTimeout(this.timer),this.timer=null),super.render(),this.options.noTTYOutput&&this.terminal.isTTY()===!1&&this.terminal.newline(),this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(e,i){this.timer&&(super.update(e,i),this.options.synchronousUpdate&&this.lastRedraw+this.options.throttleTime*2<Date.now()&&this.render())}start(e,i,n){this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1||(this.sigintCallback===null&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.terminal.cursorSave(),this.options.hideCursor===!0&&this.terminal.cursor(!1),this.options.linewrap===!1&&this.terminal.lineWrapping(!1),super.start(e,i,n),this.render())}stop(){this.timer&&(this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,this.options.hideCursor===!0&&this.terminal.cursor(!0),this.options.linewrap===!1&&this.terminal.lineWrapping(!0),this.terminal.cursorRestore(),this.options.clearOnComplete?(this.terminal.cursorTo(0,null),this.terminal.clearLine()):this.terminal.newline())}}});var kDe=b((OZt,FDe)=>{f();var Aut=m4(),cut=Q4(),uut=rb(),lut=require("events");FDe.exports=class extends lut{constructor(e,i){super(),this.bars=[],this.options=uut.parse(e,i),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new Aut(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(e,i,n,r={}){let s=new cut(Object.assign({},this.options,{terminal:this.terminal},r));return this.bars.push(s),this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1||(this.sigintCallback===null&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.isActive||(this.options.hideCursor===!0&&this.terminal.cursor(!1),this.options.linewrap===!1&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,s.start(e,i,n),this.emit("start")),s}remove(e){let i=this.bars.indexOf(e);return i<0?!1:(this.bars.splice(i,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0)}update(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0)for(this.terminal.clearLine();this.loggingBuffer.length>0;)this.terminal.write(this.loggingBuffer.shift(),!0);for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render();this.emit("redraw-post"),this.options.noTTYOutput&&this.terminal.isTTY()===!1&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find(e=>e.isActive)&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.isActive=!1,this.options.hideCursor===!0&&this.terminal.cursor(!0),this.options.linewrap===!1&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render(),this.bars[e].stop();this.terminal.newline()}this.emit("stop")}log(e){this.loggingBuffer.push(e)}}});var NDe=b((HZt,RDe)=>{f();RDe.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}});var MDe=b((jZt,TDe)=>{f();TDe.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var _De=b((qZt,PDe)=>{f();PDe.exports={format:" \x1B[90m{bar}\x1B[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var UDe=b((zZt,LDe)=>{f();LDe.exports={format:" {bar}\u25A0 {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u25A0",barIncompleteChar:" "}});var ODe=b((WZt,GDe)=>{f();var put=NDe(),gut=MDe(),dut=_De(),mut=UDe();GDe.exports={legacy:put,shades_classic:gut,shades_grey:dut,rect:mut}});var JDe=b((XZt,HDe)=>{f();var KDe=SDe(),fut=kDe(),hut=ODe(),Cut=B4(),Iut=C4(),Eut=I4(),But=E4();HDe.exports={Bar:KDe,SingleBar:KDe,MultiBar:fut,Presets:hut,Format:{Formatter:Cut,BarFormat:Eut,ValueFormat:Iut,TimeFormat:But}}});var VDe=b((aXt,zDe)=>{f();zDe.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Slt={};rl(Slt,{default:()=>blt});module.exports=Wi(Slt);f();f();try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="f0029b05-b9b9-4448-950a-d9a5aff79538",t._sentryDebugIdIdentifier="sentry-dbid-f0029b05-b9b9-4448-950a-d9a5aff79538")}catch{}f();var Bxe=require("../core/index.cjs"),Qxe=require("../node/index.cjs"),yxe=require("../server/index.cjs"),Dxe=ie(j4(),1);f();f();var vv=require("fs/promises");rB();Qn();wd();ti();var Oi=ie(Ri(),1),zm=require("node:path");co();Cs();ln();on();Ll();var mWe="https://cdn.builder.io",Xge=async(t,e)=>{console.log(""),Kt((0,Oi.bgCyan)((0,Oi.bold)((0,Oi.white)(" figma migrate ")))+" "+(0,Oi.dim)(ut));let{builderPrivateKey:i,builderPublicKey:n}=await Ai(t,e,{forceSpaceId:e.spaceId,builderPrivateKey:!0,builderPublicKey:!0});await ot("figma publish started",{spaceId:n});let r=await Jl(t);if(r.length>0){await ot("figma migrate with existing files",{spaceId:n}),U.warning(`${(0,Oi.yellow)("This repo already has figma mappings in:")}
|
|
2645
2645
|
|
|
2646
2646
|
${r.map(c=>` - ${(0,zm.relative)(t.getAppRootDir(),c)}`).join(`
|
|
2647
2647
|
`)}
|