builder.io 1.16.8 → 1.17.0
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 +268 -268
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +2 -2
- package/core/index.mjs +2 -2
- package/node/index.cjs +13 -13
- package/node/index.mjs +13 -13
- package/package.json +2 -2
- package/server/index.cjs +3 -3
- package/server/index.mjs +3 -3
- package/types/cli/codegen.d.ts +6 -3
- package/types/cli/index.d.ts +2 -0
- package/types/cli/launch/InitStateMachine.d.ts +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
- package/types/types.d.ts +4 -1
package/core/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ii=Object.create;var Dt=Object.defineProperty;var Ri=Object.getOwnPropertyDescriptor;var Ni=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,ki=Object.prototype.hasOwnProperty;var Oi=(e,t,r)=>t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Li=(e,t)=>{for(var r in t)Dt(e,r,{get:t[r],enumerable:!0})},rr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ni(t))!ki.call(e,o)&&o!==r&&Dt(e,o,{get:()=>t[o],enumerable:!(n=Ri(t,o))||n.enumerable});return e};var or=(e,t,r)=>(r=e!=null?Ii(Bi(e)):{},rr(t||!e||!e.__esModule?Dt(r,"default",{value:e,enumerable:!0}):r,e)),_i=e=>rr(Dt({},"__esModule",{value:!0}),e);var Me=(e,t,r)=>Oi(e,typeof t!="symbol"?t+"":t,r);var ur=Le((wp,sr)=>{"use strict";sr.exports=function(){if(process.env.npm_config_user_agent)return $i(process.env.npm_config_user_agent)};function $i(e){let t=e.split(" ")[0],r=t.lastIndexOf("/"),n=t.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:t.substring(r+1)}}});var Vn=Le(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.throwUnsupportedData=We.throwUnknownDataType=We.getType=void 0;function Ho(e){return Object.prototype.toString.call(e)}We.getType=Ho;function $u(e){throw new TypeError("unsupported data type: "+Ho(e))}We.throwUnknownDataType=$u;function Ku(e){throw new TypeError("unsupported data type: "+e)}We.throwUnsupportedData=Ku});var zn=Le(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.s_to_num=G.int_str_to_s=G.num_to_s=G.big_int_to_s=G.int_to_s=G.s_to_big_int=G.s_to_int=void 0;var Ke="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);Ke+=t}var dt=Ke.length,Kn={};for(let e=0;e<dt;e++){let t=Ke[e];Kn[t]=e}function Mn(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],i=Kn[o];i*=r,t+=i,r*=dt}return t}G.s_to_int=Mn;function Yo(e){let t=BigInt(0),r=BigInt(1),n=BigInt(dt);for(let o=e.length-1;o>=0;o--){let i=e[o],a=BigInt(Kn[i]);a*=r,t+=a,r*=n}return t}G.s_to_big_int=Yo;function Un(e){if(e===0)return Ke[0];let t=[];for(;e!==0;){let r=e%dt,n=Ke[r];t.push(n),e-=r,e/=dt}return t.reverse().join("")}G.int_to_s=Un;function Go(e){let t=BigInt(0),r=BigInt(dt);if(e===t)return Ke[0];let n=[];for(;e!==t;){let o=e%r,i=Ke[Number(o)];n.push(i),e/=r}return n.reverse().join("")}G.big_int_to_s=Go;function Xo(e){return e.split("").reverse().join("")}function Zo(e){if(e<0)return"-"+Zo(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[i,a]=t.split("e");t=i,r="0e"+a}else return Un(e);let n;r&&([r,n]=r.split("e")),t=Zt(t),r=Xo(r),r=Zt(r);let o=t+"."+r;if(n){switch(o+=".",n[0]){case"+":n=n.slice(1);break;case"-":o+="-",n=n.slice(1);break}n=Zt(n),o+=n}return o}G.num_to_s=Zo;function Zt(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?Un(t):":"+Go(BigInt(e))}G.int_str_to_s=Zt;function $n(e){return e[0]===":"?Yo(e.substring(1)).toString():Mn(e).toString()}function ei(e){if(e[0]==="-")return-ei(e.substr(1));let[t,r,n]=e.split(".");if(!r)return Mn(t);t=$n(t),r=$n(r),r=Xo(r);let o=t+"."+r;if(n){o+="e";let i=!1;n[0]==="-"&&(i=!0,n=n.slice(1)),n=$n(n),o+=i?-n:+n}return+o}G.s_to_num=ei});var Jn=Le(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.decodeStr=X.encodeStr=X.decodeBool=X.encodeBool=X.decodeKey=X.decodeNum=X.encodeNum=void 0;var qn=zn();function Mu(e){return"n|"+(0,qn.num_to_s)(e)}X.encodeNum=Mu;function Uu(e){return e=e.replace("n|",""),(0,qn.s_to_num)(e)}X.decodeNum=Uu;function zu(e){return typeof e=="number"?e:(0,qn.s_to_int)(e)}X.decodeKey=zu;function qu(e){return e?"b|T":"b|F"}X.encodeBool=qu;function Ju(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}X.decodeBool=Ju;function Wu(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}X.encodeStr=Wu;function Qu(e){return e[0]+e[1]==="s|"?e.substr(2):e}X.decodeStr=Qu});var Wn=Le(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.config=void 0;en.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Gn=Le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.addValue=xe.makeInMemoryMemory=xe.makeInMemoryCache=xe.makeInMemoryStore=xe.memToValues=void 0;var Yn=Wn(),Qn=Vn(),Hn=Jn(),Hu=zn();function Yu(e){return e.store.toArray()}xe.memToValues=Yu;function ti(){let e=[];return{forEach(t){for(let r=0;r<e.length;r++)if(t(e[r])==="break")return},add(t){e.push(t)},toArray(){return e}}}xe.makeInMemoryStore=ti;function ni(){let e=Object.create(null),t=Object.create(null);return{getValue(r){return e[r]},getSchema(r){return t[r]},forEachValue(r){for(let[n,o]of Object.entries(e))if(r(n,o)==="break")return},forEachSchema(r){for(let[n,o]of Object.entries(t))if(r(n,o)==="break")return},setValue(r,n){e[r]=n},setSchema(r,n){t[r]=n},hasValue(r){return r in e},hasSchema(r){return r in t}}}xe.makeInMemoryCache=ni;function Gu(){return{store:ti(),cache:ni(),keyCount:0}}xe.makeInMemoryMemory=Gu;function nt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,Hu.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function Xu(e,t){Yn.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=kt(e,t,void 0);return e.cache.setSchema(r,n),n}function kt(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return kt(e,null,r);break;case"object":if(t===null)return nt(e,null);if(Array.isArray(t)){let n="a";for(let o=0;o<t.length;o++){let i=t[o],a=i===null?"_":kt(e,i,t);n+="|"+a}return n==="a"&&(n="a|"),nt(e,n)}else{let n=Object.keys(t);if(n.length===0)return nt(e,"o|");let o="o",i=Xu(e,n);o+="|"+i;for(let a of n){let s=t[a],u=kt(e,s,t);o+="|"+u}return nt(e,o)}case"boolean":return nt(e,(0,Hn.encodeBool)(t));case"number":return Number.isNaN(t)?(Yn.config.error_on_nan&&(0,Qn.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(Yn.config.error_on_infinite&&(0,Qn.throwUnsupportedData)("[number Infinity]"),""):nt(e,(0,Hn.encodeNum)(t));case"string":return nt(e,(0,Hn.encodeStr)(t))}return(0,Qn.throwUnknownDataType)(t)}xe.addValue=kt});var Zn=Le(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.decompress=Qe.decode=Qe.compress=void 0;var Zu=Vn(),tn=Jn(),Xn=Gn();function ep(e){let t=(0,Xn.makeInMemoryMemory)(),r=(0,Xn.addValue)(t,e,void 0);return[(0,Xn.memToValues)(t),r]}Qe.compress=ep;function tp(e,t){if(t==="o|")return{};let r={},n=t.split("|"),o=n[1],i=Ot(e,o),a=n.length;a-2===1&&!Array.isArray(i)&&(i=[i]);for(let s=2;s<a;s++){let u=i[s-2],p=n[s];p=Ot(e,p),r[u]=p}return r}function np(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,o=new Array(n);for(let i=0;i<n;i++){let a=r[i+1];a=Ot(e,a),o[i]=a}return o}function Ot(e,t){if(t===""||t==="_")return null;let r=(0,tn.decodeKey)(t),n=e[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return(0,tn.decodeBool)(n);case"o|":return tp(e,n);case"n|":return(0,tn.decodeNum)(n);case"a|":return np(e,n);default:return(0,tn.decodeStr)(n)}}return(0,Zu.throwUnknownDataType)(n)}Qe.decode=Ot;function rp(e){let[t,r]=e;return Ot(t,r)}Qe.decompress=rp});var oi=Le(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.trimUndefinedRecursively=gt.trimUndefined=void 0;function op(e){for(let t in e)e[t]===void 0&&delete e[t]}gt.trimUndefined=op;function ip(e){ri(e,new Set)}gt.trimUndefinedRecursively=ip;function ri(e,t){t.add(e);for(let r in e)if(e[r]===void 0)delete e[r];else{let n=e[r];n&&typeof n=="object"&&!t.has(n)&&ri(n,t)}}});var si=Le(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.config=Z.trimUndefinedRecursively=Z.trimUndefined=Z.addValue=Z.decode=Z.decompress=Z.compress=void 0;var ii=Zn();Object.defineProperty(Z,"compress",{enumerable:!0,get:function(){return ii.compress}});Object.defineProperty(Z,"decompress",{enumerable:!0,get:function(){return ii.decompress}});var ap=Zn();Object.defineProperty(Z,"decode",{enumerable:!0,get:function(){return ap.decode}});var sp=Gn();Object.defineProperty(Z,"addValue",{enumerable:!0,get:function(){return sp.addValue}});var ai=oi();Object.defineProperty(Z,"trimUndefined",{enumerable:!0,get:function(){return ai.trimUndefined}});Object.defineProperty(Z,"trimUndefinedRecursively",{enumerable:!0,get:function(){return ai.trimUndefinedRecursively}});var up=Wn();Object.defineProperty(Z,"config",{enumerable:!0,get:function(){return up.config}})});var Ap={};Li(Ap,{createDevTools:()=>li,createDevToolsSys:()=>fi,detectFrameworks:()=>Ue,detectFrameworksFromPackageJson:()=>un,ensureConfigPlugin:()=>vi,findBuildToolConfig:()=>nr,getClientScript:()=>bi,parseDotEnvContent:()=>pn,version:()=>_t});module.exports=_i(Ap);var ji="1.16.8",ir=process.env.OVERRIDE_VERSION??ji;function ne(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var Vi=["node_modules","dist","build","public"];async function ie(e,t){async function r(o,i){if(i>10)return;let a=await e.readdir(o);for(let s of a){if(Vi.includes(s))continue;let u=e.join(o,s),p=await e.stat(u);if(p){if(p.isFile()&&s.startsWith("builder-registry."))return u;if(p.isDirectory()){let f=await r(u,i+1);if(f)return f}}}}let n=await r(e.getAppRootDir(),0);if(!n){let i=`builder-registry.${await ne(e)?"ts":"js"}`;return e.join(t,i)}return n}async function xt(e,t){let r=e.resolve("/");for(let n=0;n<20;n++){let o=e.join(t,"package.json"),i=await e.readFile(o);if(i)return JSON.parse(i);if(t===r)break;t=e.dirname(t)}return null}async function ar(e,t){for(let r=0;r<20;r++){let n=e.dirname(t),o=e.join(n,"node_modules");if(await e.exists(o))return o;if(t===e.getAppRootDir())break;t=e.dirname(t)}return e.join(e.getAppRootDir(),"node_modules")}async function Ct(e,t,r){let n=await e.readdir(t);return n.includes(r)?e.join(t,r):(await Promise.all(n.map(async i=>{if(i.startsWith(".")||i==="node_modules")return;let a=e.join(t,i);if((await e.stat(a)).isDirectory()){let u=await Ct(e,a,r);if(u)return u}}))).find(i=>typeof i=="string")}var cr=or(ur(),1);function Ae(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function N(e,t,r){t=he(t),r=he(r),t=e.dirname(t);let n=e.basename(r,e.extname(r));r=e.dirname(r);let o;return n==="index"?o=e.relative(t,r):o=e.relative(t,e.join(r,n)),o=he(e.normalize(o)),o.startsWith(".")||(o="./"+o),o}function he(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function Ye(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),o=n[n.length-1];return pr(o==="index"?e.basename(e.dirname(t)):o)}function pr(e){return K(e).replace(/ /g,"")}function le(e,t){let r=e.extname(t),n=he(e.basename(t,r)).split("/").pop();return K(n==="index"?e.basename(e.dirname(t)):n)}function M(e,t){let r=he(e.relative(e.getAppRootDir(),t));r=r.split("/").filter(o=>o!=="."&&o!==".."&&o!=="").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=e.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(o=>o.name.includes("next"))?"@/"+r:"~/"+r}function k(e,t){let r=t,n=[];for(let o=0;o<2;o++){let i=e.basename(r);if(!i||i==="components")break;n.unshift(i),r=e.dirname(r)}return n.join("/")}function K(e){for(e=e.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();e.includes(" ");)e=e.replace(/ /g," ");return e.split(" ").map(t=>t.length>2?t[0].toUpperCase()+t.slice(1):t).join("").trim()}function ae(e){return e.sort((t,r)=>t.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function V(e,t,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${t}`);return n&&(t=n),t=e.normalize(t),(await e.hash(t+"#"+r)).substring(0,8)}function ht(e){return typeof e=="number"}function rt(e){return typeof e=="boolean"}function re(e){return typeof e=="string"}function ot(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function pe(e){return JSON.parse(JSON.stringify(e))}function jt(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function lr(){try{let e=(0,cr.default)();if(e?.name)return e.name}catch{}return"npm"}async function Ue(e){let t=[],r=await xt(e,e.getRepoRootDir());if(r){let n=await un(r,e);t.push(...n)}return t}async function fr(e){let t=await xt(e,e.getRepoRootDir());return t?.scripts?.dev?t.scripts.dev.includes("--turbopack"):!1}async function un(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let o of Ki)if(n.has(o)&&!r.some(i=>i.name===o)){let i={name:o};mr.has(o)&&(i.version=await mr.get(o)(t)),r.push(i)}}return r}function sn(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var mr=new Map([["next",async e=>{if(!e.spawnSync)return;let t=lr(),r=t==="npm"?"npx":t,{stdout:n}=e.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let o=n.match(/(Next.js v)([\d.]+)/g);if(!o)return;let i=o[0].split("Next.js v")[1],[a,s,u]=i.split(".");return{major:sn(a),minor:sn(s),patch:sn(u)}}]]),Ki=["@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 me(e){let t=dr(e),r=await e.readFile(t);return typeof r=="string"?JSON.parse(r):{}}async function fe(e,t){t=typeof t=="object"&&t!=null?t:{};let r=dr(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function dr(e){let t=e.getAppRootDir();return e.join(t,"node_modules",".builder","builder-cache.json")}async function Fe(e,t,r){let n={envKey:r,envValue:null,file:""};for(let o of t){let i=e.join(e.getAppRootDir(),o),a=await Mi(e,i);if(a){let s=a[r];if(typeof s=="string"&&s.length>0&&s!=="YOUR_API_KEY")return n.envValue=s,n.file=i,n}}return n.file=e.join(e.getAppRootDir(),t[t.length-1]),n}async function Mi(e,t){let r=await e.readFile(t);return typeof r=="string"?pn(r):null}function pn(e){let t={},r=e.replace(/\r\n?/gm,`
|
|
1
|
+
"use strict";var Ii=Object.create;var Dt=Object.defineProperty;var Ri=Object.getOwnPropertyDescriptor;var Ni=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,ki=Object.prototype.hasOwnProperty;var Oi=(e,t,r)=>t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Li=(e,t)=>{for(var r in t)Dt(e,r,{get:t[r],enumerable:!0})},rr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ni(t))!ki.call(e,o)&&o!==r&&Dt(e,o,{get:()=>t[o],enumerable:!(n=Ri(t,o))||n.enumerable});return e};var or=(e,t,r)=>(r=e!=null?Ii(Bi(e)):{},rr(t||!e||!e.__esModule?Dt(r,"default",{value:e,enumerable:!0}):r,e)),_i=e=>rr(Dt({},"__esModule",{value:!0}),e);var Me=(e,t,r)=>Oi(e,typeof t!="symbol"?t+"":t,r);var ur=Le((wp,sr)=>{"use strict";sr.exports=function(){if(process.env.npm_config_user_agent)return $i(process.env.npm_config_user_agent)};function $i(e){let t=e.split(" ")[0],r=t.lastIndexOf("/"),n=t.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:t.substring(r+1)}}});var Vn=Le(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.throwUnsupportedData=We.throwUnknownDataType=We.getType=void 0;function Ho(e){return Object.prototype.toString.call(e)}We.getType=Ho;function $u(e){throw new TypeError("unsupported data type: "+Ho(e))}We.throwUnknownDataType=$u;function Ku(e){throw new TypeError("unsupported data type: "+e)}We.throwUnsupportedData=Ku});var zn=Le(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.s_to_num=G.int_str_to_s=G.num_to_s=G.big_int_to_s=G.int_to_s=G.s_to_big_int=G.s_to_int=void 0;var Ke="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);Ke+=t}var dt=Ke.length,Kn={};for(let e=0;e<dt;e++){let t=Ke[e];Kn[t]=e}function Mn(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],i=Kn[o];i*=r,t+=i,r*=dt}return t}G.s_to_int=Mn;function Yo(e){let t=BigInt(0),r=BigInt(1),n=BigInt(dt);for(let o=e.length-1;o>=0;o--){let i=e[o],a=BigInt(Kn[i]);a*=r,t+=a,r*=n}return t}G.s_to_big_int=Yo;function Un(e){if(e===0)return Ke[0];let t=[];for(;e!==0;){let r=e%dt,n=Ke[r];t.push(n),e-=r,e/=dt}return t.reverse().join("")}G.int_to_s=Un;function Go(e){let t=BigInt(0),r=BigInt(dt);if(e===t)return Ke[0];let n=[];for(;e!==t;){let o=e%r,i=Ke[Number(o)];n.push(i),e/=r}return n.reverse().join("")}G.big_int_to_s=Go;function Xo(e){return e.split("").reverse().join("")}function Zo(e){if(e<0)return"-"+Zo(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[i,a]=t.split("e");t=i,r="0e"+a}else return Un(e);let n;r&&([r,n]=r.split("e")),t=Zt(t),r=Xo(r),r=Zt(r);let o=t+"."+r;if(n){switch(o+=".",n[0]){case"+":n=n.slice(1);break;case"-":o+="-",n=n.slice(1);break}n=Zt(n),o+=n}return o}G.num_to_s=Zo;function Zt(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?Un(t):":"+Go(BigInt(e))}G.int_str_to_s=Zt;function $n(e){return e[0]===":"?Yo(e.substring(1)).toString():Mn(e).toString()}function ei(e){if(e[0]==="-")return-ei(e.substr(1));let[t,r,n]=e.split(".");if(!r)return Mn(t);t=$n(t),r=$n(r),r=Xo(r);let o=t+"."+r;if(n){o+="e";let i=!1;n[0]==="-"&&(i=!0,n=n.slice(1)),n=$n(n),o+=i?-n:+n}return+o}G.s_to_num=ei});var Jn=Le(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.decodeStr=X.encodeStr=X.decodeBool=X.encodeBool=X.decodeKey=X.decodeNum=X.encodeNum=void 0;var qn=zn();function Mu(e){return"n|"+(0,qn.num_to_s)(e)}X.encodeNum=Mu;function Uu(e){return e=e.replace("n|",""),(0,qn.s_to_num)(e)}X.decodeNum=Uu;function zu(e){return typeof e=="number"?e:(0,qn.s_to_int)(e)}X.decodeKey=zu;function qu(e){return e?"b|T":"b|F"}X.encodeBool=qu;function Ju(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}X.decodeBool=Ju;function Wu(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}X.encodeStr=Wu;function Qu(e){return e[0]+e[1]==="s|"?e.substr(2):e}X.decodeStr=Qu});var Wn=Le(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.config=void 0;en.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Gn=Le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.addValue=xe.makeInMemoryMemory=xe.makeInMemoryCache=xe.makeInMemoryStore=xe.memToValues=void 0;var Yn=Wn(),Qn=Vn(),Hn=Jn(),Hu=zn();function Yu(e){return e.store.toArray()}xe.memToValues=Yu;function ti(){let e=[];return{forEach(t){for(let r=0;r<e.length;r++)if(t(e[r])==="break")return},add(t){e.push(t)},toArray(){return e}}}xe.makeInMemoryStore=ti;function ni(){let e=Object.create(null),t=Object.create(null);return{getValue(r){return e[r]},getSchema(r){return t[r]},forEachValue(r){for(let[n,o]of Object.entries(e))if(r(n,o)==="break")return},forEachSchema(r){for(let[n,o]of Object.entries(t))if(r(n,o)==="break")return},setValue(r,n){e[r]=n},setSchema(r,n){t[r]=n},hasValue(r){return r in e},hasSchema(r){return r in t}}}xe.makeInMemoryCache=ni;function Gu(){return{store:ti(),cache:ni(),keyCount:0}}xe.makeInMemoryMemory=Gu;function nt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,Hu.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function Xu(e,t){Yn.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=kt(e,t,void 0);return e.cache.setSchema(r,n),n}function kt(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return kt(e,null,r);break;case"object":if(t===null)return nt(e,null);if(Array.isArray(t)){let n="a";for(let o=0;o<t.length;o++){let i=t[o],a=i===null?"_":kt(e,i,t);n+="|"+a}return n==="a"&&(n="a|"),nt(e,n)}else{let n=Object.keys(t);if(n.length===0)return nt(e,"o|");let o="o",i=Xu(e,n);o+="|"+i;for(let a of n){let s=t[a],u=kt(e,s,t);o+="|"+u}return nt(e,o)}case"boolean":return nt(e,(0,Hn.encodeBool)(t));case"number":return Number.isNaN(t)?(Yn.config.error_on_nan&&(0,Qn.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(Yn.config.error_on_infinite&&(0,Qn.throwUnsupportedData)("[number Infinity]"),""):nt(e,(0,Hn.encodeNum)(t));case"string":return nt(e,(0,Hn.encodeStr)(t))}return(0,Qn.throwUnknownDataType)(t)}xe.addValue=kt});var Zn=Le(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.decompress=Qe.decode=Qe.compress=void 0;var Zu=Vn(),tn=Jn(),Xn=Gn();function ep(e){let t=(0,Xn.makeInMemoryMemory)(),r=(0,Xn.addValue)(t,e,void 0);return[(0,Xn.memToValues)(t),r]}Qe.compress=ep;function tp(e,t){if(t==="o|")return{};let r={},n=t.split("|"),o=n[1],i=Ot(e,o),a=n.length;a-2===1&&!Array.isArray(i)&&(i=[i]);for(let s=2;s<a;s++){let u=i[s-2],p=n[s];p=Ot(e,p),r[u]=p}return r}function np(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,o=new Array(n);for(let i=0;i<n;i++){let a=r[i+1];a=Ot(e,a),o[i]=a}return o}function Ot(e,t){if(t===""||t==="_")return null;let r=(0,tn.decodeKey)(t),n=e[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return(0,tn.decodeBool)(n);case"o|":return tp(e,n);case"n|":return(0,tn.decodeNum)(n);case"a|":return np(e,n);default:return(0,tn.decodeStr)(n)}}return(0,Zu.throwUnknownDataType)(n)}Qe.decode=Ot;function rp(e){let[t,r]=e;return Ot(t,r)}Qe.decompress=rp});var oi=Le(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.trimUndefinedRecursively=gt.trimUndefined=void 0;function op(e){for(let t in e)e[t]===void 0&&delete e[t]}gt.trimUndefined=op;function ip(e){ri(e,new Set)}gt.trimUndefinedRecursively=ip;function ri(e,t){t.add(e);for(let r in e)if(e[r]===void 0)delete e[r];else{let n=e[r];n&&typeof n=="object"&&!t.has(n)&&ri(n,t)}}});var si=Le(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.config=Z.trimUndefinedRecursively=Z.trimUndefined=Z.addValue=Z.decode=Z.decompress=Z.compress=void 0;var ii=Zn();Object.defineProperty(Z,"compress",{enumerable:!0,get:function(){return ii.compress}});Object.defineProperty(Z,"decompress",{enumerable:!0,get:function(){return ii.decompress}});var ap=Zn();Object.defineProperty(Z,"decode",{enumerable:!0,get:function(){return ap.decode}});var sp=Gn();Object.defineProperty(Z,"addValue",{enumerable:!0,get:function(){return sp.addValue}});var ai=oi();Object.defineProperty(Z,"trimUndefined",{enumerable:!0,get:function(){return ai.trimUndefined}});Object.defineProperty(Z,"trimUndefinedRecursively",{enumerable:!0,get:function(){return ai.trimUndefinedRecursively}});var up=Wn();Object.defineProperty(Z,"config",{enumerable:!0,get:function(){return up.config}})});var Ap={};Li(Ap,{createDevTools:()=>li,createDevToolsSys:()=>fi,detectFrameworks:()=>Ue,detectFrameworksFromPackageJson:()=>un,ensureConfigPlugin:()=>vi,findBuildToolConfig:()=>nr,getClientScript:()=>bi,parseDotEnvContent:()=>pn,version:()=>_t});module.exports=_i(Ap);var ji="1.17.0",ir=process.env.OVERRIDE_VERSION??ji;function ne(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var Vi=["node_modules","dist","build","public"];async function ie(e,t){async function r(o,i){if(i>10)return;let a=await e.readdir(o);for(let s of a){if(Vi.includes(s))continue;let u=e.join(o,s),p=await e.stat(u);if(p){if(p.isFile()&&s.startsWith("builder-registry."))return u;if(p.isDirectory()){let f=await r(u,i+1);if(f)return f}}}}let n=await r(e.getAppRootDir(),0);if(!n){let i=`builder-registry.${await ne(e)?"ts":"js"}`;return e.join(t,i)}return n}async function xt(e,t){let r=e.resolve("/");for(let n=0;n<20;n++){let o=e.join(t,"package.json"),i=await e.readFile(o);if(i)return JSON.parse(i);if(t===r)break;t=e.dirname(t)}return null}async function ar(e,t){for(let r=0;r<20;r++){let n=e.dirname(t),o=e.join(n,"node_modules");if(await e.exists(o))return o;if(t===e.getAppRootDir())break;t=e.dirname(t)}return e.join(e.getAppRootDir(),"node_modules")}async function Ct(e,t,r){let n=await e.readdir(t);return n.includes(r)?e.join(t,r):(await Promise.all(n.map(async i=>{if(i.startsWith(".")||i==="node_modules")return;let a=e.join(t,i);if((await e.stat(a)).isDirectory()){let u=await Ct(e,a,r);if(u)return u}}))).find(i=>typeof i=="string")}var cr=or(ur(),1);function Ae(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function N(e,t,r){t=he(t),r=he(r),t=e.dirname(t);let n=e.basename(r,e.extname(r));r=e.dirname(r);let o;return n==="index"?o=e.relative(t,r):o=e.relative(t,e.join(r,n)),o=he(e.normalize(o)),o.startsWith(".")||(o="./"+o),o}function he(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function Ye(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),o=n[n.length-1];return pr(o==="index"?e.basename(e.dirname(t)):o)}function pr(e){return K(e).replace(/ /g,"")}function le(e,t){let r=e.extname(t),n=he(e.basename(t,r)).split("/").pop();return K(n==="index"?e.basename(e.dirname(t)):n)}function M(e,t){let r=he(e.relative(e.getAppRootDir(),t));r=r.split("/").filter(o=>o!=="."&&o!==".."&&o!=="").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=e.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(o=>o.name.includes("next"))?"@/"+r:"~/"+r}function k(e,t){let r=t,n=[];for(let o=0;o<2;o++){let i=e.basename(r);if(!i||i==="components")break;n.unshift(i),r=e.dirname(r)}return n.join("/")}function K(e){for(e=e.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();e.includes(" ");)e=e.replace(/ /g," ");return e.split(" ").map(t=>t.length>2?t[0].toUpperCase()+t.slice(1):t).join("").trim()}function ae(e){return e.sort((t,r)=>t.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function V(e,t,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${t}`);return n&&(t=n),t=e.normalize(t),(await e.hash(t+"#"+r)).substring(0,8)}function ht(e){return typeof e=="number"}function rt(e){return typeof e=="boolean"}function re(e){return typeof e=="string"}function ot(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function pe(e){return JSON.parse(JSON.stringify(e))}function jt(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function lr(){try{let e=(0,cr.default)();if(e?.name)return e.name}catch{}return"npm"}async function Ue(e){let t=[],r=await xt(e,e.getRepoRootDir());if(r){let n=await un(r,e);t.push(...n)}return t}async function fr(e){let t=await xt(e,e.getRepoRootDir());return t?.scripts?.dev?t.scripts.dev.includes("--turbopack"):!1}async function un(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let o of Ki)if(n.has(o)&&!r.some(i=>i.name===o)){let i={name:o};mr.has(o)&&(i.version=await mr.get(o)(t)),r.push(i)}}return r}function sn(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var mr=new Map([["next",async e=>{if(!e.spawnSync)return;let t=lr(),r=t==="npm"?"npx":t,{stdout:n}=e.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let o=n.match(/(Next.js v)([\d.]+)/g);if(!o)return;let i=o[0].split("Next.js v")[1],[a,s,u]=i.split(".");return{major:sn(a),minor:sn(s),patch:sn(u)}}]]),Ki=["@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 me(e){let t=dr(e),r=await e.readFile(t);return typeof r=="string"?JSON.parse(r):{}}async function fe(e,t){t=typeof t=="object"&&t!=null?t:{};let r=dr(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function dr(e){let t=e.getAppRootDir();return e.join(t,"node_modules",".builder","builder-cache.json")}async function Fe(e,t,r){let n={envKey:r,envValue:null,file:""};for(let o of t){let i=e.join(e.getAppRootDir(),o),a=await Mi(e,i);if(a){let s=a[r];if(typeof s=="string"&&s.length>0&&s!=="YOUR_API_KEY")return n.envValue=s,n.file=i,n}}return n.file=e.join(e.getAppRootDir(),t[t.length-1]),n}async function Mi(e,t){let r=await e.readFile(t);return typeof r=="string"?pn(r):null}function pn(e){let t={},r=e.replace(/\r\n?/gm,`
|
|
2
2
|
`),n;for(;(n=Ui.exec(r))!=null;){let o=n[1],i=n[2]||"";i=i.trim();let a=i[0];i=i.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),a==='"'&&(i=i.replace(/\\n/g,`
|
|
3
3
|
`),i=i.replace(/\\r/g,"\r")),t[o]=i}return t}var Ui=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;async function Pe(e,t,r,n){let o="# https://www.builder.io/c/docs/using-your-api-key",i=await e.readFile(t);try{if(i)if(i.includes(r))if(i.includes(n))e.debug(`"${r}" with "${n}" already set in ${t}`);else return e.debug(`Replace "${r}" in ${t}`),i=i.replace(new RegExp(`${r}=.*`),`${r}=${n}`),await e.writeFile(t,i),"update";else return e.debug(`Append "${r}" to ${t}`),i+=`
|
|
4
4
|
|
|
@@ -1021,7 +1021,7 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
1021
1021
|
];
|
|
1022
1022
|
`}async function Qo(e){let t=await _u(e);return{builderPageOptions:async()=>({templateContentId:"vue-demo-template-id",pathname:"/builder-demo",title:"Builder + Vue Demo Page"}),ensureBuilderSetup:async()=>(await qo(t)).errors.length>0?[]:[],ensureFigmaImportPage:()=>Jo(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>tt(t,{readAllInputTypes:!!n?.readAllInputTypes}),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let o=await tt(t,{readAllInputTypes:!1}),i=o.components.find(a=>a.id===n.cmpId);return{...o,component:i}},registerComponent:async n=>tt(t,{readAllInputTypes:!1}),setRegisteredComponentInfo:async n=>tt(t,{readAllInputTypes:!1}),setRegisteredComponentInput:async n=>tt(t,{readAllInputTypes:!1}),unregisterComponent:async n=>tt(t,{readAllInputTypes:!1}),getPublicApiKey:()=>Bt(t),setPublicApiKey:n=>Mo(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===y.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:()=>me(t),setCache:n=>fe(t,n)}}async function _u(e){let t=await ju(e),r=e.getAppRootDir(),n=e.join(r,"src"),o=await ne(e),i={},a={...e,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",vueConfigPath:t,typescriptEnabled:o,configType:"",isNuxt:await Vu(e),addExternalPackage:p=>{i[e.join(r,p,"index.ts")]=`export * from "${p}";`},readFileSync:p=>i[p]??e.readFileSync(p),existsSync:p=>!!i[p]||e.existsSync(p),readdirSync:p=>{let f=e.readdirSync(p);return p===r?[...f,...Object.keys(i).map(m=>m.slice(r.length+1))]:f},readdir:async p=>{let f=await e.readdir(p);return p===r?[...f,...Object.keys(i).map(m=>m.slice(r.length+1))]:f}};t.includes("webpack.config")&&(a.configType="webpack"),(t.includes("vite.config")||t.includes("nuxt.config"))&&(a.configType="vite");let s=await e.exists(n);a.srcDir=s?n:null;let u=[e.join(r,"components"),e.join(r,"src","components"),e.join(r,"app","components")];for(let p of u)if(await e.exists(p)){a.componentsDir=p;break}return a.componentsDir||(a.componentsDir=s?e.join(n,"components"):e.join(r,"components")),a.registryPath=await ie(e,a.componentsDir),a}async function ju(e){let t=["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 t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return n}if(e.ignoreMissingConfig)return"";throw new Error(`Could not find Vue config file. Searched for ${t.join(", ")} in "${e.getAppRootDir()}".`)}async function Vu(e){let t=["nuxt.config.ts","nuxt.config.js"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return!0}try{let r=e.join(e.getAppRootDir(),"package.json");if(await e.exists(r)){let n=JSON.parse(await e.readFile(r)||"{}"),o={...n.dependencies,...n.devDependencies};return!!(o.nuxt||o["@nuxt/kit"]||o.nuxt3)}}catch{}return!1}var nn=or(si(),1);async function ui(e,t){let n={components:(await t.getRegistry()).components.filter(i=>i.isRegistered).map(i=>{let a={filePath:he(e.relative(e.getAppRootDir(),i.filePath)),name:i.name,image:i.image,description:i.description,exportName:i.exportName,inputs:pe(i.inputs)};return pe(a)}),version:1};e.debug("exporting registry components:",n.components.length);let o=(0,nn.compress)(n);return btoa(JSON.stringify(o))}async function pi(e,t,r){if(typeof r!="string")throw new Error("Invalid registry to import");let n=await t.getRegistry(),o=JSON.parse(atob(r)),i=(0,nn.decompress)(o),a=pe(n);e.debug("importing registry components:",i.components.length);for(let s of i.components){let u=he(e.normalize(s.filePath)),p=n.components.find(m=>he(m.filePath).endsWith(u)&&m.exportName===s.exportName);if(!p){console.error(`Could not find component to register: ${s.filePath}, ${s.exportName}`);continue}e.debug(`register (${p.id})`,p.filePath),await t.registerComponent({cmpId:p.id});for(let m of s.inputs)e.debug(`set input (${p.id})`),await t.setRegisteredComponentInput({cmpId:p.id,name:m.name,type:m.type,required:m.required,defaultValue:m.defaultValue,friendlyName:m.friendlyName,helperText:m.helperText});e.debug(`set input (${p.id}) info`);let f=await t.setRegisteredComponentInfo({cmpId:p.id,name:s.name,image:s.image,description:s.description});a=pe(f)}return a}var ue={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik",vue:"vue",native:"native"},Ag={[ue.react]:[{version:y.gen1,recommended:!0},{version:y.gen2,recommended:!1}],[ue.remix]:[{version:y.gen1,recommended:!1},{version:y.gen2,recommended:!0}],[ue.angular]:[{version:y.gen2,recommended:!0}],[ue.next]:[{version:y.gen1,recommended:!0},{version:y.gen2,recommended:!1}],[ue.qwik]:[{version:y.gen2,recommended:!0}],[ue.vue]:[{version:y.gen1,recommended:!0},{version:y.gen2,recommended:!1}]};async function ci(e,t){let r=[],n=new Set;async function o(i){let a=e.join(i,"package.json");try{if(!await e.exists(a))return null;let u=await e.readFile(a);if(u===null)throw new Error(`Failed to read package.json at ${a}`);let p=JSON.parse(u);if(typeof p.name!="string"||p.name.trim()===""||n.has(p.name))return null;n.add(p.name);let f={name:p.name,subPackages:[]},m=await e.readdir(i);for(let c of m)c!=="node_modules"&&(await e.stat(e.join(i,c))).isDirectory()&&f.subPackages.push(c);return r.push(f),f}catch(s){return e.Sentry?.captureException(s,{level:"warning"}),null}}try{let i=e.join(t,"package.json");if(await e.exists(i)){let s=await e.readFile(i);if(s!==null){let u=JSON.parse(s),p={...u.dependencies,...u.devDependencies};for(let f of Object.keys(p)){let m=e.join(t,"node_modules",f);await o(m)}if(Array.isArray(u.workspaces))for(let f of u.workspaces){let m=await e.readdir(e.join(t,f));for(let c of m){let d=e.join(t,f,c);await o(d)}}}}}catch(i){e.Sentry?.captureException(i,{level:"warning"})}return r}var pp={"@builder.io/qwik-city":io,next:Qr,"@remix-run/react":fo,react:vn,"@angular/core":Ko,vue:Qo,native:vn},cp={"@builder.io/qwik-city":ue.qwik,next:ue.next,"@remix-run/react":ue.remix,react:ue.react,"@angular/core":ue.angular,vue:ue.vue,native:ue.native};async function li(e,t=!1){if(!e.ts)throw new Error("createDevTools() requires a TypeScript instance passed to the 'ts' option");if((!e.frameworks||e.frameworks.length===0)&&(e.frameworks=await Ue(e)),e.frameworks.length===0&&t&&e.frameworks.push({name:"native"}),e.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let r of e.frameworks){let n=pp[r.name];if(n)try{let o=await n(e);return{...o,exportRegistry:()=>ui(e,o),importRegistry:a=>pi(e,o,a),framework:cp[r.name],findAllDependencies:async()=>await ci(e,e.getRepoRootDir())}}catch(o){e.Sentry?.captureException(o,{level:"warning"})}}throw new Error(`Devtools framework not found for ${e.getAppRootDir()}, ${JSON.stringify(e.frameworks,null,2)}`)}var rn=class{constructor(t){Me(this,"connections",new Set);Me(this,"maxConnections",1e3);Me(this,"sys");Me(this,"healthCheckInterval",null);Me(this,"HEALTH_CHECK_INTERVAL_MS",3e4);this.sys=t,this.startHealthMonitoring()}addConnection(t,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(t),t.on("close",()=>{this.removeConnection(t)}),t.on("error",()=>{this.removeConnection(t)}),!0}removeConnection(t){this.connections.delete(t)}getConnectionCount(){return this.connections.size}cleanup(){for(let t of this.connections)t.writable&&t.write(`HTTP/1.1 503 Service Unavailable\r
|
|
1023
1023
|
\r
|
|
1024
|
-
`),t.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 t=[];for(let r of this.connections)if(r.destroyed||!r.writable){t.push(r);continue}for(let r of t){this.removeConnection(r);try{r.destroy()}catch{}}}};function mi(e){function t(m){if(typeof m!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(m))}function r(m,c){let d="",D=0,g=-1,x=0,l;for(let C=0;C<=m.length;++C){if(C<m.length)l=m.charCodeAt(C);else{if(l===47)break;l=47}if(l===47){if(!(g===C-1||x===1))if(g!==C-1&&x===2){if(d.length<2||D!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){let E=d.lastIndexOf("/");if(E!==d.length-1){E===-1?(d="",D=0):(d=d.slice(0,E),D=d.length-1-d.lastIndexOf("/")),g=C,x=0;continue}}else if(d.length===2||d.length===1){d="",D=0,g=C,x=0;continue}}c&&(d.length>0?d+="/..":d="..",D=2)}else d.length>0?d+="/"+m.slice(g+1,C):d=m.slice(g+1,C),D=C-g-1;g=C,x=0}else l===46&&x!==-1?++x:x=-1}return d}let n=function(...c){let d="",D=!1;for(let g=c.length-1;g>=-1&&!D;g--){let x;g>=0?x=c[g]:e.cwd?x=e.cwd():x="/",t(x),x.length!==0&&(d=x+"/"+d,D=x.charCodeAt(0)===47)}return d=r(d,!D),D?d.length>0?"/"+d:"/":d.length>0?d:"."},o=function(c){if(t(c),c.length===0)return".";let d=c.charCodeAt(0)===47,D=c.charCodeAt(c.length-1)===47;return c=r(c,!d),c.length===0&&!d&&(c="."),c.length>0&&D&&(c+="/"),d?"/"+c:c};return{relative:function(c,d){if(t(c),t(d),c===d||(c=n(c),d=n(d),c===d))return"";let D=1;for(;D<c.length&&c.charCodeAt(D)===47;++D);let g=c.length,x=g-D,l=1;for(;l<d.length&&d.charCodeAt(l)===47;++l);let E=d.length-l,F=x<E?x:E,A=-1,S=0;for(;S<=F;++S){if(S===F){if(E>F){if(d.charCodeAt(l+S)===47)return d.slice(l+S+1);if(S===0)return d.slice(l+S)}else x>F&&(c.charCodeAt(D+S)===47?A=S:S===0&&(A=0));break}let $=c.charCodeAt(D+S),O=d.charCodeAt(l+S);if($!==O)break;$===47&&(A=S)}let B="";for(S=D+A+1;S<=g;++S)(S===g||c.charCodeAt(S)===47)&&(B.length===0?B+="..":B+="/..");return B.length>0?B+d.slice(l+A):(l+=A,d.charCodeAt(l)===47&&++l,d.slice(l))},resolve:n,join:function(...c){if(c.length===0)return".";let d;for(let D=0;D<c.length;++D){let g=c[D];t(g),g.length>0&&(d===void 0?d=g:d+="/"+g)}return d===void 0?".":o(d)},isAbsolute:function(c){return t(c),c.length>0&&c.charCodeAt(0)===47},basename:function(c,d){if(d!==void 0&&typeof d!="string")throw new TypeError('"ext" argument must be a string');t(c);let D=0,g=-1,x=!0,l;if(d!==void 0&&d.length>0&&d.length<=c.length){if(d.length===c.length&&d===c)return"";let C=d.length-1,E=-1;for(l=c.length-1;l>=0;--l){let F=c.charCodeAt(l);if(F===47){if(!x){D=l+1;break}}else E===-1&&(x=!1,E=l+1),C>=0&&(F===d.charCodeAt(C)?--C===-1&&(g=l):(C=-1,g=E))}return D===g?g=E:g===-1&&(g=c.length),c.slice(D,g)}else{for(l=c.length-1;l>=0;--l)if(c.charCodeAt(l)===47){if(!x){D=l+1;break}}else g===-1&&(x=!1,g=l+1);return g===-1?"":c.slice(D,g)}},normalize:o,dirname:function(c){if(t(c),c.length===0)return".";let d=c.charCodeAt(0),D=d===47,g=-1,x=!0;for(let l=c.length-1;l>=1;--l)if(d=c.charCodeAt(l),d===47){if(!x){g=l;break}}else x=!1;return g===-1?D?"/":".":D&&g===1?"//":c.slice(0,g)},extname:function(c){t(c);let d=-1,D=0,g=-1,x=!0,l=0;for(let C=c.length-1;C>=0;--C){let E=c.charCodeAt(C);if(E===47){if(!x){D=C+1;break}continue}g===-1&&(x=!1,g=C+1),E===46?d===-1?d=C:l!==1&&(l=1):d!==-1&&(l=-1)}return d===-1||g===-1||l===0||l===1&&d===g-1&&d===D+1?"":c.slice(d,g)}}}async function fi(e){let t=e.getRepoRootDir?e.getRepoRootDir:()=>"/",r=e.cwd?e.cwd:()=>"/",n=mi({cwd:r,...e}),o=new Map,i=l=>n.normalize(n.resolve(r(),l)),a=l=>{for(let[C]of o)if((C+"/").startsWith(l))return!0;return l===t()},s=l=>(l=i(l),o.has(l)?!0:a(l)),u=l=>{l=i(l);let C=l===t()?l:l+"/",E=C.split("/").length-1,F=[];for(let[A]of o)if(A.split("/").slice(0,E).join("/")+"/"===C){let $=A.split("/")[E];$&&!F.includes($)&&F.push($)}return F.sort()},p=async(l,C=[])=>{l=i(l);let E=l===t()?l:l+"/",F=[],A=new Set(C);for(let[S]of o)S.startsWith(E)&&(S.slice(E.length).split("/").some(O=>A.has(O))||F.push(S));return F.sort()},f=l=>{l=i(l);let C=o.get(l);return typeof C=="string"?C:null},m=l=>{l=i(l);let C=o.get(l);return typeof C=="string"?new TextEncoder().encode(C):C instanceof Uint8Array?C:null},c=l=>(l=i(l),{isFile:()=>o.has(l),isDirectory:()=>!o.has(l)&&a(l),size:a(l)?0:o.get(l)?.length??0}),d=async l=>{if(typeof crypto<"u"){let F=new TextEncoder().encode(l),A=await crypto.subtle.digest("SHA-256",F);return Array.from(new Uint8Array(A)).map(S=>S.toString(16).padStart(2,"0")).join("")}let C=0;for(let E=0;E<l.length;E++){let F=l.charCodeAt(E);C=(C<<5)-C+F,C|=0}return Number(Math.abs(C)).toString(36)},D=new Set,g={getRepoRootDir:t,getAppRootDir:t,getCwdDir:r,cwd:r,exists:async l=>s(l),existsSync:s,readdir:async l=>u(l),readdirSync:u,readdirRecursive:p,readFile:async l=>f(l),readFileSync:f,readFileSyncBuffer:l=>m(l),stat:async l=>c(l),statSync:c,writeFile:async(l,C)=>{l=i(l),o.set(l,C);let E={path:l,basename:n.basename(l),dirname:n.dirname(l),extname:n.extname(l)};for(let F of D)await F(E)},unlink:async l=>{l=i(l),o.delete(l)},unlinkSync:l=>{l=i(l),o.delete(l)},hash:d,getDeviceId:async()=>typeof navigator<"u"?d(navigator.userAgent):"",getRepoInfo:async()=>({hasGit:!1,remoteUrl:"",defaultBranch:"",currentBranch:"",commit:""}),formatCode:async(l,C)=>C,on:(l,C)=>{l==="change"&&D.add(C)},off:(l,C)=>{l==="change"&&D.delete(C)},debug:(...l)=>{console.debug("[builder-dev-tools]",...l)},launchEditor:async()=>{},platform:()=>({runtime:"",os:""}),getFrameworks:()=>[],...n,...e,version:"0.0.0",sdkVersion:null,kind:null,magicast:void 0,spawnSync:void 0,Sentry:void 0,connectionTracker:null};g.connectionTracker=new rn(g);let x=await Ue(g);return g.getFrameworks=e.getFrameworks?e.getFrameworks:()=>x,g}async function di(e,t,r){try{let n=b(e,r),o={content:r,filePath:t,fileName:e.basename(t),outcome:"no-update"};if(await fr(e))return console.warn("Turbopack does not support the Builder.io devtools cli. Please disable Turbopack or manually integrate Builder.io into your Next.js project."),o;if(gi(e,n))return o;let s=de(e,n,"cjs"),u=de(e,n);if(s.length!==1&&u.length!==1)throw new Error("Expected an export from file");if(u.length===1){let m=u[0];if(!m.isDefaultExport)throw new Error("Expected a default export from file");let c=m.statement;if(!e.ts.isVariableStatement(c))throw new Error(`Unexpected export type in ${t}
|
|
1024
|
+
`),t.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 t=[];for(let r of this.connections)if(r.destroyed||!r.writable){t.push(r);continue}for(let r of t){this.removeConnection(r);try{r.destroy()}catch{}}}};function mi(e){function t(m){if(typeof m!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(m))}function r(m,c){let d="",D=0,g=-1,x=0,l;for(let C=0;C<=m.length;++C){if(C<m.length)l=m.charCodeAt(C);else{if(l===47)break;l=47}if(l===47){if(!(g===C-1||x===1))if(g!==C-1&&x===2){if(d.length<2||D!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){let E=d.lastIndexOf("/");if(E!==d.length-1){E===-1?(d="",D=0):(d=d.slice(0,E),D=d.length-1-d.lastIndexOf("/")),g=C,x=0;continue}}else if(d.length===2||d.length===1){d="",D=0,g=C,x=0;continue}}c&&(d.length>0?d+="/..":d="..",D=2)}else d.length>0?d+="/"+m.slice(g+1,C):d=m.slice(g+1,C),D=C-g-1;g=C,x=0}else l===46&&x!==-1?++x:x=-1}return d}let n=function(...c){let d="",D=!1;for(let g=c.length-1;g>=-1&&!D;g--){let x;g>=0?x=c[g]:e.cwd?x=e.cwd():x="/",t(x),x.length!==0&&(d=x+"/"+d,D=x.charCodeAt(0)===47)}return d=r(d,!D),D?d.length>0?"/"+d:"/":d.length>0?d:"."},o=function(c){if(t(c),c.length===0)return".";let d=c.charCodeAt(0)===47,D=c.charCodeAt(c.length-1)===47;return c=r(c,!d),c.length===0&&!d&&(c="."),c.length>0&&D&&(c+="/"),d?"/"+c:c};return{relative:function(c,d){if(t(c),t(d),c===d||(c=n(c),d=n(d),c===d))return"";let D=1;for(;D<c.length&&c.charCodeAt(D)===47;++D);let g=c.length,x=g-D,l=1;for(;l<d.length&&d.charCodeAt(l)===47;++l);let E=d.length-l,F=x<E?x:E,A=-1,S=0;for(;S<=F;++S){if(S===F){if(E>F){if(d.charCodeAt(l+S)===47)return d.slice(l+S+1);if(S===0)return d.slice(l+S)}else x>F&&(c.charCodeAt(D+S)===47?A=S:S===0&&(A=0));break}let $=c.charCodeAt(D+S),O=d.charCodeAt(l+S);if($!==O)break;$===47&&(A=S)}let B="";for(S=D+A+1;S<=g;++S)(S===g||c.charCodeAt(S)===47)&&(B.length===0?B+="..":B+="/..");return B.length>0?B+d.slice(l+A):(l+=A,d.charCodeAt(l)===47&&++l,d.slice(l))},resolve:n,join:function(...c){if(c.length===0)return".";let d;for(let D=0;D<c.length;++D){let g=c[D];t(g),g.length>0&&(d===void 0?d=g:d+="/"+g)}return d===void 0?".":o(d)},isAbsolute:function(c){return t(c),c.length>0&&c.charCodeAt(0)===47},basename:function(c,d){if(d!==void 0&&typeof d!="string")throw new TypeError('"ext" argument must be a string');t(c);let D=0,g=-1,x=!0,l;if(d!==void 0&&d.length>0&&d.length<=c.length){if(d.length===c.length&&d===c)return"";let C=d.length-1,E=-1;for(l=c.length-1;l>=0;--l){let F=c.charCodeAt(l);if(F===47){if(!x){D=l+1;break}}else E===-1&&(x=!1,E=l+1),C>=0&&(F===d.charCodeAt(C)?--C===-1&&(g=l):(C=-1,g=E))}return D===g?g=E:g===-1&&(g=c.length),c.slice(D,g)}else{for(l=c.length-1;l>=0;--l)if(c.charCodeAt(l)===47){if(!x){D=l+1;break}}else g===-1&&(x=!1,g=l+1);return g===-1?"":c.slice(D,g)}},normalize:o,dirname:function(c){if(t(c),c.length===0)return".";let d=c.charCodeAt(0),D=d===47,g=-1,x=!0;for(let l=c.length-1;l>=1;--l)if(d=c.charCodeAt(l),d===47){if(!x){g=l;break}}else x=!1;return g===-1?D?"/":".":D&&g===1?"//":c.slice(0,g)},extname:function(c){t(c);let d=-1,D=0,g=-1,x=!0,l=0;for(let C=c.length-1;C>=0;--C){let E=c.charCodeAt(C);if(E===47){if(!x){D=C+1;break}continue}g===-1&&(x=!1,g=C+1),E===46?d===-1?d=C:l!==1&&(l=1):d!==-1&&(l=-1)}return d===-1||g===-1||l===0||l===1&&d===g-1&&d===D+1?"":c.slice(d,g)}}}async function fi(e){let t=e.getRepoRootDir?e.getRepoRootDir:()=>"/",r=e.cwd?e.cwd:()=>"/",n=mi({cwd:r,...e}),o=new Map,i=l=>n.normalize(n.resolve(r(),l)),a=l=>{for(let[C]of o)if((C+"/").startsWith(l))return!0;return l===t()},s=l=>(l=i(l),o.has(l)?!0:a(l)),u=l=>{l=i(l);let C=l===t()?l:l+"/",E=C.split("/").length-1,F=[];for(let[A]of o)if(A.split("/").slice(0,E).join("/")+"/"===C){let $=A.split("/")[E];$&&!F.includes($)&&F.push($)}return F.sort()},p=async(l,C=[])=>{l=i(l);let E=l===t()?l:l+"/",F=[],A=new Set(C);for(let[S]of o)S.startsWith(E)&&(S.slice(E.length).split("/").some(O=>A.has(O))||F.push(S));return F.sort()},f=l=>{l=i(l);let C=o.get(l);return typeof C=="string"?C:null},m=l=>{l=i(l);let C=o.get(l);return typeof C=="string"?new TextEncoder().encode(C):C instanceof Uint8Array?C:null},c=l=>(l=i(l),{isFile:()=>o.has(l),isDirectory:()=>!o.has(l)&&a(l),size:a(l)?0:o.get(l)?.length??0}),d=async l=>{if(typeof crypto<"u"){let F=new TextEncoder().encode(l),A=await crypto.subtle.digest("SHA-256",F);return Array.from(new Uint8Array(A)).map(S=>S.toString(16).padStart(2,"0")).join("")}let C=0;for(let E=0;E<l.length;E++){let F=l.charCodeAt(E);C=(C<<5)-C+F,C|=0}return Number(Math.abs(C)).toString(36)},D=new Set,g={getRepoRootDir:t,getAppRootDir:t,getCwdDir:r,cwd:r,exists:async l=>s(l),existsSync:s,readdir:async l=>u(l),readdirSync:u,readdirRecursive:p,readFile:async l=>f(l),readFileSync:f,readFileSyncBuffer:l=>m(l),stat:async l=>c(l),statSync:c,writeFile:async(l,C)=>{l=i(l),o.set(l,C);let E={path:l,basename:n.basename(l),dirname:n.dirname(l),extname:n.extname(l)};for(let F of D)await F(E)},unlink:async l=>{l=i(l),o.delete(l)},unlinkSync:l=>{l=i(l),o.delete(l)},hash:d,getDeviceId:async()=>typeof navigator<"u"?d(navigator.userAgent):"",getRepoInfo:async()=>({hasGit:!1,remoteUrl:"",defaultBranch:"",currentBranch:"",commit:""}),formatCode:async(l,C)=>C,on:(l,C)=>{l==="change"&&D.add(C)},off:(l,C)=>{l==="change"&&D.delete(C)},debug:(...l)=>{console.debug("[builder-dev-tools]",...l)},launchEditor:async()=>({success:!1,message:"Not implemented"}),platform:()=>({runtime:"",os:""}),getFrameworks:()=>[],...n,...e,version:"0.0.0",sdkVersion:null,kind:null,magicast:void 0,spawnSync:void 0,Sentry:void 0,connectionTracker:null};g.connectionTracker=new rn(g);let x=await Ue(g);return g.getFrameworks=e.getFrameworks?e.getFrameworks:()=>x,g}async function di(e,t,r){try{let n=b(e,r),o={content:r,filePath:t,fileName:e.basename(t),outcome:"no-update"};if(await fr(e))return console.warn("Turbopack does not support the Builder.io devtools cli. Please disable Turbopack or manually integrate Builder.io into your Next.js project."),o;if(gi(e,n))return o;let s=de(e,n,"cjs"),u=de(e,n);if(s.length!==1&&u.length!==1)throw new Error("Expected an export from file");if(u.length===1){let m=u[0];if(!m.isDefaultExport)throw new Error("Expected a default export from file");let c=m.statement;if(!e.ts.isVariableStatement(c))throw new Error(`Unexpected export type in ${t}
|
|
1025
1025
|
Found config content:
|
|
1026
1026
|
${r}
|
|
1027
1027
|
|
package/core/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
var yi=Object.create;var an=Object.defineProperty;var wi=Object.getOwnPropertyDescriptor;var vi=Object.getOwnPropertyNames;var Ti=Object.getPrototypeOf,bi=Object.prototype.hasOwnProperty;var Ii=(e,t,r)=>t in e?an(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ri=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vi(t))!bi.call(e,o)&&o!==r&&an(e,o,{get:()=>t[o],enumerable:!(n=wi(t,o))||n.enumerable});return e};var er=(e,t,r)=>(r=e!=null?yi(Ti(e)):{},Ri(t||!e||!e.__esModule?an(r,"default",{value:e,enumerable:!0}):r,e));var Me=(e,t,r)=>Ii(e,typeof t!="symbol"?t+"":t,r);var or=Le((Fp,rr)=>{"use strict";rr.exports=function(){if(process.env.npm_config_user_agent)return ki(process.env.npm_config_user_agent)};function ki(e){let t=e.split(" ")[0],r=t.lastIndexOf("/"),n=t.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:t.substring(r+1)}}});var _n=Le(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.throwUnsupportedData=Je.throwUnknownDataType=Je.getType=void 0;function Wo(e){return Object.prototype.toString.call(e)}Je.getType=Wo;function ku(e){throw new TypeError("unsupported data type: "+Wo(e))}Je.throwUnknownDataType=ku;function Ou(e){throw new TypeError("unsupported data type: "+e)}Je.throwUnsupportedData=Ou});var Mn=Le(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.s_to_num=G.int_str_to_s=G.num_to_s=G.big_int_to_s=G.int_to_s=G.s_to_big_int=G.s_to_int=void 0;var Ke="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);Ke+=t}var dt=Ke.length,Vn={};for(let e=0;e<dt;e++){let t=Ke[e];Vn[t]=e}function $n(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],i=Vn[o];i*=r,t+=i,r*=dt}return t}G.s_to_int=$n;function Qo(e){let t=BigInt(0),r=BigInt(1),n=BigInt(dt);for(let o=e.length-1;o>=0;o--){let i=e[o],a=BigInt(Vn[i]);a*=r,t+=a,r*=n}return t}G.s_to_big_int=Qo;function Kn(e){if(e===0)return Ke[0];let t=[];for(;e!==0;){let r=e%dt,n=Ke[r];t.push(n),e-=r,e/=dt}return t.reverse().join("")}G.int_to_s=Kn;function Ho(e){let t=BigInt(0),r=BigInt(dt);if(e===t)return Ke[0];let n=[];for(;e!==t;){let o=e%r,i=Ke[Number(o)];n.push(i),e/=r}return n.reverse().join("")}G.big_int_to_s=Ho;function Yo(e){return e.split("").reverse().join("")}function Go(e){if(e<0)return"-"+Go(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[i,a]=t.split("e");t=i,r="0e"+a}else return Kn(e);let n;r&&([r,n]=r.split("e")),t=Gt(t),r=Yo(r),r=Gt(r);let o=t+"."+r;if(n){switch(o+=".",n[0]){case"+":n=n.slice(1);break;case"-":o+="-",n=n.slice(1);break}n=Gt(n),o+=n}return o}G.num_to_s=Go;function Gt(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?Kn(t):":"+Ho(BigInt(e))}G.int_str_to_s=Gt;function jn(e){return e[0]===":"?Qo(e.substring(1)).toString():$n(e).toString()}function Xo(e){if(e[0]==="-")return-Xo(e.substr(1));let[t,r,n]=e.split(".");if(!r)return $n(t);t=jn(t),r=jn(r),r=Yo(r);let o=t+"."+r;if(n){o+="e";let i=!1;n[0]==="-"&&(i=!0,n=n.slice(1)),n=jn(n),o+=i?-n:+n}return+o}G.s_to_num=Xo});var zn=Le(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.decodeStr=X.encodeStr=X.decodeBool=X.encodeBool=X.decodeKey=X.decodeNum=X.encodeNum=void 0;var Un=Mn();function Lu(e){return"n|"+(0,Un.num_to_s)(e)}X.encodeNum=Lu;function _u(e){return e=e.replace("n|",""),(0,Un.s_to_num)(e)}X.decodeNum=_u;function ju(e){return typeof e=="number"?e:(0,Un.s_to_int)(e)}X.decodeKey=ju;function Vu(e){return e?"b|T":"b|F"}X.encodeBool=Vu;function $u(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}X.decodeBool=$u;function Ku(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}X.encodeStr=Ku;function Mu(e){return e[0]+e[1]==="s|"?e.substr(2):e}X.decodeStr=Mu});var qn=Le(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.config=void 0;Xt.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Hn=Le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.addValue=xe.makeInMemoryMemory=xe.makeInMemoryCache=xe.makeInMemoryStore=xe.memToValues=void 0;var Qn=qn(),Jn=_n(),Wn=zn(),Uu=Mn();function zu(e){return e.store.toArray()}xe.memToValues=zu;function Zo(){let e=[];return{forEach(t){for(let r=0;r<e.length;r++)if(t(e[r])==="break")return},add(t){e.push(t)},toArray(){return e}}}xe.makeInMemoryStore=Zo;function ei(){let e=Object.create(null),t=Object.create(null);return{getValue(r){return e[r]},getSchema(r){return t[r]},forEachValue(r){for(let[n,o]of Object.entries(e))if(r(n,o)==="break")return},forEachSchema(r){for(let[n,o]of Object.entries(t))if(r(n,o)==="break")return},setValue(r,n){e[r]=n},setSchema(r,n){t[r]=n},hasValue(r){return r in e},hasSchema(r){return r in t}}}xe.makeInMemoryCache=ei;function qu(){return{store:Zo(),cache:ei(),keyCount:0}}xe.makeInMemoryMemory=qu;function nt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,Uu.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function Ju(e,t){Qn.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=Bt(e,t,void 0);return e.cache.setSchema(r,n),n}function Bt(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return Bt(e,null,r);break;case"object":if(t===null)return nt(e,null);if(Array.isArray(t)){let n="a";for(let o=0;o<t.length;o++){let i=t[o],a=i===null?"_":Bt(e,i,t);n+="|"+a}return n==="a"&&(n="a|"),nt(e,n)}else{let n=Object.keys(t);if(n.length===0)return nt(e,"o|");let o="o",i=Ju(e,n);o+="|"+i;for(let a of n){let s=t[a],u=Bt(e,s,t);o+="|"+u}return nt(e,o)}case"boolean":return nt(e,(0,Wn.encodeBool)(t));case"number":return Number.isNaN(t)?(Qn.config.error_on_nan&&(0,Jn.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(Qn.config.error_on_infinite&&(0,Jn.throwUnsupportedData)("[number Infinity]"),""):nt(e,(0,Wn.encodeNum)(t));case"string":return nt(e,(0,Wn.encodeStr)(t))}return(0,Jn.throwUnknownDataType)(t)}xe.addValue=Bt});var Gn=Le(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.decompress=We.decode=We.compress=void 0;var Wu=_n(),Zt=zn(),Yn=Hn();function Qu(e){let t=(0,Yn.makeInMemoryMemory)(),r=(0,Yn.addValue)(t,e,void 0);return[(0,Yn.memToValues)(t),r]}We.compress=Qu;function Hu(e,t){if(t==="o|")return{};let r={},n=t.split("|"),o=n[1],i=kt(e,o),a=n.length;a-2===1&&!Array.isArray(i)&&(i=[i]);for(let s=2;s<a;s++){let u=i[s-2],p=n[s];p=kt(e,p),r[u]=p}return r}function Yu(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,o=new Array(n);for(let i=0;i<n;i++){let a=r[i+1];a=kt(e,a),o[i]=a}return o}function kt(e,t){if(t===""||t==="_")return null;let r=(0,Zt.decodeKey)(t),n=e[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return(0,Zt.decodeBool)(n);case"o|":return Hu(e,n);case"n|":return(0,Zt.decodeNum)(n);case"a|":return Yu(e,n);default:return(0,Zt.decodeStr)(n)}}return(0,Wu.throwUnknownDataType)(n)}We.decode=kt;function Gu(e){let[t,r]=e;return kt(t,r)}We.decompress=Gu});var ni=Le(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.trimUndefinedRecursively=gt.trimUndefined=void 0;function Xu(e){for(let t in e)e[t]===void 0&&delete e[t]}gt.trimUndefined=Xu;function Zu(e){ti(e,new Set)}gt.trimUndefinedRecursively=Zu;function ti(e,t){t.add(e);for(let r in e)if(e[r]===void 0)delete e[r];else{let n=e[r];n&&typeof n=="object"&&!t.has(n)&&ti(n,t)}}});var ii=Le(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.config=Z.trimUndefinedRecursively=Z.trimUndefined=Z.addValue=Z.decode=Z.decompress=Z.compress=void 0;var ri=Gn();Object.defineProperty(Z,"compress",{enumerable:!0,get:function(){return ri.compress}});Object.defineProperty(Z,"decompress",{enumerable:!0,get:function(){return ri.decompress}});var ep=Gn();Object.defineProperty(Z,"decode",{enumerable:!0,get:function(){return ep.decode}});var tp=Hn();Object.defineProperty(Z,"addValue",{enumerable:!0,get:function(){return tp.addValue}});var oi=ni();Object.defineProperty(Z,"trimUndefined",{enumerable:!0,get:function(){return oi.trimUndefined}});Object.defineProperty(Z,"trimUndefinedRecursively",{enumerable:!0,get:function(){return oi.trimUndefinedRecursively}});var np=qn();Object.defineProperty(Z,"config",{enumerable:!0,get:function(){return np.config}})});var Ni="1.16.8",tr=process.env.OVERRIDE_VERSION??Ni;function ne(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var Bi=["node_modules","dist","build","public"];async function ie(e,t){async function r(o,i){if(i>10)return;let a=await e.readdir(o);for(let s of a){if(Bi.includes(s))continue;let u=e.join(o,s),p=await e.stat(u);if(p){if(p.isFile()&&s.startsWith("builder-registry."))return u;if(p.isDirectory()){let f=await r(u,i+1);if(f)return f}}}}let n=await r(e.getAppRootDir(),0);if(!n){let i=`builder-registry.${await ne(e)?"ts":"js"}`;return e.join(t,i)}return n}async function Dt(e,t){let r=e.resolve("/");for(let n=0;n<20;n++){let o=e.join(t,"package.json"),i=await e.readFile(o);if(i)return JSON.parse(i);if(t===r)break;t=e.dirname(t)}return null}async function nr(e,t){for(let r=0;r<20;r++){let n=e.dirname(t),o=e.join(n,"node_modules");if(await e.exists(o))return o;if(t===e.getAppRootDir())break;t=e.dirname(t)}return e.join(e.getAppRootDir(),"node_modules")}async function xt(e,t,r){let n=await e.readdir(t);return n.includes(r)?e.join(t,r):(await Promise.all(n.map(async i=>{if(i.startsWith(".")||i==="node_modules")return;let a=e.join(t,i);if((await e.stat(a)).isDirectory()){let u=await xt(e,a,r);if(u)return u}}))).find(i=>typeof i=="string")}var ar=er(or(),1);function Ae(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function N(e,t,r){t=he(t),r=he(r),t=e.dirname(t);let n=e.basename(r,e.extname(r));r=e.dirname(r);let o;return n==="index"?o=e.relative(t,r):o=e.relative(t,e.join(r,n)),o=he(e.normalize(o)),o.startsWith(".")||(o="./"+o),o}function he(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function He(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),o=n[n.length-1];return ir(o==="index"?e.basename(e.dirname(t)):o)}function ir(e){return K(e).replace(/ /g,"")}function le(e,t){let r=e.extname(t),n=he(e.basename(t,r)).split("/").pop();return K(n==="index"?e.basename(e.dirname(t)):n)}function M(e,t){let r=he(e.relative(e.getAppRootDir(),t));r=r.split("/").filter(o=>o!=="."&&o!==".."&&o!=="").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=e.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(o=>o.name.includes("next"))?"@/"+r:"~/"+r}function k(e,t){let r=t,n=[];for(let o=0;o<2;o++){let i=e.basename(r);if(!i||i==="components")break;n.unshift(i),r=e.dirname(r)}return n.join("/")}function K(e){for(e=e.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();e.includes(" ");)e=e.replace(/ /g," ");return e.split(" ").map(t=>t.length>2?t[0].toUpperCase()+t.slice(1):t).join("").trim()}function ae(e){return e.sort((t,r)=>t.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function V(e,t,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${t}`);return n&&(t=n),t=e.normalize(t),(await e.hash(t+"#"+r)).substring(0,8)}function Ct(e){return typeof e=="number"}function rt(e){return typeof e=="boolean"}function re(e){return typeof e=="string"}function ot(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function pe(e){return JSON.parse(JSON.stringify(e))}function Lt(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function sr(){try{let e=(0,ar.default)();if(e?.name)return e.name}catch{}return"npm"}async function Ye(e){let t=[],r=await Dt(e,e.getRepoRootDir());if(r){let n=await cr(r,e);t.push(...n)}return t}async function pr(e){let t=await Dt(e,e.getRepoRootDir());return t?.scripts?.dev?t.scripts.dev.includes("--turbopack"):!1}async function cr(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let o of Oi)if(n.has(o)&&!r.some(i=>i.name===o)){let i={name:o};ur.has(o)&&(i.version=await ur.get(o)(t)),r.push(i)}}return r}function sn(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var ur=new Map([["next",async e=>{if(!e.spawnSync)return;let t=sr(),r=t==="npm"?"npx":t,{stdout:n}=e.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let o=n.match(/(Next.js v)([\d.]+)/g);if(!o)return;let i=o[0].split("Next.js v")[1],[a,s,u]=i.split(".");return{major:sn(a),minor:sn(s),patch:sn(u)}}]]),Oi=["@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 me(e){let t=lr(e),r=await e.readFile(t);return typeof r=="string"?JSON.parse(r):{}}async function fe(e,t){t=typeof t=="object"&&t!=null?t:{};let r=lr(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function lr(e){let t=e.getAppRootDir();return e.join(t,"node_modules",".builder","builder-cache.json")}async function Fe(e,t,r){let n={envKey:r,envValue:null,file:""};for(let o of t){let i=e.join(e.getAppRootDir(),o),a=await Li(e,i);if(a){let s=a[r];if(typeof s=="string"&&s.length>0&&s!=="YOUR_API_KEY")return n.envValue=s,n.file=i,n}}return n.file=e.join(e.getAppRootDir(),t[t.length-1]),n}async function Li(e,t){let r=await e.readFile(t);return typeof r=="string"?mr(r):null}function mr(e){let t={},r=e.replace(/\r\n?/gm,`
|
|
2
|
+
var yi=Object.create;var an=Object.defineProperty;var wi=Object.getOwnPropertyDescriptor;var vi=Object.getOwnPropertyNames;var Ti=Object.getPrototypeOf,bi=Object.prototype.hasOwnProperty;var Ii=(e,t,r)=>t in e?an(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ri=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vi(t))!bi.call(e,o)&&o!==r&&an(e,o,{get:()=>t[o],enumerable:!(n=wi(t,o))||n.enumerable});return e};var er=(e,t,r)=>(r=e!=null?yi(Ti(e)):{},Ri(t||!e||!e.__esModule?an(r,"default",{value:e,enumerable:!0}):r,e));var Me=(e,t,r)=>Ii(e,typeof t!="symbol"?t+"":t,r);var or=Le((Fp,rr)=>{"use strict";rr.exports=function(){if(process.env.npm_config_user_agent)return ki(process.env.npm_config_user_agent)};function ki(e){let t=e.split(" ")[0],r=t.lastIndexOf("/"),n=t.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:t.substring(r+1)}}});var _n=Le(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.throwUnsupportedData=Je.throwUnknownDataType=Je.getType=void 0;function Wo(e){return Object.prototype.toString.call(e)}Je.getType=Wo;function ku(e){throw new TypeError("unsupported data type: "+Wo(e))}Je.throwUnknownDataType=ku;function Ou(e){throw new TypeError("unsupported data type: "+e)}Je.throwUnsupportedData=Ou});var Mn=Le(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.s_to_num=G.int_str_to_s=G.num_to_s=G.big_int_to_s=G.int_to_s=G.s_to_big_int=G.s_to_int=void 0;var Ke="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);Ke+=t}var dt=Ke.length,Vn={};for(let e=0;e<dt;e++){let t=Ke[e];Vn[t]=e}function $n(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],i=Vn[o];i*=r,t+=i,r*=dt}return t}G.s_to_int=$n;function Qo(e){let t=BigInt(0),r=BigInt(1),n=BigInt(dt);for(let o=e.length-1;o>=0;o--){let i=e[o],a=BigInt(Vn[i]);a*=r,t+=a,r*=n}return t}G.s_to_big_int=Qo;function Kn(e){if(e===0)return Ke[0];let t=[];for(;e!==0;){let r=e%dt,n=Ke[r];t.push(n),e-=r,e/=dt}return t.reverse().join("")}G.int_to_s=Kn;function Ho(e){let t=BigInt(0),r=BigInt(dt);if(e===t)return Ke[0];let n=[];for(;e!==t;){let o=e%r,i=Ke[Number(o)];n.push(i),e/=r}return n.reverse().join("")}G.big_int_to_s=Ho;function Yo(e){return e.split("").reverse().join("")}function Go(e){if(e<0)return"-"+Go(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[i,a]=t.split("e");t=i,r="0e"+a}else return Kn(e);let n;r&&([r,n]=r.split("e")),t=Gt(t),r=Yo(r),r=Gt(r);let o=t+"."+r;if(n){switch(o+=".",n[0]){case"+":n=n.slice(1);break;case"-":o+="-",n=n.slice(1);break}n=Gt(n),o+=n}return o}G.num_to_s=Go;function Gt(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?Kn(t):":"+Ho(BigInt(e))}G.int_str_to_s=Gt;function jn(e){return e[0]===":"?Qo(e.substring(1)).toString():$n(e).toString()}function Xo(e){if(e[0]==="-")return-Xo(e.substr(1));let[t,r,n]=e.split(".");if(!r)return $n(t);t=jn(t),r=jn(r),r=Yo(r);let o=t+"."+r;if(n){o+="e";let i=!1;n[0]==="-"&&(i=!0,n=n.slice(1)),n=jn(n),o+=i?-n:+n}return+o}G.s_to_num=Xo});var zn=Le(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.decodeStr=X.encodeStr=X.decodeBool=X.encodeBool=X.decodeKey=X.decodeNum=X.encodeNum=void 0;var Un=Mn();function Lu(e){return"n|"+(0,Un.num_to_s)(e)}X.encodeNum=Lu;function _u(e){return e=e.replace("n|",""),(0,Un.s_to_num)(e)}X.decodeNum=_u;function ju(e){return typeof e=="number"?e:(0,Un.s_to_int)(e)}X.decodeKey=ju;function Vu(e){return e?"b|T":"b|F"}X.encodeBool=Vu;function $u(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}X.decodeBool=$u;function Ku(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}X.encodeStr=Ku;function Mu(e){return e[0]+e[1]==="s|"?e.substr(2):e}X.decodeStr=Mu});var qn=Le(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.config=void 0;Xt.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Hn=Le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.addValue=xe.makeInMemoryMemory=xe.makeInMemoryCache=xe.makeInMemoryStore=xe.memToValues=void 0;var Qn=qn(),Jn=_n(),Wn=zn(),Uu=Mn();function zu(e){return e.store.toArray()}xe.memToValues=zu;function Zo(){let e=[];return{forEach(t){for(let r=0;r<e.length;r++)if(t(e[r])==="break")return},add(t){e.push(t)},toArray(){return e}}}xe.makeInMemoryStore=Zo;function ei(){let e=Object.create(null),t=Object.create(null);return{getValue(r){return e[r]},getSchema(r){return t[r]},forEachValue(r){for(let[n,o]of Object.entries(e))if(r(n,o)==="break")return},forEachSchema(r){for(let[n,o]of Object.entries(t))if(r(n,o)==="break")return},setValue(r,n){e[r]=n},setSchema(r,n){t[r]=n},hasValue(r){return r in e},hasSchema(r){return r in t}}}xe.makeInMemoryCache=ei;function qu(){return{store:Zo(),cache:ei(),keyCount:0}}xe.makeInMemoryMemory=qu;function nt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,Uu.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function Ju(e,t){Qn.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=Bt(e,t,void 0);return e.cache.setSchema(r,n),n}function Bt(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return Bt(e,null,r);break;case"object":if(t===null)return nt(e,null);if(Array.isArray(t)){let n="a";for(let o=0;o<t.length;o++){let i=t[o],a=i===null?"_":Bt(e,i,t);n+="|"+a}return n==="a"&&(n="a|"),nt(e,n)}else{let n=Object.keys(t);if(n.length===0)return nt(e,"o|");let o="o",i=Ju(e,n);o+="|"+i;for(let a of n){let s=t[a],u=Bt(e,s,t);o+="|"+u}return nt(e,o)}case"boolean":return nt(e,(0,Wn.encodeBool)(t));case"number":return Number.isNaN(t)?(Qn.config.error_on_nan&&(0,Jn.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(Qn.config.error_on_infinite&&(0,Jn.throwUnsupportedData)("[number Infinity]"),""):nt(e,(0,Wn.encodeNum)(t));case"string":return nt(e,(0,Wn.encodeStr)(t))}return(0,Jn.throwUnknownDataType)(t)}xe.addValue=Bt});var Gn=Le(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.decompress=We.decode=We.compress=void 0;var Wu=_n(),Zt=zn(),Yn=Hn();function Qu(e){let t=(0,Yn.makeInMemoryMemory)(),r=(0,Yn.addValue)(t,e,void 0);return[(0,Yn.memToValues)(t),r]}We.compress=Qu;function Hu(e,t){if(t==="o|")return{};let r={},n=t.split("|"),o=n[1],i=kt(e,o),a=n.length;a-2===1&&!Array.isArray(i)&&(i=[i]);for(let s=2;s<a;s++){let u=i[s-2],p=n[s];p=kt(e,p),r[u]=p}return r}function Yu(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,o=new Array(n);for(let i=0;i<n;i++){let a=r[i+1];a=kt(e,a),o[i]=a}return o}function kt(e,t){if(t===""||t==="_")return null;let r=(0,Zt.decodeKey)(t),n=e[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return(0,Zt.decodeBool)(n);case"o|":return Hu(e,n);case"n|":return(0,Zt.decodeNum)(n);case"a|":return Yu(e,n);default:return(0,Zt.decodeStr)(n)}}return(0,Wu.throwUnknownDataType)(n)}We.decode=kt;function Gu(e){let[t,r]=e;return kt(t,r)}We.decompress=Gu});var ni=Le(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.trimUndefinedRecursively=gt.trimUndefined=void 0;function Xu(e){for(let t in e)e[t]===void 0&&delete e[t]}gt.trimUndefined=Xu;function Zu(e){ti(e,new Set)}gt.trimUndefinedRecursively=Zu;function ti(e,t){t.add(e);for(let r in e)if(e[r]===void 0)delete e[r];else{let n=e[r];n&&typeof n=="object"&&!t.has(n)&&ti(n,t)}}});var ii=Le(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.config=Z.trimUndefinedRecursively=Z.trimUndefined=Z.addValue=Z.decode=Z.decompress=Z.compress=void 0;var ri=Gn();Object.defineProperty(Z,"compress",{enumerable:!0,get:function(){return ri.compress}});Object.defineProperty(Z,"decompress",{enumerable:!0,get:function(){return ri.decompress}});var ep=Gn();Object.defineProperty(Z,"decode",{enumerable:!0,get:function(){return ep.decode}});var tp=Hn();Object.defineProperty(Z,"addValue",{enumerable:!0,get:function(){return tp.addValue}});var oi=ni();Object.defineProperty(Z,"trimUndefined",{enumerable:!0,get:function(){return oi.trimUndefined}});Object.defineProperty(Z,"trimUndefinedRecursively",{enumerable:!0,get:function(){return oi.trimUndefinedRecursively}});var np=qn();Object.defineProperty(Z,"config",{enumerable:!0,get:function(){return np.config}})});var Ni="1.17.0",tr=process.env.OVERRIDE_VERSION??Ni;function ne(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var Bi=["node_modules","dist","build","public"];async function ie(e,t){async function r(o,i){if(i>10)return;let a=await e.readdir(o);for(let s of a){if(Bi.includes(s))continue;let u=e.join(o,s),p=await e.stat(u);if(p){if(p.isFile()&&s.startsWith("builder-registry."))return u;if(p.isDirectory()){let f=await r(u,i+1);if(f)return f}}}}let n=await r(e.getAppRootDir(),0);if(!n){let i=`builder-registry.${await ne(e)?"ts":"js"}`;return e.join(t,i)}return n}async function Dt(e,t){let r=e.resolve("/");for(let n=0;n<20;n++){let o=e.join(t,"package.json"),i=await e.readFile(o);if(i)return JSON.parse(i);if(t===r)break;t=e.dirname(t)}return null}async function nr(e,t){for(let r=0;r<20;r++){let n=e.dirname(t),o=e.join(n,"node_modules");if(await e.exists(o))return o;if(t===e.getAppRootDir())break;t=e.dirname(t)}return e.join(e.getAppRootDir(),"node_modules")}async function xt(e,t,r){let n=await e.readdir(t);return n.includes(r)?e.join(t,r):(await Promise.all(n.map(async i=>{if(i.startsWith(".")||i==="node_modules")return;let a=e.join(t,i);if((await e.stat(a)).isDirectory()){let u=await xt(e,a,r);if(u)return u}}))).find(i=>typeof i=="string")}var ar=er(or(),1);function Ae(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function N(e,t,r){t=he(t),r=he(r),t=e.dirname(t);let n=e.basename(r,e.extname(r));r=e.dirname(r);let o;return n==="index"?o=e.relative(t,r):o=e.relative(t,e.join(r,n)),o=he(e.normalize(o)),o.startsWith(".")||(o="./"+o),o}function he(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function He(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),o=n[n.length-1];return ir(o==="index"?e.basename(e.dirname(t)):o)}function ir(e){return K(e).replace(/ /g,"")}function le(e,t){let r=e.extname(t),n=he(e.basename(t,r)).split("/").pop();return K(n==="index"?e.basename(e.dirname(t)):n)}function M(e,t){let r=he(e.relative(e.getAppRootDir(),t));r=r.split("/").filter(o=>o!=="."&&o!==".."&&o!=="").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=e.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(o=>o.name.includes("next"))?"@/"+r:"~/"+r}function k(e,t){let r=t,n=[];for(let o=0;o<2;o++){let i=e.basename(r);if(!i||i==="components")break;n.unshift(i),r=e.dirname(r)}return n.join("/")}function K(e){for(e=e.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();e.includes(" ");)e=e.replace(/ /g," ");return e.split(" ").map(t=>t.length>2?t[0].toUpperCase()+t.slice(1):t).join("").trim()}function ae(e){return e.sort((t,r)=>t.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function V(e,t,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${t}`);return n&&(t=n),t=e.normalize(t),(await e.hash(t+"#"+r)).substring(0,8)}function Ct(e){return typeof e=="number"}function rt(e){return typeof e=="boolean"}function re(e){return typeof e=="string"}function ot(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function pe(e){return JSON.parse(JSON.stringify(e))}function Lt(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function sr(){try{let e=(0,ar.default)();if(e?.name)return e.name}catch{}return"npm"}async function Ye(e){let t=[],r=await Dt(e,e.getRepoRootDir());if(r){let n=await cr(r,e);t.push(...n)}return t}async function pr(e){let t=await Dt(e,e.getRepoRootDir());return t?.scripts?.dev?t.scripts.dev.includes("--turbopack"):!1}async function cr(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let o of Oi)if(n.has(o)&&!r.some(i=>i.name===o)){let i={name:o};ur.has(o)&&(i.version=await ur.get(o)(t)),r.push(i)}}return r}function sn(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var ur=new Map([["next",async e=>{if(!e.spawnSync)return;let t=sr(),r=t==="npm"?"npx":t,{stdout:n}=e.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let o=n.match(/(Next.js v)([\d.]+)/g);if(!o)return;let i=o[0].split("Next.js v")[1],[a,s,u]=i.split(".");return{major:sn(a),minor:sn(s),patch:sn(u)}}]]),Oi=["@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 me(e){let t=lr(e),r=await e.readFile(t);return typeof r=="string"?JSON.parse(r):{}}async function fe(e,t){t=typeof t=="object"&&t!=null?t:{};let r=lr(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function lr(e){let t=e.getAppRootDir();return e.join(t,"node_modules",".builder","builder-cache.json")}async function Fe(e,t,r){let n={envKey:r,envValue:null,file:""};for(let o of t){let i=e.join(e.getAppRootDir(),o),a=await Li(e,i);if(a){let s=a[r];if(typeof s=="string"&&s.length>0&&s!=="YOUR_API_KEY")return n.envValue=s,n.file=i,n}}return n.file=e.join(e.getAppRootDir(),t[t.length-1]),n}async function Li(e,t){let r=await e.readFile(t);return typeof r=="string"?mr(r):null}function mr(e){let t={},r=e.replace(/\r\n?/gm,`
|
|
3
3
|
`),n;for(;(n=_i.exec(r))!=null;){let o=n[1],i=n[2]||"";i=i.trim();let a=i[0];i=i.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),a==='"'&&(i=i.replace(/\\n/g,`
|
|
4
4
|
`),i=i.replace(/\\r/g,"\r")),t[o]=i}return t}var _i=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;async function Pe(e,t,r,n){let o="# https://www.builder.io/c/docs/using-your-api-key",i=await e.readFile(t);try{if(i)if(i.includes(r))if(i.includes(n))e.debug(`"${r}" with "${n}" already set in ${t}`);else return e.debug(`Replace "${r}" in ${t}`),i=i.replace(new RegExp(`${r}=.*`),`${r}=${n}`),await e.writeFile(t,i),"update";else return e.debug(`Append "${r}" to ${t}`),i+=`
|
|
5
5
|
|
|
@@ -1022,7 +1022,7 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
1022
1022
|
];
|
|
1023
1023
|
`}async function Jo(e){let t=await Ru(e);return{builderPageOptions:async()=>({templateContentId:"vue-demo-template-id",pathname:"/builder-demo",title:"Builder + Vue Demo Page"}),ensureBuilderSetup:async()=>(await Uo(t)).errors.length>0?[]:[],ensureFigmaImportPage:()=>zo(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>tt(t,{readAllInputTypes:!!n?.readAllInputTypes}),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let o=await tt(t,{readAllInputTypes:!1}),i=o.components.find(a=>a.id===n.cmpId);return{...o,component:i}},registerComponent:async n=>tt(t,{readAllInputTypes:!1}),setRegisteredComponentInfo:async n=>tt(t,{readAllInputTypes:!1}),setRegisteredComponentInput:async n=>tt(t,{readAllInputTypes:!1}),unregisterComponent:async n=>tt(t,{readAllInputTypes:!1}),getPublicApiKey:()=>Nt(t),setPublicApiKey:n=>$o(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===y.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:()=>me(t),setCache:n=>fe(t,n)}}async function Ru(e){let t=await Nu(e),r=e.getAppRootDir(),n=e.join(r,"src"),o=await ne(e),i={},a={...e,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",vueConfigPath:t,typescriptEnabled:o,configType:"",isNuxt:await Bu(e),addExternalPackage:p=>{i[e.join(r,p,"index.ts")]=`export * from "${p}";`},readFileSync:p=>i[p]??e.readFileSync(p),existsSync:p=>!!i[p]||e.existsSync(p),readdirSync:p=>{let f=e.readdirSync(p);return p===r?[...f,...Object.keys(i).map(m=>m.slice(r.length+1))]:f},readdir:async p=>{let f=await e.readdir(p);return p===r?[...f,...Object.keys(i).map(m=>m.slice(r.length+1))]:f}};t.includes("webpack.config")&&(a.configType="webpack"),(t.includes("vite.config")||t.includes("nuxt.config"))&&(a.configType="vite");let s=await e.exists(n);a.srcDir=s?n:null;let u=[e.join(r,"components"),e.join(r,"src","components"),e.join(r,"app","components")];for(let p of u)if(await e.exists(p)){a.componentsDir=p;break}return a.componentsDir||(a.componentsDir=s?e.join(n,"components"):e.join(r,"components")),a.registryPath=await ie(e,a.componentsDir),a}async function Nu(e){let t=["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 t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return n}if(e.ignoreMissingConfig)return"";throw new Error(`Could not find Vue config file. Searched for ${t.join(", ")} in "${e.getAppRootDir()}".`)}async function Bu(e){let t=["nuxt.config.ts","nuxt.config.js"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return!0}try{let r=e.join(e.getAppRootDir(),"package.json");if(await e.exists(r)){let n=JSON.parse(await e.readFile(r)||"{}"),o={...n.dependencies,...n.devDependencies};return!!(o.nuxt||o["@nuxt/kit"]||o.nuxt3)}}catch{}return!1}var en=er(ii(),1);async function ai(e,t){let n={components:(await t.getRegistry()).components.filter(i=>i.isRegistered).map(i=>{let a={filePath:he(e.relative(e.getAppRootDir(),i.filePath)),name:i.name,image:i.image,description:i.description,exportName:i.exportName,inputs:pe(i.inputs)};return pe(a)}),version:1};e.debug("exporting registry components:",n.components.length);let o=(0,en.compress)(n);return btoa(JSON.stringify(o))}async function si(e,t,r){if(typeof r!="string")throw new Error("Invalid registry to import");let n=await t.getRegistry(),o=JSON.parse(atob(r)),i=(0,en.decompress)(o),a=pe(n);e.debug("importing registry components:",i.components.length);for(let s of i.components){let u=he(e.normalize(s.filePath)),p=n.components.find(m=>he(m.filePath).endsWith(u)&&m.exportName===s.exportName);if(!p){console.error(`Could not find component to register: ${s.filePath}, ${s.exportName}`);continue}e.debug(`register (${p.id})`,p.filePath),await t.registerComponent({cmpId:p.id});for(let m of s.inputs)e.debug(`set input (${p.id})`),await t.setRegisteredComponentInput({cmpId:p.id,name:m.name,type:m.type,required:m.required,defaultValue:m.defaultValue,friendlyName:m.friendlyName,helperText:m.helperText});e.debug(`set input (${p.id}) info`);let f=await t.setRegisteredComponentInfo({cmpId:p.id,name:s.name,image:s.image,description:s.description});a=pe(f)}return a}var ue={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik",vue:"vue",native:"native"},hg={[ue.react]:[{version:y.gen1,recommended:!0},{version:y.gen2,recommended:!1}],[ue.remix]:[{version:y.gen1,recommended:!1},{version:y.gen2,recommended:!0}],[ue.angular]:[{version:y.gen2,recommended:!0}],[ue.next]:[{version:y.gen1,recommended:!0},{version:y.gen2,recommended:!1}],[ue.qwik]:[{version:y.gen2,recommended:!0}],[ue.vue]:[{version:y.gen1,recommended:!0},{version:y.gen2,recommended:!1}]};async function ui(e,t){let r=[],n=new Set;async function o(i){let a=e.join(i,"package.json");try{if(!await e.exists(a))return null;let u=await e.readFile(a);if(u===null)throw new Error(`Failed to read package.json at ${a}`);let p=JSON.parse(u);if(typeof p.name!="string"||p.name.trim()===""||n.has(p.name))return null;n.add(p.name);let f={name:p.name,subPackages:[]},m=await e.readdir(i);for(let c of m)c!=="node_modules"&&(await e.stat(e.join(i,c))).isDirectory()&&f.subPackages.push(c);return r.push(f),f}catch(s){return e.Sentry?.captureException(s,{level:"warning"}),null}}try{let i=e.join(t,"package.json");if(await e.exists(i)){let s=await e.readFile(i);if(s!==null){let u=JSON.parse(s),p={...u.dependencies,...u.devDependencies};for(let f of Object.keys(p)){let m=e.join(t,"node_modules",f);await o(m)}if(Array.isArray(u.workspaces))for(let f of u.workspaces){let m=await e.readdir(e.join(t,f));for(let c of m){let d=e.join(t,f,c);await o(d)}}}}}catch(i){e.Sentry?.captureException(i,{level:"warning"})}return r}var rp={"@builder.io/qwik-city":ro,next:Jr,"@remix-run/react":lo,react:yn,"@angular/core":Vo,vue:Jo,native:yn},op={"@builder.io/qwik-city":ue.qwik,next:ue.next,"@remix-run/react":ue.remix,react:ue.react,"@angular/core":ue.angular,vue:ue.vue,native:ue.native};async function ip(e,t=!1){if(!e.ts)throw new Error("createDevTools() requires a TypeScript instance passed to the 'ts' option");if((!e.frameworks||e.frameworks.length===0)&&(e.frameworks=await Ye(e)),e.frameworks.length===0&&t&&e.frameworks.push({name:"native"}),e.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let r of e.frameworks){let n=rp[r.name];if(n)try{let o=await n(e);return{...o,exportRegistry:()=>ai(e,o),importRegistry:a=>si(e,o,a),framework:op[r.name],findAllDependencies:async()=>await ui(e,e.getRepoRootDir())}}catch(o){e.Sentry?.captureException(o,{level:"warning"})}}throw new Error(`Devtools framework not found for ${e.getAppRootDir()}, ${JSON.stringify(e.frameworks,null,2)}`)}var tn=class{constructor(t){Me(this,"connections",new Set);Me(this,"maxConnections",1e3);Me(this,"sys");Me(this,"healthCheckInterval",null);Me(this,"HEALTH_CHECK_INTERVAL_MS",3e4);this.sys=t,this.startHealthMonitoring()}addConnection(t,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(t),t.on("close",()=>{this.removeConnection(t)}),t.on("error",()=>{this.removeConnection(t)}),!0}removeConnection(t){this.connections.delete(t)}getConnectionCount(){return this.connections.size}cleanup(){for(let t of this.connections)t.writable&&t.write(`HTTP/1.1 503 Service Unavailable\r
|
|
1024
1024
|
\r
|
|
1025
|
-
`),t.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 t=[];for(let r of this.connections)if(r.destroyed||!r.writable){t.push(r);continue}for(let r of t){this.removeConnection(r);try{r.destroy()}catch{}}}};function pi(e){function t(m){if(typeof m!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(m))}function r(m,c){let d="",D=0,g=-1,x=0,l;for(let C=0;C<=m.length;++C){if(C<m.length)l=m.charCodeAt(C);else{if(l===47)break;l=47}if(l===47){if(!(g===C-1||x===1))if(g!==C-1&&x===2){if(d.length<2||D!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){let E=d.lastIndexOf("/");if(E!==d.length-1){E===-1?(d="",D=0):(d=d.slice(0,E),D=d.length-1-d.lastIndexOf("/")),g=C,x=0;continue}}else if(d.length===2||d.length===1){d="",D=0,g=C,x=0;continue}}c&&(d.length>0?d+="/..":d="..",D=2)}else d.length>0?d+="/"+m.slice(g+1,C):d=m.slice(g+1,C),D=C-g-1;g=C,x=0}else l===46&&x!==-1?++x:x=-1}return d}let n=function(...c){let d="",D=!1;for(let g=c.length-1;g>=-1&&!D;g--){let x;g>=0?x=c[g]:e.cwd?x=e.cwd():x="/",t(x),x.length!==0&&(d=x+"/"+d,D=x.charCodeAt(0)===47)}return d=r(d,!D),D?d.length>0?"/"+d:"/":d.length>0?d:"."},o=function(c){if(t(c),c.length===0)return".";let d=c.charCodeAt(0)===47,D=c.charCodeAt(c.length-1)===47;return c=r(c,!d),c.length===0&&!d&&(c="."),c.length>0&&D&&(c+="/"),d?"/"+c:c};return{relative:function(c,d){if(t(c),t(d),c===d||(c=n(c),d=n(d),c===d))return"";let D=1;for(;D<c.length&&c.charCodeAt(D)===47;++D);let g=c.length,x=g-D,l=1;for(;l<d.length&&d.charCodeAt(l)===47;++l);let E=d.length-l,F=x<E?x:E,A=-1,S=0;for(;S<=F;++S){if(S===F){if(E>F){if(d.charCodeAt(l+S)===47)return d.slice(l+S+1);if(S===0)return d.slice(l+S)}else x>F&&(c.charCodeAt(D+S)===47?A=S:S===0&&(A=0));break}let $=c.charCodeAt(D+S),O=d.charCodeAt(l+S);if($!==O)break;$===47&&(A=S)}let B="";for(S=D+A+1;S<=g;++S)(S===g||c.charCodeAt(S)===47)&&(B.length===0?B+="..":B+="/..");return B.length>0?B+d.slice(l+A):(l+=A,d.charCodeAt(l)===47&&++l,d.slice(l))},resolve:n,join:function(...c){if(c.length===0)return".";let d;for(let D=0;D<c.length;++D){let g=c[D];t(g),g.length>0&&(d===void 0?d=g:d+="/"+g)}return d===void 0?".":o(d)},isAbsolute:function(c){return t(c),c.length>0&&c.charCodeAt(0)===47},basename:function(c,d){if(d!==void 0&&typeof d!="string")throw new TypeError('"ext" argument must be a string');t(c);let D=0,g=-1,x=!0,l;if(d!==void 0&&d.length>0&&d.length<=c.length){if(d.length===c.length&&d===c)return"";let C=d.length-1,E=-1;for(l=c.length-1;l>=0;--l){let F=c.charCodeAt(l);if(F===47){if(!x){D=l+1;break}}else E===-1&&(x=!1,E=l+1),C>=0&&(F===d.charCodeAt(C)?--C===-1&&(g=l):(C=-1,g=E))}return D===g?g=E:g===-1&&(g=c.length),c.slice(D,g)}else{for(l=c.length-1;l>=0;--l)if(c.charCodeAt(l)===47){if(!x){D=l+1;break}}else g===-1&&(x=!1,g=l+1);return g===-1?"":c.slice(D,g)}},normalize:o,dirname:function(c){if(t(c),c.length===0)return".";let d=c.charCodeAt(0),D=d===47,g=-1,x=!0;for(let l=c.length-1;l>=1;--l)if(d=c.charCodeAt(l),d===47){if(!x){g=l;break}}else x=!1;return g===-1?D?"/":".":D&&g===1?"//":c.slice(0,g)},extname:function(c){t(c);let d=-1,D=0,g=-1,x=!0,l=0;for(let C=c.length-1;C>=0;--C){let E=c.charCodeAt(C);if(E===47){if(!x){D=C+1;break}continue}g===-1&&(x=!1,g=C+1),E===46?d===-1?d=C:l!==1&&(l=1):d!==-1&&(l=-1)}return d===-1||g===-1||l===0||l===1&&d===g-1&&d===D+1?"":c.slice(d,g)}}}async function ap(e){let t=e.getRepoRootDir?e.getRepoRootDir:()=>"/",r=e.cwd?e.cwd:()=>"/",n=pi({cwd:r,...e}),o=new Map,i=l=>n.normalize(n.resolve(r(),l)),a=l=>{for(let[C]of o)if((C+"/").startsWith(l))return!0;return l===t()},s=l=>(l=i(l),o.has(l)?!0:a(l)),u=l=>{l=i(l);let C=l===t()?l:l+"/",E=C.split("/").length-1,F=[];for(let[A]of o)if(A.split("/").slice(0,E).join("/")+"/"===C){let $=A.split("/")[E];$&&!F.includes($)&&F.push($)}return F.sort()},p=async(l,C=[])=>{l=i(l);let E=l===t()?l:l+"/",F=[],A=new Set(C);for(let[S]of o)S.startsWith(E)&&(S.slice(E.length).split("/").some(O=>A.has(O))||F.push(S));return F.sort()},f=l=>{l=i(l);let C=o.get(l);return typeof C=="string"?C:null},m=l=>{l=i(l);let C=o.get(l);return typeof C=="string"?new TextEncoder().encode(C):C instanceof Uint8Array?C:null},c=l=>(l=i(l),{isFile:()=>o.has(l),isDirectory:()=>!o.has(l)&&a(l),size:a(l)?0:o.get(l)?.length??0}),d=async l=>{if(typeof crypto<"u"){let F=new TextEncoder().encode(l),A=await crypto.subtle.digest("SHA-256",F);return Array.from(new Uint8Array(A)).map(S=>S.toString(16).padStart(2,"0")).join("")}let C=0;for(let E=0;E<l.length;E++){let F=l.charCodeAt(E);C=(C<<5)-C+F,C|=0}return Number(Math.abs(C)).toString(36)},D=new Set,g={getRepoRootDir:t,getAppRootDir:t,getCwdDir:r,cwd:r,exists:async l=>s(l),existsSync:s,readdir:async l=>u(l),readdirSync:u,readdirRecursive:p,readFile:async l=>f(l),readFileSync:f,readFileSyncBuffer:l=>m(l),stat:async l=>c(l),statSync:c,writeFile:async(l,C)=>{l=i(l),o.set(l,C);let E={path:l,basename:n.basename(l),dirname:n.dirname(l),extname:n.extname(l)};for(let F of D)await F(E)},unlink:async l=>{l=i(l),o.delete(l)},unlinkSync:l=>{l=i(l),o.delete(l)},hash:d,getDeviceId:async()=>typeof navigator<"u"?d(navigator.userAgent):"",getRepoInfo:async()=>({hasGit:!1,remoteUrl:"",defaultBranch:"",currentBranch:"",commit:""}),formatCode:async(l,C)=>C,on:(l,C)=>{l==="change"&&D.add(C)},off:(l,C)=>{l==="change"&&D.delete(C)},debug:(...l)=>{console.debug("[builder-dev-tools]",...l)},launchEditor:async()=>{},platform:()=>({runtime:"",os:""}),getFrameworks:()=>[],...n,...e,version:"0.0.0",sdkVersion:null,kind:null,magicast:void 0,spawnSync:void 0,Sentry:void 0,connectionTracker:null};g.connectionTracker=new tn(g);let x=await Ye(g);return g.getFrameworks=e.getFrameworks?e.getFrameworks:()=>x,g}async function ci(e,t,r){try{let n=b(e,r),o={content:r,filePath:t,fileName:e.basename(t),outcome:"no-update"};if(await pr(e))return console.warn("Turbopack does not support the Builder.io devtools cli. Please disable Turbopack or manually integrate Builder.io into your Next.js project."),o;if(li(e,n))return o;let s=de(e,n,"cjs"),u=de(e,n);if(s.length!==1&&u.length!==1)throw new Error("Expected an export from file");if(u.length===1){let m=u[0];if(!m.isDefaultExport)throw new Error("Expected a default export from file");let c=m.statement;if(!e.ts.isVariableStatement(c))throw new Error(`Unexpected export type in ${t}
|
|
1025
|
+
`),t.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 t=[];for(let r of this.connections)if(r.destroyed||!r.writable){t.push(r);continue}for(let r of t){this.removeConnection(r);try{r.destroy()}catch{}}}};function pi(e){function t(m){if(typeof m!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(m))}function r(m,c){let d="",D=0,g=-1,x=0,l;for(let C=0;C<=m.length;++C){if(C<m.length)l=m.charCodeAt(C);else{if(l===47)break;l=47}if(l===47){if(!(g===C-1||x===1))if(g!==C-1&&x===2){if(d.length<2||D!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){let E=d.lastIndexOf("/");if(E!==d.length-1){E===-1?(d="",D=0):(d=d.slice(0,E),D=d.length-1-d.lastIndexOf("/")),g=C,x=0;continue}}else if(d.length===2||d.length===1){d="",D=0,g=C,x=0;continue}}c&&(d.length>0?d+="/..":d="..",D=2)}else d.length>0?d+="/"+m.slice(g+1,C):d=m.slice(g+1,C),D=C-g-1;g=C,x=0}else l===46&&x!==-1?++x:x=-1}return d}let n=function(...c){let d="",D=!1;for(let g=c.length-1;g>=-1&&!D;g--){let x;g>=0?x=c[g]:e.cwd?x=e.cwd():x="/",t(x),x.length!==0&&(d=x+"/"+d,D=x.charCodeAt(0)===47)}return d=r(d,!D),D?d.length>0?"/"+d:"/":d.length>0?d:"."},o=function(c){if(t(c),c.length===0)return".";let d=c.charCodeAt(0)===47,D=c.charCodeAt(c.length-1)===47;return c=r(c,!d),c.length===0&&!d&&(c="."),c.length>0&&D&&(c+="/"),d?"/"+c:c};return{relative:function(c,d){if(t(c),t(d),c===d||(c=n(c),d=n(d),c===d))return"";let D=1;for(;D<c.length&&c.charCodeAt(D)===47;++D);let g=c.length,x=g-D,l=1;for(;l<d.length&&d.charCodeAt(l)===47;++l);let E=d.length-l,F=x<E?x:E,A=-1,S=0;for(;S<=F;++S){if(S===F){if(E>F){if(d.charCodeAt(l+S)===47)return d.slice(l+S+1);if(S===0)return d.slice(l+S)}else x>F&&(c.charCodeAt(D+S)===47?A=S:S===0&&(A=0));break}let $=c.charCodeAt(D+S),O=d.charCodeAt(l+S);if($!==O)break;$===47&&(A=S)}let B="";for(S=D+A+1;S<=g;++S)(S===g||c.charCodeAt(S)===47)&&(B.length===0?B+="..":B+="/..");return B.length>0?B+d.slice(l+A):(l+=A,d.charCodeAt(l)===47&&++l,d.slice(l))},resolve:n,join:function(...c){if(c.length===0)return".";let d;for(let D=0;D<c.length;++D){let g=c[D];t(g),g.length>0&&(d===void 0?d=g:d+="/"+g)}return d===void 0?".":o(d)},isAbsolute:function(c){return t(c),c.length>0&&c.charCodeAt(0)===47},basename:function(c,d){if(d!==void 0&&typeof d!="string")throw new TypeError('"ext" argument must be a string');t(c);let D=0,g=-1,x=!0,l;if(d!==void 0&&d.length>0&&d.length<=c.length){if(d.length===c.length&&d===c)return"";let C=d.length-1,E=-1;for(l=c.length-1;l>=0;--l){let F=c.charCodeAt(l);if(F===47){if(!x){D=l+1;break}}else E===-1&&(x=!1,E=l+1),C>=0&&(F===d.charCodeAt(C)?--C===-1&&(g=l):(C=-1,g=E))}return D===g?g=E:g===-1&&(g=c.length),c.slice(D,g)}else{for(l=c.length-1;l>=0;--l)if(c.charCodeAt(l)===47){if(!x){D=l+1;break}}else g===-1&&(x=!1,g=l+1);return g===-1?"":c.slice(D,g)}},normalize:o,dirname:function(c){if(t(c),c.length===0)return".";let d=c.charCodeAt(0),D=d===47,g=-1,x=!0;for(let l=c.length-1;l>=1;--l)if(d=c.charCodeAt(l),d===47){if(!x){g=l;break}}else x=!1;return g===-1?D?"/":".":D&&g===1?"//":c.slice(0,g)},extname:function(c){t(c);let d=-1,D=0,g=-1,x=!0,l=0;for(let C=c.length-1;C>=0;--C){let E=c.charCodeAt(C);if(E===47){if(!x){D=C+1;break}continue}g===-1&&(x=!1,g=C+1),E===46?d===-1?d=C:l!==1&&(l=1):d!==-1&&(l=-1)}return d===-1||g===-1||l===0||l===1&&d===g-1&&d===D+1?"":c.slice(d,g)}}}async function ap(e){let t=e.getRepoRootDir?e.getRepoRootDir:()=>"/",r=e.cwd?e.cwd:()=>"/",n=pi({cwd:r,...e}),o=new Map,i=l=>n.normalize(n.resolve(r(),l)),a=l=>{for(let[C]of o)if((C+"/").startsWith(l))return!0;return l===t()},s=l=>(l=i(l),o.has(l)?!0:a(l)),u=l=>{l=i(l);let C=l===t()?l:l+"/",E=C.split("/").length-1,F=[];for(let[A]of o)if(A.split("/").slice(0,E).join("/")+"/"===C){let $=A.split("/")[E];$&&!F.includes($)&&F.push($)}return F.sort()},p=async(l,C=[])=>{l=i(l);let E=l===t()?l:l+"/",F=[],A=new Set(C);for(let[S]of o)S.startsWith(E)&&(S.slice(E.length).split("/").some(O=>A.has(O))||F.push(S));return F.sort()},f=l=>{l=i(l);let C=o.get(l);return typeof C=="string"?C:null},m=l=>{l=i(l);let C=o.get(l);return typeof C=="string"?new TextEncoder().encode(C):C instanceof Uint8Array?C:null},c=l=>(l=i(l),{isFile:()=>o.has(l),isDirectory:()=>!o.has(l)&&a(l),size:a(l)?0:o.get(l)?.length??0}),d=async l=>{if(typeof crypto<"u"){let F=new TextEncoder().encode(l),A=await crypto.subtle.digest("SHA-256",F);return Array.from(new Uint8Array(A)).map(S=>S.toString(16).padStart(2,"0")).join("")}let C=0;for(let E=0;E<l.length;E++){let F=l.charCodeAt(E);C=(C<<5)-C+F,C|=0}return Number(Math.abs(C)).toString(36)},D=new Set,g={getRepoRootDir:t,getAppRootDir:t,getCwdDir:r,cwd:r,exists:async l=>s(l),existsSync:s,readdir:async l=>u(l),readdirSync:u,readdirRecursive:p,readFile:async l=>f(l),readFileSync:f,readFileSyncBuffer:l=>m(l),stat:async l=>c(l),statSync:c,writeFile:async(l,C)=>{l=i(l),o.set(l,C);let E={path:l,basename:n.basename(l),dirname:n.dirname(l),extname:n.extname(l)};for(let F of D)await F(E)},unlink:async l=>{l=i(l),o.delete(l)},unlinkSync:l=>{l=i(l),o.delete(l)},hash:d,getDeviceId:async()=>typeof navigator<"u"?d(navigator.userAgent):"",getRepoInfo:async()=>({hasGit:!1,remoteUrl:"",defaultBranch:"",currentBranch:"",commit:""}),formatCode:async(l,C)=>C,on:(l,C)=>{l==="change"&&D.add(C)},off:(l,C)=>{l==="change"&&D.delete(C)},debug:(...l)=>{console.debug("[builder-dev-tools]",...l)},launchEditor:async()=>({success:!1,message:"Not implemented"}),platform:()=>({runtime:"",os:""}),getFrameworks:()=>[],...n,...e,version:"0.0.0",sdkVersion:null,kind:null,magicast:void 0,spawnSync:void 0,Sentry:void 0,connectionTracker:null};g.connectionTracker=new tn(g);let x=await Ye(g);return g.getFrameworks=e.getFrameworks?e.getFrameworks:()=>x,g}async function ci(e,t,r){try{let n=b(e,r),o={content:r,filePath:t,fileName:e.basename(t),outcome:"no-update"};if(await pr(e))return console.warn("Turbopack does not support the Builder.io devtools cli. Please disable Turbopack or manually integrate Builder.io into your Next.js project."),o;if(li(e,n))return o;let s=de(e,n,"cjs"),u=de(e,n);if(s.length!==1&&u.length!==1)throw new Error("Expected an export from file");if(u.length===1){let m=u[0];if(!m.isDefaultExport)throw new Error("Expected a default export from file");let c=m.statement;if(!e.ts.isVariableStatement(c))throw new Error(`Unexpected export type in ${t}
|
|
1026
1026
|
Found config content:
|
|
1027
1027
|
${r}
|
|
1028
1028
|
|