@wix/cli-app 1.1.18 → 1.1.19

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 (119) hide show
  1. package/build/CreateVersionCommand-3UL6NYDF.js +4 -0
  2. package/build/{CreateVersionCommand-CHX2UWME.js.map → CreateVersionCommand-3UL6NYDF.js.map} +1 -1
  3. package/build/DevCommand-GD7XT72H.js +4 -0
  4. package/build/DevCommand-GD7XT72H.js.map +1 -0
  5. package/build/GenerateCommand-YW37BTUB.js +99 -0
  6. package/build/GenerateCommand-YW37BTUB.js.map +1 -0
  7. package/build/PreviewCommand-HDEZ6LT3.js +4 -0
  8. package/build/{ServeCommand-XTHWLUDT.js → ServeCommand-YRMZVHZN.js} +2 -2
  9. package/build/ServeCommand-YRMZVHZN.js.map +1 -0
  10. package/build/build-FJMITZHU.js +4 -0
  11. package/build/build-FJMITZHU.js.map +1 -0
  12. package/build/chunk-4VOJ4MBF.js +4 -0
  13. package/build/chunk-4VOJ4MBF.js.map +1 -0
  14. package/build/{chunk-PE3RXVKE.js → chunk-56GO226U.js} +2 -2
  15. package/build/chunk-56GO226U.js.map +1 -0
  16. package/build/chunk-6U7WFIFR.js +87 -0
  17. package/build/chunk-6U7WFIFR.js.map +1 -0
  18. package/build/chunk-CXTD4ANR.js +4 -0
  19. package/build/{chunk-S7NF452E.js → chunk-EL4LLNE3.js} +2 -2
  20. package/build/chunk-EVTSTCPY.js +4 -0
  21. package/build/chunk-EVTSTCPY.js.map +1 -0
  22. package/build/chunk-FMEEFVFZ.js +4 -0
  23. package/build/chunk-FMEEFVFZ.js.map +1 -0
  24. package/build/chunk-I4ARVL5S.js +6 -0
  25. package/build/chunk-I4ARVL5S.js.map +1 -0
  26. package/build/chunk-KF76KJSL.js +4 -0
  27. package/build/chunk-KF76KJSL.js.map +1 -0
  28. package/build/chunk-L47BPWKS.js +23 -0
  29. package/build/chunk-L47BPWKS.js.map +1 -0
  30. package/build/chunk-LINHFSVS.js +4 -0
  31. package/build/{chunk-BGSKNKJF.js.map → chunk-LINHFSVS.js.map} +1 -1
  32. package/build/chunk-LKXDY7ME.js +27 -0
  33. package/build/chunk-LKXDY7ME.js.map +1 -0
  34. package/build/chunk-MNS7PUKJ.js +11 -0
  35. package/build/chunk-MNS7PUKJ.js.map +1 -0
  36. package/build/{chunk-RCDIKBVN.js → chunk-POJEX3XJ.js} +12 -12
  37. package/build/chunk-POJEX3XJ.js.map +1 -0
  38. package/build/chunk-PWKG7UKK.js +4 -0
  39. package/build/{chunk-O4DV7EH5.js.map → chunk-PWKG7UKK.js.map} +1 -1
  40. package/build/{chunk-BKNV2B7T.js → chunk-QLWXUOAT.js} +2 -2
  41. package/build/{chunk-QBIV5U5A.js → chunk-QOQRQIMF.js} +2 -2
  42. package/build/chunk-QZS4ARDD.js +4 -0
  43. package/build/chunk-QZS4ARDD.js.map +1 -0
  44. package/build/chunk-RJKCVYVO.js +73 -0
  45. package/build/chunk-RJKCVYVO.js.map +1 -0
  46. package/build/{chunk-PYBYLDJB.js → chunk-TPV6MPZ4.js} +2 -2
  47. package/build/{chunk-5XZSJPLU.js → chunk-V35F6N6Y.js} +2 -2
  48. package/build/{chunk-HFDLXX7R.js → chunk-V4TR6DCM.js} +1 -1
  49. package/build/{chunk-HLCGKBPK.js → chunk-YE7MFP76.js} +2 -2
  50. package/build/chunk-YE7MFP76.js.map +1 -0
  51. package/build/{devtools-WFBFD7GB.js → devtools-WDPQJNQZ.js} +2 -2
  52. package/build/{devtools-WFBFD7GB.js.map → devtools-WDPQJNQZ.js.map} +1 -1
  53. package/build/{esm-QEHFRL6L.js → esm-MUZJUC5Q.js} +2 -2
  54. package/build/index.js +14 -14
  55. package/build/index.js.map +1 -1
  56. package/build/preview-3ZAXKZ4E.js +4 -0
  57. package/build/preview-3ZAXKZ4E.js.map +1 -0
  58. package/build/{render-command-PDPDZKND.js → render-command-SBXRR4MG.js} +2 -2
  59. package/build/{types.impl-HD4UTKFC.js → types.impl-V4PI7Z6L.js} +2 -2
  60. package/build/types.impl-V4PI7Z6L.js.map +1 -0
  61. package/package.json +7 -6
  62. package/schemas/custom-element.json +1 -1
  63. package/schemas/dashboard-menu-plugin.json +1 -1
  64. package/schemas/dashboard-modal.json +1 -1
  65. package/schemas/dashboard-page.json +1 -1
  66. package/schemas/dashboard-plugin.json +1 -1
  67. package/schemas/embedded-script.json +1 -1
  68. package/schemas/wix-config.json +1 -1
  69. package/templates/custom-element/element.tsx.ejs +27 -4
  70. package/templates/custom-element/panel.tsx.ejs +45 -6
  71. package/build/CreateVersionCommand-CHX2UWME.js +0 -4
  72. package/build/DevCommand-TKHJTH22.js +0 -4
  73. package/build/DevCommand-TKHJTH22.js.map +0 -1
  74. package/build/GenerateCommand-PIRMS3PT.js +0 -99
  75. package/build/GenerateCommand-PIRMS3PT.js.map +0 -1
  76. package/build/PreviewCommand-2DQ252RA.js +0 -4
  77. package/build/PreviewCommand-2DQ252RA.js.map +0 -1
  78. package/build/ServeCommand-XTHWLUDT.js.map +0 -1
  79. package/build/build-QLE4H4H2.js +0 -4
  80. package/build/build-QLE4H4H2.js.map +0 -1
  81. package/build/chunk-3L5LQKB7.js +0 -4
  82. package/build/chunk-3L5LQKB7.js.map +0 -1
  83. package/build/chunk-6OPLPT2G.js +0 -87
  84. package/build/chunk-6OPLPT2G.js.map +0 -1
  85. package/build/chunk-6R3ZFQVO.js +0 -27
  86. package/build/chunk-6R3ZFQVO.js.map +0 -1
  87. package/build/chunk-7JJKVPKL.js +0 -6
  88. package/build/chunk-7JJKVPKL.js.map +0 -1
  89. package/build/chunk-BGSKNKJF.js +0 -4
  90. package/build/chunk-HLCGKBPK.js.map +0 -1
  91. package/build/chunk-LZ4SXWLW.js +0 -11
  92. package/build/chunk-LZ4SXWLW.js.map +0 -1
  93. package/build/chunk-O4DV7EH5.js +0 -4
  94. package/build/chunk-PE3RXVKE.js.map +0 -1
  95. package/build/chunk-RCDIKBVN.js.map +0 -1
  96. package/build/chunk-RDIPEKL2.js +0 -23
  97. package/build/chunk-RDIPEKL2.js.map +0 -1
  98. package/build/chunk-SIP7BHV7.js +0 -4
  99. package/build/chunk-TBT2V5T7.js +0 -4
  100. package/build/chunk-TBT2V5T7.js.map +0 -1
  101. package/build/chunk-UQ7NP6NA.js +0 -4
  102. package/build/chunk-UQ7NP6NA.js.map +0 -1
  103. package/build/chunk-XHPVJXDY.js +0 -73
  104. package/build/chunk-XHPVJXDY.js.map +0 -1
  105. package/build/chunk-XYNUUMC2.js +0 -4
  106. package/build/chunk-XYNUUMC2.js.map +0 -1
  107. package/build/preview-LQ6YX5QD.js +0 -4
  108. package/build/preview-LQ6YX5QD.js.map +0 -1
  109. package/schemas/dashboard-sidebar-category.json +0 -1
  110. /package/build/{types.impl-HD4UTKFC.js.map → PreviewCommand-HDEZ6LT3.js.map} +0 -0
  111. /package/build/{chunk-SIP7BHV7.js.map → chunk-CXTD4ANR.js.map} +0 -0
  112. /package/build/{chunk-S7NF452E.js.map → chunk-EL4LLNE3.js.map} +0 -0
  113. /package/build/{chunk-BKNV2B7T.js.map → chunk-QLWXUOAT.js.map} +0 -0
  114. /package/build/{chunk-QBIV5U5A.js.map → chunk-QOQRQIMF.js.map} +0 -0
  115. /package/build/{chunk-PYBYLDJB.js.map → chunk-TPV6MPZ4.js.map} +0 -0
  116. /package/build/{chunk-5XZSJPLU.js.map → chunk-V35F6N6Y.js.map} +0 -0
  117. /package/build/{chunk-HFDLXX7R.js.map → chunk-V4TR6DCM.js.map} +0 -0
  118. /package/build/{esm-QEHFRL6L.js.map → esm-MUZJUC5Q.js.map} +0 -0
  119. /package/build/{render-command-PDPDZKND.js.map → render-command-SBXRR4MG.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{d as Xc,h as f}from"./chunk-HFDLXX7R.js";f();f();f();f();f();f();var Zc=Object.prototype.toString;function ut(e){switch(Zc.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Be(e,Error)}}function Tn(e,t){return Zc.call(e)===`[object ${t}]`}function In(e){return Tn(e,"ErrorEvent")}function So(e){return Tn(e,"DOMError")}function ls(e){return Tn(e,"DOMException")}function Se(e){return Tn(e,"String")}function vn(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Vt(e){return e===null||vn(e)||typeof e!="object"&&typeof e!="function"}function Fe(e){return Tn(e,"Object")}function Kt(e){return typeof Event<"u"&&Be(e,Event)}function ds(e){return typeof Element<"u"&&Be(e,Element)}function fs(e){return Tn(e,"RegExp")}function ze(e){return!!(e&&e.then&&typeof e.then=="function")}function ps(e){return Fe(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function ar(e){return typeof e=="number"&&e!==e}function Be(e,t){try{return e instanceof t}catch{return!1}}function cr(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}f();function lt(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function ur(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let i=Math.min(o+140,r);return i>r-5&&(i=r),i===r&&(o=Math.max(i-140,0)),n=n.slice(o,i),o>0&&(n=`'{snip} ${n}`),i<r&&(n+=" {snip}"),n}function Jt(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];try{cr(o)?n.push("[VueViewModel]"):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Qc(e,t,n=!1){return Se(e)?fs(t)?t.test(e):Se(t)?n?e===t:e.includes(t):!1:!1}function dt(e,t=[],n=!1){return t.some(r=>Qc(e,r,n))}function lr(e,t,n=250,r,o,i,s){if(!i.exception||!i.exception.values||!s||!Be(s.originalException,Error))return;let a=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;a&&(i.exception.values=dm(ms(e,t,o,s.originalException,r,i.exception.values,a,0),n))}function ms(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let c=[...i];if(Be(r[o],Error)){eu(s,a);let u=e(t,r[o]),l=c.length;tu(u,o,l,a),c=ms(e,t,n,r[o],o,[u,...c],u,l)}return Array.isArray(r.errors)&&r.errors.forEach((u,l)=>{if(Be(u,Error)){eu(s,a);let d=e(t,u),p=c.length;tu(d,`errors[${l}]`,p,a),c=ms(e,t,n,u,o,[d,...c],d,p)}}),c}function eu(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function tu(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function dm(e,t){return e.map(n=>(n.value&&(n.value=lt(n.value,t)),n))}f();f();function Eo(e){return e&&e.Math==Math?e:void 0}var C=typeof globalThis=="object"&&Eo(globalThis)||typeof window=="object"&&Eo(window)||typeof self=="object"&&Eo(self)||typeof global=="object"&&Eo(global)||function(){return this}()||{};function Xt(){return C}function dr(e,t,n){let r=n||C,o=r.__SENTRY__=r.__SENTRY__||{};return o[e]||(o[e]=t())}var xn=Xt(),fm=80;function He(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],i=0,s=0,a=" > ",c=a.length,u,l=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||fm;for(;n&&i++<r&&(u=pm(n,l),!(u==="html"||i>1&&s+o.length*c+u.length>=d));)o.push(u),s+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function pm(e,t){let n=e,r=[],o,i,s,a,c;if(!n||!n.tagName)return"";if(xn.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());let u=t&&t.length?t.filter(d=>n.getAttribute(d)).map(d=>[d,n.getAttribute(d)]):null;if(u&&u.length)u.forEach(d=>{r.push(`[${d[0]}="${d[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),o=n.className,o&&Se(o))for(i=o.split(/\s+/),c=0;c<i.length;c++)r.push(`.${i[c]}`);let l=["aria-label","type","name","title","alt"];for(c=0;c<l.length;c++)s=l[c],a=n.getAttribute(s),a&&r.push(`[${s}="${a}"]`);return r.join("")}function fr(){try{return xn.document.location.href}catch{return""}}function pr(e){return xn.document&&xn.document.querySelector?xn.document.querySelector(e):null}function mr(e){if(!xn.HTMLElement)return null;let t=e,n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}f();f();var je=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;f();var mm="Sentry Logger ",Zt=["debug","info","warn","error","log","assert","trace"],wn={};function Re(e){if(!("console"in C))return e();let t=C.console,n={},r=Object.keys(wn);r.forEach(o=>{let i=wn[o];n[o]=t[o],t[o]=i});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function hm(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return je?Zt.forEach(n=>{t[n]=(...r)=>{e&&Re(()=>{C.console[n](`${mm}[${n}]:`,...r)})}}):Zt.forEach(n=>{t[n]=()=>{}}),t}var h=hm();var gm=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function _m(e){return e==="http"||e==="https"}function Te(e,t=!1){let{host:n,path:r,pass:o,port:i,projectId:s,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${s}`}function bo(e){let t=gm.exec(e);if(!t){Re(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",i,s="",a]=t.slice(1),c="",u=a,l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){let d=u.match(/^\d+/);d&&(u=d[0])}return nu({host:i,pass:o,path:c,projectId:u,port:s,protocol:n,publicKey:r})}function nu(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function ym(e){if(!je)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(h.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?_m(r)?t&&isNaN(parseInt(t,10))?(h.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(h.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(h.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function hr(e){let t=typeof e=="string"?bo(e):nu(e);if(!(!t||!ym(t)))return t}f();var Ee=class extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}};f();f();function Q(e,t,n){if(!(t in e))return;let r=e[t],o=n(r);typeof o=="function"&&To(o,r),e[t]=o}function ke(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{je&&h.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function To(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,ke(e,"__sentry_original__",t)}catch{}}function Qt(e){return e.__sentry_original__}function gs(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function Io(e){if(ut(e))return{message:e.message,name:e.name,stack:e.stack,...ou(e)};if(Kt(e)){let t={type:e.type,target:ru(e.target),currentTarget:ru(e.currentTarget),...ou(e)};return typeof CustomEvent<"u"&&Be(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function ru(e){try{return ds(e)?He(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function ou(e){if(typeof e=="object"&&e!==null){let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function _s(e,t=40){let n=Object.keys(Io(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return lt(n[0],t);for(let r=n.length;r>0;r--){let o=n.slice(0,r).join(", ");if(!(o.length>t))return r===n.length?o:lt(o,t)}return""}function J(e){return hs(e,new Map)}function hs(e,t){if(Sm(e)){let n=t.get(e);if(n!==void 0)return n;let r={};t.set(e,r);for(let o of Object.keys(e))typeof e[o]<"u"&&(r[o]=hs(e[o],t));return r}if(Array.isArray(e)){let n=t.get(e);if(n!==void 0)return n;let r=[];return t.set(e,r),e.forEach(o=>{r.push(hs(o,t))}),r}return e}function Sm(e){if(!Fe(e))return!1;try{let t=Object.getPrototypeOf(e).constructor.name;return!t||t==="Object"}catch{return!0}}f();f();var au=50,iu=/\(error: (.*)\)/,su=/captureMessage|captureException/;function vo(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{let o=[],i=n.split(`
3
+ import{d as Xc,h as f}from"./chunk-V4TR6DCM.js";f();f();f();f();f();f();var Zc=Object.prototype.toString;function ut(e){switch(Zc.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Be(e,Error)}}function Tn(e,t){return Zc.call(e)===`[object ${t}]`}function In(e){return Tn(e,"ErrorEvent")}function So(e){return Tn(e,"DOMError")}function ls(e){return Tn(e,"DOMException")}function Se(e){return Tn(e,"String")}function vn(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Vt(e){return e===null||vn(e)||typeof e!="object"&&typeof e!="function"}function Fe(e){return Tn(e,"Object")}function Kt(e){return typeof Event<"u"&&Be(e,Event)}function ds(e){return typeof Element<"u"&&Be(e,Element)}function fs(e){return Tn(e,"RegExp")}function ze(e){return!!(e&&e.then&&typeof e.then=="function")}function ps(e){return Fe(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function ar(e){return typeof e=="number"&&e!==e}function Be(e,t){try{return e instanceof t}catch{return!1}}function cr(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}f();function lt(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function ur(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let i=Math.min(o+140,r);return i>r-5&&(i=r),i===r&&(o=Math.max(i-140,0)),n=n.slice(o,i),o>0&&(n=`'{snip} ${n}`),i<r&&(n+=" {snip}"),n}function Jt(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];try{cr(o)?n.push("[VueViewModel]"):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Qc(e,t,n=!1){return Se(e)?fs(t)?t.test(e):Se(t)?n?e===t:e.includes(t):!1:!1}function dt(e,t=[],n=!1){return t.some(r=>Qc(e,r,n))}function lr(e,t,n=250,r,o,i,s){if(!i.exception||!i.exception.values||!s||!Be(s.originalException,Error))return;let a=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;a&&(i.exception.values=dm(ms(e,t,o,s.originalException,r,i.exception.values,a,0),n))}function ms(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let c=[...i];if(Be(r[o],Error)){eu(s,a);let u=e(t,r[o]),l=c.length;tu(u,o,l,a),c=ms(e,t,n,r[o],o,[u,...c],u,l)}return Array.isArray(r.errors)&&r.errors.forEach((u,l)=>{if(Be(u,Error)){eu(s,a);let d=e(t,u),p=c.length;tu(d,`errors[${l}]`,p,a),c=ms(e,t,n,u,o,[d,...c],d,p)}}),c}function eu(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function tu(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function dm(e,t){return e.map(n=>(n.value&&(n.value=lt(n.value,t)),n))}f();f();function Eo(e){return e&&e.Math==Math?e:void 0}var C=typeof globalThis=="object"&&Eo(globalThis)||typeof window=="object"&&Eo(window)||typeof self=="object"&&Eo(self)||typeof global=="object"&&Eo(global)||function(){return this}()||{};function Xt(){return C}function dr(e,t,n){let r=n||C,o=r.__SENTRY__=r.__SENTRY__||{};return o[e]||(o[e]=t())}var xn=Xt(),fm=80;function He(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],i=0,s=0,a=" > ",c=a.length,u,l=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||fm;for(;n&&i++<r&&(u=pm(n,l),!(u==="html"||i>1&&s+o.length*c+u.length>=d));)o.push(u),s+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function pm(e,t){let n=e,r=[],o,i,s,a,c;if(!n||!n.tagName)return"";if(xn.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());let u=t&&t.length?t.filter(d=>n.getAttribute(d)).map(d=>[d,n.getAttribute(d)]):null;if(u&&u.length)u.forEach(d=>{r.push(`[${d[0]}="${d[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),o=n.className,o&&Se(o))for(i=o.split(/\s+/),c=0;c<i.length;c++)r.push(`.${i[c]}`);let l=["aria-label","type","name","title","alt"];for(c=0;c<l.length;c++)s=l[c],a=n.getAttribute(s),a&&r.push(`[${s}="${a}"]`);return r.join("")}function fr(){try{return xn.document.location.href}catch{return""}}function pr(e){return xn.document&&xn.document.querySelector?xn.document.querySelector(e):null}function mr(e){if(!xn.HTMLElement)return null;let t=e,n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}f();f();var je=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;f();var mm="Sentry Logger ",Zt=["debug","info","warn","error","log","assert","trace"],wn={};function Re(e){if(!("console"in C))return e();let t=C.console,n={},r=Object.keys(wn);r.forEach(o=>{let i=wn[o];n[o]=t[o],t[o]=i});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function hm(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return je?Zt.forEach(n=>{t[n]=(...r)=>{e&&Re(()=>{C.console[n](`${mm}[${n}]:`,...r)})}}):Zt.forEach(n=>{t[n]=()=>{}}),t}var h=hm();var gm=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function _m(e){return e==="http"||e==="https"}function Te(e,t=!1){let{host:n,path:r,pass:o,port:i,projectId:s,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${s}`}function bo(e){let t=gm.exec(e);if(!t){Re(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",i,s="",a]=t.slice(1),c="",u=a,l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){let d=u.match(/^\d+/);d&&(u=d[0])}return nu({host:i,pass:o,path:c,projectId:u,port:s,protocol:n,publicKey:r})}function nu(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function ym(e){if(!je)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(h.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?_m(r)?t&&isNaN(parseInt(t,10))?(h.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(h.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(h.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function hr(e){let t=typeof e=="string"?bo(e):nu(e);if(!(!t||!ym(t)))return t}f();var Ee=class extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}};f();f();function Q(e,t,n){if(!(t in e))return;let r=e[t],o=n(r);typeof o=="function"&&To(o,r),e[t]=o}function ke(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{je&&h.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function To(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,ke(e,"__sentry_original__",t)}catch{}}function Qt(e){return e.__sentry_original__}function gs(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function Io(e){if(ut(e))return{message:e.message,name:e.name,stack:e.stack,...ou(e)};if(Kt(e)){let t={type:e.type,target:ru(e.target),currentTarget:ru(e.currentTarget),...ou(e)};return typeof CustomEvent<"u"&&Be(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function ru(e){try{return ds(e)?He(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function ou(e){if(typeof e=="object"&&e!==null){let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function _s(e,t=40){let n=Object.keys(Io(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return lt(n[0],t);for(let r=n.length;r>0;r--){let o=n.slice(0,r).join(", ");if(!(o.length>t))return r===n.length?o:lt(o,t)}return""}function J(e){return hs(e,new Map)}function hs(e,t){if(Sm(e)){let n=t.get(e);if(n!==void 0)return n;let r={};t.set(e,r);for(let o of Object.keys(e))typeof e[o]<"u"&&(r[o]=hs(e[o],t));return r}if(Array.isArray(e)){let n=t.get(e);if(n!==void 0)return n;let r=[];return t.set(e,r),e.forEach(o=>{r.push(hs(o,t))}),r}return e}function Sm(e){if(!Fe(e))return!1;try{let t=Object.getPrototypeOf(e).constructor.name;return!t||t==="Object"}catch{return!0}}f();f();var au=50,iu=/\(error: (.*)\)/,su=/captureMessage|captureException/;function vo(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{let o=[],i=n.split(`
4
4
  `);for(let s=r;s<i.length;s++){let a=i[s];if(a.length>1024)continue;let c=iu.test(a)?a.replace(iu,"$1"):a;if(!c.match(/\S*Error: /)){for(let u of t){let l=u(c);if(l){o.push(l);break}}if(o.length>=au)break}}return cu(o)}}function Ss(e){return Array.isArray(e)?vo(...e):e}function cu(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),su.test(t[t.length-1].function||"")&&(t.pop(),su.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,au).map(n=>({...n,filename:n.filename||t[t.length-1].filename,function:n.function||"?"}))}var ys="<anonymous>";function Ae(e){try{return!e||typeof e!="function"?ys:e.name||ys}catch{return ys}}var xo={},uu={};function Oe(e,t){xo[e]=xo[e]||[],xo[e].push(t)}function Me(e,t){uu[e]||(t(),uu[e]=!0)}function me(e,t){let n=e&&xo[e];if(n)for(let r of n)try{r(t)}catch(o){je&&h.error(`Error while triggering instrumentation handler.
5
5
  Type: ${e}
6
6
  Name: ${Ae(r)}
@@ -362,4 +362,4 @@ ${t==="system"?`
362
362
  `),o.append(i),n.append(o),{get el(){return n}}}function sT({formTitle:e,showBranding:t,showName:n,showEmail:r,isNameRequired:o,isEmailRequired:i,colorScheme:s,defaultName:a,defaultEmail:c,onClosed:u,onCancel:l,onSubmit:d,...p}){let m=null;function g(){E(),u&&u()}function E(){m&&(m.open=!1)}function T(){m&&(m.open=!0)}function S(){return m&&m.open===!0||!1}let{el:b,showError:v,hideError:O}=rT({showEmail:r,showName:n,isEmailRequired:i,isNameRequired:o,defaultName:a,defaultEmail:c,onSubmit:d,onCancel:l,...p});return m=oe("dialog",{className:"dialog",open:!0,onClick:g},oe("div",{className:"dialog__content",onClick:L=>{L.stopPropagation()}},oe("h2",{className:"dialog__header"},e,t&&oe("a",{className:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer"},iT({colorScheme:s}).el)),b)),{get el(){return m},showError:v,hideError:O,open:T,close:E,checkIsOpen:S}}var es=16,Sp=17,aT="http://www.w3.org/2000/svg";function cT(){let e=c=>yn.document.createElementNS(aT,c),t=Ge(e("svg"),{class:"success-icon",width:`${es}`,height:`${Sp}`,viewBox:`0 0 ${es} ${Sp}`,fill:"none"}),n=Ge(e("g"),{clipPath:"url(#clip0_57_156)"}),r=Ge(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),o=Ge(e("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});t.appendChild(n).append(o,r);let i=e("defs"),s=Ge(e("clipPath"),{id:"clip0_57_156"}),a=Ge(e("rect"),{width:`${es}`,height:`${es}`,fill:"white",transform:"translate(0 0.5)"});return s.appendChild(a),i.appendChild(s),t.appendChild(i).appendChild(s).appendChild(a),{get el(){return t}}}function uT({message:e,onRemove:t}){function n(){r&&(r.remove(),t&&t())}let r=oe("div",{className:"success-message",onClick:n},cT().el,e);return{el:r,remove:n}}function Ep({shadow:e,options:{shouldCreateActor:t=!0,...n},attachTo:r}){let o,i,s=!1;function a(){if(e)try{let S=uT({message:n.successMessageText,onRemove:()=>{b&&clearTimeout(b),l()}});if(!S.el)throw new Error("Unable to show success message");e.appendChild(S.el);let b=setTimeout(()=>{S&&S.remove()},5e3)}catch(S){h.error(S)}}async function c(S){if(!i)return;let b=[];if(n.isNameRequired&&!S.name&&b.push(n.nameLabel),n.isEmailRequired&&!S.email&&b.push(n.emailLabel),S.message||b.push(n.messageLabel),b.length>0){i.showError(`Please enter in the following required fields: ${b.join(", ")}`);return}if(!await Zb(i,S)){n.onSubmitError&&n.onSubmitError();return}E(),a(),n.onSubmitSuccess&&n.onSubmitSuccess()}function u(){let S=x(),b=S&&S.getIntegrationByName&&S.getIntegrationByName("Replay");b&&b.flush().catch(v=>{_n&&h.error(v)})}function l(){o&&o.show()}function d(){o&&o.hide()}function p(){o&&o.el&&o.el.remove()}function m(){try{if(i){i.open(),s=!0,n.onFormOpen&&n.onFormOpen(),u();return}let S=n.useSentryUser,b=q(),v=b&&b.getUser();if(i=sT({colorScheme:n.colorScheme,showBranding:n.showBranding,showName:n.showName||n.isNameRequired,showEmail:n.showEmail||n.isEmailRequired,isNameRequired:n.isNameRequired,isEmailRequired:n.isEmailRequired,formTitle:n.formTitle,cancelButtonLabel:n.cancelButtonLabel,submitButtonLabel:n.submitButtonLabel,emailLabel:n.emailLabel,emailPlaceholder:n.emailPlaceholder,messageLabel:n.messageLabel,messagePlaceholder:n.messagePlaceholder,nameLabel:n.nameLabel,namePlaceholder:n.namePlaceholder,isRequiredLabel:n.isRequiredLabel,defaultName:S&&v&&v[S.name]||"",defaultEmail:S&&v&&v[S.email]||"",onClosed:()=>{l(),s=!1,n.onFormClose&&n.onFormClose()},onCancel:()=>{g(),l()},onSubmit:c}),!i.el)throw new Error("Unable to open Feedback dialog");e.appendChild(i.el),d(),n.onFormOpen&&n.onFormOpen(),u()}catch(S){h.error(S)}}function g(){i&&(i.close(),s=!1,n.onFormClose&&n.onFormClose())}function E(){if(i){g();let S=i.el;S&&S.remove(),i=void 0}}function T(){s||m(),d()}return r?r.addEventListener("click",T):t&&(o=tT({buttonLabel:n.buttonLabel,onClick:T}),o.el&&e.appendChild(o.el)),{get actor(){return o},get dialog(){return i},showActor:l,hideActor:d,removeActor:p,openDialog:m,closeDialog:g,removeDialog:E}}var ts=yn.document,lT=e=>new mo(e),mo=class e{static __initStatic(){this.id="Feedback"}constructor({autoInject:t=!0,id:n="sentry-feedback",isEmailRequired:r=!1,isNameRequired:o=!1,showBranding:i=!0,showEmail:s=!0,showName:a=!0,useSentryUser:c={email:"email",name:"username"},themeDark:u,themeLight:l,colorScheme:d="system",buttonLabel:p=Db,cancelButtonLabel:m=Lb,submitButtonLabel:g=Pb,formTitle:E=Fb,emailPlaceholder:T=Bb,emailLabel:S=Hb,messagePlaceholder:b=Ub,messageLabel:v=$b,namePlaceholder:O=Gb,nameLabel:L=Wb,isRequiredLabel:M=zb,successMessageText:w=jb,onFormClose:U,onFormOpen:ne,onSubmitError:k,onSubmitSuccess:N}={}){this.name=e.id,this._host=null,this._shadow=null,this._widget=null,this._widgets=new Set,this._hasInsertedActorStyles=!1,this.options={autoInject:t,showBranding:i,id:n,isEmailRequired:r,isNameRequired:o,showEmail:s,showName:a,useSentryUser:c,colorScheme:d,themeDark:{...gp.dark,...u},themeLight:{...gp.light,...l},buttonLabel:p,cancelButtonLabel:m,submitButtonLabel:g,formTitle:E,emailLabel:S,emailPlaceholder:T,messageLabel:v,messagePlaceholder:b,nameLabel:L,namePlaceholder:O,isRequiredLabel:M,successMessageText:w,onFormClose:U,onFormOpen:ne,onSubmitError:k,onSubmitSuccess:N}}setupOnce(){if(kn())try{this._cleanupWidgetIfExists();let{autoInject:t}=this.options;if(!t)return;this._createWidget(this.options)}catch(t){_n&&h.error(t)}}openDialog(){this._widget||this._createWidget({...this.options,shouldCreateActor:!1}),this._widget&&this._widget.openDialog()}closeDialog(){this._widget&&this._widget.closeDialog()}attachTo(t,n){try{let r=_p(this.options,n||{});return this._ensureShadowHost(r,({shadow:o})=>{let i=typeof t=="string"?ts.querySelector(t):typeof t.addEventListener=="function"?t:null;if(!i)return _n&&h.error("[Feedback] Unable to attach to target element"),null;let s=Ep({shadow:o,options:r,attachTo:i});return this._widgets.add(s),this._widget||(this._widget=s),s})}catch(r){return _n&&h.error(r),null}}createWidget(t){try{return this._createWidget(_p(this.options,t||{}))}catch(n){return _n&&h.error(n),null}}removeWidget(t){if(!t)return!1;try{if(this._widgets.has(t))return t.removeActor(),t.removeDialog(),this._widgets.delete(t),this._widget===t&&(this._widget=null),!0}catch(n){_n&&h.error(n)}return!1}getWidget(){return this._widget}remove(){this._host&&this._host.remove(),this._initialize()}_initialize(){this._host=null,this._shadow=null,this._widget=null,this._widgets=new Set,this._hasInsertedActorStyles=!1}_cleanupWidgetIfExists(){this._host&&this.remove();let t=ts.querySelector(`#${this.options.id}`);t&&t.remove()}_createWidget(t){return this._ensureShadowHost(t,({shadow:n})=>{let r=Ep({shadow:n,options:t});return!this._hasInsertedActorStyles&&r.actor&&(n.appendChild(Vb(ts)),this._hasInsertedActorStyles=!0),this._widgets.add(r),this._widget||(this._widget=r),r})}_ensureShadowHost(t,n){let r=!1;if(!this._shadow||!this._host){let{id:i,colorScheme:s,themeLight:a,themeDark:c}=t,{shadow:u,host:l}=Xb({id:i,colorScheme:s,themeLight:a,themeDark:c});this._shadow=u,this._host=l,r=!0}this._host.dataset.sentryFeedbackColorscheme=t.colorScheme;let o=n({shadow:this._shadow,host:this._host});return r&&ts.body.appendChild(this._host),o}};mo.__initStatic();f();f();var xp="CaptureConsole",dT=(e={})=>{let t=e.levels||Zt;return{name:xp,setupOnce(){},setup(n){"console"in C&&gr(({args:r,level:o})=>{x()!==n||!t.includes(o)||pT(r,o)})}}},Pc=dT,fT=D(xp,Pc);function pT(e,t){let n={level:vr(t),extra:{arguments:e}};De(r=>{if(r.addEventProcessor(s=>(s.logger="console",Ue(s,{handled:!1,type:"console"}),s)),t==="assert"&&e[0]===!1){let s=`Assertion failed: ${Jt(e.slice(1)," ")||"console.assert"}`;r.setExtra("arguments",e.slice(1)),an(s,n);return}let o=e.find(s=>s instanceof Error);if(t==="error"&&o){xt(o,n);return}let i=Jt(e," ");an(i,n)})}f();var wp="Debug",mT=(e={})=>{let t={debugger:!1,stringify:!1,...e};return{name:wp,setupOnce(){},setup(n){n.on&&n.on("beforeSendEvent",(r,o)=>{if(t.debugger)debugger;Re(()=>{t.stringify?(console.log(JSON.stringify(r,null,2)),o&&Object.keys(o).length&&console.log(JSON.stringify(o,null,2))):(console.log(r),o&&Object.keys(o).length&&console.log(o))})})}}},Fc=mT,hT=D(wp,Fc);f();f();var kt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var kp="Dedupe",gT=()=>{let e;return{name:kp,setupOnce(){},processEvent(t){if(t.type)return t;try{if(yT(t,e))return kt&&h.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Bc=gT,_T=D(kp,Bc);function yT(e,t){return t?!!(ST(e,t)||ET(e,t)):!1}function ST(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Op(e,t)||!Ap(e,t))}function ET(e,t){let n=Cp(t),r=Cp(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Op(e,t)||!Ap(e,t))}function Ap(e,t){let n=Rp(e),r=Rp(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){let i=r[o],s=n[o];if(i.filename!==s.filename||i.lineno!==s.lineno||i.colno!==s.colno||i.function!==s.function)return!1}return!0}function Op(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function Cp(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Rp(e){let t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}f();var Mp="ExtraErrorData",bT=(e={})=>{let t=e.depth||3,n=e.captureErrorCause||!1;return{name:Mp,setupOnce(){},processEvent(r,o){return IT(r,o,t,n)}}},Hc=bT,TT=D(Mp,Hc);function IT(e,t={},n,r){if(!t.originalException||!ut(t.originalException))return e;let o=t.originalException.name||t.originalException.constructor.name,i=vT(t.originalException,r);if(i){let s={...e.contexts},a=be(i,n);return Fe(a)&&(ke(a,"__sentry_skip_normalization__",!0),s[o]=a),{...e,contexts:s}}return e}function vT(e,t){try{let n=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],r={};for(let o of Object.keys(e)){if(n.indexOf(o)!==-1)continue;let i=e[o];r[o]=ut(i)?i.toString():i}if(t&&e.cause!==void 0&&(r.cause=ut(e.cause)?e.cause.toString():e.cause),typeof e.toJSON=="function"){let o=e.toJSON();for(let i of Object.keys(o)){let s=o[i];r[i]=ut(s)?s.toString():s}}return r}catch(n){kt&&h.error("Unable to extract extra data from the Error object:",n)}return null}f();var xT=C,Dp="ReportingObserver",Np=new WeakMap,wT=(e={})=>{let t=e.types||["crash","deprecation","intervention"];function n(r){if(Np.has(x()))for(let o of r)De(i=>{i.setExtra("url",o.url);let s=`ReportingObserver [${o.type}]`,a="No details available";if(o.body){let c={};for(let u in o.body)c[u]=o.body[u];if(i.setExtra("body",c),o.type==="crash"){let u=o.body;a=[u.crashId||"",u.reason||""].join(" ").trim()||a}else a=o.body.message||a}an(`${s}: ${a}`)})}return{name:Dp,setupOnce(){if(!Is())return;new xT.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(r){Np.set(r,!0)}}},Uc=wT,CT=D(Dp,Uc);f();var Lp="RewriteFrames",RT=(e={})=>{let t=e.root,n=e.prefix||"app:///",r=e.iteratee||(s=>{if(!s.filename)return s;let a=/^[a-zA-Z]:\\/.test(s.filename)||s.filename.includes("\\")&&!s.filename.includes("/"),c=/^\//.test(s.filename);if(a||c){let u=a?s.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):s.filename,l=t?Rs(t,u):ks(u);s.filename=`${n}${l}`}return s});function o(s){try{return{...s,exception:{...s.exception,values:s.exception.values.map(a=>({...a,...a.stacktrace&&{stacktrace:i(a.stacktrace)}}))}}}catch{return s}}function i(s){return{...s,frames:s&&s.frames&&s.frames.map(a=>r(a))}}return{name:Lp,setupOnce(){},processEvent(s){let a=s;return s.exception&&Array.isArray(s.exception.values)&&(a=o(a)),a}}},$c=RT,kT=D(Lp,$c);f();var Pp="SessionTiming",AT=()=>{let e=Date.now();return{name:Pp,setupOnce(){},processEvent(t){let n=Date.now();return{...t,extra:{...t.extra,"session:start":e,"session:duration":n-e,"session:end":n}}}}},Gc=AT,OT=D(Pp,Gc);f();var Fp="HttpClient",MT=(e={})=>{let t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:Fp,setupOnce(){},setup(n){$T(n,t),GT(n,t)}}},Wc=MT,NT=D(Fp,Wc);function DT(e,t,n,r){if(Hp(e,n.status,n.url)){let o=WT(t,r),i,s,a,c;$p()&&([{headers:i,cookies:a},{headers:s,cookies:c}]=[{cookieHeader:"Cookie",obj:o},{cookieHeader:"Set-Cookie",obj:n}].map(({cookieHeader:l,obj:d})=>{let p=FT(d.headers),m;try{let g=p[l]||p[l.toLowerCase()]||void 0;g&&(m=Bp(g))}catch{kt&&h.log(`Could not extract cookies from header ${l}`)}return{headers:p,cookies:m}}));let u=Up({url:o.url,method:o.method,status:n.status,requestHeaders:i,responseHeaders:s,requestCookies:a,responseCookies:c});Mt(u)}}function LT(e,t,n,r){if(Hp(e,t.status,t.responseURL)){let o,i,s;if($p()){try{let c=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;c&&(i=Bp(c))}catch{kt&&h.log("Could not extract cookies from response headers")}try{s=BT(t)}catch{kt&&h.log("Could not extract headers from response")}o=r}let a=Up({url:t.responseURL,method:n,status:t.status,requestHeaders:o,responseHeaders:s,responseCookies:i});Mt(a)}}function PT(e){if(e){let t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function Bp(e){return e.split("; ").reduce((t,n)=>{let[r,o]=n.split("=");return t[r]=o,t},{})}function FT(e){let t={};return e.forEach((n,r)=>{t[r]=n}),t}function BT(e){let t=e.getAllResponseHeaders();return t?t.split(`\r
363
363
  `).reduce((n,r)=>{let[o,i]=r.split(": ");return n[o]=i,n},{}):{}}function HT(e,t){return e.some(n=>typeof n=="string"?t.includes(n):n.test(t))}function UT(e,t){return e.some(n=>typeof n=="number"?n===t:t>=n[0]&&t<=n[1])}function $T(e,t){Er()&&bt(n=>{if(x()!==e)return;let{response:r,args:o}=n,[i,s]=o;r&&DT(t,i,r,s)})}function GT(e,t){"XMLHttpRequest"in C&&Tt(n=>{if(x()!==e)return;let r=n.xhr,o=r[Ne];if(!o)return;let{method:i,request_headers:s}=o;try{LT(t,r,i,s)}catch(a){kt&&h.warn("Error while extracting response event form XHR response",a)}})}function Hp(e,t,n){return UT(e.failedRequestStatusCodes,t)&&HT(e.failedRequestTargets,n)&&!Wr(n,x())}function Up(e){let t=`HTTP Client Error with status code: ${e.status}`,n={message:t,exception:{values:[{type:"Error",value:t}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:PT(e.responseHeaders)}}};return Ue(n,{type:"http.client",handled:!1}),n}function WT(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function $p(){let e=x();return e?!!e.getOptions().sendDefaultPii:!1}f();var zc=C,zT=7,Gp="ContextLines",jT=(e={})=>{let t=e.frameContextLines!=null?e.frameContextLines:zT;return{name:Gp,setupOnce(){},processEvent(n){return YT(n,t)}}},jc=jT,qT=D(Gp,jc);function YT(e,t){let n=zc.document,r=zc.location&&Os(zc.location.href);if(!n||!r)return e;let o=e.exception&&e.exception.values;if(!o||!o.length)return e;let i=n.documentElement.innerHTML;if(!i)return e;let s=["<!DOCTYPE html>","<html>",...i.split(`
364
364
  `),"</html>"];return o.forEach(a=>{let c=a.stacktrace;c&&c.frames&&(c.frames=c.frames.map(u=>VT(u,s,r,t)))}),e}function VT(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||Es(t,e,r),e}f();function ho(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function KT(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let r=ho(n);return o=>r.then(i=>o(i.transaction(t,"readwrite").objectStore(t)))}function Wp(e){return ho(e.getAllKeys())}function JT(e,t,n){return e(r=>Wp(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.max(...o,0)+1),ho(r.transaction)}))}function XT(e){return e(t=>Wp(t).then(n=>{if(n.length!==0)return ho(t.get(n[0])).then(r=>(t.delete(n[0]),ho(t.transaction).then(()=>r)))}))}function ZT(e){let t;function n(){return t==null&&(t=KT(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{insert:async r=>{try{let o=await kr(r,e.textEncoder);await JT(n(),o,e.maxQueueSize||30)}catch{}},pop:async()=>{try{let r=await XT(n());if(r)return Fs(r,e.textEncoder||new TextEncoder,e.textDecoder||new TextDecoder)}catch{}}}}function QT(e){return t=>e({...t,createStore:ZT})}function eI(e){return QT(la(e))}f();f();var zp=1e6,ns=String(0),tI="main",Yp="",Vp="",Kp="",qc=A.navigator&&A.navigator.userAgent||"",Jp="",nI=A.navigator&&A.navigator.language||A.navigator&&A.navigator.languages&&A.navigator.languages[0]||"";function rI(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}var jp=A.navigator&&A.navigator.userAgentData;rI(jp)&&jp.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{if(Yp=e.platform||"",Kp=e.architecture||"",Jp=e.model||"",Vp=e.platformVersion||"",e.fullVersionList&&e.fullVersionList.length>0){let t=e.fullVersionList[e.fullVersionList.length-1];qc=`${t.brand} ${t.version}`}}).catch(e=>{});function oI(e){return!("thread_metadata"in e)}function iI(e){return oI(e)?cI(e):e}function sI(e){let t=e&&e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id;return typeof t=="string"&&t.length!==32&&F&&h.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function aI(e,t,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);let o=sI(r),i=iI(n),s=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:Date.now()),a=typeof r.timestamp=="number"?r.timestamp*1e3:Date.now();return{event_id:e,timestamp:new Date(s).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||rt,runtime:{name:"javascript",version:A.navigator.userAgent},os:{name:Yp,version:Vp,build_number:qc},device:{locale:nI,model:Jp,manufacturer:qc,architecture:Kp,is_emulator:!1},debug_meta:{images:uI(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||B(),trace_id:o,active_thread_id:ns,relative_start_ns:"0",relative_end_ns:((a-s)*1e6).toFixed(0)}]}}function rs(e){return e.op==="pageload"}function cI(e){let t,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[ns]:{name:tI}}};if(!e.samples.length)return r;let o=e.samples[0].timestamp,i=typeof performance.timeOrigin=="number"?performance.timeOrigin:re||0,s=i-(re||i);for(let a=0;a<e.samples.length;a++){let c=e.samples[a];if(c.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[a]={elapsed_since_start_ns:((c.timestamp+s-o)*zp).toFixed(0),stack_id:t,thread_id:ns};continue}let u=e.stacks[c.stackId],l=[];for(;u;){l.push(u.frameId);let p=e.frames[u.frameId];r.frames[u.frameId]===void 0&&(r.frames[u.frameId]={function:p.name,abs_path:typeof p.resourceId=="number"?e.resources[p.resourceId]:void 0,lineno:p.line,colno:p.column}),u=u.parentId===void 0?void 0:e.stacks[u.parentId]}let d={elapsed_since_start_ns:((c.timestamp+s-o)*zp).toFixed(0),stack_id:n,thread_id:ns};r.stacks[n]=l,r.samples[a]=d,n++}return r}function Xp(e,t){if(!t.length)return e;for(let n of t)e[1].push([{type:"profile"},n]);return e}function Zp(e){let t=[];return nt(e,(n,r)=>{if(r==="transaction")for(let o=1;o<n.length;o++){let i=n[o];i&&i.contexts&&i.contexts.profile&&i.contexts.profile.profile_id&&t.push(n[o])}}),t}var qp=new WeakMap;function uI(e){let t=C._sentryDebugIds;if(!t)return[];let n=x(),r=n&&n.getOptions(),o=r&&r.stackParser;if(!o)return[];let i,s=qp.get(o);s?i=s:(i=new Map,qp.set(o,i));let a=Object.keys(t).reduce((u,l)=>{let d,p=i.get(l);p?d=p:(d=o(l),i.set(l,d));for(let m=d.length-1;m>=0;m--){let g=d[m],E=g&&g.filename;if(g&&E){u[E]=t[l];break}}return u},{}),c=[];for(let u of e)u&&a[u]&&c.push({type:"sourcemap",code_file:u,debug_id:a[u]});return c}function lI(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(F&&h.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e===!0||e===!1?!0:e<0||e>1?(F&&h.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function dI(e){return e.samples.length<2?(F&&h.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(F&&h.log("[Profiling] Discarding profile because it contains no frames"),!1)}var Qp=!1,Yc=3e4;function fI(e){return typeof e=="function"}function em(){let e=A.Profiler;if(!fI(e)){F&&h.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}let t=10,n=Math.floor(Yc/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{F&&(h.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),h.log("[Profiling] Disabling profiling for current user session.")),Qp=!0}}function go(e){if(Qp)return F&&h.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return F&&h.log("[Profiling] Discarding profile because transaction was not sampled."),!1;let t=x(),n=t&&t.getOptions();if(!n)return F&&h.log("[Profiling] Profiling disabled, no options found."),!1;let r=n.profilesSampleRate;return lI(r)?r?(r===!0?!0:Math.random()<r)?!0:(F&&h.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(F&&h.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(F&&h.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function tm(e,t,n,r){return dI(n)?aI(e,t,n,r):null}var Sn=new Map;function nm(){return Sn.size}function rm(e){let t=Sn.get(e);return t&&Sn.delete(e),t}function om(e,t){if(Sn.set(e,t),Sn.size>30){let n=Sn.keys().next().value;Sn.delete(n)}}function pI(e){return e?go(e)?os(e):e:(F&&h.log("[Profiling] Transaction is undefined, skipping profiling"),e)}function os(e){let t;rs(e)&&(t=Ie()*1e3);let n=em();if(!n)return e;F&&h.log(`[Profiling] started profiling transaction: ${P(e).description}`);let r=B();async function o(){return!e||!n?null:n.stop().then(c=>(i&&(A.clearTimeout(i),i=void 0),F&&h.log(`[Profiling] stopped profiling of transaction: ${P(e).description}`),c?(om(r,c),null):(F&&h.log(`[Profiling] profiler returned null profile for: ${P(e).description}`,"this may indicate an overlapping transaction or a call to stopProfiling with a profile title that was never started"),null))).catch(c=>(F&&h.log("[Profiling] error while stopping profiler:",c),null))}let i=A.setTimeout(()=>{F&&h.log("[Profiling] max profile duration elapsed, stopping profiling for:",P(e).description),o()},Yc),s=e.end.bind(e);function a(){return e?(o().then(()=>{e.setContext("profile",{profile_id:r,start_timestamp:t}),s()},()=>{s()}),e):s()}return e.end=a,e}f();var im="BrowserProfiling",mI=()=>({name:im,setupOnce(){},setup(e){let n=q().getTransaction();if(n&&rs(n)&&go(n)&&os(n),typeof e.on!="function"){h.warn("[Profiling] Client does not support hooks, profiling will be disabled");return}e.on("startTransaction",r=>{go(r)&&os(r)}),e.on("beforeEnvelope",r=>{if(!nm())return;let o=Zp(r);if(!o.length)return;let i=[];for(let s of o){let a=s&&s.contexts,c=a&&a.profile&&a.profile.profile_id,u=a&&a.profile&&a.profile.start_timestamp;if(typeof c!="string"){F&&h.log("[Profiling] cannot find profile for a transaction without a profile context");continue}if(!c){F&&h.log("[Profiling] cannot find profile for a transaction without a profile context");continue}a&&a.profile&&delete a.profile;let l=rm(c);if(!l){F&&h.log(`[Profiling] Could not retrieve profile for transaction: ${c}`);continue}let d=tm(c,u,l,s);d&&i.push(d)}Xp(r,i)})}}),sm=mI,hI=D(im,sm);var am={};A.Sentry&&A.Sentry.Integrations&&(am=A.Sentry.Integrations);var DP={...am,...$l,...ja};export{Ba as Breadcrumbs,Jr as BrowserClient,hI as BrowserProfilingIntegration,yi as BrowserTracing,Ua as Dedupe,mo as Feedback,oi as FunctionToString,$a as GlobalHandlers,Ga as HttpContext,Nn as Hub,ri as InboundFilters,DP as Integrations,Wa as LinkedErrors,Ol as ModuleMetadata,uo as Replay,Nb as ReplayCanvas,ln as SDK_VERSION,dn as SEMANTIC_ATTRIBUTE_SENTRY_OP,st as SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,pt as SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,_e as SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,it as Scope,za as TryCatch,A as WINDOW,Ye as addBreadcrumb,Zo as addEventProcessor,Bo as addGlobalEventProcessor,cl as addIntegration,Bn as addTracingExtensions,Ti as breadcrumbsIntegration,wi as browserApiErrorsIntegration,sm as browserProfilingIntegration,bd as browserTracingIntegration,Pc as captureConsoleIntegration,Mt as captureEvent,xt as captureException,an as captureMessage,Lr as captureSession,cy as captureUserFeedback,vd as chromeStackLineParser,Uu as close,Au as configureScope,jc as contextLinesIntegration,Qu as continueTrace,Un as createTransport,Da as createUserFeedbackEnvelope,Fc as debugIntegration,Bc as dedupeIntegration,Wd as defaultIntegrations,Ht as defaultRequestInstrumentationOptions,Cd as defaultStackLineParsers,Fa as defaultStackParser,Wo as endSession,Ma as eventFromException,Na as eventFromMessage,Si as exceptionFromError,Hc as extraErrorDataIntegration,qu as extractTraceparentData,lT as feedbackIntegration,Hu as flush,oy as forceLoad,jr as functionToStringIntegration,xd as geckoStackLineParser,Pt as getActiveSpan,ye as getActiveTransaction,x as getClient,W as getCurrentHub,q as getCurrentScope,zd as getDefaultIntegrations,Fr as getHubFromCarrier,Eb as getReplay,jo as getSpanStatusFromHttpCode,Ii as globalHandlersIntegration,Wc as httpClientIntegration,vi as httpContextIntegration,zr as inboundFiltersIntegration,ny as init,zn as instrumentOutgoingRequests,Gu as isInitialized,$u as lastEventId,xi as linkedErrorsIntegration,eI as makeBrowserOfflineTransport,La as makeFetchTransport,zo as makeMain,Il as makeMultiplexedTransport,Pa as makeXHRTransport,Ul as metrics,pa as moduleMetadataIntegration,iy as onLoad,pI as onProfilingStartRouteTransaction,x_ as opera10StackLineParser,R_ as opera11StackLineParser,xl as parameterize,pp as replayCanvasIntegration,yb as replayIntegration,Uc as reportingObserverIntegration,$c as rewriteFramesIntegration,Ip as sendFeedback,Gc as sessionTimingIntegration,Go as setContext,ca as setCurrentClient,Mu as setExtra,Ou as setExtras,Lt as setHttpStatus,Xo as setMeasurement,Du as setTag,Nu as setTags,Lu as setUser,ry as showReportDialog,Ku as spanStatusfromHttpCode,wa as startBrowserTracingNavigationSpan,xa as startBrowserTracingPageLoadSpan,Dn as startInactiveSpan,Dr as startSession,Xu as startSpan,Zu as startSpanManual,Bu as startTransaction,Ju as trace,wd as winjsStackLineParser,Fu as withActiveSpan,Pu as withIsolationScope,De as withScope,sy as wrap};
365
- //# sourceMappingURL=esm-QEHFRL6L.js.map
365
+ //# sourceMappingURL=esm-MUZJUC5Q.js.map
package/build/index.js CHANGED
@@ -1,25 +1,25 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{a as x}from"./chunk-SIP7BHV7.js";import{a as Y}from"./chunk-HLCGKBPK.js";import"./chunk-LZ4SXWLW.js";import"./chunk-6OPLPT2G.js";import{h as H}from"./chunk-7JJKVPKL.js";import{a as $,c as E,e as be,h as m}from"./chunk-HFDLXX7R.js";var S=E(F=>{"use strict";m();var V=class extends Error{constructor(e,t,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},I=class extends V{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};F.CommanderError=V;F.InvalidArgumentError=I});var k=E(D=>{"use strict";m();var{InvalidArgumentError:we}=S(),q=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new we(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,i):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Ae(a){let e=a.name()+(a.variadic===!0?"...":"");return a.required?"<"+e+">":"["+e+"]"}D.Argument=q;D.humanReadableArgName=Ae});var W=E(Q=>{"use strict";m();var{humanReadableArgName:ve}=k(),N=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(n=>!n._hidden),i=e._getHelpCommand();return i&&!i._hidden&&t.push(i),this.sortSubcommands&&t.sort((n,r)=>n.name().localeCompare(r.name())),t}compareOptions(e,t){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(e).localeCompare(i(t))}visibleOptions(e){let t=e.options.filter(n=>!n.hidden),i=e._getHelpOption();if(i&&!i.hidden){let n=i.short&&e._findOption(i.short),r=i.long&&e._findOption(i.long);!n&&!r?t.push(i):i.long&&!r?t.push(e.createOption(i.long,i.description)):i.short&&!n&&t.push(e.createOption(i.short,i.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let i=e.parent;i;i=i.parent){let n=i.options.filter(r=>!r.hidden);t.push(...n)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(i=>ve(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((i,n)=>Math.max(i,t.subcommandTerm(n).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((i,n)=>Math.max(i,t.optionTerm(n).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((i,n)=>Math.max(i,t.optionTerm(n).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((i,n)=>Math.max(i,t.argumentTerm(n).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let i=`(${t.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatHelp(e,t){let i=t.padWidth(e,t),n=t.helpWidth||80,r=2,s=2;function h(p,v){if(v){let T=`${p.padEnd(i+s)}${v}`;return t.wrap(T,n-r,i+s)}return p}function o(p){return p.join(`
4
- `).replace(/^/gm," ".repeat(r))}let u=[`Usage: ${t.commandUsage(e)}`,""],l=t.commandDescription(e);l.length>0&&(u=u.concat([t.wrap(l,n,0),""]));let c=t.visibleArguments(e).map(p=>h(t.argumentTerm(p),t.argumentDescription(p)));c.length>0&&(u=u.concat(["Arguments:",o(c),""]));let C=t.visibleOptions(e).map(p=>h(t.optionTerm(p),t.optionDescription(p)));if(C.length>0&&(u=u.concat(["Options:",o(C),""])),this.showGlobalOptions){let p=t.visibleGlobalOptions(e).map(v=>h(t.optionTerm(v),t.optionDescription(v)));p.length>0&&(u=u.concat(["Global Options:",o(p),""]))}let y=t.visibleCommands(e).map(p=>h(t.subcommandTerm(p),t.subcommandDescription(p)));return y.length>0&&(u=u.concat(["Commands:",o(y),""])),u.join(`
5
- `)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,i,n=40){let r=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",s=new RegExp(`[\\n][${r}]+`);if(e.match(s))return e;let h=t-i;if(h<n)return e;let o=e.slice(0,i),u=e.slice(i).replace(`\r
3
+ import{a as x}from"./chunk-CXTD4ANR.js";import{a as Q}from"./chunk-YE7MFP76.js";import"./chunk-MNS7PUKJ.js";import"./chunk-6U7WFIFR.js";import{h as S}from"./chunk-I4ARVL5S.js";import{a as $,c as E,e as be,h as m}from"./chunk-V4TR6DCM.js";var H=E(q=>{"use strict";m();var V=class extends Error{constructor(e,t,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},F=class extends V{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};q.CommanderError=V;q.InvalidArgumentError=F});var k=E(N=>{"use strict";m();var{InvalidArgumentError:Ae}=H(),D=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new Ae(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,i):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function we(a){let e=a.name()+(a.variadic===!0?"...":"");return a.required?"<"+e+">":"["+e+"]"}N.Argument=D;N.humanReadableArgName=we});var M=E(X=>{"use strict";m();var{humanReadableArgName:ve}=k(),W=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(n=>!n._hidden),i=e._getHelpCommand();return i&&!i._hidden&&t.push(i),this.sortSubcommands&&t.sort((n,r)=>n.name().localeCompare(r.name())),t}compareOptions(e,t){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(e).localeCompare(i(t))}visibleOptions(e){let t=e.options.filter(n=>!n.hidden),i=e._getHelpOption();if(i&&!i.hidden){let n=i.short&&e._findOption(i.short),r=i.long&&e._findOption(i.long);!n&&!r?t.push(i):i.long&&!r?t.push(e.createOption(i.long,i.description)):i.short&&!n&&t.push(e.createOption(i.short,i.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let i=e.parent;i;i=i.parent){let n=i.options.filter(r=>!r.hidden);t.push(...n)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(i=>ve(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((i,n)=>Math.max(i,t.subcommandTerm(n).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((i,n)=>Math.max(i,t.optionTerm(n).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((i,n)=>Math.max(i,t.optionTerm(n).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((i,n)=>Math.max(i,t.argumentTerm(n).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let i=`(${t.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatHelp(e,t){let i=t.padWidth(e,t),n=t.helpWidth||80,r=2,s=2;function u(p,v){if(v){let I=`${p.padEnd(i+s)}${v}`;return t.wrap(I,n-r,i+s)}return p}function o(p){return p.join(`
4
+ `).replace(/^/gm," ".repeat(r))}let h=[`Usage: ${t.commandUsage(e)}`,""],l=t.commandDescription(e);l.length>0&&(h=h.concat([t.wrap(l,n,0),""]));let c=t.visibleArguments(e).map(p=>u(t.argumentTerm(p),t.argumentDescription(p)));c.length>0&&(h=h.concat(["Arguments:",o(c),""]));let _=t.visibleOptions(e).map(p=>u(t.optionTerm(p),t.optionDescription(p)));if(_.length>0&&(h=h.concat(["Options:",o(_),""])),this.showGlobalOptions){let p=t.visibleGlobalOptions(e).map(v=>u(t.optionTerm(v),t.optionDescription(v)));p.length>0&&(h=h.concat(["Global Options:",o(p),""]))}let y=t.visibleCommands(e).map(p=>u(t.subcommandTerm(p),t.subcommandDescription(p)));return y.length>0&&(h=h.concat(["Commands:",o(y),""])),h.join(`
5
+ `)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,i,n=40){let r=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",s=new RegExp(`[\\n][${r}]+`);if(e.match(s))return e;let u=t-i;if(u<n)return e;let o=e.slice(0,i),h=e.slice(i).replace(`\r
6
6
  `,`
7
- `),l=" ".repeat(i),C="\\s\u200B",y=new RegExp(`
8
- |.{1,${h-1}}([${C}]|$)|[^${C}]+?([${C}]|$)`,"g"),p=u.match(y)||[];return o+p.map((v,T)=>v===`
9
- `?"":(T>0?l:"")+v.trimEnd()).join(`
10
- `)}};Q.Help=N});var R=E(U=>{"use strict";m();var{InvalidArgumentError:Ee}=S(),M=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=ye(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new Ee(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,i):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return xe(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},j=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,t){let i=t.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,r=n!==void 0?n:!1;return t.negate===(r===e)}};function xe(a){return a.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function ye(a){let e,t,i=a.split(/[ |,]+/);return i.length>1&&!/^[[<]/.test(i[1])&&(e=i.shift()),t=i.shift(),!e&&/^-[^-]$/.test(t)&&(e=t,t=void 0),{shortFlag:e,longFlag:t}}U.Option=M;U.DualOptions=j});var Z=E(X=>{"use strict";m();function $e(a,e){if(Math.abs(a.length-e.length)>3)return Math.max(a.length,e.length);let t=[];for(let i=0;i<=a.length;i++)t[i]=[i];for(let i=0;i<=e.length;i++)t[0][i]=i;for(let i=1;i<=e.length;i++)for(let n=1;n<=a.length;n++){let r=1;a[n-1]===e[i-1]?r=0:r=1,t[n][i]=Math.min(t[n-1][i]+1,t[n][i-1]+1,t[n-1][i-1]+r),n>1&&i>1&&a[n-1]===e[i-2]&&a[n-2]===e[i-1]&&(t[n][i]=Math.min(t[n][i],t[n-2][i-2]+1))}return t[a.length][e.length]}function He(a,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=a.startsWith("--");t&&(a=a.slice(2),e=e.map(s=>s.slice(2)));let i=[],n=3,r=.4;return e.forEach(s=>{if(s.length<=1)return;let h=$e(a,s),o=Math.max(a.length,s.length);(o-h)/o>r&&(h<n?(n=h,i=[s]):h===n&&i.push(s))}),i.sort((s,h)=>s.localeCompare(h)),t&&(i=i.map(s=>`--${s}`)),i.length>1?`
7
+ `),l=" ".repeat(i),_="\\s\u200B",y=new RegExp(`
8
+ |.{1,${u-1}}([${_}]|$)|[^${_}]+?([${_}]|$)`,"g"),p=h.match(y)||[];return o+p.map((v,I)=>v===`
9
+ `?"":(I>0?l:"")+v.trimEnd()).join(`
10
+ `)}};X.Help=W});var G=E(R=>{"use strict";m();var{InvalidArgumentError:Ee}=H(),j=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=ye(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new Ee(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,i):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return xe(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},U=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,t){let i=t.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,r=n!==void 0?n:!1;return t.negate===(r===e)}};function xe(a){return a.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function ye(a){let e,t,i=a.split(/[ |,]+/);return i.length>1&&!/^[[<]/.test(i[1])&&(e=i.shift()),t=i.shift(),!e&&/^-[^-]$/.test(t)&&(e=t,t=void 0),{shortFlag:e,longFlag:t}}R.Option=j;R.DualOptions=U});var ee=E(Z=>{"use strict";m();function $e(a,e){if(Math.abs(a.length-e.length)>3)return Math.max(a.length,e.length);let t=[];for(let i=0;i<=a.length;i++)t[i]=[i];for(let i=0;i<=e.length;i++)t[0][i]=i;for(let i=1;i<=e.length;i++)for(let n=1;n<=a.length;n++){let r=1;a[n-1]===e[i-1]?r=0:r=1,t[n][i]=Math.min(t[n-1][i]+1,t[n][i-1]+1,t[n-1][i-1]+r),n>1&&i>1&&a[n-1]===e[i-2]&&a[n-2]===e[i-1]&&(t[n][i]=Math.min(t[n][i],t[n-2][i-2]+1))}return t[a.length][e.length]}function Se(a,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=a.startsWith("--");t&&(a=a.slice(2),e=e.map(s=>s.slice(2)));let i=[],n=3,r=.4;return e.forEach(s=>{if(s.length<=1)return;let u=$e(a,s),o=Math.max(a.length,s.length);(o-u)/o>r&&(u<n?(n=u,i=[s]):u===n&&i.push(s))}),i.sort((s,u)=>s.localeCompare(u)),t&&(i=i.map(s=>`--${s}`)),i.length>1?`
11
11
  (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
12
- (Did you mean ${i[0]}?)`:""}X.suggestSimilar=He});var re=E(ne=>{"use strict";m();var Se=$("events").EventEmitter,G=$("child_process"),A=$("path"),L=$("fs"),d=$("process"),{Argument:Ve,humanReadableArgName:ke}=k(),{CommanderError:B}=S(),{Help:Pe}=W(),{Option:ee,DualOptions:Te}=R(),{suggestSimilar:te}=Z(),J=class a extends Se{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>d.stdout.write(t),writeErr:t=>d.stderr.write(t),getOutHelpWidth:()=>d.stdout.isTTY?d.stdout.columns:void 0,getErrHelpWidth:()=>d.stderr.isTTY?d.stderr.columns:void 0,outputError:(t,i)=>i(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,i){let n=t,r=i;typeof n=="object"&&n!==null&&(r=n,n=null),r=r||{};let[,s,h]=e.match(/([^ ]+) *(.*)/),o=this.createCommand(s);return n&&(o.description(n),o._executableHandler=!0),r.isDefault&&(this._defaultCommandName=o._name),o._hidden=!!(r.noHelp||r.hidden),o._executableFile=r.executableFile||null,h&&o.arguments(h),this._registerCommand(o),o.parent=this,o.copyInheritedSettings(this),n?this:o}createCommand(e){return new a(e)}createHelp(){return Object.assign(new Pe,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
12
+ (Did you mean ${i[0]}?)`:""}Z.suggestSimilar=Se});var se=E(re=>{"use strict";m();var He=$("node:events").EventEmitter,L=$("node:child_process"),w=$("node:path"),B=$("node:fs"),d=$("node:process"),{Argument:Ve,humanReadableArgName:ke}=k(),{CommanderError:J}=H(),{Help:Pe}=M(),{Option:te,DualOptions:Te}=G(),{suggestSimilar:ie}=ee(),K=class a extends He{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>d.stdout.write(t),writeErr:t=>d.stderr.write(t),getOutHelpWidth:()=>d.stdout.isTTY?d.stdout.columns:void 0,getErrHelpWidth:()=>d.stderr.isTTY?d.stderr.columns:void 0,outputError:(t,i)=>i(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,i){let n=t,r=i;typeof n=="object"&&n!==null&&(r=n,n=null),r=r||{};let[,s,u]=e.match(/([^ ]+) *(.*)/),o=this.createCommand(s);return n&&(o.description(n),o._executableHandler=!0),r.isDefault&&(this._defaultCommandName=o._name),o._hidden=!!(r.noHelp||r.hidden),o._executableFile=r.executableFile||null,u&&o.arguments(u),this._registerCommand(o),o.parent=this,o.copyInheritedSettings(this),n?this:o}createCommand(e){return new a(e)}createHelp(){return Object.assign(new Pe,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
13
13
  - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new Ve(e,t)}argument(e,t,i,n){let r=this.createArgument(e,t);return typeof i=="function"?r.default(n).argParser(i):r.default(i),this.addArgument(r),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,i,n]=e.match(/([^ ]+) *(.*)/),r=t??"display help for command",s=this.createCommand(i);return s.helpOption(!1),n&&s.arguments(n),r&&s.description(r),this._addImplicitHelpCommand=!0,this._helpCommand=s,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
14
- Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,i){this._exitCallback&&this._exitCallback(new B(e,t,i)),d.exit(e)}action(e){let t=i=>{let n=this.registeredArguments.length,r=i.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)};return this._actionHandler=t,this}createOption(e,t){return new ee(e,t)}_callParseArg(e,t,i,n){try{return e.parseArg(t,i)}catch(r){if(r.code==="commander.invalidArgument"){let s=`${n} ${r.message}`;this.error(s,{exitCode:r.exitCode,code:r.code})}throw r}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
15
- - already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=n=>[n.name()].concat(n.aliases()),i=t(e).find(n=>this._findCommand(n));if(i){let n=t(this._findCommand(i)).join("|"),r=t(e).join("|");throw new Error(`cannot add command '${r}' as already have command '${n}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),i=e.attributeName();if(e.negate){let r=e.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(i,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let n=(r,s,h)=>{r==null&&e.presetArg!==void 0&&(r=e.presetArg);let o=this.getOptionValue(i);r!==null&&e.parseArg?r=this._callParseArg(e,r,o,s):r!==null&&e.variadic&&(r=e._concatValue(r,o)),r==null&&(e.negate?r=!1:e.isBoolean()||e.optional?r=!0:r=""),this.setOptionValueWithSource(i,r,h)};return this.on("option:"+t,r=>{let s=`error: option '${e.flags}' argument '${r}' is invalid.`;n(r,s,"cli")}),e.envVar&&this.on("optionEnv:"+t,r=>{let s=`error: option '${e.flags}' value '${r}' from env '${e.envVar}' is invalid.`;n(r,s,"env")}),this}_optionEx(e,t,i,n,r){if(typeof t=="object"&&t instanceof ee)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(t,i);if(s.makeOptionMandatory(!!e.mandatory),typeof n=="function")s.default(r).argParser(n);else if(n instanceof RegExp){let h=n;n=(o,u)=>{let l=h.exec(o);return l?l[0]:u},s.default(r).argParser(n)}else s.default(n);return this.addOption(s)}option(e,t,i,n){return this._optionEx({},e,t,i,n)}requiredOption(e,t,i,n){return this._optionEx({mandatory:!0},e,t,i,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,i){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(t=i.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");t=t||{},e===void 0&&(e=d.argv,d.versions&&d.versions.electron&&(t.from="electron")),this.rawArgs=e.slice();let i;switch(t.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":d.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,t){let i=this._prepareUserArgs(e,t);return this._parseCommand([],i),this}async parseAsync(e,t){let i=this._prepareUserArgs(e,t);return await this._parseCommand([],i),this}_executeSubCommand(e,t){t=t.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function r(l,c){let C=A.resolve(l,c);if(L.existsSync(C))return C;if(n.includes(A.extname(c)))return;let y=n.find(p=>L.existsSync(`${C}${p}`));if(y)return`${C}${y}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,h=this._executableDir||"";if(this._scriptPath){let l;try{l=L.realpathSync(this._scriptPath)}catch{l=this._scriptPath}h=A.resolve(A.dirname(l),h)}if(h){let l=r(h,s);if(!l&&!e._executableFile&&this._scriptPath){let c=A.basename(this._scriptPath,A.extname(this._scriptPath));c!==this._name&&(l=r(h,`${c}-${e._name}`))}s=l||s}i=n.includes(A.extname(s));let o;d.platform!=="win32"?i?(t.unshift(s),t=ie(d.execArgv).concat(t),o=G.spawn(d.argv[0],t,{stdio:"inherit"})):o=G.spawn(s,t,{stdio:"inherit"}):(t.unshift(s),t=ie(d.execArgv).concat(t),o=G.spawn(d.execPath,t,{stdio:"inherit"})),o.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{d.on(c,()=>{o.killed===!1&&o.exitCode===null&&o.kill(c)})});let u=this._exitCallback;o.on("close",(l,c)=>{l=l??1,u?u(new B(l,"commander.executeSubCommandAsync","(close)")):d.exit(l)}),o.on("error",l=>{if(l.code==="ENOENT"){let c=h?`searched for local subcommand relative to directory '${h}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",C=`'${s}' does not exist
14
+ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,i){this._exitCallback&&this._exitCallback(new J(e,t,i)),d.exit(e)}action(e){let t=i=>{let n=this.registeredArguments.length,r=i.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)};return this._actionHandler=t,this}createOption(e,t){return new te(e,t)}_callParseArg(e,t,i,n){try{return e.parseArg(t,i)}catch(r){if(r.code==="commander.invalidArgument"){let s=`${n} ${r.message}`;this.error(s,{exitCode:r.exitCode,code:r.code})}throw r}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
15
+ - already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=n=>[n.name()].concat(n.aliases()),i=t(e).find(n=>this._findCommand(n));if(i){let n=t(this._findCommand(i)).join("|"),r=t(e).join("|");throw new Error(`cannot add command '${r}' as already have command '${n}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),i=e.attributeName();if(e.negate){let r=e.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(i,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let n=(r,s,u)=>{r==null&&e.presetArg!==void 0&&(r=e.presetArg);let o=this.getOptionValue(i);r!==null&&e.parseArg?r=this._callParseArg(e,r,o,s):r!==null&&e.variadic&&(r=e._concatValue(r,o)),r==null&&(e.negate?r=!1:e.isBoolean()||e.optional?r=!0:r=""),this.setOptionValueWithSource(i,r,u)};return this.on("option:"+t,r=>{let s=`error: option '${e.flags}' argument '${r}' is invalid.`;n(r,s,"cli")}),e.envVar&&this.on("optionEnv:"+t,r=>{let s=`error: option '${e.flags}' value '${r}' from env '${e.envVar}' is invalid.`;n(r,s,"env")}),this}_optionEx(e,t,i,n,r){if(typeof t=="object"&&t instanceof te)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(t,i);if(s.makeOptionMandatory(!!e.mandatory),typeof n=="function")s.default(r).argParser(n);else if(n instanceof RegExp){let u=n;n=(o,h)=>{let l=u.exec(o);return l?l[0]:h},s.default(r).argParser(n)}else s.default(n);return this.addOption(s)}option(e,t,i,n){return this._optionEx({},e,t,i,n)}requiredOption(e,t,i,n){return this._optionEx({mandatory:!0},e,t,i,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,i){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(t=i.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){d.versions?.electron&&(t.from="electron");let n=d.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(t.from="eval")}e===void 0&&(e=d.argv),this.rawArgs=e.slice();let i;switch(t.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":d.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;case"eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,t){let i=this._prepareUserArgs(e,t);return this._parseCommand([],i),this}async parseAsync(e,t){let i=this._prepareUserArgs(e,t);return await this._parseCommand([],i),this}_executeSubCommand(e,t){t=t.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function r(l,c){let _=w.resolve(l,c);if(B.existsSync(_))return _;if(n.includes(w.extname(c)))return;let y=n.find(p=>B.existsSync(`${_}${p}`));if(y)return`${_}${y}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,u=this._executableDir||"";if(this._scriptPath){let l;try{l=B.realpathSync(this._scriptPath)}catch{l=this._scriptPath}u=w.resolve(w.dirname(l),u)}if(u){let l=r(u,s);if(!l&&!e._executableFile&&this._scriptPath){let c=w.basename(this._scriptPath,w.extname(this._scriptPath));c!==this._name&&(l=r(u,`${c}-${e._name}`))}s=l||s}i=n.includes(w.extname(s));let o;d.platform!=="win32"?i?(t.unshift(s),t=ne(d.execArgv).concat(t),o=L.spawn(d.argv[0],t,{stdio:"inherit"})):o=L.spawn(s,t,{stdio:"inherit"}):(t.unshift(s),t=ne(d.execArgv).concat(t),o=L.spawn(d.execPath,t,{stdio:"inherit"})),o.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{d.on(c,()=>{o.killed===!1&&o.exitCode===null&&o.kill(c)})});let h=this._exitCallback;o.on("close",l=>{l=l??1,h?h(new J(l,"commander.executeSubCommandAsync","(close)")):d.exit(l)}),o.on("error",l=>{if(l.code==="ENOENT"){let c=u?`searched for local subcommand relative to directory '${u}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",_=`'${s}' does not exist
16
16
  - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
17
17
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
18
- - ${c}`;throw new Error(C)}else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!u)d.exit(1);else{let c=new B(1,"commander.executeSubCommandAsync","(error)");c.nestedError=l,u(c)}}),this.runningCommand=o}_dispatchSubcommand(e,t,i){let n=this._findCommand(e);n||this.help({error:!0});let r;return r=this._chainOrCallSubCommandHook(r,n,"preSubcommand"),r=this._chainOrCall(r,()=>{if(n._executableHandler)this._executeSubCommand(n,t.concat(i));else return n._parseCommand(t,i)}),r}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(i,n,r)=>{let s=n;if(n!==null&&i.parseArg){let h=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;s=this._callParseArg(i,n,r,h)}return s};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((i,n)=>{let r=i.defaultValue;i.variadic?n<this.args.length?(r=this.args.slice(n),i.parseArg&&(r=r.reduce((s,h)=>e(i,h,s),i.defaultValue))):r===void 0&&(r=[]):n<this.args.length&&(r=this.args[n],i.parseArg&&(r=e(i,r,i.defaultValue))),t[n]=r}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let i=e,n=[];return this._getCommandAndAncestors().reverse().filter(r=>r._lifeCycleHooks[t]!==void 0).forEach(r=>{r._lifeCycleHooks[t].forEach(s=>{n.push({hookedCommand:r,callback:s})})}),t==="postAction"&&n.reverse(),n.forEach(r=>{i=this._chainOrCall(i,()=>r.callback(r.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,t,i){let n=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(r=>{n=this._chainOrCall(n,()=>r(this,t))}),n}_parseCommand(e,t){let i=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),t=i.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},r=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(r,e,t)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(r))n(),this._processArguments(),this.parent.emit(r,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=e.find(r=>i.conflictsWith.includes(r.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],i=[],n=t,r=e.slice();function s(o){return o.length>1&&o[0]==="-"}let h=null;for(;r.length;){let o=r.shift();if(o==="--"){n===i&&n.push(o),n.push(...r);break}if(h&&!s(o)){this.emit(`option:${h.name()}`,o);continue}if(h=null,s(o)){let u=this._findOption(o);if(u){if(u.required){let l=r.shift();l===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,l)}else if(u.optional){let l=null;r.length>0&&!s(r[0])&&(l=r.shift()),this.emit(`option:${u.name()}`,l)}else this.emit(`option:${u.name()}`);h=u.variadic?u:null;continue}}if(o.length>2&&o[0]==="-"&&o[1]!=="-"){let u=this._findOption(`-${o[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,o.slice(2)):(this.emit(`option:${u.name()}`),r.unshift(`-${o.slice(2)}`));continue}}if(/^--[^=]+=/.test(o)){let u=o.indexOf("="),l=this._findOption(o.slice(0,u));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,o.slice(u+1));continue}}if(s(o)&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&i.length===0){if(this._findCommand(o)){t.push(o),r.length>0&&i.push(...r);break}else if(this._getHelpCommand()&&o===this._getHelpCommand().name()){t.push(o),r.length>0&&t.push(...r);break}else if(this._defaultCommandName){i.push(o),r.length>0&&i.push(...r);break}}if(this._passThroughOptions){n.push(o),r.length>0&&n.push(...r);break}n.push(o)}return{operands:t,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let i=0;i<t;i++){let n=this.options[i].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
18
+ - ${c}`;throw new Error(_)}else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!h)d.exit(1);else{let c=new J(1,"commander.executeSubCommandAsync","(error)");c.nestedError=l,h(c)}}),this.runningCommand=o}_dispatchSubcommand(e,t,i){let n=this._findCommand(e);n||this.help({error:!0});let r;return r=this._chainOrCallSubCommandHook(r,n,"preSubcommand"),r=this._chainOrCall(r,()=>{if(n._executableHandler)this._executeSubCommand(n,t.concat(i));else return n._parseCommand(t,i)}),r}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(i,n,r)=>{let s=n;if(n!==null&&i.parseArg){let u=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;s=this._callParseArg(i,n,r,u)}return s};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((i,n)=>{let r=i.defaultValue;i.variadic?n<this.args.length?(r=this.args.slice(n),i.parseArg&&(r=r.reduce((s,u)=>e(i,u,s),i.defaultValue))):r===void 0&&(r=[]):n<this.args.length&&(r=this.args[n],i.parseArg&&(r=e(i,r,i.defaultValue))),t[n]=r}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let i=e,n=[];return this._getCommandAndAncestors().reverse().filter(r=>r._lifeCycleHooks[t]!==void 0).forEach(r=>{r._lifeCycleHooks[t].forEach(s=>{n.push({hookedCommand:r,callback:s})})}),t==="postAction"&&n.reverse(),n.forEach(r=>{i=this._chainOrCall(i,()=>r.callback(r.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,t,i){let n=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(r=>{n=this._chainOrCall(n,()=>r(this,t))}),n}_parseCommand(e,t){let i=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),t=i.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},r=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(r,e,t)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(r))n(),this._processArguments(),this.parent.emit(r,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=e.find(r=>i.conflictsWith.includes(r.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],i=[],n=t,r=e.slice();function s(o){return o.length>1&&o[0]==="-"}let u=null;for(;r.length;){let o=r.shift();if(o==="--"){n===i&&n.push(o),n.push(...r);break}if(u&&!s(o)){this.emit(`option:${u.name()}`,o);continue}if(u=null,s(o)){let h=this._findOption(o);if(h){if(h.required){let l=r.shift();l===void 0&&this.optionMissingArgument(h),this.emit(`option:${h.name()}`,l)}else if(h.optional){let l=null;r.length>0&&!s(r[0])&&(l=r.shift()),this.emit(`option:${h.name()}`,l)}else this.emit(`option:${h.name()}`);u=h.variadic?h:null;continue}}if(o.length>2&&o[0]==="-"&&o[1]!=="-"){let h=this._findOption(`-${o[1]}`);if(h){h.required||h.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${h.name()}`,o.slice(2)):(this.emit(`option:${h.name()}`),r.unshift(`-${o.slice(2)}`));continue}}if(/^--[^=]+=/.test(o)){let h=o.indexOf("="),l=this._findOption(o.slice(0,h));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,o.slice(h+1));continue}}if(s(o)&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&i.length===0){if(this._findCommand(o)){t.push(o),r.length>0&&i.push(...r);break}else if(this._getHelpCommand()&&o===this._getHelpCommand().name()){t.push(o),r.length>0&&t.push(...r);break}else if(this._defaultCommandName){i.push(o),r.length>0&&i.push(...r);break}}if(this._passThroughOptions){n.push(o),r.length>0&&n.push(...r);break}n.push(o)}return{operands:t,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let i=0;i<t;i++){let n=this.options[i].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
19
19
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
20
20
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
21
- `),this.outputHelp({error:!0}));let i=t||{},n=i.exitCode||1,r=i.code||"commander.error";this._exit(n,r,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in d.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,d.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Te(this.options),t=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&t(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!t(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let i=s=>{let h=s.attributeName(),o=this.getOptionValue(h),u=this.options.find(c=>c.negate&&h===c.attributeName()),l=this.options.find(c=>!c.negate&&h===c.attributeName());return u&&(u.presetArg===void 0&&o===!1||u.presetArg!==void 0&&o===u.presetArg)?u:l||s},n=s=>{let h=i(s),o=h.attributeName();return this.getOptionValueSource(o)==="env"?`environment variable '${h.envVar}'`:`option '${h.flags}'`},r=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(r,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{let s=r.createHelp().visibleOptions(r).filter(h=>h.long).map(h=>h.long);n=n.concat(s),r=r.parent}while(r&&!r._enablePositionalOptions);t=te(e,n)}let i=`error: unknown option '${e}'${t}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,i=t===1?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${i} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(r=>{n.push(r.name()),r.alias()&&n.push(r.alias())}),t=te(e,n)}let i=`error: unknown command '${e}'${t}`;this.error(i,{code:"commander.unknownCommand"})}version(e,t,i){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",i=i||"output the version number";let n=this.createOption(t,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
22
- `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(i=>ke(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=A.basename(e,A.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e=e||{};let t={error:!!e.error},i;return t.error?i=n=>this._outputConfiguration.writeErr(n):i=n=>this._outputConfiguration.writeOut(n),t.write=e.write||i,t.command=this,t}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let i=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(r=>r.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let n=this.helpInformation(i);if(t&&(n=t(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(r=>r.emit("afterAllHelp",i))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=d.exitCode||0;t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
21
+ `),this.outputHelp({error:!0}));let i=t||{},n=i.exitCode||1,r=i.code||"commander.error";this._exit(n,r,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in d.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,d.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Te(this.options),t=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&t(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!t(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let i=s=>{let u=s.attributeName(),o=this.getOptionValue(u),h=this.options.find(c=>c.negate&&u===c.attributeName()),l=this.options.find(c=>!c.negate&&u===c.attributeName());return h&&(h.presetArg===void 0&&o===!1||h.presetArg!==void 0&&o===h.presetArg)?h:l||s},n=s=>{let u=i(s),o=u.attributeName();return this.getOptionValueSource(o)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},r=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(r,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{let s=r.createHelp().visibleOptions(r).filter(u=>u.long).map(u=>u.long);n=n.concat(s),r=r.parent}while(r&&!r._enablePositionalOptions);t=ie(e,n)}let i=`error: unknown option '${e}'${t}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,i=t===1?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${i} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(r=>{n.push(r.name()),r.alias()&&n.push(r.alias())}),t=ie(e,n)}let i=`error: unknown command '${e}'${t}`;this.error(i,{code:"commander.unknownCommand"})}version(e,t,i){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",i=i||"output the version number";let n=this.createOption(t,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
22
+ `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(i=>ke(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=w.basename(e,w.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e=e||{};let t={error:!!e.error},i;return t.error?i=n=>this._outputConfiguration.writeErr(n):i=n=>this._outputConfiguration.writeOut(n),t.write=e.write||i,t.command=this,t}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let i=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(r=>r.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let n=this.helpInformation(i);if(t&&(n=t(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(r=>r.emit("afterAllHelp",i))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=d.exitCode||0;t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
23
23
  Expecting one of '${i.join("', '")}'`);let n=`${e}Help`;return this.on(n,r=>{let s;typeof t=="function"?s=t({error:r.error,command:r.command}):s=t,s&&r.write(`${s}
24
- `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(n=>t.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ie(a){return a.map(e=>{if(!e.startsWith("--inspect"))return e;let t,i="127.0.0.1",n="9229",r;return(r=e.match(/^(--inspect(-brk)?)$/))!==null?t=r[1]:(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=r[1],/^\d+$/.test(r[3])?n=r[3]:i=r[3]):(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=r[1],i=r[3],n=r[4]),t&&n!=="0"?`${t}=${i}:${parseInt(n)+1}`:e})}ne.Command=J});var he=E(b=>{"use strict";m();var{Argument:se}=k(),{Command:K}=re(),{CommanderError:Ie,InvalidArgumentError:oe}=S(),{Help:Fe}=W(),{Option:ae}=R();b.program=new K;b.createCommand=a=>new K(a);b.createOption=(a,e)=>new ae(a,e);b.createArgument=(a,e)=>new se(a,e);b.Command=K;b.Option=ae;b.Argument=se;b.Help=Fe;b.CommanderError=Ie;b.InvalidArgumentError=oe;b.InvalidOptionArgumentError=oe});var le=E((O,ue)=>{"use strict";m();var w=he();O=ue.exports={};O.program=new w.Command;O.Argument=w.Argument;O.Command=w.Command;O.CommanderError=w.CommanderError;O.Help=w.Help;O.InvalidArgumentError=w.InvalidArgumentError;O.InvalidOptionArgumentError=w.InvalidArgumentError;O.Option=w.Option;O.createCommand=a=>new w.Command(a);O.createOption=(a,e)=>new w.Option(a,e);O.createArgument=(a,e)=>new w.Argument(a,e)});m();m();m();var me=be(le(),1),{program:nt,createCommand:_,createArgument:rt,createOption:st,CommanderError:ot,InvalidArgumentError:z,InvalidOptionArgumentError:at,Command:ht,Argument:ut,Option:ce,Help:lt}=me.default;m();var de=a=>_("build").action(async(e,t)=>{let{runCommand:i}=await import("./render-command-PDPDZKND.js"),{build:n}=await import("./build-QLE4H4H2.js");await i(t,a,n)});m();import qe from"react";var pe=a=>{let e=x();return _("dev").option("-s, --https",e("dev_command_def.option.https")).action(async(t,i)=>{let{DevCommand:n}=await import("./DevCommand-TKHJTH22.js"),{renderCommand:r}=await import("./render-command-PDPDZKND.js"),{https:s=!1}=t;await r(i,a,qe.createElement(n,{https:s}),{watchForModelChanges:!0})})};m();import De from"react";m();function fe(a){let e=H.union([H.string().uuid(),H.literal("current")]).transform(t=>t==="current"?void 0:t).safeParse(a);if(e.success)return e.data;throw new z('Value must be a valid GUID or "current"')}function P(a){let e=H.string().url().safeParse(a);if(e.success)return e.data;throw new z("Value must be a valid URL")}var ge=a=>{let e=x();return _("preview").option("-s, --site <site-id>",e("app_preview_command_def.option.site"),fe).option("--base-url <url>",e("app_preview_command_def.option.base_url"),P).option("--no-input",e("app_preview_command_def.option.no_input")).action(async(t,i)=>{let{site:n,baseUrl:r,input:s}=t,{renderCommand:h,runCommand:o}=await import("./render-command-PDPDZKND.js");if(!s)return o(i,a,async()=>{let{nonInteractivePreview:l}=await import("./preview-LQ6YX5QD.js");return l({siteId:n,baseUrl:r},a)});let{PreviewCommand:u}=await import("./PreviewCommand-2DQ252RA.js");await h(i,a,De.createElement(u,{baseUrl:r,siteIdOverride:n}))})};m();import Ne from"react";var _e=a=>{let e=x();return _("create-version").addOption(new ce("-t, --version-type <type>",e("create_version_command_def.option.version_type")).choices(["major","minor"])).option("-y, --approve-preview",e("create_version_command_def.option.approve_preview")).option("--base-url <url>",e("create_version_command_def.option.base_url"),P).action(async(t,i)=>{let{VersionType:n}=await import("./types.impl-HD4UTKFC.js"),{renderCommand:r}=await import("./render-command-PDPDZKND.js"),{CreateVersionCommand:s}=await import("./CreateVersionCommand-CHX2UWME.js"),{approvePreview:h=!1,versionType:o,baseUrl:u}=t,l={major:n.MAJOR,minor:n.MINOR},c=o?l[o]:void 0;await r(i,a,Ne.createElement(s,{baseUrl:u,preApprovePreview:h,versionType:c}))})};m();import We from"react";var Ce=a=>_("serve").action(async(e,t)=>{let{renderCommand:i}=await import("./render-command-PDPDZKND.js"),{ServeCommand:n}=await import("./ServeCommand-XTHWLUDT.js");await i(t,a,We.createElement(n,null))});m();import Me from"react";var Oe=a=>{let e=x();return _("generate").description(e("generate_command.description")).action(async(t,i)=>{let{GenerateCommand:n}=await import("./GenerateCommand-PIRMS3PT.js"),{renderCommand:r}=await import("./render-command-PDPDZKND.js");await r(i,a,Me.createElement(n,null))})};var je=async a=>_("app").version(Y,"-v, --version","Output the version number").enablePositionalOptions(!0).helpOption("-h, --help","Display help for command").addHelpCommand(!1).addCommand(pe(a)).addCommand(de(a)).addCommand(Ce(a)).addCommand(ge(a)).addCommand(_e(a)).addCommand(Oe(a));export{je as getRootCommand};
24
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(n=>t.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ne(a){return a.map(e=>{if(!e.startsWith("--inspect"))return e;let t,i="127.0.0.1",n="9229",r;return(r=e.match(/^(--inspect(-brk)?)$/))!==null?t=r[1]:(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=r[1],/^\d+$/.test(r[3])?n=r[3]:i=r[3]):(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=r[1],i=r[3],n=r[4]),t&&n!=="0"?`${t}=${i}:${parseInt(n)+1}`:e})}re.Command=K});var he=E(b=>{"use strict";m();var{Argument:oe}=k(),{Command:z}=se(),{CommanderError:Ie,InvalidArgumentError:ae}=H(),{Help:Fe}=M(),{Option:ue}=G();b.program=new z;b.createCommand=a=>new z(a);b.createOption=(a,e)=>new ue(a,e);b.createArgument=(a,e)=>new oe(a,e);b.Command=z;b.Option=ue;b.Argument=oe;b.Help=Fe;b.CommanderError=Ie;b.InvalidArgumentError=ae;b.InvalidOptionArgumentError=ae});var me=E((O,le)=>{"use strict";m();var A=he();O=le.exports={};O.program=new A.Command;O.Argument=A.Argument;O.Command=A.Command;O.CommanderError=A.CommanderError;O.Help=A.Help;O.InvalidArgumentError=A.InvalidArgumentError;O.InvalidOptionArgumentError=A.InvalidArgumentError;O.Option=A.Option;O.createCommand=a=>new A.Command(a);O.createOption=(a,e)=>new A.Option(a,e);O.createArgument=(a,e)=>new A.Argument(a,e)});m();m();m();var ce=be(me(),1),{program:nt,createCommand:C,createArgument:rt,createOption:st,CommanderError:ot,InvalidArgumentError:Y,InvalidOptionArgumentError:at,Command:ut,Argument:ht,Option:de,Help:lt}=ce.default;m();var pe=a=>C("build").action(async(e,t)=>{let{runCommand:i}=await import("./render-command-SBXRR4MG.js"),{build:n}=await import("./build-FJMITZHU.js");await i(t,a,n)});m();import qe from"react";var fe=a=>{let e=x();return C("dev").option("-s, --https",e("dev_command_def.option.https")).action(async(t,i)=>{let{DevCommand:n}=await import("./DevCommand-GD7XT72H.js"),{renderCommand:r}=await import("./render-command-SBXRR4MG.js"),{https:s=!1}=t;await r(i,a,qe.createElement(n,{https:s}),{watchForModelChanges:!0})})};m();import De from"react";m();function P(a){let e=S.union([S.string().uuid(),S.literal("current")]).transform(t=>t==="current"?void 0:t).safeParse(a);if(e.success)return e.data;throw new Y('Value must be a valid GUID or "current"')}function T(a){let e=S.string().url().safeParse(a);if(e.success)return e.data;throw new Y("Value must be a valid URL")}var ge=a=>{let e=x();return C("preview").option("-s, --site <site-id>",e("app_preview_command_def.option.site"),P).option("--base-url <url>",e("app_preview_command_def.option.base_url"),T).option("--no-input",e("app_preview_command_def.option.no_input")).action(async(t,i)=>{let{site:n,baseUrl:r,input:s}=t,{renderCommand:u,runCommand:o}=await import("./render-command-SBXRR4MG.js");if(!s)return o(i,a,async()=>{let{nonInteractivePreview:l}=await import("./preview-3ZAXKZ4E.js");return l({siteId:n,baseUrl:r},a)});let{PreviewCommand:h}=await import("./PreviewCommand-HDEZ6LT3.js");await u(i,a,De.createElement(h,{baseUrl:r,siteIdOverride:n}))})};m();import Ne from"react";var _e=a=>{let e=x();return C("create-version").addOption(new de("-t, --version-type <type>",e("create_version_command_def.option.version_type")).choices(["major","minor"])).option("-s, --site <site-id>",e("create_version_command_def.option.site"),P).option("-y, --approve-preview",e("create_version_command_def.option.approve_preview")).option("--base-url <url>",e("create_version_command_def.option.base_url"),T).action(async(t,i)=>{let{VersionType:n}=await import("./types.impl-V4PI7Z6L.js"),{renderCommand:r}=await import("./render-command-SBXRR4MG.js"),{CreateVersionCommand:s}=await import("./CreateVersionCommand-3UL6NYDF.js"),{approvePreview:u=!1,versionType:o,baseUrl:h,site:l}=t,c={major:n.MAJOR,minor:n.MINOR},_=o?c[o]:void 0;await r(i,a,Ne.createElement(s,{baseUrl:h,siteIdOverride:l,preApprovePreview:u,versionType:_}))})};m();import We from"react";var Ce=a=>C("serve").action(async(e,t)=>{let{renderCommand:i}=await import("./render-command-SBXRR4MG.js"),{ServeCommand:n}=await import("./ServeCommand-YRMZVHZN.js");await i(t,a,We.createElement(n,null))});m();import Me from"react";var Oe=a=>{let e=x();return C("generate").description(e("generate_command.description")).action(async(t,i)=>{let{GenerateCommand:n}=await import("./GenerateCommand-YW37BTUB.js"),{renderCommand:r}=await import("./render-command-SBXRR4MG.js");await r(i,a,Me.createElement(n,null))})};var je=async a=>C("app").version(Q,"-v, --version","Output the version number").enablePositionalOptions(!0).helpOption("-h, --help","Display help for command").addHelpCommand(!1).addCommand(fe(a)).addCommand(pe(a)).addCommand(Ce(a)).addCommand(ge(a)).addCommand(_e(a)).addCommand(Oe(a));export{je as getRootCommand};
25
25
  //# sourceMappingURL=index.js.map