khoros-aurora-sdk 25.3.1 → 25.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build-hash.txt CHANGED
@@ -1 +1 @@
1
- 8440039
1
+ 6aebf80
@@ -576,7 +576,7 @@ type VisitsByReferrersBaseMetricWithChartData {
576
576
  "Metric."
577
577
  metric: BaseMetric!
578
578
  "Chart data with granularity of interval asked in the request."
579
- chartDataConnection: VisitsByReferrersChartDataConnection!
579
+ chartDataConnection: VisitsByReferrersChartDataConnection
580
580
  }
581
581
 
582
582
  "MemberEngagement Metric response object containing various metric data."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "khoros-aurora-sdk",
3
- "version": "25.3.1",
3
+ "version": "25.3.2",
4
4
  "author": "Khoros, LLC",
5
5
  "keywords": [
6
6
  "Khoros_Aurora_SDK",
@@ -1,6 +1,6 @@
1
- "use strict";var Vn=Object.create;var Be=Object.defineProperty;var Bn=Object.getOwnPropertyDescriptor;var Wn=Object.getOwnPropertyNames;var qn=Object.getPrototypeOf,Xn=Object.prototype.hasOwnProperty;var V=(e,t)=>()=>(e&&(t=e(e=0)),t);var x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nr=(e,t)=>{for(var r in t)Be(e,r,{get:t[r],enumerable:!0})},ir=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Wn(t))!Xn.call(e,i)&&i!==r&&Be(e,i,{get:()=>t[i],enumerable:!(n=Bn(t,i))||n.enumerable});return e};var R=(e,t,r)=>(r=e!=null?Vn(qn(e)):{},ir(t||!e||!e.__esModule?Be(r,"default",{value:e,enumerable:!0}):r,e)),or=e=>ir(Be({},"__esModule",{value:!0}),e);var lr,Ee=V(()=>{"use strict";lr=require("exenv");if(process.env.NODE_ENV!=="test"&&lr.canUseDOM)throw new Error("This code should never be exposed in the client bundle")});var pr=V(()=>{"use strict"});var fr=x(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.isAlsSupported=Q.getNodeVersion=Q.nodeVersionString=void 0;Q.nodeVersionString=process.versions.node;function Zn(e){let[t,r,n]=e.split(".");return{majorVersion:Number.parseInt(t),minorVersion:Number.parseInt(r),patchVersion:Number.parseInt(n)}}Q.getNodeVersion=Zn;function Qn(e){let{majorVersion:t,minorVersion:r}=e;return t>13?!0:t<12?!1:t===12?r>=17:t===13?r>=10:!1}Q.isAlsSupported=Qn});var dr=x(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.als=void 0;var Jn=require("async_hooks"),gt=new Jn.AsyncLocalStorage;ae.als={storageImplementation:"AsyncLocalStorage",get:e=>{let t=gt.getStore();return t?.get(e)},set:(e,t)=>{let r=gt.getStore();r?.set(e,t)},runWith:(e,t)=>{let r=t?new Map(Object.entries(t)):new Map;gt.run(r,()=>{e()})}};ae.default=ae.als});var Nr=x((h,Ar)=>{h=Ar.exports=v;var E;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?E=function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:E=function(){};h.SEMVER_SPEC_VERSION="2.0.0";var yt=256,qe=Number.MAX_SAFE_INTEGER||9007199254740991,mt=16,_=h.re=[],c=h.src=[],m=0,ce=m++;c[ce]="0|[1-9]\\d*";var ue=m++;c[ue]="[0-9]+";var Et=m++;c[Et]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var gr=m++;c[gr]="("+c[ce]+")\\.("+c[ce]+")\\.("+c[ce]+")";var mr=m++;c[mr]="("+c[ue]+")\\.("+c[ue]+")\\.("+c[ue]+")";var vt=m++;c[vt]="(?:"+c[ce]+"|"+c[Et]+")";var Tt=m++;c[Tt]="(?:"+c[ue]+"|"+c[Et]+")";var _t=m++;c[_t]="(?:-("+c[vt]+"(?:\\."+c[vt]+")*))";var wt=m++;c[wt]="(?:-?("+c[Tt]+"(?:\\."+c[Tt]+")*))";var bt=m++;c[bt]="[0-9A-Za-z-]+";var Le=m++;c[Le]="(?:\\+("+c[bt]+"(?:\\."+c[bt]+")*))";var Lt=m++,yr="v?"+c[gr]+c[_t]+"?"+c[Le]+"?";c[Lt]="^"+yr+"$";var Ot="[v=\\s]*"+c[mr]+c[wt]+"?"+c[Le]+"?",It=m++;c[It]="^"+Ot+"$";var fe=m++;c[fe]="((?:<|>)?=?)";var Xe=m++;c[Xe]=c[ue]+"|x|X|\\*";var Ke=m++;c[Ke]=c[ce]+"|x|X|\\*";var re=m++;c[re]="[v=\\s]*("+c[Ke]+")(?:\\.("+c[Ke]+")(?:\\.("+c[Ke]+")(?:"+c[_t]+")?"+c[Le]+"?)?)?";var pe=m++;c[pe]="[v=\\s]*("+c[Xe]+")(?:\\.("+c[Xe]+")(?:\\.("+c[Xe]+")(?:"+c[wt]+")?"+c[Le]+"?)?)?";var vr=m++;c[vr]="^"+c[fe]+"\\s*"+c[re]+"$";var Tr=m++;c[Tr]="^"+c[fe]+"\\s*"+c[pe]+"$";var br=m++;c[br]="(?:^|[^\\d])(\\d{1,"+mt+"})(?:\\.(\\d{1,"+mt+"}))?(?:\\.(\\d{1,"+mt+"}))?(?:$|[^\\d])";var et=m++;c[et]="(?:~>?)";var Ye=m++;c[Ye]="(\\s*)"+c[et]+"\\s+";_[Ye]=new RegExp(c[Ye],"g");var ei="$1~",Er=m++;c[Er]="^"+c[et]+c[re]+"$";var _r=m++;c[_r]="^"+c[et]+c[pe]+"$";var tt=m++;c[tt]="(?:\\^)";var ze=m++;c[ze]="(\\s*)"+c[tt]+"\\s+";_[ze]=new RegExp(c[ze],"g");var ti="$1^",wr=m++;c[wr]="^"+c[tt]+c[re]+"$";var Lr=m++;c[Lr]="^"+c[tt]+c[pe]+"$";var St=m++;c[St]="^"+c[fe]+"\\s*("+Ot+")$|^$";var xt=m++;c[xt]="^"+c[fe]+"\\s*("+yr+")$|^$";var _e=m++;c[_e]="(\\s*)"+c[fe]+"\\s*("+Ot+"|"+c[re]+")";_[_e]=new RegExp(c[_e],"g");var ri="$1$2$3",Or=m++;c[Or]="^\\s*("+c[re]+")\\s+-\\s+("+c[re]+")\\s*$";var Ir=m++;c[Ir]="^\\s*("+c[pe]+")\\s+-\\s+("+c[pe]+")\\s*$";var Sr=m++;c[Sr]="(<|>)?=?\\s*\\*";for(J=0;J<m;J++)E(J,c[J]),_[J]||(_[J]=new RegExp(c[J]));var J;h.parse=ne;function ne(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof v)return e;if(typeof e!="string"||e.length>yt)return null;var r=t.loose?_[It]:_[Lt];if(!r.test(e))return null;try{return new v(e,t)}catch{return null}}h.valid=ni;function ni(e,t){var r=ne(e,t);return r?r.version:null}h.clean=ii;function ii(e,t){var r=ne(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}h.SemVer=v;function v(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof v){if(e.loose===t.loose)return e;e=e.version}else if(typeof e!="string")throw new TypeError("Invalid Version: "+e);if(e.length>yt)throw new TypeError("version is longer than "+yt+" characters");if(!(this instanceof v))return new v(e,t);E("SemVer",e,t),this.options=t,this.loose=!!t.loose;var r=e.trim().match(t.loose?_[It]:_[Lt]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>qe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>qe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>qe||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var i=+n;if(i>=0&&i<qe)return i}return n}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}v.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version};v.prototype.toString=function(){return this.version};v.prototype.compare=function(e){return E("SemVer.compare",this.version,this.options,e),e instanceof v||(e=new v(e,this.options)),this.compareMain(e)||this.comparePre(e)};v.prototype.compareMain=function(e){return e instanceof v||(e=new v(e,this.options)),le(this.major,e.major)||le(this.minor,e.minor)||le(this.patch,e.patch)};v.prototype.comparePre=function(e){if(e instanceof v||(e=new v(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],n=e.prerelease[t];if(E("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r===n)continue;return le(r,n)}while(++t)};v.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this};h.inc=oi;function oi(e,t,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new v(e,r).inc(t,n).version}catch{return null}}h.diff=si;function si(e,t){if(At(e,t))return null;var r=ne(e),n=ne(t),i="";if(r.prerelease.length||n.prerelease.length){i="pre";var o="prerelease"}for(var s in r)if((s==="major"||s==="minor"||s==="patch")&&r[s]!==n[s])return i+s;return o}h.compareIdentifiers=le;var hr=/^[0-9]+$/;function le(e,t){var r=hr.test(e),n=hr.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1}h.rcompareIdentifiers=ai;function ai(e,t){return le(t,e)}h.major=ci;function ci(e,t){return new v(e,t).major}h.minor=ui;function ui(e,t){return new v(e,t).minor}h.patch=li;function li(e,t){return new v(e,t).patch}h.compare=X;function X(e,t,r){return new v(e,r).compare(new v(t,r))}h.compareLoose=pi;function pi(e,t){return X(e,t,!0)}h.rcompare=fi;function fi(e,t,r){return X(t,e,r)}h.sort=di;function di(e,t){return e.sort(function(r,n){return h.compare(r,n,t)})}h.rsort=hi;function hi(e,t){return e.sort(function(r,n){return h.rcompare(r,n,t)})}h.gt=we;function we(e,t,r){return X(e,t,r)>0}h.lt=Ze;function Ze(e,t,r){return X(e,t,r)<0}h.eq=At;function At(e,t,r){return X(e,t,r)===0}h.neq=xr;function xr(e,t,r){return X(e,t,r)!==0}h.gte=Nt;function Nt(e,t,r){return X(e,t,r)>=0}h.lte=Ct;function Ct(e,t,r){return X(e,t,r)<=0}h.cmp=Qe;function Qe(e,t,r,n){switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return At(e,r,n);case"!=":return xr(e,r,n);case">":return we(e,r,n);case">=":return Nt(e,r,n);case"<":return Ze(e,r,n);case"<=":return Ct(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}h.Comparator=U;function U(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof U){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof U))return new U(e,t);E("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Oe?this.value="":this.value=this.operator+this.semver.version,E("comp",this)}var Oe={};U.prototype.parse=function(e){var t=this.options.loose?_[St]:_[xt],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new v(r[2],this.options.loose):this.semver=Oe};U.prototype.toString=function(){return this.value};U.prototype.test=function(e){return E("Comparator.test",e,this.options.loose),this.semver===Oe?!0:(typeof e=="string"&&(e=new v(e,this.options)),Qe(e,this.operator,this.semver,this.options))};U.prototype.intersects=function(e,t){if(!(e instanceof U))throw new TypeError("a Comparator is required");(!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1});var r;if(this.operator==="")return r=new O(e.value,t),Je(this.value,r,t);if(e.operator==="")return r=new O(this.value,t),Je(e.semver,r,t);var n=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),i=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),o=this.semver.version===e.semver.version,s=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),u=Qe(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),a=Qe(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||i||o&&s||u||a};h.Range=O;function O(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof O)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new O(e.raw,t);if(e instanceof U)return new O(e.value,t);if(!(this instanceof O))return new O(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}O.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range};O.prototype.toString=function(){return this.range};O.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?_[Ir]:_[Or];e=e.replace(r,Li),E("hyphen replace",e),e=e.replace(_[_e],ri),E("comparator trim",e,_[_e]),e=e.replace(_[Ye],ei),e=e.replace(_[ze],ti),e=e.split(/\s+/).join(" ");var n=t?_[St]:_[xt],i=e.split(" ").map(function(o){return mi(o,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(i=i.filter(function(o){return!!o.match(n)})),i=i.map(function(o){return new U(o,this.options)},this),i};O.prototype.intersects=function(e,t){if(!(e instanceof O))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return e.set.some(function(i){return i.every(function(o){return n.intersects(o,t)})})})})};h.toComparators=gi;function gi(e,t){return new O(e,t).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}function mi(e,t){return E("comp",e,t),e=Ti(e,t),E("caret",e),e=yi(e,t),E("tildes",e),e=Ei(e,t),E("xrange",e),e=wi(e,t),E("stars",e),e}function k(e){return!e||e.toLowerCase()==="x"||e==="*"}function yi(e,t){return e.trim().split(/\s+/).map(function(r){return vi(r,t)}).join(" ")}function vi(e,t){var r=t.loose?_[_r]:_[Er];return e.replace(r,function(n,i,o,s,u){E("tilde",e,n,i,o,s,u);var a;return k(i)?a="":k(o)?a=">="+i+".0.0 <"+(+i+1)+".0.0":k(s)?a=">="+i+"."+o+".0 <"+i+"."+(+o+1)+".0":u?(E("replaceTilde pr",u),a=">="+i+"."+o+"."+s+"-"+u+" <"+i+"."+(+o+1)+".0"):a=">="+i+"."+o+"."+s+" <"+i+"."+(+o+1)+".0",E("tilde return",a),a})}function Ti(e,t){return e.trim().split(/\s+/).map(function(r){return bi(r,t)}).join(" ")}function bi(e,t){E("caret",e,t);var r=t.loose?_[Lr]:_[wr];return e.replace(r,function(n,i,o,s,u){E("caret",e,n,i,o,s,u);var a;return k(i)?a="":k(o)?a=">="+i+".0.0 <"+(+i+1)+".0.0":k(s)?i==="0"?a=">="+i+"."+o+".0 <"+i+"."+(+o+1)+".0":a=">="+i+"."+o+".0 <"+(+i+1)+".0.0":u?(E("replaceCaret pr",u),i==="0"?o==="0"?a=">="+i+"."+o+"."+s+"-"+u+" <"+i+"."+o+"."+(+s+1):a=">="+i+"."+o+"."+s+"-"+u+" <"+i+"."+(+o+1)+".0":a=">="+i+"."+o+"."+s+"-"+u+" <"+(+i+1)+".0.0"):(E("no pr"),i==="0"?o==="0"?a=">="+i+"."+o+"."+s+" <"+i+"."+o+"."+(+s+1):a=">="+i+"."+o+"."+s+" <"+i+"."+(+o+1)+".0":a=">="+i+"."+o+"."+s+" <"+(+i+1)+".0.0"),E("caret return",a),a})}function Ei(e,t){return E("replaceXRanges",e,t),e.split(/\s+/).map(function(r){return _i(r,t)}).join(" ")}function _i(e,t){e=e.trim();var r=t.loose?_[Tr]:_[vr];return e.replace(r,function(n,i,o,s,u,a){E("xRange",e,n,i,o,s,u,a);var l=k(o),f=l||k(s),p=f||k(u),g=p;return i==="="&&g&&(i=""),l?i===">"||i==="<"?n="<0.0.0":n="*":i&&g?(f&&(s=0),u=0,i===">"?(i=">=",f?(o=+o+1,s=0,u=0):(s=+s+1,u=0)):i==="<="&&(i="<",f?o=+o+1:s=+s+1),n=i+o+"."+s+"."+u):f?n=">="+o+".0.0 <"+(+o+1)+".0.0":p&&(n=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0"),E("xRange return",n),n})}function wi(e,t){return E("replaceStars",e,t),e.trim().replace(_[Sr],"")}function Li(e,t,r,n,i,o,s,u,a,l,f,p,g){return k(r)?t="":k(n)?t=">="+r+".0.0":k(i)?t=">="+r+"."+n+".0":t=">="+t,k(a)?u="":k(l)?u="<"+(+a+1)+".0.0":k(f)?u="<"+a+"."+(+l+1)+".0":p?u="<="+a+"."+l+"."+f+"-"+p:u="<="+u,(t+" "+u).trim()}O.prototype.test=function(e){if(!e)return!1;typeof e=="string"&&(e=new v(e,this.options));for(var t=0;t<this.set.length;t++)if(Oi(this.set[t],e,this.options))return!0;return!1};function Oi(e,t,r){for(var n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(n=0;n<e.length;n++)if(E(e[n].semver),e[n].semver!==Oe&&e[n].semver.prerelease.length>0){var i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}h.satisfies=Je;function Je(e,t,r){try{t=new O(t,r)}catch{return!1}return t.test(e)}h.maxSatisfying=Ii;function Ii(e,t,r){var n=null,i=null;try{var o=new O(t,r)}catch{return null}return e.forEach(function(s){o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new v(n,r))}),n}h.minSatisfying=Si;function Si(e,t,r){var n=null,i=null;try{var o=new O(t,r)}catch{return null}return e.forEach(function(s){o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new v(n,r))}),n}h.minVersion=xi;function xi(e,t){e=new O(e,t);var r=new v("0.0.0");if(e.test(r)||(r=new v("0.0.0-0"),e.test(r)))return r;r=null;for(var n=0;n<e.set.length;++n){var i=e.set[n];i.forEach(function(o){var s=new v(o.semver.version);switch(o.operator){case">":s.prerelease.length===0?s.patch++:s.prerelease.push(0),s.raw=s.format();case"":case">=":(!r||we(r,s))&&(r=s);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+o.operator)}})}return r&&e.test(r)?r:null}h.validRange=Ai;function Ai(e,t){try{return new O(e,t).range||"*"}catch{return null}}h.ltr=Ni;function Ni(e,t,r){return Rt(e,t,"<",r)}h.gtr=Ci;function Ci(e,t,r){return Rt(e,t,">",r)}h.outside=Rt;function Rt(e,t,r,n){e=new v(e,n),t=new O(t,n);var i,o,s,u,a;switch(r){case">":i=we,o=Ct,s=Ze,u=">",a=">=";break;case"<":i=Ze,o=Nt,s=we,u="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Je(e,t,n))return!1;for(var l=0;l<t.set.length;++l){var f=t.set[l],p=null,g=null;if(f.forEach(function(y){y.semver===Oe&&(y=new U(">=0.0.0")),p=p||y,g=g||y,i(y.semver,p.semver,n)?p=y:s(y.semver,g.semver,n)&&(g=y)}),p.operator===u||p.operator===a||(!g.operator||g.operator===u)&&o(e,g.semver))return!1;if(g.operator===a&&s(e,g.semver))return!1}return!0}h.prerelease=Ri;function Ri(e,t){var r=ne(e,t);return r&&r.prerelease.length?r.prerelease:null}h.intersects=ki;function ki(e,t,r){return e=new O(e,r),t=new O(t,r),e.intersects(t)}h.coerce=Pi;function Pi(e){if(e instanceof v)return e;if(typeof e!="string")return null;var t=e.match(_[br]);return t==null?null:ne(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}});var Pr=x((Ho,kr)=>{"use strict";function kt(e){return typeof e=="function"}var P=console.error.bind(console);function Ie(e,t,r){var n=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}function Se(e){e&&e.logger&&(kt(e.logger)?P=e.logger:P("new logger isn't a function, not replacing"))}function Cr(e,t,r){if(!e||!e[t]){P("no original function "+t+" to wrap");return}if(!r){P("no wrapper function"),P(new Error().stack);return}if(!kt(e[t])||!kt(r)){P("original object and wrapper must be functions");return}var n=e[t],i=r(n,t);return Ie(i,"__original",n),Ie(i,"__unwrap",function(){e[t]===i&&Ie(e,t,n)}),Ie(i,"__wrapped",!0),Ie(e,t,i),i}function $i(e,t,r){if(e)Array.isArray(e)||(e=[e]);else{P("must provide one or more modules to patch"),P(new Error().stack);return}if(!(t&&Array.isArray(t))){P("must provide one or more functions to wrap on modules");return}e.forEach(function(n){t.forEach(function(i){Cr(n,i,r)})})}function Rr(e,t){if(!e||!e[t]){P("no function to unwrap."),P(new Error().stack);return}if(!e[t].__unwrap)P("no original to unwrap to -- has "+t+" already been unwrapped?");else return e[t].__unwrap()}function Di(e,t){if(e)Array.isArray(e)||(e=[e]);else{P("must provide one or more modules to patch"),P(new Error().stack);return}if(!(t&&Array.isArray(t))){P("must provide one or more functions to unwrap on modules");return}e.forEach(function(r){t.forEach(function(n){Rr(r,n)})})}Se.wrap=Cr;Se.massWrap=$i;Se.unwrap=Rr;Se.massUnwrap=Di;kr.exports=Se});var Pt=x((Uo,Fr)=>{"use strict";var Dr=Pr(),de=Dr.wrap,rt=Dr.unwrap,K="wrap@before";function nt(e,t,r){var n=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}function ji(e,t){for(var r=t.length,n=0;n<r;n++){var i=t[n],o=e[K];if(typeof o=="function")o(i);else if(Array.isArray(o))for(var s=o.length,u=0;u<s;u++)o[u](i)}}function jr(e,t){var r;return r=e._events&&e._events[t],Array.isArray(r)||(r?r=[r]:r=[]),r}function Fi(e,t,r){var n=jr(e,t),i=n.filter(function(o){return r.indexOf(o)===-1});i.length>0&&ji(e,i)}function $r(e,t){if(e){var r=e;if(typeof e=="function")r=t(e);else if(Array.isArray(e)){r=[];for(var n=0;n<e.length;n++)r[n]=t(e[n])}return r}}Fr.exports=function(t,r,n){if(!t||!t.on||!t.addListener||!t.removeListener||!t.emit)throw new Error("can only wrap real EEs");if(!r)throw new Error("must have function to run on listener addition");if(!n)throw new Error("must have function to wrap listeners when emitting");function i(s){return function(a,l){var f=jr(this,a).slice();try{var p=s.call(this,a,l);return Fi(this,a,f),p}finally{this.on.__wrapped||de(this,"on",i),this.addListener.__wrapped||de(this,"addListener",i)}}}function o(s){return function(a){if(!this._events||!this._events[a])return s.apply(this,arguments);var l=this._events[a];function f(p){return function(){this._events[a]=l;try{return p.apply(this,arguments)}finally{l=this._events[a],this._events[a]=$r(l,n)}}}de(this,"removeListener",f);try{return this._events[a]=$r(l,n),s.apply(this,arguments)}finally{rt(this,"removeListener"),this._events[a]=l}}}t[K]?typeof t[K]=="function"?nt(t,K,[t[K],r]):Array.isArray(t[K])&&t[K].push(r):nt(t,K,r),t.__wrapped||(de(t,"addListener",i),de(t,"on",i),de(t,"emit",o),nt(t,"__unwrap",function(){rt(t,"addListener"),rt(t,"on"),rt(t,"emit"),delete t[K],delete t.__wrapped}),nt(t,"__wrapped",!0))}});var Gr=x((Mo,Mr)=>{"use strict";var b=require("util"),Y=require("assert"),Hi=Pt(),w=require("async_hooks"),xe="cls@contexts",Ae="error@context",I=process.env.DEBUG_CLS_HOOKED,T=-1;Mr.exports={getNamespace:Hr,createNamespace:Ui,destroyNamespace:Ur,reset:Mi,ERROR_SYMBOL:Ae};function M(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}M.prototype.set=function(t,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");if(this.active[t]=r,I){let n=" ".repeat(this._indent<0?0:this._indent);L(n+"CONTEXT-SET KEY:"+t+"="+r+" in ns:"+this.name+" currentUid:"+T+" active:"+b.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r};M.prototype.get=function(t){if(!this.active){if(I){let r=w.currentId(),n=w.triggerAsyncId(),i=" ".repeat(this._indent<0?0:this._indent);L(`${i}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${t}=undefined currentUid:${T} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(I){let r=w.executionAsyncId(),n=w.triggerAsyncId(),i=" ".repeat(this._indent<0?0:this._indent);L(i+"CONTEXT-GETTING KEY:"+t+"="+this.active[t]+" ("+this.name+") currentUid:"+T+" active:"+b.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),L(`${i}CONTEXT-GETTING KEY: (${this.name}) ${t}=${this.active[t]} currentUid:${T} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${b.inspect(this.active)}`)}return this.active[t]};M.prototype.createContext=function(){let t=Object.create(this.active?this.active:Object.prototype);if(t._ns_name=this.name,t.id=T,I){let r=w.executionAsyncId(),n=w.triggerAsyncId(),i=" ".repeat(this._indent<0?0:this._indent);L(`${i}CONTEXT-CREATED Context: (${this.name}) currentUid:${T} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${b.inspect(t,{showHidden:!0,depth:2,colors:!0})}`)}return t};M.prototype.run=function(t){let r=this.createContext();this.enter(r);try{if(I){let n=w.triggerAsyncId(),i=w.executionAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);L(`${o}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${T} triggerId:${n} asyncHooksCurrentId:${i} len:${this._set.length} context:${b.inspect(r)}`)}return t(r),r}catch(n){throw n&&(n[Ae]=r),n}finally{if(I){let n=w.triggerAsyncId(),i=w.executionAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);L(`${o}CONTEXT-RUN END: (${this.name}) currentUid:${T} triggerId:${n} asyncHooksCurrentId:${i} len:${this._set.length} ${b.inspect(r)}`)}this.exit(r)}};M.prototype.runAndReturn=function(t){let r;return this.run(function(n){r=t(n)}),r};M.prototype.runPromise=function(t){let r=this.createContext();this.enter(r);let n=t(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return I&&L("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+T+" len:"+this._set.length+" "+b.inspect(r)),n.then(i=>(I&&L("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+T+" len:"+this._set.length+" "+b.inspect(r)),this.exit(r),i)).catch(i=>{throw i[Ae]=r,I&&L("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+T+" len:"+this._set.length+" "+b.inspect(r)),this.exit(r),i})};M.prototype.bind=function(t,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return function(){n.enter(r);try{return t.apply(this,arguments)}catch(o){throw o&&(o[Ae]=r),o}finally{n.exit(r)}}};M.prototype.enter=function(t){if(Y.ok(t,"context must be provided for entering"),I){let r=w.executionAsyncId(),n=w.triggerAsyncId(),i=" ".repeat(this._indent<0?0:this._indent);L(`${i}CONTEXT-ENTER: (${this.name}) currentUid:${T} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${b.inspect(t)}`)}this._set.push(this.active),this.active=t};M.prototype.exit=function(t){if(Y.ok(t,"context must be provided for exiting"),I){let n=w.executionAsyncId(),i=w.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);L(`${o}CONTEXT-EXIT: (${this.name}) currentUid:${T} triggerId:${i} asyncHooksCurrentId:${n} len:${this._set.length} ${b.inspect(t)}`)}if(this.active===t){Y.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(t);r<0?(I&&L("??ERROR?? context exiting but not entered - ignoring: "+b.inspect(t)),Y.ok(r>=0,`context not currently entered; can't exit.
1
+ "use strict";var Bn=Object.create;var Be=Object.defineProperty;var Wn=Object.getOwnPropertyDescriptor;var qn=Object.getOwnPropertyNames;var Xn=Object.getPrototypeOf,Kn=Object.prototype.hasOwnProperty;var V=(e,t)=>()=>(e&&(t=e(e=0)),t);var x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nr=(e,t)=>{for(var r in t)Be(e,r,{get:t[r],enumerable:!0})},ir=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qn(t))!Kn.call(e,i)&&i!==r&&Be(e,i,{get:()=>t[i],enumerable:!(n=Wn(t,i))||n.enumerable});return e};var R=(e,t,r)=>(r=e!=null?Bn(Xn(e)):{},ir(t||!e||!e.__esModule?Be(r,"default",{value:e,enumerable:!0}):r,e)),or=e=>ir(Be({},"__esModule",{value:!0}),e);var lr,Ee=V(()=>{"use strict";lr=require("exenv");if(process.env.NODE_ENV!=="test"&&lr.canUseDOM)throw new Error("This code should never be exposed in the client bundle")});var pr=V(()=>{"use strict"});var fr=x(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.isAlsSupported=Q.getNodeVersion=Q.nodeVersionString=void 0;Q.nodeVersionString=process.versions.node;function Qn(e){let[t,r,n]=e.split(".");return{majorVersion:Number.parseInt(t),minorVersion:Number.parseInt(r),patchVersion:Number.parseInt(n)}}Q.getNodeVersion=Qn;function Jn(e){let{majorVersion:t,minorVersion:r}=e;return t>13?!0:t<12?!1:t===12?r>=17:t===13?r>=10:!1}Q.isAlsSupported=Jn});var dr=x(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.als=void 0;var ei=require("async_hooks"),gt=new ei.AsyncLocalStorage;ae.als={storageImplementation:"AsyncLocalStorage",get:e=>{let t=gt.getStore();return t?.get(e)},set:(e,t)=>{let r=gt.getStore();r?.set(e,t)},runWith:(e,t)=>{let r=t?new Map(Object.entries(t)):new Map;gt.run(r,()=>{e()})}};ae.default=ae.als});var Nr=x((h,Ar)=>{h=Ar.exports=v;var E;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?E=function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:E=function(){};h.SEMVER_SPEC_VERSION="2.0.0";var yt=256,qe=Number.MAX_SAFE_INTEGER||9007199254740991,mt=16,_=h.re=[],c=h.src=[],m=0,ce=m++;c[ce]="0|[1-9]\\d*";var ue=m++;c[ue]="[0-9]+";var Et=m++;c[Et]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var gr=m++;c[gr]="("+c[ce]+")\\.("+c[ce]+")\\.("+c[ce]+")";var mr=m++;c[mr]="("+c[ue]+")\\.("+c[ue]+")\\.("+c[ue]+")";var vt=m++;c[vt]="(?:"+c[ce]+"|"+c[Et]+")";var Tt=m++;c[Tt]="(?:"+c[ue]+"|"+c[Et]+")";var _t=m++;c[_t]="(?:-("+c[vt]+"(?:\\."+c[vt]+")*))";var wt=m++;c[wt]="(?:-?("+c[Tt]+"(?:\\."+c[Tt]+")*))";var bt=m++;c[bt]="[0-9A-Za-z-]+";var Le=m++;c[Le]="(?:\\+("+c[bt]+"(?:\\."+c[bt]+")*))";var Lt=m++,yr="v?"+c[gr]+c[_t]+"?"+c[Le]+"?";c[Lt]="^"+yr+"$";var Ot="[v=\\s]*"+c[mr]+c[wt]+"?"+c[Le]+"?",It=m++;c[It]="^"+Ot+"$";var fe=m++;c[fe]="((?:<|>)?=?)";var Xe=m++;c[Xe]=c[ue]+"|x|X|\\*";var Ke=m++;c[Ke]=c[ce]+"|x|X|\\*";var re=m++;c[re]="[v=\\s]*("+c[Ke]+")(?:\\.("+c[Ke]+")(?:\\.("+c[Ke]+")(?:"+c[_t]+")?"+c[Le]+"?)?)?";var pe=m++;c[pe]="[v=\\s]*("+c[Xe]+")(?:\\.("+c[Xe]+")(?:\\.("+c[Xe]+")(?:"+c[wt]+")?"+c[Le]+"?)?)?";var vr=m++;c[vr]="^"+c[fe]+"\\s*"+c[re]+"$";var Tr=m++;c[Tr]="^"+c[fe]+"\\s*"+c[pe]+"$";var br=m++;c[br]="(?:^|[^\\d])(\\d{1,"+mt+"})(?:\\.(\\d{1,"+mt+"}))?(?:\\.(\\d{1,"+mt+"}))?(?:$|[^\\d])";var et=m++;c[et]="(?:~>?)";var Ye=m++;c[Ye]="(\\s*)"+c[et]+"\\s+";_[Ye]=new RegExp(c[Ye],"g");var ti="$1~",Er=m++;c[Er]="^"+c[et]+c[re]+"$";var _r=m++;c[_r]="^"+c[et]+c[pe]+"$";var tt=m++;c[tt]="(?:\\^)";var ze=m++;c[ze]="(\\s*)"+c[tt]+"\\s+";_[ze]=new RegExp(c[ze],"g");var ri="$1^",wr=m++;c[wr]="^"+c[tt]+c[re]+"$";var Lr=m++;c[Lr]="^"+c[tt]+c[pe]+"$";var St=m++;c[St]="^"+c[fe]+"\\s*("+Ot+")$|^$";var xt=m++;c[xt]="^"+c[fe]+"\\s*("+yr+")$|^$";var _e=m++;c[_e]="(\\s*)"+c[fe]+"\\s*("+Ot+"|"+c[re]+")";_[_e]=new RegExp(c[_e],"g");var ni="$1$2$3",Or=m++;c[Or]="^\\s*("+c[re]+")\\s+-\\s+("+c[re]+")\\s*$";var Ir=m++;c[Ir]="^\\s*("+c[pe]+")\\s+-\\s+("+c[pe]+")\\s*$";var Sr=m++;c[Sr]="(<|>)?=?\\s*\\*";for(J=0;J<m;J++)E(J,c[J]),_[J]||(_[J]=new RegExp(c[J]));var J;h.parse=ne;function ne(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof v)return e;if(typeof e!="string"||e.length>yt)return null;var r=t.loose?_[It]:_[Lt];if(!r.test(e))return null;try{return new v(e,t)}catch{return null}}h.valid=ii;function ii(e,t){var r=ne(e,t);return r?r.version:null}h.clean=oi;function oi(e,t){var r=ne(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}h.SemVer=v;function v(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof v){if(e.loose===t.loose)return e;e=e.version}else if(typeof e!="string")throw new TypeError("Invalid Version: "+e);if(e.length>yt)throw new TypeError("version is longer than "+yt+" characters");if(!(this instanceof v))return new v(e,t);E("SemVer",e,t),this.options=t,this.loose=!!t.loose;var r=e.trim().match(t.loose?_[It]:_[Lt]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>qe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>qe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>qe||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var i=+n;if(i>=0&&i<qe)return i}return n}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}v.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version};v.prototype.toString=function(){return this.version};v.prototype.compare=function(e){return E("SemVer.compare",this.version,this.options,e),e instanceof v||(e=new v(e,this.options)),this.compareMain(e)||this.comparePre(e)};v.prototype.compareMain=function(e){return e instanceof v||(e=new v(e,this.options)),le(this.major,e.major)||le(this.minor,e.minor)||le(this.patch,e.patch)};v.prototype.comparePre=function(e){if(e instanceof v||(e=new v(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],n=e.prerelease[t];if(E("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r===n)continue;return le(r,n)}while(++t)};v.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this};h.inc=si;function si(e,t,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new v(e,r).inc(t,n).version}catch{return null}}h.diff=ai;function ai(e,t){if(At(e,t))return null;var r=ne(e),n=ne(t),i="";if(r.prerelease.length||n.prerelease.length){i="pre";var o="prerelease"}for(var s in r)if((s==="major"||s==="minor"||s==="patch")&&r[s]!==n[s])return i+s;return o}h.compareIdentifiers=le;var hr=/^[0-9]+$/;function le(e,t){var r=hr.test(e),n=hr.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1}h.rcompareIdentifiers=ci;function ci(e,t){return le(t,e)}h.major=ui;function ui(e,t){return new v(e,t).major}h.minor=li;function li(e,t){return new v(e,t).minor}h.patch=pi;function pi(e,t){return new v(e,t).patch}h.compare=X;function X(e,t,r){return new v(e,r).compare(new v(t,r))}h.compareLoose=fi;function fi(e,t){return X(e,t,!0)}h.rcompare=di;function di(e,t,r){return X(t,e,r)}h.sort=hi;function hi(e,t){return e.sort(function(r,n){return h.compare(r,n,t)})}h.rsort=gi;function gi(e,t){return e.sort(function(r,n){return h.rcompare(r,n,t)})}h.gt=we;function we(e,t,r){return X(e,t,r)>0}h.lt=Ze;function Ze(e,t,r){return X(e,t,r)<0}h.eq=At;function At(e,t,r){return X(e,t,r)===0}h.neq=xr;function xr(e,t,r){return X(e,t,r)!==0}h.gte=Nt;function Nt(e,t,r){return X(e,t,r)>=0}h.lte=Ct;function Ct(e,t,r){return X(e,t,r)<=0}h.cmp=Qe;function Qe(e,t,r,n){switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return At(e,r,n);case"!=":return xr(e,r,n);case">":return we(e,r,n);case">=":return Nt(e,r,n);case"<":return Ze(e,r,n);case"<=":return Ct(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}h.Comparator=U;function U(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof U){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof U))return new U(e,t);E("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Oe?this.value="":this.value=this.operator+this.semver.version,E("comp",this)}var Oe={};U.prototype.parse=function(e){var t=this.options.loose?_[St]:_[xt],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new v(r[2],this.options.loose):this.semver=Oe};U.prototype.toString=function(){return this.value};U.prototype.test=function(e){return E("Comparator.test",e,this.options.loose),this.semver===Oe?!0:(typeof e=="string"&&(e=new v(e,this.options)),Qe(e,this.operator,this.semver,this.options))};U.prototype.intersects=function(e,t){if(!(e instanceof U))throw new TypeError("a Comparator is required");(!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1});var r;if(this.operator==="")return r=new O(e.value,t),Je(this.value,r,t);if(e.operator==="")return r=new O(this.value,t),Je(e.semver,r,t);var n=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),i=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),o=this.semver.version===e.semver.version,s=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),u=Qe(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),a=Qe(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||i||o&&s||u||a};h.Range=O;function O(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof O)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new O(e.raw,t);if(e instanceof U)return new O(e.value,t);if(!(this instanceof O))return new O(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}O.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range};O.prototype.toString=function(){return this.range};O.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?_[Ir]:_[Or];e=e.replace(r,Oi),E("hyphen replace",e),e=e.replace(_[_e],ni),E("comparator trim",e,_[_e]),e=e.replace(_[Ye],ti),e=e.replace(_[ze],ri),e=e.split(/\s+/).join(" ");var n=t?_[St]:_[xt],i=e.split(" ").map(function(o){return yi(o,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(i=i.filter(function(o){return!!o.match(n)})),i=i.map(function(o){return new U(o,this.options)},this),i};O.prototype.intersects=function(e,t){if(!(e instanceof O))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return e.set.some(function(i){return i.every(function(o){return n.intersects(o,t)})})})})};h.toComparators=mi;function mi(e,t){return new O(e,t).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}function yi(e,t){return E("comp",e,t),e=bi(e,t),E("caret",e),e=vi(e,t),E("tildes",e),e=_i(e,t),E("xrange",e),e=Li(e,t),E("stars",e),e}function k(e){return!e||e.toLowerCase()==="x"||e==="*"}function vi(e,t){return e.trim().split(/\s+/).map(function(r){return Ti(r,t)}).join(" ")}function Ti(e,t){var r=t.loose?_[_r]:_[Er];return e.replace(r,function(n,i,o,s,u){E("tilde",e,n,i,o,s,u);var a;return k(i)?a="":k(o)?a=">="+i+".0.0 <"+(+i+1)+".0.0":k(s)?a=">="+i+"."+o+".0 <"+i+"."+(+o+1)+".0":u?(E("replaceTilde pr",u),a=">="+i+"."+o+"."+s+"-"+u+" <"+i+"."+(+o+1)+".0"):a=">="+i+"."+o+"."+s+" <"+i+"."+(+o+1)+".0",E("tilde return",a),a})}function bi(e,t){return e.trim().split(/\s+/).map(function(r){return Ei(r,t)}).join(" ")}function Ei(e,t){E("caret",e,t);var r=t.loose?_[Lr]:_[wr];return e.replace(r,function(n,i,o,s,u){E("caret",e,n,i,o,s,u);var a;return k(i)?a="":k(o)?a=">="+i+".0.0 <"+(+i+1)+".0.0":k(s)?i==="0"?a=">="+i+"."+o+".0 <"+i+"."+(+o+1)+".0":a=">="+i+"."+o+".0 <"+(+i+1)+".0.0":u?(E("replaceCaret pr",u),i==="0"?o==="0"?a=">="+i+"."+o+"."+s+"-"+u+" <"+i+"."+o+"."+(+s+1):a=">="+i+"."+o+"."+s+"-"+u+" <"+i+"."+(+o+1)+".0":a=">="+i+"."+o+"."+s+"-"+u+" <"+(+i+1)+".0.0"):(E("no pr"),i==="0"?o==="0"?a=">="+i+"."+o+"."+s+" <"+i+"."+o+"."+(+s+1):a=">="+i+"."+o+"."+s+" <"+i+"."+(+o+1)+".0":a=">="+i+"."+o+"."+s+" <"+(+i+1)+".0.0"),E("caret return",a),a})}function _i(e,t){return E("replaceXRanges",e,t),e.split(/\s+/).map(function(r){return wi(r,t)}).join(" ")}function wi(e,t){e=e.trim();var r=t.loose?_[Tr]:_[vr];return e.replace(r,function(n,i,o,s,u,a){E("xRange",e,n,i,o,s,u,a);var l=k(o),f=l||k(s),p=f||k(u),g=p;return i==="="&&g&&(i=""),l?i===">"||i==="<"?n="<0.0.0":n="*":i&&g?(f&&(s=0),u=0,i===">"?(i=">=",f?(o=+o+1,s=0,u=0):(s=+s+1,u=0)):i==="<="&&(i="<",f?o=+o+1:s=+s+1),n=i+o+"."+s+"."+u):f?n=">="+o+".0.0 <"+(+o+1)+".0.0":p&&(n=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0"),E("xRange return",n),n})}function Li(e,t){return E("replaceStars",e,t),e.trim().replace(_[Sr],"")}function Oi(e,t,r,n,i,o,s,u,a,l,f,p,g){return k(r)?t="":k(n)?t=">="+r+".0.0":k(i)?t=">="+r+"."+n+".0":t=">="+t,k(a)?u="":k(l)?u="<"+(+a+1)+".0.0":k(f)?u="<"+a+"."+(+l+1)+".0":p?u="<="+a+"."+l+"."+f+"-"+p:u="<="+u,(t+" "+u).trim()}O.prototype.test=function(e){if(!e)return!1;typeof e=="string"&&(e=new v(e,this.options));for(var t=0;t<this.set.length;t++)if(Ii(this.set[t],e,this.options))return!0;return!1};function Ii(e,t,r){for(var n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(n=0;n<e.length;n++)if(E(e[n].semver),e[n].semver!==Oe&&e[n].semver.prerelease.length>0){var i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}h.satisfies=Je;function Je(e,t,r){try{t=new O(t,r)}catch{return!1}return t.test(e)}h.maxSatisfying=Si;function Si(e,t,r){var n=null,i=null;try{var o=new O(t,r)}catch{return null}return e.forEach(function(s){o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new v(n,r))}),n}h.minSatisfying=xi;function xi(e,t,r){var n=null,i=null;try{var o=new O(t,r)}catch{return null}return e.forEach(function(s){o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new v(n,r))}),n}h.minVersion=Ai;function Ai(e,t){e=new O(e,t);var r=new v("0.0.0");if(e.test(r)||(r=new v("0.0.0-0"),e.test(r)))return r;r=null;for(var n=0;n<e.set.length;++n){var i=e.set[n];i.forEach(function(o){var s=new v(o.semver.version);switch(o.operator){case">":s.prerelease.length===0?s.patch++:s.prerelease.push(0),s.raw=s.format();case"":case">=":(!r||we(r,s))&&(r=s);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+o.operator)}})}return r&&e.test(r)?r:null}h.validRange=Ni;function Ni(e,t){try{return new O(e,t).range||"*"}catch{return null}}h.ltr=Ci;function Ci(e,t,r){return Rt(e,t,"<",r)}h.gtr=Ri;function Ri(e,t,r){return Rt(e,t,">",r)}h.outside=Rt;function Rt(e,t,r,n){e=new v(e,n),t=new O(t,n);var i,o,s,u,a;switch(r){case">":i=we,o=Ct,s=Ze,u=">",a=">=";break;case"<":i=Ze,o=Nt,s=we,u="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Je(e,t,n))return!1;for(var l=0;l<t.set.length;++l){var f=t.set[l],p=null,g=null;if(f.forEach(function(y){y.semver===Oe&&(y=new U(">=0.0.0")),p=p||y,g=g||y,i(y.semver,p.semver,n)?p=y:s(y.semver,g.semver,n)&&(g=y)}),p.operator===u||p.operator===a||(!g.operator||g.operator===u)&&o(e,g.semver))return!1;if(g.operator===a&&s(e,g.semver))return!1}return!0}h.prerelease=ki;function ki(e,t){var r=ne(e,t);return r&&r.prerelease.length?r.prerelease:null}h.intersects=Pi;function Pi(e,t,r){return e=new O(e,r),t=new O(t,r),e.intersects(t)}h.coerce=$i;function $i(e){if(e instanceof v)return e;if(typeof e!="string")return null;var t=e.match(_[br]);return t==null?null:ne(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}});var Pr=x((Uo,kr)=>{"use strict";function kt(e){return typeof e=="function"}var P=console.error.bind(console);function Ie(e,t,r){var n=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}function Se(e){e&&e.logger&&(kt(e.logger)?P=e.logger:P("new logger isn't a function, not replacing"))}function Cr(e,t,r){if(!e||!e[t]){P("no original function "+t+" to wrap");return}if(!r){P("no wrapper function"),P(new Error().stack);return}if(!kt(e[t])||!kt(r)){P("original object and wrapper must be functions");return}var n=e[t],i=r(n,t);return Ie(i,"__original",n),Ie(i,"__unwrap",function(){e[t]===i&&Ie(e,t,n)}),Ie(i,"__wrapped",!0),Ie(e,t,i),i}function Di(e,t,r){if(e)Array.isArray(e)||(e=[e]);else{P("must provide one or more modules to patch"),P(new Error().stack);return}if(!(t&&Array.isArray(t))){P("must provide one or more functions to wrap on modules");return}e.forEach(function(n){t.forEach(function(i){Cr(n,i,r)})})}function Rr(e,t){if(!e||!e[t]){P("no function to unwrap."),P(new Error().stack);return}if(!e[t].__unwrap)P("no original to unwrap to -- has "+t+" already been unwrapped?");else return e[t].__unwrap()}function ji(e,t){if(e)Array.isArray(e)||(e=[e]);else{P("must provide one or more modules to patch"),P(new Error().stack);return}if(!(t&&Array.isArray(t))){P("must provide one or more functions to unwrap on modules");return}e.forEach(function(r){t.forEach(function(n){Rr(r,n)})})}Se.wrap=Cr;Se.massWrap=Di;Se.unwrap=Rr;Se.massUnwrap=ji;kr.exports=Se});var Pt=x((Mo,Fr)=>{"use strict";var Dr=Pr(),de=Dr.wrap,rt=Dr.unwrap,K="wrap@before";function nt(e,t,r){var n=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}function Fi(e,t){for(var r=t.length,n=0;n<r;n++){var i=t[n],o=e[K];if(typeof o=="function")o(i);else if(Array.isArray(o))for(var s=o.length,u=0;u<s;u++)o[u](i)}}function jr(e,t){var r;return r=e._events&&e._events[t],Array.isArray(r)||(r?r=[r]:r=[]),r}function Hi(e,t,r){var n=jr(e,t),i=n.filter(function(o){return r.indexOf(o)===-1});i.length>0&&Fi(e,i)}function $r(e,t){if(e){var r=e;if(typeof e=="function")r=t(e);else if(Array.isArray(e)){r=[];for(var n=0;n<e.length;n++)r[n]=t(e[n])}return r}}Fr.exports=function(t,r,n){if(!t||!t.on||!t.addListener||!t.removeListener||!t.emit)throw new Error("can only wrap real EEs");if(!r)throw new Error("must have function to run on listener addition");if(!n)throw new Error("must have function to wrap listeners when emitting");function i(s){return function(a,l){var f=jr(this,a).slice();try{var p=s.call(this,a,l);return Hi(this,a,f),p}finally{this.on.__wrapped||de(this,"on",i),this.addListener.__wrapped||de(this,"addListener",i)}}}function o(s){return function(a){if(!this._events||!this._events[a])return s.apply(this,arguments);var l=this._events[a];function f(p){return function(){this._events[a]=l;try{return p.apply(this,arguments)}finally{l=this._events[a],this._events[a]=$r(l,n)}}}de(this,"removeListener",f);try{return this._events[a]=$r(l,n),s.apply(this,arguments)}finally{rt(this,"removeListener"),this._events[a]=l}}}t[K]?typeof t[K]=="function"?nt(t,K,[t[K],r]):Array.isArray(t[K])&&t[K].push(r):nt(t,K,r),t.__wrapped||(de(t,"addListener",i),de(t,"on",i),de(t,"emit",o),nt(t,"__unwrap",function(){rt(t,"addListener"),rt(t,"on"),rt(t,"emit"),delete t[K],delete t.__wrapped}),nt(t,"__wrapped",!0))}});var Gr=x((Go,Mr)=>{"use strict";var b=require("util"),Y=require("assert"),Ui=Pt(),w=require("async_hooks"),xe="cls@contexts",Ae="error@context",I=process.env.DEBUG_CLS_HOOKED,T=-1;Mr.exports={getNamespace:Hr,createNamespace:Mi,destroyNamespace:Ur,reset:Gi,ERROR_SYMBOL:Ae};function M(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}M.prototype.set=function(t,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");if(this.active[t]=r,I){let n=" ".repeat(this._indent<0?0:this._indent);L(n+"CONTEXT-SET KEY:"+t+"="+r+" in ns:"+this.name+" currentUid:"+T+" active:"+b.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r};M.prototype.get=function(t){if(!this.active){if(I){let r=w.currentId(),n=w.triggerAsyncId(),i=" ".repeat(this._indent<0?0:this._indent);L(`${i}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${t}=undefined currentUid:${T} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(I){let r=w.executionAsyncId(),n=w.triggerAsyncId(),i=" ".repeat(this._indent<0?0:this._indent);L(i+"CONTEXT-GETTING KEY:"+t+"="+this.active[t]+" ("+this.name+") currentUid:"+T+" active:"+b.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),L(`${i}CONTEXT-GETTING KEY: (${this.name}) ${t}=${this.active[t]} currentUid:${T} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${b.inspect(this.active)}`)}return this.active[t]};M.prototype.createContext=function(){let t=Object.create(this.active?this.active:Object.prototype);if(t._ns_name=this.name,t.id=T,I){let r=w.executionAsyncId(),n=w.triggerAsyncId(),i=" ".repeat(this._indent<0?0:this._indent);L(`${i}CONTEXT-CREATED Context: (${this.name}) currentUid:${T} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${b.inspect(t,{showHidden:!0,depth:2,colors:!0})}`)}return t};M.prototype.run=function(t){let r=this.createContext();this.enter(r);try{if(I){let n=w.triggerAsyncId(),i=w.executionAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);L(`${o}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${T} triggerId:${n} asyncHooksCurrentId:${i} len:${this._set.length} context:${b.inspect(r)}`)}return t(r),r}catch(n){throw n&&(n[Ae]=r),n}finally{if(I){let n=w.triggerAsyncId(),i=w.executionAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);L(`${o}CONTEXT-RUN END: (${this.name}) currentUid:${T} triggerId:${n} asyncHooksCurrentId:${i} len:${this._set.length} ${b.inspect(r)}`)}this.exit(r)}};M.prototype.runAndReturn=function(t){let r;return this.run(function(n){r=t(n)}),r};M.prototype.runPromise=function(t){let r=this.createContext();this.enter(r);let n=t(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return I&&L("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+T+" len:"+this._set.length+" "+b.inspect(r)),n.then(i=>(I&&L("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+T+" len:"+this._set.length+" "+b.inspect(r)),this.exit(r),i)).catch(i=>{throw i[Ae]=r,I&&L("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+T+" len:"+this._set.length+" "+b.inspect(r)),this.exit(r),i})};M.prototype.bind=function(t,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return function(){n.enter(r);try{return t.apply(this,arguments)}catch(o){throw o&&(o[Ae]=r),o}finally{n.exit(r)}}};M.prototype.enter=function(t){if(Y.ok(t,"context must be provided for entering"),I){let r=w.executionAsyncId(),n=w.triggerAsyncId(),i=" ".repeat(this._indent<0?0:this._indent);L(`${i}CONTEXT-ENTER: (${this.name}) currentUid:${T} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${b.inspect(t)}`)}this._set.push(this.active),this.active=t};M.prototype.exit=function(t){if(Y.ok(t,"context must be provided for exiting"),I){let n=w.executionAsyncId(),i=w.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);L(`${o}CONTEXT-EXIT: (${this.name}) currentUid:${T} triggerId:${i} asyncHooksCurrentId:${n} len:${this._set.length} ${b.inspect(t)}`)}if(this.active===t){Y.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(t);r<0?(I&&L("??ERROR?? context exiting but not entered - ignoring: "+b.inspect(t)),Y.ok(r>=0,`context not currently entered; can't exit.
2
2
  `+b.inspect(this)+`
3
- `+b.inspect(t))):(Y.ok(r,"can't remove top context"),this._set.splice(r,1))};M.prototype.bindEmitter=function(t){Y.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function i(s){s&&(s[xe]||(s[xe]=Object.create(null)),s[xe][n]={namespace:r,context:r.active})}function o(s){if(!(s&&s[xe]))return s;let u=s,a=s[xe];return Object.keys(a).forEach(function(l){let f=a[l];u=f.namespace.bind(u,f.context)}),u}Hi(t,i,o)};M.prototype.fromException=function(t){return t[Ae]};function Hr(e){return process.namespaces[e]}function Ui(e){Y.ok(e,"namespace must be given a name."),I&&L(`NS-CREATING NAMESPACE (${e})`);let t=new M(e);return t.id=T,w.createHook({init(n,i,o,s){if(T=w.executionAsyncId(),t.active){if(t._contexts.set(n,t.active),I){let u=" ".repeat(t._indent<0?0:t._indent);L(`${u}INIT [${i}] (${e}) asyncId:${n} currentUid:${T} triggerId:${o} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${s}`)}}else if(T===0){let u=w.triggerAsyncId(),a=t._contexts.get(u);if(a){if(t._contexts.set(n,a),I){let l=" ".repeat(t._indent<0?0:t._indent);L(`${l}INIT USING CONTEXT FROM TRIGGERID [${i}] (${e}) asyncId:${n} currentUid:${T} triggerId:${u} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${s}`)}}else if(I){let l=" ".repeat(t._indent<0?0:t._indent);L(`${l}INIT MISSING CONTEXT [${i}] (${e}) asyncId:${n} currentUid:${T} triggerId:${u} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${s}`)}}if(I&&i==="PROMISE"){L(b.inspect(s,{showHidden:!0}));let u=s.parentId,a=" ".repeat(t._indent<0?0:t._indent);L(`${a}INIT RESOURCE-PROMISE [${i}] (${e}) parentId:${u} asyncId:${n} currentUid:${T} triggerId:${o} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${s}`)}},before(n){T=w.executionAsyncId();let i;if(i=t._contexts.get(n)||t._contexts.get(T),i){if(I){let o=w.triggerAsyncId(),s=" ".repeat(t._indent<0?0:t._indent);L(`${s}BEFORE (${e}) asyncId:${n} currentUid:${T} triggerId:${o} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${b.inspect(i)}`),t._indent+=2}t.enter(i)}else if(I){let o=w.triggerAsyncId(),s=" ".repeat(t._indent<0?0:t._indent);L(`${s}BEFORE MISSING CONTEXT (${e}) asyncId:${n} currentUid:${T} triggerId:${o} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${b.inspect(t._contexts,{showHidden:!0,depth:2,colors:!0})}`),t._indent+=2}},after(n){T=w.executionAsyncId();let i;if(i=t._contexts.get(n)||t._contexts.get(T),i){if(I){let o=w.triggerAsyncId();t._indent-=2;let s=" ".repeat(t._indent<0?0:t._indent);L(`${s}AFTER (${e}) asyncId:${n} currentUid:${T} triggerId:${o} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${b.inspect(i)}`)}t.exit(i)}else if(I){let o=w.triggerAsyncId();t._indent-=2;let s=" ".repeat(t._indent<0?0:t._indent);L(`${s}AFTER MISSING CONTEXT (${e}) asyncId:${n} currentUid:${T} triggerId:${o} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${b.inspect(i)}`)}},destroy(n){if(T=w.executionAsyncId(),I){let i=w.triggerAsyncId(),o=" ".repeat(t._indent<0?0:t._indent);L(`${o}DESTROY (${e}) currentUid:${T} asyncId:${n} triggerId:${i} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${b.inspect(t._contexts.get(T))}`)}t._contexts.delete(n)}}).enable(),process.namespaces[e]=t,t}function Ur(e){let t=Hr(e);Y.ok(t,`can't delete nonexistent namespace! "`+e+'"'),Y.ok(t.id,"don't assign to process.namespaces directly! "+b.inspect(t)),process.namespaces[e]=null}function Mi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(e){Ur(e)}),process.namespaces=Object.create(null)}process.namespaces={};function L(...e){I&&process._rawDebug(`${b.format(...e)}`)}});var Br=x((Go,Vr)=>{"use strict";function Gi(){}Vr.exports=function(){let t=this._hooks,r=this._state,n=process.nextTick;process.nextTick=function(){if(!r.enabled)return n.apply(process,arguments);let i=new Array(arguments.length);for(let a=0;a<arguments.length;a++)i[a]=arguments[a];let o=i[0];if(typeof o!="function")throw new TypeError("callback is not a function");let s=new Gi,u=--r.counter;return t.init.call(s,u,0,null,null),i[0]=function(){t.pre.call(s,u);let a=!0;try{o.apply(this,arguments),a=!1}finally{a&&process.listenerCount("uncaughtException")>0&&process.once("uncaughtException",function(){t.post.call(s,u,!0),t.destroy.call(null,u)})}t.post.call(s,u,!1),t.destroy.call(null,u)},n.apply(process,i)}}});var qr=x((Vo,Wr)=>{"use strict";function Vi(){}Wr.exports=function(){let t=this._hooks,r=this._state,n=global.Promise,i=n.prototype.then;n.prototype.then=a;function o(l,f,p,g){return typeof l!="function"?g?s(p):u(p):function(){t.pre.call(f,p);try{return l.apply(this,arguments)}finally{t.post.call(f,p,!1),t.destroy.call(null,p)}}}function s(l){return function(p){return t.destroy.call(null,l),p}}function u(l){return function(p){throw t.destroy.call(null,l),p}}function a(l,f){if(!r.enabled)return i.call(this,l,f);let p=new Vi,g=--r.counter;return t.init.call(p,g,0,null,null),i.call(this,o(l,p,g,!0),o(f,p,g,!1))}}});var Kr=x((Bo,Xr)=>{"use strict";var D=require("timers");function Bi(){}function Wi(){}function qi(){}var Xi=new Map,Ki=new Map,Yi=new Map,$t=null,Dt=!1;Xr.exports=function(){jt(this._hooks,this._state,"setTimeout","clearTimeout",Bi,Xi,!0),jt(this._hooks,this._state,"setInterval","clearInterval",Wi,Ki,!1),jt(this._hooks,this._state,"setImmediate","clearImmediate",qi,Yi,!0),global.setTimeout=D.setTimeout,global.setInterval=D.setInterval,global.setImmediate=D.setImmediate,global.clearTimeout=D.clearTimeout,global.clearInterval=D.clearInterval,global.clearImmediate=D.clearImmediate};function jt(e,t,r,n,i,o,s){let u=D[r],a=D[n];D[r]=function(){if(!t.enabled)return u.apply(D,arguments);let l=new Array(arguments.length);for(let j=0;j<arguments.length;j++)l[j]=arguments[j];let f=l[0];if(typeof f!="function")throw new TypeError('"callback" argument must be a function');let p=new i,g=--t.counter,y;return e.init.call(p,g,0,null,null),l[0]=function(){$t=y,e.pre.call(p,g);let j=!0;try{f.apply(this,arguments),j=!1}finally{j&&process.listenerCount("uncaughtException")>0&&process.once("uncaughtException",function(){e.post.call(p,g,!0),o.delete(y),e.destroy.call(null,g)})}e.post.call(p,g,!1),$t=null,(s||Dt)&&(Dt=!1,o.delete(y),e.destroy.call(null,g))},y=u.apply(D,l),o.set(y,g),y},D[n]=function(l){if($t===l&&l!==null)Dt=!0;else if(o.has(l)){let f=o.get(l);o.delete(l),e.destroy.call(null,f)}a.apply(D,arguments)}}});var Ft=x((Wo,zi)=>{zi.exports={name:"async-hook-jl",description:"Inspect the life of handle objects in node",version:"1.7.6",author:"Andreas Madsen <amwebdk@gmail.com>",main:"./index.js",scripts:{test:"node ./test/runner.js && eslint ."},repository:{type:"git",url:"git://github.com/jeff-lewis/async-hook-jl.git"},keywords:["async","async hooks","inspect","async wrap"],license:"MIT",dependencies:{"stack-chain":"^1.3.7"},devDependencies:{async:"1.5.x","cli-color":"1.1.x",eslint:"^3.4.0",endpoint:"0.4.x"},engines:{node:"^4.7 || >=6.9 || >=7.3"}}});var Zr=x((qo,zr)=>{"use strict";var Ce=process.binding("async_wrap"),Zi=Ce.Providers.TIMERWRAP,Yr={nextTick:Br(),promise:qr(),timers:Kr()},Ne=new Set;function Qi(){this.enabled=!1,this.counter=0}function Ht(){let e=this.initFns=[],t=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(i,o,s,u){if(o===Zi){Ne.add(i);return}for(let a of e)a(i,this,o,s,u)},this.pre=function(i){if(!Ne.has(i))for(let o of t)o(i,this)},this.post=function(i,o){if(!Ne.has(i))for(let s of r)s(i,this,o)},this.destroy=function(i){if(Ne.has(i)){Ne.delete(i);return}for(let o of n)o(i)}}Ht.prototype.add=function(e){e.init&&this.initFns.push(e.init),e.pre&&this.preFns.push(e.pre),e.post&&this.postFns.push(e.post),e.destroy&&this.destroyFns.push(e.destroy)};function it(e,t){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}Ht.prototype.remove=function(e){e.init&&it(this.initFns,e.init),e.pre&&it(this.preFns,e.pre),e.post&&it(this.postFns,e.post),e.destroy&&it(this.destroyFns,e.destroy)};function Re(){this._state=new Qi,this._hooks=new Ht,this.version=Ft().version,this.providers=Ce.Providers;for(let e of Object.keys(Yr))Yr[e].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),Ce.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}zr.exports=Re;Re.prototype.addHooks=function(e){this._hooks.add(e)};Re.prototype.removeHooks=function(e){this._hooks.remove(e)};Re.prototype.enable=function(){this._state.enabled=!0,Ce.enable()};Re.prototype.disable=function(){this._state.enabled=!1,Ce.disable()}});var Ut=x((Xo,Ji)=>{Ji.exports={name:"stack-chain",description:"API for combining call site modifiers",version:"1.3.7",author:"Andreas Madsen <amwebdk@gmail.com>",scripts:{test:"tap ./test/simple"},repository:{type:"git",url:"git://github.com/AndreasMadsen/stack-chain.git"},keywords:["stack","chain","trace","call site","concat","format"],devDependencies:{tap:"2.x.x","uglify-js":"2.5.x"},license:"MIT"}});var Jr=x((Ko,Qr)=>{function eo(e){try{return Error.prototype.toString.call(e)}catch(t){try{return"<error: "+t+">"}catch{return"<error>"}}}Qr.exports=function(t,r){var n=[];n.push(eo(t));for(var i=0;i<r.length;i++){var o=r[i],s;try{s=o.toString()}catch(u){try{s="<error: "+u+">"}catch{s="<error>"}}n.push(" at "+s)}return n.join(`
4
- `)}});var nn=x((Yo,rn)=>{var ot=Jr();function tn(){this.extend=new ke,this.filter=new ke,this.format=new Pe,this.version=Ut().version}var Gt=!1;tn.prototype.callSite=function e(t){t||(t={}),Gt=!0;var r={};Error.captureStackTrace(r,e);var n=r.stack;return Gt=!1,n=n.slice(t.slice||0),t.extend&&(n=this.extend._modify(r,n)),t.filter&&(n=this.filter._modify(r,n)),n};var ee=new tn;function ke(){this._modifiers=[]}ke.prototype._modify=function(e,t){for(var r=0,n=this._modifiers.length;r<n;r++)t=this._modifiers[r](e,t);return t};ke.prototype.attach=function(e){this._modifiers.push(e)};ke.prototype.deattach=function(e){var t=this._modifiers.indexOf(e);return t===-1?!1:(this._modifiers.splice(t,1),!0)};function Pe(){this._formater=ot,this._previous=void 0}Pe.prototype.replace=function(e){e?this._formater=e:this.restore()};Pe.prototype.restore=function(){this._formater=ot,this._previous=void 0};Pe.prototype._backup=function(){this._previous=this._formater};Pe.prototype._roolback=function(){this._previous===ot?this.replace(void 0):this.replace(this._previous),this._previous=void 0};Error.prepareStackTrace&&ee.format.replace(Error.prepareStackTrace);var Mt=!1;function en(e,t){if(Gt)return t;if(Mt)return ot(e,t);var r=t.concat();r=ee.extend._modify(e,r),r=ee.filter._modify(e,r),r=r.slice(0,Error.stackTraceLimit),Object.isExtensible(e)&&Object.getOwnPropertyDescriptor(e,"callSite")===void 0&&(e.callSite={original:t,mutated:r}),Mt=!0;var n=ee.format._formater(e,r);return Mt=!1,n}Object.defineProperty(Error,"prepareStackTrace",{get:function(){return en},set:function(e){e===en?ee.format._roolback():(ee.format._backup(),ee.format.replace(e))}});function to(){return this.stack,this.callSite}Object.defineProperty(Error.prototype,"callSite",{get:to,set:function(e){Object.defineProperty(this,"callSite",{value:e,writable:!0,configurable:!0})},configurable:!0});rn.exports=ee});var Bt=x((zo,Vt)=>{if(global._stackChain)if(global._stackChain.version===Ut().version)Vt.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else Vt.exports=global._stackChain=nn()});var on=x((Zo,Wt)=>{"use strict";var ro=Zr();if(global._asyncHook)if(global._asyncHook.version===Ft().version)Wt.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else Bt().filter.attach(function(t,r){return r.filter(function(n){let i=n.getFileName();return!(i&&i.slice(0,__dirname.length)===__dirname)})}),Wt.exports=global._asyncHook=new ro});var pn=x((Qo,ln)=>{"use strict";var N=require("util"),z=require("assert"),no=Pt(),he=on(),$e="cls@contexts",De="error@context",an=[];for(let e in he.providers)an[he.providers[e]]=e;var S=process.env.DEBUG_CLS_HOOKED,C=-1;ln.exports={getNamespace:cn,createNamespace:io,destroyNamespace:un,reset:oo,ERROR_SYMBOL:De};function G(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map}G.prototype.set=function(t,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return S&&A(" SETTING KEY:"+t+"="+r+" in ns:"+this.name+" uid:"+C+" active:"+N.inspect(this.active,!0)),this.active[t]=r,r};G.prototype.get=function(t){if(!this.active){S&&A(" GETTING KEY:"+t+"=undefined "+this.name+" uid:"+C+" active:"+N.inspect(this.active,!0));return}return S&&A(" GETTING KEY:"+t+"="+this.active[t]+" "+this.name+" uid:"+C+" active:"+N.inspect(this.active,!0)),this.active[t]};G.prototype.createContext=function(){S&&A(" CREATING Context: "+this.name+" uid:"+C+" len:"+this._set.length+" active:"+N.inspect(this.active,!0,2,!0));let t=Object.create(this.active?this.active:Object.prototype);return t._ns_name=this.name,t.id=C,S&&A(" CREATED Context: "+this.name+" uid:"+C+" len:"+this._set.length+" context:"+N.inspect(t,!0,2,!0)),t};G.prototype.run=function(t){let r=this.createContext();this.enter(r);try{return S&&A(" BEFORE RUN: "+this.name+" uid:"+C+" len:"+this._set.length+" "+N.inspect(r)),t(r),r}catch(n){throw n&&(n[De]=r),n}finally{S&&A(" AFTER RUN: "+this.name+" uid:"+C+" len:"+this._set.length+" "+N.inspect(r)),this.exit(r)}};G.prototype.runAndReturn=function(t){var r;return this.run(function(n){r=t(n)}),r};G.prototype.runPromise=function(t){let r=this.createContext();this.enter(r);let n=t(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return S&&A(" BEFORE runPromise: "+this.name+" uid:"+C+" len:"+this._set.length+" "+N.inspect(r)),n.then(i=>(S&&A(" AFTER runPromise: "+this.name+" uid:"+C+" len:"+this._set.length+" "+N.inspect(r)),this.exit(r),i)).catch(i=>{throw i[De]=r,S&&A(" AFTER runPromise: "+this.name+" uid:"+C+" len:"+this._set.length+" "+N.inspect(r)),this.exit(r),i})};G.prototype.bind=function(t,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return function(){n.enter(r);try{return t.apply(this,arguments)}catch(o){throw o&&(o[De]=r),o}finally{n.exit(r)}}};G.prototype.enter=function(t){z.ok(t,"context must be provided for entering"),S&&A(" ENTER "+this.name+" uid:"+C+" len:"+this._set.length+" context: "+N.inspect(t)),this._set.push(this.active),this.active=t};G.prototype.exit=function(t){if(z.ok(t,"context must be provided for exiting"),S&&A(" EXIT "+this.name+" uid:"+C+" len:"+this._set.length+" context: "+N.inspect(t)),this.active===t){z.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(t);r<0?(S&&A("??ERROR?? context exiting but not entered - ignoring: "+N.inspect(t)),z.ok(r>=0,`context not currently entered; can't exit.
3
+ `+b.inspect(t))):(Y.ok(r,"can't remove top context"),this._set.splice(r,1))};M.prototype.bindEmitter=function(t){Y.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function i(s){s&&(s[xe]||(s[xe]=Object.create(null)),s[xe][n]={namespace:r,context:r.active})}function o(s){if(!(s&&s[xe]))return s;let u=s,a=s[xe];return Object.keys(a).forEach(function(l){let f=a[l];u=f.namespace.bind(u,f.context)}),u}Ui(t,i,o)};M.prototype.fromException=function(t){return t[Ae]};function Hr(e){return process.namespaces[e]}function Mi(e){Y.ok(e,"namespace must be given a name."),I&&L(`NS-CREATING NAMESPACE (${e})`);let t=new M(e);return t.id=T,w.createHook({init(n,i,o,s){if(T=w.executionAsyncId(),t.active){if(t._contexts.set(n,t.active),I){let u=" ".repeat(t._indent<0?0:t._indent);L(`${u}INIT [${i}] (${e}) asyncId:${n} currentUid:${T} triggerId:${o} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${s}`)}}else if(T===0){let u=w.triggerAsyncId(),a=t._contexts.get(u);if(a){if(t._contexts.set(n,a),I){let l=" ".repeat(t._indent<0?0:t._indent);L(`${l}INIT USING CONTEXT FROM TRIGGERID [${i}] (${e}) asyncId:${n} currentUid:${T} triggerId:${u} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${s}`)}}else if(I){let l=" ".repeat(t._indent<0?0:t._indent);L(`${l}INIT MISSING CONTEXT [${i}] (${e}) asyncId:${n} currentUid:${T} triggerId:${u} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${s}`)}}if(I&&i==="PROMISE"){L(b.inspect(s,{showHidden:!0}));let u=s.parentId,a=" ".repeat(t._indent<0?0:t._indent);L(`${a}INIT RESOURCE-PROMISE [${i}] (${e}) parentId:${u} asyncId:${n} currentUid:${T} triggerId:${o} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${s}`)}},before(n){T=w.executionAsyncId();let i;if(i=t._contexts.get(n)||t._contexts.get(T),i){if(I){let o=w.triggerAsyncId(),s=" ".repeat(t._indent<0?0:t._indent);L(`${s}BEFORE (${e}) asyncId:${n} currentUid:${T} triggerId:${o} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${b.inspect(i)}`),t._indent+=2}t.enter(i)}else if(I){let o=w.triggerAsyncId(),s=" ".repeat(t._indent<0?0:t._indent);L(`${s}BEFORE MISSING CONTEXT (${e}) asyncId:${n} currentUid:${T} triggerId:${o} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${b.inspect(t._contexts,{showHidden:!0,depth:2,colors:!0})}`),t._indent+=2}},after(n){T=w.executionAsyncId();let i;if(i=t._contexts.get(n)||t._contexts.get(T),i){if(I){let o=w.triggerAsyncId();t._indent-=2;let s=" ".repeat(t._indent<0?0:t._indent);L(`${s}AFTER (${e}) asyncId:${n} currentUid:${T} triggerId:${o} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${b.inspect(i)}`)}t.exit(i)}else if(I){let o=w.triggerAsyncId();t._indent-=2;let s=" ".repeat(t._indent<0?0:t._indent);L(`${s}AFTER MISSING CONTEXT (${e}) asyncId:${n} currentUid:${T} triggerId:${o} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${b.inspect(i)}`)}},destroy(n){if(T=w.executionAsyncId(),I){let i=w.triggerAsyncId(),o=" ".repeat(t._indent<0?0:t._indent);L(`${o}DESTROY (${e}) currentUid:${T} asyncId:${n} triggerId:${i} active:${b.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${b.inspect(t._contexts.get(T))}`)}t._contexts.delete(n)}}).enable(),process.namespaces[e]=t,t}function Ur(e){let t=Hr(e);Y.ok(t,`can't delete nonexistent namespace! "`+e+'"'),Y.ok(t.id,"don't assign to process.namespaces directly! "+b.inspect(t)),process.namespaces[e]=null}function Gi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(e){Ur(e)}),process.namespaces=Object.create(null)}process.namespaces={};function L(...e){I&&process._rawDebug(`${b.format(...e)}`)}});var Br=x((Vo,Vr)=>{"use strict";function Vi(){}Vr.exports=function(){let t=this._hooks,r=this._state,n=process.nextTick;process.nextTick=function(){if(!r.enabled)return n.apply(process,arguments);let i=new Array(arguments.length);for(let a=0;a<arguments.length;a++)i[a]=arguments[a];let o=i[0];if(typeof o!="function")throw new TypeError("callback is not a function");let s=new Vi,u=--r.counter;return t.init.call(s,u,0,null,null),i[0]=function(){t.pre.call(s,u);let a=!0;try{o.apply(this,arguments),a=!1}finally{a&&process.listenerCount("uncaughtException")>0&&process.once("uncaughtException",function(){t.post.call(s,u,!0),t.destroy.call(null,u)})}t.post.call(s,u,!1),t.destroy.call(null,u)},n.apply(process,i)}}});var qr=x((Bo,Wr)=>{"use strict";function Bi(){}Wr.exports=function(){let t=this._hooks,r=this._state,n=global.Promise,i=n.prototype.then;n.prototype.then=a;function o(l,f,p,g){return typeof l!="function"?g?s(p):u(p):function(){t.pre.call(f,p);try{return l.apply(this,arguments)}finally{t.post.call(f,p,!1),t.destroy.call(null,p)}}}function s(l){return function(p){return t.destroy.call(null,l),p}}function u(l){return function(p){throw t.destroy.call(null,l),p}}function a(l,f){if(!r.enabled)return i.call(this,l,f);let p=new Bi,g=--r.counter;return t.init.call(p,g,0,null,null),i.call(this,o(l,p,g,!0),o(f,p,g,!1))}}});var Kr=x((Wo,Xr)=>{"use strict";var D=require("timers");function Wi(){}function qi(){}function Xi(){}var Ki=new Map,Yi=new Map,zi=new Map,$t=null,Dt=!1;Xr.exports=function(){jt(this._hooks,this._state,"setTimeout","clearTimeout",Wi,Ki,!0),jt(this._hooks,this._state,"setInterval","clearInterval",qi,Yi,!1),jt(this._hooks,this._state,"setImmediate","clearImmediate",Xi,zi,!0),global.setTimeout=D.setTimeout,global.setInterval=D.setInterval,global.setImmediate=D.setImmediate,global.clearTimeout=D.clearTimeout,global.clearInterval=D.clearInterval,global.clearImmediate=D.clearImmediate};function jt(e,t,r,n,i,o,s){let u=D[r],a=D[n];D[r]=function(){if(!t.enabled)return u.apply(D,arguments);let l=new Array(arguments.length);for(let j=0;j<arguments.length;j++)l[j]=arguments[j];let f=l[0];if(typeof f!="function")throw new TypeError('"callback" argument must be a function');let p=new i,g=--t.counter,y;return e.init.call(p,g,0,null,null),l[0]=function(){$t=y,e.pre.call(p,g);let j=!0;try{f.apply(this,arguments),j=!1}finally{j&&process.listenerCount("uncaughtException")>0&&process.once("uncaughtException",function(){e.post.call(p,g,!0),o.delete(y),e.destroy.call(null,g)})}e.post.call(p,g,!1),$t=null,(s||Dt)&&(Dt=!1,o.delete(y),e.destroy.call(null,g))},y=u.apply(D,l),o.set(y,g),y},D[n]=function(l){if($t===l&&l!==null)Dt=!0;else if(o.has(l)){let f=o.get(l);o.delete(l),e.destroy.call(null,f)}a.apply(D,arguments)}}});var Ft=x((qo,Zi)=>{Zi.exports={name:"async-hook-jl",description:"Inspect the life of handle objects in node",version:"1.7.6",author:"Andreas Madsen <amwebdk@gmail.com>",main:"./index.js",scripts:{test:"node ./test/runner.js && eslint ."},repository:{type:"git",url:"git://github.com/jeff-lewis/async-hook-jl.git"},keywords:["async","async hooks","inspect","async wrap"],license:"MIT",dependencies:{"stack-chain":"^1.3.7"},devDependencies:{async:"1.5.x","cli-color":"1.1.x",eslint:"^3.4.0",endpoint:"0.4.x"},engines:{node:"^4.7 || >=6.9 || >=7.3"}}});var Zr=x((Xo,zr)=>{"use strict";var Ce=process.binding("async_wrap"),Qi=Ce.Providers.TIMERWRAP,Yr={nextTick:Br(),promise:qr(),timers:Kr()},Ne=new Set;function Ji(){this.enabled=!1,this.counter=0}function Ht(){let e=this.initFns=[],t=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(i,o,s,u){if(o===Qi){Ne.add(i);return}for(let a of e)a(i,this,o,s,u)},this.pre=function(i){if(!Ne.has(i))for(let o of t)o(i,this)},this.post=function(i,o){if(!Ne.has(i))for(let s of r)s(i,this,o)},this.destroy=function(i){if(Ne.has(i)){Ne.delete(i);return}for(let o of n)o(i)}}Ht.prototype.add=function(e){e.init&&this.initFns.push(e.init),e.pre&&this.preFns.push(e.pre),e.post&&this.postFns.push(e.post),e.destroy&&this.destroyFns.push(e.destroy)};function it(e,t){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}Ht.prototype.remove=function(e){e.init&&it(this.initFns,e.init),e.pre&&it(this.preFns,e.pre),e.post&&it(this.postFns,e.post),e.destroy&&it(this.destroyFns,e.destroy)};function Re(){this._state=new Ji,this._hooks=new Ht,this.version=Ft().version,this.providers=Ce.Providers;for(let e of Object.keys(Yr))Yr[e].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),Ce.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}zr.exports=Re;Re.prototype.addHooks=function(e){this._hooks.add(e)};Re.prototype.removeHooks=function(e){this._hooks.remove(e)};Re.prototype.enable=function(){this._state.enabled=!0,Ce.enable()};Re.prototype.disable=function(){this._state.enabled=!1,Ce.disable()}});var Ut=x((Ko,eo)=>{eo.exports={name:"stack-chain",description:"API for combining call site modifiers",version:"1.3.7",author:"Andreas Madsen <amwebdk@gmail.com>",scripts:{test:"tap ./test/simple"},repository:{type:"git",url:"git://github.com/AndreasMadsen/stack-chain.git"},keywords:["stack","chain","trace","call site","concat","format"],devDependencies:{tap:"2.x.x","uglify-js":"2.5.x"},license:"MIT"}});var Jr=x((Yo,Qr)=>{function to(e){try{return Error.prototype.toString.call(e)}catch(t){try{return"<error: "+t+">"}catch{return"<error>"}}}Qr.exports=function(t,r){var n=[];n.push(to(t));for(var i=0;i<r.length;i++){var o=r[i],s;try{s=o.toString()}catch(u){try{s="<error: "+u+">"}catch{s="<error>"}}n.push(" at "+s)}return n.join(`
4
+ `)}});var nn=x((zo,rn)=>{var ot=Jr();function tn(){this.extend=new ke,this.filter=new ke,this.format=new Pe,this.version=Ut().version}var Gt=!1;tn.prototype.callSite=function e(t){t||(t={}),Gt=!0;var r={};Error.captureStackTrace(r,e);var n=r.stack;return Gt=!1,n=n.slice(t.slice||0),t.extend&&(n=this.extend._modify(r,n)),t.filter&&(n=this.filter._modify(r,n)),n};var ee=new tn;function ke(){this._modifiers=[]}ke.prototype._modify=function(e,t){for(var r=0,n=this._modifiers.length;r<n;r++)t=this._modifiers[r](e,t);return t};ke.prototype.attach=function(e){this._modifiers.push(e)};ke.prototype.deattach=function(e){var t=this._modifiers.indexOf(e);return t===-1?!1:(this._modifiers.splice(t,1),!0)};function Pe(){this._formater=ot,this._previous=void 0}Pe.prototype.replace=function(e){e?this._formater=e:this.restore()};Pe.prototype.restore=function(){this._formater=ot,this._previous=void 0};Pe.prototype._backup=function(){this._previous=this._formater};Pe.prototype._roolback=function(){this._previous===ot?this.replace(void 0):this.replace(this._previous),this._previous=void 0};Error.prepareStackTrace&&ee.format.replace(Error.prepareStackTrace);var Mt=!1;function en(e,t){if(Gt)return t;if(Mt)return ot(e,t);var r=t.concat();r=ee.extend._modify(e,r),r=ee.filter._modify(e,r),r=r.slice(0,Error.stackTraceLimit),Object.isExtensible(e)&&Object.getOwnPropertyDescriptor(e,"callSite")===void 0&&(e.callSite={original:t,mutated:r}),Mt=!0;var n=ee.format._formater(e,r);return Mt=!1,n}Object.defineProperty(Error,"prepareStackTrace",{get:function(){return en},set:function(e){e===en?ee.format._roolback():(ee.format._backup(),ee.format.replace(e))}});function ro(){return this.stack,this.callSite}Object.defineProperty(Error.prototype,"callSite",{get:ro,set:function(e){Object.defineProperty(this,"callSite",{value:e,writable:!0,configurable:!0})},configurable:!0});rn.exports=ee});var Bt=x((Zo,Vt)=>{if(global._stackChain)if(global._stackChain.version===Ut().version)Vt.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else Vt.exports=global._stackChain=nn()});var on=x((Qo,Wt)=>{"use strict";var no=Zr();if(global._asyncHook)if(global._asyncHook.version===Ft().version)Wt.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else Bt().filter.attach(function(t,r){return r.filter(function(n){let i=n.getFileName();return!(i&&i.slice(0,__dirname.length)===__dirname)})}),Wt.exports=global._asyncHook=new no});var pn=x((Jo,ln)=>{"use strict";var N=require("util"),z=require("assert"),io=Pt(),he=on(),$e="cls@contexts",De="error@context",an=[];for(let e in he.providers)an[he.providers[e]]=e;var S=process.env.DEBUG_CLS_HOOKED,C=-1;ln.exports={getNamespace:cn,createNamespace:oo,destroyNamespace:un,reset:so,ERROR_SYMBOL:De};function G(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map}G.prototype.set=function(t,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return S&&A(" SETTING KEY:"+t+"="+r+" in ns:"+this.name+" uid:"+C+" active:"+N.inspect(this.active,!0)),this.active[t]=r,r};G.prototype.get=function(t){if(!this.active){S&&A(" GETTING KEY:"+t+"=undefined "+this.name+" uid:"+C+" active:"+N.inspect(this.active,!0));return}return S&&A(" GETTING KEY:"+t+"="+this.active[t]+" "+this.name+" uid:"+C+" active:"+N.inspect(this.active,!0)),this.active[t]};G.prototype.createContext=function(){S&&A(" CREATING Context: "+this.name+" uid:"+C+" len:"+this._set.length+" active:"+N.inspect(this.active,!0,2,!0));let t=Object.create(this.active?this.active:Object.prototype);return t._ns_name=this.name,t.id=C,S&&A(" CREATED Context: "+this.name+" uid:"+C+" len:"+this._set.length+" context:"+N.inspect(t,!0,2,!0)),t};G.prototype.run=function(t){let r=this.createContext();this.enter(r);try{return S&&A(" BEFORE RUN: "+this.name+" uid:"+C+" len:"+this._set.length+" "+N.inspect(r)),t(r),r}catch(n){throw n&&(n[De]=r),n}finally{S&&A(" AFTER RUN: "+this.name+" uid:"+C+" len:"+this._set.length+" "+N.inspect(r)),this.exit(r)}};G.prototype.runAndReturn=function(t){var r;return this.run(function(n){r=t(n)}),r};G.prototype.runPromise=function(t){let r=this.createContext();this.enter(r);let n=t(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return S&&A(" BEFORE runPromise: "+this.name+" uid:"+C+" len:"+this._set.length+" "+N.inspect(r)),n.then(i=>(S&&A(" AFTER runPromise: "+this.name+" uid:"+C+" len:"+this._set.length+" "+N.inspect(r)),this.exit(r),i)).catch(i=>{throw i[De]=r,S&&A(" AFTER runPromise: "+this.name+" uid:"+C+" len:"+this._set.length+" "+N.inspect(r)),this.exit(r),i})};G.prototype.bind=function(t,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return function(){n.enter(r);try{return t.apply(this,arguments)}catch(o){throw o&&(o[De]=r),o}finally{n.exit(r)}}};G.prototype.enter=function(t){z.ok(t,"context must be provided for entering"),S&&A(" ENTER "+this.name+" uid:"+C+" len:"+this._set.length+" context: "+N.inspect(t)),this._set.push(this.active),this.active=t};G.prototype.exit=function(t){if(z.ok(t,"context must be provided for exiting"),S&&A(" EXIT "+this.name+" uid:"+C+" len:"+this._set.length+" context: "+N.inspect(t)),this.active===t){z.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(t);r<0?(S&&A("??ERROR?? context exiting but not entered - ignoring: "+N.inspect(t)),z.ok(r>=0,`context not currently entered; can't exit.
5
5
  `+N.inspect(this)+`
6
- `+N.inspect(t))):(z.ok(r,"can't remove top context"),this._set.splice(r,1))};G.prototype.bindEmitter=function(t){z.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function i(s){s&&(s[$e]||(s[$e]=Object.create(null)),s[$e][n]={namespace:r,context:r.active})}function o(s){if(!(s&&s[$e]))return s;let u=s,a=s[$e];return Object.keys(a).forEach(function(l){let f=a[l];u=f.namespace.bind(u,f.context)}),u}no(t,i,o)};G.prototype.fromException=function(t){return t[De]};function cn(e){return process.namespaces[e]}function io(e){z.ok(e,"namespace must be given a name."),S&&A("CREATING NAMESPACE "+e);let t=new G(e);return t.id=C,he.addHooks({init(r,n,i,o,s){C=r,o?(t._contexts.set(r,t._contexts.get(o)),S&&A("PARENTID: "+e+" uid:"+r+" parent:"+o+" provider:"+i)):t._contexts.set(C,t.active),S&&A("INIT "+e+" uid:"+r+" parent:"+o+" provider:"+an[i]+" active:"+N.inspect(t.active,!0))},pre(r,n){C=r;let i=t._contexts.get(r);i?(S&&A(" PRE "+e+" uid:"+r+" handle:"+st(n)+" context:"+N.inspect(i)),t.enter(i)):S&&A(" PRE MISSING CONTEXT "+e+" uid:"+r+" handle:"+st(n))},post(r,n){C=r;let i=t._contexts.get(r);i?(S&&A(" POST "+e+" uid:"+r+" handle:"+st(n)+" context:"+N.inspect(i)),t.exit(i)):S&&A(" POST MISSING CONTEXT "+e+" uid:"+r+" handle:"+st(n))},destroy(r){C=r,S&&A("DESTROY "+e+" uid:"+r+" context:"+N.inspect(t._contexts.get(C))+" active:"+N.inspect(t.active,!0)),t._contexts.delete(r)}}),process.namespaces[e]=t,t}function un(e){let t=cn(e);z.ok(t,`can't delete nonexistent namespace! "`+e+'"'),z.ok(t.id,"don't assign to process.namespaces directly! "+N.inspect(t)),process.namespaces[e]=null}function oo(){process.namespaces&&Object.keys(process.namespaces).forEach(function(e){un(e)}),process.namespaces=Object.create(null)}process.namespaces={};he._state&&!he._state.enabled&&he.enable();function A(e){process.env.DEBUG&&process._rawDebug(e)}function st(e){if(!e)return e;if(typeof e=="function")return e.name?e.name:(e.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1];if(e.constructor&&e.constructor.name)return e.constructor.name}if(S){qt=Bt();for(sn in qt.filter._modifiers)qt.filter.deattach(sn)}var qt,sn});var fn=x((Jo,Xt)=>{"use strict";var so=Nr();process&&so.gte(process.versions.node,"8.0.0")?Xt.exports=Gr():Xt.exports=pn()});var dn=x(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.cls=void 0;var ao=fn(),ge=ao.createNamespace("@kibertoad/als");me.cls={storageImplementation:"cls-hooked",get:e=>{if(ge.active)return ge.get(e)},set:(e,t)=>{ge.active&&ge.set(e,t)},runWith:(e,t)=>{ge.run(()=>{if(t){let r=Object.keys(t);for(let n=0;n<r.length;n++)ge.set(r[n],t[r[n]])}e()})}};me.default=me.cls});var hn=x(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.als=void 0;var{getNodeVersion:co,isAlsSupported:uo,nodeVersionString:lo}=fr();ye.als=uo(co(lo))?dr().als:dn().cls;ye.default=ye.als});var gn,Kt,te,Yt=V(()=>{"use strict";gn=R(require("pino")),Kt=class{static getLogName(t){return(typeof t=="string"?t:t.id).replaceAll(/\.(tsx?|jsx?)/gi,"").split("/").filter(i=>i!==".").at(-1)}static validateLogLevel(t,r){if(t&&r){let n=r.toLowerCase(),{values:i}=gn.default.levels;if(i[n]===void 0)global.appLog?.warn("Unable to set %s log level to %s as it is an invalid value. Valid values are: %s",t,r,Object.keys(i));else return n}return null}},te=Kt});function po(e,t=!1){je?.debug("[log] Using file transport for log %s",e);let r=process.env.LOG_DIR;if(!r){je?.debug("[log] No process.env.LOG_DIR value found for log %s. Disabling file logging.",e);return}let n=process.env.USE_LOG_FILE_SERVICE_ID_PREFIX==="true",i=process.env.SERVICE_ID;if(n&&!i){je?.error("[log] No process.env.SERVICE_ID value found. Unable to set log file for log: "+e);return}let o=mn.default.resolve(r),s=n?`${i}-${e}`:e;try{let u=`${o}/${s}.log`,a={target:"pino/file",options:{destination:u,mkdir:!0,sync:t,append:!0}};return je?.info('[log] Log "%s" destination is file: %s',e,u),a}catch(u){je?.error("[log] Unable to set up log destination: %s for log: %s",o,e,u)}}var mn,je,yn,vn=V(()=>{"use strict";mn=R(require("node:path"));Ee();je=process.env.NODE_ENV==="production"?console:void 0;yn=po});function fo(){return{target:"pino-pretty",options:{colorize:!0,singleLine:!0,translateTime:"SYS:HH:MM:ss.l"}}}var at,zt=V(()=>{"use strict";at=fo});function ho(e,t={}){if(ct.has(e))return ct.get(e);let r=yn(e,t?.sync);if(r)return ct.set(e,r),r;if(t?.prettyPrint){let n=at();return ct.set(e,n),n}}var ct,Tn,bn=V(()=>{"use strict";vn();zt();Ee();ct=new Map;Tn=ho});var En,_n,Zt,ut,wn=V(()=>{"use strict";Ee();En=R(require("node:os")),_n=R(require("pino"));bn();Zt=class e{static getBase(){return{pid:process.pid,hostname:En.default.hostname()}}static buildLogger(t,r,n={}){let{hideLogName:i,mixin:o,transport:s}=n;return(0,_n.default)({name:i?void 0:t,level:r,base:e.getBase(),mixin:o,transport:s??Tn(t,n)})}static prettyPrintEnabled(){return process.env.NEXT_PUBLIC_LOG_PRETTY_PRINT_ENABLED==="true"}},ut=Zt});function go(e){return e?.split(/[\s,]+/)?.map(t=>t.trim())?.filter(t=>t?.length>0)}function lt(e){return e?go(e)?.map(r=>r.split("=")?.filter(n=>n?.trim()!==""))?.reduce((r,n)=>{let[i,o]=n;return r[i]=o,r},{}):{}}var ds,hs,Qt=V(()=>{"use strict";ds=new RegExp(/^[\w!#$%&'*-/=?^`{|}~]+\S@[\w!#$%&'*-/=?^`{|}~]+\.[\w!#$%&'*-/=?^`{|}~]+$/);hs=new RegExp(/^[\w.\-]+$/)});var Ln={};nr(Ln,{default:()=>mo});var pt,Jt,mo,On=V(()=>{"use strict";Ee();pr();pt=R(hn());Yt();wn();Qt();Jt=class e{constructor(){this.useTraceInfo=process.env.LOG_USE_TRACE_INFO==="true",this.logLevelApp=te.validateLogLevel("app",process.env.NEXT_PUBLIC_LOG_LEVEL)??"silent",this.appLogOverrides=lt(process.env.APP_LOG_LEVEL_OVERRIDES??""),this.prettyPrint=ut.prettyPrintEnabled();let t=this.useTraceInfo?()=>e.getTraceInfo():void 0;this.appLog=ut.buildLogger("app",this.logLevelApp,{mixin:t,prettyPrint:this.prettyPrint,hideLogName:!0}),this.syncLog=ut.buildLogger("app",this.logLevelApp,{mixin:t,prettyPrint:this.prettyPrint,hideLogName:!0,sync:!0})}getAppLog(t,r){let n=te.getLogName(t),i=te.validateLogLevel(n,this.appLogOverrides[n]);return i&&this.appLog.warn("Setting log level to %s for: %s ",i,n),this.appLog.child({name:n},{...r,level:i??this.logLevelApp})}getSyncLog(t,r){let n=te.getLogName(t);return this.syncLog.child({name:n},r)}static setForwardedForHeader(t){this.xForwardedForHeader=t}static buildTraceInfo(t,r){let n={},i=t.get("x-li-cid")||t.get("x-lithium-community-id")||r.locals.tenant?.id;i&&(n.cid=i);let o=t.get("x-li-tx")||t.get("x-lithium-tx-id")||`${process.hrtime.bigint()}`;o&&(n.tx=o);let s=t.get("x-li-frame")||t.get("x-lithium-activity-frame");if(s)try{let a=JSON.parse(s),{id:l,time:f}=a;n.frameId=l,n.frameTime=f}catch(a){console.error('Unable to get frame information from "x-lithium-community-id" header',a)}let u=r.locals.uid;if(u!=null&&(n.uid=u),process.env.TRACE_INFO_ADD_IP==="true"){let a=e.xForwardedForHeader?t.get(e.xForwardedForHeader)??t.ip:t.ip;a&&(n.ip=a)}if(process.env.TRACE_INFO_ADD_URL==="true"){let a=t.originalUrl;a&&(n.url=a)}if(process.env.TRACE_INFO_ADD_AUTH_TOKEN==="true"){let a=r.locals.authToken;a&&(n.authToken=`${a.providerName}:${a.token}`)}return n}static setTraceInfo(t,r){pt.als&&pt.als.set("traceInfo",e.buildTraceInfo(t,r))}static getTraceInfo(){return pt.als?.get("traceInfo")??{}}},mo=Jt});var Sn=x((er,In)=>{"use strict";function ve(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ve=function(r){return typeof r}:ve=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ve(e)}(function(e){var t=arguments,r=function(){var a=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,l=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,f=/[^-+\dA-Z]/g;return function(p,g,y,j){if(t.length===1&&u(p)==="string"&&!/\d/.test(p)&&(g=p,p=void 0),p=p||p===0?p:new Date,p instanceof Date||(p=new Date(p)),isNaN(p))throw TypeError("Invalid date");g=String(r.masks[g]||g||r.masks.default);var ie=g.slice(0,4);(ie==="UTC:"||ie==="GMT:")&&(g=g.slice(4),y=!0,ie==="GMT:"&&(j=!0));var $=function(){return y?"getUTC":"get"},F=function(){return p[$()+"Date"]()},W=function(){return p[$()+"Day"]()},H=function(){return p[$()+"Month"]()},oe=function(){return p[$()+"FullYear"]()},q=function(){return p[$()+"Hours"]()},He=function(){return p[$()+"Minutes"]()},Ue=function(){return p[$()+"Seconds"]()},Me=function(){return p[$()+"Milliseconds"]()},Z=function(){return y?0:p.getTimezoneOffset()},Ge=function(){return o(p)},ft=function(){return s(p)},Ve={d:function(){return F()},dd:function(){return n(F())},ddd:function(){return r.i18n.dayNames[W()]},DDD:function(){return i({y:oe(),m:H(),d:F(),_:$(),dayName:r.i18n.dayNames[W()],short:!0})},dddd:function(){return r.i18n.dayNames[W()+7]},DDDD:function(){return i({y:oe(),m:H(),d:F(),_:$(),dayName:r.i18n.dayNames[W()+7]})},m:function(){return H()+1},mm:function(){return n(H()+1)},mmm:function(){return r.i18n.monthNames[H()]},mmmm:function(){return r.i18n.monthNames[H()+12]},yy:function(){return String(oe()).slice(2)},yyyy:function(){return n(oe(),4)},h:function(){return q()%12||12},hh:function(){return n(q()%12||12)},H:function(){return q()},HH:function(){return n(q())},M:function(){return He()},MM:function(){return n(He())},s:function(){return Ue()},ss:function(){return n(Ue())},l:function(){return n(Me(),3)},L:function(){return n(Math.floor(Me()/10))},t:function(){return q()<12?r.i18n.timeNames[0]:r.i18n.timeNames[1]},tt:function(){return q()<12?r.i18n.timeNames[2]:r.i18n.timeNames[3]},T:function(){return q()<12?r.i18n.timeNames[4]:r.i18n.timeNames[5]},TT:function(){return q()<12?r.i18n.timeNames[6]:r.i18n.timeNames[7]},Z:function(){return j?"GMT":y?"UTC":(String(p).match(l)||[""]).pop().replace(f,"").replace(/GMT\+0000/g,"UTC")},o:function(){return(Z()>0?"-":"+")+n(Math.floor(Math.abs(Z())/60)*100+Math.abs(Z())%60,4)},p:function(){return(Z()>0?"-":"+")+n(Math.floor(Math.abs(Z())/60),2)+":"+n(Math.floor(Math.abs(Z())%60),2)},S:function(){return["th","st","nd","rd"][F()%10>3?0:(F()%100-F()%10!=10)*F()%10]},W:function(){return Ge()},WW:function(){return n(Ge())},N:function(){return ft()}};return g.replace(a,function(d){return d in Ve?Ve[d]():d.slice(1,d.length-1)})}}();r.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},r.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]};var n=function(l,f){for(l=String(l),f=f||2;l.length<f;)l="0"+l;return l},i=function(l){var f=l.y,p=l.m,g=l.d,y=l._,j=l.dayName,ie=l.short,$=ie===void 0?!1:ie,F=new Date,W=new Date;W.setDate(W[y+"Date"]()-1);var H=new Date;H.setDate(H[y+"Date"]()+1);var oe=function(){return F[y+"Date"]()},q=function(){return F[y+"Month"]()},He=function(){return F[y+"FullYear"]()},Ue=function(){return W[y+"Date"]()},Me=function(){return W[y+"Month"]()},Z=function(){return W[y+"FullYear"]()},Ge=function(){return H[y+"Date"]()},ft=function(){return H[y+"Month"]()},Ve=function(){return H[y+"FullYear"]()};return He()===f&&q()===p&&oe()===g?$?"Tdy":"Today":Z()===f&&Me()===p&&Ue()===g?$?"Ysd":"Yesterday":Ve()===f&&ft()===p&&Ge()===g?$?"Tmw":"Tomorrow":j},o=function(l){var f=new Date(l.getFullYear(),l.getMonth(),l.getDate());f.setDate(f.getDate()-(f.getDay()+6)%7+3);var p=new Date(f.getFullYear(),0,4);p.setDate(p.getDate()-(p.getDay()+6)%7+3);var g=f.getTimezoneOffset()-p.getTimezoneOffset();f.setHours(f.getHours()-g);var y=(f-p)/(864e5*7);return 1+Math.floor(y)},s=function(l){var f=l.getDay();return f===0&&(f=7),f},u=function(l){return l===null?"null":l===void 0?"undefined":ve(l)!=="object"?ve(l):Array.isArray(l)?"array":{}.toString.call(l).slice(8,-1).toLowerCase()};typeof define=="function"&&define.amd?define(function(){return r}):(typeof er>"u"?"undefined":ve(er))==="object"?In.exports=r:e.dateFormat=r})(void 0)});function yo(e,t,r,n){return[e,`background-color: ${t}; padding: 2px 3px; border-radius: 3px; color: white; ${r}`,"color: graytext","color: canvastext",...n??[]]}function vo(e,t,r,n){let{name:i,msg:o}=e,s=o?.replace(xn,"%O")??"",u=o?.match(xn)?.map(l=>{try{return JSON.parse(l)}catch{return l}})??[],a=(0,An.default)(Date.now(),"HH:MM:ss.l");return yo(`[${a}] %c${t}%c (${i}): %c${s}`,r,n,u)}function Te(e,t,r,n,i){return function(s){let u=r==="fatal"?"error":r;try{e[u](...t(s,r.toUpperCase(),n,i))}catch(a){e.error(a)}}}function To(e,t){return{trace:Te(e,t,"trace","magenta"),debug:Te(e,t,"debug","blue"),info:Te(e,t,"info","green"),warn:Te(e,t,"warn","orange"),error:Te(e,t,"error","red"),fatal:Te(e,t,"fatal","red","font-weight: bold")}}function Nn(e){return To(e,vo)}var An,xn,Cn=V(()=>{"use strict";An=R(Sn()),xn=new RegExp(/{(?:[^{}]|({(?:[^{}]|({(?:[^{}]|())*}))*}))*}/g)});var Pn={};nr(Pn,{default:()=>bo});var Rn,kn,tr,bo,$n=V(()=>{"use strict";Rn=R(require("next/config")),kn=R(require("pino"));Cn();Yt();Qt();zt();tr=class{constructor(){let t=(0,Rn.default)();this.logLevelApp=t?.publicRuntimeConfig?.logLevelApp??"silent";let r=t?.publicRuntimeConfig?.prettyPrint==="true";this.appLogOverrides=lt(t?.publicRuntimeConfig?.logLevelAppOverrides),this.rootLog=(0,kn.default)({level:this.logLevelApp,browser:{asObject:!r,write:r?Nn(console):void 0},transport:r?at():void 0})}getAppLog(t,r){let n=te.getLogName(t),i=te.validateLogLevel(n,this.appLogOverrides[n]);return i&&this.rootLog.warn("Setting log level to %s for: %s ",i,n),this.rootLog.child({name:n},{...r,level:i??this.logLevelApp})}},bo=tr});var We=require("fs-extra"),se=R(require("node:path")),cr=R(require("shelljs"));var Yn=R(require("fs-extra")),dt=R(require("node:path"));var ar=require("glob");var sr=R(require("pino")),Kn=(0,sr.default)({transport:{target:"pino-pretty",options:{sync:!0}},level:process.env.LOG_LEVEL??"info"});function B(e,t){return Kn.child({name:e??"sdk"},t)}var Co=B("filePathHelper");function ht(e,t){return(0,ar.glob)(e?.replaceAll(dt.default.sep,dt.default.posix.sep),t)}var be=B("graphql-types");async function zn(e,t,r){be.info("Building graphql types for plugin directory: %s",e);let n=t&&r?"**":t?"components":"endpoints",i=await ht(se.default.join(e,"src",n,"**","package.json"));return(await Promise.all(i.map(async s=>{let u=se.default.dirname(s),a=await ht(se.default.join(u,"**","*.graphql"));if(a.length>0){be.debug("Building types types for graphql files: %s",a);let l=se.default.join(u,"types","codegen.json");try{await(0,We.copy)(se.default.join(__dirname,"..","types","codegen.json"),l);let f="graphql-codegen --config ./types/codegen.json ";be.debug(f);let p=cr.default.exec(f,{fatal:!0,silent:!0,cwd:u});return p.code>0?be.error("Building graphql types failed for module at %s: %s",u,p.stderr):be.info("Building graphql types complete for module at %s",u),p.code}finally{await(0,We.rm)(l)}}}))).find(s=>s>0)??0}var ur=zn;function Eo(){if(typeof window>"u"){let e=(On(),or(Ln)).default;return new e}else{let e=($n(),or(Pn)).default;return new e}}var _o=Eo();function Dn(e,t){return _o.getAppLog(e,t)}var As=Dn(module);var Fn=R(require("dotenv-flow")),Hn=R(require("findup-sync")),rr=R(require("node:path")),Un=R(require("yargs")),Mn=require("yargs/helpers");var js=require("graphql-import-node"),jn=require("@urql/core");var Us=B("GraphqlClient");var Ys=B("versionCheck");var Fe=B("cli");function Oo(){if(!global.sdkConfigLoaded){let e=(0,Hn.default)(".env*");if(e){Fe.debug("Loading config from .env files: $s",e);let{error:t,parsed:r}=Fn.default.config({path:rr.default.dirname(e)});t?(Fe.error(t,"Error reading config file"),process.exit(1)):Fe.info("Using config values: %O",r)}}global.sdkConfigLoaded=!0}function Io(e){let t=e.indexOf("node_modules");return t===1?e:e.slice(0,t-1)}function So(e,t,r,n,i){Oo(),(0,Un.default)((0,Mn.hideBin)(process.argv)).scriptName(e).options(n??{}).env("PLUGIN").usage("$0 [repoPath]").command("$0 [repoPath]",t,o=>{let s=Io(process.cwd());return o.positional("repoPath",{describe:"The full path to plugin root directory.",default:s,type:"string"})},async o=>{await r(o)}).check(async o=>{let{repoPath:s}=o;if(!s)throw new Error("No plugin repository path found. Please either pass it as an argument to this process or specify it in your .env file as PLUGIN_REPO_PATH. ");if(!rr.default.isAbsolute(s))throw new Error("The plugin repository path must be a full (not relative) path.");return i?await i(o):!0}).help().showHelpOnFail(!1).fail((o,s)=>{s?Fe.error(s.message):Fe.error(o),process.exit(1)}).parse()}var Gn=So;Gn("build:types","Builds GraphQL types for the plugin",async({repoPath:e})=>{await ur(e,!0,!0)});
6
+ `+N.inspect(t))):(z.ok(r,"can't remove top context"),this._set.splice(r,1))};G.prototype.bindEmitter=function(t){z.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function i(s){s&&(s[$e]||(s[$e]=Object.create(null)),s[$e][n]={namespace:r,context:r.active})}function o(s){if(!(s&&s[$e]))return s;let u=s,a=s[$e];return Object.keys(a).forEach(function(l){let f=a[l];u=f.namespace.bind(u,f.context)}),u}io(t,i,o)};G.prototype.fromException=function(t){return t[De]};function cn(e){return process.namespaces[e]}function oo(e){z.ok(e,"namespace must be given a name."),S&&A("CREATING NAMESPACE "+e);let t=new G(e);return t.id=C,he.addHooks({init(r,n,i,o,s){C=r,o?(t._contexts.set(r,t._contexts.get(o)),S&&A("PARENTID: "+e+" uid:"+r+" parent:"+o+" provider:"+i)):t._contexts.set(C,t.active),S&&A("INIT "+e+" uid:"+r+" parent:"+o+" provider:"+an[i]+" active:"+N.inspect(t.active,!0))},pre(r,n){C=r;let i=t._contexts.get(r);i?(S&&A(" PRE "+e+" uid:"+r+" handle:"+st(n)+" context:"+N.inspect(i)),t.enter(i)):S&&A(" PRE MISSING CONTEXT "+e+" uid:"+r+" handle:"+st(n))},post(r,n){C=r;let i=t._contexts.get(r);i?(S&&A(" POST "+e+" uid:"+r+" handle:"+st(n)+" context:"+N.inspect(i)),t.exit(i)):S&&A(" POST MISSING CONTEXT "+e+" uid:"+r+" handle:"+st(n))},destroy(r){C=r,S&&A("DESTROY "+e+" uid:"+r+" context:"+N.inspect(t._contexts.get(C))+" active:"+N.inspect(t.active,!0)),t._contexts.delete(r)}}),process.namespaces[e]=t,t}function un(e){let t=cn(e);z.ok(t,`can't delete nonexistent namespace! "`+e+'"'),z.ok(t.id,"don't assign to process.namespaces directly! "+N.inspect(t)),process.namespaces[e]=null}function so(){process.namespaces&&Object.keys(process.namespaces).forEach(function(e){un(e)}),process.namespaces=Object.create(null)}process.namespaces={};he._state&&!he._state.enabled&&he.enable();function A(e){process.env.DEBUG&&process._rawDebug(e)}function st(e){if(!e)return e;if(typeof e=="function")return e.name?e.name:(e.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1];if(e.constructor&&e.constructor.name)return e.constructor.name}if(S){qt=Bt();for(sn in qt.filter._modifiers)qt.filter.deattach(sn)}var qt,sn});var fn=x((es,Xt)=>{"use strict";var ao=Nr();process&&ao.gte(process.versions.node,"8.0.0")?Xt.exports=Gr():Xt.exports=pn()});var dn=x(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.cls=void 0;var co=fn(),ge=co.createNamespace("@kibertoad/als");me.cls={storageImplementation:"cls-hooked",get:e=>{if(ge.active)return ge.get(e)},set:(e,t)=>{ge.active&&ge.set(e,t)},runWith:(e,t)=>{ge.run(()=>{if(t){let r=Object.keys(t);for(let n=0;n<r.length;n++)ge.set(r[n],t[r[n]])}e()})}};me.default=me.cls});var hn=x(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.als=void 0;var{getNodeVersion:uo,isAlsSupported:lo,nodeVersionString:po}=fr();ye.als=lo(uo(po))?dr().als:dn().cls;ye.default=ye.als});var gn,Kt,te,Yt=V(()=>{"use strict";gn=R(require("pino")),Kt=class{static getLogName(t){return(typeof t=="string"?t:t.id).replaceAll(/\.(tsx?|jsx?)/gi,"").split("/").filter(i=>i!==".").at(-1)}static validateLogLevel(t,r){if(t&&r){let n=r.toLowerCase(),{values:i}=gn.default.levels;if(i[n]===void 0)global.appLog?.warn("Unable to set %s log level to %s as it is an invalid value. Valid values are: %s",t,r,Object.keys(i));else return n}return null}},te=Kt});function fo(e,t=!1){je?.debug("[log] Using file transport for log %s",e);let r=process.env.LOG_DIR;if(!r){je?.debug("[log] No process.env.LOG_DIR value found for log %s. Disabling file logging.",e);return}let n=process.env.USE_LOG_FILE_SERVICE_ID_PREFIX==="true",i=process.env.SERVICE_ID;if(n&&!i){je?.error("[log] No process.env.SERVICE_ID value found. Unable to set log file for log: "+e);return}let o=mn.default.resolve(r),s=n?`${i}-${e}`:e;try{let u=`${o}/${s}.log`,a={target:"pino/file",options:{destination:u,mkdir:!0,sync:t,append:!0}};return je?.info('[log] Log "%s" destination is file: %s',e,u),a}catch(u){je?.error("[log] Unable to set up log destination: %s for log: %s",o,e,u)}}var mn,je,yn,vn=V(()=>{"use strict";mn=R(require("node:path"));Ee();je=process.env.NODE_ENV==="production"?console:void 0;yn=fo});function ho(){return{target:"pino-pretty",options:{colorize:!0,singleLine:!0,translateTime:"SYS:HH:MM:ss.l"}}}var at,zt=V(()=>{"use strict";at=ho});function go(e,t={}){if(ct.has(e))return ct.get(e);let r=yn(e,t?.sync);if(r)return ct.set(e,r),r;if(t?.prettyPrint){let n=at();return ct.set(e,n),n}}var ct,Tn,bn=V(()=>{"use strict";vn();zt();Ee();ct=new Map;Tn=go});var En,_n,Zt,ut,wn=V(()=>{"use strict";Ee();En=R(require("node:os")),_n=R(require("pino"));bn();Zt=class e{static getBase(){return{pid:process.pid,hostname:En.default.hostname()}}static buildLogger(t,r,n={}){let{hideLogName:i,mixin:o,transport:s}=n;return(0,_n.default)({name:i?void 0:t,level:r,base:e.getBase(),mixin:o,transport:s??Tn(t,n)})}static prettyPrintEnabled(){return process.env.NEXT_PUBLIC_LOG_PRETTY_PRINT_ENABLED==="true"}},ut=Zt});function mo(e){return e?.split(/[\s,]+/)?.map(t=>t.trim())?.filter(t=>t?.length>0)}function lt(e){return e?mo(e)?.map(r=>r.split("=")?.filter(n=>n?.trim()!==""))?.reduce((r,n)=>{let[i,o]=n;return r[i]=o,r},{}):{}}var hs,gs,Qt=V(()=>{"use strict";hs=new RegExp(/^[\w!#$%&'*-/=?^`{|}~]+\S@[\w!#$%&'*-/=?^`{|}~]+\.[\w!#$%&'*-/=?^`{|}~]+$/);gs=new RegExp(/^[\w.\-]+$/)});var On={};nr(On,{default:()=>yo});var pt,Ln,Jt,yo,In=V(()=>{"use strict";Ee();pr();pt=R(hn());Yt();wn();Qt();Ln="traceInfo",Jt=class e{constructor(){this.useTraceInfo=process.env.LOG_USE_TRACE_INFO==="true",this.logLevelApp=te.validateLogLevel("app",process.env.NEXT_PUBLIC_LOG_LEVEL)??"silent",this.appLogOverrides=lt(process.env.APP_LOG_LEVEL_OVERRIDES??""),this.prettyPrint=ut.prettyPrintEnabled();let t=this.useTraceInfo?()=>e.getTraceInfo():void 0;this.appLog=ut.buildLogger("app",this.logLevelApp,{mixin:t,prettyPrint:this.prettyPrint,hideLogName:!0}),this.syncLog=ut.buildLogger("app",this.logLevelApp,{mixin:t,prettyPrint:this.prettyPrint,hideLogName:!0,sync:!0})}getAppLog(t,r){let n=te.getLogName(t),i=te.validateLogLevel(n,this.appLogOverrides[n]);return i&&this.appLog.warn("Setting log level to %s for: %s ",i,n),this.appLog.child({name:n},{...r,level:i??this.logLevelApp})}getSyncLog(t,r){let n=te.getLogName(t);return this.syncLog.child({name:n},r)}static setForwardedForHeader(t){this.xForwardedForHeader=t}static buildTraceInfo(t,r){let n={},i=t.get("x-li-cid")||t.get("x-lithium-community-id")||r.locals.tenant?.id;i&&(n.cid=i);let o=t.get("x-li-tx")||t.get("x-lithium-tx-id")||`${process.hrtime.bigint()}`;o&&(n.tx=o);let s=t.get("x-li-frame")||t.get("x-lithium-activity-frame");if(s)try{let a=JSON.parse(s),{id:l,time:f}=a;n.frameId=l,n.frameTime=f}catch(a){console.error('Unable to get frame information from "x-lithium-community-id" header',a)}let u=r.locals.uid;if(u!=null&&(n.uid=u),process.env.TRACE_INFO_ADD_IP==="true"){let a=e.xForwardedForHeader?t.get(e.xForwardedForHeader)??t.ip:t.ip;a&&(n.ip=a)}if(process.env.TRACE_INFO_ADD_URL==="true"){let a=t.originalUrl;a&&(n.url=a)}if(process.env.TRACE_INFO_ADD_AUTH_TOKEN==="true"){let a=r.locals.authToken;a&&(n.authToken=`${a.providerName}:${a.token}`)}return n}static setTraceInfo(t,r){pt.als&&pt.als.set(Ln,e.buildTraceInfo(t,r))}static getTraceInfo(){return pt.als?.get(Ln)??{}}},yo=Jt});var xn=x((er,Sn)=>{"use strict";function ve(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ve=function(r){return typeof r}:ve=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ve(e)}(function(e){var t=arguments,r=function(){var a=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,l=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,f=/[^-+\dA-Z]/g;return function(p,g,y,j){if(t.length===1&&u(p)==="string"&&!/\d/.test(p)&&(g=p,p=void 0),p=p||p===0?p:new Date,p instanceof Date||(p=new Date(p)),isNaN(p))throw TypeError("Invalid date");g=String(r.masks[g]||g||r.masks.default);var ie=g.slice(0,4);(ie==="UTC:"||ie==="GMT:")&&(g=g.slice(4),y=!0,ie==="GMT:"&&(j=!0));var $=function(){return y?"getUTC":"get"},F=function(){return p[$()+"Date"]()},W=function(){return p[$()+"Day"]()},H=function(){return p[$()+"Month"]()},oe=function(){return p[$()+"FullYear"]()},q=function(){return p[$()+"Hours"]()},He=function(){return p[$()+"Minutes"]()},Ue=function(){return p[$()+"Seconds"]()},Me=function(){return p[$()+"Milliseconds"]()},Z=function(){return y?0:p.getTimezoneOffset()},Ge=function(){return o(p)},ft=function(){return s(p)},Ve={d:function(){return F()},dd:function(){return n(F())},ddd:function(){return r.i18n.dayNames[W()]},DDD:function(){return i({y:oe(),m:H(),d:F(),_:$(),dayName:r.i18n.dayNames[W()],short:!0})},dddd:function(){return r.i18n.dayNames[W()+7]},DDDD:function(){return i({y:oe(),m:H(),d:F(),_:$(),dayName:r.i18n.dayNames[W()+7]})},m:function(){return H()+1},mm:function(){return n(H()+1)},mmm:function(){return r.i18n.monthNames[H()]},mmmm:function(){return r.i18n.monthNames[H()+12]},yy:function(){return String(oe()).slice(2)},yyyy:function(){return n(oe(),4)},h:function(){return q()%12||12},hh:function(){return n(q()%12||12)},H:function(){return q()},HH:function(){return n(q())},M:function(){return He()},MM:function(){return n(He())},s:function(){return Ue()},ss:function(){return n(Ue())},l:function(){return n(Me(),3)},L:function(){return n(Math.floor(Me()/10))},t:function(){return q()<12?r.i18n.timeNames[0]:r.i18n.timeNames[1]},tt:function(){return q()<12?r.i18n.timeNames[2]:r.i18n.timeNames[3]},T:function(){return q()<12?r.i18n.timeNames[4]:r.i18n.timeNames[5]},TT:function(){return q()<12?r.i18n.timeNames[6]:r.i18n.timeNames[7]},Z:function(){return j?"GMT":y?"UTC":(String(p).match(l)||[""]).pop().replace(f,"").replace(/GMT\+0000/g,"UTC")},o:function(){return(Z()>0?"-":"+")+n(Math.floor(Math.abs(Z())/60)*100+Math.abs(Z())%60,4)},p:function(){return(Z()>0?"-":"+")+n(Math.floor(Math.abs(Z())/60),2)+":"+n(Math.floor(Math.abs(Z())%60),2)},S:function(){return["th","st","nd","rd"][F()%10>3?0:(F()%100-F()%10!=10)*F()%10]},W:function(){return Ge()},WW:function(){return n(Ge())},N:function(){return ft()}};return g.replace(a,function(d){return d in Ve?Ve[d]():d.slice(1,d.length-1)})}}();r.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},r.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]};var n=function(l,f){for(l=String(l),f=f||2;l.length<f;)l="0"+l;return l},i=function(l){var f=l.y,p=l.m,g=l.d,y=l._,j=l.dayName,ie=l.short,$=ie===void 0?!1:ie,F=new Date,W=new Date;W.setDate(W[y+"Date"]()-1);var H=new Date;H.setDate(H[y+"Date"]()+1);var oe=function(){return F[y+"Date"]()},q=function(){return F[y+"Month"]()},He=function(){return F[y+"FullYear"]()},Ue=function(){return W[y+"Date"]()},Me=function(){return W[y+"Month"]()},Z=function(){return W[y+"FullYear"]()},Ge=function(){return H[y+"Date"]()},ft=function(){return H[y+"Month"]()},Ve=function(){return H[y+"FullYear"]()};return He()===f&&q()===p&&oe()===g?$?"Tdy":"Today":Z()===f&&Me()===p&&Ue()===g?$?"Ysd":"Yesterday":Ve()===f&&ft()===p&&Ge()===g?$?"Tmw":"Tomorrow":j},o=function(l){var f=new Date(l.getFullYear(),l.getMonth(),l.getDate());f.setDate(f.getDate()-(f.getDay()+6)%7+3);var p=new Date(f.getFullYear(),0,4);p.setDate(p.getDate()-(p.getDay()+6)%7+3);var g=f.getTimezoneOffset()-p.getTimezoneOffset();f.setHours(f.getHours()-g);var y=(f-p)/(864e5*7);return 1+Math.floor(y)},s=function(l){var f=l.getDay();return f===0&&(f=7),f},u=function(l){return l===null?"null":l===void 0?"undefined":ve(l)!=="object"?ve(l):Array.isArray(l)?"array":{}.toString.call(l).slice(8,-1).toLowerCase()};typeof define=="function"&&define.amd?define(function(){return r}):(typeof er>"u"?"undefined":ve(er))==="object"?Sn.exports=r:e.dateFormat=r})(void 0)});function vo(e,t,r,n){return[e,`background-color: ${t}; padding: 2px 3px; border-radius: 3px; color: white; ${r}`,"color: graytext","color: canvastext",...n??[]]}function To(e,t,r,n){let{name:i,msg:o}=e,s=o?.replace(An,"%O")??"",u=o?.match(An)?.map(l=>{try{return JSON.parse(l)}catch{return l}})??[],a=(0,Nn.default)(Date.now(),"HH:MM:ss.l");return vo(`[${a}] %c${t}%c (${i}): %c${s}`,r,n,u)}function Te(e,t,r,n,i){return function(s){let u=r==="fatal"?"error":r;try{e[u](...t(s,r.toUpperCase(),n,i))}catch(a){e.error(a)}}}function bo(e,t){return{trace:Te(e,t,"trace","magenta"),debug:Te(e,t,"debug","blue"),info:Te(e,t,"info","green"),warn:Te(e,t,"warn","orange"),error:Te(e,t,"error","red"),fatal:Te(e,t,"fatal","red","font-weight: bold")}}function Cn(e){return bo(e,To)}var Nn,An,Rn=V(()=>{"use strict";Nn=R(xn()),An=new RegExp(/{(?:[^{}]|({(?:[^{}]|({(?:[^{}]|())*}))*}))*}/g)});var $n={};nr($n,{default:()=>Eo});var kn,Pn,tr,Eo,Dn=V(()=>{"use strict";kn=R(require("next/config")),Pn=R(require("pino"));Rn();Yt();Qt();zt();tr=class{constructor(){let t=(0,kn.default)();this.logLevelApp=t?.publicRuntimeConfig?.logLevelApp??"silent";let r=t?.publicRuntimeConfig?.prettyPrint==="true";this.appLogOverrides=lt(t?.publicRuntimeConfig?.logLevelAppOverrides),this.rootLog=(0,Pn.default)({level:this.logLevelApp,browser:{asObject:!r,write:r?Cn(console):void 0},transport:r?at():void 0})}getAppLog(t,r){let n=te.getLogName(t),i=te.validateLogLevel(n,this.appLogOverrides[n]);return i&&this.rootLog.warn("Setting log level to %s for: %s ",i,n),this.rootLog.child({name:n},{...r,level:i??this.logLevelApp})}},Eo=tr});var We=require("fs-extra"),se=R(require("node:path")),cr=R(require("shelljs"));var zn=R(require("fs-extra")),dt=R(require("node:path"));var ar=require("glob");var sr=R(require("pino")),Yn=(0,sr.default)({transport:{target:"pino-pretty",options:{sync:!0}},level:process.env.LOG_LEVEL??"info"});function B(e,t){return Yn.child({name:e??"sdk"},t)}var Ro=B("filePathHelper");function ht(e,t){return(0,ar.glob)(e?.replaceAll(dt.default.sep,dt.default.posix.sep),t)}var be=B("graphql-types");async function Zn(e,t,r){be.info("Building graphql types for plugin directory: %s",e);let n=t&&r?"**":t?"components":"endpoints",i=await ht(se.default.join(e,"src",n,"**","package.json"));return(await Promise.all(i.map(async s=>{let u=se.default.dirname(s),a=await ht(se.default.join(u,"**","*.graphql"));if(a.length>0){be.debug("Building types types for graphql files: %s",a);let l=se.default.join(u,"types","codegen.json");try{await(0,We.copy)(se.default.join(__dirname,"..","types","codegen.json"),l);let f="graphql-codegen --config ./types/codegen.json ";be.debug(f);let p=cr.default.exec(f,{fatal:!0,silent:!0,cwd:u});return p.code>0?be.error("Building graphql types failed for module at %s: %s",u,p.stderr):be.info("Building graphql types complete for module at %s",u),p.code}finally{await(0,We.rm)(l)}}}))).find(s=>s>0)??0}var ur=Zn;function _o(){if(typeof window>"u"){let e=(In(),or(On)).default;return new e}else{let e=(Dn(),or($n)).default;return new e}}var wo=_o();function jn(e,t){return wo.getAppLog(e,t)}var Ns=jn(module);var Hn=R(require("dotenv-flow")),Un=R(require("findup-sync")),rr=R(require("node:path")),Mn=R(require("yargs")),Gn=require("yargs/helpers");var Fs=require("graphql-import-node"),Fn=require("@urql/core");var Ms=B("GraphqlClient");var zs=B("versionCheck");var Fe=B("cli");function Io(){if(!global.sdkConfigLoaded){let e=(0,Un.default)(".env*");if(e){Fe.debug("Loading config from .env files: $s",e);let{error:t,parsed:r}=Hn.default.config({path:rr.default.dirname(e)});t?(Fe.error(t,"Error reading config file"),process.exit(1)):Fe.info("Using config values: %O",r)}}global.sdkConfigLoaded=!0}function So(e){let t=e.indexOf("node_modules");return t===1?e:e.slice(0,t-1)}function xo(e,t,r,n,i){Io(),(0,Mn.default)((0,Gn.hideBin)(process.argv)).scriptName(e).options(n??{}).env("PLUGIN").usage("$0 [repoPath]").command("$0 [repoPath]",t,o=>{let s=So(process.cwd());return o.positional("repoPath",{describe:"The full path to plugin root directory.",default:s,type:"string"})},async o=>{await r(o)}).check(async o=>{let{repoPath:s}=o;if(!s)throw new Error("No plugin repository path found. Please either pass it as an argument to this process or specify it in your .env file as PLUGIN_REPO_PATH. ");if(!rr.default.isAbsolute(s))throw new Error("The plugin repository path must be a full (not relative) path.");return i?await i(o):!0}).help().showHelpOnFail(!1).fail((o,s)=>{s?Fe.error(s.message):Fe.error(o),process.exit(1)}).parse()}var Vn=xo;Vn("build:types","Builds GraphQL types for the plugin",async({repoPath:e})=>{await ur(e,!0,!0)});