@builder.io/dev-tools 1.59.2-beta.202605251348.eef0ced → 1.59.2
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 +83 -84
- 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 +38 -39
- package/server/index.mjs +38 -39
- package/types/cli/index.d.ts +0 -2
- package/types/cli/launch.d.ts +0 -3
- package/types/tsconfig.tsbuildinfo +1 -1
package/cli/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var xxe=Object.create;var ey=Object.defineProperty;var Fxe=Object.getOwnPropertyDescriptor;var kxe=Object.getOwnPropertyNames;var Rxe=Object.getPrototypeOf,Txe=Object.prototype.hasOwnProperty;var L=(t,e)=>()=>(t&&(e=t(t=0)),e);var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ty=(t,e)=>{for(var r in e)ey(t,r,{get:e[r],enumerable:!0})},WJ=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of kxe(e))!Txe.call(t,i)&&i!==r&&ey(t,i,{get:()=>e[i],enumerable:!(n=Fxe(e,i))||n.enumerable});return t};var X=(t,e,r)=>(r=t!=null?xxe(Rxe(t)):{},WJ(e||!t||!t.__esModule?ey(r,"default",{value:t,enumerable:!0}):r,t)),Vr=t=>WJ(ey({},"__esModule",{value:!0}),t);var h=L(()=>{(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"
|
|
1
|
+
var xxe=Object.create;var ey=Object.defineProperty;var Fxe=Object.getOwnPropertyDescriptor;var kxe=Object.getOwnPropertyNames;var Rxe=Object.getPrototypeOf,Txe=Object.prototype.hasOwnProperty;var L=(t,e)=>()=>(t&&(e=t(t=0)),e);var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ty=(t,e)=>{for(var r in e)ey(t,r,{get:e[r],enumerable:!0})},WJ=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of kxe(e))!Txe.call(t,i)&&i!==r&&ey(t,i,{get:()=>e[i],enumerable:!(n=Fxe(e,i))||n.enumerable});return t};var X=(t,e,r)=>(r=t!=null?xxe(Rxe(t)):{},WJ(e||!t||!t.__esModule?ey(r,"default",{value:t,enumerable:!0}):r,t)),Vr=t=>WJ(ey({},"__esModule",{value:!0}),t);var h=L(()=>{(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"5f0d8988e3b78c8d3f6bc4a679f1d6b41191da2c"}}catch{}})()});function Xc(t){let e=t[t.length-1];return e&&typeof e=="object"&&!(e instanceof Error)&&!Array.isArray(e)&&"loggerOptions"in e?{callArgs:t.slice(0,-1),options:e.loggerOptions}:{callArgs:t,options:{}}}function Nxe(t,e){return`[${t.toUpperCase()}]`+e.map(r=>{if(r instanceof Error)return r.stack??r.message;if(typeof r=="object"&&r!==null)try{return JSON.stringify(r)}catch{return String(r)}return String(r)}).join(" ")}function XJ(){let t=process.env.FUSION_ENVIRONMENT;return t==="cloud"||t==="cloud-v2"}function ry(t,e,r,n){let i={severity:e,message:Nxe(r,n),timestamp:new Date().toISOString()};r&&(i.context=r),t.write(JSON.stringify(i)+`
|
|
2
2
|
`)}function Mxe(t,e,r){return{debug(...n){if(!e())return;let{callArgs:i,options:s}=Xc(n);ry(s.stderr?process.stderr:process.stdout,"DEBUG",r,i)},info(...n){if(t>Zc.info)return;let{callArgs:i,options:s}=Xc(n);s.debug&&!e()||ry(s.stderr?process.stderr:process.stdout,"INFO",r,i)},warn(...n){if(t>Zc.warn)return;let{callArgs:i,options:s}=Xc(n);s.debug&&!e()||ry(process.stderr,"WARNING",r,i)},error(...n){if(t>Zc.error)return;let{callArgs:i,options:s}=Xc(n);s.debug&&!e()||ry(process.stderr,"ERROR",r,i)}}}function Pp(t){return t?`[${t}]`:""}function Pxe(t,e,r){return{debug(...n){if(!e())return;let{callArgs:i,options:s}=Xc(n);s.stderr?console.error(Pp(r),...i):console.debug(Pp(r),...i)},info(...n){if(Zc.info<t)return;let{callArgs:i,options:s}=Xc(n);s.debug&&!e()||(s.stderr?console.error(Pp(r),...i):console.log(Pp(r),...i))},warn(...n){if(Zc.warn<t)return;let{callArgs:i,options:s}=Xc(n);s.debug&&!e()||console.warn(Pp(r),...i)},error(...n){if(Zc.error<t)return;let{callArgs:i,options:s}=Xc(n);s.debug&&!e()||console.error(Pp(r),...i)}}}function ej(t){ZJ=t}function ve(t,e){let r=typeof e?.debug=="function"?e.debug:e?.debug!==void 0?()=>e.debug:()=>ZJ||!!process.env.DEBUG,n=e?.level??process.env.LOG_LEVEL?.toLowerCase();return XJ()?Mxe(zJ(n??"info"),r,t):Pxe(zJ(n??"info"),r,t)}function zJ(t){return Zc[t]??Zc.info}function tj(){if(!XJ())return;let t=process.stderr.write.bind(process.stderr);process.stderr.write=function(e,r,n){let i=typeof r=="function"?r:n,s=typeof r=="string"?r:void 0,o=typeof e=="string"?e:Buffer.from(e).toString("utf8"),a=o.trim();if(a.startsWith("{"))try{if(typeof JSON.parse(a).severity=="string")return s?t(e,s,i):t(e,i)}catch{}let A={severity:"ERROR",message:a||o,timestamp:new Date().toISOString(),stream:"stderr"},c=JSON.stringify(A)+`
|
|
3
3
|
`;return i?t(c,i):t(c)}}function rj(t="process",e=r=>process.exit(r)){let r=ve(t),n=i=>Promise.resolve(e(i)).catch(()=>{}).finally(()=>process.exit(i));process.on("uncaughtException",i=>{r.error("Uncaught exception:",i),n(1)}),process.on("unhandledRejection",i=>{r.error("Unhandled rejection:",i instanceof Error?i:String(i)),n(1)})}var Zc,ZJ,Qt=L(()=>{"use strict";h();Zc={debug:0,info:1,warn:2,error:3};ZJ=!1});var ij=N((fDt,nj)=>{h();function HF(t){return t==null?[]:Array.isArray(t)?t:[t]}function Lxe(t,e,r,n){var i,s=t[e],o=~n.string.indexOf(e)?r==null||r===!0?"":String(r):typeof r=="boolean"?r:~n.boolean.indexOf(e)?r==="false"?!1:r==="true"||(t._.push((i=+r,i*0===0?i:r)),!!r):(i=+r,i*0===0?i:r);t[e]=s==null?o:Array.isArray(s)?s.concat(o):[s,o]}nj.exports=function(t,e){t=t||[],e=e||{};var r,n,i,s,o,a={_:[]},A=0,c=0,u=0,l=t.length;let d=e.alias!==void 0,g=e.unknown!==void 0,p=e.default!==void 0;if(e.alias=e.alias||{},e.string=HF(e.string),e.boolean=HF(e.boolean),d)for(r in e.alias)for(n=e.alias[r]=HF(e.alias[r]),A=0;A<n.length;A++)(e.alias[n[A]]=n.concat(r)).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(p){for(r in e.default)if(s=typeof e.default[r],n=e.alias[r]=e.alias[r]||[],e[s]!==void 0)for(e[s].push(r),A=0;A<n.length;A++)e[s].push(n[A])}let f=g?Object.keys(e.alias):[];for(A=0;A<l;A++){if(i=t[A],i==="--"){a._=a._.concat(t.slice(++A));break}for(c=0;c<i.length&&i.charCodeAt(c)===45;c++);if(c===0)a._.push(i);else if(i.substring(c,c+3)==="no-"){if(s=i.substring(c+3),g&&!~f.indexOf(s))return e.unknown(i);a[s]=!1}else{for(u=c+1;u<i.length&&i.charCodeAt(u)!==61;u++);for(s=i.substring(c,u),o=i.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],g&&!~f.indexOf(s))return e.unknown("-".repeat(c)+s);Lxe(a,s,u+1<n.length||o,e)}}}if(p)for(r in e.default)a[r]===void 0&&(a[r]=e.default[r]);if(d)for(r in a)for(n=e.alias[r]||[];n.length>0;)a[n.shift()]=a[r];return a}});function _xe(){if(fm!==void 0)return fm;try{return fm=require("prettier"),fm}catch{return fm=null,null}}function Uxe(t){let e=[],r=Pl.default.dirname(t);for(;r!==Pl.default.dirname(r);){let n=Pl.default.join(r,".prettierignore");JF.default.existsSync(n)&&e.push(n);let i=Pl.default.join(r,".git");if(JF.default.existsSync(i))break;r=Pl.default.dirname(r)}return e}function Gxe(t){if(t)try{let r=(0,sj.createRequire)(t)("prettier");if(r)return r}catch{}return _xe()}async function OA(t,e,r,n){try{let i=Pl.default.resolve(t,n??"file.tsx"),s=Gxe(i);if(!s)return e;if(n){let A=Uxe(i);if((await s.getFileInfo(i,{ignorePath:A.length>0?A:void 0})).ignored)return e}let o=await s.resolveConfig(i);return await s.format(e,{...o,filepath:n,parser:r})}catch{return e}}var sj,Pl,JF,fm,jF=L(()=>{"use strict";h();sj=require("node:module"),Pl=X(require("node:path"),1),JF=X(require("node:fs"),1)});var YF,Lp,ny,iy,oj,Ll,qF,$F,_l,aj,_p=L(()=>{"use strict";h();YF="preview-url",Lp="framework",ny="platform",iy="node",oj="/~builder-connect",Ll="/~builder-connected",qF="/~builder-dev-tools",$F="/~builder-dev-tools.js",_l="/~builder-dev-tools-close",aj="/mappings"});var sy=N((BDt,Aj)=>{"use strict";h();var VF={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},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"},Oxe={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Kxe={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 r=0;r<t;r++)e+=this.line+(r<t-1?VF.up():"");return t&&(e+=VF.left),e}};Aj.exports={cursor:VF,scroll:Oxe,erase:Kxe,beep:"\x07"}});var Ir=N((QDt,WF)=>{h();var ay=process||{},cj=ay.argv||[],oy=ay.env||{},Hxe=!(oy.NO_COLOR||cj.includes("--no-color"))&&(!!oy.FORCE_COLOR||cj.includes("--color")||ay.platform==="win32"||(ay.stdout||{}).isTTY&&oy.TERM!=="dumb"||!!oy.CI),Jxe=(t,e,r=t)=>n=>{let i=""+n,s=i.indexOf(e,t.length);return~s?t+jxe(i,e,r,s)+e:t+i+e},jxe=(t,e,r,n)=>{let i="",s=0;do i+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return i+t.substring(s)},uj=(t=Hxe)=>{let e=t?Jxe:()=>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")}};WF.exports=uj();WF.exports.createColors=uj});function Yxe({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 Bj(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(qxe,"")}function yj(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function hm(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Bj(t),t.length===0))return 0;t=t.replace(zxe()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let s=i.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(Vxe.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}function eFe(){let t=new Map;for(let[e,r]of Object.entries(Nr)){for(let[n,i]of Object.entries(r))Nr[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Nr[n],t.set(i[0],i[1]);Object.defineProperty(Nr,e,{value:r,enumerable:!1})}return Object.defineProperty(Nr,"codes",{value:t,enumerable:!1}),Nr.color.close="\x1B[39m",Nr.bgColor.close="\x1B[49m",Nr.color.ansi=lj(),Nr.color.ansi256=gj(),Nr.color.ansi16m=pj(),Nr.bgColor.ansi=lj(zF),Nr.bgColor.ansi256=gj(zF),Nr.bgColor.ansi16m=pj(zF),Object.defineProperties(Nr,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Nr.rgbToAnsi256(...Nr.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Nr.ansi256ToAnsi(Nr.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Nr.ansi256ToAnsi(Nr.hexToAnsi256(e)),enumerable:!1}}),Nr}function hj(t,e,r){return String(t).normalize().replace(/\r\n/g,`
|
|
4
4
|
`).split(`
|
|
@@ -74,8 +74,8 @@ ${Fj}${n.trimStart()}`),r=3+(0,Ul.stripVTControlCharacters)(n.trimStart()).lengt
|
|
|
74
74
|
`):process.stdout.write(`${Q} ${a}
|
|
75
75
|
`),p(),i()};return{start:I,stop:B,message:(E="")=>{a=m(E??a)}}}});function jt(t,e=""){return t.ts.createSourceFile("module.tsx",typeof e=="string"?e:"",t.ts.ScriptTarget.Latest,void 0)}function hy(t,e=""){let r=jt(t,e?.trim());if(r.statements.length===0)throw new Error(`No statements found in code: ${e}`);return r.statements[0]}function Ln(t,e,r){if(e){let n=t.ts.createPrinter({newLine:t.ts.NewLineKind.LineFeed,removeComments:r});return t.ts.isSourceFile(e)?n.printFile(e).trim()+`
|
|
76
76
|
`:n.printNode(t.ts.EmitHint.Unspecified,e,t.ts.createSourceFile("module.tsx","",t.ts.ScriptTarget.Latest)).trim()+`
|
|
77
|
-
`}return""}var Jr=L(()=>{"use strict";h()});var _j=N((UDt,Lj)=>{"use strict";h();Lj.exports=function(){if(process.env.npm_config_user_agent)return wFe(process.env.npm_config_user_agent)};function wFe(t){let e=t.split(" ")[0],r=e.lastIndexOf("/"),n=e.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:e.substring(r+1)}}});function js(t){return t.endsWith(".mapper.tsx")||t.endsWith(".mapper.jsx")||t.endsWith(".mapper.ts")||t.endsWith(".mapper.js")||t.endsWith(".mapper.mjs")}function Yt(t,e,r){e=Oo(e),r=Oo(r),e=t.dirname(e);let n=t.basename(r,t.extname(r));r=t.dirname(r);let i;return n==="index"?i=t.relative(e,r):i=t.relative(e,t.join(r,n)),i=Oo(t.normalize(i)),i.startsWith(".")||(i="./"+i),i}function Oo(t){return t.startsWith("\\\\?\\")?t:t.replace(/\\/g,"/")}function Ol(t,e){let r=t.extname(e),n=t.basename(e,r).split(/[\/\\]/),i=n[n.length-1];return Uj(i==="index"?t.basename(t.dirname(e)):i)}function Uj(t){return Er(t).replace(/ /g,"")}function Ys(t,e){let r=t.extname(e),n=Oo(t.basename(e,r)).split("/").pop();return Er(n==="index"?t.basename(t.dirname(e)):n)}function Br(t,e){let r=Oo(t.relative(t.getAppRootDir(),e));r=r.split("/").filter(i=>i!=="."&&i!==".."&&i!=="").join("/"),r.endsWith(".tsx")||r.endsWith(".jsx")?r=r.slice(0,-4):(r.endsWith(".ts")||r.endsWith(".js"))&&(r=r.slice(0,-3));let n=t.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(i=>i.name.includes("next"))?"@/"+r:"~/"+r}function ir(t,e){let r=e,n=[];for(let i=0;i<2;i++){let s=t.basename(r);if(!s||s==="components")break;n.unshift(s),r=t.dirname(r)}return n.join("/")}function Er(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 ts(t){return t.sort((e,r)=>e.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function hr(t,e,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${e}`);return n&&(e=n),e=t.normalize(e),(await t.hash(e+"#"+r)).substring(0,8)}async function Oj(t){return(await t.hash(t.getAppRootDir())).substring(0,8)}function Cm(t){return typeof t=="number"}function Kp(t){return typeof t=="boolean"}function Pi(t){return typeof t=="string"}function Hp(t){return typeof t=="string"?/^[A-Z][A-Za-z0-9]*$/.test(t):!1}function bs(t){return JSON.parse(JSON.stringify(t))}function my(t,e,r){for(let n of e)if(t.dirname(r).includes(n))return!0;return!1}function Kj(){try{let t=(0,Gj.default)();if(t?.name)return t.name}catch{}return"npm"}function bFe(){return process.platform.startsWith("win")}function
|
|
78
|
-
`,getSourceFile:a=>{if(a=t.normalize(a),a.includes("node_modules")){let c=Em.get(a);if(c)return jt(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(i)&&u===".ts"&&(A=jj.get(c),A==null&&typeof self<"u"&&typeof fetch=="function"))throw new Iy(c)}return a.includes("node_modules")&&(A?Em.set(a,{exists:!0,content:A}):Em.set(a,{exists:!1})),jt(t,A)},readFile:a=>{let A=t.readFileSync(a);return typeof A=="string"?A:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return vFe(t,o,e,r)}catch(a){if(a instanceof Iy){await xFe(t,a.libName);continue}throw t.Sentry?.captureException(a),new Error(`createTsProgram() Could not create program for: ${e[0]}`,{cause:a})}}function vFe(t,e,r,n){let i={rootNames:[...r],host:e,options:{}},s=t.ts.findConfigFile(t.dirname(r[0]),o=>t.existsSync(o));if(s){let o=Jj.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,Jj.set(s,o))}o&&(i.options=bs(o))}return i.options.noEmit=!0,i.options.isolatedModules=!1,i.options.strict=!1,i.options.jsx=t.ts.JsxEmit.Preserve,i.options.allowJs=!0,Object.assign(i.options,n),t.ts.createProgram(i)}async function Jp(t,e,r){r||(r=await Dn(t,[e]));let n=r.getSourceFile(e);if(!n)throw new Error(`getTypeChecker() Could not find source file: ${e}`);return{typeChecker:r.getTypeChecker(),sourceFile:n}}async function xFe(t,e){let r=`https://cdn.jsdelivr.net/npm/typescript@${t.ts.version}/lib/${e}`;Cy.has(e)||Cy.set(e,fetch(r).then(n=>n.text()).then(n=>{jj.set(e,n)})),await Cy.get(e),Cy.delete(e)}async function Yj(t,e){let r=await t.readFile(e.filePath);return r==null?{diagnostics:[{messageText:`Error reading: ${e.filePath}`}],code:null,output:null}:uk(t,{code:r,filePath:e.filePath,compilerOptions:e.compilerOptions})}function uk(t,e){let r={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(i=>{r.diagnostics.push({messageText:String(i.messageText)})}),r.output=n.outputText}catch(n){console.error("transpileModule",n),r.diagnostics.push({messageText:String(n)})}return r}var Iy,jj,Cy,Em,Jj,qs=L(()=>{"use strict";h();Jr();St();Bi();Iy=class{libName;constructor(e){this.libName=e}};jj=new Map,Cy=new Map,Em=new Map,Jj=new Map});var FFe,dt,Wr=L(()=>{"use strict";h();FFe="1.59.2
|
|
77
|
+
`}return""}var Jr=L(()=>{"use strict";h()});var _j=N((UDt,Lj)=>{"use strict";h();Lj.exports=function(){if(process.env.npm_config_user_agent)return wFe(process.env.npm_config_user_agent)};function wFe(t){let e=t.split(" ")[0],r=e.lastIndexOf("/"),n=e.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:e.substring(r+1)}}});function js(t){return t.endsWith(".mapper.tsx")||t.endsWith(".mapper.jsx")||t.endsWith(".mapper.ts")||t.endsWith(".mapper.js")||t.endsWith(".mapper.mjs")}function Yt(t,e,r){e=Oo(e),r=Oo(r),e=t.dirname(e);let n=t.basename(r,t.extname(r));r=t.dirname(r);let i;return n==="index"?i=t.relative(e,r):i=t.relative(e,t.join(r,n)),i=Oo(t.normalize(i)),i.startsWith(".")||(i="./"+i),i}function Oo(t){return t.startsWith("\\\\?\\")?t:t.replace(/\\/g,"/")}function Ol(t,e){let r=t.extname(e),n=t.basename(e,r).split(/[\/\\]/),i=n[n.length-1];return Uj(i==="index"?t.basename(t.dirname(e)):i)}function Uj(t){return Er(t).replace(/ /g,"")}function Ys(t,e){let r=t.extname(e),n=Oo(t.basename(e,r)).split("/").pop();return Er(n==="index"?t.basename(t.dirname(e)):n)}function Br(t,e){let r=Oo(t.relative(t.getAppRootDir(),e));r=r.split("/").filter(i=>i!=="."&&i!==".."&&i!=="").join("/"),r.endsWith(".tsx")||r.endsWith(".jsx")?r=r.slice(0,-4):(r.endsWith(".ts")||r.endsWith(".js"))&&(r=r.slice(0,-3));let n=t.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(i=>i.name.includes("next"))?"@/"+r:"~/"+r}function ir(t,e){let r=e,n=[];for(let i=0;i<2;i++){let s=t.basename(r);if(!s||s==="components")break;n.unshift(s),r=t.dirname(r)}return n.join("/")}function Er(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 ts(t){return t.sort((e,r)=>e.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function hr(t,e,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${e}`);return n&&(e=n),e=t.normalize(e),(await t.hash(e+"#"+r)).substring(0,8)}async function Oj(t){return(await t.hash(t.getAppRootDir())).substring(0,8)}function Cm(t){return typeof t=="number"}function Kp(t){return typeof t=="boolean"}function Pi(t){return typeof t=="string"}function Hp(t){return typeof t=="string"?/^[A-Z][A-Za-z0-9]*$/.test(t):!1}function bs(t){return JSON.parse(JSON.stringify(t))}function my(t,e,r){for(let n of e)if(t.dirname(r).includes(n))return!0;return!1}function Kj(){try{let t=(0,Gj.default)();if(t?.name)return t.name}catch{}return"npm"}function bFe(){return process.platform.startsWith("win")}function st(){return process.pkg?"@builder.io/agent":bFe()?'"@builder.io/dev-tools"':"builder.io"}function ck(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_")}var Gj,St=L(()=>{"use strict";h();Gj=X(_j(),1)});function Li(t){let e=t.join(t.getAppRootDir(),"tsconfig.json");return t.exists(e)}async function rs(t,e){async function r(i,s){if(s>10)return;let o=await t.readdir(i);for(let a of o){if(SFe.includes(a))continue;let A=t.join(i,a),c=await t.stat(A);if(c){if(c.isFile()&&a.startsWith("builder-registry."))return A;if(c.isDirectory()){let u=await r(A,s+1);if(u)return u}}}}let n=await r(t.getAppRootDir(),0);if(!n){let s=`builder-registry.${await Li(t)?"ts":"js"}`;return t.join(e,s)}return n}async function Ko(t,e){let r=t.resolve("/");for(let n=0;n<20;n++){let i=t.join(e,"package.json"),s=await t.readFile(i);if(s)return JSON.parse(s);if(e===r)break;e=t.dirname(e)}return null}async function Hj(t,e){for(let r=0;r<20;r++){let n=t.dirname(e),i=t.join(n,"node_modules");if(await t.exists(i))return i;if(e===t.getAppRootDir())break;e=t.dirname(e)}return t.join(t.getAppRootDir(),"node_modules")}async function Im(t,e,r){let n=await t.readdir(e);return n.includes(r)?t.join(e,r):(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 Im(t,o,r);if(A)return A}}))).find(s=>typeof s=="string")}var SFe,Bi=L(()=>{"use strict";h();SFe=["node_modules","dist","build","public"]});async function Dn(t,e,r){if(!Array.isArray(e)||e.length===0)throw new Error(`createTsProgram() Invalid filePaths: ${e}`);let n=await Hj(t,e[0]),i=t.join(n,"typescript","lib"),s=new Map,o={fileExists:a=>{if(a=t.normalize(a),a.includes("node_modules")){let A=Em.get(a);if(!A){try{t.statSync(a).isFile()?A={exists:!0,content:t.readFileSync(a)}:A={exists:!1}}catch{A={exists:!1}}Em.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(i,"lib.d.ts"),getDefaultLibLocation:()=>i,getNewLine:()=>`
|
|
78
|
+
`,getSourceFile:a=>{if(a=t.normalize(a),a.includes("node_modules")){let c=Em.get(a);if(c)return jt(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(i)&&u===".ts"&&(A=jj.get(c),A==null&&typeof self<"u"&&typeof fetch=="function"))throw new Iy(c)}return a.includes("node_modules")&&(A?Em.set(a,{exists:!0,content:A}):Em.set(a,{exists:!1})),jt(t,A)},readFile:a=>{let A=t.readFileSync(a);return typeof A=="string"?A:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return vFe(t,o,e,r)}catch(a){if(a instanceof Iy){await xFe(t,a.libName);continue}throw t.Sentry?.captureException(a),new Error(`createTsProgram() Could not create program for: ${e[0]}`,{cause:a})}}function vFe(t,e,r,n){let i={rootNames:[...r],host:e,options:{}},s=t.ts.findConfigFile(t.dirname(r[0]),o=>t.existsSync(o));if(s){let o=Jj.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,Jj.set(s,o))}o&&(i.options=bs(o))}return i.options.noEmit=!0,i.options.isolatedModules=!1,i.options.strict=!1,i.options.jsx=t.ts.JsxEmit.Preserve,i.options.allowJs=!0,Object.assign(i.options,n),t.ts.createProgram(i)}async function Jp(t,e,r){r||(r=await Dn(t,[e]));let n=r.getSourceFile(e);if(!n)throw new Error(`getTypeChecker() Could not find source file: ${e}`);return{typeChecker:r.getTypeChecker(),sourceFile:n}}async function xFe(t,e){let r=`https://cdn.jsdelivr.net/npm/typescript@${t.ts.version}/lib/${e}`;Cy.has(e)||Cy.set(e,fetch(r).then(n=>n.text()).then(n=>{jj.set(e,n)})),await Cy.get(e),Cy.delete(e)}async function Yj(t,e){let r=await t.readFile(e.filePath);return r==null?{diagnostics:[{messageText:`Error reading: ${e.filePath}`}],code:null,output:null}:uk(t,{code:r,filePath:e.filePath,compilerOptions:e.compilerOptions})}function uk(t,e){let r={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(i=>{r.diagnostics.push({messageText:String(i.messageText)})}),r.output=n.outputText}catch(n){console.error("transpileModule",n),r.diagnostics.push({messageText:String(n)})}return r}var Iy,jj,Cy,Em,Jj,qs=L(()=>{"use strict";h();Jr();St();Bi();Iy=class{libName;constructor(e){this.libName=e}};jj=new Map,Cy=new Map,Em=new Map,Jj=new Map});var FFe,dt,Wr=L(()=>{"use strict";h();FFe="1.59.2",dt=process.env.OVERRIDE_VERSION??FFe});async function Kl(t){let e=[],r=await Ko(t,t.getRepoRootDir());if(r){let n=await $j(r,t);e.push(...n)}return e}async function $j(t,e){let r=[];if(t&&typeof t=="object"){let n=new Set(Object.keys({...t.dependencies,...t.devDependencies}));for(let i of kFe)if(n.has(i)&&!r.some(s=>s.name===i)){let s={name:i};qj.has(i)&&(s.version=await qj.get(i)(e)),r.push(s)}}return r}function lk(t){let e=parseInt(t);return Number.isNaN(e)?void 0:e}var qj,kFe,Hl=L(()=>{"use strict";h();Bi();St();qj=new Map([["next",async t=>{if(!t.spawnSync)return;let e=Kj(),r=e==="npm"?"npx":e,{stdout:n}=t.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let i=n.match(/(Next.js v)([\d.]+)/g);if(!i)return;let s=i[0].split("Next.js v")[1],[o,a,A]=s.split(".");return{major:lk(o),minor:lk(a),patch:lk(A)}}]]),kFe=["@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 $s(t){let e=Vj(t),r=await t.readFile(e);return typeof r=="string"?JSON.parse(r):{}}async function Vs(t,e){e=typeof e=="object"&&e!=null?e:{};let r=Vj(t);await t.writeFile(r,JSON.stringify(e??{},null,2))}function Vj(t){let e=t.getAppRootDir();return t.join(e,"node_modules",".builder","builder-cache.json")}var Jl=L(()=>{"use strict";h()});async function Ra(t,e,r){let n={envKey:r,envValue:null,file:""};for(let i of e){let s=t.join(t.getAppRootDir(),i),o=await RFe(t,s);if(o){let a=o[r];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 RFe(t,e){let r=await t.readFile(e);return typeof r=="string"?Wj(r):null}function Wj(t){let e={},r=t.replace(/\r\n?/gm,`
|
|
79
79
|
`),n;for(;(n=TFe.exec(r))!=null;){let i=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,`
|
|
80
80
|
`),s=s.replace(/\\r/g,"\r")),e[i]=s}return e}async function Ta(t,e,r,n){let i="# https://www.builder.io/c/docs/using-your-api-key",s=await t.readFile(e);try{if(s)if(s.includes(r))if(s.includes(n))t.debug(`"${r}" with "${n}" already set in ${e}`);else return t.debug(`Replace "${r}" in ${e}`),s=s.replace(new RegExp(`${r}=.*`),`${r}=${n}`),await t.writeFile(e,s),"update";else return t.debug(`Append "${r}" to ${e}`),s+=`
|
|
81
81
|
|
|
@@ -83,7 +83,7 @@ ${i}
|
|
|
83
83
|
${r}=${n}
|
|
84
84
|
|
|
85
85
|
`,await t.writeFile(e,s),"update";else return t.debug(`Creating new .env file with "${r}" at ${e}`),s=[i,`${r}=${n}`,""].join(`
|
|
86
|
-
`),await t.writeFile(e,s),"create"}catch(o){if(o&&String(o).includes("EACCES"))return t.debug(`Permssion denied, failed to create or modify .env file with "${r}=${n}" at ${e}`),"permission-error";t.Sentry?.captureException(o)}return null}var TFe,jl=L(()=>{"use strict";h();TFe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm});async function Bm(t){return await Ra(t,[".env.local",".env.development.local",".env.production.local",".env.development",".env.production",".env"],Na)}async function zj(t,e){let r=await Bm(t),n=await Ta(t,r.file,r.envKey,e);return{...r,modifiedType:n}}var Na,ym=L(()=>{"use strict";h();jl();Na="NEXT_PUBLIC_BUILDER_API_KEY"});var it,Qm,_n=L(()=>{"use strict";h();it={gen1:"Gen 1",gen2:"Gen 2"},Qm={CMS:"cms",VCP:"vcp",HYBRID:"hybrid"}});function jp(t,e,r,n,i=!0){let s=e.properties.filter(a=>t.ts.isPropertyAssignment(a)),o=NFe(t,e,r);return o>-1?n==null&&i?t.ts.factory.updateObjectLiteralExpression(e,s.filter((a,A)=>A!==o)):(s[o]=t.ts.factory.updatePropertyAssignment(s[o],s[o].name,Dm(t,n)),t.ts.factory.updateObjectLiteralExpression(e,s)):(n!=null&&s.push(t.ts.factory.createPropertyAssignment(r,Dm(t,n))),t.ts.factory.updateObjectLiteralExpression(e,s))}function NFe(t,e,r){return e.properties.findIndex(n=>cr(t,n)===r)}function wm(t,e){switch(e.kind){case t.ts.SyntaxKind.ArrayLiteralExpression:return PFe(t,e);case t.ts.SyntaxKind.ObjectLiteralExpression:return MFe(t,e);case t.ts.SyntaxKind.StringLiteral:return e.text;case t.ts.SyntaxKind.NumericLiteral:return Number(e.text);case t.ts.SyntaxKind.NoSubstitutionTemplateLiteral:return e.text;case t.ts.SyntaxKind.TrueKeyword:return!0;case t.ts.SyntaxKind.FalseKeyword:return!1;case t.ts.SyntaxKind.Identifier:switch(e.escapedText){case"undefined":return;case"null":return null;case"String":return String;case"Number":return Number;case"Boolean":return Boolean;case"NaN":return NaN}}}function MFe(t,e){let r={};if(e&&t.ts.isObjectLiteralExpression(e)){for(let n of e.properties)if(t.ts.isPropertyAssignment(n)){let i=cr(t,n);i&&(r[i]=wm(t,n.initializer))}}return r}function PFe(t,e){return e&&t.ts.isArrayLiteralExpression(e)?e.elements.map(r=>wm(t,r)):[]}function cr(t,e){if(e&&t.ts.isPropertyAssignment(e)){let r=e.name;switch(r.kind){case t.ts.SyntaxKind.Identifier:return r.text;case t.ts.SyntaxKind.StringLiteral:case t.ts.SyntaxKind.NumericLiteral:return r.text;case t.ts.SyntaxKind.ComputedPropertyName:let n=r.expression;if(t.ts.isStringLiteral(n)||t.ts.isNumericLiteral(n))return r.expression.text}}}function Dm(t,e){return gk(t,e,new WeakSet)}function gk(t,e,r){return e===void 0?t.ts.factory.createIdentifier("undefined"):e===null?t.ts.factory.createIdentifier("null"):typeof e=="string"?t.ts.factory.createStringLiteral(e):typeof e=="number"?isNaN(e)?t.ts.factory.createIdentifier("NaN"):t.ts.factory.createNumericLiteral(e):e===!0?t.ts.factory.createTrue():e===!1?t.ts.factory.createFalse():e===String?t.ts.factory.createIdentifier("String"):e===Number?t.ts.factory.createIdentifier("Number"):e===Boolean?t.ts.factory.createIdentifier("Boolean"):Array.isArray(e)?LFe(t,e,r):typeof e=="object"?_Fe(t,e,r):t.ts.factory.createIdentifier(e)}function LFe(t,e,r){let n=e.map(i=>gk(t,i,r));return t.ts.factory.createArrayLiteralExpression(n,!0)}function _Fe(t,e,r){if(r.has(e))return t.ts.factory.createIdentifier("undefined");r.add(e);let n=Object.keys(e).map(i=>t.ts.factory.createPropertyAssignment(i,gk(t,e[i],r)));return t.ts.factory.createObjectLiteralExpression(n,!0)}var Ma=L(()=>{"use strict";h()});function Yl(t,e,r){let n=[];if(!r)return n;let i=null;if(t.ts.isArrowFunction(r)||t.ts.isFunctionExpression(r)||t.ts.isFunctionDeclaration(r)){let s=r.parameters;if(s.length>0){let o=s[0],a=e.getTypeAtLocation(o);a.aliasTypeArguments&&a.aliasTypeArguments.length>0&&(a=a.aliasTypeArguments[0]),a.flags&t.ts.TypeFlags.Object&&(i=a.getProperties())}}else if(t.ts.isIdentifier(r)){let s=e.getTypeAtLocation(r),o=s.symbol?.valueDeclaration;if(o&&t.ts.isClassDeclaration(o)){let A=o.heritageClauses?.find(c=>c.token===t.ts.SyntaxKind.ExtendsKeyword)?.types;if(A){for(let c of A)if(e.getSymbolAtLocation(c.expression)?.name==="Component"){if(t.ts.isExpressionWithTypeArguments(c)){let l=c.typeArguments;if(l){let d=l[0];i=e.getTypeFromTypeNode(d).getProperties()}}break}}}if(!i){let a=s.getCallSignatures();if(a.length>0){let A=a[0].getParameters();A.length>0&&(i=e.getTypeOfSymbolAtLocation(A[0],r).getProperties())}}}else if(t.ts.isExportSpecifier(r)){let s=e.getSymbolAtLocation(r.name);if(s){let a=e.getTypeOfSymbolAtLocation(s,r).getCallSignatures();if(a.length>0){let A=a[0].getParameters();A.length>0&&(i=e.getTypeOfSymbolAtLocation(A[0],r).getProperties())}}}if(i)for(let s of i){let o=UFe(t,e,s);o&&n.push(o)}return n=n.filter(Zj),n.length>0?n:GFe(t,r)}function UFe(t,e,r){let n=r.valueDeclaration,i=r.getName();if(n||(n=r.getDeclarations()?.[0]),n&&t.ts.isPropertySignature(n)){if(i!=="children"&&n.getSourceFile().fileName.includes("node_modules/@types/"))return null;let s="string",o;if(n?.type){let A=e.getTypeFromTypeNode(n.type),c=e.typeToString(A),u=pk(c);u.knownType?s=u.builderType:KFe(c)||A.flags&t.ts.TypeFlags.StringLike?s="string":A.flags&t.ts.TypeFlags.NumberLike?s="number":A.flags&t.ts.TypeFlags.IndexedAccess?s="list":A.flags&t.ts.TypeFlags.Object||A.isUnion()&&A.types.every(l=>l.flags&t.ts.TypeFlags.Object)||A.isIntersection()&&A.types.some(l=>l.flags&t.ts.TypeFlags.Object)?s="object":s="string",c!==s&&(o=c)}let a={name:i,type:s,isRegistered:!1};if(o&&n.type){let A=YFe(t,e,e.getTypeFromTypeNode(n.type));a.meta=a.meta||{},A&&A.length>0&&a.type==="string"&&A.every(JFe)?a.enum=A.map(jFe):a.meta.ts=o}return n.questionToken||(a.required=!0),a}return null}function GFe(t,e){let r=[],n=t.ts.getJSDocCommentsAndTags(e);for(let i of n)if(!(!t.ts.isJSDoc(i)||!i.tags))for(let s of i.tags){if(!t.ts.isJSDocParameterTag(s)||s.tagName.text!=="param")continue;let a=s.typeExpression?.type;if(!a||!t.ts.isJSDocTypeLiteral(a))continue;let A=a.jsDocPropertyTags;if(A)for(let c of A){if(!t.ts.isJSDocPropertyLikeTag(c))continue;let u=c.name;if(!t.ts.isQualifiedName(u))continue;let l=c.typeExpression;if(!l)continue;let d="";switch(l.type.kind){case t.ts.SyntaxKind.StringKeyword:{d="string";break}case t.ts.SyntaxKind.NumberKeyword:{d="number";break}case t.ts.SyntaxKind.BooleanKeyword:{d="boolean";break}default:continue}let p={name:u.right.text,type:d,isRegistered:!1};r.push(p)}}return r.filter(Zj)}function KFe(t){return typeof t!="string"?!1:!!OFe.some(e=>t.includes(e))}function pk(t){return typeof t=="string"&&(t=t.trim(),HFe.some(e=>e.value===t))?{builderType:t,knownType:!0}:{builderType:"string",knownType:!1}}function JFe(t){return/^['"].*['"]$/.test(t)}function jFe(t){return(t.startsWith('"')||t.startsWith("'"))&&(t.endsWith('"')||t.endsWith("'"))?t.slice(1,-1):t}function Zj(t){let e=t?.name;if(typeof e!="string"||e===""||e.startsWith("aria")||e.startsWith("data-"))return!1;if(e.startsWith("on")&&e.length>2){let r=e.charAt(2);if(r.toUpperCase()===r)return!1}return!$Fe.has(e.toLowerCase())}var OFe,HFe,YFe,qFe,Xj,$Fe,bm=L(()=>{"use strict";h();OFe=["ClassicComponent","FunctionComponent","IntrinsicElements","JSX","ReactNode","ReactElement","ReactPortal"];HFe=[{value:"boolean",text:"boolean"},{value:"color",text:"color (provides a color in hex or rgb)"},{value:"date",text:"date (same format as the Date constructor)"},{value:"email",text:"email"},{value:"file",text:"file (uploads a file and provides a url)"},{value:"list",text:"list (collection of items)"},{value:"longText",text:"longText (multiline text editor)"},{value:"number",text:"number"},{value:"object",text:"object (set of specific names and values)"},{value:"richText",text:"richText (provides value as html)"},{value:"string",text:"string"}];YFe=(t,e,r)=>{let n=new Set;Xj(t,e,r,n);let i=n.delete("true"),s=n.delete("false");(i||s)&&n.add("boolean");let o=Array.from(n.keys()).sort();if(o.length>1&&(o=o.map(a=>a.indexOf("=>")>=0?`(${a})`:a)),!(o.length>20))return o},qFe=(t,e,r)=>{let n=t.ts.TypeFormatFlags.InElementType|t.ts.TypeFormatFlags.NoTruncation;return e.typeToString(r,void 0,n)},Xj=(t,e,r,n)=>{if(r.isUnion())r.types.forEach(i=>{Xj(t,e,i,n)});else if(r.isLiteral()){let i=qFe(t,e,r);n.add(i)}};$Fe=new Set(["about","accessKey","accessKeyLabel","asChild","autoCapitalize","autoCorrect","autoFocus","autoSave","blur","contentEditable","contextMenu","dangerouslySetInnerHTML","datatype","defaultChecked","defaultValue","dir","draggable","enterKeyHint","focus","form","formAction","formEncType","formMethod","formNoValidate","formTarget","inlist","innerText","inputMode","is","isContentEditable","itemID","itemProp","itemRef","itemScope","itemType","lang","nonce","offsetHeight","offsetLeft","offsetTop","offsetWidth","outerText","prefix","property","radioGroup","rel","resource","results","rev","role","security","slot","spellCheck","suppressContentEditableWarning","suppressHydrationWarning","tabIndex","translate","typeof","unselectable","vocab"].map(t=>t.toLowerCase()))});function ns(t,e,r){for(let n of r.properties){if(!t.ts.isPropertyAssignment(n))continue;let i=cr(t,n);if(i==="name"&&t.ts.isStringLiteral(n.initializer)){e.name=n.initializer.text;continue}if(i==="description"&&t.ts.isStringLiteral(n.initializer)){e.description=n.initializer.text;continue}if(i==="image"&&t.ts.isStringLiteral(n.initializer)){e.image=n.initializer.text;continue}if(i==="inputs"&&t.ts.isArrayLiteralExpression(n.initializer)){let s=VFe(t,n.initializer);Ss(e,s);continue}if(i==="meta"&&t.ts.isObjectLiteralExpression(n.initializer)){let s=wm(t,n.initializer);s&&typeof s=="object"&&(e.meta=s);continue}}return e}function VFe(t,e){let r=[];for(let n of e.elements)t.ts.isObjectLiteralExpression(n)&&r.push(WFe(t,n));return r}function WFe(t,e){let r=wm(t,e),n=nke(r);return n.isRegistered=!0,n}function wn(t,e,r){let n=XFe(r);return e=jp(t,e,"name",n.name,!1),e=jp(t,e,"description",n.description),e=jp(t,e,"image",n.image),e=jp(t,e,"meta",n.meta),e=zFe(t,e,n),ike(t,e)}function zFe(t,e,r){let n=null,i=e.properties.filter(a=>t.ts.isPropertyAssignment(a)&&t.ts.isIdentifier(a.name)),s=i.findIndex(a=>t.ts.isIdentifier(a.name)&&a.name.text==="inputs"),o=[...r.inputs??[]];if(s>-1){if(o.length===0)return jp(t,e,"inputs",null);let a=i[s];t.ts.isPropertyAssignment(a)&&t.ts.isArrayLiteralExpression(a.initializer)&&(n=a.initializer)}return o.length===0?e:(n=eke(t,n||t.ts.factory.createArrayLiteralExpression(),o),s>-1?i[s]=t.ts.factory.updatePropertyAssignment(i[s],i[s].name,n):i.push(t.ts.factory.createPropertyAssignment("inputs",n)),t.ts.factory.updateObjectLiteralExpression(e,i))}function XFe(t){return{name:t.name,description:t.description,image:t.image,inputs:(t.inputs||[]).filter(r=>r.isRegistered).map(ZFe),...t.meta?{meta:{...t.meta}}:{}}}function ZFe(t){let e={name:t.name,type:t.type};return(Pi(t.defaultValue)||Cm(t.defaultValue)||Kp(t.defaultValue))&&(e.defaultValue=t.defaultValue),Pi(t.friendlyName)&&(e.friendlyName=t.friendlyName),Pi(t.helperText)&&(e.helperText=t.helperText),t.required===!0&&(e.required=!0),Array.isArray(t.enum)&&(e.enum=t.enum),t.hideFromUI===!0&&(e.hideFromUI=!0),typeof t.meta=="object"&&t.meta!=null&&Object.keys(t.meta).length>0&&(e.meta=t.meta),e}function eke(t,e,r){let n=e.elements.filter(i=>{if(!t.ts.isObjectLiteralExpression(i))return!1;let s=i.properties.find(a=>cr(t,a)==="name");if(!s)return!1;let o=s.initializer;return t.ts.isStringLiteral(o)?r.some(a=>a.name===o.text):!1});for(let i of r)n=tke(t,n,i);return n.sort((i,s)=>{let o=i.properties.find(d=>cr(t,d)==="name"),a=s.properties.find(d=>cr(t,d)==="name"),A=o?.initializer,c=a?.initializer,u=A&&t.ts.isStringLiteral(A)?A.text:"zz",l=c&&t.ts.isStringLiteral(c)?c.text:"zz";return u.toLowerCase().localeCompare(l.toLowerCase())}),t.ts.factory.updateArrayLiteralExpression(e,n)}function tke(t,e,r){let n=e.findIndex(i=>i.properties.some(s=>{let o=cr(t,s);return t.ts.isPropertyAssignment(s)&&o==="name"&&t.ts.isStringLiteral(s.initializer)&&s.initializer.text===r.name}));if(n>-1)e[n]=eY(t,e[n],r);else{let i=eY(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("name",t.ts.factory.createStringLiteral(r.name))],!0),r);e.push(i)}return e}function eY(t,e,r){let n=e.properties.filter(s=>t.ts.isPropertyAssignment(s)),i=Object.keys(r).filter(s=>s!=="isRegistered");for(let s of i)n=rke(t,n,r,s);return n=ske(t,n.filter(s=>{let o=cr(t,s);return i.includes(o)})),t.ts.factory.updateObjectLiteralExpression(e,n)}function rke(t,e,r,n){let i=e.findIndex(s=>t.ts.isIdentifier(s.name)&&s.name.text===n);return i>-1?e[i]=t.ts.factory.updatePropertyAssignment(e[i],e[i].name,Dm(t,r[n])):e.push(t.ts.factory.createPropertyAssignment(n,Dm(t,r[n]))),e}function Ss(t,e){for(let r of e){let n=t.inputs.findIndex(i=>i.name===r.name);n>-1?(r.isRegistered||!t.inputs[n].isRegistered)&&(t.inputs[n]=r):t.inputs.push(r)}t.acceptsChildren=dk(t)}function nke(t){let e=pk(t.type),r={name:t.name.trim(),type:e.builderType};return Pi(t.friendlyName)&&t.friendlyName.trim()!==t.name.trim()&&(r.friendlyName=t.friendlyName),(Pi(t.defaultValue)||Cm(t.defaultValue)||Kp(t.defaultValue))&&(r.defaultValue=t.defaultValue),Pi(t.helperText)&&(r.helperText=t.helperText),Kp(t.required)&&(r.required=t.required),typeof t.meta=="object"&&t.meta!=null&&Object.keys(t.meta).length>0&&(r.meta=t.meta),Array.isArray(t.enum)&&t.enum.length>0&&(r.enum=t.enum),t.hideFromUI===!0&&(r.hideFromUI=!0),fk(r)}function dk(t){let e=t.inputs.some(n=>n.name==="children"),r=t.inputs.some(n=>n.meta?.ts==="ReactNode");return!!(e||r||t.acceptsChildren===!0)}function fk(t){if(t.name==="children"&&(t.hideFromUI=!0,delete t.required),t.type==="object"&&t.defaultValue==null&&(t.hideFromUI=!0),t.type==="list"&&t.defaultValue==null&&(t.hideFromUI=!0),t.meta){let e=t.meta.ts;typeof e=="string"&&(e=e.trim(),e.endsWith("ReactNode")&&(e="ReactNode"),t.meta.ts=e,e==="ReactNode"&&(t.hideFromUI=!0))}return t}function ike(t,e){let r=[...e.properties].sort((n,i)=>{let s=cr(t,n)||"zz",o=cr(t,i)||"zz";if(s==="inputs")return 1;let a=tY.indexOf(s),A=tY.indexOf(o);return a>-1?A>-1&&a>A?1:-1:A>-1?a>-1&&A<a?-1:1:s.localeCompare(o)});return t.ts.factory.updateObjectLiteralExpression(e,r)}function ske(t,e){return[...e].sort((n,i)=>{let s=cr(t,n)||"zz",o=cr(t,i)||"zz",a=rY.indexOf(s),A=rY.indexOf(o);return a>-1?A>-1&&a>A?1:-1:A>-1?a>-1&&A<a?-1:1:s.localeCompare(o)})}function Yp(t,e){for(let r of e.properties){if(!t.ts.isPropertyAssignment(r)||!t.ts.isIdentifier(r.name))continue;if(cr(t,r)==="canHaveChildren"){let{initializer:i}=r;return i.kind===t.ts.SyntaxKind.TrueKeyword}}return!1}var tY,rY,_i=L(()=>{"use strict";h();Ma();bm();St();tY=["component","name","description"];rY=["name","type"]});function nY(t,e){let r=`Builder.registerComponent(
|
|
86
|
+
`),await t.writeFile(e,s),"create"}catch(o){if(o&&String(o).includes("EACCES"))return t.debug(`Permssion denied, failed to create or modify .env file with "${r}=${n}" at ${e}`),"permission-error";t.Sentry?.captureException(o)}return null}var TFe,jl=L(()=>{"use strict";h();TFe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm});async function Bm(t){return await Ra(t,[".env.local",".env.development.local",".env.production.local",".env.development",".env.production",".env"],Na)}async function zj(t,e){let r=await Bm(t),n=await Ta(t,r.file,r.envKey,e);return{...r,modifiedType:n}}var Na,ym=L(()=>{"use strict";h();jl();Na="NEXT_PUBLIC_BUILDER_API_KEY"});var nt,Qm,_n=L(()=>{"use strict";h();nt={gen1:"Gen 1",gen2:"Gen 2"},Qm={CMS:"cms",VCP:"vcp",HYBRID:"hybrid"}});function jp(t,e,r,n,i=!0){let s=e.properties.filter(a=>t.ts.isPropertyAssignment(a)),o=NFe(t,e,r);return o>-1?n==null&&i?t.ts.factory.updateObjectLiteralExpression(e,s.filter((a,A)=>A!==o)):(s[o]=t.ts.factory.updatePropertyAssignment(s[o],s[o].name,Dm(t,n)),t.ts.factory.updateObjectLiteralExpression(e,s)):(n!=null&&s.push(t.ts.factory.createPropertyAssignment(r,Dm(t,n))),t.ts.factory.updateObjectLiteralExpression(e,s))}function NFe(t,e,r){return e.properties.findIndex(n=>cr(t,n)===r)}function wm(t,e){switch(e.kind){case t.ts.SyntaxKind.ArrayLiteralExpression:return PFe(t,e);case t.ts.SyntaxKind.ObjectLiteralExpression:return MFe(t,e);case t.ts.SyntaxKind.StringLiteral:return e.text;case t.ts.SyntaxKind.NumericLiteral:return Number(e.text);case t.ts.SyntaxKind.NoSubstitutionTemplateLiteral:return e.text;case t.ts.SyntaxKind.TrueKeyword:return!0;case t.ts.SyntaxKind.FalseKeyword:return!1;case t.ts.SyntaxKind.Identifier:switch(e.escapedText){case"undefined":return;case"null":return null;case"String":return String;case"Number":return Number;case"Boolean":return Boolean;case"NaN":return NaN}}}function MFe(t,e){let r={};if(e&&t.ts.isObjectLiteralExpression(e)){for(let n of e.properties)if(t.ts.isPropertyAssignment(n)){let i=cr(t,n);i&&(r[i]=wm(t,n.initializer))}}return r}function PFe(t,e){return e&&t.ts.isArrayLiteralExpression(e)?e.elements.map(r=>wm(t,r)):[]}function cr(t,e){if(e&&t.ts.isPropertyAssignment(e)){let r=e.name;switch(r.kind){case t.ts.SyntaxKind.Identifier:return r.text;case t.ts.SyntaxKind.StringLiteral:case t.ts.SyntaxKind.NumericLiteral:return r.text;case t.ts.SyntaxKind.ComputedPropertyName:let n=r.expression;if(t.ts.isStringLiteral(n)||t.ts.isNumericLiteral(n))return r.expression.text}}}function Dm(t,e){return gk(t,e,new WeakSet)}function gk(t,e,r){return e===void 0?t.ts.factory.createIdentifier("undefined"):e===null?t.ts.factory.createIdentifier("null"):typeof e=="string"?t.ts.factory.createStringLiteral(e):typeof e=="number"?isNaN(e)?t.ts.factory.createIdentifier("NaN"):t.ts.factory.createNumericLiteral(e):e===!0?t.ts.factory.createTrue():e===!1?t.ts.factory.createFalse():e===String?t.ts.factory.createIdentifier("String"):e===Number?t.ts.factory.createIdentifier("Number"):e===Boolean?t.ts.factory.createIdentifier("Boolean"):Array.isArray(e)?LFe(t,e,r):typeof e=="object"?_Fe(t,e,r):t.ts.factory.createIdentifier(e)}function LFe(t,e,r){let n=e.map(i=>gk(t,i,r));return t.ts.factory.createArrayLiteralExpression(n,!0)}function _Fe(t,e,r){if(r.has(e))return t.ts.factory.createIdentifier("undefined");r.add(e);let n=Object.keys(e).map(i=>t.ts.factory.createPropertyAssignment(i,gk(t,e[i],r)));return t.ts.factory.createObjectLiteralExpression(n,!0)}var Ma=L(()=>{"use strict";h()});function Yl(t,e,r){let n=[];if(!r)return n;let i=null;if(t.ts.isArrowFunction(r)||t.ts.isFunctionExpression(r)||t.ts.isFunctionDeclaration(r)){let s=r.parameters;if(s.length>0){let o=s[0],a=e.getTypeAtLocation(o);a.aliasTypeArguments&&a.aliasTypeArguments.length>0&&(a=a.aliasTypeArguments[0]),a.flags&t.ts.TypeFlags.Object&&(i=a.getProperties())}}else if(t.ts.isIdentifier(r)){let s=e.getTypeAtLocation(r),o=s.symbol?.valueDeclaration;if(o&&t.ts.isClassDeclaration(o)){let A=o.heritageClauses?.find(c=>c.token===t.ts.SyntaxKind.ExtendsKeyword)?.types;if(A){for(let c of A)if(e.getSymbolAtLocation(c.expression)?.name==="Component"){if(t.ts.isExpressionWithTypeArguments(c)){let l=c.typeArguments;if(l){let d=l[0];i=e.getTypeFromTypeNode(d).getProperties()}}break}}}if(!i){let a=s.getCallSignatures();if(a.length>0){let A=a[0].getParameters();A.length>0&&(i=e.getTypeOfSymbolAtLocation(A[0],r).getProperties())}}}else if(t.ts.isExportSpecifier(r)){let s=e.getSymbolAtLocation(r.name);if(s){let a=e.getTypeOfSymbolAtLocation(s,r).getCallSignatures();if(a.length>0){let A=a[0].getParameters();A.length>0&&(i=e.getTypeOfSymbolAtLocation(A[0],r).getProperties())}}}if(i)for(let s of i){let o=UFe(t,e,s);o&&n.push(o)}return n=n.filter(Zj),n.length>0?n:GFe(t,r)}function UFe(t,e,r){let n=r.valueDeclaration,i=r.getName();if(n||(n=r.getDeclarations()?.[0]),n&&t.ts.isPropertySignature(n)){if(i!=="children"&&n.getSourceFile().fileName.includes("node_modules/@types/"))return null;let s="string",o;if(n?.type){let A=e.getTypeFromTypeNode(n.type),c=e.typeToString(A),u=pk(c);u.knownType?s=u.builderType:KFe(c)||A.flags&t.ts.TypeFlags.StringLike?s="string":A.flags&t.ts.TypeFlags.NumberLike?s="number":A.flags&t.ts.TypeFlags.IndexedAccess?s="list":A.flags&t.ts.TypeFlags.Object||A.isUnion()&&A.types.every(l=>l.flags&t.ts.TypeFlags.Object)||A.isIntersection()&&A.types.some(l=>l.flags&t.ts.TypeFlags.Object)?s="object":s="string",c!==s&&(o=c)}let a={name:i,type:s,isRegistered:!1};if(o&&n.type){let A=YFe(t,e,e.getTypeFromTypeNode(n.type));a.meta=a.meta||{},A&&A.length>0&&a.type==="string"&&A.every(JFe)?a.enum=A.map(jFe):a.meta.ts=o}return n.questionToken||(a.required=!0),a}return null}function GFe(t,e){let r=[],n=t.ts.getJSDocCommentsAndTags(e);for(let i of n)if(!(!t.ts.isJSDoc(i)||!i.tags))for(let s of i.tags){if(!t.ts.isJSDocParameterTag(s)||s.tagName.text!=="param")continue;let a=s.typeExpression?.type;if(!a||!t.ts.isJSDocTypeLiteral(a))continue;let A=a.jsDocPropertyTags;if(A)for(let c of A){if(!t.ts.isJSDocPropertyLikeTag(c))continue;let u=c.name;if(!t.ts.isQualifiedName(u))continue;let l=c.typeExpression;if(!l)continue;let d="";switch(l.type.kind){case t.ts.SyntaxKind.StringKeyword:{d="string";break}case t.ts.SyntaxKind.NumberKeyword:{d="number";break}case t.ts.SyntaxKind.BooleanKeyword:{d="boolean";break}default:continue}let p={name:u.right.text,type:d,isRegistered:!1};r.push(p)}}return r.filter(Zj)}function KFe(t){return typeof t!="string"?!1:!!OFe.some(e=>t.includes(e))}function pk(t){return typeof t=="string"&&(t=t.trim(),HFe.some(e=>e.value===t))?{builderType:t,knownType:!0}:{builderType:"string",knownType:!1}}function JFe(t){return/^['"].*['"]$/.test(t)}function jFe(t){return(t.startsWith('"')||t.startsWith("'"))&&(t.endsWith('"')||t.endsWith("'"))?t.slice(1,-1):t}function Zj(t){let e=t?.name;if(typeof e!="string"||e===""||e.startsWith("aria")||e.startsWith("data-"))return!1;if(e.startsWith("on")&&e.length>2){let r=e.charAt(2);if(r.toUpperCase()===r)return!1}return!$Fe.has(e.toLowerCase())}var OFe,HFe,YFe,qFe,Xj,$Fe,bm=L(()=>{"use strict";h();OFe=["ClassicComponent","FunctionComponent","IntrinsicElements","JSX","ReactNode","ReactElement","ReactPortal"];HFe=[{value:"boolean",text:"boolean"},{value:"color",text:"color (provides a color in hex or rgb)"},{value:"date",text:"date (same format as the Date constructor)"},{value:"email",text:"email"},{value:"file",text:"file (uploads a file and provides a url)"},{value:"list",text:"list (collection of items)"},{value:"longText",text:"longText (multiline text editor)"},{value:"number",text:"number"},{value:"object",text:"object (set of specific names and values)"},{value:"richText",text:"richText (provides value as html)"},{value:"string",text:"string"}];YFe=(t,e,r)=>{let n=new Set;Xj(t,e,r,n);let i=n.delete("true"),s=n.delete("false");(i||s)&&n.add("boolean");let o=Array.from(n.keys()).sort();if(o.length>1&&(o=o.map(a=>a.indexOf("=>")>=0?`(${a})`:a)),!(o.length>20))return o},qFe=(t,e,r)=>{let n=t.ts.TypeFormatFlags.InElementType|t.ts.TypeFormatFlags.NoTruncation;return e.typeToString(r,void 0,n)},Xj=(t,e,r,n)=>{if(r.isUnion())r.types.forEach(i=>{Xj(t,e,i,n)});else if(r.isLiteral()){let i=qFe(t,e,r);n.add(i)}};$Fe=new Set(["about","accessKey","accessKeyLabel","asChild","autoCapitalize","autoCorrect","autoFocus","autoSave","blur","contentEditable","contextMenu","dangerouslySetInnerHTML","datatype","defaultChecked","defaultValue","dir","draggable","enterKeyHint","focus","form","formAction","formEncType","formMethod","formNoValidate","formTarget","inlist","innerText","inputMode","is","isContentEditable","itemID","itemProp","itemRef","itemScope","itemType","lang","nonce","offsetHeight","offsetLeft","offsetTop","offsetWidth","outerText","prefix","property","radioGroup","rel","resource","results","rev","role","security","slot","spellCheck","suppressContentEditableWarning","suppressHydrationWarning","tabIndex","translate","typeof","unselectable","vocab"].map(t=>t.toLowerCase()))});function ns(t,e,r){for(let n of r.properties){if(!t.ts.isPropertyAssignment(n))continue;let i=cr(t,n);if(i==="name"&&t.ts.isStringLiteral(n.initializer)){e.name=n.initializer.text;continue}if(i==="description"&&t.ts.isStringLiteral(n.initializer)){e.description=n.initializer.text;continue}if(i==="image"&&t.ts.isStringLiteral(n.initializer)){e.image=n.initializer.text;continue}if(i==="inputs"&&t.ts.isArrayLiteralExpression(n.initializer)){let s=VFe(t,n.initializer);Ss(e,s);continue}if(i==="meta"&&t.ts.isObjectLiteralExpression(n.initializer)){let s=wm(t,n.initializer);s&&typeof s=="object"&&(e.meta=s);continue}}return e}function VFe(t,e){let r=[];for(let n of e.elements)t.ts.isObjectLiteralExpression(n)&&r.push(WFe(t,n));return r}function WFe(t,e){let r=wm(t,e),n=nke(r);return n.isRegistered=!0,n}function wn(t,e,r){let n=XFe(r);return e=jp(t,e,"name",n.name,!1),e=jp(t,e,"description",n.description),e=jp(t,e,"image",n.image),e=jp(t,e,"meta",n.meta),e=zFe(t,e,n),ike(t,e)}function zFe(t,e,r){let n=null,i=e.properties.filter(a=>t.ts.isPropertyAssignment(a)&&t.ts.isIdentifier(a.name)),s=i.findIndex(a=>t.ts.isIdentifier(a.name)&&a.name.text==="inputs"),o=[...r.inputs??[]];if(s>-1){if(o.length===0)return jp(t,e,"inputs",null);let a=i[s];t.ts.isPropertyAssignment(a)&&t.ts.isArrayLiteralExpression(a.initializer)&&(n=a.initializer)}return o.length===0?e:(n=eke(t,n||t.ts.factory.createArrayLiteralExpression(),o),s>-1?i[s]=t.ts.factory.updatePropertyAssignment(i[s],i[s].name,n):i.push(t.ts.factory.createPropertyAssignment("inputs",n)),t.ts.factory.updateObjectLiteralExpression(e,i))}function XFe(t){return{name:t.name,description:t.description,image:t.image,inputs:(t.inputs||[]).filter(r=>r.isRegistered).map(ZFe),...t.meta?{meta:{...t.meta}}:{}}}function ZFe(t){let e={name:t.name,type:t.type};return(Pi(t.defaultValue)||Cm(t.defaultValue)||Kp(t.defaultValue))&&(e.defaultValue=t.defaultValue),Pi(t.friendlyName)&&(e.friendlyName=t.friendlyName),Pi(t.helperText)&&(e.helperText=t.helperText),t.required===!0&&(e.required=!0),Array.isArray(t.enum)&&(e.enum=t.enum),t.hideFromUI===!0&&(e.hideFromUI=!0),typeof t.meta=="object"&&t.meta!=null&&Object.keys(t.meta).length>0&&(e.meta=t.meta),e}function eke(t,e,r){let n=e.elements.filter(i=>{if(!t.ts.isObjectLiteralExpression(i))return!1;let s=i.properties.find(a=>cr(t,a)==="name");if(!s)return!1;let o=s.initializer;return t.ts.isStringLiteral(o)?r.some(a=>a.name===o.text):!1});for(let i of r)n=tke(t,n,i);return n.sort((i,s)=>{let o=i.properties.find(d=>cr(t,d)==="name"),a=s.properties.find(d=>cr(t,d)==="name"),A=o?.initializer,c=a?.initializer,u=A&&t.ts.isStringLiteral(A)?A.text:"zz",l=c&&t.ts.isStringLiteral(c)?c.text:"zz";return u.toLowerCase().localeCompare(l.toLowerCase())}),t.ts.factory.updateArrayLiteralExpression(e,n)}function tke(t,e,r){let n=e.findIndex(i=>i.properties.some(s=>{let o=cr(t,s);return t.ts.isPropertyAssignment(s)&&o==="name"&&t.ts.isStringLiteral(s.initializer)&&s.initializer.text===r.name}));if(n>-1)e[n]=eY(t,e[n],r);else{let i=eY(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("name",t.ts.factory.createStringLiteral(r.name))],!0),r);e.push(i)}return e}function eY(t,e,r){let n=e.properties.filter(s=>t.ts.isPropertyAssignment(s)),i=Object.keys(r).filter(s=>s!=="isRegistered");for(let s of i)n=rke(t,n,r,s);return n=ske(t,n.filter(s=>{let o=cr(t,s);return i.includes(o)})),t.ts.factory.updateObjectLiteralExpression(e,n)}function rke(t,e,r,n){let i=e.findIndex(s=>t.ts.isIdentifier(s.name)&&s.name.text===n);return i>-1?e[i]=t.ts.factory.updatePropertyAssignment(e[i],e[i].name,Dm(t,r[n])):e.push(t.ts.factory.createPropertyAssignment(n,Dm(t,r[n]))),e}function Ss(t,e){for(let r of e){let n=t.inputs.findIndex(i=>i.name===r.name);n>-1?(r.isRegistered||!t.inputs[n].isRegistered)&&(t.inputs[n]=r):t.inputs.push(r)}t.acceptsChildren=dk(t)}function nke(t){let e=pk(t.type),r={name:t.name.trim(),type:e.builderType};return Pi(t.friendlyName)&&t.friendlyName.trim()!==t.name.trim()&&(r.friendlyName=t.friendlyName),(Pi(t.defaultValue)||Cm(t.defaultValue)||Kp(t.defaultValue))&&(r.defaultValue=t.defaultValue),Pi(t.helperText)&&(r.helperText=t.helperText),Kp(t.required)&&(r.required=t.required),typeof t.meta=="object"&&t.meta!=null&&Object.keys(t.meta).length>0&&(r.meta=t.meta),Array.isArray(t.enum)&&t.enum.length>0&&(r.enum=t.enum),t.hideFromUI===!0&&(r.hideFromUI=!0),fk(r)}function dk(t){let e=t.inputs.some(n=>n.name==="children"),r=t.inputs.some(n=>n.meta?.ts==="ReactNode");return!!(e||r||t.acceptsChildren===!0)}function fk(t){if(t.name==="children"&&(t.hideFromUI=!0,delete t.required),t.type==="object"&&t.defaultValue==null&&(t.hideFromUI=!0),t.type==="list"&&t.defaultValue==null&&(t.hideFromUI=!0),t.meta){let e=t.meta.ts;typeof e=="string"&&(e=e.trim(),e.endsWith("ReactNode")&&(e="ReactNode"),t.meta.ts=e,e==="ReactNode"&&(t.hideFromUI=!0))}return t}function ike(t,e){let r=[...e.properties].sort((n,i)=>{let s=cr(t,n)||"zz",o=cr(t,i)||"zz";if(s==="inputs")return 1;let a=tY.indexOf(s),A=tY.indexOf(o);return a>-1?A>-1&&a>A?1:-1:A>-1?a>-1&&A<a?-1:1:s.localeCompare(o)});return t.ts.factory.updateObjectLiteralExpression(e,r)}function ske(t,e){return[...e].sort((n,i)=>{let s=cr(t,n)||"zz",o=cr(t,i)||"zz",a=rY.indexOf(s),A=rY.indexOf(o);return a>-1?A>-1&&a>A?1:-1:A>-1?a>-1&&A<a?-1:1:s.localeCompare(o)})}function Yp(t,e){for(let r of e.properties){if(!t.ts.isPropertyAssignment(r)||!t.ts.isIdentifier(r.name))continue;if(cr(t,r)==="canHaveChildren"){let{initializer:i}=r;return i.kind===t.ts.SyntaxKind.TrueKeyword}}return!1}var tY,rY,_i=L(()=>{"use strict";h();Ma();bm();St();tY=["component","name","description"];rY=["name","type"]});function nY(t,e){let r=`Builder.registerComponent(
|
|
87
87
|
`;if(t.appDir)e.acceptsChildren?r+=` withChildren(${e.importName}),
|
|
88
88
|
`:r+=` ${e.importName},
|
|
89
89
|
`;else{let i=e.externalImportPath?e.externalImportPath:Yt(t,t.registryPath,e.filePath);e.exportName==="default"?e.acceptsChildren?r+=` withChildren(dynamic(() => import(${JSON.stringify(i)}))),
|
|
@@ -103,7 +103,7 @@ ${r}=${n}
|
|
|
103
103
|
`+i)),t=i+`
|
|
104
104
|
`+t}return t.trim()+`
|
|
105
105
|
`}function Ck(t,e){return e.sort((r,n)=>{let i=fY(t,r),s=fY(t,n);return i.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())})}function fY(t,e){let r=e.importClause;if(r){let n=r.namedBindings;if(n&&t.ts.isNamedImports(n)&&n.elements.length>0)return n.elements[0].name.text;if(r.name)return r.name.text}return e.moduleSpecifier&&t.ts.isStringLiteral(e.moduleSpecifier)?e.moduleSpecifier.text:""}function mY(t){return typeof t=="string"&&!t.includes("'use client'")&&!t.includes(`"use client"'`)&&(t=`"use client"
|
|
106
|
-
${t}`),t}function CY(t,e){let r=e.statements.filter(n=>!(t.ts.isExpressionStatement(n)&&t.ts.isStringLiteral(n.expression)&&t.ts.isStringLiteral(n.expression)&&n.expression.text==="use client"));return t.ts.factory.updateSourceFile(e,r)}function _a(t,e){return e.sort((r,n)=>{if(t.ts.isObjectLiteralExpression(r)&&t.ts.isObjectLiteralExpression(n)){let i=hY(t,r),s=hY(t,n);return i.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())}return 1})}function hY(t,e){let r=e.properties.find(n=>cr(t,n)==="name");return r&&t.ts.isPropertyAssignment(r)&&t.ts.isStringLiteral(r.initializer)?r.initializer.text:"zzzz"}var $l=L(()=>{"use strict";h();Ma()});async function IY(t){let e=await t.readFile(t.registryPath);return e?Qke(t,e):{components:[],sourceFile:jt(t,"")}}async function Qke(t,e){let r=jt(t,e);return t.sdkVersion===it.gen2?wke(t,r):Dke(t,r)}async function Dke(t,e){let r=[];for(let n=0;n<e.statements.length;n++){let i=e.statements[n];if(!t.ts.isExpressionStatement(i))continue;let s=i.expression;if(!t.ts.isCallExpression(s))continue;let o=s.expression;if(!t.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!t.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let u=c[1];if(!t.ts.isObjectLiteralExpression(u))continue;let l=c[0];if(t.ts.isCallExpression(l)){let d=t.ts.isIdentifier(l.expression)&&l.expression.text;if(d==="withChildren"){let p=Bk(t,l.arguments[0]);if(t.ts.isCallExpression(p)){let f=await Ik(t,n,p,u,!0);f&&r.push(f)}else{let f=p;if(t.ts.isIdentifier(f)){let m=await Ek(t,e,n,f,u,!0);m&&r.push(m)}}continue}if(d==="dynamic"){let p=await Ik(t,n,l,u,!1);p&&r.push(p);continue}let g=Bk(t,l.arguments[0]);if(t.ts.isCallExpression(g)&&t.ts.isIdentifier(g.expression)&&g.expression.text==="dynamic"){let p=await Ik(t,n,g,u,!1);p&&r.push(p);continue}if(t.ts.isIdentifier(g)){let p=await Ek(t,e,n,g,u,!1);p&&r.push(p);continue}continue}if(t.ts.isIdentifier(l)){let d=await Ek(t,e,n,l,u,!1);d&&r.push(d);continue}}return{sourceFile:e,components:ts(r)}}function Bk(t,e){return t.ts.isCallExpression(e)?(t.ts.isIdentifier(e.expression)&&e.expression.text)==="dynamic"?e:Bk(t,e.arguments[0]):e}async function Ik(t,e,r,n,i){let s={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:e,acceptsChildren:i,framework:"react"},o=r.arguments;if(o.length===0)return null;let a=o[0];if(!t.ts.isArrowFunction(a))return null;let A=a.body;if(t.ts.isCallExpression(A)){if(A.expression.kind!==t.ts.SyntaxKind.ImportKeyword||A.arguments.length!==1)return null;let u=A.arguments[0];if(!t.ts.isStringLiteral(u))return null;let l=u.text,d=await Xp(t,l);s.filePath=d,s.relFilePath=t.relative(t.getAppRootDir(),s.filePath),await t.exists(d)?s.importPath=Br(t,s.filePath):(s.externalImportPath=l,s.importPath=s.externalImportPath),s.name=Ys(t,s.filePath),s.importName="default",s.exportName="default",s.exportType="default"}else if(t.ts.isPropertyAccessExpression(A)){let c=A.expression;if(!t.ts.isParenthesizedExpression(c))return null;let u=c.expression;if(!t.ts.isAwaitExpression(u))return null;let l=u.expression;if(!t.ts.isCallExpression(l)||l.expression.kind!==t.ts.SyntaxKind.ImportKeyword||l.arguments.length!==1)return null;let g=l.arguments[0];if(!t.ts.isStringLiteral(g)||!t.ts.isIdentifier(A.name))return null;let p=g.text,f=await Xp(t,p);s.filePath=f,s.relFilePath=t.relative(t.getAppRootDir(),s.filePath),await t.exists(f)?s.importPath=Br(t,s.filePath):(s.externalImportPath=p,s.importPath=s.externalImportPath),s.name=Er(A.name.text),s.importName=A.name.text,s.exportName=A.name.text,s.exportType="named"}else return null;return s=ns(t,s,n),s.displayFilePath=ir(t,s.filePath),s.filePath&&s.exportName&&(s.id=await hr(t,s.filePath,s.exportName,s.externalImportPath)),s}async function Ek(t,e,r,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=e.statements.filter(c=>t.ts.isImportDeclaration(c)),A=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(A){let c=A.moduleSpecifier;if(!t.ts.isStringLiteral(c))return null;let u=await Xp(t,c.text);o.filePath=u,o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(u)?o.importPath=Br(t,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=Ys(t,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!t.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(g=>g.name.text===n.text));if(!c)return null;let u=c.moduleSpecifier;if(!t.ts.isStringLiteral(u))return null;let l=await Xp(t,u.text);o.filePath=l,o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(l)?o.importPath=Br(t,o.filePath):(o.externalImportPath=u.text,o.importPath=o.externalImportPath),o.name=Er(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=ns(t,o,i),o.displayFilePath=ir(t,o.filePath),o.filePath&&o.exportName&&(o.id=await hr(t,o.filePath,o.exportName,o.externalImportPath)),o}function Xp(t,e){return Sm(t,t.normalize(t.resolve(t.dirname(t.registryPath),e)))}function EY(t,e,r){let n=!1,i=0,s=[...e.statements];for(let c=0;c<s.length;c++){let u=s[c];if(t.ts.isImportDeclaration(u)){i=c;continue}if(!t.ts.isExpressionStatement(u))continue;let l=u.expression;if(!t.ts.isCallExpression(l))continue;let d=l.expression;if(!t.ts.isPropertyAccessExpression(d))continue;let g=d.expression;if(!t.ts.isIdentifier(g)||g.text!=="builder")continue;if(d.name.text=="init"){n=!0;break}else continue}if(n)return e;let o=t.ts.factory.createPropertyAccessExpression(t.ts.factory.createPropertyAccessExpression(t.ts.factory.createIdentifier("process"),t.ts.factory.createIdentifier("env")),t.ts.factory.createIdentifier(Na)),a=r?t.ts.factory.createNonNullExpression(o):o,A=t.ts.factory.createExpressionStatement(t.ts.factory.createCallExpression(t.ts.factory.createPropertyAccessExpression(t.ts.factory.createIdentifier("builder"),t.ts.factory.createIdentifier("init")),void 0,[a]));return s.splice(i+1,0,A),t.ts.factory.updateSourceFile(e,s)}async function wke(t,e){let r=[],n=hn(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await yk(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:ts(r)}}async function yk(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};Yp(t,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!t.ts.isPropertyAssignment(s)||!t.ts.isIdentifier(s.name))continue;if(cr(t,s)==="component"){let a,{initializer:A}=s;if(t.ts.isCallExpression(A)&&(t.ts.isIdentifier(A.expression)&&A.expression.text)==="dynamic"){let g=A.arguments;if(g.length===0)return null;let p=g[0];if(!t.ts.isArrowFunction(p))return null;let f=p.body;if(t.ts.isCallExpression(f)){if(f.expression.kind!==t.ts.SyntaxKind.ImportKeyword||f.arguments.length!==1)return null;let C=f.arguments[0];if(!t.ts.isStringLiteral(C))return null;let I=C.text,B=await Xp(t,I);n.filePath=B,n.relFilePath=t.relative(t.getAppRootDir(),n.filePath),await t.exists(B)?n.importPath=Br(t,n.filePath):(n.externalImportPath=I,n.importPath=n.externalImportPath),n.name=Ys(t,n.filePath),n.importName="default",n.exportName="default",n.exportType="default"}else if(t.ts.isPropertyAccessExpression(f)){let m=f.expression;if(!t.ts.isParenthesizedExpression(m))return null;let C=m.expression;if(!t.ts.isAwaitExpression(C))return null;let I=C.expression;if(!t.ts.isCallExpression(I)||I.expression.kind!==t.ts.SyntaxKind.ImportKeyword||I.arguments.length!==1)return null;let E=I.arguments[0];if(!t.ts.isStringLiteral(E)||!t.ts.isIdentifier(f.name))return null;let y=E.text,Q=await Xp(t,y);n.filePath=Q,n.relFilePath=t.relative(t.getAppRootDir(),n.filePath),await t.exists(Q)?n.importPath=Br(t,n.filePath):(n.externalImportPath=y,n.importPath=n.externalImportPath),n.name=Er(f.name.text),n.importName=f.name.text,n.exportName=f.name.text,n.exportType="named"}else return null;return n=ns(t,n,r),n.displayFilePath=ir(t,n.filePath),n.filePath&&n.exportName&&(n.id=await hr(t,n.filePath,n.exportName,n.externalImportPath)),n}if(t.ts.isIdentifier(A)&&(a=A.text),!a)continue;n.name===""&&(n.name=Er(a)),n.importName=a;let c=await Pa(t,t.registryPath,e,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await t.exists(c.filePath)?n.importPath=Br(t,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.importPath=Br(t,c.filePath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let u=e.statements.filter(d=>t.ts.isImportDeclaration(d)),l=u.find(d=>d.importClause&&d.importClause.name?.text===a);if(l){let d=l.moduleSpecifier;if(!t.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=u.find(p=>!p.importClause||!p.importClause.namedBindings||!t.ts.isNamedImports(p.importClause.namedBindings)?!1:p.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let g=d.moduleSpecifier;if(!t.ts.isStringLiteral(g))return null;n.exportName=a}continue}}return n=ns(t,n,r),n.filePath&&n.exportName&&(n.id=await hr(t,n.filePath,n.exportName,n.externalImportPath)),n}var BY=L(()=>{"use strict";h();_n();Jr();is();St();Ma();_i();ym()});function Ua(t,e){let r=[...e.statements],n=!1;for(let i=e.statements.length-1;i>=0;i--){let s=e.statements[i];if(t.ts.isImportDeclaration(s)&&s.importClause){let o=!1,a=s.importClause.namedBindings;if(a&&t.ts.isNamedImports(a)&&a.elements){let A=[...a.elements];for(let c=A.length-1;c>=0;c--){let u=A[c];if(t.ts.isImportSpecifier(u)){let l=u.name;if(l&&t.ts.isIdentifier(l)){let d=l.text;yY(t,e,d)||A.splice(c,1)}}}if(A.length===0)o=!0;else if(a.elements.length!==A.length){let c=t.ts.factory.updateImportClause(s.importClause,!1,s.importClause.name,t.ts.factory.createNamedImports(A)),u=t.ts.factory.updateImportDeclaration(s,void 0,c,s.moduleSpecifier,void 0);r[i]=u,n=!0}}else if(s.importClause.name&&t.ts.isIdentifier(s.importClause.name)){let A=s.importClause.name.text;yY(t,e,A)||(o=!0)}o&&(r.splice(i,1),n=!0)}}return n?t.ts.factory.updateSourceFile(e,r):e}function yY(t,e,r){let n=!1;function i(s){if(!t.ts.isImportDeclaration(s)){if(t.ts.isIdentifier(s)&&s.text===r){n=!0;return}t.ts.forEachChild(s,i)}}return t.ts.forEachChild(e,i),n}var Zp=L(()=>{"use strict";h()});function Ga(t,e,r,n,i,s,o){let a=null,A=null,c=null,u=-1;e=bs(e),r=bs(r);let l=e.find(g=>g.id===t),d=r.find(g=>g.id===t);if(n)d||(a={...bs(l),inputs:bs(l.inputs).map(g=>(g.isRegistered=!0,g))},u=r.length,r.push(a));else if(typeof d?.nodeIndex=="number"&&d.nodeIndex>-1){if(i)u=d.nodeIndex,A=bs(d),r=r.filter(g=>g.id!==t);else if(s!=null)bke(d,s),u=d.nodeIndex,c=d;else if(o!=null){let g=d.inputs.find(p=>p.name===o.name);g&&(o.registerInput===!1?g.isRegistered=!1:(Ske(g,o),g.isRegistered=!0),c=d,u=d.nodeIndex)}}return{addCmpToRegistry:a,removeCmpFromRegistry:A,updateRegisteredCmp:c,nodeIndex:u,components:jo(e,r)}}function jo(t,e){let r=ts([...e.map(n=>(n.isRegistered=!0,n)),...t.filter(n=>!e.some(i=>i.id===n.id)).map(n=>(n.isRegistered=!1,n))]);return r.forEach(n=>{n.inputs=n.inputs.map(fk),n.inputs.sort((o,a)=>o.name.toLowerCase().localeCompare(a.name.toLowerCase()));let i=e.find(o=>o.id===n.id);i&&(i.acceptsChildren=dk(n));let s=t.find(o=>o.id===n.id&&o.externalImportPath);s&&(n.filePath=s.filePath,n.relFilePath=s.relFilePath)}),r}function bke(t,e){Pi(e.name)?t.name=e.name:e.name===null&&(t.name=t.importName),Pi(e.description)?t.description=e.description:e.description===null&&delete t.description,Pi(e.image)?t.image=e.image:e.image===null&&delete t.image}function Ske(t,e){Pi(e.type)&&(t.type=e.type),Pi(e.friendlyName)?t.friendlyName=e.friendlyName:e.friendlyName===null&&delete t.friendlyName,Pi(e.defaultValue)||Cm(e.defaultValue)||Kp(e.defaultValue)?t.defaultValue=e.defaultValue:e.defaultValue===null&&delete t.defaultValue,Pi(e.helperText)?t.helperText=e.helperText:e.helperText===null&&delete t.helperText,e.required===!0?t.required=e.required:(e.required===null||e.required===!1)&&delete t.required}var ed=L(()=>{"use strict";h();St();_i()});async function ou(t){let e=new Set,r=async i=>{let s=await t.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=t.join(i,o),A=t.extname(o).toLowerCase();if(A===".tsx"||A===".jsx"||A===".ts"||A===".js"){e.add(a);return}(await t.stat(a)).isDirectory()&&await r(a)}))};return await r(t.getAppRootDir()),await Dn(t,[...e])}var vm=L(()=>{"use strict";h();qs()});function Oa(t,e,r){return $p(t,e,r.variableName)?e:vke(t,e,r)}function vke(t,e,r){let n=typeof r.arrayType=="string"?t.ts.factory.createArrayTypeNode(t.ts.factory.createTypeReferenceNode(r.arrayType,void 0)):void 0,i=t.ts.factory.createArrayLiteralExpression([]),s=t.ts.factory.createVariableDeclaration(r.variableName,void 0,n,i),o=t.ts.factory.createVariableDeclarationList([s],t.ts.NodeFlags.Const),a=t.ts.factory.createModifier(t.ts.SyntaxKind.ExportKeyword),A=t.ts.factory.createVariableStatement([a],o),c=[...e.statements,A];return t.ts.factory.updateSourceFile(e,c)}var td=L(()=>{"use strict";h();is()});async function Ka(t,e,r,n,i,s,o,a){let A=await ou(t),[c,u,l,d]=await Promise.all([pY(t,A),IY(t),Li(t),Bm(t)]),g=c.map(B=>B.cmpInfo),p=u.components,f={components:jo(g,p),registryPath:t.registryPath,registryDisplayPath:ir(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Ws(g),publicApiKey:d.envValue??void 0,devToolsVersion:t.version};if(a)return f.components=await Wp(t,f.components),f;let m=!1,C=u.sourceFile,I=Array.isArray(e)?e:typeof e=="string"?[e]:[];if(I.length>0){let B=I.map(Q=>{let b=c.find(D=>D.cmpInfo.id===Q);if(!b)throw new Error(`Component ${Q} not found`);return b}),E=Array.from(new Set(B.map(Q=>Q.cmpInfo.filePath))),y=await Dn(t,E);for(let Q of B){let b=f.components.find(x=>x.id===Q.cmpInfo.id),D=await zp(t,Q,y,t.registryPath===Q.cmpInfo.filePath||js(Q.cmpInfo.filePath));Ss(b,D);let F=g.findIndex(x=>x.id===Q.cmpInfo.id);g[F].inputs=D;let S=Ga(Q.cmpInfo.id,g,p,r,n,i,s);if(t.sdkVersion===it.gen2){let{elements:x,elmIndex:U,statementIndex:j,statement:H,variableDeclaration:P}=await kke(t,C,Q);if(S.addCmpToRegistry)x.push(Fke(t,S.addCmpToRegistry)),m=!0;else if(S.removeCmpFromRegistry)x.splice(U,1),m=!0;else if(S.updateRegisteredCmp){let G=wn(t,x[U],S.updateRegisteredCmp);x[U]=t.ts.factory.updateObjectLiteralExpression(G,[DY(t,S.updateRegisteredCmp),...G.properties.slice(1)]),m=!0}if(m&&o){let G=[...C.statements];G[j]=t.ts.factory.updateVariableStatement(H,H.modifiers,t.ts.factory.updateVariableDeclarationList(H.declarationList,[t.ts.factory.updateVariableDeclaration(P,P.name,P.exclamationToken,P.type,t.ts.factory.createArrayLiteralExpression(_a(t,x)))])),C=t.ts.factory.updateSourceFile(C,G),C=QY(t,S,C),C=Vt(t,C,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),C=Oa(t,C,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=S.components,p=S.components.filter($=>$.isRegistered)}}else{let x=[...C.statements];S.addCmpToRegistry?(x.push(nY(t,S.addCmpToRegistry)),m=!0):S.removeCmpFromRegistry?(x.splice(S.nodeIndex,1),m=!0):S.updateRegisteredCmp&&(x[S.nodeIndex]=hk(t,x[S.nodeIndex],S.updateRegisteredCmp),m=!0),m&&o&&(C=t.ts.factory.updateSourceFile(C,x),C=Vt(t,C,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),C=EY(t,C,l),C=QY(t,S,C),b?.acceptsChildren&&(C=Vt(t,C,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=S.components,p=S.components.filter(U=>U.isRegistered))}}}if(m&&o){C=Ua(t,C),C=La(t,C),t.appDir&&(C=CY(t,C));let B=Ln(t,C);B=Jo(B),t.appDir&&(B=mY(B)),B=await t.formatCode(t.registryPath,B),await t.writeFile(t.registryPath,B)}return f}function DY(t,e){let r=t.ts.factory.createIdentifier(e.importName);return t.appDir?t.ts.factory.createPropertyAssignment("component",r):t.ts.factory.createPropertyAssignment("component",Rke(t,e))}function xke(t){return t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())}function Fke(t,e){return wn(t,t.ts.factory.createObjectLiteralExpression([DY(t,e),...e.acceptsChildren?[xke(t)]:[]],!0),e)}async function kke(t,e,r){let n=hn(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await yk(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}function QY(t,e,r){if(t.appDir){let n=e.addCmpToRegistry||e.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:Yt(t,t.registryPath,n.filePath);n.exportType==="default"?r=Vt(t,r,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(r=Vt(t,r,{namedImports:[n.importName],importPath:i}))}}else r=Vt(t,r,{defaultImport:"dynamic",importPath:"next/dynamic"});return r}function Rke(t,e){let r=e.externalImportPath?e.externalImportPath:Yt(t,t.registryPath,e.filePath),n=e.exportName!=="default",i;n?i=t.ts.factory.createPropertyAccessExpression(t.ts.factory.createAwaitExpression(t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("import"),void 0,[t.ts.factory.createStringLiteral(r)])),t.ts.factory.createIdentifier(e.exportName)):i=t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("import"),void 0,[t.ts.factory.createStringLiteral(r)]);let s=t.ts.factory.createArrowFunction(n?[t.ts.factory.createModifier(t.ts.SyntaxKind.AsyncKeyword)]:void 0,void 0,[],void 0,t.ts.factory.createToken(t.ts.SyntaxKind.EqualsGreaterThanToken),i);return t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("dynamic"),void 0,[s])}var Qk=L(()=>{"use strict";h();_n();iY();qs();Ho();Jr();dY();St();$l();BY();su();Zp();ed();_i();vm();nu();ym();is();td();Bi()});async function bY(t){let e=[],r=await Lke(t,e);return await kY(t,e,r),t.appDir?(t.debug(`ensure builder setup for next.js app ${t.appDir}`),await Nke(t,t.appDir,e)):t.pagesDir&&(t.debug(`ensure builder setup for next.js pages ${t.pagesDir}`),await Mke(t,t.pagesDir,e)),e}async function SY(t){let e=[];return await kY(t,e),t.appDir?(t.debug(`ensure figma-imports setup for next.js app ${t.appDir}`),await Tke(t,t.appDir,e)):t.pagesDir&&(t.debug(`ensure figma-imports setup for next.js pages ${t.pagesDir}`),await Pke(t,t.pagesDir,e)),e}async function Tke(t,e,r){let n=`page.${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,"figma-imports",n);if(!await t.exists(i)){let s=await t.formatCode(i,xY({sys:t,routePath:i,modelName:"figma-imports"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(!await t.exists(t.builderComponentPath)){let s=await t.formatCode(t.builderComponentPath,vY(t));await t.writeFile(t.builderComponentPath,s),r.push({filePath:t.builderComponentPath,modifiedType:"create"})}}async function Nke(t,e,r){let n=`page.${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,"[...page]",n);if(!await t.exists(i)){let s=await t.formatCode(i,xY({sys:t,routePath:i,modelName:"page"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(!await t.exists(t.builderComponentPath)){let s=await t.formatCode(t.builderComponentPath,vY(t));await t.writeFile(t.builderComponentPath,s),r.push({filePath:t.builderComponentPath,modifiedType:"create"})}}function vY(t){let e=t.typescriptEnabled;return t.sdkVersion===it.gen2?`
|
|
106
|
+
${t}`),t}function CY(t,e){let r=e.statements.filter(n=>!(t.ts.isExpressionStatement(n)&&t.ts.isStringLiteral(n.expression)&&t.ts.isStringLiteral(n.expression)&&n.expression.text==="use client"));return t.ts.factory.updateSourceFile(e,r)}function _a(t,e){return e.sort((r,n)=>{if(t.ts.isObjectLiteralExpression(r)&&t.ts.isObjectLiteralExpression(n)){let i=hY(t,r),s=hY(t,n);return i.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())}return 1})}function hY(t,e){let r=e.properties.find(n=>cr(t,n)==="name");return r&&t.ts.isPropertyAssignment(r)&&t.ts.isStringLiteral(r.initializer)?r.initializer.text:"zzzz"}var $l=L(()=>{"use strict";h();Ma()});async function IY(t){let e=await t.readFile(t.registryPath);return e?Qke(t,e):{components:[],sourceFile:jt(t,"")}}async function Qke(t,e){let r=jt(t,e);return t.sdkVersion===nt.gen2?wke(t,r):Dke(t,r)}async function Dke(t,e){let r=[];for(let n=0;n<e.statements.length;n++){let i=e.statements[n];if(!t.ts.isExpressionStatement(i))continue;let s=i.expression;if(!t.ts.isCallExpression(s))continue;let o=s.expression;if(!t.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!t.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let u=c[1];if(!t.ts.isObjectLiteralExpression(u))continue;let l=c[0];if(t.ts.isCallExpression(l)){let d=t.ts.isIdentifier(l.expression)&&l.expression.text;if(d==="withChildren"){let p=Bk(t,l.arguments[0]);if(t.ts.isCallExpression(p)){let f=await Ik(t,n,p,u,!0);f&&r.push(f)}else{let f=p;if(t.ts.isIdentifier(f)){let m=await Ek(t,e,n,f,u,!0);m&&r.push(m)}}continue}if(d==="dynamic"){let p=await Ik(t,n,l,u,!1);p&&r.push(p);continue}let g=Bk(t,l.arguments[0]);if(t.ts.isCallExpression(g)&&t.ts.isIdentifier(g.expression)&&g.expression.text==="dynamic"){let p=await Ik(t,n,g,u,!1);p&&r.push(p);continue}if(t.ts.isIdentifier(g)){let p=await Ek(t,e,n,g,u,!1);p&&r.push(p);continue}continue}if(t.ts.isIdentifier(l)){let d=await Ek(t,e,n,l,u,!1);d&&r.push(d);continue}}return{sourceFile:e,components:ts(r)}}function Bk(t,e){return t.ts.isCallExpression(e)?(t.ts.isIdentifier(e.expression)&&e.expression.text)==="dynamic"?e:Bk(t,e.arguments[0]):e}async function Ik(t,e,r,n,i){let s={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:e,acceptsChildren:i,framework:"react"},o=r.arguments;if(o.length===0)return null;let a=o[0];if(!t.ts.isArrowFunction(a))return null;let A=a.body;if(t.ts.isCallExpression(A)){if(A.expression.kind!==t.ts.SyntaxKind.ImportKeyword||A.arguments.length!==1)return null;let u=A.arguments[0];if(!t.ts.isStringLiteral(u))return null;let l=u.text,d=await Xp(t,l);s.filePath=d,s.relFilePath=t.relative(t.getAppRootDir(),s.filePath),await t.exists(d)?s.importPath=Br(t,s.filePath):(s.externalImportPath=l,s.importPath=s.externalImportPath),s.name=Ys(t,s.filePath),s.importName="default",s.exportName="default",s.exportType="default"}else if(t.ts.isPropertyAccessExpression(A)){let c=A.expression;if(!t.ts.isParenthesizedExpression(c))return null;let u=c.expression;if(!t.ts.isAwaitExpression(u))return null;let l=u.expression;if(!t.ts.isCallExpression(l)||l.expression.kind!==t.ts.SyntaxKind.ImportKeyword||l.arguments.length!==1)return null;let g=l.arguments[0];if(!t.ts.isStringLiteral(g)||!t.ts.isIdentifier(A.name))return null;let p=g.text,f=await Xp(t,p);s.filePath=f,s.relFilePath=t.relative(t.getAppRootDir(),s.filePath),await t.exists(f)?s.importPath=Br(t,s.filePath):(s.externalImportPath=p,s.importPath=s.externalImportPath),s.name=Er(A.name.text),s.importName=A.name.text,s.exportName=A.name.text,s.exportType="named"}else return null;return s=ns(t,s,n),s.displayFilePath=ir(t,s.filePath),s.filePath&&s.exportName&&(s.id=await hr(t,s.filePath,s.exportName,s.externalImportPath)),s}async function Ek(t,e,r,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=e.statements.filter(c=>t.ts.isImportDeclaration(c)),A=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(A){let c=A.moduleSpecifier;if(!t.ts.isStringLiteral(c))return null;let u=await Xp(t,c.text);o.filePath=u,o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(u)?o.importPath=Br(t,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=Ys(t,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!t.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(g=>g.name.text===n.text));if(!c)return null;let u=c.moduleSpecifier;if(!t.ts.isStringLiteral(u))return null;let l=await Xp(t,u.text);o.filePath=l,o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(l)?o.importPath=Br(t,o.filePath):(o.externalImportPath=u.text,o.importPath=o.externalImportPath),o.name=Er(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=ns(t,o,i),o.displayFilePath=ir(t,o.filePath),o.filePath&&o.exportName&&(o.id=await hr(t,o.filePath,o.exportName,o.externalImportPath)),o}function Xp(t,e){return Sm(t,t.normalize(t.resolve(t.dirname(t.registryPath),e)))}function EY(t,e,r){let n=!1,i=0,s=[...e.statements];for(let c=0;c<s.length;c++){let u=s[c];if(t.ts.isImportDeclaration(u)){i=c;continue}if(!t.ts.isExpressionStatement(u))continue;let l=u.expression;if(!t.ts.isCallExpression(l))continue;let d=l.expression;if(!t.ts.isPropertyAccessExpression(d))continue;let g=d.expression;if(!t.ts.isIdentifier(g)||g.text!=="builder")continue;if(d.name.text=="init"){n=!0;break}else continue}if(n)return e;let o=t.ts.factory.createPropertyAccessExpression(t.ts.factory.createPropertyAccessExpression(t.ts.factory.createIdentifier("process"),t.ts.factory.createIdentifier("env")),t.ts.factory.createIdentifier(Na)),a=r?t.ts.factory.createNonNullExpression(o):o,A=t.ts.factory.createExpressionStatement(t.ts.factory.createCallExpression(t.ts.factory.createPropertyAccessExpression(t.ts.factory.createIdentifier("builder"),t.ts.factory.createIdentifier("init")),void 0,[a]));return s.splice(i+1,0,A),t.ts.factory.updateSourceFile(e,s)}async function wke(t,e){let r=[],n=hn(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await yk(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:ts(r)}}async function yk(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};Yp(t,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!t.ts.isPropertyAssignment(s)||!t.ts.isIdentifier(s.name))continue;if(cr(t,s)==="component"){let a,{initializer:A}=s;if(t.ts.isCallExpression(A)&&(t.ts.isIdentifier(A.expression)&&A.expression.text)==="dynamic"){let g=A.arguments;if(g.length===0)return null;let p=g[0];if(!t.ts.isArrowFunction(p))return null;let f=p.body;if(t.ts.isCallExpression(f)){if(f.expression.kind!==t.ts.SyntaxKind.ImportKeyword||f.arguments.length!==1)return null;let C=f.arguments[0];if(!t.ts.isStringLiteral(C))return null;let I=C.text,B=await Xp(t,I);n.filePath=B,n.relFilePath=t.relative(t.getAppRootDir(),n.filePath),await t.exists(B)?n.importPath=Br(t,n.filePath):(n.externalImportPath=I,n.importPath=n.externalImportPath),n.name=Ys(t,n.filePath),n.importName="default",n.exportName="default",n.exportType="default"}else if(t.ts.isPropertyAccessExpression(f)){let m=f.expression;if(!t.ts.isParenthesizedExpression(m))return null;let C=m.expression;if(!t.ts.isAwaitExpression(C))return null;let I=C.expression;if(!t.ts.isCallExpression(I)||I.expression.kind!==t.ts.SyntaxKind.ImportKeyword||I.arguments.length!==1)return null;let E=I.arguments[0];if(!t.ts.isStringLiteral(E)||!t.ts.isIdentifier(f.name))return null;let y=E.text,Q=await Xp(t,y);n.filePath=Q,n.relFilePath=t.relative(t.getAppRootDir(),n.filePath),await t.exists(Q)?n.importPath=Br(t,n.filePath):(n.externalImportPath=y,n.importPath=n.externalImportPath),n.name=Er(f.name.text),n.importName=f.name.text,n.exportName=f.name.text,n.exportType="named"}else return null;return n=ns(t,n,r),n.displayFilePath=ir(t,n.filePath),n.filePath&&n.exportName&&(n.id=await hr(t,n.filePath,n.exportName,n.externalImportPath)),n}if(t.ts.isIdentifier(A)&&(a=A.text),!a)continue;n.name===""&&(n.name=Er(a)),n.importName=a;let c=await Pa(t,t.registryPath,e,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await t.exists(c.filePath)?n.importPath=Br(t,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.importPath=Br(t,c.filePath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let u=e.statements.filter(d=>t.ts.isImportDeclaration(d)),l=u.find(d=>d.importClause&&d.importClause.name?.text===a);if(l){let d=l.moduleSpecifier;if(!t.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=u.find(p=>!p.importClause||!p.importClause.namedBindings||!t.ts.isNamedImports(p.importClause.namedBindings)?!1:p.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let g=d.moduleSpecifier;if(!t.ts.isStringLiteral(g))return null;n.exportName=a}continue}}return n=ns(t,n,r),n.filePath&&n.exportName&&(n.id=await hr(t,n.filePath,n.exportName,n.externalImportPath)),n}var BY=L(()=>{"use strict";h();_n();Jr();is();St();Ma();_i();ym()});function Ua(t,e){let r=[...e.statements],n=!1;for(let i=e.statements.length-1;i>=0;i--){let s=e.statements[i];if(t.ts.isImportDeclaration(s)&&s.importClause){let o=!1,a=s.importClause.namedBindings;if(a&&t.ts.isNamedImports(a)&&a.elements){let A=[...a.elements];for(let c=A.length-1;c>=0;c--){let u=A[c];if(t.ts.isImportSpecifier(u)){let l=u.name;if(l&&t.ts.isIdentifier(l)){let d=l.text;yY(t,e,d)||A.splice(c,1)}}}if(A.length===0)o=!0;else if(a.elements.length!==A.length){let c=t.ts.factory.updateImportClause(s.importClause,!1,s.importClause.name,t.ts.factory.createNamedImports(A)),u=t.ts.factory.updateImportDeclaration(s,void 0,c,s.moduleSpecifier,void 0);r[i]=u,n=!0}}else if(s.importClause.name&&t.ts.isIdentifier(s.importClause.name)){let A=s.importClause.name.text;yY(t,e,A)||(o=!0)}o&&(r.splice(i,1),n=!0)}}return n?t.ts.factory.updateSourceFile(e,r):e}function yY(t,e,r){let n=!1;function i(s){if(!t.ts.isImportDeclaration(s)){if(t.ts.isIdentifier(s)&&s.text===r){n=!0;return}t.ts.forEachChild(s,i)}}return t.ts.forEachChild(e,i),n}var Zp=L(()=>{"use strict";h()});function Ga(t,e,r,n,i,s,o){let a=null,A=null,c=null,u=-1;e=bs(e),r=bs(r);let l=e.find(g=>g.id===t),d=r.find(g=>g.id===t);if(n)d||(a={...bs(l),inputs:bs(l.inputs).map(g=>(g.isRegistered=!0,g))},u=r.length,r.push(a));else if(typeof d?.nodeIndex=="number"&&d.nodeIndex>-1){if(i)u=d.nodeIndex,A=bs(d),r=r.filter(g=>g.id!==t);else if(s!=null)bke(d,s),u=d.nodeIndex,c=d;else if(o!=null){let g=d.inputs.find(p=>p.name===o.name);g&&(o.registerInput===!1?g.isRegistered=!1:(Ske(g,o),g.isRegistered=!0),c=d,u=d.nodeIndex)}}return{addCmpToRegistry:a,removeCmpFromRegistry:A,updateRegisteredCmp:c,nodeIndex:u,components:jo(e,r)}}function jo(t,e){let r=ts([...e.map(n=>(n.isRegistered=!0,n)),...t.filter(n=>!e.some(i=>i.id===n.id)).map(n=>(n.isRegistered=!1,n))]);return r.forEach(n=>{n.inputs=n.inputs.map(fk),n.inputs.sort((o,a)=>o.name.toLowerCase().localeCompare(a.name.toLowerCase()));let i=e.find(o=>o.id===n.id);i&&(i.acceptsChildren=dk(n));let s=t.find(o=>o.id===n.id&&o.externalImportPath);s&&(n.filePath=s.filePath,n.relFilePath=s.relFilePath)}),r}function bke(t,e){Pi(e.name)?t.name=e.name:e.name===null&&(t.name=t.importName),Pi(e.description)?t.description=e.description:e.description===null&&delete t.description,Pi(e.image)?t.image=e.image:e.image===null&&delete t.image}function Ske(t,e){Pi(e.type)&&(t.type=e.type),Pi(e.friendlyName)?t.friendlyName=e.friendlyName:e.friendlyName===null&&delete t.friendlyName,Pi(e.defaultValue)||Cm(e.defaultValue)||Kp(e.defaultValue)?t.defaultValue=e.defaultValue:e.defaultValue===null&&delete t.defaultValue,Pi(e.helperText)?t.helperText=e.helperText:e.helperText===null&&delete t.helperText,e.required===!0?t.required=e.required:(e.required===null||e.required===!1)&&delete t.required}var ed=L(()=>{"use strict";h();St();_i()});async function ou(t){let e=new Set,r=async i=>{let s=await t.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=t.join(i,o),A=t.extname(o).toLowerCase();if(A===".tsx"||A===".jsx"||A===".ts"||A===".js"){e.add(a);return}(await t.stat(a)).isDirectory()&&await r(a)}))};return await r(t.getAppRootDir()),await Dn(t,[...e])}var vm=L(()=>{"use strict";h();qs()});function Oa(t,e,r){return $p(t,e,r.variableName)?e:vke(t,e,r)}function vke(t,e,r){let n=typeof r.arrayType=="string"?t.ts.factory.createArrayTypeNode(t.ts.factory.createTypeReferenceNode(r.arrayType,void 0)):void 0,i=t.ts.factory.createArrayLiteralExpression([]),s=t.ts.factory.createVariableDeclaration(r.variableName,void 0,n,i),o=t.ts.factory.createVariableDeclarationList([s],t.ts.NodeFlags.Const),a=t.ts.factory.createModifier(t.ts.SyntaxKind.ExportKeyword),A=t.ts.factory.createVariableStatement([a],o),c=[...e.statements,A];return t.ts.factory.updateSourceFile(e,c)}var td=L(()=>{"use strict";h();is()});async function Ka(t,e,r,n,i,s,o,a){let A=await ou(t),[c,u,l,d]=await Promise.all([pY(t,A),IY(t),Li(t),Bm(t)]),g=c.map(B=>B.cmpInfo),p=u.components,f={components:jo(g,p),registryPath:t.registryPath,registryDisplayPath:ir(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Ws(g),publicApiKey:d.envValue??void 0,devToolsVersion:t.version};if(a)return f.components=await Wp(t,f.components),f;let m=!1,C=u.sourceFile,I=Array.isArray(e)?e:typeof e=="string"?[e]:[];if(I.length>0){let B=I.map(Q=>{let b=c.find(D=>D.cmpInfo.id===Q);if(!b)throw new Error(`Component ${Q} not found`);return b}),E=Array.from(new Set(B.map(Q=>Q.cmpInfo.filePath))),y=await Dn(t,E);for(let Q of B){let b=f.components.find(x=>x.id===Q.cmpInfo.id),D=await zp(t,Q,y,t.registryPath===Q.cmpInfo.filePath||js(Q.cmpInfo.filePath));Ss(b,D);let F=g.findIndex(x=>x.id===Q.cmpInfo.id);g[F].inputs=D;let S=Ga(Q.cmpInfo.id,g,p,r,n,i,s);if(t.sdkVersion===nt.gen2){let{elements:x,elmIndex:U,statementIndex:j,statement:H,variableDeclaration:P}=await kke(t,C,Q);if(S.addCmpToRegistry)x.push(Fke(t,S.addCmpToRegistry)),m=!0;else if(S.removeCmpFromRegistry)x.splice(U,1),m=!0;else if(S.updateRegisteredCmp){let G=wn(t,x[U],S.updateRegisteredCmp);x[U]=t.ts.factory.updateObjectLiteralExpression(G,[DY(t,S.updateRegisteredCmp),...G.properties.slice(1)]),m=!0}if(m&&o){let G=[...C.statements];G[j]=t.ts.factory.updateVariableStatement(H,H.modifiers,t.ts.factory.updateVariableDeclarationList(H.declarationList,[t.ts.factory.updateVariableDeclaration(P,P.name,P.exclamationToken,P.type,t.ts.factory.createArrayLiteralExpression(_a(t,x)))])),C=t.ts.factory.updateSourceFile(C,G),C=QY(t,S,C),C=Vt(t,C,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),C=Oa(t,C,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=S.components,p=S.components.filter($=>$.isRegistered)}}else{let x=[...C.statements];S.addCmpToRegistry?(x.push(nY(t,S.addCmpToRegistry)),m=!0):S.removeCmpFromRegistry?(x.splice(S.nodeIndex,1),m=!0):S.updateRegisteredCmp&&(x[S.nodeIndex]=hk(t,x[S.nodeIndex],S.updateRegisteredCmp),m=!0),m&&o&&(C=t.ts.factory.updateSourceFile(C,x),C=Vt(t,C,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),C=EY(t,C,l),C=QY(t,S,C),b?.acceptsChildren&&(C=Vt(t,C,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=S.components,p=S.components.filter(U=>U.isRegistered))}}}if(m&&o){C=Ua(t,C),C=La(t,C),t.appDir&&(C=CY(t,C));let B=Ln(t,C);B=Jo(B),t.appDir&&(B=mY(B)),B=await t.formatCode(t.registryPath,B),await t.writeFile(t.registryPath,B)}return f}function DY(t,e){let r=t.ts.factory.createIdentifier(e.importName);return t.appDir?t.ts.factory.createPropertyAssignment("component",r):t.ts.factory.createPropertyAssignment("component",Rke(t,e))}function xke(t){return t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())}function Fke(t,e){return wn(t,t.ts.factory.createObjectLiteralExpression([DY(t,e),...e.acceptsChildren?[xke(t)]:[]],!0),e)}async function kke(t,e,r){let n=hn(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await yk(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}function QY(t,e,r){if(t.appDir){let n=e.addCmpToRegistry||e.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:Yt(t,t.registryPath,n.filePath);n.exportType==="default"?r=Vt(t,r,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(r=Vt(t,r,{namedImports:[n.importName],importPath:i}))}}else r=Vt(t,r,{defaultImport:"dynamic",importPath:"next/dynamic"});return r}function Rke(t,e){let r=e.externalImportPath?e.externalImportPath:Yt(t,t.registryPath,e.filePath),n=e.exportName!=="default",i;n?i=t.ts.factory.createPropertyAccessExpression(t.ts.factory.createAwaitExpression(t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("import"),void 0,[t.ts.factory.createStringLiteral(r)])),t.ts.factory.createIdentifier(e.exportName)):i=t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("import"),void 0,[t.ts.factory.createStringLiteral(r)]);let s=t.ts.factory.createArrowFunction(n?[t.ts.factory.createModifier(t.ts.SyntaxKind.AsyncKeyword)]:void 0,void 0,[],void 0,t.ts.factory.createToken(t.ts.SyntaxKind.EqualsGreaterThanToken),i);return t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("dynamic"),void 0,[s])}var Qk=L(()=>{"use strict";h();_n();iY();qs();Ho();Jr();dY();St();$l();BY();su();Zp();ed();_i();vm();nu();ym();is();td();Bi()});async function bY(t){let e=[],r=await Lke(t,e);return await kY(t,e,r),t.appDir?(t.debug(`ensure builder setup for next.js app ${t.appDir}`),await Nke(t,t.appDir,e)):t.pagesDir&&(t.debug(`ensure builder setup for next.js pages ${t.pagesDir}`),await Mke(t,t.pagesDir,e)),e}async function SY(t){let e=[];return await kY(t,e),t.appDir?(t.debug(`ensure figma-imports setup for next.js app ${t.appDir}`),await Tke(t,t.appDir,e)):t.pagesDir&&(t.debug(`ensure figma-imports setup for next.js pages ${t.pagesDir}`),await Pke(t,t.pagesDir,e)),e}async function Tke(t,e,r){let n=`page.${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,"figma-imports",n);if(!await t.exists(i)){let s=await t.formatCode(i,xY({sys:t,routePath:i,modelName:"figma-imports"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(!await t.exists(t.builderComponentPath)){let s=await t.formatCode(t.builderComponentPath,vY(t));await t.writeFile(t.builderComponentPath,s),r.push({filePath:t.builderComponentPath,modifiedType:"create"})}}async function Nke(t,e,r){let n=`page.${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,"[...page]",n);if(!await t.exists(i)){let s=await t.formatCode(i,xY({sys:t,routePath:i,modelName:"page"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(!await t.exists(t.builderComponentPath)){let s=await t.formatCode(t.builderComponentPath,vY(t));await t.writeFile(t.builderComponentPath,s),r.push({filePath:t.builderComponentPath,modifiedType:"create"})}}function vY(t){let e=t.typescriptEnabled;return t.sdkVersion===nt.gen2?`
|
|
107
107
|
"use client";
|
|
108
108
|
import { ${e?"BuilderContent, ":""} isPreviewing, Content } from "@builder.io/sdk-react";
|
|
109
109
|
import DefaultErrorPage from "next/error";
|
|
@@ -172,7 +172,7 @@ interface PageProps {
|
|
|
172
172
|
params: {
|
|
173
173
|
page: string[];
|
|
174
174
|
};
|
|
175
|
-
}`}function xY({sys:t,routePath:e,modelName:r}){let n=t.typescriptEnabled,i=Yt(t,e,t.builderComponentPath);return t.sdkVersion===
|
|
175
|
+
}`}function xY({sys:t,routePath:e,modelName:r}){let n=t.typescriptEnabled,i=Yt(t,e,t.builderComponentPath);return t.sdkVersion===nt.gen2?`
|
|
176
176
|
import { fetchOneEntry } from "@builder.io/sdk-react";
|
|
177
177
|
import { RenderBuilderContent } from ${JSON.stringify(i)};
|
|
178
178
|
|
|
@@ -230,7 +230,7 @@ export default async function Page(props${n?": PageProps":""}) {
|
|
|
230
230
|
</>
|
|
231
231
|
);
|
|
232
232
|
}
|
|
233
|
-
`.trimStart()}async function Mke(t,e,r){let n=`[...page].${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,n);if(!await t.exists(i)){let s=await t.formatCode(i,FY({sys:t,routePath:i,modelName:"page"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}}async function Pke(t,e,r){let n=`figma-imports.${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,n);if(!await t.exists(i)){let s=await t.formatCode(i,FY({sys:t,routePath:i,modelName:"figma-imports"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}}function FY({sys:t,routePath:e,modelName:r}){let n=t.typescriptEnabled;return t.sdkVersion===
|
|
233
|
+
`.trimStart()}async function Mke(t,e,r){let n=`[...page].${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,n);if(!await t.exists(i)){let s=await t.formatCode(i,FY({sys:t,routePath:i,modelName:"page"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}}async function Pke(t,e,r){let n=`figma-imports.${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,n);if(!await t.exists(i)){let s=await t.formatCode(i,FY({sys:t,routePath:i,modelName:"figma-imports"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}}function FY({sys:t,routePath:e,modelName:r}){let n=t.typescriptEnabled;return t.sdkVersion===nt.gen2?`
|
|
234
234
|
import React from "react";
|
|
235
235
|
import { useRouter } from "next/router";
|
|
236
236
|
${n?'import type { BuilderContent } from "@builder.io/sdk-react";':""}
|
|
@@ -457,18 +457,18 @@ export default Counter;
|
|
|
457
457
|
font-size: 42px;
|
|
458
458
|
text-align: center;
|
|
459
459
|
}
|
|
460
|
-
`.trimStart();return{component:r,styles:n}}async function kY(t,e,r){if(!await t.exists(t.registryPath)){if(t.sdkVersion===
|
|
460
|
+
`.trimStart();return{component:r,styles:n}}async function kY(t,e,r){if(!await t.exists(t.registryPath)){if(t.sdkVersion===nt.gen2){let s=Uke(t);await t.writeFile(t.registryPath,s)}else await t.writeFile(t.registryPath,"");e.push({filePath:t.registryPath,modifiedType:"create"})}if(!r)return;let i=(await Ka(t,null,!1,!1,null,null,!1,!1)).components.find(s=>s.filePath===r);i&&await Ka(t,i.id,!0,!1,null,null,!0,!1)}function Uke(t){return t.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-react";
|
|
461
461
|
|
|
462
462
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
463
463
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
464
464
|
];
|
|
465
|
-
`}var RY=L(()=>{"use strict";h();_n();St();ym();Qk()});async function rd(t){let e=await Ko(t,t.getRepoRootDir());if(e&&typeof e=="object"){let r=new Set(Object.keys({...e.dependencies,...e.devDependencies}));if(r.has("@builder.io/sdk-react"))return
|
|
465
|
+
`}var RY=L(()=>{"use strict";h();_n();St();ym();Qk()});async function rd(t){let e=await Ko(t,t.getRepoRootDir());if(e&&typeof e=="object"){let r=new Set(Object.keys({...e.dependencies,...e.devDependencies}));if(r.has("@builder.io/sdk-react"))return nt.gen2;if(r.has("@builder.io/react"))return nt.gen1}return null}var By=L(()=>{"use strict";h();_n();Bi()});async function TY(t){let e=await Gke(t);return{builderPageOptions:async()=>({templateContentId:"3de2f13211234071a4b19a17b4fbc5a7",pathname:"/builder-demo",title:"Builder + Next.js Demo Page"}),ensureBuilderSetup:()=>bY(e),ensureFigmaImportPage:()=>SY(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Ka(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Ka(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Ka(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Ka(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Ka(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Ka(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Bm(e),setPublicApiKey:n=>zj(e,n.publicApiKey),getDependencies:n=>n.sdkVersion===nt.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>$s(e),setCache:n=>Vs(e,n)}}async function Gke(t){let e=t.getAppRootDir(),r=t.join(e,"src"),n=await Oke(t),i=await Li(t),s=t.getFrameworks().find(c=>c.name==="next"),o={asyncParams:s?.version?.major!==void 0&&s.version.major>=15},a={},A={...t,addExternalPackage:c=>{a[t.join(e,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>a[c]??t.readFileSync(c),existsSync:c=>!!a[c]||t.existsSync(c),readdirSync:c=>{let u=t.readdirSync(c);return c===e?[...u,...Object.keys(a).map(l=>l.slice(e.length+1))]:u},readdir:async c=>{let u=await t.readdir(c);return c===e?[...u,...Object.keys(a).map(l=>l.slice(e.length+1))]:u},appDir:null,pagesDir:null,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",nextConfigPath:n,typescriptEnabled:i,features:o};if(t.sdkVersion?A.sdkVersion=t.sdkVersion:A.sdkVersion=await rd(A),await t.exists(r)){A.srcDir=r,A.componentsDir=t.join(r,"components");let c=t.join(r,"app");await t.exists(c)&&(A.appDir=c);let u=t.join(r,"pages");await t.exists(u)&&(A.pagesDir=u),A.registryPath=await rs(t,r)}else A.componentsDir=t.join(e,"components"),A.registryPath=await rs(t,e);if(A.builderComponentPath=t.join(A.componentsDir,`builder.${i?"tsx":"jsx"}`),!A.appDir){let c=t.join(e,"app");await t.exists(c)&&(A.appDir=c)}if(!A.pagesDir){let c=t.join(e,"pages");await t.exists(c)&&(A.pagesDir=c)}if(!A.appDir&&!A.pagesDir&&!t.ignoreMissingConfig)throw new Error(`Could not find Next.js "app" or "pages" directory. Searched in "${e}".`);return A}async function Oke(t){let e=t.join(t.getAppRootDir(),"next.config.ts");if(await t.exists(e))return e;let r=t.join(t.getAppRootDir(),"next.config.mjs");if(await t.exists(r))return r;let n=t.join(t.getAppRootDir(),"next.config.js");if(await t.exists(n))return n;throw new Error(`Could not find Next.js config file. Searched for "next.config.ts", "next.config.mjs" and "next.config.js" in "${t.getAppRootDir()}".`)}var NY=L(()=>{"use strict";h();Jl();ym();Qk();RY();_n();By();Bi()});async function xm(t){return await Ra(t,[".env"],PY)}async function MY(t,e){Kke(e);let r=await xm(t),n=await Ta(t,r.file,r.envKey,e);return{...r,modifiedType:n}}function Kke(t){typeof process<"u"&&(process.env[PY]=t)}var PY,Dk=L(()=>{"use strict";h();jl();PY="PUBLIC_BUILDER_API_KEY"});function LY(t,e,r){if(r.length===0)return t;let n=t.split(`
|
|
466
466
|
`),i=n.findIndex(a=>a.includes(r));if(i===-1||n.some(a=>a.includes(e[0])))return t;let o=["/**",...e.map(a=>` * ${a.trim()}`)," */"];return n.splice(i,0,...o),n.join(`
|
|
467
467
|
`)}var _Y=L(()=>{"use strict";h()});async function GY(t,e){let r=[],n=e.getSourceFiles(),i=e.getTypeChecker();return await Promise.all(n.map(async s=>{let o=t.basename(s.fileName);if(o.startsWith(".")||jke.has(o))return;let a=t.normalize(s.fileName);if(a===t.registryPath)return;let A=await yy(t,i,a,s);r.push(...A)})),r}async function OY(t,e){if(t.extname(e).toLowerCase()===".tsx"){let n=await t.readFile(e);if(n)return Hke(t,e,n)}return null}function Hke(t,e,r){let n=jt(t,r);return yy(t,null,e,n)}async function yy(t,e,r,n){r=t.normalize(r);let i=[],s=ql(t,n);return await Promise.all(s.map(async o=>{let a=await Jke(t,e,r,o);a&&i.push(a)})),i}async function Jke(t,e,r,n){let i=t.relative(t.getAppRootDir(),r),s=Br(t,r);if(t.ts.isVariableStatement(n.node))for(let o of n.node.declarationList.declarations){let a=UY(t,o.initializer);if(a&&t.ts.isIdentifier(o.name)){let A=o.name.text;return{cmpInfo:{id:await hr(t,r,A),displayFilePath:ir(t,r),name:Er(A),inputs:[],exportName:n.isDefaultExport?"default":A,exportType:n.isDefaultExport?"default":"named",importName:A,filePath:r,relFilePath:i,importPath:s,framework:"qwik"},node:a}}}else if(t.ts.isCallExpression(n.node)){let o=UY(t,n.node);if(o)return{cmpInfo:{id:await hr(t,r,"default"),displayFilePath:ir(t,r),name:Ys(t,r),inputs:[],exportName:"default",exportType:"default",importName:Ol(t,r),filePath:r,relFilePath:i,importPath:s,framework:"qwik"},node:o}}return null}function UY(t,e){if(e&&t.ts.isCallExpression(e)&&t.ts.isIdentifier(e.expression)&&e.expression.text==="component$"&&e.arguments.length>0){let r=e.arguments[0];if(t.ts.isArrowFunction(r)||t.ts.isFunctionExpression(r))return{callExpression:e,fnNode:r}}return null}var jke,Qy=L(()=>{"use strict";h();Jr();St();qp();jke=new Set(["node_modules","layout.tsx","404.tsx","router-head.tsx"])});async function KY(t,e){let r=e.node.fnNode;if((t.ts.isArrowFunction(r)||t.ts.isFunctionExpression(r))&&r.parameters.length>0){let{sourceFile:i,typeChecker:s}=await Jp(t,e.cmpInfo.filePath,null);if(!(await yy(t,s,e.cmpInfo.filePath,i)).find(A=>A.cmpInfo.id===e.cmpInfo.id))throw new Error(`createComponentInputs() Could not find component ${e.cmpInfo.name} in ${e.cmpInfo.filePath}`);return Yl(t,s,r)}return[]}var HY=L(()=>{"use strict";h();Qy();qs();bm()});async function JY(t){return wk(t)}async function wk(t){let e=[];return await t.exists(t.registryPath)||(await t.writeFile(t.registryPath,Yke),e.push({filePath:t.registryPath,modifiedType:"create"})),e}var Yke,bk=L(()=>{"use strict";h();Yke=`import type { RegisteredComponent } from "@builder.io/sdk-qwik";
|
|
468
468
|
|
|
469
469
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
470
470
|
];
|
|
471
|
-
`});async function jY(t){await wk(t);let e=await t.readFile(t.registryPath);return e?qke(t,e):{components:[],sourceFile:jt(t,"")}}async function qke(t,e){let r=jt(t,e);return $ke(t,r)}async function $ke(t,e){let r=[],n=hn(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await Sk(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:ts(r)}}async function Sk(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"qwik"};for(let i of r.properties){if(!t.ts.isPropertyAssignment(i)||!t.ts.isIdentifier(i.name))continue;if(cr(t,i)==="component"&&t.ts.isIdentifier(i.initializer)){let o=i.initializer.text;n.name===""&&(n.name=Er(o)),n.importName=o;let a=await Pa(t,t.registryPath,e,o);if(!a)continue;n.filePath=a.filePath,n.relFilePath=a.relFilePath,n.importPath=Br(t,a.filePath),n.displayFilePath=a.displayFilePath,n.exportType=a.exportType;let A=await OY(t,a.filePath);if(A&&A.length>0)if(A.length===1)n.exportName=A[0].cmpInfo.exportName;else{let c=A.find(u=>u.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}continue}}return n=ns(t,n,r),n.filePath&&n.exportName&&(n.id=await hr(t,n.filePath,n.exportName)),n}var vk=L(()=>{"use strict";h();Jr();is();St();Qy();Ma();_i();bk()});async function YY(t){let e=new Set,r=async i=>{let s=await t.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=t.join(i,o),A=t.extname(o).toLowerCase();if(A===".tsx"||A===".ts"){e.add(a);return}(await t.stat(a)).isDirectory()&&await r(a)}))};return await r(t.getAppRootDir()),await Dn(t,[...e])}var qY=L(()=>{"use strict";h();qs()});async function Vl(t,e,r,n,i,s,o,a){let A=await YY(t),[c,u,l]=await Promise.all([GY(t,A),jY(t),xm(t)]),d=c.map(f=>f.cmpInfo),g=u.components,p={components:jo(d,g),registryPath:t.registryPath,registryDisplayPath:ir(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Ws(d),publicApiKey:l.envValue??void 0,devToolsVersion:t.version};if(a)return p;if(e!=null){let f=c.find(S=>S.cmpInfo.id===e);if(!f)throw new Error(`Component ${e} not found`);let m=u.sourceFile,C=p.components.find(S=>S.id===e),I=await KY(t,f);Ss(C,I),e=Array.isArray(e)?e[0]:e;let B=Ga(e,d,g,r,n,i,s),{elements:E,elmIndex:y,statementIndex:Q,statement:b,variableDeclaration:D}=await Wke(t,m,f),F=!1;if(B.addCmpToRegistry?(E.push(Vke(t,B.addCmpToRegistry)),F=!0):B.removeCmpFromRegistry?(E.splice(y,1),F=!0):B.updateRegisteredCmp&&(E[y]=wn(t,E[y],B.updateRegisteredCmp),F=!0),F&&o){let S=[...m.statements];S[Q]=t.ts.factory.updateVariableStatement(b,b.modifiers,t.ts.factory.updateVariableDeclarationList(b.declarationList,[t.ts.factory.updateVariableDeclaration(D,D.name,D.exclamationToken,D.type,t.ts.factory.createArrayLiteralExpression(_a(t,E)))])),m=t.ts.factory.updateSourceFile(m,S),C.exportType==="named"?m=Vt(t,m,{namedImports:[C.importName],importPath:Yt(t,t.registryPath,C.filePath)}):m=Vt(t,m,{defaultImport:C.importName,importPath:Yt(t,t.registryPath,C.filePath)}),m=Vt(t,m,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),m=Oa(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m=Ua(t,m),m=La(t,m);let x=Ln(t,m);x=Jo(x),x=LY(x,zke,"CUSTOM_COMPONENTS"),x=await t.formatCode(t.registryPath,x),await t.writeFile(t.registryPath,x)}p.components=B.components}return p}function Vke(t,e){return wn(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("component",t.ts.factory.createIdentifier(e.importName))],!0),e)}async function Wke(t,e,r){let n=hn(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await Sk(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var zke,$Y=L(()=>{"use strict";h();_Y();Ho();td();is();St();Qy();ed();$l();HY();vk();vk();Zp();Jr();_i();qY();nu();Dk();zke=["This array is used to integrate custom components within Builder.","https://www.builder.io/c/docs/custom-components-intro","",'These components will be found the "Custom Components"',"section of Builder's visual editor.",'You can also turn on "components only mode" to limit',"editing to only these components.","https://www.builder.io/c/docs/guides/components-only-mode"]});async function VY(t){let e=await Xke(t);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>JY(e),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>e.registryPath,getRegistry:n=>Vl(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{},loadComponent:async n=>{let i=await Vl(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Vl(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Vl(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Vl(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Vl(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>xm(e),setPublicApiKey:n=>MY(e,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>$s(e),setCache:n=>Vs(e,n)}}async function Xke(t){let e=await Im(t,t.getAppRootDir(),"components");if(!e)throw new Error(`Could not find components directory within project: ${t.getAppRootDir()}`);let r=await rs(t,e),n=t.join(t.getAppRootDir(),".env");return{...t,componentsDir:e,registryPath:r,envPath:n}}var WY=L(()=>{"use strict";h();Jl();Dk();$Y();bk();Bi()});async function Fm(t){return await Ra(t,[".env"],km)}async function zY(t,e){let r=await Fm(t),n=await Ta(t,r.file,r.envKey,e);return{...r,modifiedType:n}}var km,Dy=L(()=>{"use strict";h();jl();km="PUBLIC_BUILDER_KEY"});async function XY(t,e){let r=[],n=e.getSourceFiles(),i=e.getTypeChecker(),s=t.join(t.getAppRootDir(),"build");return await Promise.all(n.map(async o=>{let a=t.basename(o.fileName);if(a.startsWith(".")||a==="node_modules"||my(t,Zke,o.fileName)||eRe.has(a)||a.includes("$."))return;let A=t.normalize(o.fileName);if(A===t.remixConfigPath||A===s)return;let c=await iu(t,i,A,o,A===t.registryPath);r.push(...c)})),r}var Zke,eRe,ZY=L(()=>{"use strict";h();su();St();Zke=new Set(["dist","node_modules"]);eRe=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"])});async function e9(t){await wy(t);let e=await t.readFile(t.registryPath);return e?tRe(t,e):{components:[],sourceFile:jt(t,"")}}async function tRe(t,e){let r=jt(t,e);return rRe(t,r)}async function rRe(t,e){let r=[],n=hn(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await xk(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:ts(r)}}async function xk(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};t.sdkVersion===it.gen2&&Yp(t,r)&&(n.acceptsChildren=!0);for(let i of r.properties){if(!t.ts.isPropertyAssignment(i)||!t.ts.isIdentifier(i.name))continue;if(cr(t,i)==="component"){let o,{initializer:a}=i;if(t.ts.isIdentifier(a))o=a.text;else if(t.ts.isCallExpression(a)){(t.ts.isIdentifier(a.expression)&&a.expression.text)==="withChildren"&&(n.acceptsChildren=!0);let u=a.arguments[0];t.ts.isIdentifier(u)&&(o=u.text)}if(!o)continue;n.name===""&&(n.name=Er(o)),n.importName=o;let A=await Pa(t,t.registryPath,e,o);if(!A)continue;if(n.filePath=A.filePath,n.relFilePath=A.relFilePath,await t.exists(A.filePath)?n.importPath=Br(t,A.filePath):(n.externalImportPath=A.importPath,n.importPath=n.externalImportPath),n.displayFilePath=A.displayFilePath,n.exportType=A.exportType,n.externalImportPath)n.exportName=o;else{let c=await uY(t,A.filePath,t.registryPath===A.filePath||js(A.filePath));if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let u=c.find(l=>l.cmpInfo.exportName===o);u&&(n.exportName=u.cmpInfo.exportName)}}continue}}return n=ns(t,n,r),n.filePath&&n.exportName&&(n.id=await hr(t,n.filePath,n.exportName,n.externalImportPath)),n}var t9=L(()=>{"use strict";h();_n();Jr();is();St();Ma();_i();Fk();su()});async function Ha(t,e,r,n,i,s,o,a){let A=await ou(t),[c,u,l]=await Promise.all([XY(t,A),e9(t),Fm(t)]),d=c.map(I=>I.cmpInfo),g=u.components,p={components:jo(d,g),registryPath:t.registryPath,registryDisplayPath:ir(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Ws(d),publicApiKey:l.envValue??void 0,devToolsVersion:t.version};if(a)return p.components=await Wp(t,p.components),p;let f=!1,m=u.sourceFile,C=Array.isArray(e)?e:typeof e=="string"?[e]:[];if(C.length>0){let I=C.map(y=>{let Q=c.find(b=>b.cmpInfo.id===y);if(!Q)throw new Error(`Component ${y} not found`);return Q}),B=Array.from(new Set(I.map(y=>y.cmpInfo.filePath))),E=await Dn(t,B);for(let y of I){let Q=p.components.find(P=>P.id===y.cmpInfo.id),b=await zp(t,y,E,t.registryPath===y.cmpInfo.filePath||js(y.cmpInfo.filePath));Ss(Q,b);let D=d.findIndex(P=>P.id===y.cmpInfo.id);d[D].inputs=b;let F=Ga(y.cmpInfo.id,d,g,r,n,i,s),{elements:S,elmIndex:x,statementIndex:U,statement:j,variableDeclaration:H}=await iRe(t,m,y);if(F.addCmpToRegistry)S.push(nRe(t,F.addCmpToRegistry)),f=!0;else if(F.removeCmpFromRegistry)S.splice(x,1),f=!0;else if(F.updateRegisteredCmp){let P=wn(t,S[x],F.updateRegisteredCmp);S[x]=t.ts.factory.updateObjectLiteralExpression(P,[r9(t,F.updateRegisteredCmp),...P.properties.slice(1)]),f=!0}if(f&&o){let P=[...m.statements];P[U]=t.ts.factory.updateVariableStatement(j,j.modifiers,t.ts.factory.updateVariableDeclarationList(j.declarationList,[t.ts.factory.updateVariableDeclaration(H,H.name,H.exclamationToken,H.type,t.ts.factory.createArrayLiteralExpression(_a(t,S)))])),m=t.ts.factory.updateSourceFile(m,P),Q.exportType==="named"?m=Vt(t,m,{namedImports:[Q.importName],importPath:Q.externalImportPath?Q.externalImportPath:Yt(t,t.registryPath,Q.filePath)}):m=Vt(t,m,{defaultImport:Q.importName,importPath:Q.externalImportPath?Q.externalImportPath:Yt(t,t.registryPath,Q.filePath)});let G=t.sdkVersion===it.gen2?"@builder.io/sdk-react":"@builder.io/react";m=Vt(t,m,{namedImports:["RegisteredComponent"],importPath:G,isTypeOnly:!0}),Q.acceptsChildren&&t.sdkVersion!==it.gen2&&(m=Vt(t,m,{namedImports:["withChildren"],importPath:"@builder.io/react"})),m=Oa(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),p.components=F.components,g=F.components.filter($=>$.isRegistered)}}}if(f&&o){m=Ua(t,m),m=La(t,m);let I=Ln(t,m);I=Jo(I),I=await t.formatCode(t.registryPath,I),await t.writeFile(t.registryPath,I)}return p}function r9(t,e){if(t.sdkVersion===it.gen2)return t.ts.factory.createPropertyAssignment("component",t.ts.factory.createIdentifier(e.importName));let r=t.ts.factory.createIdentifier(e.importName),n=e.acceptsChildren?t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("withChildren"),void 0,[r]):r;return t.ts.factory.createPropertyAssignment("component",n)}function nRe(t,e){return wn(t,t.ts.factory.createObjectLiteralExpression([r9(t,e),...e.acceptsChildren&&t.sdkVersion===it.gen2?[t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())]:[]],!0),e)}async function iRe(t,e,r){let n=hn(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await xk(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var kk=L(()=>{"use strict";h();_n();qs();Ho();Jr();ZY();St();$l();t9();Zp();ed();_i();su();is();td();vm();nu();Dy()});async function n9(t){let e=[],r=await aRe(t,e);return e.push(...await wy(t)),await cRe(t,r),await oRe(t,e),e}async function i9(t){let e=[];return e.push(...await wy(t)),await sRe(t,e),e}async function sRe(t,e){let r=`figma-imports.${t.typescriptEnabled?"tsx":"jsx"}`;t.hasLocaleParam&&(t.debug("remixEnsureFigmaImportRoute, hasLocaleParam"),r=`($locale).${r}`);let n=t.join(t.routesDir,r),i=await t.exists(n);t.debug(`remixEnsureFigmaImportRoute, hasRoute: ${i}`);let s=await t.formatCode(n,s9({sys:t,routePath:n,modelName:"figma-imports"}));await t.writeFile(n,s),e.push({filePath:n,modifiedType:i?"update":"create"})}async function oRe(t,e){let r=`$.${t.typescriptEnabled?"tsx":"jsx"}`;t.hasLocaleParam&&(t.debug("remixEnsureAppRoute, hasLocaleParam"),r=`($locale).${r}`),t.sdkVersion===it.gen2&&(r=`($slug)._index.${t.typescriptEnabled?"tsx":"jsx"}`);let n=t.join(t.routesDir,r),i=await t.exists(n);t.debug(`remixEnsureAppRoute, hasRoute: ${i}`);let s=await t.formatCode(n,s9({sys:t,routePath:n,modelName:"page"}));await t.writeFile(n,s),e.push({filePath:n,modifiedType:i?"update":"create"})}function s9({sys:t,routePath:e,modelName:r}){let n=t.typescriptEnabled,i=Yt(t,e,t.registryPath),s="",o="";n&&(s="import type { LoaderArgs } from '@remix-run/server-runtime';",o=": LoaderArgs");let a=`process.env.${km}`,A="";return t.getFrameworks().some(c=>c.name==="@shopify/remix-oxygen")&&(a=`context.env.${km}`,A=", context"),n&&(a+="!"),t.sdkVersion===it.gen2?`
|
|
471
|
+
`});async function jY(t){await wk(t);let e=await t.readFile(t.registryPath);return e?qke(t,e):{components:[],sourceFile:jt(t,"")}}async function qke(t,e){let r=jt(t,e);return $ke(t,r)}async function $ke(t,e){let r=[],n=hn(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await Sk(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:ts(r)}}async function Sk(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"qwik"};for(let i of r.properties){if(!t.ts.isPropertyAssignment(i)||!t.ts.isIdentifier(i.name))continue;if(cr(t,i)==="component"&&t.ts.isIdentifier(i.initializer)){let o=i.initializer.text;n.name===""&&(n.name=Er(o)),n.importName=o;let a=await Pa(t,t.registryPath,e,o);if(!a)continue;n.filePath=a.filePath,n.relFilePath=a.relFilePath,n.importPath=Br(t,a.filePath),n.displayFilePath=a.displayFilePath,n.exportType=a.exportType;let A=await OY(t,a.filePath);if(A&&A.length>0)if(A.length===1)n.exportName=A[0].cmpInfo.exportName;else{let c=A.find(u=>u.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}continue}}return n=ns(t,n,r),n.filePath&&n.exportName&&(n.id=await hr(t,n.filePath,n.exportName)),n}var vk=L(()=>{"use strict";h();Jr();is();St();Qy();Ma();_i();bk()});async function YY(t){let e=new Set,r=async i=>{let s=await t.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=t.join(i,o),A=t.extname(o).toLowerCase();if(A===".tsx"||A===".ts"){e.add(a);return}(await t.stat(a)).isDirectory()&&await r(a)}))};return await r(t.getAppRootDir()),await Dn(t,[...e])}var qY=L(()=>{"use strict";h();qs()});async function Vl(t,e,r,n,i,s,o,a){let A=await YY(t),[c,u,l]=await Promise.all([GY(t,A),jY(t),xm(t)]),d=c.map(f=>f.cmpInfo),g=u.components,p={components:jo(d,g),registryPath:t.registryPath,registryDisplayPath:ir(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Ws(d),publicApiKey:l.envValue??void 0,devToolsVersion:t.version};if(a)return p;if(e!=null){let f=c.find(S=>S.cmpInfo.id===e);if(!f)throw new Error(`Component ${e} not found`);let m=u.sourceFile,C=p.components.find(S=>S.id===e),I=await KY(t,f);Ss(C,I),e=Array.isArray(e)?e[0]:e;let B=Ga(e,d,g,r,n,i,s),{elements:E,elmIndex:y,statementIndex:Q,statement:b,variableDeclaration:D}=await Wke(t,m,f),F=!1;if(B.addCmpToRegistry?(E.push(Vke(t,B.addCmpToRegistry)),F=!0):B.removeCmpFromRegistry?(E.splice(y,1),F=!0):B.updateRegisteredCmp&&(E[y]=wn(t,E[y],B.updateRegisteredCmp),F=!0),F&&o){let S=[...m.statements];S[Q]=t.ts.factory.updateVariableStatement(b,b.modifiers,t.ts.factory.updateVariableDeclarationList(b.declarationList,[t.ts.factory.updateVariableDeclaration(D,D.name,D.exclamationToken,D.type,t.ts.factory.createArrayLiteralExpression(_a(t,E)))])),m=t.ts.factory.updateSourceFile(m,S),C.exportType==="named"?m=Vt(t,m,{namedImports:[C.importName],importPath:Yt(t,t.registryPath,C.filePath)}):m=Vt(t,m,{defaultImport:C.importName,importPath:Yt(t,t.registryPath,C.filePath)}),m=Vt(t,m,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),m=Oa(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m=Ua(t,m),m=La(t,m);let x=Ln(t,m);x=Jo(x),x=LY(x,zke,"CUSTOM_COMPONENTS"),x=await t.formatCode(t.registryPath,x),await t.writeFile(t.registryPath,x)}p.components=B.components}return p}function Vke(t,e){return wn(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("component",t.ts.factory.createIdentifier(e.importName))],!0),e)}async function Wke(t,e,r){let n=hn(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await Sk(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var zke,$Y=L(()=>{"use strict";h();_Y();Ho();td();is();St();Qy();ed();$l();HY();vk();vk();Zp();Jr();_i();qY();nu();Dk();zke=["This array is used to integrate custom components within Builder.","https://www.builder.io/c/docs/custom-components-intro","",'These components will be found the "Custom Components"',"section of Builder's visual editor.",'You can also turn on "components only mode" to limit',"editing to only these components.","https://www.builder.io/c/docs/guides/components-only-mode"]});async function VY(t){let e=await Xke(t);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>JY(e),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>e.registryPath,getRegistry:n=>Vl(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{},loadComponent:async n=>{let i=await Vl(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Vl(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Vl(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Vl(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Vl(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>xm(e),setPublicApiKey:n=>MY(e,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>$s(e),setCache:n=>Vs(e,n)}}async function Xke(t){let e=await Im(t,t.getAppRootDir(),"components");if(!e)throw new Error(`Could not find components directory within project: ${t.getAppRootDir()}`);let r=await rs(t,e),n=t.join(t.getAppRootDir(),".env");return{...t,componentsDir:e,registryPath:r,envPath:n}}var WY=L(()=>{"use strict";h();Jl();Dk();$Y();bk();Bi()});async function Fm(t){return await Ra(t,[".env"],km)}async function zY(t,e){let r=await Fm(t),n=await Ta(t,r.file,r.envKey,e);return{...r,modifiedType:n}}var km,Dy=L(()=>{"use strict";h();jl();km="PUBLIC_BUILDER_KEY"});async function XY(t,e){let r=[],n=e.getSourceFiles(),i=e.getTypeChecker(),s=t.join(t.getAppRootDir(),"build");return await Promise.all(n.map(async o=>{let a=t.basename(o.fileName);if(a.startsWith(".")||a==="node_modules"||my(t,Zke,o.fileName)||eRe.has(a)||a.includes("$."))return;let A=t.normalize(o.fileName);if(A===t.remixConfigPath||A===s)return;let c=await iu(t,i,A,o,A===t.registryPath);r.push(...c)})),r}var Zke,eRe,ZY=L(()=>{"use strict";h();su();St();Zke=new Set(["dist","node_modules"]);eRe=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"])});async function e9(t){await wy(t);let e=await t.readFile(t.registryPath);return e?tRe(t,e):{components:[],sourceFile:jt(t,"")}}async function tRe(t,e){let r=jt(t,e);return rRe(t,r)}async function rRe(t,e){let r=[],n=hn(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await xk(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:ts(r)}}async function xk(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};t.sdkVersion===nt.gen2&&Yp(t,r)&&(n.acceptsChildren=!0);for(let i of r.properties){if(!t.ts.isPropertyAssignment(i)||!t.ts.isIdentifier(i.name))continue;if(cr(t,i)==="component"){let o,{initializer:a}=i;if(t.ts.isIdentifier(a))o=a.text;else if(t.ts.isCallExpression(a)){(t.ts.isIdentifier(a.expression)&&a.expression.text)==="withChildren"&&(n.acceptsChildren=!0);let u=a.arguments[0];t.ts.isIdentifier(u)&&(o=u.text)}if(!o)continue;n.name===""&&(n.name=Er(o)),n.importName=o;let A=await Pa(t,t.registryPath,e,o);if(!A)continue;if(n.filePath=A.filePath,n.relFilePath=A.relFilePath,await t.exists(A.filePath)?n.importPath=Br(t,A.filePath):(n.externalImportPath=A.importPath,n.importPath=n.externalImportPath),n.displayFilePath=A.displayFilePath,n.exportType=A.exportType,n.externalImportPath)n.exportName=o;else{let c=await uY(t,A.filePath,t.registryPath===A.filePath||js(A.filePath));if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let u=c.find(l=>l.cmpInfo.exportName===o);u&&(n.exportName=u.cmpInfo.exportName)}}continue}}return n=ns(t,n,r),n.filePath&&n.exportName&&(n.id=await hr(t,n.filePath,n.exportName,n.externalImportPath)),n}var t9=L(()=>{"use strict";h();_n();Jr();is();St();Ma();_i();Fk();su()});async function Ha(t,e,r,n,i,s,o,a){let A=await ou(t),[c,u,l]=await Promise.all([XY(t,A),e9(t),Fm(t)]),d=c.map(I=>I.cmpInfo),g=u.components,p={components:jo(d,g),registryPath:t.registryPath,registryDisplayPath:ir(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Ws(d),publicApiKey:l.envValue??void 0,devToolsVersion:t.version};if(a)return p.components=await Wp(t,p.components),p;let f=!1,m=u.sourceFile,C=Array.isArray(e)?e:typeof e=="string"?[e]:[];if(C.length>0){let I=C.map(y=>{let Q=c.find(b=>b.cmpInfo.id===y);if(!Q)throw new Error(`Component ${y} not found`);return Q}),B=Array.from(new Set(I.map(y=>y.cmpInfo.filePath))),E=await Dn(t,B);for(let y of I){let Q=p.components.find(P=>P.id===y.cmpInfo.id),b=await zp(t,y,E,t.registryPath===y.cmpInfo.filePath||js(y.cmpInfo.filePath));Ss(Q,b);let D=d.findIndex(P=>P.id===y.cmpInfo.id);d[D].inputs=b;let F=Ga(y.cmpInfo.id,d,g,r,n,i,s),{elements:S,elmIndex:x,statementIndex:U,statement:j,variableDeclaration:H}=await iRe(t,m,y);if(F.addCmpToRegistry)S.push(nRe(t,F.addCmpToRegistry)),f=!0;else if(F.removeCmpFromRegistry)S.splice(x,1),f=!0;else if(F.updateRegisteredCmp){let P=wn(t,S[x],F.updateRegisteredCmp);S[x]=t.ts.factory.updateObjectLiteralExpression(P,[r9(t,F.updateRegisteredCmp),...P.properties.slice(1)]),f=!0}if(f&&o){let P=[...m.statements];P[U]=t.ts.factory.updateVariableStatement(j,j.modifiers,t.ts.factory.updateVariableDeclarationList(j.declarationList,[t.ts.factory.updateVariableDeclaration(H,H.name,H.exclamationToken,H.type,t.ts.factory.createArrayLiteralExpression(_a(t,S)))])),m=t.ts.factory.updateSourceFile(m,P),Q.exportType==="named"?m=Vt(t,m,{namedImports:[Q.importName],importPath:Q.externalImportPath?Q.externalImportPath:Yt(t,t.registryPath,Q.filePath)}):m=Vt(t,m,{defaultImport:Q.importName,importPath:Q.externalImportPath?Q.externalImportPath:Yt(t,t.registryPath,Q.filePath)});let G=t.sdkVersion===nt.gen2?"@builder.io/sdk-react":"@builder.io/react";m=Vt(t,m,{namedImports:["RegisteredComponent"],importPath:G,isTypeOnly:!0}),Q.acceptsChildren&&t.sdkVersion!==nt.gen2&&(m=Vt(t,m,{namedImports:["withChildren"],importPath:"@builder.io/react"})),m=Oa(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),p.components=F.components,g=F.components.filter($=>$.isRegistered)}}}if(f&&o){m=Ua(t,m),m=La(t,m);let I=Ln(t,m);I=Jo(I),I=await t.formatCode(t.registryPath,I),await t.writeFile(t.registryPath,I)}return p}function r9(t,e){if(t.sdkVersion===nt.gen2)return t.ts.factory.createPropertyAssignment("component",t.ts.factory.createIdentifier(e.importName));let r=t.ts.factory.createIdentifier(e.importName),n=e.acceptsChildren?t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("withChildren"),void 0,[r]):r;return t.ts.factory.createPropertyAssignment("component",n)}function nRe(t,e){return wn(t,t.ts.factory.createObjectLiteralExpression([r9(t,e),...e.acceptsChildren&&t.sdkVersion===nt.gen2?[t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())]:[]],!0),e)}async function iRe(t,e,r){let n=hn(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await xk(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var kk=L(()=>{"use strict";h();_n();qs();Ho();Jr();ZY();St();$l();t9();Zp();ed();_i();su();is();td();vm();nu();Dy()});async function n9(t){let e=[],r=await aRe(t,e);return e.push(...await wy(t)),await cRe(t,r),await oRe(t,e),e}async function i9(t){let e=[];return e.push(...await wy(t)),await sRe(t,e),e}async function sRe(t,e){let r=`figma-imports.${t.typescriptEnabled?"tsx":"jsx"}`;t.hasLocaleParam&&(t.debug("remixEnsureFigmaImportRoute, hasLocaleParam"),r=`($locale).${r}`);let n=t.join(t.routesDir,r),i=await t.exists(n);t.debug(`remixEnsureFigmaImportRoute, hasRoute: ${i}`);let s=await t.formatCode(n,s9({sys:t,routePath:n,modelName:"figma-imports"}));await t.writeFile(n,s),e.push({filePath:n,modifiedType:i?"update":"create"})}async function oRe(t,e){let r=`$.${t.typescriptEnabled?"tsx":"jsx"}`;t.hasLocaleParam&&(t.debug("remixEnsureAppRoute, hasLocaleParam"),r=`($locale).${r}`),t.sdkVersion===nt.gen2&&(r=`($slug)._index.${t.typescriptEnabled?"tsx":"jsx"}`);let n=t.join(t.routesDir,r),i=await t.exists(n);t.debug(`remixEnsureAppRoute, hasRoute: ${i}`);let s=await t.formatCode(n,s9({sys:t,routePath:n,modelName:"page"}));await t.writeFile(n,s),e.push({filePath:n,modifiedType:i?"update":"create"})}function s9({sys:t,routePath:e,modelName:r}){let n=t.typescriptEnabled,i=Yt(t,e,t.registryPath),s="",o="";n&&(s="import type { LoaderArgs } from '@remix-run/server-runtime';",o=": LoaderArgs");let a=`process.env.${km}`,A="";return t.getFrameworks().some(c=>c.name==="@shopify/remix-oxygen")&&(a=`context.env.${km}`,A=", context"),n&&(a+="!"),t.sdkVersion===nt.gen2?`
|
|
472
472
|
|
|
473
473
|
import {
|
|
474
474
|
Content,
|
|
@@ -641,17 +641,17 @@ export default Counter;
|
|
|
641
641
|
font-size: 42px;
|
|
642
642
|
text-align: center;
|
|
643
643
|
}
|
|
644
|
-
`.trimStart();return{component:r,styles:n}}async function cRe(t,e){let n=(await Ha(t,null,!1,!1,null,null,!1,!1)).components.find(i=>i.filePath===e);n&&await Ha(t,n.id,!0,!1,null,null,!0,!1)}async function wy(t){let e=[];return await t.exists(t.registryPath)||(await t.writeFile(t.registryPath,uRe(t)),e.push({filePath:t.registryPath,modifiedType:"create"})),e}function uRe(t){let e=t.sdkVersion===
|
|
644
|
+
`.trimStart();return{component:r,styles:n}}async function cRe(t,e){let n=(await Ha(t,null,!1,!1,null,null,!1,!1)).components.find(i=>i.filePath===e);n&&await Ha(t,n.id,!0,!1,null,null,!0,!1)}async function wy(t){let e=[];return await t.exists(t.registryPath)||(await t.writeFile(t.registryPath,uRe(t)),e.push({filePath:t.registryPath,modifiedType:"create"})),e}function uRe(t){let e=t.sdkVersion===nt.gen2;return t.typescriptEnabled?`import type { RegisteredComponent } from ${e?'"@builder.io/sdk-react"':'"@builder.io/react"'};
|
|
645
645
|
|
|
646
646
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
647
647
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
648
648
|
];
|
|
649
|
-
`}var Fk=L(()=>{"use strict";h();_n();kk();Dy();St()});async function o9(t){let e=await lRe(t);return{builderPageOptions:async()=>{let n="/builder-demo",i=e.hasLocaleParam?`/en-us${n}`:void 0;return{templateContentId:"a5c9eef7909d4fc99554264a17de22c9",pathname:n,localePathname:i,title:"Builder + Remix Demo Page"}},ensureBuilderSetup:()=>n9(e),ensureFigmaImportPage:()=>i9(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Ha(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Ha(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Ha(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Ha(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Ha(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Ha(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Fm(e),setPublicApiKey:n=>zY(e,n.publicApiKey),getDependencies:n=>n.sdkVersion===
|
|
649
|
+
`}var Fk=L(()=>{"use strict";h();_n();kk();Dy();St()});async function o9(t){let e=await lRe(t);return{builderPageOptions:async()=>{let n="/builder-demo",i=e.hasLocaleParam?`/en-us${n}`:void 0;return{templateContentId:"a5c9eef7909d4fc99554264a17de22c9",pathname:n,localePathname:i,title:"Builder + Remix Demo Page"}},ensureBuilderSetup:()=>n9(e),ensureFigmaImportPage:()=>i9(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Ha(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Ha(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Ha(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Ha(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Ha(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Ha(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Fm(e),setPublicApiKey:n=>zY(e,n.publicApiKey),getDependencies:n=>n.sdkVersion===nt.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>$s(e),setCache:n=>Vs(e,n)}}async function lRe(t){let e=await pRe(t),r=t.getAppRootDir(),n=await dRe(t),i=t.dirname(n),s=t.join(i,"components"),o=await Li(t),a=await rs(t,i),A={},c={...t,registryPath:a,remixConfigPath:e,typescriptEnabled:o,appDir:i,componentsDir:s,routesDir:n,hasLocaleParam:await gRe(t,n),addExternalPackage:u=>{A[t.join(r,u,"index.ts")]=`export * from "${u}";`},readFileSync:u=>A[u]??t.readFileSync(u),existsSync:u=>!!A[u]||t.existsSync(u),readdirSync:u=>{let l=t.readdirSync(u);return u===r?[...l,...Object.keys(A).map(d=>d.slice(r.length+1))]:l},readdir:async u=>{let l=await t.readdir(u);return u===r?[...l,...Object.keys(A).map(d=>d.slice(r.length+1))]:l}};return t.sdkVersion?c.sdkVersion=t.sdkVersion:c.sdkVersion=await rd(c),c}async function gRe(t,e){return(await t.readdir(e)).some(n=>n.startsWith("($locale)."))}async function pRe(t){let e=["remix.config.ts","remix.config.js","vite.config.ts","vite.config.js"];for(let r of e){let n=t.join(t.getAppRootDir(),r);if(await t.exists(n))return n}if(t.ignoreMissingConfig)return"";throw new Error(`Could not find Remix config file. Searched for ${e.join(", ")} in "${t.getAppRootDir()}".`)}async function dRe(t){let e=await Im(t,t.getAppRootDir(),"routes");if(e)return e;throw new Error(`Could not find Remix "routes" directory in "${t.getAppRootDir()}". Please ensure this command is ran from within your Remix project's directory.`)}var a9=L(()=>{"use strict";h();Jl();Dy();Bi();Fk();kk();_n();By()});async function Rm(t){let e=[".env"],r=t.configType==="vite"?Tm:by;return await Ra(t,e,r)}async function A9(t,e){let r=await Rm(t),n=await Ta(t,r.file,r.envKey,e);return{...r,modifiedType:n}}var Tm,by,Nm=L(()=>{"use strict";h();jl();Tm="VITE_PUBLIC_BUILDER_KEY",by="PUBLIC_BUILDER_KEY"});function c9(t,e){let r=`Builder.registerComponent(
|
|
650
650
|
`;r+=` ${e.importName},
|
|
651
651
|
`,r+=` {
|
|
652
652
|
name: "${e.name}",
|
|
653
653
|
}
|
|
654
|
-
`,r+=");";let n=hy(t,r);return Rk(t,n,e)}function Rk(t,e,r){if(!t.ts.isExpressionStatement(e))return e;let n=e.expression;if(!t.ts.isCallExpression(n))return e;let i=[...n.arguments];if(i.length<2)return e;let s=i[1];return t.ts.isObjectLiteralExpression(s)?(i[1]=wn(t,s,r),t.ts.factory.updateExpressionStatement(e,t.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):e}var u9=L(()=>{"use strict";h();Jr();_i()});async function l9(t){let e=await t.readFile(t.registryPath);return e?fRe(t,e):{components:[],sourceFile:jt(t,"")}}async function fRe(t,e){let r=jt(t,e);return t.sdkVersion===
|
|
654
|
+
`,r+=");";let n=hy(t,r);return Rk(t,n,e)}function Rk(t,e,r){if(!t.ts.isExpressionStatement(e))return e;let n=e.expression;if(!t.ts.isCallExpression(n))return e;let i=[...n.arguments];if(i.length<2)return e;let s=i[1];return t.ts.isObjectLiteralExpression(s)?(i[1]=wn(t,s,r),t.ts.factory.updateExpressionStatement(e,t.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):e}var u9=L(()=>{"use strict";h();Jr();_i()});async function l9(t){let e=await t.readFile(t.registryPath);return e?fRe(t,e):{components:[],sourceFile:jt(t,"")}}async function fRe(t,e){let r=jt(t,e);return t.sdkVersion===nt.gen2?CRe(t,r):hRe(t,r)}async function hRe(t,e){let r=[];for(let n=0;n<e.statements.length;n++){let i=e.statements[n];if(!t.ts.isExpressionStatement(i))continue;let s=i.expression;if(!t.ts.isCallExpression(s))continue;let o=s.expression;if(!t.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!t.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let u=c[1];if(!t.ts.isObjectLiteralExpression(u))continue;let l=c[0];if(t.ts.isIdentifier(l)){let d=await mRe(t,e,n,l,u,!1);d&&r.push(d);continue}}return{sourceFile:e,components:ts(r)}}async function mRe(t,e,r,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=e.statements.filter(c=>t.ts.isImportDeclaration(c)),A=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(A){let c=A.moduleSpecifier;if(!t.ts.isStringLiteral(c))return null;o.filePath=await Tk(t,c.text),o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),o.importPath=Br(t,o.filePath),o.name=Ys(t,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!t.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(g=>g.name.text===n.text));if(!c)return null;let u=c.moduleSpecifier;if(!t.ts.isStringLiteral(u))return null;let l=await Tk(t,u.text);o.filePath=await Tk(t,u.text),o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(l)?o.importPath=Br(t,o.filePath):(o.externalImportPath=u.text,o.importPath=o.externalImportPath),o.name=Er(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=ns(t,o,i),o.displayFilePath=ir(t,o.filePath),o.filePath&&o.exportName&&(o.id=await hr(t,o.filePath,o.exportName,o.externalImportPath)),o}function Tk(t,e){return Sm(t,t.normalize(t.resolve(t.dirname(t.registryPath),e)))}async function CRe(t,e){let r=[],n=hn(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await Nk(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:ts(r)}}async function Nk(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};Yp(t,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!t.ts.isPropertyAssignment(s)||!t.ts.isIdentifier(s.name))continue;if(cr(t,s)==="component"){let a,{initializer:A}=s;if(t.ts.isIdentifier(A)&&(a=A.text),!a)continue;n.name===""&&(n.name=Er(a)),n.importName=a;let c=await Pa(t,t.registryPath,e,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await t.exists(c.filePath)?n.importPath=Br(t,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let u=e.statements.filter(d=>t.ts.isImportDeclaration(d)),l=u.find(d=>d.importClause&&d.importClause.name?.text===a);if(l){let d=l.moduleSpecifier;if(!t.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=u.find(p=>!p.importClause||!p.importClause.namedBindings||!t.ts.isNamedImports(p.importClause.namedBindings)?!1:p.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let g=d.moduleSpecifier;if(!t.ts.isStringLiteral(g))return null;n.exportName=a}continue}}return n=ns(t,n,r),n.filePath&&n.exportName&&(n.id=await hr(t,n.filePath,n.exportName,n.externalImportPath)),n}var g9=L(()=>{"use strict";h();_n();Jr();is();St();Ma();_i();Nm()});async function Ja(t,e,r,n,i,s,o,a){let A=await ou(t),[c,u,l,d]=await Promise.all([lY(t,A),l9(t),Li(t),Rm(t)]),g=c.map(B=>B.cmpInfo),p=u.components,f={components:jo(g,p),registryPath:t.registryPath,registryDisplayPath:ir(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Ws(g),publicApiKey:d.envValue??void 0,devToolsVersion:t.version};if(a)return f.components=await Wp(t,f.components),f;let m=!1,C=u.sourceFile,I=Array.isArray(e)?e:typeof e=="string"?[e]:[];if(I.length>0){let B=I.map(Q=>{let b=c.find(D=>D.cmpInfo.id===Q);if(!b)throw new Error(`Component ${Q} not found`);return b}),E=Array.from(new Set(B.map(Q=>Q.cmpInfo.filePath))),y=await Dn(t,E);for(let Q of B){let b=f.components.find(x=>x.id===Q.cmpInfo.id),D=await zp(t,Q,y,t.registryPath===Q.cmpInfo.filePath||js(Q.cmpInfo.filePath));Ss(b,D);let F=g.findIndex(x=>x.id===Q.cmpInfo.id);g[F].inputs=D;let S=Ga(Q.cmpInfo.id,g,p,r,n,i,s);if(t.sdkVersion===nt.gen2){let{elements:x,elmIndex:U,statementIndex:j,statement:H,variableDeclaration:P}=await IRe(t,C,Q);if(S.addCmpToRegistry)x.push(ERe(t,S.addCmpToRegistry)),m=!0;else if(S.removeCmpFromRegistry)x.splice(U,1),m=!0;else if(S.updateRegisteredCmp){let G=wn(t,x[U],S.updateRegisteredCmp),$=t.ts.factory.createIdentifier(S.updateRegisteredCmp.importName);x[U]=t.ts.factory.updateObjectLiteralExpression(G,[t.ts.factory.createPropertyAssignment("component",$),...G.properties.slice(1)]),m=!0}if(m&&o){let G=[...C.statements];G[j]=t.ts.factory.updateVariableStatement(H,H.modifiers,t.ts.factory.updateVariableDeclarationList(H.declarationList,[t.ts.factory.updateVariableDeclaration(P,P.name,P.exclamationToken,P.type,t.ts.factory.createArrayLiteralExpression(_a(t,x)))])),C=t.ts.factory.updateSourceFile(C,G),C=p9(t,S,C),C=Vt(t,C,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),C=Oa(t,C,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=S.components,p=S.components.filter($=>$.isRegistered)}}else{let x=[...C.statements];S.addCmpToRegistry?(x.push(c9(t,S.addCmpToRegistry)),m=!0):S.removeCmpFromRegistry?(x.splice(S.nodeIndex,1),m=!0):S.updateRegisteredCmp&&(x[S.nodeIndex]=Rk(t,x[S.nodeIndex],S.updateRegisteredCmp),m=!0),m&&o&&(C=t.ts.factory.updateSourceFile(C,x),C=Vt(t,C,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),C=p9(t,S,C),b?.acceptsChildren&&(C=Vt(t,C,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=S.components,p=S.components.filter(U=>U.isRegistered))}}}if(m&&o){C=Ua(t,C),C=La(t,C);let B=Ln(t,C);B=Jo(B),B=await t.formatCode(t.registryPath,B),await t.writeFile(t.registryPath,B)}return f}async function IRe(t,e,r){let n=hn(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await Nk(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}function ERe(t,e){let r=t.ts.factory.createIdentifier(e.importName);return wn(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("component",r),...e.acceptsChildren?[t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())]:[]],!0),e)}function p9(t,e,r){let n=e.addCmpToRegistry||e.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:Yt(t,t.registryPath,n.filePath);n.exportType==="default"?r=Vt(t,r,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(r=Vt(t,r,{namedImports:[n.importName],importPath:i}))}return r}var Mk=L(()=>{"use strict";h();_n();u9();qs();Ho();Jr();is();su();St();$l();g9();su();Zp();ed();_i();vm();nu();Nm();td();Bi()});async function d9(t){let e=[],r=await BRe(t,e);if(await m9(t,e,r),!await t.exists(t.builderComponentPath)){let n=await t.formatCode(t.builderComponentPath,h9(t,t.builderComponentPath));await t.writeFile(t.builderComponentPath,n),e.push({filePath:t.builderComponentPath,modifiedType:"create"})}return e}async function f9(t){let e=[];await m9(t,e);let r=`figma-imports.${t.typescriptEnabled?"tsx":"jsx"}`,n=t.join(t.componentsDir,r);if(!await t.exists(n)){let i=await t.formatCode(n,h9(t,n,"figma-imports"));await t.writeFile(n,i),e.push({filePath:n,modifiedType:"create"})}return e}function h9(t,e,r="page"){let n=t.typescriptEnabled;return t.sdkVersion===nt.gen2?`
|
|
655
655
|
import React from "react";
|
|
656
656
|
import {
|
|
657
657
|
Content,
|
|
@@ -761,7 +761,7 @@ export default function BuilderPage() {
|
|
|
761
761
|
</>
|
|
762
762
|
);
|
|
763
763
|
}
|
|
764
|
-
`.trimStart()}async function m9(t,e,r){if(!await t.exists(t.registryPath)){if(t.sdkVersion===
|
|
764
|
+
`.trimStart()}async function m9(t,e,r){if(!await t.exists(t.registryPath)){if(t.sdkVersion===nt.gen2){let s=QRe(t);await t.writeFile(t.registryPath,s)}else await t.writeFile(t.registryPath,"");e.push({filePath:t.registryPath,modifiedType:"create"})}if(!r)return;let i=(await Ja(t,null,!1,!1,null,null,!1,!1)).components.find(s=>s.filePath===r);i&&await Ja(t,i.id,!0,!1,null,null,!0,!1)}async function BRe(t,e){let n=t.typescriptEnabled?"tsx":"jsx",i=t.join(t.componentsDir,"Counter"),s=t.join(i,`Counter.${n}`),o=t.join(i,"styles.module.css"),{component:a,styles:A}=yRe(t);if(!await t.exists(s)){let c=await t.formatCode(s,a);await t.writeFile(s,c),e.push({filePath:s,modifiedType:"create"})}return await t.exists(o)||(await t.writeFile(o,A),e.push({filePath:o,modifiedType:"create"})),s}function yRe(t){let e=t.typescriptEnabled,r=`
|
|
765
765
|
"use client"
|
|
766
766
|
import React, { useState } from "react";
|
|
767
767
|
import styles from "./styles.module.css";
|
|
@@ -829,7 +829,7 @@ export default Counter;
|
|
|
829
829
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
830
830
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
831
831
|
];
|
|
832
|
-
`}var C9=L(()=>{"use strict";h();_n();Mk();St();Nm()});async function Pk(t){let e=await DRe(t);return{builderPageOptions:async()=>({templateContentId:"2e36438034894a8abf279ea9e6d3596f",pathname:"/builder-demo",title:"Builder + React Demo Page"}),ensureBuilderSetup:()=>d9(e),ensureFigmaImportPage:()=>f9(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Ja(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Ja(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Ja(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Ja(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Ja(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Ja(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Rm(e),setPublicApiKey:n=>A9(e,n.publicApiKey),getDependencies:n=>n.sdkVersion===
|
|
832
|
+
`}var C9=L(()=>{"use strict";h();_n();Mk();St();Nm()});async function Pk(t){let e=await DRe(t);return{builderPageOptions:async()=>({templateContentId:"2e36438034894a8abf279ea9e6d3596f",pathname:"/builder-demo",title:"Builder + React Demo Page"}),ensureBuilderSetup:()=>d9(e),ensureFigmaImportPage:()=>f9(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Ja(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Ja(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Ja(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Ja(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Ja(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Ja(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Rm(e),setPublicApiKey:n=>A9(e,n.publicApiKey),getDependencies:n=>n.sdkVersion===nt.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>$s(e),setCache:n=>Vs(e,n)}}async function DRe(t){let e=await wRe(t),r=t.getAppRootDir(),n=t.join(r,"src"),i=await Li(t),s={},o={...t,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",reactConfigPath:e,typescriptEnabled:i,configType:"",addExternalPackage:a=>{s[t.join(r,a,"index.ts")]=`export * from "${a}";`},readFileSync:a=>s[a]??t.readFileSync(a),existsSync:a=>!!s[a]||t.existsSync(a),readdirSync:a=>{let A=t.readdirSync(a);return a===r?[...A,...Object.keys(s).map(c=>c.slice(r.length+1))]:A},readdir:async a=>{let A=await t.readdir(a);return a===r?[...A,...Object.keys(s).map(c=>c.slice(r.length+1))]:A}};return t.sdkVersion?o.sdkVersion=t.sdkVersion:o.sdkVersion=await rd(o),e.includes("webpack.config")&&(o.configType="webpack"),e.includes("vite.config")&&(o.configType="vite"),await t.exists(n)?(o.srcDir=n,o.componentsDir=t.join(n,"components"),o.registryPath=await rs(t,n),o.builderComponentPath=t.join(o.srcDir,`builder-page.${i?"tsx":"jsx"}`)):(o.componentsDir=t.join(r,"components"),o.registryPath=await rs(t,r),o.builderComponentPath=t.join(r,`builder-page.${i?"tsx":"jsx"}`)),o}async function wRe(t){let e=["vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts"];for(let r of e){let n=t.join(t.getAppRootDir(),r);if(await t.exists(n))return n}if(t.ignoreMissingConfig)return"";throw new Error(`Could not find React config file. Searched for ${e.join(", ")} in "${t.getAppRootDir()}".`)}var I9=L(()=>{"use strict";h();Jl();Nm();Mk();C9();_n();By();Bi()});async function Mm(t){return await bRe(t,["environment.ts"],Sy)}async function E9(t,e){let r=await Mm(t),n=await FRe(t,r.file,r.envKey,e);return{...r,modifiedType:n}}async function bRe(t,e,r){let n={envKey:r,envValue:null,file:""};for(let i of e){let s=t.join(t.getAppRootDir(),"src","environments",i),o=await SRe(t,s);if(typeof o=="string"&&o.length>0&&o!=="YOUR_API_KEY")return n.envValue=o,n.file=s,n}return n.file=t.join(t.getAppRootDir(),"src","environments",e[e.length-1]),n}async function SRe(t,e){let r=await t.readFile(e);return r?vRe(t,r):""}function vRe(t,e){let r=jt(t,e),n="",s=$p(t,r,"environment");if(s&&s.statement.declarationList.declarations.length>0){let a=s.statement.declarationList.declarations[0].initializer;a&&t.ts.isObjectLiteralExpression(a)&&a.properties.forEach(A=>{t.ts.isPropertyAssignment(A)&&t.ts.isIdentifier(A.name)&&A.name.text===Sy&&t.ts.isStringLiteral(A.initializer)&&(n=A.initializer.text)})}return n}async function xRe(t,e,r,n){let i=jt(t,e),o=$p(t,i,"environment");if(o&&o.statement.declarationList.declarations.length>0){let a=o.statement.declarationList,A=a.declarations[0],c=A.initializer;if(c&&t.ts.isObjectLiteralExpression(c)){let u=t.ts.factory.createPropertyAssignment(t.ts.factory.createIdentifier(r),t.ts.factory.createStringLiteral(n)),l=t.ts.factory.createNodeArray([...c.properties,u]),d=t.ts.factory.updateObjectLiteralExpression(c,l),g=t.ts.factory.updateVariableDeclaration(A,A.name,A.exclamationToken,A.type,d),p=t.ts.factory.updateVariableDeclarationList(a,[g]);return t.ts.factory.updateVariableStatement(o.statement,o.statement.modifiers,p)}return null}return null}async function FRe(t,e,r,n){let i=await t.readFile(e);if(i)if(i.includes(r))t.debug(`"${r}" already set in ${e}`);else{t.debug(`Add "${r}" to ${e}`);let s=await xRe(t,i,r,n);if(s){let o=Ln(t,s),a=await t.formatCode(e,o);await t.writeFile(e,a)}return"update"}else{t.debug(`Creating new env file with "${r}" at ${e}`);let s=`
|
|
833
833
|
// https://www.builder.io/c/docs/using-your-api-key
|
|
834
834
|
export const environment = {
|
|
835
835
|
production: false,
|
|
@@ -1093,7 +1093,7 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
1093
1093
|
// ]
|
|
1094
1094
|
// }
|
|
1095
1095
|
];
|
|
1096
|
-
`}var o6=L(()=>{"use strict";h();St()});async function a6(t){let e=await QTe(t);return{builderPageOptions:async()=>({templateContentId:"vue-demo-template-id",pathname:"/builder-demo",title:"Builder + Vue Demo Page"}),ensureBuilderSetup:async()=>(await n6(e)).errors.length>0?[]:[],ensureFigmaImportPage:()=>i6(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Xl(e,{readAllInputTypes:!!n?.readAllInputTypes}),addExternalPackage:n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Xl(e,{readAllInputTypes:!1}),s=i.components.find(o=>o.id===n.cmpId);return{...i,component:s}},registerComponent:async n=>Xl(e,{readAllInputTypes:!1}),setRegisteredComponentInfo:async n=>Xl(e,{readAllInputTypes:!1}),setRegisteredComponentInput:async n=>Xl(e,{readAllInputTypes:!1}),unregisterComponent:async n=>Xl(e,{readAllInputTypes:!1}),getPublicApiKey:()=>_m(e),setPublicApiKey:n=>X9(e,n.publicApiKey),getDependencies:n=>n.sdkVersion===it.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-vue"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/vue"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>$s(e),setCache:n=>Vs(e,n)}}async function QTe(t){let e=await DTe(t),r=t.getAppRootDir(),n=t.join(r,"src"),i=await Li(t),s={},o={...t,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",vueConfigPath:e,typescriptEnabled:i,configType:"",isNuxt:await wTe(t),addExternalPackage:c=>{s[t.join(r,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>s[c]??t.readFileSync(c),existsSync:c=>!!s[c]||t.existsSync(c),readdirSync:c=>{let u=t.readdirSync(c);return c===r?[...u,...Object.keys(s).map(l=>l.slice(r.length+1))]:u},readdir:async c=>{let u=await t.readdir(c);return c===r?[...u,...Object.keys(s).map(l=>l.slice(r.length+1))]:u}};e.includes("webpack.config")&&(o.configType="webpack"),(e.includes("vite.config")||e.includes("nuxt.config"))&&(o.configType="vite");let a=await t.exists(n);o.srcDir=a?n:null;let A=[t.join(r,"components"),t.join(r,"src","components"),t.join(r,"app","components")];for(let c of A)if(await t.exists(c)){o.componentsDir=c;break}return o.componentsDir||(o.componentsDir=a?t.join(n,"components"):t.join(r,"components")),o.registryPath=await rs(t,o.componentsDir),o}async function DTe(t){let e=["nuxt.config.ts","nuxt.config.js","vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts","vue.config.js","vue.config.ts"];for(let r of e){let n=t.join(t.getAppRootDir(),r);if(await t.exists(n))return n}if(t.ignoreMissingConfig)return"";throw new Error(`Could not find Vue config file. Searched for ${e.join(", ")} in "${t.getAppRootDir()}".`)}async function wTe(t){let e=["nuxt.config.ts","nuxt.config.js"];for(let r of e){let n=t.join(t.getAppRootDir(),r);if(await t.exists(n))return!0}try{let r=t.join(t.getAppRootDir(),"package.json");if(await t.exists(r)){let n=JSON.parse(await t.readFile(r)||"{}"),i={...n.dependencies,...n.devDependencies};return!!(i.nuxt||i["@nuxt/kit"]||i.nuxt3)}}catch{}return!1}var A6=L(()=>{"use strict";h();Jl();Wk();r6();_n();Bi();o6()});var Zk=N(Um=>{"use strict";h();Object.defineProperty(Um,"__esModule",{value:!0});Um.getType=c6;Um.throwUnknownDataType=bTe;Um.throwUnsupportedData=STe;function c6(t){return Object.prototype.toString.call(t)}function bTe(t){throw new TypeError("unsupported data type: "+c6(t))}function STe(t){throw new TypeError("unsupported data type: "+t)}});var _y=N(qA=>{"use strict";h();Object.defineProperty(qA,"__esModule",{value:!0});qA.s_to_int=rR;qA.s_to_big_int=u6;qA.int_to_s=nR;qA.big_int_to_s=l6;qA.num_to_s=p6;qA.int_str_to_s=Ly;qA.s_to_num=d6;var YA="";for(let t=0;t<10;t++){let e=String.fromCharCode(48+t);YA+=e}for(let t=0;t<26;t++){let e=String.fromCharCode(65+t);YA+=e}for(let t=0;t<26;t++){let e=String.fromCharCode(97+t);YA+=e}var nd=YA.length,tR={};for(let t=0;t<nd;t++){let e=YA[t];tR[e]=t}function rR(t){let e=0,r=1;for(let n=t.length-1;n>=0;n--){let i=t[n],s=tR[i];s*=r,e+=s,r*=nd}return e}function u6(t){let e=BigInt(0),r=BigInt(1),n=BigInt(nd);for(let i=t.length-1;i>=0;i--){let s=t[i],o=BigInt(tR[s]);o*=r,e+=o,r*=n}return e}function nR(t){if(t===0)return YA[0];let e=[];for(;t!==0;){let r=t%nd,n=YA[r];e.push(n),t-=r,t/=nd}return e.reverse().join("")}function l6(t){let e=BigInt(0),r=BigInt(nd);if(t===e)return YA[0];let n=[];for(;t!==e;){let i=t%r,s=YA[Number(i)];n.push(s),t/=r}return n.reverse().join("")}function g6(t){return t.split("").reverse().join("")}function p6(t){if(t<0)return"-"+p6(-t);let[e,r]=t.toString().split(".");if(!r)if(e.includes("e")){let[s,o]=e.split("e");e=s,r="0e"+o}else return nR(t);let n;r&&([r,n]=r.split("e")),e=Ly(e),r=g6(r),r=Ly(r);let i=e+"."+r;if(n){switch(i+=".",n[0]){case"+":n=n.slice(1);break;case"-":i+="-",n=n.slice(1);break}n=Ly(n),i+=n}return i}function Ly(t){let e=+t;return e.toString()===t&&e+1!==e&&e-1!==e?nR(e):":"+l6(BigInt(t))}function eR(t){return t[0]===":"?u6(t.substring(1)).toString():rR(t).toString()}function d6(t){if(t[0]==="-")return-d6(t.substr(1));let[e,r,n]=t.split(".");if(!r)return rR(e);e=eR(e),r=eR(r),r=g6(r);let i=e+"."+r;if(n){i+="e";let s=!1;n[0]==="-"&&(s=!0,n=n.slice(1)),n=eR(n),i+=s?-n:+n}return+i}});var sR=N($A=>{"use strict";h();Object.defineProperty($A,"__esModule",{value:!0});$A.encodeNum=vTe;$A.decodeNum=xTe;$A.decodeKey=FTe;$A.encodeBool=kTe;$A.decodeBool=RTe;$A.encodeStr=TTe;$A.decodeStr=NTe;var iR=_y();function vTe(t){return t===1/0?"N|+":t===-1/0?"N|-":Number.isNaN(t)?"N|0":"n|"+(0,iR.num_to_s)(t)}function xTe(t){if(t.length===3&&t[0]==="N"&&t[1]==="|")switch(t[2]){case"+":return 1/0;case"-":return-1/0;case"0":return NaN}return(0,iR.s_to_num)(t.slice(2))}function FTe(t){return typeof t=="number"?t:(0,iR.s_to_int)(t)}function kTe(t){return t?"b|T":"b|F"}function RTe(t){if(t.length===3&&t[0]==="b"&&t[1]==="|")switch(t[2]){case"T":return!0;case"F":return!1}return!!t}function TTe(t){if(t[1]==="|")switch(t[0]){case"b":case"o":case"n":case"a":case"s":return"s|"+t}return t}function NTe(t){return t[0]==="s"&&t[1]==="|"?t.substr(2):t}});var oR=N(Uy=>{"use strict";h();Object.defineProperty(Uy,"__esModule",{value:!0});Uy.config=void 0;Uy.config={sort_key:!1,preserve_nan:!1,error_on_nan:!1,preserve_infinite:!1,error_on_infinite:!1}});var AR=N(eg=>{"use strict";h();Object.defineProperty(eg,"__esModule",{value:!0});eg.memToValues=PTe;eg.makeInMemoryStore=f6;eg.makeInMemoryCache=h6;eg.makeInMemoryMemory=LTe;eg.addValue=Gm;var Zl=oR(),Gy=Zk(),aR=sR(),MTe=_y();function PTe(t){return t.store.toArray()}function f6(){let t=[];return{forEach(e){for(let r=0;r<t.length;r++)if(e(t[r])==="break")return},add(e){t.push(e)},toArray(){return t}}}function h6(){let t=Object.create(null),e=Object.create(null);return{getValue(r){return t[r]},getSchema(r){return e[r]},forEachValue(r){for(let[n,i]of Object.entries(t))if(r(n,i)==="break")return},forEachSchema(r){for(let[n,i]of Object.entries(e))if(r(n,i)==="break")return},setValue(r,n){t[r]=n},setSchema(r,n){e[r]=n},hasValue(r){return r in t},hasSchema(r){return r in e}}}function LTe(){return{store:f6(),cache:h6(),keyCount:0}}function Ya(t,e){if(t.cache.hasValue(e))return t.cache.getValue(e);let r=t.keyCount++,n=(0,MTe.num_to_s)(r);return t.store.add(e),t.cache.setValue(e,n),n}function _Te(t,e){Zl.config.sort_key&&e.sort();let r=e.join(",");if(t.cache.hasSchema(r))return t.cache.getSchema(r);let n=Gm(t,e,void 0);return t.cache.setSchema(r,n),n}function Gm(t,e,r){if(e===null)return"";switch(typeof e){case"undefined":if(Array.isArray(r))return Gm(t,null,r);break;case"object":if(e===null)return Ya(t,null);if(Array.isArray(e)){let n="a";for(let i=0;i<e.length;i++){let s=e[i],o=s===null?"_":Gm(t,s,e);n+="|"+o}return n==="a"&&(n="a|"),Ya(t,n)}else{let n=Object.keys(e);if(n.length===0)return Ya(t,"o|");let i="o",s=_Te(t,n);i+="|"+s;for(let o of n){let a=e[o],A=Gm(t,a,e);i+="|"+A}return Ya(t,i)}case"boolean":return Ya(t,(0,aR.encodeBool)(e));case"number":return Number.isNaN(e)?Zl.config.preserve_nan?Ya(t,"N|0"):(Zl.config.error_on_nan&&(0,Gy.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===e?Zl.config.preserve_infinite?Ya(t,"N|+"):(Zl.config.error_on_infinite&&(0,Gy.throwUnsupportedData)("[number Infinity]"),""):Number.NEGATIVE_INFINITY===e?Zl.config.preserve_infinite?Ya(t,"N|-"):(Zl.config.error_on_infinite&&(0,Gy.throwUnsupportedData)("[number -Infinity]"),""):Ya(t,(0,aR.encodeNum)(e));case"string":return Ya(t,(0,aR.encodeStr)(e))}return(0,Gy.throwUnknownDataType)(e)}});var lR=N(Km=>{"use strict";h();Object.defineProperty(Km,"__esModule",{value:!0});Km.compress=GTe;Km.decode=Om;Km.decompress=HTe;var cR=Zk(),m6=sR(),uR=AR(),UTe=_y();function GTe(t){let e=(0,uR.makeInMemoryMemory)(),r=(0,uR.addValue)(e,t,void 0);return[(0,uR.memToValues)(e),r]}function OTe(t,e){if(e==="o|")return{};let r={},n=e.split("|"),i=n[1],s=Om(t,i),o=n.length;o-2===1&&!Array.isArray(s)&&(s=[s]);for(let a=2;a<o;a++){let A=s[a-2],c=n[a];c=Om(t,c),r[A]=c}return r}function KTe(t,e){if(e==="a|")return[];let r=e.split("|"),n=r.length-1,i=new Array(n);for(let s=0;s<n;s++){let o=r[s+1];o=Om(t,o),i[s]=o}return i}function Om(t,e){if(e===""||e==="_")return null;let r=(0,m6.decodeKey)(e),n=t[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":if(n[1]==="|")switch(n[0]){case"b":switch(n[2]){case"T":return!0;case"F":return!1;default:return(0,cR.throwUnknownDataType)(n)}case"o":return OTe(t,n);case"n":return(0,UTe.s_to_num)(n.slice(2));case"N":switch(n[2]){case"+":return 1/0;case"-":return-1/0;case"0":return NaN;default:return(0,cR.throwUnknownDataType)(n)}case"a":return KTe(t,n)}return(0,m6.decodeStr)(n)}return(0,cR.throwUnknownDataType)(n)}function HTe(t){let[e,r]=t;return Om(e,r)}});var I6=N(Oy=>{"use strict";h();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.trimUndefined=JTe;Oy.trimUndefinedRecursively=jTe;function JTe(t){for(let e in t)t[e]===void 0&&delete t[e]}function jTe(t){C6(t,new Set)}function C6(t,e){e.add(t);for(let r in t)if(t[r]===void 0)delete t[r];else{let n=t[r];n&&typeof n=="object"&&!e.has(n)&&C6(n,e)}}});var y6=N(yi=>{"use strict";h();Object.defineProperty(yi,"__esModule",{value:!0});yi.config=yi.trimUndefinedRecursively=yi.trimUndefined=yi.addValue=yi.decode=yi.decompress=yi.compress=void 0;var E6=lR();Object.defineProperty(yi,"compress",{enumerable:!0,get:function(){return E6.compress}});Object.defineProperty(yi,"decompress",{enumerable:!0,get:function(){return E6.decompress}});var YTe=lR();Object.defineProperty(yi,"decode",{enumerable:!0,get:function(){return YTe.decode}});var qTe=AR();Object.defineProperty(yi,"addValue",{enumerable:!0,get:function(){return qTe.addValue}});var B6=I6();Object.defineProperty(yi,"trimUndefined",{enumerable:!0,get:function(){return B6.trimUndefined}});Object.defineProperty(yi,"trimUndefinedRecursively",{enumerable:!0,get:function(){return B6.trimUndefinedRecursively}});var $Te=oR();Object.defineProperty(yi,"config",{enumerable:!0,get:function(){return $Te.config}})});async function Q6(t,e){let n={components:(await e.getRegistry()).components.filter(s=>s.isRegistered).map(s=>{let o={filePath:Oo(t.relative(t.getAppRootDir(),s.filePath)),name:s.name,image:s.image,description:s.description,exportName:s.exportName,inputs:bs(s.inputs)};return bs(o)}),version:1};t.debug("exporting registry components:",n.components.length);let i=(0,Ky.compress)(n);return btoa(JSON.stringify(i))}async function D6(t,e,r){if(typeof r!="string")throw new Error("Invalid registry to import");let n=await e.getRegistry(),i=JSON.parse(atob(r)),s=(0,Ky.decompress)(i),o=bs(n);t.debug("importing registry components:",s.components.length);for(let a of s.components){let A=Oo(t.normalize(a.filePath)),c=n.components.find(l=>Oo(l.filePath).endsWith(A)&&l.exportName===a.exportName);if(!c){VTe.error(`Could not find component to register: ${a.filePath}, ${a.exportName}`);continue}t.debug(`register (${c.id})`,c.filePath),await e.registerComponent({cmpId:c.id});for(let l of a.inputs)t.debug(`set input (${c.id})`),await e.setRegisteredComponentInput({cmpId:c.id,name:l.name,type:l.type,required:l.required,defaultValue:l.defaultValue,friendlyName:l.friendlyName,helperText:l.helperText});t.debug(`set input (${c.id}) info`);let u=await e.setRegisteredComponentInfo({cmpId:c.id,name:a.name,image:a.image,description:a.description});o=bs(u)}return o}var Ky,VTe,w6=L(()=>{"use strict";h();St();Qt();Ky=X(y6(),1),VTe=ve("ImportExportRegistry")});var ss,gkt,b6=L(()=>{"use strict";h();_n();ss={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik",vue:"vue",native:"native"},gkt={[ss.react]:[{version:it.gen1,recommended:!0},{version:it.gen2,recommended:!1}],[ss.remix]:[{version:it.gen1,recommended:!1},{version:it.gen2,recommended:!0}],[ss.angular]:[{version:it.gen2,recommended:!0}],[ss.next]:[{version:it.gen1,recommended:!0},{version:it.gen2,recommended:!1}],[ss.qwik]:[{version:it.gen2,recommended:!0}],[ss.vue]:[{version:it.gen1,recommended:!0},{version:it.gen2,recommended:!1}]}});async function S6(t,e){let r=[],n=new Set;async function i(s){let o=t.join(s,"package.json");try{if(!await t.exists(o))return null;let A=await t.readFile(o);if(A===null)throw new Error(`Failed to read package.json at ${o}`);let c=JSON.parse(A);if(typeof c.name!="string"||c.name.trim()===""||n.has(c.name))return null;n.add(c.name);let u={name:c.name,subPackages:[]},l=await t.readdir(s);for(let d of l)d!=="node_modules"&&(await t.stat(t.join(s,d))).isDirectory()&&u.subPackages.push(d);return r.push(u),u}catch(a){return t.Sentry?.captureException(a,{level:"warning"}),null}}try{let s=t.join(e,"package.json");if(await t.exists(s)){let a=await t.readFile(s);if(a!==null){let A=JSON.parse(a),c={...A.dependencies,...A.devDependencies};for(let u of Object.keys(c)){let l=t.join(e,"node_modules",u);await i(l)}if(Array.isArray(A.workspaces))for(let u of A.workspaces){let l=await t.readdir(t.join(e,u));for(let d of l){let g=t.join(e,u,d);await i(g)}}}}}catch(s){t.Sentry?.captureException(s,{level:"warning"})}return r}var v6=L(()=>{"use strict";h()});async function id(t,e=!1){if(!t.ts)throw new Error("createDevTools() requires a TypeScript instance passed to the 'ts' option");if((!t.frameworks||t.frameworks.length===0)&&(t.frameworks=await Kl(t)),t.frameworks.length===0&&e&&t.frameworks.push({name:"native"}),t.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let r of t.frameworks){let n=WTe[r.name];if(n)try{let i=await n(t);return{...i,exportRegistry:()=>Q6(t,i),importRegistry:o=>D6(t,i,o),framework:zTe[r.name],findAllDependencies:async()=>await S6(t,t.getRepoRootDir())}}catch(i){t.Sentry?.captureException(i,{level:"warning"})}}throw new Error(`Devtools framework not found for ${t.getAppRootDir()}, ${JSON.stringify(t.frameworks,null,2)}`)}var WTe,zTe,x6=L(()=>{"use strict";h();Hl();NY();WY();a9();I9();z9();A6();w6();b6();v6();WTe={"@builder.io/qwik-city":VY,next:TY,"@remix-run/react":o9,react:Pk,"@angular/core":W9,vue:a6,native:Pk},zTe={"@builder.io/qwik-city":ss.qwik,next:ss.next,"@remix-run/react":ss.remix,react:ss.react,"@angular/core":ss.angular,vue:ss.vue,native:ss.native}});var Hm,gR=L(()=>{"use strict";h();Hm=class{connections=new Set;maxConnections=1e3;sys;healthCheckInterval=null;HEALTH_CHECK_INTERVAL_MS=3e4;constructor(e){this.sys=e,this.startHealthMonitoring()}addConnection(e,r){if(this.connections.size>=this.maxConnections){let n=`Max connections (${this.maxConnections}) reached, rejecting new connection`;return console.error(`[ConnectionTracker] ${n}`),this.sys.Sentry?.captureMessage(n,{level:"error",tags:{component:"ConnectionTracker",maxConnections:this.maxConnections.toString(),currentConnections:this.connections.size.toString(),requestUrl:r?.url||"unknown",requestMethod:r?.method||"unknown",userAgent:r?.headers?.["user-agent"]||"unknown",origin:r?.headers?.origin||"unknown",referer:r?.headers?.referer||"unknown"},extra:{connectionLimit:this.maxConnections,activeConnections:this.connections.size,requestHeaders:r?.headers||{},requestUrl:r?.url}}),!1}return this.connections.add(e),e.on("close",()=>{this.removeConnection(e)}),e.on("error",()=>{this.removeConnection(e)}),!0}removeConnection(e){this.connections.delete(e)}getConnectionCount(){return this.connections.size}cleanup(){for(let e of this.connections)e.writable&&e.write(`HTTP/1.1 503 Service Unavailable\r
|
|
1096
|
+
`}var o6=L(()=>{"use strict";h();St()});async function a6(t){let e=await QTe(t);return{builderPageOptions:async()=>({templateContentId:"vue-demo-template-id",pathname:"/builder-demo",title:"Builder + Vue Demo Page"}),ensureBuilderSetup:async()=>(await n6(e)).errors.length>0?[]:[],ensureFigmaImportPage:()=>i6(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Xl(e,{readAllInputTypes:!!n?.readAllInputTypes}),addExternalPackage:n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Xl(e,{readAllInputTypes:!1}),s=i.components.find(o=>o.id===n.cmpId);return{...i,component:s}},registerComponent:async n=>Xl(e,{readAllInputTypes:!1}),setRegisteredComponentInfo:async n=>Xl(e,{readAllInputTypes:!1}),setRegisteredComponentInput:async n=>Xl(e,{readAllInputTypes:!1}),unregisterComponent:async n=>Xl(e,{readAllInputTypes:!1}),getPublicApiKey:()=>_m(e),setPublicApiKey:n=>X9(e,n.publicApiKey),getDependencies:n=>n.sdkVersion===nt.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-vue"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/vue"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>$s(e),setCache:n=>Vs(e,n)}}async function QTe(t){let e=await DTe(t),r=t.getAppRootDir(),n=t.join(r,"src"),i=await Li(t),s={},o={...t,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",vueConfigPath:e,typescriptEnabled:i,configType:"",isNuxt:await wTe(t),addExternalPackage:c=>{s[t.join(r,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>s[c]??t.readFileSync(c),existsSync:c=>!!s[c]||t.existsSync(c),readdirSync:c=>{let u=t.readdirSync(c);return c===r?[...u,...Object.keys(s).map(l=>l.slice(r.length+1))]:u},readdir:async c=>{let u=await t.readdir(c);return c===r?[...u,...Object.keys(s).map(l=>l.slice(r.length+1))]:u}};e.includes("webpack.config")&&(o.configType="webpack"),(e.includes("vite.config")||e.includes("nuxt.config"))&&(o.configType="vite");let a=await t.exists(n);o.srcDir=a?n:null;let A=[t.join(r,"components"),t.join(r,"src","components"),t.join(r,"app","components")];for(let c of A)if(await t.exists(c)){o.componentsDir=c;break}return o.componentsDir||(o.componentsDir=a?t.join(n,"components"):t.join(r,"components")),o.registryPath=await rs(t,o.componentsDir),o}async function DTe(t){let e=["nuxt.config.ts","nuxt.config.js","vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts","vue.config.js","vue.config.ts"];for(let r of e){let n=t.join(t.getAppRootDir(),r);if(await t.exists(n))return n}if(t.ignoreMissingConfig)return"";throw new Error(`Could not find Vue config file. Searched for ${e.join(", ")} in "${t.getAppRootDir()}".`)}async function wTe(t){let e=["nuxt.config.ts","nuxt.config.js"];for(let r of e){let n=t.join(t.getAppRootDir(),r);if(await t.exists(n))return!0}try{let r=t.join(t.getAppRootDir(),"package.json");if(await t.exists(r)){let n=JSON.parse(await t.readFile(r)||"{}"),i={...n.dependencies,...n.devDependencies};return!!(i.nuxt||i["@nuxt/kit"]||i.nuxt3)}}catch{}return!1}var A6=L(()=>{"use strict";h();Jl();Wk();r6();_n();Bi();o6()});var Zk=N(Um=>{"use strict";h();Object.defineProperty(Um,"__esModule",{value:!0});Um.getType=c6;Um.throwUnknownDataType=bTe;Um.throwUnsupportedData=STe;function c6(t){return Object.prototype.toString.call(t)}function bTe(t){throw new TypeError("unsupported data type: "+c6(t))}function STe(t){throw new TypeError("unsupported data type: "+t)}});var _y=N(qA=>{"use strict";h();Object.defineProperty(qA,"__esModule",{value:!0});qA.s_to_int=rR;qA.s_to_big_int=u6;qA.int_to_s=nR;qA.big_int_to_s=l6;qA.num_to_s=p6;qA.int_str_to_s=Ly;qA.s_to_num=d6;var YA="";for(let t=0;t<10;t++){let e=String.fromCharCode(48+t);YA+=e}for(let t=0;t<26;t++){let e=String.fromCharCode(65+t);YA+=e}for(let t=0;t<26;t++){let e=String.fromCharCode(97+t);YA+=e}var nd=YA.length,tR={};for(let t=0;t<nd;t++){let e=YA[t];tR[e]=t}function rR(t){let e=0,r=1;for(let n=t.length-1;n>=0;n--){let i=t[n],s=tR[i];s*=r,e+=s,r*=nd}return e}function u6(t){let e=BigInt(0),r=BigInt(1),n=BigInt(nd);for(let i=t.length-1;i>=0;i--){let s=t[i],o=BigInt(tR[s]);o*=r,e+=o,r*=n}return e}function nR(t){if(t===0)return YA[0];let e=[];for(;t!==0;){let r=t%nd,n=YA[r];e.push(n),t-=r,t/=nd}return e.reverse().join("")}function l6(t){let e=BigInt(0),r=BigInt(nd);if(t===e)return YA[0];let n=[];for(;t!==e;){let i=t%r,s=YA[Number(i)];n.push(s),t/=r}return n.reverse().join("")}function g6(t){return t.split("").reverse().join("")}function p6(t){if(t<0)return"-"+p6(-t);let[e,r]=t.toString().split(".");if(!r)if(e.includes("e")){let[s,o]=e.split("e");e=s,r="0e"+o}else return nR(t);let n;r&&([r,n]=r.split("e")),e=Ly(e),r=g6(r),r=Ly(r);let i=e+"."+r;if(n){switch(i+=".",n[0]){case"+":n=n.slice(1);break;case"-":i+="-",n=n.slice(1);break}n=Ly(n),i+=n}return i}function Ly(t){let e=+t;return e.toString()===t&&e+1!==e&&e-1!==e?nR(e):":"+l6(BigInt(t))}function eR(t){return t[0]===":"?u6(t.substring(1)).toString():rR(t).toString()}function d6(t){if(t[0]==="-")return-d6(t.substr(1));let[e,r,n]=t.split(".");if(!r)return rR(e);e=eR(e),r=eR(r),r=g6(r);let i=e+"."+r;if(n){i+="e";let s=!1;n[0]==="-"&&(s=!0,n=n.slice(1)),n=eR(n),i+=s?-n:+n}return+i}});var sR=N($A=>{"use strict";h();Object.defineProperty($A,"__esModule",{value:!0});$A.encodeNum=vTe;$A.decodeNum=xTe;$A.decodeKey=FTe;$A.encodeBool=kTe;$A.decodeBool=RTe;$A.encodeStr=TTe;$A.decodeStr=NTe;var iR=_y();function vTe(t){return t===1/0?"N|+":t===-1/0?"N|-":Number.isNaN(t)?"N|0":"n|"+(0,iR.num_to_s)(t)}function xTe(t){if(t.length===3&&t[0]==="N"&&t[1]==="|")switch(t[2]){case"+":return 1/0;case"-":return-1/0;case"0":return NaN}return(0,iR.s_to_num)(t.slice(2))}function FTe(t){return typeof t=="number"?t:(0,iR.s_to_int)(t)}function kTe(t){return t?"b|T":"b|F"}function RTe(t){if(t.length===3&&t[0]==="b"&&t[1]==="|")switch(t[2]){case"T":return!0;case"F":return!1}return!!t}function TTe(t){if(t[1]==="|")switch(t[0]){case"b":case"o":case"n":case"a":case"s":return"s|"+t}return t}function NTe(t){return t[0]==="s"&&t[1]==="|"?t.substr(2):t}});var oR=N(Uy=>{"use strict";h();Object.defineProperty(Uy,"__esModule",{value:!0});Uy.config=void 0;Uy.config={sort_key:!1,preserve_nan:!1,error_on_nan:!1,preserve_infinite:!1,error_on_infinite:!1}});var AR=N(eg=>{"use strict";h();Object.defineProperty(eg,"__esModule",{value:!0});eg.memToValues=PTe;eg.makeInMemoryStore=f6;eg.makeInMemoryCache=h6;eg.makeInMemoryMemory=LTe;eg.addValue=Gm;var Zl=oR(),Gy=Zk(),aR=sR(),MTe=_y();function PTe(t){return t.store.toArray()}function f6(){let t=[];return{forEach(e){for(let r=0;r<t.length;r++)if(e(t[r])==="break")return},add(e){t.push(e)},toArray(){return t}}}function h6(){let t=Object.create(null),e=Object.create(null);return{getValue(r){return t[r]},getSchema(r){return e[r]},forEachValue(r){for(let[n,i]of Object.entries(t))if(r(n,i)==="break")return},forEachSchema(r){for(let[n,i]of Object.entries(e))if(r(n,i)==="break")return},setValue(r,n){t[r]=n},setSchema(r,n){e[r]=n},hasValue(r){return r in t},hasSchema(r){return r in e}}}function LTe(){return{store:f6(),cache:h6(),keyCount:0}}function Ya(t,e){if(t.cache.hasValue(e))return t.cache.getValue(e);let r=t.keyCount++,n=(0,MTe.num_to_s)(r);return t.store.add(e),t.cache.setValue(e,n),n}function _Te(t,e){Zl.config.sort_key&&e.sort();let r=e.join(",");if(t.cache.hasSchema(r))return t.cache.getSchema(r);let n=Gm(t,e,void 0);return t.cache.setSchema(r,n),n}function Gm(t,e,r){if(e===null)return"";switch(typeof e){case"undefined":if(Array.isArray(r))return Gm(t,null,r);break;case"object":if(e===null)return Ya(t,null);if(Array.isArray(e)){let n="a";for(let i=0;i<e.length;i++){let s=e[i],o=s===null?"_":Gm(t,s,e);n+="|"+o}return n==="a"&&(n="a|"),Ya(t,n)}else{let n=Object.keys(e);if(n.length===0)return Ya(t,"o|");let i="o",s=_Te(t,n);i+="|"+s;for(let o of n){let a=e[o],A=Gm(t,a,e);i+="|"+A}return Ya(t,i)}case"boolean":return Ya(t,(0,aR.encodeBool)(e));case"number":return Number.isNaN(e)?Zl.config.preserve_nan?Ya(t,"N|0"):(Zl.config.error_on_nan&&(0,Gy.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===e?Zl.config.preserve_infinite?Ya(t,"N|+"):(Zl.config.error_on_infinite&&(0,Gy.throwUnsupportedData)("[number Infinity]"),""):Number.NEGATIVE_INFINITY===e?Zl.config.preserve_infinite?Ya(t,"N|-"):(Zl.config.error_on_infinite&&(0,Gy.throwUnsupportedData)("[number -Infinity]"),""):Ya(t,(0,aR.encodeNum)(e));case"string":return Ya(t,(0,aR.encodeStr)(e))}return(0,Gy.throwUnknownDataType)(e)}});var lR=N(Km=>{"use strict";h();Object.defineProperty(Km,"__esModule",{value:!0});Km.compress=GTe;Km.decode=Om;Km.decompress=HTe;var cR=Zk(),m6=sR(),uR=AR(),UTe=_y();function GTe(t){let e=(0,uR.makeInMemoryMemory)(),r=(0,uR.addValue)(e,t,void 0);return[(0,uR.memToValues)(e),r]}function OTe(t,e){if(e==="o|")return{};let r={},n=e.split("|"),i=n[1],s=Om(t,i),o=n.length;o-2===1&&!Array.isArray(s)&&(s=[s]);for(let a=2;a<o;a++){let A=s[a-2],c=n[a];c=Om(t,c),r[A]=c}return r}function KTe(t,e){if(e==="a|")return[];let r=e.split("|"),n=r.length-1,i=new Array(n);for(let s=0;s<n;s++){let o=r[s+1];o=Om(t,o),i[s]=o}return i}function Om(t,e){if(e===""||e==="_")return null;let r=(0,m6.decodeKey)(e),n=t[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":if(n[1]==="|")switch(n[0]){case"b":switch(n[2]){case"T":return!0;case"F":return!1;default:return(0,cR.throwUnknownDataType)(n)}case"o":return OTe(t,n);case"n":return(0,UTe.s_to_num)(n.slice(2));case"N":switch(n[2]){case"+":return 1/0;case"-":return-1/0;case"0":return NaN;default:return(0,cR.throwUnknownDataType)(n)}case"a":return KTe(t,n)}return(0,m6.decodeStr)(n)}return(0,cR.throwUnknownDataType)(n)}function HTe(t){let[e,r]=t;return Om(e,r)}});var I6=N(Oy=>{"use strict";h();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.trimUndefined=JTe;Oy.trimUndefinedRecursively=jTe;function JTe(t){for(let e in t)t[e]===void 0&&delete t[e]}function jTe(t){C6(t,new Set)}function C6(t,e){e.add(t);for(let r in t)if(t[r]===void 0)delete t[r];else{let n=t[r];n&&typeof n=="object"&&!e.has(n)&&C6(n,e)}}});var y6=N(yi=>{"use strict";h();Object.defineProperty(yi,"__esModule",{value:!0});yi.config=yi.trimUndefinedRecursively=yi.trimUndefined=yi.addValue=yi.decode=yi.decompress=yi.compress=void 0;var E6=lR();Object.defineProperty(yi,"compress",{enumerable:!0,get:function(){return E6.compress}});Object.defineProperty(yi,"decompress",{enumerable:!0,get:function(){return E6.decompress}});var YTe=lR();Object.defineProperty(yi,"decode",{enumerable:!0,get:function(){return YTe.decode}});var qTe=AR();Object.defineProperty(yi,"addValue",{enumerable:!0,get:function(){return qTe.addValue}});var B6=I6();Object.defineProperty(yi,"trimUndefined",{enumerable:!0,get:function(){return B6.trimUndefined}});Object.defineProperty(yi,"trimUndefinedRecursively",{enumerable:!0,get:function(){return B6.trimUndefinedRecursively}});var $Te=oR();Object.defineProperty(yi,"config",{enumerable:!0,get:function(){return $Te.config}})});async function Q6(t,e){let n={components:(await e.getRegistry()).components.filter(s=>s.isRegistered).map(s=>{let o={filePath:Oo(t.relative(t.getAppRootDir(),s.filePath)),name:s.name,image:s.image,description:s.description,exportName:s.exportName,inputs:bs(s.inputs)};return bs(o)}),version:1};t.debug("exporting registry components:",n.components.length);let i=(0,Ky.compress)(n);return btoa(JSON.stringify(i))}async function D6(t,e,r){if(typeof r!="string")throw new Error("Invalid registry to import");let n=await e.getRegistry(),i=JSON.parse(atob(r)),s=(0,Ky.decompress)(i),o=bs(n);t.debug("importing registry components:",s.components.length);for(let a of s.components){let A=Oo(t.normalize(a.filePath)),c=n.components.find(l=>Oo(l.filePath).endsWith(A)&&l.exportName===a.exportName);if(!c){VTe.error(`Could not find component to register: ${a.filePath}, ${a.exportName}`);continue}t.debug(`register (${c.id})`,c.filePath),await e.registerComponent({cmpId:c.id});for(let l of a.inputs)t.debug(`set input (${c.id})`),await e.setRegisteredComponentInput({cmpId:c.id,name:l.name,type:l.type,required:l.required,defaultValue:l.defaultValue,friendlyName:l.friendlyName,helperText:l.helperText});t.debug(`set input (${c.id}) info`);let u=await e.setRegisteredComponentInfo({cmpId:c.id,name:a.name,image:a.image,description:a.description});o=bs(u)}return o}var Ky,VTe,w6=L(()=>{"use strict";h();St();Qt();Ky=X(y6(),1),VTe=ve("ImportExportRegistry")});var ss,gkt,b6=L(()=>{"use strict";h();_n();ss={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik",vue:"vue",native:"native"},gkt={[ss.react]:[{version:nt.gen1,recommended:!0},{version:nt.gen2,recommended:!1}],[ss.remix]:[{version:nt.gen1,recommended:!1},{version:nt.gen2,recommended:!0}],[ss.angular]:[{version:nt.gen2,recommended:!0}],[ss.next]:[{version:nt.gen1,recommended:!0},{version:nt.gen2,recommended:!1}],[ss.qwik]:[{version:nt.gen2,recommended:!0}],[ss.vue]:[{version:nt.gen1,recommended:!0},{version:nt.gen2,recommended:!1}]}});async function S6(t,e){let r=[],n=new Set;async function i(s){let o=t.join(s,"package.json");try{if(!await t.exists(o))return null;let A=await t.readFile(o);if(A===null)throw new Error(`Failed to read package.json at ${o}`);let c=JSON.parse(A);if(typeof c.name!="string"||c.name.trim()===""||n.has(c.name))return null;n.add(c.name);let u={name:c.name,subPackages:[]},l=await t.readdir(s);for(let d of l)d!=="node_modules"&&(await t.stat(t.join(s,d))).isDirectory()&&u.subPackages.push(d);return r.push(u),u}catch(a){return t.Sentry?.captureException(a,{level:"warning"}),null}}try{let s=t.join(e,"package.json");if(await t.exists(s)){let a=await t.readFile(s);if(a!==null){let A=JSON.parse(a),c={...A.dependencies,...A.devDependencies};for(let u of Object.keys(c)){let l=t.join(e,"node_modules",u);await i(l)}if(Array.isArray(A.workspaces))for(let u of A.workspaces){let l=await t.readdir(t.join(e,u));for(let d of l){let g=t.join(e,u,d);await i(g)}}}}}catch(s){t.Sentry?.captureException(s,{level:"warning"})}return r}var v6=L(()=>{"use strict";h()});async function id(t,e=!1){if(!t.ts)throw new Error("createDevTools() requires a TypeScript instance passed to the 'ts' option");if((!t.frameworks||t.frameworks.length===0)&&(t.frameworks=await Kl(t)),t.frameworks.length===0&&e&&t.frameworks.push({name:"native"}),t.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let r of t.frameworks){let n=WTe[r.name];if(n)try{let i=await n(t);return{...i,exportRegistry:()=>Q6(t,i),importRegistry:o=>D6(t,i,o),framework:zTe[r.name],findAllDependencies:async()=>await S6(t,t.getRepoRootDir())}}catch(i){t.Sentry?.captureException(i,{level:"warning"})}}throw new Error(`Devtools framework not found for ${t.getAppRootDir()}, ${JSON.stringify(t.frameworks,null,2)}`)}var WTe,zTe,x6=L(()=>{"use strict";h();Hl();NY();WY();a9();I9();z9();A6();w6();b6();v6();WTe={"@builder.io/qwik-city":VY,next:TY,"@remix-run/react":o9,react:Pk,"@angular/core":W9,vue:a6,native:Pk},zTe={"@builder.io/qwik-city":ss.qwik,next:ss.next,"@remix-run/react":ss.remix,react:ss.react,"@angular/core":ss.angular,vue:ss.vue,native:ss.native}});var Hm,gR=L(()=>{"use strict";h();Hm=class{connections=new Set;maxConnections=1e3;sys;healthCheckInterval=null;HEALTH_CHECK_INTERVAL_MS=3e4;constructor(e){this.sys=e,this.startHealthMonitoring()}addConnection(e,r){if(this.connections.size>=this.maxConnections){let n=`Max connections (${this.maxConnections}) reached, rejecting new connection`;return console.error(`[ConnectionTracker] ${n}`),this.sys.Sentry?.captureMessage(n,{level:"error",tags:{component:"ConnectionTracker",maxConnections:this.maxConnections.toString(),currentConnections:this.connections.size.toString(),requestUrl:r?.url||"unknown",requestMethod:r?.method||"unknown",userAgent:r?.headers?.["user-agent"]||"unknown",origin:r?.headers?.origin||"unknown",referer:r?.headers?.referer||"unknown"},extra:{connectionLimit:this.maxConnections,activeConnections:this.connections.size,requestHeaders:r?.headers||{},requestUrl:r?.url}}),!1}return this.connections.add(e),e.on("close",()=>{this.removeConnection(e)}),e.on("error",()=>{this.removeConnection(e)}),!0}removeConnection(e){this.connections.delete(e)}getConnectionCount(){return this.connections.size}cleanup(){for(let e of this.connections)e.writable&&e.write(`HTTP/1.1 503 Service Unavailable\r
|
|
1097
1097
|
\r
|
|
1098
1098
|
`),e.destroy();this.connections.clear(),this.stopHealthMonitoring()}startHealthMonitoring(){this.healthCheckInterval||(this.healthCheckInterval=setInterval(()=>{this.performHealthCheck()},this.HEALTH_CHECK_INTERVAL_MS))}stopHealthMonitoring(){this.healthCheckInterval&&(clearInterval(this.healthCheckInterval),this.healthCheckInterval=null)}performHealthCheck(){let e=[];for(let r of this.connections)if(r.destroyed||!r.writable){e.push(r);continue}for(let r of e){this.removeConnection(r);try{r.destroy()}catch{}}}}});var F6=L(()=>{"use strict";h()});var k6=L(()=>{"use strict";h();gR();F6();Hl()});var jkt,R6=L(()=>{"use strict";h();Jr();qp();Ho();Hl();Qt();jkt=ve("NextConfig")});var T6=L(()=>{"use strict";h();Jr();qp();Ho();Ma()});var N6=L(()=>{"use strict";h();Jr();Ho();qp()});var M6=L(()=>{"use strict";h()});var P6=L(()=>{"use strict";h();Ho();Jr()});var QRt,L6=L(()=>{"use strict";h();Hl();$l();R6();T6();N6();M6();P6();QRt=`
|
|
1099
1099
|
/** @type {import('next').NextConfig} */
|
|
@@ -1276,7 +1276,7 @@ Restarting server after Builder Devtools update...
|
|
|
1276
1276
|
<h3>How's Devtools working for you?</h3>
|
|
1277
1277
|
<p>We'd love your feedback!</p>
|
|
1278
1278
|
</div>
|
|
1279
|
-
\`,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",a=>{a.preventDefault(),a.stopPropagation(),Ee(t,!1),window.open(Ur(),"builder")}),t.getElementById("components-link").addEventListener("click",a=>{a.preventDefault(),a.stopPropagation();let c=t.querySelector(".nav-cmp-list .section-content");c.scrollTop=0,oe(t,"nav-cmp-list"),ai(t)}),t.getElementById("settings-link").addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),oe(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),Ee(t,!1),window.open(je(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",a=>{a.preventDefault(),a.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(),Ht(e.checked)}),e.checked=it(),Ht(e.checked)}var Dt=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>\`,si(e),ui(e),oi(e),ri(e),ti(e),ci(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.59.2-beta.202605251348.eef0ced"}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)}
|
|
1279
|
+
\`,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",a=>{a.preventDefault(),a.stopPropagation(),Ee(t,!1),window.open(Ur(),"builder")}),t.getElementById("components-link").addEventListener("click",a=>{a.preventDefault(),a.stopPropagation();let c=t.querySelector(".nav-cmp-list .section-content");c.scrollTop=0,oe(t,"nav-cmp-list"),ai(t)}),t.getElementById("settings-link").addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),oe(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),Ee(t,!1),window.open(je(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",a=>{a.preventDefault(),a.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(),Ht(e.checked)}),e.checked=it(),Ht(e.checked)}var Dt=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>\`,si(e),ui(e),oi(e),ri(e),ti(e),ci(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.59.2"}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)}
|
|
1280
1280
|
</style>\`,Nt=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=lo+\`<main>
|
|
1281
1281
|
<aside>
|
|
1282
1282
|
<div class="logo"></div>
|
|
@@ -1315,7 +1315,7 @@ Restarting server after Builder Devtools update...
|
|
|
1315
1315
|
</nav>
|
|
1316
1316
|
</section>
|
|
1317
1317
|
</main>
|
|
1318
|
-
\`,po();let r=new URL(Fr,ot);r.searchParams.set(Br,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 jr()).isValid||fo()},fo=()=>{customElements.get("builder-dev-tools-overview")||customElements.define("builder-dev-tools-overview",Nt);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",at),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",Dt);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.59.2
|
|
1318
|
+
\`,po();let r=new URL(Fr,ot);r.searchParams.set(Br,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 jr()).isValid||fo()},fo=()=>{customElements.get("builder-dev-tools-overview")||customElements.define("builder-dev-tools-overview",Nt);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",at),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",Dt);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.59.2"),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.59.2"),mo());})();`)}async function Ere(t){return Bre(t,`<!doctype html>
|
|
1319
1319
|
<html lang="en" dir="ltr">
|
|
1320
1320
|
<head>
|
|
1321
1321
|
<meta charset="utf-8" />
|
|
@@ -1956,7 +1956,7 @@ To send follow-up messages or additional context to this branch, use the tool Se
|
|
|
1956
1956
|
This command has been removed. You can create mapper files manually.
|
|
1957
1957
|
See: https://www.builder.io/c/docs/mapping-functions`);break;case"auth":q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bold)("Authentication")}
|
|
1958
1958
|
|
|
1959
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
1959
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} auth `))}
|
|
1960
1960
|
|
|
1961
1961
|
Re-authenticate with Figma and Builder.io.
|
|
1962
1962
|
|
|
@@ -1972,7 +1972,7 @@ ${(0,ie.yellow)("Non-Interactive Authentication:")}
|
|
|
1972
1972
|
Example using environment variables:
|
|
1973
1973
|
${(0,ie.dim)('export BUILDER_PRIVATE_KEY="your-private-key"')}
|
|
1974
1974
|
${(0,ie.dim)('export FIGMA_PERSONAL_TOKEN="your-figma-token"')}
|
|
1975
|
-
${(0,ie.dim)(`npx ${
|
|
1975
|
+
${(0,ie.dim)(`npx ${st()} figma generate <url> --ci`)}
|
|
1976
1976
|
|
|
1977
1977
|
${(0,ie.yellow)("Arguments:")}
|
|
1978
1978
|
${(0,ie.cyan)("--figmaToken")} Figma access token for authentication
|
|
@@ -1988,17 +1988,17 @@ ${(0,ie.yellow)("Learn More:")}
|
|
|
1988
1988
|
${(0,ie.yellow)("Subcommands:")}
|
|
1989
1989
|
${(0,ie.cyan)("status")} Check if you are authenticated and display user/space info
|
|
1990
1990
|
|
|
1991
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
1991
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} auth status `))}
|
|
1992
1992
|
|
|
1993
1993
|
Check authentication status and user information.
|
|
1994
1994
|
|
|
1995
1995
|
${(0,ie.yellow)("Clear Credentials:")}
|
|
1996
1996
|
|
|
1997
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
1997
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} auth --reset `))}
|
|
1998
1998
|
|
|
1999
1999
|
Clear all stored credentials to logout or switch accounts.`);break;case"publish":q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bold)("Publish Mappings")}
|
|
2000
2000
|
|
|
2001
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
2001
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} figma publish `))}
|
|
2002
2002
|
|
|
2003
2003
|
Publish your Figma Mappings to Builder.io.
|
|
2004
2004
|
|
|
@@ -2011,7 +2011,7 @@ ${(0,ie.yellow)("Arguments:")}
|
|
|
2011
2011
|
${(0,ie.cyan)("--yes")} Auto-confirm all prompts
|
|
2012
2012
|
${(0,ie.cyan)("--clearMappings")} Remove all mappings from the space, publishing zero mappings`);break;case"migrate":q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bold)("Migrate Mappings")}
|
|
2013
2013
|
|
|
2014
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
2014
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} figma migrate `))}
|
|
2015
2015
|
|
|
2016
2016
|
Migrate your existing Figma Mappings into the repo as local files.
|
|
2017
2017
|
|
|
@@ -2023,7 +2023,7 @@ ${(0,ie.yellow)("Arguments:")}
|
|
|
2023
2023
|
${(0,ie.cyan)("--force")} Force migration even if there are warnings
|
|
2024
2024
|
${(0,ie.cyan)("--yes")} Auto-confirm all prompts`);break;case"code":q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bold)("Code Generation")}
|
|
2025
2025
|
|
|
2026
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
2026
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} code --url URL `))}
|
|
2027
2027
|
|
|
2028
2028
|
Generate or modify code based on Figma designs.
|
|
2029
2029
|
|
|
@@ -2041,7 +2041,7 @@ ${(0,ie.yellow)("Configuration Files:")}
|
|
|
2041
2041
|
${(0,ie.cyan)(".builderrules")} Add custom instructions that will be injected into the LLM prompt
|
|
2042
2042
|
${(0,ie.cyan)(".cursorrules")} Cursor's settings are automatically supported for consistent behavior`);break;case"indexing":q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bold)("Code Indexing")}
|
|
2043
2043
|
|
|
2044
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
2044
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} code indexing `))}
|
|
2045
2045
|
|
|
2046
2046
|
Index your codebase to improve code generation results.
|
|
2047
2047
|
|
|
@@ -2049,7 +2049,7 @@ ${(0,ie.yellow)("Arguments:")}
|
|
|
2049
2049
|
${(0,ie.cyan)("--spaceId")} Builder.io space ID to use
|
|
2050
2050
|
${(0,ie.cyan)("--cwd")} Working directory to run commands from`);break;case"index-repo":case"repo-index":q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bold)("Repository Indexing")}
|
|
2051
2051
|
|
|
2052
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
2052
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} index-repo `))}
|
|
2053
2053
|
|
|
2054
2054
|
Index your entire repository to improve code generation results.
|
|
2055
2055
|
|
|
@@ -2066,11 +2066,11 @@ ${(0,ie.yellow)("Arguments:")}
|
|
|
2066
2066
|
${(0,ie.cyan)("--instructions")} Add extra instructions to be taken into account during repo indexing
|
|
2067
2067
|
|
|
2068
2068
|
${(0,ie.yellow)("Examples:")}
|
|
2069
|
-
${(0,ie.cyan)(`npx ${
|
|
2070
|
-
${(0,ie.cyan)(`npx ${
|
|
2071
|
-
${(0,ie.cyan)(`npx ${
|
|
2069
|
+
${(0,ie.cyan)(`npx ${st()} index-repo`)} - Index entire repository
|
|
2070
|
+
${(0,ie.cyan)(`npx ${st()} index-repo --components "Button,Input,Card"`)} - Reindex specific components
|
|
2071
|
+
${(0,ie.cyan)(`npx ${st()} index-repo --components "Button" --force`)} - Force reindex Button component`);break;case"launch":case"fusion":q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bold)("Fusion Development Server")}
|
|
2072
2072
|
|
|
2073
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
2073
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} launch -p <port> -c <command> `))}
|
|
2074
2074
|
|
|
2075
2075
|
This command will:
|
|
2076
2076
|
1. Run your development server command
|
|
@@ -2079,19 +2079,18 @@ This command will:
|
|
|
2079
2079
|
|
|
2080
2080
|
${(0,ie.yellow)("Arguments:")}
|
|
2081
2081
|
${(0,ie.cyan)("-p, --port")} Port number where your application is running
|
|
2082
|
-
${(0,ie.cyan)("-c, --command")}
|
|
2083
|
-
${(0,ie.cyan)("--no-open")}
|
|
2084
|
-
${(0,ie.cyan)("--
|
|
2085
|
-
${(0,ie.cyan)("--privacyMode")} Enable privacy mode for codegen (encrypts sensitive data)
|
|
2082
|
+
${(0,ie.cyan)("-c, --command")} Command to run your development server
|
|
2083
|
+
${(0,ie.cyan)("--no-open")} Skip automatically opening the browser
|
|
2084
|
+
${(0,ie.cyan)("--privacyMode")} Enable privacy mode for codegen (encrypts sensitive data)
|
|
2086
2085
|
${(0,ie.cyan)("--chat")} Open Builder in chat-only mode
|
|
2087
2086
|
|
|
2088
2087
|
${(0,ie.yellow)("Example:")}
|
|
2089
|
-
${(0,ie.cyan)(
|
|
2088
|
+
${(0,ie.cyan)('npx builder.io launch -p 3000 -c "npm run dev"')}
|
|
2090
2089
|
|
|
2091
2090
|
${(0,ie.yellow)("Note:")}
|
|
2092
2091
|
- The proxy runs on port ${(0,ie.cyan)("48752")} and the API server on port ${(0,ie.cyan)("48753")}`);break;case"launch-init":nr(`${(0,ie.cyan)("\u2192")} ${(0,ie.bold)("Initialize Builder.io Repository")}
|
|
2093
2092
|
|
|
2094
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
2093
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} init `))}
|
|
2095
2094
|
|
|
2096
2095
|
Clone and initialize a repository for use with Builder.io.
|
|
2097
2096
|
|
|
@@ -2101,7 +2100,7 @@ ${(0,ie.yellow)("Arguments:")}
|
|
|
2101
2100
|
${(0,ie.cyan)("--githubToken")} GitHub token for private repositories
|
|
2102
2101
|
${(0,ie.cyan)("--installCommand")} Command to install dependencies (defaults to npm install)`);break;case"repo-connect":case"connect-repo":q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bold)("Connect Repository to Builder.io")}
|
|
2103
2102
|
|
|
2104
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
2103
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} connect-repo `))}
|
|
2105
2104
|
|
|
2106
2105
|
Connect your existing git repository to Builder.io Fusion by creating a new project.
|
|
2107
2106
|
|
|
@@ -2129,9 +2128,9 @@ ${(0,ie.yellow)("Features:")}
|
|
|
2129
2128
|
|
|
2130
2129
|
${(0,ie.yellow)("Example:")}
|
|
2131
2130
|
${(0,ie.cyan)("cd /path/to/your/project")}
|
|
2132
|
-
${(0,ie.cyan)(`npx ${
|
|
2133
|
-
${(0,ie.cyan)(`npx ${
|
|
2134
|
-
${(0,ie.cyan)(`npx ${
|
|
2131
|
+
${(0,ie.cyan)(`npx ${st()} connect-repo`)}
|
|
2132
|
+
${(0,ie.cyan)(`npx ${st()} connect-repo --installCommand "pnpm install"`)}
|
|
2133
|
+
${(0,ie.cyan)(`npx ${st()} connect-repo --dryrun`)}
|
|
2135
2134
|
|
|
2136
2135
|
${(0,ie.yellow)("Note:")}
|
|
2137
2136
|
- Must be run from within a git repository
|
|
@@ -2139,7 +2138,7 @@ ${(0,ie.yellow)("Note:")}
|
|
|
2139
2138
|
- Environment variables can be selected interactively
|
|
2140
2139
|
- Use --dryrun to preview the configuration without creating the project`);break;case"push":q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bold)("Push to Builder.io")}
|
|
2141
2140
|
|
|
2142
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
2141
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} push `))}
|
|
2143
2142
|
|
|
2144
2143
|
Push your local git commits to the remote and ensure a Builder branch exists
|
|
2145
2144
|
in Builder.io for the current git branch (creating one automatically if needed).
|
|
@@ -2149,10 +2148,10 @@ ${(0,ie.yellow)("Arguments:")}
|
|
|
2149
2148
|
${(0,ie.cyan)("--dry-run")} Run git push --dry-run without making changes
|
|
2150
2149
|
|
|
2151
2150
|
${(0,ie.yellow)("Examples:")}
|
|
2152
|
-
${(0,ie.cyan)(`npx ${
|
|
2153
|
-
${(0,ie.cyan)(`npx ${
|
|
2151
|
+
${(0,ie.cyan)(`npx ${st()} push`)}
|
|
2152
|
+
${(0,ie.cyan)(`npx ${st()} push --project abc123`)}`);break;case"pull":q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bold)("Pull from Builder.io")}
|
|
2154
2153
|
|
|
2155
|
-
${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
2154
|
+
${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} pull <builder-branch-or-url> `))}
|
|
2156
2155
|
|
|
2157
2156
|
Pull commits that the Builder.io web app has pushed to the git remote down
|
|
2158
2157
|
into your local repo. The web app must have pushed its changes upstream first.
|
|
@@ -2163,17 +2162,17 @@ ${(0,ie.yellow)("Arguments:")}
|
|
|
2163
2162
|
${(0,ie.cyan)("--dry-run")} Show what would be pulled without applying changes
|
|
2164
2163
|
|
|
2165
2164
|
${(0,ie.yellow)("Examples:")}
|
|
2166
|
-
${(0,ie.cyan)(`npx ${
|
|
2167
|
-
${(0,ie.cyan)(`npx ${
|
|
2168
|
-
${(0,ie.cyan)(`npx ${
|
|
2169
|
-
`),[{command:"figma publish",description:"Publish your Figma Mappings to Builder.io"},{command:"figma migrate",description:"Migrate existing Figma Mappings into the repo as local files"},{command:"figma auth",description:"Authenticate with Figma and Builder.io"}].forEach(({command:n,description:i})=>{q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
2165
|
+
${(0,ie.cyan)(`npx ${st()} pull my-feature-branch`)}
|
|
2166
|
+
${(0,ie.cyan)(`npx ${st()} pull my-feature-branch --project abc123`)}
|
|
2167
|
+
${(0,ie.cyan)(`npx ${st()} pull https://builder.io/app/projects/<projectId>/<branchName>`)}`);break;case"figma":q.info(`${(0,ie.bold)("Figma Commands:")}
|
|
2168
|
+
`),[{command:"figma publish",description:"Publish your Figma Mappings to Builder.io"},{command:"figma migrate",description:"Migrate existing Figma Mappings into the repo as local files"},{command:"figma auth",description:"Authenticate with Figma and Builder.io"}].forEach(({command:n,description:i})=>{q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} ${n} `))}
|
|
2170
2169
|
${(0,ie.dim)(i)}
|
|
2171
2170
|
`)}),q.info(`For detailed help about a specific command, run:
|
|
2172
|
-
${(0,ie.cyan)(`npx ${
|
|
2173
|
-
`),[{command:"launch",description:"Launch Builder Fusion development server"},{command:"auth",description:"Authenticate with Builder.io"},{command:"index-repo",description:"Index your design system repository for AI code generation"},{command:"connect-repo",description:"Connect your git repository to Builder.io Fusion"},{command:"code",description:"Generate or modify code based on Figma designs"},{command:"figma publish",description:"Publish your Figma Mappings to Builder.io"},{command:"figma migrate",description:"Migrate existing Figma Mappings into the repo as local files"},{command:"add",description:"Add a component to your project"},{command:"push",description:"Push local changes to a Builder.io branch"},{command:"pull",description:"Pull changes from a Builder.io branch"}].forEach(({command:n,description:i})=>{q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bgGreen)((0,ie.white)(` npx ${
|
|
2171
|
+
${(0,ie.cyan)(`npx ${st()} figma <command> --help`)}`);break;default:q.info(`${(0,ie.bold)("Available Commands:")}
|
|
2172
|
+
`),[{command:"launch",description:"Launch Builder Fusion development server"},{command:"auth",description:"Authenticate with Builder.io"},{command:"index-repo",description:"Index your design system repository for AI code generation"},{command:"connect-repo",description:"Connect your git repository to Builder.io Fusion"},{command:"code",description:"Generate or modify code based on Figma designs"},{command:"figma publish",description:"Publish your Figma Mappings to Builder.io"},{command:"figma migrate",description:"Migrate existing Figma Mappings into the repo as local files"},{command:"add",description:"Add a component to your project"},{command:"push",description:"Push local changes to a Builder.io branch"},{command:"pull",description:"Pull changes from a Builder.io branch"}].forEach(({command:n,description:i})=>{q.info(`${(0,ie.cyan)("\u2192")} ${(0,ie.bgGreen)((0,ie.white)(` npx ${st()} ${n} `))}
|
|
2174
2173
|
${(0,ie.dim)(i)}
|
|
2175
2174
|
`)}),q.info(`For detailed help about a specific command, run:
|
|
2176
|
-
${(0,ie.cyan)(`npx ${
|
|
2175
|
+
${(0,ie.cyan)(`npx ${st()} <command> --help`)}`)}fn("bye \u{1F44B}")}var ie,TE=L(()=>{"use strict";h();er();ie=X(Ir(),1);St();ks();Wr()});function NE(){let{env:t}=JO.default,{TERM:e,TERM_PROGRAM:r}=t;return JO.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var JO,jO=L(()=>{h();JO=X(require("node:process"),1)});var YO,Ah,ME,Ttt,gi,qO,uS,Ntt,Mtt,Ptt,Ltt,al=L(()=>{"use strict";h();jO();YO=X(Ir(),1),Ah=X(sy(),1);Qt();ME=X(Ir(),1),Ttt=ve("Spinner"),gi=()=>{let t=qO?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=qO?80:120,r,n=!1,i="",s="",o="",a=m=>{let C=m>1?"Something went wrong":"Canceled";n&&g(C,m)},A=(m,C)=>{Ttt.error(C,m),a(2)},c=()=>a(1),u=()=>{process.on("uncaughtExceptionMonitor",A),process.on("unhandledRejection",A),process.on("SIGINT",c),process.on("SIGTERM",c),process.on("exit",a)},l=()=>{process.removeListener("uncaughtExceptionMonitor",A),process.removeListener("unhandledRejection",A),process.removeListener("SIGINT",c),process.removeListener("SIGTERM",c),process.removeListener("exit",a)},d=(m="")=>{n=!0,i=m.replace(/\.+$/,""),process.stdout.write(`${YO.default.gray(Ntt)}
|
|
2177
2176
|
`);let C=0,I=0;u(),process.env.CI||(r=setInterval(()=>{let B=YO.default.magenta(t[C]),E=".".repeat(Math.floor(I)).slice(0,3);process.stdout.write(Ah.cursor.move(-999,-o.split(`
|
|
2178
2177
|
`).length+1)),process.stdout.write(Ah.erase.down(o.split(`
|
|
2179
2178
|
`).length));let y=`${B} ${i}${E}${s}`;process.stdout.write(y),C=C+1<t.length?C+1:0,I=I<t.length?I+.125:0,o=y},e))},g=(m,C=0)=>{i=m??i,n=!1,clearInterval(r);let I=C===0?(0,ME.green)(Ltt):C===1?(0,ME.red)(Mtt):(0,ME.red)(Ptt);process.stdout.write(Ah.cursor.move(-999,-o.split(`
|
|
@@ -2183,52 +2182,52 @@ ${(0,ie.yellow)("Examples:")}
|
|
|
2183
2182
|
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var Yge=L(()=>{h();jge()});async function a8(t=jtt){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!r)throw new o8(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=n.lastIndexOf("."),s=n.lastIndexOf("-"),o=i===-1?void 0:n.slice(0,i),a=s===-1?void 0:n.slice(0,s);return gS[n]??gS[o]??gS[a]??{name:n,id:n}}var qge,$ge,jtt,gS,J7t,o8,Vge=L(()=>{h();qge=require("node:util"),$ge=require("node:child_process"),jtt=(0,qge.promisify)($ge.execFile),gS={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},J7t=new Map(Object.entries(gS)),o8=class extends Error{}});async function A8(){if(pS.default.platform==="darwin"){let t=await n8();return{name:await s8(t),id:t}}if(pS.default.platform==="linux"){let{stdout:t}=await Ytt("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:qtt(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(pS.default.platform==="win32")return a8();throw new Error("Only macOS, Linux, and Windows are supported")}var Wge,pS,zge,Ytt,qtt,Xge=L(()=>{h();Wge=require("node:util"),pS=X(require("node:process"),1),zge=require("node:child_process");Oge();Yge();Vge();Ytt=(0,Wge.promisify)(zge.execFile),qtt=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});async function Vtt(){let t=await r8(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=l8.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await $tt(t,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",r],{encoding:"utf8"}),i=n.trim(),s={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return s[i]?{id:s[i]}:{}}function rpe(t){if(typeof t=="string"||Array.isArray(t))return t;let{[epe]:e}=t;if(!e)throw new Error(`${epe} is not supported`);return e}function hS({[ch]:t},{wsl:e}){if(e&&Al)return rpe(e);if(!t)throw new Error(`${ch} is not supported`);return rpe(t)}var u8,l8,g8,npe,ipe,p8,fS,$tt,c8,Zge,ch,epe,tpe,dS,Wtt,sp,spe,ope=L(()=>{h();u8=X(require("node:process"),1),l8=require("node:buffer"),g8=X(require("node:path"),1),npe=require("node:url"),ipe=require("node:util"),p8=X(require("node:child_process"),1),fS=X(require("node:fs/promises"),1);Pge();Lge();Xge();XO();$tt=(0,ipe.promisify)(p8.default.execFile),c8=g8.default.dirname((0,npe.fileURLToPath)("file:///C:/bundled/open/index.js")),Zge=g8.default.join(c8,"xdg-open"),{platform:ch,arch:epe}=u8.default;tpe=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},dS=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return tpe(t.app,a=>dS({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return tpe(e,a=>dS({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},A={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=Al?await Vtt():await A8();if(c.id in a){let u=a[c.id];return e==="browserPrivate"&&r.push(A[u]),dS({...t,app:{name:sp[u],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],s={};if(ch==="darwin")n="open",t.wait&&i.push("--wait-apps"),t.background&&i.push("--background"),t.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(ch==="win32"||Al&&!ip()&&!e){n=await r8(),i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Al||(s.windowsVerbatimArguments=!0);let a=["Start"];t.wait&&a.push("-Wait"),e?(a.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&a.push(`"${t.target}"`),r.length>0&&(r=r.map(A=>`"\`"${A}\`""`),a.push("-ArgumentList",r.join(","))),t.target=l8.Buffer.from(a.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!c8||c8==="/",A=!1;try{await fS.default.access(Zge,fS.constants.X_OK),A=!0}catch{}n=u8.default.versions.electron??(ch==="android"||a||!A)?"xdg-open":Zge}r.length>0&&i.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}ch==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let o=p8.default.spawn(n,i,s);return t.wait?new Promise((a,A)=>{o.once("error",A),o.once("close",c=>{if(!t.allowNonzeroExitCode&&c>0){A(new Error(`Exited with code ${c}`));return}a(o)})}):(o.unref(),o)},Wtt=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return dS({...e,target:t})};sp={};cl(sp,"chrome",()=>hS({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));cl(sp,"brave",()=>hS({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));cl(sp,"firefox",()=>hS({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));cl(sp,"edge",()=>hS({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));cl(sp,"browser",()=>"browser");cl(sp,"browserPrivate",()=>"browserPrivate");spe=Wtt});async function ul(t){try{await spe(t)}catch{console.log(`
|
|
2184
2183
|
Could not open browser automatically.`),console.log(`Please open this URL manually:
|
|
2185
2184
|
${t}
|
|
2186
|
-
`)}}var LE=L(()=>{"use strict";h();ope()});async function mS(t,e,r){let n=t.isAbsolute(e)?e:t.resolve(t.cwd(),e),i=await t.readFile(n);if(!i)throw new Error(`Failed to read ${r} file: ${n}`);return q.info(`\u{1F4C4} Loaded ${r} from file: ${n}`),i}async function ztt(t,e,r){let n=r.httpsServerFiles?.key,i=r.httpsServerFiles?.cert,s=r.httpsServerFiles?.ca,o={...r.httpsServerOptions,key:n?await mS(t,n,"key"):r.httpsServerOptions?.key,cert:i?await mS(t,i,"cert"):r.httpsServerOptions?.cert,ca:s?await mS(t,s,"ca"):r.httpsServerOptions?.ca},a=Object.fromEntries(Object.entries(o).filter(([A,c])=>c!==void 0));if(Object.keys(a).length!==0)return a}async function ll(t,e){let r=t.cwd(),n=!!e.local||!e.projectId,i={workingDirectory:r,projectId:e.projectId,branchName:e.branchName,commitMode:"commits",mode:"init-and-launch",isLocal:n,allowedCommands:["npm *","pnpm *","yarn *","yarn","bun *","bun","gh *","wc *","gradle *","gradle","rg *","./gradlew *","./gradlew","expo *","expo","adb *","adb","vp *","vp","git *","export *","rails *","gem *","bundle *","rake *","echo *","cd *","find *","ls *","rm *","cp *","mv *","pwd","curl *","npx tsc *","head *","lsof *","kill *","ps *","tr *","awk *","cat *","grep *","sed *","tail *","touch *","mkdir *","tee *","true","uniq *","test *","false","npx *","sort *","env","dirname","basename *","realpath *","readlink *","stat *","file *","diff *","xargs *","chmod *","which *","whoami","uname *","uname","date","date *","printenv *","sleep *","netlify *","node *","tsx *","builderio *","builder *","open *","xcrun *","xcodebuild *","xcode-select *","xed *","agvtool *"]};if(e.configJson)try{let
|
|
2185
|
+
`)}}var LE=L(()=>{"use strict";h();ope()});async function mS(t,e,r){let n=t.isAbsolute(e)?e:t.resolve(t.cwd(),e),i=await t.readFile(n);if(!i)throw new Error(`Failed to read ${r} file: ${n}`);return q.info(`\u{1F4C4} Loaded ${r} from file: ${n}`),i}async function ztt(t,e,r){let n=r.httpsServerFiles?.key,i=r.httpsServerFiles?.cert,s=r.httpsServerFiles?.ca,o={...r.httpsServerOptions,key:n?await mS(t,n,"key"):r.httpsServerOptions?.key,cert:i?await mS(t,i,"cert"):r.httpsServerOptions?.cert,ca:s?await mS(t,s,"ca"):r.httpsServerOptions?.ca},a=Object.fromEntries(Object.entries(o).filter(([A,c])=>c!==void 0));if(Object.keys(a).length!==0)return a}async function ll(t,e){let r=t.cwd(),n=!!e.local||!e.projectId,i={workingDirectory:r,projectId:e.projectId,branchName:e.branchName,commitMode:"commits",mode:"init-and-launch",isLocal:n,allowedCommands:["npm *","pnpm *","yarn *","yarn","bun *","bun","gh *","wc *","gradle *","gradle","rg *","./gradlew *","./gradlew","expo *","expo","adb *","adb","vp *","vp","git *","export *","rails *","gem *","bundle *","rake *","echo *","cd *","find *","ls *","rm *","cp *","mv *","pwd","curl *","npx tsc *","head *","lsof *","kill *","ps *","tr *","awk *","cat *","grep *","sed *","tail *","touch *","mkdir *","tee *","true","uniq *","test *","false","npx *","sort *","env","dirname","basename *","realpath *","readlink *","stat *","file *","diff *","xargs *","chmod *","which *","whoami","uname *","uname","date","date *","printenv *","sleep *","netlify *","node *","tsx *","builderio *","builder *","open *","xcrun *","xcodebuild *","xcode-select *","xed *","agvtool *"]};if(e.configJson)try{let l=JSON.parse(e.configJson);i=Object.assign({},i,l),i.isLocal?n=!0:i.projectId&&(n=!1,i.isLocal=!1)}catch(l){t.Sentry?.captureException(l)}else{let l=await ape(t,e);if(l&&await t.exists(l))try{let d=await t.readFile(l);if(d){let g=JSON.parse(d);i=Object.assign({},i,g)}}catch(d){t.Sentry?.captureException(d)}}i.command&&(i.devCommand||(i.devCommand=i.command),delete i.command);let s=e.c||e.command,o=e.p||e.port,a=e.installCommand,A=e.serverUrl,c=e.interactive&&!e.configJson&&!e.fusionInit&&n&&!e.chat;if(A)c=!1,i.serverUrl=A,s||(i.devCommand="");else if(s&&o){c=!1;let l="http://localhost";if(i.serverUrl)try{let d=new URL(i.serverUrl);l=`${d.protocol}//${d.hostname}`}catch{l="http://localhost"}i.serverUrl=`${l}:${o}`,i.devCommand=s}else s&&i.autoDetectDevServer&&(c=!1,i.devCommand=s);if(s&&o&&(c=!1),o&&!A&&(i.serverUrl=`http://localhost:${o}`),a&&(i.setupCommand=a),s&&(i.devCommand=s),s&&!i.serverUrl&&(i.autoDetectDevServer=!0,i.autoSuggestPort=!0),typeof e.authenticateProxy=="boolean"&&(i.authenticateProxy=e.authenticateProxy),typeof e.privacyMode=="boolean"&&e.privacyMode&&(i.privacyMode=Object.assign({},i.privacyMode,{enabled:!0})),typeof e.autoDetectDevServer=="boolean"&&(i.autoDetectDevServer=e.autoDetectDevServer),typeof e.https=="boolean"&&(i.https=e.https),e.localHttpsDomain&&(i.localHttpsDomain=e.localHttpsDomain),typeof e.nativeApp=="boolean"&&(i.nativeApp=e.nativeApp),e.disabledTools){let l=e.disabledTools.split(",").map(d=>d.trim());i.disabledTools=l}if(i.httpsServerOptions=await ztt(t,e,i),c&&!e.chat){if(!i.devCommand){let l=await lr({message:"Enter the command to run for the dev server (e.g. 'npm run dev')",placeholder:"npm run dev",validate:d=>{if(d.trim()===""||d.length===0)return"Command cannot be empty"}});if(Je(l))return Ke("Goodbye! \u{1F44B}"),await(0,d8.exit)(1);i.devCommand=l}if(!i.serverUrl){let l=await lr({message:"Enter the dev server URL to proxy to (e.g. http://localhost:3000)",placeholder:"http://localhost:3000",validate:g=>{let p=g.trim();if(!p)return"Dev server URL cannot be empty";if(/^\d+$/.test(p)){let f=Number(p);return f<0||f>65535?"Invalid port number, must be between 0 and 65535":void 0}try{new URL(p)}catch{return"Enter a valid URL or port number"}}});if(Je(l))return Ke("Goodbye! \u{1F44B}"),await(0,d8.exit)(1);let d=l.trim();/^\d+$/.test(d)?i.serverUrl=`http://localhost:${d}`:i.serverUrl=new URL(d).href}await f8(t,i,e)}if(e.sessionId&&(i.sessionId=e.sessionId),typeof i.fusionServerPort=="string"){let l=parseInt(i.fusionServerPort);if(!isNaN(l))i.fusionServerPort=l;else throw new Error(`Invalid fusionServerPort: ${i.fusionServerPort}. Expected a number between 0 and 65535, got "${i.fusionServerPort}".`)}let u=i.privacyMode?.encryptionKeyPath;if(u&&i.privacyMode)try{let d=(await mS(t,u,"encryption key")).trim();i.privacyMode.encryptKey=d,delete i.privacyMode.encryptionKeyPath}catch(l){let d=new Error(`Failed to load encryption key from path: ${u}`,{cause:l});throw t.Sentry?.captureException(d),q.warn(d.message),d}return i}async function f8(t,e,r){let n=await ape(t,r);await t.writeFile(n,JSON.stringify(Xtt(e,"workingDirectory","projectId","authenticateProxy","privacyMode"),null,2))}function Ape(t,e){let r=e0(e);t.Sentry?.setTag("isLocal",r.isLocal),t.Sentry?.setTag("commitMode",r.commitMode),t.Sentry?.setTag("pvcCreationSource",r.pvcCreationSource??"unknown"),t.Sentry?.setTag("snapshot",r.syncBranch?"true":"false");let n=r.workspace?.folders.find(i=>i.enableGit)?.originalRepoUrl;if(n){let i=qC.some(s=>n.endsWith(s))?n:"custom-repo";t.Sentry?.setTag("repoUrl",i)}t.Sentry?.setContext("fusionConfig",{...r}),t.Sentry?.getCurrentScope().setContext("fusionConfig",{...r})}var d8,ape,Xtt,_E=L(()=>{"use strict";h();oo();er();d8=require("process");Fg();ape=async(t,e)=>{if(e.configPath){let A=t.resolve(t.cwd(),e.configPath);if(await t.exists(A))return A;throw new Error(`Fusion config file not found: ${A}`)}let r=["builder.config.json","fusion.config.json"],n=t.cwd(),i=t.join(n,r[0]),s=t.join(n,r[1]),o=await t.exists(i),a=await t.exists(s);if(o&&a)throw new Error(`Both builder.config.json and fusion.config.json were found in your project.
|
|
2187
2186
|
Please use only builder.config.json and remove fusion.config.json.
|
|
2188
2187
|
You can migrate any settings from fusion.config.json to builder.config.json before removing it.`);for(let A of r){let c=t.join(n,A);if(await t.exists(c))return c}return t.join(n,r[0])},Xtt=(t,...e)=>{let r={};if(t&&typeof t=="object")for(let n in t)(!t.hasOwnProperty||t.hasOwnProperty(n))&&(e.includes(n)||(r[n]=t[n]));return r}});async function lh(t,e={}){let r=new URL("/design-systems/v1",Te);r.searchParams.set("apiKey",t.builderPublicKey),r.searchParams.set("userId",t.userId),e.includeGlobalScopeDesignSystems&&r.searchParams.set("includeGlobalScopeDesignSystems","true"),e.includeDocumentCount&&r.searchParams.set("includeDocumentCount","true");let n=await Re(r,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`}});if(!n.ok)return[];let i=await n.json()??[];return e.onlyEditAccess?i.filter(s=>s.spaceId===t.builderPublicKey):i}var h8,cpe,m8,C8,uh,UE,CS,I8,Ztt,ert,trt,E8,upe,Es,wo,rrt,lpe,gpe,ppe,B8,dpe,DA=L(()=>{"use strict";h();Bi();oh();h8=X(require("@sentry/node"),1);Qt();_r();vr();Qr();Di();er();cpe=require("node:path"),m8=ve("RepoIndexing"),C8="AGENTS.md",uh="icons.mdx",UE="tokens.mdx",CS="installation.md",I8="repo-indexing",Ztt=[{value:"space",label:"Space",hint:"Available to all applications in your current space"}],ert=[{value:"organization",label:"Organization",hint:"Available to all applications in your organization"}],trt=[{value:"global",label:"Global",hint:"Available to all applications in the Builder platform"}],E8=async(t,e,r)=>{if(!t.userId)throw new Error("User ID is required");let i=e?.isAdminInOrganization,s=e?.email?.includes("@builder.io"),o=[...Ztt];if((i||s)&&o.push(...ert),s&&o.push(...trt),o.length===1)return o[0].value;if(r){if(!o.some(c=>c.value===r))throw new Error(`You don't have permission to use the scope "${r}"`);return r}let a=await Ei({message:"What is your design system scope?",options:o});if(!Je(a))return a},upe=async(t,e)=>{try{let r=t.getAppRootDir(),n=await Ko(t,r);if(!n)return{name:void 0,version:void 0};let i=e??n.name,s;if(e){let o=n.dependencies?.[e]||n.devDependencies?.[e];s=o?.replace(/^[\^~>=<]+/,"")||o}else s=n.version;return{name:i,version:s}}catch(r){return m8.error("Error parsing design system",r,{loggerOptions:{debug:!0}}),{name:void 0,version:void 0}}},Es=async(t,e,r)=>{try{let n=new URL("/mappings/store-component-docs",Te);n.searchParams.set("apiKey",t.builderPublicKey),n.searchParams.set("userId",t.userId);let i=await Re(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},body:JSON.stringify(e)});if(!i.ok){let s=await i.text();throw m8.error("API request failed:",i.status,s,{loggerOptions:{debug:!0}}),new Error(`Failed to store component group: ${i.status} ${s}`)}return await i.json()}catch(n){throw n}},wo=async(t,e,r,n,i,s,o,a={},A)=>{let{maxTokens:c,retriesAllowed:u=0,expectFile:l="tool",include:d,exclude:g,instructions:p,privacyMode:f}=a,m=null,C=l==="tool"?{...t,writeFile:async(E,y)=>(m=typeof y=="string"?y:y.toString(),Promise.resolve())}:t,B={accessControl:rrt(d,g),workingDirectory:t.cwd(),...o&&{workspace:o}};s&&!(0,cpe.isAbsolute)(s)&&B.accessControl?.entries?.push({action:"allow",resource:`**/node_modules/${s}/**/*`,permissions:["list","read"]},{action:"allow",resource:`!**/node_modules/${s}/node_modules/**/*`,permissions:["list"]},{action:"deny",resource:`**/node_modules/${s}/node_modules`,permissions:["list","read","write"]});try{let E=new Ia({maxTokens:c,sys:C,credentials:e,position:"repo-indexing",sessionOrCompletionId:r,...s&&!s.startsWith("/")&&{workingDirectory:`node_modules/${s}`},fusionConfig:B,privacyMode:f,builtInCustomInstructions:p?[{id:"repo-indexing-instructions",name:"repo-indexing-instructions",type:"always",content:p}]:void 0,enabledTools:["Read","Write","Glob","Bash","Grep","Skill","TaskCreate","TaskUpdate","TaskList"],...A&&{metadata:A}});i&&E.setDebug(i),await E.initializeSession({skipSessionLoading:!0});let y=E.connectToEventLoop(!1,async Q=>{Q.type==="error"&&m8.error(Q.message,{loggerOptions:{debug:!0}})});try{await E.sendMessage(n),await E.waitUntilIdle()}finally{y(),await E.close()}if(l!=="tool"){let Q=t.join(t.cwd(),l);if(await t.exists(Q)){m=await t.readFile(Q);try{await t.unlink(Q)}catch(D){h8.captureException(D,{extra:{expectedFile:l,expectedFilePath:Q}})}}}if(!m){let Q=h8.captureException(new gt("Repo indexing failed: No essential files were written"),{tags:{...a?.tags,sessionId:r}});throw new gt(`Sorry, we ran into a problem when indexing your components.
|
|
2189
2188
|
Session ID: ${r}.
|
|
2190
|
-
Please try again. If the issue persists, please contact support@builder.io. and provide the error ID: ${Q}`)}return m}catch(E){if(u===0)throw E;return wo(t,e,r,n,i,s,o,{...a,retriesAllowed:u-1},A)}},rrt=(t,e)=>{let r=t?(Array.isArray(t)?t:[t]).map(o=>o.trim()).filter(o=>o.length>0):[],n=e?(Array.isArray(e)?e:[e]).map(o=>o.trim()).filter(o=>o.length>0):[],i=[];i.push({action:"deny",resource:"*.mapper.tsx",description:"Do not index mapper files.",permissions:["read","write","list"]});for(let o of n)i.push({action:"deny",resource:o,description:"Excluded by --exclude flag.",permissions:["read","write","list"]});if(r.length>0){i.push({action:"allow",resource:".",permissions:["read","list"]});for(let o of r)i.push({action:"allow",resource:o,description:"Included by --include flag.",permissions:["read","list"]})}else i.push({action:"allow",resource:".",permissions:["read","list"]}),i.push({action:"allow",resource:"**/*",permissions:["read","list"]});i.push({action:"allow",resource:C8,permissions:["write"]},{action:"allow",resource:"**/repo-indexing/*.mdx",permissions:["write"]},{action:"allow",resource:"component-groups.json",permissions:["write"]},{action:"allow",resource:".icon_discovery_staging/**/*",permissions:["write"]},{action:"allow",resource:".token_discovery_staging/**/*",permissions:["write"]},{action:"allow",resource:"installation.json",permissions:["write"]});let s="You can read all files, but you can only write AGENTS.md, component-groups.json, icons.json, installation.json, .icon_discovery_staging/**/* and repo-indexing/*.mdx.";return r.length>0&&(s=`You can only read files matching these patterns: ${r.join(", ")}. You can only write AGENTS.md, component-groups.json, icons.json, installation.json, .icon_discovery_staging/**/* and repo-indexing/*.mdx.`),n.length>0&&(s+=` Excluded patterns: ${n.join(", ")}.`),{denyDescription:s,entries:i}};lpe=(t,e)=>e.find(r=>r.designSystemName===t)||null,gpe=(t,e,r,n)=>n&&n.find(i=>i.designSystemName===e&&i.scope===r)||null,ppe=async(t,e)=>{let r=new URL("/design-systems/v1",Te);r.searchParams.set("apiKey",t.builderPublicKey),r.searchParams.set("userId",t.userId);let n=await Re(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},body:JSON.stringify(e)});if(!n.ok){let o=(await n.json()).message||"Failed to add design system";throw new Error(o)}return(await n.json()).id},B8=async(t,e)=>{let r=new URL(`/design-systems/v1/${e.id}`,Te);r.searchParams.set("apiKey",t.builderPublicKey),r.searchParams.set("userId",t.userId);let n=await Re(r,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to update design system");return await n.json()},dpe=async t=>{let e=t.join(t.getAppRootDir(),I8);try{return await t.exists(e)?(await t.readdir(e)).filter(s=>s.endsWith(".mdx")||s.endsWith(".md")).length>0:!1}catch{return!1}}});async function nrt(t,e){let r="please, enter your own prompt",n=t.getCurrentState(),i=t.getLastApplyResultsTurn();switch(n){case"initial-with-url":{let s='e.g., "add a new contact page", "update the card component", "add a header to the layout of the app"',o=await lr({message:`Describe how the design integrates into your codebase: ${(0,
|
|
2189
|
+
Please try again. If the issue persists, please contact support@builder.io. and provide the error ID: ${Q}`)}return m}catch(E){if(u===0)throw E;return wo(t,e,r,n,i,s,o,{...a,retriesAllowed:u-1},A)}},rrt=(t,e)=>{let r=t?(Array.isArray(t)?t:[t]).map(o=>o.trim()).filter(o=>o.length>0):[],n=e?(Array.isArray(e)?e:[e]).map(o=>o.trim()).filter(o=>o.length>0):[],i=[];i.push({action:"deny",resource:"*.mapper.tsx",description:"Do not index mapper files.",permissions:["read","write","list"]});for(let o of n)i.push({action:"deny",resource:o,description:"Excluded by --exclude flag.",permissions:["read","write","list"]});if(r.length>0){i.push({action:"allow",resource:".",permissions:["read","list"]});for(let o of r)i.push({action:"allow",resource:o,description:"Included by --include flag.",permissions:["read","list"]})}else i.push({action:"allow",resource:".",permissions:["read","list"]}),i.push({action:"allow",resource:"**/*",permissions:["read","list"]});i.push({action:"allow",resource:C8,permissions:["write"]},{action:"allow",resource:"**/repo-indexing/*.mdx",permissions:["write"]},{action:"allow",resource:"component-groups.json",permissions:["write"]},{action:"allow",resource:".icon_discovery_staging/**/*",permissions:["write"]},{action:"allow",resource:".token_discovery_staging/**/*",permissions:["write"]},{action:"allow",resource:"installation.json",permissions:["write"]});let s="You can read all files, but you can only write AGENTS.md, component-groups.json, icons.json, installation.json, .icon_discovery_staging/**/* and repo-indexing/*.mdx.";return r.length>0&&(s=`You can only read files matching these patterns: ${r.join(", ")}. You can only write AGENTS.md, component-groups.json, icons.json, installation.json, .icon_discovery_staging/**/* and repo-indexing/*.mdx.`),n.length>0&&(s+=` Excluded patterns: ${n.join(", ")}.`),{denyDescription:s,entries:i}};lpe=(t,e)=>e.find(r=>r.designSystemName===t)||null,gpe=(t,e,r,n)=>n&&n.find(i=>i.designSystemName===e&&i.scope===r)||null,ppe=async(t,e)=>{let r=new URL("/design-systems/v1",Te);r.searchParams.set("apiKey",t.builderPublicKey),r.searchParams.set("userId",t.userId);let n=await Re(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},body:JSON.stringify(e)});if(!n.ok){let o=(await n.json()).message||"Failed to add design system";throw new Error(o)}return(await n.json()).id},B8=async(t,e)=>{let r=new URL(`/design-systems/v1/${e.id}`,Te);r.searchParams.set("apiKey",t.builderPublicKey),r.searchParams.set("userId",t.userId);let n=await Re(r,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to update design system");return await n.json()},dpe=async t=>{let e=t.join(t.getAppRootDir(),I8);try{return await t.exists(e)?(await t.readdir(e)).filter(s=>s.endsWith(".mdx")||s.endsWith(".md")).length>0:!1}catch{return!1}}});async function nrt(t,e){let r="please, enter your own prompt",n=t.getCurrentState(),i=t.getLastApplyResultsTurn();switch(n){case"initial-with-url":{let s='e.g., "add a new contact page", "update the card component", "add a header to the layout of the app"',o=await lr({message:`Describe how the design integrates into your codebase: ${(0,it.dim)("or Ctrl+C to exit")}`,placeholder:s,validate(a){if(a.length===0||a===s)return"please, enter a detailed instruction";if(a.length<10)return"a more detailed instruction is needed"}});return Je(o)?{command:"exit",userPrompt:void 0,feedback:void 0}:{command:void 0,userPrompt:o??"integrate design into the app, might be a new page/component/layout depending on the design",feedback:void 0}}case"initial-without-url":{let s='e.g., "add a new page", "add a new component", "update the button component"',o=await lr({message:`What do you want to do? ${(0,it.dim)("or Ctrl+C to exit")}`,placeholder:s,validate(a){if(a.length===0||a===s)return r}});return Je(o)?{command:"exit",userPrompt:void 0,feedback:void 0}:{command:void 0,userPrompt:o??"integrate design into the app, might be a new page/component/layout depending on the design",feedback:void 0}}case"abort":{let s='e.g., "make sure to keep X, while removing Y"',o=await lr({message:`Okey! what do you want to do? ${(0,it.dim)("or Ctrl+C to exit")}`,placeholder:s,validate(a){if(a.length===0||a===s)return r}});return Je(o)?(await t.acceptCode(),{command:"exit",userPrompt:void 0,feedback:void 0}):{command:void 0,userPrompt:o??"integrate design into the app, might be a new page/component/layout depending on the design",feedback:void 0}}case"error":{let s="Press Enter to retry or prompt how to proceed",o=await lr({message:`Mmmh! something went wrong, let's try again: ${(0,it.dim)("or Ctrl+C to exit")}`,placeholder:s,validate:void 0});if(Je(o))return await t.acceptCode(),{command:"exit",userPrompt:void 0,feedback:void 0};let a=o?.trim();return!a||a.length===0||a===s?{command:void 0,userPrompt:"Retry the last failed instruction/command and continue if successful",feedback:void 0}:{command:void 0,userPrompt:a,feedback:void 0}}case"success":{let s='e.g., "Plan, search, build"';if(!i?.applyResults.length){if(e.accept)return await t.acceptCode(),{command:"exit",userPrompt:void 0,feedback:void 0};let a=await lr({message:">",placeholder:s,validate(A){if(A.length===0||A===s)return r}});return Je(a)?(await t.acceptCode(),{command:"exit",userPrompt:void 0,feedback:void 0}):{command:void 0,userPrompt:a??"integrate design into the app, might be a new page/component/layout depending on the design",feedback:void 0}}let o=t.lastTurnHasChanges()?e.accept?"good":await Ei({message:`What do you want to do next? ${(0,it.dim)("or Ctrl+C to exit")}`,options:[{value:"good",label:"\u{1F44D} Accept and Continue",hint:"you will be able to keep prompting for more changes"},{value:"bad",label:"\u{1F44E} Refine",hint:"something went wrong, but I wanna refine instead of a complete undo"},{value:"undo",label:"\u23EE\uFE0F Undo last changes",hint:"want to revert the last changes"}]}):"continue";if(Je(o))return await t.acceptCode(),{command:"exit",userPrompt:void 0,feedback:void 0};if(o==="continue"){let a='e.g., "implement the new page"',A=await lr({message:`What else can I do for you? ${(0,it.dim)("or Ctrl+C to exit")}`,placeholder:a,validate(c){if(!c||c===a)return"Ctrl+C to exit"}});return Je(A)?(await t.acceptCode(),{feedback:void 0,command:"exit",userPrompt:void 0}):{command:void 0,userPrompt:A,feedback:void 0}}if(o==="good"){if(t.sendFeedback({feedbackSentiment:"positive"}),e.accept)return await t.acceptCode(),{feedback:"positive",command:"exit",userPrompt:void 0};let a='e.g., "Make it mobile-friendly", "Add form validation", "add docs"',A=await lr({message:`Describe any additional improvements: ${(0,it.dim)("or Ctrl+C to exit")}`,placeholder:a,validate(c){if(!c||c===a)return"Ctrl+C to exit"}});return Je(A)?(await t.acceptCode(),{feedback:"positive",command:"exit",userPrompt:void 0}):{userPrompt:A,feedback:"positive",command:void 0}}if(o==="bad"){t.sendFeedback({feedbackSentiment:"negative"});let a=`e.g., "code seems to be broken", "i can't see the page"`,A=await lr({message:`What went wrong? Please be more detailed this time ${(0,it.dim)("or Ctrl+C to exit")}`,placeholder:a,validate(c){if(!c||c===a)return"Ctrl+C to exit"}});return Je(A)?(await t.acceptCode(),{command:"exit",userPrompt:void 0,feedback:void 0}):(t.sendFeedback({feedbackSentiment:"negative",feedbackText:A}),{feedback:"negative",userPrompt:`Last changes were not good, here's my feedback:
|
|
2191
2190
|
${A}
|
|
2192
2191
|
Notice that previously changes were already applied, any patch goes on top the previous changes.`,command:void 0})}if(o==="undo"){t.sendFeedback({feedbackSentiment:"undo"});let{undone:a}=await t.undoLastUserMessage();a&&a.length>0&&q.warn(`Restored files to previous state:
|
|
2193
2192
|
|
|
2194
|
-
${a.map(u=>(0,
|
|
2193
|
+
${a.map(u=>(0,it.dim)(u)).join(`
|
|
2195
2194
|
`)}
|
|
2196
|
-
`);let A='e.g., "do X and Y, but make sure to do Z"',c=await lr({message:`Let's try again, please be more detailed this time ${(0,
|
|
2197
|
-
`),A=!1,c=!1;if(n!==void 0){let p=Math.abs(n);a.length>p&&(n>0?(a=a.slice(0,p),A=!0):(a=a.slice(-p),c=!0))}a=a.map(p=>{if(hpe(p)>o){let f=0,m=0;for(;m<o-3&&f<p.length;)p.substring(f).match(Cpe)?.[0]?.startsWith(p[f])||m++,f++;return p.slice(0,f)+"..."}return p});let u="\u2500".repeat(Math.max(0,s-2)),l=e(`${r}\u250C${u}\u2510`),d=e(`${r}\u2514${u}\u2518`),g=a.map(p=>{let f=" ".repeat(Math.max(0,o-hpe(p)));return`${r}${e("\u2502")} ${(0,
|
|
2195
|
+
`);let A='e.g., "do X and Y, but make sure to do Z"',c=await lr({message:`Let's try again, please be more detailed this time ${(0,it.dim)("or Ctrl+C to exit")}`,placeholder:A,validate(u){if(u=u.trim(),!u||u===A)return"Ctrl+C to exit"}});return Je(c)?(await t.acceptCode(),{command:"exit",userPrompt:void 0,feedback:void 0}):{feedback:"negative",command:void 0,userPrompt:c}}}default:throw new Error(`Unknown state: ${n}`)}}function hpe(t){return t.replace(Cpe,"").length}function y8(t,e,r,n){let i=process.stdout.columns||80,s=Math.min(Math.floor(i*.8),120),o=s-4,a=t.split(`
|
|
2196
|
+
`),A=!1,c=!1;if(n!==void 0){let p=Math.abs(n);a.length>p&&(n>0?(a=a.slice(0,p),A=!0):(a=a.slice(-p),c=!0))}a=a.map(p=>{if(hpe(p)>o){let f=0,m=0;for(;m<o-3&&f<p.length;)p.substring(f).match(Cpe)?.[0]?.startsWith(p[f])||m++,f++;return p.slice(0,f)+"..."}return p});let u="\u2500".repeat(Math.max(0,s-2)),l=e(`${r}\u250C${u}\u2510`),d=e(`${r}\u2514${u}\u2518`),g=a.map(p=>{let f=" ".repeat(Math.max(0,o-hpe(p)));return`${r}${e("\u2502")} ${(0,it.dim)(p)}${f} ${e("\u2502")}`});if(c){let p="... continues above ...",f=" ".repeat(Math.max(0,o-p.length));g.unshift(`${r}${e("\u2502")} ${e(p)}${f} ${e("\u2502")}`)}if(A){let p="... continues below ...",f=" ".repeat(Math.max(0,o-p.length));g.push(`${r}${e("\u2502")} ${e(p)}${f} ${e("\u2502")}`)}return`${l}
|
|
2198
2197
|
${g.join(`
|
|
2199
2198
|
`)}
|
|
2200
|
-
${d}`}function irt(t,e){let r="https://docs.google.com/forms/d/e/1FAIpQLSdHUIxeNZCAeMTgAWehxBtZplgcqXqyPbGf9Z1Advnf2ARxGw/viewform",n="entry.986969459",i="entry.1867678972",s=new URL(r);return s.searchParams.set("usp","pp_url"),s.searchParams.set(n,t),e&&s.searchParams.set(i,e),s.toString()}function srt(t){let e=t.getSessionId();q.info(`Session ID: ${(0,
|
|
2199
|
+
${d}`}function irt(t,e){let r="https://docs.google.com/forms/d/e/1FAIpQLSdHUIxeNZCAeMTgAWehxBtZplgcqXqyPbGf9Z1Advnf2ARxGw/viewform",n="entry.986969459",i="entry.1867678972",s=new URL(r);return s.searchParams.set("usp","pp_url"),s.searchParams.set(n,t),e&&s.searchParams.set(i,e),s.toString()}function srt(t){let e=t.getSessionId();q.info(`Session ID: ${(0,it.dim)(e)}`)}async function ort(t){let e=t.getSessionId(),r=t.getSpaceId(),n=t.getNextUrl();fn(`${(0,it.bgGreen)((0,it.bold)((0,it.white)(" Done! \u{1F389} ")))} ${(0,it.dim)("session "+e)}`);let i=irt(e,r);console.log(`
|
|
2201
2200
|
\u{1F4DD} We'd love your feedback on the code generation!
|
|
2202
|
-
${(0,
|
|
2201
|
+
${(0,it.dim)(i)}
|
|
2203
2202
|
|
|
2204
2203
|
${n?`
|
|
2205
2204
|
\u25B6\uFE0F Resume session:
|
|
2206
|
-
${(0,
|
|
2205
|
+
${(0,it.dim)(`npx builder.io@latest code --url ${JSON.stringify(n)}`)}
|
|
2207
2206
|
`:""}`)}function art(t,e){let r=Math.round(t/e*100),n=process.stdout.columns||80,i=Math.min(Math.floor(n/2),80),s=Math.round(r/100*i),o=i-s,a="\u2588".repeat(s),A="\u2591".repeat(o),c=t.toLocaleString(),u=e.toLocaleString();return`Usage: ${c}/${u}
|
|
2208
|
-
${a}${A}`}function Art(t){return t.length===0?(0,
|
|
2207
|
+
${a}${A}`}function Art(t){return t.length===0?(0,it.green)("Changes are applied"):`${(0,it.green)("Changes applied, please review the changes:")}
|
|
2209
2208
|
|
|
2210
|
-
${t.map(e=>{let r=e.addedLines>0?(0,
|
|
2211
|
-
`)}`}async function D8(t,e){let r=t.getCwdDir();q.info(`Opening project: ${(0,
|
|
2209
|
+
${t.map(e=>{let r=e.addedLines>0?(0,it.green)("\u25A0".repeat(Math.min(e.addedLines,5))):"",n=e.removedLines>0?(0,it.red)("\u25A0".repeat(Math.min(e.removedLines,5))):"";return`${(0,it.dim)(e.filePath)} ${(0,it.green)(`+${e.addedLines}`)} ${(0,it.red)(`-${e.removedLines}`)} ${r}${n}`}).join(`
|
|
2210
|
+
`)}`}async function D8(t,e){let r=t.getCwdDir();q.info(`Opening project: ${(0,it.dim)(r)}`);let n=await Lu({basePath:r,globPattern:"**/{package.json,tsconfig.json}",sys:t}),i=n.filter(c=>c.endsWith("/package.json")),s=await Ko(t,r),o=(await t.readdir(r)).some(c=>c.endsWith(".xcodeproj")||c.endsWith(".xcworkspace")||c==="Podfile"),a=(await t.readdir(r)).some(c=>c.startsWith("build.gradle")||c.startsWith("settings.gradle"));if(!(s||a||o)&&(q.warn("Looks like you are running this command outside a JS, iOS or Android project, this project runs better when executed at the root of a JS, iOS or Android project."),await Pt("cli code outside project",{}),e&&await wr({message:"Do you want to continue anyway?",active:"Yes",inactive:"No",initialValue:!1})!==!0)){await Ne(1);return}let A=n.filter(c=>c.endsWith("/tsconfig.json"));t.Sentry?.setExtra("nonRootPackageJsons",i),t.Sentry?.setExtra("nonRootTsConfigs",A),t.Sentry?.setExtra("packageJson",s),t.Sentry?.setExtra("cwdDir",r)}async function Ipe(t){let e=await t.getRepoInfo(),r={client:"@builder.io/dev-tools",clientVersion:t.version,nodeVersion:process.version,frameworks:t.getFrameworks().map(n=>n.name),systemPlatform:process.platform,systemEOL:IS.default.EOL,systemArch:IS.default.arch(),inGitRepo:e.hasGit};try{let n=IS.default.userInfo();r.systemShell=n.shell??void 0}catch{}return r}function crt(){return process.stdout.isTTY||process.env.FORCE_TTY==="1"}function urt(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}var it,IS,Q8,mpe,ES,fpe,Cpe,BS=L(()=>{"use strict";h();it=X(Ir(),1);Pg();er();_r();ks();TE();Bi();IS=X(require("node:os"),1);Wr();oo();oh();yS();ac();al();Q8=X(require("node:readline"),1);vs();LE();_E();DA();mpe=async(t,e,r)=>{r.prototype?await Epe(t,r):e==="generate"||e==="gen"||e==="g"?await ES(t,r):e==="gen"?Sc("code"):await ES(t,r)},ES=async(t,e)=>{if(console.log(""),nr((0,it.bgCyan)((0,it.bold)((0,it.white)(" code ")))+" "+(0,it.dim)(dt)),!crt()&&!e.prompt){await Pt("tty error",{}),q.error(`This command requires a TTY-enabled terminal.
|
|
2212
2211
|
If you are using Windows Git Bash, try a different terminal or wrap the command with winpty.`),await Ne(1);return}await Pt("figma code started",{}),e.workspace||await D8(t,!e.prompt);let r=await Wt(t,e,{forceSpaceId:e.spaceId,builderPrivateKey:!0,builderPublicKey:!0}),n,i;if(e.workspace){let I=await ype(t,e.workspace);n=I.workspace,i=I.workingDirectory}let s=await ll(t,e),o=await lh(r,{includeGlobalScopeDesignSystems:!0,includeDocumentCount:!0});if(s.repoIndexingConfig?.designSystems){let I=new Set(o.map(y=>y.designSystemName)),E=s.repoIndexingConfig.designSystems.filter(y=>!I.has(y));E.length>0&&q.warn(`\u26A0\uFE0F The following design systems in your configuration no longer exist or you don't have access:
|
|
2213
2212
|
`+E.map(y=>` \u2022 ${y}`).join(`
|
|
2214
2213
|
`))}if(!s.repoIndexingConfig){let I=o.filter(B=>B.scope==="space"||B.scope==="organization");if(I.length>0){let B=[];if(I.length===1){let E=I[0],y=await wr({message:`Use the ${E.designSystemName} design system (${E.docCount} document${E.docCount===1?"":"s"})${E.scope==="organization"?" (Organization)":""} with code generation?`});if(Je(y))return Ke("Aborted"),await Ne(1);y&&B.push(I[0].designSystemName)}else{let E=await Op({message:"You have available design systems. Select the ones you want to use:",options:I.map(y=>({value:y.designSystemName,label:`${y.scope==="organization"?"(Organization) ":""}${y.designSystemName} (${y.docCount} document${y.docCount===1?"":"s"})`})),required:!1});if(Je(E))return Ke("Aborted"),await Ne(1);B.push(...E)}if(B&&B.length>0){s.repoIndexingConfig={designSystems:B};let E=await wr({message:`Save selection${B.length>1?"s":""} for this working directory to your builder.config.json?`,active:"Yes",inactive:"No"});if(Je(E))return Ke("Aborted"),await Ne(1);E&&await f8(t,s,e)}}}let a=new Ia({sys:t,credentials:r,position:"cli",initialUrl:e.url,mcpServers:!e.disableMcp,autoImportLocalMCPs:!e.disableMcp,privacyMode:s?.privacyMode,skipFileDiff:!1,fusionConfig:{...s,workingDirectory:i,workspace:n}}),A=e.prompt,c=(I,B)=>{(B.ctrl&&B.name==="c"||B.name==="escape")&&a.abort()},u,l=()=>{u&&d(),u=Q8.default.createInterface({input:process.stdin,output:process.stdout}),process.stdin.isTTY&&process.stdin.setRawMode(!0),Q8.default.emitKeypressEvents(process.stdin,u),process.stdin.on("keypress",c)},d=()=>{u&&(process.stdin.removeListener("keypress",c),process.stdin.isTTY&&process.stdin.setRawMode(!1),u.close(),u=void 0)},g,p;await a.initializeSession(),srt(a);let f="",m="";A&&(await a.sendMessage({userPrompt:A,user:{source:"builder.io",userId:r.userId,role:"user"}}),e.prototype&&(A=void 0));let C=a.connectToEventLoop(!1,async I=>{switch(I.type){case"start":{if(f="",m=I.title,I.name==="tool"&&["view_path","Read"].includes(I.filePath))break;g&&(g.stop(),g=void 0),p&&(p[1](`
|
|
2215
|
-
`),p[2](),p=void 0),I.name==="text"?(p=Bpe(),tu.message(p[0],{symbol:(0,
|
|
2214
|
+
`),p[2](),p=void 0),I.name==="text"?(p=Bpe(),tu.message(p[0],{symbol:(0,it.magenta)("~")})):(g=gi(),g.start(I.title),g.extra(fpe));break}case"delta":{f+=I.delta,I.name==="tool"||(p?p[1](I.delta):g&&g.extra(`
|
|
2216
2215
|
|
|
2217
|
-
`+(m?" "+(0,
|
|
2218
|
-
`:"")+y8(f,
|
|
2219
|
-
`+fpe));break}case"tool":{g&&(g.stop(`${I.name}`),g=void 0);break}case"file":case"diff":{g&&(g.stop(`${I.title}: ${(0,
|
|
2216
|
+
`+(m?" "+(0,it.bgMagenta)(` ${m} `)+`
|
|
2217
|
+
`:"")+y8(f,it.magenta," ",-15)+`
|
|
2218
|
+
`+fpe));break}case"tool":{g&&(g.stop(`${I.name}`),g=void 0);break}case"file":case"diff":{g&&(g.stop(`${I.title}: ${(0,it.dim)(I.filePath)}`),g=void 0);break}case"text":{p&&(p[1](`
|
|
2220
2219
|
`),p[2](),p=void 0);break}case"user-abort":{g&&(g.stop(),g=void 0),p&&(p[1](`
|
|
2221
2220
|
`),p[2](),p=void 0),q.error("Generation aborted");break}case"wait-for-input":{if(A)await a.stopEventLoop();else{await new Promise(E=>setTimeout(E,100)),d();let B=await nrt(a,e);B.command==="exit"?await a.stopEventLoop():B.userPrompt&&(l(),await a.sendMessage({userPrompt:B.userPrompt,user:{source:"builder.io",userId:r.userId,role:"user"}}))}break}case"user-input":{p&&(p[1](`
|
|
2222
2221
|
`),p[2](),p=void 0),g&&(g.stop(),g=void 0),I.files.length>0&&q.info(`Reading files:
|
|
2223
2222
|
|
|
2224
|
-
`+I.files.map(B=>` ${(0,
|
|
2223
|
+
`+I.files.map(B=>` ${(0,it.dim)(B.filePath)} (${urt(B.size)})`).join(`
|
|
2225
2224
|
`));break}case"tool_result":{I.result.tool_name==="bash"&&g&&(g.stop(),g=void 0),I.result.is_error?q.error(`${I.result.title?I.result.title:`Tool failed: ${I.result.tool_name}`}
|
|
2226
2225
|
|
|
2227
|
-
${y8(_1(I.result.content).trim(),
|
|
2226
|
+
${y8(_1(I.result.content).trim(),it.red,"")}`):q.info(`${I.result.title?I.result.title:`Tool: ${I.result.tool_name}`}
|
|
2228
2227
|
|
|
2229
|
-
${y8(_1(I.result.content).trim(),
|
|
2228
|
+
${y8(_1(I.result.content).trim(),it.green,"",15)}`);break}case"error":{if(I.stopReason==="limit"){await Pt("code generation",{spaceId:r.builderPublicKey,cli:!0,error:"rate limit reached"});let B=I.message??"The request was cancelled because it reached the account limits. Please upgrade your plan.";q.error((0,it.red)("\u{1F6A8} "+B));let E=new URL("https://builder.io/account/subscription");E.searchParams.set("space_id",r.builderPublicKey),await wr({message:(0,it.dim)(E.href),active:"Open subscription page",inactive:"Exit"})&&await ul(E.href),await Ne(1)}else if(I.code==="ask-to-continue")if(g&&(g.stop(),g=void 0),await wr({message:I.message||"The agent has been working for a while. Do you want to continue?",active:"Yes, continue",inactive:"No, stop here"}))await a.sendMessage({userPrompt:"",displayPrompt:"Continue!",isManualContinue:!0,user:{source:"agent",role:"agent"},queue:!0});else{q.info("Code generation stopped by user.");break}else await Pt("code generation",{spaceId:r.builderPublicKey,cli:!0,error:I.message}),q.error(I.message),await Ne(1);break}case"done":{p&&(p[1](`
|
|
2230
2229
|
`),p[2](),p=void 0),g&&(g.stop(),g=void 0),I.usage&&I.usage.total/I.usage.limits.aiGeneration>.5&&q.info(art(I.usage.total,I.usage.limits.aiGeneration)),I.applyResults.length>0&&q.success(Art(I.applyResults));break}case"continue":{g&&(g.stop("All changes applied"),g=void 0);break}default:if(g){if(I.type==="stdio")break;g.stop(),g=void 0}}});await a.waitForEventLoop(),C(),d(),await ort(a),await Ne(0)};fpe=`
|
|
2231
|
-
`+(0,
|
|
2230
|
+
`+(0,it.dim)("ESC to interrupt"),Cpe=/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g});function lrt(t){let e=t.match(/\/app\/projects\/([^/]+)\/([^/]+)/);return e?{projectId:e[1],branchName:e[2]}:null}function vc(t){if(!t.includes("://")&&!t.startsWith("http"))return null;let e;try{e=new URL(t)}catch{return null}if(!e.hostname.endsWith("builder.io"))return null;let r=lrt(e.pathname);if(!r)throw new Error(`Malformed Builder URL: "${t}". Expected format: https://builder.io/app/projects/<projectId>/<branchName>`);return r}var GE=L(()=>{"use strict";h()});function frt(t){let e=t.split("/");for(let i of e)if(grt.has(i))return!1;let r=e[e.length-1];if(prt.has(r))return!1;let n=r.includes(".")?"."+r.split(".").pop():"";return drt.has(n.toLowerCase())}async function KE(t){let{projectId:e,branchName:r,apiKey:n,authHeaders:i,userId:s}=t,o=await Re(new URL(`${Te}/projects/branch/chat-history?apiKey=${n}&userId=${s??""}`),{method:"POST",headers:i,body:JSON.stringify({projectId:e,branchName:r})});return o.ok?(await o.json()).conversation:[]}async function HE(t){let{projectId:e,branchName:r,apiKey:n,authHeaders:i,userId:s,showLogs:o=!0}=t,a=r.replace(/[/\\]/g,"-"),A=Bn(Ea.default.join(w8.default.homedir(),".builder","prototypes")),c=Bn(Ea.default.join(A,`${e}:${a}`)),u=Bn(Ea.default.join(c,"code")),l;o&&(l=es()),o&&l.start("Fetching bundle...");let[d,g]=await Promise.all([Re(new URL(`${Te}/projects/branch/bundle-download-url?apiKey=${n}&userId=${s??""}`),{method:"POST",headers:i,body:JSON.stringify({projectId:e,branchName:r})}),Re(new URL(`${Te}/projects/branches?apiKey=${n}&projectId=${e}&branchName=${encodeURIComponent(r)}`),{method:"GET",headers:i})]);if(!d.ok){let x=await d.text().catch(()=>d.statusText);op.captureException(new Error("pullPrototypeError"),{tags:{operation:"pull-prototype",step:"bundle-download-url"},extra:{projectId:e,branchName:r,status:d.status,errorBody:x}}),o&&(l.stop("Failed to get bundle URL"),q.error(x));return}if(!g.ok){let x=await g.text().catch(()=>g.statusText);op.captureException(new Error("pullPrototypeError"),{tags:{operation:"pull-prototype",step:"resolve-branch"},extra:{projectId:e,branchName:r,status:g.status,errorBody:x}}),o&&(l.stop("Failed to resolve branch"),q.error(x));return}let{signedUrl:p,partial:f}=await d.json(),C=(await g.json()).branch,I=C.gitAiBranch??C.backup?.gitBranchName??Object.values(C.backups??{})[0]?.gitBranchName,B;try{B=await Re(p)}catch(x){op.captureException(new Error("pullPrototypeError"),{tags:{operation:"pull-prototype",step:"bundle-download"},extra:{projectId:e,branchName:r,partial:f,error:x instanceof Error?x.message:String(x)}}),o&&(l.stop("Failed to download bundle"),q.error(`Bundle download failed: ${x instanceof Error?x.message:String(x)}`));return}if(!B.ok){op.captureException(new Error("pullPrototypeError"),{tags:{operation:"pull-prototype",step:"bundle-download"},extra:{projectId:e,branchName:r,partial:f,status:B.status,statusText:B.statusText}}),o&&(l.stop("Failed to download bundle"),q.error(`Bundle download failed: ${B.statusText}`));return}let E=xc.default.mkdtempSync(Ea.default.join(w8.default.tmpdir(),"builder-prototype-")),y=Ea.default.join(E,"repo.bundle"),Q=Ea.default.join(E,"repo"),b=await B.arrayBuffer(),D=Buffer.from(b.slice(0,20)).toString("utf8");if(!D.startsWith("# v")){op.captureException(new Error("pullPrototypeError"),{tags:{operation:"pull-prototype",step:"validate-bundle"},extra:{projectId:e,branchName:r,partial:f,bundleSize:b.byteLength,headerPreview:JSON.stringify(D.slice(0,40))}}),o&&(l.stop("Invalid bundle"),q.error("Downloaded file is not a git bundle. The backup may not exist yet for this branch."));return}xc.default.writeFileSync(y,new Uint8Array(b));let F=I??"main";try{if(f){await OE("git",["init",Q],{cwd:E});let{stdout:x}=await OE("git",["-C",Q,"bundle","unbundle",y],{cwd:E}),U=x.trim().split(/\s+/)[0];if(U)await OE("git",["-C",Q,"checkout",U],{cwd:E});else throw new Error("Bundle produced no refs \u2014 it may be empty or corrupt")}else await OE("git",["clone","--branch",F,y,Q],{cwd:E})}catch(x){op.captureException(new Error("pullPrototypeError"),{tags:{operation:"pull-prototype",step:"git-extract"},extra:{projectId:e,branchName:r,partial:f,checkoutBranch:F,error:x instanceof Error?x.message:String(x)}}),o&&(l.stop("Failed to extract bundle"),q.error(`Could not extract git bundle: ${x}`)),xc.default.rmSync(E,{recursive:!0,force:!0});return}let{stdout:S}=await OE("git",["ls-files"],{cwd:Q});xc.default.mkdirSync(u,{recursive:!0});for(let x of S.trim().split(`
|
|
2232
2231
|
`).filter(Boolean))if(frt(x))try{let U=Ea.default.join(Q,x),j=Ea.default.join(u,x);xc.default.mkdirSync(Ea.default.dirname(j),{recursive:!0}),xc.default.copyFileSync(U,j)}catch{}return o&&l.stop(`Files saved to ${u}`),xc.default.rmSync(E,{recursive:!0,force:!0}),{projectDir:u,prototypesRoot:A,apiKey:n}}async function Epe(t,e){let r=e.prototype;if(!r){q.error("Please provide a prototype URL: --prototype https://builder.io/app/projects/<projectId>/<branchName>");return}let n=vc(r);if(!n){q.error(`Invalid prototype URL: ${r}
|
|
2233
2232
|
Expected format: https://builder.io/app/projects/<projectId>/<branchName>`);return}console.log(""),nr((0,gl.bgCyan)((0,gl.bold)((0,gl.white)(" prototype ")))+" "+(0,gl.dim)(dt));let{projectId:i,branchName:s}=n,o=await Wt(t,e,{builderPrivateKey:!0,builderPublicKey:!0});if(!o.builderPublicKey){q.error("No space ID found. Run 'builder login' first.");return}let a=o.builderPublicKey,A={"Content-Type":"application/json",Authorization:`Bearer ${o.builderPrivateKey}`},[c,u]=await Promise.all([HE({projectId:i,branchName:s,apiKey:a,authHeaders:A,userId:o.userId}),KE({projectId:i,branchName:s,apiKey:a,authHeaders:A,userId:o.userId}).catch(()=>[])]);if(!c)return;let l=e.prompt?.trim()||await mrt();if(!l)return;let d=Ea.default.relative(process.cwd(),c.projectDir);e.prompt=hrt(d,u,l),e.spaceId=a;let g=()=>xc.default.rmSync(c.prototypesRoot,{recursive:!0,force:!0});process.on("exit",g),process.on("SIGINT",g),process.on("SIGTERM",g),process.on("uncaughtException",g),process.on("unhandledRejection",g),await ES(t,e)}function b8(t){return t.length===0?"No conversation history available.":t.map((e,r)=>`### ${e.title?`**${e.title}**`:`Message ${r+1}`}
|
|
2234
2233
|
${e.userPrompt}`).join(`
|
|
@@ -2804,7 +2803,7 @@ return fn.apply(this, arguments)
|
|
|
2804
2803
|
`)+`\r
|
|
2805
2804
|
\r
|
|
2806
2805
|
`+r)}function Ep(t,e,r,n,i,s){if(t.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,Ep),t.emit("wsClientError",o,r,e)}else QB(r,n,i,s)}});var cQe=N((sur,AQe)=>{h();var _4=class{constructor(e,r,n){this.etaBufferLength=e||100,this.valueBuffer=[n],this.timeBuffer=[r],this.eta="0"}update(e,r,n){this.valueBuffer.push(r),this.timeBuffer.push(e),this.calculate(n-r)}getTime(){return this.eta}calculate(e){let r=this.valueBuffer.length,n=Math.min(this.etaBufferLength,r),i=this.valueBuffer[r-1]-this.valueBuffer[r-n],s=this.timeBuffer[r-1]-this.timeBuffer[r-n],o=i/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"}};AQe.exports=_4});var G4=N((aur,uQe)=>{h();var yp=require("readline"),U4=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,r=null){this.stream.isTTY&&yp.cursorTo(this.stream,e,r)}cursorRelative(e=null,r=null){this.stream.isTTY&&(this.dy=this.dy+r,yp.moveCursor(this.stream,e,r))}cursorRelativeReset(){this.stream.isTTY&&(yp.moveCursor(this.stream,0,-this.dy),yp.cursorTo(this.stream,0,null),this.dy=0)}clearRight(){this.stream.isTTY&&yp.clearLine(this.stream,1)}clearLine(){this.stream.isTTY&&yp.clearLine(this.stream,0)}clearBottom(){this.stream.isTTY&&yp.clearScreenDown(this.stream)}newline(){this.stream.write(`
|
|
2807
|
-
`),this.dy++}write(e,r=!1){this.linewrap===!0&&r===!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)}};uQe.exports=U4});var gQe=N((cur,O4)=>{"use strict";h();var lQe=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);O4.exports=lQe;O4.exports.default=lQe});var dQe=N((lur,pQe)=>{"use strict";h();pQe.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 hQe=N((pur,K4)=>{"use strict";h();var Fht=sL(),kht=gQe(),Rht=dQe(),fQe=t=>{if(typeof t!="string"||t.length===0||(t=Fht(t),t.length===0))return 0;t=t.replace(Rht()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=kht(n)?2:1)}return e};K4.exports=fQe;K4.exports.default=fQe});var H4=N((fur,mQe)=>{h();mQe.exports=function(e,r,n){if(r.autopadding!==!0)return e;function i(s,o){return(r.autopaddingChar+s).slice(-o)}return n==="percentage"?i(e,3):e}});var J4=N((mur,CQe)=>{h();CQe.exports=function(e,r){let n=Math.round(e*r.barsize),i=r.barsize-n;return r.barCompleteString.substr(0,n)+r.barGlue+r.barIncompleteString.substr(0,i)}});var j4=N((Iur,IQe)=>{h();IQe.exports=function(e,r,n){function i(o){return n?n*Math.round(o/n):o}function s(o){return(r.autopaddingChar+o).slice(-2)}return e>3600?s(Math.floor(e/3600))+"h"+s(i(e%3600/60))+"m":e>60?s(Math.floor(e/60))+"m"+s(i(e%60))+"s":e>10?s(i(e))+"s":s(e)+"s"}});var Y4=N((Bur,EQe)=>{h();var Tht=hQe(),Nht=H4(),Mht=J4(),Pht=j4();EQe.exports=function(e,r,n){let i=e.format,s=e.formatTime||Pht,o=e.formatValue||Nht,a=e.formatBar||Mht,A=Math.floor(r.progress*100)+"",c=r.stopTime||Date.now(),u=Math.round((c-r.startTime)/1e3),l=Object.assign({},n,{bar:a(r.progress,e),percentage:o(A,e,"percentage"),total:o(r.total,e,"total"),value:o(r.value,e,"value"),eta:o(r.eta,e,"eta"),eta_formatted:s(r.eta,e,5),duration:o(u,e,"duration"),duration_formatted:s(u,e,1)});i=i.replace(/\{(\w+)\}/g,function(p,f){return typeof l[f]<"u"?l[f]:p});let d=Math.max(0,r.maxWidth-Tht(i)-2),g=Math.floor(d/2);switch(e.align){case"right":i=d>0?" ".repeat(d)+i:i;break;case"center":i=g>0?" ".repeat(g)+i:i;break;default:break}return i}});var ix=N((Qur,BQe)=>{h();function Cr(t,e){return typeof t>"u"||t===null?e:t}BQe.exports={parse:function(e,r){let n={},i=Object.assign({},r,e);return n.throttleTime=1e3/Cr(i.fps,10),n.stream=Cr(i.stream,process.stderr),n.terminal=Cr(i.terminal,null),n.clearOnComplete=Cr(i.clearOnComplete,!1),n.stopOnComplete=Cr(i.stopOnComplete,!1),n.barsize=Cr(i.barsize,40),n.align=Cr(i.align,"left"),n.hideCursor=Cr(i.hideCursor,!1),n.linewrap=Cr(i.linewrap,!1),n.barGlue=Cr(i.barGlue,""),n.barCompleteChar=Cr(i.barCompleteChar,"="),n.barIncompleteChar=Cr(i.barIncompleteChar,"-"),n.format=Cr(i.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),n.formatTime=Cr(i.formatTime,null),n.formatValue=Cr(i.formatValue,null),n.formatBar=Cr(i.formatBar,null),n.etaBufferLength=Cr(i.etaBuffer,10),n.etaAsynchronousUpdate=Cr(i.etaAsynchronousUpdate,!1),n.progressCalculationRelative=Cr(i.progressCalculationRelative,!1),n.synchronousUpdate=Cr(i.synchronousUpdate,!0),n.noTTYOutput=Cr(i.noTTYOutput,!1),n.notTTYSchedule=Cr(i.notTTYSchedule,2e3),n.emptyOnZero=Cr(i.emptyOnZero,!1),n.forceRedraw=Cr(i.forceRedraw,!1),n.autopadding=Cr(i.autopadding,!1),n.gracefulExit=Cr(i.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?Cr(e.autopaddingChar," "):"",e}}});var q4=N((bur,QQe)=>{h();var yQe=cQe(),Lht=G4(),_ht=Y4(),Uht=ix(),Ght=require("events");QQe.exports=class extends Ght{constructor(e){super(),this.options=Uht.assignDerivedOptions(e),this.terminal=this.options.terminal?this.options.terminal:new Lht(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 yQe(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter=typeof this.options.format=="function"?this.options.format:_ht}render(e=!1){let r={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,r,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,r,n){this.value=r||0,this.total=typeof e<"u"&&e>=0?e:100,this.startValue=r||0,this.payload=n||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new yQe(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",e,r)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,r={}){typeof e=="number"&&(this.value=e,this.eta.update(Date.now(),e,this.total));let n=(typeof e=="object"?e:r)||{};this.emit("update",this.total,this.value);for(let i in n)this.payload[i]=n[i];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,r={}){typeof e=="object"?this.update(this.value+1,e):this.update(this.value+e,r)}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 wQe=N((xur,DQe)=>{h();var Oht=q4(),Kht=ix();DQe.exports=class extends Oht{constructor(e,r){super(Kht.parse(e,r)),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,r){this.timer&&(super.update(e,r),this.options.synchronousUpdate&&this.lastRedraw+this.options.throttleTime*2<Date.now()&&this.render())}start(e,r,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,r,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 SQe=N((Rur,bQe)=>{h();var Hht=G4(),Jht=q4(),jht=ix(),Yht=require("events");bQe.exports=class extends Yht{constructor(e,r){super(),this.bars=[],this.options=jht.parse(e,r),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new Hht(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,r,n,i={}){let s=new Jht(Object.assign({},this.options,{terminal:this.terminal},i));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,r,n),this.emit("start")),s}remove(e){let r=this.bars.indexOf(e);return r<0?!1:(this.bars.splice(r,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 xQe=N((Nur,vQe)=>{h();vQe.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}});var kQe=N((Pur,FQe)=>{h();FQe.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var TQe=N((_ur,RQe)=>{h();RQe.exports={format:" \x1B[90m{bar}\x1B[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var MQe=N((Gur,NQe)=>{h();NQe.exports={format:" {bar}\u25A0 {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u25A0",barIncompleteChar:" "}});var LQe=N((Kur,PQe)=>{h();var qht=xQe(),$ht=kQe(),Vht=TQe(),Wht=MQe();PQe.exports={legacy:qht,shades_classic:$ht,shades_grey:Vht,rect:Wht}});var GQe=N((Jur,UQe)=>{h();var _Qe=wQe(),zht=SQe(),Xht=LQe(),Zht=Y4(),emt=H4(),tmt=J4(),rmt=j4();UQe.exports={Bar:_Qe,SingleBar:_Qe,MultiBar:zht,Presets:Xht,Format:{Formatter:Zht,BarFormat:tmt,ValueFormat:emt,TimeFormat:rmt}}});var qQe=N((plr,YQe)=>{h();YQe.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-\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-\uDED8\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\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\uDD3C-\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-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\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\uDE70]|\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\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 uDt={};ty(uDt,{default:()=>cDt});module.exports=Vr(uDt);h();h();(function(){try{var 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]="10bffb51-19c9-44d1-a543-afa1cd54f304",t._sentryDebugIdIdentifier="sentry-dbid-10bffb51-19c9-44d1-a543-afa1cd54f304")}catch{}})();h();Qt();var Dxe=require("../core/index.cjs"),wxe=require("../node/index.cjs"),bxe=require("../server/index.cjs"),Sxe=X(ij(),1);h();h();var kS=require("fs/promises");jF();_r();JC();er();var Or=X(Ir(),1),hh=require("node:path");vs();ks();Qr();Wr();rh();var Ynt="https://cdn.builder.io",ide=async(t,e)=>{console.log(""),nr((0,Or.bgCyan)((0,Or.bold)((0,Or.white)(" figma migrate ")))+" "+(0,Or.dim)(dt));let{builderPrivateKey:r,builderPublicKey:n}=await Wt(t,e,{forceSpaceId:e.spaceId,builderPrivateKey:!0,builderPublicKey:!0});await Pt("figma publish started",{spaceId:n});let i=await HC(t);if(i.length>0){await Pt("figma migrate with existing files",{spaceId:n}),q.warning(`${(0,Or.yellow)("This repo already has figma mappings in:")}
|
|
2806
|
+
`),this.dy++}write(e,r=!1){this.linewrap===!0&&r===!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)}};uQe.exports=U4});var gQe=N((cur,O4)=>{"use strict";h();var lQe=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);O4.exports=lQe;O4.exports.default=lQe});var dQe=N((lur,pQe)=>{"use strict";h();pQe.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 hQe=N((pur,K4)=>{"use strict";h();var Fht=sL(),kht=gQe(),Rht=dQe(),fQe=t=>{if(typeof t!="string"||t.length===0||(t=Fht(t),t.length===0))return 0;t=t.replace(Rht()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=kht(n)?2:1)}return e};K4.exports=fQe;K4.exports.default=fQe});var H4=N((fur,mQe)=>{h();mQe.exports=function(e,r,n){if(r.autopadding!==!0)return e;function i(s,o){return(r.autopaddingChar+s).slice(-o)}return n==="percentage"?i(e,3):e}});var J4=N((mur,CQe)=>{h();CQe.exports=function(e,r){let n=Math.round(e*r.barsize),i=r.barsize-n;return r.barCompleteString.substr(0,n)+r.barGlue+r.barIncompleteString.substr(0,i)}});var j4=N((Iur,IQe)=>{h();IQe.exports=function(e,r,n){function i(o){return n?n*Math.round(o/n):o}function s(o){return(r.autopaddingChar+o).slice(-2)}return e>3600?s(Math.floor(e/3600))+"h"+s(i(e%3600/60))+"m":e>60?s(Math.floor(e/60))+"m"+s(i(e%60))+"s":e>10?s(i(e))+"s":s(e)+"s"}});var Y4=N((Bur,EQe)=>{h();var Tht=hQe(),Nht=H4(),Mht=J4(),Pht=j4();EQe.exports=function(e,r,n){let i=e.format,s=e.formatTime||Pht,o=e.formatValue||Nht,a=e.formatBar||Mht,A=Math.floor(r.progress*100)+"",c=r.stopTime||Date.now(),u=Math.round((c-r.startTime)/1e3),l=Object.assign({},n,{bar:a(r.progress,e),percentage:o(A,e,"percentage"),total:o(r.total,e,"total"),value:o(r.value,e,"value"),eta:o(r.eta,e,"eta"),eta_formatted:s(r.eta,e,5),duration:o(u,e,"duration"),duration_formatted:s(u,e,1)});i=i.replace(/\{(\w+)\}/g,function(p,f){return typeof l[f]<"u"?l[f]:p});let d=Math.max(0,r.maxWidth-Tht(i)-2),g=Math.floor(d/2);switch(e.align){case"right":i=d>0?" ".repeat(d)+i:i;break;case"center":i=g>0?" ".repeat(g)+i:i;break;default:break}return i}});var ix=N((Qur,BQe)=>{h();function Cr(t,e){return typeof t>"u"||t===null?e:t}BQe.exports={parse:function(e,r){let n={},i=Object.assign({},r,e);return n.throttleTime=1e3/Cr(i.fps,10),n.stream=Cr(i.stream,process.stderr),n.terminal=Cr(i.terminal,null),n.clearOnComplete=Cr(i.clearOnComplete,!1),n.stopOnComplete=Cr(i.stopOnComplete,!1),n.barsize=Cr(i.barsize,40),n.align=Cr(i.align,"left"),n.hideCursor=Cr(i.hideCursor,!1),n.linewrap=Cr(i.linewrap,!1),n.barGlue=Cr(i.barGlue,""),n.barCompleteChar=Cr(i.barCompleteChar,"="),n.barIncompleteChar=Cr(i.barIncompleteChar,"-"),n.format=Cr(i.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),n.formatTime=Cr(i.formatTime,null),n.formatValue=Cr(i.formatValue,null),n.formatBar=Cr(i.formatBar,null),n.etaBufferLength=Cr(i.etaBuffer,10),n.etaAsynchronousUpdate=Cr(i.etaAsynchronousUpdate,!1),n.progressCalculationRelative=Cr(i.progressCalculationRelative,!1),n.synchronousUpdate=Cr(i.synchronousUpdate,!0),n.noTTYOutput=Cr(i.noTTYOutput,!1),n.notTTYSchedule=Cr(i.notTTYSchedule,2e3),n.emptyOnZero=Cr(i.emptyOnZero,!1),n.forceRedraw=Cr(i.forceRedraw,!1),n.autopadding=Cr(i.autopadding,!1),n.gracefulExit=Cr(i.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?Cr(e.autopaddingChar," "):"",e}}});var q4=N((bur,QQe)=>{h();var yQe=cQe(),Lht=G4(),_ht=Y4(),Uht=ix(),Ght=require("events");QQe.exports=class extends Ght{constructor(e){super(),this.options=Uht.assignDerivedOptions(e),this.terminal=this.options.terminal?this.options.terminal:new Lht(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 yQe(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter=typeof this.options.format=="function"?this.options.format:_ht}render(e=!1){let r={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,r,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,r,n){this.value=r||0,this.total=typeof e<"u"&&e>=0?e:100,this.startValue=r||0,this.payload=n||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new yQe(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",e,r)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,r={}){typeof e=="number"&&(this.value=e,this.eta.update(Date.now(),e,this.total));let n=(typeof e=="object"?e:r)||{};this.emit("update",this.total,this.value);for(let i in n)this.payload[i]=n[i];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,r={}){typeof e=="object"?this.update(this.value+1,e):this.update(this.value+e,r)}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 wQe=N((xur,DQe)=>{h();var Oht=q4(),Kht=ix();DQe.exports=class extends Oht{constructor(e,r){super(Kht.parse(e,r)),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,r){this.timer&&(super.update(e,r),this.options.synchronousUpdate&&this.lastRedraw+this.options.throttleTime*2<Date.now()&&this.render())}start(e,r,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,r,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 SQe=N((Rur,bQe)=>{h();var Hht=G4(),Jht=q4(),jht=ix(),Yht=require("events");bQe.exports=class extends Yht{constructor(e,r){super(),this.bars=[],this.options=jht.parse(e,r),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new Hht(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,r,n,i={}){let s=new Jht(Object.assign({},this.options,{terminal:this.terminal},i));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,r,n),this.emit("start")),s}remove(e){let r=this.bars.indexOf(e);return r<0?!1:(this.bars.splice(r,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 xQe=N((Nur,vQe)=>{h();vQe.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}});var kQe=N((Pur,FQe)=>{h();FQe.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var TQe=N((_ur,RQe)=>{h();RQe.exports={format:" \x1B[90m{bar}\x1B[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var MQe=N((Gur,NQe)=>{h();NQe.exports={format:" {bar}\u25A0 {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u25A0",barIncompleteChar:" "}});var LQe=N((Kur,PQe)=>{h();var qht=xQe(),$ht=kQe(),Vht=TQe(),Wht=MQe();PQe.exports={legacy:qht,shades_classic:$ht,shades_grey:Vht,rect:Wht}});var GQe=N((Jur,UQe)=>{h();var _Qe=wQe(),zht=SQe(),Xht=LQe(),Zht=Y4(),emt=H4(),tmt=J4(),rmt=j4();UQe.exports={Bar:_Qe,SingleBar:_Qe,MultiBar:zht,Presets:Xht,Format:{Formatter:Zht,BarFormat:tmt,ValueFormat:emt,TimeFormat:rmt}}});var qQe=N((plr,YQe)=>{h();YQe.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-\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-\uDED8\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\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\uDD3C-\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-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\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\uDE70]|\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\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 uDt={};ty(uDt,{default:()=>cDt});module.exports=Vr(uDt);h();h();(function(){try{var 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]="96310af5-a960-4682-ba3d-6312e3281b3f",t._sentryDebugIdIdentifier="sentry-dbid-96310af5-a960-4682-ba3d-6312e3281b3f")}catch{}})();h();Qt();var Dxe=require("../core/index.cjs"),wxe=require("../node/index.cjs"),bxe=require("../server/index.cjs"),Sxe=X(ij(),1);h();h();var kS=require("fs/promises");jF();_r();JC();er();var Or=X(Ir(),1),hh=require("node:path");vs();ks();Qr();Wr();rh();var Ynt="https://cdn.builder.io",ide=async(t,e)=>{console.log(""),nr((0,Or.bgCyan)((0,Or.bold)((0,Or.white)(" figma migrate ")))+" "+(0,Or.dim)(dt));let{builderPrivateKey:r,builderPublicKey:n}=await Wt(t,e,{forceSpaceId:e.spaceId,builderPrivateKey:!0,builderPublicKey:!0});await Pt("figma publish started",{spaceId:n});let i=await HC(t);if(i.length>0){await Pt("figma migrate with existing files",{spaceId:n}),q.warning(`${(0,Or.yellow)("This repo already has figma mappings in:")}
|
|
2808
2807
|
|
|
2809
2808
|
${i.map(c=>` - ${(0,hh.relative)(t.getAppRootDir(),c)}`).join(`
|
|
2810
2809
|
`)}
|
|
@@ -7072,7 +7071,7 @@ Instead, \`yield\` should either be called with a value, or not be called at all
|
|
|
7072
7071
|
Make sure you are authenticated to the correct space.
|
|
7073
7072
|
To switch spaces or re-authenticate, run:
|
|
7074
7073
|
|
|
7075
|
-
npx ${
|
|
7074
|
+
npx ${st()} auth
|
|
7076
7075
|
|
|
7077
7076
|
To create a new project, visit https://builder.io/app/projects.`)}if(c.length===1)return c[0].id;let u=await lm();if(u){let l=gm(u),d=c.filter(g=>zve(g,l));if(d.length===1)return d[0].id;if(d.length>1)return o(d)}return a(c)}h();ua();async function NF(t,e,r,n){n.onGitPushing(e);try{await mi("git",["push","origin",e])}catch(u){throw new Error(`git push failed: ${fl(u)}`)}n.onGitPushed(e),n.onBranchLookupStart();let i=await pm(t.builderPublicKey,t.builderPrivateKey,t.userId,r),s=await lm(),o=!s||!i.repoUrl||TF(i,gm(s)),a=NJ(i,e),A;if(a)A=a[0],n.onBranchFound(A);else{n.onBranchCreating();let u;try{let{stdout:l}=await mi("git",["remote","show","origin"]),g=l.match(/HEAD branch: (.+)/)?.[1]?.trim();if(g){let{stdout:p}=await mi("git",["diff",`origin/${g}...HEAD`]);p.trim()&&(u=p.slice(0,1e4))}}catch{}A=await MJ(t.builderPublicKey,t.builderPrivateKey,t.userId,r,e,u,o),n.onBranchCreated(A)}await RF(r);try{await PJ(t.builderPublicKey,t.builderPrivateKey,t.userId,r,A),n.onSyncDone()}catch(u){let l=u instanceof Error?u.message:String(u);n.onSyncWarning(l)}let c=`https://builder.io/app/projects/${r}/${A}`;return{builderBranchName:A,projectId:r,branchUrl:c}}async function MF(t,e,r,n){n.onBranchResolving(r);let i=await pm(t.builderPublicKey,t.builderPrivateKey,t.userId,e),s=VB(i,r);if(!s)throw new Error(`No Builder branch matching "${r}" was found in project "${e}".`);n.onBranchResolved(s),n.onFetchStart(s);let o=!0;try{await mi("git",["fetch","origin",s]),n.onFetchDone(s)}catch(A){let c=fl(A).toLowerCase();if(!(c.includes("couldn't find remote ref")||c.includes("remote ref does not exist")||c.includes("no such ref was fetched")))throw new Error(`git fetch failed: ${fl(A)}`);o=!1,n.onFetchFailed(s)}n.onCheckoutStart(s);try{await mi("git",["checkout",s])}catch{let A=o?["checkout","-b",s,`origin/${s}`]:["checkout","-b",s];try{await mi("git",A)}catch(c){throw new Error(`git checkout failed: ${fl(c)}`)}}n.onCheckoutDone(s);let a=!1;if(o){n.onPullStart();let{stdout:A}=await mi("git",["rev-parse","HEAD"]);try{await mi("git",["pull","origin",s])}catch(u){throw new Error(`git pull failed: ${fl(u)}`)}let{stdout:c}=await mi("git",["rev-parse","HEAD"]);a=A.trim()!==c.trim(),n.onPullDone(r,a)}else n.onNoRemote(s);return await RF(e),{gitBranch:s,hadChanges:a}}ua();vr();_E();Qr();Di();Bu();h();h();h();var Zve={"builder.io":"https://www.builder.io","builder.codes":"https://test.projects.builder.codes/proxy-health","api.builder.io":"https://api.builder.io/codegen/health","cdn.builder.io":"https://cdn.builder.io/api/v1/image/assets/TEMP/75a212ab82b6175c9862b125e0e23db8d369a58a?width=100","health.builderio.xyz":"https://health.builderio.xyz/health","health.builderio.xyz:ws":"wss://health.builderio.xyz/ws","health.builderio.dev":"https://health.builderio.dev/health","health.builderio.dev:ws":"wss://health.builderio.dev/ws","fly.dev":"https://fly.dev"};function PF(t,e){if(t.startsWith("git-host:")){if(!e)throw new Error(`gitHost parameter is required for test "${t}"`);return e}let r=Zve[t];if(!r)throw new Error(`Unknown testId: ${t}`);return r}function dm(t){try{return new URL(t).hostname}catch{return t}}function LJ(t,e){try{let r=new URL(t);if(r.port)return parseInt(r.port,10);let n=r.protocol==="https:"?443:r.protocol==="http:"?80:null,i=t.slice(t.indexOf("://")+3).split(/[/?#]/)[0];return n!==null&&i.endsWith(`:${n}`)?n:e}catch{return e}}function LF(t,e=443){try{let r=new URL(t);if(r.protocol==="http:"&&!r.port)return 80}catch{}return LJ(t,e)}h();function _F(){return typeof window<"u"&&typeof window.document<"u"}function exe(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null}function _J(t){return t==="health.builderio.xyz:ws"||t==="health.builderio.dev:ws"?"websocket":t.startsWith("git-host:")?t.replace("git-host:",""):"http"}function UJ(t){return t==="http"||t==="websocket"?!0:exe()}function GJ(t){return _F()?`${t.toUpperCase()} checks are not available in browser environments. Only HTTP and WebSocket checks can be performed from the browser.`:`${t.toUpperCase()} checks are not available in this environment.`}h();ku();var PQt=3e4,LQt=5e3;async function OJ(t){let{target:e,source:r,testId:n,timeout:i=PQt,fetchFn:s=fetch,dispatcher:o}=t,a=Date.now(),A=new AbortController,c=setTimeout(()=>A.abort(),i);try{let u="HEAD",l=_F()?"follow":"manual",d=A.signal,g=o?await fetch(e,{method:u,signal:d,redirect:l,dispatcher:o}):await s(e,{method:u,signal:d,redirect:l});clearTimeout(c);let p=Date.now()-a,f=p>LQt;return g.status>=500?{source:r,testId:n,target:e,passed:!1,errorCode:"http_server_error",durationMs:p,metadata:{statusCode:g.status,statusText:g.statusText}}:{source:r,testId:n,target:e,passed:!0,durationMs:p,errorCode:f?"latency_high":void 0,metadata:{statusCode:g.status,statusText:g.statusText,latencyHigh:f}}}catch(u){clearTimeout(c);let l=Date.now()-a,d=u;if(d.name==="AbortError")return{source:r,testId:n,target:e,passed:!1,errorCode:"tcp_connection_timeout",durationMs:l,metadata:{error:"Request timed out",timeoutMs:i}};let g=z1(d);return{source:r,testId:n,target:e,passed:!1,errorCode:g,durationMs:l,metadata:{error:d.message,...d.cause&&{causeCode:d.cause.code}}}}}h();async function txe(t){let{target:e,source:r,testId:n,timeout:i=1e4}=t,s=Date.now();return new Promise(o=>{let a=!1,A=null,c=setTimeout(()=>{a||(a=!0,A?.close(),o({source:r,testId:n,target:e,passed:!1,errorCode:"tcp_connection_timeout",durationMs:Date.now()-s,metadata:{error:"WebSocket connection timed out",timeoutMs:i}}))},i);try{A=new WebSocket(e)}catch(u){clearTimeout(c),a=!0,o({source:r,testId:n,target:e,passed:!1,errorCode:"unknown_error",durationMs:Date.now()-s,metadata:{error:u instanceof Error?u.message:"Failed to create WebSocket"}});return}A.onopen=()=>{if(a)return;a=!0,clearTimeout(c);let u=Date.now()-s;A?.close(1e3),o({source:r,testId:n,target:e,passed:!0,durationMs:u,metadata:{protocol:A?.protocol||void 0}})},A.onerror=()=>{a||(a=!0,clearTimeout(c),o({source:r,testId:n,target:e,passed:!1,errorCode:"tcp_connection_refused",durationMs:Date.now()-s,metadata:{error:"WebSocket connection failed"}}))}})}h();var rxe=X(require("node:dns"),1);ku();var{resolve4:_Qt,resolve6:UQt}=rxe.default.promises,GQt=1e4;async function KJ(t){let{hostname:e,source:r,testId:n,timeout:i=GQt}=t,s=Date.now(),o,a=new Promise((A,c)=>{o=setTimeout(()=>{c(new Error("DNS resolution timed out"))},i)});try{let A=[],c="IPv4";try{A=await Promise.race([_Qt(e),a])}catch(l){let d=l;if(d.code==="ENODATA"||d.code==="ENOTFOUND")try{A=await Promise.race([UQt(e),a]),c="IPv6"}catch{throw l}else throw l}clearTimeout(o);let u=Date.now()-s;return A.length===0?{source:r,testId:n,target:e,passed:!1,errorCode:"dns_resolution_failed",durationMs:u,metadata:{error:"No addresses resolved"}}:{source:r,testId:n,target:e,passed:!0,durationMs:u,metadata:{addresses:A,ipVersion:c,addressCount:A.length}}}catch(A){clearTimeout(o);let c=Date.now()-s,u=A;if(u.message==="DNS resolution timed out")return{source:r,testId:n,target:e,passed:!1,errorCode:"dns_timeout",durationMs:c,metadata:{error:u.message,timeoutMs:i}};let l=Ps(u);return{source:r,testId:n,target:e,passed:!1,errorCode:l,durationMs:c,metadata:{error:u.message,nodeErrorCode:u.code}}}}h();var nxe=X(require("net"),1);ku();var OQt=5e3,KQt=443;async function HJ(t){let{hostname:e,port:r=KQt,source:n,testId:i,timeout:s=OQt,connectFn:o}=t,a=`${e}:${r}`,A=Date.now();try{let c=await new Promise(d=>{if(o){let p=setTimeout(()=>{let f=new Error("Connection timed out");f.code="ETIMEDOUT",d({success:!1,error:f})},s);o(e,r).then(f=>{clearTimeout(p),f.destroy(),d({success:!0})}).catch(f=>{clearTimeout(p),d({success:!1,error:f})});return}let g=new nxe.default.Socket;g.setTimeout(s),g.on("connect",()=>{g.destroy(),d({success:!0})}),g.on("timeout",()=>{g.destroy();let p=new Error("Connection timed out");p.code="ETIMEDOUT",d({success:!1,error:p})}),g.on("error",p=>{g.destroy(),d({success:!1,error:p})}),g.connect(r,e)}),u=Date.now()-A;if(c.success)return{source:n,testId:i,target:a,passed:!0,durationMs:u,metadata:{hostname:e,port:r}};let l=c.error?Ps(c.error):"tcp_connection_timeout";return{source:n,testId:i,target:a,passed:!1,errorCode:l,durationMs:u,metadata:{hostname:e,port:r,error:c.error?.message,nodeErrorCode:c.error?.code}}}catch(c){let u=Date.now()-A,l=c;return{source:n,testId:i,target:a,passed:!1,errorCode:Ps(l),durationMs:u,metadata:{hostname:e,port:r,error:l.message,nodeErrorCode:l.code}}}}h();var sxe=X(require("tls"),1);ku();var HQt=1e4,JQt=443;async function JJ(t){let{hostname:e,port:r=JQt,source:n,testId:i,timeout:s=HQt,connectFn:o}=t,a=`${e}:${r}`,A=Date.now();try{let c;if(o){let g=!1,p=o(e,r);c=await new Promise((f,m)=>{let C=setTimeout(()=>{g=!0,p.then(B=>B.destroy()).catch(()=>{});let I=new Error("Proxy CONNECT timed out");I.code="ETIMEDOUT",m(I)},s);p.then(I=>{clearTimeout(C),g?I.destroy():f(I)}).catch(I=>{clearTimeout(C),m(I)})})}let u=await new Promise(g=>{let p=sxe.default.connect({host:e,port:r,servername:e,rejectUnauthorized:!0,timeout:s,...c?{socket:c}:{}},()=>{let f=p.getPeerCertificate(),m;f&&Object.keys(f).length>0&&(m={subject:ixe(f.subject),issuer:ixe(f.issuer),validFrom:f.valid_from,validTo:f.valid_to,fingerprint:f.fingerprint,serialNumber:f.serialNumber,subjectAltNames:f.subjectaltname?f.subjectaltname.split(", "):void 0}),p.end(),g({success:!0,certInfo:m})});p.on("timeout",()=>{p.destroy();let f=new Error("TLS connection timed out");f.code="ETIMEDOUT",g({success:!1,error:f})}),p.on("error",f=>{p.destroy(),g({success:!1,error:f})})}),l=Date.now()-A;if(u.success)return{source:n,testId:i,target:a,passed:!0,durationMs:l,metadata:{hostname:e,port:r,certificate:u.certInfo}};let d=u.error?Ps(u.error):"tls_handshake_failed";return{source:n,testId:i,target:a,passed:!1,errorCode:d,durationMs:l,metadata:{hostname:e,port:r,error:u.error?.message,nodeErrorCode:u.error?.code}}}catch(c){let u=Date.now()-A,l=c;return{source:n,testId:i,target:a,passed:!1,errorCode:Ps(l),durationMs:u,metadata:{hostname:e,port:r,error:l.message,nodeErrorCode:l.code}}}}function ixe(t){if(!t)return"";let e=[],r=["CN","O","OU","L","ST","C"];for(let n of r){let i=t[n];i&&e.push(`${n}=${i}`)}return e.join(", ")}h();var oxe=X(require("net"),1);ku();var jQt=22,YQt=5e3,qQt="SSH-";async function jJ(t){let{hostname:e,port:r=jQt,source:n,testId:i,timeout:s=YQt}=t,o=`${e}:${r}`,a=Date.now();try{let A=await new Promise(l=>{let d=new oxe.default.Socket,g="";d.setTimeout(s),d.on("connect",()=>{}),d.on("data",p=>{g+=p.toString(),(g.includes(`
|
|
7078
7077
|
`)||g.length>256)&&(d.destroy(),g=g.split(`
|
|
@@ -7096,10 +7095,10 @@ ${(0,at.bold)("Examples:")}
|
|
|
7096
7095
|
`)}var qJ=ve("DsiMcp");async function tDt(){try{let t=await WB({tests:[...zB],fetchFn:UF}),e=[`
|
|
7097
7096
|
|
|
7098
7097
|
Network Connectivity Diagnostics:`];for(let n of t.results){let i=n.passed?"\u2713":"\u2717",s=n.passed?"OK":`FAILED${n.errorCode?` (${GF(n.errorCode)})`:""}`;e.push(` ${i} ${n.testId}: ${s} (${n.durationMs}ms)`)}return t.results.filter(n=>!n.passed).length>0&&e.push(`
|
|
7099
|
-
If you are on a corporate network, make sure you are connected to your VPN.`,`Run \`npx ${
|
|
7098
|
+
If you are on a corporate network, make sure you are connected to your VPN.`,`Run \`npx ${st()} doctor\` for detailed diagnostics and recommendations.`),e.join(`
|
|
7100
7099
|
`)}catch{return`
|
|
7101
7100
|
|
|
7102
|
-
Run \`npx ${
|
|
7101
|
+
Run \`npx ${st()} doctor\` for detailed diagnostics.`}}var Ci=null,Ds=null,fxe=new Map;async function lxe(){return Ci||(Ci=await(0,dxe.createDevToolsNodeSys)({cwd:process.cwd(),ignoreMissingConfig:!0})),Ci}var XB=async t=>{if(!Ci||!Ds)throw new Error("System and args must be initialized before calling remote MCP");let{builderPublicKey:e,builderPrivateKey:r,userId:n}=So(Ci,Ds);if(!e||!n||!r)throw new Error(`Missing required credentials. Please run \`npx ${st()} auth\` to authenticate.`);let i=new URL(`${Te}/design-systems/v1/mcp`);i.searchParams.set("apiKey",e),i.searchParams.set("userId",n);try{let s=await Re(i,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify(t)});if(!s.ok){let a=await s.text();throw new Error(`Failed to call tool: ${s.status} ${s.statusText}. ${a}`)}let o=await s.json();if(o.error)throw new Error(o.error.message);return o}catch(s){if(s instanceof ti)throw s;if(s instanceof Ye&&s.type!=="server_error"){let o=await tDt();throw new Error(s.message+o,{cause:s})}throw s}};async function gxe(t){return fxe.set(t,{uri:t,name:t,description:"Figma Quick Copy export with design implementation data",mimeType:"application/json"}),await Tp.sendResourceListChanged(),`
|
|
7103
7102
|
A new resource has been created with the URI ${t}. You should read this resource from the MCP server so you know the Figma design you are implementing.`}var Tp=new mx({name:"Builder.io Design System Intelligence",version:"0.0.1"},{capabilities:{tools:{},resources:{subscribe:!0,listChanged:!0}},instructions:"An important source of information to understand design systems and components. You must use this MCP server to understand how to implement a UI using the design system."});async function pxe(t,e,r,n){return Tl({projectId:t,builderPublicKey:e,builderPrivateKey:r,userId:n,onMultipleRepoMatches:async i=>{let s=i.map(o=>` - ${o.name} (${o.id})`).join(`
|
|
7104
7103
|
`);throw new Error(`Multiple Builder.io projects are connected to this repository. Please specify a projectId.
|
|
7105
7104
|
|
|
@@ -7108,13 +7107,13 @@ ${s}`)},onNoRepoMatch:async i=>{let s=i.map(o=>` - ${o.name} (${o.id})`).join(`
|
|
|
7108
7107
|
`);throw new Error(`Multiple Builder.io projects found. Please specify a projectId in your tool call.
|
|
7109
7108
|
|
|
7110
7109
|
Available projects:
|
|
7111
|
-
${s}`)}})}Tp.setRequestHandler($_,async()=>{let{result:t}=await XB({method:"tools/list",params:{}});return{tools:[...t.tools,{name:"push",title:"Push to Builder",annotations:{destructiveHint:!0},description:"Push the current git branch to origin and ensure a corresponding Builder.io branch exists. Equivalent to running `npx @builder.io/dev-tools push` from the CLI.",inputSchema:{type:"object",properties:{projectId:{type:"string",description:"Optional Builder.io project ID. If omitted, the project is auto-detected from the git remote or pinned project."}}}},{name:"pull",title:"Pull from Builder",annotations:{destructiveHint:!0},description:"Resolve a Builder.io branch to its corresponding git branch, then fetch and check it out locally. Equivalent to running `npx @builder.io/dev-tools pull <builder-branch>` from the CLI.",inputSchema:{type:"object",properties:{builderBranch:{type:"string",description:'The Builder.io branch name, ID, or full Builder project URL to pull. Accepts a branch name/ID (e.g. "my-feature") or a full Builder URL (e.g. "https://builder.io/app/projects/<projectId>/<branchName>"). When a URL is provided, projectId and branchName are parsed from it automatically.'},projectId:{type:"string",description:"Optional Builder.io project ID. If omitted, the project is auto-detected from the git remote or pinned project. Ignored when builderBranch is a full Builder URL."}},required:["builderBranch"]}},{name:"planWithDesignSystem",annotations:{readOnlyHint:!0},title:"Plan with Design System",description:"Analyze and plan how to implement a prompt using the design system. Understand proper usage of components, patterns, design tokens, and icons.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"The prompt from the user."},smartExportUrl:{type:"string",description:"The URL for a Smart Export/Quick Copy Figma design if available. Accepts a vcp://quickcopy/vcp-{ID} URI or a builder.io URL with a figmaQuickCopyData query parameter."}},required:["prompt"]}},{name:"implementWithDesignSystem",annotations:{destructiveHint:!0},title:"Implement with Design System",description:"Implement a UI using the design system. Runs Builder's full code generation pipeline and writes code directly to your project files.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"The prompt describing what to implement."},smartExportUrl:{type:"string",description:"The URL for a Smart Export/Quick Copy Figma design if available. Accepts a vcp://quickcopy/vcp-{ID} URI or a builder.io URL with a figmaQuickCopyData query parameter."}},required:["prompt"]}},{name:"pullPrototype",annotations:{readOnlyHint:!0},title:"Pull Prototype",description:"Pull a Builder.io prototype's code and conversation history. Returns the local directory path where prototype code is stored and the formatted conversation history. The caller is responsible for reading the code, using the conversation as context, and cleaning up the prototype directory when done.",inputSchema:{type:"object",properties:{prototypeUrl:{type:"string",description:"The Builder prototype URL. Format: https://builder.io/app/projects/<projectId>/<branchName>"}},required:["prototypeUrl"]}}]}});Tp.setRequestHandler(M_,async()=>{let{result:t}=await XB({method:"resources/templates/list",params:{}});return{resourceTemplates:t.resourceTemplates}});Tp.setRequestHandler(T_,async()=>{let t=Array.from(fxe.values()),{result:e}=await XB({method:"resources/list",params:{}});return{resources:[...e.resources,...t]}});Tp.setRequestHandler(__,async t=>{let{result:e}=await XB(t);return{contents:e.contents}});Tp.setRequestHandler(vI,async t=>{let{name:e,arguments:r}=t.params;if(e==="push"){let n=[];try{if(!Ci||!Ds)return{content:[{type:"text",text:"System and args must be initialized before calling push"}],isError:!0};let{builderPublicKey:i,builderPrivateKey:s,userId:o}=So(Ci,Ds);if(!i||!s)return{content:[{type:"text",text:`Missing required credentials. Please run \`npx ${
|
|
7110
|
+
${s}`)}})}Tp.setRequestHandler($_,async()=>{let{result:t}=await XB({method:"tools/list",params:{}});return{tools:[...t.tools,{name:"push",title:"Push to Builder",annotations:{destructiveHint:!0},description:"Push the current git branch to origin and ensure a corresponding Builder.io branch exists. Equivalent to running `npx @builder.io/dev-tools push` from the CLI.",inputSchema:{type:"object",properties:{projectId:{type:"string",description:"Optional Builder.io project ID. If omitted, the project is auto-detected from the git remote or pinned project."}}}},{name:"pull",title:"Pull from Builder",annotations:{destructiveHint:!0},description:"Resolve a Builder.io branch to its corresponding git branch, then fetch and check it out locally. Equivalent to running `npx @builder.io/dev-tools pull <builder-branch>` from the CLI.",inputSchema:{type:"object",properties:{builderBranch:{type:"string",description:'The Builder.io branch name, ID, or full Builder project URL to pull. Accepts a branch name/ID (e.g. "my-feature") or a full Builder URL (e.g. "https://builder.io/app/projects/<projectId>/<branchName>"). When a URL is provided, projectId and branchName are parsed from it automatically.'},projectId:{type:"string",description:"Optional Builder.io project ID. If omitted, the project is auto-detected from the git remote or pinned project. Ignored when builderBranch is a full Builder URL."}},required:["builderBranch"]}},{name:"planWithDesignSystem",annotations:{readOnlyHint:!0},title:"Plan with Design System",description:"Analyze and plan how to implement a prompt using the design system. Understand proper usage of components, patterns, design tokens, and icons.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"The prompt from the user."},smartExportUrl:{type:"string",description:"The URL for a Smart Export/Quick Copy Figma design if available. Accepts a vcp://quickcopy/vcp-{ID} URI or a builder.io URL with a figmaQuickCopyData query parameter."}},required:["prompt"]}},{name:"implementWithDesignSystem",annotations:{destructiveHint:!0},title:"Implement with Design System",description:"Implement a UI using the design system. Runs Builder's full code generation pipeline and writes code directly to your project files.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"The prompt describing what to implement."},smartExportUrl:{type:"string",description:"The URL for a Smart Export/Quick Copy Figma design if available. Accepts a vcp://quickcopy/vcp-{ID} URI or a builder.io URL with a figmaQuickCopyData query parameter."}},required:["prompt"]}},{name:"pullPrototype",annotations:{readOnlyHint:!0},title:"Pull Prototype",description:"Pull a Builder.io prototype's code and conversation history. Returns the local directory path where prototype code is stored and the formatted conversation history. The caller is responsible for reading the code, using the conversation as context, and cleaning up the prototype directory when done.",inputSchema:{type:"object",properties:{prototypeUrl:{type:"string",description:"The Builder prototype URL. Format: https://builder.io/app/projects/<projectId>/<branchName>"}},required:["prototypeUrl"]}}]}});Tp.setRequestHandler(M_,async()=>{let{result:t}=await XB({method:"resources/templates/list",params:{}});return{resourceTemplates:t.resourceTemplates}});Tp.setRequestHandler(T_,async()=>{let t=Array.from(fxe.values()),{result:e}=await XB({method:"resources/list",params:{}});return{resources:[...e.resources,...t]}});Tp.setRequestHandler(__,async t=>{let{result:e}=await XB(t);return{contents:e.contents}});Tp.setRequestHandler(vI,async t=>{let{name:e,arguments:r}=t.params;if(e==="push"){let n=[];try{if(!Ci||!Ds)return{content:[{type:"text",text:"System and args must be initialized before calling push"}],isError:!0};let{builderPublicKey:i,builderPrivateKey:s,userId:o}=So(Ci,Ds);if(!i||!s)return{content:[{type:"text",text:`Missing required credentials. Please run \`npx ${st()} auth\` to authenticate.`}],isError:!0};let a;try{let{stdout:d}=await mi("git",["symbolic-ref","--short","HEAD"]);a=d.trim()}catch{return{content:[{type:"text",text:"Not inside a git repository, or HEAD is detached. Please run this command from a git branch."}],isError:!0}}await pc(process.cwd(),Ci)||n.push("Warning: You have uncommitted changes that will not be included in this push.");let c=o??"",u=await pxe(r?.projectId,i,s,c),l=await NF({builderPublicKey:i,builderPrivateKey:s,userId:c},a,u,{onGitPushing:d=>n.push(`Pushing "${d}" to origin...`),onGitPushed:d=>n.push(`Pushed "${d}" to origin.`),onBranchLookupStart:()=>{},onBranchFound:d=>n.push(`Found existing Builder branch: ${d}`),onBranchCreating:()=>n.push("No existing Builder branch found. Creating one..."),onBranchCreated:d=>n.push(`Created Builder branch: ${d}`),onSyncDone:()=>n.push("Remote container synced."),onSyncWarning:d=>n.push(`Warning: Could not notify remote container to sync: ${d}`)});return n.push(`Branch pushed successfully. View at: ${l.branchUrl}`),{content:[{type:"text",text:n.join(`
|
|
7112
7111
|
`)}],isError:!1}}catch(i){Nl.captureException(new Error("Builder MCP push failed",{cause:i}),{tags:{operation:"dsi-mcp-push"}});let s=i instanceof Error?i.message:String(i);return{content:[{type:"text",text:n.length>0?`${n.join(`
|
|
7113
7112
|
`)}
|
|
7114
|
-
${s}`:s}],isError:!0}}}if(e==="pull"){let n=[];try{if(!Ci||!Ds)return{content:[{type:"text",text:"System and args must be initialized before calling pull"}],isError:!0};let{builderPublicKey:i,builderPrivateKey:s,userId:o}=So(Ci,Ds);if(!i||!s)return{content:[{type:"text",text:`Missing required credentials. Please run \`npx ${
|
|
7113
|
+
${s}`:s}],isError:!0}}}if(e==="pull"){let n=[];try{if(!Ci||!Ds)return{content:[{type:"text",text:"System and args must be initialized before calling pull"}],isError:!0};let{builderPublicKey:i,builderPrivateKey:s,userId:o}=So(Ci,Ds);if(!i||!s)return{content:[{type:"text",text:`Missing required credentials. Please run \`npx ${st()} auth\` to authenticate.`}],isError:!0};let a=r?.builderBranch;if(!a)return{content:[{type:"text",text:'Missing required parameter: builderBranch. Usage: provide { "builderBranch": "<branch-name>" } or { "builderBranch": "https://builder.io/app/projects/<projectId>/<branchName>" } in the tool arguments.'}],isError:!0};let A;if(a.includes("builder.io/app/projects/"))try{A=vc(a)}catch(g){return{content:[{type:"text",text:g instanceof Error?g.message:String(g)}],isError:!0}}else A=null;let c=A?.branchName??a,u=A?.projectId,l=o??"",d=await pxe(u??r?.projectId,i,s,l);return await MF({builderPublicKey:i,builderPrivateKey:s,userId:l},d,c,{onBranchResolving:g=>n.push(`Resolving Builder branch "${g}"...`),onBranchResolved:g=>n.push(`Resolved to git branch "${g}".`),onFetchStart:g=>{},onFetchDone:g=>n.push(`Fetched "${g}" from origin.`),onFetchFailed:g=>n.push(`Branch "${g}" not found on remote.`),onCheckoutStart:g=>{},onCheckoutDone:g=>n.push(`Checked out "${g}".`),onPullStart:()=>{},onPullDone:(g,p)=>n.push(p?`Pulled "${g}" successfully.`:`Already up to date. No changes pulled for "${g}".`),onNoRemote:g=>n.push(`Checked out local branch "${g}". No remote branch to pull from.`)}),{content:[{type:"text",text:n.join(`
|
|
7115
7114
|
`)}],isError:!1}}catch(i){Nl.captureException(new Error("Builder MCP pull failed",{cause:i}),{tags:{operation:"dsi-mcp-pull"}});let s=i instanceof Error?i.message:String(i);return{content:[{type:"text",text:n.length>0?`${n.join(`
|
|
7116
7115
|
`)}
|
|
7117
|
-
${s}`:s}],isError:!0}}}if(e==="planWithDesignSystem")try{if(!Ci||!Ds)return{content:[{type:"text",text:"System and args must be initialized before calling planWithDesignSystem"}],isError:!0};let{builderPublicKey:n,builderPrivateKey:i,userId:s}=So(Ci,Ds);if(!n||!s||!i)return{content:[{type:"text",text:`Missing required credentials. Please run \`npx ${
|
|
7116
|
+
${s}`:s}],isError:!0}}}if(e==="planWithDesignSystem")try{if(!Ci||!Ds)return{content:[{type:"text",text:"System and args must be initialized before calling planWithDesignSystem"}],isError:!0};let{builderPublicKey:n,builderPrivateKey:i,userId:s}=So(Ci,Ds);if(!n||!s||!i)return{content:[{type:"text",text:`Missing required credentials. Please run \`npx ${st()} auth\` to authenticate.`}],isError:!0};if(!r||!r.prompt)return{content:[{type:"text",text:"Missing prompt"}],isError:!0};let o=await lxe(),a={userToken:i,builderPrivateKey:i,builderPublicKey:n,userId:s},A=new Ia({sys:o,credentials:a,position:"dsi-mcp",workingDirectory:process.cwd(),mcpServers:!0,autoImportLocalMCPs:!1,builtInCustomAgents:[{name:"design-system-agent",model:"acs",description:"Analyze and plan how to implement a prompt using the design system. Understand proper usage of components, patterns, design tokens, and icons.",tools:["Read","Grep","Glob","ReadMcpResource"],systemPrompt:`
|
|
7118
7117
|
You are a senior UI engineer who takes prompts and designs and turns them into code.
|
|
7119
7118
|
|
|
7120
7119
|
When invoked you must do the following:
|
|
@@ -7126,12 +7125,12 @@ When invoked you must do the following:
|
|
|
7126
7125
|
5. Generate and return a plan for how to implement code such that the prompt and Figma design are respect and the design system is used correctly. Include information such as components, tokens, and icons to use, implementation patterns to follow, and relevant design system documents to reference. You may use the ExplorationMetadata tool to note any relevant files in the codebase that should be used during implementation. Never write any implementation code (pseudo code or otherwise). Your job is only to advise on how the code should be implemented.
|
|
7127
7126
|
|
|
7128
7127
|
Remember that your main goal is not to write code, or modify anything. You excel at performing planning tasks.`}],enabledTools:["Read","Write","Glob","Grep","Skill","TaskCreate","TaskUpdate","TaskList","Agent","ReadMcpResource","ExplorationMetadata"]});await A.initializeSession({skipSessionLoading:!0});let c=A.connectToEventLoop(!1,async g=>{g.type==="error"&&(qJ.error(g.message),Nl.captureException(new Error("Builder MCP planWithDesignSystem error",{cause:g.message}),{tags:{operation:"dsi-mcp-plan"}}))}),u=r.prompt;r.smartExportUrl&&(u+=`
|
|
7129
|
-
Smart Export URL: ${r.smartExportUrl}`);let l;try{l=await A.spawnNamedAgent("design-system-agent",{signal:new AbortController().signal,mcpServers:!0,prompt:u,user:{source:"agent",role:"agent"},sessionId:A.getSessionId(),maxCompletions:1e3})}finally{c(),await A.close()}let d=l.response;return l.success&&r.smartExportUrl&&(d+=await gxe(r.smartExportUrl)),{content:[{type:"text",text:d}],isError:!l.success}}catch(n){return qJ.error("Error spawning agent:",n),Nl.captureException(new Error("Builder MCP planWithDesignSystem failed",{cause:n}),{tags:{operation:"dsi-mcp-plan"}}),{content:[{type:"text",text:`Error spawning codegen agent: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}if(e==="implementWithDesignSystem")try{if(!Ci||!Ds)return{content:[{type:"text",text:"System and args must be initialized before calling implementWithDesignSystem"}],isError:!0};let{builderPublicKey:n,builderPrivateKey:i,userId:s}=So(Ci,Ds);if(!n||!s||!i)return{content:[{type:"text",text:`Missing required credentials. Please run \`npx ${
|
|
7128
|
+
Smart Export URL: ${r.smartExportUrl}`);let l;try{l=await A.spawnNamedAgent("design-system-agent",{signal:new AbortController().signal,mcpServers:!0,prompt:u,user:{source:"agent",role:"agent"},sessionId:A.getSessionId(),maxCompletions:1e3})}finally{c(),await A.close()}let d=l.response;return l.success&&r.smartExportUrl&&(d+=await gxe(r.smartExportUrl)),{content:[{type:"text",text:d}],isError:!l.success}}catch(n){return qJ.error("Error spawning agent:",n),Nl.captureException(new Error("Builder MCP planWithDesignSystem failed",{cause:n}),{tags:{operation:"dsi-mcp-plan"}}),{content:[{type:"text",text:`Error spawning codegen agent: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}if(e==="implementWithDesignSystem")try{if(!Ci||!Ds)return{content:[{type:"text",text:"System and args must be initialized before calling implementWithDesignSystem"}],isError:!0};let{builderPublicKey:n,builderPrivateKey:i,userId:s}=So(Ci,Ds);if(!n||!s||!i)return{content:[{type:"text",text:`Missing required credentials. Please run \`npx ${st()} auth\` to authenticate.`}],isError:!0};if(!r||!r.prompt)return{content:[{type:"text",text:"Missing prompt"}],isError:!0};let o=await lxe(),a={userToken:i,builderPrivateKey:i,builderPublicKey:n,userId:s},A=await ll(o,Ds),c=new Ia({sys:o,credentials:a,position:"dsi-mcp",mcpServers:!0,autoImportLocalMCPs:!1,skipFileDiff:!1,fusionConfig:A}),u=[],l,d,g=r.prompt;r.smartExportUrl&&(g+=`
|
|
7130
7129
|
Smart Export URL: ${r.smartExportUrl}`);try{await c.initializeSession({skipSessionLoading:!0}),await c.sendMessage({userPrompt:g,user:{source:"builder.io",userId:a.userId,role:"user"}}),d=c.connectToEventLoop(!1,async I=>{switch(I.type){case"done":{u=[...u,...I.applyResults??[]];break}case"wait-for-input":{await c.stopEventLoop();break}case"error":{l=I.message,Nl.captureException(new Error("Builder MCP implement error",{cause:I.message}),{tags:{operation:"dsi-mcp-implement"}});break}}});let m=!1,C=setTimeout(()=>{m=!0,c.stopEventLoop()},300*1e3);try{await c.waitForEventLoop()}finally{clearTimeout(C)}if(m)throw new Error("Implementation timed out after 5 minutes. The operation was stopped.")}finally{d?.(),await c.close()}if(l)return{content:[{type:"text",text:l}],isError:!0};let p=r.smartExportUrl?await gxe(r.smartExportUrl):"";return{content:[{type:"text",text:u.length>0?`Implementation complete.
|
|
7131
7130
|
|
|
7132
7131
|
Files changed:
|
|
7133
7132
|
${u.map(m=>` ${m.filePath} (+${m.addedLines} -${m.removedLines})`).join(`
|
|
7134
|
-
`)}${p}`:`Implementation complete. No files were changed.${p}`}],isError:!1}}catch(n){return Nl.captureException(new Error("Builder MCP implementWithDesignSystem failed",{cause:n}),{tags:{operation:"dsi-mcp-implement"}}),{content:[{type:"text",text:`Error running implementation: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}if(e==="pullPrototype")try{if(!Ci||!Ds)return{content:[{type:"text",text:"System and args must be initialized before calling pullPrototype"}],isError:!0};let{builderPublicKey:n,builderPrivateKey:i,userId:s}=So(Ci,Ds);if(!n||!s||!i)return{content:[{type:"text",text:`Missing required credentials. Please run \`npx ${
|
|
7133
|
+
`)}${p}`:`Implementation complete. No files were changed.${p}`}],isError:!1}}catch(n){return Nl.captureException(new Error("Builder MCP implementWithDesignSystem failed",{cause:n}),{tags:{operation:"dsi-mcp-implement"}}),{content:[{type:"text",text:`Error running implementation: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}if(e==="pullPrototype")try{if(!Ci||!Ds)return{content:[{type:"text",text:"System and args must be initialized before calling pullPrototype"}],isError:!0};let{builderPublicKey:n,builderPrivateKey:i,userId:s}=So(Ci,Ds);if(!n||!s||!i)return{content:[{type:"text",text:`Missing required credentials. Please run \`npx ${st()} auth\` to authenticate.`}],isError:!0};if(!r||!r.prototypeUrl)return{content:[{type:"text",text:"Missing prototypeUrl"}],isError:!0};let o=vc(r.prototypeUrl);if(!o)return{content:[{type:"text",text:`Invalid prototype URL: ${r.prototypeUrl}
|
|
7135
7134
|
Expected format: https://builder.io/app/projects/<projectId>/<branchName>`}],isError:!0};let a={"Content-Type":"application/json",Authorization:`Bearer ${i}`},[A,c]=await Promise.all([HE({projectId:o.projectId,branchName:o.branchName,apiKey:n,authHeaders:a,userId:s,showLogs:!1}),KE({projectId:o.projectId,branchName:o.branchName,apiKey:n,authHeaders:a,userId:s}).catch(()=>[])]);if(!A)return{content:[{type:"text",text:"Failed to pull prototype. The prototype may not exist or you may not have access."}],isError:!0};let u=A.projectDir,l=b8(c);return{content:[{type:"text",text:`## Prototype Code
|
|
7136
7135
|
The prototype code has been downloaded to: ${u}
|
|
7137
7136
|
|
|
@@ -7156,22 +7155,22 @@ ${l}
|
|
|
7156
7155
|
Make sure you are authenticated to the correct Builder.io space.
|
|
7157
7156
|
To switch spaces or re-authenticate, run:
|
|
7158
7157
|
|
|
7159
|
-
npx ${
|
|
7158
|
+
npx ${st()} auth`),await Ne(1)}throw l instanceof Error&&l.message.startsWith("git push failed")?(q.error(l.message),q.info(`If the remote is ahead of your local branch, run:
|
|
7160
7159
|
${(0,KF.cyan)("npx builder.io pull <builder-branch>")} first, then retry.`),new Error("git push failed")):l}}h();vs();_r();al();er();var VJ=X(Ir(),1);St();ua();GE();async function Qxe(t,e){let{builderPublicKey:r,builderPrivateKey:n,userId:i,spaceName:s}=await Wt(t,e,{builderPrivateKey:!0,builderPublicKey:!0});if(!r||!n)throw new Error("Builder.io credentials are required. Run `npx builder.io auth` first.");let o=i??"",a=e._[1];if(!a)throw new Error(`Builder branch is required. Usage: npx builder.io pull <builder-branch>
|
|
7161
7160
|
or: npx builder.io pull https://builder.io/app/projects/<projectId>/<branchName>`);let A=null;if(a.includes("builder.io/app/projects/"))try{A=vc(a)}catch{throw new Error(`Invalid Builder URL: ${a}. Expected format: https://builder.io/app/projects/<projectId>/<branchName>`)}else A=null;let c=A?.projectId,u=A?.branchName??a;c&&e.projectId&&e.projectId!==c&&q.info(`Note: using projectId "${c}" from the URL (overrides --project "${e.projectId}").`);let l=c??e.projectId;if(e.dryrun){q.info(`Dry run: would resolve Builder branch "${u}" to a git branch and pull.`);let p=await pm(r,n,o,await Tl({projectId:l,builderPublicKey:r,builderPrivateKey:n,userId:o,spaceName:s,onMultipleRepoMatches:async m=>(q.info("Multiple Builder.io projects are connected to this repository. Please select one:"),Np(m,"Select a Builder.io project for this repository:")),onNoRepoMatch:async m=>Np(m,"Select a Builder.io project:")})),f=VB(p,u);if(!f)throw new Error(`No Builder branch matching "${u}" was found.`);q.info(`Dry run: would pull git branch "${f}" (Builder branch: ${u})`);return}let d;try{d=await Tl({projectId:l,builderPublicKey:r,builderPrivateKey:n,userId:o,spaceName:s,onMultipleRepoMatches:async p=>(q.info("Multiple Builder.io projects are connected to this repository. Please select one:"),Np(p,"Select a Builder.io project for this repository:")),onNoRepoMatch:async p=>Np(p,"Select a Builder.io project:")})}catch(p){throw p}let g=gi();try{await MF({builderPublicKey:r,builderPrivateKey:n,userId:o},d,u,{onBranchResolving:p=>g.start(`Resolving Builder branch "${p}"...`),onBranchResolved:p=>g.stop(`Resolved to git branch "${p}".`),onFetchStart:p=>g.start(`Fetching "${p}" from origin...`),onFetchDone:p=>g.stop(`Fetched "${p}".`),onFetchFailed:p=>g.stop(`Branch "${p}" not found on remote.`),onCheckoutStart:p=>g.start(`Checking out "${p}"...`),onCheckoutDone:p=>g.stop(`Checked out "${p}".`),onPullStart:()=>g.start("Pulling latest changes..."),onPullDone:(p,f)=>{f?g.stop(`Pulled "${p}" successfully.`):g.stop(`Already up to date. No changes pulled for "${p}".`)},onNoRemote:p=>{q.info(`Checked out local branch "${p}". No remote branch to pull from.`)}})}catch(p){if(g.stop("Failed.",1),p instanceof Rp){let f=s?`"${s}" (${p.builderPublicKey})`:p.builderPublicKey;q.error(`Project "${p.projectId}" was not found in space ${f}.
|
|
7162
7161
|
Make sure you are authenticated to the correct Builder.io space.
|
|
7163
7162
|
To switch spaces or re-authenticate, run:
|
|
7164
7163
|
|
|
7165
|
-
npx ${
|
|
7164
|
+
npx ${st()} auth`),await Ne(1)}if(p instanceof Error){if(p.message.includes("No Builder branch")){let f=s?`"${s}" (${r})`:r;throw new Error(`No Builder branch matching "${u}" was found in project "${d}".
|
|
7166
7165
|
|
|
7167
7166
|
You are currently authenticated to space ${f}.
|
|
7168
7167
|
If this is the wrong space, re-authenticate with the correct one by running:
|
|
7169
7168
|
|
|
7170
|
-
npx ${
|
|
7169
|
+
npx ${st()} auth
|
|
7171
7170
|
|
|
7172
7171
|
Otherwise, make sure the branch exists and the Builder.io web app has pushed its changes to the git remote before pulling.`)}if(p.message.startsWith("git checkout failed"))throw await pc(process.cwd(),t)||q.info(`If you have local uncommitted changes blocking checkout, stash them first:
|
|
7173
7172
|
${(0,VJ.cyan)("git stash")}`),new Error("git checkout failed");if(p.message.startsWith("git pull failed"))throw await pc(process.cwd(),t)||q.info(`If you have local uncommitted changes blocking the pull, stash them first:
|
|
7174
|
-
${(0,VJ.cyan)("git stash")}`),new Error("git pull failed")}throw p}}tj();async function aDt(t,e){console.log(""),nr((0,Ml.bgMagenta)((0,Ml.bold)((0,Ml.white)(" dev-tools server ")))+" "+(0,Ml.dim)(dt)),t.debug("builder dev tools cli init");let r=await(0,Dxe.createDevTools)(t,e.nativeApp);await(0,bxe.createDevToolsServer)({...r,getClientId:()=>"builder-dev-tools-cli",closeAppServer:async()=>{},restartAppServer:async()=>{t.debug("restart server")},enableAppWatch:async n=>n,...t})}hye();async function ADt(){let t=(0,Sxe.default)(process.argv.slice(2),{string:["figmaToken","privateKey","spaceId","cwd","prompt","token","url","sessionId","command","c","serverUrl","builderPublicKey","builderPrivateKey","builderUserId","repoFullName","branchName","installCommand","projectId","configJson","configPath","workspace","enabledTools","disabledTools","designSystemPackage","includeDirectories","addDirectory","scope","components","include","exclude","instructions","uploadCustomDocs"],boolean:["help","ci","force","verbose","fusionInit","debug","dryrun","yes","skipInstallation","skipDetailedGrouping","noAuth","auth","dev","app","noOpen","open","silent","interactive","jsonOutput","local","clearMappings","index","listIndexedRepos","disableMcp","reset","privacyMode","nativeApp","
|
|
7173
|
+
${(0,VJ.cyan)("git stash")}`),new Error("git pull failed")}throw p}}tj();async function aDt(t,e){console.log(""),nr((0,Ml.bgMagenta)((0,Ml.bold)((0,Ml.white)(" dev-tools server ")))+" "+(0,Ml.dim)(dt)),t.debug("builder dev tools cli init");let r=await(0,Dxe.createDevTools)(t,e.nativeApp);await(0,bxe.createDevToolsServer)({...r,getClientId:()=>"builder-dev-tools-cli",closeAppServer:async()=>{},restartAppServer:async()=>{t.debug("restart server")},enableAppWatch:async n=>n,...t})}hye();async function ADt(){let t=(0,Sxe.default)(process.argv.slice(2),{string:["figmaToken","privateKey","spaceId","cwd","prompt","token","url","sessionId","command","c","serverUrl","builderPublicKey","builderPrivateKey","builderUserId","repoFullName","branchName","installCommand","projectId","configJson","configPath","workspace","enabledTools","disabledTools","designSystemPackage","includeDirectories","addDirectory","scope","components","include","exclude","instructions","uploadCustomDocs"],boolean:["help","ci","force","verbose","fusionInit","debug","dryrun","yes","skipInstallation","skipDetailedGrouping","noAuth","auth","dev","app","noOpen","open","silent","interactive","jsonOutput","local","clearMappings","index","listIndexedRepos","disableMcp","reset","privacyMode","nativeApp","acceptSelfSigned","chat","createFusionExample","testFusionExample","continuous","accept"],alias:{p:"port",c:"command",json:"jsonOutput",native:"nativeApp",y:"yes",add:"addDirectory",i:"include",e:"exclude",project:"projectId","dry-run":"dryrun"},default:{interactive:!1,fusionInit:!1}});t.cwd&&process.chdir(t.cwd),t.debug&&(process.env.DEBUG="1"),t.acceptSelfSigned&&(process.env.FUSION_REJECT_UNAUTHORIZED="0");let e=await IW(!!(t.verbose||t.debug));rj("process",Ne),await e.withScope(async r=>{try{let n=await(0,wxe.createDevToolsNodeSys)({cwd:process.cwd(),ignoreMissingConfig:!0});n.Sentry?.setTag("cli-command",t._.join(" ")),n.Sentry?.setContext("flags-args",{...t});let{builderPublicKey:i}=await Wt(n,t,{});if(n.Sentry?.setTag("spaceId",i),t.help)return Sc(t._[t._.length-1]),await Ne(0);let s=t._[0];if(s==="figma"){let o=t._[1];try{return await ude(n,o,t),await Ne(0)}catch(a){return n.Sentry?.captureException(a),a instanceof Ye&&(Xr(a),Ke()),await Ne(1)}}else if(s==="code"){let o=t._[1];try{t.index&&(t.skipDetailedGrouping=!0,t.skipHeader=!0,await nH(n,t)),await mpe(n,o,t)}catch(a){return n.Sentry?.captureException(a),a instanceof Ye&&(Xr(a),Ke()),await Ne(1)}}else if(s==="index-repo"||s==="repo-index")try{return await nH(n,t),await Ne(0)}catch(o){return n.Sentry?.captureException(o),o instanceof Ye&&(Xr(o),Ke()),await Ne(1)}else if(s==="launch"||s==="fusion")try{await aQe({sys:n,args:t})}catch(o){return n.Sentry?.captureException(o),o instanceof Ye&&(Xr(o),Ke()),await Ne(1)}else if(s==="add"){let o=G8(n.getAppRootDir(),process.argv.slice(2));return await Nre(o),await Ne(0)}else if(s==="sync"){let o=G8(n.getAppRootDir(),process.argv.slice(2)),a=await v8(o);await Mpe(n,a).then(()=>{q.success("Builder dev tools is running")}).catch(A=>(q.error("Cannot start builder dev tools"),n.Sentry?.captureException(A),Ne(1)))}else if(s==="auth"){let o=t._[1];try{return await kDe(n,o,t),await Ne(0)}catch(a){return n.Sentry?.captureException(a),a instanceof Ye&&(Xr(a),Ke()),await Ne(1)}}else if(s==="doctor"){let o=t._[1];try{return await cxe(n,o,t),await Ne(0)}catch(a){return n.Sentry?.captureException(a),a instanceof Ye&&(Xr(a),Ke()),await Ne(1)}}else if(s==="connect-repo"||s==="repo-connect")try{return await XDe(n,t),await Ne(0)}catch(o){return n.Sentry?.captureException(o),o instanceof Ye&&(Xr(o),Ke()),await Ne(1)}else if(s==="agent"){let o=t._[1];try{return await Ixe(n,o,t),await Ne(0)}catch(a){return n.Sentry?.captureException(a),a instanceof Ye&&(Xr(a),Ke()),await Ne(1)}}else if(s==="space-sync")try{return await Exe(n,t),await Ne(0)}catch(o){return n.Sentry?.captureException(o),o instanceof Ye&&(Xr(o),Ke()),await Ne(1)}else if(s==="push")try{return await yxe(n,t),await Ne(0)}catch(o){return n.Sentry?.captureException(o),o instanceof Ye&&(Xr(o),Ke()),await Ne(1)}else if(s==="pull")try{return await Qxe(n,t),await Ne(0)}catch(o){return n.Sentry?.captureException(o),o instanceof Ye&&(Xr(o),Ke()),await Ne(1)}else if(s==="dsi-mcp"||s==="mcp")try{await hxe(n,t)}catch(o){return n.Sentry?.captureException(o),o instanceof Ye&&(Xr(o),Ke()),await Ne(1)}else{if(s==="help")return Sc(t._[1]),await Ne(0);if(s==="publish"||s==="migrate"||s==="generate")return Ke("Command not found, do you mean `npx "+st()+" figma "+s+"`?"),await Ne(1);aDt(n,t).then(()=>{q.success("Builder dev tools is running")}).catch(o=>(q.error("Cannot start builder dev tools"),e.captureException(o),Ne(1)))}}catch(n){return e.captureException(n),n instanceof Ye&&(Xr(n),Ke("Cannot start builder dev tools due to network error")),await Ne(1)}})}ADt().catch(t=>{process.stderr.write((t instanceof Error?t.stack??t.message:String(t))+`
|
|
7175
7174
|
`),process.exit(1)});var cDt=void 0;
|
|
7176
7175
|
/*! Bundled license information:
|
|
7177
7176
|
|