@gadgetinc/ggt 1.7.1 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{add-M2YVCVDJ.js → add-BIKODQCS.js} +2 -2
  2. package/dist/{chunk-UAZBF6WU.js → chunk-D2R4J557.js} +2 -2
  3. package/dist/{chunk-GC4CQ6BI.js → chunk-FGUWID6B.js} +2 -2
  4. package/dist/{chunk-DP2MEKPK.js → chunk-MBWB2XUY.js} +2 -2
  5. package/dist/{chunk-2WKENYA3.js → chunk-VJTDX5WL.js} +2 -2
  6. package/dist/{chunk-TPWSJOGX.js → chunk-XQWSZW7K.js} +2 -2
  7. package/dist/{chunk-TPWSJOGX.js.map → chunk-XQWSZW7K.js.map} +2 -2
  8. package/dist/{deploy-QX2ELPOA.js → deploy-3H3W42UM.js} +2 -2
  9. package/dist/{dev-ODLZZUI4.js → dev-O5KGPP2V.js} +2 -2
  10. package/dist/{list-E3DN5VVW.js → list-O5JTZNKN.js} +2 -2
  11. package/dist/{login-LXGUUTW3.js → login-6MLYS6A4.js} +2 -2
  12. package/dist/{logs-VGDAULNT.js → logs-SS34WQ2K.js} +2 -2
  13. package/dist/main.js +1 -1
  14. package/dist/{open-LBVP7DXX.js → open-JQTW6XFM.js} +2 -2
  15. package/dist/{pull-I3WM4RL3.js → pull-5HLV3C74.js} +2 -2
  16. package/dist/push-62ZJ6D3R.js +2 -0
  17. package/dist/{status-2PKSATWL.js → status-PL7MJVN7.js} +2 -2
  18. package/dist/{whoami-LEZVATND.js → whoami-3RPUP2PK.js} +2 -2
  19. package/package.json +1 -1
  20. package/dist/push-GE55G6KR.js +0 -2
  21. /package/dist/{add-M2YVCVDJ.js.map → add-BIKODQCS.js.map} +0 -0
  22. /package/dist/{chunk-UAZBF6WU.js.map → chunk-D2R4J557.js.map} +0 -0
  23. /package/dist/{chunk-GC4CQ6BI.js.map → chunk-FGUWID6B.js.map} +0 -0
  24. /package/dist/{chunk-DP2MEKPK.js.map → chunk-MBWB2XUY.js.map} +0 -0
  25. /package/dist/{chunk-2WKENYA3.js.map → chunk-VJTDX5WL.js.map} +0 -0
  26. /package/dist/{deploy-QX2ELPOA.js.map → deploy-3H3W42UM.js.map} +0 -0
  27. /package/dist/{dev-ODLZZUI4.js.map → dev-O5KGPP2V.js.map} +0 -0
  28. /package/dist/{list-E3DN5VVW.js.map → list-O5JTZNKN.js.map} +0 -0
  29. /package/dist/{login-LXGUUTW3.js.map → login-6MLYS6A4.js.map} +0 -0
  30. /package/dist/{logs-VGDAULNT.js.map → logs-SS34WQ2K.js.map} +0 -0
  31. /package/dist/{open-LBVP7DXX.js.map → open-JQTW6XFM.js.map} +0 -0
  32. /package/dist/{pull-I3WM4RL3.js.map → pull-5HLV3C74.js.map} +0 -0
  33. /package/dist/{push-GE55G6KR.js.map → push-62ZJ6D3R.js.map} +0 -0
  34. /package/dist/{status-2PKSATWL.js.map → status-PL7MJVN7.js.map} +0 -0
  35. /package/dist/{whoami-LEZVATND.js.map → whoami-3RPUP2PK.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{f as O,g as R,h as M,i as j,j as k,k as P,p as b}from"./chunk-2WKENYA3.js";import{g as N,l as D,m as _,n as E}from"./chunk-UAZBF6WU.js";import"./chunk-JSGXXXFU.js";import"./chunk-WNAYBYSG.js";import{c as f}from"./chunk-GC4CQ6BI.js";import{a as J}from"./chunk-JBY5A44K.js";import"./chunk-HN3YKQ3C.js";import{B as U,C as L,a as T,e as C,f as S,l as B,n as y}from"./chunk-TPWSJOGX.js";import"./chunk-DYAWQS24.js";import{b as w}from"./chunk-XGQQOMPO.js";import"./chunk-KMNQ3LJT.js";import{b as m,ha as d,ja as p,n as F}from"./chunk-24OT7GHO.js";import"./chunk-GFQYFEEH.js";import{a as g,h as $}from"./chunk-7DYQUG5M.js";$();var h=class extends S{static{g(this,"AddClientError")}isBug=C.NO;constructor(o){let i="";if(F(o.cause)){let a=B(o.cause.map(e=>e.message));i=d` • ${a.map(e=>e.split(`
1
+ import{f as O,g as R,h as M,i as j,j as k,k as P,p as b}from"./chunk-VJTDX5WL.js";import{g as N,l as D,m as _,n as E}from"./chunk-D2R4J557.js";import"./chunk-JSGXXXFU.js";import"./chunk-WNAYBYSG.js";import{c as f}from"./chunk-FGUWID6B.js";import{a as J}from"./chunk-JBY5A44K.js";import"./chunk-HN3YKQ3C.js";import{B as U,C as L,a as T,e as C,f as S,l as B,n as y}from"./chunk-XQWSZW7K.js";import"./chunk-DYAWQS24.js";import{b as w}from"./chunk-XGQQOMPO.js";import"./chunk-KMNQ3LJT.js";import{b as m,ha as d,ja as p,n as F}from"./chunk-24OT7GHO.js";import"./chunk-GFQYFEEH.js";import{a as g,h as $}from"./chunk-7DYQUG5M.js";$();var h=class extends S{static{g(this,"AddClientError")}isBug=C.NO;constructor(o){let i="";if(F(o.cause)){let a=B(o.cause.map(e=>e.message));i=d` • ${a.map(e=>e.split(`
2
2
  `).join(`
3
3
  \u200E \u2022 `)).join(`
4
4
  `)}`}else i=d`${o.cause}`;super(i)}render(){return`${m.redBright(w.cross)} Failed to add:
@@ -78,4 +78,4 @@ import{f as O,g as R,h as M,i as j,j as k,k as P,p as b}from"./chunk-2WKENYA3.js
78
78
 
79
79
  {gray Usage}
80
80
  {cyanBright ggt add field ${e[0]}/<field_name>:<field_type>}`);try{let n=(await a.edit.mutate({mutation:j,variables:{path:e[0],fields:r.map(s=>({name:s.name,fieldType:s.fieldType}))}})).createModelFields;await i.writeToLocalFilesystem(t,{filesVersion:n.remoteFilesVersion,files:n.changed,delete:[]})}catch(n){throw n instanceof y?new h(n):n}p({ensureEmptyLineAbove:!0,content:`Field ${m.cyanBright(r[0]?.name)} added successfully.`})},"fieldSubCommand"),Q=g(async(t,{args:o,filesync:i})=>{let a=i.syncJson,e=o._[1]??Y();try{await a.edit.mutate({mutation:k,variables:{environment:{slug:e,sourceSlug:a.environment.name}}})}catch(n){throw n instanceof y?new h(n):n}if(p({ensureEmptyLineAbove:!0,content:`Environment ${m.cyanBright(e)} added successfully.`}),await _.load(t,{command:"pull",args:{_:[],"--app":void 0,"--allow-unknown-directory":void 0,"--allow-different-app":void 0,"--env":e},directory:await E(process.cwd())})){let n=new b(a),s=await n.hashes(t);if(s.environmentChangesToPull.size===0){p({ensureEmptyLineAbove:!0,content:"Nothing to pull."});return}s.localChangesToPush.size>0&&await n.print(t,{hashes:s}),await n.pull(t,{hashes:s,force:!0})}},"envSubCommand"),Y=g(()=>{let t=new Date;return`env-${t.toISOString().slice(0,10).replace(/-/g,"")}-${t.toLocaleTimeString("en-US",{hour12:!1}).replace(/:/g,"")}`},"makeDefaultEnvName");export{h as AddClientError,ue as args,fe as run,G as usage};
81
- //# sourceMappingURL=add-M2YVCVDJ.js.map
81
+ //# sourceMappingURL=add-BIKODQCS.js.map
@@ -1,4 +1,4 @@
1
- import{c as K}from"./chunk-GC4CQ6BI.js";import{a as be}from"./chunk-JBY5A44K.js";import{a as no,b as so}from"./chunk-HN3YKQ3C.js";import{A as Lr,D as kt,a as ft,b as Rr,e as wt,f as _t,j as io,k as Ar,m as ge,n as X,o as Fr,w as jr,x as Dr,y as ye,z as ve}from"./chunk-TPWSJOGX.js";import{a as $r}from"./chunk-KMNQ3LJT.js";import{$ as Or,A as ro,N as Pr,U as vt,Z as he,b as st,e as J,g as br,h as wr,ha as C,i as _r,ia as $,ja as bt,m as kr,n as Tr,u as Sr,v as Cr,w as xr,z as Er}from"./chunk-24OT7GHO.js";import{a as eo}from"./chunk-GFQYFEEH.js";import{a as n,b as de,d as nt,f as pt,h as T}from"./chunk-7DYQUG5M.js";var Gr=nt(N=>{"use strict";T();var uo=N&&N.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(N,"__esModule",{value:!0});var co=de("fs"),lo=uo(so()),mt=lo.default("@kwsites/file-exists");function po(t,e,r){mt("checking %s",t);try{let s=co.statSync(t);return s.isFile()&&e?(mt("[OK] path represents a file"),!0):s.isDirectory()&&r?(mt("[OK] path represents a directory"),!0):(mt("[FAIL] path represents something other than a file or directory"),!1)}catch(s){if(s.code==="ENOENT")return mt("[FAIL] path is not accessible: %o",s),!1;throw mt("[FATAL] %o",s),s}}n(po,"check");function fo(t,e=N.READABLE){return po(t,(e&N.FILE)>0,(e&N.FOLDER)>0)}n(fo,"exists");N.exists=fo;N.FILE=1;N.FOLDER=2;N.READABLE=N.FILE+N.FOLDER});var Ur=nt(Bt=>{"use strict";T();function mo(t){for(var e in t)Bt.hasOwnProperty(e)||(Bt[e]=t[e])}n(mo,"__export");Object.defineProperty(Bt,"__esModule",{value:!0});mo(Gr())});var _e=nt((kl,qr)=>{T();function ho(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=a,r.humanize=eo(),r.destroy=d,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let m=0;for(let h=0;h<p.length;h++)m=(m<<5)-m+p.charCodeAt(h),m|=0;return r.colors[Math.abs(m)%r.colors.length]}n(e,"selectColor"),r.selectColor=e;function r(p){let m,h=null,g,I;function q(...D){if(!q.enabled)return;let Y=q,ct=Number(new Date),le=ct-(m||ct);Y.diff=le,Y.prev=m,Y.curr=ct,m=ct,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let lt=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(yt,pe)=>{if(yt==="%%")return"%";lt++;let Lt=r.formatters[pe];if(typeof Lt=="function"){let fe=D[lt];yt=Lt.call(Y,fe),D.splice(lt,1),lt--}return yt}),r.formatArgs.call(Y,D),(Y.log||r.log).apply(Y,D)}return n(q,"debug"),q.namespace=p,q.useColors=r.useColors(),q.color=r.selectColor(p),q.extend=s,q.destroy=r.destroy,Object.defineProperty(q,"enabled",{enumerable:!0,configurable:!1,get:n(()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,I=r.enabled(p)),I),"get"),set:n(D=>{h=D},"set")}),typeof r.init=="function"&&r.init(q),q}n(r,"createDebug");function s(p,m){let h=r(this.namespace+(typeof m>"u"?":":m)+p);return h.log=this.log,h}n(s,"extend");function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let m,h=(typeof p=="string"?p:"").split(/[\s,]+/),g=h.length;for(m=0;m<g;m++)h[m]&&(p=h[m].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.slice(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}n(i,"enable");function o(){let p=[...r.names.map(u),...r.skips.map(u).map(m=>"-"+m)].join(",");return r.enable(""),p}n(o,"disable");function a(p){if(p[p.length-1]==="*")return!0;let m,h;for(m=0,h=r.skips.length;m<h;m++)if(r.skips[m].test(p))return!1;for(m=0,h=r.names.length;m<h;m++)if(r.names[m].test(p))return!0;return!1}n(a,"enabled");function u(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}n(u,"toNamespace");function c(p){return p instanceof Error?p.stack||p.message:p}n(c,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n(d,"destroy"),r.enable(r.load()),r}n(ho,"setup");qr.exports=ho});var Jr=nt((G,It)=>{T();G.formatArgs=yo;G.save=vo;G.load=bo;G.useColors=go;G.storage=wo();G.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();G.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function go(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}n(go,"useColors");function yo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+It.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(s=r))}),t.splice(s,0,e)}n(yo,"formatArgs");G.log=console.debug||console.log||(()=>{});function vo(t){try{t?G.storage.setItem("debug",t):G.storage.removeItem("debug")}catch{}}n(vo,"save");function bo(){let t;try{t=G.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}n(bo,"load");function wo(){try{return localStorage}catch{}}n(wo,"localstorage");It.exports=_e()(G);var{formatters:_o}=It.exports;_o.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Vr=nt((R,Gt)=>{T();var ko=de("tty"),Nt=de("util");R.init=Oo;R.log=xo;R.formatArgs=So;R.save=Eo;R.load=Po;R.useColors=To;R.destroy=Nt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");R.colors=[6,2,3,4,5,1];try{let t=no();t&&(t.stderr||t).level>=2&&(R.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}R.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),t[r]=s,t},{});function To(){return"colors"in R.inspectOpts?!!R.inspectOpts.colors:ko.isatty(process.stderr.fd)}n(To,"useColors");function So(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,i="\x1B[3"+(s<8?s:"8;5;"+s),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
1
+ import{c as K}from"./chunk-FGUWID6B.js";import{a as be}from"./chunk-JBY5A44K.js";import{a as no,b as so}from"./chunk-HN3YKQ3C.js";import{A as Lr,D as kt,a as ft,b as Rr,e as wt,f as _t,j as io,k as Ar,m as ge,n as X,o as Fr,w as jr,x as Dr,y as ye,z as ve}from"./chunk-XQWSZW7K.js";import{a as $r}from"./chunk-KMNQ3LJT.js";import{$ as Or,A as ro,N as Pr,U as vt,Z as he,b as st,e as J,g as br,h as wr,ha as C,i as _r,ia as $,ja as bt,m as kr,n as Tr,u as Sr,v as Cr,w as xr,z as Er}from"./chunk-24OT7GHO.js";import{a as eo}from"./chunk-GFQYFEEH.js";import{a as n,b as de,d as nt,f as pt,h as T}from"./chunk-7DYQUG5M.js";var Gr=nt(N=>{"use strict";T();var uo=N&&N.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(N,"__esModule",{value:!0});var co=de("fs"),lo=uo(so()),mt=lo.default("@kwsites/file-exists");function po(t,e,r){mt("checking %s",t);try{let s=co.statSync(t);return s.isFile()&&e?(mt("[OK] path represents a file"),!0):s.isDirectory()&&r?(mt("[OK] path represents a directory"),!0):(mt("[FAIL] path represents something other than a file or directory"),!1)}catch(s){if(s.code==="ENOENT")return mt("[FAIL] path is not accessible: %o",s),!1;throw mt("[FATAL] %o",s),s}}n(po,"check");function fo(t,e=N.READABLE){return po(t,(e&N.FILE)>0,(e&N.FOLDER)>0)}n(fo,"exists");N.exists=fo;N.FILE=1;N.FOLDER=2;N.READABLE=N.FILE+N.FOLDER});var Ur=nt(Bt=>{"use strict";T();function mo(t){for(var e in t)Bt.hasOwnProperty(e)||(Bt[e]=t[e])}n(mo,"__export");Object.defineProperty(Bt,"__esModule",{value:!0});mo(Gr())});var _e=nt((kl,qr)=>{T();function ho(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=a,r.humanize=eo(),r.destroy=d,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let m=0;for(let h=0;h<p.length;h++)m=(m<<5)-m+p.charCodeAt(h),m|=0;return r.colors[Math.abs(m)%r.colors.length]}n(e,"selectColor"),r.selectColor=e;function r(p){let m,h=null,g,I;function q(...D){if(!q.enabled)return;let Y=q,ct=Number(new Date),le=ct-(m||ct);Y.diff=le,Y.prev=m,Y.curr=ct,m=ct,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let lt=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(yt,pe)=>{if(yt==="%%")return"%";lt++;let Lt=r.formatters[pe];if(typeof Lt=="function"){let fe=D[lt];yt=Lt.call(Y,fe),D.splice(lt,1),lt--}return yt}),r.formatArgs.call(Y,D),(Y.log||r.log).apply(Y,D)}return n(q,"debug"),q.namespace=p,q.useColors=r.useColors(),q.color=r.selectColor(p),q.extend=s,q.destroy=r.destroy,Object.defineProperty(q,"enabled",{enumerable:!0,configurable:!1,get:n(()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,I=r.enabled(p)),I),"get"),set:n(D=>{h=D},"set")}),typeof r.init=="function"&&r.init(q),q}n(r,"createDebug");function s(p,m){let h=r(this.namespace+(typeof m>"u"?":":m)+p);return h.log=this.log,h}n(s,"extend");function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let m,h=(typeof p=="string"?p:"").split(/[\s,]+/),g=h.length;for(m=0;m<g;m++)h[m]&&(p=h[m].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.slice(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}n(i,"enable");function o(){let p=[...r.names.map(u),...r.skips.map(u).map(m=>"-"+m)].join(",");return r.enable(""),p}n(o,"disable");function a(p){if(p[p.length-1]==="*")return!0;let m,h;for(m=0,h=r.skips.length;m<h;m++)if(r.skips[m].test(p))return!1;for(m=0,h=r.names.length;m<h;m++)if(r.names[m].test(p))return!0;return!1}n(a,"enabled");function u(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}n(u,"toNamespace");function c(p){return p instanceof Error?p.stack||p.message:p}n(c,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n(d,"destroy"),r.enable(r.load()),r}n(ho,"setup");qr.exports=ho});var Jr=nt((G,It)=>{T();G.formatArgs=yo;G.save=vo;G.load=bo;G.useColors=go;G.storage=wo();G.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();G.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function go(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}n(go,"useColors");function yo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+It.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(s=r))}),t.splice(s,0,e)}n(yo,"formatArgs");G.log=console.debug||console.log||(()=>{});function vo(t){try{t?G.storage.setItem("debug",t):G.storage.removeItem("debug")}catch{}}n(vo,"save");function bo(){let t;try{t=G.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}n(bo,"load");function wo(){try{return localStorage}catch{}}n(wo,"localstorage");It.exports=_e()(G);var{formatters:_o}=It.exports;_o.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Vr=nt((R,Gt)=>{T();var ko=de("tty"),Nt=de("util");R.init=Oo;R.log=xo;R.formatArgs=So;R.save=Eo;R.load=Po;R.useColors=To;R.destroy=Nt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");R.colors=[6,2,3,4,5,1];try{let t=no();t&&(t.stderr||t).level>=2&&(R.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}R.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),t[r]=s,t},{});function To(){return"colors"in R.inspectOpts?!!R.inspectOpts.colors:ko.isatty(process.stderr.fd)}n(To,"useColors");function So(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,i="\x1B[3"+(s<8?s:"8;5;"+s),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
2
2
  `).join(`
3
3
  `+o),t.push(i+"m+"+Gt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Co()+e+" "+t[0]}n(So,"formatArgs");function Co(){return R.inspectOpts.hideDate?"":new Date().toISOString()+" "}n(Co,"getDate");function xo(...t){return process.stderr.write(Nt.formatWithOptions(R.inspectOpts,...t)+`
4
4
  `)}n(xo,"log");function Eo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}n(Eo,"save");function Po(){return process.env.DEBUG}n(Po,"load");function Oo(t){t.inspectOpts={};let e=Object.keys(R.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=R.inspectOpts[e[r]]}n(Oo,"init");Gt.exports=_e()(R);var{formatters:zr}=Gt.exports;zr.o=function(t){return this.inspectOpts.colors=this.useColors,Nt.inspect(t,this.inspectOpts).split(`
@@ -113,4 +113,4 @@ import{c as K}from"./chunk-GC4CQ6BI.js";import{a as be}from"./chunk-JBY5A44K.js"
113
113
  • ${u.join(`
114
114
  \u2022 `)}
115
115
  `)},"loadEnvironment"),Uc=n(async(t,{directory:e})=>{try{return await Pi(e.path).revparse(["--abbrev-ref","HEAD"])}catch(r){t.log.warn("failed to read git branch",{error:r});return}},"loadBranch"),qc=J.object({application:J.string(),environment:J.string(),environments:J.record(J.object({filesVersion:J.string()}))}),Jc=J.object({app:J.string(),filesVersion:J.string(),mtime:J.number()}),zc=J.union([qc,Jc]),Vc=zc.transform(t=>"environment"in t?t:{application:t.app,environment:"development",environments:{development:{filesVersion:t.filesVersion}}});export{Xc as a,we as b,Zc as c,tl as d,el as e,Br as f,Mt as g,Ir as h,Nr as i,ao as j,fl as k,Hp as l,gr as m,Yp as n};
116
- //# sourceMappingURL=chunk-UAZBF6WU.js.map
116
+ //# sourceMappingURL=chunk-D2R4J557.js.map
@@ -1,2 +1,2 @@
1
- import{e as C,f as b,g as E}from"./chunk-TPWSJOGX.js";import{b as D}from"./chunk-XGQQOMPO.js";import{b as N,f as G}from"./chunk-24OT7GHO.js";import{a as m,d as $,f as P,h as y}from"./chunk-7DYQUG5M.js";var S=$((F,I)=>{y();var _=Symbol("arg flag"),a=class n extends Error{static{m(this,"ArgError")}constructor(e,p){super(e),this.name="ArgError",this.code=p,Object.setPrototypeOf(this,n.prototype)}};function A(n,{argv:e=process.argv.slice(2),permissive:p=!1,stopAtPositional:w=!1}={}){if(!n)throw new a("argument specification object is required","ARG_CONFIG_NO_SPEC");let t={_:[]},s={},c={};for(let r of Object.keys(n)){if(!r)throw new a("argument key cannot be an empty string","ARG_CONFIG_EMPTY_KEY");if(r[0]!=="-")throw new a(`argument key must start with '-' but found: '${r}'`,"ARG_CONFIG_NONOPT_KEY");if(r.length===1)throw new a(`argument key must have a name; singular '-' keys are not allowed: ${r}`,"ARG_CONFIG_NONAME_KEY");if(typeof n[r]=="string"){s[r]=n[r];continue}let l=n[r],i=!1;if(Array.isArray(l)&&l.length===1&&typeof l[0]=="function"){let[u]=l;l=m((f,d,g=[])=>(g.push(u(f,d,g[g.length-1])),g),"type"),i=u===Boolean||u[_]===!0}else if(typeof l=="function")i=l===Boolean||l[_]===!0;else throw new a(`type missing or not a function or valid array type: ${r}`,"ARG_CONFIG_VAD_TYPE");if(r[1]!=="-"&&r.length>2)throw new a(`short argument keys (with a single hyphen) must have only one character: ${r}`,"ARG_CONFIG_SHORTOPT_TOOLONG");c[r]=[l,i]}for(let r=0,l=e.length;r<l;r++){let i=e[r];if(w&&t._.length>0){t._=t._.concat(e.slice(r));break}if(i==="--"){t._=t._.concat(e.slice(r+1));break}if(i.length>1&&i[0]==="-"){let u=i[1]==="-"||i.length===2?[i]:i.slice(1).split("").map(f=>`-${f}`);for(let f=0;f<u.length;f++){let d=u[f],[g,O]=d[1]==="-"?d.split(/=(.*)/,2):[d,void 0],o=g;for(;o in s;)o=s[o];if(!(o in c))if(p){t._.push(d);continue}else throw new a(`unknown or unexpected option: ${g}`,"ARG_UNKNOWN_OPTION");let[h,R]=c[o];if(!R&&f+1<u.length)throw new a(`option requires argument (but was followed by another short argument): ${g}`,"ARG_MISSING_REQUIRED_SHORTARG");if(R)t[o]=h(!0,o,t[o]);else if(O===void 0){if(e.length<r+2||e[r+1].length>1&&e[r+1][0]==="-"&&!(e[r+1].match(/^-?\d*(\.(?=\d))?\d*$/)&&(h===Number||typeof BigInt<"u"&&h===BigInt))){let T=g===o?"":` (alias for ${o})`;throw new a(`option requires argument: ${g}${T}`,"ARG_MISSING_REQUIRED_LONGARG")}t[o]=h(e[r+1],o,t[o]),++r}else t[o]=h(O,o,t[o])}}else t._.push(i)}return t}m(A,"arg");A.flag=n=>(n[_]=!0,n);A.COUNT=A.flag((n,e,p)=>(p||0)+1);A.ArgError=a;I.exports=A});y();var k=P(S(),1);var L=m((n,e)=>{let p={},w={};for(let[t,s]of Object.entries(n)){if(!("type"in s)){p[t]=s;continue}if(p[t]=s.type,w[t]=s.default,s.alias)for(let c of Array.isArray(s.alias)?s.alias:[s.alias])p[c]=t}try{let t=(0,k.default)(p,e);for(let[s,c]of Object.entries(w))G(t[s])&&(t[s]=c);return t}catch(t){throw t instanceof k.default.ArgError&&(t=new x(t.message)),t instanceof b?t:new E(t)}},"parseArgs"),x=class extends b{static{m(this,"ArgError")}isBug=C.NO;render(){return`${N.redBright(D.cross)} `+this.message}};y();import j from"node:assert";var H=["dev","deploy","status","push","pull","add","open","list","login","logout","logs","whoami","configure","version"],K=m(n=>H.includes(n),"isCommand"),J=m(async n=>{j(K(n),`invalid command: ${n}`);let e;switch(n){case"dev":e=await import("./dev-ODLZZUI4.js");break;case"deploy":e=await import("./deploy-QX2ELPOA.js");break;case"status":e=await import("./status-2PKSATWL.js");break;case"push":e=await import("./push-GE55G6KR.js");break;case"pull":e=await import("./pull-I3WM4RL3.js");break;case"add":e=await import("./add-M2YVCVDJ.js");break;case"open":e=await import("./open-LBVP7DXX.js");break;case"list":e=await import("./list-E3DN5VVW.js");break;case"login":e=await import("./login-LXGUUTW3.js");break;case"logout":e=await import("./logout-ACRXIJEF.js");break;case"logs":e=await import("./logs-VGDAULNT.js");break;case"whoami":e=await import("./whoami-LEZVATND.js");break;case"configure":e=await import("./configure-LD5XC2MR.js");break;case"version":e=await import("./version-NZHW3VLV.js");break}return e},"importCommand");export{S as a,L as b,x as c,H as d,K as e,J as f};
2
- //# sourceMappingURL=chunk-GC4CQ6BI.js.map
1
+ import{e as C,f as b,g as E}from"./chunk-XQWSZW7K.js";import{b as D}from"./chunk-XGQQOMPO.js";import{b as N,f as G}from"./chunk-24OT7GHO.js";import{a as m,d as $,f as P,h as y}from"./chunk-7DYQUG5M.js";var S=$((F,I)=>{y();var _=Symbol("arg flag"),a=class n extends Error{static{m(this,"ArgError")}constructor(e,p){super(e),this.name="ArgError",this.code=p,Object.setPrototypeOf(this,n.prototype)}};function A(n,{argv:e=process.argv.slice(2),permissive:p=!1,stopAtPositional:w=!1}={}){if(!n)throw new a("argument specification object is required","ARG_CONFIG_NO_SPEC");let t={_:[]},s={},c={};for(let r of Object.keys(n)){if(!r)throw new a("argument key cannot be an empty string","ARG_CONFIG_EMPTY_KEY");if(r[0]!=="-")throw new a(`argument key must start with '-' but found: '${r}'`,"ARG_CONFIG_NONOPT_KEY");if(r.length===1)throw new a(`argument key must have a name; singular '-' keys are not allowed: ${r}`,"ARG_CONFIG_NONAME_KEY");if(typeof n[r]=="string"){s[r]=n[r];continue}let l=n[r],i=!1;if(Array.isArray(l)&&l.length===1&&typeof l[0]=="function"){let[u]=l;l=m((f,d,g=[])=>(g.push(u(f,d,g[g.length-1])),g),"type"),i=u===Boolean||u[_]===!0}else if(typeof l=="function")i=l===Boolean||l[_]===!0;else throw new a(`type missing or not a function or valid array type: ${r}`,"ARG_CONFIG_VAD_TYPE");if(r[1]!=="-"&&r.length>2)throw new a(`short argument keys (with a single hyphen) must have only one character: ${r}`,"ARG_CONFIG_SHORTOPT_TOOLONG");c[r]=[l,i]}for(let r=0,l=e.length;r<l;r++){let i=e[r];if(w&&t._.length>0){t._=t._.concat(e.slice(r));break}if(i==="--"){t._=t._.concat(e.slice(r+1));break}if(i.length>1&&i[0]==="-"){let u=i[1]==="-"||i.length===2?[i]:i.slice(1).split("").map(f=>`-${f}`);for(let f=0;f<u.length;f++){let d=u[f],[g,O]=d[1]==="-"?d.split(/=(.*)/,2):[d,void 0],o=g;for(;o in s;)o=s[o];if(!(o in c))if(p){t._.push(d);continue}else throw new a(`unknown or unexpected option: ${g}`,"ARG_UNKNOWN_OPTION");let[h,R]=c[o];if(!R&&f+1<u.length)throw new a(`option requires argument (but was followed by another short argument): ${g}`,"ARG_MISSING_REQUIRED_SHORTARG");if(R)t[o]=h(!0,o,t[o]);else if(O===void 0){if(e.length<r+2||e[r+1].length>1&&e[r+1][0]==="-"&&!(e[r+1].match(/^-?\d*(\.(?=\d))?\d*$/)&&(h===Number||typeof BigInt<"u"&&h===BigInt))){let T=g===o?"":` (alias for ${o})`;throw new a(`option requires argument: ${g}${T}`,"ARG_MISSING_REQUIRED_LONGARG")}t[o]=h(e[r+1],o,t[o]),++r}else t[o]=h(O,o,t[o])}}else t._.push(i)}return t}m(A,"arg");A.flag=n=>(n[_]=!0,n);A.COUNT=A.flag((n,e,p)=>(p||0)+1);A.ArgError=a;I.exports=A});y();var k=P(S(),1);var L=m((n,e)=>{let p={},w={};for(let[t,s]of Object.entries(n)){if(!("type"in s)){p[t]=s;continue}if(p[t]=s.type,w[t]=s.default,s.alias)for(let c of Array.isArray(s.alias)?s.alias:[s.alias])p[c]=t}try{let t=(0,k.default)(p,e);for(let[s,c]of Object.entries(w))G(t[s])&&(t[s]=c);return t}catch(t){throw t instanceof k.default.ArgError&&(t=new x(t.message)),t instanceof b?t:new E(t)}},"parseArgs"),x=class extends b{static{m(this,"ArgError")}isBug=C.NO;render(){return`${N.redBright(D.cross)} `+this.message}};y();import j from"node:assert";var H=["dev","deploy","status","push","pull","add","open","list","login","logout","logs","whoami","configure","version"],K=m(n=>H.includes(n),"isCommand"),J=m(async n=>{j(K(n),`invalid command: ${n}`);let e;switch(n){case"dev":e=await import("./dev-O5KGPP2V.js");break;case"deploy":e=await import("./deploy-3H3W42UM.js");break;case"status":e=await import("./status-PL7MJVN7.js");break;case"push":e=await import("./push-62ZJ6D3R.js");break;case"pull":e=await import("./pull-5HLV3C74.js");break;case"add":e=await import("./add-BIKODQCS.js");break;case"open":e=await import("./open-JQTW6XFM.js");break;case"list":e=await import("./list-O5JTZNKN.js");break;case"login":e=await import("./login-6MLYS6A4.js");break;case"logout":e=await import("./logout-ACRXIJEF.js");break;case"logs":e=await import("./logs-SS34WQ2K.js");break;case"whoami":e=await import("./whoami-3RPUP2PK.js");break;case"configure":e=await import("./configure-LD5XC2MR.js");break;case"version":e=await import("./version-NZHW3VLV.js");break}return e},"importCommand");export{S as a,L as b,x as c,H as d,K as e,J as f};
2
+ //# sourceMappingURL=chunk-FGUWID6B.js.map
@@ -1,4 +1,4 @@
1
- import{p as m}from"./chunk-2WKENYA3.js";import{l as g,m as h,n as p}from"./chunk-UAZBF6WU.js";import{c}from"./chunk-GC4CQ6BI.js";import{ha as a,ja as i}from"./chunk-24OT7GHO.js";import{a as s,h as r}from"./chunk-7DYQUG5M.js";r();var P={...g,"--env":{type:String,alias:["-e","--environment","--to"]},"--force":{type:Boolean,alias:"-f"}},S=s(e=>a`
1
+ import{p as m}from"./chunk-VJTDX5WL.js";import{l as g,m as h,n as p}from"./chunk-D2R4J557.js";import{c}from"./chunk-FGUWID6B.js";import{ha as a,ja as i}from"./chunk-24OT7GHO.js";import{a as s,h as r}from"./chunk-7DYQUG5M.js";r();var P={...g,"--env":{type:String,alias:["-e","--environment","--to"]},"--force":{type:Boolean,alias:"-f"}},S=s(e=>a`
2
2
  Pushes your local files to your environment directory.
3
3
 
4
4
  This command first tracks changes in your environment directory since the last sync.
@@ -25,4 +25,4 @@ import{p as m}from"./chunk-2WKENYA3.js";import{l as g,m as h,n as p}from"./chunk
25
25
 
26
26
  Run "ggt push -h" for more information.
27
27
  `);let y=await p(process.cwd()),l=await h.loadOrInit(e,{command:"push",args:o,directory:y}),t=new m(l),n=await t.hashes(e);if(n.localChangesToPush.size===0){i({ensureEmptyLineAbove:!0,content:"Nothing to push."});return}n.environmentChangesToPull.size>0&&!n.onlyDotGadgetFilesChanged&&await t.print(e,{hashes:n}),await t.push(e,{command:"push",hashes:n,force:o["--force"]})},"run");export{P as a,S as b,A as c};
28
- //# sourceMappingURL=chunk-DP2MEKPK.js.map
28
+ //# sourceMappingURL=chunk-MBWB2XUY.js.map
@@ -1,4 +1,4 @@
1
- import{b as bt,e as Et,h as xt,j as Ie,k as ne}from"./chunk-UAZBF6WU.js";import{a as ft,b as ht}from"./chunk-JSGXXXFU.js";import{b as W}from"./chunk-WNAYBYSG.js";import{c as St}from"./chunk-GC4CQ6BI.js";import{a as Ct}from"./chunk-JBY5A44K.js";import{F as _t,h as Me,i as vr,j as gt,p as Mt,u as Ae}from"./chunk-TPWSJOGX.js";import{b as N}from"./chunk-XGQQOMPO.js";import{b as It,c as At}from"./chunk-KMNQ3LJT.js";import{A as Tr,O as ct,R as dt,S as D,V as xe,W as te,Z as yt,aa as mt,b as E,d as ot,g as st,ha as g,ia as G,ja as O,o as it,q as Ee,r as lt,s as ut,t as pt}from"./chunk-24OT7GHO.js";import{a as Cr}from"./chunk-GFQYFEEH.js";import{a,b as F,d as x,f as w,h as p}from"./chunk-7DYQUG5M.js";var $t=x((Ts,Ut)=>{p();Ut.exports=Ht;Ht.sync=Br;var Dt=F("fs");function Nr(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}a(Nr,"checkPathExt");function Gt(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:Nr(t,n)}a(Gt,"checkStat");function Ht(e,t,n){Dt.stat(e,function(r,o){n(r,r?!1:Gt(o,e,t))})}a(Ht,"isexe");function Br(e,t){return Gt(Dt.statSync(e),e,t)}a(Br,"sync")});var qt=x((Rs,Wt)=>{p();Wt.exports=jt;jt.sync=kr;var Qt=F("fs");function jt(e,t,n){Qt.stat(e,function(r,o){n(r,r?!1:Jt(o,t))})}a(jt,"isexe");function kr(e,t){return Jt(Qt.statSync(e),t)}a(kr,"sync");function Jt(e,t){return e.isFile()&&Lr(e,t)}a(Jt,"checkStat");function Lr(e,t){var n=e.mode,r=e.uid,o=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),l=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),d=l|u,y=n&c||n&u&&o===i||n&l&&r===s||n&d&&s===0;return y}a(Lr,"checkMode")});var zt=x((Ns,Yt)=>{p();var Os=F("fs"),oe;process.platform==="win32"||global.TESTING_WINDOWS?oe=$t():oe=qt();Yt.exports=Te;Te.sync=Vr;function Te(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Te(e,t||{},function(s,i){s?o(s):r(i)})})}oe(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}a(Te,"isexe");function Vr(e,t){try{return oe.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}a(Vr,"sync")});var rn=x((Ls,nn)=>{p();var $=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Kt=F("path"),Dr=$?";":":",Xt=zt(),Zt=a(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),en=a((e,t)=>{let n=t.colon||Dr,r=e.match(/\//)||$&&e.match(/\\/)?[""]:[...$?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=$?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=$?o.split(n):[""];return $&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:r,pathExt:s,pathExtExe:o}},"getPathInfo"),tn=a((e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:s}=en(e,t),i=[],l=a(c=>new Promise((d,y)=>{if(c===r.length)return t.all&&i.length?d(i):y(Zt(e));let m=r[c],S=/^".*"$/.test(m)?m.slice(1,-1):m,f=Kt.join(S,e),h=!S&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;d(u(h,c,0))}),"step"),u=a((c,d,y)=>new Promise((m,S)=>{if(y===o.length)return m(l(d+1));let f=o[y];Xt(c+f,{pathExt:s},(h,b)=>{if(!h&&b)if(t.all)i.push(c+f);else return m(c+f);return m(u(c,d,y+1))})}),"subStep");return n?l(0).then(c=>n(null,c),n):l(0)},"which"),Gr=a((e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=en(e,t),s=[];for(let i=0;i<n.length;i++){let l=n[i],u=/^".*"$/.test(l)?l.slice(1,-1):l,c=Kt.join(u,e),d=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let y=0;y<r.length;y++){let m=d+r[y];try{if(Xt.sync(m,{pathExt:o}))if(t.all)s.push(m);else return m}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Zt(e)},"whichSync");nn.exports=tn;tn.sync=Gr});var on=x((Gs,ve)=>{"use strict";p();var an=a((e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"},"pathKey");ve.exports=an;ve.exports.default=an});var pn=x(($s,un)=>{"use strict";p();var sn=F("path"),Hr=rn(),Ur=on();function ln(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Hr.sync(e.command,{path:n[Ur({env:n})],pathExt:t?sn.delimiter:void 0})}catch{}finally{s&&process.chdir(r)}return i&&(i=sn.resolve(o?e.options.cwd:"",i)),i}a(ln,"resolveCommandAttempt");function $r(e){return ln(e)||ln(e,!0)}a($r,"resolveCommand");un.exports=$r});var cn=x((Js,Re)=>{"use strict";p();var Fe=/([()\][%!^"`<>&|;, *?])/g;function Qr(e){return e=e.replace(Fe,"^$1"),e}a(Qr,"escapeCommand");function jr(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Fe,"^$1"),t&&(e=e.replace(Fe,"^$1")),e}a(jr,"escapeArgument");Re.exports.command=Qr;Re.exports.argument=jr});var yn=x((Ys,dn)=>{"use strict";p();dn.exports=/^#!(.*)/});var Sn=x((Ks,mn)=>{"use strict";p();var Jr=yn();mn.exports=(e="")=>{let t=e.match(Jr);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var fn=x((Zs,gn)=>{"use strict";p();var we=F("fs"),Wr=Sn();function qr(e){let n=Buffer.alloc(150),r;try{r=we.openSync(e,"r"),we.readSync(r,n,0,150,0),we.closeSync(r)}catch{}return Wr(n.toString())}a(qr,"readShebang");gn.exports=qr});var xn=x((ni,En)=>{"use strict";p();var Yr=F("path"),hn=pn(),bn=cn(),zr=fn(),Kr=process.platform==="win32",Xr=/\.(?:com|exe)$/i,Zr=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function ea(e){e.file=hn(e);let t=e.file&&zr(e.file);return t?(e.args.unshift(e.file),e.command=t,hn(e)):e.file}a(ea,"detectShebang");function ta(e){if(!Kr)return e;let t=ea(e),n=!Xr.test(t);if(e.options.forceShell||n){let r=Zr.test(t);e.command=Yr.normalize(e.command),e.command=bn.command(e.command),e.args=e.args.map(s=>bn.argument(s,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}a(ta,"parseNonShell");function na(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:ta(r)}a(na,"parse");En.exports=na});var An=x((oi,In)=>{"use strict";p();var Pe=process.platform==="win32";function Oe(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}a(Oe,"notFoundError");function ra(e,t){if(!Pe)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let s=Mn(o,t,"spawn");if(s)return n.call(e,"error",s)}return n.apply(e,arguments)}}a(ra,"hookChildProcess");function Mn(e,t){return Pe&&e===1&&!t.file?Oe(t.original,"spawn"):null}a(Mn,"verifyENOENT");function aa(e,t){return Pe&&e===1&&!t.file?Oe(t.original,"spawnSync"):null}a(aa,"verifyENOENTSync");In.exports={hookChildProcess:ra,verifyENOENT:Mn,verifyENOENTSync:aa,notFoundError:Oe}});var Tn=x((li,Q)=>{"use strict";p();var _n=F("child_process"),Ne=xn(),Be=An();function Cn(e,t,n){let r=Ne(e,t,n),o=_n.spawn(r.command,r.args,r.options);return Be.hookChildProcess(o,r),o}a(Cn,"spawn");function oa(e,t,n){let r=Ne(e,t,n),o=_n.spawnSync(r.command,r.args,r.options);return o.error=o.error||Be.verifyENOENTSync(o.status,r),o}a(oa,"spawnSync");Q.exports=Cn;Q.exports.spawn=Cn;Q.exports.sync=oa;Q.exports._parse=Ne;Q.exports._enoent=Be});var Zn=x((zl,Xn)=>{"use strict";p();var{PassThrough:to}=F("stream");Xn.exports=function(){var e=[],t=new to({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(s){return Array.isArray(s)?(s.forEach(n),this):(e.push(s),s.once("end",o.bind(null,s)),s.once("error",t.emit.bind(t,"error")),s.pipe(t,{end:!1}),this)}a(n,"add");function r(){return e.length==0}a(r,"isEmpty");function o(s){e=e.filter(function(i){return i!==s}),!e.length&&t.readable&&t.end()}a(o,"remove")}});var fr=x(($u,gr)=>{p();function A(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}a(A,"RetryOperation");gr.exports=A;A.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};A.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};A.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0};A.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};A.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};A.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};A.prototype.start=A.prototype.try;A.prototype.errors=function(){return this._errors};A.prototype.attempts=function(){return this._attempts};A.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],s=o.message,i=(e[s]||0)+1;e[s]=i,i>=n&&(t=o,n=i)}return t}});var hr=x(L=>{p();var Co=fr();L.operation=function(e){var t=L.timeouts(e);return new Co(t,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};L.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<t.retries;o++)r.push(this.createTimeout(o,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(o,t)),r.sort(function(s,i){return s-i}),r};L.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return r=Math.min(r,t.maxTimeout),r};L.wrap=function(e,t,n){if(t instanceof Array&&(n=t,t=null),!n){n=[];for(var r in e)typeof e[r]=="function"&&n.push(r)}for(var o=0;o<n.length;o++){var s=n[o],i=e[s];e[s]=a(function(u){var c=L.operation(t),d=Array.prototype.slice.call(arguments,1),y=d.pop();d.push(function(m){c.retry(m)||(m&&(arguments[0]=c.mainError()),y.apply(this,arguments))}),c.attempt(function(){u.apply(e,d)})},"retryWrapper").bind(e,i),e[s].options=t}}});var Er=x((Yu,br)=>{p();br.exports=hr()});p();var q=w(gt(),1);var re=class extends Map{static{a(this,"Changes")}created=D(()=>Array.from(this.entries()).filter(([,t])=>t.type==="create").map(([t])=>t));updated=D(()=>Array.from(this.entries()).filter(([,t])=>t.type==="update").map(([t])=>t));deleted=D(()=>Array.from(this.entries()).filter(([,t])=>t.type==="delete").map(([t])=>t))},Fr=E.greenBright("+"),Rr=E.blueBright("\xB1"),wr=E.redBright("-"),Tt=E.yellowBright("\u2192"),Y=a((e,{changes:t,tense:n,limit:r=1/0,...o})=>{yt.logLevel<=te.TRACE&&(r=1/0);let s=Array.from(t.entries()).filter(([m])=>!m.startsWith(".gadget/"));if(s.length===0)return"";let i=E.yellowBright(n==="past"?"renamed":"rename"),l=E.greenBright(n==="past"?"created":"create"),u=E.blueBright(n==="past"?"updated":"update"),c=E.redBright(n==="past"?"deleted":"delete"),d=s.sort((m,S)=>m[0].localeCompare(S[0])).slice(0,r).map(([m,S])=>{switch(!0){case(S.type==="create"&&st(S.oldPath)):return[Tt,E.yellowBright(S.oldPath),i,Tt,E.yellowBright(m)];case S.type==="create":return[Fr,E.greenBright(m),l];case S.type==="update":return[Rr,E.blueBright(m),u];case S.type==="delete":return[wr,E.redBright(m),c];default:return it(S)}});s.length>r&&d.push([E.gray(N.ellipsis),g`{gray ${s.length-r} more}`,""]);let y;if(s.length>=5){let m=[],S=s.filter(([,b])=>b.type==="create").length;if(S>0){let b=n==="past"?`${S} created`:(0,q.default)("create",S,!0);m.push(g`{greenBright ${b}}`)}let f=s.filter(([,b])=>b.type==="update").length;if(f>0){let b=n==="past"?`${f} updated`:(0,q.default)("update",f,!0);m.push(g`{blueBright ${b}}`)}let h=s.filter(([,b])=>b.type==="delete").length;if(h>0){let b=n==="past"?`${h} deleted`:(0,q.default)("delete",h,!0);m.push(g`{redBright ${b}}`)}y=G`
1
+ import{b as bt,e as Et,h as xt,j as Ie,k as ne}from"./chunk-D2R4J557.js";import{a as ft,b as ht}from"./chunk-JSGXXXFU.js";import{b as W}from"./chunk-WNAYBYSG.js";import{c as St}from"./chunk-FGUWID6B.js";import{a as Ct}from"./chunk-JBY5A44K.js";import{F as _t,h as Me,i as vr,j as gt,p as Mt,u as Ae}from"./chunk-XQWSZW7K.js";import{b as N}from"./chunk-XGQQOMPO.js";import{b as It,c as At}from"./chunk-KMNQ3LJT.js";import{A as Tr,O as ct,R as dt,S as D,V as xe,W as te,Z as yt,aa as mt,b as E,d as ot,g as st,ha as g,ia as G,ja as O,o as it,q as Ee,r as lt,s as ut,t as pt}from"./chunk-24OT7GHO.js";import{a as Cr}from"./chunk-GFQYFEEH.js";import{a,b as F,d as x,f as w,h as p}from"./chunk-7DYQUG5M.js";var $t=x((Ts,Ut)=>{p();Ut.exports=Ht;Ht.sync=Br;var Dt=F("fs");function Nr(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}a(Nr,"checkPathExt");function Gt(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:Nr(t,n)}a(Gt,"checkStat");function Ht(e,t,n){Dt.stat(e,function(r,o){n(r,r?!1:Gt(o,e,t))})}a(Ht,"isexe");function Br(e,t){return Gt(Dt.statSync(e),e,t)}a(Br,"sync")});var qt=x((Rs,Wt)=>{p();Wt.exports=jt;jt.sync=kr;var Qt=F("fs");function jt(e,t,n){Qt.stat(e,function(r,o){n(r,r?!1:Jt(o,t))})}a(jt,"isexe");function kr(e,t){return Jt(Qt.statSync(e),t)}a(kr,"sync");function Jt(e,t){return e.isFile()&&Lr(e,t)}a(Jt,"checkStat");function Lr(e,t){var n=e.mode,r=e.uid,o=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),l=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),d=l|u,y=n&c||n&u&&o===i||n&l&&r===s||n&d&&s===0;return y}a(Lr,"checkMode")});var zt=x((Ns,Yt)=>{p();var Os=F("fs"),oe;process.platform==="win32"||global.TESTING_WINDOWS?oe=$t():oe=qt();Yt.exports=Te;Te.sync=Vr;function Te(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Te(e,t||{},function(s,i){s?o(s):r(i)})})}oe(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}a(Te,"isexe");function Vr(e,t){try{return oe.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}a(Vr,"sync")});var rn=x((Ls,nn)=>{p();var $=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Kt=F("path"),Dr=$?";":":",Xt=zt(),Zt=a(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),en=a((e,t)=>{let n=t.colon||Dr,r=e.match(/\//)||$&&e.match(/\\/)?[""]:[...$?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=$?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=$?o.split(n):[""];return $&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:r,pathExt:s,pathExtExe:o}},"getPathInfo"),tn=a((e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:s}=en(e,t),i=[],l=a(c=>new Promise((d,y)=>{if(c===r.length)return t.all&&i.length?d(i):y(Zt(e));let m=r[c],S=/^".*"$/.test(m)?m.slice(1,-1):m,f=Kt.join(S,e),h=!S&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;d(u(h,c,0))}),"step"),u=a((c,d,y)=>new Promise((m,S)=>{if(y===o.length)return m(l(d+1));let f=o[y];Xt(c+f,{pathExt:s},(h,b)=>{if(!h&&b)if(t.all)i.push(c+f);else return m(c+f);return m(u(c,d,y+1))})}),"subStep");return n?l(0).then(c=>n(null,c),n):l(0)},"which"),Gr=a((e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=en(e,t),s=[];for(let i=0;i<n.length;i++){let l=n[i],u=/^".*"$/.test(l)?l.slice(1,-1):l,c=Kt.join(u,e),d=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let y=0;y<r.length;y++){let m=d+r[y];try{if(Xt.sync(m,{pathExt:o}))if(t.all)s.push(m);else return m}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Zt(e)},"whichSync");nn.exports=tn;tn.sync=Gr});var on=x((Gs,ve)=>{"use strict";p();var an=a((e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"},"pathKey");ve.exports=an;ve.exports.default=an});var pn=x(($s,un)=>{"use strict";p();var sn=F("path"),Hr=rn(),Ur=on();function ln(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Hr.sync(e.command,{path:n[Ur({env:n})],pathExt:t?sn.delimiter:void 0})}catch{}finally{s&&process.chdir(r)}return i&&(i=sn.resolve(o?e.options.cwd:"",i)),i}a(ln,"resolveCommandAttempt");function $r(e){return ln(e)||ln(e,!0)}a($r,"resolveCommand");un.exports=$r});var cn=x((Js,Re)=>{"use strict";p();var Fe=/([()\][%!^"`<>&|;, *?])/g;function Qr(e){return e=e.replace(Fe,"^$1"),e}a(Qr,"escapeCommand");function jr(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Fe,"^$1"),t&&(e=e.replace(Fe,"^$1")),e}a(jr,"escapeArgument");Re.exports.command=Qr;Re.exports.argument=jr});var yn=x((Ys,dn)=>{"use strict";p();dn.exports=/^#!(.*)/});var Sn=x((Ks,mn)=>{"use strict";p();var Jr=yn();mn.exports=(e="")=>{let t=e.match(Jr);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var fn=x((Zs,gn)=>{"use strict";p();var we=F("fs"),Wr=Sn();function qr(e){let n=Buffer.alloc(150),r;try{r=we.openSync(e,"r"),we.readSync(r,n,0,150,0),we.closeSync(r)}catch{}return Wr(n.toString())}a(qr,"readShebang");gn.exports=qr});var xn=x((ni,En)=>{"use strict";p();var Yr=F("path"),hn=pn(),bn=cn(),zr=fn(),Kr=process.platform==="win32",Xr=/\.(?:com|exe)$/i,Zr=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function ea(e){e.file=hn(e);let t=e.file&&zr(e.file);return t?(e.args.unshift(e.file),e.command=t,hn(e)):e.file}a(ea,"detectShebang");function ta(e){if(!Kr)return e;let t=ea(e),n=!Xr.test(t);if(e.options.forceShell||n){let r=Zr.test(t);e.command=Yr.normalize(e.command),e.command=bn.command(e.command),e.args=e.args.map(s=>bn.argument(s,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}a(ta,"parseNonShell");function na(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:ta(r)}a(na,"parse");En.exports=na});var An=x((oi,In)=>{"use strict";p();var Pe=process.platform==="win32";function Oe(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}a(Oe,"notFoundError");function ra(e,t){if(!Pe)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let s=Mn(o,t,"spawn");if(s)return n.call(e,"error",s)}return n.apply(e,arguments)}}a(ra,"hookChildProcess");function Mn(e,t){return Pe&&e===1&&!t.file?Oe(t.original,"spawn"):null}a(Mn,"verifyENOENT");function aa(e,t){return Pe&&e===1&&!t.file?Oe(t.original,"spawnSync"):null}a(aa,"verifyENOENTSync");In.exports={hookChildProcess:ra,verifyENOENT:Mn,verifyENOENTSync:aa,notFoundError:Oe}});var Tn=x((li,Q)=>{"use strict";p();var _n=F("child_process"),Ne=xn(),Be=An();function Cn(e,t,n){let r=Ne(e,t,n),o=_n.spawn(r.command,r.args,r.options);return Be.hookChildProcess(o,r),o}a(Cn,"spawn");function oa(e,t,n){let r=Ne(e,t,n),o=_n.spawnSync(r.command,r.args,r.options);return o.error=o.error||Be.verifyENOENTSync(o.status,r),o}a(oa,"spawnSync");Q.exports=Cn;Q.exports.spawn=Cn;Q.exports.sync=oa;Q.exports._parse=Ne;Q.exports._enoent=Be});var Zn=x((zl,Xn)=>{"use strict";p();var{PassThrough:to}=F("stream");Xn.exports=function(){var e=[],t=new to({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(s){return Array.isArray(s)?(s.forEach(n),this):(e.push(s),s.once("end",o.bind(null,s)),s.once("error",t.emit.bind(t,"error")),s.pipe(t,{end:!1}),this)}a(n,"add");function r(){return e.length==0}a(r,"isEmpty");function o(s){e=e.filter(function(i){return i!==s}),!e.length&&t.readable&&t.end()}a(o,"remove")}});var fr=x(($u,gr)=>{p();function A(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}a(A,"RetryOperation");gr.exports=A;A.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};A.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};A.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0};A.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};A.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};A.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};A.prototype.start=A.prototype.try;A.prototype.errors=function(){return this._errors};A.prototype.attempts=function(){return this._attempts};A.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],s=o.message,i=(e[s]||0)+1;e[s]=i,i>=n&&(t=o,n=i)}return t}});var hr=x(L=>{p();var Co=fr();L.operation=function(e){var t=L.timeouts(e);return new Co(t,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};L.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<t.retries;o++)r.push(this.createTimeout(o,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(o,t)),r.sort(function(s,i){return s-i}),r};L.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return r=Math.min(r,t.maxTimeout),r};L.wrap=function(e,t,n){if(t instanceof Array&&(n=t,t=null),!n){n=[];for(var r in e)typeof e[r]=="function"&&n.push(r)}for(var o=0;o<n.length;o++){var s=n[o],i=e[s];e[s]=a(function(u){var c=L.operation(t),d=Array.prototype.slice.call(arguments,1),y=d.pop();d.push(function(m){c.retry(m)||(m&&(arguments[0]=c.mainError()),y.apply(this,arguments))}),c.attempt(function(){u.apply(e,d)})},"retryWrapper").bind(e,i),e[s].options=t}}});var Er=x((Yu,br)=>{p();br.exports=hr()});p();var q=w(gt(),1);var re=class extends Map{static{a(this,"Changes")}created=D(()=>Array.from(this.entries()).filter(([,t])=>t.type==="create").map(([t])=>t));updated=D(()=>Array.from(this.entries()).filter(([,t])=>t.type==="update").map(([t])=>t));deleted=D(()=>Array.from(this.entries()).filter(([,t])=>t.type==="delete").map(([t])=>t))},Fr=E.greenBright("+"),Rr=E.blueBright("\xB1"),wr=E.redBright("-"),Tt=E.yellowBright("\u2192"),Y=a((e,{changes:t,tense:n,limit:r=1/0,...o})=>{yt.logLevel<=te.TRACE&&(r=1/0);let s=Array.from(t.entries()).filter(([m])=>!m.startsWith(".gadget/"));if(s.length===0)return"";let i=E.yellowBright(n==="past"?"renamed":"rename"),l=E.greenBright(n==="past"?"created":"create"),u=E.blueBright(n==="past"?"updated":"update"),c=E.redBright(n==="past"?"deleted":"delete"),d=s.sort((m,S)=>m[0].localeCompare(S[0])).slice(0,r).map(([m,S])=>{switch(!0){case(S.type==="create"&&st(S.oldPath)):return[Tt,E.yellowBright(S.oldPath),i,Tt,E.yellowBright(m)];case S.type==="create":return[Fr,E.greenBright(m),l];case S.type==="update":return[Rr,E.blueBright(m),u];case S.type==="delete":return[wr,E.redBright(m),c];default:return it(S)}});s.length>r&&d.push([E.gray(N.ellipsis),g`{gray ${s.length-r} more}`,""]);let y;if(s.length>=5){let m=[],S=s.filter(([,b])=>b.type==="create").length;if(S>0){let b=n==="past"?`${S} created`:(0,q.default)("create",S,!0);m.push(g`{greenBright ${b}}`)}let f=s.filter(([,b])=>b.type==="update").length;if(f>0){let b=n==="past"?`${f} updated`:(0,q.default)("update",f,!0);m.push(g`{blueBright ${b}}`)}let h=s.filter(([,b])=>b.type==="delete").length;if(h>0){let b=n==="past"?`${h} deleted`:(0,q.default)("delete",h,!0);m.push(g`{redBright ${b}}`)}y=G`
2
2
  ${(0,q.default)("change",s.length,!0)} in total. ${m.join(", ")}.
3
3
  `}return ft({rows:d,footer:y,ensureEmptyLineAbove:!0,ensureEmptyLineAboveBody:!1,ensureEmptyLineAboveFooter:!0,indent:0,...o})},"sprintChanges"),ae=a((e,t)=>{let n=Y(e,t);n&&O(n)},"printChanges");p();var vt=g(`
4
4
  subscription EnvironmentLogs($query: String!, $start: DateTime, $limit: Int) {
@@ -191,4 +191,4 @@ ${r.message}`:b,T=[M,t,e].filter(Boolean).join(`
191
191
 
192
192
  {red Your app will not be operational until all fatal errors are fixed.}
193
193
  `})}catch(c){throw Ie(c)?u.clear():u.fail(),c}}};export{re as a,Rr as b,wr as c,rn as d,Jo as e,Wo as f,qo as g,Yo as h,zo as i,Ko as j,B as k,Lt as l,Vt as m,Ms as n,Is as o,Ir as p};
194
- //# sourceMappingURL=chunk-2WKENYA3.js.map
194
+ //# sourceMappingURL=chunk-VJTDX5WL.js.map
@@ -21,7 +21,7 @@ tell application "System Events" to get value of property list item "CFBundleNam
21
21
  \u2022 `)}
22
22
  `;break}case ur(this.cause):r="The connection to Gadget closed unexpectedly.";break;case(fr(this.cause)||lr(this.cause)):r=this.cause.message;break;case cr(this.cause):this.cause.length===1?r=String(this.cause[0]):r=this.cause.join(", ");break;default:r=this.cause;break}return this.message+`
23
23
 
24
- `+r}},ir=class extends $e{static{o(this,"AuthenticationError")}constructor(t){super(t,"Request authentication failed due to the session expiring while running the command. Please sign-in again.",Ie.NO)}};var sr=class{constructor(t,r,n){this.environment=r;this.endpoint=n;this.ctx=t.child({name:"client"}),this._graphqlWsClient=wi({url:`wss://${r.application.slug}.${R.domains.app}/edit/api/graphql-ws`,keepAlive:(0,mn.default)("10s"),shouldRetry:o(()=>!0,"shouldRetry"),connectionParams:{environment:r.name},webSocketImpl:class extends Ps{static{o(this,"webSocketImpl")}constructor(i,s,a){super(i,s,{signal:t.signal,...a,headers:{...a?.headers,"user-agent":R.versionFull,...Sr(t)}})}},on:{opened:o(()=>{this.ctx.log.trace("opened")},"opened"),ping:o(i=>{this.ctx.log.trace("ping",{received:i})},"ping"),pong:o(i=>{this.ctx.log.trace("pong",{received:i})},"pong"),connecting:o(()=>{switch(this.status){case 1:this.status=2,this.ctx.log.info("reconnecting");break;case 2:this.ctx.log.info("retrying");break;default:this.ctx.log.debug("connecting");break}},"connecting"),connected:o(()=>{this.status===2?this.ctx.log.info("reconnected"):this.ctx.log.debug("connected"),setImmediate(()=>this.status=0)},"connected"),closed:o(()=>{this.status=1,this.ctx.log.debug("disconnected")},"closed"),error:o(i=>{this.status===2?this.ctx.log.error("failed to reconnect",{error:i}):this.ctx.log.error("connection error",{error:i})},"error")}})}static{o(this,"Client")}status=0;ctx;_graphqlWsClient;_sessionUpdateInterval;subscribe(t,{subscription:r,variables:n,onResponse:i,onError:s,onComplete:a=In}){let l={query:r,variables:ae(n)},c=this._graphqlWsClient.on("connected",()=>{this.status===2&&(l.variables=ae(n),t.log.info("re-subscribing to graphql subscription")),this._sessionUpdateInterval=setInterval(()=>{ut(this.ctx).catch(y=>this.ctx.abort(y)).then(y=>{y||this.ctx.abort(new ir(void 0))})},(0,mn.default)("30m")),this.ctx.done.finally(()=>{this._sessionUpdateInterval&&clearInterval(this._sessionUpdateInterval)})}),f=new xt({concurrency:1}),d=o(y=>s(new $e(r,y)),"onError"),p=this._graphqlWsClient.subscribe(l,{next:o(y=>void f.add(()=>i(y)).catch(d),"next"),error:o(y=>void f.add(()=>d(y)),"error"),complete:o(()=>void f.add(()=>a()).catch(d),"complete")});return()=>{t.log.trace("unsubscribing from graphql subscription"),c(),f.clear(),p()}}async execute(t,r){let n=this.environment.application.slug;this.environment.application.multiEnvironmentEnabled?this.environment.type!=="production"&&(n+=`--${this.environment.name}`):this.environment.application.hasSplitEnvironments&&(n+="--development");try{let i=await ft({context:{ctx:t},method:"POST",url:`https://${n}.${R.domains.app}${this.endpoint}`,headers:{...Sr(t),"x-gadget-environment":this.environment.name},json:{query:r.operation,variables:ae(r.variables)},responseType:"json",resolveBodyOnly:!0,throwHttpErrors:!1,...r.http});if(!Qe(i)||!("data"in i)&&!("errors"in i))throw t.log.error("received invalid graphql response",{error:i}),i;return i}catch(i){throw new $e(r.operation,i)}}async dispose(){await this._graphqlWsClient.dispose()}};var At=class{static{o(this,"Api")}ctx;#e;constructor(t,r){this.ctx=t.child({name:"api"}),this.#e=new sr(this.ctx,r,"/api/graphql")}async query({query:t,variables:r,...n}){let i=/query (\w+)/.exec(t)?.[1];Ic(i,"query name not found");let s=this.ctx.child({name:"api",fields:{edit:{query:i}},devFields:{edit:{query:i,variables:ae(r)}}});s.log.info("executing graphql query");let a=await this.#e.execute(s,{operation:t,variables:r,...n,http:{retry:{methods:["POST"]},...n.http}});if(a.errors)throw new $e(t,a.errors);if(!a.data)throw new $e(t,"Query response did not contain data");return a.data}async dispose(){await this.#e.dispose()}};h();var Fs=ne(`
24
+ `+r}},ir=class extends $e{static{o(this,"AuthenticationError")}constructor(t){super(t,"Request authentication failed due to the session expiring while running the command. Please sign-in again.",Ie.NO)}};var sr=class{constructor(t,r,n){this.environment=r;this.endpoint=n;this.ctx=t.child({name:"client"}),this._graphqlWsClient=wi({url:`wss://${r.application.slug}.${R.domains.app}/edit/api/graphql-ws`,keepAlive:(0,mn.default)("10s"),shouldRetry:o(()=>!0,"shouldRetry"),connectionParams:{environment:r.name},webSocketImpl:class extends Ps{static{o(this,"webSocketImpl")}constructor(i,s,a){super(i,s,{signal:t.signal,...a,headers:{...a?.headers,"user-agent":R.versionFull,...Sr(t)}})}},on:{opened:o(()=>{this.ctx.log.trace("opened")},"opened"),ping:o(i=>{this.ctx.log.trace("ping",{received:i})},"ping"),pong:o(i=>{this.ctx.log.trace("pong",{received:i})},"pong"),connecting:o(()=>{switch(this.status){case 1:this.status=2,this.ctx.log.info("reconnecting");break;case 2:this.ctx.log.info("retrying");break;default:this.ctx.log.debug("connecting");break}},"connecting"),connected:o(()=>{this.status===2?this.ctx.log.info("reconnected"):this.ctx.log.debug("connected"),setImmediate(()=>this.status=0)},"connected"),closed:o(()=>{this.status=1,this.ctx.log.debug("disconnected")},"closed"),error:o(i=>{this.status===2?this.ctx.log.error("failed to reconnect",{error:i}):this.ctx.log.error("connection error",{error:i})},"error")}})}static{o(this,"Client")}status=0;ctx;_graphqlWsClient;_sessionUpdateInterval;subscribe(t,{subscription:r,variables:n,onResponse:i,onError:s,onComplete:a=In}){let l={query:r,variables:ae(n)},c=this._graphqlWsClient.on("connected",()=>{this.status===2&&(l.variables=ae(n),t.log.info("re-subscribing to graphql subscription")),this._sessionUpdateInterval=setInterval(()=>{ut(this.ctx).catch(y=>this.ctx.abort(y)).then(y=>{y||this.ctx.abort(new ir(void 0))})},(0,mn.default)("30m")).unref(),this.ctx.done.finally(()=>{this._sessionUpdateInterval&&clearInterval(this._sessionUpdateInterval)})}),f=new xt({concurrency:1}),d=o(y=>s(new $e(r,y)),"onError"),p=this._graphqlWsClient.subscribe(l,{next:o(y=>void f.add(()=>i(y)).catch(d),"next"),error:o(y=>void f.add(()=>d(y)),"error"),complete:o(()=>void f.add(()=>a()).catch(d),"complete")});return()=>{t.log.trace("unsubscribing from graphql subscription"),c(),f.clear(),p()}}async execute(t,r){let n=this.environment.application.slug;this.environment.application.multiEnvironmentEnabled?this.environment.type!=="production"&&(n+=`--${this.environment.name}`):this.environment.application.hasSplitEnvironments&&(n+="--development");try{let i=await ft({context:{ctx:t},method:"POST",url:`https://${n}.${R.domains.app}${this.endpoint}`,headers:{...Sr(t),"x-gadget-environment":this.environment.name},json:{query:r.operation,variables:ae(r.variables)},responseType:"json",resolveBodyOnly:!0,throwHttpErrors:!1,...r.http});if(!Qe(i)||!("data"in i)&&!("errors"in i))throw t.log.error("received invalid graphql response",{error:i}),i;return i}catch(i){throw new $e(r.operation,i)}}async dispose(){await this._graphqlWsClient.dispose()}};var At=class{static{o(this,"Api")}ctx;#e;constructor(t,r){this.ctx=t.child({name:"api"}),this.#e=new sr(this.ctx,r,"/api/graphql")}async query({query:t,variables:r,...n}){let i=/query (\w+)/.exec(t)?.[1];Ic(i,"query name not found");let s=this.ctx.child({name:"api",fields:{edit:{query:i}},devFields:{edit:{query:i,variables:ae(r)}}});s.log.info("executing graphql query");let a=await this.#e.execute(s,{operation:t,variables:r,...n,http:{retry:{methods:["POST"]},...n.http}});if(a.errors)throw new $e(t,a.errors);if(!a.data)throw new $e(t,"Query response did not contain data");return a.data}async dispose(){await this.#e.dispose()}};h();var Fs=ne(`
25
25
  query GadgetMetaModels {
26
26
  gadgetMeta {
27
27
  models {
@@ -63,4 +63,4 @@ tell application "System Events" to get value of property list item "CFBundleNam
63
63
 
64
64
  Once logged in, return to this terminal.
65
65
  `})}await n}finally{t?.close()}},"run"),bo=cl;export{ye as a,Eu as b,kc as c,Lh as d,Ie as e,He as f,hn as g,Is as h,ui as i,Ns as j,Fh as k,Ds as l,jh as m,$e as n,ir as o,xt as p,Xn as q,Wm as r,cl as s,bo as t,yo as u,ut as v,Am as w,sr as x,Rc as y,Pd as z,Nd as A,Id as B,Rd as C,M as D,Ip as E,Rp as F,zp as G,ar as H,ft as I};
66
- //# sourceMappingURL=chunk-TPWSJOGX.js.map
66
+ //# sourceMappingURL=chunk-XQWSZW7K.js.map