@northflank/js-client 0.7.6 → 0.7.7

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("events"),t=require("stream"),n=require("http"),r=require("url"),o=require("punycode"),i=require("https"),s=require("zlib"),a=require("os"),u=require("net"),c=require("child_process"),l=require("fs"),d=require("path"),p=require("buffer"),h=require("tls"),f=require("crypto"),v=require("dgram");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function b(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var y=m(e),g=m(t),w=b(t),j=m(n),_=m(r),S=m(o),E=m(i),P=m(s),A=m(a),x=m(u),I=b(u),C=m(l),k=m(d),U=m(p),O=m(h),D=m(f),R=m(v),B=function(e,t){return B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},B(e,t)};function T(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var N=function(){return N=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},N.apply(this,arguments)};function L(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function q(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function G(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var F="object"==typeof global&&global&&global.Object===Object&&global,J="object"==typeof self&&self&&self.Object===Object&&self,M=F||J||Function("return this")(),z=M.Symbol,W=Object.prototype,V=W.hasOwnProperty,$=W.toString,H=z?z.toStringTag:void 0;var Y=Object.prototype.toString;var Z="[object Null]",K="[object Undefined]",X=z?z.toStringTag:void 0;function Q(e){return null==e?void 0===e?K:Z:X&&X in Object(e)?function(e){var t=V.call(e,H),n=e[H];try{e[H]=void 0;var r=!0}catch(e){}var o=$.call(e);return r&&(t?e[H]=n:delete e[H]),o}(e):function(e){return Y.call(e)}(e)}function ee(e){return null!=e&&"object"==typeof e}var te="[object Symbol]";function ne(e){return"symbol"==typeof e||ee(e)&&Q(e)==te}function re(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var oe=Array.isArray,ie=1/0,se=z?z.prototype:void 0,ae=se?se.toString:void 0;function ue(e){if("string"==typeof e)return e;if(oe(e))return re(e,ue)+"";if(ne(e))return ae?ae.call(e):"";var t=e+"";return"0"==t&&1/e==-ie?"-0":t}function ce(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function le(e){return e}var de="[object AsyncFunction]",pe="[object Function]",he="[object GeneratorFunction]",fe="[object Proxy]";function ve(e){if(!ce(e))return!1;var t=Q(e);return t==pe||t==he||t==de||t==fe}var me,be=M["__core-js_shared__"],ye=(me=/[^.]+$/.exec(be&&be.keys&&be.keys.IE_PROTO||""))?"Symbol(src)_1."+me:"";var ge=Function.prototype.toString;function we(e){if(null!=e){try{return ge.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var je=/^\[object .+?Constructor\]$/,_e=Function.prototype,Se=Object.prototype,Ee=_e.toString,Pe=Se.hasOwnProperty,Ae=RegExp("^"+Ee.call(Pe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xe(e){return!(!ce(e)||(t=e,ye&&ye in t))&&(ve(e)?Ae:je).test(we(e));var t}function Ie(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return xe(n)?n:void 0}var Ce=Ie(M,"WeakMap"),ke=Object.create,Ue=function(){function e(){}return function(t){if(!ce(t))return{};if(ke)return ke(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var Oe=Date.now;var De,Re,Be,Te=function(){try{var e=Ie(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ne=Te,Le=Ne?function(e,t){return Ne(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:le,qe=(De=Le,Re=0,Be=0,function(){var e=Oe(),t=16-(e-Be);if(Be=e,t>0){if(++Re>=800)return arguments[0]}else Re=0;return De.apply(void 0,arguments)}),Ge=9007199254740991,Fe=/^(?:0|[1-9]\d*)$/;function Je(e,t){var n=typeof e;return!!(t=null==t?Ge:t)&&("number"==n||"symbol"!=n&&Fe.test(e))&&e>-1&&e%1==0&&e<t}function Me(e,t,n){"__proto__"==t&&Ne?Ne(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ze(e,t){return e===t||e!=e&&t!=t}var We=Object.prototype.hasOwnProperty;function Ve(e,t,n){var r=e[t];We.call(e,t)&&ze(r,n)&&(void 0!==n||t in e)||Me(e,t,n)}var $e=Math.max;function He(e,t){return qe(function(e,t,n){return t=$e(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=$e(r.length-t,0),s=Array(i);++o<i;)s[o]=r[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=r[o];return a[t]=n(s),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,a)}}(e,t,le),e+"")}var Ye=9007199254740991;function Ze(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Ye}function Ke(e){return null!=e&&Ze(e.length)&&!ve(e)}var Xe=Object.prototype;function Qe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Xe)}function et(e){return ee(e)&&"[object Arguments]"==Q(e)}var tt=Object.prototype,nt=tt.hasOwnProperty,rt=tt.propertyIsEnumerable,ot=et(function(){return arguments}())?et:function(e){return ee(e)&&nt.call(e,"callee")&&!rt.call(e,"callee")};var it="object"==typeof exports&&exports&&!exports.nodeType&&exports,st=it&&"object"==typeof module&&module&&!module.nodeType&&module,at=st&&st.exports===it?M.Buffer:void 0,ut=(at?at.isBuffer:void 0)||function(){return!1},ct={};ct["[object Float32Array]"]=ct["[object Float64Array]"]=ct["[object Int8Array]"]=ct["[object Int16Array]"]=ct["[object Int32Array]"]=ct["[object Uint8Array]"]=ct["[object Uint8ClampedArray]"]=ct["[object Uint16Array]"]=ct["[object Uint32Array]"]=!0,ct["[object Arguments]"]=ct["[object Array]"]=ct["[object ArrayBuffer]"]=ct["[object Boolean]"]=ct["[object DataView]"]=ct["[object Date]"]=ct["[object Error]"]=ct["[object Function]"]=ct["[object Map]"]=ct["[object Number]"]=ct["[object Object]"]=ct["[object RegExp]"]=ct["[object Set]"]=ct["[object String]"]=ct["[object WeakMap]"]=!1;var lt="object"==typeof exports&&exports&&!exports.nodeType&&exports,dt=lt&&"object"==typeof module&&module&&!module.nodeType&&module,pt=dt&&dt.exports===lt&&F.process,ht=function(){try{var e=dt&&dt.require&&dt.require("util").types;return e||pt&&pt.binding&&pt.binding("util")}catch(e){}}(),ft=ht&&ht.isTypedArray,vt=ft?function(e){return function(t){return e(t)}}(ft):function(e){return ee(e)&&Ze(e.length)&&!!ct[Q(e)]},mt=vt,bt=Object.prototype.hasOwnProperty;function yt(e,t){var n=oe(e),r=!n&&ot(e),o=!n&&!r&&ut(e),i=!n&&!r&&!o&&mt(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],u=a.length;for(var c in e)!t&&!bt.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Je(c,u))||a.push(c);return a}function gt(e,t){return function(n){return e(t(n))}}var wt=gt(Object.keys,Object),jt=Object.prototype.hasOwnProperty;function _t(e){return Ke(e)?yt(e):function(e){if(!Qe(e))return wt(e);var t=[];for(var n in Object(e))jt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}var St=Object.prototype.hasOwnProperty;function Et(e){if(!ce(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Qe(e),n=[];for(var r in e)("constructor"!=r||!t&&St.call(e,r))&&n.push(r);return n}function Pt(e){return Ke(e)?yt(e,!0):Et(e)}var At=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xt=/^\w*$/;function It(e,t){if(oe(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ne(e))||(xt.test(e)||!At.test(e)||null!=t&&e in Object(t))}var Ct=Ie(Object,"create");var kt=Object.prototype.hasOwnProperty;var Ut=Object.prototype.hasOwnProperty;function Ot(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Dt(e,t){for(var n=e.length;n--;)if(ze(e[n][0],t))return n;return-1}Ot.prototype.clear=function(){this.__data__=Ct?Ct(null):{},this.size=0},Ot.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ot.prototype.get=function(e){var t=this.__data__;if(Ct){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return kt.call(t,e)?t[e]:void 0},Ot.prototype.has=function(e){var t=this.__data__;return Ct?void 0!==t[e]:Ut.call(t,e)},Ot.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ct&&void 0===t?"__lodash_hash_undefined__":t,this};var Rt=Array.prototype.splice;function Bt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bt.prototype.clear=function(){this.__data__=[],this.size=0},Bt.prototype.delete=function(e){var t=this.__data__,n=Dt(t,e);return!(n<0)&&(n==t.length-1?t.pop():Rt.call(t,n,1),--this.size,!0)},Bt.prototype.get=function(e){var t=this.__data__,n=Dt(t,e);return n<0?void 0:t[n][1]},Bt.prototype.has=function(e){return Dt(this.__data__,e)>-1},Bt.prototype.set=function(e,t){var n=this.__data__,r=Dt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Tt=Ie(M,"Map");function Nt(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Lt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Lt.prototype.clear=function(){this.size=0,this.__data__={hash:new Ot,map:new(Tt||Bt),string:new Ot}},Lt.prototype.delete=function(e){var t=Nt(this,e).delete(e);return this.size-=t?1:0,t},Lt.prototype.get=function(e){return Nt(this,e).get(e)},Lt.prototype.has=function(e){return Nt(this,e).has(e)},Lt.prototype.set=function(e,t){var n=Nt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var qt="Expected a function";function Gt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(qt);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Gt.Cache||Lt),n}Gt.Cache=Lt;var Ft=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jt=/\\(\\)?/g,Mt=function(e){var t=Gt(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ft,(function(e,n,r,o){t.push(r?o.replace(Jt,"$1"):n||e)})),t})),zt=Mt;function Wt(e){return null==e?"":ue(e)}function Vt(e,t){return oe(e)?e:It(e,t)?[e]:zt(Wt(e))}var $t=1/0;function Ht(e){if("string"==typeof e||ne(e))return e;var t=e+"";return"0"==t&&1/e==-$t?"-0":t}function Yt(e,t){for(var n=0,r=(t=Vt(t,e)).length;null!=e&&n<r;)e=e[Ht(t[n++])];return n&&n==r?e:void 0}function Zt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var Kt=z?z.isConcatSpreadable:void 0;function Xt(e){return oe(e)||ot(e)||!!(Kt&&e&&e[Kt])}function Qt(e,t,n,r,o){var i=-1,s=e.length;for(n||(n=Xt),o||(o=[]);++i<s;){var a=e[i];t>0&&n(a)?t>1?Qt(a,t-1,n,r,o):Zt(o,a):r||(o[o.length]=a)}return o}var en=gt(Object.getPrototypeOf,Object),tn="[object Object]",nn=Function.prototype,rn=Object.prototype,on=nn.toString,sn=rn.hasOwnProperty,an=on.call(Object);function un(e){var t=this.__data__=new Bt(e);this.size=t.size}un.prototype.clear=function(){this.__data__=new Bt,this.size=0},un.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},un.prototype.get=function(e){return this.__data__.get(e)},un.prototype.has=function(e){return this.__data__.has(e)},un.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Bt){var r=n.__data__;if(!Tt||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Lt(r)}return n.set(e,t),this.size=n.size,this};var cn="object"==typeof exports&&exports&&!exports.nodeType&&exports,ln=cn&&"object"==typeof module&&module&&!module.nodeType&&module,dn=ln&&ln.exports===cn?M.Buffer:void 0,pn=dn?dn.allocUnsafe:void 0;var hn=Object.prototype.propertyIsEnumerable,fn=Object.getOwnPropertySymbols,vn=fn?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}(fn(e),(function(t){return hn.call(e,t)})))}:function(){return[]};function mn(e){return function(e,t,n){var r=t(e);return oe(e)?r:Zt(r,n(e))}(e,_t,vn)}var bn=Ie(M,"DataView"),yn=Ie(M,"Promise"),gn=Ie(M,"Set"),wn="[object Map]",jn="[object Promise]",_n="[object Set]",Sn="[object WeakMap]",En="[object DataView]",Pn=we(bn),An=we(Tt),xn=we(yn),In=we(gn),Cn=we(Ce),kn=Q;(bn&&kn(new bn(new ArrayBuffer(1)))!=En||Tt&&kn(new Tt)!=wn||yn&&kn(yn.resolve())!=jn||gn&&kn(new gn)!=_n||Ce&&kn(new Ce)!=Sn)&&(kn=function(e){var t=Q(e),n="[object Object]"==t?e.constructor:void 0,r=n?we(n):"";if(r)switch(r){case Pn:return En;case An:return wn;case xn:return jn;case In:return _n;case Cn:return Sn}return t});var Un=kn,On=M.Uint8Array;function Dn(e,t){var n,r,o=t?(n=e.buffer,r=new n.constructor(n.byteLength),new On(r).set(new On(n)),r):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Lt;++t<n;)this.add(e[t])}function Bn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}Rn.prototype.add=Rn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Rn.prototype.has=function(e){return this.__data__.has(e)};var Tn=1,Nn=2;function Ln(e,t,n,r,o,i){var s=n&Tn,a=e.length,u=t.length;if(a!=u&&!(s&&u>a))return!1;var c=i.get(e),l=i.get(t);if(c&&l)return c==t&&l==e;var d=-1,p=!0,h=n&Nn?new Rn:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var f=e[d],v=t[d];if(r)var m=s?r(v,f,d,t,e,i):r(f,v,d,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!Bn(t,(function(e,t){if(s=t,!h.has(s)&&(f===e||o(f,e,n,r,i)))return h.push(t);var s}))){p=!1;break}}else if(f!==v&&!o(f,v,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function qn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Gn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Fn=1,Jn=2,Mn="[object Boolean]",zn="[object Date]",Wn="[object Error]",Vn="[object Map]",$n="[object Number]",Hn="[object RegExp]",Yn="[object Set]",Zn="[object String]",Kn="[object Symbol]",Xn="[object ArrayBuffer]",Qn="[object DataView]",er=z?z.prototype:void 0,tr=er?er.valueOf:void 0;var nr=1,rr=Object.prototype.hasOwnProperty;var or=1,ir="[object Arguments]",sr="[object Array]",ar="[object Object]",ur=Object.prototype.hasOwnProperty;function cr(e,t,n,r,o,i){var s=oe(e),a=oe(t),u=s?sr:Un(e),c=a?sr:Un(t),l=(u=u==ir?ar:u)==ar,d=(c=c==ir?ar:c)==ar,p=u==c;if(p&&ut(e)){if(!ut(t))return!1;s=!0,l=!1}if(p&&!l)return i||(i=new un),s||mt(e)?Ln(e,t,n,r,o,i):function(e,t,n,r,o,i,s){switch(n){case Qn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Xn:return!(e.byteLength!=t.byteLength||!i(new On(e),new On(t)));case Mn:case zn:case $n:return ze(+e,+t);case Wn:return e.name==t.name&&e.message==t.message;case Hn:case Zn:return e==t+"";case Vn:var a=qn;case Yn:var u=r&Fn;if(a||(a=Gn),e.size!=t.size&&!u)return!1;var c=s.get(e);if(c)return c==t;r|=Jn,s.set(e,t);var l=Ln(a(e),a(t),r,o,i,s);return s.delete(e),l;case Kn:if(tr)return tr.call(e)==tr.call(t)}return!1}(e,t,u,n,r,o,i);if(!(n&or)){var h=l&&ur.call(e,"__wrapped__"),f=d&&ur.call(t,"__wrapped__");if(h||f){var v=h?e.value():e,m=f?t.value():t;return i||(i=new un),o(v,m,n,r,i)}}return!!p&&(i||(i=new un),function(e,t,n,r,o,i){var s=n&nr,a=mn(e),u=a.length;if(u!=mn(t).length&&!s)return!1;for(var c=u;c--;){var l=a[c];if(!(s?l in t:rr.call(t,l)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var h=!0;i.set(e,t),i.set(t,e);for(var f=s;++c<u;){var v=e[l=a[c]],m=t[l];if(r)var b=s?r(m,v,l,t,e,i):r(v,m,l,e,t,i);if(!(void 0===b?v===m||o(v,m,n,r,i):b)){h=!1;break}f||(f="constructor"==l)}if(h&&!f){var y=e.constructor,g=t.constructor;y==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof g&&g instanceof g||(h=!1)}return i.delete(e),i.delete(t),h}(e,t,n,r,o,i))}function lr(e,t,n,r,o){return e===t||(null==e||null==t||!ee(e)&&!ee(t)?e!=e&&t!=t:cr(e,t,n,r,lr,o))}var dr=1,pr=2;function hr(e){return e==e&&!ce(e)}function fr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function vr(e){var t=function(e){for(var t=_t(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,hr(o)]}return t}(e);return 1==t.length&&t[0][2]?fr(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,s=!r;if(null==e)return!i;for(e=Object(e);o--;){var a=n[o];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<i;){var u=(a=n[o])[0],c=e[u],l=a[1];if(s&&a[2]){if(void 0===c&&!(u in e))return!1}else{var d=new un;if(r)var p=r(c,l,u,e,t,d);if(!(void 0===p?lr(l,c,dr|pr,r,d):p))return!1}}return!0}(n,e,t)}}function mr(e,t){return null!=e&&t in Object(e)}function br(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=Vt(t,e)).length,i=!1;++r<o;){var s=Ht(t[r]);if(!(i=null!=e&&n(e,s)))break;e=e[s]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&Ze(o)&&Je(s,o)&&(oe(e)||ot(e))}(e,t,mr)}var yr=1,gr=2;function wr(e,t){return It(e)&&hr(t)?fr(Ht(e),t):function(n){var r=function(e,t,n){var r=null==e?void 0:Yt(e,t);return void 0===r?n:r}(n,e);return void 0===r&&r===t?br(n,e):lr(t,r,yr|gr)}}function jr(e){return It(e)?(t=Ht(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Yt(t,e)}}(e);var t}function _r(e){return"function"==typeof e?e:null==e?le:"object"==typeof e?oe(e)?wr(e[0],e[1]):vr(e):jr(e)}var Sr,Er=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),s=i.length;s--;){var a=i[Sr?s:++r];if(!1===t(o[a],a,o))break}return e};var Pr=function(e,t){return function(n,r){if(null==n)return n;if(!Ke(n))return e(n,r);for(var o=n.length,i=t?o:-1,s=Object(n);(t?i--:++i<o)&&!1!==r(s[i],i,s););return n}}((function(e,t){return e&&Er(e,t,_t)})),Ar=Pr;function xr(e,t,n){(void 0!==n&&!ze(e[t],n)||void 0===n&&!(t in e))&&Me(e,t,n)}function Ir(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Cr(e){return function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,s=t.length;++i<s;){var a=t[i],u=r?r(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),o?Me(n,a,u):Ve(n,a,u)}return n}(e,Pt(e))}function kr(e,t,n,r,o,i,s){var a=Ir(e,n),u=Ir(t,n),c=s.get(u);if(c)xr(e,n,c);else{var l,d=i?i(a,u,n+"",e,t,s):void 0,p=void 0===d;if(p){var h=oe(u),f=!h&&ut(u),v=!h&&!f&&mt(u);d=u,h||f||v?oe(a)?d=a:ee(l=a)&&Ke(l)?d=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(a):f?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=pn?pn(n):new e.constructor(n);return e.copy(r),r}(u,!0)):v?(p=!1,d=Dn(u,!0)):d=[]:function(e){if(!ee(e)||Q(e)!=tn)return!1;var t=en(e);if(null===t)return!0;var n=sn.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&on.call(n)==an}(u)||ot(u)?(d=a,ot(a)?d=Cr(a):ce(a)&&!ve(a)||(d=function(e){return"function"!=typeof e.constructor||Qe(e)?{}:Ue(en(e))}(u))):p=!1}p&&(s.set(u,d),o(d,u,r,i,s),s.delete(u)),xr(e,n,d)}}function Ur(e,t,n,r,o){e!==t&&Er(t,(function(i,s){if(o||(o=new un),ce(i))kr(e,t,s,n,Ur,r,o);else{var a=r?r(Ir(e,s),i,s+"",e,t,o):void 0;void 0===a&&(a=i),xr(e,s,a)}}),Pt)}var Or=/[\\^$.*+?()[\]{}|]/g,Dr=RegExp(Or.source);function Rr(e,t){var n=-1,r=Ke(e)?Array(e.length):[];return Ar(e,(function(e,o,i){r[++n]=t(e,o,i)})),r}function Br(e,t){return Qt(function(e,t){return(oe(e)?re:Rr)(e,_r(t))}(e,t),1)}function Tr(e,t){return e>t}function Nr(e){return"string"==typeof e||!oe(e)&&ee(e)&&"[object String]"==Q(e)}function Lr(e,t){return e&&e.length?function(e,t,n){for(var r=-1,o=e.length;++r<o;){var i=e[r],s=t(i);if(null!=s&&(void 0===a?s==s&&!ne(s):n(s,a)))var a=s,u=i}return u}(e,_r(t),Tr):void 0}var qr,Gr=(qr=function(e,t,n){Ur(e,t,n)},He((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=qr.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!ce(n))return!1;var r=typeof t;return!!("number"==r?Ke(n)&&Je(t,n.length):"string"==r&&t in n)&&ze(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var s=t[n];s&&qr(e,s,n,o)}return e})));function Fr(e,t){return e(t={exports:{}},t.exports),t.exports}var Jr={},Mr=Jr;function zr(e){return e<0?-1:1}function Wr(e,t){t.unsigned||--e;const n=t.unsigned?0:-Math.pow(2,e),r=Math.pow(2,e)-1,o=t.moduloBitLength?Math.pow(2,t.moduloBitLength):Math.pow(2,e),i=t.moduloBitLength?Math.pow(2,t.moduloBitLength-1):Math.pow(2,e-1);return function(e,s){s||(s={});let a=+e;if(s.enforceRange){if(!Number.isFinite(a))throw new TypeError("Argument is not a finite number");if(a=zr(a)*Math.floor(Math.abs(a)),a<n||a>r)throw new TypeError("Argument is not in byte range");return a}if(!isNaN(a)&&s.clamp)return a=function(e){return e%1==.5&&0==(1&e)?Math.floor(e):Math.round(e)}(a),a<n&&(a=n),a>r&&(a=r),a;if(!Number.isFinite(a)||0===a)return 0;if(a=zr(a)*Math.floor(Math.abs(a)),a%=o,!t.unsigned&&a>=i)return a-o;if(t.unsigned)if(a<0)a+=o;else if(-0===a)return 0;return a}}Jr.void=function(){},Jr.boolean=function(e){return!!e},Jr.byte=Wr(8,{unsigned:!1}),Jr.octet=Wr(8,{unsigned:!0}),Jr.short=Wr(16,{unsigned:!1}),Jr["unsigned short"]=Wr(16,{unsigned:!0}),Jr.long=Wr(32,{unsigned:!1}),Jr["unsigned long"]=Wr(32,{unsigned:!0}),Jr["long long"]=Wr(32,{unsigned:!1,moduloBitLength:64}),Jr["unsigned long long"]=Wr(32,{unsigned:!0,moduloBitLength:64}),Jr.double=function(e){const t=+e;if(!Number.isFinite(t))throw new TypeError("Argument is not a finite floating-point value");return t},Jr["unrestricted double"]=function(e){const t=+e;if(isNaN(t))throw new TypeError("Argument is NaN");return t},Jr.float=Jr.double,Jr["unrestricted float"]=Jr["unrestricted double"],Jr.DOMString=function(e,t){return t||(t={}),t.treatNullAsEmptyString&&null===e?"":String(e)},Jr.ByteString=function(e,t){const n=String(e);let r;for(let e=0;void 0!==(r=n.codePointAt(e));++e)if(r>255)throw new TypeError("Argument is not a valid bytestring");return n},Jr.USVString=function(e){const t=String(e),n=t.length,r=[];for(let e=0;e<n;++e){const o=t.charCodeAt(e);if(o<55296||o>57343)r.push(String.fromCodePoint(o));else if(56320<=o&&o<=57343)r.push(String.fromCodePoint(65533));else if(e===n-1)r.push(String.fromCodePoint(65533));else{const n=t.charCodeAt(e+1);if(56320<=n&&n<=57343){const t=1023&o,i=1023&n;r.push(String.fromCodePoint(65536+1024*t+i)),++e}else r.push(String.fromCodePoint(65533))}}return r.join("")},Jr.Date=function(e,t){if(!(e instanceof Date))throw new TypeError("Argument is not a Date object");if(!isNaN(e))return e},Jr.RegExp=function(e,t){return e instanceof RegExp||(e=new RegExp(e)),e};var Vr=Fr((function(e){e.exports.mixin=function(e,t){const n=Object.getOwnPropertyNames(t);for(let r=0;r<n.length;++r)Object.defineProperty(e,n[r],Object.getOwnPropertyDescriptor(t,n[r]))},e.exports.wrapperSymbol=Symbol("wrapper"),e.exports.implSymbol=Symbol("impl"),e.exports.wrapperForImpl=function(t){return t[e.exports.wrapperSymbol]},e.exports.implForWrapper=function(t){return t[e.exports.implSymbol]}}));Vr.mixin,Vr.wrapperSymbol,Vr.implSymbol,Vr.wrapperForImpl,Vr.implForWrapper;var $r,Hr=($r=Object.freeze({__proto__:null}))&&$r.default||$r,Yr={TRANSITIONAL:0,NONTRANSITIONAL:1};function Zr(e){return e.split("\0").map((function(e){return e.normalize("NFC")})).join("\0")}function Kr(e){for(var t=0,n=Hr.length-1;t<=n;){var r=Math.floor((t+n)/2),o=Hr[r];if(o[0][0]<=e&&o[0][1]>=e)return o;o[0][0]>e?n=r-1:t=r+1}return null}var Xr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function Qr(e){return e.replace(Xr,"_").length}var eo=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;function to(e,t){"xn--"===e.substr(0,4)&&(e=S.default.toUnicode(e));var n=!1;(Zr(e)!==e||"-"===e[3]&&"-"===e[4]||"-"===e[0]||"-"===e[e.length-1]||-1!==e.indexOf(".")||0===e.search(eo))&&(n=!0);for(var r=Qr(e),o=0;o<r;++o){var i=Kr(e.codePointAt(o));if(no===Yr.TRANSITIONAL&&"valid"!==i[1]||no===Yr.NONTRANSITIONAL&&"valid"!==i[1]&&"deviation"!==i[1]){n=!0;break}}return{label:e,error:n}}function no(e,t,n){var r=function(e,t,n){for(var r=!1,o="",i=Qr(e),s=0;s<i;++s){var a=e.codePointAt(s),u=Kr(a);switch(u[1]){case"disallowed":r=!0,o+=String.fromCodePoint(a);break;case"ignored":break;case"mapped":o+=String.fromCodePoint.apply(String,u[2]);break;case"deviation":n===Yr.TRANSITIONAL?o+=String.fromCodePoint.apply(String,u[2]):o+=String.fromCodePoint(a);break;case"valid":o+=String.fromCodePoint(a);break;case"disallowed_STD3_mapped":t?(r=!0,o+=String.fromCodePoint(a)):o+=String.fromCodePoint.apply(String,u[2]);break;case"disallowed_STD3_valid":t&&(r=!0),o+=String.fromCodePoint(a)}}return{string:o,error:r}}(e,t,n);r.string=Zr(r.string);for(var o=r.string.split("."),i=0;i<o.length;++i)try{var s=to(o[i]);o[i]=s.label,r.error=r.error||s.error}catch(e){r.error=!0}return{string:o.join("."),error:r.error}}var ro={toASCII:function(e,t,n,r){var o=no(e,t,n),i=o.string.split(".");if(i=i.map((function(e){try{return S.default.toASCII(e)}catch(t){return o.error=!0,e}})),r){var s=i.slice(0,i.length-1).join(".").length;(s.length>253||0===s.length)&&(o.error=!0);for(var a=0;a<i.length;++a)if(i.length>63||0===i.length){o.error=!0;break}}return o.error?null:i.join(".")},toUnicode:function(e,t){var n=no(e,t,Yr.NONTRANSITIONAL);return{domain:n.string,error:n.error}},PROCESSING_OPTIONS:Yr},oo=Fr((function(e){const t={ftp:21,file:null,gopher:70,http:80,https:443,ws:80,wss:443},n=Symbol("failure");function r(e){return S.default.ucs2.decode(e).length}function o(e,t){const n=e[t];return isNaN(n)?void 0:String.fromCodePoint(n)}function i(e){return e>=48&&e<=57}function s(e){return e>=65&&e<=90||e>=97&&e<=122}function a(e){return i(e)||e>=65&&e<=70||e>=97&&e<=102}function u(e){return"."===e||"%2e"===e.toLowerCase()}function c(e){return 2===e.length&&s(e.codePointAt(0))&&(":"===e[1]||"|"===e[1])}function l(e){return void 0!==t[e]}function d(e){return l(e.scheme)}function p(e){let t=e.toString(16).toUpperCase();return 1===t.length&&(t="0"+t),"%"+t}function h(e){return e<=31||e>126}const f=new Set([32,34,35,60,62,63,96,123,125]);function v(e){return h(e)||f.has(e)}const m=new Set([47,58,59,61,64,91,92,93,94,124]);function b(e){return v(e)||m.has(e)}function y(e,t){const n=String.fromCodePoint(e);return t(e)?function(e){const t=new Buffer(e);let n="";for(let e=0;e<t.length;++e)n+=p(t[e]);return n}(n):n}function g(e){let t=10;if(e.length>=2&&"0"===e.charAt(0)&&"x"===e.charAt(1).toLowerCase()?(e=e.substring(2),t=16):e.length>=2&&"0"===e.charAt(0)&&(e=e.substring(1),t=8),""===e)return 0;return(10===t?/[^0-9]/:16===t?/[^0-9A-Fa-f]/:/[^0-7]/).test(e)?n:parseInt(e,t)}function w(e,t){if("["===e[0])return"]"!==e[e.length-1]?n:function(e){const t=[0,0,0,0,0,0,0,0];let r=0,s=null,u=0;if(58===(e=S.default.ucs2.decode(e))[u]){if(58!==e[u+1])return n;u+=2,++r,s=r}for(;u<e.length;){if(8===r)return n;if(58===e[u]){if(null!==s)return n;++u,++r,s=r;continue}let c=0,l=0;for(;l<4&&a(e[u]);)c=16*c+parseInt(o(e,u),16),++u,++l;if(46===e[u]){if(0===l)return n;if(u-=l,r>6)return n;let s=0;for(;void 0!==e[u];){let a=null;if(s>0){if(!(46===e[u]&&s<4))return n;++u}if(!i(e[u]))return n;for(;i(e[u]);){const t=parseInt(o(e,u));if(null===a)a=t;else{if(0===a)return n;a=10*a+t}if(a>255)return n;++u}t[r]=256*t[r]+a,++s,2!==s&&4!==s||++r}if(4!==s)return n;break}if(58===e[u]){if(++u,void 0===e[u])return n}else if(void 0!==e[u])return n;t[r]=c,++r}if(null!==s){let e=r-s;for(r=7;0!==r&&e>0;){const n=t[s+e-1];t[s+e-1]=t[r],t[r]=n,--r,--e}}else if(null===s&&8!==r)return n;return t}(e.substring(1,e.length-1));if(!t)return function(e){if(t=e,-1!==t.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/))return n;var t;let r="";const o=S.default.ucs2.decode(e);for(let e=0;e<o.length;++e)r+=y(o[e],h);return r}(e);const r=function(e){const t=new Buffer(e),n=[];for(let e=0;e<t.length;++e)37!==t[e]?n.push(t[e]):37===t[e]&&a(t[e+1])&&a(t[e+2])?(n.push(parseInt(t.slice(e+1,e+3).toString(),16)),e+=2):n.push(t[e]);return new Buffer(n).toString()}(e),s=ro.toASCII(r,!1,ro.PROCESSING_OPTIONS.NONTRANSITIONAL,!1);if(null===s)return n;if(-1!==s.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/))return n;const u=function(e){const t=e.split(".");if(""===t[t.length-1]&&t.length>1&&t.pop(),t.length>4)return e;const r=[];for(const o of t){if(""===o)return e;const t=g(o);if(t===n)return e;r.push(t)}for(let e=0;e<r.length-1;++e)if(r[e]>255)return n;if(r[r.length-1]>=Math.pow(256,5-r.length))return n;let o=r.pop(),i=0;for(const e of r)o+=e*Math.pow(256,3-i),++i;return o}(s);return"number"==typeof u||u===n?u:s}function j(e){return"number"==typeof e?function(e){let t="",n=e;for(let e=1;e<=4;++e)t=String(n%256)+t,4!==e&&(t="."+t),n=Math.floor(n/256);return t}(e):e instanceof Array?"["+function(e){let t="";const n=function(e){let t=null,n=1,r=null,o=0;for(let i=0;i<e.length;++i)0!==e[i]?(o>n&&(t=r,n=o),r=null,o=0):(null===r&&(r=i),++o);return o>n&&(t=r,n=o),{idx:t,len:n}}(e).idx;let r=!1;for(let o=0;o<=7;++o)r&&0===e[o]||(r&&(r=!1),n!==o?(t+=e[o].toString(16),7!==o&&(t+=":")):(t+=0===o?"::":":",r=!0));return t}(e)+"]":e}function _(e){const t=e.path;var n;0!==t.length&&("file"===e.scheme&&1===t.length&&(n=t[0],/^[A-Za-z]:$/.test(n))||t.pop())}function E(e){return""!==e.username||""!==e.password}function P(e,t,r,o,i){if(this.pointer=0,this.input=e,this.base=t||null,this.encodingOverride=r||"utf-8",this.stateOverride=i,this.url=o,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,cannotBeABaseURL:!1};const e=function(e){return e.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,"")}(this.input);e!==this.input&&(this.parseError=!0),this.input=e}const s=function(e){return e.replace(/\u0009|\u000A|\u000D/g,"")}(this.input);for(s!==this.input&&(this.parseError=!0),this.input=s,this.state=i||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=S.default.ucs2.decode(this.input);this.pointer<=this.input.length;++this.pointer){const e=this.input[this.pointer],t=isNaN(e)?void 0:String.fromCodePoint(e),r=this["parse "+this.state](e,t);if(!r)break;if(r===n){this.failure=!0;break}}}P.prototype["parse scheme start"]=function(e,t){if(s(e))this.buffer+=t.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,n;this.state="no scheme",--this.pointer}return!0},P.prototype["parse scheme"]=function(e,t){if(function(e){return s(e)||i(e)}(e)||43===e||45===e||46===e)this.buffer+=t.toLowerCase();else if(58===e){if(this.stateOverride){if(d(this.url)&&!l(this.buffer))return!1;if(!d(this.url)&&l(this.buffer))return!1;if((E(this.url)||null!==this.url.port)&&"file"===this.buffer)return!1;if("file"===this.url.scheme&&(""===this.url.host||null===this.url.host))return!1}if(this.url.scheme=this.buffer,this.buffer="",this.stateOverride)return!1;"file"===this.url.scheme?(47===this.input[this.pointer+1]&&47===this.input[this.pointer+2]||(this.parseError=!0),this.state="file"):d(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":d(this.url)?this.state="special authority slashes":47===this.input[this.pointer+1]?(this.state="path or authority",++this.pointer):(this.url.cannotBeABaseURL=!0,this.url.path.push(""),this.state="cannot-be-a-base-URL path")}else{if(this.stateOverride)return this.parseError=!0,n;this.buffer="",this.state="no scheme",this.pointer=-1}return!0},P.prototype["parse no scheme"]=function(e){return null===this.base||this.base.cannotBeABaseURL&&35!==e?n:(this.base.cannotBeABaseURL&&35===e?(this.url.scheme=this.base.scheme,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.url.cannotBeABaseURL=!0,this.state="fragment"):"file"===this.base.scheme?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},P.prototype["parse special relative or authority"]=function(e){return 47===e&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},P.prototype["parse path or authority"]=function(e){return 47===e?this.state="authority":(this.state="path",--this.pointer),!0},P.prototype["parse relative"]=function(e){return this.url.scheme=this.base.scheme,isNaN(e)?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query):47===e?this.state="relative slash":63===e?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===e?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):d(this.url)&&92===e?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(0,this.base.path.length-1),this.state="path",--this.pointer),!0},P.prototype["parse relative slash"]=function(e){return!d(this.url)||47!==e&&92!==e?47===e?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer):(92===e&&(this.parseError=!0),this.state="special authority ignore slashes"),!0},P.prototype["parse special authority slashes"]=function(e){return 47===e&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},P.prototype["parse special authority ignore slashes"]=function(e){return 47!==e&&92!==e?(this.state="authority",--this.pointer):this.parseError=!0,!0},P.prototype["parse authority"]=function(e,t){if(64===e){this.parseError=!0,this.atFlag&&(this.buffer="%40"+this.buffer),this.atFlag=!0;const e=r(this.buffer);for(let t=0;t<e;++t){const e=this.buffer.codePointAt(t);if(58===e&&!this.passwordTokenSeenFlag){this.passwordTokenSeenFlag=!0;continue}const n=y(e,b);this.passwordTokenSeenFlag?this.url.password+=n:this.url.username+=n}this.buffer=""}else if(isNaN(e)||47===e||63===e||35===e||d(this.url)&&92===e){if(this.atFlag&&""===this.buffer)return this.parseError=!0,n;this.pointer-=r(this.buffer)+1,this.buffer="",this.state="host"}else this.buffer+=t;return!0},P.prototype["parse hostname"]=P.prototype["parse host"]=function(e,t){if(this.stateOverride&&"file"===this.url.scheme)--this.pointer,this.state="file host";else if(58!==e||this.arrFlag)if(isNaN(e)||47===e||63===e||35===e||d(this.url)&&92===e){if(--this.pointer,d(this.url)&&""===this.buffer)return this.parseError=!0,n;if(this.stateOverride&&""===this.buffer&&(E(this.url)||null!==this.url.port))return this.parseError=!0,!1;const e=w(this.buffer,d(this.url));if(e===n)return n;if(this.url.host=e,this.buffer="",this.state="path start",this.stateOverride)return!1}else 91===e?this.arrFlag=!0:93===e&&(this.arrFlag=!1),this.buffer+=t;else{if(""===this.buffer)return this.parseError=!0,n;const e=w(this.buffer,d(this.url));if(e===n)return n;if(this.url.host=e,this.buffer="",this.state="port","hostname"===this.stateOverride)return!1}return!0},P.prototype["parse port"]=function(e,r){if(i(e))this.buffer+=r;else{if(!(isNaN(e)||47===e||63===e||35===e||d(this.url)&&92===e||this.stateOverride))return this.parseError=!0,n;if(""!==this.buffer){const e=parseInt(this.buffer);if(e>Math.pow(2,16)-1)return this.parseError=!0,n;this.url.port=e===(o=this.url.scheme,t[o])?null:e,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}var o;return!0};const A=new Set([47,92,63,35]);P.prototype["parse file"]=function(e){var t,n;return this.url.scheme="file",47===e||92===e?(92===e&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?isNaN(e)?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query):63===e?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===e?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):(this.input.length-this.pointer-1==0||(t=e,n=this.input[this.pointer+1],!s(t)||58!==n&&124!==n)||this.input.length-this.pointer-1>=2&&!A.has(this.input[this.pointer+2])?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),_(this.url)):this.parseError=!0,this.state="path",--this.pointer):(this.state="path",--this.pointer),!0},P.prototype["parse file slash"]=function(e){var t;return 47===e||92===e?(92===e&&(this.parseError=!0),this.state="file host"):(null!==this.base&&"file"===this.base.scheme&&(2===(t=this.base.path[0]).length&&s(t.codePointAt(0))&&":"===t[1]?this.url.path.push(this.base.path[0]):this.url.host=this.base.host),this.state="path",--this.pointer),!0},P.prototype["parse file host"]=function(e,t){if(isNaN(e)||47===e||92===e||63===e||35===e)if(--this.pointer,!this.stateOverride&&c(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let e=w(this.buffer,d(this.url));if(e===n)return n;if("localhost"===e&&(e=""),this.url.host=e,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=t;return!0},P.prototype["parse path start"]=function(e){return d(this.url)?(92===e&&(this.parseError=!0),this.state="path",47!==e&&92!==e&&--this.pointer):this.stateOverride||63!==e?this.stateOverride||35!==e?void 0!==e&&(this.state="path",47!==e&&--this.pointer):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},P.prototype["parse path"]=function(e){if(isNaN(e)||47===e||d(this.url)&&92===e||!this.stateOverride&&(63===e||35===e)){if(d(this.url)&&92===e&&(this.parseError=!0),!function(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e}(this.buffer)?!u(this.buffer)||47===e||d(this.url)&&92===e?u(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&c(this.buffer)&&(""!==this.url.host&&null!==this.url.host&&(this.parseError=!0,this.url.host=""),this.buffer=this.buffer[0]+":"),this.url.path.push(this.buffer)):this.url.path.push(""):(_(this.url),47===e||d(this.url)&&92===e||this.url.path.push("")),this.buffer="","file"===this.url.scheme&&(void 0===e||63===e||35===e))for(;this.url.path.length>1&&""===this.url.path[0];)this.parseError=!0,this.url.path.shift();63===e&&(this.url.query="",this.state="query"),35===e&&(this.url.fragment="",this.state="fragment")}else 37!==e||a(this.input[this.pointer+1])&&a(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=y(e,v);return!0},P.prototype["parse cannot-be-a-base-URL path"]=function(e){return 63===e?(this.url.query="",this.state="query"):35===e?(this.url.fragment="",this.state="fragment"):(isNaN(e)||37===e||(this.parseError=!0),37!==e||a(this.input[this.pointer+1])&&a(this.input[this.pointer+2])||(this.parseError=!0),isNaN(e)||(this.url.path[0]=this.url.path[0]+y(e,h))),!0},P.prototype["parse query"]=function(e,t){if(isNaN(e)||!this.stateOverride&&35===e){d(this.url)&&"ws"!==this.url.scheme&&"wss"!==this.url.scheme||(this.encodingOverride="utf-8");const t=new Buffer(this.buffer);for(let e=0;e<t.length;++e)t[e]<33||t[e]>126||34===t[e]||35===t[e]||60===t[e]||62===t[e]?this.url.query+=p(t[e]):this.url.query+=String.fromCodePoint(t[e]);this.buffer="",35===e&&(this.url.fragment="",this.state="fragment")}else 37!==e||a(this.input[this.pointer+1])&&a(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=t;return!0},P.prototype["parse fragment"]=function(e){return isNaN(e)||(0===e?this.parseError=!0:(37!==e||a(this.input[this.pointer+1])&&a(this.input[this.pointer+2])||(this.parseError=!0),this.url.fragment+=y(e,h))),!0},e.exports.serializeURL=function(e,t){let n=e.scheme+":";if(null!==e.host?(n+="//",""===e.username&&""===e.password||(n+=e.username,""!==e.password&&(n+=":"+e.password),n+="@"),n+=j(e.host),null!==e.port&&(n+=":"+e.port)):null===e.host&&"file"===e.scheme&&(n+="//"),e.cannotBeABaseURL)n+=e.path[0];else for(const t of e.path)n+="/"+t;return null!==e.query&&(n+="?"+e.query),t||null===e.fragment||(n+="#"+e.fragment),n},e.exports.serializeURLOrigin=function(t){switch(t.scheme){case"blob":try{return e.exports.serializeURLOrigin(e.exports.parseURL(t.path[0]))}catch(e){return"null"}case"ftp":case"gopher":case"http":case"https":case"ws":case"wss":return function(e){let t=e.scheme+"://";return t+=j(e.host),null!==e.port&&(t+=":"+e.port),t}({scheme:t.scheme,host:t.host,port:t.port});case"file":return"file://";default:return"null"}},e.exports.basicURLParse=function(e,t){void 0===t&&(t={});const n=new P(e,t.baseURL,t.encodingOverride,t.url,t.stateOverride);return n.failure?"failure":n.url},e.exports.setTheUsername=function(e,t){e.username="";const n=S.default.ucs2.decode(t);for(let t=0;t<n.length;++t)e.username+=y(n[t],b)},e.exports.setThePassword=function(e,t){e.password="";const n=S.default.ucs2.decode(t);for(let t=0;t<n.length;++t)e.password+=y(n[t],b)},e.exports.serializeHost=j,e.exports.cannotHaveAUsernamePasswordPort=function(e){return null===e.host||""===e.host||e.cannotBeABaseURL||"file"===e.scheme},e.exports.serializeInteger=function(e){return String(e)},e.exports.parseURL=function(t,n){return void 0===n&&(n={}),e.exports.basicURLParse(t,{baseURL:n.baseURL,encodingOverride:n.encodingOverride})}}));oo.serializeURL,oo.serializeURLOrigin,oo.basicURLParse,oo.setTheUsername,oo.setThePassword,oo.serializeHost,oo.cannotHaveAUsernamePasswordPort,oo.serializeInteger,oo.parseURL;var io=class{constructor(e){const t=e[0],n=e[1];let r=null;if(void 0!==n&&(r=oo.basicURLParse(n),"failure"===r))throw new TypeError("Invalid base URL");const o=oo.basicURLParse(t,{baseURL:r});if("failure"===o)throw new TypeError("Invalid URL");this._url=o}get href(){return oo.serializeURL(this._url)}set href(e){const t=oo.basicURLParse(e);if("failure"===t)throw new TypeError("Invalid URL");this._url=t}get origin(){return oo.serializeURLOrigin(this._url)}get protocol(){return this._url.scheme+":"}set protocol(e){oo.basicURLParse(e+":",{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(e){oo.cannotHaveAUsernamePasswordPort(this._url)||oo.setTheUsername(this._url,e)}get password(){return this._url.password}set password(e){oo.cannotHaveAUsernamePasswordPort(this._url)||oo.setThePassword(this._url,e)}get host(){const e=this._url;return null===e.host?"":null===e.port?oo.serializeHost(e.host):oo.serializeHost(e.host)+":"+oo.serializeInteger(e.port)}set host(e){this._url.cannotBeABaseURL||oo.basicURLParse(e,{url:this._url,stateOverride:"host"})}get hostname(){return null===this._url.host?"":oo.serializeHost(this._url.host)}set hostname(e){this._url.cannotBeABaseURL||oo.basicURLParse(e,{url:this._url,stateOverride:"hostname"})}get port(){return null===this._url.port?"":oo.serializeInteger(this._url.port)}set port(e){oo.cannotHaveAUsernamePasswordPort(this._url)||(""===e?this._url.port=null:oo.basicURLParse(e,{url:this._url,stateOverride:"port"}))}get pathname(){return this._url.cannotBeABaseURL?this._url.path[0]:0===this._url.path.length?"":"/"+this._url.path.join("/")}set pathname(e){this._url.cannotBeABaseURL||(this._url.path=[],oo.basicURLParse(e,{url:this._url,stateOverride:"path start"}))}get search(){return null===this._url.query||""===this._url.query?"":"?"+this._url.query}set search(e){const t=this._url;if(""===e)return void(t.query=null);const n="?"===e[0]?e.substring(1):e;t.query="",oo.basicURLParse(n,{url:t,stateOverride:"query"})}get hash(){return null===this._url.fragment||""===this._url.fragment?"":"#"+this._url.fragment}set hash(e){if(""===e)return void(this._url.fragment=null);const t="#"===e[0]?e.substring(1):e;this._url.fragment="",oo.basicURLParse(t,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}},so=Fr((function(e){const t=Vr.implSymbol;function n(r){if(!this||this[t]||!(this instanceof n))throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");if(arguments.length<1)throw new TypeError("Failed to construct 'URL': 1 argument required, but only "+arguments.length+" present.");const o=[];for(let e=0;e<arguments.length&&e<2;++e)o[e]=arguments[e];o[0]=Mr.USVString(o[0]),void 0!==o[1]&&(o[1]=Mr.USVString(o[1])),e.exports.setup(this,o)}n.prototype.toJSON=function(){if(!this||!e.exports.is(this))throw new TypeError("Illegal invocation");const n=[];for(let e=0;e<arguments.length&&e<0;++e)n[e]=arguments[e];return this[t].toJSON.apply(this[t],n)},Object.defineProperty(n.prototype,"href",{get(){return this[t].href},set(e){e=Mr.USVString(e),this[t].href=e},enumerable:!0,configurable:!0}),n.prototype.toString=function(){if(!this||!e.exports.is(this))throw new TypeError("Illegal invocation");return this.href},Object.defineProperty(n.prototype,"origin",{get(){return this[t].origin},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"protocol",{get(){return this[t].protocol},set(e){e=Mr.USVString(e),this[t].protocol=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"username",{get(){return this[t].username},set(e){e=Mr.USVString(e),this[t].username=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"password",{get(){return this[t].password},set(e){e=Mr.USVString(e),this[t].password=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"host",{get(){return this[t].host},set(e){e=Mr.USVString(e),this[t].host=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hostname",{get(){return this[t].hostname},set(e){e=Mr.USVString(e),this[t].hostname=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"port",{get(){return this[t].port},set(e){e=Mr.USVString(e),this[t].port=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pathname",{get(){return this[t].pathname},set(e){e=Mr.USVString(e),this[t].pathname=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"search",{get(){return this[t].search},set(e){e=Mr.USVString(e),this[t].search=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hash",{get(){return this[t].hash},set(e){e=Mr.USVString(e),this[t].hash=e},enumerable:!0,configurable:!0}),e.exports={is:e=>!!e&&e[t]instanceof io,create(e,t){let r=Object.create(n.prototype);return this.setup(r,e,t),r},setup(e,n,r){r||(r={}),r.wrapper=e,e[t]=new io(n,r),e[t][Vr.wrapperSymbol]=e},interface:n,expose:{Window:{URL:n},Worker:{URL:n}}}}));so.is,so.create,so.setup,so.expose;var ao={URL:so.interface,serializeURL:oo.serializeURL,serializeURLOrigin:oo.serializeURLOrigin,basicURLParse:oo.basicURLParse,setTheUsername:oo.setTheUsername,setThePassword:oo.setThePassword,serializeHost:oo.serializeHost,serializeInteger:oo.serializeInteger,parseURL:oo.parseURL};const uo=g.default.Readable,co=Symbol("buffer"),lo=Symbol("type");class po{constructor(){this[lo]="";const e=arguments[0],t=arguments[1],n=[];let r=0;if(e){const t=e,o=Number(t.length);for(let e=0;e<o;e++){const o=t[e];let i;i=o instanceof Buffer?o:ArrayBuffer.isView(o)?Buffer.from(o.buffer,o.byteOffset,o.byteLength):o instanceof ArrayBuffer?Buffer.from(o):o instanceof po?o[co]:Buffer.from("string"==typeof o?o:String(o)),r+=i.length,n.push(i)}}this[co]=Buffer.concat(n);let o=t&&void 0!==t.type&&String(t.type).toLowerCase();o&&!/[^\u0020-\u007E]/.test(o)&&(this[lo]=o)}get size(){return this[co].length}get type(){return this[lo]}text(){return Promise.resolve(this[co].toString())}arrayBuffer(){const e=this[co],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new uo;return e._read=function(){},e.push(this[co]),e.push(null),e}toString(){return"[object Blob]"}slice(){const e=this.size,t=arguments[0],n=arguments[1];let r,o;r=void 0===t?0:t<0?Math.max(e+t,0):Math.min(t,e),o=void 0===n?e:n<0?Math.max(e+n,0):Math.min(n,e);const i=Math.max(o-r,0),s=this[co].slice(r,r+i),a=new po([],{type:arguments[2]});return a[co]=s,a}}function ho(e,t,n){Error.call(this,e),this.message=e,this.type=t,n&&(this.code=this.errno=n.code),Error.captureStackTrace(this,this.constructor)}let fo;Object.defineProperties(po.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(po.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),ho.prototype=Object.create(Error.prototype),ho.prototype.constructor=ho,ho.prototype.name="FetchError";try{fo=require("encoding").convert}catch(e){}const vo=Symbol("Body internals"),mo=g.default.PassThrough;function bo(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.size;let o=void 0===r?0:r;var i=n.timeout;let s=void 0===i?0:i;null==e?e=null:go(e)?e=Buffer.from(e.toString()):wo(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof g.default||(e=Buffer.from(String(e)))),this[vo]={body:e,disturbed:!1,error:null},this.size=o,this.timeout=s,e instanceof g.default&&e.on("error",(function(e){const n="AbortError"===e.name?e:new ho(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[vo].error=n}))}function yo(){var e=this;if(this[vo].disturbed)return bo.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[vo].disturbed=!0,this[vo].error)return bo.Promise.reject(this[vo].error);let t=this.body;if(null===t)return bo.Promise.resolve(Buffer.alloc(0));if(wo(t)&&(t=t.stream()),Buffer.isBuffer(t))return bo.Promise.resolve(t);if(!(t instanceof g.default))return bo.Promise.resolve(Buffer.alloc(0));let n=[],r=0,o=!1;return new bo.Promise((function(i,s){let a;e.timeout&&(a=setTimeout((function(){o=!0,s(new ho(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(o=!0,s(t)):s(new ho(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!o&&null!==t){if(e.size&&r+t.length>e.size)return o=!0,void s(new ho(`content size at ${e.url} over limit: ${e.size}`,"max-size"));r+=t.length,n.push(t)}})),t.on("end",(function(){if(!o){clearTimeout(a);try{i(Buffer.concat(n,r))}catch(t){s(new ho(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function go(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function wo(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function jo(e){let t,n,r=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return r instanceof g.default&&"function"!=typeof r.getBoundary&&(t=new mo,n=new mo,r.pipe(t),r.pipe(n),e[vo].body=t,r=n),r}function _o(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":go(e)?"application/x-www-form-urlencoded;charset=UTF-8":wo(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof g.default?null:"text/plain;charset=UTF-8"}function So(e){const t=e.body;return null===t?0:wo(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}bo.prototype={get body(){return this[vo].body},get bodyUsed(){return this[vo].disturbed},arrayBuffer(){return yo.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return yo.call(this).then((function(t){return Object.assign(new po([],{type:e.toLowerCase()}),{[co]:t})}))},json(){var e=this;return yo.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return bo.Promise.reject(new ho(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return yo.call(this).then((function(e){return e.toString()}))},buffer(){return yo.call(this)},textConverted(){var e=this;return yo.call(this).then((function(t){return function(e,t){if("function"!=typeof fo)throw new Error("The package `encoding` must be installed to use the textConverted() function");const n=t.get("content-type");let r,o,i="utf-8";n&&(r=/charset=([^;]*)/i.exec(n));o=e.slice(0,1024).toString(),!r&&o&&(r=/<meta.+?charset=(['"])(.+?)\1/i.exec(o));!r&&o&&(r=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(o),r||(r=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(o),r&&r.pop()),r&&(r=/charset=(.*)/i.exec(r.pop())));!r&&o&&(r=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(o));r&&(i=r.pop(),"gb2312"!==i&&"gbk"!==i||(i="gb18030"));return fo(e,"UTF-8",i).toString()}(t,e.headers)}))}},Object.defineProperties(bo.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),bo.mixIn=function(e){for(const t of Object.getOwnPropertyNames(bo.prototype))if(!(t in e)){const n=Object.getOwnPropertyDescriptor(bo.prototype,t);Object.defineProperty(e,t,n)}},bo.Promise=global.Promise;const Eo=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,Po=/[^\t\x20-\x7e\x80-\xff]/;function Ao(e){if(e=`${e}`,Eo.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function xo(e){if(e=`${e}`,Po.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function Io(e,t){t=t.toLowerCase();for(const n in e)if(n.toLowerCase()===t)return n}const Co=Symbol("map");class ko{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[Co]=Object.create(null),e instanceof ko){const t=e.raw(),n=Object.keys(t);for(const e of n)for(const n of t[e])this.append(e,n)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const n=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");n.push(Array.from(t))}for(const e of n){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const n=e[t];this.append(t,n)}}}}get(e){Ao(e=`${e}`);const t=Io(this[Co],e);return void 0===t?null:this[Co][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=Uo(this),r=0;for(;r<n.length;){var o=n[r];const i=o[0],s=o[1];e.call(t,s,i,this),n=Uo(this),r++}}set(e,t){t=`${t}`,Ao(e=`${e}`),xo(t);const n=Io(this[Co],e);this[Co][void 0!==n?n:e]=[t]}append(e,t){t=`${t}`,Ao(e=`${e}`),xo(t);const n=Io(this[Co],e);void 0!==n?this[Co][n].push(t):this[Co][e]=[t]}has(e){return Ao(e=`${e}`),void 0!==Io(this[Co],e)}delete(e){Ao(e=`${e}`);const t=Io(this[Co],e);void 0!==t&&delete this[Co][t]}raw(){return this[Co]}keys(){return Do(this,"key")}values(){return Do(this,"value")}[Symbol.iterator](){return Do(this,"key+value")}}function Uo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[Co]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[Co][t].join(", ")}:function(t){return[t.toLowerCase(),e[Co][t].join(", ")]})}ko.prototype.entries=ko.prototype[Symbol.iterator],Object.defineProperty(ko.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(ko.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const Oo=Symbol("internal");function Do(e,t){const n=Object.create(Ro);return n[Oo]={target:e,kind:t,index:0},n}const Ro=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==Ro)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[Oo];const t=e.target,n=e.kind,r=e.index,o=Uo(t,n);return r>=o.length?{value:void 0,done:!0}:(this[Oo].index=r+1,{value:o[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function Bo(e){const t=Object.assign({__proto__:null},e[Co]),n=Io(e[Co],"Host");return void 0!==n&&(t[n]=t[n][0]),t}Object.defineProperty(Ro,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const To=Symbol("Response internals"),No=j.default.STATUS_CODES;class Lo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};bo.call(this,e,t);const n=t.status||200,r=new ko(t.headers);if(null!=e&&!r.has("Content-Type")){const t=_o(e);t&&r.append("Content-Type",t)}this[To]={url:t.url,status:n,statusText:t.statusText||No[n],headers:r,counter:t.counter}}get url(){return this[To].url||""}get status(){return this[To].status}get ok(){return this[To].status>=200&&this[To].status<300}get redirected(){return this[To].counter>0}get statusText(){return this[To].statusText}get headers(){return this[To].headers}clone(){return new Lo(jo(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}bo.mixIn(Lo.prototype),Object.defineProperties(Lo.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(Lo.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const qo=Symbol("Request internals"),Go=_.default.URL||ao.URL,Fo=_.default.parse,Jo=_.default.format;function Mo(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(e)&&(e=new Go(e).toString()),Fo(e)}const zo="destroy"in g.default.Readable.prototype;function Wo(e){return"object"==typeof e&&"object"==typeof e[qo]}class Vo{constructor(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Wo(e)?t=Mo(e.url):(t=e&&e.href?Mo(e.href):Mo(`${e}`),e={});let r=n.method||e.method||"GET";if(r=r.toUpperCase(),(null!=n.body||Wo(e)&&null!==e.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let o=null!=n.body?n.body:Wo(e)&&null!==e.body?jo(e):null;bo.call(this,o,{timeout:n.timeout||e.timeout||0,size:n.size||e.size||0});const i=new ko(n.headers||e.headers||{});if(null!=o&&!i.has("Content-Type")){const e=_o(o);e&&i.append("Content-Type",e)}let s=Wo(e)?e.signal:null;if("signal"in n&&(s=n.signal),null!=s&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[qo]={method:r,redirect:n.redirect||e.redirect||"follow",headers:i,parsedURL:t,signal:s},this.follow=void 0!==n.follow?n.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==n.compress?n.compress:void 0===e.compress||e.compress,this.counter=n.counter||e.counter||0,this.agent=n.agent||e.agent}get method(){return this[qo].method}get url(){return Jo(this[qo].parsedURL)}get headers(){return this[qo].headers}get redirect(){return this[qo].redirect}get signal(){return this[qo].signal}clone(){return new Vo(this)}}function $o(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}bo.mixIn(Vo.prototype),Object.defineProperty(Vo.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(Vo.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),$o.prototype=Object.create(Error.prototype),$o.prototype.constructor=$o,$o.prototype.name="AbortError";const Ho=_.default.URL||ao.URL,Yo=g.default.PassThrough;function Zo(e,t){if(!Zo.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return bo.Promise=Zo.Promise,new Zo.Promise((function(n,r){const o=new Vo(e,t),i=function(e){const t=e[qo].parsedURL,n=new ko(e[qo].headers);if(n.has("Accept")||n.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof g.default.Readable&&!zo)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let r=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(r="0"),null!=e.body){const t=So(e);"number"==typeof t&&(r=String(t))}r&&n.set("Content-Length",r),n.has("User-Agent")||n.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip,deflate");let o=e.agent;return"function"==typeof o&&(o=o(t)),n.has("Connection")||o||n.set("Connection","close"),Object.assign({},t,{method:e.method,headers:Bo(n),agent:o})}(o),s=("https:"===i.protocol?E.default:j.default).request,a=o.signal;let u=null;const c=function(){let e=new $o("The user aborted a request.");r(e),o.body&&o.body instanceof g.default.Readable&&Ko(o.body,e),u&&u.body&&u.body.emit("error",e)};if(a&&a.aborted)return void c();const l=function(){c(),h()},d=s(i);let p;function h(){d.abort(),a&&a.removeEventListener("abort",l),clearTimeout(p)}a&&a.addEventListener("abort",l),o.timeout&&d.once("socket",(function(e){p=setTimeout((function(){r(new ho(`network timeout at: ${o.url}`,"request-timeout")),h()}),o.timeout)})),d.on("error",(function(e){r(new ho(`request to ${o.url} failed, reason: ${e.message}`,"system",e)),u&&u.body&&Ko(u.body,e),h()})),function(e,t){let n;e.on("socket",(function(e){n=e})),e.on("response",(function(e){const r=e.headers;"chunked"!==r["transfer-encoding"]||r["content-length"]||e.once("close",(function(e){if(n.listenerCount("data")>0&&!e){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",t(e)}}))}))}(d,(function(e){a&&a.aborted||u&&u.body&&Ko(u.body,e)})),parseInt(process.version.substring(1))<14&&d.on("socket",(function(e){e.addListener("close",(function(t){const n=e.listenerCount("data")>0;if(u&&n&&!t&&(!a||!a.aborted)){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",u.body.emit("error",e)}}))})),d.on("response",(function(e){clearTimeout(p);const t=function(e){const t=new ko;for(const n of Object.keys(e))if(!Eo.test(n))if(Array.isArray(e[n]))for(const r of e[n])Po.test(r)||(void 0===t[Co][n]?t[Co][n]=[r]:t[Co][n].push(r));else Po.test(e[n])||(t[Co][n]=[e[n]]);return t}(e.headers);if(Zo.isRedirect(e.statusCode)){const s=t.get("Location");let a=null;try{a=null===s?null:new Ho(s,o.url).toString()}catch(e){if("manual"!==o.redirect)return r(new ho(`uri requested responds with an invalid redirect URL: ${s}`,"invalid-redirect")),void h()}switch(o.redirect){case"error":return r(new ho(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),void h();case"manual":if(null!==a)try{t.set("Location",a)}catch(e){r(e)}break;case"follow":if(null===a)break;if(o.counter>=o.follow)return r(new ho(`maximum redirect reached at: ${o.url}`,"max-redirect")),void h();const s={headers:new ko(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:o.body,signal:o.signal,timeout:o.timeout,size:o.size};if(!function(e,t){const n=new Ho(t).hostname,r=new Ho(e).hostname;return n===r||"."===n[n.length-r.length-1]&&n.endsWith(r)}(o.url,a)||(i=o.url,new Ho(a).protocol!==new Ho(i).protocol))for(const e of["authorization","www-authenticate","cookie","cookie2"])s.headers.delete(e);return 303!==e.statusCode&&o.body&&null===So(o)?(r(new ho("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void h()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==o.method)||(s.method="GET",s.body=void 0,s.headers.delete("content-length")),n(Zo(new Vo(a,s))),void h())}}var i;e.once("end",(function(){a&&a.removeEventListener("abort",l)}));let s=e.pipe(new Yo);const c={url:o.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:o.size,timeout:o.timeout,counter:o.counter},d=t.get("Content-Encoding");if(!o.compress||"HEAD"===o.method||null===d||204===e.statusCode||304===e.statusCode)return u=new Lo(s,c),void n(u);const f={flush:P.default.Z_SYNC_FLUSH,finishFlush:P.default.Z_SYNC_FLUSH};if("gzip"==d||"x-gzip"==d)return s=s.pipe(P.default.createGunzip(f)),u=new Lo(s,c),void n(u);if("deflate"==d||"x-deflate"==d){const t=e.pipe(new Yo);return t.once("data",(function(e){s=8==(15&e[0])?s.pipe(P.default.createInflate()):s.pipe(P.default.createInflateRaw()),u=new Lo(s,c),n(u)})),void t.on("end",(function(){u||(u=new Lo(s,c),n(u))}))}if("br"==d&&"function"==typeof P.default.createBrotliDecompress)return s=s.pipe(P.default.createBrotliDecompress()),u=new Lo(s,c),void n(u);u=new Lo(s,c),n(u)})),function(e,t){const n=t.body;null===n?e.end():wo(n)?n.stream().pipe(e):Buffer.isBuffer(n)?(e.write(n),e.end()):n.pipe(e)}(d,o)}))}function Ko(e,t){e.destroy?e.destroy(t):(e.emit("error",t),e.end())}Zo.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},Zo.Promise=global.Promise;var Xo=function(){function e(e){this.contextProvider=e}return e.prototype.getServiceDetails=function(e,t){return L(this,void 0,void 0,(function(){return q(this,(function(n){return[2,this.fetch("".concat(this.contextProvider.getCurrentBaseUrl(),"/v1/port-forwarding/info/projects/").concat(e,"/services/").concat(t))]}))}))},e.prototype.getAddonDetails=function(e,t){return L(this,void 0,void 0,(function(){return q(this,(function(n){return[2,this.fetch("".concat(this.contextProvider.getCurrentBaseUrl(),"/v1/port-forwarding/info/projects/").concat(e,"/addons/").concat(t))]}))}))},e.prototype.fetch=function(e,t){return L(this,void 0,void 0,(function(){var n,r,o,i,s;return q(this,(function(a){switch(a.label){case 0:return n=Gr({},{headers:{Authorization:"Bearer ".concat(this.contextProvider.getCurrentToken()),"Content-Type":"application/json"}},N({},t)),[4,Zo(e,n)];case 1:return(r=a.sent()).ok?[3,3]:(o=Error.bind,s=(i=JSON).stringify,[4,r.json()]);case 2:throw new(o.apply(Error,[void 0,s.apply(i,[a.sent()])]));case 3:return[4,r.json()];case 4:return[2,a.sent()]}}))}))},e}(),Qo=function(e,t,n){return L(void 0,void 0,void 0,(function(){var r,o,i,s,a;return q(this,(function(u){switch(u.label){case 0:if(r=ni(t||"127.0.0.1"),(o=ni(n||"127.255.255.255"))<r)throw new Error("Invalid IP range");"darwin"===A.default.platform()&&(i=function(e){return L(void 0,void 0,void 0,(function(){var t;return q(this,(function(n){switch(n.label){case 0:return t="lo0 alias ".concat(e," up"),[4,ti.apply(void 0,t.split(" "))];case 1:return n.sent(),[2]}}))}))}),s=r,u.label=1;case 1:return s<=o?(a=ri(s),[4,ei(e,a)]):[3,6];case 2:return u.sent()?i?[4,i(a)]:[3,4]:[3,5];case 3:u.sent(),u.label=4;case 4:return[2,a];case 5:return s+=1,[3,1];case 6:throw new Error("Not possible to assign port '".concat(e,"' to an IP address on this machine. Please check if there is already a service running with this port which binds to the wildcard host address (0.0.0.0) and stop this service."))}}))}))},ei=function(e,t){return new Promise((function(n){var r=new u.Socket,o=!1;r.on("connect",(function(){o=!0,r.destroy()})),r.setTimeout(400),r.on("timeout",(function(){o=!1,r.destroy()})),r.on("error",(function(){o=!1})),r.on("close",(function(){n(!o)})),t?r.connect(e,t):r.connect(e)}))},ti=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return L(void 0,void 0,void 0,(function(){return q(this,(function(t){switch(t.label){case 0:return"/sbin/ifconfig",[4,oi("/sbin/ifconfig",e).resultPromise];case 1:return[2,t.sent()]}}))}))},ni=function(e){var t=e.split(".").reverse();if(4!==t.length)throw new Error("Invalid ip address: ".concat(e));for(var n=0,r=0;r<4;r+=1){var o=Number.parseInt(t[r],10);if(o<0||o>255)throw new Error("Invalid ip address: ".concat(e));n+=o<<8*r}return n},ri=function(e){if(!Number.isSafeInteger(e))throw new Error("Number is not an integer");if(e<0||e>4294967295)throw new Error("Number is out of range 0x0-0xffffffff");for(var t=[],n=0;n<4;n+=1)t.push(e>>8*n&255);return t.reverse().join(".")},oi=function(e,t,n){var r=c.spawn(e,t,N({windowsHide:!0},n)),o=new Promise((function(o,i){var s="",a="";(null===(null==n?void 0:n.stdio)||void 0===(null==n?void 0:n.stdio))&&(r.stdout&&r.stdout.on("data",(function(e){s+=e})),r.stderr&&r.stderr.on("data",(function(e){a+=e}))),r.on("close",(function(n){var r={code:n,stdout:s,stderr:a};if(0!==n){var u="Error during execution of command '".concat(e," ").concat(t.join(" "),"': ").concat(a);i({message:u,result:r})}else o(r)}))}));return{process:r,resultPromise:o}},ii=function(e,t,n){return L(void 0,void 0,void 0,(function(){var r,o;return q(this,(function(i){switch(i.label){case 0:return r=si(e,10),[4,C.default.promises.writeFile(r,t,n)];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,4,,6]),[4,C.default.promises.rename(r,e)];case 3:return i.sent(),[3,6];case 4:return o=i.sent(),[4,C.default.promises.unlink(r).catch((function(){}))];case 5:throw i.sent(),o;case 6:return[2]}}))}))},si=function(e,t){for(var n,r=k.default.dirname(e),o=k.default.basename(e),i=0;null===(n=i<t)||void 0===n||n;i+=1){var s=G([],Array(16),!0).map((function(){return Math.floor(16*Math.random()).toString(16)})).join(""),a=".".concat(s,".").concat(o),u=k.default.join(r,a);if(!C.default.existsSync(u))return u}throw new Error("Could not write file to file '".concat(e,"'."))},ai="win32"===process.platform?"\r\n":"\n",ui=function(){function e(e,t){this.nodes=e,this.config=t}return e.prototype.add=function(e,t,n){var r=this;if(0===t.length)return this;var o=this.findOrCreateEntry(e,n);return t.forEach((function(e){if(!o.hosts.find((function(t){return t.host===e}))){var t=1;0===o.hosts.length&&(t=r.config.indent-"".concat(o.ipPrefixWhitespace).concat(o.ip).length),o.hosts.push({whitespace:" ".repeat(t<1?1:t),host:e})}})),this},e.prototype.remove=function(e,t){var n=this;return this.findEntries(e).forEach((function(e){t.forEach((function(t){var r=e.hosts.findIndex((function(e){return e.host===t}));r<0||(0===r&&void 0!==e.hosts[1]&&(e.hosts[1].whitespace=e.hosts[0].whitespace),e.hosts.splice(r,1),0===e.hosts.length&&n.removeEntry(e))}))})),this},e.prototype.removeHosts=function(e){var t=this;vi(this.nodes,"entry").forEach((function(n){t.remove(n.ip,e)}))},e.prototype.removeIps=function(e){var t=this;return e.forEach((function(e){t.findEntries(e).forEach((function(e){return t.removeEntry(e)}))})),this},e.prototype.resolveHosts=function(e){return Br(this.findEntries(e),(function(e){return e.hosts.map((function(e){return e.host}))}))},e.prototype.resolveIps=function(e){return vi(this.nodes,"entry").filter((function(t){return t.hosts.some((function(t){return t.host===e}))})).map((function(e){return e.ip}))},e.prototype.toString=function(){return pi(this.nodes,this.config.eol)},e.prototype.removeEntry=function(e){var t,n="number"==typeof(t=e)||ee(t)&&"[object Number]"==Q(t)?e:this.nodes.findIndex((function(t){return t===e}));n<0||this.nodes.splice(n,1)},e.prototype.findEntries=function(e){return vi(this.nodes,"entry").filter((function(t){return t.ip===e}))},e.prototype.findOrCreateEntry=function(e,t){var n=this.findEntries(e)[0];if(n)return n;var r=this.makeEntry(e);if(t){var o=di(t),i=this.nodes.findIndex((function(e){return"comment"===e.type&&e.line===o}));if(i>=0)this.insertAt(i+1,r);else{var s="blank"!==this.nodes[this.nodes.length-1].type?[ci(),li(o),r]:[li(o),r];this.insertAt.apply(this,G([this.nodes.length],s,!1))}}else this.insertAt(this.nodes.length,r);return r},e.prototype.insertAt=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(t=this.nodes).splice.apply(t,G([e,0],n,!1))},e.prototype.makeEntry=function(e,t){var n=this.config.ipPrefixWhitespace;return N({type:"entry",ip:e,ipPrefixWhitespace:n,hosts:[]},t)},e.fromNodes=function(t,n){var r,o;return new e(t.filter((function(e){return"eol"!==e.type})),{eol:null!==(r=null==n?void 0:n.eol)&&void 0!==r?r:function(){var e,n=vi(t,"eol").map((function(e){return e.line}));return null!==(e=mi(n))&&void 0!==e?e:ai}(),indent:null!==(o=null==n?void 0:n.indent)&&void 0!==o?o:function(){var e,n=Br(vi(t,"entry"),(function(e){var t=e.ipPrefixWhitespace,n=e.ip,r=e.hosts[0];return r?["".concat(t).concat(n).concat(r.whitespace).length]:[]}));return null!==(e=mi(n))&&void 0!==e?e:17}(),ipPrefixWhitespace:""})},e.parse=function(e,t){return this.fromNodes(hi(e),t)},e}(),ci=function(){return{type:"blank",line:""}},li=function(e){return{type:"comment",line:di(e)}},di=function(e){return e.startsWith("#")?e:"# ".concat(e)},pi=function(e,t){var n=e.map((function(e){switch(e.type){case"entry":var t=e.hosts.map((function(e){var t=e.whitespace,n=e.host;return"".concat(t).concat(n)})).join("");return"".concat(e.ipPrefixWhitespace).concat(e.ip).concat(t);case"blank":case"comment":case"invalid":return e.line;default:return""}}));return n.join(null!=t?t:ai)},hi=function(e){return e.split(/(\r?\n)/).map((function(e){return function(e){return e.match(/^\s*#.*$/)}(e)?{type:"comment",line:e}:function(e){return e.match(/^(\r?\n)$/)}(e)?{type:"eol",line:e}:function(e){return e.match(/^\s*$/)}(e)?{type:"blank",line:e}:fi(e)}))},fi=function(e){var t=e.match(/^(\s*)(\S+)(.+)?$/);if(!t)return{type:"invalid",line:e};var n=t[1],r=t[2],o=t.slice(3),i=!1,s=Br(o.filter((function(e){return void 0!==e})),(function(e){var t=e.match(/(\s+)(\S+)/g);return t?t.map((function(e){var t=e.match(/^(\s+)(\S+)$/);t||(i=!0);var n=null!=t?t:[];return{whitespace:n[1],host:n[2]}})):(i=!0,[])}));return i?{type:"invalid",line:e}:{type:"entry",ipPrefixWhitespace:n,ip:r,hosts:s}},vi=function(e,t){return e.filter((function(e){return e.type===t}))},mi=function(e){var t=new Map;e.forEach((function(e){var n;t.set(e,(null!==(n=t.get(e))&&void 0!==n?n:0)+1)}));var n=Lr(Array.from(t.entries()),(function(e){return e[1]}));if(n)return n[0]},bi="win32"===process.platform?"C:/Windows/System32/drivers/etc/hosts":"/etc/hosts",yi=function(){function e(e){this.ast=ui.fromNodes([]);var t={writeMode:"atomic",hostsFile:bi};this.config=N(N({},t),e)}return e.prototype.add=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!Nr(e))throw new Error("Expected 'ip' to be a string, but got ".concat(typeof e,"."));return t.forEach((function(e){if(!Nr(e))throw new Error("Expected 'host' to be a string, but got ".concat(typeof e,"."))})),this.ast.add(e,t,this.config.header),this},e.prototype.remove=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!Nr(e))throw new Error("Expected 'ip' to be a string, but got ".concat(typeof e,"."));return t.forEach((function(e){if(!Nr(e))throw new Error("Expected 'host' to be a string, but got ".concat(typeof e,"."))})),this.ast.remove(e,t),this},e.prototype.removeHosts=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.forEach((function(e){if(!Nr(e))throw new Error("Expected 'host' to be a string, but got ".concat(typeof e,"."))})),this.ast.removeHosts(e),this},e.prototype.removeIps=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.forEach((function(e){if(!Nr(e))throw new Error("Expected 'ip' to be a string, but got ".concat(typeof e,"."))})),this.ast.removeIps(e),this},e.prototype.read=function(){return L(this,void 0,void 0,(function(){var e;return q(this,(function(t){switch(t.label){case 0:return[4,C.default.promises.readFile(this.config.hostsFile)];case 1:return e=t.sent(),this.ast=ui.parse(e.toString(),this.config),[2,this]}}))}))},e.prototype.write=function(e){return L(this,void 0,void 0,(function(){var t,n,r,o;return q(this,(function(i){switch(i.label){case 0:switch(t=N(N({},this.config),e),n=t.hostsFile,r=t.writeMode,o=this.ast.toString(),r){case void 0:case"atomic":return[3,1];case"standard":return[3,3];case"disabled":return[3,5]}return[3,5];case 1:return[4,ii(n,o)];case 2:case 4:return i.sent(),[3,6];case 3:return[4,C.default.promises.writeFile(n,o)];case 5:return[3,6];case 6:return[2,this]}}))}))},e.prototype.backup=function(e){return L(this,void 0,void 0,(function(){var t,n,r,o;return q(this,(function(i){switch(i.label){case 0:return C.default.existsSync(this.config.hostsFile)?(t=k.default.dirname(this.config.hostsFile),n=k.default.basename(this.config.hostsFile),r="".concat(n).concat(e.suffix),o=k.default.resolve(t,r),C.default.existsSync(o)&&!e.rewrite?[3,2]:[4,C.default.promises.copyFile(this.config.hostsFile,o)]):[2];case 1:i.sent(),i.label=2;case 2:return[2]}}))}))},e.load=function(t){return L(this,void 0,void 0,(function(){return q(this,(function(n){switch(n.label){case 0:return[4,new e(t).read()];case 1:return[2,n.sent()]}}))}))},e}(),gi=function(){function e(){this.previousPromise=Promise.resolve()}return e.prototype.enter=function(e){return L(this,void 0,void 0,(function(){var t;return q(this,(function(n){return t=this.previousPromise.then((function(){return e()})).catch((function(){return e()})),this.previousPromise=t,[2,t]}))}))},e}(),wi=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){r[e]=t[e]})),r;function r(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];var r=t.apply(this,e),o=e[e.length-1];return"function"==typeof r&&r!==o&&Object.keys(o).forEach((function(e){r[e]=o[e]})),r}};var ji=wi(Si),_i=wi(Ei);function Si(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function Ei(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}Si.proto=Si((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Si(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Ei(this)},configurable:!0})})),ji.strict=_i;var Pi=function(){},Ai=function(e,t,n){if("function"==typeof t)return Ai(e,null,t);t||(t={}),n=ji(n||Pi);var r=e._writableState,o=e._readableState,i=t.readable||!1!==t.readable&&e.readable,s=t.writable||!1!==t.writable&&e.writable,a=!1,u=function(){e.writable||c()},c=function(){s=!1,i||n.call(e)},l=function(){i=!1,s||n.call(e)},d=function(t){n.call(e,t?new Error("exited with error code: "+t):null)},p=function(t){n.call(e,t)},h=function(){process.nextTick(f)},f=function(){if(!a)return(!i||o&&o.ended&&!o.destroyed)&&(!s||r&&r.ended&&!r.destroyed)?void 0:n.call(e,new Error("premature close"))},v=function(){e.req.on("finish",c)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?s&&!r&&(e.on("end",u),e.on("close",u)):(e.on("complete",c),e.on("abort",h),e.req?v():e.on("request",v)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",d),e.on("end",l),e.on("finish",c),!1!==t.error&&e.on("error",p),e.on("close",h),function(){a=!0,e.removeListener("complete",c),e.removeListener("abort",h),e.removeListener("request",v),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("exit",d),e.removeListener("end",l),e.removeListener("error",p),e.removeListener("close",h)}},xi=Ai,Ii=function(){},Ci=/^v?\.0/.test(process.version),ki=function(e){return"function"==typeof e},Ui=function(e,t,n,r){r=ji(r);var o=!1;e.on("close",(function(){o=!0})),xi(e,{readable:t,writable:n},(function(e){if(e)return r(e);o=!0,r()}));var i=!1;return function(t){if(!o&&!i)return i=!0,function(e){return!!Ci&&!!C.default&&(e instanceof(C.default.ReadStream||Ii)||e instanceof(C.default.WriteStream||Ii))&&ki(e.close)}(e)?e.close(Ii):function(e){return e.setHeader&&ki(e.abort)}(e)?e.abort():ki(e.destroy)?e.destroy():void r(t||new Error("stream was destroyed"))}},Oi=function(e){e()},Di=function(e,t){return e.pipe(t)},Ri=function(){var e,t=Array.prototype.slice.call(arguments),n=ki(t[t.length-1]||Ii)&&t.pop()||Ii;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var r=t.map((function(o,i){var s=i<t.length-1;return Ui(o,s,i>0,(function(t){e||(e=t),t&&r.forEach(Oi),s||(r.forEach(Oi),n(e))}))}));return t.reduce(Di)};const{Duplex:Bi}=g.default;function Ti(e){e.emit("close")}function Ni(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Li(e){this.removeListener("error",Li),this.destroy(),0===this.listenerCount("error")&&this.emit("error",e)}var qi=function(e,t){let n=!0;const r=new Bi({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",(function(t,n){const o=!n&&r._readableState.objectMode?t.toString():t;r.push(o)||e.pause()})),e.once("error",(function(e){r.destroyed||(n=!1,r.destroy(e))})),e.once("close",(function(){r.destroyed||r.push(null)})),r._destroy=function(t,o){if(e.readyState===e.CLOSED)return o(t),void process.nextTick(Ti,r);let i=!1;e.once("error",(function(e){i=!0,o(e)})),e.once("close",(function(){i||o(t),process.nextTick(Ti,r)})),n&&e.terminate()},r._final=function(t){e.readyState!==e.CONNECTING?null!==e._socket&&(e._socket._writableState.finished?(t(),r._readableState.endEmitted&&r.destroy()):(e._socket.once("finish",(function(){t()})),e.close())):e.once("open",(function(){r._final(t)}))},r._read=function(){e.isPaused&&e.resume()},r._write=function(t,n,o){e.readyState!==e.CONNECTING?e.send(t,o):e.once("open",(function(){r._write(t,n,o)}))},r.on("end",Ni),r.on("error",Li),r},Gi={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}},Fi="function"==typeof __webpack_require__?__non_webpack_require__:function(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")},Ji=process.config&&process.config.variables||{},Mi=!!process.env.PREBUILDS_ONLY,zi=process.versions.modules,Wi=!(!process.versions||!process.versions.electron)||!!process.env.ELECTRON_RUN_AS_NODE||"undefined"!=typeof window&&window.process&&"renderer"===window.process.type?"electron":process.versions&&process.versions.nw?"node-webkit":"node",Vi=process.env.npm_config_arch||A.default.arch(),$i=process.env.npm_config_platform||A.default.platform(),Hi=process.env.LIBC||(function(e){return"linux"===e&&C.default.existsSync("/etc/alpine-release")}($i)?"musl":"glibc"),Yi=process.env.ARM_VERSION||("arm64"===Vi?"8":Ji.arm_version)||"",Zi=(process.versions.uv||"").split(".")[0],Ki=Xi;function Xi(e){return Fi(Xi.resolve(e))}function Qi(e){try{return C.default.readdirSync(e)}catch(e){return[]}}function es(e,t){var n=Qi(e).filter(t);return n[0]&&k.default.join(e,n[0])}function ts(e){return/\.node$/.test(e)}function ns(e){var t=e.split("-");if(2===t.length){var n=t[0],r=t[1].split("+");if(n&&r.length&&r.every(Boolean))return{name:e,platform:n,architectures:r}}}function rs(e,t){return function(n){return null!=n&&(n.platform===e&&n.architectures.includes(t))}}function os(e,t){return e.architectures.length-t.architectures.length}function is(e){var t=e.split("."),n={file:e,specificity:0};if("node"===t.pop()){for(var r=0;r<t.length;r++){var o=t[r];if("node"===o||"electron"===o||"node-webkit"===o)n.runtime=o;else if("napi"===o)n.napi=!0;else if("abi"===o.slice(0,3))n.abi=o.slice(3);else if("uv"===o.slice(0,2))n.uv=o.slice(2);else if("armv"===o.slice(0,4))n.armv=o.slice(4);else{if("glibc"!==o&&"musl"!==o)continue;n.libc=o}n.specificity++}return n}}function ss(e,t){return function(n){return null!=n&&(!(n.runtime!==e&&!function(e){return"node"===e.runtime&&e.napi}(n))&&(!(n.abi!==t&&!n.napi)&&((!n.uv||n.uv===Zi)&&((!n.armv||n.armv===Yi)&&(!n.libc||n.libc===Hi)))))}}function as(e){return function(t,n){return t.runtime!==n.runtime?t.runtime===e?-1:1:t.abi!==n.abi?t.abi?-1:1:t.specificity!==n.specificity?t.specificity>n.specificity?-1:1:0}}Xi.resolve=Xi.path=function(e){e=k.default.resolve(e||".");try{var t=Fi(k.default.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[t+"_PREBUILD"]&&(e=process.env[t+"_PREBUILD"])}catch(e){}if(!Mi){var n=es(k.default.join(e,"build/Release"),ts);if(n)return n;var r=es(k.default.join(e,"build/Debug"),ts);if(r)return r}var o=a(e);if(o)return o;var i=a(k.default.dirname(process.execPath));if(i)return i;var s=["platform="+$i,"arch="+Vi,"runtime="+Wi,"abi="+zi,"uv="+Zi,Yi?"armv="+Yi:"","libc="+Hi,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"","function"==typeof __webpack_require__?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+s+"\n loaded from: "+e+"\n");function a(e){var t=Qi(k.default.join(e,"prebuilds")).map(ns).filter(rs($i,Vi)).sort(os)[0];if(t){var n=k.default.join(e,"prebuilds",t.name),r=Qi(n).map(is).filter(ss(Wi,zi)).sort(as(Wi))[0];return r?k.default.join(n,r.file):void 0}}},Xi.parseTags=is,Xi.matchTags=ss,Xi.compareTags=as,Xi.parseTuple=ns,Xi.matchTuple=rs,Xi.compareTuples=os;var us=Fr((function(e){"function"==typeof process.addon?e.exports=process.addon.bind(process):e.exports=Ki}));var cs={mask:(e,t,n,r,o)=>{for(var i=0;i<o;i++)n[r+i]=e[i]^t[3&i]},unmask:(e,t)=>{const n=e.length;for(var r=0;r<n;r++)e[r]^=t[3&r]}},ls=Fr((function(e){try{e.exports=us(__dirname)}catch(t){e.exports=cs}})),ds=Fr((function(e){const{EMPTY_BUFFER:t}=Gi,n=Buffer[Symbol.species];function r(e,t,n,r,o){for(let i=0;i<o;i++)n[r+i]=e[i]^t[3&i]}function o(e,t){for(let n=0;n<e.length;n++)e[n]^=t[3&n]}if(e.exports={concat:function(e,r){if(0===e.length)return t;if(1===e.length)return e[0];const o=Buffer.allocUnsafe(r);let i=0;for(let t=0;t<e.length;t++){const n=e[t];o.set(n,i),i+=n.length}return i<r?new n(o.buffer,o.byteOffset,i):o},mask:r,toArrayBuffer:function(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)},toBuffer:function e(t){if(e.readOnly=!0,Buffer.isBuffer(t))return t;let r;return t instanceof ArrayBuffer?r=new n(t):ArrayBuffer.isView(t)?r=new n(t.buffer,t.byteOffset,t.byteLength):(r=Buffer.from(t),e.readOnly=!1),r},unmask:o},!process.env.WS_NO_BUFFER_UTIL)try{const t=ls;e.exports.mask=function(e,n,o,i,s){s<48?r(e,n,o,i,s):t.mask(e,n,o,i,s)},e.exports.unmask=function(e,n){e.length<32?o(e,n):t.unmask(e,n)}}catch(e){}}));ds.concat,ds.mask,ds.toArrayBuffer,ds.toBuffer,ds.unmask;const ps=Symbol("kDone"),hs=Symbol("kRun");var fs=class{constructor(e){this[ps]=()=>{this.pending--,this[hs]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[hs]()}[hs](){if(this.pending!==this.concurrency&&this.jobs.length){const e=this.jobs.shift();this.pending++,e(this[ps])}}};const{kStatusCode:vs}=Gi,ms=Buffer[Symbol.species],bs=Buffer.from([0,0,255,255]),ys=Symbol("permessage-deflate"),gs=Symbol("total-length"),ws=Symbol("callback"),js=Symbol("buffers"),_s=Symbol("error");let Ss;var Es=class{constructor(e,t,n){if(this._maxPayload=0|n,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!Ss){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;Ss=new fs(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const e=this._deflate[ws];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){const t=this._options,n=e.find((e=>!(!1===t.serverNoContextTakeover&&e.server_no_context_takeover||e.server_max_window_bits&&(!1===t.serverMaxWindowBits||"number"==typeof t.serverMaxWindowBits&&t.serverMaxWindowBits>e.server_max_window_bits)||"number"==typeof t.clientMaxWindowBits&&!e.client_max_window_bits)));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(n.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?n.client_max_window_bits=t.clientMaxWindowBits:!0!==n.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete n.client_max_window_bits,n}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(t.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(t.client_max_window_bits=this._options.clientMaxWindowBits);return t}normalizeParams(e){return e.forEach((e=>{Object.keys(e).forEach((t=>{let n=e[t];if(n.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(n=n[0],"client_max_window_bits"===t){if(!0!==n){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}else if("server_max_window_bits"===t){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==n)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}e[t]=n}))})),e}decompress(e,t,n){Ss.add((r=>{this._decompress(e,t,((e,t)=>{r(),n(e,t)}))}))}compress(e,t,n){Ss.add((r=>{this._compress(e,t,((e,t)=>{r(),n(e,t)}))}))}_decompress(e,t,n){const r=this._isServer?"client":"server";if(!this._inflate){const e=`${r}_max_window_bits`,t="number"!=typeof this.params[e]?P.default.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=P.default.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[ys]=this,this._inflate[gs]=0,this._inflate[js]=[],this._inflate.on("error",xs),this._inflate.on("data",As)}this._inflate[ws]=n,this._inflate.write(e),t&&this._inflate.write(bs),this._inflate.flush((()=>{const e=this._inflate[_s];if(e)return this._inflate.close(),this._inflate=null,void n(e);const o=ds.concat(this._inflate[js],this._inflate[gs]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[gs]=0,this._inflate[js]=[],t&&this.params[`${r}_no_context_takeover`]&&this._inflate.reset()),n(null,o)}))}_compress(e,t,n){const r=this._isServer?"server":"client";if(!this._deflate){const e=`${r}_max_window_bits`,t="number"!=typeof this.params[e]?P.default.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=P.default.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[gs]=0,this._deflate[js]=[],this._deflate.on("data",Ps)}this._deflate[ws]=n,this._deflate.write(e),this._deflate.flush(P.default.Z_SYNC_FLUSH,(()=>{if(!this._deflate)return;let e=ds.concat(this._deflate[js],this._deflate[gs]);t&&(e=new ms(e.buffer,e.byteOffset,e.length-4)),this._deflate[ws]=null,this._deflate[gs]=0,this._deflate[js]=[],t&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),n(null,e)}))}};function Ps(e){this[js].push(e),this[gs]+=e.length}function As(e){this[gs]+=e.length,this[ys]._maxPayload<1||this[gs]<=this[ys]._maxPayload?this[js].push(e):(this[_s]=new RangeError("Max payload size exceeded"),this[_s].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[_s][vs]=1009,this.removeListener("data",As),this.reset())}function xs(e){this[ys]._inflate=null,e[vs]=1007,this[ws](e)}var Is=function(e){const t=e.length;let n=0;for(;n<t;)if(0==(128&e[n]))n++;else if(192==(224&e[n])){if(n+1===t||128!=(192&e[n+1])||192==(254&e[n]))return!1;n+=2}else if(224==(240&e[n])){if(n+2>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||224===e[n]&&128==(224&e[n+1])||237===e[n]&&160==(224&e[n+1]))return!1;n+=3}else{if(240!=(248&e[n]))return!1;if(n+3>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||128!=(192&e[n+3])||240===e[n]&&128==(240&e[n+1])||244===e[n]&&e[n+1]>143||e[n]>244)return!1;n+=4}return!0},Cs=Fr((function(e){try{e.exports=us(__dirname)}catch(t){e.exports=Is}})),ks=Fr((function(e){const{isUtf8:t}=U.default;function n(e){const t=e.length;let n=0;for(;n<t;)if(0==(128&e[n]))n++;else if(192==(224&e[n])){if(n+1===t||128!=(192&e[n+1])||192==(254&e[n]))return!1;n+=2}else if(224==(240&e[n])){if(n+2>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||224===e[n]&&128==(224&e[n+1])||237===e[n]&&160==(224&e[n+1]))return!1;n+=3}else{if(240!=(248&e[n]))return!1;if(n+3>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||128!=(192&e[n+3])||240===e[n]&&128==(240&e[n+1])||244===e[n]&&e[n+1]>143||e[n]>244)return!1;n+=4}return!0}if(e.exports={isValidStatusCode:function(e){return e>=1e3&&e<=1014&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999},isValidUTF8:n,tokenChars:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0]},t)e.exports.isValidUTF8=function(e){return e.length<24?n(e):t(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{const t=Cs;e.exports.isValidUTF8=function(e){return e.length<32?n(e):t(e)}}catch(e){}}));ks.isValidStatusCode,ks.isValidUTF8,ks.tokenChars;const{Writable:Us}=g.default,{BINARY_TYPES:Os,EMPTY_BUFFER:Ds,kStatusCode:Rs,kWebSocket:Bs}=Gi,{concat:Ts,toArrayBuffer:Ns,unmask:Ls}=ds,{isValidStatusCode:qs,isValidUTF8:Gs}=ks,Fs=Buffer[Symbol.species];var Js=class extends Us{constructor(e={}){super(),this._binaryType=e.binaryType||Os[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=0|e.maxPayload,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Bs]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=0,this._loop=!1}_write(e,t,n){if(8===this._opcode&&0==this._state)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){const t=this._buffers[0];return this._buffers[0]=new Fs(t.buffer,t.byteOffset+e,t.length-e),new Fs(t.buffer,t.byteOffset,e)}const t=Buffer.allocUnsafe(e);do{const n=this._buffers[0],r=t.length-e;e>=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=new Fs(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){let t;this._loop=!0;do{switch(this._state){case 0:t=this.getInfo();break;case 1:t=this.getPayloadLength16();break;case 2:t=this.getPayloadLength64();break;case 3:this.getMask();break;case 4:t=this.getData(e);break;default:return void(this._loop=!1)}}while(this._loop);e(t)}getInfo(){if(this._bufferedBytes<2)return void(this._loop=!1);const e=this.consume(2);if(0!=(48&e[0]))return this._loop=!1,Ms(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");const t=64==(64&e[0]);if(t&&!this._extensions[Es.extensionName])return this._loop=!1,Ms(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=128==(128&e[0]),this._opcode=15&e[0],this._payloadLength=127&e[1],0===this._opcode){if(t)return this._loop=!1,Ms(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,Ms(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return this._loop=!1,Ms(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=t}else{if(!(this._opcode>7&&this._opcode<11))return this._loop=!1,Ms(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin)return this._loop=!1,Ms(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(t)return this._loop=!1,Ms(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125||8===this._opcode&&1===this._payloadLength)return this._loop=!1,Ms(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=128==(128&e[1]),this._isServer){if(!this._masked)return this._loop=!1,Ms(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,Ms(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(126===this._payloadLength)this._state=1;else{if(127!==this._payloadLength)return this.haveLength();this._state=2}}getPayloadLength16(){if(!(this._bufferedBytes<2))return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength();this._loop=!1}getPayloadLength64(){if(this._bufferedBytes<8)return void(this._loop=!1);const e=this.consume(8),t=e.readUInt32BE(0);return t>Math.pow(2,21)-1?(this._loop=!1,Ms(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=t*Math.pow(2,32)+e.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,Ms(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(e){let t=Ds;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength)return void(this._loop=!1);t=this.consume(this._payloadLength),this._masked&&0!=(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])&&Ls(t,this._mask)}return this._opcode>7?this.controlMessage(t):this._compressed?(this._state=5,void this.decompress(t,e)):(t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage())}decompress(e,t){this._extensions[Es.extensionName].decompress(e,this._fin,((e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return t(Ms(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(n)}const r=this.dataMessage();if(r)return t(r);this.startLoop(t)}))}dataMessage(){if(this._fin){const e=this._messageLength,t=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let n;n="nodebuffer"===this._binaryType?Ts(t,e):"arraybuffer"===this._binaryType?Ns(Ts(t,e)):t,this.emit("message",n,!0)}else{const n=Ts(t,e);if(!this._skipUTF8Validation&&!Gs(n))return this._loop=!1,Ms(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",n,!1)}}this._state=0}controlMessage(e){if(8===this._opcode)if(this._loop=!1,0===e.length)this.emit("conclude",1005,Ds),this.end();else{const t=e.readUInt16BE(0);if(!qs(t))return Ms(RangeError,`invalid status code ${t}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");const n=new Fs(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Gs(n))return Ms(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",t,n),this.end()}else 9===this._opcode?this.emit("ping",e):this.emit("pong",e);this._state=0}};function Ms(e,t,n,r,o){const i=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(i,Ms),i.code=o,i[Rs]=r,i}const{randomFillSync:zs}=D.default,{EMPTY_BUFFER:Ws}=Gi,{isValidStatusCode:Vs}=ks,{mask:$s,toBuffer:Hs}=ds,Ys=Symbol("kByteLength"),Zs=Buffer.alloc(4);class Ks{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){let n,r,o=!1,i=2,s=!1;t.mask&&(n=t.maskBuffer||Zs,t.generateMask?t.generateMask(n):zs(n,0,4),s=0==(n[0]|n[1]|n[2]|n[3]),i=6),"string"==typeof e?r=t.mask&&!s||void 0===t[Ys]?(e=Buffer.from(e)).length:t[Ys]:(r=e.length,o=t.mask&&t.readOnly&&!s);let a=r;r>=65536?(i+=8,a=127):r>125&&(i+=2,a=126);const u=Buffer.allocUnsafe(o?r+i:i);return u[0]=t.fin?128|t.opcode:t.opcode,t.rsv1&&(u[0]|=64),u[1]=a,126===a?u.writeUInt16BE(r,2):127===a&&(u[2]=u[3]=0,u.writeUIntBE(r,4,6)),t.mask?(u[1]|=128,u[i-4]=n[0],u[i-3]=n[1],u[i-2]=n[2],u[i-1]=n[3],s?[u,e]:o?($s(e,n,u,i,r),[u]):($s(e,n,e,0,r),[u,e])):[u,e]}close(e,t,n,r){let o;if(void 0===e)o=Ws;else{if("number"!=typeof e||!Vs(e))throw new TypeError("First argument must be a valid error code number");if(void 0!==t&&t.length){const n=Buffer.byteLength(t);if(n>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+n),o.writeUInt16BE(e,0),"string"==typeof t?o.write(t,2):o.set(t,2)}else o=Buffer.allocUnsafe(2),o.writeUInt16BE(e,0)}const i={[Ys]:o.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,o,!1,i,r]):this.sendFrame(Ks.frame(o,i),r)}ping(e,t,n){let r,o;if("string"==typeof e?(r=Buffer.byteLength(e),o=!1):(r=(e=Hs(e)).length,o=Hs.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");const i={[Ys]:r,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,i,n]):this.sendFrame(Ks.frame(e,i),n)}pong(e,t,n){let r,o;if("string"==typeof e?(r=Buffer.byteLength(e),o=!1):(r=(e=Hs(e)).length,o=Hs.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");const i={[Ys]:r,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,i,n]):this.sendFrame(Ks.frame(e,i),n)}send(e,t,n){const r=this._extensions[Es.extensionName];let o,i,s=t.binary?2:1,a=t.compress;if("string"==typeof e?(o=Buffer.byteLength(e),i=!1):(o=(e=Hs(e)).length,i=Hs.readOnly),this._firstFragment?(this._firstFragment=!1,a&&r&&r.params[r._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(a=o>=r._threshold),this._compress=a):(a=!1,s=0),t.fin&&(this._firstFragment=!0),r){const r={[Ys]:o,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:i,rsv1:a};this._deflating?this.enqueue([this.dispatch,e,this._compress,r,n]):this.dispatch(e,this._compress,r,n)}else this.sendFrame(Ks.frame(e,{[Ys]:o,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:i,rsv1:!1}),n)}dispatch(e,t,n,r){if(!t)return void this.sendFrame(Ks.frame(e,n),r);const o=this._extensions[Es.extensionName];this._bufferedBytes+=n[Ys],this._deflating=!0,o.compress(e,n.fin,((e,t)=>{if(this._socket.destroyed){const e=new Error("The socket was closed while data was being compressed");"function"==typeof r&&r(e);for(let t=0;t<this._queue.length;t++){const n=this._queue[t],r=n[n.length-1];"function"==typeof r&&r(e)}}else this._bufferedBytes-=n[Ys],this._deflating=!1,n.readOnly=!1,this.sendFrame(Ks.frame(t,n),r),this.dequeue()}))}dequeue(){for(;!this._deflating&&this._queue.length;){const e=this._queue.shift();this._bufferedBytes-=e[3][Ys],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][Ys],this._queue.push(e)}sendFrame(e,t){2===e.length?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}}var Xs=Ks;const{kForOnEventAttribute:Qs,kListener:ea}=Gi,ta=Symbol("kCode"),na=Symbol("kData"),ra=Symbol("kError"),oa=Symbol("kMessage"),ia=Symbol("kReason"),sa=Symbol("kTarget"),aa=Symbol("kType"),ua=Symbol("kWasClean");class ca{constructor(e){this[sa]=null,this[aa]=e}get target(){return this[sa]}get type(){return this[aa]}}Object.defineProperty(ca.prototype,"target",{enumerable:!0}),Object.defineProperty(ca.prototype,"type",{enumerable:!0});class la extends ca{constructor(e,t={}){super(e),this[ta]=void 0===t.code?0:t.code,this[ia]=void 0===t.reason?"":t.reason,this[ua]=void 0!==t.wasClean&&t.wasClean}get code(){return this[ta]}get reason(){return this[ia]}get wasClean(){return this[ua]}}Object.defineProperty(la.prototype,"code",{enumerable:!0}),Object.defineProperty(la.prototype,"reason",{enumerable:!0}),Object.defineProperty(la.prototype,"wasClean",{enumerable:!0});class da extends ca{constructor(e,t={}){super(e),this[ra]=void 0===t.error?null:t.error,this[oa]=void 0===t.message?"":t.message}get error(){return this[ra]}get message(){return this[oa]}}Object.defineProperty(da.prototype,"error",{enumerable:!0}),Object.defineProperty(da.prototype,"message",{enumerable:!0});class pa extends ca{constructor(e,t={}){super(e),this[na]=void 0===t.data?null:t.data}get data(){return this[na]}}Object.defineProperty(pa.prototype,"data",{enumerable:!0});const ha={addEventListener(e,t,n={}){for(const r of this.listeners(e))if(!n[Qs]&&r[ea]===t&&!r[Qs])return;let r;if("message"===e)r=function(e,n){const r=new pa("message",{data:n?e:e.toString()});r[sa]=this,va(t,this,r)};else if("close"===e)r=function(e,n){const r=new la("close",{code:e,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[sa]=this,va(t,this,r)};else if("error"===e)r=function(e){const n=new da("error",{error:e,message:e.message});n[sa]=this,va(t,this,n)};else{if("open"!==e)return;r=function(){const e=new ca("open");e[sa]=this,va(t,this,e)}}r[Qs]=!!n[Qs],r[ea]=t,n.once?this.once(e,r):this.on(e,r)},removeEventListener(e,t){for(const n of this.listeners(e))if(n[ea]===t&&!n[Qs]){this.removeListener(e,n);break}}};var fa={CloseEvent:la,ErrorEvent:da,Event:ca,EventTarget:ha,MessageEvent:pa};function va(e,t,n){"object"==typeof e&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}const{tokenChars:ma}=ks;function ba(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}var ya={format:function(e){return Object.keys(e).map((t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map((e=>[t].concat(Object.keys(e).map((t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map((e=>!0===e?t:`${t}=${e}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")},parse:function(e){const t=Object.create(null);let n,r,o=Object.create(null),i=!1,s=!1,a=!1,u=-1,c=-1,l=-1,d=0;for(;d<e.length;d++)if(c=e.charCodeAt(d),void 0===n)if(-1===l&&1===ma[c])-1===u&&(u=d);else if(0===d||32!==c&&9!==c){if(59!==c&&44!==c)throw new SyntaxError(`Unexpected character at index ${d}`);{if(-1===u)throw new SyntaxError(`Unexpected character at index ${d}`);-1===l&&(l=d);const r=e.slice(u,l);44===c?(ba(t,r,o),o=Object.create(null)):n=r,u=l=-1}}else-1===l&&-1!==u&&(l=d);else if(void 0===r)if(-1===l&&1===ma[c])-1===u&&(u=d);else if(32===c||9===c)-1===l&&-1!==u&&(l=d);else if(59===c||44===c){if(-1===u)throw new SyntaxError(`Unexpected character at index ${d}`);-1===l&&(l=d),ba(o,e.slice(u,l),!0),44===c&&(ba(t,n,o),o=Object.create(null),n=void 0),u=l=-1}else{if(61!==c||-1===u||-1!==l)throw new SyntaxError(`Unexpected character at index ${d}`);r=e.slice(u,d),u=l=-1}else if(s){if(1!==ma[c])throw new SyntaxError(`Unexpected character at index ${d}`);-1===u?u=d:i||(i=!0),s=!1}else if(a)if(1===ma[c])-1===u&&(u=d);else if(34===c&&-1!==u)a=!1,l=d;else{if(92!==c)throw new SyntaxError(`Unexpected character at index ${d}`);s=!0}else if(34===c&&61===e.charCodeAt(d-1))a=!0;else if(-1===l&&1===ma[c])-1===u&&(u=d);else if(-1===u||32!==c&&9!==c){if(59!==c&&44!==c)throw new SyntaxError(`Unexpected character at index ${d}`);{if(-1===u)throw new SyntaxError(`Unexpected character at index ${d}`);-1===l&&(l=d);let s=e.slice(u,l);i&&(s=s.replace(/\\/g,""),i=!1),ba(o,r,s),44===c&&(ba(t,n,o),o=Object.create(null),n=void 0),r=void 0,u=l=-1}}else-1===l&&(l=d);if(-1===u||a||32===c||9===c)throw new SyntaxError("Unexpected end of input");-1===l&&(l=d);const p=e.slice(u,l);return void 0===n?ba(t,p,o):(void 0===r?ba(o,p,!0):ba(o,r,i?p.replace(/\\/g,""):p),ba(t,n,o)),t}};const{randomBytes:ga,createHash:wa}=D.default,{URL:ja}=_.default,{BINARY_TYPES:_a,EMPTY_BUFFER:Sa,GUID:Ea,kForOnEventAttribute:Pa,kListener:Aa,kStatusCode:xa,kWebSocket:Ia,NOOP:Ca}=Gi,{EventTarget:{addEventListener:ka,removeEventListener:Ua}}=fa,{format:Oa,parse:Da}=ya,{toBuffer:Ra}=ds,Ba=Symbol("kAborted"),Ta=[8,13],Na=["CONNECTING","OPEN","CLOSING","CLOSED"],La=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class qa extends y.default{constructor(e,t,n){super(),this._binaryType=_a[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Sa,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=qa.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==e?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,void 0===t?t=[]:Array.isArray(t)||("object"==typeof t&&null!==t?(n=t,t=[]):t=[t]),Fa(this,e,t,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(e){_a.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){const r=new Js({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation});this._sender=new Xs(e,this._extensions,n.generateMask),this._receiver=r,this._socket=e,r[Ia]=this,e[Ia]=this,r.on("conclude",$a),r.on("drain",Ha),r.on("error",Ya),r.on("message",Ka),r.on("ping",Xa),r.on("pong",Qa),e.setTimeout(0),e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",tu),e.on("data",nu),e.on("end",ru),e.on("error",ou),this._readyState=qa.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this._readyState=qa.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[Es.extensionName]&&this._extensions[Es.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=qa.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==qa.CLOSED)if(this.readyState!==qa.CONNECTING)this.readyState!==qa.CLOSING?(this._readyState=qa.CLOSING,this._sender.close(e,t,!this._isServer,(e=>{e||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())})),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();else{const e="WebSocket was closed before the connection was established";Wa(this,this._req,e)}}pause(){this.readyState!==qa.CONNECTING&&this.readyState!==qa.CLOSED&&(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===qa.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===qa.OPEN?(void 0===t&&(t=!this._isServer),this._sender.ping(e||Sa,t,n)):Va(this,e,n)}pong(e,t,n){if(this.readyState===qa.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===qa.OPEN?(void 0===t&&(t=!this._isServer),this._sender.pong(e||Sa,t,n)):Va(this,e,n)}resume(){this.readyState!==qa.CONNECTING&&this.readyState!==qa.CLOSED&&(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===qa.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof t&&(n=t,t={}),"number"==typeof e&&(e=e.toString()),this.readyState!==qa.OPEN)return void Va(this,e,n);const r={binary:"string"!=typeof e,mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Es.extensionName]||(r.compress=!1),this._sender.send(e||Sa,r,n)}terminate(){if(this.readyState!==qa.CLOSED)if(this.readyState!==qa.CONNECTING)this._socket&&(this._readyState=qa.CLOSING,this._socket.destroy());else{const e="WebSocket was closed before the connection was established";Wa(this,this._req,e)}}}Object.defineProperty(qa,"CONNECTING",{enumerable:!0,value:Na.indexOf("CONNECTING")}),Object.defineProperty(qa.prototype,"CONNECTING",{enumerable:!0,value:Na.indexOf("CONNECTING")}),Object.defineProperty(qa,"OPEN",{enumerable:!0,value:Na.indexOf("OPEN")}),Object.defineProperty(qa.prototype,"OPEN",{enumerable:!0,value:Na.indexOf("OPEN")}),Object.defineProperty(qa,"CLOSING",{enumerable:!0,value:Na.indexOf("CLOSING")}),Object.defineProperty(qa.prototype,"CLOSING",{enumerable:!0,value:Na.indexOf("CLOSING")}),Object.defineProperty(qa,"CLOSED",{enumerable:!0,value:Na.indexOf("CLOSED")}),Object.defineProperty(qa.prototype,"CLOSED",{enumerable:!0,value:Na.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((e=>{Object.defineProperty(qa.prototype,e,{enumerable:!0})})),["open","error","close","message"].forEach((e=>{Object.defineProperty(qa.prototype,`on${e}`,{enumerable:!0,get(){for(const t of this.listeners(e))if(t[Pa])return t[Aa];return null},set(t){for(const t of this.listeners(e))if(t[Pa]){this.removeListener(e,t);break}"function"==typeof t&&this.addEventListener(e,t,{[Pa]:!0})}})})),qa.prototype.addEventListener=ka,qa.prototype.removeEventListener=Ua;var Ga=qa;function Fa(e,t,n,r){const o={protocolVersion:Ta[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(!Ta.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${Ta.join(", ")})`);let i;if(t instanceof ja)i=t,e._url=t.href;else{try{i=new ja(t)}catch(e){throw new SyntaxError(`Invalid URL: ${t}`)}e._url=t}const s="wss:"===i.protocol,a="ws+unix:"===i.protocol;let u;if("ws:"===i.protocol||s||a?a&&!i.pathname?u="The URL's pathname is empty":i.hash&&(u="The URL contains a fragment identifier"):u='The URL\'s protocol must be one of "ws:", "wss:", or "ws+unix:"',u){const t=new SyntaxError(u);if(0===e._redirects)throw t;return void Ja(e,t)}const c=s?443:80,l=ga(16).toString("base64"),d=s?E.default.request:j.default.request,p=new Set;let h,f;if(o.createConnection=s?za:Ma,o.defaultPort=o.defaultPort||c,o.port=i.port||c,o.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},o.path=i.pathname+i.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(h=new Es(!0!==o.perMessageDeflate?o.perMessageDeflate:{},!1,o.maxPayload),o.headers["Sec-WebSocket-Extensions"]=Oa({[Es.extensionName]:h.offer()})),n.length){for(const e of n){if("string"!=typeof e||!La.test(e)||p.has(e))throw new SyntaxError("An invalid or duplicated subprotocol was specified");p.add(e)}o.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(i.username||i.password)&&(o.auth=`${i.username}:${i.password}`),a){const e=o.path.split(":");o.socketPath=e[0],o.path=e[1]}if(o.followRedirects){if(0===e._redirects){e._originalIpc=a,e._originalSecure=s,e._originalHostOrSocketPath=a?o.socketPath:i.host;const t=r&&r.headers;if(r={...r,headers:{}},t)for(const[e,n]of Object.entries(t))r.headers[e.toLowerCase()]=n}else if(0===e.listenerCount("redirect")){const t=a?!!e._originalIpc&&o.socketPath===e._originalHostOrSocketPath:!e._originalIpc&&i.host===e._originalHostOrSocketPath;(!t||e._originalSecure&&!s)&&(delete o.headers.authorization,delete o.headers.cookie,t||delete o.headers.host,o.auth=void 0)}o.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),f=e._req=d(o),e._redirects&&e.emit("redirect",e.url,f)}else f=e._req=d(o);o.timeout&&f.on("timeout",(()=>{Wa(e,f,"Opening handshake has timed out")})),f.on("error",(t=>{null===f||f[Ba]||(f=e._req=null,Ja(e,t))})),f.on("response",(i=>{const s=i.headers.location,a=i.statusCode;if(s&&o.followRedirects&&a>=300&&a<400){if(++e._redirects>o.maxRedirects)return void Wa(e,f,"Maximum redirects exceeded");let i;f.abort();try{i=new ja(s,t)}catch(t){const n=new SyntaxError(`Invalid URL: ${s}`);return void Ja(e,n)}Fa(e,i,n,r)}else e.emit("unexpected-response",f,i)||Wa(e,f,`Unexpected server response: ${i.statusCode}`)})),f.on("upgrade",((t,n,r)=>{if(e.emit("upgrade",t),e.readyState!==qa.CONNECTING)return;if(f=e._req=null,"websocket"!==t.headers.upgrade.toLowerCase())return void Wa(e,n,"Invalid Upgrade header");const i=wa("sha1").update(l+Ea).digest("base64");if(t.headers["sec-websocket-accept"]!==i)return void Wa(e,n,"Invalid Sec-WebSocket-Accept header");const s=t.headers["sec-websocket-protocol"];let a;if(void 0!==s?p.size?p.has(s)||(a="Server sent an invalid subprotocol"):a="Server sent a subprotocol but none was requested":p.size&&(a="Server sent no subprotocol"),a)return void Wa(e,n,a);s&&(e._protocol=s);const u=t.headers["sec-websocket-extensions"];if(void 0!==u){if(!h){return void Wa(e,n,"Server sent a Sec-WebSocket-Extensions header but no extension was requested")}let t;try{t=Da(u)}catch(t){return void Wa(e,n,"Invalid Sec-WebSocket-Extensions header")}const r=Object.keys(t);if(1!==r.length||r[0]!==Es.extensionName){return void Wa(e,n,"Server indicated an extension that was not requested")}try{h.accept(t[Es.extensionName])}catch(t){return void Wa(e,n,"Invalid Sec-WebSocket-Extensions header")}e._extensions[Es.extensionName]=h}e.setSocket(n,r,{generateMask:o.generateMask,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})})),o.finishRequest?o.finishRequest(f,e):f.end()}function Ja(e,t){e._readyState=qa.CLOSING,e.emit("error",t),e.emitClose()}function Ma(e){return e.path=e.socketPath,x.default.connect(e)}function za(e){return e.path=void 0,e.servername||""===e.servername||(e.servername=x.default.isIP(e.host)?"":e.host),O.default.connect(e)}function Wa(e,t,n){e._readyState=qa.CLOSING;const r=new Error(n);Error.captureStackTrace(r,Wa),t.setHeader?(t[Ba]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Ja,e,r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function Va(e,t,n){if(t){const n=Ra(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(n){const t=new Error(`WebSocket is not open: readyState ${e.readyState} (${Na[e.readyState]})`);process.nextTick(n,t)}}function $a(e,t){const n=this[Ia];n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,void 0!==n._socket[Ia]&&(n._socket.removeListener("data",nu),process.nextTick(eu,n._socket),1005===e?n.close():n.close(e,t))}function Ha(){const e=this[Ia];e.isPaused||e._socket.resume()}function Ya(e){const t=this[Ia];void 0!==t._socket[Ia]&&(t._socket.removeListener("data",nu),process.nextTick(eu,t._socket),t.close(e[xa])),t.emit("error",e)}function Za(){this[Ia].emitClose()}function Ka(e,t){this[Ia].emit("message",e,t)}function Xa(e){const t=this[Ia];t.pong(e,!t._isServer,Ca),t.emit("ping",e)}function Qa(e){this[Ia].emit("pong",e)}function eu(e){e.resume()}function tu(){const e=this[Ia];let t;this.removeListener("close",tu),this.removeListener("data",nu),this.removeListener("end",ru),e._readyState=qa.CLOSING,this._readableState.endEmitted||e._closeFrameReceived||e._receiver._writableState.errorEmitted||null===(t=e._socket.read())||e._receiver.write(t),e._receiver.end(),this[Ia]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",Za),e._receiver.on("finish",Za))}function nu(e){this[Ia]._receiver.write(e)||this.pause()}function ru(){const e=this[Ia];e._readyState=qa.CLOSING,e._receiver.end(),this.end()}function ou(){const e=this[Ia];this.removeListener("error",ou),this.on("error",Ca),e&&(e._readyState=qa.CLOSING,this.destroy())}var iu=function(e){function n(t,n,r,o,i){void 0===i&&(i=5e3);var s=e.call(this)||this;s.endpoint=t,s.headers=n,s.rewriteHostHeader=r,s.bindToAssign=o,s.closeTimeout=i,s.protocol="TCP",s.openConnections=new Set,s.tcpServer=I.createServer(s.handleConnection.bind(s));var a=null==r?void 0:r.altHostnames.map((function(e){return(t=Wt(t=e))&&Dr.test(t)?t.replace(Or,"\\$&"):t;var t})).join("|");return s.hostRegex=new RegExp("Host: (?:".concat(a,")(:.*$|$)"),"im"),s}return T(n,e),Object.defineProperty(n.prototype,"bindTo",{get:function(){var e;return null!==(e=this.boundTo)&&void 0!==e?e:this.bindToAssign},enumerable:!1,configurable:!0}),n.prototype.open=function(){return L(this,void 0,void 0,(function(){var e=this;return q(this,(function(t){return[2,new Promise((function(t){if(e.bindToAssign){var n=e.bindToAssign,r=n.port,o=n.address;e.tcpServer.listen(r,o,(function(){e.emit("tunnel-open",{address:o,port:r}),t({address:o,port:r})}))}else e.tcpServer.listen(0,(function(){var n=e.tcpServer.address(),r=n.address,o=n.port,i="0.0.0.0"===r||"::"===r?"127.0.0.1":r;e.boundTo={address:i,port:o},e.emit("tunnel-open",e.boundTo),t(e.boundTo)}))}))]}))}))},n.prototype.close=function(){return L(this,void 0,void 0,(function(){var e,t=this;return q(this,(function(n){switch(n.label){case 0:return e=!1,[4,Promise.race([new Promise((function(n){t.tcpServer.close((function(){e=!0,t.emit("tunnel-close"),n()}))})),new Promise((function(n){new Promise((function(e){return setTimeout(e,t.closeTimeout)})).then((function(){e||(t.openConnections.forEach((function(e){e.destroy(),t.openConnections.delete(e)})),n())}))}))])];case 1:return n.sent(),[2]}}))}))},n.prototype.handleConnection=function(e){var t=this;this.openConnections.add(e);var n=new Ga(this.endpoint.replace("https:","wss:"),{headers:this.headers}),r=qi(n),o=this.getHeaderTransform();this.rewriteHostHeader&&o?Ri(e,o,r):Ri(e,r),Ri(r,e),n.on("close",(function(e,n,r){t.emit("connection-close",e,n,r)})),r.on("error",(function(e){t.emit("connection-error",e)})),e.on("error",(function(e){t.emit("connection-error",e)})),this.emit("connection-accept")},n.prototype.getHeaderTransform=function(){if(this.rewriteHostHeader){var e=this.rewriteHostHeader.targetHostname,n=this.hostRegex;return new t.Transform({transform:function(t,r,o){var i=t.toString();if(i.split("\n",1)[0].includes("HTTP")){var s=i.replace(n,"Host: ".concat(e));o(null,Buffer.from(s))}else o(null,t)}})}},n}(e.EventEmitter),su=function(e){function t(t,n,r){var o=e.call(this)||this;return o.endpoint=t,o.headers=n,o.bindToAssign=r,o.protocol="UDP",o.udpSocket=R.default.createSocket("udp4"),o.handleConnection(),o}return T(t,e),Object.defineProperty(t.prototype,"bindTo",{get:function(){var e;return null!==(e=this.boundTo)&&void 0!==e?e:this.bindToAssign},enumerable:!1,configurable:!0}),t.prototype.open=function(){return L(this,void 0,void 0,(function(){var e=this;return q(this,(function(t){return[2,new Promise((function(t){if(e.bindToAssign){var n=e.bindToAssign,r=n.port,o=n.address;e.udpSocket.bind(r,o,(function(){e.emit("tunnel-open",{address:o,port:r}),t({address:o,port:r})}))}else e.udpSocket.bind(0,(function(){var n=e.udpSocket.address(),r=n.address,o=n.port,i="0.0.0.0"===r||"::"===r?"127.0.0.1":r;e.boundTo={address:i,port:o},e.emit("tunnel-open",e.boundTo),t(e.boundTo)}))}))]}))}))},t.prototype.close=function(){return L(this,void 0,void 0,(function(){var e=this;return q(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(t){e.udpSocket.close((function(){e.emit("tunnel-close"),t()}))}))];case 1:return t.sent(),[2]}}))}))},t.prototype.handleConnection=function(){var e,t=this,n=new Ga(this.endpoint.replace("https:","wss:"),{headers:this.headers}),r=qi(n);this.udpSocket.on("message",(function(t,n){e=n,r.write(t)})),r.on("data",(function(n){e&&t.udpSocket.send(n,e.port,e.address,(function(e){e&&t.emit("connection-error",e)}))})),this.udpSocket.on("error",(function(e){t.emit("connection-error",e)})),r.on("error",(function(e){t.emit("connection-error",e)})),n.on("connection-close",(function(e,n,r){t.emit("connection-close",e,n,r)})),n.on("connection-error",(function(e){t.emit("connection-error",e)})),this.emit("connection-accept")},t}(e.EventEmitter);var au,uu="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,cu=function(e,t){return L(void 0,void 0,void 0,(function(){var n;return q(this,(function(r){return n=Promise.resolve([]),[2,e.reduce((function(e,n){return e.then((function(e){return t(n).then((function(t){return e.push(t),e}))}))}),n)]}))}))},lu=function(e){function t(t){void 0===t&&(t=8192);var n=e.call(this)||this;return n.bufferDefaultSize=t,n._size=0,n.buffer=Buffer.alloc(n.bufferDefaultSize),n}return T(t,e),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),t.prototype.getContentsAsString=function(e,t){void 0===e&&(e="utf8");var n=this.buffer.toString(e,0,Math.min(t||this.size,this.size)),r=Buffer.byteLength(n);return r<this.size&&this.buffer.copy(this.buffer,0,r),this._size-=r,n},t.prototype.adaptBuffer=function(e){if(this.buffer.length-this.size<e){var t=Math.ceil((e-(this.buffer.length-this.size))/this.bufferDefaultSize),n=Buffer.alloc(this.buffer.length+this.bufferDefaultSize*t);this.buffer.copy(n,0,0,this.size),this.buffer=n}},t.prototype._write=function(e,t,n){this.adaptBuffer(e.length),e.copy(this.buffer,this.size,0),this._size+=e.length,n()},t}(g.default.Writable),du=function(e){function t(t,n,r){var o=e.call(this)||this;return o.contextProvider=t,o.listServices=n,o.listAddons=r,o.connections=[],o.hostsFileMutex=new gi,o.ipAllocationMutex=new gi,o.stopForwarding=function(e){return L(o,void 0,void 0,(function(){var t,n,r,o,i,s,a;return q(this,(function(u){switch(u.label){case 0:return[4,e.tunnel.close()];case 1:return u.sent(),t=e.forwardingContext,n=t.projectId,r=t.type,o=t.id,i=t.hostnames,s=t.ipOnly,i.length>0&&!s?[4,this.unregisterHostnames(null===(a=e.tunnel.bindTo)||void 0===a?void 0:a.address,i)]:[3,3];case 2:u.sent(),u.label=3;case 3:return this.connections.splice(this.connections.findIndex((function(e){var t=e.forwardingContext,i=t.type,s=t.id,a=t.projectId;return s===o&&a===n&&i===r})),1),[2]}}))}))},o.canExecuteWithHostnames=function(){return"win32"!==process.platform?process.getuid&&0!==process.getuid()?{error:!0,message:"You are not running this command with sufficient privileges (uid=".concat(null===(e=null===process||void 0===process?void 0:process.getuid)||void 0===e?void 0:e.call(process),"). Try running with 'sudo -E'.")}:{error:!1,type:"unix-admin"}:function(){try{return c.execSync("fsutil dirty query %systemdrive%"),!0}catch(e){if("ENOENT"===e.code)try{return c.execSync("fltmc"),!0}catch(e){return!1}return!1}}()?{error:!1,type:"windows-admin"}:{error:!0,message:"You are not running this command as administrator. Please start command line with admin rights."};var e},o.assertStartedWithNodejs=function(){if(!uu)throw new Error("Port forwarding only possible when started with nodejs")},o.proxyApiClient=new Xo(t),o}return T(t,e),t.prototype.withProjectForwarding=function(e,t,n){return void 0===n&&(n=!0),L(this,void 0,void 0,(function(){var r;return q(this,(function(o){switch(o.label){case 0:return[4,this.forwardProject(e,n)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,6]),[4,t(r)];case 3:return[2,o.sent()];case 4:return[4,this.stopProjectForwarding(e)];case 5:return o.sent(),[7];case 6:return[2]}}))}))},t.prototype.forwardProject=function(e,t){return void 0===t&&(t=!0),L(this,void 0,void 0,(function(){var n,r,o,i,s,a=this;return q(this,(function(u){switch(u.label){case 0:return this.assertStartedWithNodejs(),n=e.projectId,[4,this.listServices({parameters:{projectId:n}})];case 1:return r=u.sent(),[4,this.listAddons({parameters:{projectId:n}})];case 2:return o=u.sent(),[4,Promise.all(r.data.services.map((function(e){return L(a,void 0,void 0,(function(){return q(this,(function(r){return[2,this.forwardService({projectId:n,serviceId:e.id},t)]}))}))})))];case 3:return i=u.sent(),[4,Promise.all(o.data.addons.map((function(e){return L(a,void 0,void 0,(function(){return q(this,(function(r){switch(r.label){case 0:return[4,this.forwardAddon({projectId:n,addonId:e.id},t)];case 1:return[2,r.sent()]}}))}))})))];case 4:return s=u.sent(),[2,{services:i,addons:s}]}}))}))},t.prototype.withServiceForwarding=function(e,t,n){return void 0===n&&(n=!0),L(this,void 0,void 0,(function(){var r;return q(this,(function(o){switch(o.label){case 0:return[4,this.forwardService(e,n)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,6]),[4,t(r)];case 3:return[2,o.sent()];case 4:return[4,this.stopServiceForwarding(e)];case 5:return o.sent(),[7];case 6:return[2]}}))}))},t.prototype.forwardService=function(e,t){return void 0===t&&(t=!0),L(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c=this;return q(this,(function(l){switch(l.label){case 0:return this.assertStartedWithNodejs(),n=e.projectId,r=e.serviceId,[4,this.proxyApiClient.getServiceDetails(n,r)];case 1:return o=l.sent(),i=o.namespace,s=o.targetDomain,a=o.instances,u=o.ports,0===a.length?[2,[]]:[4,cu(u,(function(e){var o,u="https://".concat(s,"/tunnel/projects/").concat(n,"/services/").concat(r,"/instance/").concat(a[0].podName,"/port/").concat(e.internalPort),l="".concat(r,".").concat(i,".svc.cluster.local"),d=["".concat(r)];e.name&&d.push("".concat(e.name,".").concat(r)),"HTTP"===e.protocol&&(o={altHostnames:d,targetHostname:l});var p=G([l],d,!0);return c.forwardPort(u,e,p,"service",r,n,t,o)}))];case 2:return[2,l.sent()]}}))}))},t.prototype.withAddonForwarding=function(e,t,n){return void 0===n&&(n=!0),L(this,void 0,void 0,(function(){var r;return q(this,(function(o){switch(o.label){case 0:return[4,this.forwardAddon(e,n)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,6]),[4,t(r)];case 3:return[2,o.sent()];case 4:return[4,this.stopAddonForwarding(e)];case 5:return o.sent(),[7];case 6:return[2]}}))}))},t.prototype.forwardAddon=function(e,t){return void 0===t&&(t=!0),L(this,void 0,void 0,(function(){var n,r,o,i,s=this;return q(this,(function(a){switch(a.label){case 0:return this.assertStartedWithNodejs(),n=e.addonId,r=e.projectId,[4,this.proxyApiClient.getAddonDetails(r,n)];case 1:return o=a.sent(),i=o.instances.map((function(e){var t=e.podName,n=e.internalHostname;return e.ports.map((function(e){return{podName:t,internalHostname:n,port:e}}))})),[4,cu((u=i,null!=u&&u.length?Qt(u,1/0):[]),(function(e){var i=e.podName,a=e.internalHostname,u=e.port;return L(s,void 0,void 0,(function(){var e;return q(this,(function(s){return e="https://".concat(o.targetDomain,"/tunnel/projects/").concat(r,"/addons/").concat(n,"/instance/").concat(i,"/port/").concat(u.internalPort),[2,this.forwardPort(e,u,[a],"addon",n,r,t)]}))}))}))];case 2:return[2,a.sent()]}var u}))}))},t.prototype.allocateIpAddress=function(e){return L(this,void 0,void 0,(function(){var t=this;return q(this,(function(n){return[2,this.ipAllocationMutex.enter((function(){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){switch(s.label){case 0:return t="127.24.1.1",n="127.24.255.255",r=null!==(i=this.nextIpAddress)&&void 0!==i?i:t,[4,Qo(e,r,n)];case 1:return o=s.sent(),this.nextIpAddress=ri(ni(o)+1),ni(this.nextIpAddress)>ni(n)&&(this.nextIpAddress=t),[2,o]}}))}))}))]}))}))},t.prototype.forwardPort=function(e,t,n,r,o,i,s,a){var u;return void 0===s&&(s=!0),L(this,void 0,void 0,(function(){var c,l,d,p,h,f,v=this;return q(this,(function(m){switch(m.label){case 0:if(c={Authorization:"Bearer ".concat(this.contextProvider.getCurrentToken())},!s&&(l=this.canExecuteWithHostnames()).error)throw new Error("".concat(l.message," Alternatively, you can use the ipOnly mode when port-forwarding (apiClient.forwarding.forwardAddon({ projectId, addonId }, true))"));return[4,this.determineSocketAddress(i,o,r,t,s)];case 1:return d=m.sent(),p="UDP"===t.protocol?new su(e,c,d):new iu(e,c,a,d),s?[3,3]:[4,this.registerHostnames(null===(u=p.bindTo)||void 0===u?void 0:u.address,n)];case 2:m.sent(),m.label=3;case 3:return p.on("connection-accept",(function(){return v.emit("connection-accept",p)})),p.on("connection-close",(function(){return L(v,void 0,void 0,(function(){return q(this,(function(e){return[2,this.emit("connection-close",p)]}))}))})),[4,p.open()];case 4:return h=m.sent(),f={projectId:i,id:o,type:r,hostnames:n,ipOnly:s,port:h.port,address:h.address,protocol:t.protocol,portName:t.name},this.emit("tunnel-open",p,f),p.on("connection-error",(function(e){return v.emit("connection-error",p,f,e)})),p.on("tunnel-close",(function(){return v.emit("tunnel-close",p,f)})),this.connections.push({tunnel:p,forwardingContext:f}),[2,{data:f}]}}))}))},t.prototype.determineSocketAddress=function(e,t,n,r,o){var i;return L(this,void 0,void 0,(function(){var s,a,u;return q(this,(function(c){switch(c.label){case 0:return o&&"darwin"===A.default.platform()?[2,void 0]:(s=this.connections.find((function(r){return r.forwardingContext.projectId===e&&r.forwardingContext.id===t&&r.forwardingContext.type===n})),a=(null===(i=null==s?void 0:s.forwardingContext)||void 0===i?void 0:i.port)!==r.internalPort,s&&a?[2,{address:s.forwardingContext.address,port:r.internalPort}]:(u={},[4,this.allocateIpAddress(r.internalPort)]));case 1:return[2,(u.address=c.sent(),u.port=r.internalPort,u)]}}))}))},t.prototype.registerHostnames=function(e,t){return L(this,void 0,void 0,(function(){return q(this,(function(n){switch(n.label){case 0:return[4,this.modifyHostsFile((function(n){n.removeHosts.apply(n,t),n.add.apply(n,G([e],t,!1))}))];case 1:return n.sent(),[2]}}))}))},t.prototype.unregisterHostnames=function(e,t){return L(this,void 0,void 0,(function(){return q(this,(function(n){switch(n.label){case 0:return[4,this.modifyHostsFile((function(n){n.remove.apply(n,G([e],t,!1))}))];case 1:return n.sent(),[2]}}))}))},t.prototype.modifyHostsFile=function(e){return L(this,void 0,void 0,(function(){var t=this;return q(this,(function(n){switch(n.label){case 0:return[4,this.hostsFileMutex.enter((function(){return L(t,void 0,void 0,(function(){var t,n=this;return q(this,(function(r){switch(r.label){case 0:return[4,yi.load({header:"Northflank Proxy"})];case 1:return t=r.sent(),e(t),[4,t.backup({suffix:".backup-pre-northflank"})];case 2:r.sent(),r.label=3;case 3:return r.trys.push([3,5,,7]),[4,pu(5)((function(){return L(n,void 0,void 0,(function(){return q(this,(function(e){switch(e.label){case 0:return[4,t.write({writeMode:"atomic"})];case 1:return e.sent(),[2]}}))}))}))];case 4:return r.sent(),[3,7];case 5:return r.sent(),[4,pu(5)((function(){return L(n,void 0,void 0,(function(){return q(this,(function(e){switch(e.label){case 0:return[4,t.write({writeMode:"standard"})];case 1:return e.sent(),[2]}}))}))}))];case 6:return r.sent(),[3,7];case 7:return[2]}}))}))}))];case 1:return n.sent(),[2]}}))}))},t.prototype.stopProjectForwarding=function(e){return L(this,void 0,void 0,(function(){var t=this;return q(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.connections.filter((function(t){return t.forwardingContext.projectId===e.projectId})).map((function(e){return t.stopForwarding(e)})))];case 1:return n.sent(),[2]}}))}))},t.prototype.stopServiceForwarding=function(e){return L(this,void 0,void 0,(function(){var t=this;return q(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.connections.filter((function(t){return"service"===t.forwardingContext.type&&t.forwardingContext.projectId===e.projectId&&t.forwardingContext.id===e.serviceId})).map((function(e){return t.stopForwarding(e)})))];case 1:return n.sent(),[2]}}))}))},t.prototype.stopAddonForwarding=function(e){return L(this,void 0,void 0,(function(){var t=this;return q(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.connections.filter((function(t){return"addon"===t.forwardingContext.type&&t.forwardingContext.projectId===e.projectId&&t.forwardingContext.id===e.addonId})).map((function(e){return t.stopForwarding(e)})))];case 1:return n.sent(),[2]}}))}))},t.prototype.stop=function(){return L(this,void 0,void 0,(function(){var e=this;return q(this,(function(t){switch(t.label){case 0:return[4,Promise.all(this.connections.map((function(t){return L(e,void 0,void 0,(function(){return q(this,(function(e){return[2,this.stopForwarding(t)]}))}))})))];case 1:return t.sent(),[2]}}))}))},t}(e.EventEmitter),pu=function(e,t){return void 0===t&&(t=50),function(n){var r=e,o=function(){return L(void 0,void 0,void 0,(function(){var e;return q(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,4]),[4,n()];case 1:return[2,i.sent()];case 2:if(e=i.sent(),r<=0)throw e;return r-=1,[4,new Promise((function(e){return setTimeout((function(){return e()}),t)}))];case 3:return i.sent(),[2,o()];case 4:return[2]}}))}))};return o()}},hu=function(e){function t(t,n,r,o,i,s){void 0===o&&(o=new w.PassThrough),void 0===i&&(i=new w.PassThrough),void 0===s&&(s=new w.PassThrough);var a=e.call(this)||this;return a.baseUrl=t,a.execConfig=n,a.token=r,a.stdOut=o,a.stdErr=i,a.stdIn=s,a.waitForCommandResult=function(){return L(a,void 0,void 0,(function(){return q(this,(function(e){switch(e.label){case 0:if(void 0===this.currentCommand)throw new Error("No command is running");return[4,this.currentCommand];case 1:return[2,e.sent()]}}))}))},a.sendInputToCurrentCommand=function(e){return L(a,void 0,void 0,(function(){var t;return q(this,(function(n){if(void 0===this.currentCommand||void 0===this.duplex)throw new Error("No command is running");return null===(t=this.duplex)||void 0===t||t.write(this.constructPayloadPacket(e)),[2]}))}))},a.resizeTerminal=function(e){return L(a,void 0,void 0,(function(){var t;return q(this,(function(n){if(void 0===this.currentCommand||void 0===this.duplex)throw new Error("No command is running, can't resize terminal");return null===(t=this.duplex)||void 0===t||t.write(JSON.stringify({type:"resize",data:{ttyRows:null==e?void 0:e.rows,ttyColumns:null==e?void 0:e.columns}})),[2]}))}))},a.constructPayloadPacket=function(e){return JSON.stringify({type:"payload",data:e.toString()})},a}return T(t,e),Object.defineProperty(t.prototype,"execEndpoint",{get:function(){var e=this.execConfig,t=e.entityId,n=e.entityType,r=e.projectId,o="".concat(this.baseUrl,"/v1/command-exec/projects/").concat(r,"/");return"".concat(o).concat(function(){switch(n){case"service":return"services/".concat(t);case"job":return"jobs/".concat(t);case"addon":return"addons/".concat(t);case"build":return"builds/".concat(t);default:throw new Error("Unexpected Northflank entity type received in command exec endpoint generation: ".concat(n))}}())},enumerable:!1,configurable:!0}),t.prototype.start=function(){return L(this,void 0,void 0,(function(){var e=this;return q(this,(function(t){if(void 0!==this.currentCommand)throw new Error("Command is already running");return this.currentCommand=new Promise((function(t,n){var r,o,i;void 0!==e.remote&&n(Error("Command is already running"));var s,a=e.execEndpoint.replace("https:","wss:").replace("http:","ws:");e.remote=new Ga(a);try{e.duplex=qi(e.remote)}catch(e){throw new Error("Failed to establish connection to command execution proxy: ".concat(e.message))}e.initialAuth(),e.stdIn.on("data",(function(t){var n,r;(null===(n=e.duplex)||void 0===n?void 0:n.writable)&&(null===(r=e.duplex)||void 0===r||r.write(e.constructPayloadPacket(t)))})),null===(r=e.duplex)||void 0===r||r.on("data",(function(t){var n,r,o,i=JSON.parse(t.toString());switch(null==i?void 0:i.type){case"init":var a=i.data;"successful"!==a.auth&&u("Command initialization failed: ".concat(null!==(n=null==a?void 0:a.message)&&void 0!==n?n:"Reason unknown"));break;case"completion":s=i.data,e.emit("command-result",s),null===(r=e.duplex)||void 0===r||r.end();break;case"stdOut":e.emit("std-out-data",i.data),e.stdOut.write(i.data);break;case"stdErr":e.emit("std-err-data",i.data),e.stdErr.write(i.data);break;case"error":u(null===(o=i.data)||void 0===o?void 0:o.message);break;default:var c="unable to parse message: ".concat(JSON.stringify(i));u(c)}})),null===(o=e.duplex)||void 0===o||o.on("end",(function(){e.emit("command-completed"),e.reset(),t(s)})),null===(i=e.duplex)||void 0===i||i.on("error",(function(n){e.emit("error",n),e.emit("command-completed"),e.reset(),t(s)}));var u=function(t){e.emit("error",t),e.reset(),n(new Error(t))};e.emit("command-started")})),[2,this.currentCommand]}))}))},t.prototype.initialAuth=function(){var e,t=this.execConfig,n=t.command,r=t.containerName,o=t.shell,i=t.user,s=t.group,a=t.ttyColumns,u=t.ttyRows,c={type:"init",data:{auth:{type:"apiToken",apiToken:this.token},context:{containerId:r,command:n,shell:o,user:i,group:s,ttyColumns:a,ttyRows:u}}};null===(e=this.duplex)||void 0===e||e.write(JSON.stringify(c))},t.prototype.reset=function(){var e;this.remote=void 0,this.currentCommand=void 0,null===(e=this.duplex)||void 0===e||e.destroy(),this.duplex=void 0},t}(e.EventEmitter),fu=function(){function e(e){this.contextProvider=e,this.assertStartedWithNodejs=function(){if(!uu)throw new Error("Command exec only possible when started with nodejs")}}return e.prototype.execServiceCommand=function(e,t){return L(this,void 0,void 0,(function(){var n,r,o;return q(this,(function(i){return n=e.serviceId,r=e.projectId,"service",o=N({projectId:r,entityId:n,entityType:"service"},t),[2,this.execCommand(o)]}))}))},e.prototype.execServiceSession=function(e,t){return L(this,void 0,void 0,(function(){var n,r,o;return q(this,(function(i){return n=e.serviceId,r=e.projectId,"service",o=N({projectId:r,entityId:n,entityType:"service"},t),[2,this.shellSession(o)]}))}))},e.prototype.execJobCommand=function(e,t){return L(this,void 0,void 0,(function(){var n,r,o;return q(this,(function(i){return n=e.jobId,r=e.projectId,"job",o=N({projectId:r,entityId:n,entityType:"job"},t),[2,this.execCommand(o)]}))}))},e.prototype.execJobSession=function(e,t){return L(this,void 0,void 0,(function(){var n,r,o;return q(this,(function(i){return n=e.jobId,r=e.projectId,"job",o=N({projectId:r,entityId:n,entityType:"job"},t),[2,this.shellSession(o)]}))}))},e.prototype.execCommand=function(e){return L(this,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){switch(o.label){case 0:return this.assertStartedWithNodejs(),t=this.getCommandRunner(N({shell:"none"},e)),n=new lu,r=new lu,t.stdOut.pipe(n),t.stdErr.pipe(r),t.on("error",(function(e){throw new Error(e)})),[4,t.start()];case 1:return[2,{commandResult:o.sent(),stdOut:n.getContentsAsString(),stdErr:r.getContentsAsString()}]}}))}))},e.prototype.shellSession=function(e){this.assertStartedWithNodejs();var t=this.getCommandRunner(e);return t.start(),t},e.prototype.getCommandRunner=function(e){var t=this.contextProvider.getCurrentBaseUrl(!0),n=this.contextProvider.getCurrentToken();if(!n)throw Error("API token not found");return new hu(t,e,n)},e}(),vu=function(e){function t(t){var n=this.constructor,r=e.call(this,t.message)||this;r.name="NorthflankApiCallError",r.message=t.message,r.status=t.status,r.id=t.id,r.details=t.details;var o=n.prototype;return Object.setPrototypeOf?Object.setPrototypeOf(r,o):r.__proto__=o,r}return T(t,e),t}(Error),mu=function(e){function t(t,n,r){var o=e.call(this)||this;return o.baseUrl=t,o.logsConfig=n,o.token=r,o.stop=function(){return L(o,void 0,void 0,(function(){var e;return q(this,(function(t){if(void 0===this.logSession)throw new Error("No command is running");return null===(e=this.duplex)||void 0===e||e.end(),[2]}))}))},o}return T(t,e),t.getLogsEndpoint=function(e){var t=e.containerName,n=e.entityId,r=e.entityType,o=e.buildId,i=e.runId,s=e.isBuild,a=e.lineLimit,u=e.projectId,c=e.queryType,l=e.startTime,d=e.endTime,p=e.duration,h=e.direction,f=e.textIncludes,v=e.textNotIncludes,m=e.regexIncludes,b=e.regexNotIncludes,y="/v1/projects/".concat(u,"/"),g=new URLSearchParams;return g.append("queryType",c),l&&g.append("startTime",l.toISOString()),d&&g.append("endTime",d.toISOString()),a&&g.append("lineLimit",a.toString()),t&&g.append("containerName",t),i&&g.append("runId",i),o&&g.append("buildId",o),f&&g.append("textIncludes",f),v&&g.append("textNotIncludes",v),m&&g.append("regexIncludes",m),b&&g.append("regexNotIncludes",b),h&&g.append("direction",h),p&&g.append("duration",p.toString()),"".concat(y).concat(function(){var e=s?"/build-logs":"/logs";switch(r){case"service":return"services/".concat(n).concat(e);case"job":return"jobs/".concat(n).concat(e);case"addon":return"addons/".concat(n).concat(e);default:throw new Error("Unexpected Northflank entity type received in logs endpoint generation: ".concat(r))}}(),"?").concat(g.toString())},Object.defineProperty(t.prototype,"logsEndpoint",{get:function(){return"".concat(this.baseUrl).concat(t.getLogsEndpoint(this.logsConfig))},enumerable:!1,configurable:!0}),t.prototype.start=function(){return L(this,void 0,void 0,(function(){var e=this;return q(this,(function(t){if(void 0!==this.logSession)throw new Error("Command is already running");return this.logSession=new Promise((function(t,n){var r,o,i,s;void 0!==e.remote&&n(Error("Command is already running"));var a=e.logsEndpoint.replace("https:","wss:").replace("http:","ws:");e.remote=new Ga(a);try{e.duplex=qi(e.remote)}catch(e){throw new Error("Failed to establish connection to command execution proxy: ".concat(e.message))}e.initialAuth(),null===(r=e.duplex)||void 0===r||r.on("data",(function(t){var n,r,o=JSON.parse(t.toString());switch(null==o?void 0:o.type){case"init":var i=o.data;"successful"!==i.auth&&u("Log tail initialization failed: ".concat(null!==(n=null==i?void 0:i.message)&&void 0!==n?n:"Reason unknown"));break;case"log-lines":var s=o.data;e.emit("logs-received",s.map(xu));break;case"error":u(null===(r=o.data)||void 0===r?void 0:r.message);break;default:var a="unable to parse message: ".concat(JSON.stringify(o));u(a)}})),null===(o=e.duplex)||void 0===o||o.on("end",(function(){e.emit("close"),e.reset(),t()})),null===(i=e.duplex)||void 0===i||i.on("open",(function(){e.emit("open")})),null===(s=e.duplex)||void 0===s||s.on("error",(function(n){e.emit("error",n),e.reset(),t()}));var u=function(t){e.emit("error",{message:t}),e.reset(),n(new Error(t))}})),[2,this.logSession]}))}))},t.prototype.initialAuth=function(){var e,t={type:"init",data:{auth:{type:"apiToken",apiToken:this.token}}};null===(e=this.duplex)||void 0===e||e.write(JSON.stringify(t))},t.prototype.reset=function(){var e;this.remote=void 0,this.logSession=void 0,null===(e=this.duplex)||void 0===e||e.destroy(),this.duplex=void 0},t}(e.EventEmitter),bu=uu?Zo:window.fetch,yu=function(){if(uu)try{return JSON.parse(C.default.readFileSync(k.default.join(k.default.dirname(r.fileURLToPath("undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("api-client.js",document.baseURI).href)),"../../package.json")).toString())}catch(e){return console.log("Failed to check version of northflank CLI (".concat(e.message,")")),{}}return{}},gu=function(){function e(e,t){var n=this;this.opts=t,this.call=function(e){return L(n,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l,d,p,h=this;return q(this,(function(f){switch(f.label){case 0:if(t=this.method,n={method:t,headers:this.getDefaultHeaders()},!(r=null===(p=this.contextProvider)||void 0===p?void 0:p.getCurrentBaseUrl()))throw new Error("Api client context not correctly initialized, please provide a url to the context.");return o="".concat(r).concat(this.endpointUrl(e)),i=this.body(e),s=N(N({url:o},n),{body:i}),[4,Pu(o,N(N({},n),{body:i}))];case 1:return[4,(a=f.sent()).text()];case 2:return u=f.sent(),c=function(){if(200!==a.status){var e=null==l?void 0:l.error,t=(null==e?void 0:e.message)||"",n={status:a.status,message:t,id:null==e?void 0:e.id,details:null==e?void 0:e.details};if(h.opts.throwErrorOnHttpErrorCode)throw new vu(n);return n}},l=function(){try{return JSON.parse(u)}catch(e){throw Error("Failed reading api request result: \n\tStatus: ".concat(a.statusText," (").concat(a.status,")\n\tMessage: ").concat(u))}}(),d=c(),[2,{data:null==l?void 0:l.data,rawResponse:a,request:s,error:d,pagination:null==l?void 0:l.pagination}]}}))}))},this.contextProvider=e}return e.prototype.getDefaultHeaders=function(){var e,t,n=this.contextProvider.getCurrentToken(),r=(null===(e=this.opts)||void 0===e?void 0:e.customUserAgent)?" (".concat(this.opts.customUserAgent,")"):"";return{Authorization:this.withAuth?"Bearer ".concat(n):void 0,"Content-Type":"application/json","User-Agent":"northflank-js-client/".concat(null===(t=yu())||void 0===t?void 0:t.version).concat(r)}},e}(),wu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.method="get",t.body=function(){},t}return T(t,e),t}(gu),ju=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.method="post",t}return T(t,e),t}(gu),_u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.method="delete",t.body=function(){},t}return T(t,e),t}(gu),Su=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.method="put",t}return T(t,e),t}(gu),Eu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.method="patch",t}return T(t,e),t}(gu),Pu=function(e,t,n,r){return void 0===t&&(t={}),void 0===n&&(n=3),void 0===r&&(r=500),new Promise((function(o,i){var s=function(n){return bu(e,t).then((function(e){o(e)})).catch((function(e){return L(void 0,void 0,void 0,(function(){return q(this,(function(t){switch(t.label){case 0:return n>0?[4,(o=r,new Promise((function(e){setTimeout((function(){e()}),o)})))]:[3,2];case 1:return t.sent(),[2,s(n-1)];case 2:return[2,i(e)]}var o}))}))}))};return s(n)}))},Au=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Fetch log lines over a specific time span",t.withAuth=!0,t.requiredPermissions="Account > Service | Job | Addon > General > Read",t.endpointUrl=function(e){return mu.getLogsEndpoint(e)},t.body=function(){},t}return T(t,e),t}(wu),xu=function(e){return{containerId:e.containerId,log:e.log,ts:new Date(e.ts)}},Iu=function(e){var t=this;this.contextProvider=e,this.getServiceLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.serviceId,projectId:t.projectId},[2,this.logRange(r,null!=n?n:{},"service")]}))}))},this.getServiceBuildLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.projectId,o=t.serviceId,i={entityId:o,projectId:r},[2,this.logRange(i,N(N({},n),{isBuild:!0}),"service")]}))}))},this.getJobLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.jobId,projectId:t.projectId},[2,this.logRange(r,null!=n?n:{},"job")]}))}))},this.getJobBuildLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.projectId,o=t.jobId,i={entityId:o,projectId:r},[2,this.logRange(i,N(N({},n),{isBuild:!0}),"job")]}))}))},this.getAddonLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.addonId,projectId:t.projectId},[2,this.logRange(r,null!=n?n:{},"addon")]}))}))},this.logRange=function(e,n,r){return L(t,void 0,void 0,(function(){var t,o,i,s,a;return q(this,(function(u){switch(u.label){case 0:return t=e.entityId,o=e.projectId,i=N(N({projectId:o,entityId:t,entityType:r},n),{queryType:"range"}),[4,new Au(this.contextProvider,{}).call(i)];case 1:return(s=u.sent()).error?[2,s]:[2,N(N({},s),{data:null===(a=null==s?void 0:s.data)||void 0===a?void 0:a.map(xu)})]}}))}))},this.tailServiceLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.serviceId,projectId:t.projectId},[2,this.logTail(r,null!=n?n:{},"service")]}))}))},this.tailServiceBuildLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.serviceId,o=t.projectId,i={entityId:r,projectId:o},[2,this.logTail(i,N(N({},n),{isBuild:!0}),"service")]}))}))},this.tailJobLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.jobId,projectId:t.projectId},[2,this.logTail(r,null!=n?n:{},"job")]}))}))},this.tailJobBuildLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.projectId,o=t.jobId,i={entityId:o,projectId:r},[2,this.logTail(i,N(N({},n),{isBuild:!0}),"job")]}))}))},this.tailAddonLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.addonId,projectId:t.projectId},[2,this.logTail(r,null!=n?n:{},"addon")]}))}))},this.logTail=function(e,n,r){return L(t,void 0,void 0,(function(){var t,o,i,s,a;return q(this,(function(u){if(t=e.entityId,o=e.projectId,i=N({queryType:"tail",projectId:o,entityId:t,entityType:r},n),this.assertStartedWithNodejs(),s=this.contextProvider.getCurrentBaseUrl(!0),!(a=this.contextProvider.getCurrentToken()))throw new Error("API token not found");return[2,new mu(s,i,a)]}))}))},this.assertStartedWithNodejs=function(){if(!uu)throw new Error("Command exec only possible when started with nodejs")}},Cu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Fetch metrics entries over a specific time span",t.withAuth=!0,t.requiredPermissions="Account > Service | Job | Addon > General > Read",t.endpointUrl=function(e){var t=e.projectId,n=e.entityId,r=e.entityType,o=e.runId,i=e.buildId,s=e.isBuild,a=e.queryType,u=e.metricTypes,c=e.startTime,l=e.endTime,d=e.duration,p=e.containerName,h=e.timestamp,f="/v1/projects/".concat(t,"/");var v=new URLSearchParams;return v.append("queryType",a),c&&v.append("startTime",c.toISOString()),l&&v.append("endTime",l.toISOString()),p&&v.append("containerName",p),o&&v.append("runId",o),i&&v.append("buildId",i),h&&v.append("timestamp",h.toISOString()),d&&v.append("duration",d.toString()),u&&u.forEach((function(e){return v.append("metricTypes",e)})),"".concat(f).concat(function(){var e=s?"/build-metrics":"/metrics";switch(r){case"service":return"services/".concat(n).concat(e);case"job":return"jobs/".concat(n).concat(e);case"addon":return"addons/".concat(n).concat(e);default:throw new Error("Unexpected Northflank entity type received in metrics endpoint generation: ".concat(r))}}(),"?").concat(v.toString())},t.body=function(){},t}return T(t,e),t}(wu),ku=function(e){return{metadata:e.metadata,data:e.data.map((function(e){return{value:e.value,ts:new Date(e.ts)}}))}};exports.MetricType=void 0,(au=exports.MetricType||(exports.MetricType={})).Cpu="cpu",au.Memory="memory",au.NetworkIngress="networkIngress",au.NetworkEgress="networkEgress",au.TcpConnectionOpen="tcpConnectionsOpen",au.PvcUsage="diskUsage",au.Requests="requests",au.Http4xxResponses="http4xxResponses",au.Http5xxResponses="http5xxResponses";var Uu=function(e){var t=this;this.contextProvider=e,this.getServiceMetrics=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.serviceId,projectId:t.projectId},[2,this.metricsSingle(r,null!=n?n:{},"service")]}))}))},this.getServiceBuildMetrics=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.serviceId,o=t.projectId,i={entityId:r,projectId:o},[2,this.metricsSingle(i,N(N({},n),{isBuild:!0}),"service")]}))}))},this.getJobMetrics=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.jobId,projectId:t.projectId},[2,this.metricsSingle(r,null!=n?n:{},"job")]}))}))},this.getJobBuildMetrics=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.jobId,o=t.projectId,i={entityId:r,projectId:o},[2,this.metricsSingle(i,N(N({},n),{isBuild:!0}),"job")]}))}))},this.getAddonMetrics=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.addonId,projectId:t.projectId},[2,this.metricsSingle(r,null!=n?n:{},"addon")]}))}))},this.metricsSingle=function(e,n,r){return L(t,void 0,void 0,(function(){var t,o,i;return q(this,(function(s){return t=e.entityId,o=e.projectId,i=N(N({projectId:o,entityId:t,entityType:r},n),{queryType:"single"}),[2,this.getMetrics(i)]}))}))},this.getServiceMetricsRange=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.serviceId,projectId:t.projectId},[2,this.metricsRange(r,null!=n?n:{},"service")]}))}))},this.getServiceBuildMetricsRange=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.projectId,o=t.serviceId,i={entityId:o,projectId:r},[2,this.metricsRange(i,N(N({},n),{isBuild:!0}),"service")]}))}))},this.getJobMetricsRange=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.jobId,projectId:t.projectId},[2,this.metricsRange(r,null!=n?n:{},"job")]}))}))},this.getJobBuildMetricsRange=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.projectId,o=t.jobId,i={entityId:o,projectId:r},[2,this.metricsRange(i,N(N({},n),{isBuild:!0}),"job")]}))}))},this.getAddonMetricsRange=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.addonId,projectId:t.projectId},[2,this.metricsRange(r,null!=n?n:{},"addon")]}))}))},this.metricsRange=function(e,n,r){return L(t,void 0,void 0,(function(){var t,o,i;return q(this,(function(s){return t=e.entityId,o=e.projectId,i=N(N({projectId:o,entityId:t,entityType:r},n),{queryType:"range"}),[2,this.getMetrics(i)]}))}))},this.getMetrics=function(e){return L(t,void 0,void 0,(function(){var t;return q(this,(function(n){switch(n.label){case 0:return[4,new Cu(this.contextProvider,{}).call(e)];case 1:return(t=n.sent()).error?[2,t]:[2,N(N({},t),{data:Object.fromEntries(Object.entries(t.data).map((function(e){var t=e[0],n=e[1];return[t,N(N({},n),{values:n.values.map(ku)})]})))})]}}))}))}},Ou=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists projects for the authenticated user or team.",t.withAuth=!0,t.requiredPermissions="Project > Projects > Manage > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Du=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new project.",t.withAuth=!0,t.requiredPermissions="Project > Projects > Manage > Create",t.endpointUrl=function(e){return"/v1/projects"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Ru=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get information about the given project",t.withAuth=!0,t.requiredPermissions="Project > Projects > Manage > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId)},t.body=function(){},t}return T(t,e),t}(wu),Bu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Delete the given project. Fails if the project isn't empty.",t.withAuth=!0,t.requiredPermissions="Project > Projects > Manage > Delete",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId)},t.body=function(){},t}return T(t,e),t}(_u),Tu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of addons belonging to the project",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/addons").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Nu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new addon",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Lu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates an addon",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),qu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the given addon",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId)},t.body=function(){},t}return T(t,e),t}(wu),Gu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates an addon",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),Fu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Delete",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId)},t.body=function(){},t}return T(t,e),t}(_u),Ju=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Returns the credentials for connecting to the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/credentials")},t.body=function(){},t}return T(t,e),t}(wu),Mu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the available addon types",t.withAuth=!0,t.requiredPermissions="undefined",t.endpointUrl=function(e){return"/v1/addon-types"},t.body=function(){},t}return T(t,e),t}(wu),zu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Modifies the allocated resources for the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/scale")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Wu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about the current addon version including available upgrades and upgrade history.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/version")},t.body=function(){},t}return T(t,e),t}(wu),Vu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Upgrades the addon to a new version.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/version")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),$u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the network settings for the addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/network-settings")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Hu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the security rules for the addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/security")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Yu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Returns a list of backups for the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Zu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Initiates a backup for the given addon",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Ku=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about a given backup.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId)},t.body=function(){},t}return T(t,e),t}(wu),Xu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes a given backup",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId)},t.body=function(){},t}return T(t,e),t}(_u),Qu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Restores the given addon to the given backup state.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId,"/restore")},t.body=function(){},t}return T(t,e),t}(ju),ec=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of restores for the given backup.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId,"/restores").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),tc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Imports a database from an external archive or existing live database.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/import")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),nc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of containers for the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > Deployment > View Instances",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/containers").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),rc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Pause the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/pause")},t.body=function(){},t}return T(t,e),t}(ju),oc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Resume the given addon if it is paused.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/resume")},t.body=function(){},t}return T(t,e),t}(ju),ic=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Restart the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/restart")},t.body=function(){},t}return T(t,e),t}(ju),sc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Aborts the in progress backup.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId,"/abort")},t.body=function(){},t}return T(t,e),t}(ju),ac=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Flags a temporary backup generated by a backup schedule to be retained indefinitely rather than being deleted after the expiry date.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId,"/retain")},t.body=function(){},t}return T(t,e),t}(ju),uc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Generates a temporary download link for downloading the given backup.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId,"/download-link")},t.body=function(){},t}return T(t,e),t}(wu),cc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Aborts an in-progress backup restore.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId,"/abort-restore")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),lc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about an addon's backup schedules",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backup-schedules").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),dc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Create a new backup schedule for an addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backup-schedules")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),pc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes a backup schedule for an addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backup-schedules/").concat(e.parameters.scheduleId)},t.body=function(){},t}return T(t,e),t}(_u),hc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets the valid window for performing a point-in-time restore (PITR) on this addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/pitr-window")},t.body=function(){},t}return T(t,e),t}(wu),fc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Restores an addon to a specific point in time.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/pitr")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),vc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get a list of past invoices",t.withAuth=!0,t.requiredPermissions="Account > Billing > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/billing/invoices".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),mc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about an invoice. If `timestamp` is passed in as a query parameter, this endpoint returns details about the invoice containing that timestamp. Otherwise, returns a preview invoice displaying billing data from after the most recent invoice.",t.withAuth=!0,t.requiredPermissions="Account > Billing > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/billing/invoices/details".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),bc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists supported cloud providers",t.withAuth=!0,t.requiredPermissions="undefined",t.endpointUrl=function(e){return"/v1/cloud-providers"},t.body=function(){},t}return T(t,e),t}(wu),yc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists integrations for the authenticated user or team.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Integrations > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/cloud-providers/integrations".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),gc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new integration.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Integrations > Create",t.endpointUrl=function(e){return"/v1/cloud-providers/integrations"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),wc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get information about the given integration",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Integrations > Read",t.endpointUrl=function(e){return"/v1/cloud-providers/integrations/".concat(e.parameters.integrationId)},t.body=function(){},t}return T(t,e),t}(wu),jc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Update information about the given integration",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Integrations > Update",t.endpointUrl=function(e){return"/v1/cloud-providers/integrations/".concat(e.parameters.integrationId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),_c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Delete the given integration. Fails if the integration is associated with existing clusters.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Integrations > Delete",t.endpointUrl=function(e){return"/v1/cloud-providers/integrations/".concat(e.parameters.integrationId)},t.body=function(){},t}return T(t,e),t}(_u),Sc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists clusters for the authenticated user or team.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Clusters > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/cloud-providers/clusters".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Ec=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new cluster.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Clusters > Create",t.endpointUrl=function(e){return"/v1/cloud-providers/clusters"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Pc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get information about the given cluster",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Clusters > Read",t.endpointUrl=function(e){return"/v1/cloud-providers/clusters/".concat(e.parameters.clusterId)},t.body=function(){},t}return T(t,e),t}(wu),Ac=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Update an existing cluster.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Clusters > Update",t.endpointUrl=function(e){return"/v1/cloud-providers/clusters/".concat(e.parameters.clusterId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),xc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Delete the given cluster. Fails if the cluster has associated projects.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Clusters > Delete",t.endpointUrl=function(e){return"/v1/cloud-providers/clusters/".concat(e.parameters.clusterId)},t.body=function(){},t}return T(t,e),t}(_u),Ic=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of jobs belonging to the project",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Cc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the given job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId)},t.body=function(){},t}return T(t,e),t}(wu),kc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Delete",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId)},t.body=function(){},t}return T(t,e),t}(_u),Uc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new manual job that only runs when initiated via the UI, CLI, API or JS client.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/manual")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Oc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates a new manual job that only runs when initiated via the UI, CLI, API or JS client.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/manual")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),Dc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a new manual job that only runs when initiated via the UI, CLI, API or JS client.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/manual/").concat(e.parameters.jobId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),Rc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new cron job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/cron")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Bc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates a cron job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/cron")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),Tc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a cron job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/cron/").concat(e.parameters.jobId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),Nc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Modifies the scaling settings for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Deployment > Scale Job",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/scale")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Lc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Modify cron job to toggle suspending of its schedule.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/suspend")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),qc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Pause the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/pause")},t.body=function(){},t}return T(t,e),t}(ju),Gc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Resumes the given job. Optionally takes several arguments to override resumed settings.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/resume")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Fc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Fetches run history for the given job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runs").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Jc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Starts a new job run for the given job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runs")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Mc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Returns data about the given job run",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runs/").concat(e.parameters.runId)},t.body=function(){},t}return T(t,e),t}(wu),zc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Aborts the given job run",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Deployment > Deploy Build",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runs/").concat(e.parameters.runId)},t.body=function(){},t}return T(t,e),t}(_u),Wc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates settings for the job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/settings")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Vc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists the health checks for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/health-checks")},t.body=function(){},t}return T(t,e),t}(wu),$c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates health checks for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/health-checks")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Hc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists builds for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Yc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Start a new build for the given job. Given a commit sha, it will build that commit.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Deployment > Deploy Build",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Zc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about a build for the job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Deployment > Deploy Build",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build/").concat(e.parameters.buildId)},t.body=function(){},t}return T(t,e),t}(wu),Kc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Aborts the given job build",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Deployment > Deploy Build",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build/").concat(e.parameters.buildId)},t.body=function(){},t}return T(t,e),t}(_u),Xc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the build options for a given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build-options")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Qc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the version control source for a given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build-source")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),el=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets the build arguments of the given job. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Configuration > View Build Parameters",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build-arguments").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),tl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Sets build arguments for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Configuration > Update Build Parameters",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build-arguments")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),nl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about the build arguments accessible by the given job. Also requires the permission 'Project > Secrets > General > Read'",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Configuration > View Build Parameters",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build-arguments/details")},t.body=function(){},t}return T(t,e),t}(wu),rl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Returns the runtime environment for the given job. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Configuration > View Environment Variables",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runtime-environment").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),ol=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Sets the runtime environment for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Configuration > Update Environment Variables",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runtime-environment")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),il=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about the runtime environment accessible by the given job. Also requires the permission 'Project > Secrets > General > Read'",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Configuration > View Environment Variables",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runtime-environment/details")},t.body=function(){},t}return T(t,e),t}(wu),sl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the deployment of the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/deployment")},t.body=function(){},t}return T(t,e),t}(wu),al=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the deployment settings of the given job.",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > Update Deployment",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/deployment")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),ul=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of containers for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Deployment > View Instance Logs",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/containers").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),cl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the branches of the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/branches").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),ll=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the pull-requests of the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/pull-requests").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),dl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of log sinks added to this account.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/integrations/log-sinks".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),pl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new log sink.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Create",t.endpointUrl=function(e){return"/v1/integrations/log-sinks"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),hl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about a given log sink.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Read",t.endpointUrl=function(e){return"/v1/integrations/log-sinks/".concat(e.parameters.logSinkId)},t.body=function(){},t}return T(t,e),t}(wu),fl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes a log sink.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Delete",t.endpointUrl=function(e){return"/v1/integrations/log-sinks/".concat(e.parameters.logSinkId)},t.body=function(){},t}return T(t,e),t}(_u),vl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the settings for a log sink.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Update",t.endpointUrl=function(e){return"/v1/integrations/log-sinks/".concat(e.parameters.logSinkId,"/settings")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),ml=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Pauses a given log sink.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Update",t.endpointUrl=function(e){return"/v1/integrations/log-sinks/".concat(e.parameters.logSinkId,"/pause")},t.body=function(){},t}return T(t,e),t}(ju),bl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Resumes a paused log sink.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Update",t.endpointUrl=function(e){return"/v1/integrations/log-sinks/".concat(e.parameters.logSinkId,"/resume")},t.body=function(){},t}return T(t,e),t}(ju),yl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists the container registry credentials saved to this account. Does not display secrets.",t.withAuth=!0,t.requiredPermissions="Account > Credentials > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/integrations/registries".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),gl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Adds a new set of container registry credentials to this account.",t.withAuth=!0,t.requiredPermissions="Account > Credentials > General > Create",t.endpointUrl=function(e){return"/v1/integrations/registries"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),wl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Views a set of registry credential data.",t.withAuth=!0,t.requiredPermissions="Account > Credentials > General > Read Encrypted",t.endpointUrl=function(e){return"/v1/integrations/registries/".concat(e.parameters.credentialId)},t.body=function(){},t}return T(t,e),t}(wu),jl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes a set of registry credential data.",t.withAuth=!0,t.requiredPermissions="Account > Credentials > General > Delete",t.endpointUrl=function(e){return"/v1/integrations/registries/".concat(e.parameters.credentialId)},t.body=function(){},t}return T(t,e),t}(_u),_l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a set of registry credential data.",t.withAuth=!0,t.requiredPermissions="Account > Credentials > General > Update",t.endpointUrl=function(e){return"/v1/integrations/registries/".concat(e.parameters.credentialId,"/modify")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Sl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists available domains",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/domains".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),El=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Registers a new domain",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Create",t.endpointUrl=function(e){return"/v1/domains"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Pl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about domain",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Read",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain)},t.body=function(){},t}return T(t,e),t}(wu),Al=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes a domain and each of its registered subdomains.",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Delete",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain)},t.body=function(){},t}return T(t,e),t}(_u),xl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Attempts to verify the domain",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Create",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/verify")},t.body=function(){},t}return T(t,e),t}(ju),Il=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Adds a new subdomain to the domain.",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Update",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/subdomains")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Cl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about the given subdomain",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Read",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/subdomains/").concat(e.parameters.subdomain)},t.body=function(){},t}return T(t,e),t}(wu),kl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Removes a subdomain from a domain.",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Update",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/subdomains/").concat(e.parameters.subdomain)},t.body=function(){},t}return T(t,e),t}(_u),Ul=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about the given subdomain",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Update",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/subdomains/").concat(e.parameters.subdomain,"/verify")},t.body=function(){},t}return T(t,e),t}(ju),Ol=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Assigns a service port to the given subdomain",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Update",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/subdomains/").concat(e.parameters.subdomain,"/assign")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Dl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Removes a subdomain from its assigned service",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Update",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/subdomains/").concat(e.parameters.subdomain,"/assign")},t.body=function(){},t}return T(t,e),t}(_u),Rl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists available billing plans",t.withAuth=!0,t.requiredPermissions="undefined",t.endpointUrl=function(e){return"/v1/plans"},t.body=function(){},t}return T(t,e),t}(wu),Bl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists available project regions",t.withAuth=!0,t.requiredPermissions="undefined",t.endpointUrl=function(e){return"/v1/regions"},t.body=function(){},t}return T(t,e),t}(wu),Tl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Returns the partially random string used when generating host names for the authenticated account.",t.withAuth=!0,t.requiredPermissions="Project > Projects > Manage > Read",t.endpointUrl=function(e){return"/v1/dns-id"},t.body=function(){},t}return T(t,e),t}(wu),Nl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists linked version control providers",t.withAuth=!0,t.requiredPermissions="Account > Git > General > Read",t.endpointUrl=function(e){return"/v1/integrations/vcs"},t.body=function(){},t}return T(t,e),t}(wu),Ll=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists all pipelines for a project",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/pipelines").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),ql=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about a pipeline",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId)},t.body=function(){},t}return T(t,e),t}(wu),Gl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about a release flow",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId,"/release-flows/").concat(e.parameters.stage)},t.body=function(){},t}return T(t,e),t}(wu),Fl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a release flow",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId,"/release-flows/").concat(e.parameters.stage)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Jl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Runs a given release flow with given arguments. This endpoint can be used as part of a CI pipeline to automatically trigger a release process.",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId,"/release-flows/").concat(e.parameters.stage,"/runs")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Ml=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists runs of a release flow",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId,"/release-flows/").concat(e.parameters.stage,"/runs").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),zl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get information about the given release flow run",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId,"/release-flows/").concat(e.parameters.stage,"/runs/").concat(e.parameters.runId)},t.body=function(){},t}return T(t,e),t}(wu),Wl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Abort the given release flow run",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId,"/release-flows/").concat(e.parameters.stage,"/runs/").concat(e.parameters.runId,"/abort")},t.body=function(){},t}return T(t,e),t}(ju),Vl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of secrets belonging to the project",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/secrets").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),$l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a secret with the specified payload",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Hl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates a secret with the specified payload",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),Yl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a secret with the specified payload",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),Zl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="View a secret including its contents",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId).concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Kl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Delete a secret",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Delete",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId)},t.body=function(){},t}return T(t,e),t}(_u),Xl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Update a secret",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Ql=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="View a secret with details about its linked addons",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId,"/details")},t.body=function(){},t}return T(t,e),t}(wu),ed=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Link an addon to the secret group or edit the settings of the linked addon.",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId,"/addons/").concat(e.parameters.addonId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),td=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about a given addon link.",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId,"/addons/").concat(e.parameters.addonId)},t.body=function(){},t}return T(t,e),t}(wu),nd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Unlinks an addon from the secret group.",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId,"/addons/").concat(e.parameters.addonId)},t.body=function(){},t}return T(t,e),t}(_u),rd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of services belonging to the project",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),od=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new combined service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/combined")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),id=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates a combined service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/combined")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),sd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a combined service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/combined/").concat(e.parameters.serviceId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),ad=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new deployment service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/deployment")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),ud=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates a deployment service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/deployment")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),cd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a deployment service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/deployment/").concat(e.parameters.serviceId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),ld=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new build service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/build")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),dd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates a build service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/build")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),pd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a build service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/build/").concat(e.parameters.serviceId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),hd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId)},t.body=function(){},t}return T(t,e),t}(wu),fd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Delete",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId)},t.body=function(){},t}return T(t,e),t}(_u),vd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Modifies the scaling settings for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > Scale Service",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/scale")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),md=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the deployment of the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > View Instances",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/deployment")},t.body=function(){},t}return T(t,e),t}(wu),bd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the deployment settings of the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > Update Deployment",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/deployment")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),yd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Restarts the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/restart")},t.body=function(){},t}return T(t,e),t}(ju),gd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Pause the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/pause")},t.body=function(){},t}return T(t,e),t}(ju),wd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Resumes the given service. Optionally takes several arguments to override resumed settings.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/resume")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),jd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists the ports for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/ports")},t.body=function(){},t}return T(t,e),t}(wu),_d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the list of ports for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/ports")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Sd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the build options for a given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build-options")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Ed=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the version control source for a given build or combined service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build-source")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Pd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists the health checks for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/health-checks")},t.body=function(){},t}return T(t,e),t}(wu),Ad=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates health checks for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/health-checks")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),xd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists the builds for the service",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Id=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Start a new build for the given combined or build service. If given a commit sha, it will build that commit. Otherwise, the most recent relevant commit will be built. If the service provided is a build service, a branch name or pull request to build from is required.",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > Deploy Build",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Cd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about a build for the service",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build/").concat(e.parameters.buildId)},t.body=function(){},t}return T(t,e),t}(wu),kd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Aborts the given service build",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > Deploy Build",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build/").concat(e.parameters.buildId)},t.body=function(){},t}return T(t,e),t}(_u),Ud=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of containers for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > View Instances",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/containers").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Od=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the branches of the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/branches").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Dd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the pull-requests of the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/pull-requests").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Rd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get a list of templates",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/templates".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Bd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Create a template",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Create",t.endpointUrl=function(e){return"/v1/templates"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Td=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get information about the given template.",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/templates/".concat(e.parameters.templateId).concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Nd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Update a template",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Update",t.endpointUrl=function(e){return"/v1/templates/".concat(e.parameters.templateId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Ld=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Delete a template",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Delete",t.endpointUrl=function(e){return"/v1/templates/".concat(e.parameters.templateId)},t.body=function(){},t}return T(t,e),t}(_u),qd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Run a template",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Run",t.endpointUrl=function(e){return"/v1/templates/".concat(e.parameters.templateId,"/runs")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Gd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get a list of template runs",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/templates/".concat(e.parameters.templateId,"/runs").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Fd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get information about the given template run.",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Read",t.endpointUrl=function(e){return"/v1/templates/".concat(e.parameters.templateId,"/runs/").concat(e.parameters.templateRunId)},t.body=function(){},t}return T(t,e),t}(wu),Jd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Abort the given template run.",t.withAuth=!0,t.requiredPermissions="Account > Templates > Runs > Abort",t.endpointUrl=function(e){return"/v1/templates/".concat(e.parameters.templateId,"/runs/").concat(e.parameters.templateRunId,"/abort")},t.body=function(){},t}return T(t,e),t}(ju),Md=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of repositories accessible to this account",t.withAuth=!0,t.requiredPermissions="Account > Git > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/integrations/vcs/repos".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),zd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of branches for the repo",t.withAuth=!0,t.requiredPermissions="Account > Git > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/integrations/vcs/repos/".concat(e.parameters.vcsService,"/").concat(e.parameters.repositoryOwner,"/").concat(e.parameters.repositoryName,"/branches").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Wd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Generate a token for a specific VCS link.",t.withAuth=!0,t.requiredPermissions="Account > Git > Tokens > Read",t.endpointUrl=function(e){return"/v1/integrations/vcs/custom/".concat(e.parameters.customVCSId,"/token/").concat(e.parameters.vcsLinkId)},t.body=function(){},t}return T(t,e),t}(ju),Vd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of volumes belonging to the project",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes")},t.body=function(){},t}return T(t,e),t}(wu),$d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a volume with the specified payload",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Hd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Retrieve a volume",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes/").concat(e.parameters.volumeId)},t.body=function(){},t}return T(t,e),t}(wu),Yd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Update volume mounts and storage size",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes/").concat(e.parameters.volumeId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Zd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes this volume and its associated data.",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Delete",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes/").concat(e.parameters.volumeId)},t.body=function(){},t}return T(t,e),t}(_u),Kd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Attach a volume",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes/").concat(e.parameters.volumeId,"/attach")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Xd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Detach a volume",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes/").concat(e.parameters.volumeId,"/detach")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Qd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets the build arguments of the given service. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",t.withAuth=!0,t.requiredPermissions="Project > Services > Configuration > View Build Parameters",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build-arguments").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),ep=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Sets the build arguments for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > Configuration > Update Build Parameters",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build-arguments")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),tp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about the build arguments accessible by the given service. Also requires the permission 'Project > Secrets > General > Read'",t.withAuth=!0,t.requiredPermissions="Project > Services > Configuration > View Build Parameters",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build-arguments/details")},t.body=function(){},t}return T(t,e),t}(wu),np=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets the runtime environment of the given service. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",t.withAuth=!0,t.requiredPermissions="Project > Services > Configuration > View Environment Variables",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/runtime-environment").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),rp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Sets the runtime environment for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > Configuration > Update Environment Variables",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/runtime-environment")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),op=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about the runtime environment accessible by the given service. Also requires the permission 'Project > Secrets > General > Read'",t.withAuth=!0,t.requiredPermissions="Project > Services > Configuration > View Environment Variables",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/runtime-environment/details")},t.body=function(){},t}return T(t,e),t}(wu),ip=function(){function e(){this.loadContext()}return e.prototype.loadContext=function(){this.contextWrapper=this.loadContextWrapper()},e.prototype.getInfo=function(){return""},e.prototype.storeContext=function(e){return L(this,void 0,void 0,(function(){return q(this,(function(t){switch(t.label){case 0:return[4,this.writeContext(e)];case 1:return t.sent(),this.contextWrapper=e,[2]}}))}))},e.prototype.addContext=function(e,t){return void 0===t&&(t=!0),L(this,void 0,void 0,(function(){var n,r,o;return q(this,(function(i){switch(i.label){case 0:if(t||void 0===this.findContext(e.name))return[3,1];throw new Error("Context with name ".concat(e.name," already exists"));case 1:return[4,this.removeContext(e.name)];case 2:i.sent(),i.label=3;case 3:return n=N({host:"https://api.northflank.com"},e),r=this.contextWrapper,o={current:n.name,contexts:G(G([],r.contexts,!0),[n],!1),lastUpdateCheck:r.lastUpdateCheck},[4,this.storeContext(o)];case 4:return i.sent(),[2]}}))}))},e.prototype.removeContext=function(e){return L(this,void 0,void 0,(function(){var t,n,r,o;return q(this,(function(i){switch(i.label){case 0:return t=this.contextWrapper,n=t.contexts.filter((function(t){return t.name!==e})),r=t.current===e?void 0:t.current,o={current:r,contexts:G([],n,!0),lastUpdateCheck:t.lastUpdateCheck},[4,this.storeContext(o)];case 1:return i.sent(),[2]}}))}))},e.prototype.getCurrentContext=function(){var e=this.contextWrapper.current;return void 0===e?e:this.findContext(e)},e.prototype.findContext=function(e){return this.contextWrapper.contexts.find((function(t){return t.name===e}))},e.prototype.getCurrentBaseUrl=function(e){var t=this.getCurrentContext();if(!0===e&&!(null==t?void 0:t.host))throw new Error("Context (".concat(null==t?void 0:t.name,") doesn't have a target API host. Please login again."));return null==t?void 0:t.host},e.prototype.getCurrentProjectName=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.project},e.prototype.getCurrentName=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.name},e.prototype.getCurrentToken=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.token},e.prototype.getCurrentServiceName=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.service},e.prototype.getCurrentJobName=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.job},e.prototype.getCurrentPlanId=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.plan},e.prototype.getCurrentRegion=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.region},e.prototype.useContext=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:if(!this.findContext(e))throw new Error("Context with name ".concat(e," doesn't exist"));return t=this.contextWrapper,n=N(N({},t),{current:e}),[4,this.storeContext(n)];case 1:return r.sent(),[2]}}))}))},e.prototype.updateToken=function(e,t){return L(this,void 0,void 0,(function(){var n,r,o,i,s;return q(this,(function(a){switch(a.label){case 0:if(n=null!=t?t:this.getCurrentName(),!(r=this.findContext(n)))throw new Error("Context with name ".concat(t," doesn't exist"));return o=this.contextWrapper,i=o.contexts.map((function(t){return t.name===n?N(N({},r),{token:e}):t})),s=N(N({},o),{contexts:i}),[4,this.storeContext(s)];case 1:return a.sent(),[2]}}))}))},e.prototype.useProjectId=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:if(void 0===(t=this.getCurrentContext()))throw new Error("Failed to set project id to current context, current context not defined");return n=N(N({},t),{project:e}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},e.prototype.useServiceId=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:if(void 0===(t=this.getCurrentContext()))throw new Error("Failed to set service id to current context, current context not defined");return n=N(N({},t),{service:e}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},e.prototype.useJobId=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:if(void 0===(t=this.getCurrentContext()))throw new Error("Failed to set job id to current context, current context not defined");return n=N(N({},t),{job:e}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},e.prototype.usePlanId=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:if(void 0===(t=this.getCurrentContext()))throw new Error("Failed to set plan id to current context, current context not defined");return n=N(N({},t),{plan:e}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},e.prototype.useRegion=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:if(void 0===(t=this.getCurrentContext()))throw new Error("Failed to set region id to current context, current context not defined");return n=N(N({},t),{region:e}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},e.prototype.getLastUpdateCheck=function(){return this.contextWrapper.lastUpdateCheck||new Date},e.prototype.setLastUpdateCheck=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:return t=this.contextWrapper,n=N(N({},t),{lastUpdateCheck:e}),[4,this.storeContext(n)];case 1:return r.sent(),[2]}}))}))},e}(),sp=function(e){function t(t){var n=e.call(this)||this;return n.assertDir=function(e){return L(n,void 0,void 0,(function(){var t;return q(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,C.default.promises.mkdir(e,{recursive:!0})];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.log("Failed to login, local files could not be created: ".concat(e,", error: ").concat(t.message)),t;case 3:return[2]}}))}))},n.configPath=t||"".concat(A.default.homedir(),"/.northflank"),n.configFile="".concat(n.configPath,"/config.json"),n.loadContext(),n}return T(t,e),t.prototype.loadContextWrapper=function(){try{return JSON.parse(C.default.readFileSync(this.configFile,"utf8"))}catch(e){return{contexts:[],lastUpdateCheck:new Date(0)}}},t.prototype.writeContext=function(e){return L(this,void 0,void 0,(function(){var t;return q(this,(function(n){switch(n.label){case 0:return[4,this.assertConfigDir()];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,4,,5]),[4,C.default.promises.writeFile(this.configFile,JSON.stringify(e,null,"\t"),{mode:416})];case 3:return n.sent(),[3,5];case 4:throw t=n.sent(),console.log("Failed to persist api context, local files could not be created, error: ".concat(t.message)),t;case 5:return[2]}}))}))},t.prototype.assertConfigDir=function(){return L(this,void 0,void 0,(function(){return q(this,(function(e){switch(e.label){case 0:return[4,this.assertDir(this.configPath)];case 1:return e.sent(),[2]}}))}))},t.prototype.getInfo=function(){return"Cli config stored in: ".concat(this.configPath)},t}(ip),ap=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.inMemoryContextWrapper={contexts:[],lastUpdateCheck:new Date(0)},t}return T(t,e),t.prototype.loadContextWrapper=function(){return this.inMemoryContextWrapper||(this.inMemoryContextWrapper={contexts:[],lastUpdateCheck:new Date(0)}),this.inMemoryContextWrapper},t.prototype.writeContext=function(e){return L(this,void 0,void 0,(function(){return q(this,(function(t){return this.inMemoryContextWrapper=e,[2]}))}))},t}(ip),up=function(e,t){void 0===t&&(t={});var n,r=this;this.baseUrl=function(){return r.contextProvider.getCurrentBaseUrl()},this.contextProvider=e,this.forwarding=new du(e,new rd(e,t).call,new Tu(e,t).call),this.exec=new fu(e),this.logs=new Iu(e),this.metrics=new Uu(e),this.endpoints={list:(n={},n.projects=new Ou(e,t),n.addons=new Tu(e,t),n.invoices=new vc(e,t),n.providers=new bc(e,t),n.integrations=new yc(e,t),n.clusters=new Sc(e,t),n.jobs=new Ic(e,t),n.logSinks=new dl(e,t),n.registries=new yl(e,t),n.domains=new Sl(e,t),n.plans=new Rl(e,t),n.regions=new Bl(e,t),n.vcs=new Nl(e,t),n.pipelines=new Ll(e,t),n.releaseFlowRuns=new Ml(e,t),n.secrets=new Vl(e,t),n.services=new rd(e,t),n.templates=new Rd(e,t),n.templateRuns=new Gd(e,t),n.repos=new Md(e,t),n.branches=new zd(e,t),n.volumes=new Vd(e,t),n),create:function(){var n,r={};return r.project=new Du(e,t),r.addon=((n=new Nu(e,t)).backupSchedule=new dc(e,t),n),r.integration=new gc(e,t),r.cluster=new Ec(e,t),r.job=function(){var n={};return n.manual=new Uc(e,t),n.cron=new Rc(e,t),n}(),r.logSink=new pl(e,t),r.domain=new El(e,t),r.secret=new $l(e,t),r.service=function(){var n={};return n.combined=new od(e,t),n.deployment=new ad(e,t),n.build=new ld(e,t),n}(),r.template=new Bd(e,t),r.customVcs=function(){var n={};return n.token=new Wd(e,t),n}(),r.volume=new $d(e,t),r}(),get:function(){var n,r,o={};return o.project=new Ru(e,t),o.addon=((r=new qu(e,t)).credentials=new Ju(e,t),r.types=new Mu(e,t),r.version=new Wu(e,t),r.backups=new Yu(e,t),r.backup=((n=new Ku(e,t)).download=new uc(e,t),n),r.restores=new ec(e,t),r.containers=new nc(e,t),r.backupSchedules=new lc(e,t),r.pitrWindow=new hc(e,t),r),o.invoice=function(){var n={};return n.details=new mc(e,t),n}(),o.integration=new wc(e,t),o.cluster=new Pc(e,t),o.job=function(){var n=new Cc(e,t);return n.runs=new Fc(e,t),n.run=new Mc(e,t),n.healthChecks=new Vc(e,t),n.builds=new Hc(e,t),n.build=new Zc(e,t),n.buildArguments=new el(e,t),n.buildArgumentDetails=new nl(e,t),n.runtimeEnvironment=new rl(e,t),n.runtimeEnvironmentDetails=new il(e,t),n.deployment=new sl(e,t),n.containers=new ul(e,t),n.branches=new cl(e,t),n.pullRequests=new ll(e,t),n}(),o.logSink=new hl(e,t),o.registry=new wl(e,t),o.domain=new Pl(e,t),o.subdomain=new Cl(e,t),o.dnsId=new Tl(e,t),o.pipeline=new ql(e,t),o.releaseFlow=new Gl(e,t),o.releaseFlowRun=new zl(e,t),o.secret=new Zl(e,t),o.secretDetails=new Ql(e,t),o.secretLink=new td(e,t),o.service=function(){var n=new hd(e,t);return n.deployment=new md(e,t),n.ports=new jd(e,t),n.healthChecks=new Pd(e,t),n.builds=new xd(e,t),n.build=new Cd(e,t),n.containers=new Ud(e,t),n.branches=new Od(e,t),n.pullRequests=new Dd(e,t),n.buildArguments=new Qd(e,t),n.buildArgumentDetails=new tp(e,t),n.runtimeEnvironment=new np(e,t),n.runtimeEnvironmentDetails=new op(e,t),n}(),o.template=new Td(e,t),o.templateRun=new Fd(e,t),o.volume=new Hd(e,t),o}(),delete:function(){var n,r={};return r.project=new Bu(e,t),r.addon=((n=new Fu(e,t)).backupSchedule=new pc(e,t),n),r.backup=new Xu(e,t),r.integration=new _c(e,t),r.cluster=new xc(e,t),r.job=new kc(e,t),r.logSink=new fl(e,t),r.registry=new jl(e,t),r.domain=new Al(e,t),r.subdomain=new kl(e,t),r.secret=new Kl(e,t),r.secretLink=new nd(e,t),r.service=new fd(e,t),r.template=new Ld(e,t),r.volume=new Zd(e,t),r}(),put:function(){var n,r={};return r.addon=new Lu(e,t),r.job=((n={}).manual=new Oc(e,t),n.cron=new Bc(e,t),n),r.secret=new Hl(e,t),r.service=function(){var n={};return n.combined=new id(e,t),n.deployment=new ud(e,t),n.build=new dd(e,t),n}(),r}(),patch:function(){var n,r={};return r.addon=new Gu(e,t),r.job=((n={}).manual=new Dc(e,t),n.cron=new Tc(e,t),n),r.secret=new Yl(e,t),r.service=function(){var n={};return n.combined=new sd(e,t),n.deployment=new cd(e,t),n.build=new pd(e,t),n}(),r}(),scale:function(){var n={};return n.addon=new zu(e,t),n.job=new Nc(e,t),n.service=new vd(e,t),n}(),update:function(){var n,r={};return r.addon=((n={}).version=new Vu(e,t),n.networkSettings=new $u(e,t),n.security=new Hu(e,t),n),r.integration=new jc(e,t),r.cluster=new Ac(e,t),r.job=function(){var n={};return n.settings=new Wc(e,t),n.healthChecks=new $c(e,t),n.buildOptions=new Xc(e,t),n.buildSource=new Qc(e,t),n.buildArguments=new tl(e,t),n.runtimeEnvironment=new ol(e,t),n.deployment=new al(e,t),n}(),r.logSink=new vl(e,t),r.registry=new _l(e,t),r.releaseFlow=new Fl(e,t),r.secret=new Xl(e,t),r.secretLink=new ed(e,t),r.service=function(){var n={};return n.deployment=new bd(e,t),n.ports=new _d(e,t),n.buildOptions=new Sd(e,t),n.buildSource=new Ed(e,t),n.healthChecks=new Ad(e,t),n.buildArguments=new ep(e,t),n.runtimeEnvironment=new rp(e,t),n}(),r.template=new Nd(e,t),r.volume=new Yd(e,t),r}(),backup:function(){var n={};return n.addon=new Zu(e,t),n}(),restore:function(){var n,r={};return r.addon=((n={}).backup=new Qu(e,t),n),r}(),import:function(){var n,r={};return r.addon=((n={}).backup=new tc(e,t),n),r}(),pause:function(){var n={};return n.addon=new rc(e,t),n.job=new qc(e,t),n.logSink=new ml(e,t),n.service=new gd(e,t),n}(),resume:function(){var n={};return n.addon=new oc(e,t),n.job=new Gc(e,t),n.logSink=new bl(e,t),n.service=new wd(e,t),n}(),restart:function(){var n={};return n.addon=new ic(e,t),n.service=new yd(e,t),n}(),abort:function(){var n,r={};return r.addon=((n={}).backup=new sc(e,t),n.restore=new cc(e,t),n),r.job=function(){var n={};return n.run=new zc(e,t),n.build=new Kc(e,t),n}(),r.releaseFlowRun=new Wl(e,t),r.service=function(){var n={};return n.build=new kd(e,t),n}(),r.templateRun=new Jd(e,t),r}(),retain:function(){var n,r={};return r.addon=((n={}).backup=new ac(e,t),n),r}(),start:function(){var n,r={};return r.addon=((n={}).pitr=new fc(e,t),n),r.job=function(){var n={};return n.run=new Jc(e,t),n.build=new Yc(e,t),n}(),r.service=function(){var n={};return n.build=new Id(e,t),n}(),r}(),suspend:function(){var n={};return n.job=new Lc(e,t),n}(),add:function(){var n,r={};return r.registry=new gl(e,t),r.domain=((n={}).subdomain=new Il(e,t),n),r}(),verify:function(){var n={};return n.domain=new xl(e,t),n.subdomain=new Ul(e,t),n}(),assign:function(){var n,r={};return r.subdomain=((n={}).service=new Ol(e,t),n),r}(),unassign:function(){var n={};return n.subdomain=new Dl(e,t),n}(),run:function(){var n={};return n.releaseFlow=new Jl(e,t),n.template=new qd(e,t),n}(),attach:function(){var n={};return n.volume=new Kd(e,t),n}(),detach:function(){var n={};return n.volume=new Xd(e,t),n}()},this.list=function(){var e={};return e.projects=r.endpoints.list.projects.call,e.addons=r.endpoints.list.addons.call,e.invoices=r.endpoints.list.invoices.call,e.providers=r.endpoints.list.providers.call,e.integrations=r.endpoints.list.integrations.call,e.clusters=r.endpoints.list.clusters.call,e.jobs=r.endpoints.list.jobs.call,e.logSinks=r.endpoints.list.logSinks.call,e.registries=r.endpoints.list.registries.call,e.domains=r.endpoints.list.domains.call,e.plans=r.endpoints.list.plans.call,e.regions=r.endpoints.list.regions.call,e.vcs=r.endpoints.list.vcs.call,e.pipelines=r.endpoints.list.pipelines.call,e.releaseFlowRuns=r.endpoints.list.releaseFlowRuns.call,e.secrets=r.endpoints.list.secrets.call,e.services=r.endpoints.list.services.call,e.templates=r.endpoints.list.templates.call,e.templateRuns=r.endpoints.list.templateRuns.call,e.repos=r.endpoints.list.repos.call,e.branches=r.endpoints.list.branches.call,e.volumes=r.endpoints.list.volumes.call,e}(),this.create=function(){var e,t={};return t.project=r.endpoints.create.project.call,t.addon=((e=r.endpoints.create.addon.call).backupSchedule=r.endpoints.create.addon.backupSchedule.call,e),t.integration=r.endpoints.create.integration.call,t.cluster=r.endpoints.create.cluster.call,t.job=function(){var e={};return e.manual=r.endpoints.create.job.manual.call,e.cron=r.endpoints.create.job.cron.call,e}(),t.logSink=r.endpoints.create.logSink.call,t.domain=r.endpoints.create.domain.call,t.secret=r.endpoints.create.secret.call,t.service=function(){var e={};return e.combined=r.endpoints.create.service.combined.call,e.deployment=r.endpoints.create.service.deployment.call,e.build=r.endpoints.create.service.build.call,e}(),t.template=r.endpoints.create.template.call,t.customVcs=function(){var e={};return e.token=r.endpoints.create.customVcs.token.call,e}(),t.volume=r.endpoints.create.volume.call,t}(),this.get=function(){var e,t,n={};return n.project=r.endpoints.get.project.call,n.addon=((t=r.endpoints.get.addon.call).credentials=r.endpoints.get.addon.credentials.call,t.types=r.endpoints.get.addon.types.call,t.version=r.endpoints.get.addon.version.call,t.backups=r.endpoints.get.addon.backups.call,t.backup=((e=r.endpoints.get.addon.backup.call).download=r.endpoints.get.addon.backup.download.call,e),t.restores=r.endpoints.get.addon.restores.call,t.containers=r.endpoints.get.addon.containers.call,t.backupSchedules=r.endpoints.get.addon.backupSchedules.call,t.pitrWindow=r.endpoints.get.addon.pitrWindow.call,t.logs=r.logs.getAddonLogs,t.logTail=r.logs.tailAddonLogs,t.metrics=r.metrics.getAddonMetrics,t.metricsRange=r.metrics.getAddonMetricsRange,t),n.invoice=function(){var e={};return e.details=r.endpoints.get.invoice.details.call,e}(),n.integration=r.endpoints.get.integration.call,n.cluster=r.endpoints.get.cluster.call,n.job=function(){var e=r.endpoints.get.job.call;return e.runs=r.endpoints.get.job.runs.call,e.run=r.endpoints.get.job.run.call,e.healthChecks=r.endpoints.get.job.healthChecks.call,e.builds=r.endpoints.get.job.builds.call,e.build=r.endpoints.get.job.build.call,e.buildArguments=r.endpoints.get.job.buildArguments.call,e.buildArgumentDetails=r.endpoints.get.job.buildArgumentDetails.call,e.runtimeEnvironment=r.endpoints.get.job.runtimeEnvironment.call,e.runtimeEnvironmentDetails=r.endpoints.get.job.runtimeEnvironmentDetails.call,e.deployment=r.endpoints.get.job.deployment.call,e.containers=r.endpoints.get.job.containers.call,e.branches=r.endpoints.get.job.branches.call,e.pullRequests=r.endpoints.get.job.pullRequests.call,e.logs=r.logs.getJobLogs,e.buildLogs=r.logs.getJobBuildLogs,e.logTail=r.logs.tailJobLogs,e.buildLogTail=r.logs.tailJobBuildLogs,e.metrics=r.metrics.getJobMetrics,e.buildMetrics=r.metrics.getJobBuildMetrics,e.metricsRange=r.metrics.getJobMetricsRange,e.buildMetricsRange=r.metrics.getJobBuildMetricsRange,e}(),n.logSink=r.endpoints.get.logSink.call,n.registry=r.endpoints.get.registry.call,n.domain=r.endpoints.get.domain.call,n.subdomain=r.endpoints.get.subdomain.call,n.dnsId=r.endpoints.get.dnsId.call,n.pipeline=r.endpoints.get.pipeline.call,n.releaseFlow=r.endpoints.get.releaseFlow.call,n.releaseFlowRun=r.endpoints.get.releaseFlowRun.call,n.secret=r.endpoints.get.secret.call,n.secretDetails=r.endpoints.get.secretDetails.call,n.secretLink=r.endpoints.get.secretLink.call,n.service=function(){var e=r.endpoints.get.service.call;return e.deployment=r.endpoints.get.service.deployment.call,e.ports=r.endpoints.get.service.ports.call,e.healthChecks=r.endpoints.get.service.healthChecks.call,e.builds=r.endpoints.get.service.builds.call,e.build=r.endpoints.get.service.build.call,e.containers=r.endpoints.get.service.containers.call,e.branches=r.endpoints.get.service.branches.call,e.pullRequests=r.endpoints.get.service.pullRequests.call,e.buildArguments=r.endpoints.get.service.buildArguments.call,e.buildArgumentDetails=r.endpoints.get.service.buildArgumentDetails.call,e.runtimeEnvironment=r.endpoints.get.service.runtimeEnvironment.call,e.runtimeEnvironmentDetails=r.endpoints.get.service.runtimeEnvironmentDetails.call,e.logs=r.logs.getServiceLogs,e.buildLogs=r.logs.getServiceBuildLogs,e.logTail=r.logs.tailServiceLogs,e.buildLogTail=r.logs.tailServiceBuildLogs,e.metrics=r.metrics.getServiceMetrics,e.buildMetrics=r.metrics.getServiceBuildMetrics,e.metricsRange=r.metrics.getServiceMetricsRange,e.buildMetricsRange=r.metrics.getServiceBuildMetricsRange,e}(),n.template=r.endpoints.get.template.call,n.templateRun=r.endpoints.get.templateRun.call,n.volume=r.endpoints.get.volume.call,n}(),this.delete=function(){var e,t={};return t.project=r.endpoints.delete.project.call,t.addon=((e=r.endpoints.delete.addon.call).backupSchedule=r.endpoints.delete.addon.backupSchedule.call,e),t.backup=r.endpoints.delete.backup.call,t.integration=r.endpoints.delete.integration.call,t.cluster=r.endpoints.delete.cluster.call,t.job=r.endpoints.delete.job.call,t.logSink=r.endpoints.delete.logSink.call,t.registry=r.endpoints.delete.registry.call,t.domain=r.endpoints.delete.domain.call,t.subdomain=r.endpoints.delete.subdomain.call,t.secret=r.endpoints.delete.secret.call,t.secretLink=r.endpoints.delete.secretLink.call,t.service=r.endpoints.delete.service.call,t.template=r.endpoints.delete.template.call,t.volume=r.endpoints.delete.volume.call,t}(),this.put=function(){var e,t={};return t.addon=r.endpoints.put.addon.call,t.job=((e={}).manual=r.endpoints.put.job.manual.call,e.cron=r.endpoints.put.job.cron.call,e),t.secret=r.endpoints.put.secret.call,t.service=function(){var e={};return e.combined=r.endpoints.put.service.combined.call,e.deployment=r.endpoints.put.service.deployment.call,e.build=r.endpoints.put.service.build.call,e}(),t}(),this.patch=function(){var e,t={};return t.addon=r.endpoints.patch.addon.call,t.job=((e={}).manual=r.endpoints.patch.job.manual.call,e.cron=r.endpoints.patch.job.cron.call,e),t.secret=r.endpoints.patch.secret.call,t.service=function(){var e={};return e.combined=r.endpoints.patch.service.combined.call,e.deployment=r.endpoints.patch.service.deployment.call,e.build=r.endpoints.patch.service.build.call,e}(),t}(),this.scale=function(){var e={};return e.addon=r.endpoints.scale.addon.call,e.job=r.endpoints.scale.job.call,e.service=r.endpoints.scale.service.call,e}(),this.update=function(){var e,t={};return t.addon=((e={}).version=r.endpoints.update.addon.version.call,e.networkSettings=r.endpoints.update.addon.networkSettings.call,e.security=r.endpoints.update.addon.security.call,e),t.integration=r.endpoints.update.integration.call,t.cluster=r.endpoints.update.cluster.call,t.job=function(){var e={};return e.settings=r.endpoints.update.job.settings.call,e.healthChecks=r.endpoints.update.job.healthChecks.call,e.buildOptions=r.endpoints.update.job.buildOptions.call,e.buildSource=r.endpoints.update.job.buildSource.call,e.buildArguments=r.endpoints.update.job.buildArguments.call,e.runtimeEnvironment=r.endpoints.update.job.runtimeEnvironment.call,e.deployment=r.endpoints.update.job.deployment.call,e}(),t.logSink=r.endpoints.update.logSink.call,t.registry=r.endpoints.update.registry.call,t.releaseFlow=r.endpoints.update.releaseFlow.call,t.secret=r.endpoints.update.secret.call,t.secretLink=r.endpoints.update.secretLink.call,t.service=function(){var e={};return e.deployment=r.endpoints.update.service.deployment.call,e.ports=r.endpoints.update.service.ports.call,e.buildOptions=r.endpoints.update.service.buildOptions.call,e.buildSource=r.endpoints.update.service.buildSource.call,e.healthChecks=r.endpoints.update.service.healthChecks.call,e.buildArguments=r.endpoints.update.service.buildArguments.call,e.runtimeEnvironment=r.endpoints.update.service.runtimeEnvironment.call,e}(),t.template=r.endpoints.update.template.call,t.volume=r.endpoints.update.volume.call,t}(),this.backup=function(){var e={};return e.addon=r.endpoints.backup.addon.call,e}(),this.restore=function(){var e,t={};return t.addon=((e={}).backup=r.endpoints.restore.addon.backup.call,e),t}(),this.import=function(){var e,t={};return t.addon=((e={}).backup=r.endpoints.import.addon.backup.call,e),t}(),this.pause=function(){var e={};return e.addon=r.endpoints.pause.addon.call,e.job=r.endpoints.pause.job.call,e.logSink=r.endpoints.pause.logSink.call,e.service=r.endpoints.pause.service.call,e}(),this.resume=function(){var e={};return e.addon=r.endpoints.resume.addon.call,e.job=r.endpoints.resume.job.call,e.logSink=r.endpoints.resume.logSink.call,e.service=r.endpoints.resume.service.call,e}(),this.restart=function(){var e={};return e.addon=r.endpoints.restart.addon.call,e.service=r.endpoints.restart.service.call,e}(),this.abort=function(){var e,t={};return t.addon=((e={}).backup=r.endpoints.abort.addon.backup.call,e.restore=r.endpoints.abort.addon.restore.call,e),t.job=function(){var e={};return e.run=r.endpoints.abort.job.run.call,e.build=r.endpoints.abort.job.build.call,e}(),t.releaseFlowRun=r.endpoints.abort.releaseFlowRun.call,t.service=function(){var e={};return e.build=r.endpoints.abort.service.build.call,e}(),t.templateRun=r.endpoints.abort.templateRun.call,t}(),this.retain=function(){var e,t={};return t.addon=((e={}).backup=r.endpoints.retain.addon.backup.call,e),t}(),this.start=function(){var e,t={};return t.addon=((e={}).pitr=r.endpoints.start.addon.pitr.call,e),t.job=function(){var e={};return e.run=r.endpoints.start.job.run.call,e.build=r.endpoints.start.job.build.call,e}(),t.service=function(){var e={};return e.build=r.endpoints.start.service.build.call,e}(),t}(),this.suspend=function(){var e={};return e.job=r.endpoints.suspend.job.call,e}(),this.add=function(){var e,t={};return t.registry=r.endpoints.add.registry.call,t.domain=((e={}).subdomain=r.endpoints.add.domain.subdomain.call,e),t}(),this.verify=function(){var e={};return e.domain=r.endpoints.verify.domain.call,e.subdomain=r.endpoints.verify.subdomain.call,e}(),this.assign=function(){var e,t={};return t.subdomain=((e={}).service=r.endpoints.assign.subdomain.service.call,e),t}(),this.unassign=function(){var e={};return e.subdomain=r.endpoints.unassign.subdomain.call,e}(),this.run=function(){var e={};return e.releaseFlow=r.endpoints.run.releaseFlow.call,e.template=r.endpoints.run.template.call,e}(),this.attach=function(){var e={};return e.volume=r.endpoints.attach.volume.call,e}(),this.detach=function(){var e={};return e.volume=r.endpoints.detach.volume.call,e}()};exports.AbortAddonBackupEndpoint=sc,exports.AbortAddonRestoreEndpoint=cc,exports.AbortJobBuildEndpoint=Kc,exports.AbortJobRunEndpoint=zc,exports.AbortReleaseflowrunEndpoint=Wl,exports.AbortServiceBuildEndpoint=kd,exports.AbortTemplaterunEndpoint=Jd,exports.AddDomainSubdomainEndpoint=Il,exports.AddRegistryEndpoint=gl,exports.ApiClient=up,exports.ApiClientContextProvider=ip,exports.ApiClientFileContextProvider=sp,exports.ApiClientInMemoryContextProvider=ap,exports.ApiEndpoint=gu,exports.AssignSubdomainServiceEndpoint=Ol,exports.AttachVolumeEndpoint=Kd,exports.BackupAddonEndpoint=Zu,exports.CreateAddonBackupscheduleEndpoint=dc,exports.CreateAddonEndpoint=Nu,exports.CreateClusterEndpoint=Ec,exports.CreateCustomvcsTokenEndpoint=Wd,exports.CreateDomainEndpoint=El,exports.CreateIntegrationEndpoint=gc,exports.CreateJobCronEndpoint=Rc,exports.CreateJobManualEndpoint=Uc,exports.CreateLogsinkEndpoint=pl,exports.CreateProjectEndpoint=Du,exports.CreateSecretEndpoint=$l,exports.CreateServiceBuildEndpoint=ld,exports.CreateServiceCombinedEndpoint=od,exports.CreateServiceDeploymentEndpoint=ad,exports.CreateTemplateEndpoint=Bd,exports.CreateVolumeEndpoint=$d,exports.DeleteAddonBackupscheduleEndpoint=pc,exports.DeleteAddonEndpoint=Fu,exports.DeleteApiEndpoint=_u,exports.DeleteBackupEndpoint=Xu,exports.DeleteClusterEndpoint=xc,exports.DeleteDomainEndpoint=Al,exports.DeleteIntegrationEndpoint=_c,exports.DeleteJobEndpoint=kc,exports.DeleteLogsinkEndpoint=fl,exports.DeleteProjectEndpoint=Bu,exports.DeleteRegistryEndpoint=jl,exports.DeleteSecretEndpoint=Kl,exports.DeleteSecretlinkEndpoint=nd,exports.DeleteServiceEndpoint=fd,exports.DeleteSubdomainEndpoint=kl,exports.DeleteTemplateEndpoint=Ld,exports.DeleteVolumeEndpoint=Zd,exports.DetachVolumeEndpoint=Xd,exports.ExecCommandStandard=hu,exports.GetAddonBackupDownloadEndpoint=uc,exports.GetAddonBackupEndpoint=Ku,exports.GetAddonBackupsEndpoint=Yu,exports.GetAddonBackupschedulesEndpoint=lc,exports.GetAddonContainersEndpoint=nc,exports.GetAddonCredentialsEndpoint=Ju,exports.GetAddonEndpoint=qu,exports.GetAddonPitrwindowEndpoint=hc,exports.GetAddonRestoresEndpoint=ec,exports.GetAddonTypesEndpoint=Mu,exports.GetAddonVersionEndpoint=Wu,exports.GetApiEndpoint=wu,exports.GetClusterEndpoint=Pc,exports.GetDnsidEndpoint=Tl,exports.GetDomainEndpoint=Pl,exports.GetIntegrationEndpoint=wc,exports.GetInvoiceDetailsEndpoint=mc,exports.GetJobBranchesEndpoint=cl,exports.GetJobBuildEndpoint=Zc,exports.GetJobBuildargumentdetailsEndpoint=nl,exports.GetJobBuildargumentsEndpoint=el,exports.GetJobBuildsEndpoint=Hc,exports.GetJobContainersEndpoint=ul,exports.GetJobDeploymentEndpoint=sl,exports.GetJobEndpoint=Cc,exports.GetJobHealthchecksEndpoint=Vc,exports.GetJobPullrequestsEndpoint=ll,exports.GetJobRunEndpoint=Mc,exports.GetJobRunsEndpoint=Fc,exports.GetJobRuntimeenvironmentEndpoint=rl,exports.GetJobRuntimeenvironmentdetailsEndpoint=il,exports.GetLogsinkEndpoint=hl,exports.GetPipelineEndpoint=ql,exports.GetProjectEndpoint=Ru,exports.GetRegistryEndpoint=wl,exports.GetReleaseflowEndpoint=Gl,exports.GetReleaseflowrunEndpoint=zl,exports.GetSecretEndpoint=Zl,exports.GetSecretdetailsEndpoint=Ql,exports.GetSecretlinkEndpoint=td,exports.GetServiceBranchesEndpoint=Od,exports.GetServiceBuildEndpoint=Cd,exports.GetServiceBuildargumentdetailsEndpoint=tp,exports.GetServiceBuildargumentsEndpoint=Qd,exports.GetServiceBuildsEndpoint=xd,exports.GetServiceContainersEndpoint=Ud,exports.GetServiceDeploymentEndpoint=md,exports.GetServiceEndpoint=hd,exports.GetServiceHealthchecksEndpoint=Pd,exports.GetServicePortsEndpoint=jd,exports.GetServicePullrequestsEndpoint=Dd,exports.GetServiceRuntimeenvironmentEndpoint=np,exports.GetServiceRuntimeenvironmentdetailsEndpoint=op,exports.GetSubdomainEndpoint=Cl,exports.GetTemplateEndpoint=Td,exports.GetTemplaterunEndpoint=Fd,exports.GetVolumeEndpoint=Hd,exports.ImportAddonBackupEndpoint=tc,exports.ListAddonsEndpoint=Tu,exports.ListBranchesEndpoint=zd,exports.ListClustersEndpoint=Sc,exports.ListDomainsEndpoint=Sl,exports.ListIntegrationsEndpoint=yc,exports.ListInvoicesEndpoint=vc,exports.ListJobsEndpoint=Ic,exports.ListLogsinksEndpoint=dl,exports.ListPipelinesEndpoint=Ll,exports.ListPlansEndpoint=Rl,exports.ListProjectsEndpoint=Ou,exports.ListProvidersEndpoint=bc,exports.ListRegionsEndpoint=Bl,exports.ListRegistriesEndpoint=yl,exports.ListReleaseflowrunsEndpoint=Ml,exports.ListReposEndpoint=Md,exports.ListSecretsEndpoint=Vl,exports.ListServicesEndpoint=rd,exports.ListTemplaterunsEndpoint=Gd,exports.ListTemplatesEndpoint=Rd,exports.ListVcsEndpoint=Nl,exports.ListVolumesEndpoint=Vd,exports.NorthflankApiCallError=vu,exports.NorthflankExecCommand=fu,exports.NorthflankLogFetch=Iu,exports.NorthflankMetricFetch=Uu,exports.NorthflankPortForwarder=du,exports.PatchAddonEndpoint=Gu,exports.PatchApiEndpoint=Eu,exports.PatchJobCronEndpoint=Tc,exports.PatchJobManualEndpoint=Dc,exports.PatchSecretEndpoint=Yl,exports.PatchServiceBuildEndpoint=pd,exports.PatchServiceCombinedEndpoint=sd,exports.PatchServiceDeploymentEndpoint=cd,exports.PauseAddonEndpoint=rc,exports.PauseJobEndpoint=qc,exports.PauseLogsinkEndpoint=ml,exports.PauseServiceEndpoint=gd,exports.PostApiEndpoint=ju,exports.PutAddonEndpoint=Lu,exports.PutApiEndpoint=Su,exports.PutJobCronEndpoint=Bc,exports.PutJobManualEndpoint=Oc,exports.PutSecretEndpoint=Hl,exports.PutServiceBuildEndpoint=dd,exports.PutServiceCombinedEndpoint=id,exports.PutServiceDeploymentEndpoint=ud,exports.RestartAddonEndpoint=ic,exports.RestartServiceEndpoint=yd,exports.RestoreAddonBackupEndpoint=Qu,exports.ResumeAddonEndpoint=oc,exports.ResumeJobEndpoint=Gc,exports.ResumeLogsinkEndpoint=bl,exports.ResumeServiceEndpoint=wd,exports.RetainAddonBackupEndpoint=ac,exports.RunReleaseflowEndpoint=Jl,exports.RunTemplateEndpoint=qd,exports.ScaleAddonEndpoint=zu,exports.ScaleJobEndpoint=Nc,exports.ScaleServiceEndpoint=vd,exports.StartAddonPitrEndpoint=fc,exports.StartJobBuildEndpoint=Yc,exports.StartJobRunEndpoint=Jc,exports.StartServiceBuildEndpoint=Id,exports.SuspendJobEndpoint=Lc,exports.UnassignSubdomainEndpoint=Dl,exports.UpdateAddonNetworksettingsEndpoint=$u,exports.UpdateAddonSecurityEndpoint=Hu,exports.UpdateAddonVersionEndpoint=Vu,exports.UpdateClusterEndpoint=Ac,exports.UpdateIntegrationEndpoint=jc,exports.UpdateJobBuildargumentsEndpoint=tl,exports.UpdateJobBuildoptionsEndpoint=Xc,exports.UpdateJobBuildsourceEndpoint=Qc,exports.UpdateJobDeploymentEndpoint=al,exports.UpdateJobHealthchecksEndpoint=$c,exports.UpdateJobRuntimeenvironmentEndpoint=ol,exports.UpdateJobSettingsEndpoint=Wc,exports.UpdateLogsinkEndpoint=vl,exports.UpdateRegistryEndpoint=_l,exports.UpdateReleaseflowEndpoint=Fl,exports.UpdateSecretEndpoint=Xl,exports.UpdateSecretlinkEndpoint=ed,exports.UpdateServiceBuildargumentsEndpoint=ep,exports.UpdateServiceBuildoptionsEndpoint=Sd,exports.UpdateServiceBuildsourceEndpoint=Ed,exports.UpdateServiceDeploymentEndpoint=bd,exports.UpdateServiceHealthchecksEndpoint=Ad,exports.UpdateServicePortsEndpoint=_d,exports.UpdateServiceRuntimeenvironmentEndpoint=rp,exports.UpdateTemplateEndpoint=Nd,exports.UpdateVolumeEndpoint=Yd,exports.VerifyDomainEndpoint=xl,exports.VerifySubdomainEndpoint=Ul;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("events"),t=require("stream"),n=require("http"),r=require("url"),o=require("punycode"),i=require("https"),s=require("zlib"),a=require("os"),u=require("net"),c=require("child_process"),l=require("fs"),d=require("path"),p=require("buffer"),h=require("tls"),f=require("crypto"),v=require("dgram");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function b(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var y=m(e),g=m(t),w=b(t),j=m(n),_=m(r),S=m(o),E=m(i),P=m(s),A=m(a),x=m(u),I=b(u),C=m(l),k=m(d),U=m(p),O=m(h),D=m(f),R=m(v),B=function(e,t){return B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},B(e,t)};function T(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var N=function(){return N=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},N.apply(this,arguments)};function L(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function q(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function G(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var F="object"==typeof global&&global&&global.Object===Object&&global,J="object"==typeof self&&self&&self.Object===Object&&self,M=F||J||Function("return this")(),z=M.Symbol,W=Object.prototype,V=W.hasOwnProperty,$=W.toString,H=z?z.toStringTag:void 0;var Y=Object.prototype.toString;var Z="[object Null]",K="[object Undefined]",X=z?z.toStringTag:void 0;function Q(e){return null==e?void 0===e?K:Z:X&&X in Object(e)?function(e){var t=V.call(e,H),n=e[H];try{e[H]=void 0;var r=!0}catch(e){}var o=$.call(e);return r&&(t?e[H]=n:delete e[H]),o}(e):function(e){return Y.call(e)}(e)}function ee(e){return null!=e&&"object"==typeof e}var te="[object Symbol]";function ne(e){return"symbol"==typeof e||ee(e)&&Q(e)==te}function re(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var oe=Array.isArray,ie=1/0,se=z?z.prototype:void 0,ae=se?se.toString:void 0;function ue(e){if("string"==typeof e)return e;if(oe(e))return re(e,ue)+"";if(ne(e))return ae?ae.call(e):"";var t=e+"";return"0"==t&&1/e==-ie?"-0":t}function ce(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function le(e){return e}var de="[object AsyncFunction]",pe="[object Function]",he="[object GeneratorFunction]",fe="[object Proxy]";function ve(e){if(!ce(e))return!1;var t=Q(e);return t==pe||t==he||t==de||t==fe}var me,be=M["__core-js_shared__"],ye=(me=/[^.]+$/.exec(be&&be.keys&&be.keys.IE_PROTO||""))?"Symbol(src)_1."+me:"";var ge=Function.prototype.toString;function we(e){if(null!=e){try{return ge.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var je=/^\[object .+?Constructor\]$/,_e=Function.prototype,Se=Object.prototype,Ee=_e.toString,Pe=Se.hasOwnProperty,Ae=RegExp("^"+Ee.call(Pe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xe(e){return!(!ce(e)||(t=e,ye&&ye in t))&&(ve(e)?Ae:je).test(we(e));var t}function Ie(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return xe(n)?n:void 0}var Ce=Ie(M,"WeakMap"),ke=Object.create,Ue=function(){function e(){}return function(t){if(!ce(t))return{};if(ke)return ke(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var Oe=Date.now;var De,Re,Be,Te=function(){try{var e=Ie(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ne=Te,Le=Ne?function(e,t){return Ne(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:le,qe=(De=Le,Re=0,Be=0,function(){var e=Oe(),t=16-(e-Be);if(Be=e,t>0){if(++Re>=800)return arguments[0]}else Re=0;return De.apply(void 0,arguments)}),Ge=9007199254740991,Fe=/^(?:0|[1-9]\d*)$/;function Je(e,t){var n=typeof e;return!!(t=null==t?Ge:t)&&("number"==n||"symbol"!=n&&Fe.test(e))&&e>-1&&e%1==0&&e<t}function Me(e,t,n){"__proto__"==t&&Ne?Ne(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ze(e,t){return e===t||e!=e&&t!=t}var We=Object.prototype.hasOwnProperty;function Ve(e,t,n){var r=e[t];We.call(e,t)&&ze(r,n)&&(void 0!==n||t in e)||Me(e,t,n)}var $e=Math.max;function He(e,t){return qe(function(e,t,n){return t=$e(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=$e(r.length-t,0),s=Array(i);++o<i;)s[o]=r[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=r[o];return a[t]=n(s),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,a)}}(e,t,le),e+"")}var Ye=9007199254740991;function Ze(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Ye}function Ke(e){return null!=e&&Ze(e.length)&&!ve(e)}var Xe=Object.prototype;function Qe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Xe)}function et(e){return ee(e)&&"[object Arguments]"==Q(e)}var tt=Object.prototype,nt=tt.hasOwnProperty,rt=tt.propertyIsEnumerable,ot=et(function(){return arguments}())?et:function(e){return ee(e)&&nt.call(e,"callee")&&!rt.call(e,"callee")};var it="object"==typeof exports&&exports&&!exports.nodeType&&exports,st=it&&"object"==typeof module&&module&&!module.nodeType&&module,at=st&&st.exports===it?M.Buffer:void 0,ut=(at?at.isBuffer:void 0)||function(){return!1},ct={};ct["[object Float32Array]"]=ct["[object Float64Array]"]=ct["[object Int8Array]"]=ct["[object Int16Array]"]=ct["[object Int32Array]"]=ct["[object Uint8Array]"]=ct["[object Uint8ClampedArray]"]=ct["[object Uint16Array]"]=ct["[object Uint32Array]"]=!0,ct["[object Arguments]"]=ct["[object Array]"]=ct["[object ArrayBuffer]"]=ct["[object Boolean]"]=ct["[object DataView]"]=ct["[object Date]"]=ct["[object Error]"]=ct["[object Function]"]=ct["[object Map]"]=ct["[object Number]"]=ct["[object Object]"]=ct["[object RegExp]"]=ct["[object Set]"]=ct["[object String]"]=ct["[object WeakMap]"]=!1;var lt="object"==typeof exports&&exports&&!exports.nodeType&&exports,dt=lt&&"object"==typeof module&&module&&!module.nodeType&&module,pt=dt&&dt.exports===lt&&F.process,ht=function(){try{var e=dt&&dt.require&&dt.require("util").types;return e||pt&&pt.binding&&pt.binding("util")}catch(e){}}(),ft=ht&&ht.isTypedArray,vt=ft?function(e){return function(t){return e(t)}}(ft):function(e){return ee(e)&&Ze(e.length)&&!!ct[Q(e)]},mt=vt,bt=Object.prototype.hasOwnProperty;function yt(e,t){var n=oe(e),r=!n&&ot(e),o=!n&&!r&&ut(e),i=!n&&!r&&!o&&mt(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],u=a.length;for(var c in e)!t&&!bt.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Je(c,u))||a.push(c);return a}function gt(e,t){return function(n){return e(t(n))}}var wt=gt(Object.keys,Object),jt=Object.prototype.hasOwnProperty;function _t(e){return Ke(e)?yt(e):function(e){if(!Qe(e))return wt(e);var t=[];for(var n in Object(e))jt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}var St=Object.prototype.hasOwnProperty;function Et(e){if(!ce(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Qe(e),n=[];for(var r in e)("constructor"!=r||!t&&St.call(e,r))&&n.push(r);return n}function Pt(e){return Ke(e)?yt(e,!0):Et(e)}var At=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xt=/^\w*$/;function It(e,t){if(oe(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ne(e))||(xt.test(e)||!At.test(e)||null!=t&&e in Object(t))}var Ct=Ie(Object,"create");var kt=Object.prototype.hasOwnProperty;var Ut=Object.prototype.hasOwnProperty;function Ot(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Dt(e,t){for(var n=e.length;n--;)if(ze(e[n][0],t))return n;return-1}Ot.prototype.clear=function(){this.__data__=Ct?Ct(null):{},this.size=0},Ot.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ot.prototype.get=function(e){var t=this.__data__;if(Ct){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return kt.call(t,e)?t[e]:void 0},Ot.prototype.has=function(e){var t=this.__data__;return Ct?void 0!==t[e]:Ut.call(t,e)},Ot.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ct&&void 0===t?"__lodash_hash_undefined__":t,this};var Rt=Array.prototype.splice;function Bt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bt.prototype.clear=function(){this.__data__=[],this.size=0},Bt.prototype.delete=function(e){var t=this.__data__,n=Dt(t,e);return!(n<0)&&(n==t.length-1?t.pop():Rt.call(t,n,1),--this.size,!0)},Bt.prototype.get=function(e){var t=this.__data__,n=Dt(t,e);return n<0?void 0:t[n][1]},Bt.prototype.has=function(e){return Dt(this.__data__,e)>-1},Bt.prototype.set=function(e,t){var n=this.__data__,r=Dt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Tt=Ie(M,"Map");function Nt(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Lt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Lt.prototype.clear=function(){this.size=0,this.__data__={hash:new Ot,map:new(Tt||Bt),string:new Ot}},Lt.prototype.delete=function(e){var t=Nt(this,e).delete(e);return this.size-=t?1:0,t},Lt.prototype.get=function(e){return Nt(this,e).get(e)},Lt.prototype.has=function(e){return Nt(this,e).has(e)},Lt.prototype.set=function(e,t){var n=Nt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var qt="Expected a function";function Gt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(qt);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Gt.Cache||Lt),n}Gt.Cache=Lt;var Ft=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jt=/\\(\\)?/g,Mt=function(e){var t=Gt(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ft,(function(e,n,r,o){t.push(r?o.replace(Jt,"$1"):n||e)})),t})),zt=Mt;function Wt(e){return null==e?"":ue(e)}function Vt(e,t){return oe(e)?e:It(e,t)?[e]:zt(Wt(e))}var $t=1/0;function Ht(e){if("string"==typeof e||ne(e))return e;var t=e+"";return"0"==t&&1/e==-$t?"-0":t}function Yt(e,t){for(var n=0,r=(t=Vt(t,e)).length;null!=e&&n<r;)e=e[Ht(t[n++])];return n&&n==r?e:void 0}function Zt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var Kt=z?z.isConcatSpreadable:void 0;function Xt(e){return oe(e)||ot(e)||!!(Kt&&e&&e[Kt])}function Qt(e,t,n,r,o){var i=-1,s=e.length;for(n||(n=Xt),o||(o=[]);++i<s;){var a=e[i];t>0&&n(a)?t>1?Qt(a,t-1,n,r,o):Zt(o,a):r||(o[o.length]=a)}return o}var en=gt(Object.getPrototypeOf,Object),tn="[object Object]",nn=Function.prototype,rn=Object.prototype,on=nn.toString,sn=rn.hasOwnProperty,an=on.call(Object);function un(e){var t=this.__data__=new Bt(e);this.size=t.size}un.prototype.clear=function(){this.__data__=new Bt,this.size=0},un.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},un.prototype.get=function(e){return this.__data__.get(e)},un.prototype.has=function(e){return this.__data__.has(e)},un.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Bt){var r=n.__data__;if(!Tt||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Lt(r)}return n.set(e,t),this.size=n.size,this};var cn="object"==typeof exports&&exports&&!exports.nodeType&&exports,ln=cn&&"object"==typeof module&&module&&!module.nodeType&&module,dn=ln&&ln.exports===cn?M.Buffer:void 0,pn=dn?dn.allocUnsafe:void 0;var hn=Object.prototype.propertyIsEnumerable,fn=Object.getOwnPropertySymbols,vn=fn?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}(fn(e),(function(t){return hn.call(e,t)})))}:function(){return[]};function mn(e){return function(e,t,n){var r=t(e);return oe(e)?r:Zt(r,n(e))}(e,_t,vn)}var bn=Ie(M,"DataView"),yn=Ie(M,"Promise"),gn=Ie(M,"Set"),wn="[object Map]",jn="[object Promise]",_n="[object Set]",Sn="[object WeakMap]",En="[object DataView]",Pn=we(bn),An=we(Tt),xn=we(yn),In=we(gn),Cn=we(Ce),kn=Q;(bn&&kn(new bn(new ArrayBuffer(1)))!=En||Tt&&kn(new Tt)!=wn||yn&&kn(yn.resolve())!=jn||gn&&kn(new gn)!=_n||Ce&&kn(new Ce)!=Sn)&&(kn=function(e){var t=Q(e),n="[object Object]"==t?e.constructor:void 0,r=n?we(n):"";if(r)switch(r){case Pn:return En;case An:return wn;case xn:return jn;case In:return _n;case Cn:return Sn}return t});var Un=kn,On=M.Uint8Array;function Dn(e,t){var n,r,o=t?(n=e.buffer,r=new n.constructor(n.byteLength),new On(r).set(new On(n)),r):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Lt;++t<n;)this.add(e[t])}function Bn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}Rn.prototype.add=Rn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Rn.prototype.has=function(e){return this.__data__.has(e)};var Tn=1,Nn=2;function Ln(e,t,n,r,o,i){var s=n&Tn,a=e.length,u=t.length;if(a!=u&&!(s&&u>a))return!1;var c=i.get(e),l=i.get(t);if(c&&l)return c==t&&l==e;var d=-1,p=!0,h=n&Nn?new Rn:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var f=e[d],v=t[d];if(r)var m=s?r(v,f,d,t,e,i):r(f,v,d,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!Bn(t,(function(e,t){if(s=t,!h.has(s)&&(f===e||o(f,e,n,r,i)))return h.push(t);var s}))){p=!1;break}}else if(f!==v&&!o(f,v,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function qn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Gn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Fn=1,Jn=2,Mn="[object Boolean]",zn="[object Date]",Wn="[object Error]",Vn="[object Map]",$n="[object Number]",Hn="[object RegExp]",Yn="[object Set]",Zn="[object String]",Kn="[object Symbol]",Xn="[object ArrayBuffer]",Qn="[object DataView]",er=z?z.prototype:void 0,tr=er?er.valueOf:void 0;var nr=1,rr=Object.prototype.hasOwnProperty;var or=1,ir="[object Arguments]",sr="[object Array]",ar="[object Object]",ur=Object.prototype.hasOwnProperty;function cr(e,t,n,r,o,i){var s=oe(e),a=oe(t),u=s?sr:Un(e),c=a?sr:Un(t),l=(u=u==ir?ar:u)==ar,d=(c=c==ir?ar:c)==ar,p=u==c;if(p&&ut(e)){if(!ut(t))return!1;s=!0,l=!1}if(p&&!l)return i||(i=new un),s||mt(e)?Ln(e,t,n,r,o,i):function(e,t,n,r,o,i,s){switch(n){case Qn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Xn:return!(e.byteLength!=t.byteLength||!i(new On(e),new On(t)));case Mn:case zn:case $n:return ze(+e,+t);case Wn:return e.name==t.name&&e.message==t.message;case Hn:case Zn:return e==t+"";case Vn:var a=qn;case Yn:var u=r&Fn;if(a||(a=Gn),e.size!=t.size&&!u)return!1;var c=s.get(e);if(c)return c==t;r|=Jn,s.set(e,t);var l=Ln(a(e),a(t),r,o,i,s);return s.delete(e),l;case Kn:if(tr)return tr.call(e)==tr.call(t)}return!1}(e,t,u,n,r,o,i);if(!(n&or)){var h=l&&ur.call(e,"__wrapped__"),f=d&&ur.call(t,"__wrapped__");if(h||f){var v=h?e.value():e,m=f?t.value():t;return i||(i=new un),o(v,m,n,r,i)}}return!!p&&(i||(i=new un),function(e,t,n,r,o,i){var s=n&nr,a=mn(e),u=a.length;if(u!=mn(t).length&&!s)return!1;for(var c=u;c--;){var l=a[c];if(!(s?l in t:rr.call(t,l)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var h=!0;i.set(e,t),i.set(t,e);for(var f=s;++c<u;){var v=e[l=a[c]],m=t[l];if(r)var b=s?r(m,v,l,t,e,i):r(v,m,l,e,t,i);if(!(void 0===b?v===m||o(v,m,n,r,i):b)){h=!1;break}f||(f="constructor"==l)}if(h&&!f){var y=e.constructor,g=t.constructor;y==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof g&&g instanceof g||(h=!1)}return i.delete(e),i.delete(t),h}(e,t,n,r,o,i))}function lr(e,t,n,r,o){return e===t||(null==e||null==t||!ee(e)&&!ee(t)?e!=e&&t!=t:cr(e,t,n,r,lr,o))}var dr=1,pr=2;function hr(e){return e==e&&!ce(e)}function fr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function vr(e){var t=function(e){for(var t=_t(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,hr(o)]}return t}(e);return 1==t.length&&t[0][2]?fr(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,s=!r;if(null==e)return!i;for(e=Object(e);o--;){var a=n[o];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<i;){var u=(a=n[o])[0],c=e[u],l=a[1];if(s&&a[2]){if(void 0===c&&!(u in e))return!1}else{var d=new un;if(r)var p=r(c,l,u,e,t,d);if(!(void 0===p?lr(l,c,dr|pr,r,d):p))return!1}}return!0}(n,e,t)}}function mr(e,t){return null!=e&&t in Object(e)}function br(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=Vt(t,e)).length,i=!1;++r<o;){var s=Ht(t[r]);if(!(i=null!=e&&n(e,s)))break;e=e[s]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&Ze(o)&&Je(s,o)&&(oe(e)||ot(e))}(e,t,mr)}var yr=1,gr=2;function wr(e,t){return It(e)&&hr(t)?fr(Ht(e),t):function(n){var r=function(e,t,n){var r=null==e?void 0:Yt(e,t);return void 0===r?n:r}(n,e);return void 0===r&&r===t?br(n,e):lr(t,r,yr|gr)}}function jr(e){return It(e)?(t=Ht(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Yt(t,e)}}(e);var t}function _r(e){return"function"==typeof e?e:null==e?le:"object"==typeof e?oe(e)?wr(e[0],e[1]):vr(e):jr(e)}var Sr,Er=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),s=i.length;s--;){var a=i[Sr?s:++r];if(!1===t(o[a],a,o))break}return e};var Pr=function(e,t){return function(n,r){if(null==n)return n;if(!Ke(n))return e(n,r);for(var o=n.length,i=t?o:-1,s=Object(n);(t?i--:++i<o)&&!1!==r(s[i],i,s););return n}}((function(e,t){return e&&Er(e,t,_t)})),Ar=Pr;function xr(e,t,n){(void 0!==n&&!ze(e[t],n)||void 0===n&&!(t in e))&&Me(e,t,n)}function Ir(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Cr(e){return function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,s=t.length;++i<s;){var a=t[i],u=r?r(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),o?Me(n,a,u):Ve(n,a,u)}return n}(e,Pt(e))}function kr(e,t,n,r,o,i,s){var a=Ir(e,n),u=Ir(t,n),c=s.get(u);if(c)xr(e,n,c);else{var l,d=i?i(a,u,n+"",e,t,s):void 0,p=void 0===d;if(p){var h=oe(u),f=!h&&ut(u),v=!h&&!f&&mt(u);d=u,h||f||v?oe(a)?d=a:ee(l=a)&&Ke(l)?d=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(a):f?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=pn?pn(n):new e.constructor(n);return e.copy(r),r}(u,!0)):v?(p=!1,d=Dn(u,!0)):d=[]:function(e){if(!ee(e)||Q(e)!=tn)return!1;var t=en(e);if(null===t)return!0;var n=sn.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&on.call(n)==an}(u)||ot(u)?(d=a,ot(a)?d=Cr(a):ce(a)&&!ve(a)||(d=function(e){return"function"!=typeof e.constructor||Qe(e)?{}:Ue(en(e))}(u))):p=!1}p&&(s.set(u,d),o(d,u,r,i,s),s.delete(u)),xr(e,n,d)}}function Ur(e,t,n,r,o){e!==t&&Er(t,(function(i,s){if(o||(o=new un),ce(i))kr(e,t,s,n,Ur,r,o);else{var a=r?r(Ir(e,s),i,s+"",e,t,o):void 0;void 0===a&&(a=i),xr(e,s,a)}}),Pt)}var Or=/[\\^$.*+?()[\]{}|]/g,Dr=RegExp(Or.source);function Rr(e,t){var n=-1,r=Ke(e)?Array(e.length):[];return Ar(e,(function(e,o,i){r[++n]=t(e,o,i)})),r}function Br(e,t){return Qt(function(e,t){return(oe(e)?re:Rr)(e,_r(t))}(e,t),1)}function Tr(e,t){return e>t}function Nr(e){return"string"==typeof e||!oe(e)&&ee(e)&&"[object String]"==Q(e)}function Lr(e,t){return e&&e.length?function(e,t,n){for(var r=-1,o=e.length;++r<o;){var i=e[r],s=t(i);if(null!=s&&(void 0===a?s==s&&!ne(s):n(s,a)))var a=s,u=i}return u}(e,_r(t),Tr):void 0}var qr,Gr=(qr=function(e,t,n){Ur(e,t,n)},He((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=qr.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!ce(n))return!1;var r=typeof t;return!!("number"==r?Ke(n)&&Je(t,n.length):"string"==r&&t in n)&&ze(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var s=t[n];s&&qr(e,s,n,o)}return e})));function Fr(e,t){return e(t={exports:{}},t.exports),t.exports}var Jr={},Mr=Jr;function zr(e){return e<0?-1:1}function Wr(e,t){t.unsigned||--e;const n=t.unsigned?0:-Math.pow(2,e),r=Math.pow(2,e)-1,o=t.moduloBitLength?Math.pow(2,t.moduloBitLength):Math.pow(2,e),i=t.moduloBitLength?Math.pow(2,t.moduloBitLength-1):Math.pow(2,e-1);return function(e,s){s||(s={});let a=+e;if(s.enforceRange){if(!Number.isFinite(a))throw new TypeError("Argument is not a finite number");if(a=zr(a)*Math.floor(Math.abs(a)),a<n||a>r)throw new TypeError("Argument is not in byte range");return a}if(!isNaN(a)&&s.clamp)return a=function(e){return e%1==.5&&0==(1&e)?Math.floor(e):Math.round(e)}(a),a<n&&(a=n),a>r&&(a=r),a;if(!Number.isFinite(a)||0===a)return 0;if(a=zr(a)*Math.floor(Math.abs(a)),a%=o,!t.unsigned&&a>=i)return a-o;if(t.unsigned)if(a<0)a+=o;else if(-0===a)return 0;return a}}Jr.void=function(){},Jr.boolean=function(e){return!!e},Jr.byte=Wr(8,{unsigned:!1}),Jr.octet=Wr(8,{unsigned:!0}),Jr.short=Wr(16,{unsigned:!1}),Jr["unsigned short"]=Wr(16,{unsigned:!0}),Jr.long=Wr(32,{unsigned:!1}),Jr["unsigned long"]=Wr(32,{unsigned:!0}),Jr["long long"]=Wr(32,{unsigned:!1,moduloBitLength:64}),Jr["unsigned long long"]=Wr(32,{unsigned:!0,moduloBitLength:64}),Jr.double=function(e){const t=+e;if(!Number.isFinite(t))throw new TypeError("Argument is not a finite floating-point value");return t},Jr["unrestricted double"]=function(e){const t=+e;if(isNaN(t))throw new TypeError("Argument is NaN");return t},Jr.float=Jr.double,Jr["unrestricted float"]=Jr["unrestricted double"],Jr.DOMString=function(e,t){return t||(t={}),t.treatNullAsEmptyString&&null===e?"":String(e)},Jr.ByteString=function(e,t){const n=String(e);let r;for(let e=0;void 0!==(r=n.codePointAt(e));++e)if(r>255)throw new TypeError("Argument is not a valid bytestring");return n},Jr.USVString=function(e){const t=String(e),n=t.length,r=[];for(let e=0;e<n;++e){const o=t.charCodeAt(e);if(o<55296||o>57343)r.push(String.fromCodePoint(o));else if(56320<=o&&o<=57343)r.push(String.fromCodePoint(65533));else if(e===n-1)r.push(String.fromCodePoint(65533));else{const n=t.charCodeAt(e+1);if(56320<=n&&n<=57343){const t=1023&o,i=1023&n;r.push(String.fromCodePoint(65536+1024*t+i)),++e}else r.push(String.fromCodePoint(65533))}}return r.join("")},Jr.Date=function(e,t){if(!(e instanceof Date))throw new TypeError("Argument is not a Date object");if(!isNaN(e))return e},Jr.RegExp=function(e,t){return e instanceof RegExp||(e=new RegExp(e)),e};var Vr=Fr((function(e){e.exports.mixin=function(e,t){const n=Object.getOwnPropertyNames(t);for(let r=0;r<n.length;++r)Object.defineProperty(e,n[r],Object.getOwnPropertyDescriptor(t,n[r]))},e.exports.wrapperSymbol=Symbol("wrapper"),e.exports.implSymbol=Symbol("impl"),e.exports.wrapperForImpl=function(t){return t[e.exports.wrapperSymbol]},e.exports.implForWrapper=function(t){return t[e.exports.implSymbol]}}));Vr.mixin,Vr.wrapperSymbol,Vr.implSymbol,Vr.wrapperForImpl,Vr.implForWrapper;var $r,Hr=($r=Object.freeze({__proto__:null}))&&$r.default||$r,Yr={TRANSITIONAL:0,NONTRANSITIONAL:1};function Zr(e){return e.split("\0").map((function(e){return e.normalize("NFC")})).join("\0")}function Kr(e){for(var t=0,n=Hr.length-1;t<=n;){var r=Math.floor((t+n)/2),o=Hr[r];if(o[0][0]<=e&&o[0][1]>=e)return o;o[0][0]>e?n=r-1:t=r+1}return null}var Xr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function Qr(e){return e.replace(Xr,"_").length}var eo=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;function to(e,t){"xn--"===e.substr(0,4)&&(e=S.default.toUnicode(e));var n=!1;(Zr(e)!==e||"-"===e[3]&&"-"===e[4]||"-"===e[0]||"-"===e[e.length-1]||-1!==e.indexOf(".")||0===e.search(eo))&&(n=!0);for(var r=Qr(e),o=0;o<r;++o){var i=Kr(e.codePointAt(o));if(no===Yr.TRANSITIONAL&&"valid"!==i[1]||no===Yr.NONTRANSITIONAL&&"valid"!==i[1]&&"deviation"!==i[1]){n=!0;break}}return{label:e,error:n}}function no(e,t,n){var r=function(e,t,n){for(var r=!1,o="",i=Qr(e),s=0;s<i;++s){var a=e.codePointAt(s),u=Kr(a);switch(u[1]){case"disallowed":r=!0,o+=String.fromCodePoint(a);break;case"ignored":break;case"mapped":o+=String.fromCodePoint.apply(String,u[2]);break;case"deviation":n===Yr.TRANSITIONAL?o+=String.fromCodePoint.apply(String,u[2]):o+=String.fromCodePoint(a);break;case"valid":o+=String.fromCodePoint(a);break;case"disallowed_STD3_mapped":t?(r=!0,o+=String.fromCodePoint(a)):o+=String.fromCodePoint.apply(String,u[2]);break;case"disallowed_STD3_valid":t&&(r=!0),o+=String.fromCodePoint(a)}}return{string:o,error:r}}(e,t,n);r.string=Zr(r.string);for(var o=r.string.split("."),i=0;i<o.length;++i)try{var s=to(o[i]);o[i]=s.label,r.error=r.error||s.error}catch(e){r.error=!0}return{string:o.join("."),error:r.error}}var ro={toASCII:function(e,t,n,r){var o=no(e,t,n),i=o.string.split(".");if(i=i.map((function(e){try{return S.default.toASCII(e)}catch(t){return o.error=!0,e}})),r){var s=i.slice(0,i.length-1).join(".").length;(s.length>253||0===s.length)&&(o.error=!0);for(var a=0;a<i.length;++a)if(i.length>63||0===i.length){o.error=!0;break}}return o.error?null:i.join(".")},toUnicode:function(e,t){var n=no(e,t,Yr.NONTRANSITIONAL);return{domain:n.string,error:n.error}},PROCESSING_OPTIONS:Yr},oo=Fr((function(e){const t={ftp:21,file:null,gopher:70,http:80,https:443,ws:80,wss:443},n=Symbol("failure");function r(e){return S.default.ucs2.decode(e).length}function o(e,t){const n=e[t];return isNaN(n)?void 0:String.fromCodePoint(n)}function i(e){return e>=48&&e<=57}function s(e){return e>=65&&e<=90||e>=97&&e<=122}function a(e){return i(e)||e>=65&&e<=70||e>=97&&e<=102}function u(e){return"."===e||"%2e"===e.toLowerCase()}function c(e){return 2===e.length&&s(e.codePointAt(0))&&(":"===e[1]||"|"===e[1])}function l(e){return void 0!==t[e]}function d(e){return l(e.scheme)}function p(e){let t=e.toString(16).toUpperCase();return 1===t.length&&(t="0"+t),"%"+t}function h(e){return e<=31||e>126}const f=new Set([32,34,35,60,62,63,96,123,125]);function v(e){return h(e)||f.has(e)}const m=new Set([47,58,59,61,64,91,92,93,94,124]);function b(e){return v(e)||m.has(e)}function y(e,t){const n=String.fromCodePoint(e);return t(e)?function(e){const t=new Buffer(e);let n="";for(let e=0;e<t.length;++e)n+=p(t[e]);return n}(n):n}function g(e){let t=10;if(e.length>=2&&"0"===e.charAt(0)&&"x"===e.charAt(1).toLowerCase()?(e=e.substring(2),t=16):e.length>=2&&"0"===e.charAt(0)&&(e=e.substring(1),t=8),""===e)return 0;return(10===t?/[^0-9]/:16===t?/[^0-9A-Fa-f]/:/[^0-7]/).test(e)?n:parseInt(e,t)}function w(e,t){if("["===e[0])return"]"!==e[e.length-1]?n:function(e){const t=[0,0,0,0,0,0,0,0];let r=0,s=null,u=0;if(58===(e=S.default.ucs2.decode(e))[u]){if(58!==e[u+1])return n;u+=2,++r,s=r}for(;u<e.length;){if(8===r)return n;if(58===e[u]){if(null!==s)return n;++u,++r,s=r;continue}let c=0,l=0;for(;l<4&&a(e[u]);)c=16*c+parseInt(o(e,u),16),++u,++l;if(46===e[u]){if(0===l)return n;if(u-=l,r>6)return n;let s=0;for(;void 0!==e[u];){let a=null;if(s>0){if(!(46===e[u]&&s<4))return n;++u}if(!i(e[u]))return n;for(;i(e[u]);){const t=parseInt(o(e,u));if(null===a)a=t;else{if(0===a)return n;a=10*a+t}if(a>255)return n;++u}t[r]=256*t[r]+a,++s,2!==s&&4!==s||++r}if(4!==s)return n;break}if(58===e[u]){if(++u,void 0===e[u])return n}else if(void 0!==e[u])return n;t[r]=c,++r}if(null!==s){let e=r-s;for(r=7;0!==r&&e>0;){const n=t[s+e-1];t[s+e-1]=t[r],t[r]=n,--r,--e}}else if(null===s&&8!==r)return n;return t}(e.substring(1,e.length-1));if(!t)return function(e){if(t=e,-1!==t.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/))return n;var t;let r="";const o=S.default.ucs2.decode(e);for(let e=0;e<o.length;++e)r+=y(o[e],h);return r}(e);const r=function(e){const t=new Buffer(e),n=[];for(let e=0;e<t.length;++e)37!==t[e]?n.push(t[e]):37===t[e]&&a(t[e+1])&&a(t[e+2])?(n.push(parseInt(t.slice(e+1,e+3).toString(),16)),e+=2):n.push(t[e]);return new Buffer(n).toString()}(e),s=ro.toASCII(r,!1,ro.PROCESSING_OPTIONS.NONTRANSITIONAL,!1);if(null===s)return n;if(-1!==s.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/))return n;const u=function(e){const t=e.split(".");if(""===t[t.length-1]&&t.length>1&&t.pop(),t.length>4)return e;const r=[];for(const o of t){if(""===o)return e;const t=g(o);if(t===n)return e;r.push(t)}for(let e=0;e<r.length-1;++e)if(r[e]>255)return n;if(r[r.length-1]>=Math.pow(256,5-r.length))return n;let o=r.pop(),i=0;for(const e of r)o+=e*Math.pow(256,3-i),++i;return o}(s);return"number"==typeof u||u===n?u:s}function j(e){return"number"==typeof e?function(e){let t="",n=e;for(let e=1;e<=4;++e)t=String(n%256)+t,4!==e&&(t="."+t),n=Math.floor(n/256);return t}(e):e instanceof Array?"["+function(e){let t="";const n=function(e){let t=null,n=1,r=null,o=0;for(let i=0;i<e.length;++i)0!==e[i]?(o>n&&(t=r,n=o),r=null,o=0):(null===r&&(r=i),++o);return o>n&&(t=r,n=o),{idx:t,len:n}}(e).idx;let r=!1;for(let o=0;o<=7;++o)r&&0===e[o]||(r&&(r=!1),n!==o?(t+=e[o].toString(16),7!==o&&(t+=":")):(t+=0===o?"::":":",r=!0));return t}(e)+"]":e}function _(e){const t=e.path;var n;0!==t.length&&("file"===e.scheme&&1===t.length&&(n=t[0],/^[A-Za-z]:$/.test(n))||t.pop())}function E(e){return""!==e.username||""!==e.password}function P(e,t,r,o,i){if(this.pointer=0,this.input=e,this.base=t||null,this.encodingOverride=r||"utf-8",this.stateOverride=i,this.url=o,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,cannotBeABaseURL:!1};const e=function(e){return e.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,"")}(this.input);e!==this.input&&(this.parseError=!0),this.input=e}const s=function(e){return e.replace(/\u0009|\u000A|\u000D/g,"")}(this.input);for(s!==this.input&&(this.parseError=!0),this.input=s,this.state=i||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=S.default.ucs2.decode(this.input);this.pointer<=this.input.length;++this.pointer){const e=this.input[this.pointer],t=isNaN(e)?void 0:String.fromCodePoint(e),r=this["parse "+this.state](e,t);if(!r)break;if(r===n){this.failure=!0;break}}}P.prototype["parse scheme start"]=function(e,t){if(s(e))this.buffer+=t.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,n;this.state="no scheme",--this.pointer}return!0},P.prototype["parse scheme"]=function(e,t){if(function(e){return s(e)||i(e)}(e)||43===e||45===e||46===e)this.buffer+=t.toLowerCase();else if(58===e){if(this.stateOverride){if(d(this.url)&&!l(this.buffer))return!1;if(!d(this.url)&&l(this.buffer))return!1;if((E(this.url)||null!==this.url.port)&&"file"===this.buffer)return!1;if("file"===this.url.scheme&&(""===this.url.host||null===this.url.host))return!1}if(this.url.scheme=this.buffer,this.buffer="",this.stateOverride)return!1;"file"===this.url.scheme?(47===this.input[this.pointer+1]&&47===this.input[this.pointer+2]||(this.parseError=!0),this.state="file"):d(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":d(this.url)?this.state="special authority slashes":47===this.input[this.pointer+1]?(this.state="path or authority",++this.pointer):(this.url.cannotBeABaseURL=!0,this.url.path.push(""),this.state="cannot-be-a-base-URL path")}else{if(this.stateOverride)return this.parseError=!0,n;this.buffer="",this.state="no scheme",this.pointer=-1}return!0},P.prototype["parse no scheme"]=function(e){return null===this.base||this.base.cannotBeABaseURL&&35!==e?n:(this.base.cannotBeABaseURL&&35===e?(this.url.scheme=this.base.scheme,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.url.cannotBeABaseURL=!0,this.state="fragment"):"file"===this.base.scheme?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},P.prototype["parse special relative or authority"]=function(e){return 47===e&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},P.prototype["parse path or authority"]=function(e){return 47===e?this.state="authority":(this.state="path",--this.pointer),!0},P.prototype["parse relative"]=function(e){return this.url.scheme=this.base.scheme,isNaN(e)?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query):47===e?this.state="relative slash":63===e?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===e?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):d(this.url)&&92===e?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(0,this.base.path.length-1),this.state="path",--this.pointer),!0},P.prototype["parse relative slash"]=function(e){return!d(this.url)||47!==e&&92!==e?47===e?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer):(92===e&&(this.parseError=!0),this.state="special authority ignore slashes"),!0},P.prototype["parse special authority slashes"]=function(e){return 47===e&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},P.prototype["parse special authority ignore slashes"]=function(e){return 47!==e&&92!==e?(this.state="authority",--this.pointer):this.parseError=!0,!0},P.prototype["parse authority"]=function(e,t){if(64===e){this.parseError=!0,this.atFlag&&(this.buffer="%40"+this.buffer),this.atFlag=!0;const e=r(this.buffer);for(let t=0;t<e;++t){const e=this.buffer.codePointAt(t);if(58===e&&!this.passwordTokenSeenFlag){this.passwordTokenSeenFlag=!0;continue}const n=y(e,b);this.passwordTokenSeenFlag?this.url.password+=n:this.url.username+=n}this.buffer=""}else if(isNaN(e)||47===e||63===e||35===e||d(this.url)&&92===e){if(this.atFlag&&""===this.buffer)return this.parseError=!0,n;this.pointer-=r(this.buffer)+1,this.buffer="",this.state="host"}else this.buffer+=t;return!0},P.prototype["parse hostname"]=P.prototype["parse host"]=function(e,t){if(this.stateOverride&&"file"===this.url.scheme)--this.pointer,this.state="file host";else if(58!==e||this.arrFlag)if(isNaN(e)||47===e||63===e||35===e||d(this.url)&&92===e){if(--this.pointer,d(this.url)&&""===this.buffer)return this.parseError=!0,n;if(this.stateOverride&&""===this.buffer&&(E(this.url)||null!==this.url.port))return this.parseError=!0,!1;const e=w(this.buffer,d(this.url));if(e===n)return n;if(this.url.host=e,this.buffer="",this.state="path start",this.stateOverride)return!1}else 91===e?this.arrFlag=!0:93===e&&(this.arrFlag=!1),this.buffer+=t;else{if(""===this.buffer)return this.parseError=!0,n;const e=w(this.buffer,d(this.url));if(e===n)return n;if(this.url.host=e,this.buffer="",this.state="port","hostname"===this.stateOverride)return!1}return!0},P.prototype["parse port"]=function(e,r){if(i(e))this.buffer+=r;else{if(!(isNaN(e)||47===e||63===e||35===e||d(this.url)&&92===e||this.stateOverride))return this.parseError=!0,n;if(""!==this.buffer){const e=parseInt(this.buffer);if(e>Math.pow(2,16)-1)return this.parseError=!0,n;this.url.port=e===(o=this.url.scheme,t[o])?null:e,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}var o;return!0};const A=new Set([47,92,63,35]);P.prototype["parse file"]=function(e){var t,n;return this.url.scheme="file",47===e||92===e?(92===e&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?isNaN(e)?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query):63===e?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===e?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):(this.input.length-this.pointer-1==0||(t=e,n=this.input[this.pointer+1],!s(t)||58!==n&&124!==n)||this.input.length-this.pointer-1>=2&&!A.has(this.input[this.pointer+2])?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),_(this.url)):this.parseError=!0,this.state="path",--this.pointer):(this.state="path",--this.pointer),!0},P.prototype["parse file slash"]=function(e){var t;return 47===e||92===e?(92===e&&(this.parseError=!0),this.state="file host"):(null!==this.base&&"file"===this.base.scheme&&(2===(t=this.base.path[0]).length&&s(t.codePointAt(0))&&":"===t[1]?this.url.path.push(this.base.path[0]):this.url.host=this.base.host),this.state="path",--this.pointer),!0},P.prototype["parse file host"]=function(e,t){if(isNaN(e)||47===e||92===e||63===e||35===e)if(--this.pointer,!this.stateOverride&&c(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let e=w(this.buffer,d(this.url));if(e===n)return n;if("localhost"===e&&(e=""),this.url.host=e,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=t;return!0},P.prototype["parse path start"]=function(e){return d(this.url)?(92===e&&(this.parseError=!0),this.state="path",47!==e&&92!==e&&--this.pointer):this.stateOverride||63!==e?this.stateOverride||35!==e?void 0!==e&&(this.state="path",47!==e&&--this.pointer):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},P.prototype["parse path"]=function(e){if(isNaN(e)||47===e||d(this.url)&&92===e||!this.stateOverride&&(63===e||35===e)){if(d(this.url)&&92===e&&(this.parseError=!0),!function(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e}(this.buffer)?!u(this.buffer)||47===e||d(this.url)&&92===e?u(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&c(this.buffer)&&(""!==this.url.host&&null!==this.url.host&&(this.parseError=!0,this.url.host=""),this.buffer=this.buffer[0]+":"),this.url.path.push(this.buffer)):this.url.path.push(""):(_(this.url),47===e||d(this.url)&&92===e||this.url.path.push("")),this.buffer="","file"===this.url.scheme&&(void 0===e||63===e||35===e))for(;this.url.path.length>1&&""===this.url.path[0];)this.parseError=!0,this.url.path.shift();63===e&&(this.url.query="",this.state="query"),35===e&&(this.url.fragment="",this.state="fragment")}else 37!==e||a(this.input[this.pointer+1])&&a(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=y(e,v);return!0},P.prototype["parse cannot-be-a-base-URL path"]=function(e){return 63===e?(this.url.query="",this.state="query"):35===e?(this.url.fragment="",this.state="fragment"):(isNaN(e)||37===e||(this.parseError=!0),37!==e||a(this.input[this.pointer+1])&&a(this.input[this.pointer+2])||(this.parseError=!0),isNaN(e)||(this.url.path[0]=this.url.path[0]+y(e,h))),!0},P.prototype["parse query"]=function(e,t){if(isNaN(e)||!this.stateOverride&&35===e){d(this.url)&&"ws"!==this.url.scheme&&"wss"!==this.url.scheme||(this.encodingOverride="utf-8");const t=new Buffer(this.buffer);for(let e=0;e<t.length;++e)t[e]<33||t[e]>126||34===t[e]||35===t[e]||60===t[e]||62===t[e]?this.url.query+=p(t[e]):this.url.query+=String.fromCodePoint(t[e]);this.buffer="",35===e&&(this.url.fragment="",this.state="fragment")}else 37!==e||a(this.input[this.pointer+1])&&a(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=t;return!0},P.prototype["parse fragment"]=function(e){return isNaN(e)||(0===e?this.parseError=!0:(37!==e||a(this.input[this.pointer+1])&&a(this.input[this.pointer+2])||(this.parseError=!0),this.url.fragment+=y(e,h))),!0},e.exports.serializeURL=function(e,t){let n=e.scheme+":";if(null!==e.host?(n+="//",""===e.username&&""===e.password||(n+=e.username,""!==e.password&&(n+=":"+e.password),n+="@"),n+=j(e.host),null!==e.port&&(n+=":"+e.port)):null===e.host&&"file"===e.scheme&&(n+="//"),e.cannotBeABaseURL)n+=e.path[0];else for(const t of e.path)n+="/"+t;return null!==e.query&&(n+="?"+e.query),t||null===e.fragment||(n+="#"+e.fragment),n},e.exports.serializeURLOrigin=function(t){switch(t.scheme){case"blob":try{return e.exports.serializeURLOrigin(e.exports.parseURL(t.path[0]))}catch(e){return"null"}case"ftp":case"gopher":case"http":case"https":case"ws":case"wss":return function(e){let t=e.scheme+"://";return t+=j(e.host),null!==e.port&&(t+=":"+e.port),t}({scheme:t.scheme,host:t.host,port:t.port});case"file":return"file://";default:return"null"}},e.exports.basicURLParse=function(e,t){void 0===t&&(t={});const n=new P(e,t.baseURL,t.encodingOverride,t.url,t.stateOverride);return n.failure?"failure":n.url},e.exports.setTheUsername=function(e,t){e.username="";const n=S.default.ucs2.decode(t);for(let t=0;t<n.length;++t)e.username+=y(n[t],b)},e.exports.setThePassword=function(e,t){e.password="";const n=S.default.ucs2.decode(t);for(let t=0;t<n.length;++t)e.password+=y(n[t],b)},e.exports.serializeHost=j,e.exports.cannotHaveAUsernamePasswordPort=function(e){return null===e.host||""===e.host||e.cannotBeABaseURL||"file"===e.scheme},e.exports.serializeInteger=function(e){return String(e)},e.exports.parseURL=function(t,n){return void 0===n&&(n={}),e.exports.basicURLParse(t,{baseURL:n.baseURL,encodingOverride:n.encodingOverride})}}));oo.serializeURL,oo.serializeURLOrigin,oo.basicURLParse,oo.setTheUsername,oo.setThePassword,oo.serializeHost,oo.cannotHaveAUsernamePasswordPort,oo.serializeInteger,oo.parseURL;var io=class{constructor(e){const t=e[0],n=e[1];let r=null;if(void 0!==n&&(r=oo.basicURLParse(n),"failure"===r))throw new TypeError("Invalid base URL");const o=oo.basicURLParse(t,{baseURL:r});if("failure"===o)throw new TypeError("Invalid URL");this._url=o}get href(){return oo.serializeURL(this._url)}set href(e){const t=oo.basicURLParse(e);if("failure"===t)throw new TypeError("Invalid URL");this._url=t}get origin(){return oo.serializeURLOrigin(this._url)}get protocol(){return this._url.scheme+":"}set protocol(e){oo.basicURLParse(e+":",{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(e){oo.cannotHaveAUsernamePasswordPort(this._url)||oo.setTheUsername(this._url,e)}get password(){return this._url.password}set password(e){oo.cannotHaveAUsernamePasswordPort(this._url)||oo.setThePassword(this._url,e)}get host(){const e=this._url;return null===e.host?"":null===e.port?oo.serializeHost(e.host):oo.serializeHost(e.host)+":"+oo.serializeInteger(e.port)}set host(e){this._url.cannotBeABaseURL||oo.basicURLParse(e,{url:this._url,stateOverride:"host"})}get hostname(){return null===this._url.host?"":oo.serializeHost(this._url.host)}set hostname(e){this._url.cannotBeABaseURL||oo.basicURLParse(e,{url:this._url,stateOverride:"hostname"})}get port(){return null===this._url.port?"":oo.serializeInteger(this._url.port)}set port(e){oo.cannotHaveAUsernamePasswordPort(this._url)||(""===e?this._url.port=null:oo.basicURLParse(e,{url:this._url,stateOverride:"port"}))}get pathname(){return this._url.cannotBeABaseURL?this._url.path[0]:0===this._url.path.length?"":"/"+this._url.path.join("/")}set pathname(e){this._url.cannotBeABaseURL||(this._url.path=[],oo.basicURLParse(e,{url:this._url,stateOverride:"path start"}))}get search(){return null===this._url.query||""===this._url.query?"":"?"+this._url.query}set search(e){const t=this._url;if(""===e)return void(t.query=null);const n="?"===e[0]?e.substring(1):e;t.query="",oo.basicURLParse(n,{url:t,stateOverride:"query"})}get hash(){return null===this._url.fragment||""===this._url.fragment?"":"#"+this._url.fragment}set hash(e){if(""===e)return void(this._url.fragment=null);const t="#"===e[0]?e.substring(1):e;this._url.fragment="",oo.basicURLParse(t,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}},so=Fr((function(e){const t=Vr.implSymbol;function n(r){if(!this||this[t]||!(this instanceof n))throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");if(arguments.length<1)throw new TypeError("Failed to construct 'URL': 1 argument required, but only "+arguments.length+" present.");const o=[];for(let e=0;e<arguments.length&&e<2;++e)o[e]=arguments[e];o[0]=Mr.USVString(o[0]),void 0!==o[1]&&(o[1]=Mr.USVString(o[1])),e.exports.setup(this,o)}n.prototype.toJSON=function(){if(!this||!e.exports.is(this))throw new TypeError("Illegal invocation");const n=[];for(let e=0;e<arguments.length&&e<0;++e)n[e]=arguments[e];return this[t].toJSON.apply(this[t],n)},Object.defineProperty(n.prototype,"href",{get(){return this[t].href},set(e){e=Mr.USVString(e),this[t].href=e},enumerable:!0,configurable:!0}),n.prototype.toString=function(){if(!this||!e.exports.is(this))throw new TypeError("Illegal invocation");return this.href},Object.defineProperty(n.prototype,"origin",{get(){return this[t].origin},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"protocol",{get(){return this[t].protocol},set(e){e=Mr.USVString(e),this[t].protocol=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"username",{get(){return this[t].username},set(e){e=Mr.USVString(e),this[t].username=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"password",{get(){return this[t].password},set(e){e=Mr.USVString(e),this[t].password=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"host",{get(){return this[t].host},set(e){e=Mr.USVString(e),this[t].host=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hostname",{get(){return this[t].hostname},set(e){e=Mr.USVString(e),this[t].hostname=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"port",{get(){return this[t].port},set(e){e=Mr.USVString(e),this[t].port=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pathname",{get(){return this[t].pathname},set(e){e=Mr.USVString(e),this[t].pathname=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"search",{get(){return this[t].search},set(e){e=Mr.USVString(e),this[t].search=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hash",{get(){return this[t].hash},set(e){e=Mr.USVString(e),this[t].hash=e},enumerable:!0,configurable:!0}),e.exports={is:e=>!!e&&e[t]instanceof io,create(e,t){let r=Object.create(n.prototype);return this.setup(r,e,t),r},setup(e,n,r){r||(r={}),r.wrapper=e,e[t]=new io(n,r),e[t][Vr.wrapperSymbol]=e},interface:n,expose:{Window:{URL:n},Worker:{URL:n}}}}));so.is,so.create,so.setup,so.expose;var ao={URL:so.interface,serializeURL:oo.serializeURL,serializeURLOrigin:oo.serializeURLOrigin,basicURLParse:oo.basicURLParse,setTheUsername:oo.setTheUsername,setThePassword:oo.setThePassword,serializeHost:oo.serializeHost,serializeInteger:oo.serializeInteger,parseURL:oo.parseURL};const uo=g.default.Readable,co=Symbol("buffer"),lo=Symbol("type");class po{constructor(){this[lo]="";const e=arguments[0],t=arguments[1],n=[];let r=0;if(e){const t=e,o=Number(t.length);for(let e=0;e<o;e++){const o=t[e];let i;i=o instanceof Buffer?o:ArrayBuffer.isView(o)?Buffer.from(o.buffer,o.byteOffset,o.byteLength):o instanceof ArrayBuffer?Buffer.from(o):o instanceof po?o[co]:Buffer.from("string"==typeof o?o:String(o)),r+=i.length,n.push(i)}}this[co]=Buffer.concat(n);let o=t&&void 0!==t.type&&String(t.type).toLowerCase();o&&!/[^\u0020-\u007E]/.test(o)&&(this[lo]=o)}get size(){return this[co].length}get type(){return this[lo]}text(){return Promise.resolve(this[co].toString())}arrayBuffer(){const e=this[co],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new uo;return e._read=function(){},e.push(this[co]),e.push(null),e}toString(){return"[object Blob]"}slice(){const e=this.size,t=arguments[0],n=arguments[1];let r,o;r=void 0===t?0:t<0?Math.max(e+t,0):Math.min(t,e),o=void 0===n?e:n<0?Math.max(e+n,0):Math.min(n,e);const i=Math.max(o-r,0),s=this[co].slice(r,r+i),a=new po([],{type:arguments[2]});return a[co]=s,a}}function ho(e,t,n){Error.call(this,e),this.message=e,this.type=t,n&&(this.code=this.errno=n.code),Error.captureStackTrace(this,this.constructor)}let fo;Object.defineProperties(po.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(po.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),ho.prototype=Object.create(Error.prototype),ho.prototype.constructor=ho,ho.prototype.name="FetchError";try{fo=require("encoding").convert}catch(e){}const vo=Symbol("Body internals"),mo=g.default.PassThrough;function bo(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.size;let o=void 0===r?0:r;var i=n.timeout;let s=void 0===i?0:i;null==e?e=null:go(e)?e=Buffer.from(e.toString()):wo(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof g.default||(e=Buffer.from(String(e)))),this[vo]={body:e,disturbed:!1,error:null},this.size=o,this.timeout=s,e instanceof g.default&&e.on("error",(function(e){const n="AbortError"===e.name?e:new ho(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[vo].error=n}))}function yo(){var e=this;if(this[vo].disturbed)return bo.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[vo].disturbed=!0,this[vo].error)return bo.Promise.reject(this[vo].error);let t=this.body;if(null===t)return bo.Promise.resolve(Buffer.alloc(0));if(wo(t)&&(t=t.stream()),Buffer.isBuffer(t))return bo.Promise.resolve(t);if(!(t instanceof g.default))return bo.Promise.resolve(Buffer.alloc(0));let n=[],r=0,o=!1;return new bo.Promise((function(i,s){let a;e.timeout&&(a=setTimeout((function(){o=!0,s(new ho(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(o=!0,s(t)):s(new ho(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!o&&null!==t){if(e.size&&r+t.length>e.size)return o=!0,void s(new ho(`content size at ${e.url} over limit: ${e.size}`,"max-size"));r+=t.length,n.push(t)}})),t.on("end",(function(){if(!o){clearTimeout(a);try{i(Buffer.concat(n,r))}catch(t){s(new ho(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function go(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function wo(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function jo(e){let t,n,r=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return r instanceof g.default&&"function"!=typeof r.getBoundary&&(t=new mo,n=new mo,r.pipe(t),r.pipe(n),e[vo].body=t,r=n),r}function _o(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":go(e)?"application/x-www-form-urlencoded;charset=UTF-8":wo(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof g.default?null:"text/plain;charset=UTF-8"}function So(e){const t=e.body;return null===t?0:wo(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}bo.prototype={get body(){return this[vo].body},get bodyUsed(){return this[vo].disturbed},arrayBuffer(){return yo.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return yo.call(this).then((function(t){return Object.assign(new po([],{type:e.toLowerCase()}),{[co]:t})}))},json(){var e=this;return yo.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return bo.Promise.reject(new ho(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return yo.call(this).then((function(e){return e.toString()}))},buffer(){return yo.call(this)},textConverted(){var e=this;return yo.call(this).then((function(t){return function(e,t){if("function"!=typeof fo)throw new Error("The package `encoding` must be installed to use the textConverted() function");const n=t.get("content-type");let r,o,i="utf-8";n&&(r=/charset=([^;]*)/i.exec(n));o=e.slice(0,1024).toString(),!r&&o&&(r=/<meta.+?charset=(['"])(.+?)\1/i.exec(o));!r&&o&&(r=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(o),r||(r=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(o),r&&r.pop()),r&&(r=/charset=(.*)/i.exec(r.pop())));!r&&o&&(r=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(o));r&&(i=r.pop(),"gb2312"!==i&&"gbk"!==i||(i="gb18030"));return fo(e,"UTF-8",i).toString()}(t,e.headers)}))}},Object.defineProperties(bo.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),bo.mixIn=function(e){for(const t of Object.getOwnPropertyNames(bo.prototype))if(!(t in e)){const n=Object.getOwnPropertyDescriptor(bo.prototype,t);Object.defineProperty(e,t,n)}},bo.Promise=global.Promise;const Eo=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,Po=/[^\t\x20-\x7e\x80-\xff]/;function Ao(e){if(e=`${e}`,Eo.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function xo(e){if(e=`${e}`,Po.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function Io(e,t){t=t.toLowerCase();for(const n in e)if(n.toLowerCase()===t)return n}const Co=Symbol("map");class ko{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[Co]=Object.create(null),e instanceof ko){const t=e.raw(),n=Object.keys(t);for(const e of n)for(const n of t[e])this.append(e,n)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const n=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");n.push(Array.from(t))}for(const e of n){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const n=e[t];this.append(t,n)}}}}get(e){Ao(e=`${e}`);const t=Io(this[Co],e);return void 0===t?null:this[Co][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=Uo(this),r=0;for(;r<n.length;){var o=n[r];const i=o[0],s=o[1];e.call(t,s,i,this),n=Uo(this),r++}}set(e,t){t=`${t}`,Ao(e=`${e}`),xo(t);const n=Io(this[Co],e);this[Co][void 0!==n?n:e]=[t]}append(e,t){t=`${t}`,Ao(e=`${e}`),xo(t);const n=Io(this[Co],e);void 0!==n?this[Co][n].push(t):this[Co][e]=[t]}has(e){return Ao(e=`${e}`),void 0!==Io(this[Co],e)}delete(e){Ao(e=`${e}`);const t=Io(this[Co],e);void 0!==t&&delete this[Co][t]}raw(){return this[Co]}keys(){return Do(this,"key")}values(){return Do(this,"value")}[Symbol.iterator](){return Do(this,"key+value")}}function Uo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[Co]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[Co][t].join(", ")}:function(t){return[t.toLowerCase(),e[Co][t].join(", ")]})}ko.prototype.entries=ko.prototype[Symbol.iterator],Object.defineProperty(ko.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(ko.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const Oo=Symbol("internal");function Do(e,t){const n=Object.create(Ro);return n[Oo]={target:e,kind:t,index:0},n}const Ro=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==Ro)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[Oo];const t=e.target,n=e.kind,r=e.index,o=Uo(t,n);return r>=o.length?{value:void 0,done:!0}:(this[Oo].index=r+1,{value:o[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function Bo(e){const t=Object.assign({__proto__:null},e[Co]),n=Io(e[Co],"Host");return void 0!==n&&(t[n]=t[n][0]),t}Object.defineProperty(Ro,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const To=Symbol("Response internals"),No=j.default.STATUS_CODES;class Lo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};bo.call(this,e,t);const n=t.status||200,r=new ko(t.headers);if(null!=e&&!r.has("Content-Type")){const t=_o(e);t&&r.append("Content-Type",t)}this[To]={url:t.url,status:n,statusText:t.statusText||No[n],headers:r,counter:t.counter}}get url(){return this[To].url||""}get status(){return this[To].status}get ok(){return this[To].status>=200&&this[To].status<300}get redirected(){return this[To].counter>0}get statusText(){return this[To].statusText}get headers(){return this[To].headers}clone(){return new Lo(jo(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}bo.mixIn(Lo.prototype),Object.defineProperties(Lo.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(Lo.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const qo=Symbol("Request internals"),Go=_.default.URL||ao.URL,Fo=_.default.parse,Jo=_.default.format;function Mo(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(e)&&(e=new Go(e).toString()),Fo(e)}const zo="destroy"in g.default.Readable.prototype;function Wo(e){return"object"==typeof e&&"object"==typeof e[qo]}class Vo{constructor(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Wo(e)?t=Mo(e.url):(t=e&&e.href?Mo(e.href):Mo(`${e}`),e={});let r=n.method||e.method||"GET";if(r=r.toUpperCase(),(null!=n.body||Wo(e)&&null!==e.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let o=null!=n.body?n.body:Wo(e)&&null!==e.body?jo(e):null;bo.call(this,o,{timeout:n.timeout||e.timeout||0,size:n.size||e.size||0});const i=new ko(n.headers||e.headers||{});if(null!=o&&!i.has("Content-Type")){const e=_o(o);e&&i.append("Content-Type",e)}let s=Wo(e)?e.signal:null;if("signal"in n&&(s=n.signal),null!=s&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[qo]={method:r,redirect:n.redirect||e.redirect||"follow",headers:i,parsedURL:t,signal:s},this.follow=void 0!==n.follow?n.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==n.compress?n.compress:void 0===e.compress||e.compress,this.counter=n.counter||e.counter||0,this.agent=n.agent||e.agent}get method(){return this[qo].method}get url(){return Jo(this[qo].parsedURL)}get headers(){return this[qo].headers}get redirect(){return this[qo].redirect}get signal(){return this[qo].signal}clone(){return new Vo(this)}}function $o(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}bo.mixIn(Vo.prototype),Object.defineProperty(Vo.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(Vo.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),$o.prototype=Object.create(Error.prototype),$o.prototype.constructor=$o,$o.prototype.name="AbortError";const Ho=_.default.URL||ao.URL,Yo=g.default.PassThrough;function Zo(e,t){if(!Zo.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return bo.Promise=Zo.Promise,new Zo.Promise((function(n,r){const o=new Vo(e,t),i=function(e){const t=e[qo].parsedURL,n=new ko(e[qo].headers);if(n.has("Accept")||n.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof g.default.Readable&&!zo)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let r=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(r="0"),null!=e.body){const t=So(e);"number"==typeof t&&(r=String(t))}r&&n.set("Content-Length",r),n.has("User-Agent")||n.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip,deflate");let o=e.agent;return"function"==typeof o&&(o=o(t)),n.has("Connection")||o||n.set("Connection","close"),Object.assign({},t,{method:e.method,headers:Bo(n),agent:o})}(o),s=("https:"===i.protocol?E.default:j.default).request,a=o.signal;let u=null;const c=function(){let e=new $o("The user aborted a request.");r(e),o.body&&o.body instanceof g.default.Readable&&Ko(o.body,e),u&&u.body&&u.body.emit("error",e)};if(a&&a.aborted)return void c();const l=function(){c(),h()},d=s(i);let p;function h(){d.abort(),a&&a.removeEventListener("abort",l),clearTimeout(p)}a&&a.addEventListener("abort",l),o.timeout&&d.once("socket",(function(e){p=setTimeout((function(){r(new ho(`network timeout at: ${o.url}`,"request-timeout")),h()}),o.timeout)})),d.on("error",(function(e){r(new ho(`request to ${o.url} failed, reason: ${e.message}`,"system",e)),u&&u.body&&Ko(u.body,e),h()})),function(e,t){let n;e.on("socket",(function(e){n=e})),e.on("response",(function(e){const r=e.headers;"chunked"!==r["transfer-encoding"]||r["content-length"]||e.once("close",(function(e){if(n.listenerCount("data")>0&&!e){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",t(e)}}))}))}(d,(function(e){a&&a.aborted||u&&u.body&&Ko(u.body,e)})),parseInt(process.version.substring(1))<14&&d.on("socket",(function(e){e.addListener("close",(function(t){const n=e.listenerCount("data")>0;if(u&&n&&!t&&(!a||!a.aborted)){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",u.body.emit("error",e)}}))})),d.on("response",(function(e){clearTimeout(p);const t=function(e){const t=new ko;for(const n of Object.keys(e))if(!Eo.test(n))if(Array.isArray(e[n]))for(const r of e[n])Po.test(r)||(void 0===t[Co][n]?t[Co][n]=[r]:t[Co][n].push(r));else Po.test(e[n])||(t[Co][n]=[e[n]]);return t}(e.headers);if(Zo.isRedirect(e.statusCode)){const s=t.get("Location");let a=null;try{a=null===s?null:new Ho(s,o.url).toString()}catch(e){if("manual"!==o.redirect)return r(new ho(`uri requested responds with an invalid redirect URL: ${s}`,"invalid-redirect")),void h()}switch(o.redirect){case"error":return r(new ho(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),void h();case"manual":if(null!==a)try{t.set("Location",a)}catch(e){r(e)}break;case"follow":if(null===a)break;if(o.counter>=o.follow)return r(new ho(`maximum redirect reached at: ${o.url}`,"max-redirect")),void h();const s={headers:new ko(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:o.body,signal:o.signal,timeout:o.timeout,size:o.size};if(!function(e,t){const n=new Ho(t).hostname,r=new Ho(e).hostname;return n===r||"."===n[n.length-r.length-1]&&n.endsWith(r)}(o.url,a)||(i=o.url,new Ho(a).protocol!==new Ho(i).protocol))for(const e of["authorization","www-authenticate","cookie","cookie2"])s.headers.delete(e);return 303!==e.statusCode&&o.body&&null===So(o)?(r(new ho("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void h()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==o.method)||(s.method="GET",s.body=void 0,s.headers.delete("content-length")),n(Zo(new Vo(a,s))),void h())}}var i;e.once("end",(function(){a&&a.removeEventListener("abort",l)}));let s=e.pipe(new Yo);const c={url:o.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:o.size,timeout:o.timeout,counter:o.counter},d=t.get("Content-Encoding");if(!o.compress||"HEAD"===o.method||null===d||204===e.statusCode||304===e.statusCode)return u=new Lo(s,c),void n(u);const f={flush:P.default.Z_SYNC_FLUSH,finishFlush:P.default.Z_SYNC_FLUSH};if("gzip"==d||"x-gzip"==d)return s=s.pipe(P.default.createGunzip(f)),u=new Lo(s,c),void n(u);if("deflate"==d||"x-deflate"==d){const t=e.pipe(new Yo);return t.once("data",(function(e){s=8==(15&e[0])?s.pipe(P.default.createInflate()):s.pipe(P.default.createInflateRaw()),u=new Lo(s,c),n(u)})),void t.on("end",(function(){u||(u=new Lo(s,c),n(u))}))}if("br"==d&&"function"==typeof P.default.createBrotliDecompress)return s=s.pipe(P.default.createBrotliDecompress()),u=new Lo(s,c),void n(u);u=new Lo(s,c),n(u)})),function(e,t){const n=t.body;null===n?e.end():wo(n)?n.stream().pipe(e):Buffer.isBuffer(n)?(e.write(n),e.end()):n.pipe(e)}(d,o)}))}function Ko(e,t){e.destroy?e.destroy(t):(e.emit("error",t),e.end())}Zo.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},Zo.Promise=global.Promise;var Xo=function(){function e(e){this.contextProvider=e}return e.prototype.getServiceDetails=function(e,t){return L(this,void 0,void 0,(function(){return q(this,(function(n){return[2,this.fetch("".concat(this.contextProvider.getCurrentBaseUrl(),"/v1/port-forwarding/info/projects/").concat(e,"/services/").concat(t))]}))}))},e.prototype.getAddonDetails=function(e,t){return L(this,void 0,void 0,(function(){return q(this,(function(n){return[2,this.fetch("".concat(this.contextProvider.getCurrentBaseUrl(),"/v1/port-forwarding/info/projects/").concat(e,"/addons/").concat(t))]}))}))},e.prototype.fetch=function(e,t){return L(this,void 0,void 0,(function(){var n,r,o,i,s;return q(this,(function(a){switch(a.label){case 0:return n=Gr({},{headers:{Authorization:"Bearer ".concat(this.contextProvider.getCurrentToken()),"Content-Type":"application/json"}},N({},t)),[4,Zo(e,n)];case 1:return(r=a.sent()).ok?[3,3]:(o=Error.bind,s=(i=JSON).stringify,[4,r.json()]);case 2:throw new(o.apply(Error,[void 0,s.apply(i,[a.sent()])]));case 3:return[4,r.json()];case 4:return[2,a.sent()]}}))}))},e}(),Qo=function(e,t,n){return L(void 0,void 0,void 0,(function(){var r,o,i,s,a;return q(this,(function(u){switch(u.label){case 0:if(r=ni(t||"127.0.0.1"),(o=ni(n||"127.255.255.255"))<r)throw new Error("Invalid IP range");"darwin"===A.default.platform()&&(i=function(e){return L(void 0,void 0,void 0,(function(){var t;return q(this,(function(n){switch(n.label){case 0:return t="lo0 alias ".concat(e," up"),[4,ti.apply(void 0,t.split(" "))];case 1:return n.sent(),[2]}}))}))}),s=r,u.label=1;case 1:return s<=o?(a=ri(s),[4,ei(e,a)]):[3,6];case 2:return u.sent()?i?[4,i(a)]:[3,4]:[3,5];case 3:u.sent(),u.label=4;case 4:return[2,a];case 5:return s+=1,[3,1];case 6:throw new Error("Not possible to assign port '".concat(e,"' to an IP address on this machine. Please check if there is already a service running with this port which binds to the wildcard host address (0.0.0.0) and stop this service."))}}))}))},ei=function(e,t){return new Promise((function(n){var r=new u.Socket,o=!1;r.on("connect",(function(){o=!0,r.destroy()})),r.setTimeout(400),r.on("timeout",(function(){o=!1,r.destroy()})),r.on("error",(function(){o=!1})),r.on("close",(function(){n(!o)})),t?r.connect(e,t):r.connect(e)}))},ti=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return L(void 0,void 0,void 0,(function(){return q(this,(function(t){switch(t.label){case 0:return"/sbin/ifconfig",[4,oi("/sbin/ifconfig",e).resultPromise];case 1:return[2,t.sent()]}}))}))},ni=function(e){var t=e.split(".").reverse();if(4!==t.length)throw new Error("Invalid ip address: ".concat(e));for(var n=0,r=0;r<4;r+=1){var o=Number.parseInt(t[r],10);if(o<0||o>255)throw new Error("Invalid ip address: ".concat(e));n+=o<<8*r}return n},ri=function(e){if(!Number.isSafeInteger(e))throw new Error("Number is not an integer");if(e<0||e>4294967295)throw new Error("Number is out of range 0x0-0xffffffff");for(var t=[],n=0;n<4;n+=1)t.push(e>>8*n&255);return t.reverse().join(".")},oi=function(e,t,n){var r=c.spawn(e,t,N({windowsHide:!0},n)),o=new Promise((function(o,i){var s="",a="";(null===(null==n?void 0:n.stdio)||void 0===(null==n?void 0:n.stdio))&&(r.stdout&&r.stdout.on("data",(function(e){s+=e})),r.stderr&&r.stderr.on("data",(function(e){a+=e}))),r.on("close",(function(n){var r={code:n,stdout:s,stderr:a};if(0!==n){var u="Error during execution of command '".concat(e," ").concat(t.join(" "),"': ").concat(a);i({message:u,result:r})}else o(r)}))}));return{process:r,resultPromise:o}},ii=function(e,t,n){return L(void 0,void 0,void 0,(function(){var r,o;return q(this,(function(i){switch(i.label){case 0:return r=si(e,10),[4,C.default.promises.writeFile(r,t,n)];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,4,,6]),[4,C.default.promises.rename(r,e)];case 3:return i.sent(),[3,6];case 4:return o=i.sent(),[4,C.default.promises.unlink(r).catch((function(){}))];case 5:throw i.sent(),o;case 6:return[2]}}))}))},si=function(e,t){for(var n,r=k.default.dirname(e),o=k.default.basename(e),i=0;null===(n=i<t)||void 0===n||n;i+=1){var s=G([],Array(16),!0).map((function(){return Math.floor(16*Math.random()).toString(16)})).join(""),a=".".concat(s,".").concat(o),u=k.default.join(r,a);if(!C.default.existsSync(u))return u}throw new Error("Could not write file to file '".concat(e,"'."))},ai="win32"===process.platform?"\r\n":"\n",ui=function(){function e(e,t){this.nodes=e,this.config=t}return e.prototype.add=function(e,t,n){var r=this;if(0===t.length)return this;var o=this.findOrCreateEntry(e,n);return t.forEach((function(e){if(!o.hosts.find((function(t){return t.host===e}))){var t=1;0===o.hosts.length&&(t=r.config.indent-"".concat(o.ipPrefixWhitespace).concat(o.ip).length),o.hosts.push({whitespace:" ".repeat(t<1?1:t),host:e})}})),this},e.prototype.remove=function(e,t){var n=this;return this.findEntries(e).forEach((function(e){t.forEach((function(t){var r=e.hosts.findIndex((function(e){return e.host===t}));r<0||(0===r&&void 0!==e.hosts[1]&&(e.hosts[1].whitespace=e.hosts[0].whitespace),e.hosts.splice(r,1),0===e.hosts.length&&n.removeEntry(e))}))})),this},e.prototype.removeHosts=function(e){var t=this;vi(this.nodes,"entry").forEach((function(n){t.remove(n.ip,e)}))},e.prototype.removeIps=function(e){var t=this;return e.forEach((function(e){t.findEntries(e).forEach((function(e){return t.removeEntry(e)}))})),this},e.prototype.resolveHosts=function(e){return Br(this.findEntries(e),(function(e){return e.hosts.map((function(e){return e.host}))}))},e.prototype.resolveIps=function(e){return vi(this.nodes,"entry").filter((function(t){return t.hosts.some((function(t){return t.host===e}))})).map((function(e){return e.ip}))},e.prototype.toString=function(){return pi(this.nodes,this.config.eol)},e.prototype.removeEntry=function(e){var t,n="number"==typeof(t=e)||ee(t)&&"[object Number]"==Q(t)?e:this.nodes.findIndex((function(t){return t===e}));n<0||this.nodes.splice(n,1)},e.prototype.findEntries=function(e){return vi(this.nodes,"entry").filter((function(t){return t.ip===e}))},e.prototype.findOrCreateEntry=function(e,t){var n=this.findEntries(e)[0];if(n)return n;var r=this.makeEntry(e);if(t){var o=di(t),i=this.nodes.findIndex((function(e){return"comment"===e.type&&e.line===o}));if(i>=0)this.insertAt(i+1,r);else{var s="blank"!==this.nodes[this.nodes.length-1].type?[ci(),li(o),r]:[li(o),r];this.insertAt.apply(this,G([this.nodes.length],s,!1))}}else this.insertAt(this.nodes.length,r);return r},e.prototype.insertAt=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(t=this.nodes).splice.apply(t,G([e,0],n,!1))},e.prototype.makeEntry=function(e,t){var n=this.config.ipPrefixWhitespace;return N({type:"entry",ip:e,ipPrefixWhitespace:n,hosts:[]},t)},e.fromNodes=function(t,n){var r,o;return new e(t.filter((function(e){return"eol"!==e.type})),{eol:null!==(r=null==n?void 0:n.eol)&&void 0!==r?r:function(){var e,n=vi(t,"eol").map((function(e){return e.line}));return null!==(e=mi(n))&&void 0!==e?e:ai}(),indent:null!==(o=null==n?void 0:n.indent)&&void 0!==o?o:function(){var e,n=Br(vi(t,"entry"),(function(e){var t=e.ipPrefixWhitespace,n=e.ip,r=e.hosts[0];return r?["".concat(t).concat(n).concat(r.whitespace).length]:[]}));return null!==(e=mi(n))&&void 0!==e?e:17}(),ipPrefixWhitespace:""})},e.parse=function(e,t){return this.fromNodes(hi(e),t)},e}(),ci=function(){return{type:"blank",line:""}},li=function(e){return{type:"comment",line:di(e)}},di=function(e){return e.startsWith("#")?e:"# ".concat(e)},pi=function(e,t){var n=e.map((function(e){switch(e.type){case"entry":var t=e.hosts.map((function(e){var t=e.whitespace,n=e.host;return"".concat(t).concat(n)})).join("");return"".concat(e.ipPrefixWhitespace).concat(e.ip).concat(t);case"blank":case"comment":case"invalid":return e.line;default:return""}}));return n.join(null!=t?t:ai)},hi=function(e){return e.split(/(\r?\n)/).map((function(e){return function(e){return e.match(/^\s*#.*$/)}(e)?{type:"comment",line:e}:function(e){return e.match(/^(\r?\n)$/)}(e)?{type:"eol",line:e}:function(e){return e.match(/^\s*$/)}(e)?{type:"blank",line:e}:fi(e)}))},fi=function(e){var t=e.match(/^(\s*)(\S+)(.+)?$/);if(!t)return{type:"invalid",line:e};var n=t[1],r=t[2],o=t.slice(3),i=!1,s=Br(o.filter((function(e){return void 0!==e})),(function(e){var t=e.match(/(\s+)(\S+)/g);return t?t.map((function(e){var t=e.match(/^(\s+)(\S+)$/);t||(i=!0);var n=null!=t?t:[];return{whitespace:n[1],host:n[2]}})):(i=!0,[])}));return i?{type:"invalid",line:e}:{type:"entry",ipPrefixWhitespace:n,ip:r,hosts:s}},vi=function(e,t){return e.filter((function(e){return e.type===t}))},mi=function(e){var t=new Map;e.forEach((function(e){var n;t.set(e,(null!==(n=t.get(e))&&void 0!==n?n:0)+1)}));var n=Lr(Array.from(t.entries()),(function(e){return e[1]}));if(n)return n[0]},bi="win32"===process.platform?"C:/Windows/System32/drivers/etc/hosts":"/etc/hosts",yi=function(){function e(e){this.ast=ui.fromNodes([]);var t={writeMode:"atomic",hostsFile:bi};this.config=N(N({},t),e)}return e.prototype.add=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!Nr(e))throw new Error("Expected 'ip' to be a string, but got ".concat(typeof e,"."));return t.forEach((function(e){if(!Nr(e))throw new Error("Expected 'host' to be a string, but got ".concat(typeof e,"."))})),this.ast.add(e,t,this.config.header),this},e.prototype.remove=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!Nr(e))throw new Error("Expected 'ip' to be a string, but got ".concat(typeof e,"."));return t.forEach((function(e){if(!Nr(e))throw new Error("Expected 'host' to be a string, but got ".concat(typeof e,"."))})),this.ast.remove(e,t),this},e.prototype.removeHosts=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.forEach((function(e){if(!Nr(e))throw new Error("Expected 'host' to be a string, but got ".concat(typeof e,"."))})),this.ast.removeHosts(e),this},e.prototype.removeIps=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.forEach((function(e){if(!Nr(e))throw new Error("Expected 'ip' to be a string, but got ".concat(typeof e,"."))})),this.ast.removeIps(e),this},e.prototype.read=function(){return L(this,void 0,void 0,(function(){var e;return q(this,(function(t){switch(t.label){case 0:return[4,C.default.promises.readFile(this.config.hostsFile)];case 1:return e=t.sent(),this.ast=ui.parse(e.toString(),this.config),[2,this]}}))}))},e.prototype.write=function(e){return L(this,void 0,void 0,(function(){var t,n,r,o;return q(this,(function(i){switch(i.label){case 0:switch(t=N(N({},this.config),e),n=t.hostsFile,r=t.writeMode,o=this.ast.toString(),r){case void 0:case"atomic":return[3,1];case"standard":return[3,3];case"disabled":return[3,5]}return[3,5];case 1:return[4,ii(n,o)];case 2:case 4:return i.sent(),[3,6];case 3:return[4,C.default.promises.writeFile(n,o)];case 5:return[3,6];case 6:return[2,this]}}))}))},e.prototype.backup=function(e){return L(this,void 0,void 0,(function(){var t,n,r,o;return q(this,(function(i){switch(i.label){case 0:return C.default.existsSync(this.config.hostsFile)?(t=k.default.dirname(this.config.hostsFile),n=k.default.basename(this.config.hostsFile),r="".concat(n).concat(e.suffix),o=k.default.resolve(t,r),C.default.existsSync(o)&&!e.rewrite?[3,2]:[4,C.default.promises.copyFile(this.config.hostsFile,o)]):[2];case 1:i.sent(),i.label=2;case 2:return[2]}}))}))},e.load=function(t){return L(this,void 0,void 0,(function(){return q(this,(function(n){switch(n.label){case 0:return[4,new e(t).read()];case 1:return[2,n.sent()]}}))}))},e}(),gi=function(){function e(){this.previousPromise=Promise.resolve()}return e.prototype.enter=function(e){return L(this,void 0,void 0,(function(){var t;return q(this,(function(n){return t=this.previousPromise.then((function(){return e()})).catch((function(){return e()})),this.previousPromise=t,[2,t]}))}))},e}(),wi=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){r[e]=t[e]})),r;function r(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];var r=t.apply(this,e),o=e[e.length-1];return"function"==typeof r&&r!==o&&Object.keys(o).forEach((function(e){r[e]=o[e]})),r}};var ji=wi(Si),_i=wi(Ei);function Si(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function Ei(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}Si.proto=Si((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Si(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Ei(this)},configurable:!0})})),ji.strict=_i;var Pi=function(){},Ai=function(e,t,n){if("function"==typeof t)return Ai(e,null,t);t||(t={}),n=ji(n||Pi);var r=e._writableState,o=e._readableState,i=t.readable||!1!==t.readable&&e.readable,s=t.writable||!1!==t.writable&&e.writable,a=!1,u=function(){e.writable||c()},c=function(){s=!1,i||n.call(e)},l=function(){i=!1,s||n.call(e)},d=function(t){n.call(e,t?new Error("exited with error code: "+t):null)},p=function(t){n.call(e,t)},h=function(){process.nextTick(f)},f=function(){if(!a)return(!i||o&&o.ended&&!o.destroyed)&&(!s||r&&r.ended&&!r.destroyed)?void 0:n.call(e,new Error("premature close"))},v=function(){e.req.on("finish",c)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?s&&!r&&(e.on("end",u),e.on("close",u)):(e.on("complete",c),e.on("abort",h),e.req?v():e.on("request",v)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",d),e.on("end",l),e.on("finish",c),!1!==t.error&&e.on("error",p),e.on("close",h),function(){a=!0,e.removeListener("complete",c),e.removeListener("abort",h),e.removeListener("request",v),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("exit",d),e.removeListener("end",l),e.removeListener("error",p),e.removeListener("close",h)}},xi=Ai,Ii=function(){},Ci=/^v?\.0/.test(process.version),ki=function(e){return"function"==typeof e},Ui=function(e,t,n,r){r=ji(r);var o=!1;e.on("close",(function(){o=!0})),xi(e,{readable:t,writable:n},(function(e){if(e)return r(e);o=!0,r()}));var i=!1;return function(t){if(!o&&!i)return i=!0,function(e){return!!Ci&&!!C.default&&(e instanceof(C.default.ReadStream||Ii)||e instanceof(C.default.WriteStream||Ii))&&ki(e.close)}(e)?e.close(Ii):function(e){return e.setHeader&&ki(e.abort)}(e)?e.abort():ki(e.destroy)?e.destroy():void r(t||new Error("stream was destroyed"))}},Oi=function(e){e()},Di=function(e,t){return e.pipe(t)},Ri=function(){var e,t=Array.prototype.slice.call(arguments),n=ki(t[t.length-1]||Ii)&&t.pop()||Ii;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var r=t.map((function(o,i){var s=i<t.length-1;return Ui(o,s,i>0,(function(t){e||(e=t),t&&r.forEach(Oi),s||(r.forEach(Oi),n(e))}))}));return t.reduce(Di)};const{Duplex:Bi}=g.default;function Ti(e){e.emit("close")}function Ni(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Li(e){this.removeListener("error",Li),this.destroy(),0===this.listenerCount("error")&&this.emit("error",e)}var qi=function(e,t){let n=!0;const r=new Bi({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",(function(t,n){const o=!n&&r._readableState.objectMode?t.toString():t;r.push(o)||e.pause()})),e.once("error",(function(e){r.destroyed||(n=!1,r.destroy(e))})),e.once("close",(function(){r.destroyed||r.push(null)})),r._destroy=function(t,o){if(e.readyState===e.CLOSED)return o(t),void process.nextTick(Ti,r);let i=!1;e.once("error",(function(e){i=!0,o(e)})),e.once("close",(function(){i||o(t),process.nextTick(Ti,r)})),n&&e.terminate()},r._final=function(t){e.readyState!==e.CONNECTING?null!==e._socket&&(e._socket._writableState.finished?(t(),r._readableState.endEmitted&&r.destroy()):(e._socket.once("finish",(function(){t()})),e.close())):e.once("open",(function(){r._final(t)}))},r._read=function(){e.isPaused&&e.resume()},r._write=function(t,n,o){e.readyState!==e.CONNECTING?e.send(t,o):e.once("open",(function(){r._write(t,n,o)}))},r.on("end",Ni),r.on("error",Li),r},Gi={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}},Fi="function"==typeof __webpack_require__?__non_webpack_require__:function(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")},Ji=process.config&&process.config.variables||{},Mi=!!process.env.PREBUILDS_ONLY,zi=process.versions.modules,Wi=!(!process.versions||!process.versions.electron)||!!process.env.ELECTRON_RUN_AS_NODE||"undefined"!=typeof window&&window.process&&"renderer"===window.process.type?"electron":process.versions&&process.versions.nw?"node-webkit":"node",Vi=process.env.npm_config_arch||A.default.arch(),$i=process.env.npm_config_platform||A.default.platform(),Hi=process.env.LIBC||(function(e){return"linux"===e&&C.default.existsSync("/etc/alpine-release")}($i)?"musl":"glibc"),Yi=process.env.ARM_VERSION||("arm64"===Vi?"8":Ji.arm_version)||"",Zi=(process.versions.uv||"").split(".")[0],Ki=Xi;function Xi(e){return Fi(Xi.resolve(e))}function Qi(e){try{return C.default.readdirSync(e)}catch(e){return[]}}function es(e,t){var n=Qi(e).filter(t);return n[0]&&k.default.join(e,n[0])}function ts(e){return/\.node$/.test(e)}function ns(e){var t=e.split("-");if(2===t.length){var n=t[0],r=t[1].split("+");if(n&&r.length&&r.every(Boolean))return{name:e,platform:n,architectures:r}}}function rs(e,t){return function(n){return null!=n&&(n.platform===e&&n.architectures.includes(t))}}function os(e,t){return e.architectures.length-t.architectures.length}function is(e){var t=e.split("."),n={file:e,specificity:0};if("node"===t.pop()){for(var r=0;r<t.length;r++){var o=t[r];if("node"===o||"electron"===o||"node-webkit"===o)n.runtime=o;else if("napi"===o)n.napi=!0;else if("abi"===o.slice(0,3))n.abi=o.slice(3);else if("uv"===o.slice(0,2))n.uv=o.slice(2);else if("armv"===o.slice(0,4))n.armv=o.slice(4);else{if("glibc"!==o&&"musl"!==o)continue;n.libc=o}n.specificity++}return n}}function ss(e,t){return function(n){return null!=n&&(!(n.runtime!==e&&!function(e){return"node"===e.runtime&&e.napi}(n))&&(!(n.abi!==t&&!n.napi)&&((!n.uv||n.uv===Zi)&&((!n.armv||n.armv===Yi)&&(!n.libc||n.libc===Hi)))))}}function as(e){return function(t,n){return t.runtime!==n.runtime?t.runtime===e?-1:1:t.abi!==n.abi?t.abi?-1:1:t.specificity!==n.specificity?t.specificity>n.specificity?-1:1:0}}Xi.resolve=Xi.path=function(e){e=k.default.resolve(e||".");try{var t=Fi(k.default.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[t+"_PREBUILD"]&&(e=process.env[t+"_PREBUILD"])}catch(e){}if(!Mi){var n=es(k.default.join(e,"build/Release"),ts);if(n)return n;var r=es(k.default.join(e,"build/Debug"),ts);if(r)return r}var o=a(e);if(o)return o;var i=a(k.default.dirname(process.execPath));if(i)return i;var s=["platform="+$i,"arch="+Vi,"runtime="+Wi,"abi="+zi,"uv="+Zi,Yi?"armv="+Yi:"","libc="+Hi,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"","function"==typeof __webpack_require__?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+s+"\n loaded from: "+e+"\n");function a(e){var t=Qi(k.default.join(e,"prebuilds")).map(ns).filter(rs($i,Vi)).sort(os)[0];if(t){var n=k.default.join(e,"prebuilds",t.name),r=Qi(n).map(is).filter(ss(Wi,zi)).sort(as(Wi))[0];return r?k.default.join(n,r.file):void 0}}},Xi.parseTags=is,Xi.matchTags=ss,Xi.compareTags=as,Xi.parseTuple=ns,Xi.matchTuple=rs,Xi.compareTuples=os;var us=Fr((function(e){"function"==typeof process.addon?e.exports=process.addon.bind(process):e.exports=Ki}));var cs={mask:(e,t,n,r,o)=>{for(var i=0;i<o;i++)n[r+i]=e[i]^t[3&i]},unmask:(e,t)=>{const n=e.length;for(var r=0;r<n;r++)e[r]^=t[3&r]}},ls=Fr((function(e){try{e.exports=us(__dirname)}catch(t){e.exports=cs}})),ds=Fr((function(e){const{EMPTY_BUFFER:t}=Gi,n=Buffer[Symbol.species];function r(e,t,n,r,o){for(let i=0;i<o;i++)n[r+i]=e[i]^t[3&i]}function o(e,t){for(let n=0;n<e.length;n++)e[n]^=t[3&n]}if(e.exports={concat:function(e,r){if(0===e.length)return t;if(1===e.length)return e[0];const o=Buffer.allocUnsafe(r);let i=0;for(let t=0;t<e.length;t++){const n=e[t];o.set(n,i),i+=n.length}return i<r?new n(o.buffer,o.byteOffset,i):o},mask:r,toArrayBuffer:function(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)},toBuffer:function e(t){if(e.readOnly=!0,Buffer.isBuffer(t))return t;let r;return t instanceof ArrayBuffer?r=new n(t):ArrayBuffer.isView(t)?r=new n(t.buffer,t.byteOffset,t.byteLength):(r=Buffer.from(t),e.readOnly=!1),r},unmask:o},!process.env.WS_NO_BUFFER_UTIL)try{const t=ls;e.exports.mask=function(e,n,o,i,s){s<48?r(e,n,o,i,s):t.mask(e,n,o,i,s)},e.exports.unmask=function(e,n){e.length<32?o(e,n):t.unmask(e,n)}}catch(e){}}));ds.concat,ds.mask,ds.toArrayBuffer,ds.toBuffer,ds.unmask;const ps=Symbol("kDone"),hs=Symbol("kRun");var fs=class{constructor(e){this[ps]=()=>{this.pending--,this[hs]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[hs]()}[hs](){if(this.pending!==this.concurrency&&this.jobs.length){const e=this.jobs.shift();this.pending++,e(this[ps])}}};const{kStatusCode:vs}=Gi,ms=Buffer[Symbol.species],bs=Buffer.from([0,0,255,255]),ys=Symbol("permessage-deflate"),gs=Symbol("total-length"),ws=Symbol("callback"),js=Symbol("buffers"),_s=Symbol("error");let Ss;var Es=class{constructor(e,t,n){if(this._maxPayload=0|n,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!Ss){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;Ss=new fs(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const e=this._deflate[ws];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){const t=this._options,n=e.find((e=>!(!1===t.serverNoContextTakeover&&e.server_no_context_takeover||e.server_max_window_bits&&(!1===t.serverMaxWindowBits||"number"==typeof t.serverMaxWindowBits&&t.serverMaxWindowBits>e.server_max_window_bits)||"number"==typeof t.clientMaxWindowBits&&!e.client_max_window_bits)));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(n.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?n.client_max_window_bits=t.clientMaxWindowBits:!0!==n.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete n.client_max_window_bits,n}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(t.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(t.client_max_window_bits=this._options.clientMaxWindowBits);return t}normalizeParams(e){return e.forEach((e=>{Object.keys(e).forEach((t=>{let n=e[t];if(n.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(n=n[0],"client_max_window_bits"===t){if(!0!==n){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}else if("server_max_window_bits"===t){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==n)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}e[t]=n}))})),e}decompress(e,t,n){Ss.add((r=>{this._decompress(e,t,((e,t)=>{r(),n(e,t)}))}))}compress(e,t,n){Ss.add((r=>{this._compress(e,t,((e,t)=>{r(),n(e,t)}))}))}_decompress(e,t,n){const r=this._isServer?"client":"server";if(!this._inflate){const e=`${r}_max_window_bits`,t="number"!=typeof this.params[e]?P.default.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=P.default.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[ys]=this,this._inflate[gs]=0,this._inflate[js]=[],this._inflate.on("error",xs),this._inflate.on("data",As)}this._inflate[ws]=n,this._inflate.write(e),t&&this._inflate.write(bs),this._inflate.flush((()=>{const e=this._inflate[_s];if(e)return this._inflate.close(),this._inflate=null,void n(e);const o=ds.concat(this._inflate[js],this._inflate[gs]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[gs]=0,this._inflate[js]=[],t&&this.params[`${r}_no_context_takeover`]&&this._inflate.reset()),n(null,o)}))}_compress(e,t,n){const r=this._isServer?"server":"client";if(!this._deflate){const e=`${r}_max_window_bits`,t="number"!=typeof this.params[e]?P.default.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=P.default.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[gs]=0,this._deflate[js]=[],this._deflate.on("data",Ps)}this._deflate[ws]=n,this._deflate.write(e),this._deflate.flush(P.default.Z_SYNC_FLUSH,(()=>{if(!this._deflate)return;let e=ds.concat(this._deflate[js],this._deflate[gs]);t&&(e=new ms(e.buffer,e.byteOffset,e.length-4)),this._deflate[ws]=null,this._deflate[gs]=0,this._deflate[js]=[],t&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),n(null,e)}))}};function Ps(e){this[js].push(e),this[gs]+=e.length}function As(e){this[gs]+=e.length,this[ys]._maxPayload<1||this[gs]<=this[ys]._maxPayload?this[js].push(e):(this[_s]=new RangeError("Max payload size exceeded"),this[_s].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[_s][vs]=1009,this.removeListener("data",As),this.reset())}function xs(e){this[ys]._inflate=null,e[vs]=1007,this[ws](e)}var Is=function(e){const t=e.length;let n=0;for(;n<t;)if(0==(128&e[n]))n++;else if(192==(224&e[n])){if(n+1===t||128!=(192&e[n+1])||192==(254&e[n]))return!1;n+=2}else if(224==(240&e[n])){if(n+2>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||224===e[n]&&128==(224&e[n+1])||237===e[n]&&160==(224&e[n+1]))return!1;n+=3}else{if(240!=(248&e[n]))return!1;if(n+3>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||128!=(192&e[n+3])||240===e[n]&&128==(240&e[n+1])||244===e[n]&&e[n+1]>143||e[n]>244)return!1;n+=4}return!0},Cs=Fr((function(e){try{e.exports=us(__dirname)}catch(t){e.exports=Is}})),ks=Fr((function(e){const{isUtf8:t}=U.default;function n(e){const t=e.length;let n=0;for(;n<t;)if(0==(128&e[n]))n++;else if(192==(224&e[n])){if(n+1===t||128!=(192&e[n+1])||192==(254&e[n]))return!1;n+=2}else if(224==(240&e[n])){if(n+2>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||224===e[n]&&128==(224&e[n+1])||237===e[n]&&160==(224&e[n+1]))return!1;n+=3}else{if(240!=(248&e[n]))return!1;if(n+3>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||128!=(192&e[n+3])||240===e[n]&&128==(240&e[n+1])||244===e[n]&&e[n+1]>143||e[n]>244)return!1;n+=4}return!0}if(e.exports={isValidStatusCode:function(e){return e>=1e3&&e<=1014&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999},isValidUTF8:n,tokenChars:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0]},t)e.exports.isValidUTF8=function(e){return e.length<24?n(e):t(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{const t=Cs;e.exports.isValidUTF8=function(e){return e.length<32?n(e):t(e)}}catch(e){}}));ks.isValidStatusCode,ks.isValidUTF8,ks.tokenChars;const{Writable:Us}=g.default,{BINARY_TYPES:Os,EMPTY_BUFFER:Ds,kStatusCode:Rs,kWebSocket:Bs}=Gi,{concat:Ts,toArrayBuffer:Ns,unmask:Ls}=ds,{isValidStatusCode:qs,isValidUTF8:Gs}=ks,Fs=Buffer[Symbol.species];var Js=class extends Us{constructor(e={}){super(),this._binaryType=e.binaryType||Os[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=0|e.maxPayload,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Bs]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=0,this._loop=!1}_write(e,t,n){if(8===this._opcode&&0==this._state)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){const t=this._buffers[0];return this._buffers[0]=new Fs(t.buffer,t.byteOffset+e,t.length-e),new Fs(t.buffer,t.byteOffset,e)}const t=Buffer.allocUnsafe(e);do{const n=this._buffers[0],r=t.length-e;e>=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=new Fs(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){let t;this._loop=!0;do{switch(this._state){case 0:t=this.getInfo();break;case 1:t=this.getPayloadLength16();break;case 2:t=this.getPayloadLength64();break;case 3:this.getMask();break;case 4:t=this.getData(e);break;default:return void(this._loop=!1)}}while(this._loop);e(t)}getInfo(){if(this._bufferedBytes<2)return void(this._loop=!1);const e=this.consume(2);if(0!=(48&e[0]))return this._loop=!1,Ms(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");const t=64==(64&e[0]);if(t&&!this._extensions[Es.extensionName])return this._loop=!1,Ms(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=128==(128&e[0]),this._opcode=15&e[0],this._payloadLength=127&e[1],0===this._opcode){if(t)return this._loop=!1,Ms(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,Ms(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return this._loop=!1,Ms(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=t}else{if(!(this._opcode>7&&this._opcode<11))return this._loop=!1,Ms(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin)return this._loop=!1,Ms(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(t)return this._loop=!1,Ms(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125||8===this._opcode&&1===this._payloadLength)return this._loop=!1,Ms(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=128==(128&e[1]),this._isServer){if(!this._masked)return this._loop=!1,Ms(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,Ms(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(126===this._payloadLength)this._state=1;else{if(127!==this._payloadLength)return this.haveLength();this._state=2}}getPayloadLength16(){if(!(this._bufferedBytes<2))return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength();this._loop=!1}getPayloadLength64(){if(this._bufferedBytes<8)return void(this._loop=!1);const e=this.consume(8),t=e.readUInt32BE(0);return t>Math.pow(2,21)-1?(this._loop=!1,Ms(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=t*Math.pow(2,32)+e.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,Ms(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(e){let t=Ds;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength)return void(this._loop=!1);t=this.consume(this._payloadLength),this._masked&&0!=(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])&&Ls(t,this._mask)}return this._opcode>7?this.controlMessage(t):this._compressed?(this._state=5,void this.decompress(t,e)):(t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage())}decompress(e,t){this._extensions[Es.extensionName].decompress(e,this._fin,((e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return t(Ms(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(n)}const r=this.dataMessage();if(r)return t(r);this.startLoop(t)}))}dataMessage(){if(this._fin){const e=this._messageLength,t=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let n;n="nodebuffer"===this._binaryType?Ts(t,e):"arraybuffer"===this._binaryType?Ns(Ts(t,e)):t,this.emit("message",n,!0)}else{const n=Ts(t,e);if(!this._skipUTF8Validation&&!Gs(n))return this._loop=!1,Ms(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",n,!1)}}this._state=0}controlMessage(e){if(8===this._opcode)if(this._loop=!1,0===e.length)this.emit("conclude",1005,Ds),this.end();else{const t=e.readUInt16BE(0);if(!qs(t))return Ms(RangeError,`invalid status code ${t}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");const n=new Fs(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Gs(n))return Ms(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",t,n),this.end()}else 9===this._opcode?this.emit("ping",e):this.emit("pong",e);this._state=0}};function Ms(e,t,n,r,o){const i=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(i,Ms),i.code=o,i[Rs]=r,i}const{randomFillSync:zs}=D.default,{EMPTY_BUFFER:Ws}=Gi,{isValidStatusCode:Vs}=ks,{mask:$s,toBuffer:Hs}=ds,Ys=Symbol("kByteLength"),Zs=Buffer.alloc(4);class Ks{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){let n,r,o=!1,i=2,s=!1;t.mask&&(n=t.maskBuffer||Zs,t.generateMask?t.generateMask(n):zs(n,0,4),s=0==(n[0]|n[1]|n[2]|n[3]),i=6),"string"==typeof e?r=t.mask&&!s||void 0===t[Ys]?(e=Buffer.from(e)).length:t[Ys]:(r=e.length,o=t.mask&&t.readOnly&&!s);let a=r;r>=65536?(i+=8,a=127):r>125&&(i+=2,a=126);const u=Buffer.allocUnsafe(o?r+i:i);return u[0]=t.fin?128|t.opcode:t.opcode,t.rsv1&&(u[0]|=64),u[1]=a,126===a?u.writeUInt16BE(r,2):127===a&&(u[2]=u[3]=0,u.writeUIntBE(r,4,6)),t.mask?(u[1]|=128,u[i-4]=n[0],u[i-3]=n[1],u[i-2]=n[2],u[i-1]=n[3],s?[u,e]:o?($s(e,n,u,i,r),[u]):($s(e,n,e,0,r),[u,e])):[u,e]}close(e,t,n,r){let o;if(void 0===e)o=Ws;else{if("number"!=typeof e||!Vs(e))throw new TypeError("First argument must be a valid error code number");if(void 0!==t&&t.length){const n=Buffer.byteLength(t);if(n>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+n),o.writeUInt16BE(e,0),"string"==typeof t?o.write(t,2):o.set(t,2)}else o=Buffer.allocUnsafe(2),o.writeUInt16BE(e,0)}const i={[Ys]:o.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,o,!1,i,r]):this.sendFrame(Ks.frame(o,i),r)}ping(e,t,n){let r,o;if("string"==typeof e?(r=Buffer.byteLength(e),o=!1):(r=(e=Hs(e)).length,o=Hs.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");const i={[Ys]:r,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,i,n]):this.sendFrame(Ks.frame(e,i),n)}pong(e,t,n){let r,o;if("string"==typeof e?(r=Buffer.byteLength(e),o=!1):(r=(e=Hs(e)).length,o=Hs.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");const i={[Ys]:r,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,i,n]):this.sendFrame(Ks.frame(e,i),n)}send(e,t,n){const r=this._extensions[Es.extensionName];let o,i,s=t.binary?2:1,a=t.compress;if("string"==typeof e?(o=Buffer.byteLength(e),i=!1):(o=(e=Hs(e)).length,i=Hs.readOnly),this._firstFragment?(this._firstFragment=!1,a&&r&&r.params[r._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(a=o>=r._threshold),this._compress=a):(a=!1,s=0),t.fin&&(this._firstFragment=!0),r){const r={[Ys]:o,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:i,rsv1:a};this._deflating?this.enqueue([this.dispatch,e,this._compress,r,n]):this.dispatch(e,this._compress,r,n)}else this.sendFrame(Ks.frame(e,{[Ys]:o,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:i,rsv1:!1}),n)}dispatch(e,t,n,r){if(!t)return void this.sendFrame(Ks.frame(e,n),r);const o=this._extensions[Es.extensionName];this._bufferedBytes+=n[Ys],this._deflating=!0,o.compress(e,n.fin,((e,t)=>{if(this._socket.destroyed){const e=new Error("The socket was closed while data was being compressed");"function"==typeof r&&r(e);for(let t=0;t<this._queue.length;t++){const n=this._queue[t],r=n[n.length-1];"function"==typeof r&&r(e)}}else this._bufferedBytes-=n[Ys],this._deflating=!1,n.readOnly=!1,this.sendFrame(Ks.frame(t,n),r),this.dequeue()}))}dequeue(){for(;!this._deflating&&this._queue.length;){const e=this._queue.shift();this._bufferedBytes-=e[3][Ys],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][Ys],this._queue.push(e)}sendFrame(e,t){2===e.length?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}}var Xs=Ks;const{kForOnEventAttribute:Qs,kListener:ea}=Gi,ta=Symbol("kCode"),na=Symbol("kData"),ra=Symbol("kError"),oa=Symbol("kMessage"),ia=Symbol("kReason"),sa=Symbol("kTarget"),aa=Symbol("kType"),ua=Symbol("kWasClean");class ca{constructor(e){this[sa]=null,this[aa]=e}get target(){return this[sa]}get type(){return this[aa]}}Object.defineProperty(ca.prototype,"target",{enumerable:!0}),Object.defineProperty(ca.prototype,"type",{enumerable:!0});class la extends ca{constructor(e,t={}){super(e),this[ta]=void 0===t.code?0:t.code,this[ia]=void 0===t.reason?"":t.reason,this[ua]=void 0!==t.wasClean&&t.wasClean}get code(){return this[ta]}get reason(){return this[ia]}get wasClean(){return this[ua]}}Object.defineProperty(la.prototype,"code",{enumerable:!0}),Object.defineProperty(la.prototype,"reason",{enumerable:!0}),Object.defineProperty(la.prototype,"wasClean",{enumerable:!0});class da extends ca{constructor(e,t={}){super(e),this[ra]=void 0===t.error?null:t.error,this[oa]=void 0===t.message?"":t.message}get error(){return this[ra]}get message(){return this[oa]}}Object.defineProperty(da.prototype,"error",{enumerable:!0}),Object.defineProperty(da.prototype,"message",{enumerable:!0});class pa extends ca{constructor(e,t={}){super(e),this[na]=void 0===t.data?null:t.data}get data(){return this[na]}}Object.defineProperty(pa.prototype,"data",{enumerable:!0});const ha={addEventListener(e,t,n={}){for(const r of this.listeners(e))if(!n[Qs]&&r[ea]===t&&!r[Qs])return;let r;if("message"===e)r=function(e,n){const r=new pa("message",{data:n?e:e.toString()});r[sa]=this,va(t,this,r)};else if("close"===e)r=function(e,n){const r=new la("close",{code:e,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[sa]=this,va(t,this,r)};else if("error"===e)r=function(e){const n=new da("error",{error:e,message:e.message});n[sa]=this,va(t,this,n)};else{if("open"!==e)return;r=function(){const e=new ca("open");e[sa]=this,va(t,this,e)}}r[Qs]=!!n[Qs],r[ea]=t,n.once?this.once(e,r):this.on(e,r)},removeEventListener(e,t){for(const n of this.listeners(e))if(n[ea]===t&&!n[Qs]){this.removeListener(e,n);break}}};var fa={CloseEvent:la,ErrorEvent:da,Event:ca,EventTarget:ha,MessageEvent:pa};function va(e,t,n){"object"==typeof e&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}const{tokenChars:ma}=ks;function ba(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}var ya={format:function(e){return Object.keys(e).map((t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map((e=>[t].concat(Object.keys(e).map((t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map((e=>!0===e?t:`${t}=${e}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")},parse:function(e){const t=Object.create(null);let n,r,o=Object.create(null),i=!1,s=!1,a=!1,u=-1,c=-1,l=-1,d=0;for(;d<e.length;d++)if(c=e.charCodeAt(d),void 0===n)if(-1===l&&1===ma[c])-1===u&&(u=d);else if(0===d||32!==c&&9!==c){if(59!==c&&44!==c)throw new SyntaxError(`Unexpected character at index ${d}`);{if(-1===u)throw new SyntaxError(`Unexpected character at index ${d}`);-1===l&&(l=d);const r=e.slice(u,l);44===c?(ba(t,r,o),o=Object.create(null)):n=r,u=l=-1}}else-1===l&&-1!==u&&(l=d);else if(void 0===r)if(-1===l&&1===ma[c])-1===u&&(u=d);else if(32===c||9===c)-1===l&&-1!==u&&(l=d);else if(59===c||44===c){if(-1===u)throw new SyntaxError(`Unexpected character at index ${d}`);-1===l&&(l=d),ba(o,e.slice(u,l),!0),44===c&&(ba(t,n,o),o=Object.create(null),n=void 0),u=l=-1}else{if(61!==c||-1===u||-1!==l)throw new SyntaxError(`Unexpected character at index ${d}`);r=e.slice(u,d),u=l=-1}else if(s){if(1!==ma[c])throw new SyntaxError(`Unexpected character at index ${d}`);-1===u?u=d:i||(i=!0),s=!1}else if(a)if(1===ma[c])-1===u&&(u=d);else if(34===c&&-1!==u)a=!1,l=d;else{if(92!==c)throw new SyntaxError(`Unexpected character at index ${d}`);s=!0}else if(34===c&&61===e.charCodeAt(d-1))a=!0;else if(-1===l&&1===ma[c])-1===u&&(u=d);else if(-1===u||32!==c&&9!==c){if(59!==c&&44!==c)throw new SyntaxError(`Unexpected character at index ${d}`);{if(-1===u)throw new SyntaxError(`Unexpected character at index ${d}`);-1===l&&(l=d);let s=e.slice(u,l);i&&(s=s.replace(/\\/g,""),i=!1),ba(o,r,s),44===c&&(ba(t,n,o),o=Object.create(null),n=void 0),r=void 0,u=l=-1}}else-1===l&&(l=d);if(-1===u||a||32===c||9===c)throw new SyntaxError("Unexpected end of input");-1===l&&(l=d);const p=e.slice(u,l);return void 0===n?ba(t,p,o):(void 0===r?ba(o,p,!0):ba(o,r,i?p.replace(/\\/g,""):p),ba(t,n,o)),t}};const{randomBytes:ga,createHash:wa}=D.default,{URL:ja}=_.default,{BINARY_TYPES:_a,EMPTY_BUFFER:Sa,GUID:Ea,kForOnEventAttribute:Pa,kListener:Aa,kStatusCode:xa,kWebSocket:Ia,NOOP:Ca}=Gi,{EventTarget:{addEventListener:ka,removeEventListener:Ua}}=fa,{format:Oa,parse:Da}=ya,{toBuffer:Ra}=ds,Ba=Symbol("kAborted"),Ta=[8,13],Na=["CONNECTING","OPEN","CLOSING","CLOSED"],La=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class qa extends y.default{constructor(e,t,n){super(),this._binaryType=_a[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Sa,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=qa.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==e?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,void 0===t?t=[]:Array.isArray(t)||("object"==typeof t&&null!==t?(n=t,t=[]):t=[t]),Fa(this,e,t,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(e){_a.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){const r=new Js({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation});this._sender=new Xs(e,this._extensions,n.generateMask),this._receiver=r,this._socket=e,r[Ia]=this,e[Ia]=this,r.on("conclude",$a),r.on("drain",Ha),r.on("error",Ya),r.on("message",Ka),r.on("ping",Xa),r.on("pong",Qa),e.setTimeout(0),e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",tu),e.on("data",nu),e.on("end",ru),e.on("error",ou),this._readyState=qa.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this._readyState=qa.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[Es.extensionName]&&this._extensions[Es.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=qa.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==qa.CLOSED)if(this.readyState!==qa.CONNECTING)this.readyState!==qa.CLOSING?(this._readyState=qa.CLOSING,this._sender.close(e,t,!this._isServer,(e=>{e||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())})),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();else{const e="WebSocket was closed before the connection was established";Wa(this,this._req,e)}}pause(){this.readyState!==qa.CONNECTING&&this.readyState!==qa.CLOSED&&(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===qa.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===qa.OPEN?(void 0===t&&(t=!this._isServer),this._sender.ping(e||Sa,t,n)):Va(this,e,n)}pong(e,t,n){if(this.readyState===qa.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===qa.OPEN?(void 0===t&&(t=!this._isServer),this._sender.pong(e||Sa,t,n)):Va(this,e,n)}resume(){this.readyState!==qa.CONNECTING&&this.readyState!==qa.CLOSED&&(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===qa.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof t&&(n=t,t={}),"number"==typeof e&&(e=e.toString()),this.readyState!==qa.OPEN)return void Va(this,e,n);const r={binary:"string"!=typeof e,mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Es.extensionName]||(r.compress=!1),this._sender.send(e||Sa,r,n)}terminate(){if(this.readyState!==qa.CLOSED)if(this.readyState!==qa.CONNECTING)this._socket&&(this._readyState=qa.CLOSING,this._socket.destroy());else{const e="WebSocket was closed before the connection was established";Wa(this,this._req,e)}}}Object.defineProperty(qa,"CONNECTING",{enumerable:!0,value:Na.indexOf("CONNECTING")}),Object.defineProperty(qa.prototype,"CONNECTING",{enumerable:!0,value:Na.indexOf("CONNECTING")}),Object.defineProperty(qa,"OPEN",{enumerable:!0,value:Na.indexOf("OPEN")}),Object.defineProperty(qa.prototype,"OPEN",{enumerable:!0,value:Na.indexOf("OPEN")}),Object.defineProperty(qa,"CLOSING",{enumerable:!0,value:Na.indexOf("CLOSING")}),Object.defineProperty(qa.prototype,"CLOSING",{enumerable:!0,value:Na.indexOf("CLOSING")}),Object.defineProperty(qa,"CLOSED",{enumerable:!0,value:Na.indexOf("CLOSED")}),Object.defineProperty(qa.prototype,"CLOSED",{enumerable:!0,value:Na.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((e=>{Object.defineProperty(qa.prototype,e,{enumerable:!0})})),["open","error","close","message"].forEach((e=>{Object.defineProperty(qa.prototype,`on${e}`,{enumerable:!0,get(){for(const t of this.listeners(e))if(t[Pa])return t[Aa];return null},set(t){for(const t of this.listeners(e))if(t[Pa]){this.removeListener(e,t);break}"function"==typeof t&&this.addEventListener(e,t,{[Pa]:!0})}})})),qa.prototype.addEventListener=ka,qa.prototype.removeEventListener=Ua;var Ga=qa;function Fa(e,t,n,r){const o={protocolVersion:Ta[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(!Ta.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${Ta.join(", ")})`);let i;if(t instanceof ja)i=t,e._url=t.href;else{try{i=new ja(t)}catch(e){throw new SyntaxError(`Invalid URL: ${t}`)}e._url=t}const s="wss:"===i.protocol,a="ws+unix:"===i.protocol;let u;if("ws:"===i.protocol||s||a?a&&!i.pathname?u="The URL's pathname is empty":i.hash&&(u="The URL contains a fragment identifier"):u='The URL\'s protocol must be one of "ws:", "wss:", or "ws+unix:"',u){const t=new SyntaxError(u);if(0===e._redirects)throw t;return void Ja(e,t)}const c=s?443:80,l=ga(16).toString("base64"),d=s?E.default.request:j.default.request,p=new Set;let h,f;if(o.createConnection=s?za:Ma,o.defaultPort=o.defaultPort||c,o.port=i.port||c,o.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},o.path=i.pathname+i.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(h=new Es(!0!==o.perMessageDeflate?o.perMessageDeflate:{},!1,o.maxPayload),o.headers["Sec-WebSocket-Extensions"]=Oa({[Es.extensionName]:h.offer()})),n.length){for(const e of n){if("string"!=typeof e||!La.test(e)||p.has(e))throw new SyntaxError("An invalid or duplicated subprotocol was specified");p.add(e)}o.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(i.username||i.password)&&(o.auth=`${i.username}:${i.password}`),a){const e=o.path.split(":");o.socketPath=e[0],o.path=e[1]}if(o.followRedirects){if(0===e._redirects){e._originalIpc=a,e._originalSecure=s,e._originalHostOrSocketPath=a?o.socketPath:i.host;const t=r&&r.headers;if(r={...r,headers:{}},t)for(const[e,n]of Object.entries(t))r.headers[e.toLowerCase()]=n}else if(0===e.listenerCount("redirect")){const t=a?!!e._originalIpc&&o.socketPath===e._originalHostOrSocketPath:!e._originalIpc&&i.host===e._originalHostOrSocketPath;(!t||e._originalSecure&&!s)&&(delete o.headers.authorization,delete o.headers.cookie,t||delete o.headers.host,o.auth=void 0)}o.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),f=e._req=d(o),e._redirects&&e.emit("redirect",e.url,f)}else f=e._req=d(o);o.timeout&&f.on("timeout",(()=>{Wa(e,f,"Opening handshake has timed out")})),f.on("error",(t=>{null===f||f[Ba]||(f=e._req=null,Ja(e,t))})),f.on("response",(i=>{const s=i.headers.location,a=i.statusCode;if(s&&o.followRedirects&&a>=300&&a<400){if(++e._redirects>o.maxRedirects)return void Wa(e,f,"Maximum redirects exceeded");let i;f.abort();try{i=new ja(s,t)}catch(t){const n=new SyntaxError(`Invalid URL: ${s}`);return void Ja(e,n)}Fa(e,i,n,r)}else e.emit("unexpected-response",f,i)||Wa(e,f,`Unexpected server response: ${i.statusCode}`)})),f.on("upgrade",((t,n,r)=>{if(e.emit("upgrade",t),e.readyState!==qa.CONNECTING)return;if(f=e._req=null,"websocket"!==t.headers.upgrade.toLowerCase())return void Wa(e,n,"Invalid Upgrade header");const i=wa("sha1").update(l+Ea).digest("base64");if(t.headers["sec-websocket-accept"]!==i)return void Wa(e,n,"Invalid Sec-WebSocket-Accept header");const s=t.headers["sec-websocket-protocol"];let a;if(void 0!==s?p.size?p.has(s)||(a="Server sent an invalid subprotocol"):a="Server sent a subprotocol but none was requested":p.size&&(a="Server sent no subprotocol"),a)return void Wa(e,n,a);s&&(e._protocol=s);const u=t.headers["sec-websocket-extensions"];if(void 0!==u){if(!h){return void Wa(e,n,"Server sent a Sec-WebSocket-Extensions header but no extension was requested")}let t;try{t=Da(u)}catch(t){return void Wa(e,n,"Invalid Sec-WebSocket-Extensions header")}const r=Object.keys(t);if(1!==r.length||r[0]!==Es.extensionName){return void Wa(e,n,"Server indicated an extension that was not requested")}try{h.accept(t[Es.extensionName])}catch(t){return void Wa(e,n,"Invalid Sec-WebSocket-Extensions header")}e._extensions[Es.extensionName]=h}e.setSocket(n,r,{generateMask:o.generateMask,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})})),o.finishRequest?o.finishRequest(f,e):f.end()}function Ja(e,t){e._readyState=qa.CLOSING,e.emit("error",t),e.emitClose()}function Ma(e){return e.path=e.socketPath,x.default.connect(e)}function za(e){return e.path=void 0,e.servername||""===e.servername||(e.servername=x.default.isIP(e.host)?"":e.host),O.default.connect(e)}function Wa(e,t,n){e._readyState=qa.CLOSING;const r=new Error(n);Error.captureStackTrace(r,Wa),t.setHeader?(t[Ba]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Ja,e,r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function Va(e,t,n){if(t){const n=Ra(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(n){const t=new Error(`WebSocket is not open: readyState ${e.readyState} (${Na[e.readyState]})`);process.nextTick(n,t)}}function $a(e,t){const n=this[Ia];n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,void 0!==n._socket[Ia]&&(n._socket.removeListener("data",nu),process.nextTick(eu,n._socket),1005===e?n.close():n.close(e,t))}function Ha(){const e=this[Ia];e.isPaused||e._socket.resume()}function Ya(e){const t=this[Ia];void 0!==t._socket[Ia]&&(t._socket.removeListener("data",nu),process.nextTick(eu,t._socket),t.close(e[xa])),t.emit("error",e)}function Za(){this[Ia].emitClose()}function Ka(e,t){this[Ia].emit("message",e,t)}function Xa(e){const t=this[Ia];t.pong(e,!t._isServer,Ca),t.emit("ping",e)}function Qa(e){this[Ia].emit("pong",e)}function eu(e){e.resume()}function tu(){const e=this[Ia];let t;this.removeListener("close",tu),this.removeListener("data",nu),this.removeListener("end",ru),e._readyState=qa.CLOSING,this._readableState.endEmitted||e._closeFrameReceived||e._receiver._writableState.errorEmitted||null===(t=e._socket.read())||e._receiver.write(t),e._receiver.end(),this[Ia]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",Za),e._receiver.on("finish",Za))}function nu(e){this[Ia]._receiver.write(e)||this.pause()}function ru(){const e=this[Ia];e._readyState=qa.CLOSING,e._receiver.end(),this.end()}function ou(){const e=this[Ia];this.removeListener("error",ou),this.on("error",Ca),e&&(e._readyState=qa.CLOSING,this.destroy())}var iu=function(e){function n(t,n,r,o,i){void 0===i&&(i=5e3);var s=e.call(this)||this;s.endpoint=t,s.headers=n,s.rewriteHostHeader=r,s.bindToAssign=o,s.closeTimeout=i,s.protocol="TCP",s.openConnections=new Set,s.tcpServer=I.createServer(s.handleConnection.bind(s));var a=null==r?void 0:r.altHostnames.map((function(e){return(t=Wt(t=e))&&Dr.test(t)?t.replace(Or,"\\$&"):t;var t})).join("|");return s.hostRegex=new RegExp("Host: (?:".concat(a,")(:.*$|$)"),"im"),s}return T(n,e),Object.defineProperty(n.prototype,"bindTo",{get:function(){var e;return null!==(e=this.boundTo)&&void 0!==e?e:this.bindToAssign},enumerable:!1,configurable:!0}),n.prototype.open=function(){return L(this,void 0,void 0,(function(){var e=this;return q(this,(function(t){return[2,new Promise((function(t){if(e.bindToAssign){var n=e.bindToAssign,r=n.port,o=n.address;e.tcpServer.listen(r,o,(function(){e.emit("tunnel-open",{address:o,port:r}),t({address:o,port:r})}))}else e.tcpServer.listen(0,(function(){var n=e.tcpServer.address(),r=n.address,o=n.port,i="0.0.0.0"===r||"::"===r?"127.0.0.1":r;e.boundTo={address:i,port:o},e.emit("tunnel-open",e.boundTo),t(e.boundTo)}))}))]}))}))},n.prototype.close=function(){return L(this,void 0,void 0,(function(){var e,t=this;return q(this,(function(n){switch(n.label){case 0:return e=!1,[4,Promise.race([new Promise((function(n){t.tcpServer.close((function(){e=!0,t.emit("tunnel-close"),n()}))})),new Promise((function(n){new Promise((function(e){return setTimeout(e,t.closeTimeout)})).then((function(){e||(t.openConnections.forEach((function(e){e.destroy(),t.openConnections.delete(e)})),n())}))}))])];case 1:return n.sent(),[2]}}))}))},n.prototype.handleConnection=function(e){var t=this;this.openConnections.add(e);var n=new Ga(this.endpoint.replace("https:","wss:"),{headers:this.headers}),r=qi(n),o=this.getHeaderTransform();this.rewriteHostHeader&&o?Ri(e,o,r):Ri(e,r),Ri(r,e),n.on("close",(function(e,n,r){t.emit("connection-close",e,n,r)})),r.on("error",(function(e){t.emit("connection-error",e)})),e.on("error",(function(e){t.emit("connection-error",e)})),this.emit("connection-accept")},n.prototype.getHeaderTransform=function(){if(this.rewriteHostHeader){var e=this.rewriteHostHeader.targetHostname,n=this.hostRegex;return new t.Transform({transform:function(t,r,o){var i=t.toString();if(i.split("\n",1)[0].includes("HTTP")){var s=i.replace(n,"Host: ".concat(e));o(null,Buffer.from(s))}else o(null,t)}})}},n}(e.EventEmitter),su=function(e){function t(t,n,r){var o=e.call(this)||this;return o.endpoint=t,o.headers=n,o.bindToAssign=r,o.protocol="UDP",o.udpSocket=R.default.createSocket("udp4"),o.handleConnection(),o}return T(t,e),Object.defineProperty(t.prototype,"bindTo",{get:function(){var e;return null!==(e=this.boundTo)&&void 0!==e?e:this.bindToAssign},enumerable:!1,configurable:!0}),t.prototype.open=function(){return L(this,void 0,void 0,(function(){var e=this;return q(this,(function(t){return[2,new Promise((function(t){if(e.bindToAssign){var n=e.bindToAssign,r=n.port,o=n.address;e.udpSocket.bind(r,o,(function(){e.emit("tunnel-open",{address:o,port:r}),t({address:o,port:r})}))}else e.udpSocket.bind(0,(function(){var n=e.udpSocket.address(),r=n.address,o=n.port,i="0.0.0.0"===r||"::"===r?"127.0.0.1":r;e.boundTo={address:i,port:o},e.emit("tunnel-open",e.boundTo),t(e.boundTo)}))}))]}))}))},t.prototype.close=function(){return L(this,void 0,void 0,(function(){var e=this;return q(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(t){e.udpSocket.close((function(){e.emit("tunnel-close"),t()}))}))];case 1:return t.sent(),[2]}}))}))},t.prototype.handleConnection=function(){var e,t=this,n=new Ga(this.endpoint.replace("https:","wss:"),{headers:this.headers}),r=qi(n);this.udpSocket.on("message",(function(t,n){e=n,r.write(t)})),r.on("data",(function(n){e&&t.udpSocket.send(n,e.port,e.address,(function(e){e&&t.emit("connection-error",e)}))})),this.udpSocket.on("error",(function(e){t.emit("connection-error",e)})),r.on("error",(function(e){t.emit("connection-error",e)})),n.on("connection-close",(function(e,n,r){t.emit("connection-close",e,n,r)})),n.on("connection-error",(function(e){t.emit("connection-error",e)})),this.emit("connection-accept")},t}(e.EventEmitter);var au,uu="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,cu=function(e,t){return L(void 0,void 0,void 0,(function(){var n;return q(this,(function(r){return n=Promise.resolve([]),[2,e.reduce((function(e,n){return e.then((function(e){return t(n).then((function(t){return e.push(t),e}))}))}),n)]}))}))},lu=function(e){function t(t){void 0===t&&(t=8192);var n=e.call(this)||this;return n.bufferDefaultSize=t,n._size=0,n.buffer=Buffer.alloc(n.bufferDefaultSize),n}return T(t,e),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),t.prototype.getContentsAsString=function(e,t){void 0===e&&(e="utf8");var n=this.buffer.toString(e,0,Math.min(t||this.size,this.size)),r=Buffer.byteLength(n);return r<this.size&&this.buffer.copy(this.buffer,0,r),this._size-=r,n},t.prototype.adaptBuffer=function(e){if(this.buffer.length-this.size<e){var t=Math.ceil((e-(this.buffer.length-this.size))/this.bufferDefaultSize),n=Buffer.alloc(this.buffer.length+this.bufferDefaultSize*t);this.buffer.copy(n,0,0,this.size),this.buffer=n}},t.prototype._write=function(e,t,n){this.adaptBuffer(e.length),e.copy(this.buffer,this.size,0),this._size+=e.length,n()},t}(g.default.Writable),du=function(e){function t(t,n,r){var o=e.call(this)||this;return o.contextProvider=t,o.listServices=n,o.listAddons=r,o.connections=[],o.hostsFileMutex=new gi,o.ipAllocationMutex=new gi,o.stopForwarding=function(e){return L(o,void 0,void 0,(function(){var t,n,r,o,i,s,a;return q(this,(function(u){switch(u.label){case 0:return[4,e.tunnel.close()];case 1:return u.sent(),t=e.forwardingContext,n=t.projectId,r=t.type,o=t.id,i=t.hostnames,s=t.ipOnly,i.length>0&&!s?[4,this.unregisterHostnames(null===(a=e.tunnel.bindTo)||void 0===a?void 0:a.address,i)]:[3,3];case 2:u.sent(),u.label=3;case 3:return this.connections.splice(this.connections.findIndex((function(e){var t=e.forwardingContext,i=t.type,s=t.id,a=t.projectId;return s===o&&a===n&&i===r})),1),[2]}}))}))},o.canExecuteWithHostnames=function(){return"win32"!==process.platform?process.getuid&&0!==process.getuid()?{error:!0,message:"You are not running this command with sufficient privileges (uid=".concat(null===(e=null===process||void 0===process?void 0:process.getuid)||void 0===e?void 0:e.call(process),"). Try running with 'sudo -E'.")}:{error:!1,type:"unix-admin"}:function(){try{return c.execSync("fsutil dirty query %systemdrive%"),!0}catch(e){if("ENOENT"===e.code)try{return c.execSync("fltmc"),!0}catch(e){return!1}return!1}}()?{error:!1,type:"windows-admin"}:{error:!0,message:"You are not running this command as administrator. Please start command line with admin rights."};var e},o.assertStartedWithNodejs=function(){if(!uu)throw new Error("Port forwarding only possible when started with nodejs")},o.proxyApiClient=new Xo(t),o}return T(t,e),t.prototype.withProjectForwarding=function(e,t,n){return void 0===n&&(n=!0),L(this,void 0,void 0,(function(){var r;return q(this,(function(o){switch(o.label){case 0:return[4,this.forwardProject(e,n)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,6]),[4,t(r)];case 3:return[2,o.sent()];case 4:return[4,this.stopProjectForwarding(e)];case 5:return o.sent(),[7];case 6:return[2]}}))}))},t.prototype.forwardProject=function(e,t){return void 0===t&&(t=!0),L(this,void 0,void 0,(function(){var n,r,o,i,s,a=this;return q(this,(function(u){switch(u.label){case 0:return this.assertStartedWithNodejs(),n=e.projectId,[4,this.listServices({parameters:{projectId:n}})];case 1:return r=u.sent(),[4,this.listAddons({parameters:{projectId:n}})];case 2:return o=u.sent(),[4,Promise.all(r.data.services.map((function(e){return L(a,void 0,void 0,(function(){return q(this,(function(r){return[2,this.forwardService({projectId:n,serviceId:e.id},t)]}))}))})))];case 3:return i=u.sent(),[4,Promise.all(o.data.addons.map((function(e){return L(a,void 0,void 0,(function(){return q(this,(function(r){switch(r.label){case 0:return[4,this.forwardAddon({projectId:n,addonId:e.id},t)];case 1:return[2,r.sent()]}}))}))})))];case 4:return s=u.sent(),[2,{services:i,addons:s}]}}))}))},t.prototype.withServiceForwarding=function(e,t,n){return void 0===n&&(n=!0),L(this,void 0,void 0,(function(){var r;return q(this,(function(o){switch(o.label){case 0:return[4,this.forwardService(e,n)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,6]),[4,t(r)];case 3:return[2,o.sent()];case 4:return[4,this.stopServiceForwarding(e)];case 5:return o.sent(),[7];case 6:return[2]}}))}))},t.prototype.forwardService=function(e,t){return void 0===t&&(t=!0),L(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c=this;return q(this,(function(l){switch(l.label){case 0:return this.assertStartedWithNodejs(),n=e.projectId,r=e.serviceId,[4,this.proxyApiClient.getServiceDetails(n,r)];case 1:return o=l.sent(),i=o.namespace,s=o.targetDomain,a=o.instances,u=o.ports,0===a.length?[2,[]]:[4,cu(u,(function(e){var o,u="https://".concat(s,"/tunnel/projects/").concat(n,"/services/").concat(r,"/instance/").concat(a[0].podName,"/port/").concat(e.internalPort),l="".concat(r,".").concat(i,".svc.cluster.local"),d=["".concat(r)];e.name&&d.push("".concat(e.name,".").concat(r)),"HTTP"===e.protocol&&(o={altHostnames:d,targetHostname:l});var p=G([l],d,!0);return c.forwardPort(u,e,p,"service",r,n,t,o)}))];case 2:return[2,l.sent()]}}))}))},t.prototype.withAddonForwarding=function(e,t,n){return void 0===n&&(n=!0),L(this,void 0,void 0,(function(){var r;return q(this,(function(o){switch(o.label){case 0:return[4,this.forwardAddon(e,n)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,6]),[4,t(r)];case 3:return[2,o.sent()];case 4:return[4,this.stopAddonForwarding(e)];case 5:return o.sent(),[7];case 6:return[2]}}))}))},t.prototype.forwardAddon=function(e,t){return void 0===t&&(t=!0),L(this,void 0,void 0,(function(){var n,r,o,i,s=this;return q(this,(function(a){switch(a.label){case 0:return this.assertStartedWithNodejs(),n=e.addonId,r=e.projectId,[4,this.proxyApiClient.getAddonDetails(r,n)];case 1:return o=a.sent(),i=o.instances.map((function(e){var t=e.podName,n=e.internalHostname;return e.ports.map((function(e){return{podName:t,internalHostname:n,port:e}}))})),[4,cu((u=i,null!=u&&u.length?Qt(u,1/0):[]),(function(e){var i=e.podName,a=e.internalHostname,u=e.port;return L(s,void 0,void 0,(function(){var e;return q(this,(function(s){return e="https://".concat(o.targetDomain,"/tunnel/projects/").concat(r,"/addons/").concat(n,"/instance/").concat(i,"/port/").concat(u.internalPort),[2,this.forwardPort(e,u,[a],"addon",n,r,t)]}))}))}))];case 2:return[2,a.sent()]}var u}))}))},t.prototype.allocateIpAddress=function(e){return L(this,void 0,void 0,(function(){var t=this;return q(this,(function(n){return[2,this.ipAllocationMutex.enter((function(){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){switch(s.label){case 0:return t="127.24.1.1",n="127.24.255.255",r=null!==(i=this.nextIpAddress)&&void 0!==i?i:t,[4,Qo(e,r,n)];case 1:return o=s.sent(),this.nextIpAddress=ri(ni(o)+1),ni(this.nextIpAddress)>ni(n)&&(this.nextIpAddress=t),[2,o]}}))}))}))]}))}))},t.prototype.forwardPort=function(e,t,n,r,o,i,s,a){var u;return void 0===s&&(s=!0),L(this,void 0,void 0,(function(){var c,l,d,p,h,f,v=this;return q(this,(function(m){switch(m.label){case 0:if(c={Authorization:"Bearer ".concat(this.contextProvider.getCurrentToken())},!s&&(l=this.canExecuteWithHostnames()).error)throw new Error("".concat(l.message," Alternatively, you can use the ipOnly mode when port-forwarding (apiClient.forwarding.forwardAddon({ projectId, addonId }, true))"));return[4,this.determineSocketAddress(i,o,r,t,s)];case 1:return d=m.sent(),p="UDP"===t.protocol?new su(e,c,d):new iu(e,c,a,d),s?[3,3]:[4,this.registerHostnames(null===(u=p.bindTo)||void 0===u?void 0:u.address,n)];case 2:m.sent(),m.label=3;case 3:return p.on("connection-accept",(function(){return v.emit("connection-accept",p)})),p.on("connection-close",(function(){return L(v,void 0,void 0,(function(){return q(this,(function(e){return[2,this.emit("connection-close",p)]}))}))})),[4,p.open()];case 4:return h=m.sent(),f={projectId:i,id:o,type:r,hostnames:n,ipOnly:s,port:h.port,address:h.address,protocol:t.protocol,portName:t.name},this.emit("tunnel-open",p,f),p.on("connection-error",(function(e){return v.emit("connection-error",p,f,e)})),p.on("tunnel-close",(function(){return v.emit("tunnel-close",p,f)})),this.connections.push({tunnel:p,forwardingContext:f}),[2,{data:f}]}}))}))},t.prototype.determineSocketAddress=function(e,t,n,r,o){var i;return L(this,void 0,void 0,(function(){var s,a,u;return q(this,(function(c){switch(c.label){case 0:return o&&"darwin"===A.default.platform()?[2,void 0]:(s=this.connections.find((function(r){return r.forwardingContext.projectId===e&&r.forwardingContext.id===t&&r.forwardingContext.type===n})),a=(null===(i=null==s?void 0:s.forwardingContext)||void 0===i?void 0:i.port)!==r.internalPort,s&&a?[2,{address:s.forwardingContext.address,port:r.internalPort}]:(u={},[4,this.allocateIpAddress(r.internalPort)]));case 1:return[2,(u.address=c.sent(),u.port=r.internalPort,u)]}}))}))},t.prototype.registerHostnames=function(e,t){return L(this,void 0,void 0,(function(){return q(this,(function(n){switch(n.label){case 0:return[4,this.modifyHostsFile((function(n){n.removeHosts.apply(n,t),n.add.apply(n,G([e],t,!1))}))];case 1:return n.sent(),[2]}}))}))},t.prototype.unregisterHostnames=function(e,t){return L(this,void 0,void 0,(function(){return q(this,(function(n){switch(n.label){case 0:return[4,this.modifyHostsFile((function(n){n.remove.apply(n,G([e],t,!1))}))];case 1:return n.sent(),[2]}}))}))},t.prototype.modifyHostsFile=function(e){return L(this,void 0,void 0,(function(){var t=this;return q(this,(function(n){switch(n.label){case 0:return[4,this.hostsFileMutex.enter((function(){return L(t,void 0,void 0,(function(){var t,n=this;return q(this,(function(r){switch(r.label){case 0:return[4,yi.load({header:"Northflank Proxy"})];case 1:return t=r.sent(),e(t),[4,t.backup({suffix:".backup-pre-northflank"})];case 2:r.sent(),r.label=3;case 3:return r.trys.push([3,5,,7]),[4,pu(5)((function(){return L(n,void 0,void 0,(function(){return q(this,(function(e){switch(e.label){case 0:return[4,t.write({writeMode:"atomic"})];case 1:return e.sent(),[2]}}))}))}))];case 4:return r.sent(),[3,7];case 5:return r.sent(),[4,pu(5)((function(){return L(n,void 0,void 0,(function(){return q(this,(function(e){switch(e.label){case 0:return[4,t.write({writeMode:"standard"})];case 1:return e.sent(),[2]}}))}))}))];case 6:return r.sent(),[3,7];case 7:return[2]}}))}))}))];case 1:return n.sent(),[2]}}))}))},t.prototype.stopProjectForwarding=function(e){return L(this,void 0,void 0,(function(){var t=this;return q(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.connections.filter((function(t){return t.forwardingContext.projectId===e.projectId})).map((function(e){return t.stopForwarding(e)})))];case 1:return n.sent(),[2]}}))}))},t.prototype.stopServiceForwarding=function(e){return L(this,void 0,void 0,(function(){var t=this;return q(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.connections.filter((function(t){return"service"===t.forwardingContext.type&&t.forwardingContext.projectId===e.projectId&&t.forwardingContext.id===e.serviceId})).map((function(e){return t.stopForwarding(e)})))];case 1:return n.sent(),[2]}}))}))},t.prototype.stopAddonForwarding=function(e){return L(this,void 0,void 0,(function(){var t=this;return q(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.connections.filter((function(t){return"addon"===t.forwardingContext.type&&t.forwardingContext.projectId===e.projectId&&t.forwardingContext.id===e.addonId})).map((function(e){return t.stopForwarding(e)})))];case 1:return n.sent(),[2]}}))}))},t.prototype.stop=function(){return L(this,void 0,void 0,(function(){var e=this;return q(this,(function(t){switch(t.label){case 0:return[4,Promise.all(this.connections.map((function(t){return L(e,void 0,void 0,(function(){return q(this,(function(e){return[2,this.stopForwarding(t)]}))}))})))];case 1:return t.sent(),[2]}}))}))},t}(e.EventEmitter),pu=function(e,t){return void 0===t&&(t=50),function(n){var r=e,o=function(){return L(void 0,void 0,void 0,(function(){var e;return q(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,4]),[4,n()];case 1:return[2,i.sent()];case 2:if(e=i.sent(),r<=0)throw e;return r-=1,[4,new Promise((function(e){return setTimeout((function(){return e()}),t)}))];case 3:return i.sent(),[2,o()];case 4:return[2]}}))}))};return o()}},hu=function(e){function t(t,n,r,o,i,s){void 0===o&&(o=new w.PassThrough),void 0===i&&(i=new w.PassThrough),void 0===s&&(s=new w.PassThrough);var a=e.call(this)||this;return a.baseUrl=t,a.execConfig=n,a.token=r,a.stdOut=o,a.stdErr=i,a.stdIn=s,a.waitForCommandResult=function(){return L(a,void 0,void 0,(function(){return q(this,(function(e){switch(e.label){case 0:if(void 0===this.currentCommand)throw new Error("No command is running");return[4,this.currentCommand];case 1:return[2,e.sent()]}}))}))},a.sendInputToCurrentCommand=function(e){return L(a,void 0,void 0,(function(){var t;return q(this,(function(n){if(void 0===this.currentCommand||void 0===this.duplex)throw new Error("No command is running");return null===(t=this.duplex)||void 0===t||t.write(this.constructPayloadPacket(e)),[2]}))}))},a.resizeTerminal=function(e){return L(a,void 0,void 0,(function(){var t;return q(this,(function(n){if(void 0===this.currentCommand||void 0===this.duplex)throw new Error("No command is running, can't resize terminal");return null===(t=this.duplex)||void 0===t||t.write(JSON.stringify({type:"resize",data:{ttyRows:null==e?void 0:e.rows,ttyColumns:null==e?void 0:e.columns}})),[2]}))}))},a.constructPayloadPacket=function(e){return JSON.stringify({type:"payload",data:e.toString()})},a}return T(t,e),Object.defineProperty(t.prototype,"execEndpoint",{get:function(){var e=this.execConfig,t=e.entityId,n=e.entityType,r=e.projectId,o="".concat(this.baseUrl,"/v1/command-exec/projects/").concat(r,"/");return"".concat(o).concat(function(){switch(n){case"service":return"services/".concat(t);case"job":return"jobs/".concat(t);case"addon":return"addons/".concat(t);case"build":return"builds/".concat(t);default:throw new Error("Unexpected Northflank entity type received in command exec endpoint generation: ".concat(n))}}())},enumerable:!1,configurable:!0}),t.prototype.start=function(){return L(this,void 0,void 0,(function(){var e=this;return q(this,(function(t){if(void 0!==this.currentCommand)throw new Error("Command is already running");return this.currentCommand=new Promise((function(t,n){var r,o,i;void 0!==e.remote&&n(Error("Command is already running"));var s,a=e.execEndpoint.replace("https:","wss:").replace("http:","ws:");e.remote=new Ga(a);try{e.duplex=qi(e.remote)}catch(e){throw new Error("Failed to establish connection to command execution proxy: ".concat(e.message))}e.initialAuth(),e.stdIn.on("data",(function(t){var n,r;(null===(n=e.duplex)||void 0===n?void 0:n.writable)&&(null===(r=e.duplex)||void 0===r||r.write(e.constructPayloadPacket(t)))})),null===(r=e.duplex)||void 0===r||r.on("data",(function(t){var n,r,o,i=JSON.parse(t.toString());switch(null==i?void 0:i.type){case"init":var a=i.data;"successful"!==a.auth&&u("Command initialization failed: ".concat(null!==(n=null==a?void 0:a.message)&&void 0!==n?n:"Reason unknown"));break;case"completion":s=i.data,e.emit("command-result",s),null===(r=e.duplex)||void 0===r||r.end();break;case"stdOut":e.emit("std-out-data",i.data),e.stdOut.write(i.data);break;case"stdErr":e.emit("std-err-data",i.data),e.stdErr.write(i.data);break;case"error":u(null===(o=i.data)||void 0===o?void 0:o.message);break;default:var c="unable to parse message: ".concat(JSON.stringify(i));u(c)}})),null===(o=e.duplex)||void 0===o||o.on("end",(function(){e.emit("command-completed"),e.reset(),t(s)})),null===(i=e.duplex)||void 0===i||i.on("error",(function(n){e.emit("error",n),e.emit("command-completed"),e.reset(),t(s)}));var u=function(t){e.emit("error",t),e.reset(),n(new Error(t))};e.emit("command-started")})),[2,this.currentCommand]}))}))},t.prototype.initialAuth=function(){var e,t=this.execConfig,n=t.command,r=t.containerName,o=t.shell,i=t.user,s=t.group,a=t.ttyColumns,u=t.ttyRows,c={type:"init",data:{auth:{type:"apiToken",apiToken:this.token},context:{containerId:r,command:n,shell:o,user:i,group:s,ttyColumns:a,ttyRows:u}}};null===(e=this.duplex)||void 0===e||e.write(JSON.stringify(c))},t.prototype.reset=function(){var e;this.remote=void 0,this.currentCommand=void 0,null===(e=this.duplex)||void 0===e||e.destroy(),this.duplex=void 0},t}(e.EventEmitter),fu=function(){function e(e){this.contextProvider=e,this.assertStartedWithNodejs=function(){if(!uu)throw new Error("Command exec only possible when started with nodejs")}}return e.prototype.execServiceCommand=function(e,t){return L(this,void 0,void 0,(function(){var n,r,o;return q(this,(function(i){return n=e.serviceId,r=e.projectId,"service",o=N({projectId:r,entityId:n,entityType:"service"},t),[2,this.execCommand(o)]}))}))},e.prototype.execServiceSession=function(e,t){return L(this,void 0,void 0,(function(){var n,r,o;return q(this,(function(i){return n=e.serviceId,r=e.projectId,"service",o=N({projectId:r,entityId:n,entityType:"service"},t),[2,this.shellSession(o)]}))}))},e.prototype.execJobCommand=function(e,t){return L(this,void 0,void 0,(function(){var n,r,o;return q(this,(function(i){return n=e.jobId,r=e.projectId,"job",o=N({projectId:r,entityId:n,entityType:"job"},t),[2,this.execCommand(o)]}))}))},e.prototype.execJobSession=function(e,t){return L(this,void 0,void 0,(function(){var n,r,o;return q(this,(function(i){return n=e.jobId,r=e.projectId,"job",o=N({projectId:r,entityId:n,entityType:"job"},t),[2,this.shellSession(o)]}))}))},e.prototype.execCommand=function(e){return L(this,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){switch(o.label){case 0:return this.assertStartedWithNodejs(),t=this.getCommandRunner(N({shell:"none"},e)),n=new lu,r=new lu,t.stdOut.pipe(n),t.stdErr.pipe(r),t.on("error",(function(e){throw new Error(e)})),[4,t.start()];case 1:return[2,{commandResult:o.sent(),stdOut:n.getContentsAsString(),stdErr:r.getContentsAsString()}]}}))}))},e.prototype.shellSession=function(e){this.assertStartedWithNodejs();var t=this.getCommandRunner(e);return t.start(),t},e.prototype.getCommandRunner=function(e){var t=this.contextProvider.getCurrentBaseUrl(!0),n=this.contextProvider.getCurrentToken();if(!n)throw Error("API token not found");return new hu(t,e,n)},e}(),vu=function(e){function t(t){var n=this.constructor,r=e.call(this,t.message)||this;r.name="NorthflankApiCallError",r.message=t.message,r.status=t.status,r.id=t.id,r.details=t.details;var o=n.prototype;return Object.setPrototypeOf?Object.setPrototypeOf(r,o):r.__proto__=o,r}return T(t,e),t}(Error),mu=function(e){function t(t,n,r){var o=e.call(this)||this;return o.baseUrl=t,o.logsConfig=n,o.token=r,o.stop=function(){return L(o,void 0,void 0,(function(){var e;return q(this,(function(t){if(void 0===this.logSession)throw new Error("No command is running");return null===(e=this.remote)||void 0===e||e.close(),[2]}))}))},o}return T(t,e),t.getLogsEndpoint=function(e){var t=e.containerName,n=e.entityId,r=e.entityType,o=e.buildId,i=e.runId,s=e.isBuild,a=e.lineLimit,u=e.projectId,c=e.queryType,l=e.startTime,d=e.endTime,p=e.duration,h=e.direction,f=e.textIncludes,v=e.textNotIncludes,m=e.regexIncludes,b=e.regexNotIncludes,y="/v1/projects/".concat(u,"/"),g=new URLSearchParams;return g.append("queryType",c),l&&g.append("startTime",l.toISOString()),d&&g.append("endTime",d.toISOString()),a&&g.append("lineLimit",a.toString()),t&&g.append("containerName",t),i&&g.append("runId",i),o&&g.append("buildId",o),f&&g.append("textIncludes",f),v&&g.append("textNotIncludes",v),m&&g.append("regexIncludes",m),b&&g.append("regexNotIncludes",b),h&&g.append("direction",h),p&&g.append("duration",p.toString()),"".concat(y).concat(function(){var e=s?"/build-logs":"/logs";switch(r){case"service":return"services/".concat(n).concat(e);case"job":return"jobs/".concat(n).concat(e);case"addon":return"addons/".concat(n).concat(e);default:throw new Error("Unexpected Northflank entity type received in logs endpoint generation: ".concat(r))}}(),"?").concat(g.toString())},Object.defineProperty(t.prototype,"logsEndpoint",{get:function(){return"".concat(this.baseUrl).concat(t.getLogsEndpoint(this.logsConfig))},enumerable:!1,configurable:!0}),t.prototype.start=function(){return L(this,void 0,void 0,(function(){var e=this;return q(this,(function(t){switch(t.label){case 0:if(void 0!==this.logSession)throw new Error("Command is already running");return this.logSession=new Promise((function(t,n){var r,o,i,s;void 0!==e.remote&&n(Error("Command is already running"));var a=e.logsEndpoint.replace("https:","wss:").replace("http:","ws:");e.remote=new Ga(a),null===(r=e.remote)||void 0===r||r.on("message",(function(n){var r,o,i=JSON.parse(n.toString());switch(null==i?void 0:i.type){case"init":var s=i.data;"successful"!==s.auth?u("Log tail initialization failed: ".concat(null!==(r=null==s?void 0:s.message)&&void 0!==r?r:"Reason unknown")):t();break;case"log-lines":var a=i.data;e.emit("logs-received",a.map(xu));break;case"error":u(null===(o=i.data)||void 0===o?void 0:o.message);break;default:var c="unable to parse message: ".concat(JSON.stringify(i));u(c)}})),null===(o=e.remote)||void 0===o||o.on("close",(function(){e.emit("close"),e.reset(),t()})),null===(i=e.remote)||void 0===i||i.on("open",(function(){e.emit("open")})),null===(s=e.remote)||void 0===s||s.on("error",(function(n){e.emit("error",n),e.reset(),t()}));var u=function(t){e.emit("error",{message:t}),e.reset(),n(new Error(t))}})),[4,new Promise((function(t){var n;e.remote.on("open",(function(){return t()})),null===(n=e.remote)||void 0===n||n.on("error",(function(){t()}))}))];case 1:return t.sent(),this.initialAuth(),[2,this.logSession]}}))}))},t.prototype.initialAuth=function(){var e,t={type:"init",data:{auth:{type:"apiToken",apiToken:this.token}}};null===(e=this.remote)||void 0===e||e.send(JSON.stringify(t))},t.prototype.reset=function(){this.remote=void 0,this.logSession=void 0},t}(e.EventEmitter),bu=uu?Zo:window.fetch,yu=function(){if(uu)try{return JSON.parse(C.default.readFileSync(k.default.join(k.default.dirname(r.fileURLToPath("undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("api-client.js",document.baseURI).href)),"../../package.json")).toString())}catch(e){return console.log("Failed to check version of northflank CLI (".concat(e.message,")")),{}}return{}},gu=function(){function e(e,t){var n=this;this.opts=t,this.call=function(e){return L(n,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l,d,p,h=this;return q(this,(function(f){switch(f.label){case 0:if(t=this.method,n={method:t,headers:this.getDefaultHeaders()},!(r=null===(p=this.contextProvider)||void 0===p?void 0:p.getCurrentBaseUrl()))throw new Error("Api client context not correctly initialized, please provide a url to the context.");return o="".concat(r).concat(this.endpointUrl(e)),i=this.body(e),s=N(N({url:o},n),{body:i}),[4,Pu(o,N(N({},n),{body:i}))];case 1:return[4,(a=f.sent()).text()];case 2:return u=f.sent(),c=function(){if(200!==a.status){var e=null==l?void 0:l.error,t=(null==e?void 0:e.message)||"",n={status:a.status,message:t,id:null==e?void 0:e.id,details:null==e?void 0:e.details};if(h.opts.throwErrorOnHttpErrorCode)throw new vu(n);return n}},l=function(){try{return JSON.parse(u)}catch(e){throw Error("Failed reading api request result: \n\tStatus: ".concat(a.statusText," (").concat(a.status,")\n\tMessage: ").concat(u))}}(),d=c(),[2,{data:null==l?void 0:l.data,rawResponse:a,request:s,error:d,pagination:null==l?void 0:l.pagination}]}}))}))},this.contextProvider=e}return e.prototype.getDefaultHeaders=function(){var e,t,n=this.contextProvider.getCurrentToken(),r=(null===(e=this.opts)||void 0===e?void 0:e.customUserAgent)?" (".concat(this.opts.customUserAgent,")"):"";return{Authorization:this.withAuth?"Bearer ".concat(n):void 0,"Content-Type":"application/json","User-Agent":"northflank-js-client/".concat(null===(t=yu())||void 0===t?void 0:t.version).concat(r)}},e}(),wu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.method="get",t.body=function(){},t}return T(t,e),t}(gu),ju=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.method="post",t}return T(t,e),t}(gu),_u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.method="delete",t.body=function(){},t}return T(t,e),t}(gu),Su=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.method="put",t}return T(t,e),t}(gu),Eu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.method="patch",t}return T(t,e),t}(gu),Pu=function(e,t,n,r){return void 0===t&&(t={}),void 0===n&&(n=3),void 0===r&&(r=500),new Promise((function(o,i){var s=function(n){return bu(e,t).then((function(e){o(e)})).catch((function(e){return L(void 0,void 0,void 0,(function(){return q(this,(function(t){switch(t.label){case 0:return n>0?[4,(o=r,new Promise((function(e){setTimeout((function(){e()}),o)})))]:[3,2];case 1:return t.sent(),[2,s(n-1)];case 2:return[2,i(e)]}var o}))}))}))};return s(n)}))},Au=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Fetch log lines over a specific time span",t.withAuth=!0,t.requiredPermissions="Account > Service | Job | Addon > General > Read",t.endpointUrl=function(e){return mu.getLogsEndpoint(e)},t.body=function(){},t}return T(t,e),t}(wu),xu=function(e){return{containerId:e.containerId,log:e.log,ts:new Date(e.ts)}},Iu=function(e){var t=this;this.contextProvider=e,this.getServiceLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.serviceId,projectId:t.projectId},[2,this.logRange(r,null!=n?n:{},"service")]}))}))},this.getServiceBuildLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.projectId,o=t.serviceId,i={entityId:o,projectId:r},[2,this.logRange(i,N(N({},n),{isBuild:!0}),"service")]}))}))},this.getJobLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.jobId,projectId:t.projectId},[2,this.logRange(r,null!=n?n:{},"job")]}))}))},this.getJobBuildLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.projectId,o=t.jobId,i={entityId:o,projectId:r},[2,this.logRange(i,N(N({},n),{isBuild:!0}),"job")]}))}))},this.getAddonLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.addonId,projectId:t.projectId},[2,this.logRange(r,null!=n?n:{},"addon")]}))}))},this.logRange=function(e,n,r){return L(t,void 0,void 0,(function(){var t,o,i,s,a;return q(this,(function(u){switch(u.label){case 0:return t=e.entityId,o=e.projectId,i=N(N({projectId:o,entityId:t,entityType:r},n),{queryType:"range"}),[4,new Au(this.contextProvider,{}).call(i)];case 1:return(s=u.sent()).error?[2,s]:[2,N(N({},s),{data:null===(a=null==s?void 0:s.data)||void 0===a?void 0:a.map(xu)})]}}))}))},this.tailServiceLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.serviceId,projectId:t.projectId},[2,this.logTail(r,null!=n?n:{},"service")]}))}))},this.tailServiceBuildLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.serviceId,o=t.projectId,i={entityId:r,projectId:o},[2,this.logTail(i,N(N({},n),{isBuild:!0}),"service")]}))}))},this.tailJobLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.jobId,projectId:t.projectId},[2,this.logTail(r,null!=n?n:{},"job")]}))}))},this.tailJobBuildLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.projectId,o=t.jobId,i={entityId:o,projectId:r},[2,this.logTail(i,N(N({},n),{isBuild:!0}),"job")]}))}))},this.tailAddonLogs=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.addonId,projectId:t.projectId},[2,this.logTail(r,null!=n?n:{},"addon")]}))}))},this.logTail=function(e,n,r){return L(t,void 0,void 0,(function(){var t,o,i,s,a;return q(this,(function(u){if(t=e.entityId,o=e.projectId,i=N({queryType:"tail",projectId:o,entityId:t,entityType:r},n),this.assertStartedWithNodejs(),s=this.contextProvider.getCurrentBaseUrl(!0),!(a=this.contextProvider.getCurrentToken()))throw new Error("API token not found");return[2,new mu(s,i,a)]}))}))},this.assertStartedWithNodejs=function(){if(!uu)throw new Error("Command exec only possible when started with nodejs")}},Cu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Fetch metrics entries over a specific time span",t.withAuth=!0,t.requiredPermissions="Account > Service | Job | Addon > General > Read",t.endpointUrl=function(e){var t=e.projectId,n=e.entityId,r=e.entityType,o=e.runId,i=e.buildId,s=e.isBuild,a=e.queryType,u=e.metricTypes,c=e.startTime,l=e.endTime,d=e.duration,p=e.containerName,h=e.timestamp,f="/v1/projects/".concat(t,"/");var v=new URLSearchParams;return v.append("queryType",a),c&&v.append("startTime",c.toISOString()),l&&v.append("endTime",l.toISOString()),p&&v.append("containerName",p),o&&v.append("runId",o),i&&v.append("buildId",i),h&&v.append("timestamp",h.toISOString()),d&&v.append("duration",d.toString()),u&&u.forEach((function(e){return v.append("metricTypes",e)})),"".concat(f).concat(function(){var e=s?"/build-metrics":"/metrics";switch(r){case"service":return"services/".concat(n).concat(e);case"job":return"jobs/".concat(n).concat(e);case"addon":return"addons/".concat(n).concat(e);default:throw new Error("Unexpected Northflank entity type received in metrics endpoint generation: ".concat(r))}}(),"?").concat(v.toString())},t.body=function(){},t}return T(t,e),t}(wu),ku=function(e){return{metadata:e.metadata,data:e.data.map((function(e){return{value:e.value,ts:new Date(e.ts)}}))}};exports.MetricType=void 0,(au=exports.MetricType||(exports.MetricType={})).Cpu="cpu",au.Memory="memory",au.NetworkIngress="networkIngress",au.NetworkEgress="networkEgress",au.TcpConnectionOpen="tcpConnectionsOpen",au.PvcUsage="diskUsage",au.Requests="requests",au.Http4xxResponses="http4xxResponses",au.Http5xxResponses="http5xxResponses";var Uu=function(e){var t=this;this.contextProvider=e,this.getServiceMetrics=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.serviceId,projectId:t.projectId},[2,this.metricsSingle(r,null!=n?n:{},"service")]}))}))},this.getServiceBuildMetrics=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.serviceId,o=t.projectId,i={entityId:r,projectId:o},[2,this.metricsSingle(i,N(N({},n),{isBuild:!0}),"service")]}))}))},this.getJobMetrics=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.jobId,projectId:t.projectId},[2,this.metricsSingle(r,null!=n?n:{},"job")]}))}))},this.getJobBuildMetrics=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.jobId,o=t.projectId,i={entityId:r,projectId:o},[2,this.metricsSingle(i,N(N({},n),{isBuild:!0}),"job")]}))}))},this.getAddonMetrics=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.addonId,projectId:t.projectId},[2,this.metricsSingle(r,null!=n?n:{},"addon")]}))}))},this.metricsSingle=function(e,n,r){return L(t,void 0,void 0,(function(){var t,o,i;return q(this,(function(s){return t=e.entityId,o=e.projectId,i=N(N({projectId:o,entityId:t,entityType:r},n),{queryType:"single"}),[2,this.getMetrics(i)]}))}))},this.getServiceMetricsRange=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.serviceId,projectId:t.projectId},[2,this.metricsRange(r,null!=n?n:{},"service")]}))}))},this.getServiceBuildMetricsRange=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.projectId,o=t.serviceId,i={entityId:o,projectId:r},[2,this.metricsRange(i,N(N({},n),{isBuild:!0}),"service")]}))}))},this.getJobMetricsRange=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.jobId,projectId:t.projectId},[2,this.metricsRange(r,null!=n?n:{},"job")]}))}))},this.getJobBuildMetricsRange=function(e){return L(t,void 0,void 0,(function(){var t,n,r,o,i;return q(this,(function(s){return t=e.parameters,n=e.options,r=t.projectId,o=t.jobId,i={entityId:o,projectId:r},[2,this.metricsRange(i,N(N({},n),{isBuild:!0}),"job")]}))}))},this.getAddonMetricsRange=function(e){return L(t,void 0,void 0,(function(){var t,n,r;return q(this,(function(o){return t=e.parameters,n=e.options,r={entityId:t.addonId,projectId:t.projectId},[2,this.metricsRange(r,null!=n?n:{},"addon")]}))}))},this.metricsRange=function(e,n,r){return L(t,void 0,void 0,(function(){var t,o,i;return q(this,(function(s){return t=e.entityId,o=e.projectId,i=N(N({projectId:o,entityId:t,entityType:r},n),{queryType:"range"}),[2,this.getMetrics(i)]}))}))},this.getMetrics=function(e){return L(t,void 0,void 0,(function(){var t;return q(this,(function(n){switch(n.label){case 0:return[4,new Cu(this.contextProvider,{}).call(e)];case 1:return(t=n.sent()).error?[2,t]:[2,N(N({},t),{data:Object.fromEntries(Object.entries(t.data).map((function(e){var t=e[0],n=e[1];return[t,N(N({},n),{values:n.values.map(ku)})]})))})]}}))}))}},Ou=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists projects for the authenticated user or team.",t.withAuth=!0,t.requiredPermissions="Project > Projects > Manage > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Du=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new project.",t.withAuth=!0,t.requiredPermissions="Project > Projects > Manage > Create",t.endpointUrl=function(e){return"/v1/projects"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Ru=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get information about the given project",t.withAuth=!0,t.requiredPermissions="Project > Projects > Manage > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId)},t.body=function(){},t}return T(t,e),t}(wu),Bu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Delete the given project. Fails if the project isn't empty.",t.withAuth=!0,t.requiredPermissions="Project > Projects > Manage > Delete",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId)},t.body=function(){},t}return T(t,e),t}(_u),Tu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of addons belonging to the project",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/addons").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Nu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new addon",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Lu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates an addon",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),qu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the given addon",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId)},t.body=function(){},t}return T(t,e),t}(wu),Gu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates an addon",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),Fu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Delete",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId)},t.body=function(){},t}return T(t,e),t}(_u),Ju=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Returns the credentials for connecting to the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/credentials")},t.body=function(){},t}return T(t,e),t}(wu),Mu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the available addon types",t.withAuth=!0,t.requiredPermissions="undefined",t.endpointUrl=function(e){return"/v1/addon-types"},t.body=function(){},t}return T(t,e),t}(wu),zu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Modifies the allocated resources for the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/scale")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Wu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about the current addon version including available upgrades and upgrade history.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/version")},t.body=function(){},t}return T(t,e),t}(wu),Vu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Upgrades the addon to a new version.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/version")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),$u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the network settings for the addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/network-settings")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Hu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the security rules for the addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/security")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Yu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Returns a list of backups for the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Zu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Initiates a backup for the given addon",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Ku=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about a given backup.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId)},t.body=function(){},t}return T(t,e),t}(wu),Xu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes a given backup",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId)},t.body=function(){},t}return T(t,e),t}(_u),Qu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Restores the given addon to the given backup state.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId,"/restore")},t.body=function(){},t}return T(t,e),t}(ju),ec=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of restores for the given backup.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId,"/restores").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),tc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Imports a database from an external archive or existing live database.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/import")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),nc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of containers for the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > Deployment > View Instances",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/containers").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),rc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Pause the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/pause")},t.body=function(){},t}return T(t,e),t}(ju),oc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Resume the given addon if it is paused.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/resume")},t.body=function(){},t}return T(t,e),t}(ju),ic=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Restart the given addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/restart")},t.body=function(){},t}return T(t,e),t}(ju),sc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Aborts the in progress backup.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId,"/abort")},t.body=function(){},t}return T(t,e),t}(ju),ac=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Flags a temporary backup generated by a backup schedule to be retained indefinitely rather than being deleted after the expiry date.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId,"/retain")},t.body=function(){},t}return T(t,e),t}(ju),uc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Generates a temporary download link for downloading the given backup.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId,"/download-link")},t.body=function(){},t}return T(t,e),t}(wu),cc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Aborts an in-progress backup restore.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backups/").concat(e.parameters.backupId,"/abort-restore")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),lc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about an addon's backup schedules",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backup-schedules").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),dc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Create a new backup schedule for an addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backup-schedules")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),pc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes a backup schedule for an addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/backup-schedules/").concat(e.parameters.scheduleId)},t.body=function(){},t}return T(t,e),t}(_u),hc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets the valid window for performing a point-in-time restore (PITR) on this addon.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/pitr-window")},t.body=function(){},t}return T(t,e),t}(wu),fc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Restores an addon to a specific point in time.",t.withAuth=!0,t.requiredPermissions="Project > Addons > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/addons/").concat(e.parameters.addonId,"/pitr")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),vc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get a list of past invoices",t.withAuth=!0,t.requiredPermissions="Account > Billing > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/billing/invoices".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),mc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about an invoice. If `timestamp` is passed in as a query parameter, this endpoint returns details about the invoice containing that timestamp. Otherwise, returns a preview invoice displaying billing data from after the most recent invoice.",t.withAuth=!0,t.requiredPermissions="Account > Billing > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/billing/invoices/details".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),bc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists supported cloud providers",t.withAuth=!0,t.requiredPermissions="undefined",t.endpointUrl=function(e){return"/v1/cloud-providers"},t.body=function(){},t}return T(t,e),t}(wu),yc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists integrations for the authenticated user or team.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Integrations > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/cloud-providers/integrations".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),gc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new integration.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Integrations > Create",t.endpointUrl=function(e){return"/v1/cloud-providers/integrations"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),wc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get information about the given integration",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Integrations > Read",t.endpointUrl=function(e){return"/v1/cloud-providers/integrations/".concat(e.parameters.integrationId)},t.body=function(){},t}return T(t,e),t}(wu),jc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Update information about the given integration",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Integrations > Update",t.endpointUrl=function(e){return"/v1/cloud-providers/integrations/".concat(e.parameters.integrationId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),_c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Delete the given integration. Fails if the integration is associated with existing clusters.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Integrations > Delete",t.endpointUrl=function(e){return"/v1/cloud-providers/integrations/".concat(e.parameters.integrationId)},t.body=function(){},t}return T(t,e),t}(_u),Sc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists clusters for the authenticated user or team.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Clusters > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/cloud-providers/clusters".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Ec=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new cluster.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Clusters > Create",t.endpointUrl=function(e){return"/v1/cloud-providers/clusters"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Pc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get information about the given cluster",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Clusters > Read",t.endpointUrl=function(e){return"/v1/cloud-providers/clusters/".concat(e.parameters.clusterId)},t.body=function(){},t}return T(t,e),t}(wu),Ac=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Update an existing cluster.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Clusters > Update",t.endpointUrl=function(e){return"/v1/cloud-providers/clusters/".concat(e.parameters.clusterId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),xc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Delete the given cluster. Fails if the cluster has associated projects.",t.withAuth=!0,t.requiredPermissions="Account > Cloud > Clusters > Delete",t.endpointUrl=function(e){return"/v1/cloud-providers/clusters/".concat(e.parameters.clusterId)},t.body=function(){},t}return T(t,e),t}(_u),Ic=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of jobs belonging to the project",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Cc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the given job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId)},t.body=function(){},t}return T(t,e),t}(wu),kc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Delete",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId)},t.body=function(){},t}return T(t,e),t}(_u),Uc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new manual job that only runs when initiated via the UI, CLI, API or JS client.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/manual")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Oc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates a new manual job that only runs when initiated via the UI, CLI, API or JS client.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/manual")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),Dc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a new manual job that only runs when initiated via the UI, CLI, API or JS client.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/manual/").concat(e.parameters.jobId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),Rc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new cron job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/cron")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Bc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates a cron job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/cron")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),Tc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a cron job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/cron/").concat(e.parameters.jobId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),Nc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Modifies the scaling settings for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Deployment > Scale Job",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/scale")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Lc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Modify cron job to toggle suspending of its schedule.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/suspend")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),qc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Pause the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/pause")},t.body=function(){},t}return T(t,e),t}(ju),Gc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Resumes the given job. Optionally takes several arguments to override resumed settings.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/resume")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Fc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Fetches run history for the given job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runs").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Jc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Starts a new job run for the given job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runs")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Mc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Returns data about the given job run",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runs/").concat(e.parameters.runId)},t.body=function(){},t}return T(t,e),t}(wu),zc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Aborts the given job run",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Deployment > Deploy Build",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runs/").concat(e.parameters.runId)},t.body=function(){},t}return T(t,e),t}(_u),Wc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates settings for the job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/settings")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Vc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists the health checks for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/health-checks")},t.body=function(){},t}return T(t,e),t}(wu),$c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates health checks for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/health-checks")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Hc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists builds for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Yc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Start a new build for the given job. Given a commit sha, it will build that commit.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Deployment > Deploy Build",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Zc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about a build for the job",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Deployment > Deploy Build",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build/").concat(e.parameters.buildId)},t.body=function(){},t}return T(t,e),t}(wu),Kc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Aborts the given job build",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Deployment > Deploy Build",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build/").concat(e.parameters.buildId)},t.body=function(){},t}return T(t,e),t}(_u),Xc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the build options for a given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build-options")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Qc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the version control source for a given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build-source")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),el=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets the build arguments of the given job. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Configuration > View Build Parameters",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build-arguments").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),tl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Sets build arguments for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Configuration > Update Build Parameters",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build-arguments")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),nl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about the build arguments accessible by the given job. Also requires the permission 'Project > Secrets > General > Read'",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Configuration > View Build Parameters",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/build-arguments/details")},t.body=function(){},t}return T(t,e),t}(wu),rl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Returns the runtime environment for the given job. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Configuration > View Environment Variables",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runtime-environment").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),ol=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Sets the runtime environment for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Configuration > Update Environment Variables",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runtime-environment")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),il=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about the runtime environment accessible by the given job. Also requires the permission 'Project > Secrets > General > Read'",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Configuration > View Environment Variables",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/runtime-environment/details")},t.body=function(){},t}return T(t,e),t}(wu),sl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the deployment of the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/deployment")},t.body=function(){},t}return T(t,e),t}(wu),al=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the deployment settings of the given job.",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > Update Deployment",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/deployment")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),ul=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of containers for the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > Deployment > View Instance Logs",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/containers").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),cl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the branches of the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/branches").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),ll=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the pull-requests of the given job.",t.withAuth=!0,t.requiredPermissions="Project > Jobs > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/jobs/").concat(e.parameters.jobId,"/pull-requests").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),dl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of log sinks added to this account.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/integrations/log-sinks".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),pl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new log sink.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Create",t.endpointUrl=function(e){return"/v1/integrations/log-sinks"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),hl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about a given log sink.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Read",t.endpointUrl=function(e){return"/v1/integrations/log-sinks/".concat(e.parameters.logSinkId)},t.body=function(){},t}return T(t,e),t}(wu),fl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes a log sink.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Delete",t.endpointUrl=function(e){return"/v1/integrations/log-sinks/".concat(e.parameters.logSinkId)},t.body=function(){},t}return T(t,e),t}(_u),vl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the settings for a log sink.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Update",t.endpointUrl=function(e){return"/v1/integrations/log-sinks/".concat(e.parameters.logSinkId,"/settings")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),ml=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Pauses a given log sink.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Update",t.endpointUrl=function(e){return"/v1/integrations/log-sinks/".concat(e.parameters.logSinkId,"/pause")},t.body=function(){},t}return T(t,e),t}(ju),bl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Resumes a paused log sink.",t.withAuth=!0,t.requiredPermissions="Account > Sinks > General > Update",t.endpointUrl=function(e){return"/v1/integrations/log-sinks/".concat(e.parameters.logSinkId,"/resume")},t.body=function(){},t}return T(t,e),t}(ju),yl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists the container registry credentials saved to this account. Does not display secrets.",t.withAuth=!0,t.requiredPermissions="Account > Credentials > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/integrations/registries".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),gl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Adds a new set of container registry credentials to this account.",t.withAuth=!0,t.requiredPermissions="Account > Credentials > General > Create",t.endpointUrl=function(e){return"/v1/integrations/registries"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),wl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Views a set of registry credential data.",t.withAuth=!0,t.requiredPermissions="Account > Credentials > General > Read Encrypted",t.endpointUrl=function(e){return"/v1/integrations/registries/".concat(e.parameters.credentialId)},t.body=function(){},t}return T(t,e),t}(wu),jl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes a set of registry credential data.",t.withAuth=!0,t.requiredPermissions="Account > Credentials > General > Delete",t.endpointUrl=function(e){return"/v1/integrations/registries/".concat(e.parameters.credentialId)},t.body=function(){},t}return T(t,e),t}(_u),_l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a set of registry credential data.",t.withAuth=!0,t.requiredPermissions="Account > Credentials > General > Update",t.endpointUrl=function(e){return"/v1/integrations/registries/".concat(e.parameters.credentialId,"/modify")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Sl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists available domains",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/domains".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),El=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Registers a new domain",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Create",t.endpointUrl=function(e){return"/v1/domains"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Pl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about domain",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Read",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain)},t.body=function(){},t}return T(t,e),t}(wu),Al=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes a domain and each of its registered subdomains.",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Delete",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain)},t.body=function(){},t}return T(t,e),t}(_u),xl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Attempts to verify the domain",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Create",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/verify")},t.body=function(){},t}return T(t,e),t}(ju),Il=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Adds a new subdomain to the domain.",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Update",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/subdomains")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Cl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about the given subdomain",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Read",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/subdomains/").concat(e.parameters.subdomain)},t.body=function(){},t}return T(t,e),t}(wu),kl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Removes a subdomain from a domain.",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Update",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/subdomains/").concat(e.parameters.subdomain)},t.body=function(){},t}return T(t,e),t}(_u),Ul=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about the given subdomain",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Update",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/subdomains/").concat(e.parameters.subdomain,"/verify")},t.body=function(){},t}return T(t,e),t}(ju),Ol=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Assigns a service port to the given subdomain",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Update",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/subdomains/").concat(e.parameters.subdomain,"/assign")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Dl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Removes a subdomain from its assigned service",t.withAuth=!0,t.requiredPermissions="Account > Domains > General > Update",t.endpointUrl=function(e){return"/v1/domains/".concat(e.parameters.domain,"/subdomains/").concat(e.parameters.subdomain,"/assign")},t.body=function(){},t}return T(t,e),t}(_u),Rl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists available billing plans",t.withAuth=!0,t.requiredPermissions="undefined",t.endpointUrl=function(e){return"/v1/plans"},t.body=function(){},t}return T(t,e),t}(wu),Bl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists available project regions",t.withAuth=!0,t.requiredPermissions="undefined",t.endpointUrl=function(e){return"/v1/regions"},t.body=function(){},t}return T(t,e),t}(wu),Tl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Returns the partially random string used when generating host names for the authenticated account.",t.withAuth=!0,t.requiredPermissions="Project > Projects > Manage > Read",t.endpointUrl=function(e){return"/v1/dns-id"},t.body=function(){},t}return T(t,e),t}(wu),Nl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists linked version control providers",t.withAuth=!0,t.requiredPermissions="Account > Git > General > Read",t.endpointUrl=function(e){return"/v1/integrations/vcs"},t.body=function(){},t}return T(t,e),t}(wu),Ll=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists all pipelines for a project",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/pipelines").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),ql=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about a pipeline",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId)},t.body=function(){},t}return T(t,e),t}(wu),Gl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets details about a release flow",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId,"/release-flows/").concat(e.parameters.stage)},t.body=function(){},t}return T(t,e),t}(wu),Fl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a release flow",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId,"/release-flows/").concat(e.parameters.stage)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Jl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Runs a given release flow with given arguments. This endpoint can be used as part of a CI pipeline to automatically trigger a release process.",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId,"/release-flows/").concat(e.parameters.stage,"/runs")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Ml=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists runs of a release flow",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId,"/release-flows/").concat(e.parameters.stage,"/runs").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),zl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get information about the given release flow run",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId,"/release-flows/").concat(e.parameters.stage,"/runs/").concat(e.parameters.runId)},t.body=function(){},t}return T(t,e),t}(wu),Wl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Abort the given release flow run",t.withAuth=!0,t.requiredPermissions="Project > Pipelines > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/pipelines/").concat(e.parameters.pipelineId,"/release-flows/").concat(e.parameters.stage,"/runs/").concat(e.parameters.runId,"/abort")},t.body=function(){},t}return T(t,e),t}(ju),Vl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of secrets belonging to the project",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/secrets").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),$l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a secret with the specified payload",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Hl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates a secret with the specified payload",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),Yl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a secret with the specified payload",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),Zl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="View a secret including its contents",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId).concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Kl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Delete a secret",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Delete",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId)},t.body=function(){},t}return T(t,e),t}(_u),Xl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Update a secret",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Ql=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="View a secret with details about its linked addons",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId,"/details")},t.body=function(){},t}return T(t,e),t}(wu),ed=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Link an addon to the secret group or edit the settings of the linked addon.",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId,"/addons/").concat(e.parameters.addonId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),td=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about a given addon link.",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId,"/addons/").concat(e.parameters.addonId)},t.body=function(){},t}return T(t,e),t}(wu),nd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Unlinks an addon from the secret group.",t.withAuth=!0,t.requiredPermissions="Project > Secrets > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/secrets/").concat(e.parameters.secretId,"/addons/").concat(e.parameters.addonId)},t.body=function(){},t}return T(t,e),t}(_u),rd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of services belonging to the project",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),od=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new combined service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/combined")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),id=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates a combined service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/combined")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),sd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a combined service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/combined/").concat(e.parameters.serviceId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),ad=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new deployment service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/deployment")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),ud=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates a deployment service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/deployment")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),cd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a deployment service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/deployment/").concat(e.parameters.serviceId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),ld=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a new build service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/build")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),dd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates or updates a build service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/build")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Su),pd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates a build service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/build/").concat(e.parameters.serviceId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(Eu),hd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId)},t.body=function(){},t}return T(t,e),t}(wu),fd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Delete",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId)},t.body=function(){},t}return T(t,e),t}(_u),vd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Modifies the scaling settings for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > Scale Service",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/scale")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),md=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the deployment of the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > View Instances",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/deployment")},t.body=function(){},t}return T(t,e),t}(wu),bd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the deployment settings of the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > Update Deployment",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/deployment")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),yd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Restarts the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/restart")},t.body=function(){},t}return T(t,e),t}(ju),gd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Pause the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/pause")},t.body=function(){},t}return T(t,e),t}(ju),wd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Resumes the given service. Optionally takes several arguments to override resumed settings.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/resume")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),jd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists the ports for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/ports")},t.body=function(){},t}return T(t,e),t}(wu),_d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the list of ports for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/ports")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Sd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the build options for a given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build-options")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Ed=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates the version control source for a given build or combined service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build-source")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Pd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists the health checks for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/health-checks")},t.body=function(){},t}return T(t,e),t}(wu),Ad=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Updates health checks for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/health-checks")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),xd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Lists the builds for the service",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Id=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Start a new build for the given combined or build service. If given a commit sha, it will build that commit. Otherwise, the most recent relevant commit will be built. If the service provided is a build service, a branch name or pull request to build from is required.",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > Deploy Build",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Cd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about a build for the service",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build/").concat(e.parameters.buildId)},t.body=function(){},t}return T(t,e),t}(wu),kd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Aborts the given service build",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > Deploy Build",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build/").concat(e.parameters.buildId)},t.body=function(){},t}return T(t,e),t}(_u),Ud=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of containers for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > Deployment > View Instances",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/containers").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Od=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the branches of the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/branches").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Dd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets information about the pull-requests of the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/pull-requests").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Rd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get a list of templates",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/templates".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Bd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Create a template",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Create",t.endpointUrl=function(e){return"/v1/templates"},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Td=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get information about the given template.",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/templates/".concat(e.parameters.templateId).concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Nd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Update a template",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Update",t.endpointUrl=function(e){return"/v1/templates/".concat(e.parameters.templateId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Ld=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Delete a template",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Delete",t.endpointUrl=function(e){return"/v1/templates/".concat(e.parameters.templateId)},t.body=function(){},t}return T(t,e),t}(_u),qd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Run a template",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Run",t.endpointUrl=function(e){return"/v1/templates/".concat(e.parameters.templateId,"/runs")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Gd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get a list of template runs",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/templates/".concat(e.parameters.templateId,"/runs").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Fd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get information about the given template run.",t.withAuth=!0,t.requiredPermissions="Account > Templates > General > Read",t.endpointUrl=function(e){return"/v1/templates/".concat(e.parameters.templateId,"/runs/").concat(e.parameters.templateRunId)},t.body=function(){},t}return T(t,e),t}(wu),Jd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Abort the given template run.",t.withAuth=!0,t.requiredPermissions="Account > Templates > Runs > Abort",t.endpointUrl=function(e){return"/v1/templates/".concat(e.parameters.templateId,"/runs/").concat(e.parameters.templateRunId,"/abort")},t.body=function(){},t}return T(t,e),t}(ju),Md=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of repositories accessible to this account",t.withAuth=!0,t.requiredPermissions="Account > Git > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/integrations/vcs/repos".concat(r)},t.body=function(){},t}return T(t,e),t}(wu),zd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of branches for the repo",t.withAuth=!0,t.requiredPermissions="Account > Git > General > Read",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/integrations/vcs/repos/".concat(e.parameters.vcsService,"/").concat(e.parameters.repositoryOwner,"/").concat(e.parameters.repositoryName,"/branches").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),Wd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Generate a token for a specific VCS link.",t.withAuth=!0,t.requiredPermissions="Account > Git > Tokens > Read",t.endpointUrl=function(e){return"/v1/integrations/vcs/custom/".concat(e.parameters.customVCSId,"/token/").concat(e.parameters.vcsLinkId)},t.body=function(){},t}return T(t,e),t}(ju),Vd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets a list of volumes belonging to the project",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes")},t.body=function(){},t}return T(t,e),t}(wu),$d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Creates a volume with the specified payload",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Create",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Hd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Retrieve a volume",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Read",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes/").concat(e.parameters.volumeId)},t.body=function(){},t}return T(t,e),t}(wu),Yd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Update volume mounts and storage size",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes/").concat(e.parameters.volumeId)},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Zd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Deletes this volume and its associated data.",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Delete",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes/").concat(e.parameters.volumeId)},t.body=function(){},t}return T(t,e),t}(_u),Kd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Attach a volume",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes/").concat(e.parameters.volumeId,"/attach")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Xd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Detach a volume",t.withAuth=!0,t.requiredPermissions="Project > Volumes > General > Update",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/volumes/").concat(e.parameters.volumeId,"/detach")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),Qd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets the build arguments of the given service. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",t.withAuth=!0,t.requiredPermissions="Project > Services > Configuration > View Build Parameters",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build-arguments").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),ep=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Sets the build arguments for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > Configuration > Update Build Parameters",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build-arguments")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),tp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about the build arguments accessible by the given service. Also requires the permission 'Project > Secrets > General > Read'",t.withAuth=!0,t.requiredPermissions="Project > Services > Configuration > View Build Parameters",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/build-arguments/details")},t.body=function(){},t}return T(t,e),t}(wu),np=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Gets the runtime environment of the given service. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",t.withAuth=!0,t.requiredPermissions="Project > Services > Configuration > View Environment Variables",t.endpointUrl=function(e){var t,n=Object.entries(null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{}).filter((function(e){return void 0!==e[1]})),r=n.length>0?"?".concat(n.map((function(e){return"".concat(e[0],"=").concat(e[1])})).join("&")):"";return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/runtime-environment").concat(r)},t.body=function(){},t}return T(t,e),t}(wu),rp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Sets the runtime environment for the given service.",t.withAuth=!0,t.requiredPermissions="Project > Services > Configuration > Update Environment Variables",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/runtime-environment")},t.body=function(e){return JSON.stringify(e.data)},t}return T(t,e),t}(ju),op=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.description="Get details about the runtime environment accessible by the given service. Also requires the permission 'Project > Secrets > General > Read'",t.withAuth=!0,t.requiredPermissions="Project > Services > Configuration > View Environment Variables",t.endpointUrl=function(e){return"/v1/projects/".concat(e.parameters.projectId,"/services/").concat(e.parameters.serviceId,"/runtime-environment/details")},t.body=function(){},t}return T(t,e),t}(wu),ip=function(){function e(){this.loadContext()}return e.prototype.loadContext=function(){this.contextWrapper=this.loadContextWrapper()},e.prototype.getInfo=function(){return""},e.prototype.storeContext=function(e){return L(this,void 0,void 0,(function(){return q(this,(function(t){switch(t.label){case 0:return[4,this.writeContext(e)];case 1:return t.sent(),this.contextWrapper=e,[2]}}))}))},e.prototype.addContext=function(e,t){return void 0===t&&(t=!0),L(this,void 0,void 0,(function(){var n,r,o;return q(this,(function(i){switch(i.label){case 0:if(t||void 0===this.findContext(e.name))return[3,1];throw new Error("Context with name ".concat(e.name," already exists"));case 1:return[4,this.removeContext(e.name)];case 2:i.sent(),i.label=3;case 3:return n=N({host:"https://api.northflank.com"},e),r=this.contextWrapper,o={current:n.name,contexts:G(G([],r.contexts,!0),[n],!1),lastUpdateCheck:r.lastUpdateCheck},[4,this.storeContext(o)];case 4:return i.sent(),[2]}}))}))},e.prototype.removeContext=function(e){return L(this,void 0,void 0,(function(){var t,n,r,o;return q(this,(function(i){switch(i.label){case 0:return t=this.contextWrapper,n=t.contexts.filter((function(t){return t.name!==e})),r=t.current===e?void 0:t.current,o={current:r,contexts:G([],n,!0),lastUpdateCheck:t.lastUpdateCheck},[4,this.storeContext(o)];case 1:return i.sent(),[2]}}))}))},e.prototype.getCurrentContext=function(){var e=this.contextWrapper.current;return void 0===e?e:this.findContext(e)},e.prototype.findContext=function(e){return this.contextWrapper.contexts.find((function(t){return t.name===e}))},e.prototype.getCurrentBaseUrl=function(e){var t=this.getCurrentContext();if(!0===e&&!(null==t?void 0:t.host))throw new Error("Context (".concat(null==t?void 0:t.name,") doesn't have a target API host. Please login again."));return null==t?void 0:t.host},e.prototype.getCurrentProjectName=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.project},e.prototype.getCurrentName=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.name},e.prototype.getCurrentToken=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.token},e.prototype.getCurrentServiceName=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.service},e.prototype.getCurrentJobName=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.job},e.prototype.getCurrentPlanId=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.plan},e.prototype.getCurrentRegion=function(){var e;return null===(e=this.getCurrentContext())||void 0===e?void 0:e.region},e.prototype.useContext=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:if(!this.findContext(e))throw new Error("Context with name ".concat(e," doesn't exist"));return t=this.contextWrapper,n=N(N({},t),{current:e}),[4,this.storeContext(n)];case 1:return r.sent(),[2]}}))}))},e.prototype.updateToken=function(e,t){return L(this,void 0,void 0,(function(){var n,r,o,i,s;return q(this,(function(a){switch(a.label){case 0:if(n=null!=t?t:this.getCurrentName(),!(r=this.findContext(n)))throw new Error("Context with name ".concat(t," doesn't exist"));return o=this.contextWrapper,i=o.contexts.map((function(t){return t.name===n?N(N({},r),{token:e}):t})),s=N(N({},o),{contexts:i}),[4,this.storeContext(s)];case 1:return a.sent(),[2]}}))}))},e.prototype.useProjectId=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:if(void 0===(t=this.getCurrentContext()))throw new Error("Failed to set project id to current context, current context not defined");return n=N(N({},t),{project:e}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},e.prototype.useServiceId=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:if(void 0===(t=this.getCurrentContext()))throw new Error("Failed to set service id to current context, current context not defined");return n=N(N({},t),{service:e}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},e.prototype.useJobId=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:if(void 0===(t=this.getCurrentContext()))throw new Error("Failed to set job id to current context, current context not defined");return n=N(N({},t),{job:e}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},e.prototype.usePlanId=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:if(void 0===(t=this.getCurrentContext()))throw new Error("Failed to set plan id to current context, current context not defined");return n=N(N({},t),{plan:e}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},e.prototype.useRegion=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:if(void 0===(t=this.getCurrentContext()))throw new Error("Failed to set region id to current context, current context not defined");return n=N(N({},t),{region:e}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},e.prototype.getLastUpdateCheck=function(){return this.contextWrapper.lastUpdateCheck||new Date},e.prototype.setLastUpdateCheck=function(e){return L(this,void 0,void 0,(function(){var t,n;return q(this,(function(r){switch(r.label){case 0:return t=this.contextWrapper,n=N(N({},t),{lastUpdateCheck:e}),[4,this.storeContext(n)];case 1:return r.sent(),[2]}}))}))},e}(),sp=function(e){function t(t){var n=e.call(this)||this;return n.assertDir=function(e){return L(n,void 0,void 0,(function(){var t;return q(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,C.default.promises.mkdir(e,{recursive:!0})];case 1:return[2,n.sent()];case 2:throw t=n.sent(),console.log("Failed to login, local files could not be created: ".concat(e,", error: ").concat(t.message)),t;case 3:return[2]}}))}))},n.configPath=t||"".concat(A.default.homedir(),"/.northflank"),n.configFile="".concat(n.configPath,"/config.json"),n.loadContext(),n}return T(t,e),t.prototype.loadContextWrapper=function(){try{return JSON.parse(C.default.readFileSync(this.configFile,"utf8"))}catch(e){return{contexts:[],lastUpdateCheck:new Date(0)}}},t.prototype.writeContext=function(e){return L(this,void 0,void 0,(function(){var t;return q(this,(function(n){switch(n.label){case 0:return[4,this.assertConfigDir()];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,4,,5]),[4,C.default.promises.writeFile(this.configFile,JSON.stringify(e,null,"\t"),{mode:416})];case 3:return n.sent(),[3,5];case 4:throw t=n.sent(),console.log("Failed to persist api context, local files could not be created, error: ".concat(t.message)),t;case 5:return[2]}}))}))},t.prototype.assertConfigDir=function(){return L(this,void 0,void 0,(function(){return q(this,(function(e){switch(e.label){case 0:return[4,this.assertDir(this.configPath)];case 1:return e.sent(),[2]}}))}))},t.prototype.getInfo=function(){return"Cli config stored in: ".concat(this.configPath)},t}(ip),ap=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.inMemoryContextWrapper={contexts:[],lastUpdateCheck:new Date(0)},t}return T(t,e),t.prototype.loadContextWrapper=function(){return this.inMemoryContextWrapper||(this.inMemoryContextWrapper={contexts:[],lastUpdateCheck:new Date(0)}),this.inMemoryContextWrapper},t.prototype.writeContext=function(e){return L(this,void 0,void 0,(function(){return q(this,(function(t){return this.inMemoryContextWrapper=e,[2]}))}))},t}(ip),up=function(e,t){void 0===t&&(t={});var n,r=this;this.baseUrl=function(){return r.contextProvider.getCurrentBaseUrl()},this.contextProvider=e,this.forwarding=new du(e,new rd(e,t).call,new Tu(e,t).call),this.exec=new fu(e),this.logs=new Iu(e),this.metrics=new Uu(e),this.endpoints={list:(n={},n.projects=new Ou(e,t),n.addons=new Tu(e,t),n.invoices=new vc(e,t),n.providers=new bc(e,t),n.integrations=new yc(e,t),n.clusters=new Sc(e,t),n.jobs=new Ic(e,t),n.logSinks=new dl(e,t),n.registries=new yl(e,t),n.domains=new Sl(e,t),n.plans=new Rl(e,t),n.regions=new Bl(e,t),n.vcs=new Nl(e,t),n.pipelines=new Ll(e,t),n.releaseFlowRuns=new Ml(e,t),n.secrets=new Vl(e,t),n.services=new rd(e,t),n.templates=new Rd(e,t),n.templateRuns=new Gd(e,t),n.repos=new Md(e,t),n.branches=new zd(e,t),n.volumes=new Vd(e,t),n),create:function(){var n,r={};return r.project=new Du(e,t),r.addon=((n=new Nu(e,t)).backupSchedule=new dc(e,t),n),r.integration=new gc(e,t),r.cluster=new Ec(e,t),r.job=function(){var n={};return n.manual=new Uc(e,t),n.cron=new Rc(e,t),n}(),r.logSink=new pl(e,t),r.domain=new El(e,t),r.secret=new $l(e,t),r.service=function(){var n={};return n.combined=new od(e,t),n.deployment=new ad(e,t),n.build=new ld(e,t),n}(),r.template=new Bd(e,t),r.customVcs=function(){var n={};return n.token=new Wd(e,t),n}(),r.volume=new $d(e,t),r}(),get:function(){var n,r,o={};return o.project=new Ru(e,t),o.addon=((r=new qu(e,t)).credentials=new Ju(e,t),r.types=new Mu(e,t),r.version=new Wu(e,t),r.backups=new Yu(e,t),r.backup=((n=new Ku(e,t)).download=new uc(e,t),n),r.restores=new ec(e,t),r.containers=new nc(e,t),r.backupSchedules=new lc(e,t),r.pitrWindow=new hc(e,t),r),o.invoice=function(){var n={};return n.details=new mc(e,t),n}(),o.integration=new wc(e,t),o.cluster=new Pc(e,t),o.job=function(){var n=new Cc(e,t);return n.runs=new Fc(e,t),n.run=new Mc(e,t),n.healthChecks=new Vc(e,t),n.builds=new Hc(e,t),n.build=new Zc(e,t),n.buildArguments=new el(e,t),n.buildArgumentDetails=new nl(e,t),n.runtimeEnvironment=new rl(e,t),n.runtimeEnvironmentDetails=new il(e,t),n.deployment=new sl(e,t),n.containers=new ul(e,t),n.branches=new cl(e,t),n.pullRequests=new ll(e,t),n}(),o.logSink=new hl(e,t),o.registry=new wl(e,t),o.domain=new Pl(e,t),o.subdomain=new Cl(e,t),o.dnsId=new Tl(e,t),o.pipeline=new ql(e,t),o.releaseFlow=new Gl(e,t),o.releaseFlowRun=new zl(e,t),o.secret=new Zl(e,t),o.secretDetails=new Ql(e,t),o.secretLink=new td(e,t),o.service=function(){var n=new hd(e,t);return n.deployment=new md(e,t),n.ports=new jd(e,t),n.healthChecks=new Pd(e,t),n.builds=new xd(e,t),n.build=new Cd(e,t),n.containers=new Ud(e,t),n.branches=new Od(e,t),n.pullRequests=new Dd(e,t),n.buildArguments=new Qd(e,t),n.buildArgumentDetails=new tp(e,t),n.runtimeEnvironment=new np(e,t),n.runtimeEnvironmentDetails=new op(e,t),n}(),o.template=new Td(e,t),o.templateRun=new Fd(e,t),o.volume=new Hd(e,t),o}(),delete:function(){var n,r={};return r.project=new Bu(e,t),r.addon=((n=new Fu(e,t)).backupSchedule=new pc(e,t),n),r.backup=new Xu(e,t),r.integration=new _c(e,t),r.cluster=new xc(e,t),r.job=new kc(e,t),r.logSink=new fl(e,t),r.registry=new jl(e,t),r.domain=new Al(e,t),r.subdomain=new kl(e,t),r.secret=new Kl(e,t),r.secretLink=new nd(e,t),r.service=new fd(e,t),r.template=new Ld(e,t),r.volume=new Zd(e,t),r}(),put:function(){var n,r={};return r.addon=new Lu(e,t),r.job=((n={}).manual=new Oc(e,t),n.cron=new Bc(e,t),n),r.secret=new Hl(e,t),r.service=function(){var n={};return n.combined=new id(e,t),n.deployment=new ud(e,t),n.build=new dd(e,t),n}(),r}(),patch:function(){var n,r={};return r.addon=new Gu(e,t),r.job=((n={}).manual=new Dc(e,t),n.cron=new Tc(e,t),n),r.secret=new Yl(e,t),r.service=function(){var n={};return n.combined=new sd(e,t),n.deployment=new cd(e,t),n.build=new pd(e,t),n}(),r}(),scale:function(){var n={};return n.addon=new zu(e,t),n.job=new Nc(e,t),n.service=new vd(e,t),n}(),update:function(){var n,r={};return r.addon=((n={}).version=new Vu(e,t),n.networkSettings=new $u(e,t),n.security=new Hu(e,t),n),r.integration=new jc(e,t),r.cluster=new Ac(e,t),r.job=function(){var n={};return n.settings=new Wc(e,t),n.healthChecks=new $c(e,t),n.buildOptions=new Xc(e,t),n.buildSource=new Qc(e,t),n.buildArguments=new tl(e,t),n.runtimeEnvironment=new ol(e,t),n.deployment=new al(e,t),n}(),r.logSink=new vl(e,t),r.registry=new _l(e,t),r.releaseFlow=new Fl(e,t),r.secret=new Xl(e,t),r.secretLink=new ed(e,t),r.service=function(){var n={};return n.deployment=new bd(e,t),n.ports=new _d(e,t),n.buildOptions=new Sd(e,t),n.buildSource=new Ed(e,t),n.healthChecks=new Ad(e,t),n.buildArguments=new ep(e,t),n.runtimeEnvironment=new rp(e,t),n}(),r.template=new Nd(e,t),r.volume=new Yd(e,t),r}(),backup:function(){var n={};return n.addon=new Zu(e,t),n}(),restore:function(){var n,r={};return r.addon=((n={}).backup=new Qu(e,t),n),r}(),import:function(){var n,r={};return r.addon=((n={}).backup=new tc(e,t),n),r}(),pause:function(){var n={};return n.addon=new rc(e,t),n.job=new qc(e,t),n.logSink=new ml(e,t),n.service=new gd(e,t),n}(),resume:function(){var n={};return n.addon=new oc(e,t),n.job=new Gc(e,t),n.logSink=new bl(e,t),n.service=new wd(e,t),n}(),restart:function(){var n={};return n.addon=new ic(e,t),n.service=new yd(e,t),n}(),abort:function(){var n,r={};return r.addon=((n={}).backup=new sc(e,t),n.restore=new cc(e,t),n),r.job=function(){var n={};return n.run=new zc(e,t),n.build=new Kc(e,t),n}(),r.releaseFlowRun=new Wl(e,t),r.service=function(){var n={};return n.build=new kd(e,t),n}(),r.templateRun=new Jd(e,t),r}(),retain:function(){var n,r={};return r.addon=((n={}).backup=new ac(e,t),n),r}(),start:function(){var n,r={};return r.addon=((n={}).pitr=new fc(e,t),n),r.job=function(){var n={};return n.run=new Jc(e,t),n.build=new Yc(e,t),n}(),r.service=function(){var n={};return n.build=new Id(e,t),n}(),r}(),suspend:function(){var n={};return n.job=new Lc(e,t),n}(),add:function(){var n,r={};return r.registry=new gl(e,t),r.domain=((n={}).subdomain=new Il(e,t),n),r}(),verify:function(){var n={};return n.domain=new xl(e,t),n.subdomain=new Ul(e,t),n}(),assign:function(){var n,r={};return r.subdomain=((n={}).service=new Ol(e,t),n),r}(),unassign:function(){var n={};return n.subdomain=new Dl(e,t),n}(),run:function(){var n={};return n.releaseFlow=new Jl(e,t),n.template=new qd(e,t),n}(),attach:function(){var n={};return n.volume=new Kd(e,t),n}(),detach:function(){var n={};return n.volume=new Xd(e,t),n}()},this.list=function(){var e={};return e.projects=r.endpoints.list.projects.call,e.addons=r.endpoints.list.addons.call,e.invoices=r.endpoints.list.invoices.call,e.providers=r.endpoints.list.providers.call,e.integrations=r.endpoints.list.integrations.call,e.clusters=r.endpoints.list.clusters.call,e.jobs=r.endpoints.list.jobs.call,e.logSinks=r.endpoints.list.logSinks.call,e.registries=r.endpoints.list.registries.call,e.domains=r.endpoints.list.domains.call,e.plans=r.endpoints.list.plans.call,e.regions=r.endpoints.list.regions.call,e.vcs=r.endpoints.list.vcs.call,e.pipelines=r.endpoints.list.pipelines.call,e.releaseFlowRuns=r.endpoints.list.releaseFlowRuns.call,e.secrets=r.endpoints.list.secrets.call,e.services=r.endpoints.list.services.call,e.templates=r.endpoints.list.templates.call,e.templateRuns=r.endpoints.list.templateRuns.call,e.repos=r.endpoints.list.repos.call,e.branches=r.endpoints.list.branches.call,e.volumes=r.endpoints.list.volumes.call,e}(),this.create=function(){var e,t={};return t.project=r.endpoints.create.project.call,t.addon=((e=r.endpoints.create.addon.call).backupSchedule=r.endpoints.create.addon.backupSchedule.call,e),t.integration=r.endpoints.create.integration.call,t.cluster=r.endpoints.create.cluster.call,t.job=function(){var e={};return e.manual=r.endpoints.create.job.manual.call,e.cron=r.endpoints.create.job.cron.call,e}(),t.logSink=r.endpoints.create.logSink.call,t.domain=r.endpoints.create.domain.call,t.secret=r.endpoints.create.secret.call,t.service=function(){var e={};return e.combined=r.endpoints.create.service.combined.call,e.deployment=r.endpoints.create.service.deployment.call,e.build=r.endpoints.create.service.build.call,e}(),t.template=r.endpoints.create.template.call,t.customVcs=function(){var e={};return e.token=r.endpoints.create.customVcs.token.call,e}(),t.volume=r.endpoints.create.volume.call,t}(),this.get=function(){var e,t,n={};return n.project=r.endpoints.get.project.call,n.addon=((t=r.endpoints.get.addon.call).credentials=r.endpoints.get.addon.credentials.call,t.types=r.endpoints.get.addon.types.call,t.version=r.endpoints.get.addon.version.call,t.backups=r.endpoints.get.addon.backups.call,t.backup=((e=r.endpoints.get.addon.backup.call).download=r.endpoints.get.addon.backup.download.call,e),t.restores=r.endpoints.get.addon.restores.call,t.containers=r.endpoints.get.addon.containers.call,t.backupSchedules=r.endpoints.get.addon.backupSchedules.call,t.pitrWindow=r.endpoints.get.addon.pitrWindow.call,t.logs=r.logs.getAddonLogs,t.logTail=r.logs.tailAddonLogs,t.metrics=r.metrics.getAddonMetrics,t.metricsRange=r.metrics.getAddonMetricsRange,t),n.invoice=function(){var e={};return e.details=r.endpoints.get.invoice.details.call,e}(),n.integration=r.endpoints.get.integration.call,n.cluster=r.endpoints.get.cluster.call,n.job=function(){var e=r.endpoints.get.job.call;return e.runs=r.endpoints.get.job.runs.call,e.run=r.endpoints.get.job.run.call,e.healthChecks=r.endpoints.get.job.healthChecks.call,e.builds=r.endpoints.get.job.builds.call,e.build=r.endpoints.get.job.build.call,e.buildArguments=r.endpoints.get.job.buildArguments.call,e.buildArgumentDetails=r.endpoints.get.job.buildArgumentDetails.call,e.runtimeEnvironment=r.endpoints.get.job.runtimeEnvironment.call,e.runtimeEnvironmentDetails=r.endpoints.get.job.runtimeEnvironmentDetails.call,e.deployment=r.endpoints.get.job.deployment.call,e.containers=r.endpoints.get.job.containers.call,e.branches=r.endpoints.get.job.branches.call,e.pullRequests=r.endpoints.get.job.pullRequests.call,e.logs=r.logs.getJobLogs,e.buildLogs=r.logs.getJobBuildLogs,e.logTail=r.logs.tailJobLogs,e.buildLogTail=r.logs.tailJobBuildLogs,e.metrics=r.metrics.getJobMetrics,e.buildMetrics=r.metrics.getJobBuildMetrics,e.metricsRange=r.metrics.getJobMetricsRange,e.buildMetricsRange=r.metrics.getJobBuildMetricsRange,e}(),n.logSink=r.endpoints.get.logSink.call,n.registry=r.endpoints.get.registry.call,n.domain=r.endpoints.get.domain.call,n.subdomain=r.endpoints.get.subdomain.call,n.dnsId=r.endpoints.get.dnsId.call,n.pipeline=r.endpoints.get.pipeline.call,n.releaseFlow=r.endpoints.get.releaseFlow.call,n.releaseFlowRun=r.endpoints.get.releaseFlowRun.call,n.secret=r.endpoints.get.secret.call,n.secretDetails=r.endpoints.get.secretDetails.call,n.secretLink=r.endpoints.get.secretLink.call,n.service=function(){var e=r.endpoints.get.service.call;return e.deployment=r.endpoints.get.service.deployment.call,e.ports=r.endpoints.get.service.ports.call,e.healthChecks=r.endpoints.get.service.healthChecks.call,e.builds=r.endpoints.get.service.builds.call,e.build=r.endpoints.get.service.build.call,e.containers=r.endpoints.get.service.containers.call,e.branches=r.endpoints.get.service.branches.call,e.pullRequests=r.endpoints.get.service.pullRequests.call,e.buildArguments=r.endpoints.get.service.buildArguments.call,e.buildArgumentDetails=r.endpoints.get.service.buildArgumentDetails.call,e.runtimeEnvironment=r.endpoints.get.service.runtimeEnvironment.call,e.runtimeEnvironmentDetails=r.endpoints.get.service.runtimeEnvironmentDetails.call,e.logs=r.logs.getServiceLogs,e.buildLogs=r.logs.getServiceBuildLogs,e.logTail=r.logs.tailServiceLogs,e.buildLogTail=r.logs.tailServiceBuildLogs,e.metrics=r.metrics.getServiceMetrics,e.buildMetrics=r.metrics.getServiceBuildMetrics,e.metricsRange=r.metrics.getServiceMetricsRange,e.buildMetricsRange=r.metrics.getServiceBuildMetricsRange,e}(),n.template=r.endpoints.get.template.call,n.templateRun=r.endpoints.get.templateRun.call,n.volume=r.endpoints.get.volume.call,n}(),this.delete=function(){var e,t={};return t.project=r.endpoints.delete.project.call,t.addon=((e=r.endpoints.delete.addon.call).backupSchedule=r.endpoints.delete.addon.backupSchedule.call,e),t.backup=r.endpoints.delete.backup.call,t.integration=r.endpoints.delete.integration.call,t.cluster=r.endpoints.delete.cluster.call,t.job=r.endpoints.delete.job.call,t.logSink=r.endpoints.delete.logSink.call,t.registry=r.endpoints.delete.registry.call,t.domain=r.endpoints.delete.domain.call,t.subdomain=r.endpoints.delete.subdomain.call,t.secret=r.endpoints.delete.secret.call,t.secretLink=r.endpoints.delete.secretLink.call,t.service=r.endpoints.delete.service.call,t.template=r.endpoints.delete.template.call,t.volume=r.endpoints.delete.volume.call,t}(),this.put=function(){var e,t={};return t.addon=r.endpoints.put.addon.call,t.job=((e={}).manual=r.endpoints.put.job.manual.call,e.cron=r.endpoints.put.job.cron.call,e),t.secret=r.endpoints.put.secret.call,t.service=function(){var e={};return e.combined=r.endpoints.put.service.combined.call,e.deployment=r.endpoints.put.service.deployment.call,e.build=r.endpoints.put.service.build.call,e}(),t}(),this.patch=function(){var e,t={};return t.addon=r.endpoints.patch.addon.call,t.job=((e={}).manual=r.endpoints.patch.job.manual.call,e.cron=r.endpoints.patch.job.cron.call,e),t.secret=r.endpoints.patch.secret.call,t.service=function(){var e={};return e.combined=r.endpoints.patch.service.combined.call,e.deployment=r.endpoints.patch.service.deployment.call,e.build=r.endpoints.patch.service.build.call,e}(),t}(),this.scale=function(){var e={};return e.addon=r.endpoints.scale.addon.call,e.job=r.endpoints.scale.job.call,e.service=r.endpoints.scale.service.call,e}(),this.update=function(){var e,t={};return t.addon=((e={}).version=r.endpoints.update.addon.version.call,e.networkSettings=r.endpoints.update.addon.networkSettings.call,e.security=r.endpoints.update.addon.security.call,e),t.integration=r.endpoints.update.integration.call,t.cluster=r.endpoints.update.cluster.call,t.job=function(){var e={};return e.settings=r.endpoints.update.job.settings.call,e.healthChecks=r.endpoints.update.job.healthChecks.call,e.buildOptions=r.endpoints.update.job.buildOptions.call,e.buildSource=r.endpoints.update.job.buildSource.call,e.buildArguments=r.endpoints.update.job.buildArguments.call,e.runtimeEnvironment=r.endpoints.update.job.runtimeEnvironment.call,e.deployment=r.endpoints.update.job.deployment.call,e}(),t.logSink=r.endpoints.update.logSink.call,t.registry=r.endpoints.update.registry.call,t.releaseFlow=r.endpoints.update.releaseFlow.call,t.secret=r.endpoints.update.secret.call,t.secretLink=r.endpoints.update.secretLink.call,t.service=function(){var e={};return e.deployment=r.endpoints.update.service.deployment.call,e.ports=r.endpoints.update.service.ports.call,e.buildOptions=r.endpoints.update.service.buildOptions.call,e.buildSource=r.endpoints.update.service.buildSource.call,e.healthChecks=r.endpoints.update.service.healthChecks.call,e.buildArguments=r.endpoints.update.service.buildArguments.call,e.runtimeEnvironment=r.endpoints.update.service.runtimeEnvironment.call,e}(),t.template=r.endpoints.update.template.call,t.volume=r.endpoints.update.volume.call,t}(),this.backup=function(){var e={};return e.addon=r.endpoints.backup.addon.call,e}(),this.restore=function(){var e,t={};return t.addon=((e={}).backup=r.endpoints.restore.addon.backup.call,e),t}(),this.import=function(){var e,t={};return t.addon=((e={}).backup=r.endpoints.import.addon.backup.call,e),t}(),this.pause=function(){var e={};return e.addon=r.endpoints.pause.addon.call,e.job=r.endpoints.pause.job.call,e.logSink=r.endpoints.pause.logSink.call,e.service=r.endpoints.pause.service.call,e}(),this.resume=function(){var e={};return e.addon=r.endpoints.resume.addon.call,e.job=r.endpoints.resume.job.call,e.logSink=r.endpoints.resume.logSink.call,e.service=r.endpoints.resume.service.call,e}(),this.restart=function(){var e={};return e.addon=r.endpoints.restart.addon.call,e.service=r.endpoints.restart.service.call,e}(),this.abort=function(){var e,t={};return t.addon=((e={}).backup=r.endpoints.abort.addon.backup.call,e.restore=r.endpoints.abort.addon.restore.call,e),t.job=function(){var e={};return e.run=r.endpoints.abort.job.run.call,e.build=r.endpoints.abort.job.build.call,e}(),t.releaseFlowRun=r.endpoints.abort.releaseFlowRun.call,t.service=function(){var e={};return e.build=r.endpoints.abort.service.build.call,e}(),t.templateRun=r.endpoints.abort.templateRun.call,t}(),this.retain=function(){var e,t={};return t.addon=((e={}).backup=r.endpoints.retain.addon.backup.call,e),t}(),this.start=function(){var e,t={};return t.addon=((e={}).pitr=r.endpoints.start.addon.pitr.call,e),t.job=function(){var e={};return e.run=r.endpoints.start.job.run.call,e.build=r.endpoints.start.job.build.call,e}(),t.service=function(){var e={};return e.build=r.endpoints.start.service.build.call,e}(),t}(),this.suspend=function(){var e={};return e.job=r.endpoints.suspend.job.call,e}(),this.add=function(){var e,t={};return t.registry=r.endpoints.add.registry.call,t.domain=((e={}).subdomain=r.endpoints.add.domain.subdomain.call,e),t}(),this.verify=function(){var e={};return e.domain=r.endpoints.verify.domain.call,e.subdomain=r.endpoints.verify.subdomain.call,e}(),this.assign=function(){var e,t={};return t.subdomain=((e={}).service=r.endpoints.assign.subdomain.service.call,e),t}(),this.unassign=function(){var e={};return e.subdomain=r.endpoints.unassign.subdomain.call,e}(),this.run=function(){var e={};return e.releaseFlow=r.endpoints.run.releaseFlow.call,e.template=r.endpoints.run.template.call,e}(),this.attach=function(){var e={};return e.volume=r.endpoints.attach.volume.call,e}(),this.detach=function(){var e={};return e.volume=r.endpoints.detach.volume.call,e}()};exports.AbortAddonBackupEndpoint=sc,exports.AbortAddonRestoreEndpoint=cc,exports.AbortJobBuildEndpoint=Kc,exports.AbortJobRunEndpoint=zc,exports.AbortReleaseflowrunEndpoint=Wl,exports.AbortServiceBuildEndpoint=kd,exports.AbortTemplaterunEndpoint=Jd,exports.AddDomainSubdomainEndpoint=Il,exports.AddRegistryEndpoint=gl,exports.ApiClient=up,exports.ApiClientContextProvider=ip,exports.ApiClientFileContextProvider=sp,exports.ApiClientInMemoryContextProvider=ap,exports.ApiEndpoint=gu,exports.AssignSubdomainServiceEndpoint=Ol,exports.AttachVolumeEndpoint=Kd,exports.BackupAddonEndpoint=Zu,exports.CreateAddonBackupscheduleEndpoint=dc,exports.CreateAddonEndpoint=Nu,exports.CreateClusterEndpoint=Ec,exports.CreateCustomvcsTokenEndpoint=Wd,exports.CreateDomainEndpoint=El,exports.CreateIntegrationEndpoint=gc,exports.CreateJobCronEndpoint=Rc,exports.CreateJobManualEndpoint=Uc,exports.CreateLogsinkEndpoint=pl,exports.CreateProjectEndpoint=Du,exports.CreateSecretEndpoint=$l,exports.CreateServiceBuildEndpoint=ld,exports.CreateServiceCombinedEndpoint=od,exports.CreateServiceDeploymentEndpoint=ad,exports.CreateTemplateEndpoint=Bd,exports.CreateVolumeEndpoint=$d,exports.DeleteAddonBackupscheduleEndpoint=pc,exports.DeleteAddonEndpoint=Fu,exports.DeleteApiEndpoint=_u,exports.DeleteBackupEndpoint=Xu,exports.DeleteClusterEndpoint=xc,exports.DeleteDomainEndpoint=Al,exports.DeleteIntegrationEndpoint=_c,exports.DeleteJobEndpoint=kc,exports.DeleteLogsinkEndpoint=fl,exports.DeleteProjectEndpoint=Bu,exports.DeleteRegistryEndpoint=jl,exports.DeleteSecretEndpoint=Kl,exports.DeleteSecretlinkEndpoint=nd,exports.DeleteServiceEndpoint=fd,exports.DeleteSubdomainEndpoint=kl,exports.DeleteTemplateEndpoint=Ld,exports.DeleteVolumeEndpoint=Zd,exports.DetachVolumeEndpoint=Xd,exports.ExecCommandStandard=hu,exports.GetAddonBackupDownloadEndpoint=uc,exports.GetAddonBackupEndpoint=Ku,exports.GetAddonBackupsEndpoint=Yu,exports.GetAddonBackupschedulesEndpoint=lc,exports.GetAddonContainersEndpoint=nc,exports.GetAddonCredentialsEndpoint=Ju,exports.GetAddonEndpoint=qu,exports.GetAddonPitrwindowEndpoint=hc,exports.GetAddonRestoresEndpoint=ec,exports.GetAddonTypesEndpoint=Mu,exports.GetAddonVersionEndpoint=Wu,exports.GetApiEndpoint=wu,exports.GetClusterEndpoint=Pc,exports.GetDnsidEndpoint=Tl,exports.GetDomainEndpoint=Pl,exports.GetIntegrationEndpoint=wc,exports.GetInvoiceDetailsEndpoint=mc,exports.GetJobBranchesEndpoint=cl,exports.GetJobBuildEndpoint=Zc,exports.GetJobBuildargumentdetailsEndpoint=nl,exports.GetJobBuildargumentsEndpoint=el,exports.GetJobBuildsEndpoint=Hc,exports.GetJobContainersEndpoint=ul,exports.GetJobDeploymentEndpoint=sl,exports.GetJobEndpoint=Cc,exports.GetJobHealthchecksEndpoint=Vc,exports.GetJobPullrequestsEndpoint=ll,exports.GetJobRunEndpoint=Mc,exports.GetJobRunsEndpoint=Fc,exports.GetJobRuntimeenvironmentEndpoint=rl,exports.GetJobRuntimeenvironmentdetailsEndpoint=il,exports.GetLogsinkEndpoint=hl,exports.GetPipelineEndpoint=ql,exports.GetProjectEndpoint=Ru,exports.GetRegistryEndpoint=wl,exports.GetReleaseflowEndpoint=Gl,exports.GetReleaseflowrunEndpoint=zl,exports.GetSecretEndpoint=Zl,exports.GetSecretdetailsEndpoint=Ql,exports.GetSecretlinkEndpoint=td,exports.GetServiceBranchesEndpoint=Od,exports.GetServiceBuildEndpoint=Cd,exports.GetServiceBuildargumentdetailsEndpoint=tp,exports.GetServiceBuildargumentsEndpoint=Qd,exports.GetServiceBuildsEndpoint=xd,exports.GetServiceContainersEndpoint=Ud,exports.GetServiceDeploymentEndpoint=md,exports.GetServiceEndpoint=hd,exports.GetServiceHealthchecksEndpoint=Pd,exports.GetServicePortsEndpoint=jd,exports.GetServicePullrequestsEndpoint=Dd,exports.GetServiceRuntimeenvironmentEndpoint=np,exports.GetServiceRuntimeenvironmentdetailsEndpoint=op,exports.GetSubdomainEndpoint=Cl,exports.GetTemplateEndpoint=Td,exports.GetTemplaterunEndpoint=Fd,exports.GetVolumeEndpoint=Hd,exports.ImportAddonBackupEndpoint=tc,exports.ListAddonsEndpoint=Tu,exports.ListBranchesEndpoint=zd,exports.ListClustersEndpoint=Sc,exports.ListDomainsEndpoint=Sl,exports.ListIntegrationsEndpoint=yc,exports.ListInvoicesEndpoint=vc,exports.ListJobsEndpoint=Ic,exports.ListLogsinksEndpoint=dl,exports.ListPipelinesEndpoint=Ll,exports.ListPlansEndpoint=Rl,exports.ListProjectsEndpoint=Ou,exports.ListProvidersEndpoint=bc,exports.ListRegionsEndpoint=Bl,exports.ListRegistriesEndpoint=yl,exports.ListReleaseflowrunsEndpoint=Ml,exports.ListReposEndpoint=Md,exports.ListSecretsEndpoint=Vl,exports.ListServicesEndpoint=rd,exports.ListTemplaterunsEndpoint=Gd,exports.ListTemplatesEndpoint=Rd,exports.ListVcsEndpoint=Nl,exports.ListVolumesEndpoint=Vd,exports.NorthflankApiCallError=vu,exports.NorthflankExecCommand=fu,exports.NorthflankLogFetch=Iu,exports.NorthflankMetricFetch=Uu,exports.NorthflankPortForwarder=du,exports.PatchAddonEndpoint=Gu,exports.PatchApiEndpoint=Eu,exports.PatchJobCronEndpoint=Tc,exports.PatchJobManualEndpoint=Dc,exports.PatchSecretEndpoint=Yl,exports.PatchServiceBuildEndpoint=pd,exports.PatchServiceCombinedEndpoint=sd,exports.PatchServiceDeploymentEndpoint=cd,exports.PauseAddonEndpoint=rc,exports.PauseJobEndpoint=qc,exports.PauseLogsinkEndpoint=ml,exports.PauseServiceEndpoint=gd,exports.PostApiEndpoint=ju,exports.PutAddonEndpoint=Lu,exports.PutApiEndpoint=Su,exports.PutJobCronEndpoint=Bc,exports.PutJobManualEndpoint=Oc,exports.PutSecretEndpoint=Hl,exports.PutServiceBuildEndpoint=dd,exports.PutServiceCombinedEndpoint=id,exports.PutServiceDeploymentEndpoint=ud,exports.RestartAddonEndpoint=ic,exports.RestartServiceEndpoint=yd,exports.RestoreAddonBackupEndpoint=Qu,exports.ResumeAddonEndpoint=oc,exports.ResumeJobEndpoint=Gc,exports.ResumeLogsinkEndpoint=bl,exports.ResumeServiceEndpoint=wd,exports.RetainAddonBackupEndpoint=ac,exports.RunReleaseflowEndpoint=Jl,exports.RunTemplateEndpoint=qd,exports.ScaleAddonEndpoint=zu,exports.ScaleJobEndpoint=Nc,exports.ScaleServiceEndpoint=vd,exports.StartAddonPitrEndpoint=fc,exports.StartJobBuildEndpoint=Yc,exports.StartJobRunEndpoint=Jc,exports.StartServiceBuildEndpoint=Id,exports.SuspendJobEndpoint=Lc,exports.UnassignSubdomainEndpoint=Dl,exports.UpdateAddonNetworksettingsEndpoint=$u,exports.UpdateAddonSecurityEndpoint=Hu,exports.UpdateAddonVersionEndpoint=Vu,exports.UpdateClusterEndpoint=Ac,exports.UpdateIntegrationEndpoint=jc,exports.UpdateJobBuildargumentsEndpoint=tl,exports.UpdateJobBuildoptionsEndpoint=Xc,exports.UpdateJobBuildsourceEndpoint=Qc,exports.UpdateJobDeploymentEndpoint=al,exports.UpdateJobHealthchecksEndpoint=$c,exports.UpdateJobRuntimeenvironmentEndpoint=ol,exports.UpdateJobSettingsEndpoint=Wc,exports.UpdateLogsinkEndpoint=vl,exports.UpdateRegistryEndpoint=_l,exports.UpdateReleaseflowEndpoint=Fl,exports.UpdateSecretEndpoint=Xl,exports.UpdateSecretlinkEndpoint=ed,exports.UpdateServiceBuildargumentsEndpoint=ep,exports.UpdateServiceBuildoptionsEndpoint=Sd,exports.UpdateServiceBuildsourceEndpoint=Ed,exports.UpdateServiceDeploymentEndpoint=bd,exports.UpdateServiceHealthchecksEndpoint=Ad,exports.UpdateServicePortsEndpoint=_d,exports.UpdateServiceRuntimeenvironmentEndpoint=rp,exports.UpdateTemplateEndpoint=Nd,exports.UpdateVolumeEndpoint=Yd,exports.VerifyDomainEndpoint=xl,exports.VerifySubdomainEndpoint=Ul;