@gadgetinc/ggt 1.1.0 → 1.3.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.
Files changed (112) hide show
  1. package/README.md +4 -0
  2. package/dist/add-VYOF3CRL.js +78 -0
  3. package/dist/add-VYOF3CRL.js.map +7 -0
  4. package/dist/{chunk-FLXIAZND.js → chunk-3B5DKR5D.js} +2 -2
  5. package/dist/{chunk-FLXIAZND.js.map → chunk-3B5DKR5D.js.map} +4 -4
  6. package/dist/chunk-3V7YWBUK.js +2 -0
  7. package/dist/{chunk-BSCZOMV4.js.map → chunk-3V7YWBUK.js.map} +1 -1
  8. package/dist/chunk-B6XQEEUK.js +2 -0
  9. package/dist/chunk-B6XQEEUK.js.map +7 -0
  10. package/dist/chunk-CQH5IRAO.js +50 -0
  11. package/dist/chunk-CQH5IRAO.js.map +7 -0
  12. package/dist/{chunk-5ONACLO6.js → chunk-ENT5WEIR.js} +2 -2
  13. package/dist/chunk-FQ2LR3BI.js +6 -0
  14. package/dist/chunk-FQ2LR3BI.js.map +7 -0
  15. package/dist/chunk-J5XIQ6N4.js +187 -0
  16. package/dist/chunk-J5XIQ6N4.js.map +7 -0
  17. package/dist/chunk-JU6IEBE5.js +65 -0
  18. package/dist/chunk-JU6IEBE5.js.map +7 -0
  19. package/dist/{chunk-TRHAPK2F.js → chunk-LQDBD3BI.js} +4 -4
  20. package/dist/{chunk-TRHAPK2F.js.map → chunk-LQDBD3BI.js.map} +2 -2
  21. package/dist/chunk-P5OUQ5XQ.js +2 -0
  22. package/dist/chunk-SGMPMYEU.js +2 -0
  23. package/dist/chunk-SGMPMYEU.js.map +7 -0
  24. package/dist/chunk-VE2URKOG.js +117 -0
  25. package/dist/chunk-VE2URKOG.js.map +7 -0
  26. package/dist/{chunk-JKDJXJKF.js → chunk-WBESFPTY.js} +2 -2
  27. package/dist/chunk-YQO2R55C.js +18 -0
  28. package/dist/{chunk-M2OJZLL7.js.map → chunk-YQO2R55C.js.map} +3 -3
  29. package/dist/chunk-ZHG3WLFU.js +2 -0
  30. package/dist/chunk-ZHG3WLFU.js.map +7 -0
  31. package/dist/deploy-EEJCK2MG.js +25 -0
  32. package/dist/deploy-EEJCK2MG.js.map +7 -0
  33. package/dist/dev-G77WSGIC.js +58 -0
  34. package/dist/{dev-5UFCKF4X.js.map → dev-G77WSGIC.js.map} +4 -4
  35. package/dist/esm-3OYJEC4Z.js +36 -0
  36. package/dist/esm-3OYJEC4Z.js.map +7 -0
  37. package/dist/list-3AI2FD3F.js +11 -0
  38. package/dist/list-3AI2FD3F.js.map +7 -0
  39. package/dist/login-UGTNK3B3.js +2 -0
  40. package/dist/logout-CN5DL7Z2.js +7 -0
  41. package/dist/{logout-YXDH5ZZI.js.map → logout-CN5DL7Z2.js.map} +1 -1
  42. package/dist/main.js +10 -10
  43. package/dist/main.js.map +3 -3
  44. package/dist/open-PM56SR6Z.js +74 -0
  45. package/dist/open-PM56SR6Z.js.map +7 -0
  46. package/dist/{pull-UAKKKJJP.js → pull-TAW6KHZO.js} +4 -4
  47. package/dist/{pull-UAKKKJJP.js.map → pull-TAW6KHZO.js.map} +2 -2
  48. package/dist/push-2NCJSDGS.js +2 -0
  49. package/dist/status-WDYI4EOU.js +14 -0
  50. package/dist/status-WDYI4EOU.js.map +7 -0
  51. package/dist/{version-VE55GG37.js → version-3FBGIVXT.js} +2 -2
  52. package/dist/{version-VE55GG37.js.map → version-3FBGIVXT.js.map} +1 -1
  53. package/dist/whoami-UALRX2FT.js +7 -0
  54. package/dist/{whoami-OAH55L4M.js.map → whoami-UALRX2FT.js.map} +1 -1
  55. package/package.json +19 -18
  56. package/dist/add-RDTHYTCK.js +0 -78
  57. package/dist/add-RDTHYTCK.js.map +0 -7
  58. package/dist/build-4BGA4IZE.js +0 -3
  59. package/dist/build-4BGA4IZE.js.map +0 -7
  60. package/dist/chunk-3Q3GPB6Z.js +0 -2
  61. package/dist/chunk-3Q3GPB6Z.js.map +0 -7
  62. package/dist/chunk-457GEPUN.js +0 -9
  63. package/dist/chunk-457GEPUN.js.map +0 -7
  64. package/dist/chunk-57XALM2W.js +0 -2
  65. package/dist/chunk-57XALM2W.js.map +0 -7
  66. package/dist/chunk-5WC5D4WL.js +0 -2
  67. package/dist/chunk-5WC5D4WL.js.map +0 -7
  68. package/dist/chunk-BSCZOMV4.js +0 -2
  69. package/dist/chunk-CQLM5U6T.js +0 -67
  70. package/dist/chunk-CQLM5U6T.js.map +0 -7
  71. package/dist/chunk-D2K5XPNJ.js +0 -2
  72. package/dist/chunk-D2K5XPNJ.js.map +0 -7
  73. package/dist/chunk-F3EZ4KS3.js +0 -2
  74. package/dist/chunk-F3EZ4KS3.js.map +0 -7
  75. package/dist/chunk-GOBNB5VT.js +0 -2
  76. package/dist/chunk-GOBNB5VT.js.map +0 -7
  77. package/dist/chunk-HKBXEZNF.js +0 -2
  78. package/dist/chunk-LWW4E6P5.js +0 -173
  79. package/dist/chunk-LWW4E6P5.js.map +0 -7
  80. package/dist/chunk-M2OJZLL7.js +0 -18
  81. package/dist/chunk-M4PNFOA5.js +0 -6
  82. package/dist/chunk-M4PNFOA5.js.map +0 -7
  83. package/dist/chunk-NGTOMLDS.js +0 -33
  84. package/dist/chunk-NGTOMLDS.js.map +0 -7
  85. package/dist/chunk-RYQWS5BH.js +0 -117
  86. package/dist/chunk-RYQWS5BH.js.map +0 -7
  87. package/dist/chunk-VICN6LTV.js +0 -12
  88. package/dist/chunk-VICN6LTV.js.map +0 -7
  89. package/dist/context-GN36UFJL.js +0 -2
  90. package/dist/deploy-BAMMI3ZA.js +0 -24
  91. package/dist/deploy-BAMMI3ZA.js.map +0 -7
  92. package/dist/dev-5UFCKF4X.js +0 -55
  93. package/dist/esm-GJ7RK6IC.js +0 -34
  94. package/dist/esm-GJ7RK6IC.js.map +0 -7
  95. package/dist/list-WGRXHV2B.js +0 -11
  96. package/dist/list-WGRXHV2B.js.map +0 -7
  97. package/dist/login-5YZOB4XB.js +0 -2
  98. package/dist/logout-YXDH5ZZI.js +0 -7
  99. package/dist/open-EOH3Q5KP.js +0 -74
  100. package/dist/open-EOH3Q5KP.js.map +0 -7
  101. package/dist/push-7X4P2364.js +0 -2
  102. package/dist/push-7X4P2364.js.map +0 -7
  103. package/dist/status-UJUGP24U.js +0 -14
  104. package/dist/status-UJUGP24U.js.map +0 -7
  105. package/dist/user-B2RIDVTH.js +0 -2
  106. package/dist/user-B2RIDVTH.js.map +0 -7
  107. package/dist/whoami-OAH55L4M.js +0 -7
  108. /package/dist/{chunk-5ONACLO6.js.map → chunk-ENT5WEIR.js.map} +0 -0
  109. /package/dist/{chunk-HKBXEZNF.js.map → chunk-P5OUQ5XQ.js.map} +0 -0
  110. /package/dist/{chunk-JKDJXJKF.js.map → chunk-WBESFPTY.js.map} +0 -0
  111. /package/dist/{context-GN36UFJL.js.map → login-UGTNK3B3.js.map} +0 -0
  112. /package/dist/{login-5YZOB4XB.js.map → push-2NCJSDGS.js.map} +0 -0
