appmesh 3.1.15 → 3.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -5
- package/dist/appmesh.esm.js +1 -1
- package/package.json +1 -1
- package/src/appmesh.js +392 -16
- package/src/appmesh_tcp.js +146 -35
- package/src/request_signature.js +33 -18
- package/src/worker.js +47 -8
package/dist/appmesh.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={};const t={};function n(r){const o=t[r];if(void 0!==o)return o.exports;const i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.m=e,(()=>{const e=Object.getPrototypeOf;let t;n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"==typeof r.then)return r}const i=Object.create(null);n.r(i);const s={};t=t||[null,e({}),e([]),e(e)];for(var a=2&o&&r;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(e=>s[e]=()=>r[e]);return s.default=()=>r,n.d(i,s),i}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>{const t=[];return n.f.j(e,t),Promise.all(t)},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{const e={994:()=>import("./994.appmesh.esm.js"),453:()=>import("./453.appmesh.esm.js"),603:()=>import("./603.appmesh.esm.js"),582:()=>import("./582.appmesh.esm.js"),770:()=>import("./770.appmesh.esm.js")},t={792:0},r=e=>{let{__webpack_esm_ids__:r,__webpack_esm_modules__:o,__webpack_esm_runtime__:i}=e;var s,a,u=0;for(s in o)n.o(o,s)&&(n.m[s]=o[s]);for(i&&i(n);u<r.length;u++)a=r[u],n.o(t,a)&&t[a]&&t[a][0](),t[a]=0};n.f.j=(o,i)=>{let s=n.o(t,o)?t[o]:void 0;if(0!==s)if(s)i.push(s[1]);else{let n=e[o]().then(r,e=>{throw 0!==t[o]&&(t[o]=void 0),e});n=Promise.race([n,new Promise(e=>s=t[o]=[e])]),i.push(s[1]=n)}}})();var r={};function o(e,t){return function(){return e.apply(t,arguments)}}n.r(r),n.d(r,{hasBrowserEnv:()=>qe,hasStandardBrowserEnv:()=>He,hasStandardBrowserWebWorkerEnv:()=>ze,navigator:()=>Me,origin:()=>Ge});const{toString:i}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:a,toStringTag:u}=Symbol,c=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),l=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),f=(e,t,n)=>e===Object.prototype||!n&&null===t,p=(e,t)=>{let n=e;const r=[];for(;null!=n;){if(-1!==r.indexOf(n))return!1;r.push(n);const o=s(n);if(f(n,o,n===e))return!1;if(c(n,t))return!0;n=o}return!1},h=(d=Object.create(null),e=>{const t=i.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const y=e=>(e=e.toLowerCase(),t=>h(t)===e),m=e=>t=>typeof t===e,{isArray:b}=Array,g=m("undefined");function w(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const v=y("ArrayBuffer");const _=m("string"),O=m("function"),E=m("number"),S=e=>null!==e&&"object"==typeof e,R=e=>{if(!S(e))return!1;const t=s(e);return(null===t||t===Object.prototype||null===s(t))&&(f(e,t,!0)||!c(e,u)&&!c(e,a))},P=y("Date"),T=y("File"),k=y("Blob"),A=y("FileList"),j=y("Set");const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},N=void 0!==C.FormData?C.FormData:void 0,U=y("URLSearchParams"),[x,D,L,F]=["ReadableStream","Request","Response","Headers"].map(y);function B(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),b(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(w(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,q=e=>!g(e)&&e!==I;const M=(H="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>H&&e instanceof H);var H;const z=y("HTMLFormElement"),{propertyIsEnumerable:G}=Object.prototype,W=y("RegExp"),$=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};B(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const J=y("AsyncFunction"),K=(X="function"==typeof setImmediate,V=O(I.postMessage),X?setImmediate:V?(Y=`axios@${Math.random()}`,Q=[],I.addEventListener("message",({source:e,data:t})=>{e===I&&t===Y&&Q.length&&Q.shift()()},!1),e=>{Q.push(e),I.postMessage(Y,"*")}):e=>setTimeout(e));var X,V,Y,Q;const Z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):"undefined"!=typeof process&&process.nextTick||K,ee=e=>null!=e&&O(e[a]),te={isArray:b,isArrayBuffer:v,isBuffer:w,isFormData:e=>{if(!e)return!1;if(N&&e instanceof N)return!0;const t=s(e);if(!t||t===Object.prototype)return!1;if(!O(e.append))return!1;const n=h(e);return"formdata"===n||"object"===n&&O(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&v(e.buffer),t},isString:_,isNumber:E,isBoolean:e=>!0===e||!1===e,isObject:S,isPlainObject:R,isEmptyObject:e=>{if(!S(e)||w(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:x,isRequest:D,isResponse:L,isHeaders:F,isUndefined:g,isDate:P,isFile:T,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:k,isRegExp:W,isFunction:O,isStream:e=>S(e)&&O(e.pipe),isURLSearchParams:U,isTypedArray:M,isFileList:A,forEach:B,merge:function e(...t){const{caseless:n,skipUndefined:r}=q(this)&&this||{},o={},i=n?Object.create(null):null,s=(t,n)=>{if("__proto__"===n||"constructor"===n||"prototype"===n)return;let s=n;if(i&&"string"==typeof n){const e=n.toLowerCase(),t=i[e];void 0!==t&&c(o,t)?s=t:i[e]=n}const a=c(o,s)?o[s]:void 0;R(a)&&R(t)?o[s]=e(a,t):R(t)?o[s]=e({},t):b(t)?o[s]=t.slice():r&&g(t)||(o[s]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||w(n))continue;if(B(n,s),"object"!=typeof n||b(n)||!Object.getOwnPropertySymbols)continue;const r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){const t=r[e];G.call(n,t)&&s(n[t],t)}}return o},extend:(e,t,n,{allOwnKeys:r}={})=>(B(t,(t,r)=>{n&&O(t)?Object.defineProperty(e,r,{__proto__:null,value:o(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const u={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:h,kindOfTest:y,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(b(e))return e;let t=e.length;if(!Number.isSafeInteger(t)||t<0||t>4294967295)return null;const n=new Set,r=new Set;let o=e;for(;null!=o&&n.size<t;){if(r.has(o))return null;r.add(o);const i=s(o);if(f(o,i,o===e))break;Object.getOwnPropertyNames(o).forEach(e=>{const r=+e;Number.isInteger(r)&&r>=0&&r<t&&String(r)===e&&c(o,e)&&n.add(r)}),o=i}if(n.size!==t)return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},forEachEntry:(e,t)=>{const n=(e&&e[a]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:z,hasOwnProperty:c,hasOwnProp:c,hasOwnInPrototypeChain:p,getSafeProp:(e,t)=>null!=e&&p(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;const t=s(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(l(t))return!1;const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable})})(e))return e;const n=Object.create(null),r=Object.create(null),o=[];let i=e;for(;null!=i&&-1===o.indexOf(i);){o.push(i);const a=i===e?t:s(i);if(f(i,a,i===e))break;const u=Object.getOwnPropertyNames(i);Object.getOwnPropertySymbols&&u.push(...Object.getOwnPropertySymbols(i));for(const t of u)l(t)||c(r,t)||(n[t]=e[t],r[t]=!0);i=a}return n},reduceDescriptors:$,freezeMethods:e=>{$(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];O(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return b(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:function(e,t){if(w(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null},global:I,isContextDefined:q,isSpecCompliantForm:function(e){return!!(e&&O(e.append)&&"FormData"===e[u]&&e[a])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(S(e)){if(t.has(e))return;if(w(e))return e;if(!("toJSON"in e)){let r;if(t.add(e),j(e)){r=[];for(const t of e){const e=n(t);!g(e)&&r.push(e)}}else r=b(e)?[]:{},B(e,(e,t)=>{const o=n(e);!g(o)&&(r[t]=o)});return t.delete(e),r}}return e};return n(e)},isAsyncFn:J,isThenable:e=>e&&(S(e)||O(e))&&O(e.then)&&O(e.catch),setImmediate:K,asap:Z,isIterable:ee,isSafeIterable:e=>null!=e&&p(e,a)&&ee(e)},ne=te.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const re=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),oe=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ie(e,t){return te.isArray(e)?e.map(e=>ie(e,t)):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function se(e){const t=Object.create(null);return te.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>ie(e,oe))(e)}),t}const ae=Symbol("internals");function ue(e){return e&&String(e).trim().toLowerCase()}function ce(e){return!1===e||null==e?e:te.isArray(e)?e.map(ce):(e=>ie(e,re))(String(e))}const le=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function fe(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}const pe=e=>"__proto__"===e?"__Proto__":e;function he(e,t,n,r,o){return te.isFunction(r)?r.call(e,t,n):(o&&(t=n),te.isString(t)?te.isString(r)?-1!==t.indexOf(r):te.isRegExp(r)?r.test(t):void 0:void 0)}class de{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ue(t);if(!o)return;const i=te.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[pe(i||t)]=ce(e))}const i=(e,t)=>te.forEach(e,(e,n)=>o(e,n,t));if(te.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(te.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t=Object.create(null);let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim();const i=te.hasOwnProp(t,n);!n||i&&te.hasOwnProp(ne,n)||("set-cookie"===n?i?t[n].push(r):t[n]=[r]:t[n]=i?t[n]+", "+r:r)}),t})(e),t);else if(te.isObject(e)&&te.isSafeIterable(e)){let n,r,o=Object.create(null);for(const t of e){if(!te.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],te.hasOwnProp(o,r)?(n=o[r],o[r]=te.isArray(n)?[...n,t[1]]:[n,t[1]]):o[r]=t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=ue(e)){const n=te.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(te.isFunction(t))return t.call(this,e,n);if(te.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ue(e)){const n=te.findKey(this,e);return!(!n||void 0===this[n]||t&&!he(this,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ue(e)){const o=te.findKey(n,e);!o||t&&!he(n,n[o],o,t)||(delete n[o],r=!0)}}return te.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!he(this,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n=Object.create(null);return te.forEach(this,(r,o)=>{const i=te.findKey(n,o);if(i)return t[i]=ce(r),void delete t[o];const s=pe(e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim());s!==o&&delete t[o],t[s]=ce(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return te.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&te.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){const e=this.get("set-cookie");return te.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let r=0,o=!1,i=!1;function s(e){const o=fe(n.slice(r,e)),i=o.indexOf("=");if(i<1)return;const s=fe(o.slice(0,i));if(!le.test(s))return;const a=s.toLowerCase();if("__proto__"===a||"constructor"===a||"prototype"===a)return;const u=fe(o.slice(i+1));t[a]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let r=1;r<t;r++){const o=e.charCodeAt(r);if(34===o)return e;if(92===o&&(r+=1,r>=t))return e;n+=e[r]}return n}(u)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);o?i?i=!1:92===t?i=!0:34===t&&(o=!1):34===t?o=!0:44!==t&&59!==t||(s(e),r=e+1)}return s(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ae]=this[ae]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ue(e);t[r]||(!function(e,t){const n=te.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return te.isArray(e)?e.forEach(r):r(e),this}}de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),te.reduceDescriptors(de.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),te.freezeMethods(de);const ye=de,me="[REDACTED ****]";function be(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),r=[],o=e=>{if(null===e||"object"!=typeof e)return e;if(te.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof ye&&(e=e.toJSON()),r.push(e),te.isArray(e))t=[],e.forEach((e,n)=>{const r=o(e);te.isUndefined(r)||(t[n]=r)});else{if(!te.isPlainObject(e)&&function(e){if(te.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(te.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,i]of Object.entries(e)){const e=n.has(r.toLowerCase())?me:o(i);te.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return o(e)}function ge(e){try{return String(e)}catch(e){return""}}const we=Symbol("causeStack");class ve extends Error{static from(e,t,n,r,o,i){let s=e.message;!s&&te.isArray(e.errors)&&e.errors.length&&(s=function(e){return e.errors.map(e=>{try{return e&&e.message?ge(e.message):ge(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const a=new ve(s,t||e.code,n,r,o);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,function(e,t){try{const n=t&&t.stack;if("string"!=typeof n||!n)return;const r=e.stack;if("string"!=typeof r||!r)return;const o="\nCaused by: "+n;e.stack=r+o,Object.defineProperty(e,we,{__proto__:null,value:o})}catch(e){}}(a,e),null!=e.status&&null==a.status&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,t=e&&te.hasOwnProp(e,"redact")?e.redact:void 0,n=te.isArray(t)&&t.length>0?be(e,t):te.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}ve.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ve.ERR_BAD_OPTION="ERR_BAD_OPTION",ve.ECONNABORTED="ECONNABORTED",ve.ETIMEDOUT="ETIMEDOUT",ve.ECONNREFUSED="ECONNREFUSED",ve.ERR_NETWORK="ERR_NETWORK",ve.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ve.ERR_DEPRECATED="ERR_DEPRECATED",ve.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ve.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ve.ERR_CANCELED="ERR_CANCELED",ve.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ve.ERR_INVALID_URL="ERR_INVALID_URL",ve.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const _e=ve;function Oe(e){return te.isPlainObject(e)||te.isArray(e)}function Ee(e){return te.endsWith(e,"[]")?e.slice(0,-2):e}function Se(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ee(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Re=te.toFlatObject(te,{},null,function(e){return/^is[A-Z]/.test(e)});const Pe=function(e,t,n){if(!te.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(e,t)=>{const r=te.getSafeProp(n,e);return te.isUndefined(r)?t:r},o=r("metaTokens",!0),i=r("visitor")||d,s=r("dots",!1),a=r("indexes",!1),u=r("Blob")||"undefined"!=typeof Blob&&Blob,c=r("maxDepth",100),l=u&&te.isSpecCompliantForm(t),f=[];if(!te.isFunction(i))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(te.isDate(e))return e.toISOString();if(te.isBoolean(e))return e.toString();if(!l&&te.isBlob(e))throw new _e("Blob is not supported. Use a Buffer instead.");if(te.isArrayBuffer(e)||te.isTypedArray(e)){if(l&&"function"==typeof u)return new u([e]);throw new _e("Blob is not supported. Use a Buffer instead.",_e.ERR_NOT_SUPPORT)}return e}function h(e){if(e>c)throw new _e("Object is too deeply nested ("+e+" levels). Max depth: "+c,_e.ERR_FORM_DATA_DEPTH_EXCEEDED)}function d(e,n,r){let i=e;if(te.isReactNative(t)&&te.isReactNativeBlob(e))return t.append(Se(r,n,s),p(e)),!1;if(e&&!r&&"object"==typeof e)if(te.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e,t){if(c===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,function(e,r){if(!te.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),h(t+n.length-1),r})}(e,1);else if(te.isArray(e)&&function(e){return te.isArray(e)&&!e.some(Oe)}(e)||(te.isFileList(e)||te.endsWith(n,"[]"))&&(i=te.toArray(e)))return n=Ee(n),i.forEach(function(e,r){!te.isUndefined(e)&&null!==e&&t.append(!0===a?Se([n],r,s):null===a?n:n+"[]",p(e))}),!1;return!!Oe(e)||(t.append(Se(r,n,s),p(e)),!1)}const y=Object.assign(Re,{defaultVisitor:d,convertValue:p,isVisitable:Oe});if(!te.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!te.isUndefined(n)){if(h(o),-1!==f.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));f.push(n),te.forEach(n,function(n,s){!0===(!(te.isUndefined(n)||null===n)&&i.call(t,n,te.isString(s)?s.trim():s,r,y))&&e(n,r?r.concat(s):[s],o+1)}),f.pop()}}(e),t};function Te(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ke(e,t){this._pairs=[],e&&Pe(e,this,t)}const Ae=ke.prototype;Ae.append=function(e,t){this._pairs.push([e,t])},Ae.toString=function(e){const t=e?t=>e.call(this,t,Te):Te;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const je=ke;function Ce(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ne(e,t,n){if(!t)return e;e=e||"";const r=te.isFunction(n)?{serialize:n}:n,o=te.getSafeProp(r,"encode")||Ce,i=te.getSafeProp(r,"serialize");let s;if(s=i?i(t,r):te.isURLSearchParams(t)?t.toString():new je(t,r).toString(o),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Ue=Symbol("internals");function xe(e){return e?e.length:0}function De(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function Le(e,t){const n=e.handlers,r=xe(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)}):t.handlerEntries.clear()),t.handlersLength=r}const Fe=class{constructor(){this.handlers=[],this[Ue]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){const r={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},o=this[Ue];null==this.handlers&&(this.handlers=[]),Le(this,o);const i=o.nextId++;return this.handlers.push(r),o.handlerEntries.set(i,{handler:r,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,i}eject(e){const t=this[Ue];Le(this,t);const n=function(e){return"string"==typeof e&&""!==e&&String(Number(e))===e?Number(e):e}(e),r=t.handlerEntries.get(n);if(r){if(t.handlerEntries.delete(n),this.handlers[r.index]!==r.handler)return;this.handlers[r.index]=null,t.iterationDepth||(De(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Le(this,this[Ue]))}forEach(e){const t=this[Ue];Le(this,t),t.iterationDepth++;try{te.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(Le(this,t),De(this.handlers),t.handlersLength=xe(this.handlers))}}},Be={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0,encodeBasicAuthUsername:!1},Ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:je,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},qe="undefined"!=typeof window&&"undefined"!=typeof document,Me="object"==typeof navigator&&navigator||void 0,He=qe&&(!Me||["ReactNative","NativeScript","NS"].indexOf(Me.product)<0),ze="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ge=qe&&window.location.href||"http://localhost",We={...r,...Ie};function $e(e){if(e>100)throw new _e("FormData field is too deeply nested ("+e+" levels). Max depth: 100",_e.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Je(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}function Ke(e){if(!te.isArray(e))return e;const t=Object.keys(e);return t.length!==e.length||t.some((e,t)=>e!==String(t))?Je(e):e}const Xe=function(e){function t(e,n,r,o){$e(o);let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&te.isArray(r)?r.length:i,a)return te.hasOwnProp(r,i)?(r[i]=Ke(r[i]),r[i]=te.isArray(r[i])?r[i].concat(n):[r[i],n]):r[i]=n,!s;te.hasOwnProp(r,i)&&te.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&te.isArray(r[i])&&(r[i]=Je(r[i])),!s}if(te.isFormData(e)&&te.isFunction(e.entries)){const n={};return te.forEachEntry(e,(e,r)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;null!==(r=n.exec(e));)$e(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)}),function(e){const t=[e];for(;t.length;){const e=t.pop();Object.keys(e).forEach(n=>{const r=e[n]=Ke(e[n]);(te.isArray(r)||te.isPlainObject(r))&&t.push(r)})}return e}(n)}return null},Ve=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Ye=(e,t)=>null!=e&&te.hasOwnProp(e,t)?e[t]:void 0;const Qe={transitional:Be,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=te.isObject(e);o&&te.isHTMLForm(e)&&(e=new FormData(e));if(te.isFormData(e))return r?JSON.stringify(Xe(e)):e;if(te.isArrayBuffer(e)||te.isBuffer(e)||te.isStream(e)||te.isFile(e)||te.isBlob(e)||te.isReadableStream(e))return e;if(te.isArrayBufferView(e))return e.buffer;if(te.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){const t=Ye(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Pe(e,new We.classes.URLSearchParams,{visitor:function(e,t,n,r){return We.isNode&&te.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((i=te.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Ye(this,"env"),r=n&&n.FormData;return Pe(i?{"files[]":e}:e,r&&new r,t)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(te.isString(e))try{return(t||JSON.parse)(e),te.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Ye(this,"transitional")||Qe.transitional,n=t&&t.forcedJSONParsing,r=Ye(this,"responseType"),o="json"===r;if(te.isResponse(e)||te.isReadableStream(e))return e;if(e&&te.isString(e)&&(n&&!r||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Ye(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw _e.from(e,_e.ERR_BAD_RESPONSE,this,null,Ye(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:We.classes.FormData,Blob:We.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};te.forEach(Ve,e=>{Qe.headers[e]={}});const Ze=Qe;function et(e,t){const n=this||Ze,r=t||n,o=ye.from(r.headers);let i=r.data;return te.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function tt(e){return!(!e||!e.__CANCEL__)}const nt=class extends _e{constructor(e,t,n){super(e??"canceled",_e.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function rt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new _e("Request failed with status code "+n.status,n.status>=400&&n.status<500?_e.ERR_BAD_REQUEST:_e.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const ot=/[\t\n\r]/g;function it(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(ot,"")}function st(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1].toLowerCase()||""}const at=e=>{try{return decodeURIComponent(e)}catch(t){return e}},ut=We.hasStandardBrowserEnv?{write(e,t,n,r,o,i,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];te.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),te.isString(r)&&a.push(`path=${r}`),te.isString(o)&&a.push(`domain=${o}`),!0===i&&a.push("secure"),te.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie;if(!t)return null;const n=t.split(";");for(let t=0;t<n.length;t++){const r=n[t].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)return at(r.slice(o+1))}return null},async readAsync(e){try{const t="undefined"!=typeof window&&window.cookieStore;if(t&&te.isFunction(t.get)){const n=await t.get(e);return n?at(n.value):null}}catch(e){}return this.read(e)},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,readAsync:async()=>null,remove(){}};const ct=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const u=Date.now(),c=r[s];o||(o=u),n[i]=a,r[i]=u;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),u-o<t)return;const p=c&&u-c;return p?Math.round(1e3*f/p):void 0}};const lt=function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n),(...e)=>s(e)]},ft=(e,t,n=3)=>{let r=0;const o=ct(50,250);return lt(n=>{if(!n||!te.isNumber(n.loaded))return;const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=Math.max(0,null!=s?Math.min(i,s):i),u=Math.max(0,a-r),c=o(u);r=Math.max(r,a);e({loaded:a,total:s,progress:s?a/s:void 0,bytes:u,rate:c||void 0,estimated:c&&s?(s-a)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},pt=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ht=(e,t=te.asap)=>(...n)=>t(()=>e(...n)),dt=We.hasStandardBrowserEnv?(e=>t=>(t=new URL(t,document.baseURI||We.origin),e.protocol===t.protocol&&e.host===t.host&&e.port===t.port))(new URL(We.origin)):()=>!0;const yt=/^https?:(?!\/\/)/i;function mt(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${me}@`),n=t.indexOf("#"),r=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${me}`);return-1===n?r:`${r}#${o=t.slice(n+1),o?o.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${me}`):o}`;var o}function bt(e,t){if("string"==typeof e){const n=it(e);if(yt.test(n))throw new _e(`Invalid URL ${JSON.stringify(mt(n))}: missing "//" after protocol`,_e.ERR_INVALID_URL,t)}}function gt(e,t,n,r){bt(t,r);let o=!("string"==typeof(i=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));var i;return e&&(o||!1===n)?(bt(e,r),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const wt=e=>e instanceof ye?{...e}:e,vt=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>{const n=Object.getOwnPropertyDescriptor(e,t);return n&&n.enumerable})):Object.keys(e);function _t(e,t,n,r){return te.isPlainObject(e)&&te.isPlainObject(t)?te.merge.call({caseless:r},e,t):te.isPlainObject(t)?te.merge({},t):te.isArray(t)?t.slice():t}function Ot(e,t,n,r){return te.isUndefined(t)?te.isUndefined(e)?void 0:_t(void 0,e,0,r):_t(e,t,0,r)}function Et(e,t){if(!te.isUndefined(t))return _t(void 0,t)}function St(e,t){return te.isUndefined(t)?te.isUndefined(e)?void 0:_t(void 0,e):_t(void 0,t)}function Rt(e,t,n,r,o){return te.hasOwnProp(o,n)?_t(e,t):te.hasOwnProp(r,n)?_t(void 0,e):void 0}const Pt=Object.freeze({__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0}),Tt={url:Et,method:Et,data:Et,baseURL:St,transformRequest:St,transformResponse:St,params:function(e,t){const n=[],r=new WeakMap,o={};function i(e,t){if(!te.isPlainObject(t))return te.isArray(t)?t.slice():t;const i=te.isPlainObject(e)?e:o;let s=r.get(t);if(s||(s=new WeakMap,r.set(t,s)),s.has(i))return s.get(i);const a={};return s.set(i,a),n.push({base:i,source:t,result:a}),a}const s=te.isUndefined(t)?i(void 0,e):i(e,t);for(;n.length;){const{base:e,source:t,result:r}=n.pop(),o=new Set(vt(e)),s=new Set(vt(t));new Set([...o,...s]).forEach(n=>{if("__proto__"===n||"constructor"===n||"prototype"===n)return;const a=s.has(n),u=a?t[n]:void 0,c=a&&!te.isPlainObject(u)||!o.has(n)?void 0:e[n];r[n]=a?i(c,u):i(void 0,c)})}return function(e){const t=[{value:e}],n=new WeakSet,r=new WeakSet;for(;t.length;){const{value:e,done:o}=t.pop();if(!te.isPlainObject(e)&&!te.isArray(e))continue;if(o){n.delete(e);continue}if(n.has(e))throw new _e("Circular reference detected in params",_e.ERR_BAD_OPTION_VALUE);if(r.has(e))continue;r.add(e),n.add(e),t.push({value:e,done:!0});const i=Object.keys(e);Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor&&Object.getOwnPropertySymbols(e).forEach(t=>{const n=Object.getOwnPropertyDescriptor(e,t);n&&n.enumerable&&i.push(t)}),i.forEach(n=>{if("__proto__"===n||"constructor"===n||"prototype"===n){const r=Object.getOwnPropertyDescriptor(e,n);r&&te.hasOwnProp(r,"value")&&t.push({value:r.value})}else t.push({value:e[n]})})}}(s),s},paramsSerializer:St,timeout:St,timeoutErrorMessage:St,withCredentials:St,withXSRFToken:St,adapter:St,responseType:St,xsrfCookieName:St,xsrfHeaderName:St,onUploadProgress:St,onDownloadProgress:St,decompress:St,maxContentLength:St,maxBodyLength:St,beforeRedirect:St,transport:St,httpAgent:St,httpsAgent:St,cancelToken:St,socketPath:St,allowedSocketPaths:St,responseEncoding:St,validateStatus:Rt,headers:function(e,t,n){return Ot(wt(e),wt(t),0,!0)}};function kt(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",Pt);const r=vt({...e,...t});for(let o=0,i=r.length;o<i;o++){const i=r[o];if("__proto__"===i||"constructor"===i||"prototype"===i)continue;const s=te.hasOwnProp(Tt,i)?Tt[i]:Ot,a=te.hasOwnProp(e,i)?e[i]:void 0,u=te.hasOwnProp(t,i)?t[i]:void 0,c=s===Rt?s(a,u,i,e,t):s(a,u,i);te.isUndefined(c)&&s!==Rt||(n[i]=c)}return te.hasOwnProp(t,"validateStatus")&&te.isUndefined(t.validateStatus)&&!1===function(e,t,n){const r=te.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!te.isUndefined(r)){if(!te.isPlainObject(r))return;if(te.hasOwnProp(r,n))return r[n]}const o=te.hasOwnProp(e,"transitional")?e.transitional:void 0;if(te.isPlainObject(o)&&te.hasOwnProp(o,n))return o[n]}(e,t,"validateStatusUndefinedResolves")&&(te.hasOwnProp(e,"validateStatus")?n.validateStatus=_t(void 0,e.validateStatus):delete n.validateStatus),n}const At=["content-type","content-length"];const jt=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),Ct=e=>ut.read(e);const Nt=function(e,t=Ct){const n=kt({},e),r=e=>te.hasOwnProp(n,e)?n[e]:void 0,o=r("data");let i=r("withXSRFToken");const s=r("xsrfHeaderName"),a=r("xsrfCookieName");let u=r("headers");const c=r("auth"),l=r("baseURL"),f=r("allowAbsoluteUrls"),p=r("url");if(n.headers=u=ye.from(u),n.url=Ne(gt(l,p,f,n),r("params"),r("paramsSerializer")),c){const t=te.getSafeProp(c,"username")||"",n=te.getSafeProp(c,"password")||"",o=r("transitional"),i=o&&te.hasOwnProp(o,"encodeBasicAuthUsername")&&!0===o.encodeBasicAuthUsername;try{u.set("Authorization","Basic "+btoa((i?jt(t):t)+":"+(n?jt(n):"")))}catch(t){throw _e.from(t,_e.ERR_BAD_OPTION_VALUE,e)}}if(te.isFormData(o)){const e=te.getSafeProp(o,"getHeaders");We.hasStandardBrowserEnv||We.hasStandardBrowserWebWorkerEnv||te.isReactNative(o)?u.setContentType(void 0):te.isFunction(e)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{At.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(u,e.call(o),r("formDataHeaderPolicy"))}if(We.hasStandardBrowserEnv){te.isFunction(i)&&(i=i(n));if(!0===i||null==i&&dt(n.url)){const e=s&&a&&t(a);e&&u.set(s,e)}}return n},Ut="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){let r,o;try{const e=We.hasStandardBrowserEnv&&"undefined"!=typeof window&&window.cookieStore;r=e&&te.isFunction(e.get)}catch(e){}const i=Nt(e,r?e=>(o=e,null):void 0);let s=i.data;const a=ye.from(i.headers).normalize();let u,c,l,f,p,h,d,{responseType:y,onUploadProgress:m,onDownloadProgress:b}=i;function g(){clearTimeout(c);try{p&&p()}catch(e){setTimeout(()=>{throw e})}try{h&&h()}catch(e){setTimeout(()=>{throw e})}w&&(f&&w.removeEventListener("progress",f),w.upload&&(l&&w.upload.removeEventListener("progress",l),p&&w.upload.removeEventListener("loadend",p))),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let w=new XMLHttpRequest;function v(r){if(!w)return;if(!(0!==w.status||"file"===(st(it(i.url))||st(We.origin))||w.responseURL&&w.responseURL.startsWith("file:")))return n(new _e("Request aborted",_e.ECONNABORTED,e,w)),g(),void(w=null);try{r?d&&d(r):h&&h()}catch(e){setTimeout(()=>{throw e})}if(!w)return;const o=ye.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders());rt(function(e){t(e),g()},function(e){n(e),g()},{data:y&&"text"!==y&&"json"!==y?w.response:w.responseText,status:w.status,statusText:w.statusText,headers:o,config:e,request:w}),w=null}if(w.open(i.method.toUpperCase(),i.url,!0),w.timeout=i.timeout,"onloadend"in w?w.onloadend=v:w.onreadystatechange=function(){w&&4===w.readyState&&(0!==w.status||w.responseURL&&w.responseURL.startsWith("file:"))&&setTimeout(v)},w.onabort=function(){w&&(n(new _e("Request aborted",_e.ECONNABORTED,e,w)),g(),w=null)},w.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new _e(r,_e.ERR_NETWORK,e,w);o.event=t||null,n(o),g(),w=null},w.ontimeout=function(){if(!w)return;let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const r=i.transitional||Be;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),n(new _e(t,r.clarifyTimeoutError?_e.ETIMEDOUT:_e.ECONNABORTED,e,w)),g(),w=null},void 0===s&&a.setContentType(null),te.isUndefined(i.withCredentials)||(w.withCredentials=!!i.withCredentials),y&&"json"!==y&&(w.responseType=i.responseType),b&&([f,h,d]=ft(b,!0),w.addEventListener("progress",f)),m&&w.upload&&([l,p]=ft(m),w.upload.addEventListener("progress",l),w.upload.addEventListener("loadend",p)),i.cancelToken||i.signal){if(u=t=>{if(!w)return;n(!t||t.type?new nt(null,e,w):t);const r=w;g(),w=null,r.abort()},i.cancelToken&&i.cancelToken.subscribe(u),!w)return;i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u))}if(!w)return;const _=st(i.url);if(_&&!We.protocols.includes(_))return n(new _e("Unsupported protocol "+_+":",_e.ERR_BAD_REQUEST,e)),void g();const O=()=>{w&&("setRequestHeader"in w&&te.forEach(se(a),function(e,t){w.setRequestHeader(t,e)}),w.send(s||null))};if(o){const t="undefined"!=typeof performance&&te.isFunction(performance.now)?()=>performance.now():Date.now,r=w.timeout>0?t()+Number(w.timeout):void 0,s=()=>{if(!w)return;const e=w;e.ontimeout(),e.abort()};if(void 0!==r){const e=()=>{const n=r-t();n>0?c=setTimeout(e,Math.min(n,2147483647)):s()};e()}ut.readAsync(o).then(e=>{if(w)if(void 0!==r&&t()>=r)s();else{if(e){const t=te.hasOwnProp(i,"xsrfHeaderName")&&i.xsrfHeaderName;a.set(t,e)}O()}}).catch(t=>{w&&(n(_e.from(t,null,e,w)),g(),w=null)})}else O()})},xt=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const o=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof _e?t:new nt(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new _e(`timeout of ${t}ms exceeded`,_e.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{const t=te.getSafeProp(e,"unsubscribe");te.isFunction(t)?t.call(e,o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>{r||(e.aborted?o.call(e):e.addEventListener("abort",o,{once:!0}))});const{signal:a}=n;return a.unsubscribe=()=>te.asap(s),a},Dt=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Lt=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Ft=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Lt(e))yield*Dt(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},Bt="\r\n",It=e=>String(e).replace(/\r\n|\r|\n/g,Bt),qt=e=>String(e).replace(/[\r\n"]/g,e=>"\r"===e?"%0D":"\n"===e?"%0A":"%22"),Mt=(e,t)=>{let n=0;for(let r=0;r<e.length;r++){const o=e.charCodeAt(r);!t||13!==o&&10!==o?o<128?n++:o<2048?n+=2:o>=55296&&o<=56319&&e.charCodeAt(r+1)>=56320&&e.charCodeAt(r+1)<=57343?(n+=4,r++):n+=3:(13===o&&10===e.charCodeAt(r+1)&&r++,n+=2)}return n};class Ht extends TypeError{constructor(e,t){super(e),this.name="FormDataError",this.reason=t}}function zt(e,t,n,r,o){if(!te.isFunction(t))throw new _e("Blob is not supported",_e.ERR_NOT_SUPPORT);if(void 0===o)if(te.isFunction(We.generateString))o="axios-"+We.generateString(36,"0123456789abcdef");else{const e=te.global.crypto;if(!e||!te.isFunction(e.getRandomValues))throw new _e("Random byte generation is not supported",_e.ERR_NOT_SUPPORT);const t=new Uint8Array(18);e.getRandomValues(t),o="axios-"+Array.from(t,e=>("0"+e.toString(16)).slice(-2)).join("")}try{return function(e,t,n,r,o){if(!te.isFunction(t))throw new Ht("Blob is not supported","blob");if(!te.isString(o)||!/^[A-Za-z0-9'()+_,./:=? -]{1,70}$/.test(o)||/ $/.test(o))throw new Ht("Invalid multipart boundary","boundary");const i="--"+o+"--"+Bt;let s=i.length;const a=[],u=e=>{if(s+e>n)throw r()};u(0);for(const[t,n]of e){const e=te.isString(n),r=e?Mt(n,!0):n.size;if(!Number.isFinite(r)||r<0)throw new Ht("Unsupported FormData part size","part");u(r+Mt(t,!0)+(!e&&n.name?Mt(n.name,!1):0)+(!e&&n.type?Mt(n.type,!1):0));let i="--"+o+'\r\nContent-Disposition: form-data; name="'+qt(It(t))+'"';e||(i+='; filename="'+qt(te.isString(n.name)?n.name:"blob")+'"\r\nContent-Type: '+String(n.type||"application/octet-stream").replace(/[\r\n]/g,"")),i+=Bt+Bt;const c=Mt(i,!1)+r+2;u(c),s+=c,a.push({header:i,value:n,isString:e})}const c=[];for(const e of a)c.push(e.header,e.isString?It(e.value):e.value,Bt);return c.push(i),new t(c,{type:"multipart/form-data; boundary="+o})}(e,t,n,r,o)}catch(e){if(e instanceof Ht){const t="boundary"===e.reason?_e.ERR_BAD_OPTION_VALUE:_e.ERR_BAD_REQUEST;throw new _e(e.message,t)}throw e}}const Gt=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Wt=(e,t,n)=>t+2<n&&Gt(e.charCodeAt(t+1))&&Gt(e.charCodeAt(t+2)),$t=e=>e<=57?e-48:(223&e)-55,Jt=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,Kt=e=>9===e||10===e||12===e||13===e||32===e,Xt=e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)},Vt=e=>{const t=e.length;let n=0,r=0,o=!1;for(let i=0;i<t;i++){let s=e.charCodeAt(i);37===s&&Wt(e,i,t)&&(s=16*$t(e.charCodeAt(i+1))+$t(e.charCodeAt(i+2)),i+=2),Kt(s)||(61!==s?!Jt(s)||r>0?o=!0:n++:r++)}return o||r>2||r>0&&(n+r)%4!=0||n%4==1?Xt(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)},Yt=(e,t,n)=>{if(!e||"string"!=typeof e)return 0;if(!/^data:/i.test(e))return 0;const r=e.indexOf(",");if(r<0)return 0;const o=e.slice(5,r),i=e.slice(r+1);if(n.test(o))return t(i);let s=0;for(let e=0,t=i.length;e<t;e++){const n=i.charCodeAt(e);if(37===n&&Wt(i,e,t))s+=1,e+=2;else if(n<128)s+=1;else if(n<2048)s+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=i.charCodeAt(e+1);t>=56320&&t<=57343?(s+=4,e++):s+=3}else s+=3}return s};const Qt={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:Zt}=te,en=e=>{if(!te.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},tn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},nn=e=>{const t=void 0!==te.global&&null!==te.global?te.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=te.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response,Blob:t.Blob},e);const o=te.hasOwnProp(e,"fetch")?e.fetch:void 0,{Request:i,Response:s,Blob:a}=e,u=o?Zt(o):"function"==typeof fetch,c=Zt(i),l=Zt(s);if(!u)return!1;const f=u&&Zt(n),p=u&&("function"==typeof r?(h=new r,e=>h.encode(e)):async e=>new Uint8Array(await new i(e).arrayBuffer()));var h;const d=c&&f&&tn(()=>{let e=!1;const t=new i(We.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),y=l&&f&&tn(()=>te.isReadableStream(new s("").body)),m=Object.assign(Object.create(null),Qt);c&&!tn(()=>new i(We.origin,m))&&(delete m.cache,tn(()=>new i(We.origin,m))||(m.cache=Qt.cache));const b={stream:y&&(e=>e.body)};u&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!b[e]&&(b[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new _e(`Response type '${e}' is not supported`,_e.ERR_NOT_SUPPORT,n)})});const g=async e=>null==e?0:te.isBlob(e)?e.size:te.isArrayBufferView(e)||te.isArrayBuffer(e)?e.byteLength:(te.isURLSearchParams(e)&&(e+=""),te.isString(e)?(await p(e)).byteLength:void 0);return async e=>{let{url:t,method:n,data:u,signal:l,cancelToken:p,timeout:h,onDownloadProgress:w,onUploadProgress:v,responseType:_,headers:O,withCredentials:E="same-origin",fetchOptions:S,maxContentLength:R,maxBodyLength:P,maxRedirects:T}=Nt(e);const k=te.isNumber(R)&&R>-1,A=te.isNumber(P)&&P>-1,j=t=>te.hasOwnProp(e,t)?e[t]:void 0;let C=o||fetch;_=_?(_+"").toLowerCase():"text";let N=xt([l,p&&p.toAbortSignal()],h),U=null;const x=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let D,L=null,F=null;const B=()=>new _e("Request body larger than maxBodyLength limit",_e.ERR_BAD_REQUEST,e,U);try{let o;const l=j("auth");if(l){const e=te.getSafeProp(l,"username")||"";o={username:e,password:te.getSafeProp(l,"password")||""}}let p;if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){if(p=new URL(t,We.origin),!o&&(p.username||p.password)){const e=en(p.username);o={username:e,password:en(p.password)}}(p.username||p.password)&&(p.username="",p.password="",t=p.href)}if(o&&(O.delete("authorization"),O.set("Authorization","Basic "+btoa((I=(o.username||"")+":"+(o.password||""),encodeURIComponent(I).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))),k&&p&&"data:"===p.protocol){const t=function(e){const t="string"==typeof e?e.indexOf("#"):-1;return Yt(-1===t?e:e.slice(0,t),Vt,/; *base64[\t\n\f\r ]*$/i)}(p.href);if(t>R)throw new _e("maxContentLength size of "+R+" exceeded",_e.ERR_BAD_RESPONSE,e,U)}const h=te.isSpecCompliantForm(u)&&ye.from(j("headers")).getContentType();let q;if(te.isString(h)&&/^multipart\/form-data(?:\s*;|$)/i.test(h.trim())){const e=ye.parseParameters(h);te.hasOwnProp(e,"boundary")&&(q=e.boundary)}if(te.isSpecCompliantForm(u)&&"get"!==n&&"head"!==n&&(A||v&&d||void 0!==q)&&(u=zt(u,a,A?P:1/0,B,q),O.setContentType(void 0===q?u.type:h),D=u.size),A&&"get"!==n&&"head"!==n){const e=await g(u);if("number"==typeof e&&isFinite(e)&&(D=e,e>P))throw B()}const M=A&&(te.isReadableStream(u)||te.isStream(u)),H=(e,t,n)=>Ft(e,65536,e=>{if(A&&e>P)throw L=B();t&&t(e)},n);if(d&&"get"!==n&&"head"!==n&&(v||M)){if(D=D??await(async(e,t)=>{const n=te.toFiniteNumber(e.getContentLength());return n??g(t)})(O,u),0!==D||M){let e,n=new i(t,{method:"POST",body:u,duplex:"half"});if(te.isFormData(u)&&(e=n.headers.get("content-type"))&&O.setContentType(e),n.body){const[e,t]=v&&pt(D,ft(ht(v)))||[];u=H(n.body,e,t)}}}else if(M&&!c&&f&&"get"!==n&&"head"!==n)u=H(u);else if(M&&c&&!d&&"get"!==n&&"head"!==n)throw new _e("Stream request bodies are not supported by the current fetch implementation",_e.ERR_NOT_SUPPORT,e,U);te.isString(E)||(E=E?"include":"omit");const z=c&&"credentials"in i.prototype;if(te.isFormData(u)){const e=O.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&O.delete("content-type")}O.set("User-Agent","axios/1.21.1",!1);const G=null==S?S:Object.assign(Object.create(null),S);G&&(delete G.body,delete G.headers,delete G.method,delete G.signal,delete G.duplex,delete G.credentials);const W=Object.assign(Object.create(null),G,{signal:N,method:n.toUpperCase(),headers:se(O.normalize()),body:u,duplex:"half",credentials:z?E:void 0});c&&(te.forEach(m,(e,t)=>{void 0===W[t]&&(W[t]=e)}),void 0===W.signal&&(W.signal=null),void 0===W.body&&(W.body=null)),0===T&&(W.redirect="manual",G&&(G.redirect="manual")),U=c&&new i(t,W);let $=await(c?C(U,G):C(t,W));const J=ye.from($.headers);if(k){const t=te.toFiniteNumber(J.getContentLength());if(null!=t&&t>R)throw new _e("maxContentLength size of "+R+" exceeded",_e.ERR_BAD_RESPONSE,e,U)}const K=y&&("stream"===_||"response"===_);if(y&&$.body&&(w||k||K&&x)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=$[e]});const n=te.toFiniteNumber(J.getContentLength()),[r,o]=w&&pt(n,ft(ht(w),!0))||[];let i=0;const a=t=>{if(k&&(i=t,i>R))throw F=new _e("maxContentLength size of "+R+" exceeded",_e.ERR_BAD_RESPONSE,e,U);r&&r(t)};$=new s(Ft($.body,65536,a,()=>{o&&o(),x&&x()}),t)}_=_||"text";let X=await b[te.findKey(b,_)||"text"]($,e);if(k&&!y&&!K){let t;if(null!=X&&("number"==typeof X.byteLength?t=X.byteLength:"number"==typeof X.size?t=X.size:"string"==typeof X&&(t="function"==typeof r?(new r).encode(X).byteLength:X.length)),"number"==typeof t&&t>R)throw new _e("maxContentLength size of "+R+" exceeded",_e.ERR_BAD_RESPONSE,e,U)}return!K&&x&&x(),await new Promise((t,n)=>{rt(t,n,{data:X,headers:ye.from($.headers),status:$.status,statusText:$.statusText,config:e,request:U})})}catch(t){if(x&&x(),N&&N.aborted&&N.reason instanceof _e){const n=N.reason;throw n.config=e,U&&(n.request=U),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(L)throw U&&!L.request&&(L.request=U),L;if(F)throw F;if(t instanceof _e)throw U&&!t.request&&(t.request=U),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new _e("Network Error",_e.ERR_NETWORK,e,U,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw _e.from(t,t&&t.code,e,U,t&&t.response)}var I}},rn=new Map,on=e=>{const t=Object.create(null),n=e&&te.hasOwnProp(e,"env")&&e.env;["fetch","Request","Response","Blob"].forEach(e=>{n&&te.hasOwnProp(n,e)&&(t[e]=n[e])});const{fetch:r,Request:o,Response:i,Blob:s}=t,a=[o,i,r,s];let u,c,l=a.length,f=rn;for(;l--;)u=a[l],c=f.get(u),void 0===c&&f.set(u,c=l?new Map:nn(t)),f=c;return c},sn=(on(),{http:null,xhr:Ut,fetch:{get:on}});te.forEach(sn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const an=e=>`- ${e}`,un=e=>te.isFunction(e)||null===e||!1===e;const cn={getAdapter:function(e,t){e=te.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!un(r)&&(o=sn[(n=String(r)).toLowerCase()],void 0===o))throw new _e(`Unknown adapter '${n}'`);if(o&&(te.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(an).join("\n"):" "+an(e[0]):"as no adapter specified";throw new _e("There is no suitable adapter to dispatch the request "+t,_e.ERR_NOT_SUPPORT)}return o},adapters:sn};function ln(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nt(null,e)}function fn(e,t){return Math.max(0,Math.round(e()-t))}function pn(e){const t=te.toSafeFlatObject(e);ln(t),t.headers=ye.from(te.getSafeProp(t,"headers")),t.data=et.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);const n=cn.getAdapter(t.adapter||Ze.adapter,t),r="undefined"!=typeof performance&&te.isFunction(performance.now)?()=>performance.now():Date.now,o=r();return n(t).then(function(e){ln(t),e.duration=fn(r,o),t.response=e;try{e.data=et.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=ye.from(e.headers),e},function(e){if(!tt(e)&&(ln(t),e&&e.response)){e.response.duration=fn(r,o),t.response=e.response;try{e.response.data=et.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=ye.from(e.response.headers)}return Promise.reject(e)})}const hn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{hn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const dn={};hn.transitional=function(e,t,n){function r(e,t){return"[Axios v1.21.1] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new _e(r(o," has been removed"+(t?" in "+t:"")),_e.ERR_DEPRECATED);return t&&!dn[o]&&(dn[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},hn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const yn={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new _e("options must be an object",_e.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new _e("option "+i+" must be "+n,_e.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new _e("Unknown option "+i,_e.ERR_BAD_OPTION)}},validators:hn},mn=yn.validators,bn=e=>{if(null==e||te.isPlainObject(e)||e instanceof ye)return!0;try{return te.isObject(e)&&"AxiosHeaders"===te.getSafeProp(e,Symbol.toStringTag)&&["toJSON","set","get","has","delete","clear","normalize","concat","toString",Symbol.iterator].every(t=>te.isFunction(te.getSafeProp(e,t)))}catch(e){return!1}};class gn{constructor(e){this.defaults=e||{},this.interceptors={request:new Fe,response:new Fe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack;let r="";if("string"==typeof n){const e=n.indexOf("\n");r=-1===e?"":n.slice(e+1)}if(e.stack){if(r){const t=r.indexOf("\n"),n=-1===t?-1:r.indexOf("\n",t+1),o=-1===n?r:r.slice(n+1),i=String(e.stack),s=function(e,t){const n=te.hasOwnProp(e,we)&&e[we];return n&&t.endsWith(n)?t.length-n.length:-1}(e,i),a=-1===s?i:i.slice(0,s),u=-1===s?"":i.slice(s);a.endsWith(o)||(e.stack=a+"\n"+r+u)}}else e.stack=r}catch(e){}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=kt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&yn.assertOptions(n,{silentJSONParsing:mn.transitional(mn.boolean),forcedJSONParsing:mn.transitional(mn.boolean),clarifyTimeoutError:mn.transitional(mn.boolean),legacyInterceptorReqResOrdering:mn.transitional(mn.boolean),advertiseZstdAcceptEncoding:mn.transitional(mn.boolean),validateStatusUndefinedResolves:mn.transitional(mn.boolean),encodeBasicAuthUsername:mn.transitional(mn.boolean)},!1),null!=r&&(te.isFunction(r)?t.paramsSerializer={serialize:r}:yn.assertOptions(r,{encode:mn.function,serialize:mn.function},!0)),void 0!==t.allowAbsoluteUrls||(te.hasOwnProp(this.defaults,"allowAbsoluteUrls")&&void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),yn.assertOptions(t,{baseUrl:mn.spelling("baseURL"),withXsrfToken:mn.spelling("withXSRFToken")},!0),t.method=(te.getSafeProp(t,"method")||te.getSafeProp(this.defaults,"method")||"get").toLowerCase();const i=te.getSafeProp(o,"common"),s=te.getSafeProp(o,t.method),a=o&&te.merge(bn(i)?i:void 0,bn(s)?s:void 0);o&&te.forEach(Ve.concat("common"),e=>{bn(te.getSafeProp(o,e))&&delete o[e]}),t.headers=ye.concat(a,o);const u=[];let c=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;c=c&&e.synchronous;const n=t.transitional||Be;n&&n.legacyInterceptorReqResOrdering?u.unshift(e.fulfilled,e.rejected):u.push(e.fulfilled,e.rejected)});const l=[];let f;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let p,h=0;if(!c){const e=[pn.bind(this),void 0];for(e.unshift(...u),e.push(...l),p=e.length,f=Promise.resolve(t);h<p;)f=f.then(e[h++],e[h++]);return f}p=u.length;let d=t;for(;h<p;){const e=u[h++],t=u[h++];try{d=e?e(d):d}catch(e){if(!t){f=Promise.reject(e);break}try{const n=t.call(this,e);te.isThenable(n)&&(f=Promise.resolve(n).then(()=>pn.call(this,d)))}catch(e){f=Promise.reject(e)}break}}if(!f)try{f=pn.call(this,d)}catch(e){f=Promise.reject(e)}for(h=0,p=l.length;h<p;)f=f.then(l[h++],l[h++]);return f}getUri(e){return Ne(gt((e=kt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}te.forEach(["delete","get","head","options"],function(e){gn.prototype[e]=async function(t,n){return this.request(kt(n||{},{method:e,url:t,data:n&&te.hasOwnProp(n,"data")?n.data:void 0}))}}),te.forEach(["post","put","patch","query"],function(e){function t(t){return async function(n,r,o){return this.request(kt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}gn.prototype[e]=t(),"query"!==e&&(gn.prototype[e+"Form"]=t(!0))});const wn=gn;class vn{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new nt(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new vn(function(t){e=t}),cancel:e}}}const _n=vn;const On={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(On).forEach(([e,t])=>{void 0===On[t]&&(On[t]=e)});const En=On;const Sn=function e(t){const n=new wn(t),r=o(wn.prototype.request,n);return te.extend(r,wn.prototype,n,{allOwnKeys:!0}),te.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(kt(t,n))},r}(Ze);Sn.Axios=wn,Sn.CanceledError=nt,Sn.CancelToken=_n,Sn.isCancel=tt,Sn.VERSION="1.21.1",Sn.toFormData=Pe,Sn.AxiosError=_e,Sn.Cancel=Sn.CanceledError,Sn.all=function(e){return Promise.all(e)},Sn.spread=function(e){return function(t){return e.apply(null,t)}},Sn.isAxiosError=function(e){return te.isObject(e)&&!0===e.isAxiosError},Sn.mergeConfig=kt,Sn.AxiosHeaders=ye,Sn.formToJSON=e=>Xe(te.isHTMLForm(e)?new FormData(e):e),Sn.getAdapter=cn.getAdapter,Sn.HttpStatusCode=En,Sn.default=Sn;const Rn=Sn;function Pn(e){return Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pn(e)}function Tn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return kn(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(kn(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,kn(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,kn(f,"constructor",c),kn(c,"constructor",u),u.displayName="GeneratorFunction",kn(c,o,"GeneratorFunction"),kn(f),kn(f,o,"Generator"),kn(f,r,function(){return this}),kn(f,"toString",function(){return"[object Generator]"}),(Tn=function(){return{w:i,m:p}})()}function kn(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}kn=function(e,t,n,r){function i(t,n){kn(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},kn(e,t,n,r)}function An(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function jn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Cn(r.key),r)}}function Cn(e){var t=function(e,t){if("object"!=Pn(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=Pn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Pn(t)?t:t+""}var Nn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._token=e._validate(t)},t=[{key:"getAccessToken",value:(r=Tn().m(function e(){return Tn().w(function(e){for(;;)if(0===e.n)return e.a(2,this._token)},e,this)}),o=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function s(e){An(i,n,o,s,a,"next",e)}function a(e){An(i,n,o,s,a,"throw",e)}s(void 0)})},function(){return o.apply(this,arguments)})},{key:"canRefresh",value:function(){return!1}},{key:"clear",value:function(){this._token=null}}],n=[{key:"_validate",value:function(e){if("string"!=typeof e||!e.trim())throw new TypeError("bearer token must be a non-empty string");return e.trim()}}],t&&jn(e.prototype,t),n&&jn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o}();function Un(e){return Un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Un(e)}function xn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return Dn(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Dn(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Dn(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Dn(f,"constructor",c),Dn(c,"constructor",u),u.displayName="GeneratorFunction",Dn(c,o,"GeneratorFunction"),Dn(f),Dn(f,o,"Generator"),Dn(f,r,function(){return this}),Dn(f,"toString",function(){return"[object Generator]"}),(xn=function(){return{w:i,m:p}})()}function Dn(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Dn=function(e,t,n,r){function i(t,n){Dn(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Dn(e,t,n,r)}function Ln(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Fn(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){Ln(i,r,o,s,a,"next",e)}function a(e){Ln(i,r,o,s,a,"throw",e)}s(void 0)})}}function Bn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,In(r.key),r)}}function In(e){var t=function(e,t){if("object"!=Un(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=Un(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Un(t)?t:t+""}var qn=new Set(["127.0.0.1","localhost","::1","[::1]"]);var Mn=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.tokenUrl,r=t.clientId,o=void 0===r?"appmesh-cli":r,i=t.accessToken,s=t.refreshToken,a=t.expiresIn,u=void 0===a?0:a,c=t.httpClient;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._tokenUrl=function(e){var t;try{t=new URL(e)}catch(e){throw new TypeError("tokenUrl must be a valid URL")}if("https:"===t.protocol)return e;if("http:"===t.protocol&&qn.has(t.hostname.toLowerCase()))return e;throw new TypeError("tokenUrl must use https, or http only for loopback hosts (127.0.0.1, localhost, ::1)")}(n),this._clientId=o,this._accessToken=i||null,this._refreshToken=s||null,this._http=c||Rn.create({timeout:3e4}),this._inflightRefresh=null,this._expiresAtMs=0,this._lifetimeMs=0,this._setExpiry(u)},t=[{key:"getAccessToken",value:(s=Fn(xn().m(function e(){return xn().w(function(e){for(;;)switch(e.n){case 0:if(!(null===this._accessToken&&this._refreshToken||this._isExpiringSoon())){e.n=1;break}return e.n=1,this._refresh();case 1:if(null!==this._accessToken||this._refreshToken){e.n=2;break}throw new Error("no access token available: the provider holds no credentials");case 2:return e.a(2,this._accessToken)}},e,this)})),function(){return s.apply(this,arguments)})},{key:"canRefresh",value:function(){return!!this._refreshToken}},{key:"refreshAccessToken",value:(i=Fn(xn().m(function e(t){return xn().w(function(e){for(;;)switch(e.n){case 0:if(!t||t===this._accessToken){e.n=1;break}return e.a(2,this._accessToken);case 1:return e.n=2,this._refresh();case 2:return e.a(2,this._accessToken)}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"clear",value:function(){this._accessToken=null,this._refreshToken=null,this._expiresAtMs=0,this._lifetimeMs=0}},{key:"_setExpiry",value:function(e){var t=Number(e);Number.isFinite(t)&&t>0?(this._lifetimeMs=1e3*t,this._expiresAtMs=Date.now()+this._lifetimeMs):(this._lifetimeMs=0,this._expiresAtMs=0)}},{key:"_isExpiringSoon",value:function(){if(!this._expiresAtMs||!this._refreshToken)return!1;var e=Math.max(3e4,.1*this._lifetimeMs);return Date.now()>=this._expiresAtMs-e}},{key:"_refresh",value:(o=Fn(xn().m(function e(){var t=this;return xn().w(function(e){for(;;)if(0===e.n)return this._inflightRefresh||(this._inflightRefresh=this._performRefresh().finally(function(){t._inflightRefresh=null})),e.a(2,this._inflightRefresh)},e,this)})),function(){return o.apply(this,arguments)})},{key:"_performRefresh",value:(r=Fn(xn().m(function e(){var t,n,r,o,i;return xn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this._refreshToken){e.n=1;break}throw new Error("cannot refresh: no refresh token available");case 1:return t=new URLSearchParams({grant_type:"refresh_token",refresh_token:this._refreshToken,client_id:this._clientId}),e.p=2,e.n=3,this._http.post(this._tokenUrl,t.toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"},validateStatus:function(){return!0}});case 3:n=e.v,e.n=5;break;case 4:throw e.p=4,i=e.v,new Error("token refresh request failed: ".concat(i.message||"unknown error"));case 5:if(r=n.status,"invalid_grant"!==(o=n.data&&"object"===Un(n.data)?n.data:{}).error){e.n=6;break}throw this.clear(),new Error("token refresh rejected by the server (invalid_grant)");case 6:if(!(r<200||r>=300||o.error)){e.n=7;break}throw new Error("token refresh failed with status ".concat(r).concat(o.error?": ".concat(o.error):""));case 7:if("string"==typeof o.access_token&&o.access_token){e.n=8;break}throw new Error("token refresh response did not include an access_token");case 8:this._accessToken=o.access_token,"string"==typeof o.refresh_token&&o.refresh_token&&(this._refreshToken=o.refresh_token),this._setExpiry(o.expires_in);case 9:return e.a(2)}},e,this,[[2,4]])})),function(){return r.apply(this,arguments)})}],t&&Bn(e.prototype,t),n&&Bn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,i,s}();function Hn(e){return Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hn(e)}function zn(e){return function(e){if(Array.isArray(e))return $n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wn(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||Wn(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wn(e,t){if(e){if("string"==typeof e)return $n(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$n(e,t):void 0}}function $n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Jn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return Kn(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Kn(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Kn(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Kn(f,"constructor",c),Kn(c,"constructor",u),u.displayName="GeneratorFunction",Kn(c,o,"GeneratorFunction"),Kn(f),Kn(f,o,"Generator"),Kn(f,r,function(){return this}),Kn(f,"toString",function(){return"[object Generator]"}),(Jn=function(){return{w:i,m:p}})()}function Kn(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Kn=function(e,t,n,r){function i(t,n){Kn(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Kn(e,t,n,r)}function Xn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Vn(r.key),r)}}function Vn(e){var t=function(e,t){if("object"!=Hn(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=Hn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Hn(t)?t:t+""}function Yn(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Qn(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){Yn(i,r,o,s,a,"next",e)}function a(e){Yn(i,r,o,s,a,"throw",e)}s(void 0)})}}var Zn=null;function er(){return tr.apply(this,arguments)}function tr(){return(tr=Qn(Jn().m(function e(){var t;return Jn().w(function(e){for(;;)switch(e.n){case 0:if(!Zn){e.n=1;break}return e.a(2,Zn);case 1:return e.n=2,import("node:crypto");case 2:return t=e.v,Zn=t.default&&t.default.createHmac?t.default:t,e.a(2,Zn)}},e)}))).apply(this,arguments)}var nr=new Set(["/appmesh/file/download","/appmesh/file/upload","/appmesh/file/delete"]),rr=Object.freeze({KEY_ID:"X-Request-Key",TIMESTAMP:"X-Timestamp",NONCE:"X-Nonce",SIGNATURE:"X-Signature"});function or(e){return"string"==typeof e&&nr.has(ir(e))}function ir(e){return"/appmesh/file/download/ws"===e?"/appmesh/file/download":"/appmesh/file/upload/ws"===e?"/appmesh/file/upload":e}var sr=function(){return e=function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"!=typeof t||""===t.trim())throw new TypeError("keyId must be a non-empty string");if("string"!=typeof n||""===n)throw new TypeError("secret must be a non-empty string");this._keyId=t,this._secret=n},t=[{key:"keyId",get:function(){return this._keyId}},{key:"attach",value:(i=Qn(Jn().m(function e(t,n,r,o,i,s,a){var u,c,l,f,p,h,d,y,m;return Jn().w(function(e){for(;;)switch(e.n){case 0:if(u=s||String(Math.floor(Date.now()/1e3)),p=a){e.n=2;break}return e.n=1,this.randomNonce();case 1:p=e.v;case 2:return c=p,l=ir(r),h=ar,d=n,y=l,m=o,e.n=3,ur(l,i);case 3:return f=h(d,y,m,e.v,u,c),t[rr.KEY_ID]=this._keyId,t[rr.TIMESTAMP]=u,t[rr.NONCE]=c,e.n=4,this.sign(f);case 4:t[rr.SIGNATURE]=e.v;case 5:return e.a(2)}},e,this)})),function(e,t,n,r,o,s,a){return i.apply(this,arguments)})},{key:"randomNonce",value:(o=Qn(Jn().m(function e(){var t;return Jn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,er();case 1:return t=e.v,e.a(2,t.randomBytes(16).toString("hex"))}},e)})),function(){return o.apply(this,arguments)})},{key:"sign",value:(r=Qn(Jn().m(function e(t){var n;return Jn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,er();case 1:return n=e.v,e.a(2,n.createHmac("sha256",this._secret).update(t,"utf8").digest("hex"))}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"toString",value:function(){return"RequestSigner[keyId=".concat(this._keyId,"]")}}],t&&Xn(e.prototype,t),n&&Xn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,i}();function ar(e,t,n,r,o,i){if(!e||!t)throw new TypeError("method and path are required");return[e,t,n||"",r,o,i].join("\n")}function ur(e,t){return cr.apply(this,arguments)}function cr(){return(cr=Qn(Jn().m(function e(t,n){var r,o;return Jn().w(function(e){for(;;)switch(e.n){case 0:return r=null==n||or(t)?Buffer.alloc(0):Buffer.from(n),e.n=1,er();case 1:return o=e.v,e.a(2,o.createHash("sha256").update(r).digest("hex"))}},e)}))).apply(this,arguments)}function lr(e){if(!e)return"";var t,n={},r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Wn(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(e.split("&"));try{for(r.s();!(t=r.n()).done;){var o=t.value;if(""!==o){var i=o.indexOf("="),s=i<0?o:o.slice(0,i),a=i<0?"":o.slice(i+1);s in n||(n[s]=a)}}}catch(e){r.e(e)}finally{r.f()}var u=Object.entries(n).map(function(e){var t=Gn(e,2),n=t[0],r=t[1];return[fr(n),fr(r)]});return u.sort(function(e,t){var n=Buffer.compare(Buffer.from(e[0],"utf8"),Buffer.from(t[0],"utf8"));return 0!==n?n:Buffer.compare(Buffer.from(e[1],"utf8"),Buffer.from(t[1],"utf8"))}),u.map(function(e){var t=Gn(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(r)}).join("&")}function fr(e){if(!e.includes("%"))return e;for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(37===r){var o=e.charCodeAt(n+1),i=e.charCodeAt(n+2),s=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};if(!s(o)||!s(i))return e;t.push(parseInt(e.slice(n+1,n+3),16)),n+=2}else if(r<128)t.push(r);else{var a=Buffer.from(e[n],"utf8");t.push.apply(t,zn(a))}}return Buffer.from(t).toString("utf8")}function pr(e){return e?Object.entries(e).filter(function(e){var t=Gn(e,2)[1];return null!=t}).map(function(e){var t=Gn(e,2),n=t[0],r=t[1];return"".concat(encodeURIComponent(String(n)),"=").concat(encodeURIComponent(String(r)))}).join("&"):""}function hr(e){return hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hr(e)}function dr(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return yr(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(yr(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,yr(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,yr(f,"constructor",c),yr(c,"constructor",u),u.displayName="GeneratorFunction",yr(c,o,"GeneratorFunction"),yr(f),yr(f,o,"Generator"),yr(f,r,function(){return this}),yr(f,"toString",function(){return"[object Generator]"}),(dr=function(){return{w:i,m:p}})()}function yr(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}yr=function(e,t,n,r){function i(t,n){yr(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},yr(e,t,n,r)}function mr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return br(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?br(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function br(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gr(Object(n),!0).forEach(function(t){vr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vr(e,t,n){return(t=Rr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _r(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Or(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){_r(i,r,o,s,a,"next",e)}function a(e){_r(i,r,o,s,a,"throw",e)}s(void 0)})}}function Er(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rr(r.key),r)}}function Sr(e,t,n){return t&&Er(e.prototype,t),n&&Er(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rr(e){var t=function(e,t){if("object"!=hr(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=hr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==hr(t)?t:t+""}function Pr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tr(e,t,n){return t=Nr(t),function(e,t){if(t&&("object"==hr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,jr()?Reflect.construct(t,n||[],Nr(e).constructor):t.apply(e,n))}function kr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cr(e,t)}function Ar(e){var t="function"==typeof Map?new Map:void 0;return Ar=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(jr())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Cr(o,n.prototype),o}(e,arguments,Nr(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Cr(n,e)},Ar(e)}function jr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(jr=function(){return!!e})()}function Cr(e,t){return Cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Cr(e,t)}function Nr(e){return Nr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nr(e)}var Ur=null,xr=null,Dr=null,Lr=Object.freeze({HTTP_USER_AGENT_HEADER_NAME:"User-Agent",HTTP_USER_AGENT:"appmesh/javascript",DEFAULT_RUN_APP_TIMEOUT_SECONDS:"P2D",DEFAULT_RUN_APP_LIFECYCLE_SECONDS:"P2DT12H",HTTP_HEADER_KEY_AUTH:"Authorization",HTTP_HEADER_KEY_X_TARGET_HOST:"X-Target-Host",HTTP_HEADER_KEY_X_FILE_PATH:"X-File-Path"}),Fr=Object.freeze({isNode:!("undefined"!=typeof window&&"undefined"!==window.document)}),Br=/^([a-z][a-z\d+\-.]*:)?\/\//i;function Ir(e,t){var n=String(e||""),r=String(t||""),o=r;if(n&&!Br.test(r)){for(var i=n.length;i>0&&47===n.charCodeAt(i-1);)i--;o=r?n.slice(0,i)+"/"+r.replace(/^\/+/,""):n}try{return new URL(o).pathname}catch(e){try{return new URL(o,"http://localhost").pathname}catch(e){return r}}}var qr=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return Pr(this,e),(n=Tr(this,e,[t])).name="AppMeshError",n.statusCode=r,n.responseData=o,n.errorCode=i,n.timestamp=(new Date).toISOString(),n}return kr(e,Ar(Error)),Sr(e)}(),Mr=function(){function e(t){var n;return Pr(this,e),(n=Tr(this,e,[t,null,null,"APP_REMOVED"])).name="AppRemovedError",n}return kr(e,qr),Sr(e)}(),Hr=function(){function e(t){var n;return Pr(this,e),(n=Tr(this,e,[t,null,null,"TRANSPORT_DISCONNECTED"])).name="TransportDisconnectedError",n}return kr(e,qr),Sr(e)}(),zr=function(e,t){Fr.isNode?process.stdout.write(e):console.log(e)};function Gr(e){if("number"==typeof e)return e;if("string"!=typeof e)throw new Error("Invalid input type. Expected number or ISO 8601 duration string.");if(/^\d+$/.test(e))return parseInt(e,10);if(!e.trim())throw new Error("Duration string cannot be empty");if(!e.startsWith("P"))throw new Error("Invalid ISO8601 duration: must start with P");var t="\\d+",n="".concat(t,"(?:[\\.,]").concat(t,")?"),r="(".concat(t,"Y)?(").concat(t,"M)?(").concat(t,"W)?(").concat(t,"D)?"),o="T(".concat(n,"H)?(").concat(n,"M)?(").concat(n,"S)?"),i="P(?:".concat(r,"(?:").concat(o,")?)"),s=["years","months","weeks","days","hours","minutes","seconds"],a=e.replace(/,/g,".").match(new RegExp(i));if(!a)throw new RangeError("invalid duration: "+e);var u=a.slice(1);if(0===u.filter(function(e){return null!=e}).length)throw new RangeError("invalid duration: "+e);if(u.filter(function(e){return/\./.test(e||"")}).length>1)throw new RangeError("only the smallest unit can be fractional");var c=u.reduce(function(e,t,n){return e[s[n]]=parseFloat(t||"0")||0,e},{}),l=0;return l+=31536e3*c.years,l+=2592e3*c.months,l+=604800*c.weeks,l+=86400*c.days,l+=3600*c.hours,l+=60*c.minutes,l+=c.seconds}function Wr(e,t){if(e){var n=t.toLowerCase(),r=Object.keys(e).find(function(e){return e.toLowerCase()===n});return void 0===r?void 0:e[r]}}function $r(e,t,n){if("string"!=typeof e||""===e)return e;if(!String(Wr(t,"content-type")||"").toLowerCase().includes("json"))return e;try{return JSON.parse(e)}catch(t){throw new qr("Response body is not valid JSON: ".concat(t.message),null!=n?n:null,e,"JSON_PARSE")}}function Jr(e){return Kr.apply(this,arguments)}function Kr(){return(Kr=Or(dr().m(function e(t){var r,o,i,s;return dr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=parseInt(t,10),isNaN(r)||String(r)!==t.trim()){e.n=1;break}return e.a(2,r);case 1:return e.p=1,e.n=2,n.e(994).then(()=>n.t(994,19));case 2:if(o=e.v,i=o.spawnSync,0===(s=i("id",["-u",t],{encoding:"utf8",timeout:3e3})).status&&s.stdout){e.n=3;break}return e.a(2,null);case 3:return e.a(2,parseInt(s.stdout.trim(),10));case 4:return e.p=4,e.v,e.a(2,null)}},e,null,[[1,4]])}))).apply(this,arguments)}function Xr(e){return Vr.apply(this,arguments)}function Vr(){return(Vr=Or(dr().m(function e(t){var n,r;return dr().w(function(e){for(;;)switch(e.n){case 0:if(n=parseInt(t,10),isNaN(n)||String(n)!==t.trim()){e.n=1;break}return e.a(2,n);case 1:return e.n=2,Yr("name",t);case 2:return r=e.v,e.a(2,r?r.gid:null)}},e)}))).apply(this,arguments)}function Yr(e,t){return Qr.apply(this,arguments)}function Qr(){return(Qr=Or(dr().m(function e(t,r){var o,i,s,a,u,c,l,f,p,h,d;return dr().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,n.e(994).then(()=>n.t(994,19));case 1:if(o=e.v,i=o.spawnSync,0!==(s=i("getent",["group",String(r)],{encoding:"utf8",timeout:3e3})).status||!s.stdout){e.n=2;break}return a=s.stdout.trim().split(":"),u=a.length>=3?parseInt(a[2],10):NaN,e.a(2,a[0]&&!isNaN(u)?{name:a[0],gid:u}:null);case 2:if(0===(c=i("dscacheutil",["-q","group","-a",t,String(r)],{encoding:"utf8",timeout:3e3})).status&&c.stdout){e.n=3;break}return e.a(2,null);case 3:if(l=c.stdout.split("\n"),f=l.find(function(e){return e.startsWith("name:")}),p=l.find(function(e){return e.startsWith("gid:")}),f&&p){e.n=4;break}return e.a(2,null);case 4:return h=f.slice(5).trim(),d=parseInt(p.slice(4).trim(),10),e.a(2,h&&!isNaN(d)?{name:h,gid:d}:null);case 5:return e.p=5,e.v,e.a(2,null)}},e,null,[[0,5]])}))).apply(this,arguments)}function Zr(e){return eo.apply(this,arguments)}function eo(){return(eo=Or(dr().m(function e(t){var r,o,i,s;return dr().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,n.e(994).then(()=>n.t(994,19));case 1:if(r=e.v,o=r.spawnSync,0===(i=o("id",["-un",String(t)],{encoding:"utf8",timeout:3e3})).status&&i.stdout){e.n=2;break}return e.a(2,null);case 2:return s=i.stdout.trim(),e.a(2,s||null);case 3:return e.p=3,e.v,e.a(2,null)}},e,null,[[0,3]])}))).apply(this,arguments)}function to(e){return no.apply(this,arguments)}function no(){return(no=Or(dr().m(function e(t){var n;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yr("gid",t);case 1:return n=e.v,e.a(2,n?n.name:null)}},e)}))).apply(this,arguments)}var ro="/opt/appmesh/ssl/ca.pem";function oo(e){return null==e||"string"==typeof e||"undefined"!=typeof Buffer&&Buffer.isBuffer(e)}function io(e){if(!e)return null;var t="function"==typeof e.get?e.get(Lr.HTTP_HEADER_KEY_AUTH):e[Lr.HTTP_HEADER_KEY_AUTH]||e.authorization;return"string"==typeof t&&t.startsWith("Bearer ")?t.slice(7):null}function so(e){return"string"!=typeof e||e.includes("-----BEGIN")?e:xr.readFileSync(e)}function ao(e){if(!1===e)return{rejectUnauthorized:!1};if(!e)return xr.existsSync(ro)?{ca:xr.readFileSync(ro),rejectUnauthorized:!0}:{rejectUnauthorized:!0};for(var t=wr({},e),n=0,r=["ca","cert","key"];n<r.length;n++){var o=r[n];t[o]&&(t[o]=so(t[o]))}return"boolean"!=typeof t.rejectUnauthorized&&(t.rejectUnauthorized=!0),t}var uo=function(){return Sr(function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fr.isNode?"https://127.0.0.1:6060":window.location.origin,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Pr(this,e),this.baseURL=r,this.forwardingHost=null,this._requestSigner=null,this._tokenProvider=null,i&&this.setTokenProvider(i);var s={baseURL:r,timeout:3e5,validateStatus:function(e){return!0},transformResponse:[$r]};this._sslConfig=o,this._client=Rn.create(s),Fr.isNode&&!Dr&&(Dr=Promise.all([n.e(453).then(()=>n.t(453,19)),n.e(603).then(()=>n.t(603,19))]).then(function(e){var t=mr(e,2),n=t[0],r=t[1];Ur=n.default||n,xr=r.default||r}).catch(function(){})),this._client.interceptors.request.use(function(){var e=Or(dr().m(function e(n){var r,o;return dr().w(function(e){for(;;)switch(e.n){case 0:return r=wr,o=wr({},n.headers),e.n=1,t._commonHeaders();case 1:return n.headers=r(o,e.v),e.a(2,n)}},e)}));return function(t){return e.apply(this,arguments)}}(),function(e){var t=new qr("Request configuration error: "+(e.message||"Unknown error"));return Promise.reject(t)}),this._client.interceptors.response.use(function(e){return t._handleUnauthorizedRetry(e)},function(e){var t,n,r,o;if(e instanceof qr)return Promise.reject(e);var i=new qr("Request failed: "+(e.message||"Unknown error"),null!==(t=null===(n=e.response)||void 0===n?void 0:n.status)&&void 0!==t?t:null,null!==(r=null===(o=e.response)||void 0===o?void 0:o.data)&&void 0!==r?r:null);return i.cause=e,Promise.reject(i)})},[{key:"setTokenProvider",value:function(e){if(!e||"function"!=typeof e.getAccessToken)throw new TypeError("tokenProvider must implement async getAccessToken()");this._tokenProvider=e}},{key:"setBearerToken",value:function(e){null!=e?this.setTokenProvider(new Nn(e)):this.clearBearerToken()}},{key:"setToken",value:function(e){this.setBearerToken(e)}},{key:"clearBearerToken",value:function(){var e=this._tokenProvider;e&&"function"==typeof e.clear&&e.clear(),this._tokenProvider=null}},{key:"enableRequestSignature",value:function(e,t){this._requestSigner=new sr(e,t)}},{key:"disableRequestSignature",value:function(){this._requestSigner=null}},{key:"isRequestSignatureEnabled",value:function(){return null!==this._requestSigner}},{key:"_applyRequestSignature",value:(z=Or(dr().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p,h;return dr().w(function(e){for(;;)switch(e.n){case 0:if((n=this._requestSigner)&&t){e.n=1;break}return e.a(2);case 1:return r=Ir(t.baseURL||this._client.defaults.baseURL||this.baseURL,t.url),o="",t.params&&"object"===hr(t.params)&&Object.keys(t.params).length>0&&(t.paramsSerializer=pr,o=lr(pr(t.params))),i=this._headerValue(t.headers,"content-type"),s=or(r)?Buffer.alloc(0):this._wireBodyBytes(t.data,i),a=String(t.method||"get").toUpperCase(),u={},e.n=2,n.attach(u,a,r,o,s);case 2:for(c=0,l=Object.entries(u);c<l.length;c++)f=mr(l[c],2),p=f[0],h=f[1],t.headers&&"function"==typeof t.headers.set?t.headers.set(p,h):t.headers=wr(wr({},t.headers),{},vr({},p,h));case 3:return e.a(2)}},e,this)})),function(e){return z.apply(this,arguments)})},{key:"_headerValue",value:function(e,t){if(e){if("function"==typeof e.get)return e.get(t);var n=Object.keys(e).find(function(e){return e.toLowerCase()===t.toLowerCase()});return void 0===n?void 0:e[n]}}},{key:"_wireBodyBytes",value:function(e,t){if(null==e)return Buffer.alloc(0);if("string"==typeof e){if(String(t||"").toLowerCase().includes("application/json"))try{return JSON.parse(e),Buffer.from(e.trim(),"utf8")}catch(t){if("SyntaxError"!==t.name)throw t;return Buffer.from(JSON.stringify(e),"utf8")}return Buffer.from(e,"utf8")}if(Buffer.isBuffer(e)||e instanceof Uint8Array||e instanceof ArrayBuffer)return Buffer.from(e);if("object"===hr(e))return Buffer.from(JSON.stringify(e),"utf8");throw new qr("cannot sign a streaming request body; only the /appmesh/file/* endpoints accept unbound bodies")}},{key:"_getAccessToken",value:(H=Or(dr().m(function e(){var t;return dr().w(function(e){for(;;)switch(e.n){case 0:if(!this._tokenProvider){e.n=2;break}return e.n=1,this._tokenProvider.getAccessToken();case 1:t=e.v,e.n=3;break;case 2:t=null;case 3:return e.a(2,t)}},e,this)})),function(){return H.apply(this,arguments)})},{key:"_handleUnauthorizedRetry",value:(M=Or(dr().m(function e(t){var n,r,o,i,s,a,u,c;return dr().w(function(e){for(;;)switch(e.n){case 0:if(r=t.config||{},o=this._tokenProvider,401===t.status&&!r.__appmeshRetried&&o){e.n=1;break}return e.a(2,t);case 1:if("function"!=typeof o.canRefresh){e.n=3;break}return e.n=2,o.canRefresh();case 2:u=e.v,e.n=4;break;case 3:u=!!o.canRefresh;case 4:if(u&&"function"==typeof o.refreshAccessToken&&oo(r.data)){e.n=5;break}return e.a(2,t);case 5:if(null===(n=io(r.headers))||void 0===n){e.n=6;break}c=n,e.n=8;break;case 6:return e.n=7,this._getAccessToken();case 7:c=e.v;case 8:return i=c,e.n=9,o.refreshAccessToken(i);case 9:if("string"==typeof(s=e.v)&&s.trim()){e.n=10;break}return e.a(2,t);case 10:if(r.__appmeshRetried=!0,a="Bearer ".concat(s.trim()),r.headers&&"function"==typeof r.headers.set?r.headers.set(Lr.HTTP_HEADER_KEY_AUTH,a):r.headers=wr(wr({},r.headers),{},vr({},Lr.HTTP_HEADER_KEY_AUTH,a)),!this._requestSigner){e.n=11;break}return e.n=11,this._applyRequestSignature(r);case 11:return e.a(2,this._client(r))}},e,this)})),function(e){return M.apply(this,arguments)})},{key:"getAuthConfig",value:(q=Or(dr().m(function e(){return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/auth/config");case 1:return e.a(2,e.v.data)}},e,this)})),function(){return q.apply(this,arguments)})},{key:"getCurrentPrincipal",value:(I=Or(dr().m(function e(){return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/principal/self");case 1:return e.a(2,e.v.data)}},e,this)})),function(){return I.apply(this,arguments)})},{key:"listApps",value:(B=Or(dr().m(function e(){var t;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/applications");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return B.apply(this,arguments)})},{key:"getApp",value:(F=Or(dr().m(function e(t){var n;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/app/".concat(t));case 1:return n=e.v,e.a(2,n.data)}},e,this)})),function(e){return F.apply(this,arguments)})},{key:"checkAppHealth",value:(L=Or(dr().m(function e(t){var n;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/app/".concat(t,"/health"));case 1:return n=e.v,e.a(2,0===parseInt(n.data,10))}},e,this)})),function(e){return L.apply(this,arguments)})},{key:"addApp",value:(D=Or(dr().m(function e(t,n){var r;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("put","/appmesh/app/".concat(t),n);case 1:return r=e.v,e.a(2,r.data)}},e,this)})),function(e,t){return D.apply(this,arguments)})},{key:"deleteApp",value:(x=Or(dr().m(function e(t){var n,r;return dr().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this._request("delete","/appmesh/app/".concat(t));case 1:return n=e.v,e.a(2,200===n.status);case 2:if(e.p=2,404!==(r=e.v).statusCode){e.n=3;break}return e.a(2,!1);case 3:throw r;case 4:return e.a(2)}},e,this,[[0,2]])})),function(e){return x.apply(this,arguments)})},{key:"enableApp",value:(U=Or(dr().m(function e(t){return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/app/".concat(t,"/enable"));case 1:return e.a(2,!0)}},e,this)})),function(e){return U.apply(this,arguments)})},{key:"disableApp",value:(N=Or(dr().m(function e(t){return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/app/".concat(t,"/disable"));case 1:return e.a(2,!0)}},e,this)})),function(e){return N.apply(this,arguments)})},{key:"getAppOutput",value:(C=Or(dr().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p=arguments;return dr().w(function(e){for(;;)switch(e.n){case 0:return n=p.length>2&&void 0!==p[2]?p[2]:0,r=p.length>3&&void 0!==p[3]?p[3]:10240,o=p.length>4&&void 0!==p[4]?p[4]:"",i=p.length>5&&void 0!==p[5]?p[5]:0,s={stdout_position:(p.length>1&&void 0!==p[1]?p[1]:0).toString(),stdout_index:n.toString(),stdout_maxsize:r.toString(),process_uuid:o,timeout:Gr(i).toString()},e.n=1,this._request("get","/appmesh/app/".concat(t,"/output"),null,{params:s});case 1:return a=e.v,u=Wr(a.headers,"X-Output-Position"),c=Wr(a.headers,"X-Exit-Code"),l=u?parseInt(u,10):null,f=c?parseInt(c,10):null,e.a(2,new co(a.status,a.data,l,f))}},e,this)})),function(e){return C.apply(this,arguments)})},{key:"runAppSync",value:(j=Or(dr().m(function e(t){var n,r,o,i,s,a,u,c=arguments;return dr().w(function(e){for(;;)switch(e.n){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:zr,r=c.length>2&&void 0!==c[2]?c[2]:Lr.DEFAULT_RUN_APP_TIMEOUT_SECONDS,o=c.length>3&&void 0!==c[3]?c[3]:Lr.DEFAULT_RUN_APP_LIFECYCLE_SECONDS,i={timeout:Gr(r),lifecycle:Gr(o)},e.n=1,this._request("post","/appmesh/app/syncrun",t,{params:i});case 1:return s=e.v,a=null,n&&n(s.data,0),200===s.status&&(u=Wr(s.headers,"X-Exit-Code"))&&(a=parseInt(u,10)),e.a(2,a)}},e,this)})),function(e){return j.apply(this,arguments)})},{key:"runAppAsync",value:(A=Or(dr().m(function e(t){var n,r,o,i,s=arguments;return dr().w(function(e){for(;;)switch(e.n){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:Lr.DEFAULT_RUN_APP_TIMEOUT_SECONDS,r=s.length>2&&void 0!==s[2]?s[2]:Lr.DEFAULT_RUN_APP_LIFECYCLE_SECONDS,o={timeout:Gr(n),lifecycle:Gr(r)},e.n=1,this._request("post","/appmesh/app/run",t,{params:o});case 1:return i=e.v,e.a(2,new lo(this,i.data.name,i.data.process_uuid))}},e,this)})),function(e){return A.apply(this,arguments)})},{key:"waitForAsyncRun",value:(k=Or(dr().m(function e(t){var n,r,o,i,s,a,u=arguments;return dr().w(function(e){for(;;)switch(e.n){case 0:if(n=u.length>1&&void 0!==u[1]?u[1]:zr,r=u.length>2&&void 0!==u[2]?u[2]:0,!t){e.n=7;break}o=0,i=new Date,s=1;case 1:if(!(t.procUid.length>0)){e.n=7;break}return e.n=2,this.getAppOutput(t.appName,o,0,20480,t.procUid,s);case 2:if((a=e.v).output&&n&&n(a.output,o),null!==a.outPosition&&(o=a.outPosition),null===a.exitCode){e.n=4;break}return e.n=3,this.deleteApp(t.appName);case 3:return e.a(2,a.exitCode);case 4:if(!(r>0&&(new Date-i)/1e3>r)){e.n=5;break}return e.a(3,7);case 5:return e.n=6,new Promise(function(e){return setTimeout(e,100)});case 6:e.n=1;break;case 7:return e.a(2,null)}},e,this)})),function(e){return k.apply(this,arguments)})},{key:"runTask",value:(T=Or(dr().m(function e(t,n){var r,o,i=arguments;return dr().w(function(e){for(;;)switch(e.n){case 0:return(r=i.length>2&&void 0!==i[2]?i[2]:300)<=0&&(r=300),e.n=1,this._request("post","/appmesh/app/".concat(t,"/task"),n,{params:{timeout:r.toString()}});case 1:return o=e.v,e.a(2,o.data)}},e,this)})),function(e,t){return T.apply(this,arguments)})},{key:"cancelTask",value:(P=Or(dr().m(function e(t){return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/app/".concat(t,"/task"));case 1:return e.a(2,!0)}},e,this)})),function(e){return P.apply(this,arguments)})},{key:"downloadFile",value:(R=Or(dr().m(function e(t){var r,o,i,s,a,u,c,l,f,p,h,d,y,m,b,g,w,v,_,O,E,S,R,P,T,k,A=arguments;return dr().w(function(e){for(;;)switch(e.p=e.n){case 0:return a=A.length>2&&void 0!==A[2]&&A[2],(s=A.length>1&&void 0!==A[1]?A[1]:null)||(s=t.split(/[\\/]/).pop()),u=vr({},Lr.HTTP_HEADER_KEY_X_FILE_PATH,encodeURIComponent(t)),e.n=1,this._request("get","/appmesh/file/download",null,{headers:u,config:{responseType:Fr.isNode?"stream":"arraybuffer"}});case 1:if(c=e.v,l=Fr.isNode?"":c.data,200!==c.status||null!==(r=c.headers)&&void 0!==r&&r["content-disposition"]||!String(null!==(o=null===(i=c.headers)||void 0===i?void 0:i["content-type"])&&void 0!==o?o:"").toLowerCase().includes("json")){e.n=2;break}throw Fr.isNode&&c.data.destroy(),new qr("File download is not supported by this server surface: ".concat(t),c.status,l);case 2:if(200===c.status){e.n=3;break}throw new qr("Failed to download file: ".concat(t),c.status,l);case 3:if(!Fr.isNode){e.n=20;break}return e.n=4,n.e(603).then(()=>n.t(603,19));case 4:return f=e.v,e.n=5,n.e(582).then(()=>n.t(582,19));case 5:return p=e.v,h=p.promisify,P=h,e.n=6,n.e(770).then(()=>n.t(770,19));case 6:return d=P(e.v.pipeline),y=f.promises,e.p=7,e.n=8,d(c.data,f.createWriteStream(s));case 8:if(!a||"win32"===process.platform){e.n=17;break}if(m=c.headers,e.p=9,!(b=m["x-file-mode"])){e.n=12;break}if(g=parseInt(b,10),!(Number.isInteger(g)&&g>=0&&g<=511)){e.n=11;break}return e.n=10,y.chmod(s,g);case 10:e.n=12;break;case 11:console.warn("Warning: Invalid x-file-mode value:",b);case 12:if(w=m["x-file-user"],v=m["x-file-group"],!w||!v){e.n=15;break}return e.n=13,Jr(w);case 13:return _=e.v,e.n=14,Xr(v);case 14:if(O=e.v,null===_||null===O){e.n=15;break}return e.n=15,y.chown(s,_,O);case 15:e.n=17;break;case 16:e.p=16,T=e.v,console.warn("Warning: Unable to apply file attributes to",s,T.message);case 17:e.n=19;break;case 18:throw e.p=18,k=e.v,new qr("Failed to write file to ".concat(s,": ").concat(k.message),c.status);case 19:e.n=21;break;case 20:E=new Blob([c.data]),S=window.URL.createObjectURL(E),(R=document.createElement("a")).style.display="none",R.href=S,R.download=s.split("/").pop(),document.body.appendChild(R),R.click(),window.URL.revokeObjectURL(S),document.body.removeChild(R);case 21:return e.a(2)}},e,this,[[9,16],[7,18]])})),function(e){return R.apply(this,arguments)})},{key:"uploadFile",value:(S=Or(dr().m(function e(t){var r,o,i,s,a,u,c,l,f,p,h,d,y,m=arguments;return dr().w(function(e){for(;;)switch(e.n){case 0:if(s=m.length>2&&void 0!==m[2]&&m[2],i=m.length>1&&void 0!==m[1]?m[1]:null){e.n=2;break}if(a="string"==typeof t?t:t&&t.name){e.n=1;break}throw new qr("filePath is required when localFile is a Blob without a name");case 1:i=a.split(/[\\/]/).pop();case 2:if(u=vr({},Lr.HTTP_HEADER_KEY_X_FILE_PATH,encodeURIComponent(i)),!Fr.isNode){e.n=7;break}return e.n=3,n.e(603).then(()=>n.t(603,19));case 3:if(l=e.v,f=l.statSync(t),!s){e.n=6;break}return u["X-File-Mode"]=(511&f.mode).toString(),e.n=4,Zr(f.uid);case 4:return p=e.v,e.n=5,to(f.gid);case 5:h=e.v,u["X-File-User"]=p||String(f.uid),u["X-File-Group"]=h||String(f.gid);case 6:c=f.size<10485760?l.readFileSync(t):l.createReadStream(t),e.n=9;break;case 7:if(!(t instanceof File||t instanceof Blob)){e.n=8;break}c=t,e.n=9;break;case 8:throw new qr("In browser, localFile must be File or Blob");case 9:return e.n=10,this._request("post","/appmesh/file/upload",c,{headers:u,config:{maxBodyLength:1/0,maxContentLength:1/0}});case 10:if(200===(d=e.v).status||201===d.status){e.n=11;break}throw new qr("Failed to upload file: ".concat(i),d.status,d.data);case 11:if(y=String(null!==(r=null===(o=d.headers)||void 0===o?void 0:o["content-type"])&&void 0!==r?r:"").toLowerCase(),!(200===d.status&&y.includes("json")&&d.data&&"object"===hr(d.data)&&"message"in d.data)){e.n=12;break}throw new qr("File upload is not supported by this server surface: ".concat(i),d.status,d.data);case 12:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getHostResources",value:(E=Or(dr().m(function e(){var t;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/resources");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return E.apply(this,arguments)})},{key:"getConfig",value:(O=Or(dr().m(function e(){var t;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/config");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return O.apply(this,arguments)})},{key:"setConfig",value:(_=Or(dr().m(function e(t){var n;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/config",t);case 1:return n=e.v,e.a(2,n.data)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"setLogLevel",value:(v=Or(dr().m(function e(){var t,n,r=arguments;return dr().w(function(e){for(;;)switch(e.n){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"DEBUG",e.n=1,this.setConfig({BaseConfig:{LogLevel:t}});case 1:return n=e.v,e.a(2,n.BaseConfig.LogLevel)}},e,this)})),function(){return v.apply(this,arguments)})},{key:"addLabel",value:(w=Or(dr().m(function e(t,n){return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("put","/appmesh/label/".concat(t),null,{params:{value:n}});case 1:return e.a(2,!0)}},e,this)})),function(e,t){return w.apply(this,arguments)})},{key:"deleteLabel",value:(g=Or(dr().m(function e(t){return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/label/".concat(t));case 1:return e.a(2,!0)}},e,this)})),function(e){return g.apply(this,arguments)})},{key:"listLabels",value:(b=Or(dr().m(function e(){var t;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/labels");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return b.apply(this,arguments)})},{key:"listPrincipals",value:(m=Or(dr().m(function e(){return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/principals");case 1:return e.a(2,e.v.data)}},e,this)})),function(){return m.apply(this,arguments)})},{key:"updatePrincipal",value:(y=Or(dr().m(function e(t,n){return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/principal/".concat(encodeURIComponent(t)),n);case 1:return e.a(2,!0)}},e,this)})),function(e,t){return y.apply(this,arguments)})},{key:"deletePrincipal",value:(d=Or(dr().m(function e(t){return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/principal/".concat(encodeURIComponent(t)));case 1:return e.a(2,!0)}},e,this)})),function(e){return d.apply(this,arguments)})},{key:"getCurrentUser",value:(h=Or(dr().m(function e(){return dr().w(function(e){for(;;)if(0===e.n)return e.a(2,this.getCurrentPrincipal())},e,this)})),function(){return h.apply(this,arguments)})},{key:"listPermissions",value:(p=Or(dr().m(function e(){var t;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/permissions");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return p.apply(this,arguments)})},{key:"getPrincipalPermissions",value:(f=Or(dr().m(function e(){var t;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/principal/self/permissions");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return f.apply(this,arguments)})},{key:"getUserPermissions",value:(l=Or(dr().m(function e(){return dr().w(function(e){for(;;)if(0===e.n)return e.a(2,this.getPrincipalPermissions())},e,this)})),function(){return l.apply(this,arguments)})},{key:"listRoles",value:(c=Or(dr().m(function e(){var t;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/roles");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return c.apply(this,arguments)})},{key:"updateRole",value:(u=Or(dr().m(function e(t,n){return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/role/".concat(t),n);case 1:return e.a(2,!0)}},e,this)})),function(e,t){return u.apply(this,arguments)})},{key:"deleteRole",value:(a=Or(dr().m(function e(t){return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/role/".concat(t));case 1:return e.a(2,!0)}},e,this)})),function(e){return a.apply(this,arguments)})},{key:"getMetrics",value:(s=Or(dr().m(function e(){var t;return dr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/metrics",null,{config:{responseType:"text"}});case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return s.apply(this,arguments)})},{key:"subscribe",value:(i=Or(dr().m(function e(){return dr().w(function(e){for(;;)switch(e.n){case 0:throw new qr("subscribe requires the TCP client (AppMeshClientTCP, imported from 'appmesh/tcp'); the HTTP client does not support event subscriptions");case 1:return e.a(2)}},e)})),function(){return i.apply(this,arguments)})},{key:"unsubscribe",value:(o=Or(dr().m(function e(){return dr().w(function(e){for(;;)switch(e.n){case 0:throw new qr("unsubscribe requires the TCP client (AppMeshClientTCP, imported from 'appmesh/tcp'); the HTTP client does not support event subscriptions");case 1:return e.a(2)}},e)})),function(){return o.apply(this,arguments)})},{key:"request",value:(r=Or(dr().m(function e(t,n){var r,o,i=arguments;return dr().w(function(e){for(;;)if(0===e.n)return r=i.length>2&&void 0!==i[2]?i[2]:null,o=i.length>3&&void 0!==i[3]?i[3]:{},e.a(2,this._request(t,n,r,o))},e,this)})),function(e,t){return r.apply(this,arguments)})},{key:"_commonHeaders",value:(t=Or(dr().m(function e(){var t,n;return dr().w(function(e){for(;;)switch(e.n){case 0:return t={},Fr.isNode&&(t[Lr.HTTP_USER_AGENT_HEADER_NAME]=Lr.HTTP_USER_AGENT),e.n=1,this._getAccessToken();case 1:return(n=e.v)&&(t[Lr.HTTP_HEADER_KEY_AUTH]="Bearer ".concat(n)),this.forwardingHost&&(t[Lr.HTTP_HEADER_KEY_X_TARGET_HOST]=this.forwardingHost),e.a(2,t)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"_request",value:(e=Or(dr().m(function e(t,n){var r,o,i,s,a,u,c,l,f,p,h,d,y=arguments;return dr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=y.length>2&&void 0!==y[2]?y[2]:null,o=y.length>3&&void 0!==y[3]?y[3]:{},!Fr.isNode||!Dr||this._client.defaults.httpsAgent){e.n=2;break}return e.n=1,Dr;case 1:Ur&&(this._client.defaults.httpsAgent=new Ur.Agent(wr(wr({},ao(this._sslConfig)),{},{keepAlive:!0,keepAliveMsecs:3e3})));case 2:if(i=o.headers,s=void 0===i?{}:i,a=o.params,u=void 0===a?{}:a,c=o.config,l=void 0===c?{}:c,e.p=3,f=wr(wr({method:t,url:n,withCredentials:!1},l),{},{headers:wr({},s),params:wr({},u)}),null!==r&&(f.data=r),!this._requestSigner){e.n=4;break}return e.n=4,this._applyRequestSignature(f);case 4:return e.n=5,this._client(f);case 5:if(!((p=e.v).status<200||p.status>=300)){e.n=6;break}throw h=this._extractErrorMessage(p.data),new qr(h,p.status,p.data);case 6:return e.a(2,p);case 7:throw e.p=7,d=e.v,this.onError(d);case 8:return e.a(2)}},e,this,[[3,7]])})),function(t,n){return e.apply(this,arguments)})},{key:"_extractErrorMessage",value:function(e){if(!e)return"Unknown error";if(e instanceof ArrayBuffer)try{var t=new TextDecoder("utf-8").decode(e);try{var n=JSON.parse(t);return n.message||n.error||"Binary response error"}catch(e){return t}}catch(e){return"Binary response error (could not decode)"}if("string"==typeof e)try{var r=JSON.parse(e);return r.message||r.error||e}catch(t){return e}return"object"===hr(e)?e.message||e.error||JSON.stringify(e):String(e)}},{key:"onError",value:function(e){return e instanceof qr?e:new qr(e.message||"Unknown error")}}]);var e,t,r,o,i,s,a,u,c,l,f,p,h,d,y,m,b,g,w,v,_,O,E,S,R,P,T,k,A,j,C,N,U,x,D,L,F,B,I,q,M,H,z}(),co=Sr(function e(t,n,r,o){Pr(this,e),this.statusCode=Number(t),this.output=String(n),this.outPosition=null!==r?Number(r):null,this.exitCode=null!==o?Number(o):null}),lo=function(){return Sr(function e(t,n,r){Pr(this,e),this.appName=n,this.procUid=r,this._client=t,this._forwardingHost=t.forwardingHost},[{key:"withForwardingHost",value:(t=Or(dr().m(function e(t){var n;return dr().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=this._client.forwardingHost,this._client.forwardingHost=this._forwardingHost,e.p=1,e.n=2,t();case 2:return e.a(2,e.v);case 3:return e.p=3,this._client.forwardingHost=n,e.f(3);case 4:return e.a(2)}},e,this,[[1,,3,4]])})),function(e){return t.apply(this,arguments)})},{key:"wait",value:(e=Or(dr().m(function e(){var t,n,r=this,o=arguments;return dr().w(function(e){for(;;)if(0===e.n)return t=o.length>0&&void 0!==o[0]?o[0]:zr,n=o.length>1&&void 0!==o[1]?o[1]:0,e.a(2,this.withForwardingHost(function(){return r._client.waitForAsyncRun(r,t,n)}))},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t}();const fo=uo;export{uo as AppMeshClient,qr as AppMeshError,co as AppOutput,Mr as AppRemovedError,lo as AppRun,ro as DEFAULT_CA_FILE,Mn as RefreshTokenProvider,sr as RequestSigner,Nn as StaticAccessTokenProvider,Hr as TransportDisconnectedError,Xr as _resolveGid,to as _resolveGroupName,Jr as _resolveUid,Zr as _resolveUserName,fo as default};
|
|
1
|
+
var e={};const t={};function n(r){const o=t[r];if(void 0!==o)return o.exports;const i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.m=e,(()=>{const e=Object.getPrototypeOf;let t;n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"==typeof r.then)return r}const i=Object.create(null);n.r(i);const s=Object.create(null);t=t||[null,e({}),e([]),e(e)];for(var a=2&o&&r;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(e=>s[e]=()=>r[e]);return s.default=()=>r,n.d(i,s),i}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>{const t=[];return n.f.j(e,t),Promise.all(t)},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})},(()=>{const e={994:()=>import("./994.appmesh.esm.js"),453:()=>import("./453.appmesh.esm.js"),603:()=>import("./603.appmesh.esm.js"),582:()=>import("./582.appmesh.esm.js"),770:()=>import("./770.appmesh.esm.js")},t={792:0},r=e=>{let{__webpack_esm_ids__:r,__webpack_esm_modules__:o,__webpack_esm_runtime__:i}=e;var s,a,u=0;for(s in o)n.o(o,s)&&(n.m[s]=o[s]);for(i&&i(n);u<r.length;u++)a=r[u],n.o(t,a)&&t[a]&&t[a][0](),t[a]=0};n.f.j=(o,i)=>{let s=n.o(t,o)?t[o]:void 0;if(0!==s)if(s)i.push(s[1]);else{const n=Promise.race([e[o]().then(r,e=>{throw 0!==t[o]&&(t[o]=void 0),e}),new Promise(e=>s=t[o]=[e])]);i.push(s[1]=n)}}})();var r={};function o(e,t){return function(){return e.apply(t,arguments)}}n.r(r),n.d(r,{hasBrowserEnv:()=>qe,hasStandardBrowserEnv:()=>Me,hasStandardBrowserWebWorkerEnv:()=>ze,navigator:()=>He,origin:()=>Xe});const{toString:i}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:a,toStringTag:u}=Symbol,c=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),l=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),f=(e,t,n)=>e===Object.prototype||!n&&null===t,p=(e,t)=>{let n=e;const r=[];for(;null!=n;){if(-1!==r.indexOf(n))return!1;r.push(n);const o=s(n);if(f(n,o,n===e))return!1;if(c(n,t))return!0;n=o}return!1},h=(d=Object.create(null),e=>{const t=i.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const y=e=>(e=e.toLowerCase(),t=>h(t)===e),m=e=>t=>typeof t===e,{isArray:b}=Array,v=m("undefined");function g(e){return null!==e&&!v(e)&&null!==e.constructor&&!v(e.constructor)&&E(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const w=y("ArrayBuffer");const _=m("string"),E=m("function"),O=m("number"),S=e=>null!==e&&"object"==typeof e,k=e=>{if(!S(e))return!1;const t=s(e);return(null===t||t===Object.prototype||null===s(t))&&(f(e,t,!0)||!c(e,u)&&!c(e,a))},R=y("Date"),T=y("File"),P=y("Blob"),A=y("FileList"),j=y("Set");const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},N=void 0!==C.FormData?C.FormData:void 0,U=y("URLSearchParams"),[x,D,L,F]=["ReadableStream","Request","Response","Headers"].map(y);function I(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),b(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(g(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}const B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,q=e=>!v(e)&&e!==B;const H=(M="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>M&&e instanceof M);var M;const z=y("HTMLFormElement"),{propertyIsEnumerable:X}=Object.prototype,W=y("RegExp"),K=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};I(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const G=y("AsyncFunction"),$=(J="function"==typeof setImmediate,Y=E(B.postMessage),J?setImmediate:Y?(V=`axios@${Math.random()}`,Q=[],B.addEventListener("message",({source:e,data:t})=>{e===B&&t===V&&Q.length&&Q.shift()()},!1),e=>{Q.push(e),B.postMessage(V,"*")}):e=>setTimeout(e));var J,Y,V,Q;const Z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(B):"undefined"!=typeof process&&process.nextTick||$,ee=e=>null!=e&&E(e[a]),te={isArray:b,isArrayBuffer:w,isBuffer:g,isFormData:e=>{if(!e)return!1;if(N&&e instanceof N)return!0;const t=s(e);if(!t||t===Object.prototype)return!1;if(!E(e.append))return!1;const n=h(e);return"formdata"===n||"object"===n&&E(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&w(e.buffer),t},isString:_,isNumber:O,isBoolean:e=>!0===e||!1===e,isObject:S,isPlainObject:k,isEmptyObject:e=>{if(!S(e)||g(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:x,isRequest:D,isResponse:L,isHeaders:F,isUndefined:v,isDate:R,isFile:T,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:P,isRegExp:W,isFunction:E,isStream:e=>S(e)&&E(e.pipe),isURLSearchParams:U,isTypedArray:H,isFileList:A,forEach:I,merge:function e(...t){const{caseless:n,skipUndefined:r}=q(this)&&this||{},o={},i=n?Object.create(null):null,s=(t,n)=>{if("__proto__"===n||"constructor"===n||"prototype"===n)return;let s=n;if(i&&"string"==typeof n){const e=n.toLowerCase(),t=i[e];void 0!==t&&c(o,t)?s=t:i[e]=n}const a=c(o,s)?o[s]:void 0;k(a)&&k(t)?o[s]=e(a,t):k(t)?o[s]=e({},t):b(t)?o[s]=t.slice():r&&v(t)||(o[s]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||g(n))continue;if(I(n,s),"object"!=typeof n||b(n)||!Object.getOwnPropertySymbols)continue;const r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){const t=r[e];X.call(n,t)&&s(n[t],t)}}return o},extend:(e,t,n,{allOwnKeys:r}={})=>(I(t,(t,r)=>{n&&E(t)?Object.defineProperty(e,r,{__proto__:null,value:o(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const u={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:h,kindOfTest:y,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(b(e))return e;let t=e.length;if(!Number.isSafeInteger(t)||t<0||t>4294967295)return null;const n=new Set,r=new Set;let o=e;for(;null!=o&&n.size<t;){if(r.has(o))return null;r.add(o);const i=s(o);if(f(o,i,o===e))break;Object.getOwnPropertyNames(o).forEach(e=>{const r=+e;Number.isInteger(r)&&r>=0&&r<t&&String(r)===e&&c(o,e)&&n.add(r)}),o=i}if(n.size!==t)return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},forEachEntry:(e,t)=>{const n=(e&&e[a]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:z,hasOwnProperty:c,hasOwnProp:c,hasOwnInPrototypeChain:p,getSafeProp:(e,t)=>null!=e&&p(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;const t=s(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(l(t))return!1;const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable})})(e))return e;const n=Object.create(null),r=Object.create(null),o=[];let i=e;for(;null!=i&&-1===o.indexOf(i);){o.push(i);const a=i===e?t:s(i);if(f(i,a,i===e))break;const u=Object.getOwnPropertyNames(i);Object.getOwnPropertySymbols&&u.push(...Object.getOwnPropertySymbols(i));for(const t of u)l(t)||c(r,t)||(n[t]=e[t],r[t]=!0);i=a}return n},reduceDescriptors:K,freezeMethods:e=>{K(e,(t,n)=>{if(E(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];E(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return b(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:function(e,t){if(g(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null},global:B,isContextDefined:q,isSpecCompliantForm:function(e){return!!(e&&E(e.append)&&"FormData"===e[u]&&e[a])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(S(e)){if(t.has(e))return;if(g(e))return e;if(!("toJSON"in e)){let r;if(t.add(e),j(e)){r=[];for(const t of e){const e=n(t);!v(e)&&r.push(e)}}else r=b(e)?[]:{},I(e,(e,t)=>{const o=n(e);!v(o)&&(r[t]=o)});return t.delete(e),r}}return e};return n(e)},isAsyncFn:G,isThenable:e=>e&&(S(e)||E(e))&&E(e.then)&&E(e.catch),setImmediate:$,asap:Z,isIterable:ee,isSafeIterable:e=>null!=e&&p(e,a)&&ee(e)},ne=te.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const re=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),oe=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ie(e,t){return te.isArray(e)?e.map(e=>ie(e,t)):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function se(e){const t=Object.create(null);return te.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>ie(e,oe))(e)}),t}const ae=Symbol("internals");function ue(e){return e&&String(e).trim().toLowerCase()}function ce(e){return!1===e||null==e?e:te.isArray(e)?e.map(ce):(e=>ie(e,re))(String(e))}const le=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function fe(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}const pe=e=>"__proto__"===e?"__Proto__":e;function he(e,t,n,r,o){return te.isFunction(r)?r.call(e,t,n):(o&&(t=n),te.isString(t)?te.isString(r)?-1!==t.indexOf(r):te.isRegExp(r)?r.test(t):void 0:void 0)}class de{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ue(t);if(!o)return;const i=te.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[pe(i||t)]=ce(e))}const i=(e,t)=>te.forEach(e,(e,n)=>o(e,n,t));if(te.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(te.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t=Object.create(null);let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim();const i=te.hasOwnProp(t,n);!n||i&&te.hasOwnProp(ne,n)||("set-cookie"===n?i?t[n].push(r):t[n]=[r]:t[n]=i?t[n]+", "+r:r)}),t})(e),t);else if(te.isObject(e)&&te.isSafeIterable(e)){let n,r,o=Object.create(null);for(const t of e){if(!te.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],te.hasOwnProp(o,r)?(n=o[r],o[r]=te.isArray(n)?[...n,t[1]]:[n,t[1]]):o[r]=t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=ue(e)){const n=te.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(te.isFunction(t))return t.call(this,e,n);if(te.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ue(e)){const n=te.findKey(this,e);return!(!n||void 0===this[n]||t&&!he(this,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ue(e)){const o=te.findKey(n,e);!o||t&&!he(n,n[o],o,t)||(delete n[o],r=!0)}}return te.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!he(this,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n=Object.create(null);return te.forEach(this,(r,o)=>{const i=te.findKey(n,o);if(i)return t[i]=ce(r),void delete t[o];const s=pe(e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim());s!==o&&delete t[o],t[s]=ce(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return te.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&te.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){const e=this.get("set-cookie");return te.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let r=0,o=!1,i=!1;function s(e){const o=fe(n.slice(r,e)),i=o.indexOf("=");if(i<1)return;const s=fe(o.slice(0,i));if(!le.test(s))return;const a=s.toLowerCase();if("__proto__"===a||"constructor"===a||"prototype"===a)return;const u=fe(o.slice(i+1));t[a]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let r=1;r<t;r++){const o=e.charCodeAt(r);if(34===o)return e;if(92===o&&(r+=1,r>=t))return e;n+=e[r]}return n}(u)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);o?i?i=!1:92===t?i=!0:34===t&&(o=!1):34===t?o=!0:44!==t&&59!==t||(s(e),r=e+1)}return s(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ae]=this[ae]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ue(e);t[r]||(!function(e,t){const n=te.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return te.isArray(e)?e.forEach(r):r(e),this}}de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),te.reduceDescriptors(de.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),te.freezeMethods(de);const ye=de,me="[REDACTED ****]";function be(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),r=[],o=e=>{if(null===e||"object"!=typeof e)return e;if(te.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof ye&&(e=e.toJSON()),r.push(e),te.isArray(e))t=[],e.forEach((e,n)=>{const r=o(e);te.isUndefined(r)||(t[n]=r)});else{if(!te.isPlainObject(e)&&function(e){if(te.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(te.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,i]of Object.entries(e)){const e=n.has(r.toLowerCase())?me:o(i);te.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return o(e)}function ve(e){try{return String(e)}catch(e){return""}}const ge=Symbol("causeStack");class we extends Error{static from(e,t,n,r,o,i){let s=e.message;!s&&te.isArray(e.errors)&&e.errors.length&&(s=function(e){return e.errors.map(e=>{try{return e&&e.message?ve(e.message):ve(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const a=new we(s,t||e.code,n,r,o);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,function(e,t){try{const n=t&&t.stack;if("string"!=typeof n||!n)return;const r=e.stack;if("string"!=typeof r||!r)return;const o="\nCaused by: "+n;e.stack=r+o,Object.defineProperty(e,ge,{__proto__:null,value:o})}catch(e){}}(a,e),null!=e.status&&null==a.status&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,t=e&&te.hasOwnProp(e,"redact")?e.redact:void 0,n=te.isArray(t)&&t.length>0?be(e,t):te.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}we.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",we.ERR_BAD_OPTION="ERR_BAD_OPTION",we.ECONNABORTED="ECONNABORTED",we.ETIMEDOUT="ETIMEDOUT",we.ECONNREFUSED="ECONNREFUSED",we.ERR_NETWORK="ERR_NETWORK",we.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",we.ERR_DEPRECATED="ERR_DEPRECATED",we.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",we.ERR_BAD_REQUEST="ERR_BAD_REQUEST",we.ERR_CANCELED="ERR_CANCELED",we.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",we.ERR_INVALID_URL="ERR_INVALID_URL",we.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const _e=we;function Ee(e){return te.isPlainObject(e)||te.isArray(e)}function Oe(e){return te.endsWith(e,"[]")?e.slice(0,-2):e}function Se(e,t,n){return e?e.concat(t).map(function(e,t){return e=Oe(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ke=te.toFlatObject(te,{},null,function(e){return/^is[A-Z]/.test(e)});const Re=function(e,t,n){if(!te.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(e,t)=>{const r=te.getSafeProp(n,e);return te.isUndefined(r)?t:r},o=r("metaTokens",!0),i=r("visitor")||d,s=r("dots",!1),a=r("indexes",!1),u=r("Blob")||"undefined"!=typeof Blob&&Blob,c=r("maxDepth",100),l=u&&te.isSpecCompliantForm(t),f=[];if(!te.isFunction(i))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(te.isDate(e))return e.toISOString();if(te.isBoolean(e))return e.toString();if(!l&&te.isBlob(e))throw new _e("Blob is not supported. Use a Buffer instead.");if(te.isArrayBuffer(e)||te.isTypedArray(e)){if(l&&"function"==typeof u)return new u([e]);throw new _e("Blob is not supported. Use a Buffer instead.",_e.ERR_NOT_SUPPORT)}return e}function h(e){if(e>c)throw new _e("Object is too deeply nested ("+e+" levels). Max depth: "+c,_e.ERR_FORM_DATA_DEPTH_EXCEEDED)}function d(e,n,r){let i=e;if(te.isReactNative(t)&&te.isReactNativeBlob(e))return t.append(Se(r,n,s),p(e)),!1;if(e&&!r&&"object"==typeof e)if(te.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e,t){if(c===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,function(e,r){if(!te.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),h(t+n.length-1),r})}(e,1);else if(te.isArray(e)&&function(e){return te.isArray(e)&&!e.some(Ee)}(e)||(te.isFileList(e)||te.endsWith(n,"[]"))&&(i=te.toArray(e)))return n=Oe(n),i.forEach(function(e,r){!te.isUndefined(e)&&null!==e&&t.append(!0===a?Se([n],r,s):null===a?n:n+"[]",p(e))}),!1;return!!Ee(e)||(t.append(Se(r,n,s),p(e)),!1)}const y=Object.assign(ke,{defaultVisitor:d,convertValue:p,isVisitable:Ee});if(!te.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!te.isUndefined(n)){if(h(o),-1!==f.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));f.push(n),te.forEach(n,function(n,s){!0===(!(te.isUndefined(n)||null===n)&&i.call(t,n,te.isString(s)?s.trim():s,r,y))&&e(n,r?r.concat(s):[s],o+1)}),f.pop()}}(e),t};function Te(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Pe(e,t){this._pairs=[],e&&Re(e,this,t)}const Ae=Pe.prototype;Ae.append=function(e,t){this._pairs.push([e,t])},Ae.toString=function(e){const t=e?t=>e.call(this,t,Te):Te;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const je=Pe;function Ce(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ne(e,t,n){if(!t)return e;e=e||"";const r=te.isFunction(n)?{serialize:n}:n,o=te.getSafeProp(r,"encode")||Ce,i=te.getSafeProp(r,"serialize");let s;if(s=i?i(t,r):te.isURLSearchParams(t)?t.toString():new je(t,r).toString(o),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Ue=Symbol("internals");function xe(e){return e?e.length:0}function De(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function Le(e,t){const n=e.handlers,r=xe(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)}):t.handlerEntries.clear()),t.handlersLength=r}const Fe=class{constructor(){this.handlers=[],this[Ue]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){const r={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},o=this[Ue];null==this.handlers&&(this.handlers=[]),Le(this,o);const i=o.nextId++;return this.handlers.push(r),o.handlerEntries.set(i,{handler:r,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,i}eject(e){const t=this[Ue];Le(this,t);const n=function(e){return"string"==typeof e&&""!==e&&String(Number(e))===e?Number(e):e}(e),r=t.handlerEntries.get(n);if(r){if(t.handlerEntries.delete(n),this.handlers[r.index]!==r.handler)return;this.handlers[r.index]=null,t.iterationDepth||(De(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Le(this,this[Ue]))}forEach(e){const t=this[Ue];Le(this,t),t.iterationDepth++;try{te.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(Le(this,t),De(this.handlers),t.handlersLength=xe(this.handlers))}}},Ie={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0,encodeBasicAuthUsername:!1},Be={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:je,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},qe="undefined"!=typeof window&&"undefined"!=typeof document,He="object"==typeof navigator&&navigator||void 0,Me=qe&&(!He||["ReactNative","NativeScript","NS"].indexOf(He.product)<0),ze="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Xe=qe&&window.location.href||"http://localhost",We={...r,...Be};function Ke(e){if(e>100)throw new _e("FormData field is too deeply nested ("+e+" levels). Max depth: 100",_e.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Ge(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}function $e(e){if(!te.isArray(e))return e;const t=Object.keys(e);return t.length!==e.length||t.some((e,t)=>e!==String(t))?Ge(e):e}const Je=function(e){function t(e,n,r,o){Ke(o);let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&te.isArray(r)?r.length:i,a)return te.hasOwnProp(r,i)?(r[i]=$e(r[i]),r[i]=te.isArray(r[i])?r[i].concat(n):[r[i],n]):r[i]=n,!s;te.hasOwnProp(r,i)&&te.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&te.isArray(r[i])&&(r[i]=Ge(r[i])),!s}if(te.isFormData(e)&&te.isFunction(e.entries)){const n={};return te.forEachEntry(e,(e,r)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;null!==(r=n.exec(e));)Ke(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)}),function(e){const t=[e];for(;t.length;){const e=t.pop();Object.keys(e).forEach(n=>{const r=e[n]=$e(e[n]);(te.isArray(r)||te.isPlainObject(r))&&t.push(r)})}return e}(n)}return null},Ye=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Ve=(e,t)=>null!=e&&te.hasOwnProp(e,t)?e[t]:void 0;const Qe={transitional:Ie,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=te.isObject(e);o&&te.isHTMLForm(e)&&(e=new FormData(e));if(te.isFormData(e))return r?JSON.stringify(Je(e)):e;if(te.isArrayBuffer(e)||te.isBuffer(e)||te.isStream(e)||te.isFile(e)||te.isBlob(e)||te.isReadableStream(e))return e;if(te.isArrayBufferView(e))return e.buffer;if(te.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){const t=Ve(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Re(e,new We.classes.URLSearchParams,{visitor:function(e,t,n,r){return We.isNode&&te.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((i=te.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Ve(this,"env"),r=n&&n.FormData;return Re(i?{"files[]":e}:e,r&&new r,t)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(te.isString(e))try{return(t||JSON.parse)(e),te.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Ve(this,"transitional")||Qe.transitional,n=t&&t.forcedJSONParsing,r=Ve(this,"responseType"),o="json"===r;if(te.isResponse(e)||te.isReadableStream(e))return e;if(e&&te.isString(e)&&(n&&!r||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Ve(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw _e.from(e,_e.ERR_BAD_RESPONSE,this,null,Ve(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:We.classes.FormData,Blob:We.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};te.forEach(Ye,e=>{Qe.headers[e]={}});const Ze=Qe;function et(e,t){const n=this||Ze,r=t||n,o=ye.from(r.headers);let i=r.data;return te.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function tt(e){return!(!e||!e.__CANCEL__)}const nt=class extends _e{constructor(e,t,n){super(e??"canceled",_e.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function rt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new _e("Request failed with status code "+n.status,n.status>=400&&n.status<500?_e.ERR_BAD_REQUEST:_e.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const ot=/[\t\n\r]/g;function it(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(ot,"")}function st(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1].toLowerCase()||""}const at=e=>{try{return decodeURIComponent(e)}catch(t){return e}},ut=We.hasStandardBrowserEnv?{write(e,t,n,r,o,i,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];te.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),te.isString(r)&&a.push(`path=${r}`),te.isString(o)&&a.push(`domain=${o}`),!0===i&&a.push("secure"),te.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie;if(!t)return null;const n=t.split(";");for(let t=0;t<n.length;t++){const r=n[t].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)return at(r.slice(o+1))}return null},async readAsync(e){try{const t="undefined"!=typeof window&&window.cookieStore;if(t&&te.isFunction(t.get)){const n=await t.get(e);return n?at(n.value):null}}catch(e){}return this.read(e)},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,readAsync:async()=>null,remove(){}};const ct=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const u=Date.now(),c=r[s];o||(o=u),n[i]=a,r[i]=u;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),u-o<t)return;const p=c&&u-c;return p?Math.round(1e3*f/p):void 0}};const lt=function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n),(...e)=>s(e)]},ft=(e,t,n=3)=>{let r=0;const o=ct(50,250);return lt(n=>{if(!n||!te.isNumber(n.loaded))return;const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=Math.max(0,null!=s?Math.min(i,s):i),u=Math.max(0,a-r),c=o(u);r=Math.max(r,a);e({loaded:a,total:s,progress:s?a/s:void 0,bytes:u,rate:c||void 0,estimated:c&&s?(s-a)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},pt=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ht=(e,t=te.asap)=>(...n)=>t(()=>e(...n)),dt=We.hasStandardBrowserEnv?(e=>t=>(t=new URL(t,document.baseURI||We.origin),e.protocol===t.protocol&&e.host===t.host&&e.port===t.port))(new URL(We.origin)):()=>!0;const yt=/^https?:(?!\/\/)/i;function mt(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${me}@`),n=t.indexOf("#"),r=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${me}`);return-1===n?r:`${r}#${o=t.slice(n+1),o?o.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${me}`):o}`;var o}function bt(e,t){if("string"==typeof e){const n=it(e);if(yt.test(n))throw new _e(`Invalid URL ${JSON.stringify(mt(n))}: missing "//" after protocol`,_e.ERR_INVALID_URL,t)}}function vt(e,t,n,r){bt(t,r);let o=!("string"==typeof(i=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));var i;return e&&(o||!1===n)?(bt(e,r),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const gt=e=>e instanceof ye?{...e}:e,wt=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>{const n=Object.getOwnPropertyDescriptor(e,t);return n&&n.enumerable})):Object.keys(e);function _t(e,t,n,r){return te.isPlainObject(e)&&te.isPlainObject(t)?te.merge.call({caseless:r},e,t):te.isPlainObject(t)?te.merge({},t):te.isArray(t)?t.slice():t}function Et(e,t,n,r){return te.isUndefined(t)?te.isUndefined(e)?void 0:_t(void 0,e,0,r):_t(e,t,0,r)}function Ot(e,t){if(!te.isUndefined(t))return _t(void 0,t)}function St(e,t){return te.isUndefined(t)?te.isUndefined(e)?void 0:_t(void 0,e):_t(void 0,t)}function kt(e,t,n,r,o){return te.hasOwnProp(o,n)?_t(e,t):te.hasOwnProp(r,n)?_t(void 0,e):void 0}const Rt=Object.freeze({__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0}),Tt={url:Ot,method:Ot,data:Ot,baseURL:St,transformRequest:St,transformResponse:St,params:function(e,t){const n=[],r=new WeakMap,o={};function i(e,t){if(!te.isPlainObject(t))return te.isArray(t)?t.slice():t;const i=te.isPlainObject(e)?e:o;let s=r.get(t);if(s||(s=new WeakMap,r.set(t,s)),s.has(i))return s.get(i);const a={};return s.set(i,a),n.push({base:i,source:t,result:a}),a}const s=te.isUndefined(t)?i(void 0,e):i(e,t);for(;n.length;){const{base:e,source:t,result:r}=n.pop(),o=new Set(wt(e)),s=new Set(wt(t));new Set([...o,...s]).forEach(n=>{if("__proto__"===n||"constructor"===n||"prototype"===n)return;const a=s.has(n),u=a?t[n]:void 0,c=a&&!te.isPlainObject(u)||!o.has(n)?void 0:e[n];r[n]=a?i(c,u):i(void 0,c)})}return function(e){const t=[{value:e}],n=new WeakSet,r=new WeakSet;for(;t.length;){const{value:e,done:o}=t.pop();if(!te.isPlainObject(e)&&!te.isArray(e))continue;if(o){n.delete(e);continue}if(n.has(e))throw new _e("Circular reference detected in params",_e.ERR_BAD_OPTION_VALUE);if(r.has(e))continue;r.add(e),n.add(e),t.push({value:e,done:!0});const i=Object.keys(e);Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor&&Object.getOwnPropertySymbols(e).forEach(t=>{const n=Object.getOwnPropertyDescriptor(e,t);n&&n.enumerable&&i.push(t)}),i.forEach(n=>{if("__proto__"===n||"constructor"===n||"prototype"===n){const r=Object.getOwnPropertyDescriptor(e,n);r&&te.hasOwnProp(r,"value")&&t.push({value:r.value})}else t.push({value:e[n]})})}}(s),s},paramsSerializer:St,timeout:St,timeoutErrorMessage:St,withCredentials:St,withXSRFToken:St,adapter:St,responseType:St,xsrfCookieName:St,xsrfHeaderName:St,onUploadProgress:St,onDownloadProgress:St,decompress:St,maxContentLength:St,maxBodyLength:St,beforeRedirect:St,transport:St,httpAgent:St,httpsAgent:St,cancelToken:St,socketPath:St,allowedSocketPaths:St,responseEncoding:St,validateStatus:kt,headers:function(e,t,n){return Et(gt(e),gt(t),0,!0)}};function Pt(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",Rt);const r=wt({...e,...t});for(let o=0,i=r.length;o<i;o++){const i=r[o];if("__proto__"===i||"constructor"===i||"prototype"===i)continue;const s=te.hasOwnProp(Tt,i)?Tt[i]:Et,a=te.hasOwnProp(e,i)?e[i]:void 0,u=te.hasOwnProp(t,i)?t[i]:void 0,c=s===kt?s(a,u,i,e,t):s(a,u,i);te.isUndefined(c)&&s!==kt||(n[i]=c)}return te.hasOwnProp(t,"validateStatus")&&te.isUndefined(t.validateStatus)&&!1===function(e,t,n){const r=te.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!te.isUndefined(r)){if(!te.isPlainObject(r))return;if(te.hasOwnProp(r,n))return r[n]}const o=te.hasOwnProp(e,"transitional")?e.transitional:void 0;if(te.isPlainObject(o)&&te.hasOwnProp(o,n))return o[n]}(e,t,"validateStatusUndefinedResolves")&&(te.hasOwnProp(e,"validateStatus")?n.validateStatus=_t(void 0,e.validateStatus):delete n.validateStatus),n}const At=["content-type","content-length"];const jt=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),Ct=e=>ut.read(e);const Nt=function(e,t=Ct){const n=Pt({},e),r=e=>te.hasOwnProp(n,e)?n[e]:void 0,o=r("data");let i=r("withXSRFToken");const s=r("xsrfHeaderName"),a=r("xsrfCookieName");let u=r("headers");const c=r("auth"),l=r("baseURL"),f=r("allowAbsoluteUrls"),p=r("url");if(n.headers=u=ye.from(u),n.url=Ne(vt(l,p,f,n),r("params"),r("paramsSerializer")),c){const t=te.getSafeProp(c,"username")||"",n=te.getSafeProp(c,"password")||"",o=r("transitional"),i=o&&te.hasOwnProp(o,"encodeBasicAuthUsername")&&!0===o.encodeBasicAuthUsername;try{u.set("Authorization","Basic "+btoa((i?jt(t):t)+":"+(n?jt(n):"")))}catch(t){throw _e.from(t,_e.ERR_BAD_OPTION_VALUE,e)}}if(te.isFormData(o)){const e=te.getSafeProp(o,"getHeaders");We.hasStandardBrowserEnv||We.hasStandardBrowserWebWorkerEnv||te.isReactNative(o)?u.setContentType(void 0):te.isFunction(e)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{At.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(u,e.call(o),r("formDataHeaderPolicy"))}if(We.hasStandardBrowserEnv){te.isFunction(i)&&(i=i(n));if(!0===i||null==i&&dt(n.url)){const e=s&&a&&t(a);e&&u.set(s,e)}}return n},Ut="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){let r,o;try{const e=We.hasStandardBrowserEnv&&"undefined"!=typeof window&&window.cookieStore;r=e&&te.isFunction(e.get)}catch(e){}const i=Nt(e,r?e=>(o=e,null):void 0);let s=i.data;const a=ye.from(i.headers).normalize();let u,c,l,f,p,h,d,{responseType:y,onUploadProgress:m,onDownloadProgress:b}=i;function v(){clearTimeout(c);try{p&&p()}catch(e){setTimeout(()=>{throw e})}try{h&&h()}catch(e){setTimeout(()=>{throw e})}g&&(f&&g.removeEventListener("progress",f),g.upload&&(l&&g.upload.removeEventListener("progress",l),p&&g.upload.removeEventListener("loadend",p))),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let g=new XMLHttpRequest;function w(r){if(!g)return;if(!(0!==g.status||"file"===(st(it(i.url))||st(We.origin))||g.responseURL&&g.responseURL.startsWith("file:")))return n(new _e("Request aborted",_e.ECONNABORTED,e,g)),v(),void(g=null);try{r?d&&d(r):h&&h()}catch(e){setTimeout(()=>{throw e})}if(!g)return;const o=ye.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());rt(function(e){t(e),v()},function(e){n(e),v()},{data:y&&"text"!==y&&"json"!==y?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:o,config:e,request:g}),g=null}if(g.open(i.method.toUpperCase(),i.url,!0),g.timeout=i.timeout,"onloadend"in g?g.onloadend=w:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(w)},g.onabort=function(){g&&(n(new _e("Request aborted",_e.ECONNABORTED,e,g)),v(),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new _e(r,_e.ERR_NETWORK,e,g);o.event=t||null,n(o),v(),g=null},g.ontimeout=function(){if(!g)return;let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const r=i.transitional||Ie;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),n(new _e(t,r.clarifyTimeoutError?_e.ETIMEDOUT:_e.ECONNABORTED,e,g)),v(),g=null},void 0===s&&a.setContentType(null),te.isUndefined(i.withCredentials)||(g.withCredentials=!!i.withCredentials),y&&"json"!==y&&(g.responseType=i.responseType),b&&([f,h,d]=ft(b,!0),g.addEventListener("progress",f)),m&&g.upload&&([l,p]=ft(m),g.upload.addEventListener("progress",l),g.upload.addEventListener("loadend",p)),i.cancelToken||i.signal){if(u=t=>{if(!g)return;n(!t||t.type?new nt(null,e,g):t);const r=g;v(),g=null,r.abort()},i.cancelToken&&i.cancelToken.subscribe(u),!g)return;i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u))}if(!g)return;const _=st(i.url);if(_&&!We.protocols.includes(_))return n(new _e("Unsupported protocol "+_+":",_e.ERR_BAD_REQUEST,e)),void v();const E=()=>{g&&("setRequestHeader"in g&&te.forEach(se(a),function(e,t){g.setRequestHeader(t,e)}),g.send(s||null))};if(o){const t="undefined"!=typeof performance&&te.isFunction(performance.now)?()=>performance.now():Date.now,r=g.timeout>0?t()+Number(g.timeout):void 0,s=()=>{if(!g)return;const e=g;e.ontimeout(),e.abort()};if(void 0!==r){const e=()=>{const n=r-t();n>0?c=setTimeout(e,Math.min(n,2147483647)):s()};e()}ut.readAsync(o).then(e=>{if(g)if(void 0!==r&&t()>=r)s();else{if(e){const t=te.hasOwnProp(i,"xsrfHeaderName")&&i.xsrfHeaderName;a.set(t,e)}E()}}).catch(t=>{g&&(n(_e.from(t,null,e,g)),v(),g=null)})}else E()})},xt=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const o=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof _e?t:new nt(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new _e(`timeout of ${t}ms exceeded`,_e.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{const t=te.getSafeProp(e,"unsubscribe");te.isFunction(t)?t.call(e,o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>{r||(e.aborted?o.call(e):e.addEventListener("abort",o,{once:!0}))});const{signal:a}=n;return a.unsubscribe=()=>te.asap(s),a},Dt=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Lt=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Ft=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Lt(e))yield*Dt(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},It="\r\n",Bt=e=>String(e).replace(/\r\n|\r|\n/g,It),qt=e=>String(e).replace(/[\r\n"]/g,e=>"\r"===e?"%0D":"\n"===e?"%0A":"%22"),Ht=(e,t)=>{let n=0;for(let r=0;r<e.length;r++){const o=e.charCodeAt(r);!t||13!==o&&10!==o?o<128?n++:o<2048?n+=2:o>=55296&&o<=56319&&e.charCodeAt(r+1)>=56320&&e.charCodeAt(r+1)<=57343?(n+=4,r++):n+=3:(13===o&&10===e.charCodeAt(r+1)&&r++,n+=2)}return n};class Mt extends TypeError{constructor(e,t){super(e),this.name="FormDataError",this.reason=t}}function zt(e,t,n,r,o){if(!te.isFunction(t))throw new _e("Blob is not supported",_e.ERR_NOT_SUPPORT);if(void 0===o)if(te.isFunction(We.generateString))o="axios-"+We.generateString(36,"0123456789abcdef");else{const e=te.global.crypto;if(!e||!te.isFunction(e.getRandomValues))throw new _e("Random byte generation is not supported",_e.ERR_NOT_SUPPORT);const t=new Uint8Array(18);e.getRandomValues(t),o="axios-"+Array.from(t,e=>("0"+e.toString(16)).slice(-2)).join("")}try{return function(e,t,n,r,o){if(!te.isFunction(t))throw new Mt("Blob is not supported","blob");if(!te.isString(o)||!/^[A-Za-z0-9'()+_,./:=? -]{1,70}$/.test(o)||/ $/.test(o))throw new Mt("Invalid multipart boundary","boundary");const i="--"+o+"--"+It;let s=i.length;const a=[],u=e=>{if(s+e>n)throw r()};u(0);for(const[t,n]of e){const e=te.isString(n),r=e?Ht(n,!0):n.size;if(!Number.isFinite(r)||r<0)throw new Mt("Unsupported FormData part size","part");u(r+Ht(t,!0)+(!e&&n.name?Ht(n.name,!1):0)+(!e&&n.type?Ht(n.type,!1):0));let i="--"+o+'\r\nContent-Disposition: form-data; name="'+qt(Bt(t))+'"';e||(i+='; filename="'+qt(te.isString(n.name)?n.name:"blob")+'"\r\nContent-Type: '+String(n.type||"application/octet-stream").replace(/[\r\n]/g,"")),i+=It+It;const c=Ht(i,!1)+r+2;u(c),s+=c,a.push({header:i,value:n,isString:e})}const c=[];for(const e of a)c.push(e.header,e.isString?Bt(e.value):e.value,It);return c.push(i),new t(c,{type:"multipart/form-data; boundary="+o})}(e,t,n,r,o)}catch(e){if(e instanceof Mt){const t="boundary"===e.reason?_e.ERR_BAD_OPTION_VALUE:_e.ERR_BAD_REQUEST;throw new _e(e.message,t)}throw e}}const Xt=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Wt=(e,t,n)=>t+2<n&&Xt(e.charCodeAt(t+1))&&Xt(e.charCodeAt(t+2)),Kt=e=>e<=57?e-48:(223&e)-55,Gt=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,$t=e=>9===e||10===e||12===e||13===e||32===e,Jt=e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)},Yt=e=>{const t=e.length;let n=0,r=0,o=!1;for(let i=0;i<t;i++){let s=e.charCodeAt(i);37===s&&Wt(e,i,t)&&(s=16*Kt(e.charCodeAt(i+1))+Kt(e.charCodeAt(i+2)),i+=2),$t(s)||(61!==s?!Gt(s)||r>0?o=!0:n++:r++)}return o||r>2||r>0&&(n+r)%4!=0||n%4==1?Jt(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)},Vt=(e,t,n)=>{if(!e||"string"!=typeof e)return 0;if(!/^data:/i.test(e))return 0;const r=e.indexOf(",");if(r<0)return 0;const o=e.slice(5,r),i=e.slice(r+1);if(n.test(o))return t(i);let s=0;for(let e=0,t=i.length;e<t;e++){const n=i.charCodeAt(e);if(37===n&&Wt(i,e,t))s+=1,e+=2;else if(n<128)s+=1;else if(n<2048)s+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=i.charCodeAt(e+1);t>=56320&&t<=57343?(s+=4,e++):s+=3}else s+=3}return s};const Qt={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:Zt}=te,en=e=>{if(!te.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},tn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},nn=e=>{const t=void 0!==te.global&&null!==te.global?te.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=te.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response,Blob:t.Blob},e);const o=te.hasOwnProp(e,"fetch")?e.fetch:void 0,{Request:i,Response:s,Blob:a}=e,u=o?Zt(o):"function"==typeof fetch,c=Zt(i),l=Zt(s);if(!u)return!1;const f=u&&Zt(n),p=u&&("function"==typeof r?(h=new r,e=>h.encode(e)):async e=>new Uint8Array(await new i(e).arrayBuffer()));var h;const d=c&&f&&tn(()=>{let e=!1;const t=new i(We.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),y=l&&f&&tn(()=>te.isReadableStream(new s("").body)),m=Object.assign(Object.create(null),Qt);c&&!tn(()=>new i(We.origin,m))&&(delete m.cache,tn(()=>new i(We.origin,m))||(m.cache=Qt.cache));const b={stream:y&&(e=>e.body)};u&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!b[e]&&(b[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new _e(`Response type '${e}' is not supported`,_e.ERR_NOT_SUPPORT,n)})});const v=async e=>null==e?0:te.isBlob(e)?e.size:te.isArrayBufferView(e)||te.isArrayBuffer(e)?e.byteLength:(te.isURLSearchParams(e)&&(e+=""),te.isString(e)?(await p(e)).byteLength:void 0);return async e=>{let{url:t,method:n,data:u,signal:l,cancelToken:p,timeout:h,onDownloadProgress:g,onUploadProgress:w,responseType:_,headers:E,withCredentials:O="same-origin",fetchOptions:S,maxContentLength:k,maxBodyLength:R,maxRedirects:T}=Nt(e);const P=te.isNumber(k)&&k>-1,A=te.isNumber(R)&&R>-1,j=t=>te.hasOwnProp(e,t)?e[t]:void 0;let C=o||fetch;_=_?(_+"").toLowerCase():"text";let N=xt([l,p&&p.toAbortSignal()],h),U=null;const x=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let D,L=null,F=null;const I=()=>new _e("Request body larger than maxBodyLength limit",_e.ERR_BAD_REQUEST,e,U);try{let o;const l=j("auth");if(l){const e=te.getSafeProp(l,"username")||"";o={username:e,password:te.getSafeProp(l,"password")||""}}let p;if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){if(p=new URL(t,We.origin),!o&&(p.username||p.password)){const e=en(p.username);o={username:e,password:en(p.password)}}(p.username||p.password)&&(p.username="",p.password="",t=p.href)}if(o&&(E.delete("authorization"),E.set("Authorization","Basic "+btoa((B=(o.username||"")+":"+(o.password||""),encodeURIComponent(B).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))),P&&p&&"data:"===p.protocol){const t=function(e){const t="string"==typeof e?e.indexOf("#"):-1;return Vt(-1===t?e:e.slice(0,t),Yt,/; *base64[\t\n\f\r ]*$/i)}(p.href);if(t>k)throw new _e("maxContentLength size of "+k+" exceeded",_e.ERR_BAD_RESPONSE,e,U)}const h=te.isSpecCompliantForm(u)&&ye.from(j("headers")).getContentType();let q;if(te.isString(h)&&/^multipart\/form-data(?:\s*;|$)/i.test(h.trim())){const e=ye.parseParameters(h);te.hasOwnProp(e,"boundary")&&(q=e.boundary)}if(te.isSpecCompliantForm(u)&&"get"!==n&&"head"!==n&&(A||w&&d||void 0!==q)&&(u=zt(u,a,A?R:1/0,I,q),E.setContentType(void 0===q?u.type:h),D=u.size),A&&"get"!==n&&"head"!==n){const e=await v(u);if("number"==typeof e&&isFinite(e)&&(D=e,e>R))throw I()}const H=A&&(te.isReadableStream(u)||te.isStream(u)),M=(e,t,n)=>Ft(e,65536,e=>{if(A&&e>R)throw L=I();t&&t(e)},n);if(d&&"get"!==n&&"head"!==n&&(w||H)){if(D=D??await(async(e,t)=>{const n=te.toFiniteNumber(e.getContentLength());return n??v(t)})(E,u),0!==D||H){let e,n=new i(t,{method:"POST",body:u,duplex:"half"});if(te.isFormData(u)&&(e=n.headers.get("content-type"))&&E.setContentType(e),n.body){const[e,t]=w&&pt(D,ft(ht(w)))||[];u=M(n.body,e,t)}}}else if(H&&!c&&f&&"get"!==n&&"head"!==n)u=M(u);else if(H&&c&&!d&&"get"!==n&&"head"!==n)throw new _e("Stream request bodies are not supported by the current fetch implementation",_e.ERR_NOT_SUPPORT,e,U);te.isString(O)||(O=O?"include":"omit");const z=c&&"credentials"in i.prototype;if(te.isFormData(u)){const e=E.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&E.delete("content-type")}E.set("User-Agent","axios/1.21.1",!1);const X=null==S?S:Object.assign(Object.create(null),S);X&&(delete X.body,delete X.headers,delete X.method,delete X.signal,delete X.duplex,delete X.credentials);const W=Object.assign(Object.create(null),X,{signal:N,method:n.toUpperCase(),headers:se(E.normalize()),body:u,duplex:"half",credentials:z?O:void 0});c&&(te.forEach(m,(e,t)=>{void 0===W[t]&&(W[t]=e)}),void 0===W.signal&&(W.signal=null),void 0===W.body&&(W.body=null)),0===T&&(W.redirect="manual",X&&(X.redirect="manual")),U=c&&new i(t,W);let K=await(c?C(U,X):C(t,W));const G=ye.from(K.headers);if(P){const t=te.toFiniteNumber(G.getContentLength());if(null!=t&&t>k)throw new _e("maxContentLength size of "+k+" exceeded",_e.ERR_BAD_RESPONSE,e,U)}const $=y&&("stream"===_||"response"===_);if(y&&K.body&&(g||P||$&&x)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=K[e]});const n=te.toFiniteNumber(G.getContentLength()),[r,o]=g&&pt(n,ft(ht(g),!0))||[];let i=0;const a=t=>{if(P&&(i=t,i>k))throw F=new _e("maxContentLength size of "+k+" exceeded",_e.ERR_BAD_RESPONSE,e,U);r&&r(t)};K=new s(Ft(K.body,65536,a,()=>{o&&o(),x&&x()}),t)}_=_||"text";let J=await b[te.findKey(b,_)||"text"](K,e);if(P&&!y&&!$){let t;if(null!=J&&("number"==typeof J.byteLength?t=J.byteLength:"number"==typeof J.size?t=J.size:"string"==typeof J&&(t="function"==typeof r?(new r).encode(J).byteLength:J.length)),"number"==typeof t&&t>k)throw new _e("maxContentLength size of "+k+" exceeded",_e.ERR_BAD_RESPONSE,e,U)}return!$&&x&&x(),await new Promise((t,n)=>{rt(t,n,{data:J,headers:ye.from(K.headers),status:K.status,statusText:K.statusText,config:e,request:U})})}catch(t){if(x&&x(),N&&N.aborted&&N.reason instanceof _e){const n=N.reason;throw n.config=e,U&&(n.request=U),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(L)throw U&&!L.request&&(L.request=U),L;if(F)throw F;if(t instanceof _e)throw U&&!t.request&&(t.request=U),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new _e("Network Error",_e.ERR_NETWORK,e,U,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw _e.from(t,t&&t.code,e,U,t&&t.response)}var B}},rn=new Map,on=e=>{const t=Object.create(null),n=e&&te.hasOwnProp(e,"env")&&e.env;["fetch","Request","Response","Blob"].forEach(e=>{n&&te.hasOwnProp(n,e)&&(t[e]=n[e])});const{fetch:r,Request:o,Response:i,Blob:s}=t,a=[o,i,r,s];let u,c,l=a.length,f=rn;for(;l--;)u=a[l],c=f.get(u),void 0===c&&f.set(u,c=l?new Map:nn(t)),f=c;return c},sn=(on(),{http:null,xhr:Ut,fetch:{get:on}});te.forEach(sn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const an=e=>`- ${e}`,un=e=>te.isFunction(e)||null===e||!1===e;const cn={getAdapter:function(e,t){e=te.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!un(r)&&(o=sn[(n=String(r)).toLowerCase()],void 0===o))throw new _e(`Unknown adapter '${n}'`);if(o&&(te.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(an).join("\n"):" "+an(e[0]):"as no adapter specified";throw new _e("There is no suitable adapter to dispatch the request "+t,_e.ERR_NOT_SUPPORT)}return o},adapters:sn};function ln(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nt(null,e)}function fn(e,t){return Math.max(0,Math.round(e()-t))}function pn(e){const t=te.toSafeFlatObject(e);ln(t),t.headers=ye.from(te.getSafeProp(t,"headers")),t.data=et.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);const n=cn.getAdapter(t.adapter||Ze.adapter,t),r="undefined"!=typeof performance&&te.isFunction(performance.now)?()=>performance.now():Date.now,o=r();return n(t).then(function(e){ln(t),e.duration=fn(r,o),t.response=e;try{e.data=et.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=ye.from(e.headers),e},function(e){if(!tt(e)&&(ln(t),e&&e.response)){e.response.duration=fn(r,o),t.response=e.response;try{e.response.data=et.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=ye.from(e.response.headers)}return Promise.reject(e)})}const hn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{hn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const dn={};hn.transitional=function(e,t,n){function r(e,t){return"[Axios v1.21.1] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new _e(r(o," has been removed"+(t?" in "+t:"")),_e.ERR_DEPRECATED);return t&&!dn[o]&&(dn[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},hn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const yn={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new _e("options must be an object",_e.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new _e("option "+i+" must be "+n,_e.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new _e("Unknown option "+i,_e.ERR_BAD_OPTION)}},validators:hn},mn=yn.validators,bn=e=>{if(null==e||te.isPlainObject(e)||e instanceof ye)return!0;try{return te.isObject(e)&&"AxiosHeaders"===te.getSafeProp(e,Symbol.toStringTag)&&["toJSON","set","get","has","delete","clear","normalize","concat","toString",Symbol.iterator].every(t=>te.isFunction(te.getSafeProp(e,t)))}catch(e){return!1}};class vn{constructor(e){this.defaults=e||{},this.interceptors={request:new Fe,response:new Fe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack;let r="";if("string"==typeof n){const e=n.indexOf("\n");r=-1===e?"":n.slice(e+1)}if(e.stack){if(r){const t=r.indexOf("\n"),n=-1===t?-1:r.indexOf("\n",t+1),o=-1===n?r:r.slice(n+1),i=String(e.stack),s=function(e,t){const n=te.hasOwnProp(e,ge)&&e[ge];return n&&t.endsWith(n)?t.length-n.length:-1}(e,i),a=-1===s?i:i.slice(0,s),u=-1===s?"":i.slice(s);a.endsWith(o)||(e.stack=a+"\n"+r+u)}}else e.stack=r}catch(e){}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Pt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&yn.assertOptions(n,{silentJSONParsing:mn.transitional(mn.boolean),forcedJSONParsing:mn.transitional(mn.boolean),clarifyTimeoutError:mn.transitional(mn.boolean),legacyInterceptorReqResOrdering:mn.transitional(mn.boolean),advertiseZstdAcceptEncoding:mn.transitional(mn.boolean),validateStatusUndefinedResolves:mn.transitional(mn.boolean),encodeBasicAuthUsername:mn.transitional(mn.boolean)},!1),null!=r&&(te.isFunction(r)?t.paramsSerializer={serialize:r}:yn.assertOptions(r,{encode:mn.function,serialize:mn.function},!0)),void 0!==t.allowAbsoluteUrls||(te.hasOwnProp(this.defaults,"allowAbsoluteUrls")&&void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),yn.assertOptions(t,{baseUrl:mn.spelling("baseURL"),withXsrfToken:mn.spelling("withXSRFToken")},!0),t.method=(te.getSafeProp(t,"method")||te.getSafeProp(this.defaults,"method")||"get").toLowerCase();const i=te.getSafeProp(o,"common"),s=te.getSafeProp(o,t.method),a=o&&te.merge(bn(i)?i:void 0,bn(s)?s:void 0);o&&te.forEach(Ye.concat("common"),e=>{bn(te.getSafeProp(o,e))&&delete o[e]}),t.headers=ye.concat(a,o);const u=[];let c=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;c=c&&e.synchronous;const n=t.transitional||Ie;n&&n.legacyInterceptorReqResOrdering?u.unshift(e.fulfilled,e.rejected):u.push(e.fulfilled,e.rejected)});const l=[];let f;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let p,h=0;if(!c){const e=[pn.bind(this),void 0];for(e.unshift(...u),e.push(...l),p=e.length,f=Promise.resolve(t);h<p;)f=f.then(e[h++],e[h++]);return f}p=u.length;let d=t;for(;h<p;){const e=u[h++],t=u[h++];try{d=e?e(d):d}catch(e){if(!t){f=Promise.reject(e);break}try{const n=t.call(this,e);te.isThenable(n)&&(f=Promise.resolve(n).then(()=>pn.call(this,d)))}catch(e){f=Promise.reject(e)}break}}if(!f)try{f=pn.call(this,d)}catch(e){f=Promise.reject(e)}for(h=0,p=l.length;h<p;)f=f.then(l[h++],l[h++]);return f}getUri(e){return Ne(vt((e=Pt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}te.forEach(["delete","get","head","options"],function(e){vn.prototype[e]=async function(t,n){return this.request(Pt(n||{},{method:e,url:t,data:n&&te.hasOwnProp(n,"data")?n.data:void 0}))}}),te.forEach(["post","put","patch","query"],function(e){function t(t){return async function(n,r,o){return this.request(Pt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}vn.prototype[e]=t(),"query"!==e&&(vn.prototype[e+"Form"]=t(!0))});const gn=vn;class wn{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new nt(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new wn(function(t){e=t}),cancel:e}}}const _n=wn;const En={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(En).forEach(([e,t])=>{void 0===En[t]&&(En[t]=e)});const On=En;const Sn=function e(t){const n=new gn(t),r=o(gn.prototype.request,n);return te.extend(r,gn.prototype,n,{allOwnKeys:!0}),te.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Pt(t,n))},r}(Ze);Sn.Axios=gn,Sn.CanceledError=nt,Sn.CancelToken=_n,Sn.isCancel=tt,Sn.VERSION="1.21.1",Sn.toFormData=Re,Sn.AxiosError=_e,Sn.Cancel=Sn.CanceledError,Sn.all=function(e){return Promise.all(e)},Sn.spread=function(e){return function(t){return e.apply(null,t)}},Sn.isAxiosError=function(e){return te.isObject(e)&&!0===e.isAxiosError},Sn.mergeConfig=Pt,Sn.AxiosHeaders=ye,Sn.formToJSON=e=>Je(te.isHTMLForm(e)?new FormData(e):e),Sn.getAdapter=cn.getAdapter,Sn.HttpStatusCode=On,Sn.default=Sn;const kn=Sn;function Rn(e){return Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rn(e)}function Tn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return Pn(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Pn(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Pn(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Pn(f,"constructor",c),Pn(c,"constructor",u),u.displayName="GeneratorFunction",Pn(c,o,"GeneratorFunction"),Pn(f),Pn(f,o,"Generator"),Pn(f,r,function(){return this}),Pn(f,"toString",function(){return"[object Generator]"}),(Tn=function(){return{w:i,m:p}})()}function Pn(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Pn=function(e,t,n,r){function i(t,n){Pn(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Pn(e,t,n,r)}function An(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function jn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Cn(r.key),r)}}function Cn(e){var t=function(e,t){if("object"!=Rn(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=Rn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Rn(t)?t:t+""}var Nn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._token=e._validate(t)},t=[{key:"getAccessToken",value:(r=Tn().m(function e(){return Tn().w(function(e){for(;;)if(0===e.n)return e.a(2,this._token)},e,this)}),o=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function s(e){An(i,n,o,s,a,"next",e)}function a(e){An(i,n,o,s,a,"throw",e)}s(void 0)})},function(){return o.apply(this,arguments)})},{key:"canRefresh",value:function(){return!1}},{key:"clear",value:function(){this._token=null}}],n=[{key:"_validate",value:function(e){if("string"!=typeof e||!e.trim())throw new TypeError("bearer token must be a non-empty string");return e.trim()}}],t&&jn(e.prototype,t),n&&jn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o}();function Un(e){return Un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Un(e)}function xn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return Dn(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Dn(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Dn(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Dn(f,"constructor",c),Dn(c,"constructor",u),u.displayName="GeneratorFunction",Dn(c,o,"GeneratorFunction"),Dn(f),Dn(f,o,"Generator"),Dn(f,r,function(){return this}),Dn(f,"toString",function(){return"[object Generator]"}),(xn=function(){return{w:i,m:p}})()}function Dn(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Dn=function(e,t,n,r){function i(t,n){Dn(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Dn(e,t,n,r)}function Ln(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Fn(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){Ln(i,r,o,s,a,"next",e)}function a(e){Ln(i,r,o,s,a,"throw",e)}s(void 0)})}}function In(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Bn(r.key),r)}}function Bn(e){var t=function(e,t){if("object"!=Un(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=Un(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Un(t)?t:t+""}var qn=new Set(["127.0.0.1","localhost","::1","[::1]"]);var Hn=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.tokenUrl,r=t.clientId,o=void 0===r?"appmesh-cli":r,i=t.accessToken,s=t.refreshToken,a=t.expiresIn,u=void 0===a?0:a,c=t.httpClient;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._tokenUrl=function(e){var t;try{t=new URL(e)}catch(e){throw new TypeError("tokenUrl must be a valid URL")}if("https:"===t.protocol)return e;if("http:"===t.protocol&&qn.has(t.hostname.toLowerCase()))return e;throw new TypeError("tokenUrl must use https, or http only for loopback hosts (127.0.0.1, localhost, ::1)")}(n),this._clientId=o,this._accessToken=i||null,this._refreshToken=s||null,this._http=c||kn.create({timeout:3e4}),this._inflightRefresh=null,this._expiresAtMs=0,this._lifetimeMs=0,this._setExpiry(u)},t=[{key:"getAccessToken",value:(s=Fn(xn().m(function e(){return xn().w(function(e){for(;;)switch(e.n){case 0:if(!(null===this._accessToken&&this._refreshToken||this._isExpiringSoon())){e.n=1;break}return e.n=1,this._refresh();case 1:if(null!==this._accessToken||this._refreshToken){e.n=2;break}throw new Error("no access token available: the provider holds no credentials");case 2:return e.a(2,this._accessToken)}},e,this)})),function(){return s.apply(this,arguments)})},{key:"canRefresh",value:function(){return!!this._refreshToken}},{key:"refreshAccessToken",value:(i=Fn(xn().m(function e(t){return xn().w(function(e){for(;;)switch(e.n){case 0:if(!t||t===this._accessToken){e.n=1;break}return e.a(2,this._accessToken);case 1:return e.n=2,this._refresh();case 2:return e.a(2,this._accessToken)}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"clear",value:function(){this._accessToken=null,this._refreshToken=null,this._expiresAtMs=0,this._lifetimeMs=0}},{key:"_setExpiry",value:function(e){var t=Number(e);Number.isFinite(t)&&t>0?(this._lifetimeMs=1e3*t,this._expiresAtMs=Date.now()+this._lifetimeMs):(this._lifetimeMs=0,this._expiresAtMs=0)}},{key:"_isExpiringSoon",value:function(){if(!this._expiresAtMs||!this._refreshToken)return!1;var e=Math.max(3e4,.1*this._lifetimeMs);return Date.now()>=this._expiresAtMs-e}},{key:"_refresh",value:(o=Fn(xn().m(function e(){var t=this;return xn().w(function(e){for(;;)if(0===e.n)return this._inflightRefresh||(this._inflightRefresh=this._performRefresh().finally(function(){t._inflightRefresh=null})),e.a(2,this._inflightRefresh)},e,this)})),function(){return o.apply(this,arguments)})},{key:"_performRefresh",value:(r=Fn(xn().m(function e(){var t,n,r,o,i;return xn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this._refreshToken){e.n=1;break}throw new Error("cannot refresh: no refresh token available");case 1:return t=new URLSearchParams({grant_type:"refresh_token",refresh_token:this._refreshToken,client_id:this._clientId}),e.p=2,e.n=3,this._http.post(this._tokenUrl,t.toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"},validateStatus:function(){return!0}});case 3:n=e.v,e.n=5;break;case 4:throw e.p=4,i=e.v,new Error("token refresh request failed: ".concat(i.message||"unknown error"));case 5:if(r=n.status,"invalid_grant"!==(o=n.data&&"object"===Un(n.data)?n.data:{}).error){e.n=6;break}throw this.clear(),new Error("token refresh rejected by the server (invalid_grant)");case 6:if(!(r<200||r>=300||o.error)){e.n=7;break}throw new Error("token refresh failed with status ".concat(r).concat(o.error?": ".concat(o.error):""));case 7:if("string"==typeof o.access_token&&o.access_token){e.n=8;break}throw new Error("token refresh response did not include an access_token");case 8:this._accessToken=o.access_token,"string"==typeof o.refresh_token&&o.refresh_token&&(this._refreshToken=o.refresh_token),this._setExpiry(o.expires_in);case 9:return e.a(2)}},e,this,[[2,4]])})),function(){return r.apply(this,arguments)})}],t&&In(e.prototype,t),n&&In(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,i,s}();function Mn(e){return Mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mn(e)}function zn(e){return function(e){if(Array.isArray(e))return Kn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wn(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||Wn(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wn(e,t){if(e){if("string"==typeof e)return Kn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kn(e,t):void 0}}function Kn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Gn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return $n(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):($n(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,$n(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,$n(f,"constructor",c),$n(c,"constructor",u),u.displayName="GeneratorFunction",$n(c,o,"GeneratorFunction"),$n(f),$n(f,o,"Generator"),$n(f,r,function(){return this}),$n(f,"toString",function(){return"[object Generator]"}),(Gn=function(){return{w:i,m:p}})()}function $n(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}$n=function(e,t,n,r){function i(t,n){$n(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},$n(e,t,n,r)}function Jn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Yn(r.key),r)}}function Yn(e){var t=function(e,t){if("object"!=Mn(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=Mn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Mn(t)?t:t+""}function Vn(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Qn(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){Vn(i,r,o,s,a,"next",e)}function a(e){Vn(i,r,o,s,a,"throw",e)}s(void 0)})}}var Zn=null;function er(){return tr.apply(this,arguments)}function tr(){return(tr=Qn(Gn().m(function e(){var t;return Gn().w(function(e){for(;;)switch(e.n){case 0:if(!Zn){e.n=1;break}return e.a(2,Zn);case 1:return e.n=2,import("node:crypto");case 2:return t=e.v,Zn=t.default&&t.default.createHmac?t.default:t,e.a(2,Zn)}},e)}))).apply(this,arguments)}var nr=new Set(["/appmesh/file/download","/appmesh/file/upload","/appmesh/file/delete"]),rr=/^\/appmesh\/app\/[^/]+\/(output|task)\/stream$/,or=Object.freeze({KEY_ID:"X-Request-Key",TIMESTAMP:"X-Timestamp",NONCE:"X-Nonce",SIGNATURE:"X-Signature"});function ir(e){if("string"!=typeof e)return!1;var t=sr(e);return nr.has(t)||rr.test(t)}function sr(e){return"/appmesh/file/download/ws"===e?"/appmesh/file/download":"/appmesh/file/upload/ws"===e?"/appmesh/file/upload":e}var ar=function(){return e=function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"!=typeof t||""===t.trim())throw new TypeError("keyId must be a non-empty string");if("string"!=typeof n||""===n)throw new TypeError("secret must be a non-empty string");Object.defineProperty(this,"_keyId",{value:t,writable:!0}),Object.defineProperty(this,"_secret",{value:n,writable:!0})},t=[{key:"keyId",get:function(){return this._keyId}},{key:"attach",value:(i=Qn(Gn().m(function e(t,n,r,o,i,s,a){var u,c,l,f,p,h,d,y,m;return Gn().w(function(e){for(;;)switch(e.n){case 0:if(u=s||String(Math.floor(Date.now()/1e3)),p=a){e.n=2;break}return e.n=1,this.randomNonce();case 1:p=e.v;case 2:return c=p,l=sr(r),h=ur,d=n,y=l,m=o,e.n=3,cr(l,i);case 3:return f=h(d,y,m,e.v,u,c),t[or.KEY_ID]=this._keyId,t[or.TIMESTAMP]=u,t[or.NONCE]=c,e.n=4,this.sign(f);case 4:t[or.SIGNATURE]=e.v;case 5:return e.a(2)}},e,this)})),function(e,t,n,r,o,s,a){return i.apply(this,arguments)})},{key:"randomNonce",value:(o=Qn(Gn().m(function e(){var t;return Gn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,er();case 1:return t=e.v,e.a(2,t.randomBytes(16).toString("hex"))}},e)})),function(){return o.apply(this,arguments)})},{key:"sign",value:(r=Qn(Gn().m(function e(t){var n;return Gn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,er();case 1:return n=e.v,e.a(2,n.createHmac("sha256",this._secret).update(t,"utf8").digest("hex"))}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"toString",value:function(){return"RequestSigner[keyId=".concat(this._keyId,"]")}}],t&&Jn(e.prototype,t),n&&Jn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,i}();function ur(e,t,n,r,o,i){if(!e||!t)throw new TypeError("method and path are required");return[e,t,n||"",r,o,i].join("\n")}function cr(e,t){return lr.apply(this,arguments)}function lr(){return(lr=Qn(Gn().m(function e(t,n){var r,o;return Gn().w(function(e){for(;;)switch(e.n){case 0:return r=null==n||ir(t)?Buffer.alloc(0):Buffer.from(n),e.n=1,er();case 1:return o=e.v,e.a(2,o.createHash("sha256").update(r).digest("hex"))}},e)}))).apply(this,arguments)}function fr(e){if(!e)return"";for(var t=Object.create(null),n=0;n<e.length;){var r=e.indexOf("&",n),o=r<0?e.slice(n):e.slice(n,r),i=o.indexOf("="),s=i<0?o:o.slice(0,i),a=i<0?"":o.slice(i+1),u=pr(s);if(Object.prototype.hasOwnProperty.call(t,u)||(t[u]=pr(a)),r<0)break;n=r+1}var c=Object.entries(t);return c.sort(function(e,t){var n=Buffer.compare(Buffer.from(e[0],"utf8"),Buffer.from(t[0],"utf8"));return 0!==n?n:Buffer.compare(Buffer.from(e[1],"utf8"),Buffer.from(t[1],"utf8"))}),c.map(function(e){var t=Xn(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(r)}).join("&")}function pr(e){if(!e.includes("%"))return e;for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(37===r){var o=e.charCodeAt(n+1),i=e.charCodeAt(n+2),s=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};if(!s(o)||!s(i))return e;t.push(parseInt(e.slice(n+1,n+3),16)),n+=2}else if(r<128)t.push(r);else{var a=Buffer.from(e[n],"utf8");t.push.apply(t,zn(a))}}return Buffer.from(t).toString("utf8")}function hr(e){return e?Object.entries(e).filter(function(e){var t=Xn(e,2)[1];return null!=t}).map(function(e){var t=Xn(e,2),n=t[0],r=t[1];return"".concat(encodeURIComponent(String(n)),"=").concat(encodeURIComponent(String(r)))}).join("&"):""}function dr(e){return dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dr(e)}function yr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return mr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function br(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return vr(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(vr(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,vr(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,vr(f,"constructor",c),vr(c,"constructor",u),u.displayName="GeneratorFunction",vr(c,o,"GeneratorFunction"),vr(f),vr(f,o,"Generator"),vr(f,r,function(){return this}),vr(f,"toString",function(){return"[object Generator]"}),(br=function(){return{w:i,m:p}})()}function vr(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}vr=function(e,t,n,r){function i(t,n){vr(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},vr(e,t,n,r)}function gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gr(Object(n),!0).forEach(function(t){_r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _r(e,t,n){return(t=Rr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Er(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Or(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){Er(i,r,o,s,a,"next",e)}function a(e){Er(i,r,o,s,a,"throw",e)}s(void 0)})}}function Sr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rr(r.key),r)}}function kr(e,t,n){return t&&Sr(e.prototype,t),n&&Sr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rr(e){var t=function(e,t){if("object"!=dr(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=dr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==dr(t)?t:t+""}function Tr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pr(e,t,n){return t=Ur(t),function(e,t){if(t&&("object"==dr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Cr()?Reflect.construct(t,n||[],Ur(e).constructor):t.apply(e,n))}function Ar(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nr(e,t)}function jr(e){var t="function"==typeof Map?new Map:void 0;return jr=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Cr())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Nr(o,n.prototype),o}(e,arguments,Ur(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Nr(n,e)},jr(e)}function Cr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Cr=function(){return!!e})()}function Nr(e,t){return Nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nr(e,t)}function Ur(e){return Ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ur(e)}function xr(e){return new Fr(e,0)}function Dr(e){return function(){return new Lr(e.apply(this,arguments))}}function Lr(e){var t,n;function r(t,n){try{var i=e[t](n),s=i.value,a=s instanceof Fr;Promise.resolve(a?s.v:s).then(function(n){if(a){var u="return"===t&&s.k?t:"next";if(!s.k||n.done)return r(u,n);n=e[u](n).value}o(!!i.done,n)},function(e){r("throw",e)})}catch(e){o(2,e)}}function o(e,o){2===e?t.reject(o):t.resolve({value:o,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(i,s){var a={key:e,arg:o,resolve:i,reject:s,next:null};n?n=n.next=a:(t=n=a,r(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}function Fr(e,t){this.v=e,this.k=t}function Ir(e){var t,n,r,o=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);o--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new Br(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Br(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return Br=function(e){this.s=e,this.n=e.next},Br.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return void 0===n?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.throw;return void 0===n?Promise.reject(e):t(n.apply(this.s,arguments))}},new Br(e)}Lr.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Lr.prototype.next=function(e){return this._invoke("next",e)},Lr.prototype.throw=function(e){return this._invoke("throw",e)},Lr.prototype.return=function(e){return this._invoke("return",e)};var qr=null,Hr=null,Mr=null,zr=Object.freeze({HTTP_USER_AGENT_HEADER_NAME:"User-Agent",HTTP_USER_AGENT:"appmesh/javascript",DEFAULT_RUN_APP_TIMEOUT_SECONDS:"P2D",DEFAULT_RUN_APP_LIFECYCLE_SECONDS:"P2DT12H",HTTP_HEADER_KEY_AUTH:"Authorization",HTTP_HEADER_KEY_X_TARGET_HOST:"X-Target-Host",HTTP_HEADER_KEY_X_FILE_PATH:"X-File-Path",HTTP_HEADER_KEY_X_FILE_OVERWRITE:"X-File-Overwrite",HTTP_HEADER_KEY_X_FILE_MODE:"X-File-Mode",HTTP_HEADER_KEY_X_FILE_USER:"X-File-User",HTTP_HEADER_KEY_X_FILE_GROUP:"X-File-Group",HTTP_HEADER_KEY_X_OUTPUT_POSITION:"X-Output-Position",HTTP_HEADER_KEY_X_EXIT_CODE:"X-Exit-Code",HTTP_HEADER_KEY_X_INPUT_CLOSE:"X-Input-Close",HTTP_HEADER_KEY_X_SUBSCRIPTION_ID:"X-Subscription-Id",HTTP_HEADER_KEY_X_APPMESH_PROCESS_KEY:"X-AppMesh-Process-Key"}),Xr=Object.freeze({isNode:!("undefined"!=typeof window&&"undefined"!==window.document)}),Wr=/^([a-z][a-z\d+\-.]*:)?\/\//i;function Kr(e,t){var n=String(e||""),r=String(t||""),o=r;if(n&&!Wr.test(r)){for(var i=n.length;i>0&&47===n.charCodeAt(i-1);)i--;o=r?n.slice(0,i)+"/"+r.replace(/^\/+/,""):n}try{return new URL(o).pathname}catch(e){try{return new URL(o,"http://localhost").pathname}catch(e){return r}}}var Gr=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return Tr(this,e),(n=Pr(this,e,[t])).name="AppMeshError",n.statusCode=r,n.responseData=o,n.errorCode=i,n.timestamp=(new Date).toISOString(),n}return Ar(e,jr(Error)),kr(e)}(),$r=function(){function e(t){var n;return Tr(this,e),(n=Pr(this,e,[t,null,null,"APP_REMOVED"])).name="AppRemovedError",n}return Ar(e,Gr),kr(e)}(),Jr=function(){function e(t){var n;return Tr(this,e),(n=Pr(this,e,[t,null,null,"TRANSPORT_DISCONNECTED"])).name="TransportDisconnectedError",n}return Ar(e,Gr),kr(e)}(),Yr=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Tr(this,e),(n=Pr(this,e,[t,r,null,"REQUEST"])).name="AppMeshRequestError",n}return Ar(e,Gr),kr(e)}(),Vr=function(){function e(t){var n;return Tr(this,e),(n=Pr(this,e,[t,null,null,"TIMEOUT"])).name="AppMeshTimeoutError",n}return Ar(e,Gr),kr(e)}(),Qr=function(e,t){Xr.isNode?process.stdout.write(e):console.log(e)};function Zr(e){if("number"==typeof e)return e;if("string"!=typeof e)throw new Error("Invalid input type. Expected number or ISO 8601 duration string.");if(/^\d+$/.test(e))return parseInt(e,10);if(!e.trim())throw new Error("Duration string cannot be empty");if(!e.startsWith("P"))throw new Error("Invalid ISO8601 duration: must start with P");var t="\\d+",n="".concat(t,"(?:[\\.,]").concat(t,")?"),r="(".concat(t,"Y)?(").concat(t,"M)?(").concat(t,"W)?(").concat(t,"D)?"),o="T(".concat(n,"H)?(").concat(n,"M)?(").concat(n,"S)?"),i="P(?:".concat(r,"(?:").concat(o,")?)"),s=["years","months","weeks","days","hours","minutes","seconds"],a=e.replace(/,/g,".").match(new RegExp(i));if(!a)throw new RangeError("invalid duration: "+e);var u=a.slice(1);if(0===u.filter(function(e){return null!=e}).length)throw new RangeError("invalid duration: "+e);if(u.filter(function(e){return/\./.test(e||"")}).length>1)throw new RangeError("only the smallest unit can be fractional");var c=u.reduce(function(e,t,n){return e[s[n]]=parseFloat(t||"0")||0,e},{}),l=0;return l+=31536e3*c.years,l+=2592e3*c.months,l+=604800*c.weeks,l+=86400*c.days,l+=3600*c.hours,l+=60*c.minutes,l+=c.seconds}function eo(e,t){if(e){var n=t.toLowerCase(),r=Object.keys(e).find(function(e){return e.toLowerCase()===n});return void 0===r?void 0:e[r]}}function to(e,t,n){if("string"!=typeof e||""===e)return e;if(!String(eo(t,"content-type")||"").toLowerCase().includes("json"))return e;try{return JSON.parse(e)}catch(t){throw new Gr("Response body is not valid JSON: ".concat(t.message),null!=n?n:null,e,"JSON_PARSE")}}function no(e){return ro.apply(this,arguments)}function ro(){return(ro=Or(br().m(function e(t){var r,o,i,s;return br().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=parseInt(t,10),isNaN(r)||String(r)!==t.trim()){e.n=1;break}return e.a(2,r);case 1:return e.p=1,e.n=2,n.e(994).then(()=>n.t(994,19));case 2:if(o=e.v,i=o.spawnSync,0===(s=i("id",["-u",t],{encoding:"utf8",timeout:3e3})).status&&s.stdout){e.n=3;break}return e.a(2,null);case 3:return e.a(2,parseInt(s.stdout.trim(),10));case 4:return e.p=4,e.v,e.a(2,null)}},e,null,[[1,4]])}))).apply(this,arguments)}function oo(e){return io.apply(this,arguments)}function io(){return(io=Or(br().m(function e(t){var n,r;return br().w(function(e){for(;;)switch(e.n){case 0:if(n=parseInt(t,10),isNaN(n)||String(n)!==t.trim()){e.n=1;break}return e.a(2,n);case 1:return e.n=2,so("name",t);case 2:return r=e.v,e.a(2,r?r.gid:null)}},e)}))).apply(this,arguments)}function so(e,t){return ao.apply(this,arguments)}function ao(){return(ao=Or(br().m(function e(t,r){var o,i,s,a,u,c,l,f,p,h,d;return br().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,n.e(994).then(()=>n.t(994,19));case 1:if(o=e.v,i=o.spawnSync,0!==(s=i("getent",["group",String(r)],{encoding:"utf8",timeout:3e3})).status||!s.stdout){e.n=2;break}return a=s.stdout.trim().split(":"),u=a.length>=3?parseInt(a[2],10):NaN,e.a(2,a[0]&&!isNaN(u)?{name:a[0],gid:u}:null);case 2:if(0===(c=i("dscacheutil",["-q","group","-a",t,String(r)],{encoding:"utf8",timeout:3e3})).status&&c.stdout){e.n=3;break}return e.a(2,null);case 3:if(l=c.stdout.split("\n"),f=l.find(function(e){return e.startsWith("name:")}),p=l.find(function(e){return e.startsWith("gid:")}),f&&p){e.n=4;break}return e.a(2,null);case 4:return h=f.slice(5).trim(),d=parseInt(p.slice(4).trim(),10),e.a(2,h&&!isNaN(d)?{name:h,gid:d}:null);case 5:return e.p=5,e.v,e.a(2,null)}},e,null,[[0,5]])}))).apply(this,arguments)}function uo(e){return co.apply(this,arguments)}function co(){return(co=Or(br().m(function e(t){var r,o,i,s;return br().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,n.e(994).then(()=>n.t(994,19));case 1:if(r=e.v,o=r.spawnSync,0===(i=o("id",["-un",String(t)],{encoding:"utf8",timeout:3e3})).status&&i.stdout){e.n=2;break}return e.a(2,null);case 2:return s=i.stdout.trim(),e.a(2,s||null);case 3:return e.p=3,e.v,e.a(2,null)}},e,null,[[0,3]])}))).apply(this,arguments)}function lo(e){return fo.apply(this,arguments)}function fo(){return(fo=Or(br().m(function e(t){var n;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,so("gid",t);case 1:return n=e.v,e.a(2,n?n.name:null)}},e)}))).apply(this,arguments)}var po="/opt/appmesh/ssl/ca.pem";function ho(e){return null==e||"string"==typeof e||"undefined"!=typeof Buffer&&Buffer.isBuffer(e)}function yo(e){if(!e)return null;var t="function"==typeof e.get?e.get(zr.HTTP_HEADER_KEY_AUTH):e[zr.HTTP_HEADER_KEY_AUTH]||e.authorization;return"string"==typeof t&&t.startsWith("Bearer ")?t.slice(7):null}function mo(e){return"string"!=typeof e||e.includes("-----BEGIN")?e:Hr.readFileSync(e)}function bo(e){if(!1===e)return{rejectUnauthorized:!1};if(!e)return Hr.existsSync(po)?{ca:Hr.readFileSync(po),rejectUnauthorized:!0}:{rejectUnauthorized:!0};for(var t=wr({},e),n=0,r=["ca","cert","key"];n<r.length;n++){var o=r[n];t[o]&&(t[o]=mo(t[o]))}return"boolean"!=typeof t.rejectUnauthorized&&(t.rejectUnauthorized=!0),t}var vo=kr(function e(t){var n,r,o,i,s,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Tr(this,e),this.reason=t,this.exitCode=null!==(n=a.exitCode)&&void 0!==n?n:null,this.position=null!==(r=a.position)&&void 0!==r?r:null,this.status=null!==(o=a.status)&&void 0!==o?o:null,this.message=null!==(i=a.message)&&void 0!==i?i:null,this.result=null!==(s=a.result)&&void 0!==s?s:null});function go(e){return wo.apply(this,arguments)}function wo(){return(wo=Dr(br().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p,h,d,y,m,b;return br().w(function(e){for(;;)switch(e.p=e.n){case 0:n=new TextDecoder("utf-8"),r="",o="message",i=[],s=!1,a=!1,e.p=1,c=Ir(t);case 2:return e.n=3,xr(c.next());case 3:if(!(s=!(l=e.v).done)){e.n=12;break}f=l.value,r+="string"==typeof f?f:n.decode(f,{stream:!0}),p=void 0;case 4:if(!((p=r.indexOf("\n"))>=0)){e.n=11;break}if(h=r.slice(0,p).replace(/\r$/,""),r=r.slice(p+1),""!==h){e.n=9;break}if(!("message"!==o||i.length>0)){e.n=8;break}if(d=i.join("\n"),y={},!d){e.n=7;break}e.p=5,y=JSON.parse(d),e.n=7;break;case 6:throw e.p=6,m=e.v,new Gr("malformed SSE frame (".concat(o,"): ").concat(m.message));case 7:return e.n=8,[o,y];case 8:o="message",i=[],e.n=10;break;case 9:h.startsWith(":")||(h.startsWith("event:")?o=h.slice(6).trim():h.startsWith("data:")&&i.push(h.slice(5).trimStart()));case 10:e.n=4;break;case 11:s=!1,e.n=2;break;case 12:e.n=14;break;case 13:e.p=13,b=e.v,a=!0,u=b;case 14:if(e.p=14,e.p=15,!s||null==c.return){e.n=16;break}return e.n=16,xr(c.return());case 16:if(e.p=16,!a){e.n=17;break}throw u;case 17:return e.f(16);case 18:return e.f(14);case 19:return e.a(2)}},e,null,[[15,,16,18],[5,6],[1,13,14,19]])}))).apply(this,arguments)}function _o(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new vo(String(null!==(t=e.reason)&&void 0!==t?t:"closed"),wr({exitCode:e.exit_code,position:e.position,status:e.status,message:e.message},n))}function Eo(e){var t;if("error"===e.reason)throw new Yr(e.message||"stream failed with an error",null!==(t=e.status)&&void 0!==t?t:null);if("timeout"===e.reason)throw new Vr(e.message||"stream timed out");if(!["exit","removed","eof","final","disconnected","closed"].includes(e.reason))throw new Gr("stream ended with unknown reason: ".concat(e.reason))}var Oo=function(){return kr(function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xr.isNode?"https://127.0.0.1:6060":window.location.origin,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Tr(this,e),this.baseURL=r,this.forwardingHost=null,this._requestSigner=null,this._tokenProvider=null,i&&this.setTokenProvider(i);var s={baseURL:r,timeout:3e5,validateStatus:function(e){return!0},transformResponse:[to]};this._sslConfig=o,this._client=kn.create(s),Xr.isNode&&!Mr&&(Mr=Promise.all([n.e(453).then(()=>n.t(453,19)),n.e(603).then(()=>n.t(603,19))]).then(function(e){var t=yr(e,2),n=t[0],r=t[1];qr=n.default||n,Hr=r.default||r}).catch(function(){})),this._client.interceptors.request.use(function(){var e=Or(br().m(function e(n){var r,o;return br().w(function(e){for(;;)switch(e.n){case 0:return r=wr,o=wr({},n.headers),e.n=1,t._commonHeaders();case 1:return n.headers=r(o,e.v),e.a(2,n)}},e)}));return function(t){return e.apply(this,arguments)}}(),function(e){var t=new Gr("Request configuration error: "+(e.message||"Unknown error"));return Promise.reject(t)}),this._client.interceptors.response.use(function(e){return t._handleUnauthorizedRetry(e)},function(e){var t,n,r,o;if(e instanceof Gr)return Promise.reject(e);var i=new Gr("Request failed: "+(e.message||"Unknown error"),null!==(t=null===(n=e.response)||void 0===n?void 0:n.status)&&void 0!==t?t:null,null!==(r=null===(o=e.response)||void 0===o?void 0:o.data)&&void 0!==r?r:null);return i.cause=e,Promise.reject(i)})},[{key:"setTokenProvider",value:function(e){if(!e||"function"!=typeof e.getAccessToken)throw new TypeError("tokenProvider must implement async getAccessToken()");this._tokenProvider=e}},{key:"setBearerToken",value:function(e){null!=e?this.setTokenProvider(new Nn(e)):this.clearBearerToken()}},{key:"setToken",value:function(e){this.setBearerToken(e)}},{key:"clearBearerToken",value:function(){var e=this._tokenProvider;e&&"function"==typeof e.clear&&e.clear(),this._tokenProvider=null}},{key:"enableRequestSignature",value:function(e,t){this._requestSigner=new ar(e,t)}},{key:"disableRequestSignature",value:function(){this._requestSigner=null}},{key:"isRequestSignatureEnabled",value:function(){return null!==this._requestSigner}},{key:"_applyRequestSignature",value:(K=Or(br().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p,h;return br().w(function(e){for(;;)switch(e.n){case 0:if((n=this._requestSigner)&&t){e.n=1;break}return e.a(2);case 1:return r=Kr(t.baseURL||this._client.defaults.baseURL||this.baseURL,t.url),o="",t.params&&"object"===dr(t.params)&&Object.keys(t.params).length>0&&(t.paramsSerializer=hr,o=fr(hr(t.params))),i=this._headerValue(t.headers,"content-type"),s=ir(r)?Buffer.alloc(0):this._wireBodyBytes(t.data,i),a=String(t.method||"get").toUpperCase(),u={},e.n=2,n.attach(u,a,r,o,s);case 2:for(c=0,l=Object.entries(u);c<l.length;c++)f=yr(l[c],2),p=f[0],h=f[1],t.headers&&"function"==typeof t.headers.set?t.headers.set(p,h):t.headers=wr(wr({},t.headers),{},_r({},p,h));case 3:return e.a(2)}},e,this)})),function(e){return K.apply(this,arguments)})},{key:"_headerValue",value:function(e,t){if(e){if("function"==typeof e.get)return e.get(t);var n=Object.keys(e).find(function(e){return e.toLowerCase()===t.toLowerCase()});return void 0===n?void 0:e[n]}}},{key:"_wireBodyBytes",value:function(e,t){if(null==e)return Buffer.alloc(0);if("string"==typeof e){if(String(t||"").toLowerCase().includes("application/json"))try{return JSON.parse(e),Buffer.from(e.trim(),"utf8")}catch(t){if("SyntaxError"!==t.name)throw t;return Buffer.from(JSON.stringify(e),"utf8")}return Buffer.from(e,"utf8")}if(Buffer.isBuffer(e)||e instanceof Uint8Array||e instanceof ArrayBuffer)return Buffer.from(e);if("object"===dr(e))return Buffer.from(JSON.stringify(e),"utf8");throw new Gr("cannot sign a streaming request body; only the /appmesh/file/* endpoints accept unbound bodies")}},{key:"_getAccessToken",value:(W=Or(br().m(function e(){var t;return br().w(function(e){for(;;)switch(e.n){case 0:if(!this._tokenProvider){e.n=2;break}return e.n=1,this._tokenProvider.getAccessToken();case 1:t=e.v,e.n=3;break;case 2:t=null;case 3:return e.a(2,t)}},e,this)})),function(){return W.apply(this,arguments)})},{key:"_handleUnauthorizedRetry",value:(X=Or(br().m(function e(t){var n,r,o,i,s,a,u,c,l,f;return br().w(function(e){for(;;)switch(e.n){case 0:if(r=t.config||{},o=this._tokenProvider,401===t.status&&!r.__appmeshRetried&&o){e.n=1;break}return e.a(2,t);case 1:if("function"!=typeof o.canRefresh){e.n=3;break}return e.n=2,o.canRefresh();case 2:l=e.v,e.n=4;break;case 3:l=!!o.canRefresh;case 4:if(l&&"function"==typeof o.refreshAccessToken&&ho(r.data)){e.n=5;break}return e.a(2,t);case 5:if(!this._requestSigner){e.n=6;break}if(i=t.headers||{},(s="function"==typeof i.get?i.get("WWW-Authenticate"):i["WWW-Authenticate"]||i["www-authenticate"])&&s.includes("invalid_token")){e.n=6;break}return e.a(2,t);case 6:if(null===(n=yo(r.headers))||void 0===n){e.n=7;break}f=n,e.n=9;break;case 7:return e.n=8,this._getAccessToken();case 8:f=e.v;case 9:return a=f,e.n=10,o.refreshAccessToken(a);case 10:if("string"==typeof(u=e.v)&&u.trim()){e.n=11;break}return e.a(2,t);case 11:if(r.__appmeshRetried=!0,c="Bearer ".concat(u.trim()),r.headers&&"function"==typeof r.headers.set?r.headers.set(zr.HTTP_HEADER_KEY_AUTH,c):r.headers=wr(wr({},r.headers),{},_r({},zr.HTTP_HEADER_KEY_AUTH,c)),!this._requestSigner){e.n=12;break}return e.n=12,this._applyRequestSignature(r);case 12:return e.a(2,this._client(r))}},e,this)})),function(e){return X.apply(this,arguments)})},{key:"getAuthConfig",value:(z=Or(br().m(function e(){return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/auth/config");case 1:return e.a(2,e.v.data)}},e,this)})),function(){return z.apply(this,arguments)})},{key:"getCurrentPrincipal",value:(M=Or(br().m(function e(){return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/principal/self");case 1:return e.a(2,e.v.data)}},e,this)})),function(){return M.apply(this,arguments)})},{key:"listApps",value:(H=Or(br().m(function e(){var t;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/applications");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return H.apply(this,arguments)})},{key:"getApp",value:(q=Or(br().m(function e(t){var n;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/app/".concat(t));case 1:return n=e.v,e.a(2,n.data)}},e,this)})),function(e){return q.apply(this,arguments)})},{key:"checkAppHealth",value:(B=Or(br().m(function e(t){var n;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/app/".concat(t,"/health"));case 1:return n=e.v,e.a(2,0===parseInt(n.data,10))}},e,this)})),function(e){return B.apply(this,arguments)})},{key:"addApp",value:(I=Or(br().m(function e(t,n){var r;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("put","/appmesh/app/".concat(t),n);case 1:return r=e.v,e.a(2,r.data)}},e,this)})),function(e,t){return I.apply(this,arguments)})},{key:"deleteApp",value:(F=Or(br().m(function e(t){var n,r;return br().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this._request("delete","/appmesh/app/".concat(t));case 1:return n=e.v,e.a(2,200===n.status);case 2:if(e.p=2,404!==(r=e.v).statusCode){e.n=3;break}return e.a(2,!1);case 3:throw r;case 4:return e.a(2)}},e,this,[[0,2]])})),function(e){return F.apply(this,arguments)})},{key:"enableApp",value:(L=Or(br().m(function e(t){return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/app/".concat(t,"/enable"));case 1:return e.a(2,!0)}},e,this)})),function(e){return L.apply(this,arguments)})},{key:"disableApp",value:(D=Or(br().m(function e(t){return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/app/".concat(t,"/disable"));case 1:return e.a(2,!0)}},e,this)})),function(e){return D.apply(this,arguments)})},{key:"getAppOutput",value:(x=Or(br().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p=arguments;return br().w(function(e){for(;;)switch(e.n){case 0:return n=p.length>2&&void 0!==p[2]?p[2]:0,r=p.length>3&&void 0!==p[3]?p[3]:10240,o=p.length>4&&void 0!==p[4]?p[4]:"",i=p.length>5&&void 0!==p[5]?p[5]:0,s={stdout_position:(p.length>1&&void 0!==p[1]?p[1]:0).toString(),stdout_index:n.toString(),stdout_maxsize:r.toString(),process_uuid:o,timeout:Zr(i).toString()},e.n=1,this._request("get","/appmesh/app/".concat(t,"/output"),null,{params:s});case 1:return a=e.v,u=eo(a.headers,zr.HTTP_HEADER_KEY_X_OUTPUT_POSITION),c=eo(a.headers,zr.HTTP_HEADER_KEY_X_EXIT_CODE),l=u?parseInt(u,10):null,f=c?parseInt(c,10):null,e.a(2,new So(a.status,a.data,l,f))}},e,this)})),function(e){return x.apply(this,arguments)})},{key:"runAppSync",value:(U=Or(br().m(function e(t){var n,r,o,i,s,a,u,c=arguments;return br().w(function(e){for(;;)switch(e.n){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:Qr,r=c.length>2&&void 0!==c[2]?c[2]:zr.DEFAULT_RUN_APP_TIMEOUT_SECONDS,o=c.length>3&&void 0!==c[3]?c[3]:zr.DEFAULT_RUN_APP_LIFECYCLE_SECONDS,i={timeout:Zr(r),lifecycle:Zr(o)},e.n=1,this._request("post","/appmesh/app/syncrun",t,{params:i});case 1:return s=e.v,a=null,n&&n(s.data,0),200===s.status&&(u=eo(s.headers,zr.HTTP_HEADER_KEY_X_EXIT_CODE))&&(a=parseInt(u,10)),e.a(2,a)}},e,this)})),function(e){return U.apply(this,arguments)})},{key:"runAppAsync",value:(N=Or(br().m(function e(t){var n,r,o,i,s=arguments;return br().w(function(e){for(;;)switch(e.n){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:zr.DEFAULT_RUN_APP_TIMEOUT_SECONDS,r=s.length>2&&void 0!==s[2]?s[2]:zr.DEFAULT_RUN_APP_LIFECYCLE_SECONDS,o={timeout:Zr(n),lifecycle:Zr(r)},e.n=1,this._request("post","/appmesh/app/run",t,{params:o});case 1:return i=e.v,e.a(2,new ko(this,i.data.name,i.data.process_uuid))}},e,this)})),function(e){return N.apply(this,arguments)})},{key:"waitForAsyncRun",value:(C=Or(br().m(function e(t){var n,r,o,i,s,a,u=arguments;return br().w(function(e){for(;;)switch(e.n){case 0:if(n=u.length>1&&void 0!==u[1]?u[1]:Qr,r=u.length>2&&void 0!==u[2]?u[2]:0,!t){e.n=7;break}o=0,i=new Date,s=1;case 1:if(!(t.procUid.length>0)){e.n=7;break}return e.n=2,this.getAppOutput(t.appName,o,0,20480,t.procUid,s);case 2:if((a=e.v).output&&n&&n(a.output,o),null!==a.outPosition&&(o=a.outPosition),null===a.exitCode){e.n=4;break}return e.n=3,this.deleteApp(t.appName);case 3:return e.a(2,a.exitCode);case 4:if(!(r>0&&(new Date-i)/1e3>r)){e.n=5;break}return e.a(3,7);case 5:return e.n=6,new Promise(function(e){return setTimeout(e,100)});case 6:e.n=1;break;case 7:return e.a(2,null)}},e,this)})),function(e){return C.apply(this,arguments)})},{key:"runTask",value:(j=Or(br().m(function e(t,n){var r,o,i=arguments;return br().w(function(e){for(;;)switch(e.n){case 0:return(r=i.length>2&&void 0!==i[2]?i[2]:300)<=0&&(r=300),e.n=1,this._request("post","/appmesh/app/".concat(t,"/task"),n,{params:{timeout:r.toString()}});case 1:return o=e.v,e.a(2,o.data)}},e,this)})),function(e,t){return j.apply(this,arguments)})},{key:"cancelTask",value:(A=Or(br().m(function e(t){return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/app/".concat(t,"/task"));case 1:return e.a(2,!0)}},e,this)})),function(e){return A.apply(this,arguments)})},{key:"followOutput",value:function(e){var t=this;return Dr(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return br().m(function r(){var o,i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E,O,S,k,R,T;return br().w(function(r){for(;;)switch(r.p=r.n){case 0:return o=n.stdoutPosition,i=void 0===o?0:o,s=n.processUuid,a=void 0===s?"":s,u=n.follow,c=void 0===u||u,l=n.timeout,f=void 0===l?3600:l,p={stdout_position:String(i),follow:c?"true":"false",timeout:String(f)},a&&(p.process_uuid=a),r.n=1,xr(t._sseRequest("get","/appmesh/app/".concat(e,"/output/stream"),{params:p}));case 1:h=r.v,d=null,r.p=2,y=!1,m=!1,r.p=3,v=Ir(go(h.data));case 4:return r.n=5,xr(v.next());case 5:if(!(y=!(g=r.v).done)){r.n=9;break}if(w=yr(g.value,2),_=w[0],E=w[1],"stdout"!==_){r.n=7;break}return r.n=6,String(null!==(O=E.output)&&void 0!==O?O:"");case 6:r.n=8;break;case 7:if("end"!==_){r.n=8;break}return d=_o(E),r.a(3,9);case 8:y=!1,r.n=4;break;case 9:r.n=11;break;case 10:r.p=10,R=r.v,m=!0,b=R;case 11:if(r.p=11,r.p=12,!y||null==v.return){r.n=13;break}return r.n=13,xr(v.return());case 13:if(r.p=13,!m){r.n=14;break}throw b;case 14:return r.f(13);case 15:return r.f(11);case 16:r.n=18;break;case 17:throw r.p=17,T=r.v,t.onError(T);case 18:return r.p=18,null===(S=h.data)||void 0===S||null===(k=S.destroy)||void 0===k||k.call(S),r.f(18);case 19:return null===d&&(d=new vo("closed")),Eo(d),r.a(2,d)}},r,null,[[12,,13,15],[3,10,11,16],[2,17,18,19]])})()}).apply(this,arguments)}},{key:"runTaskStream",value:function(e,t){var n=this;return Dr(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return br().m(function o(){var i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E,O,S;return br().w(function(o){for(;;)switch(o.p=o.n){case 0:return i=r.timeout,a=(s=void 0===i?300:i)&&s>0?{timeout:String(s)}:{},o.n=1,xr(n._sseRequest("post","/appmesh/app/".concat(e,"/task/stream"),{params:a,body:t}));case 1:u=o.v,c=null,l=null,o.p=2,f=!1,p=!1,o.p=3,d=Ir(go(u.data));case 4:return o.n=5,xr(d.next());case 5:if(!(f=!(y=o.v).done)){o.n=10;break}if(m=yr(y.value,2),b=m[0],v=m[1],"partial"!==b){o.n=7;break}return o.n=6,String(null!==(g=v.data)&&void 0!==g?g:"");case 6:o.n=9;break;case 7:if("final"!==b){o.n=8;break}l=null!==(w=v.result)&&void 0!==w?w:null,o.n=9;break;case 8:if("end"!==b){o.n=9;break}return c=_o(v,{result:l}),o.a(3,10);case 9:f=!1,o.n=4;break;case 10:o.n=12;break;case 11:o.p=11,O=o.v,p=!0,h=O;case 12:if(o.p=12,o.p=13,!f||null==d.return){o.n=14;break}return o.n=14,xr(d.return());case 14:if(o.p=14,!p){o.n=15;break}throw h;case 15:return o.f(14);case 16:return o.f(12);case 17:o.n=19;break;case 18:throw o.p=18,S=o.v,n.onError(S);case 19:return o.p=19,null===(_=u.data)||void 0===_||null===(E=_.destroy)||void 0===E||E.call(_),o.f(19);case 20:return null===c&&(c=new vo("closed",{result:l})),Eo(c),o.a(2,c)}},o,null,[[13,,14,16],[3,11,12,17],[2,18,19,20]])})()}).apply(this,arguments)}},{key:"streamRun",value:function(e){var t=this;return Dr(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zr.DEFAULT_RUN_APP_TIMEOUT_SECONDS,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:zr.DEFAULT_RUN_APP_LIFECYCLE_SECONDS;return br().m(function o(){var i,s,a,u,c;return br().w(function(o){for(;;)switch(o.p=o.n){case 0:return i="string"==typeof e?{command:e,shell:!0}:e,o.n=1,xr(t.runAppAsync(i,n,r));case 1:return s=o.v,o.p=2,u=t.followOutput(s.appName,{processUuid:s.procUid,follow:!0,timeout:Math.max(Zr(n),Zr(r))}),o.n=3,xr(u.next());case 3:c=o.v;case 4:if(c.done){o.n=7;break}return o.n=5,c.value;case 5:return o.n=6,xr(u.next());case 6:c=o.v,o.n=4;break;case 7:a=c.value;case 8:return o.p=8,o.p=9,o.n=10,xr(t.deleteApp(s.appName));case 10:o.n=12;break;case 11:o.p=11,o.v;case 12:return o.f(8);case 13:return o.a(2,a)}},o,null,[[9,11],[2,,8,13]])})()}).apply(this,arguments)}},{key:"sendInput",value:(P=Or(br().m(function e(t,n){var r,o,i,s,a,u,c,l,f,p,h=arguments;return br().w(function(e){for(;;)switch(e.n){case 0:return s=(i=h.length>2&&void 0!==h[2]?h[2]:{}).close,a=void 0!==s&&s,u=i.processUuid,c=void 0===u?"":u,l=a?_r({},zr.HTTP_HEADER_KEY_X_INPUT_CLOSE,"true"):{},f=c?{process_uuid:c}:{},e.n=1,this._request("post","/appmesh/app/".concat(t,"/input"),n,{headers:l,params:f});case 1:return p=e.v,e.a(2,parseInt(null!==(r=null===(o=p.data)||void 0===o?void 0:o.bytes_written)&&void 0!==r?r:0,10))}},e,this)})),function(e,t){return P.apply(this,arguments)})},{key:"downloadFile",value:(T=Or(br().m(function e(t){var r,o,i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E,O,S,k,R,T,P,A=arguments;return br().w(function(e){for(;;)switch(e.p=e.n){case 0:return a=A.length>2&&void 0!==A[2]&&A[2],(s=A.length>1&&void 0!==A[1]?A[1]:null)||(s=t.split(/[\\/]/).pop()),u=_r({},zr.HTTP_HEADER_KEY_X_FILE_PATH,encodeURIComponent(t)),e.n=1,this._request("get","/appmesh/file/download",null,{headers:u,config:{responseType:Xr.isNode?"stream":"arraybuffer"}});case 1:if(c=e.v,l=Xr.isNode?"":c.data,200!==c.status||null!==(r=c.headers)&&void 0!==r&&r["content-disposition"]||!String(null!==(o=null===(i=c.headers)||void 0===i?void 0:i["content-type"])&&void 0!==o?o:"").toLowerCase().includes("json")){e.n=2;break}throw Xr.isNode&&c.data.destroy(),new Gr("File download is not supported by this server surface: ".concat(t),c.status,l);case 2:if(200===c.status){e.n=3;break}throw new Gr("Failed to download file: ".concat(t),c.status,l);case 3:if(!Xr.isNode){e.n=20;break}return e.n=4,n.e(603).then(()=>n.t(603,19));case 4:return f=e.v,e.n=5,n.e(582).then(()=>n.t(582,19));case 5:return p=e.v,h=p.promisify,R=h,e.n=6,n.e(770).then(()=>n.t(770,19));case 6:return d=R(e.v.pipeline),y=f.promises,e.p=7,e.n=8,d(c.data,f.createWriteStream(s));case 8:if(!a||"win32"===process.platform){e.n=17;break}if(m=c.headers,e.p=9,!(b=m["x-file-mode"])){e.n=12;break}if(v=parseInt(b,10),!(Number.isInteger(v)&&v>=0&&v<=511)){e.n=11;break}return e.n=10,y.chmod(s,v);case 10:e.n=12;break;case 11:console.warn("Warning: Invalid x-file-mode value:",b);case 12:if(g=m["x-file-user"],w=m["x-file-group"],!g||!w){e.n=15;break}return e.n=13,no(g);case 13:return _=e.v,e.n=14,oo(w);case 14:if(E=e.v,null===_||null===E){e.n=15;break}return e.n=15,y.chown(s,_,E);case 15:e.n=17;break;case 16:e.p=16,T=e.v,console.warn("Warning: Unable to apply file attributes to",s,T.message);case 17:e.n=19;break;case 18:throw e.p=18,P=e.v,new Gr("Failed to write file to ".concat(s,": ").concat(P.message),c.status);case 19:e.n=21;break;case 20:O=new Blob([c.data]),S=window.URL.createObjectURL(O),(k=document.createElement("a")).style.display="none",k.href=S,k.download=s.split("/").pop(),document.body.appendChild(k),k.click(),window.URL.revokeObjectURL(S),document.body.removeChild(k);case 21:return e.a(2)}},e,this,[[9,16],[7,18]])})),function(e){return T.apply(this,arguments)})},{key:"uploadFile",value:(R=Or(br().m(function e(t){var r,o,i,s,a,u,c,l,f,p,h,d,y,m,b=arguments;return br().w(function(e){for(;;)switch(e.n){case 0:if(s=b.length>2&&void 0!==b[2]&&b[2],a=b.length>3&&void 0!==b[3]&&b[3],i=b.length>1&&void 0!==b[1]?b[1]:null){e.n=2;break}if(u="string"==typeof t?t:t&&t.name){e.n=1;break}throw new Gr("filePath is required when localFile is a Blob without a name");case 1:i=u.split(/[\\/]/).pop();case 2:if(c=_r({},zr.HTTP_HEADER_KEY_X_FILE_PATH,encodeURIComponent(i)),a&&(c[zr.HTTP_HEADER_KEY_X_FILE_OVERWRITE]="true"),!Xr.isNode){e.n=7;break}return e.n=3,n.e(603).then(()=>n.t(603,19));case 3:if(f=e.v,p=f.statSync(t),!s){e.n=6;break}return c["X-File-Mode"]=(511&p.mode).toString(),e.n=4,uo(p.uid);case 4:return h=e.v,e.n=5,lo(p.gid);case 5:d=e.v,c["X-File-User"]=h||String(p.uid),c["X-File-Group"]=d||String(p.gid);case 6:l=p.size<10485760?f.readFileSync(t):f.createReadStream(t),e.n=9;break;case 7:if(!(t instanceof File||t instanceof Blob)){e.n=8;break}l=t,e.n=9;break;case 8:throw new Gr("In browser, localFile must be File or Blob");case 9:return e.n=10,this._request("post","/appmesh/file/upload",l,{headers:c,config:{maxBodyLength:1/0,maxContentLength:1/0}});case 10:if(200===(y=e.v).status||201===y.status){e.n=11;break}throw new Gr("Failed to upload file: ".concat(i),y.status,y.data);case 11:if(m=String(null!==(r=null===(o=y.headers)||void 0===o?void 0:o["content-type"])&&void 0!==r?r:"").toLowerCase(),!(200===y.status&&m.includes("json")&&y.data&&"object"===dr(y.data)&&"message"in y.data)){e.n=12;break}throw new Gr("File upload is not supported by this server surface: ".concat(i),y.status,y.data);case 12:return e.a(2)}},e,this)})),function(e){return R.apply(this,arguments)})},{key:"getHostResources",value:(k=Or(br().m(function e(){var t;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/resources");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return k.apply(this,arguments)})},{key:"getConfig",value:(S=Or(br().m(function e(){var t;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/config");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return S.apply(this,arguments)})},{key:"setConfig",value:(O=Or(br().m(function e(t){var n;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/config",t);case 1:return n=e.v,e.a(2,n.data)}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"setLogLevel",value:(E=Or(br().m(function e(){var t,n,r=arguments;return br().w(function(e){for(;;)switch(e.n){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"DEBUG",e.n=1,this.setConfig({BaseConfig:{LogLevel:t}});case 1:return n=e.v,e.a(2,n.BaseConfig.LogLevel)}},e,this)})),function(){return E.apply(this,arguments)})},{key:"addLabel",value:(_=Or(br().m(function e(t,n){return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("put","/appmesh/label/".concat(t),null,{params:{value:n}});case 1:return e.a(2,!0)}},e,this)})),function(e,t){return _.apply(this,arguments)})},{key:"deleteLabel",value:(w=Or(br().m(function e(t){return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/label/".concat(t));case 1:return e.a(2,!0)}},e,this)})),function(e){return w.apply(this,arguments)})},{key:"listLabels",value:(g=Or(br().m(function e(){var t;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/labels");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return g.apply(this,arguments)})},{key:"listPrincipals",value:(v=Or(br().m(function e(){return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/principals");case 1:return e.a(2,e.v.data)}},e,this)})),function(){return v.apply(this,arguments)})},{key:"updatePrincipal",value:(b=Or(br().m(function e(t,n){return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/principal/".concat(encodeURIComponent(t)),n);case 1:return e.a(2,!0)}},e,this)})),function(e,t){return b.apply(this,arguments)})},{key:"deletePrincipal",value:(m=Or(br().m(function e(t){return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/principal/".concat(encodeURIComponent(t)));case 1:return e.a(2,!0)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"getCurrentUser",value:(y=Or(br().m(function e(){return br().w(function(e){for(;;)if(0===e.n)return e.a(2,this.getCurrentPrincipal())},e,this)})),function(){return y.apply(this,arguments)})},{key:"listPermissions",value:(d=Or(br().m(function e(){var t;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/permissions");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return d.apply(this,arguments)})},{key:"getPrincipalPermissions",value:(h=Or(br().m(function e(){var t;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/principal/self/permissions");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return h.apply(this,arguments)})},{key:"getUserPermissions",value:(p=Or(br().m(function e(){return br().w(function(e){for(;;)if(0===e.n)return e.a(2,this.getPrincipalPermissions())},e,this)})),function(){return p.apply(this,arguments)})},{key:"listRoles",value:(f=Or(br().m(function e(){var t;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/roles");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return f.apply(this,arguments)})},{key:"updateRole",value:(l=Or(br().m(function e(t,n){return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/role/".concat(t),n);case 1:return e.a(2,!0)}},e,this)})),function(e,t){return l.apply(this,arguments)})},{key:"deleteRole",value:(c=Or(br().m(function e(t){return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/role/".concat(t));case 1:return e.a(2,!0)}},e,this)})),function(e){return c.apply(this,arguments)})},{key:"getMetrics",value:(u=Or(br().m(function e(){var t;return br().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/metrics",null,{config:{responseType:"text"}});case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return u.apply(this,arguments)})},{key:"subscribe",value:(a=Or(br().m(function e(){return br().w(function(e){for(;;)switch(e.n){case 0:throw new Gr("subscribe requires the TCP client (AppMeshClientTCP, imported from 'appmesh/tcp'); the HTTP client does not support event subscriptions");case 1:return e.a(2)}},e)})),function(){return a.apply(this,arguments)})},{key:"unsubscribe",value:(s=Or(br().m(function e(){return br().w(function(e){for(;;)switch(e.n){case 0:throw new Gr("unsubscribe requires the TCP client (AppMeshClientTCP, imported from 'appmesh/tcp'); the HTTP client does not support event subscriptions");case 1:return e.a(2)}},e)})),function(){return s.apply(this,arguments)})},{key:"request",value:(i=Or(br().m(function e(t,n){var r,o,i=arguments;return br().w(function(e){for(;;)if(0===e.n)return r=i.length>2&&void 0!==i[2]?i[2]:null,o=i.length>3&&void 0!==i[3]?i[3]:{},e.a(2,this._request(t,n,r,o))},e,this)})),function(e,t){return i.apply(this,arguments)})},{key:"_commonHeaders",value:(o=Or(br().m(function e(){var t,n;return br().w(function(e){for(;;)switch(e.n){case 0:return t={},Xr.isNode&&(t[zr.HTTP_USER_AGENT_HEADER_NAME]=zr.HTTP_USER_AGENT),e.n=1,this._getAccessToken();case 1:return(n=e.v)&&(t[zr.HTTP_HEADER_KEY_AUTH]="Bearer ".concat(n)),this.forwardingHost&&(t[zr.HTTP_HEADER_KEY_X_TARGET_HOST]=this.forwardingHost),e.a(2,t)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"_request",value:(r=Or(br().m(function e(t,n){var r,o,i,s,a,u,c,l,f,p,h,d,y=arguments;return br().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=y.length>2&&void 0!==y[2]?y[2]:null,o=y.length>3&&void 0!==y[3]?y[3]:{},e.n=1,this._ensureHttpsAgent();case 1:if(i=o.headers,s=void 0===i?{}:i,a=o.params,u=void 0===a?{}:a,c=o.config,l=void 0===c?{}:c,e.p=2,f=wr(wr({method:t,url:n,withCredentials:!1},l),{},{headers:wr({},s),params:wr({},u)}),null!==r&&(f.data=r),!this._requestSigner){e.n=3;break}return e.n=3,this._applyRequestSignature(f);case 3:return e.n=4,this._client(f);case 4:if(!((p=e.v).status<200||p.status>=300)){e.n=5;break}throw h=this._extractErrorMessage(p.data),new Gr(h,p.status,p.data);case 5:return e.a(2,p);case 6:throw e.p=6,d=e.v,this.onError(d);case 7:return e.a(2)}},e,this,[[2,6]])})),function(e,t){return r.apply(this,arguments)})},{key:"_ensureHttpsAgent",value:(t=Or(br().m(function e(){return br().w(function(e){for(;;)switch(e.n){case 0:if(!Xr.isNode||!Mr||this._client.defaults.httpsAgent){e.n=2;break}return e.n=1,Mr;case 1:qr&&(this._client.defaults.httpsAgent=new qr.Agent(wr(wr({},bo(this._sslConfig)),{},{keepAlive:!0,keepAliveMsecs:3e3})));case 2:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"_sseRequest",value:(e=Or(br().m(function e(t,n){var r,o,i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E=arguments;return br().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=E.length>2&&void 0!==E[2]?E[2]:{},e.n=1,this._ensureHttpsAgent();case 1:if(o=r.params,i=void 0===o?{}:o,s=r.headers,a=void 0===s?{}:s,u=r.body,c={method:t,url:n,withCredentials:!1,responseType:"stream",timeout:0,headers:wr({},a),params:wr({},i)},null!=u&&(c.data=u),!this._requestSigner){e.n=2;break}return e.n=2,this._applyRequestSignature(c);case 2:return e.p=2,e.n=3,this._client(c);case 3:l=e.v,e.n=5;break;case 4:throw e.p=4,w=e.v,this.onError(w);case 5:if(200===l.status){e.n=21;break}f="",e.p=6,p=[],h=!1,d=!1,e.p=7,m=Ir(l.data);case 8:return e.n=9,m.next();case 9:if(!(h=!(b=e.v).done)){e.n=11;break}v=b.value,p.push(v);case 10:h=!1,e.n=8;break;case 11:e.n=13;break;case 12:e.p=12,_=e.v,d=!0,y=_;case 13:if(e.p=13,e.p=14,!h||null==m.return){e.n=15;break}return e.n=15,m.return();case 15:if(e.p=15,!d){e.n=16;break}throw y;case 16:return e.f(15);case 17:return e.f(13);case 18:f=Buffer.concat(p).toString("utf8"),e.n=20;break;case 19:e.p=19,e.v;case 20:throw g=f?this._extractErrorMessage(f):"SSE request failed with status ".concat(l.status),new Gr(g,l.status,f||null);case 21:return e.a(2,l)}},e,this,[[14,,15,17],[7,12,13,18],[6,19],[2,4]])})),function(t,n){return e.apply(this,arguments)})},{key:"_extractErrorMessage",value:function(e){if(!e)return"Unknown error";if(e instanceof ArrayBuffer)try{var t=new TextDecoder("utf-8").decode(e);try{var n=JSON.parse(t);return n.message||n.error||"Binary response error"}catch(e){return t}}catch(e){return"Binary response error (could not decode)"}if("string"==typeof e)try{var r=JSON.parse(e);return r.message||r.error||e}catch(t){return e}return"object"===dr(e)?e.message||e.error||JSON.stringify(e):String(e)}},{key:"onError",value:function(e){return e instanceof Gr?e:new Gr(e.message||"Unknown error")}}]);var e,t,r,o,i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E,O,S,k,R,T,P,A,j,C,N,U,x,D,L,F,I,B,q,H,M,z,X,W,K}(),So=kr(function e(t,n,r,o){Tr(this,e),this.statusCode=Number(t),this.output=String(n),this.outPosition=null!==r?Number(r):null,this.exitCode=null!==o?Number(o):null}),ko=function(){return kr(function e(t,n,r){Tr(this,e),this.appName=n,this.procUid=r,this._client=t,this._forwardingHost=t.forwardingHost},[{key:"withForwardingHost",value:(t=Or(br().m(function e(t){var n;return br().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=this._client.forwardingHost,this._client.forwardingHost=this._forwardingHost,e.p=1,e.n=2,t();case 2:return e.a(2,e.v);case 3:return e.p=3,this._client.forwardingHost=n,e.f(3);case 4:return e.a(2)}},e,this,[[1,,3,4]])})),function(e){return t.apply(this,arguments)})},{key:"wait",value:(e=Or(br().m(function e(){var t,n,r=this,o=arguments;return br().w(function(e){for(;;)if(0===e.n)return t=o.length>0&&void 0!==o[0]?o[0]:Qr,n=o.length>1&&void 0!==o[1]?o[1]:0,e.a(2,this.withForwardingHost(function(){return r._client.waitForAsyncRun(r,t,n)}))},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t}();const Ro=Oo;export{Oo as AppMeshClient,Gr as AppMeshError,Yr as AppMeshRequestError,Vr as AppMeshTimeoutError,So as AppOutput,$r as AppRemovedError,ko as AppRun,zr as CONSTANTS,po as DEFAULT_CA_FILE,Hn as RefreshTokenProvider,ar as RequestSigner,vo as SseEnd,Nn as StaticAccessTokenProvider,Jr as TransportDisconnectedError,oo as _resolveGid,lo as _resolveGroupName,no as _resolveUid,uo as _resolveUserName,Ro as default};
|