@@ -0,0 +1,58 @@
1
+ import{a as gn}from"./chunk-3V7YWBUK.js";import{a as it}from"./chunk-P5OUQ5XQ.js";import{a as rt,d as vn,m as $,n as tr,o as sr}from"./chunk-J5XIQ6N4.js";import{f as Vt,l as Qt,m as rr,n as ir,o as nr}from"./chunk-VE2URKOG.js";import"./chunk-ENT5WEIR.js";import{b as er}from"./chunk-WBESFPTY.js";import"./chunk-ZHG3WLFU.js";import"./chunk-FQ2LR3BI.js";import"./chunk-YQO2R55C.js";import{A as Xt,C as Zt,d as Jt,j as Yt,k as En}from"./chunk-CQH5IRAO.js";import"./chunk-3B5DKR5D.js";import{$ as zt,C as tt,J as $t,U as Ge,Z as G,_ as Kt,b as jt,o as Ht}from"./chunk-JU6IEBE5.js";import{a as wn}from"./chunk-B6XQEEUK.js";import{a as E,b as O,c as R,d as pn,e as We,f as yn,g as a}from"./chunk-SGMPMYEU.js";var Ar=R(ge=>{"use strict";a();Object.defineProperty(ge,"__esModule",{value:!0});ge.sync=ge.isexe=void 0;var Tn=E("fs"),Rn=E("fs/promises"),bn=async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Dr(await(0,Rn.stat)(e),t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};ge.isexe=bn;var kn=(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Dr((0,Tn.statSync)(e),t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};ge.sync=kn;var Dr=(e,t)=>e.isFile()&&Ln(e,t),Ln=(e,t)=>{let r=t.uid??process.getuid?.(),i=t.groups??process.getgroups?.()??[],n=t.gid??process.getgid?.()??i[0];if(r===void 0||n===void 0)throw new Error("cannot get uid or gid");let s=new Set([n,...i]),o=e.mode,c=e.uid,f=e.gid,l=parseInt("100",8),u=parseInt("010",8),w=parseInt("001",8),m=l|u;return!!(o&w||o&u&&s.has(f)||o&l&&c===r||o&m&&r===0)}});var Tr=R(Ee=>{"use strict";a();Object.defineProperty(Ee,"__esModule",{value:!0});Ee.sync=Ee.isexe=void 0;var On=E("fs"),qn=E("fs/promises"),Fn=async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Cr(await(0,qn.stat)(e),e,t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};Ee.isexe=Fn;var Un=(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Cr((0,On.statSync)(e),e,t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};Ee.sync=Un;var Pn=(e,t)=>{let{pathExt:r=process.env.PATHEXT||""}=t,i=r.split(";");if(i.indexOf("")!==-1)return!0;for(let n=0;n<i.length;n++){let s=i[n].toLowerCase(),o=e.substring(e.length-s.length).toLowerCase();if(s&&o===s)return!0}return!1},Cr=(e,t,r)=>e.isFile()&&Pn(t,r)});var br=R(Rr=>{"use strict";a();Object.defineProperty(Rr,"__esModule",{value:!0})});var Ur=R(T=>{"use strict";a();var kr=T&&T.__createBinding||(Object.create?function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]}),Mn=T&&T.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Lr=T&&T.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&kr(t,e,r);return Mn(t,e),t},Wn=T&&T.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&kr(t,e,r)};Object.defineProperty(T,"__esModule",{value:!0});T.sync=T.isexe=T.posix=T.win32=void 0;var Or=Lr(Ar());T.posix=Or;var qr=Lr(Tr());T.win32=qr;Wn(br(),T);var Gn=process.env._ISEXE_TEST_PLATFORM_||process.platform,Fr=Gn==="win32"?qr:Or;T.isexe=Fr.isexe;T.sync=Fr.sync});var zr=R((Sc,Kr)=>{a();var{isexe:Bn,sync:jn}=Ur(),{join:Hn,delimiter:$n,sep:Pr,posix:Mr}=E("path"),Wr=process.platform==="win32",Gr=new RegExp(`[${Mr.sep}${Pr===Mr.sep?"":Pr}]`.replace(/(\\)/g,"\\$1")),Kn=new RegExp(`^\\.${Gr.source}`),Br=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),jr=(e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:i=$n})=>{let n=e.match(Gr)?[""]:[...Wr?[process.cwd()]:[],...(t||"").split(i)];if(Wr){let s=r||[".EXE",".CMD",".BAT",".COM"].join(i),o=s.split(i).flatMap(c=>[c,c.toLowerCase()]);return e.includes(".")&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:s}}return{pathEnv:n,pathExt:[""]}},Hr=(e,t)=>{let r=/^".*"$/.test(e)?e.slice(1,-1):e;return(!r&&Kn.test(t)?t.slice(0,2):"")+Hn(r,t)},$r=async(e,t={})=>{let{pathEnv:r,pathExt:i,pathExtExe:n}=jr(e,t),s=[];for(let o of r){let c=Hr(o,e);for(let f of i){let l=c+f;if(await Bn(l,{pathExt:n,ignoreErrors:!0})){if(!t.all)return l;s.push(l)}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Br(e)},zn=(e,t={})=>{let{pathEnv:r,pathExt:i,pathExtExe:n}=jr(e,t),s=[];for(let o of r){let c=Hr(o,e);for(let f of i){let l=c+f;if(jn(l,{pathExt:n,ignoreErrors:!0})){if(!t.all)return l;s.push(l)}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Br(e)};Kr.exports=$r;$r.sync=zn});var Jr=R(He=>{a();(function(){var e;e=function(t,r,i){var n,s;for(s="";t.length>0;)n=t.match(r),n?(s+=t.slice(0,n.index),s+=i(n),t=t.slice(n.index+n[0].length)):(s+=t,t="");return s},He.split=function(t){var r,i;return t==null&&(t=""),i=[],r="",e(t,/\s*(?:([^\s\\\'\"]+)|'((?:[^\'\\]|\\.)*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\s|$)?/,function(n){var s,o,c,f,l,u,w;if(f=n[0],w=n[1],u=n[2],s=n[3],o=n[4],c=n[5],l=n[6],c!=null)throw new Error("Unmatched quote");if(r+=w||(u||s||o).replace(/\\(?=.)/,""),l!=null)return i.push(r),r=""}),r&&i.push(r),i},He.escape=function(t){return t==null&&(t=""),t==null?"''":t.replace(/([^A-Za-z0-9_\-.,:\/@\n])/g,"\\$1").replace(/\n/g,`'
2
+ '`)}}).call(He)});var Xr=R((Rc,Vr)=>{"use strict";a();var Yr=E("fs"),vt;function Jn(){try{return Yr.statSync("/.dockerenv"),!0}catch{return!1}}function Yn(){try{return Yr.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}Vr.exports=()=>(vt===void 0&&(vt=Jn()||Yn()),vt)});var ei=R((kc,Nt)=>{"use strict";a();var Vn=E("os"),Xn=E("fs"),Zr=Xr(),Qr=()=>{if(process.platform!=="linux")return!1;if(Vn.release().toLowerCase().includes("microsoft"))return!Zr();try{return Xn.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Zr():!1}catch{return!1}};process.env.__IS_WSL_TEST__?Nt.exports=Qr:Nt.exports=Qr()});var he=R((Oc,D)=>{a();var Zn=Jr(),$e=E("child_process"),_t=gn(),Qn=ei(),es=E("path"),ts=E("url"),ue=E("os"),St=E("fs"),rs=E("net"),is=1024;function ni(e){return JSON.parse(JSON.stringify(e))}D.exports.clone=ni;var ns=function(e){return typeof e=="string"?e.replace(/(["$`\\])/g,"\\$1"):e},ss=function(e,t){return e.indexOf(t)!==-1},ti={u:"urgency",urgency:"urgency",t:"expire-time",time:"expire-time",timeout:"expire-time",e:"expire-time",expire:"expire-time","expire-time":"expire-time",i:"icon",icon:"icon",c:"category",category:"category",subtitle:"category",h:"hint",hint:"hint",a:"app-name","app-name":"app-name"};D.exports.command=function(e,t,r){return e=Zn.escape(e),process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (command):"),console.info("[notifier path]",e),console.info("[notifier options]",t.join(" "))),$e.exec(e+" "+t.join(" "),function(i,n,s){if(i)return r(i);r(s,n)})};D.exports.fileCommand=function(e,t,r){return process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (fileCommand):"),console.info("[notifier path]",e),console.info("[notifier options]",t.join(" "))),$e.execFile(e,t,function(i,n,s){if(i)return r(i,n);r(s,n)})};D.exports.fileCommandJson=function(e,t,r){return process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (fileCommandJson):"),console.info("[notifier path]",e),console.info("[notifier options]",t.join(" "))),$e.execFile(e,t,function(i,n,s){if(i)return r(i,n);if(!n)return r(i,{});try{let o=JSON.parse(n);r(s||null,o)}catch(o){r(o,n)}})};D.exports.immediateFileCommand=function(e,t,r){process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (notifier):"),console.info("[notifier path]",e)),os(e,function(i,n){if(!n)return r(new Error("Notifier ("+e+") not found on system."));$e.execFile(e,t),r()})};function os(e,t){return St.stat(e,function(r,i){return r?es.extname(e)?t(r,!1):St.stat(e+".exe",function(n,s){if(n)return t(n,!1);t(n,s.isFile())}):t(r,i.isFile())})}var Ke=function(e){return e.appIcon&&(e.icon=e.appIcon,delete e.appIcon),e},Ie=function(e){return e.text&&(e.message=e.text,delete e.text),e},si=function(e){return e.i&&(e.icon=e.i,delete e.i),e};D.exports.mapToNotifySend=function(e){e=Ke(e),e=Ie(e),e.timeout===!1&&delete e.timeout,e.wait===!0&&(e["expire-time"]=5);for(let t in e)t==="message"||t==="title"||e.hasOwnProperty(t)&&ti[t]!==t&&(e[ti[t]]=e[t],delete e[t]);return typeof e["expire-time"]>"u"?e["expire-time"]=10*1e3:typeof e["expire-time"]=="number"&&(e["expire-time"]=e["expire-time"]*1e3),e};D.exports.mapToGrowl=function(e){if(e=Ke(e),e=si(e),e=Ie(e),e.icon&&!Buffer.isBuffer(e.icon))try{e.icon=St.readFileSync(e.icon)}catch{}return e};D.exports.mapToMac=function(e){return e=si(e),e=Ie(e),e.icon&&(e.appIcon=e.icon,delete e.icon),e.sound===!0&&(e.sound="Bottle"),e.sound===!1&&delete e.sound,e.sound&&e.sound.indexOf("Notification.")===0&&(e.sound="Bottle"),e.wait===!0&&(e.timeout||(e.timeout=5),delete e.wait),!e.wait&&!e.timeout&&(e.timeout===!1?delete e.timeout:e.timeout=10),e.json=!0,e};function xt(e){return Object.prototype.toString.call(e)==="[object Array]"}D.exports.isArray=xt;function as(){}D.exports.actionJackerDecorator=function(e,t,r,i){if(t=ni(t),r=r||as,typeof r!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof r);return function(n,s){let o=s,c={};if(o&&typeof o=="object"&&(c=o,o=o.activationType),o&&(o=o.toLowerCase().trim(),o.match(/^activate|clicked$/)&&(o="activate"),o.match(/^timedout$/)&&(o="timeout")),r.apply(e,[n,o,c]),!i||!o)return;let f=i(o);f&&e.emit(f,e,t,c)}};D.exports.constructArgumentList=function(e,t){let r=[];t=t||{};let i=t.initial||[],n=t.keyExtra||"",s=t.allowedArguments||[],o=t.noEscape!==void 0,c=t.allowedArguments!==void 0,f=!!t.explicitTrue,l=!!t.keepNewlines,u=t.wrapper===void 0?'"':t.wrapper,w=function m(h){return xt(h)?ri(h.map(m).join(",")):(o||(h=ns(h)),typeof h=="string"&&!l&&(h=ri(h)),u+h+u)};i.forEach(function(m){r.push(w(m))});for(let m in e)if(e.hasOwnProperty(m)&&(!c||ss(s,m)))if(f&&e[m]===!0)r.push("-"+n+m);else{if(f&&e[m]===!1)continue;r.push("-"+n+m,w(e[m]))}return r};function ri(e){let t=process.platform==="win32"?"\\r\\n":"\\n";return e.replace(/\r?\n/g,t)}var cs=["t","m","b","tb","p","id","s","silent","appID","pid","pipeName","close","install"],fs="Notification.",ii="Notification.Default";D.exports.mapToWin8=function(e){e=Ke(e),e=Ie(e),e.icon&&(/^file:\/+/.test(e.icon)?e.p=new ts.URL(e.icon).pathname.replace(/^\/(\w:\/)/,"$1").replace(/\//g,"\\"):e.p=e.icon,delete e.icon),e.message&&(e.m=e.message.replace(/\x1b/g,""),delete e.message),e.title&&(e.t=e.title,delete e.title),e.appName&&(e.appID=e.appName,delete e.appName),typeof e.remove<"u"&&(e.close=e.remove,delete e.remove),(e.quiet||e.silent)&&(e.silent=e.quiet||e.silent,delete e.quiet),typeof e.sound<"u"&&(e.s=e.sound,delete e.sound),e.s===!1&&(e.silent=!0,delete e.s),e.s&&e.silent&&delete e.s,e.s===!0&&(e.s=ii),e.s&&e.s.indexOf(fs)!==0&&(e.s=ii),e.actions&&xt(e.actions)&&(e.b=e.actions.join(";"),delete e.actions);for(let t in e)e.hasOwnProperty(t)&&cs.indexOf(t)===-1&&delete e[t];return e};D.exports.mapToNotifu=function(e){return e=Ke(e),e=Ie(e),e.icon&&(e.i=e.icon,delete e.icon),e.message&&(e.m=e.message,delete e.message),e.title&&(e.p=e.title,delete e.title),e.time&&(e.d=e.time,delete e.time),e.q!==!1?e.q=!0:delete e.q,e.quiet===!1&&(delete e.q,delete e.quiet),e.sound&&(delete e.q,delete e.sound),e.t&&(e.d=e.t,delete e.t),e.type&&(e.t=ls(e.type),delete e.type),e};D.exports.isMac=function(){return ue.type()==="Darwin"};D.exports.isMountainLion=function(){return ue.type()==="Darwin"&&_t.satisfies(It(ue.release()),">=12.0.0")};D.exports.isWin8=function(){return ue.type()==="Windows_NT"&&_t.satisfies(It(ue.release()),">=6.2.9200")};D.exports.isWSL=function(){return Qn};D.exports.isLessThanWin8=function(){return ue.type()==="Windows_NT"&&_t.satisfies(It(ue.release()),"<6.2.9200")};function It(e){return e.split(".").length===2&&(e+=".0"),e}function ls(e){if(typeof e=="string"||e instanceof String){if(e.toLowerCase()==="info")return"info";if(e.toLowerCase()==="warn")return"warn";if(e.toLowerCase()==="error")return"error"}return"info"}D.exports.createNamedPipe=e=>{let t=Buffer.alloc(is);return new Promise(r=>{e.instance=rs.createServer(i=>{i.on("data",n=>{t.write(n.toString())}),i.on("end",()=>{e.instance.close()})}),e.instance.listen(e.namedPipe,()=>{r(t)})})}});var ui=R((Fc,li)=>{a();var oi=E("os"),us=vn(),De=he(),ci=E("events").EventEmitter,hs=E("util"),fi="notify-send",ze;li.exports=Ae;function Ae(e){if(e=De.clone(e||{}),!(this instanceof Ae))return new Ae(e);this.options=e,ci.call(this)}hs.inherits(Ae,ci);function ds(){}function ms(e,t){if(e=De.clone(e||{}),t=t||ds,typeof t!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof t);if(typeof e=="string"&&(e={title:"node-notifier",message:e}),!e.message)return t(new Error("Message is required.")),this;if(oi.type()!=="Linux"&&!oi.type().match(/BSD$/))return t(new Error("Only supported on Linux and *BSD systems")),this;if(ze===!1)return t(new Error("notify-send must be installed on the system.")),this;if(ze||this.options.suppressOsdCheck)return ai(e,t),this;try{ze=!!us.sync(fi),ai(e,t)}catch(r){return ze=!1,t(r)}return this}Object.defineProperty(Ae.prototype,"notify",{get:function(){return this._notify||(this._notify=ms.bind(this)),this._notify}});var ps=["urgency","expire-time","icon","category","hint","app-name"];function ai(e,t){e=De.mapToNotifySend(e),e.title=e.title||"Node Notification:";let r=[e.title,e.message];delete e.title,delete e.message;let i=De.constructArgumentList(e,{initial:r,keyExtra:"-",allowedArguments:ps});De.command(fi,i,t)}});var Dt=R((Pc,di)=>{a();var ys=E("net"),hi=!1;di.exports=function(e,t){if(typeof t>"u"&&(t=e,e={}),hi)return t(null,hi);let r=e.port||23053,i=e.host||"localhost",n=ys.connect(r,i);n.setTimeout(100),n.once("connect",function(){n.end(),t(null,!0)}),n.once("error",function(){n.end(),t(null,!1)})}});var yi=R((Wc,pi)=>{a();var ws=E("net"),gs=E("crypto"),mi=E("util").format,Es=E("fs"),W=`\r
3
+ `;function de(e,t){t=t||{},this.type=e,this.host=t.host||"localhost",this.port=t.port||23053,this.request="GNTP/1.0 "+e+" NONE"+W,this.resources=[],this.attempts=0,this.maxAttempts=5}de.prototype.parseResp=function(e){var t={},r,i;return e=e.slice(0,e.indexOf(W+W)).split(W),r=e[0],i=e.slice(1),t.state=r.match(/-(OK|ERROR|CALLBACK)/)[0].slice(1),i.forEach(function(n){n=n.split(": "),t[n[0]]=n[1]}),t};de.prototype.retry=function(){var e=this,t=arguments;setTimeout(function(){e.send.apply(e,t)},750)};de.prototype.addResource=function(e){var t=gs.createHash("md5").update(e).digest("hex"),r="Identifier: "+t+W+"Length: "+e.length+W+W;return this.resources.push({header:r,file:e}),"x-growl-resource://"+t};de.prototype.add=function(e,t){t!==void 0&&(/-Icon/.test(e)&&!/^https?:\/\//.test(t)&&(/\.(png|gif|jpe?g)$/.test(t)?t=this.addResource(Es.readFileSync(t)):t instanceof Buffer&&(t=this.addResource(t))),this.request+=e+": "+t+W)};de.prototype.newline=function(){this.request+=W};de.prototype.send=function(e){var t=this,r=ws.connect(this.port,this.host),i="";e=e||function(){},this.attempts+=1,r.on("connect",function(){r.write(t.request),t.resources.forEach(function(n){r.write(n.header),r.write(n.file),r.write(W+W)})}),r.on("data",function(n){i+=n.toString(),i.slice(i.length-4)===W+W&&(i=t.parseResp(i),i.state==="ERROR"||i.state==="CALLBACK"?r.end():i="")}),r.on("end",function(){if(["200","401","402"].indexOf(i["Error-Code"])>=0)if(t.attempts<=t.maxAttempts)t.retry(e);else{var n='GNTP request to "%s:%d" failed with error code %s (%s)';e(new Error(mi(n,t.host,t.port,i["Error-Code"],i["Error-Description"])))}else e(void 0,i)}),r.on("error",function(){e(new Error(mi('Error while sending GNTP request to "%s:%d"',t.host,t.port))),r.destroy()})};pi.exports=de});var Ei=R((Bc,gi)=>{a();var wi=yi();function Ce(){this.appname="Growly",this.notifications=void 0,this.labels=void 0,this.count=0,this.registered=!1,this.host=void 0,this.port=void 0}Ce.prototype.getLabels=function(){return this.notifications.map(function(e){return e.label})};Ce.prototype.setHost=function(e,t){this.host=e,this.port=t};Ce.prototype.register=function(e,t,r,i){var n;typeof t=="object"&&(r=t,t=void 0),(r===void 0||!r.length)&&(r=[{label:"default",dispname:"Default Notification",enabled:!0}]),typeof arguments[arguments.length-1]=="function"?i=arguments[arguments.length-1]:i=function(){},this.appname=e,this.notifications=r,this.labels=this.getLabels(),this.registered=!0,n=new wi("REGISTER",{host:this.host,port:this.port}),n.add("Application-Name",e),n.add("Application-Icon",t),n.add("Notifications-Count",r.length),n.newline(),r.forEach(function(s){s.enabled===void 0&&(s.enabled=!0),n.add("Notification-Name",s.label),n.add("Notification-Display-Name",s.dispname),n.add("Notification-Enabled",s.enabled?"True":"False"),n.add("Notification-Icon",s.icon),n.newline()}),n.send(i)};Ce.prototype.notify=function(e,t,r){var i=this,n;if(!this.registered){this.register(this.appname,function(s){s&&console.log(s),i.notify.call(i,e,t,r)});return}t=t||{},typeof t=="function"&&(r=t,t={}),n=new wi("NOTIFY",{host:this.host,port:this.port}),n.add("Application-Name",this.appname),n.add("Notification-Name",t.label||this.labels[0]),n.add("Notification-ID",++this.count),n.add("Notification-Title",t.title),n.add("Notification-Text",e),n.add("Notification-Sticky",t.sticky?"True":"False"),n.add("Notification-Priority",t.priority),n.add("Notification-Icon",t.icon),n.add("Notification-Coalescing-ID",t.coalescingId||void 0),n.add("Notification-Callback-Context",r?"context":void 0),n.add("Notification-Callback-Context-Type",r?"string":void 0),n.add("Notification-Callback-Target",void 0),n.newline(),n.send(function(s,o){r&&s?r(s):r&&o.state==="CALLBACK"&&r(void 0,o["Notification-Callback-Result"].toLowerCase())})};gi.exports=new Ce});var Ye=R((Hc,Si)=>{a();var vs=Dt(),Je=he(),Te=Ei(),Ni=E("events").EventEmitter,Ns=E("util"),Ss="Couldn't connect to growl (might be used as a fallback). Make sure it is running";Si.exports=Re;var vi;function Re(e){if(e=Je.clone(e||{}),!(this instanceof Re))return new Re(e);Te.appname=e.name||"Node",this.options=e,Ni.call(this)}Ns.inherits(Re,Ni);function _s(e,t){if(Te.setHost(this.options.host,this.options.port),e=Je.clone(e||{}),typeof e=="string"&&(e={title:"node-notifier",message:e}),t=Je.actionJackerDecorator(this,e,t,function(r){return r==="click"?"click":r==="timedout"?"timeout":!1}),e=Je.mapToGrowl(e),!e.message)return t(new Error("Message is required.")),this;if(e.title=e.title||"Node Notification:",vi||e.wait){let r=e.wait?t:xs;return Te.notify(e.message,e,r),e.wait||t(),this}return vs(Te,function(r,i){if(vi=i,!i)return t(new Error(Ss));Te.notify(e.message,e),t()}),this}Object.defineProperty(Re.prototype,"notify",{get:function(){return this._notify||(this._notify=_s.bind(this)),this._notify}});function xs(){}});var Di=R((Kc,Ii)=>{a();var me=he(),Is=Ye(),Ds=E("path"),As=Ds.join(__dirname,"../vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier"),xi=E("events").EventEmitter,Cs=E("util"),Ts="You need Mac OS X 10.8 or above to use NotificationCenter, or use Growl fallback with constructor option {withFallback: true}.";Ii.exports=be;function be(e){if(e=me.clone(e||{}),!(this instanceof be))return new be(e);this.options=e,xi.call(this)}Cs.inherits(be,xi);var _i=null;function Rs(){}function bs(e,t){let r,i=ks();if(e=me.clone(e||{}),_i=i,typeof e=="string"&&(e={title:"node-notifier",message:e}),t=t||Rs,typeof t!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof fn);let n=me.actionJackerDecorator(this,e,t,function(o){return _i!==i?!1:o==="activate"?"click":o==="timeout"?"timeout":o==="replied"?"replied":!1});if(e=me.mapToMac(e),!e.message&&!e.group&&!e.list&&!e.remove)return t(new Error("Message, group, remove or list property is required.")),this;let s=me.constructArgumentList(e);return me.isMountainLion()?(me.fileCommandJson(this.options.customPath||As,s,n),this):r||this.options.withFallback?(r=r||new Is(this.options),r.notify(e,t)):(t(new Error(Ts)),this)}Object.defineProperty(be.prototype,"notify",{get:function(){return this._notify||(this._notify=bs.bind(this)),this._notify}});function ks(){return{_ref:"val"}}});var At=R((Jc,Ri)=>{a();var Ls=E("path"),Os=Ls.resolve(__dirname,"../vendor/notifu/notifu"),qs=Dt(),te=he(),Fs=Ct(),Ai=Ye(),Us=E("os"),Ti=E("events").EventEmitter,Ps=E("util"),Ve;Ri.exports=ke;function ke(e){if(e=te.clone(e||{}),!(this instanceof ke))return new ke(e);this.options=e,Ti.call(this)}Ps.inherits(ke,Ti);function Ms(){}function Ws(e,t){let r,i=this.options;e=te.clone(e||{}),t=t||Ms,typeof e=="string"&&(e={title:"node-notifier",message:e});let n=te.actionJackerDecorator(this,e,t,function(s){return s==="activate"?"click":s==="timeout"?"timeout":!1});return this.options.withFallback&&te.isWin8()?(r=r||new Fs(i),r.notify(e,t)):this.options.withFallback&&(!te.isLessThanWin8()||Ve===!0)?(r=r||new Ai(i),r.notify(e,t)):!this.options.withFallback||Ve===!1?(Ci(e,i,n),this):(qs(i,function(s,o){if(Ve=o,Ve)return r=r||new Ai(i),r.notify(e,t);Ci(e,i,n)}),this)}Object.defineProperty(ke.prototype,"notify",{get:function(){return this._notify||(this._notify=Ws.bind(this)),this._notify}});var Gs=["t","d","p","m","i","e","q","w","xp"];function Ci(e,t,r){let i=Us.arch()==="x64";e=e||{},e=te.mapToNotifu(e),e.p=e.p||"Node Notification:";let n=Os+(i?"64":"")+".exe",s=t.customPath||n;if(!e.m)return r(new Error("Message is required.")),this;let o=te.constructArgumentList(e,{wrapper:"",noEscape:!0,explicitTrue:!0,allowedArguments:Gs});if(e.wait)return te.fileCommand(s,o,function(c,f){let l=Bs(c.code);return l==="error"?r(c,f):r(null,l)});te.immediateFileCommand(s,o,r)}function Bs(e){switch(e){case 2:return"timeout";case 3:case 6:case 7:return"activate";case 4:return"close";default:return"error"}}});import js from"crypto";function Le(){return Xe>Ze.length-16&&(js.randomFillSync(Ze),Xe=0),Ze.slice(Xe,Xe+=16)}var Ze,Xe,Tt=O(()=>{a();Ze=new Uint8Array(256),Xe=Ze.length});var bi,ki=O(()=>{a();bi=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function Hs(e){return typeof e=="string"&&bi.test(e)}var oe,Oe=O(()=>{a();ki();oe=Hs});function $s(e,t=0){let r=(b[e[t+0]]+b[e[t+1]]+b[e[t+2]]+b[e[t+3]]+"-"+b[e[t+4]]+b[e[t+5]]+"-"+b[e[t+6]]+b[e[t+7]]+"-"+b[e[t+8]]+b[e[t+9]]+"-"+b[e[t+10]]+b[e[t+11]]+b[e[t+12]]+b[e[t+13]]+b[e[t+14]]+b[e[t+15]]).toLowerCase();if(!oe(r))throw TypeError("Stringified UUID is invalid");return r}var b,ae,qe=O(()=>{a();Oe();b=[];for(let e=0;e<256;++e)b.push((e+256).toString(16).substr(1));ae=$s});function Ks(e,t,r){let i=t&&r||0,n=t||new Array(16);e=e||{};let s=e.node||Li,o=e.clockseq!==void 0?e.clockseq:Rt;if(s==null||o==null){let m=e.random||(e.rng||Le)();s==null&&(s=Li=[m[0]|1,m[1],m[2],m[3],m[4],m[5]]),o==null&&(o=Rt=(m[6]<<8|m[7])&16383)}let c=e.msecs!==void 0?e.msecs:Date.now(),f=e.nsecs!==void 0?e.nsecs:kt+1,l=c-bt+(f-kt)/1e4;if(l<0&&e.clockseq===void 0&&(o=o+1&16383),(l<0||c>bt)&&e.nsecs===void 0&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");bt=c,kt=f,Rt=o,c+=122192928e5;let u=((c&268435455)*1e4+f)%4294967296;n[i++]=u>>>24&255,n[i++]=u>>>16&255,n[i++]=u>>>8&255,n[i++]=u&255;let w=c/4294967296*1e4&268435455;n[i++]=w>>>8&255,n[i++]=w&255,n[i++]=w>>>24&15|16,n[i++]=w>>>16&255,n[i++]=o>>>8|128,n[i++]=o&255;for(let m=0;m<6;++m)n[i+m]=s[m];return t||ae(n)}var Li,Rt,bt,kt,Oi,qi=O(()=>{a();Tt();qe();bt=0,kt=0;Oi=Ks});function zs(e){if(!oe(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var Qe,Lt=O(()=>{a();Oe();Qe=zs});function Js(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}function et(e,t,r){function i(n,s,o,c){if(typeof n=="string"&&(n=Js(n)),typeof s=="string"&&(s=Qe(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+n.length);if(f.set(s),f.set(n,s.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,o){c=c||0;for(let l=0;l<16;++l)o[c+l]=f[l];return o}return ae(f)}try{i.name=e}catch{}return i.DNS=Ys,i.URL=Vs,i}var Ys,Vs,Ot=O(()=>{a();qe();Lt();Ys="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Vs="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});import Xs from"crypto";function Zs(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),Xs.createHash("md5").update(e).digest()}var Fi,Ui=O(()=>{a();Fi=Zs});var Qs,Pi,Mi=O(()=>{a();Ot();Ui();Qs=et("v3",48,Fi),Pi=Qs});function eo(e,t,r){e=e||{};let i=e.random||(e.rng||Le)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return ae(i)}var Wi,Gi=O(()=>{a();Tt();qe();Wi=eo});import to from"crypto";function ro(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),to.createHash("sha1").update(e).digest()}var Bi,ji=O(()=>{a();Bi=ro});var io,Hi,$i=O(()=>{a();Ot();ji();io=et("v5",80,Bi),Hi=io});var Ki,zi=O(()=>{a();Ki="00000000-0000-0000-0000-000000000000"});function no(e){if(!oe(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}var Ji,Yi=O(()=>{a();Oe();Ji=no});var Vi={};pn(Vi,{NIL:()=>Ki,parse:()=>Qe,stringify:()=>ae,v1:()=>Oi,v3:()=>Pi,v4:()=>Wi,v5:()=>Hi,validate:()=>oe,version:()=>Ji});var Xi=O(()=>{a();qi();Mi();Gi();$i();zi();Yi();Oe();qe();Lt()});var Ct=R((Zf,Qi)=>{a();var so=E("path"),oo=so.resolve(__dirname,"../vendor/snoreToast/snoretoast"),V=he(),ao=At(),co=E("os"),{v4:fo}=(Xi(),yn(Vi)),Zi=E("events").EventEmitter,lo=E("util"),qt,uo="notifierPipe",ho="\\\\.\\pipe\\",mo="/tmp/";Qi.exports=Fe;function Fe(e){if(e=V.clone(e||{}),!(this instanceof Fe))return new Fe(e);this.options=e,Zi.call(this)}lo.inherits(Fe,Zi);function po(){}function yo(e){return e?e.split(";").reduce((t,r)=>{let i=r.split("=");return i&&i.length===2&&(t[i[0]]=i[1]),t},{}):{}}function wo(){return`${V.isWSL()?mo:ho}${uo}-${fo()}`}function go(e,t){e=V.clone(e||{}),t=t||po;let r=co.arch()==="x64",i,n={namedPipe:wo()};if(typeof e=="string"&&(e={title:"node-notifier",message:e}),typeof t!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof fn);let s=(c,f)=>{let l=yo(i&&i.toString("utf16le"));l.action==="buttonClicked"&&l.button?l.activationType=l.button:l.action&&(l.activationType=l.action),c&&c.code===-1&&f(c,l),f(null,l),n.instance&&n.instance.close()},o=c=>s(c,V.actionJackerDecorator(this,e,t,f=>f==="activate"?"click":f||!1));return e.title=e.title||"Node Notification:",typeof e.message>"u"&&typeof e.close>"u"?(t(new Error("Message or ID to close is required.")),this):!V.isWin8()&&!V.isWSL()&&this.options.withFallback?(qt=qt||new ao(this.options),qt.notify(e,t)):(V.createNamedPipe(n).then(c=>{i=c,e.pipeName=n.namedPipe;let f=e.customPath||this.options.customPath||oo+"-x"+(r?"64":"86")+".exe";e=V.mapToWin8(e);let l=V.constructArgumentList(e,{explicitTrue:!0,wrapper:"",keepNewlines:!0,noEscape:!0});V.fileCommand(f,l,o)}),this)}Object.defineProperty(Fe.prototype,"notify",{get:function(){return this._notify||(this._notify=go.bind(this)),this._notify}})});var rn=R((el,A)=>{a();var en=E("os"),tn=he(),Ue=ui(),Ft=Di(),Pe=Ct(),Ut=Ye(),Pt=At(),pe={withFallback:!0},Eo=tn.isWSL()?"WSL":en.type();switch(Eo){case"Linux":A.exports=new Ue(pe),A.exports.Notification=Ue;break;case"Darwin":A.exports=new Ft(pe),A.exports.Notification=Ft;break;case"Windows_NT":tn.isLessThanWin8()?(A.exports=new Pt(pe),A.exports.Notification=Pt):(A.exports=new Pe(pe),A.exports.Notification=Pe);break;case"WSL":A.exports=new Pe(pe),A.exports.Notification=Pe;break;default:en.type().match(/BSD$/)?(A.exports=new Ue(pe),A.exports.Notification=Ue):(A.exports=new Ut(pe),A.exports.Notification=Ut)}A.exports.NotifySend=Ue;A.exports.NotificationCenter=Ft;A.exports.WindowsToaster=Pe;A.exports.WindowsBalloon=Pt;A.exports.Growl=Ut});a();var an=We(En(),1),ce=We(wn(),1);import on from"node:path";a();import{EventEmitter as Cn}from"node:events";import wt from"node:fs";import we from"node:path";a();import Nn from"node:os";var or=300,ne=20,ve=1e7,ar=Nn.platform();var Sn=ar==="darwin",nt=ar==="win32",se=Sn||nt,cr=3e3,fr=2e4,st=1250;a();var z;(function(e){e[e.DIR=1]="DIR",e[e.FILE=2]="FILE"})(z||(z={}));var le;(function(e){e.CHANGE="change",e.RENAME="rename"})(le||(le={}));var Ne;(function(e){e.CHANGE="change",e.ERROR="error"})(Ne||(Ne={}));var d;(function(e){e.ADD="add",e.ADD_DIR="addDir",e.CHANGE="change",e.RENAME="rename",e.RENAME_DIR="renameDir",e.UNLINK="unlink",e.UNLINK_DIR="unlinkDir"})(d||(d={}));var q;(function(e){e.ALL="all",e.CLOSE="close",e.ERROR="error",e.READY="ready"})(q||(q={}));a();a();a();var _n=(e,t=1,r)=>{t=Math.max(1,t);let i=r?.leading??!1,n=r?.trailing??!0,s=Math.max(r?.maxWait??1/0,t),o,c,f=0,l=0,u=()=>{let S=Date.now(),M=S-f,ie=S-l,fe=M>=t||ie>=s;return[S,fe]},w=S=>{if(l=S,!o)return;let M=o;o=void 0,e.apply(void 0,M)},m=()=>{k(0)},h=()=>{c&&(m(),w(Date.now()))},I=S=>{if(l=S,i)return w(S)},C=S=>{if(n&&o)return w(S);o=void 0},P=()=>{c=void 0;let[S,M]=u();return M?C(S):re(S)},re=S=>{let M=S-f,ie=S-l,fe=t-M,Me=s-ie,j=Math.min(fe,Me);return k(j)},k=S=>{c&&clearTimeout(c),!(S<=0)&&(c=setTimeout(P,S))},B=(...S)=>{let[M,ie]=u(),fe=!!c;if(o=S,f=M,(ie||!c)&&k(t),ie)return fe?w(M):I(M)};return B.cancel=m,B.flush=h,B},Be=_n;a();import Nr from"node:fs";import ft from"node:path";a();import N from"node:fs";import{promisify as L}from"node:util";a();var Z=(e,t)=>function(...i){return e.apply(void 0,i).catch(t)},J=(e,t)=>function(...i){try{return e.apply(void 0,i)}catch(n){return t(n)}};a();import lr from"node:process";var ur=lr.getuid?!lr.getuid():!1,hr=1e4,U=()=>{};a();var Se={isChangeErrorOk:e=>{if(!Se.isNodeError(e))return!1;let{code:t}=e;return t==="ENOSYS"||!ur&&(t==="EINVAL"||t==="EPERM")},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!Se.isNodeError(e))return!1;let{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},onChangeError:e=>{if(!Se.isNodeError(e))throw e;if(!Se.isChangeErrorOk(e))throw e}},x=Se;a();a();var ot=class{constructor(){this.interval=25,this.intervalId=void 0,this.limit=hr,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=t=>{this.queueWaiting.add(t),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=t=>{this.queueWaiting.delete(t),this.queueActive.delete(t)},this.schedule=()=>new Promise(t=>{let r=()=>this.remove(i),i=()=>t(r);this.add(i)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(let t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t),this.queueActive.add(t),t()}}}}},dr=new ot;var Q=(e,t)=>function(i){return function n(...s){return dr.schedule().then(o=>{let c=l=>(o(),l),f=l=>{if(o(),Date.now()>=i)throw l;if(t(l)){let u=Math.round(100*Math.random());return new Promise(m=>setTimeout(m,u)).then(()=>n.apply(void 0,s))}throw l};return e.apply(void 0,s).then(c,f)})}},ee=(e,t)=>function(i){return function n(...s){try{return e.apply(void 0,s)}catch(o){if(Date.now()>i)throw o;if(t(o))return n.apply(void 0,s);throw o}}};var xn={attempt:{chmod:Z(L(N.chmod),x.onChangeError),chown:Z(L(N.chown),x.onChangeError),close:Z(L(N.close),U),fsync:Z(L(N.fsync),U),mkdir:Z(L(N.mkdir),U),realpath:Z(L(N.realpath),U),stat:Z(L(N.stat),U),unlink:Z(L(N.unlink),U),chmodSync:J(N.chmodSync,x.onChangeError),chownSync:J(N.chownSync,x.onChangeError),closeSync:J(N.closeSync,U),existsSync:J(N.existsSync,U),fsyncSync:J(N.fsync,U),mkdirSync:J(N.mkdirSync,U),realpathSync:J(N.realpathSync,U),statSync:J(N.statSync,U),unlinkSync:J(N.unlinkSync,U)},retry:{close:Q(L(N.close),x.isRetriableError),fsync:Q(L(N.fsync),x.isRetriableError),open:Q(L(N.open),x.isRetriableError),readFile:Q(L(N.readFile),x.isRetriableError),rename:Q(L(N.rename),x.isRetriableError),stat:Q(L(N.stat),x.isRetriableError),write:Q(L(N.write),x.isRetriableError),writeFile:Q(L(N.writeFile),x.isRetriableError),closeSync:ee(N.closeSync,x.isRetriableError),fsyncSync:ee(N.fsyncSync,x.isRetriableError),openSync:ee(N.openSync,x.isRetriableError),readFileSync:ee(N.readFileSync,x.isRetriableError),renameSync:ee(N.renameSync,x.isRetriableError),statSync:ee(N.statSync,x.isRetriableError),writeSync:ee(N.writeSync,x.isRetriableError),writeFileSync:ee(N.writeFileSync,x.isRetriableError)}},mr=xn;a();import ct from"node:fs";import je from"node:path";a();a();a();var at=()=>{};var In=()=>{let e=at,t=at,r=!1,i=!1;return{promise:new Promise((f,l)=>{e=u=>(r=!0,f(u)),t=u=>(i=!0,l(u))}),resolve:e,reject:t,isPending:()=>!r&&!i,isResolved:()=>r,isRejected:()=>i}},pr=In;var Dn=()=>{let{promise:e,resolve:t,isPending:r}=pr(),i=0,n=()=>{i+=1},s=()=>{i-=1,!i&&t()};return(()=>{n(),queueMicrotask(s)})(),{promise:e,isPending:r,increment:n,decrement:s}},yr=Dn;a();var wr={then:e=>{e()}};a();var gr=e=>Array.isArray(e)?e:[e],Er=e=>typeof e=="function";var An=(e,t)=>{let r=t?.followSymlinks??!1,i=t?.depth??1/0,n=t?.limit??1/0,s=t?.ignore??[],o=gr(s).map(g=>Er(g)?g:y=>g.test(y)),c=g=>o.some(y=>y(g)),f=t?.signal??{aborted:!1},l=t?.onDirents||(()=>{}),u=[],w=new Set,m={},h=[],I=new Set,C={},P=[],re=new Set,k={},B={},S=new Set,M={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{},map:{}},ie={directories:u,directoriesNames:w,directoriesNamesToPaths:m,files:h,filesNames:I,filesNamesToPaths:C,symlinks:P,symlinksNames:re,symlinksNamesToPaths:k,map:B},{promise:fe,increment:Me,decrement:j}=yr(),X=0,Mt=(g,y,v,_)=>{S.has(y)||X>=n||(X+=1,g.directories.push(y),g.directoriesNames.add(v),u.push(y),w.add(v),m.propertyIsEnumerable(v)||(m[v]=[]),m[v].push(y),S.add(y),!(_>=i)&&(X>=n||Bt(y,_+1)))},Wt=(g,y,v)=>{S.has(y)||X>=n||(X+=1,g.files.push(y),g.filesNames.add(v),h.push(y),I.add(v),C.propertyIsEnumerable(v)||(C[v]=[]),C[v].push(y),S.add(y))},Gt=(g,y,v,_)=>{S.has(y)||X>=n||(X+=1,g.symlinks.push(y),g.symlinksNames.add(v),P.push(y),re.add(v),k.propertyIsEnumerable(v)||(k[v]=[]),k[v].push(y),S.add(y),r&&(_>=i||X>=n||dn(y,_+1)))},ln=(g,y,v,_,H)=>{f.aborted||c(y)||(_.isDirectory()?Mt(g,y,v,H):_.isFile()?Wt(g,y,v):_.isSymbolicLink()&&Gt(g,y,v,H))},un=(g,y,v,_)=>{if(f.aborted)return;let H=y===je.sep?"":je.sep,K=v.name,ye=`${y}${H}${K}`;c(ye)||(v.isDirectory()?Mt(g,ye,K,_):v.isFile()?Wt(g,ye,K):v.isSymbolicLink()&&Gt(g,ye,K,_))},hn=(g,y,v,_)=>{for(let H=0,K=v.length;H<K;H++)un(g,y,v[H],_)},Bt=(g,y)=>{f.aborted||y>i||X>=n||(Me(),ct.readdir(g,{withFileTypes:!0},(v,_)=>{if(v||f.aborted||!_.length)return j();(l(_)||wr).then(()=>{let K=B[g]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};hn(K,g,_,y),j()})}))},dn=(g,y)=>{Me(),ct.realpath(g,(v,_)=>{if(v||f.aborted)return j();ct.stat(_,(H,K)=>{if(H||f.aborted)return j();let ye=je.basename(_),mn=B[g]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};ln(mn,_,ye,K,y),j()})})};return(async(g,y=1)=>(g=je.normalize(g),S.add(g),Bt(g,y),await fe,f.aborted?M:ie))(e)},vr=An;var Y={lang:{debounce:Be,attempt:e=>{try{return e()}catch(t){return Y.lang.castError(t)}},castArray:e=>Y.lang.isArray(e)?e:[e],castError:e=>Y.lang.isError(e)?e:Y.lang.isString(e)?new Error(e):new Error("Unknown error"),defer:e=>setTimeout(e,0),isArray:e=>Array.isArray(e),isError:e=>e instanceof Error,isFunction:e=>typeof e=="function",isNaN:e=>Number.isNaN(e),isNumber:e=>typeof e=="number",isPrimitive:e=>{if(e===null)return!0;let t=typeof e;return t!=="object"&&t!=="function"},isShallowEqual:(e,t)=>{if(e===t)return!0;if(Y.lang.isNaN(e))return Y.lang.isNaN(t);if(Y.lang.isPrimitive(e)||Y.lang.isPrimitive(t))return e===t;for(let r in e)if(!(r in t))return!1;for(let r in t)if(e[r]!==t[r])return!1;return!0},isSet:e=>e instanceof Set,isString:e=>typeof e=="string",isUndefined:e=>e===void 0,noop:()=>{},uniq:e=>e.length<2?e:Array.from(new Set(e))},fs:{getDepth:e=>Math.max(0,e.split(ft.sep).length-1),getRealPath:(e,t)=>{try{return t?Nr.realpathSync.native(e):Nr.realpathSync(e)}catch{return}},isSubPath:(e,t)=>t.startsWith(e)&&t[e.length]===ft.sep&&t.length-e.length>ft.sep.length,poll:(e,t=fr)=>mr.retry.stat(t)(e,{bigint:!0}).catch(Y.lang.noop),readdir:async(e,t,r=1/0,i=1/0,n,s)=>{if(s&&r===1&&e in s){let o=s[e];return[o.directories,o.files]}else{let o=await vr(e,{depth:r,limit:i,ignore:t,signal:n});return[o.directories,o.files]}}}},p=Y;a();import lt from"node:path";var ut=class{constructor(t,r,i){this.base=i,this.watcher=t,this.handler=r.handler,this.fswatcher=r.watcher,this.options=r.options,this.folderPath=r.folderPath,this.filePath=r.filePath,this.handlerBatched=this.base?this.base.onWatcherEvent.bind(this.base):this._makeHandlerBatched(this.options.debounce)}_isSubRoot(t){return this.filePath?t===this.filePath:t===this.folderPath||p.fs.isSubPath(this.folderPath,t)}_makeHandlerBatched(t=or){return(()=>{let r=this.watcher._readyWait,i=[],n=new Set,s=async(c,f)=>{let l=this.options.ignoreInitial?[]:c,u=await this.eventsPopulate([...f]),w=this.eventsDeduplicate([...l,...u]);this.onTargetEvents(w)},o=p.lang.debounce(()=>{this.watcher.isClosed()||(r=s(i,n),i=[],n=new Set)},t);return async(c,f="",l=!1)=>{l?await this.eventsPopulate([f],i,!0):n.add(f),r.then(o)}})()}eventsDeduplicate(t){if(t.length<2)return t;let r={};return t.reduce((i,n)=>{let[s,o]=n,c=r[o];return s===c||s===d.CHANGE&&c===d.ADD||(r[o]=s,i.push(n)),i},[])}async eventsPopulate(t,r=[],i=!1){return await Promise.all(t.map(async n=>{let s=await this.watcher._poller.update(n,this.options.pollingTimeout);await Promise.all(s.map(async o=>{r.push([o,n]),o===d.ADD_DIR?await this.eventsPopulateAddDir(t,n,r,i):o===d.UNLINK_DIR&&await this.eventsPopulateUnlinkDir(t,n,r,i)}))})),r}async eventsPopulateAddDir(t,r,i=[],n=!1){if(n)return i;let s=this.options.recursive?this.options.depth??ne:Math.min(1,this.options.depth??ne),o=this.options.limit??ve,[c,f]=await p.fs.readdir(r,this.options.ignore,s,o,this.watcher._closeSignal),l=[...c,...f];return await Promise.all(l.map(u=>{if(!this.watcher.isIgnored(u,this.options.ignore)&&!t.includes(u))return this.eventsPopulate([u],i,!0)})),i}async eventsPopulateUnlinkDir(t,r,i=[],n=!1){if(n)return i;for(let s of this.watcher._poller.stats.keys())p.fs.isSubPath(r,s)&&(t.includes(s)||await this.eventsPopulate([s],i,!0));return i}onTargetAdd(t){this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAdd(t,this.options.renameTimeout):this.watcher.event(d.ADD,t))}onTargetAddDir(t){t!==this.folderPath&&this.options.recursive&&!se&&this.options.native!==!1&&this.watcher.watchDirectory(t,this.options,this.handler,void 0,this.base||this),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAddDir(t,this.options.renameTimeout):this.watcher.event(d.ADD_DIR,t))}onTargetChange(t){this._isSubRoot(t)&&this.watcher.event(d.CHANGE,t)}onTargetUnlink(t){this.watcher.watchersClose(lt.dirname(t),t,!1),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlink(t,this.options.renameTimeout):this.watcher.event(d.UNLINK,t))}onTargetUnlinkDir(t){this.watcher.watchersClose(lt.dirname(t),t,!1),this.watcher.watchersClose(t),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlinkDir(t,this.options.renameTimeout):this.watcher.event(d.UNLINK_DIR,t))}onTargetEvent(t){let[r,i]=t;r===d.ADD?this.onTargetAdd(i):r===d.ADD_DIR?this.onTargetAddDir(i):r===d.CHANGE?this.onTargetChange(i):r===d.UNLINK?this.onTargetUnlink(i):r===d.UNLINK_DIR&&this.onTargetUnlinkDir(i)}onTargetEvents(t){for(let r of t)this.onTargetEvent(r)}onWatcherEvent(t,r,i=!1){return this.handlerBatched(t,r,i)}onWatcherChange(t=le.CHANGE,r){if(this.watcher.isClosed())return;let i=lt.resolve(this.folderPath,r||"");this.filePath&&i!==this.folderPath&&i!==this.filePath||this.watcher.isIgnored(i,this.options.ignore)||this.onWatcherEvent(t,i)}onWatcherError(t){nt&&t.code==="EPERM"?this.onWatcherChange(le.CHANGE,""):this.watcher.error(t)}async init(){await this.initWatcherEvents(),await this.initInitialEvents()}async initWatcherEvents(){let t=this.onWatcherChange.bind(this);this.fswatcher.on(Ne.CHANGE,t);let r=this.onWatcherError.bind(this);this.fswatcher.on(Ne.ERROR,r)}async initInitialEvents(){let t=!this.watcher.isReady();if(this.filePath){if(this.watcher._poller.stats.has(this.filePath))return;await this.onWatcherEvent(le.CHANGE,this.filePath,t)}else{let r=this.options.recursive&&se&&this.options.native!==!1?this.options.depth??ne:Math.min(1,this.options.depth??ne),i=this.options.limit??ve,[n,s]=await p.fs.readdir(this.folderPath,this.options.ignore,r,i,this.watcher._closeSignal,this.options.readdirMap),o=[this.folderPath,...n,...s];await Promise.all(o.map(c=>{if(!this.watcher._poller.stats.has(c)&&!this.watcher.isIgnored(c,this.options.ignore))return this.onWatcherEvent(le.CHANGE,c,t)}))}}},Sr=ut;a();a();var F={interval:100,intervalId:void 0,fns:new Map,init:()=>{F.intervalId||(F.intervalId=setInterval(F.resolve,F.interval))},reset:()=>{F.intervalId&&(clearInterval(F.intervalId),delete F.intervalId)},add:(e,t)=>{F.fns.set(e,Date.now()+t),F.init()},remove:e=>{F.fns.delete(e)},resolve:()=>{if(!F.fns.size)return F.reset();let e=Date.now();for(let[t,r]of F.fns)r>=e||(F.remove(t),t())}},_e=F;var xe=class e{constructor(t){this._watcher=t,this.reset()}getLockAdd(t,r=st){let{ino:i,targetPath:n,events:s,locks:o}=t,c=()=>{let w=this._watcher._poller.paths.find(i||-1,m=>m!==n);if(w&&w!==n){if(p.fs.getRealPath(n,!0)===w)return;this._watcher.event(s.rename,w,n)}else this._watcher.event(s.add,n)};if(!i)return c();let f=()=>{o.add.delete(i),_e.remove(l)},l=()=>{f(),c()};_e.add(l,r);let u=()=>{let w=o.unlink.get(i);if(!w)return;f();let m=w();n===m?s.change&&this._watcher._poller.stats.has(n)&&this._watcher.event(s.change,n):this._watcher.event(s.rename,m,n)};o.add.set(i,u),u()}getLockUnlink(t,r=st){let{ino:i,targetPath:n,events:s,locks:o}=t,c=()=>{this._watcher.event(s.unlink,n)};if(!i)return c();let f=()=>{o.unlink.delete(i),_e.remove(l)},l=()=>{f(),c()};_e.add(l,r);let u=()=>(f(),n);o.unlink.set(i,u),o.add.get(i)?.()}getLockTargetAdd(t,r){let i=this._watcher._poller.getIno(t,d.ADD,z.FILE);return this.getLockAdd({ino:i,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetAddDir(t,r){let i=this._watcher._poller.getIno(t,d.ADD_DIR,z.DIR);return this.getLockAdd({ino:i,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}getLockTargetUnlink(t,r){let i=this._watcher._poller.getIno(t,d.UNLINK,z.FILE);return this.getLockUnlink({ino:i,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetUnlinkDir(t,r){let i=this._watcher._poller.getIno(t,d.UNLINK_DIR,z.DIR);return this.getLockUnlink({ino:i,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}reset(){this._locksAdd=new Map,this._locksAddDir=new Map,this._locksUnlink=new Map,this._locksUnlinkDir=new Map,this._locksDir={add:this._locksAddDir,unlink:this._locksUnlinkDir},this._locksFile={add:this._locksAdd,unlink:this._locksUnlink}}};xe.DIR_EVENTS={add:d.ADD_DIR,rename:d.RENAME_DIR,unlink:d.UNLINK_DIR};xe.FILE_EVENTS={add:d.ADD,change:d.CHANGE,rename:d.RENAME,unlink:d.UNLINK};var _r=xe;a();a();var ht=class{constructor(){this.map=new Map}clear(){this.map.clear()}delete(t,r){if(p.lang.isUndefined(r))return this.map.delete(t);if(this.map.has(t)){let i=this.map.get(t);if(p.lang.isSet(i)){let n=i.delete(r);return i.size||this.map.delete(t),n}else if(i===r)return this.map.delete(t),!0}return!1}find(t,r){if(this.map.has(t)){let i=this.map.get(t);if(p.lang.isSet(i))return Array.from(i).find(r);if(r(i))return i}}get(t){return this.map.get(t)}has(t,r){if(p.lang.isUndefined(r))return this.map.has(t);if(this.map.has(t)){let i=this.map.get(t);return p.lang.isSet(i)?i.has(r):i===r}return!1}set(t,r){if(this.map.has(t)){let i=this.map.get(t);p.lang.isSet(i)?i.add(r):i!==r&&this.map.set(t,new Set([i,r]))}else this.map.set(t,r);return this}},dt=ht;a();var mt=class{constructor(t){this.ino=t.ino<=Number.MAX_SAFE_INTEGER?Number(t.ino):t.ino,this.size=Number(t.size),this.atimeMs=Number(t.atimeMs),this.mtimeMs=Number(t.mtimeMs),this.ctimeMs=Number(t.ctimeMs),this.birthtimeMs=Number(t.birthtimeMs),this._isFile=t.isFile(),this._isDirectory=t.isDirectory(),this._isSymbolicLink=t.isSymbolicLink()}isFile(){return this._isFile}isDirectory(){return this._isDirectory}isSymbolicLink(){return this._isSymbolicLink}},xr=mt;var pt=class{constructor(){this.inos={},this.paths=new dt,this.stats=new Map}getIno(t,r,i){let n=this.inos[r];if(!n)return;let s=n[t];if(s&&!(i&&s[1]!==i))return s[0]}getStats(t){return this.stats.get(t)}async poll(t,r){let i=await p.fs.poll(t,r);if(!(!i||!(i.isFile()||i.isDirectory())))return new xr(i)}reset(){this.inos={},this.paths=new dt,this.stats=new Map}async update(t,r){let i=this.getStats(t),n=await this.poll(t,r);if(this.updateStats(t,n),!i&&n){if(n.isFile())return this.updateIno(t,d.ADD,n),[d.ADD];if(n.isDirectory())return this.updateIno(t,d.ADD_DIR,n),[d.ADD_DIR]}else if(i&&!n){if(i.isFile())return this.updateIno(t,d.UNLINK,i),[d.UNLINK];if(i.isDirectory())return this.updateIno(t,d.UNLINK_DIR,i),[d.UNLINK_DIR]}else if(i&&n){if(i.isFile()){if(n.isFile())return i.ino===n.ino&&!i.size&&!n.size?[]:(this.updateIno(t,d.CHANGE,n),[d.CHANGE]);if(n.isDirectory())return this.updateIno(t,d.UNLINK,i),this.updateIno(t,d.ADD_DIR,n),[d.UNLINK,d.ADD_DIR]}else if(i.isDirectory()){if(n.isFile())return this.updateIno(t,d.UNLINK_DIR,i),this.updateIno(t,d.ADD,n),[d.UNLINK_DIR,d.ADD];if(n.isDirectory())return i.ino===n.ino?[]:(this.updateIno(t,d.UNLINK_DIR,i),this.updateIno(t,d.ADD_DIR,n),[d.UNLINK_DIR,d.ADD_DIR])}}return[]}updateIno(t,r,i){let n=this.inos[r]=this.inos[r]||(this.inos[r]={}),s=i.isFile()?z.FILE:z.DIR;n[t]=[i.ino,s]}updateStats(t,r){if(r)this.paths.set(r.ino,t),this.stats.set(t,r);else{let i=this.stats.get(t)?.ino||-1;this.paths.delete(i,t),this.stats.delete(t)}}},yt=pt;var gt=class e extends Cn{constructor(t,r,i){super(),this._closed=!1,this._ready=!1,this._closeAborter=new AbortController,this._closeSignal=this._closeAborter.signal,this.on(q.CLOSE,()=>this._closeAborter.abort()),this._closeWait=new Promise(n=>this.on(q.CLOSE,n)),this._readyWait=new Promise(n=>this.on(q.READY,n)),this._locker=new _r(this),this._roots=new Set,this._poller=new yt,this._pollers=new Set,this._subwatchers=new Set,this._watchers={},this._watchersLock=Promise.resolve(),this._watchersRestorable={},this.watch(t,r,i)}isClosed(){return this._closed}isIgnored(t,r){return!!r&&(p.lang.isFunction(r)?!!r(t):r.test(t))}isReady(){return this._ready}close(){return this._locker.reset(),this._poller.reset(),this._roots.clear(),this.watchersClose(),this.isClosed()?!1:(this._closed=!0,this.emit(q.CLOSE))}error(t){if(this.isClosed())return!1;let r=p.lang.castError(t);return this.emit(q.ERROR,r)}event(t,r,i){return this.isClosed()?!1:(this.emit(q.ALL,t,r,i),this.emit(t,r,i))}ready(){return this.isClosed()||this.isReady()?!1:(this._ready=!0,this.emit(q.READY))}pollerExists(t,r){for(let i of this._pollers)if(i.targetPath===t&&p.lang.isShallowEqual(i.options,r))return!0;return!1}subwatcherExists(t,r){for(let i of this._subwatchers)if(i.targetPath===t&&p.lang.isShallowEqual(i.options,r))return!0;return!1}watchersClose(t,r,i=!0){if(t){let n=this._watchers[t];if(n)for(let s of[...n])r&&s.filePath!==r||this.watcherClose(s);if(i)for(let s in this._watchers)p.fs.isSubPath(t,s)&&this.watchersClose(s,r,!1)}else for(let n in this._watchers)this.watchersClose(n,r,!1)}watchersLock(t){return this._watchersLock.then(()=>this._watchersLock=new Promise(async r=>{await t(),r()}))}watchersRestore(){delete this._watchersRestoreTimeout;let t=Object.entries(this._watchersRestorable);this._watchersRestorable={};for(let[r,i]of t)this.watchPath(r,i.options,i.handler)}async watcherAdd(t,r){let{folderPath:i}=t;(this._watchers[i]=this._watchers[i]||[]).push(t);let s=new Sr(this,t,r);return await s.init(),s}watcherClose(t){t.watcher.close();let r=this._watchers[t.folderPath];if(r){let s=r.indexOf(t);r.splice(s,1),r.length||delete this._watchers[t.folderPath]}let i=t.filePath||t.folderPath;this._roots.has(i)&&(this._watchersRestorable[i]=t,this._watchersRestoreTimeout||(this._watchersRestoreTimeout=p.lang.defer(()=>this.watchersRestore())))}watcherExists(t,r,i,n){if(this._watchers[t]?.find(c=>c.handler===i&&(!c.filePath||c.filePath===n)&&c.options.ignore===r.ignore&&!!c.options.native==!!r.native&&(!r.recursive||c.options.recursive)))return!0;let o=we.dirname(t);for(let c=1;c<1/0;c++){if(this._watchers[o]?.find(u=>(c===1||u.options.recursive&&c<=(u.options.depth??ne))&&u.handler===i&&(!u.filePath||u.filePath===n)&&u.options.ignore===r.ignore&&!!u.options.native==!!r.native&&(!r.recursive||u.options.recursive&&se&&u.options.native!==!1)))return!0;if(!se)break;let l=we.dirname(t);if(o===l)break;o=l}return!1}async watchDirectories(t,r,i,n,s){if(this.isClosed())return;t=p.lang.uniq(t).sort();let o;for(let c of t)if(!this.isIgnored(c,r.ignore)&&!this.watcherExists(c,r,i,n))try{let f=!r.recursive||se&&r.native!==!1?r:{...r,recursive:!1},u={watcher:wt.watch(c,f),handler:i,options:r,folderPath:c,filePath:n},w=o=await this.watcherAdd(u,s);if(this._roots.has(n||c)){let h={...r,ignoreInitial:!0,recursive:!1},I=we.dirname(c),C=c;await this.watchDirectories([I],h,i,C,w)}}catch(f){this.error(f)}return o}async watchDirectory(t,r,i,n,s){if(!this.isClosed()&&!this.isIgnored(t,r.ignore)){if(!r.recursive||se&&r.native!==!1)return this.watchersLock(()=>this.watchDirectories([t],r,i,n,s));{r={...r,recursive:!0};let o=r.depth??ne,c=r.limit??ve,[f]=await p.fs.readdir(t,r.ignore,o,c,this._closeSignal,r.readdirMap);return this.watchersLock(async()=>{let l=await this.watchDirectories([t],r,i,n,s);if(f.length){let u=p.fs.getDepth(t);for(let w of f){let m=p.fs.getDepth(w),h=Math.max(0,o-(m-u)),I={...r,depth:h};await this.watchDirectories([w],I,i,n,s||l)}}})}}}async watchFileOnce(t,r,i){if(this.isClosed()||(r={...r,ignoreInitial:!1},this.subwatcherExists(t,r)))return;let n={targetPath:t,options:r},s=(l,u)=>{u===t&&(f(),i())},o=new e(s),c=()=>{this._subwatchers.add(n),this.on(q.CLOSE,f),o.watchFile(t,r,s)},f=()=>{this._subwatchers.delete(n),this.removeListener(q.CLOSE,f),o.close()};return c()}async watchFile(t,r,i){if(this.isClosed()||this.isIgnored(t,r.ignore))return;r={...r,recursive:!1};let n=we.dirname(t);return this.watchDirectory(n,r,i,t)}async watchPollingOnce(t,r,i){if(this.isClosed())return;let n=!1,s=new yt,o=await this.watchPolling(t,r,async()=>{n||!(await s.update(t,r.pollingTimeout)).length||n||(n=!0,o(),i())})}async watchPolling(t,r,i){if(this.isClosed())return p.lang.noop;if(this.pollerExists(t,r))return p.lang.noop;let n={...r,interval:r.pollingInterval??cr},s={targetPath:t,options:r},o=()=>{this._pollers.add(s),this.on(q.CLOSE,c),wt.watchFile(t,n,i)},c=()=>{this._pollers.delete(s),this.removeListener(q.CLOSE,c),wt.unwatchFile(t,i)};return p.lang.attempt(o),()=>p.lang.attempt(c)}async watchUnknownChild(t,r,i){if(this.isClosed())return;let n=()=>this.watchPath(t,r,i);return this.watchFileOnce(t,r,n)}async watchUnknownTarget(t,r,i){if(this.isClosed())return;let n=()=>this.watchPath(t,r,i);return this.watchPollingOnce(t,r,n)}async watchPaths(t,r,i){if(this.isClosed())return;if(t=p.lang.uniq(t).sort(),t.every((s,o)=>t.every((c,f)=>f===o||!p.fs.isSubPath(s,c))))await Promise.all(t.map(s=>this.watchPath(s,r,i)));else for(let s of t)await this.watchPath(s,r,i)}async watchPath(t,r,i){if(this.isClosed()||(t=we.resolve(t),this.isIgnored(t,r.ignore)))return;let n=await p.fs.poll(t,r.pollingTimeout);if(n){if(n.isFile())return this.watchFile(t,r,i);if(n.isDirectory())return this.watchDirectory(t,r,i);this.error(`"${t}" is not supported`)}else{let s=we.dirname(t);return(await p.fs.poll(s,r.pollingTimeout))?.isDirectory()?this.watchUnknownChild(t,r,i):this.watchUnknownTarget(t,r,i)}}async watch(t,r,i=p.lang.noop){if(p.lang.isFunction(t))return this.watch([],{},t);if(p.lang.isUndefined(t))return this.watch([],r,i);if(p.lang.isFunction(r))return this.watch(t,{},r);if(p.lang.isUndefined(r))return this.watch(t,{},i);if(this.isClosed())return;this.isReady()&&(r.readdirMap=void 0);let n=p.lang.castArray(t);n.forEach(s=>this._roots.add(s)),await this.watchPaths(n,r,i),!this.isClosed()&&(i!==p.lang.noop&&this.on(q.ALL,i),r.readdirMap=void 0,this.ready())}},Ir=gt;var cn=We(zr(),1);a();var Et=(e,...t)=>{let r=Kt(e,...t);Ge.isInteractive?Ge.updateFooter(r):Ge.writeStdout(r)};a();var nn=We(rn(),1);var sn=(e,t)=>{e.log.info("notifying user",{notification:t}),nn.default.notify({title:"Gadget",contentImage:tt("favicon-128@4x.png"),icon:tt("favicon-128@4x.png"),sound:!0,timeout:!1,...t},r=>{r&&e.log.warn("error notifying user",{notification:t})})};var Al={...rr,...Xt,"--prefer":tr,"--file-push-delay":{type:Number,default:(0,ce.default)("100ms")},"--file-watch-debounce":{type:Number,default:(0,ce.default)("300ms")},"--file-watch-poll-interval":{type:Number,default:(0,ce.default)("3s")},"--file-watch-poll-timeout":{type:Number,default:(0,ce.default)("20s")},"--file-watch-rename-timeout":{type:Number,default:(0,ce.default)("1.25s")},"--no-logs":Boolean},Cl=e=>G`
4
+ Clones your Gadget environment's files to your local machine and keeps it in sync, in order to
5
+ enable local development with your text editor and source code with Git.
6
+
7
+ If your app's local directory already exists, this command first performs a sync to ensure
8
+ that your local and environment directories match, changes are tracked since last sync. If any
9
+ conflicts are detected, they must be resolved before development starts.
10
+
11
+ {gray Usage}
12
+ $ ggt dev [DIRECTORY] [options]
13
+
14
+ DIRECTORY: The directory to sync files to (default: the current directory)
15
+
16
+ {gray Options}
17
+ -a, --app <app_name> Selects the app to sync files with. Default set on ".gadget/sync.json"
18
+ -e, --env <env_name> Selects the environment to sync files with. Default set on ".gadget/sync.json"
19
+ --prefer <source> Auto-select changes from 'local' or 'environment' source on conflict
20
+ --allow-unknown-directory Syncs to any local directory with existing files, even if the ".gadget/sync.json" file is missing
21
+ --allow-different-app Syncs with a different app using the --app command, instead of the one specified in the .gadget/sync.json file
22
+ --log-level <level> Sets the log level for incoming application logs (default: info)
23
+ --no-logs Disables outputting application logs to the console
24
+ --my-logs Only outputs user sourced logs
25
+
26
+ {gray Ignoring files}
27
+ ggt dev uses a .ignore file, similar to .gitignore, to exclude specific files and
28
+ folders from syncing. These files are always ignored:
29
+
30
+ • .DS_Store
31
+ • .gadget
32
+ • .git
33
+ • node_modules
34
+
35
+ {gray Notes}
36
+ • "ggt dev" only works with development environments
37
+ • "ggt dev" only supports "yarn" v1 for installing dependencies
38
+ • Avoid deleting or moving all of your files while "ggt dev" is running
39
+
40
+ {gray Examples}
41
+ sync an app in a custom path
42
+ {cyanBright $ ggt dev ~/myGadgetApps/myBlog --app myBlogApp}
43
+
44
+ sync with a specific environment and preselect all local changes on conflicts
45
+ {cyanBright $ ggt dev --env main --prefer local}
46
+
47
+ sync a custom path with a specific app, environment and preselect all changes from local on conflicts
48
+ {cyanBright $ ggt dev ~/gadget/example --app=example --env=development --prefer=local}
49
+ `,Tl=async(e,t)=>{if(!await(0,cn.default)("yarn",{nothrow:!0}))throw new Vt;let r=await nr(t._[0]||process.cwd()),i=await ir.loadOrInit(e,{command:"dev",args:t,directory:r});Et({ensureEmptyLineAbove:!0,content:i.sprint()});let n=new sr(i),s=await n.hashes(e);if(!s.inSync)if(!i.previousEnvironment||s.localChangesToPush.size===0&&s.onlyDotGadgetFilesChanged)await n.merge(e,{hashes:s,printLocalChangesOptions:{limit:5},printEnvironmentChangesOptions:{limit:5}});else{await n.print(e,{hashes:s});let h=Object.values($);switch(await Qt({ensureEmptyLineAbove:!0,choices:s.bothChanged?h:h.filter(C=>C!==$.MERGE),content:jt.bold("What do you want to do?"),formatChoice:C=>{switch(C){case $.CANCEL:return G`Cancel (Ctrl+C)`;case $.MERGE:return G`Merge local and environment's changes`;case $.PUSH:switch(!0){case s.bothChanged:return G`Push local changes and {underline discard environment's} changes`;case s.localChanges.size>0:return G`Push local changes`;case s.environmentChanges.size>0:return G`Discard environment's changes`;default:return it("no changes to push or discard")}case $.PULL:switch(!0){case s.bothChanged:return G`Pull environment's changes and {underline discard local} changes`;case s.localChanges.size>0:return G`Discard local changes`;case s.environmentChanges.size>0:return G`Pull environment's changes`;default:return it("no changes to pull or discard")}}}})){case $.CANCEL:process.exit(0);break;case $.MERGE:await n.merge(e,{hashes:s});break;case $.PUSH:await n.push(e,{command:"dev",hashes:s,force:!0});break;case $.PULL:await n.pull(e,{hashes:s,force:!0});break}}let o=new Map,c=setInterval(()=>{for(let[h,I]of o)(0,an.default)().isAfter(I+(0,ce.default)("5s"))&&o.delete(h)},(0,ce.default)("1s")).unref(),f=n.subscribeToEnvironmentChanges(e,{onError:h=>e.abort(h),beforeChanges:({changed:h,deleted:I})=>{for(let C of[...h,...I]){o.set(C,Date.now());let P=on.dirname(C);for(;P!==".";)o.set(P+"/",Date.now()),P=on.dirname(P)}}}),l;t["--no-logs"]||(l=n.subscribeToEnvironmentLogs(t,{onError:h=>{e.abort(h)}}));let u=new rt,w=$t(t["--file-push-delay"],async()=>{try{let h=i.gitBranch;if(await i.loadGitBranch(),h!==i.gitBranch){zt({ensureEmptyLineAbove:!0,content:G`
50
+ Your git branch changed.
51
+
52
+ ${h} → ${i.gitBranch}
53
+ `});let C=er({ensureEmptyLineAbove:!0,content:"Waiting for file changes to settle."});await Zt("3s"),C.succeed()}let I=new rt(u.entries());u.clear(),await n.mergeChangesWithEnvironment(e,{changes:I})}catch(h){e.log.error("error sending changes to gadget",{error:h}),e.abort(h)}});e.log.debug("watching",{path:i.directory.path});let m=new Ir(i.directory.path,{ignoreInitial:!0,recursive:!0,ignore:h=>i.directory.relative(h).startsWith(".gadget")||i.directory.ignores(h),renameDetection:!0,renameTimeout:t["--file-watch-rename-timeout"],debounce:t["--file-watch-debounce"]},(h,I,C)=>{let P=h==="rename"||h==="renameDir"?C:I,re=h==="renameDir"||h==="addDir"||h==="unlinkDir",k=i.directory.normalize(P,re);if(e.log.trace("file event",{event:h,isDirectory:re,path:k}),P===i.directory.absolute(".ignore"))i.directory.loadIgnoreFile().catch(B=>e.abort(B));else if(i.directory.ignores(P))return;if(o.delete(k)){e.log.trace("ignoring event because we caused it",{event:h,path:k});return}switch(h){case"add":case"addDir":u.set(k,{type:"create"});break;case"rename":case"renameDir":{let B=i.directory.normalize(I,re);u.set(k,{type:"create",oldPath:B});break}case"change":{u.set(k,{type:"update"});break}case"unlink":case"unlinkDir":{u.set(k,{type:"delete"});break}}w()}).once("error",h=>e.abort(h));e.onAbort(async h=>{e.log.info("stopping",{reason:h}),l?.unsubscribe(),f.unsubscribe(),m.close(),clearInterval(c),await w.flush();try{await n.idle()}catch(I){e.log.error("error while waiting for idle",{error:I})}Ht(h)||(sn(e,{subtitle:"Uh oh!",message:"An error occurred while syncing files"}),await Jt(e,h))}),Et({ensureEmptyLineAbove:!0,content:G`
54
+ ${i.sprint({indent:4})}
55
+
56
+ Waiting for file changes${Yt.ellipsis} {gray Press Ctrl+C to stop}
57
+ `})};export{Al as args,Tl as run,Cl as usage};
58
+ //# sourceMappingURL=dev-G77WSGIC.js.map